Repository navigation
feat(coordinate): compact in place and hand over only when a session can't continue - #2326
Merged
Merged
Conversation
…ker briefs render-brief.sh writes the section from the compaction-default-dispatch design word for word into every brief whose entry point isn't coordinate, after Workspace rules (or Reporting) and before Keep-alive. No input field removes or changes it, and it carries no session id. A coordinate brief gets none. The goldens double as brief-intake fixtures, so the kept-sentence counts, brief-kept.json and the intake cases fed by min.txt move with them. brief-template.md's illustrative block gains the heading, and its profile paragraph says where each role's window comes from.
… cant_continue route A coordinator compacts in place and hands over only when thrash-check.sh prints cant_continue or for one of the design's other reasons. The full rule is a new "Handing over" section in references/loop.md: when to run the check, the reasons, both ways to start a successor, the message to held workers, and the route for a worker that reports cant_continue (redispatch at once, its read_first naming the stopped worker's handoff brief). The Roles list in SKILL.md and the wait state each carry a pointer that states the default, since both are held to byte budgets. The failure state says how to redispatch such a unit. The design records the placement. dispatch-worker.sh's two "no profile" comments now say niwa then applies the workspace's default_dispatch_profile.
…ult worker profile references/handoff-brief.md gives every role the same 280K window and 350K hard stop, records the measured cut point (about 88% to 90% of the window), says a context-size figure taken on the turn of a compaction can be the pre-cut one, and has the Workers paragraph cite the compaction-default-dispatch design: workers take the window from the workspace's default_dispatch_profile. PLAN-handoff-brief.md's step 7 and step 8 amendments cite the same design: coordinators take the window from the named coordinator profile, never from the default, a failing session sends back only itself, and the coordinator identity read is recorded.
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.
Phase 2 of
docs/designs/DESIGN-compaction-default-dispatch.md: shirabe's handover rule. Sessions compact in place, and none hands over at a context size below its hard stop. Every worker brief now carries a fixed "Context and handover" section that says when the worker hands over and how. A coordinator gets the matching rule from the coordinate skill itself. When a worker reportscant_continue, its coordinator sends the unit straight to a redispatch that starts from the stopped worker's handoff brief.This changes nothing about what a session launches with. The window still comes from the dispatch profile, and the section's
window: unsetbranch covers a worker launched before the workspace default exists.The worker section.
render-brief.shwrites the design's section text word for word into every brief whose entry point isn'tcoordinate, after Workspace rules (or Reporting, when there are none) and before Keep-alive. No input field removes or changes it, and it carries no session id. A coordinate brief, a lane's or a successor's, gets no such heading. The section puts its four command lines in ashfence, so the brief renders them as code.render-brief_test.shchecks the section word for word in the base, min and leg briefs, where it sits, that it appears once, that it holds no UUID-shaped token, that a size line in the standing rules leaves it unchanged, and that both coordinate briefs lack it. The section order assertion now includes the heading, and the three goldens are regenerated.The template-heading check. The check that keeps
brief-template.md's headings in step with the rendered ones now compares the rendered headings minus Workspace rules and Keep-alive, instead of the first seven. Its illustrative block gains the new heading, so the template file lands in the same commit as the renderer.Fixture counts. The goldens double as brief-intake fixtures, so the counts derived from them move. The counts in this list are all confirmed by the suites:
brief-kept.jsongains the section's 10 sentences in each list.The intake's excluded-section list doesn't change.
Where the coordinator rule lives. The design names the Roles list in
SKILL.mdand thewaitstate's "Handing over" paragraph. Both are held to byte budgets: the skill entry, and the hub state shown at every arrival. Neither has room for the whole rule, so the full rule is a new "Handing over" section inskills/coordinate/references/loop.md. That section covers:dispatch-worker.sh --successor, or by hand withniwa dispatch --profile coordinator);cant_continueroute.SKILL.mdandwaiteach carry a pointer that states the default in its own words: compact in place, hand over only as the rule says.SKILL.mdmeasures 8217 of its 8218 bytes andwait10794 of its 10802. The design records the placement in one added line.The
cant_continueroute. It's prose only, through the existingredispatchevent fromwaittofailure. There's no new event, edge or compatibility change. Thefailurestate says the redispatch input'sread_firstnameshandoff-brief.sh read --session <the worker's koto session>.The rest.
dispatch-worker.shchanges comments only: the two that say a worker asks for no profile now add that niwa then applies the workspace'sdefault_dispatch_profile.brief-template.md's profile paragraph says where each role's window comes from, and that a brief states no context size.references/handoff-brief.mdgives every role one window and stop (280K and 350K), and records the measured cut point. It corrects the reader's first-read wording: a figure taken on the turn of a cut can be the pre-cut one. Its Workers paragraph now cites the design.PLAN-handoff-brief.md's step 7 and step 8 amendments cite the design. A failing coordinator now sends only itself back to handing over.