Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
Unreleased
1.3.0 - 2026-06-16
Added
- Ratchet H --
ratchet-dont-use-powershell(invariant gate).
Blocks command-like PowerShell usage in staged text, including
executable invocations (powershell/pwshwith switches),.ps1
command references, common cmdlets, and$env:prefixes.
Introduces scanner module
git_agent_ratchet/ratchets/powershell_usage.py, hook entry point
git_agent_ratchet/hooks/dont_use_powershell.py, console script
ratchet-dont-use-powershell, and unified CLI subcommand
dont-use-powershell.
Documentation
- Codified the anti-rot contract that governs when a rule earns a
ratchet. README gains a "When does a rule earn a ratchet (and how this
avoids rot)" section anddocs/spec.mdgains section 4 "When a Rule
Earns a Ratchet (Anti-Rot Contract)": the four-bar test for debt
ratchets (fires often / silent in review / pays down through normal work
/ cheap early-expensive late), the debt-ratchet vs invariant-gate
distinction, and the shrink-only / loud-by-default / retirement
properties that keep a ratchet from degenerating into a sinecure. - Updated all user-facing docs for the eight-ratchet surface:
README.md,AGENTS.md, anddocs/spec.mdnow consistently include
Ratchet H and release versionv1.3.0references.
1.2.0 - 2026-06-15
Added
- Ratchet E --
ratchet-no-cross-module-private-import
(private_imports.json). AST scan that blocks importing a private
(_-prefixed) name across module boundaries --from pkg.mod import _fooandimport pkg._foo. Relative imports and dunders are ignored.
New scannergit_agent_ratchet/ratchets/cross_module_private_import.py,
hookgit_agent_ratchet/hooks/no_cross_module_private_import.py, console
scriptratchet-no-cross-module-private-import, and
no-cross-module-private-importsubcommand on the unified CLI. - Ratchet F --
ratchet-no-print-outside-allowlist
(print_calls.json). AST scan forprint(...)calls outside
allowlisted path prefixes (useloggingeverywhere else; stderr shims
undergit_agent_ratchet/hooksandgit_agent_ratchet/cli.pyare
allowlisted via--allow-prefix). - Ratchet G --
ratchet-no-temporary-comments
(temporary_comments.json). Regex scan for expedient-path comment
markers (for now,back-compat,TODO: remove once,HACK: fix later, transitional bridges) across.py/.ts/.tsx/.js/.jsx/.cs/.go/
.rs/.java/.kt, with aratchet-allow: temporary_commentsper-line
escape marker.
Changed
- Extracted
git_agent_ratchet/hooks/gate.py::run_ratchet_gateas the
single seed / trip / ratchet-down / equal implementation. Ratchets A,
D, E, F, and G all dispatch through it, removing the inline-duplicated
control flow that each baseline-gate hook previously carried. - Added shared path helpers
paths.strip_dot_slashand
paths.iter_python_files.strip_dot_slashreplaces a
str.lstrip("./")character-set misuse (which mangled dotfile paths
such as.pre-commit-hooks.yaml) inanti_bypass._normalizeand the
new print scanner. - README, CLI, and
.pre-commit-hooks.yamlnow advertise seven ratchets.
Fixed
print_outside_allowlist.is_allowedmatched allow-prefixes by bare
string prefix (label.startswith(norm)), so a prefix likepkg/cli
wrongly allow-listedpkg/client.pyand let strayprint()calls go
undetected. It now matches only the exact file or a directory boundary
(norm + "/"). Regression-tested.
1.1.0 - 2026-06-03
Added
- Multi-language support for Ratchet A. Duplicate-helper detection
now scans TypeScript / JavaScript (.ts,.tsx,.js,.jsx,
.mjs,.cjs) and C# (.cs) in addition to Python. New extractor
registry undergit_agent_ratchet/ratchets/extractors/with one
module per language; each defines its own "helper-shaped" predicate
(Python: leading underscore; TS/JS: unexported top-level function or
arrow const; C#:privatemethod). New--langflag on the hook
restricts scanning to a subset of registered languages. 35 new
extractor tests; total suite now 137 tests at 100% coverage. - Default exclude list grows to skip
node_modules,bin,obj,
.venv,venv,dist,buildso the scanner does not chase build
output or vendor trees in polyglot repos. - Ratchet D --
ratchet-max-file-lines. Per-file Python line-count
ratchet. Records the total overage across all files larger than--max
(default 350) in a separate baseline; metric is allowed to shrink, never
grow. New scanner module
git_agent_ratchet/ratchets/max_file_lines.py, hook entry
git_agent_ratchet/hooks/max_file_lines.py, console script
ratchet-max-file-lines,max-file-linessubcommand on the unified CLI.
25 new tests; total suite now 102 tests at 100% line + branch coverage. - GitHub Actions release workflow (
.github/workflows/release.yml) that
builds the sdist + wheel on everyv*tag and publishes to PyPI via
trusted-publisher OIDC (no long-lived token in the repo). Requires
one-time PyPI-side publisher configuration documented in the workflow. - 100% line + branch coverage (
fail_under = 95inpyproject.toml). - Codecov upload on
ubuntu-latest+ Python 3.12 (codecov/codecov-action@v4). codecov.ymlpolicy file mirrors local gates: 95% project floor
(matchesfail_under) and 80% patch floor (matchesdiff-cover).diff-coverPR gate: PR-changed lines must be >= 80% covered.- CodeQL security analysis workflow (
security-and-qualityquery suite). - Dependabot config: weekly Python + GitHub Actions updates, grouped.
SECURITY.mdwith private-vulnerability reporting flow and threat model.CHANGELOG.md(this file).- Pull-request template and bug-report / feature-request issue templates.
Changed
- README now displays Codecov coverage badge.
- README, downstream
.pre-commit-hooks.yaml, and the CLI all advertise
four ratchets instead of three. DEVELOPERS.md"Known soft rules" no longer lists the 350-line
per-file limit -- it is now mechanically enforced by Ratchet D.
Fixed
- CI:
pre-commitdogfood job now setsSKIP=ratchet-anti-bypass.
Ratchet C is a staged-set commit gate;--all-filesmode fed every
protected file in the repo to it and tripped it unconditionally on
every run, blocking the build matrix. Anti-bypass continues to run
on developer machines at commit time, which is the only context
where the gate has meaning.
1.0.0 - 2026-06-03
Added
- Three pre-commit hooks:
ratchet-no-duplicate-helpers(Ratchet A, AST
scan),ratchet-deny-agent-chatter(Ratchet B, regex scan),
ratchet-anti-bypass(Ratchet C, env + path inspection). - Unified
git-agent-ratchetCLI dispatcher with--versionand three
subcommands. - JSON baseline registry with shrink-only invariant; auto-rewritten by the
hook on cleanup, blocked from growing withoutHUMAN_RATCHET_BYPASS_KEY. ratchet-allow: agent_chatterper-line escape marker for legitimate
quotations of forbidden phrases in docs and tests.- GitHub Actions CI: test matrix (ubuntu / windows / macos x py 3.10 / 3.11
/ 3.12), ruff lint + format, pre-commit dogfood, build sdist + wheel. - Documentation: README with seven badges,
AGENTS.md(agent-facing index),
DEVELOPERS.md(human-facing dev guide),CONTRIBUTING.md,docs/spec.md
(the contract),docs/TODO.md(roadmap + known bugs). - 76 tests covering every hook entry point, every ratchet, the baseline
registry, the unified CLI, and thepython -m git_agent_ratchet
entrypoint.
Security
- Ratchet C never logs the bypass key value; only its presence is
acknowledged in failure output (regression-tested).