Skip to content

Documenter agent + docs: snapshot of current state, not a ledger of changes #3288

Closed

Description

@jwbron

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:

Docstrings / inline comments carrying slice ledgers:

CLAUDE.md decomposition ledgers:

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

  1. added
    documentation
    cleanup
    sdlc-candidate
    on Jun 26, 2026
  2. added 20 commits that reference this issue on Jun 26, 2026
  3. added a commit that references this issue on Jun 26, 2026
  4. added a commit that references this issue on Jun 26, 2026
  5. added a commit that references this issue on Jun 26, 2026
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

    cleanupdocumentationsdlc-candidate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions