Skip to content

Deterministic BRC memory: derive the factual layer (review anchors, verdicts, NACK reasons, obligations) from the message record instead of agent transcription #3189

Closed

Description

@jwbron

Part of #3200 (BRC context discipline). This is the authoritative layer of #3200's permanent protected root — the small, deterministic, always-resident block that keeps directives + review-state salient while the bulk history moves to a queryable environment the agent pulls from on demand. Deriving these facts from the message record (instead of transcribing them into a worktree file) is what lets the root stay authoritative and survive restarts. (Under the original reseed framing, preserved as #3200's fallback, this was the authoritative half of the cold seed; its role is the same either way — it is the most load-bearing piece in both directions.)

Goal

Make the factual layer of BRC memory deterministic: derived by the orchestrator/composer from the message record, rather than transcribed by agents into worktree files.

(Reframed from the original "reconstruct last_reviewed_commit_sha when the memory file is missing" — reconstruction-on-fallback is the timid version. If the facts are derivable, they should be derived always, not only when a file goes missing. This issue is one of three paths split out of the BRC-continuity discussion: deterministic memory (this issue), agent-authored enrichment (#3188), session resume (#3186).)

The observation

Most of the current BRC memory schema is facts the orchestrator already possesses:

  • last_reviewed_commit_sha — proposals carry commit_sha in their payload (brc_propose), and reviewer ACKs/NACKs reference them.
  • prior verdict, prior NACK reasons, conditional-ACK obligations — all present verbatim in the ACK/NACK messages themselves.

Today reviewers transcribe these facts into .egg-state/agent-outputs/<role>/brc-memory-<pipeline-id>.md via _record_review_memory (sandbox/egg_agent_tools/handlers/brc.py), and the composer (orchestrator/routes/event_prompt.py) reads the file back. Having an LLM copy facts the system already knows is redundant and fragile:

reconstruct_tracker_from_messages is the in-repo precedent: consensus-tracker state is already rehydrated deterministically from the message record for orchestrator-restart recovery. This issue applies the same principle to the review-continuity facts that parameterise the composer's git-log delta.

Candidate directions (not pre-decided)

Relationship to #3183

#3183's stash-and-reseed remains the tactical fix for the file-based store as it exists today. This issue is the structural fix for the factual layer: derived memory has no worktree lifecycle to survive. Enrichment-layer content (#3188) would still be file-carried and still benefits from #3183.

Related

Activity

  1. added
    enhancement
    p2
    on Jun 12, 2026
  2. changed the title [-]Composer degrades to full-history re-review when BRC memory is missing — reconstruct last_reviewed_commit_sha from message history instead[/-] [+]Deterministic BRC memory: derive the factual layer (review anchors, verdicts, NACK reasons, obligations) from the message record instead of agent transcription[/+] on Jun 12, 2026
  3. added 6 commits that reference this issue on Jun 25, 2026
  4. 7 remaining items

  5. added 7 commits that reference this issue on Jun 25, 2026
  6. added 5 commits that reference this issue on Jun 25, 2026
  7. added a commit that references this issue on Jun 26, 2026
  8. jwbron commented on Jul 6, 2026

    @jwbron
    OwnerAuthor

    Triage: delivered as #3200 slices: PR #3238 added shared/egg_anchor/brc_derive.py, mechanically deriving all four factual anchors (last-reviewed SHA per producer, latest verdict per edge, open NACK reasons, conditional-ACK obligations) from the message record; PR #3239 renders them as the authoritative section of the protected root; PR #3248 guarantees the message record survives restart so anchors re-derive. Agent-written memory is now framed as claims with the derived anchors authoritative. Closing as complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:orchestratorenhancementp2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions