feat(tree): server-owned child role, slot wrapper and summary verdicts #246
No reviewers
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!246
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/243"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #243
What
One rule, one owner.
internal/elemops/roles.go(RootRole,ChildRole,WalkRoles,Verdicts) decides each shortcode node's role:slot,element,itemortext.slotis a wrapper, an inline-group chip is text, and anything else is an element.IsItem(parent, child)→ item. The parent'sitems.elementdecides; the child'shiddenflag is never read.Slot treatments, pinned by tests in every reader. A nameless top-level slot, a self-closing slot and a nested slot are all ordinary elements without a sidecar. They get a uid, show as a card, are listed by the link picker, are counted by pending and are translated elements.
harness checkreports each as an error.Payload. Every page tree the server sends carries
roleandsummary(elemops.ElementSummary) on every shortcode node. That covers GET/api/page, every mutation, translate and undo/discard answer, and the layout's inherited-slot children. It is built bycontent.AnnotatedDocument/AnnotatedNodes, which share one encoder with the plainMarshalJSON, through a single server helperpageTree.Server readers.
pending.go:isFoldedElementis gone.linktargets.go: rows come fromWalkRoles.itemAt: uses the role function.elemops.IsSlotShortcode.holdsElement,walkElements,MissingUIDs,Hash,markTranslatedandStampSourceall use the role.StampUIDsskips exactly role-slotnodes.Client.
isHiddenNode,isInlineGroupNode,isCardNode,isSlotWrapper,SLOT_WRAPPER_NAME,elementSummaryandplainTextare gone. Walkers readnode.role.stepTarget) now skips item rows, with a regression test.Loader. An element named by an owner's
items.elementmust declarehidden: true, andhidden: truerequires such an owner. A violation is a sidecar load error, shown byharness checkand in the editor's schema-error list.Docs.
scaffold/site/AGENTS.mdupdates the sidecarhiddenline, "Item collections", "Insertability", a new "Slot wrappers" bullet in "Editing content by hand", and the Translations element-position list. Theadd-elementandedit-contentskills point at those sections.Behaviour changes worth noting
These follow from the single rule:
hiddenelement placed outside its owner is now a visible card, and can be deleted.summarykey, then text params, then image basename). The old "body text first" card line is dropped.Verification
make test: vitest passes 116 files and 2860 tests, andgo test ./...passes.go vet ./...andgofmtare clean.harness checkpasses.hidden: truesidecar with no owner fails with a load error.{{< slot />}}to a page fails with a content error.🤖 Generated with Claude Code
[autoland] verdict: pass
Validated — CONCERNS (non-blocking). Approved, NOT merged: CI never ran.
Concern — CI has not vouched.
ci / build-and-testsat at "Waiting to run" through two fulllabctl pr checks --waitcycles. That happened on the original headba8bdb7(run 242) and on the merge head0b9efbd(run 243). It looks like no runner is picking jobs up. The validation core never lands on pending. Merge once run 243 (or a re-run) goes green.Merge resolution (pushed as
0b9efbd).mainhad moved on with #242 (the preview is just the site). That PR deletedweb/src/test/Bridge.test.tsxandweb/src/test/bridge.test.ts. This branch had only added therole/summaryfixture fields to those two files. They testbridge.ts, which #242 removed, so the deletion was kept. Every other file merged cleanly.Signal relied on: my own checks on the merged tree (
0b9efbd).tsc --noEmitis clean andvite buildsucceeds.go vet ./...andgofmt -lare clean, andgo test ./...passes (all 32 packages ok).harness checkreports "ok: no problems found".Conventions.
Closes #243is present.hiddenline, "Slot wrappers", the Translations element positions) and theadd-elementandedit-contentskills are updated, and the drift tests are green.elemops.ChildRole/RootRole/WalkRoles), the slot wrapper and the summary;pageTree;isHiddenNode,isInlineGroupNode,isCardNode,isSlotWrapper,SLOT_WRAPPER_NAME,elementSummary) are removed;stepTargetregression test.elemopsmatches the nameslot. The remainingschema.Hidden/GroupInlinereads (element.go,element_transfer.go,forms.go) are insert, duplicate and inline-form refusals, not role decisions.Note for the record, not blocking: the loader still accepts
container: truetogether withitems. Under the newChildRole, such an owner's non-item children becometext(body region), where before they were elements. No shipped element combines the two keys, which is consistent with #239's split.