Repository navigation
docs: update agent-recovery for BRC restart invariants [doc-updater] - #3267
Conversation
There was a problem hiding this comment.
Comment — docs-only, technically accurate, one cross-reference fix.
I verified every substantive claim in this diff against the implementation on main. The documentation is accurate:
- Agent-level restart, step 4 — "The Redis message store (
pipeline:{id}:messages) is NOT cleared" matches the explicit invariant atorchestrator/routes/pipelines.py:3161-3173and thetracker.remove_agent(agent_role)call at line 3184 (noget_message_store().clear()on this path). ✅ _clear_concurrent_stateclears the store at phase transitions — confirmed atorchestrator/routes/phases.py:120(get_message_store().clear(pipeline_id)). ✅- Cleared at pipeline create/delete — confirmed in
_clear_pipeline_runtime_stateatorchestrator/routes/pipelines.py:2189. ✅ - Phase-level restart, step 1 —
_persist_phase_brc_historyruns before the container teardown (line 3564, ahead of the "Stop and remove old containers" loop at line 3573), is wrapped best-effort (logs + continues), and calls_write_brc_history(write_per_slice=False)(line 9527) — so the "per-sliceCONSENSUS_*buckets are not written to disk here" claim is correct. ✅ /brc-transcriptroute (orchestrator/routes/messages.py:404) andread_peer_artifactboth exist. The invariant is further guarded bytest_restart_brc_record_survival.pyandtest_restart_phase_brc_history.py, which assert noget_message_store().clear()is added to the restart path. ✅
Non-blocking
-
Wrong cross-reference in phase-restart step 1 (
docs/reference/agent-recovery.md:274). The parenthetical reads:"...the primary mechanism for those is the Redis store surviving the restart — see step 2"
But step 2 (line 275) is "All running containers for the specified phase are stopped and removed" — unrelated to the Redis store. The Redis-store-survival claim is documented in step 3 (line 276: "The Redis message store ... is NOT cleared — ... survives the restart boundary"). The renumbering that inserted the new step 1 shifted the steps down but this inline reference wasn't updated. It should read "see step 3".
-
Minor consistency nit (optional). Phase-restart step 3 says the store is "cleared only at phase transitions and pipeline create/delete" without naming the helper, whereas agent-restart step 4 names it: "phase transitions (
_clear_concurrent_state)". Naming the function in both spots would make them symmetric, but this is cosmetic.
No blocking issues — accurate docs change. Recommend fixing the step-2/step-3 reference before merge since cross-reference precision is the whole point of this doc.
— Authored by egg
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the careful review. Both non-blocking items addressed in
(Pre-existing mypy errors in — Authored by egg |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Re-review — both prior non-blocking items correctly addressed. Approving.
The delta since my last review (d25336c) is a single docs-only commit e7ace7f touching docs/reference/agent-recovery.md (2 lines). It cleanly resolves both items I raised:
-
Cross-reference fix (
agent-recovery.md:274) — phase-restart step 1's parenthetical now reads "the primary mechanism for those is the Redis store surviving the restart — see step 3". Verified against the final document numbering: step 2 is container teardown, and step 3 (line 276) is the one carrying "The Redis message store ... is NOT cleared — ... survives the restart boundary". The reference now points at the correct step. ✅ -
Helper named in step 3 (
agent-recovery.md:276) — now reads "cleared only at phase transitions (_clear_concurrent_state) and pipeline create/delete", symmetric with agent-restart step 4. Verified the helper exists and does exactly this:_clear_concurrent_stateatorchestrator/routes/phases.py:113callsget_message_store().clear(pipeline_id)and is invoked on the phase-transition paths (lines 719, 1194, 1615). ✅
No superficial fixes — both are accurate to the implementation. No new issues introduced; the change is confined to two inline edits and introduces no factual drift. All substantive claims in the surrounding section remain correct (re-confirmed _persist_phase_brc_history runs before teardown and writes write_per_slice=False).
No blocking issues.
— Authored by egg
|
egg review completed. View run logs 3 previous review(s) hidden. |
Update agent-recovery reference docs to reflect changes from #3248 (slice-7 of #3200):
_persist_phase_brc_history) introduced in BRC context discipline: protected directive root + queryable environment, bounded by a deterministic threshold reseed #3200 task-7-1. Extended thePeerConsensusTracker.clear()step to explicitly note that the Redis message store is NOT cleared — it is the durable BRC message record that reseeded sessions re-pull via/brc-transcript+read_peer_artifact.PeerConsensusTracker.remove_agent()clears only the ephemeral tracker, not the Redis message store, which survives the restart boundary per the same BRC context discipline: protected directive root + queryable environment, bounded by a deterministic threshold reseed #3200 invariant.Triggered by: #3248
Issue: none
Test Plan
orchestrator/routes/pipelines.pyAuthored-by: egg