Repository navigation
Give the root's Chat and Planner reach into child documents - #482
Merged
Merged
Conversation
MaggieAppleton
enabled auto-merge (rebase)
October 11, 2026 12:13
MaggieAppleton
force-pushed
the
planner-children
branch
from
October 11, 2026 12:41
8f9ba52 to
1fd131c
Compare
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A child document's Chat is its root's. Startup now clears each child's stored transcript, workflow runs, conversation analysis and Planner summary under the writer lease, once and idempotently, keeping and logging any child whose decision records still cite a Chat message. No server path attaches a Conversation runtime to a child, greets it with Chat history, or accepts a Chat message, control frame, MCP invocation or comment instruction for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ldren Opening a child no longer backfills legacy Planner asks into conversation threads, which would have recreated a child Conversation and pinned the child against the startup cleanup. A child greet sends an empty Conversation snapshot, so a kept child's stored analysis is never served. The storage contract now covers diverged current and checkpoint sidecars, archived children and children without a checkpoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A child has no Chat, so a comment sent to Chopin inside one, and an invoke_planner call naming one, now run on the root's Chat with the child as focus. The root turn answers in the child's thread with reply_comment and its edit_child writes become the thread's result. Each route re-asks storage that the child still belongs to a live root in the same repository and refuses before saving anything when it does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A child comment or MCP instruction queued on the root's Chat released the root and child rooms when whatever turn was running settled, which could be before its own turn ran. The hold now ends with the instruction's own end, and at once when it folds into a waiting turn or is refused. Closing a Chat tells waiting instructions they were skipped. The root's open path is one helper that also refuses a root being archived. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Chat closed during a routed child comment turn never reports the turn's end, so the child room stayed held and its thread kept showing work. The turn's running promise now stands in for that report, and a closed Chat counts as working on nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A scripted CHILD-EDIT turn in the fake harness lists, reads and edits the focused child through the real host tools, and a comment turn on a child thread reads the child rather than the root. The new harness spec covers the root's Chat sending the open child as focus, the edit landing durably in the child only, the child socket serving and accepting no Chat, Send to Chopin on a child comment replying in the child thread, and transcript notices opening the right child and thread without the root editor claiming it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/design-contract/exceptions/dynamic-web.json: - apps/web/src/document-workspace-host.tsx (parent <RoomWorkspace> workspaceProps(...)): reviewed against origin/main. The document presentation now carries `onChildOpen: openChild`, and the nested presentation adds `childId` and `onChildOpen`. RoomWorkspace passes childId to Chat as its focus channel id and onChildOpen to Chat's onOpenChild; openChild resolves stored parentage, navigates and awaits sync. workspaceProps still returns no className or style. The exact case value, reason and source hash are renewed. scripts/design-contract/exceptions/dynamic-editor.json: - packages/editor/src/comment-layer.tsx (preview/surface className and style, hit style): the dynamic expressions are textually unchanged. The branch scopes OPEN_COMMENT requests to the store's channel and holds a request until its thread arrives; no class, style or paint value flows from that state. Source hash renewed. - packages/editor/src/resolved-layer.tsx (preview className and style): unchanged expressions; the only change passes threads.channel to openCommentThread. Source hash renewed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The initial JavaScript budget failed by 6 B gzip in the container build. DocumentRouteSwap, its route keying and ContentSwapLayer now load in a lazy document-route-view chunk; hosted.tsx fetches the workspace host in parallel, so the host arrives no later than before. The parent focus restore after a child closes now picks its DOM target inside the lazily loaded host, which passes it to the shell's focus state machine. Initial JavaScript drops by about 3 KB raw and 980 B gzip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/design-contract/exceptions/dynamic-web.json: - apps/web/src/document-workspace-host.tsx (parent and child <RoomWorkspace> workspaceProps(...)): reviewed. The only change in the owner passes parentFocusTarget, a DOM focus helper, to onParentRestored after a child closes. No className, style or paint value flows from it; the workspaceProps expressions are unchanged. Source hash renewed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaggieAppleton
force-pushed
the
planner-children
branch
from
October 11, 2026 13:10
1fd131c to
baba5bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
There is now one Chat per root document. Child documents no longer have their own Chat: the root's Chat applies to every child, and the Planner can read and edit children from it.
focus. The server checks the child belongs to the root, and the Planner's prompt names it.list_children,read_child,edit_childandanchor_child.edit_planandanchor_plan, including dialect validation and persistence before publication.invoke_planneron a child runs on the root's Chat in the same way, under the root's existing owner.As agreed (child chats were disposable), startup clears stored conversation data for child channels.
flowchart LR subgraph Root document Chat[Root Chat] -->|chat:send focus = child| Planner Planner -->|list_children / read_child| Children Planner -->|edit_child / anchor_child| ChildDoc[Child document] end ChildComment[Comment in child: Send to Chopin] -->|routed with focus| Chat MCP[invoke_planner on child] -->|routed with focus| Chat Planner -->|reply_comment| ChildThread[Child comment thread]Testing
children()and the child-conversation cleanup, as memory and Postgres contract tests (including a stale lease, diverged sidecars, archived children and children with no snapshot row)e2e/harness-children.e2e.ts, run with the fake Planner harness:edit_child, which lands in the child onlybun run types, unit tests (4195 in the touched packages) and the design-contract check pass on the rebased head.Initial bundle
To stay under the initial JS budget,
DocumentRouteSwapmoves out ofhosted.tsxinto a lazydocument-route-view.tsx. It shows the same "Opening document…" fallback and preloads the workspace host. The parent-focus helper moves into the lazy host. Initial gzip drops by about 1 KB locally.Design-contract review
Renewed after a data-flow review, with the maintainer's approval:
document-workspace-host.tsx: the presentation gains a channel id and callbacks, not styles.document-workspace-host.tsxagain: renewed after the focus helper moved in. No class or style changes.comment-layer.tsxandresolved-layer.tsx: the flagged expressions are unchanged, so only the hashes are new.Slice 6 of the nested-documents work.
🤖 Generated with Claude Code