ADLC
Toolkit

model-ratchet

Ranks hot files (churn × import criticality) for re-prosecution after a model or repo drift.

model-ratchet

ADLC phase: calibration (cross-phase) · Gate: none. It prints a prosecution plan, or drives a review over the highest-value files and records findings.

What it defends against

Every frontier model release is a free re-audit: newer models find what older ones missed. model-ratchet picks the files worth re-prosecuting first. It ranks them by SCORE = churn × (1 + inDegree), high change rate times how many source files import it, then either prints a prosecution plan or runs your review command over each file and appends verified findings to the shared .adlc/findings ledger. Run it on every model release (or monthly) to ratchet quality monotonically up.

When run from any subdirectory of a git repository, candidate files, churn metrics, and the findings ledger resolve relative to the repository root. Relative file paths are normalized to forward-slash separators across platforms, ensuring consistent matching between churn metrics, import graph analysis, and candidate files on Windows.

Usage

adlc model-ratchet [--top <n>] [--review-cmd <cmd>] [--timeout-ms <n>] [--churn-limit <n>] [--dry-run] [--allow-empty] [--json]
FlagDescription
--top <n>Number of hotspot files to select (default 10).
--review-cmd <cmd>Command to run per file; {file} is substituted. Omit it and the tool prints the plan only.
--timeout-ms <n>Kill a review-cmd run after <n> ms and record it as an operational error for that file (default 600000).
--churn-limit <n>Commit-history depth for the churn computation (default 1000).
--dry-runPrint the prosecution plan even when --review-cmd is supplied.
--allow-emptyAllow review mode to exit 0 when zero candidate files are selected.
--jsonMachine-readable output.

Exit codes

0: success. Plan printed, or the review ran and findings were appended to the ledger.1: operational error. Not a git repo, a --review-cmd exit outside 2, a review-cmd timeout, or bad arguments.2: gate failure. Review mode with zero candidate files selected and --allow-empty not set.

Example

$ adlc model-ratchet --top 3
model-ratchet — Prosecution Plan
====================================================================
FILE                        CHURN  IN-DEGREE  SCORE
--------------------------  -----  ---------  -----
src/db/query.mjs               31          5    186
src/auth.mjs                   42          3    168
src/utils.mjs                  25          1     50
exit 0

Go deeper

packages/model-ratchet. Why re-prosecution beats a one-time review pass: Prosecution, Not Code Review.

On this page