Skip to content

Define and implement property tests for parameter-pack canonicalisation and migration policy (ADR 005) #10

Description

@coderabbitai

Background

ADR 005 (PR #9, branch 1-1-4-record-seeded-prng-choice) ratifies a canonicalisation contract for contentHash computation and a semantic-version migration policy for parameter packs, but defers all implementation — including test coverage — to later roadmap items (principally 1.3.2, 1.4.x, and 2.4.3).

A review check flagged that the decision record specifies determinism, canonicalisation, and migration invariants without documenting a property-test strategy. Golden-vector snapshot tests are proposed for the PRNG but no equivalent is proposed for:

  • Canonicalisation rules (key ordering, numeric-subset extraction, field exclusion, whitespace normalisation, NaN/Infinity rejection, duplicate-key rejection)
  • Migration policy conditions (PATCH rebind predicate, MINOR upgrade eligibility, MAJOR quarantine trigger)

Required work

  1. When roadmap item 1.3.2 lands (ParameterPack type and contentHash serialiser): author fast-check property tests that assert:
    • Canonicalisation is stable under arbitrary key-insertion order
    • Numeric-subset extraction is byte-identical for semantically equal numeric values
    • NaN, Infinity, and undefined fields are rejected deterministically
    • Round-trip: canonicalize(pack) === canonicalize(canonicalize(pack))
  2. When roadmap item 1.4.x lands (Dexie schema and migration transforms): author property tests that assert:
    • PATCH rebind predicate returns true iff canonical numeric subsets are byte-identical
    • MINOR upgrade prompt is triggered iff MAJOR segment is equal and numeric subsets differ
    • MAJOR quarantine is triggered iff MAJOR segment differs
    • Sequential transform application is order-deterministic

References

Raised by @leynos via code-review check on PR #9.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions