Context
REES_ANALYZER_NAMES in src/review/enrichment-analyzer-names.ts (array starting line 6, closing ] as const at line 63) is documented as "the single source of truth for the analyzer keys that both the operator REES_ANALYZERS env list and the per-repo .loopover.yml review.enrichment toggles are validated against."
review-enrichment/analyzer-metadata.json (the generated REES analyzer-metadata registry, also surfaced via the MCP taxonomy resource in src/review/enrichment-analyzers-taxonomy.ts) lists 57 analyzers, including "duplicationDelta" (defaultEnabled: true, entry starting at line 668 of that file, sitting right next to "duplication" at line 638). REES_ANALYZER_NAMES only has 56 entries and is missing "duplicationDelta" — every other analyzer in the metadata file has a matching entry in this list; this is the one gap.
This is a real config-validation bug with two concrete, reachable breakages in src/review/enrichment-wire.ts:
resolveReesAnalyzers rejects "duplicationDelta" as an "invalid" analyzer name if a self-host operator opts into an explicit REES_ANALYZERS env list that includes it.
resolveEnrichmentAnalyzerSelection can never let a repo owner toggle duplicationDelta off per-repo via .loopover.yml review.enrichment, since that resolution loop only iterates REES_ANALYZER_NAMES.
No existing test cross-checks the two sources — test/unit/enrichment-analyzers-taxonomy.test.ts only asserts the JSON→document projection, not registry completeness against REES_ANALYZER_NAMES.
Requirements
- Add
"duplicationDelta" to REES_ANALYZER_NAMES in src/review/enrichment-analyzer-names.ts, following the exact pattern of the other 56 string-literal entries (placement next to "duplication"/"churnHotspot" mirrors the metadata file's own ordering, but exact position doesn't affect behavior — a trailing addition is also acceptable).
- Verify
resolveReesAnalyzers and resolveEnrichmentAnalyzerSelection in src/review/enrichment-wire.ts now correctly accept/toggle "duplicationDelta" with no further code changes needed (the fix should be purely additive to the array — if either function requires additional changes to actually pick up the new name, note that in the PR).
- Add a regression test (or extend an existing one) that would have caught this specific drift: assert every analyzer name present in
review-enrichment/analyzer-metadata.json has a corresponding entry in REES_ANALYZER_NAMES (a completeness check between the two sources), so a future new REES analyzer landing in the metadata file without a matching registry entry fails CI immediately rather than silently drifting.
Deliverables
Test Coverage Requirements
Aim for 99%+ Codecov patch coverage on the touched lines in src/review/enrichment-analyzer-names.ts (src/** is in coverage.include). review-enrichment/analyzer-metadata.json and review-enrichment/** are REES's own separately-deployed package (Railway, its own build/test pipeline) — the drift-guard test only needs to read that JSON file as fixture data from within src/'s test suite, it does not need REES's own coverage gate to pass.
Expected Outcome
duplicationDelta — a REES analyzer that already exists, is metadata-documented, and defaults to enabled — is now a valid, toggleable analyzer name everywhere REES_ANALYZER_NAMES is the source of truth (operator env-list validation and per-repo .loopover.yml toggles), instead of silently being rejected/un-toggleable due to a one-entry registry gap. A new drift-guard test prevents this specific class of gap from recurring silently for any future REES analyzer.
Links & Resources
src/review/enrichment-analyzer-names.ts (REES_ANALYZER_NAMES, lines 6-63)
review-enrichment/analyzer-metadata.json (duplicationDelta entry starting line 668, defaultEnabled: true)
src/review/enrichment-wire.ts (resolveReesAnalyzers around line 372, resolveEnrichmentAnalyzerSelection around line 324)
src/review/enrichment-analyzers-taxonomy.ts (MCP taxonomy resource projection)
test/unit/enrichment-analyzers-taxonomy.test.ts (existing test suite to extend)
- Related:
#4812 (duplicationDelta's own matching-algorithm upgrade — confirms the analyzer is real, shipped, and actively maintained; this issue is purely about its registry-completeness gap)
Context
REES_ANALYZER_NAMESinsrc/review/enrichment-analyzer-names.ts(array starting line 6, closing] as constat line 63) is documented as "the single source of truth for the analyzer keys that both the operatorREES_ANALYZERSenv list and the per-repo.loopover.ymlreview.enrichmenttoggles are validated against."review-enrichment/analyzer-metadata.json(the generated REES analyzer-metadata registry, also surfaced via the MCP taxonomy resource insrc/review/enrichment-analyzers-taxonomy.ts) lists 57 analyzers, including"duplicationDelta"(defaultEnabled: true, entry starting at line 668 of that file, sitting right next to"duplication"at line 638).REES_ANALYZER_NAMESonly has 56 entries and is missing"duplicationDelta"— every other analyzer in the metadata file has a matching entry in this list; this is the one gap.This is a real config-validation bug with two concrete, reachable breakages in
src/review/enrichment-wire.ts:resolveReesAnalyzersrejects"duplicationDelta"as an "invalid" analyzer name if a self-host operator opts into an explicitREES_ANALYZERSenv list that includes it.resolveEnrichmentAnalyzerSelectioncan never let a repo owner toggleduplicationDeltaoff per-repo via.loopover.yml review.enrichment, since that resolution loop only iteratesREES_ANALYZER_NAMES.No existing test cross-checks the two sources —
test/unit/enrichment-analyzers-taxonomy.test.tsonly asserts the JSON→document projection, not registry completeness againstREES_ANALYZER_NAMES.Requirements
"duplicationDelta"toREES_ANALYZER_NAMESinsrc/review/enrichment-analyzer-names.ts, following the exact pattern of the other 56 string-literal entries (placement next to"duplication"/"churnHotspot"mirrors the metadata file's own ordering, but exact position doesn't affect behavior — a trailing addition is also acceptable).resolveReesAnalyzersandresolveEnrichmentAnalyzerSelectioninsrc/review/enrichment-wire.tsnow correctly accept/toggle"duplicationDelta"with no further code changes needed (the fix should be purely additive to the array — if either function requires additional changes to actually pick up the new name, note that in the PR).review-enrichment/analyzer-metadata.jsonhas a corresponding entry inREES_ANALYZER_NAMES(a completeness check between the two sources), so a future new REES analyzer landing in the metadata file without a matching registry entry fails CI immediately rather than silently drifting.Deliverables
"duplicationDelta"added toREES_ANALYZER_NAMESinsrc/review/enrichment-analyzer-names.ts.resolveReesAnalyzers(insrc/review/enrichment-wire.ts) accepts"duplicationDelta"in an explicitREES_ANALYZERSlist.resolveEnrichmentAnalyzerSelectioncan toggleduplicationDeltaon/off via a repo's.loopover.yml review.enrichmentconfig.REES_ANALYZER_NAMESagainst the analyzer names present inreview-enrichment/analyzer-metadata.json, placed alongside the existingtest/unit/enrichment-analyzers-taxonomy.test.tssuite (or a new dedicated test file if that's a cleaner fit).Test Coverage Requirements
Aim for 99%+ Codecov patch coverage on the touched lines in
src/review/enrichment-analyzer-names.ts(src/**is incoverage.include).review-enrichment/analyzer-metadata.jsonandreview-enrichment/**are REES's own separately-deployed package (Railway, its own build/test pipeline) — the drift-guard test only needs to read that JSON file as fixture data from withinsrc/'s test suite, it does not need REES's own coverage gate to pass.Expected Outcome
duplicationDelta— a REES analyzer that already exists, is metadata-documented, and defaults to enabled — is now a valid, toggleable analyzer name everywhereREES_ANALYZER_NAMESis the source of truth (operator env-list validation and per-repo.loopover.ymltoggles), instead of silently being rejected/un-toggleable due to a one-entry registry gap. A new drift-guard test prevents this specific class of gap from recurring silently for any future REES analyzer.Links & Resources
src/review/enrichment-analyzer-names.ts(REES_ANALYZER_NAMES, lines 6-63)review-enrichment/analyzer-metadata.json(duplicationDeltaentry starting line 668,defaultEnabled: true)src/review/enrichment-wire.ts(resolveReesAnalyzersaround line 372,resolveEnrichmentAnalyzerSelectionaround line 324)src/review/enrichment-analyzers-taxonomy.ts(MCP taxonomy resource projection)test/unit/enrichment-analyzers-taxonomy.test.ts(existing test suite to extend)#4812(duplicationDelta's own matching-algorithm upgrade — confirms the analyzer is real, shipped, and actively maintained; this issue is purely about its registry-completeness gap)