Skip to content

feat(orchestrate): coordinator structure — fresh-context reviewer, blackboard, graph-drop, contract-first dispatch, size verdict (#152) - #153

Merged
choiyounggi merged 6 commits into
mainfrom
feat/i152-coordinator-structure
Aug 27, 2026
Merged

feat(orchestrate): coordinator structure — fresh-context reviewer, blackboard, graph-drop, contract-first dispatch, size verdict (#152)#153
choiyounggi merged 6 commits into
mainfrom
feat/i152-coordinator-structure

Conversation

@choiyounggi

Copy link
Copy Markdown
Owner

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:

Proposal Delivered
P1 — fresh-context integration reviewer New bundled agent agents/integration-reviewer.md (pinned model: fable, read-only, fixed VERDICT/FINDINGS contract). 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.
P2 — blackboard for facts, hub for decisions Append-only .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.
P3 — graph-drop.sh Symmetric shrink path to graph-add.sh: removes one UNDISPATCHED node, validates the RESULTING graph (dangling deps/split_of/consumes refused), byte-identical on rejection, exit 0/3/4/127.
P4 — contract-first dispatch Shared surfaces (output ∩ another task's consumes) get their interface stub committed to the integration branch BEFORE dispatch, via a temp integ worktree; producers implement the stub in place. Includes the producer-side ordering exception (plan → stub commit → worktree → launch) so the stub never precedes the plan that decides it. brief.md gains an optional stub attribute.
P5 — size verdict at plan phase wiki-plan output now REQUIRES a ## Size verdict; large triggers a pre-dispatch split branched on graph-drop.sh's own exit code (0 → independent pieces via graph-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

  • Full integration suite green: 834/834 bats on the merge tip, including 3 new spec suites (graph-drop.bats, orchestrate-fresh-reviewer.bats, orchestrate-dispatch-contracts.bats) — every structural assertion paired with a negative control.
  • 4 rework rounds during the run, each a real defect caught by the layered review (word-split false-allow in the consumes check, evidence misattribution, blackboard bootstrap gap, Write/Edit append race, split/drop paragraph ordering).
  • The P1 reviewer design was dogfooded inside this very run: the fresh-context whole-diff pass caught a cross-commit ordering defect invisible to every per-task review.
  • Orca prompt-set cksum pin updated intentionally (documented in-place in tests/send-prompt.bats).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ha52bAGBcnFZakC1SiKx9Y

choiyounggi and others added 6 commits August 27, 2026 14:56
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.
@choiyounggi
choiyounggi merged commit 8629df8 into main Aug 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant