Phase 2 proposal contract tests
Status: Proposed / Not authorized
Run from the public repository root:
node --test docs/proposals/phase-2/tests/proposal-contracts.test.mjs
The suite validates:
- every proposal schema and synthetic valid fixture;
- scoreless T0–T4 trust records with no evidence-maturity field;
- strict small-cell, organization-diversity, and concentration suppression for cells, share numerators, and share complements;
- coarse public share bands, unique measure IDs, protected-measure digests, and exact candidate-to-public count-band consistency;
- the absence of country aptitude, rank, and named-person fields;
- the absence of free-form public copy and exact public basis-point shares;
- mandatory behavioral reason, policy, bounded expiry, review, referral, and appeal records, including reason-set and chronology consistency;
- structural rejection of geography and prestige integrity inputs;
- the prohibition on referral-driven capability actions or automatic voucher penalties;
- the 12-axis, weightless multidimensional composition;
- complete T0–T4 genesis history, state reduction, policy chronology, non-referral T2, and T3 assessment-review facts;
- the research-only recency boundary with expiring policy, bounded withholding, review, appeal, alternate evidence, and accommodation controls;
- candidate digest validity, plausible organization/dominance arithmetic, active stricter privacy floors, snapshot digest validity, and candidate-to-public lineage; and
- local links in the Phase 2 proposal documents.
The suite runs 12 top-level tests over seven schemas, ten valid fixtures, 28
schema-level adversarial mutations, and additional valid-schema attacks that
must fail the relational gate. The reference relational checker is
proposal-invariants.mjs. It is proposal test code,
not a registered runtime or an authorization mechanism.
The suite imports the already-installed Ajv runtime from the v0.1 contracts package. It does not register these proposal schemas with the v0.1 runtime.
