Skip to content

docs: update agent-recovery for BRC restart invariants [doc-updater] - #3267

Merged
jwbron merged 2 commits into
mainfrom
egg/doc-update-brc-restart-invariants
Jun 25, 2026
Merged

jwbron merged 2 commits into
mainfrom
egg/doc-update-brc-restart-invariants

Conversation

@james-in-a-box

Copy link
Copy Markdown
Contributor

Update agent-recovery reference docs to reflect changes from #3248 (slice-7 of #3200):

Triggered by: #3248

Issue: none

Test Plan

  • Automated: no tests for docs
  • Manual: verify the numbered steps in the "Phase-Level Restart" and "Agent-Level Restart" sections match the implementation in orchestrator/routes/pipelines.py

Authored-by: egg

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 at orchestrator/routes/pipelines.py:3161-3173 and the tracker.remove_agent(agent_role) call at line 3184 (no get_message_store().clear() on this path). ✅
  • _clear_concurrent_state clears the store at phase transitions — confirmed at orchestrator/routes/phases.py:120 (get_message_store().clear(pipeline_id)). ✅
  • Cleared at pipeline create/delete — confirmed in _clear_pipeline_runtime_state at orchestrator/routes/pipelines.py:2189. ✅
  • Phase-level restart, step 1 — _persist_phase_brc_history runs 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-slice CONSENSUS_* buckets are not written to disk here" claim is correct. ✅
  • /brc-transcript route (orchestrator/routes/messages.py:404) and read_peer_artifact both exist. The invariant is further guarded by test_restart_brc_record_survival.py and test_restart_phase_brc_history.py, which assert no get_message_store().clear() is added to the restart path. ✅

Non-blocking

  1. 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".

  2. 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

@james-in-a-box

This comment has been minimized.

@james-in-a-box

This comment has been minimized.

@james-in-a-box

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review. Both non-blocking items addressed in fixed-in-PR (commit e7ace7f):

  1. Wrong cross-reference in phase-restart step 1 — fixed-in-PR (commit e7ace7f). Agreed. The renumbering left the inline reference pointing at step 2 (container teardown); the Redis-store-survival claim lives in step 3. Updated "see step 2" → "see step 3".

  2. Name the clear helper in phase-restart step 3 — fixed-in-PR (commit e7ace7f). Agreed. Step 3 now reads "cleared only at phase transitions (_clear_concurrent_state) and pipeline create/delete", symmetric with agent-restart step 4.

(Pre-existing mypy errors in shared/egg_agent/client.py reported by make lint are unrelated to this docs-only change.)

— Authored by egg

@james-in-a-box

This comment has been minimized.

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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. ✅

  2. 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_state at orchestrator/routes/phases.py:113 calls get_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

@james-in-a-box

Copy link
Copy Markdown
Contributor Author

egg review completed. View run logs

3 previous review(s) hidden.

@jwbron
jwbron merged commit 4943c4e into main Jun 25, 2026
23 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

Development

Successfully merging this pull request may close these issues.

1 participant