中文 · English
A written team agreement works when people keep it. An agent does not share that embarrassment. Prompts and policy files are not deterministic. ratch is the extreme-programming form of the agreement: a good practice pushed until git can re-prove it on every commit. Git author metadata no longer names which agent made the commit.
Install with pip install ratch. Put a ratch_checks.py at the
repository root (see examples/ratch_checks.py). Without that file,
nothing runs. Run python -m ratch check. Gates that fail exit
non-zero; a gate with empty needles is VACUOUS (exit 2) until you pass
patterns= / needles=. Eyes print and never change the exit code.
ratch check --compact shortens the heatmap. ratch list labels
enabled, catalog, or meta; ratch describe no-forbidden-literal prints
the docstring. They do not run checks.
This repository is gated by its own root ratch_checks.py. ./build.sh
and CI install, run pytest, then ratch check --compact.
Provenance — commit identity is no longer a person:
no-forbidden-literal— configured tokens in content, paths, or the tip commit; emptypatterns=is VACUOUS;exclude_paths=skips content and filenameno-first-person— record prose without first-person voiceno-ai-signatures— attribution trailers;sources=can add tags and files; a shallow clone FAILs
Debris agents leave in the tree:
no-conflict-markers— unfinished merge markersno-vacuous-assert—assert True/assert Falseplaceholdersno-pytest-skip— skipped tests that read green;paths=for invariants vs e2eno-hash-named-test— test files named with a forgotten hex suffixtodo-has-issue-ref— debt markers without an issue citationbdd-test-conventions— test names that read as a sentence;prefix=/blank_blocks=/forbid_comment_labels=no-circular-import— a package that only imports in one orderno-reassurance-words— prose that tells the reader to stop checkingloc-cap— Python modules over 1000 linesno-external-font-cdn— shipped HTML/CSS/JS fetching remote webfonts; no web files is not-applicable
The agreement must apply to the agreement:
plugin-registry— every plugin has plants, fixture, and headings (meta)manifest-purity—ratch_checks.pyis importable and repeatableno-internal-refs— configured needles in tracked files; emptyneedles=is VACUOUSdoc-counts-match-ssot— READMEcatalog_nequalsdiscover()(meta)docs-equal-fresh-render— the generated region matches a live render (meta)tests-repo-root-ssot— tests import one ROOT helper, not__file__parent walksinjected-clock— bound stdlib time/datetime calls only if a Clock type exists;extra_time_attrs=/extra_dt_attrs=confined-import— listed imports stay inallow_paths=; emptynames=is VACUOUSdoc-cli-examples-valid— documented ratch commands parseno-autoclose-keywords-in-commits— commit messages that would auto-close issues
Eyes — evidence, never a failed run:
catalog-size—enabled_nvscatalog_n(wheel entry points, not a debt score)commit-heatmap— tracked files × time;--compactfor one line
ratch will never gate on judgment. It does not score, grade, or block on:
- naming quality
- abstraction quality
- prose quality (including commit-message quality)
- test meaningfulness
Those calls belong to review by people. ratch gates only what a machine can prove.
catalog_n=25