Skip to content

fix(test): close-out audit findings — caching guard never covered EventHandlerEntry - #74

Merged
keithdv merged 1 commit into
mainfrom
TRIM
Aug 13, 2026
Merged

fix(test): close-out audit findings — caching guard never covered EventHandlerEntry#74
keithdv merged 1 commit into
mainfrom
TRIM

Conversation

@keithdv

@keithdv keithdv commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #73, from the TRIM arc's Step 7 close-out audit. Verdict was CONCERNS with four veto-tier findings; this addresses all four. Full record: docs/todos/TRIM-dto-trimming-preservation-gaps/reviews/close-out-audit.md.

Two of the four were defects in TRIM-006 itself, and both had been self-reported as verified in #73. That is the part worth reading.

V1 — the guard never covered EventHandlerEntry

The fixture declared two matching static handlers for the same event type on one [FactoryEventHandler<T>] class. That is the NF0502 ambiguous-match shape: the transform reports the diagnostic and continues without adding an entry.

So RelayHandlerModel.Entries was empty, and EventHandlerEntry.Parameters / ServiceParameters / AllParameters — the exact three fields #73 converted to EquatableArray<T> — were never constructed and never guarded. The RelayHandler red→green transition in #73 was real, but driven entirely by Usings and Diagnostics; the nested type was never in play. FactoryGenerator.cs:101 returns early on Entries.Count == 0, so the renderer never ran either. The fixture's own comment asserted the opposite.

Fixed with two distinct event types, one matching handler each. Coverage re-proven rather than assumed: reverting EventHandlerEntry.Parameters to IReadOnlyList<T> now turns the RelayHandler case red, which it provably did not before.

Two fixture-health tests added, because "the fixture silently stopped exercising the thing" was the actual failure mode and nothing detected it:

  • Fixture_ProducesNoDiagnostics — a diagnostic means some transform took an early-out and never built the model under guard.
  • Fixture_EmitsRelayHandlerOutput — the relay output stage returns early on empty Entries, so an empty fixture emits no file.

The first caught a second latent defect on its first run: [Fetch] on an interface-factory member (NF0106 — the interface is the boundary), which had been degrading the FactoryInterface branch too.

V2 — the byte-identity evidence was vacuous

#73 claimed generated output was byte-identical, "verified empirically rather than by inference," on the basis of zero git status drift under Generated/.

.gitignore:405 is **/Generated/ and git ls-files | grep Generated/ returns zero tracked files. Git could not have reported drift regardless of what the generator emitted. The check proved nothing.

Replaced with a real measurement: IntegrationTests' full generated tree emitted with the pre-fix generator (710498c^) into a clean directory, then with HEAD's, diffed recursively — 256 files byte-identical, including all 16 .FactoryEventHandler.g.cs. The conclusion held; the evidence had not.

V3 / V4 — container integrity

  • TRIM-007's plan header read In Progress against a Done Index row. Reconciled.
  • Plan-review findings B8 (nothing pins the guard's runtime throw) and B10 (16 emission assertions can pass vacuously via naive IndexOf slicing) had no disposition anywhere. Both now carried in a Deferred Work Carrying Forward table with explicit accept-or-queue reasoning.

Also: DtoTypeWalker's header named one caller when it now has three (this file's stale header was itself a TRIM-001 finding), and the TRIM-007 log entry's imprecise "Amend" decision is corrected in place per the append-only rule.

Tests

603+603 unit (up 2 — the new health tests), 561+561 integration, 86+86 Design. 0 failures across net9.0 and net10.0.

Note on the release

The v1.7.0 release is deliberately held — not forgotten. docs/trimming.md:35 claims [Execute] static factories' registration lambdas are trimmed away while :222 accurately describes the registrar-DAM mechanism that makes that false. Shipping today would publish IP-protection guidance the arc itself disproved. The release reopens once the registrar-DAM fix lands. Cost is recorded plainly in the todo: zTreatment PCB-003 stays blocked meanwhile.

🤖 Generated with Claude Code

…ntHandlerEntry

The Step 7 close-out audit returned CONCERNS with four veto-tier findings.
Two were defects in TRIM-006 itself, both self-reported as verified.

V1 — the caching guard's fixture declared two matching handlers for the SAME
event type, which is the NF0502 ambiguous-match shape: the transform reports
the diagnostic and continues without adding an entry. RelayHandlerModel.Entries
was therefore empty, so EventHandlerEntry.Parameters/ServiceParameters/
AllParameters — the three fields TRIM-006 converted to EquatableArray<T> —
were never constructed and never guarded. The RelayHandler red/green
transition was real but driven entirely by Usings and Diagnostics. The
fixture's own comment claimed the opposite.

Fixed by giving the fixture two distinct event types with one matching handler
each. Coverage re-proven rather than assumed: reverting EventHandlerEntry
.Parameters to IReadOnlyList<T> now turns the RelayHandler case red, which it
provably did not before.

Adds two fixture-health tests, because "the fixture silently stopped
exercising the thing" was the actual failure mode and nothing detected it:
Fixture_ProducesNoDiagnostics and Fixture_EmitsRelayHandlerOutput. The first
caught a second latent defect on its first run — [Fetch] on an
interface-factory member (NF0106), which had been degrading the
FactoryInterface branch too.

V2 — the "generated output is byte-identical" evidence was vacuous. It rested
on zero git status drift under Generated/, but .gitignore:405 is **/Generated/
with zero tracked files, so git could not have reported drift regardless.
Replaced with a real measurement: IntegrationTests' full generated tree
emitted with the pre-fix generator and with HEAD's, diffed recursively — 256
files byte-identical, including all 16 .FactoryEventHandler.g.cs. The
conclusion held; the evidence had not.

V3 — TRIM-007's plan header said In Progress against a Done Index row.
V4 — plan-review findings B8 and B10 had no disposition; both now carried in
the Deferred Work table.

Also: DtoTypeWalker's header comment still named one caller when it now has
three (C7 — this file's stale header was itself a TRIM-001 finding), and the
TRIM-007 log entry's "Amend" decision is corrected in place per the
append-only rule.

Tests: 603+603 unit, 561+561 integration, 86+86 Design, 0 failures.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@keithdv
keithdv merged commit 25ac975 into main Aug 13, 2026
2 checks passed
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.

1 participant