Files
clean-architecture-frontend…/tests
DongHyeonkaandClaude Opus 5.5 abaaa9c773 fix(contracts): return read-only indexes and frozen row snapshots (Q-6.7-7)
indexInvalidationRegistry and indexInvalidationTopicVersions froze only
the wrapper object, so `.clear()` on the returned Map emptied a
validated fan-out. validateWebWorkerContributions,
validateOfflineCommandContribution and validateRealtimeContributions
froze only the outer array and returned the caller's rows, so a later
write could raise a deadline, request byte bound or polling interval
that had already been checked.

read-only-registry.ts gains createReadOnlyMap (same private-store
facade, typed ReadonlyMap so the public index types do not change;
forEach now also passes the map argument). The three contribution
validators snapshot every row (exact keys, arrays by index) with
exact-snapshot.ts, validate the snapshot and return it frozen.

Behavior: contribution rows with extra keys, accessors or non-plain
prototypes are now rejected (template registries are empty today).

Verified: new tests/unit/contract-index-immutability.test.ts (5 cases,
all RED before); gates green except the known removal-fixture test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:45:37 +09:00
..