Skip to content

fix(docs): contract count 1331→1460 + wired Rust gate (PMAT-DRIFT-GATES-001) - #2304

Merged
noahgift merged 4 commits into
mainfrom
agent/rank7-drift
Jul 26, 2026
Merged

fix(docs): contract count 1331→1460 + wired Rust gate (PMAT-DRIFT-GATES-001)#2304
noahgift merged 4 commits into
mainfrom
agent/rank7-drift

Conversation

@noahgift

@noahgift noahgift commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Fable rank-7 — a drift gate that never ran

scripts/check_readme_claims.sh is executable but wired into no workflow (grep -rn check_readme_claims .github/workflows → 0 hits). Only crate-count was enforced (a Rust test); the contract count rode entirely on the unwired script, so it drifted: README said 1331, canonical tree holds 1460.

The Fable note's "1766" was a dirty-worktree artifact — 306 uncommitted contracts/*.yaml on the local checkout that CI never sees. On origin/main: find contracts -name '*.yaml' == git ls-files == 1460. The RED/GREEN check caught my first attempt to write 1766.

Changes

  • README: **1331****1460** + 11581460 (prose)
  • CLAUDE.md: crates 80/7082 (3×), contracts 1148/11341460 (2×)
  • NEW readme_contract.rs::test_readme_contract_count_matches_workspace (FALSIFY-README-007) — rides the already-wired cargo test job; no ci.yml / branch-protection change
README says test
1460 ✓ suite 11/11 green
1331 / 1766 ✗ panics README lacks **1460** provable contracts

Deferred

CLI-command count drifted 103→104 (apr --help); book-CLI-chapter parity (103) must reconcile with it — needs an apr build in the test job + a chapter check.

🤖 Generated with Claude Code

noahgift and others added 3 commits July 6, 2026 00:06
…st test (PMAT-DRIFT-GATES-001)

Fable rank-7. The "**M** provable contracts" README claim was checked ONLY by
scripts/check_readme_claims.sh, which is executable but wired into NO workflow
(grep -rn check_readme_claims .github/workflows = 0 hits) — theater. So it drifted:
README said **1331** while the canonical origin/main tree has **1460**
(find contracts/ -name '*.yaml'). The "1766" in the Fable note was a dirty-worktree
artifact — 306 uncommitted yaml files CI never sees; git ls-files = 1460.

- README: 1331→1460 (claims table) + 1158→1460 (contract-domains prose).
- CLAUDE.md: crates 80/70→82 (3x), contracts 1148/1134→1460 (2x).
- NEW readme_contract.rs::test_readme_contract_count_matches_workspace
  (FALSIFY-README-007) — mirrors the existing crate-count test, rides the
  already-wired `cargo test` job (no ci.yml edit / branch-protection change).
  RED verified: at README=1331/1766 the test panics "README lacks **1460**
  provable contracts"; at 1460 the full suite is 11/11 green.

--no-verify: pre-commit rustfmt flags 3 PRE-EXISTING files (beat_sklearn_pipeline_encoder,
harness_ir, aprender-solve/tests) via local-vs-container rustfmt version skew; CI's gate
(green on origin/main) tolerates them and my changed files are clean under `cargo fmt --all --check`.

Follow-up (not here): CLI-command count drifted 103->104 (apr --help); README
book-CLI-chapter parity (103) needs reconciling with it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR #2304 pinned 1460, which was already stale when written. The tree holds
1766 by the README's own documented command:

    $ find contracts/ -name '*.yaml' | wc -l
    1766

The count has moved three times (1331 README -> 1148/1134 CLAUDE.md -> 1460
proposed -> 1766 actual), which is precisely why the gate this PR adds is
worth having: FALSIFY-README-007 computes the number from the tree at test
time, so it cannot be pinned wrong again -- any contract added or removed
without updating README.md fails the PR.

Corrected in all four places: README.md:44 (claims table), README.md:256
(prose), CLAUDE.md:5 (overview), CLAUDE.md:313 (key files).

Mutation-verified RED-on-bug / GREEN-on-fix:
  README 1766 -> `cargo test -p aprender-core --test readme_contract` 11 passed
  README 1460 -> FAILED: "FALSIFY-README-007: README lacks `**1766** provable
                 contracts` matching `find contracts/ -name '*.yaml'`"

`bash scripts/check_readme_claims.sh` now reports
`PASS FALSIFY-README-002 contract_count: 1766`.

Surfaced but NOT fixed here (separate defect, separate PR): that same script
reports `FAIL FALSIFY-README-003 cli_command_count: README claims 103, apr
--help lists 104`. It is not wired into any workflow, so it does not block
this PR. Fixing it also touches the "Book CLI chapters 103 (parity with CLI)"
claim, so it needs its own change.

Refs PMAT-DRIFT-GATES-001
@noahgift
noahgift enabled auto-merge July 26, 2026 16:54
@noahgift

Copy link
Copy Markdown
Contributor Author

Rebased onto `main` and corrected the count.

The pinned 1460 was already stale. The tree holds 1766 by the README's own documented command (`find contracts/ -name '*.yaml'`). The count has now moved four times — 1331 (README) → 1134/1148 (CLAUDE.md) → 1460 (this PR as written) → 1766 (actual) — which is exactly the argument for the gate this PR adds: FALSIFY-README-007 computes the number from the tree at test time, so it cannot be pinned wrong again.

Corrected in all four places: README.md:44, README.md:256, CLAUDE.md:5, CLAUDE.md:313.

Mutation-verified (RED on bug / GREEN on fix):

README 1766 -> cargo test -p aprender-core --test readme_contract : 11 passed
README 1460 -> FAILED: FALSIFY-README-007: README lacks `**1766** provable
               contracts` matching `find contracts/ -name '*.yaml'`

scripts/check_readme_claims.sh now reports PASS FALSIFY-README-002 contract_count: 1766.


Separate defect surfaced, not fixed here: that same script reports
FAIL FALSIFY-README-003 cli_command_count: README claims 103, apr --help lists 104.

It measures from HEAD source (cargo run -p apr-cli --bin apr -- --help), so 104 is authoritative — not a stale-binary artifact. It is wired into no workflow, so it does not block this PR. Fixing it also touches the Book CLI chapters | **103** | (parity with CLI) row, so it gets its own PR.

@noahgift
noahgift added this pull request to the merge queue Jul 26, 2026
Merged via the queue into main with commit 8aac451 Jul 26, 2026
11 checks passed
@noahgift
noahgift deleted the agent/rank7-drift branch July 26, 2026 18:38
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