Skip to content

docs(readme): methodology, evidence and incident narrative move to docs/ - #433

Merged
abogartz merged 3 commits into
mainfrom
hygiene/readme-diet
Nov 18, 2026
Merged

abogartz merged 3 commits into
mainfrom
hygiene/readme-diet

Conversation

@abogartz

Copy link
Copy Markdown
Owner

What

Phase 5 of the hygiene plan. The README carried user docs, the flag reference, per-bench methodology, regeneration recipes and incident narratives in one 437-line file with paragraphs over 150 words. Methodology, evidence history and artifact policy move to docs/:

new file what left the README
docs/auto-capture-evidence.md the five "what is established" items — event fidelity, simulated traffic, teardown, the real-host scenario, the availability bench
docs/injection-cost.md epoch mechanics, the four-policy byte workload table, the invalidation counter's meaning, the author-reported provider audit
docs/store-concurrency.md publication rule, why the lock is per file, network-filesystem limits, POSIX modes and what they do not revoke
docs/repo-scoping.md identity derivation, legacy hashes, evidence attribution, the viewer's separate seat
docs/import-quarantine.md what the prose screen catches and misses, re-tagging, releasing quarantine, the viewer edit path
docs/contradiction-authority.md the code check's budgets and its accepted residual
docs/pre-release-ritual.md the mutation sweep, its cadence, and which bench artifacts stay out of git
docs/flags.md the three research flags in full
docs/write-gates.md what promotion evidence samples
docs/development.md what the smoke suite boots, how the npm surface is decided

437 lines → 374. 8,200 words → 6,656. The line drop is smaller than the word drop on purpose: a summary costs words back, and cutting the summaries to make the line count look better would leave links with no content. Everything user-visible stays — the flag table, the effectiveness section, the troubleshooting table, the install path.

Nothing lost

Moved prose is copied byte for byte. A substring check asserts each moved range appears in its new file unchanged: ten files, all VERBATIM. The README keeps a summary and a link; nine links, none broken, and every internal anchor the file referenced (#auto-capture-is-experimental, #surfaces, #secret-redaction, #export-and-move-between-machines, #contradiction-authority-policy-experimental-349--351) still exists.

The guard follows the prose

This is the part that mattered more than the word count. The prohibition scans — no dollar figure, no token-saving sentence, a percentage never attached to tokens without saying bytes, cheaper only where an n, a seat and a metric share the line, and the retracted figures never returning — walked README.md alone. Moving prose to docs/ would therefore have created an unguarded place to publish a number: the diet would have weakened the check sitting next to it, silently.

They now walk README.md plus every markdown file under docs/, recursively, and a coverage check fails if that walk stops finding them. Proven by planting violations in docs/ rather than the README:

plant result
dollar figure in docs/injection-cost.md RED
token-saving sentence in docs/auto-capture-evidence.md RED
unsourced cheaper in docs/repo-scoping.md RED
a retracted figure in docs/flags.md RED
docs/ deleted outright RED

The cheaper rules-block exemption now applies only to a document that actually carries the rules block, instead of a line-offset window that a moved file would inherit by accident.

Test plan — every line run on e544f73

  • bun run gate green: comment policy (21 added comment lines), tsc, biome, 1,475 unit, 34 e2e on the real host
  • test/claims.test.ts: 22 tests, 36 assertions — the 21 from the previous commit plus the scan-coverage check
  • the five-plant table above, run against docs/ files, plants reverted
  • verbatim check on all ten moved ranges; zero broken docs/ links
  • full suite 1,475 pass, 21 skip, 1,496 tests across 131 files

No production code changes. src/ is untouched; the only code edit is the scan scope in test/claims.test.ts.

One comment of my own tripped the comment-policy lint (reported by reads as narrative history). I reworded the comment rather than reaching for SKIP_COMMENT_LINT.

The README carried user docs, the flag reference, per-bench methodology,
regeneration recipes and incident narratives in one 437-line file, with
paragraphs over 150 words. The last three move out:

  docs/auto-capture-evidence.md  what is established, by which kind of evidence
  docs/injection-cost.md         epoch mechanics, the byte workload, a provider audit
  docs/store-concurrency.md      lock scope, publication, permissions
  docs/repo-scoping.md           identity derivation and write refusal detail
  docs/import-quarantine.md      what the prose screen catches and misses
  docs/contradiction-authority.md  the code check and its accepted residual
  docs/pre-release-ritual.md     the mutation sweep and the artifact policy
  docs/flags.md                  the three research flags in full
  docs/write-gates.md            what promotion evidence samples
  docs/development.md            what the smoke suite boots, the npm surface

Moved prose is copied byte for byte - a substring check asserts each moved range
appears in its new file unchanged. The README keeps a summary and a link, and
keeps every user-visible rule, the flag table, the effectiveness section and the
troubleshooting table. 437 lines to 374, 8,200 words to 6,656; the drop in lines
is smaller than the drop in words because a summary costs words back.

The guard follows the prose. The prohibition scans (no dollar figure, no
token-saving sentence, a percentage never attached to tokens without saying
bytes, cheaper only with an n, a seat and a metric, and the retracted figures)
walked README.md alone, so moving text to docs/ would have created an unguarded
place to publish a number. They now walk README.md plus every markdown file under
docs/, and a coverage check fails if that walk stops finding them. Proven by
planting each violation in a docs file rather than the README: four plants, four
red, and a fifth for deleting docs/ outright. The rules-block exemption for the
word cheaper applies only to a document that actually carries the rules.
…indows

relative() yields backslash-separated names on Windows, so the coverage check
counted zero docs files and every prohibition scanned one file again - the exact
failure the check exists to catch, caught by the check. Normalise separators to
forward slashes before comparing or reporting a name.

@WhollyMindless WhollyMindless 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.

Two documentation follow-ups on c245830:

  • The installed README now sends readers to nine relative docs/*.md targets, but package.json.files excludes docs/. npm pack --dry-run --ignore-scripts --json lists 122 files, including README.md and zero docs files. The detailed material previously shipped inside the README; after this move those links cannot resolve inside an installed package. Please consider including these docs in the package, or using repository URLs if the detail is intentionally hosted only on GitHub.
  • docs/flags.md has no link from the README, unlike the other nine moved documents. The option rows lost details such as invalid DEDUP values disabling the pass and SYMPTOM's metadata-only exemption, so a link from that table would keep the full behavior discoverable.

The broader claims scan works in my focused check: 22 tests / 36 assertions pass on Windows (Bun 1.4.4), and a temporary dollar-figure plant in docs/injection-cost.md fails the intended assertion. Probe reverted; no production change or full-suite rerun.

The README is shipped and the repository is not, so nine relative docs/*.md
links sent an installed reader to paths that do not exist next to the package.
npm pack listed 122 files and zero of them were docs.

docs/ joins files: 122 files to 140, unpacked 954 KB.

test/doc-links.test.ts keeps the two halves from drifting apart again: every
relative link in README.md and docs/*.md resolves in the checkout, and every
target it resolves to is inside files. Verified by removing docs from files -
both the coverage test and the unshipped-link test go red, naming all nine
links - then restoring. docs is also asserted by name, so deleting it from the
packaging list cannot pass by leaving no links behind.

docs/flags.md gains the README link the other moved documents have: the option
rows there lost the invalid-value rules (an out-of-range DEDUP turns the pass
off rather than clamping) and SYMPTOM's metadata-only exemption.
@abogartz

Copy link
Copy Markdown
Owner Author

Fixed in bbd25c9, taking the "include them in the package" option.

docs joins files. npm pack --dry-run --ignore-scripts --json now lists 140 files, 18 of them under docs/, unpacked 954 KB (was 122 files, zero docs).

Chose packaging over repository URLs because a URL resolves against a branch that moves: the README a reader has in node_modules is pinned to the version they installed, and a main link silently describes different behaviour a week later. Relative links inside the tarball keep the prose and its detail as one artifact, always.

Added test/doc-links.test.ts so the two halves cannot drift again: every relative link in README.md and docs/*.md resolves in the checkout, and every resolved target is inside files. docs is additionally asserted by name, so deleting it from the packaging list cannot pass by leaving no links behind. Verified by removing docs from files — the coverage test and the unshipped-link test both go red, naming all nine links — then restored.

The docs/flags.md link is in the same commit, with the two rules you named stated beside it: an out-of-range DEDUP turns the suppression pass off rather than clamping, and a metadata-only memory_update is exempt from SYMPTOM.

Gate on bbd25c9: comment policy (24 added comment lines), tsc, biome, 1,479 unit across 132 files (+4 from the new test), 34 e2e on the real host.

@abogartz
abogartz merged commit 0dab84a into main Nov 18, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.30.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants