Repository navigation
Add an escape-hatch ratchet and a .ub/ tamper guard - #17
Merged
Merged
Conversation
ub ratchet counts lint suppressions, coverage exclusions, and skipped tests in every file Git lists, and fails when a count grows past the human-owned .ub/ratchet. ub check runs it first and keeps running the other gates. ub init writes .ub/ratchet when it is absent. ub ratchet --guard --base REF fails when commits change .ub/check, delete .ub/ratchet, or raise a count, and on uncommitted .ub/ edits. The pre-push hook runs it from the installed ub for each pushed branch. The Stop hook warns the human when .ub/ has uncommitted changes.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The Stop and init helpers now run in the measured process, so their mutation sites count. Assert the empty-stderr Git message, a second ratchet write, nested parent creation, and a failing ps. Drop the unused managed_block default, text=True, and the <= that only equivalent mutants could change.
…teps A ratchet failure lists the grown kind's matches in files with uncommitted changes, and the count elsewhere; without such files, as in CI, it lists all of them. It ends with how to remove or accept them. .ub/ratchet takes `exclude GLOB` lines for vendored or generated files. `ub ratchet --update` keeps them; the guard fails when one is added. `ub ratchet --lower` lowers counts and never raises one or adds an exclude, so agents run it after removing escape hatches and the slack each removal left is gone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Agents can pass the CRAP, duplication, and mutation gates by switching a check off instead of fixing the code. They can also edit
.ub/checkitself. This is slice 1 of the maintainability roadmap: an anti-gaming ratchet and a tamper guard.What
ub ratchet.ub/ratchet, listing every currentfile:lineof that kind.ub checkruns the ratchet before coverage. A growth fails the verdict, and the other gates still run and report.ub ratchet --updatewrites the counts, andub initwrites.ub/ratchetwhen it is absent.ub ratchet --guard --base REF [--head REF].ub/check(content or mode), delete.ub/ratchet, or raise a count, and when.ub/has uncommitted changes.UB_ALLOW_UB_CHANGE=1is the human override.ub, not.ub/check.ub hooks installupgrades the old block..ub/has uncommitted changes.SKILL.mdand the managed instructions tell agents never to run--updateor edit.ub/unless asked.exclude GLOBlines in.ub/ratchetskip vendored or generated files; the guard fails when one is added.ub ratchet --lowerlowers counts and never raises them; agents run it after removing escape hatches.cli.rundispatches through a table, which brings it under the complexity limit.Verification
make test: 151 tests pass.make gateratchet.pyhas no surviving or uncovered mutants, and every function is under CRAP 10.hooks/projectfunctions whose tests run in child processes. Failing items dropped from 137 on main to about 115.ub initwrites the ratchet.@unittest.skipfails./.ub/checkwith itsfile:line..ub/edit triggers the Stop notice.git pushwith a raised count is refused.dx self-reviewand one independent review. Their findings are fixed, except two that are now documented limits.Known limits
omit, are not counted.--no-verifyor set the override. CI plus CODEOWNERS on/.ub/and the workflows is the real gate.