Repository navigation
Description
Problem
Documentation in egg has drifted into acting as a ledger of changes rather than a snapshot of current state. This is most pronounced in artifacts produced during the SDLC pipeline, where the documenter agent (and, by accretion, the doc corpus) records process context — which slice landed a change, which TASK-N implemented it, what the code "used to" do, what was removed in issue #NNNN — interleaved with the description of how the system actually works today.
The pipeline-process framing (slices, tasks, HITL iteration numbers, per-phase rollout order) is meaningful while a pipeline runs. Once the pipeline completes and the change is on main, that ledger is noise: it does not describe the current codebase, it costs the reader implementation-roadmap knowledge to parse, and it steadily rots as later changes invalidate the narrative.
We want documentation to be a snapshot of the current state of the codebase. Historical context should appear only where it is tangibly valuable to a reader of the current system (e.g. "this is intentionally email-allowlist-based because impersonation is the threat model"), never as a default record of how the work was sequenced. In particular, SDLC "slice" context must never appear in inline docs, docstrings, or reference documentation.
Evidence / scope
This is widespread. A survey found slice/TASK/issue-as-history references in roughly 8–12% of sentences across core architecture pages, plus heavy inline-comment and docstring tagging across orchestrator/, gateway/, and shared/. Representative examples:
Architecture docs reading as change-logs:
docs/architecture/brc-memory.md— "Introduced by BRC consensus: replace agent-held waits with deterministic event-pump + durable agent memory (durable fix for #2906) #2908, slice-1.", "Slice-1 lands the writer… lands in slice-3. Slice-4 flipped the default…", "Added in BRC context discipline: protected directive root + queryable environment, bounded by a deterministic threshold reseed #3200 slice-5."docs/architecture/orchestrator.md— behavioral sections keyed on "slice-4 TASK-4-5", "TASK-4-1 … used to clear only…"; a whole "slice lifecycle" section narrating slice-1→slice-4 rollout as a change log.docs/architecture/slice-dag.md— "The implement phase used to run as a single monolithic agent team… The slice-DAG model replaces that…"docs/architecture/gateway-auto-filter.md— sections explicitly "preserved for context" describing a "historical Gateway should auto-filter disallowed files on push, and handle pulled cross-role commits #1882 design" whose code has been removed; a "## What was removed" section.docs/architecture/coordination-state.md— "This page describes the final shape of the Design: coordination state is served, not replicated — retire git/prompt choreography for agent state exchange #3077 invariant. The epic was landed in six slices, all of which have now shipped…"; Threat/Mitigation/Status tables full of "Retired surface", "now historical".
Docstrings / inline comments carrying slice ledgers:
gateway/artifact_api.py:1—"""Artifact API endpoints on the gateway (#3077 slice-4)."""gateway/jira_client.py—# Issue #1557 slice-2 …on multiple methods.orchestrator/kubernetes_spawner.py— 30+# #3064 slice-N: …section markers and comments.shared/egg_anchor/protected_root.py:1,shared/egg_agent/context_discipline.py:1,shared/egg_agent/__main__.py— module/param docstrings framed by slice numbers ("warm resume, BRC context discipline: protected directive root + queryable environment, bounded by a deterministic threshold reseed #3200 slice-6", "the slice-8 gate").
CLAUDE.md decomposition ledgers:
gateway/CLAUDE.md,orchestrator/CLAUDE.md— submodule seam tables organized by which slice landed each decomposition ("TBD (Decompose 15 oversize Python source files to clear the file-size allowlist #2261 slice-14)", "slice-12", "slice-7"…) rather than by the current submodule structure.
Desired outcome
Two coupled work streams (exact slicing/sequencing is the pipeline's to decide — this issue does not prescribe it):
1. Change the documenter agent so it produces snapshots, not ledgers.
The documenter's task instructions (assembled in orchestrator/routes/pipelines.py, core block around the "## Your Task" section ~14207–14256; role definition in shared/egg_contracts/agent_roles.py:301) tell it to "update documentation for the changes made by the CODER agent" and focus on "changes from plan phase {id}". That framing nudges toward describing the change rather than the resulting state. The prompt should be revised to instruct the documenter to:
- Write documentation that describes the current state of the code as it exists after the change — as if the slice/pipeline machinery did not exist.
- Never reference SDLC artifacts (slice numbers, TASK-N ids, phase/HITL iteration numbers) in any doc, docstring, or inline comment it writes.
- Include historical context (issue references, "previously X" rationale, migration notes) only when it is tangibly valuable to a reader of the current system, and to prefer rationale ("why it is this way") over chronology ("what it used to be / when it changed").
- When updating an existing doc, fold the new state into the snapshot and remove now-stale ledger/historical entries rather than appending another layer.
- Keep the no-op / no-doc-impact path intact (BRC still requires a propose).
2. Clean up the existing documentation corpus.
A pass over docs/, the **/README.md / **/CLAUDE.md files, and code docstrings/comments to bring the existing corpus in line with the snapshot principle:
- Strip slice/TASK/process-ledger references from inline docs, docstrings, and reference docs.
- Rewrite behavioral sections that are narrated as change-logs ("used to… now…", "slice-N added…") into descriptions of current behavior.
- Remove or substantially refactor "historical record" sections that no longer describe live code (e.g. preserved descriptions of removed designs, "what was removed" inventories) — keep only the residue that is genuinely useful to a current reader, and total-refactor pages where the ledger framing is load-bearing.
- Where historical context is valuable, keep it but reframe it as rationale and, where it's substantial, consider isolating it (e.g. a clearly-marked rationale/history note) so it doesn't bleed into the current-state description.
Out of scope / notes
- This is not "delete all issue references" — issue links that justify why the current system is shaped the way it is are fine. The line is chronology-as-default vs. rationale-where-valuable.
- The cleanup is large; the planner should decide how to slice it (e.g. by doc area / package) rather than this issue dictating a DAG.
- Constraint to preserve: the documenter's gateway file boundaries (
docs/,**/*.md,.egg-state/agent-outputs/) and the BRC no-op propose path are unchanged.
Activity
Initialize SDLC contract for issue #3288
refine(#3288): analysis — documenter snapshot-not-ledger + corpus cle…
refine(#3288): human companion — documenter snapshot-not-ledger summary
plan(#3288): architect analysis — documenter snapshot doctrine + boun…
plan(#3288): architect-output at canonical path
plan(#3288): architect-slices scaffold (WS1 retrain + WS2 package-sli…
plan(#3288): risk assessment — documenter snapshot-not-ledger + bound…
plan(#3288): risk-analyst-output at canonical path
plan(#3288): adopt architect 6-slice DAG — documenter snapshot + corp…
plan(#3288): plain-language companion to the plan
implement(#3288): documenter writes snapshots, not ledgers
implement(#3288): tests for documenter snapshot-not-ledger framing
implement(#3288): de-ledger docs/architecture pages (slice-2)
implement(#3288): de-ledger slice-3 architecture pages
implement(#3288): strip slice ledger markers from gateway docstrings
implement(#3288): de-ledger gateway/CLAUDE.md seam tables
implement(#3288): de-ledger artifact_api strict-schema and jira multi…
implement(#3288): de-ledger orchestrator/CLAUDE.md seam tables
implement(#3288): de-ledger kubernetes_spawner comments
implement(#3288): strip slice/task ledger tags from shared docstrings
implement(#3288): de-ledger high-density reference/guide docs
Merge pull request #3317 from jwbron/egg/issue-3288/work
Fix checks: restore #2548 rationale link and slice-1/context-branch tie