Skip to content

feat(gauge): cf-no-bon-ref — sweep the consumer tree for ticket references#23

Merged
Antawari merged 1 commit into
mainfrom
feat/no-bon-ref-gauge
Jun 26, 2026
Merged

feat(gauge): cf-no-bon-ref — sweep the consumer tree for ticket references#23
Antawari merged 1 commit into
mainfrom
feat/no-bon-ref-gauge

Conversation

@Antawari

Copy link
Copy Markdown
Contributor

Contract → World → Failure

Contract: the law battery must BLOCK a ticket-id leak at PR time on the consumer tree.
World: a consumer (mexxa) shipped BON-#### refs into main — in .gitignore, CSS, a Playwright config, the e2e spec — and nobody caught it.
Failure: the no_bon_ref sweep was only a pytest self-test guarding the kit's own docs; the Python cf-gate battery never swept a consumer tree at all. The law had no shippable teeth on consumers.

What this adds

cf-no-bon-ref — a language-agnostic byte sweep over the consumer code/config tree, wired as a cf-gate stage (stage 8 of 13) and shipped as a console script (so local == CI).

  • Jurisdiction is CODE, not prose. Skips hidden/vendored/cache dirs, the docs/ tree, all markdown/rst, and binary files. An ADR, a README, or the law-debt ledger maps epic→ticket as its function — that's provenance, not a leak. This is a declared boundary, not a silent paths-ignore.
  • Reasoned, ratcheted escape. A ref that must live in a code path (vendored/generated source carrying an upstream tag) is registered in no-bon-ref-exemptions.json ({frozen_count, entries:[{path, reason}]}) — mirroring the kit's exemptions ratchet. Every blessing is printed loudly; adding one requires bumping frozen_count (visible, never silent).
  • Self-clean. The BON-- pattern is assembled by concatenation so the gauge's own source never carries it.
  • Also scrubs one pre-existing ticket id from ts/README.md — the kit now obeys the law it ships.

Verification (real gate, not just unit tests)

  • Full cf-gate battery green including the new cf-no-bon-ref stage (ruff, file-budget, recursion, exemptions, no-bon-ref, import-contract, mypy, complexipy).
  • 18 new unit tests; ruff/mypy/complexipy/cf-file-budget clean on the new module (242 lines, ≤500).
  • The only kit pytest non-passes are 3 test_packaging fixture-teardown errors that reproduce on the untouched base (a local wheel-build/venv artifact) — not introduced here.

Scope note

This is the Python-path leg (per the scope decision). TS parity (cf-gate-ts) is a fast-follow. The reusable-workflow enforcement (merged-main projection + self-verifying required-check) is a separate, disjoint PR that merges in any order with this one.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

…ences

The no-ticket-ids law had no shippable teeth: the kit's existing sweep guards only the kit's own docs, and the Python cf-gate battery never swept a consumer tree at all — so a consumer leaked ticket ids to main uncaught. This adds cf-no-bon-ref, a language-agnostic byte sweep over the code/config tree, wired as a cf-gate stage and shipped as a console script.

Jurisdiction is CODE, not prose: hidden/vendored/cache dirs, the docs/ tree, all markdown/rst, and binary files are out of scope (an ADR or a debt ledger maps epic->ticket as its function). A ref that must live in a code path is registered in no-bon-ref-exemptions.json with a reason, ratcheted by frozen_count — every blessing visible, never silent. The pattern is assembled by concatenation so the gauge's own source stays self-clean.

Also scrubs one pre-existing ticket id from ts/README.md so the kit obeys the law it now ships. Verified: full cf-gate green incl the new stage; 18 new unit tests; ruff/mypy/complexipy/file-budget clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Antawari Antawari merged commit 513b368 into main Jun 26, 2026
1 check passed
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