Context
Part of the review-stack architecture audit (parent epic — duplication dimension). Smaller-blast-radius
duplicates worth a follow-up sweep, bundled into one issue since each is a quick, independent fix:
1. isCommentLine — 5 bodies
review-enrichment/src/analyzers/{a11y-regression,unsafe-any,hardcoded-url,complexity, floating-promise}.ts. 3 of the 5 (unsafe-any.ts, complexity.ts, floating-promise.ts) are already
byte-identical (//|/\*|\*); hardcoded-url.ts deliberately adds # (shell/Python) and
a11y-regression.ts deliberately adds <!--|import\b|from\b (JSX-aware) — these two look
intentional, not accidental drift. Fix: extract a shared base regex for the 3 that already match,
leave the 2 intentionally-different ones as documented overrides of the shared base.
2. authoritativeContributorRepoStats — 4 copies
src/mcp/server.ts:3776, src/api/routes.ts:5184 (identical), src/queue/processors.ts:15224,
src/services/decision-pack.ts:1797 (both only differ by prettier line-wrap/type-spelling, verified
functionally identical). Currently harmless. Fix: consolidate into decision-pack.ts + 3 re-exports.
3. hasUnsafeWildcardCount — a 3rd, invisible-to-tooling private copy
The guarded pair src/signals/change-guardrail.ts:62 ↔
packages/gittensory-engine/src/signals/change-guardrail.ts:62 is fine (covered by the existing
engine-parity signals auto-discovered pairs). But packages/gittensory-engine/src/scoring/preview.ts:37
is a 3rd, private, non-exported copy inside the engine package that the drift-check can't see by
construction (it only compares host-vs-engine, never engine-internal duplicates). Fix: have
preview.ts import from change-guardrail.ts instead of redefining.
Acceptance criteria
Context
Part of the review-stack architecture audit (parent epic — duplication dimension). Smaller-blast-radius
duplicates worth a follow-up sweep, bundled into one issue since each is a quick, independent fix:
1.
isCommentLine— 5 bodiesreview-enrichment/src/analyzers/{a11y-regression,unsafe-any,hardcoded-url,complexity, floating-promise}.ts. 3 of the 5 (unsafe-any.ts,complexity.ts,floating-promise.ts) are alreadybyte-identical (
//|/\*|\*);hardcoded-url.tsdeliberately adds#(shell/Python) anda11y-regression.tsdeliberately adds<!--|import\b|from\b(JSX-aware) — these two lookintentional, not accidental drift. Fix: extract a shared base regex for the 3 that already match,
leave the 2 intentionally-different ones as documented overrides of the shared base.
2.
authoritativeContributorRepoStats— 4 copiessrc/mcp/server.ts:3776,src/api/routes.ts:5184(identical),src/queue/processors.ts:15224,src/services/decision-pack.ts:1797(both only differ by prettier line-wrap/type-spelling, verifiedfunctionally identical). Currently harmless. Fix: consolidate into
decision-pack.ts+ 3 re-exports.3.
hasUnsafeWildcardCount— a 3rd, invisible-to-tooling private copyThe guarded pair
src/signals/change-guardrail.ts:62↔packages/gittensory-engine/src/signals/change-guardrail.ts:62is fine (covered by the existingengine-parity
signalsauto-discovered pairs). Butpackages/gittensory-engine/src/scoring/preview.ts:37is a 3rd, private, non-exported copy inside the engine package that the drift-check can't see by
construction (it only compares host-vs-engine, never engine-internal duplicates). Fix: have
preview.tsimport fromchange-guardrail.tsinstead of redefining.Acceptance criteria