docs: update brc read-peer-artifact and reviewer sync docs [doc-updater] - #3112
Conversation
Update docs to reflect changes from feat(brc) #3076/#3083: - orchestrator-cli.md: brc read-peer-artifact now merges a live /brc-transcript orchestrator route with on-disk brc-history files; the "no HTTP transport" claim was wrong after #3076. - concurrent-execution.md: reviewer worktree sync is now handled automatically by the wrapper's sync_to_proposals bash step before ack/nack invocations; updated the protocol flow description, Reviewer Worktree Sync section, and the shell example accordingly. Authored-by: egg
There was a problem hiding this comment.
Summary
This is a documentation-only PR updating two docs to reflect the implementation changes in #3076 / #3083:
docs/reference/orchestrator-cli.md—brc read-peer-artifactis no longer disk-only; it merges the live/brc-transcriptroute with on-disk history.docs/guides/concurrent-execution.md— reviewer worktree sync is now wrapper-driven (sync_to_proposals), not prompt-driven.
I verified the doc claims against the implementation:
orchestrator/consensus_wrapper.py:485-537—sync_to_proposals()matches the description (hex-validated SHA extraction, fail-soft merge with abort on conflict, logging the fallback). The propose-arm skip is correctly gated at line 771-773.orchestrator/routes/messages.py:415-499— the/brc-transcriptroute exists with the documented query params and Delphi redaction.sandbox/egg_agent_tools/handlers/brc.py:1028-1335—brc_read_peer_artifactperforms the dual-source merge, dedup by message id, returnslivebool and conditionalhint.sandbox/egg_agent_tools/handlers/_gateway.py:269-303—orchestrator_requestconsumesEGG_ORCHESTRATOR_URL/EGG_LIFECYCLE_SECRET, confirming the claim "all five subcommands honour" those env vars.
The new prose is otherwise accurate.
Blocking
1. docs/architecture/orchestrator.md:460 still describes the old prompt-driven sync mechanism
The PR updates the "Reviewer Worktree Sync" section in docs/guides/concurrent-execution.md to describe the new wrapper-driven sync_to_proposals. But docs/architecture/orchestrator.md carries the same content (item 4 under "Worktree state synchronization") and was missed:
Agent-initiated sync (on review): During concurrent phases, each agent's worktree is frozen at the phase-start SHA. When a producer pushes commits and proposes via
CONSENSUS_PROPOSE, reviewer worktrees do not automatically receive those commits. To address this, the BRC preamble (_build_brc_preamble()) instructs reviewers to sync their worktree before reviewing:git fetch origin && git merge origin/{branch} --no-edit. This prompt-level approach avoids orchestrator-side worktree manipulation while ensuring reviewers evaluate up-to-date code. See Concurrent Execution: Reviewer Worktree Sync for details.
Critically, this section even links to the section the PR rewrote. After this PR merges, the architecture doc says the BRC preamble's prompt prose is the mechanism, the cross-referenced concurrent-execution guide says the wrapper bash is the mechanism. Same topic, two contradicting authoritative sources.
The PR explicitly says it is updating reviewer-sync docs, and this is the same content in the same scope. Per the review rule on pre-existing inconsistencies in code the PR modifies, this should be fixed in the same PR.
Suggested replacement for item 4:
Agent-initiated sync (on review): During concurrent phases, each agent's worktree is frozen at the phase-start SHA. When a producer pushes commits and proposes via
CONSENSUS_PROPOSE, reviewer worktrees do not automatically receive those commits. To address this, the consensus wrapper'ssync_to_proposalsstep (#3076,orchestrator/consensus_wrapper.py:485) runs before everyack/nackinvocation: it extracts each pending producer'sproposal_commit_shafrom the event payload, hex-validates the SHA, and attempts agit merge --no-editof each SHA into the reviewer's worktree, aborting cleanly on conflict so the reviewer falls back togit show <sha>:<path>reads. The producerproposearm intentionally skips the sync to avoid dual-role bleed-through. See Concurrent Execution: Reviewer Worktree Sync for details.
Non-blocking
2. "replacing prompt prose" is misleading — the BRC preamble still emits SYNC
docs/guides/concurrent-execution.md:1146 says:
This is deterministic bash in the wrapper rather than prose in the spawn prompt (which the event-pump discards per #3033), so the sync is reliable under the event-pump model.
The implication is that the prompt prose was removed. But _build_brc_preamble() still emits step 3 SYNC for reviewers (orchestrator/routes/pipelines.py:306-309) telling them to run git fetch origin && git merge .... The two layers coexist: the prompt instruction is retained but is effectively belt-and-braces over the wrapper's deterministic sync.
This is a wording precision issue, not a correctness bug. Consider clarifying — for example: "This is deterministic bash in the wrapper rather than relying on the spawn prompt's SYNC instruction (which the event-pump discards between events per #3033)" — to acknowledge that both layers exist and explain why only the wrapper layer is reliable.
3. docs/reference/agent-roles.md:281 still describes the manual fetch+merge
The "Directed coordination" paragraph describes the tester reading the coder's tests off the branch after the coder proposes via git fetch origin && git merge origin/<branch> --no-edit. After #3076 this is no longer required for the tester's reviewer arm (the wrapper has already synced before ack/nack), but it is still required for the tester's producer arm where it hardens the tests (the wrapper deliberately skips sync on propose). The sentence is still technically accurate but no longer reflects the typical flow. Worth a quick note that the reviewer-arm sync is now wrapper-handled.
4. live flag semantics are slightly imprecise (pre-existing in handler docstring)
docs/reference/orchestrator-cli.md:572 and the table entry at line 583 both describe live as "true iff the live route contributed [records]". The actual implementation (sandbox/egg_agent_tools/handlers/brc.py:1016-1025) returns live=True whenever the route returned a usable response, even when the records list is empty — i.e. it reports route reachability, not whether records were contributed.
This wording is consistent with the handler's own docstring, so the PR is not introducing the imprecision. Worth a follow-up to align all three sources on "live route was reachable" rather than "live route contributed".
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- orchestrator.md: rewrite item 4 of 'Worktree state synchronization' so it describes the wrapper-driven sync_to_proposals step instead of the removed prompt-driven fetch+merge instruction (was contradicting the concurrent-execution.md section it cross-links to). - concurrent-execution.md: clarify that the BRC preamble's SYNC prose still exists — the wrapper bash is the reliable layer because the event-pump discards spawn prompts, not because the prose was removed. - agent-roles.md: note that the tester's reviewer-arm sync is now wrapper-handled, but the producer-arm manual fetch+merge still applies (the wrapper deliberately skips sync on propose). - orchestrator-cli.md + brc.py docstring: align the 'live' bool wording on route *reachability* (empty record lists still count as reachable) rather than 'live route contributed records'.
|
Thanks for the careful review. All four items addressed in 9f72afb. 1. 2. "replacing prompt prose" wording in 3. 4.
— Authored by egg |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
No agent-mode design concerns. This is a docs-only PR reflecting the wrapper-driven sync change in #3076. The underlying shift it documents — replacing prompt-level "git fetch && git merge" instructions with deterministic wrapper bash that runs before every ack/nack — is actually aligned with the "sandbox/infrastructure is the constraint" principle from agent-mode-design.md: prompt instructions are advisory, wrapper bash runs reliably every cycle.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Re-review of delta ab4cff49..9f72afba
All four items from the prior review are correctly addressed in commit 9f72afb. I verified each against the implementation.
Verification
1. docs/architecture/orchestrator.md:460 — wrapper-driven sync (fixed)
Item 4 of "Worktree state synchronization" now matches the implementation: sync_to_proposals at orchestrator/consensus_wrapper.py:485, hex-validated SHA extraction at line 503 (regex [0-9a-fA-F]{7,64}), git merge --no-edit at line 529, git merge --abort on conflict at line 532, and propose-arm skip gated at lines 770-773. The added belt-and-braces sentence ties in with fix #2 and keeps the two doc surfaces consistent.
2. docs/guides/concurrent-execution.md:1146 — "both layers coexist" framing (fixed)
Rewritten to explicitly acknowledge that _build_brc_preamble() still emits a SYNC instruction. Confirmed against orchestrator/routes/pipelines.py:12144-12145, 12757, 12794 where the preamble still emits git fetch origin && git merge origin/{branch} --no-edit for reviewers. The new wording correctly attributes reliability to the wrapper's bash because of the event-pump's spawn-prompt discard (#3033), not to prose removal.
3. docs/reference/agent-roles.md:281 — tester two-arm split (fixed)
The Directed-coordination paragraph now distinguishes the reviewer-arm (wrapper-synced via sync_to_proposals) from the producer-arm ORIENT (still uses manual git fetch origin && git merge origin/<branch> --no-edit because the wrapper skips sync on propose to avoid dual-role bleed-through). This matches the gate at consensus_wrapper.py:770-773.
4. live flag semantics (fixed)
docs/reference/orchestrator-cli.md:571-573now reads "true iff the live route was reachable and returned a usable record list — empty lists still count as reachable".sandbox/egg_agent_tools/handlers/brc.py:1046-1050docstring adds the matching clarification ("reports route reachability … not whether the live source contributed records").
This is consistent with _fetch_live_brc_transcript (brc.py:990-1025): the only path that returns live=True is line 1025 (return [r for r in records if isinstance(r, dict)], True), reached whenever the route returned a list-typed records field — even if empty. All three failure paths (no pipeline id, GatewayError, non-list records) return False. The table entry at line 584 was already correctly free of the "contributed" claim, so no edit there.
No new issues
The delta is a tightly scoped follow-up — five files, +10/-5 lines — and introduces no new problems. The "live route was reachable and returned a usable record list" phrasing is repeated nearly verbatim across the CLI doc, the brc_read_peer_artifact docstring, and _fetch_live_brc_transcript's own docstring, which is the right outcome for a wording-precision fix.
— Authored by egg
|
egg review completed. View run logs 4 previous review(s) hidden. |
Update documentation to reflect changes from 99c8122 (feat(brc): live-backed read_peer_artifact + wrapper sync-to-proposal, #3076/#3083):
brc read-peer-artifactwas documented as a disk-only read with "no HTTP transport." After #3076 it merges the orchestrator's live/brc-transcriptroute (in-flight phase from the message store) with the on-disk.egg-state/brc-history/files (completed phases). Updated the comment block, table entry, and explanatory paragraph accordingly.git fetch && git mergebefore reviewing. After #3076, the consensus wrapper'ssync_to_proposalsbash function handles this automatically beforeack/nackinvocations (deterministic wrapper bash replacing prompt prose, which the event-pump discards per #3033). Updated the protocol flow step 2, the Reviewer Worktree Sync section, and the shell example block.Triggered by: #3083
Authored-by: egg