For 50+ deterministic sites, write one AST transformer.

Codemod-first threshold (N≳50 → AST transformer)

Intent — For a large mechanical backlog (N≳50 sites with a deterministic fix shape), author one AST-level transformer instead of dispatching N agents, bounding how large mechanical changes are made.

SummaryFor 50+ deterministic sites, write one AST transformer.
TargetProduct · Repair vocabulary
Formrepair-vocab
EnforcementSoft (probabilistic) — a discipline/threshold guiding how a mechanical backlog is fixed; nothing blocks N per-site edits, though the transform it produces is itself deterministic

Motivation — the failure it kills

A large mechanical lint backlog (say 200 sites all needing the same deterministic edit) tempts one of two bad responses: dispatch N agents (expensive, and each introduces per-site drift) or hand-edit them (slow and inconsistent). The failure is N inconsistent hand/agent fixes for a change that is actually a single deterministic transform, and it recurs at every large mechanical backlog.

Why it's not just "dispatch an agent per site" (or "fix them by hand")

N agents on a deterministic fix is the wasteful path: each agent re-derives the same edit slightly differently, and 200 of them is 200 chances to diverge. A single AST transformer applies the exact same transform everywhere, deterministically, in one reviewable artifact. A codemod-first rule sets the threshold: N≳50 + deterministic shape → codemod; genuine per-site judgment → an agent per site. One deterministic AST transform replaces N judgment-free agent edits and cannot drift between sites. Codemods are kept as deprecated reference exemplars so the next backlog starts from a working pattern.

Mechanism

The codemod-first rule triggers a codemod when N≳50 sites share a deterministic shape; the transformer operates at the AST level (e.g. an inline-import hoisting codemod). A pre-commit-skip rule lets a codemod-class commit skip the pre-commit lint stanza (with a pre-commit-skip: <reason> marker; unit-tier still runs), since the transform is mechanical. Finished codemods are marked deprecated and cross-referenced as paste-ready exemplars.

Prerequisites

Consequences & costs

Known uses

Related mechanisms