feat(orchestrate): coordinator structure — fresh-context reviewer, blackboard, graph-drop, contract-first dispatch, size verdict (#152) - #153
Merged
Conversation
Adds graph-drop.sh to remove one undispatched task node from graph.json, validating the resulting graph and leaving it byte-identical on reject — symmetric to graph-add.sh's grow path. A node is refused if it already has a status file (dispatched), or if another task still names it in deps, split_of, or consumes one of its outputs. Includes a 14-case bats suite and a SKILL.md doc block documenting the drop conditions, exit contract (0/3/4), and the report-immediately duty.
…end-only blackboard (#152 P1+P2) Adds a bundled integration-reviewer agent (fresh context, pinned model: fable) so Phase 5's integration review runs off the coordinator's own degraded peak context: the coordinator now consumes only VERDICT+FINDINGS, never reading the full integration diff again until Gate 2. Adds the append-only blackboard protocol (.orchestration/notes/decisions.md) for cross-task facts, read at two worker checkpoints and appended by workers/coordinator via an O_APPEND-atomic printf primitive (never Write/Edit, which can drop a concurrent worker's line under read-modify-write). Guarded by tests/orchestrate-fresh-reviewer.bats (24 cases, each structural assertion paired with a negative control). Bumps the byte-identity cksum pin in tests/send-prompt.bats for the session-prompt.md Orca span touched by the blackboard checkpoints. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RxAdc7Yy4hWFmAKWmo6b9H
…152 P4+P5) Documents the final two structural pieces of issue #152: shared-surface interface stubs committed to the integration branch before a producer is dispatched (Phase 2 marking + Phase 3 step 0 mechanism + brief.md `stub` attribute), and a required wiki-plan Size verdict that drives a pre-dispatch split via graph-drop.sh/graph-add.sh instead of only overlap-splitting mid-run. Also bounds the known re-plan-loop amplifier to 2 scoped patches -> 1 full re-plan -> user escalation. Guarded by a new bats suite (20 cases, 10 negative controls), verified against the existing token-budget/session-prompt/ fresh-reviewer regression suites. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfsauaJo91RKERwH4x2fNt
…N2 cleanup Integration review (r1) found the Contract-first dispatch paragraph quoted a plan signature that step 2a had not written yet at that point in the per-task step sequence (step 0 runs before step 2a). Adds an explicit ordering exception: a shared-surface producer runs step 2a (plan-only, no launch) first, then commits the stub, then step 1 (worktree) + step 2 (brief) and launch — so the stub never precedes the plan that decides it, and the producer's worktree never precedes the stub commit. Guarded by a new positive/negative bats pair. Also takes N1 (reorder the mid-run drop block after its section's closing sentence) and N2 (comment-syntax parenthetical on the stub marker) while already touching this paragraph. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfsauaJo91RKERwH4x2fNt
…identifying arcs The "Dropping a task mid-run" paragraph had been inserted before the pre-existing split section's own closing sentence, orphaning it behind drop's paragraph and reading as two near-duplicate "report immediately" sentences. Move drop's paragraph after split's closing sentence so each flow keeps its own intact lead-in -> mechanics -> closing arc, and tag both closing sentences self-identifying: "just grew (split)" / "just shrank (drop)". Adds two order assertions plus a negative control (awk paragraph-swap reproducing the pre-fix ordering) to tests/graph-drop.bats, following the repo's established negative-control pattern.
# Conflicts: # skills/orchestrate/SKILL.md
Merged
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.
Closes #152
What
Implements all five ranked proposals from #152 — the coordinator's triple-duty (router/reviewer/memory) decomposition — as three serialized tasks on one integration branch:
agents/integration-reviewer.md(pinnedmodel: fable, read-only, fixedVERDICT/FINDINGScontract). Phase 5's integration review now runs on the agent's own fresh context; the coordinator ingests verdict + findings only, and Gate 2's diff read becomes the run's LAST full-diff read..orchestration/notes/decisions.md. Workers read it at two fixed checkpoints (implement start, pre-self-review) and append interface changes with the O_APPEND shell primitive (printf … >>) — Write/Edit appends are explicitly forbidden (concurrent-writer race). Coordinator appends one line per merge-on-approval. Decisions stay on the existing hub paths.graph-drop.shgraph-add.sh: removes one UNDISPATCHED node, validates the RESULTING graph (danglingdeps/split_of/consumesrefused), byte-identical on rejection, exit 0/3/4/127.brief.mdgains an optionalstubattribute.## Size verdict;largetriggers a pre-dispatch split branched ongraph-drop.sh's own exit code (0 → independent pieces viagraph-add.sh, real parallelism; 3 → overlap-split fallback). The re-plan amplifier is bounded: 2 scoped patches → 1 full re-plan → user escalation, never a round 4.Verification
graph-drop.bats,orchestrate-fresh-reviewer.bats,orchestrate-dispatch-contracts.bats) — every structural assertion paired with a negative control.tests/send-prompt.bats).🤖 Generated with Claude Code
https://claude.ai/code/session_01Ha52bAGBcnFZakC1SiKx9Y