law/anti-patterns.md
Soft-warn patterns the airlock filter (Layer 2) surfaces during PR review. Unlike invariants, anti-patterns do not auto-reject; they raise a flag to the LLM judge (Layer 3) which decides whether the surrounding context justifies the pattern.
Each pattern has an id, a regex, a severity, and a description. The LLM judge sees the description and the surrounding diff context.
A-1 · MRO improver legacy imports
Legacy module reference deprecated · port forward to the current data path.
A-2 · cleanlab/fiftyone import
AD-toolchain experimental tools · production data path goes through zdata.
A-3 · ordinal-tag identifiers in source
Ordinal-style labels in code · use bullet ordering or feature names.
A-4 · hand-rolled JSON Web Token
Use the audited jose library for JWT.
A-5 · console.log in src/
Use the worker logger or emit() to trace · not stdout.
A-6 · trademarked centralised code host name
No reference to the trademarked host name in user-facing copy.
A-7 · brand drift
Primary tagline is "Agent Projects by Email". Adjacent brand words that imply a different positioning trigger this warn so the LLM judge can read context.
A-8 · suffix-versioned filenames
Replace cleanly · no suffix-versioned filenames.
A-9 · TypeScript any in app code
Use unknown and narrow at boundaries.
A-10 · hand-rolled HTTP server (Rust)
Use axum / actix / hyper · never roll the wire format.
Severity ladder
reject— hard stop (used only when the pattern is itself a sign
of crypto / parser hand-roll). Currently no anti-patterns are at this level; that's what invariants are for.
warn— soft signal · LLM judge decides.info— surface for human review at PR time, no impact on verdict.
— additions land via PR to this file; severity bumps require explicit review.