Skip to content

test(contract): doc-facts — docs that state facts about the code must match the code - #695

Merged
Amperstrand merged 2 commits into
mainfrom
test/doc-facts-contract
Oct 6, 2026
Merged

Amperstrand merged 2 commits into
mainfrom
test/doc-facts-contract

Conversation

@Amperstrand

Copy link
Copy Markdown
Collaborator

What

Mechanizes the docs-drift regression class from the 0.6.0 cycle (compat matrix describing a decode path the code removed; a tester guide stamped to a dead version era) into four executable bindings:

  1. the compat matrix's 'Re-verified against gonuts vX' note == the version src/tollwallet/go.mod pins;
  2. every 'N modules / N nested go.mod files' claim == the actual count under src/;
  3. README's 'current schema version' == the config schema default;
  4. the Payment-outcomes table in docs/merchant.md == merchant.go's emitted notice codes, bidirectionally.

Evidence

On its FIRST run against main it found real drift — the outcomes table (written one turn earlier, reviewed by hand) was missing client-not-registered, invalid-mac-address and payment-processing-failed; all three are now documented rows. Checker green after the fix. Wired into the contract-lint lane and release-check's Contract leg.

Amperstrand added 2 commits October 6, 2026 23:28
…ict-marker lint, and a fast release-check on main

17 of 24 packaging/uci-defaults suites were lane-absent; the gutter test
that would have caught #648's class pre-merge never ran per PR, and the
committed conflict markers of #663 had no lint to stop them. The lane now
runs every suite, lints unresolved conflict markers anchored to their
marker-plus-space shape, and a new make release-check-fast profile
(repro + conformance skipped through documented env knobs) runs on main
pushes so a post-merge verify-owed state is red CI in minutes.
… match the code

The 0.6.0 cycle shipped three regressions of this class (a compat matrix
describing a decode path the code removed; a tester guide stamped to a
dead version era; a stale code sample), each caught by hand. The checker
mechanizes four bindings: the compat matrix's re-verification note names
the gonuts version go.mod pins; every module-count claim equals the
actual src/ count; README's schema version equals the schema default;
and the Payment-outcomes table in merchant.md matches merchant.go's
emitted notice codes bidirectionally.

On its first run it found real drift: the outcomes table was missing
client-not-registered, invalid-mac-address and payment-processing-failed
— all three now documented. Wired into the contract-lint lane and
release-check's Contract leg.
@felixfelix-bot

Copy link
Copy Markdown
Contributor

Tag legend: pre-release-safe = land before the pre-release you are testing · ready = no blocker, timing is yours · post-release = hold until after · needs-author-pass = back to the author.

TAG: ready

tests/contract/check-docs-facts.py on this head (ebfb4c7c):

exit 0   "doc-facts: PASS (gonuts pin, module count, schema version, notice codes all agree)"

Docs that state facts about the code is the right thing to gate — the failure mode it prevents is a doc drifting out of step with the module it describes, which is how the matrix and the tester guide got stale in the first place.

Stack note: this branch carries #692/#693/#694's commits; merge bottom-up or merge this and close those. No blocker from my side.

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.

2 participants