Skip to main content

Module weakening

Module weakening 

Source
Expand description

Weakening-signal pass (6.F), PROMOTED TO A HEADLINE per v6.

A diff-scoped base-vs-head pass over the changed files that flags the AI-era failure modes a green check hides: tests removed or skipped, coverage / thresholds lowered, suppressions added, security checks/steps removed.

Always ADVISORY, reviewer-private, NEVER gates, NEVER auto-posted. It rides the brief envelope (exit-0 by construction) as a headline section.

Honest scope (ADR-001, syntactic): these are line-shape heuristics over the base-vs-head text of changed files, NOT a semantic test-coverage proof. A signal is an attention pointer (“the diff weakened a guardrail here”), framed so a reviewer decides.

Structs§

WeakeningSignal
One weakening signal: a category, the file it was detected in, and a short human-readable evidence string. Reviewer-private; never gates.

Enums§

WeakeningKind
The category of a single weakening signal.

Functions§

detect_added_suppressions
Detect added suppressions: a fallow-ignore / eslint-disable / @ts-ignore / @ts-expect-error count that increased between base and head. Only counts occurrences on a COMMENT line (a line containing //, #, /*, *, or <!--), since a real suppression directive always lives in a comment. This keeps the token list’s own definition (e.g. the string array in this file) from self-flagging, the only false-positive class the real-world smoke hit.
detect_lowered_thresholds
Detect lowered numeric thresholds: a config key whose numeric value decreased between base and head. Scans common coverage/threshold key names; a key present in both with a strictly smaller head value is a weakening.
detect_removed_security_steps
Detect removed security CI steps: a line invoking a security scanner / audit step that was present in base but is gone in head. Scoped to CI files by the caller; here we count net-removed scanner-invoking lines.
detect_removed_tests
Detect net-removed tests: a it( / test( / describe( callsite count that dropped between base and head (a test deleted).
detect_test_weakening
Detect skipped-test additions: an it.skip / xit / describe.skip / .only token present in head but not base. .only narrows the run to a subset, silently excluding siblings, so it counts as a weakening too.
is_ci_file
Whether a path looks like a CI workflow file (where security-step removal is meaningful).
is_test_file
Whether a path looks like a test file (where test removal/skip is meaningful).