Skip to content

test(registry): make every analysis account for every output surface - #150

Merged
emrecdr merged 2 commits into
mainfrom
test/registration-exhaustiveness
Jul 27, 2026
Merged

test(registry): make every analysis account for every output surface#150
emrecdr merged 2 commits into
mainfrom
test/registration-exhaustiveness

Conversation

@emrecdr

@emrecdr emrecdr commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Wave-4 opener from the 2026-07-26 audit: the analysis registry had four parallel registration surfaces (dispatch match, CSV, markdown, SPA builder) with only the enum compiler-guarded — the drift mechanism behind three separate audit finding classes. A new registration_surfaces test module now enforces: every AnalysisName is either wired on a surface or listed in that surface's documented-absence set with a one-line reason. A future analysis that skips a surface fails the test by name.

  • Structural seams, not source-scans: supported_formats(name) (csv/markdown — all 56 wired, absence lists empty) and renders_in_spa(name) (23 wired / 33 documented-absent), both exhaustive matches so a new enum variant fails compilation until classified; plus a dispatch no-dead-arm check and an html-wired-set guard.
  • Documents today's reality — wires nothing new. (Corrects the audit's figure: 48 was the html_not_wired count; the SPA partition is 23/33.)
  • The seams are shaped to be exactly what the upcoming dispatch-collapse refactor consumes, closing the residual "declaration could lie" gap then.

Negative proof (entry temporarily removed, then restored): spa: 1 analysis/analyses are neither wired nor documented-absent — wire a spa emitter/widget, or add each to the spa documented-absence list with a reason: hotspot-velocity

Verification

  • 5 new tests pass; cli (42+98+27) + lib test-support suites pass; clippy all-features clean; fmt clean; zero behavior change (test-only + seams)

Known 1-line follow-up for the dispatch-collapse PR: the html_not_wired error string omits refactoring-targets, which does wire a real html emitter.

Analyses register on four parallel surfaces (dispatch match, csv/markdown
emitters, spa dashboard) but only the dispatch match is compiler-guarded, so
a new analysis can silently ship missing a rendering surface. Add a cfg(test)
exhaustiveness module in analyze.rs that partitions AnalysisName::all() per
surface into structurally-declared "wired" (two exhaustive matches over the
enum — supported_formats and renders_in_spa, colocated with the dispatch match
and build_spa_dashboard they mirror) and reviewed documented-absence lists with
a one-line reason each. Adding a variant fails to compile until its wiring is
declared; a variant accounted for on neither side fails a test naming the
analysis and the surface.

Documents today's reality (csv/markdown universal; spa renders 23 analyses, 33
documented-absent; a compact guard pins the 9-analysis bespoke-HTML set). No
behavior change — test-only.
The campaign's refactoring churn lands in the red-band files by design —
the very files being split and hardened — which max_red_effort_pct cannot
distinguish from risk concentrating. 25.0 covers the campaign; restore
toward the ~9.6% steady state once this churn rolls out of the window.
@emrecdr
emrecdr merged commit 24ef2ed into main Jul 27, 2026
10 checks passed
@emrecdr
emrecdr deleted the test/registration-exhaustiveness branch July 27, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants