Skip to content

docs: make the repo carry the audit state a new session needs - #10

Merged
ojassug merged 1 commit into
mainfrom
audit-wave-2-prep
Aug 10, 2026
Merged

docs: make the repo carry the audit state a new session needs#10
ojassug merged 1 commit into
mainfrom
audit-wave-2-prep

Conversation

@ojassug

@ojassug ojassug commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Preparation for picking up Wave 2 in a fresh session. No source changes — typecheck, lint and 525/525 tests unaffected.

Why

Wave 2 will be started in a new session, so the context it needs has to live in the repository rather than in a conversation. Three things stood in the way: CLAUDE.md asserted things that Waves 1–3 made false, the corpus harness would refuse to run, and the audit status was scattered across DECISIONS entries.

docs/audit-remediation-status.md (new)

The entry point for audit work, pointed at from CLAUDE.md:

  • what is merged (Waves 0, 1 and most of 3 — DECISIONS §36–§43)
  • the measured corpus baseline, with the denominator caveat spelled out
  • each Wave 2 item with file and line references, verified still open at dd540fe
  • traps this codebase has for anyone changing it

It replaces status prose rather than adding to it — audit M11 counts documentation at 4.1:1 against source.

CLAUDE.md corrections

Each was load-bearing, because other notes in the same file reason from them:

claim status
"createContextBundle makes a single-item bundle for CLI/bench, so R_AST is a boolean" false on both halves since §43
"for code, R_struct is pinned at 1.0 — the only marker is filepath:" fixed by §40 — and the audit’s proposed fix for it was measured inert
invariant 9: "emittedOutput is a newline-joined blob" now a delimited envelope; invariant unchanged, reason restated
the 19.27% figure marked as a smaller-corpus number, with a pointer to the recorded baseline

Commands also lists the multi-file and directory forms.

Corpus harness

typescript expectation 57 → 59 — the two files H5 added (src/cli/ingest.ts, src/core/render/index.ts). collect.js would otherwise refuse on the next run, which is it working as designed.

A clean post-wave baseline replaces the eight scattered measurement arms:

bucket route saved
python file / stdin 23.14% / 22.66%
typescript file 25.35% (n=59)
everything else 0.00%

That 25.35% is deliberately not presented as comparable to §43’s 29.55%. Same engine, larger denominator — the "this repo is its own corpus" trap the harness exists to make visible.

Also done outside this PR

Deleted the eight merged branches (audit-*, phase-*). Two of them — audit-c1b and audit-gateway — were not ancestors of main because #5 and #6 merged into them after they had already gone upstream; verified both held no unique content before removing them. origin now has main only, plus this branch.

🤖 Generated with Claude Code

Wave 2 will be picked up in a fresh session, so the context it needs has to live
in the repository rather than in a conversation.

Adds `docs/audit-remediation-status.md` as the entry point for audit work, and
points `CLAUDE.md` at it. It records what is merged (Waves 0, 1 and most of 3,
DECISIONS §36–§43), the measured corpus baseline, exactly what each Wave 2 item
requires with file and line references, and the traps this codebase has for
anyone changing it — hazard-pinning tests that fail on purpose, `baseline.json`
assertions that are equality rather than floors, item ids being content-derived
but preserved, and the MCP transport's `StringDecoder` that must not be
"optimised" into manual concatenation.

It replaces status prose rather than adding to it (audit M11 counts documentation
at 4.1:1 against source).

`CLAUDE.md` corrections. Each of these was load-bearing — other notes in the same
file reason from them:

  - "`token-hashing` is whole-item and `createContextBundle` makes a single-item
    bundle for CLI/bench, so `R_AST` is a boolean" — false on both halves since
    §43. Region elision is preferred, whole-item elision of a symbol-bearing item
    is now refused outright, and `optimize` builds one item per file.
  - "For code, `R_struct` is pinned at 1.0 — the only marker is `filepath:`" —
    fixed by §40, with the note that the audit's proposed fix for it was measured
    inert on its own, because an empty marker set defaults the ratio back to 1.0.
  - Invariant 9's rationale restated: `emittedOutput` is no longer a
    newline-joined blob but a delimited envelope. The invariant is unchanged —
    neither form is a valid provider payload — only the reason given for it.
  - The 19.27% figure marked as belonging to a smaller corpus, with a pointer to
    the recorded baseline instead of a remembered number.
  - `Commands` lists the multi-file and directory forms.

Corpus harness: `typescript` expectation 57 -> 59, the two files H5 added
(`src/cli/ingest.ts`, `src/core/render/index.ts`). `collect.js` would otherwise
refuse on the next run, which is it working as designed rather than a fault.

A clean post-wave baseline replaces the eight scattered measurement arms: Python
23.14% file / 22.66% stdin, TypeScript 25.35% file over 59 files, every other
bucket 0.00%. The TypeScript figure is deliberately *not* presented as comparable
to §43's 29.55% — same engine, larger denominator, which is the "this repo is its
own corpus" trap the harness exists to make visible.

No source changes. Typecheck, lint and 525/525 tests unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ojassug
ojassug merged commit 0cf63dd into main Aug 10, 2026
3 checks passed
@ojassug
ojassug deleted the audit-wave-2-prep branch August 10, 2026 11:09
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