Size / Priority
- Size: Trivial (~30 lines)
- Category: C.3 Type-Safety.
- Risk: low.
Affected files
src/crdt/index.ts — exports list of CRDT kinds.
- Tests that check CRDT kind coverage.
Background
CrdtJson is a discriminated union over kind. Currently 9 kinds: GCounter / PNCounter / GSet / ORSet / LWWRegister / GCounterMap / LWWMap / MVRegister / ORMap.
To verify all kinds are tested + handled, a static ALL_CRDT_KINDS constant:
// src/crdt/index.ts
export const ALL_CRDT_KINDS = [
'GCounter',
'PNCounter',
'GSet',
'ORSet',
'LWWRegister',
'GCounterMap',
'LWWMap',
'MVRegister',
'ORMap',
] as const;
export type CrdtKind = typeof ALL_CRDT_KINDS[number];
Tests can iterate ALL_CRDT_KINDS to test each.
Compile-time check: if a new kind is added to CrdtJson but ALL_CRDT_KINDS isn't updated, the type system catches it via the exhaustiveness assertion in decodeCrdt (#231).
Integration / risk
- No behavioural change.
- Tests benefit.
Test plan
- Each kind in
ALL_CRDT_KINDS is exercised by at least one test.
- Adding a new kind requires updating the constant + tests catch missing entries.
Acceptance criteria
Size / Priority
Affected files
src/crdt/index.ts— exports list of CRDT kinds.Background
CrdtJsonis a discriminated union overkind. Currently 9 kinds: GCounter / PNCounter / GSet / ORSet / LWWRegister / GCounterMap / LWWMap / MVRegister / ORMap.To verify all kinds are tested + handled, a static
ALL_CRDT_KINDSconstant:Tests can iterate
ALL_CRDT_KINDSto test each.Compile-time check: if a new kind is added to
CrdtJsonbutALL_CRDT_KINDSisn't updated, the type system catches it via the exhaustiveness assertion indecodeCrdt(#231).Integration / risk
Test plan
ALL_CRDT_KINDSis exercised by at least one test.Acceptance criteria
ALL_CRDT_KINDSexported.