@htilabs/platform-common-models 0.12.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/config/index.cjs +0 -81
  2. package/dist/config/index.cjs.map +1 -1
  3. package/dist/config/index.d.cts +4 -79
  4. package/dist/config/index.d.ts +4 -79
  5. package/dist/config/index.js +1 -79
  6. package/dist/config/index.js.map +1 -1
  7. package/dist/constants/index.cjs +18 -2
  8. package/dist/constants/index.cjs.map +1 -1
  9. package/dist/constants/index.d.cts +1 -1
  10. package/dist/constants/index.d.ts +1 -1
  11. package/dist/constants/index.js +18 -2
  12. package/dist/constants/index.js.map +1 -1
  13. package/dist/cvc-Cp4uWnAa.d.cts +298 -0
  14. package/dist/cvc-Cp4uWnAa.d.ts +298 -0
  15. package/dist/{cvcEntry-BCj1OWqL.d.cts → cvcEntry-ctHTp2df.d.cts} +44 -44
  16. package/dist/{cvcEntry-BCj1OWqL.d.ts → cvcEntry-ctHTp2df.d.ts} +44 -44
  17. package/dist/cvcs/index.cjs +8065 -1384
  18. package/dist/cvcs/index.cjs.map +1 -1
  19. package/dist/cvcs/index.d.cts +15287 -8079
  20. package/dist/cvcs/index.d.ts +15287 -8079
  21. package/dist/cvcs/index.js +8052 -1384
  22. package/dist/cvcs/index.js.map +1 -1
  23. package/dist/enums/index.cjs +4573 -0
  24. package/dist/enums/index.cjs.map +1 -0
  25. package/dist/enums/index.d.cts +5277 -0
  26. package/dist/enums/index.d.ts +5277 -0
  27. package/dist/enums/index.js +4369 -0
  28. package/dist/enums/index.js.map +1 -0
  29. package/dist/{index-I-DiX9eQ.d.ts → index-4DiJrn7y.d.ts} +1 -1
  30. package/dist/{index-CoVr1jIV.d.cts → index-qreOzXYS.d.cts} +1 -1
  31. package/dist/index.cjs +8616 -1389
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +7 -4700
  34. package/dist/index.d.ts +7 -4700
  35. package/dist/index.js +8590 -1389
  36. package/dist/index.js.map +1 -1
  37. package/dist/models/index.d.cts +2 -2
  38. package/dist/models/index.d.ts +2 -2
  39. package/dist/mongo/index.cjs +0 -1
  40. package/dist/mongo/index.cjs.map +1 -1
  41. package/dist/mongo/index.js +1 -2
  42. package/dist/mongo/index.js.map +1 -1
  43. package/dist/{platform-auth-v53r3BhN.d.cts → platform-auth-Dv5fu0Fh.d.cts} +5 -4
  44. package/dist/{platform-auth-v53r3BhN.d.ts → platform-auth-Dv5fu0Fh.d.ts} +5 -4
  45. package/dist/schemas/index.cjs +5 -1
  46. package/dist/schemas/index.cjs.map +1 -1
  47. package/dist/schemas/index.d.cts +35 -35
  48. package/dist/schemas/index.d.ts +35 -35
  49. package/dist/schemas/index.js +5 -1
  50. package/dist/schemas/index.js.map +1 -1
  51. package/dist/types/index.d.cts +2 -2
  52. package/dist/types/index.d.ts +2 -2
  53. package/dist/validation/index.cjs +58 -0
  54. package/dist/validation/index.cjs.map +1 -1
  55. package/dist/validation/index.d.cts +82 -283
  56. package/dist/validation/index.d.ts +82 -283
  57. package/dist/validation/index.js +57 -0
  58. package/dist/validation/index.js.map +1 -1
  59. package/package.json +32 -22
  60. package/src/__sot__/README.md +36 -1
  61. package/src/__sot__/coreIndicatorFields.ts +331 -0
  62. package/src/__sot__/coreIndicators.pin.json +1936 -2
  63. package/src/__sot__/cvcIndex.pin.json +8 -4
  64. package/src/__tests__/__snapshots__/cvc-sot.snap +45 -13
  65. package/src/__tests__/core-information-scope-invariant.test.ts +134 -0
  66. package/src/__tests__/cvc-136-scoring-invariant.test.ts +8 -3
  67. package/src/__tests__/cvc-181-182-country-parity.test.ts +163 -0
  68. package/src/__tests__/cvc-drift-gate.test.ts +463 -12
  69. package/src/__tests__/cvc-sot-snapshot.test.ts +81 -11
  70. package/src/__tests__/cvc-status-parser.test.ts +150 -0
  71. package/src/__tests__/cvc-structural.test.ts +16 -0
  72. package/src/__tests__/runtime-contract-validator.test.ts +1 -325
  73. package/src/__tests__/share-response-reason-invariant.test.ts +167 -0
  74. package/src/config/index.ts +4 -189
  75. package/src/constants/ic.ts +120 -3
  76. package/src/cvcs/assertionDomain.v1.1.0.json +19 -1
  77. package/src/cvcs/assertionStatus.v1.0.0.json +80 -0
  78. package/src/cvcs/carCorrectionReason.v1.0.0.json +89 -0
  79. package/src/cvcs/caseShareState.v1.0.0.json +62 -0
  80. package/src/cvcs/coreIndicators.v1.0.0.json +83 -5
  81. package/src/cvcs/coreInformationScope.v1.0.0.json +1165 -0
  82. package/src/cvcs/countries.v1.0.0.json +3077 -0
  83. package/src/cvcs/createdBySystem.v1.0.0.json +89 -0
  84. package/src/cvcs/criminalOrgCategory.v1.0.0.json +116 -0
  85. package/src/cvcs/determinationHelperCategories.v1.0.0.json +1166 -0
  86. package/src/cvcs/incidentParticipationRoles.v1.0.0.json +11 -1
  87. package/src/cvcs/index.ts +36 -0
  88. package/src/cvcs/minorAdultStatus.v1.0.0.json +80 -0
  89. package/src/cvcs/personRelationships.v1.0.0.json +67 -2
  90. package/src/cvcs/referralOrigin.v1.0.0.json +26 -0
  91. package/src/cvcs/relationshipConcern.v1.0.0.json +28 -19
  92. package/src/cvcs/riskIdentificationMilestone.v1.0.0.json +109 -0
  93. package/src/cvcs/sessionTemplate.v1.0.0.json +22 -0
  94. package/src/cvcs/sharePurpose.v1.0.0.json +80 -12
  95. package/src/cvcs/shareResponseReason.v1.0.0.json +220 -0
  96. package/src/cvcs/subjectType.v1.0.0.json +80 -0
  97. package/src/generated/cvc-enums.ts +628 -20
  98. package/src/validation/cvcStatus.ts +209 -0
  99. package/src/validation/index.ts +1 -0
@@ -67,11 +67,11 @@ const SOT_SPECS: readonly SotSpec[] = [
67
67
  { file: "serviceStates.v1.0.0.json", domain: "service_states", expectedCount: 17 },
68
68
  // Spec §8.1 — "Entries: 147" + 4 missingness = 151
69
69
  { file: "serviceCategories.v1.0.0.json", domain: "service_categories", expectedCount: 151 },
70
- // CVC-69 — 4 group parents + 11 role leaves + 4 missingness = 19
70
+ // CVC-69 — 4 group parents + 12 role leaves + 4 missingness = 20
71
71
  {
72
72
  file: "incidentParticipationRoles.v1.0.0.json",
73
73
  domain: "incident_participation_roles",
74
- expectedCount: 19,
74
+ expectedCount: 20,
75
75
  },
76
76
  // CVC-130 — 6 flat role leaves + 4 missingness = 10
77
77
  {
@@ -242,12 +242,18 @@ const SOT_SPECS: readonly SotSpec[] = [
242
242
  domain: "preferred_contact_method",
243
243
  expectedCount: 4,
244
244
  },
245
- // CVC-84 — 8 flat Level-1 intent-based share purposes. No missingness
246
- // sentinels (variant 0, share_purpose is always known at sharing time) = 8.
245
+ // CVC-84 — 12 flat Level-1 intent-based share purposes: the 8 `wing: core`
246
+ // rows from `core_share_purpose.yaml` + the 4 `wing: leads` rows from
247
+ // `core_share_purpose_extensions_leads.yaml`, which canon's own
248
+ // `build_sharing_purpose_catalog.py` joins into one 12-row catalog. The wing
249
+ // rows were RATIFIED 2026-07-03 and live-synced 2026-08-19, so they are canon,
250
+ // not proposals. This count was 8 while only the core file had been ported.
251
+ // No missingness sentinels (variant 0, share_purpose is always known at
252
+ // sharing time) = 12.
247
253
  {
248
254
  file: "sharePurpose.v1.0.0.json",
249
255
  domain: "share_purpose",
250
- expectedCount: 8,
256
+ expectedCount: 12,
251
257
  },
252
258
  // CVC-165 — 10 flat Level-1 entity/establishment types (Notion codebook DB,
253
259
  // v1.0) + 1 missingness root + 3 canonical missingness children (no PNA;
@@ -332,11 +338,17 @@ const SOT_SPECS: readonly SotSpec[] = [
332
338
  // L0 missingness (anonymous, data_not_collected; Notion codebook explicitly
333
339
  // omits `unknown` at L0 — the L2 `relationship_unknown` code carries that
334
340
  // semantic instead; no PNA) + 8 L1 topics + 35 L2 canonical relationship
335
- // types + 40 L3 directional role labels + 3 L3 pet-branch roles = 89.
341
+ // types + 40 L3 directional role labels + 3 L3 pet-branch roles = 89,
342
+ // + 3 L2 LOCAL EXTENSIONS (`parental_figure_dependent`,
343
+ // `intimate_romantic_partner`, `intimate_partner_prior`) + 2 L3 directional
344
+ // roles under `parental_figure_dependent` = 94. All 5 are flagged
345
+ // `localExtension: true`; the canonical picker (prototype@622410b
346
+ // REL_CATEGORIES) offers them and the Notion-side export does not yet carry
347
+ // them. See the file's `_status.localExtension`.
336
348
  {
337
349
  file: "personRelationships.v1.0.0.json",
338
350
  domain: "person_relationships",
339
- expectedCount: 89,
351
+ expectedCount: 94,
340
352
  },
341
353
  // CVC-179 — employment_status: 1 missingness_root + 5 HMIS missingness
342
354
  // (unknown, anonymous, data_not_collected, client_doesnt_know,
@@ -568,9 +580,13 @@ const SOT_SPECS: readonly SotSpec[] = [
568
580
  // `none` = negative determination, canonical per Crysta directive 2026-05-27)
569
581
  // + 1 missingness root + 3 canonical missingness children = 8.
570
582
  { file: "htType.v1.0.0.json", domain: "ht_type", expectedCount: 8 },
571
- // PROVISIONAL CVC-231 relationship_concern — 7 TRA relationship-concern
583
+ // PROVISIONAL CVC-991 relationship_concern — 7 TRA relationship-concern
572
584
  // codes + 1 missingness root + 3 canonical missingness children = 11.
573
585
  // CVC number is PROVISIONAL pending codebook-session ratification.
586
+ // RENUMBERED 231 -> 991 on 2026-08-29: CVC-231 was ratified to the
587
+ // Determination Helper categories (Jevon, 2026-08-28), so the provisional
588
+ // mint this domain held out of the canonical block vacates to the 900-block.
589
+ // Count is unchanged — the renumber is a pure segment-1 prefix substitution.
574
590
  { file: "relationshipConcern.v1.0.0.json", domain: "relationship_concern", expectedCount: 11 },
575
591
  // CVC-137 recency_band — the CANONICAL 8-band key system adopted in 0.8.13
576
592
  // (w3m, m3_6, m6_12, y1p, y1_3, y3_10, y10p, ylt3 — the lowercase
@@ -588,7 +604,15 @@ const SOT_SPECS: readonly SotSpec[] = [
588
604
  // root + 3 canonical missingness children = 16. CVC number is PROVISIONAL
589
605
  // pending ratification.
590
606
  { file: "housingSubsidyTypes.v1.0.0.json", domain: "housing_subsidy_types", expectedCount: 16 },
591
- { file: "assertionDomain.v1.1.0.json", domain: "assertion_domain", expectedCount: 68 },
607
+ // 68 -> 75: the 2026-08-29 signal-identification ratification adds two Level-1
608
+ // domains (signal_identification 159-066, investigative_legal 159-067) plus the
609
+ // five identification-funnel rungs as their Level-2 value rows.
610
+ // 75 -> 70: the five identification-funnel rungs move OUT of CVC-159 into
611
+ // their own vocabulary (riskIdentificationMilestone, CVC-267). CVC-159 keeps
612
+ // the two new Level-1 DOMAINS only — AssertionDomainKeys is the set of
613
+ // domains, and a value folded into it makes `on_radar` demand a domain
614
+ // classification in every downstream totality gate.
615
+ { file: "assertionDomain.v1.1.0.json", domain: "assertion_domain", expectedCount: 70 },
592
616
  { file: "activityType.v1.0.0.json", domain: "activity_type", expectedCount: 14 },
593
617
  { file: "provenanceSourceId.v1.0.0.json", domain: "provenance_source_id", expectedCount: 13 },
594
618
  { file: "radiusBucket.v1.0.0.json", domain: "radius_bucket", expectedCount: 9 },
@@ -627,7 +651,9 @@ const SOT_SPECS: readonly SotSpec[] = [
627
651
  { file: "coreReferralOutcome.v1.0.0.json", domain: "core_referral_outcome", expectedCount: 6 },
628
652
  // ─── 0.8.13 canonical CVC batch ───
629
653
  { file: "coreDhState.v1.0.0.json", domain: "dh_state", expectedCount: 9 },
630
- { file: "coreIndicators.v1.0.0.json", domain: "core_indicators", expectedCount: 214 },
654
+ // 0.8.14: 214 -> 219 (catalog refresh a596eb9 -> 84a1b67; +5 mints, 0 withdrawn).
655
+ // 622410b refresh: 219 -> 220 (catalog refresh 84a1b67 -> 622410b; +1 mint, 0 withdrawn).
656
+ { file: "coreIndicators.v1.0.0.json", domain: "core_indicators", expectedCount: 220 },
631
657
  { file: "riskSeverityBand.v1.0.0.json", domain: "risk_severity_band", expectedCount: 9 },
632
658
  { file: "adminRoles.v1.0.0.json", domain: "admin_roles", expectedCount: 14 },
633
659
  { file: "userRoles.v1.0.0.json", domain: "user_roles", expectedCount: 19 },
@@ -640,13 +666,41 @@ const SOT_SPECS: readonly SotSpec[] = [
640
666
  { file: "poPetitionBasis.v1.0.0.json", domain: "po_petition_basis", expectedCount: 8 },
641
667
  { file: "poStatus.v1.0.0.json", domain: "po_status", expectedCount: 12 },
642
668
  { file: "poViolationStatus.v1.0.0.json", domain: "po_violation_status", expectedCount: 6 },
643
- { file: "sessionTemplate.v1.0.0.json", domain: "session_template", expectedCount: 23 },
669
+ // 0.8.23: 23 -> 25 — CVC-217 gained cst_pave_inbound_share (217-020) +
670
+ // cst_thread_inbound_share (217-021), the cross-app Inbound Share template pair.
671
+ { file: "sessionTemplate.v1.0.0.json", domain: "session_template", expectedCount: 25 },
644
672
  { file: "serviceDeliveryChannel.v1.0.0.json", domain: "service_delivery_channel", expectedCount: 11 },
645
673
  { file: "whyNots.v1.0.0.json", domain: "why_nots", expectedCount: 32 },
646
674
  // CVC-182 — 249 countries (codes MINTED; upstream Code column is blank) + 1
647
675
  // missingness root + 3 canonical missingness children (Unknown / Declined to
648
676
  // asnwer / Not collected, carried verbatim from the codebook) = 253.
649
677
  { file: "citizenship.v1.0.0.json", domain: "citizenship", expectedCount: 253 },
678
+ // CVC-181 — the SAME 249 countries (identical keys + ISO codes; asserted by
679
+ // cvc-181-182-country-parity.test.ts) + 1 missingness root + 3 workspace-
680
+ // standard missingness children (this codebook carries none of its own) + the
681
+ // 1 authored `non_us_unspecified` local extension = 254. The +1 over CVC-182
682
+ // is that local extension, and nothing else.
683
+ { file: "countries.v1.0.0.json", domain: "countries", expectedCount: 254 },
684
+ // CVC-231 — the Determination Helper category taxonomy: 53 canonical rows
685
+ // across the four sections (§ I Subject and Scope 5 · § II Activity 20 ·
686
+ // § III Means 24 · § IV Status 4) + 1 missingness root + 3 workspace-standard
687
+ // missingness children (this codebook carries none of its own) = 57. ALL 53 are
688
+ // selectable, including the 10 non-leaf rows — the canonical
689
+ // feeds_dh_subdomain_crossref addresses parent rows directly, so a
690
+ // category/leaf split would orphan those references.
691
+ {
692
+ file: "determinationHelperCategories.v1.0.0.json",
693
+ domain: "determination_helper_categories",
694
+ expectedCount: 57,
695
+ },
696
+ // CVC-306 — 10 L1 share response reasons + 1 missingness root + canon v1.1's
697
+ // ONE sentinel (UNK; ANON absent by design, DNC [ARCHIVED] in the codebook
698
+ // and omitted) = 12. Generated by scripts/gen-share-response-reason.py.
699
+ {
700
+ file: "shareResponseReason.v1.0.0.json",
701
+ domain: "share_response_reason",
702
+ expectedCount: 12,
703
+ },
650
704
  // CVC-235 — 4 L1 trafficking-relevant roles + 1 missingness root + 3 canonical
651
705
  // missingness children = 8.
652
706
  {
@@ -654,6 +708,22 @@ const SOT_SPECS: readonly SotSpec[] = [
654
708
  domain: "trafficking_relevant_role",
655
709
  expectedCount: 8,
656
710
  },
711
+ // ─── GDR §10.1 CAR-contract vocabularies (provisional 900-block; PAVE
712
+ // @pave/domain verbatim; bead pv-pgdr-cvc-source-gdr-10-1-bulk-publish). ───
713
+ // 3 lifecycle states (@pave/domain ASSERTION_STATUSES) + 4 missingness = 7
714
+ { file: "assertionStatus.v1.0.0.json", domain: "assertion_status", expectedCount: 7 },
715
+ // 4 correction/retraction reasons (@pave/domain CAR_CORRECTION_REASONS —
716
+ // entered_in_error, duplicate, superseded_externally — plus
717
+ // removed_by_recipient_curation for the CaseShare curation lane) + 4
718
+ // missingness = 8
719
+ { file: "carCorrectionReason.v1.0.0.json", domain: "car_correction_reason", expectedCount: 8 },
720
+ // 4 actor classes (@pave/domain CREATED_BY_SYSTEMS) + 4 missingness = 8
721
+ { file: "createdBySystem.v1.0.0.json", domain: "created_by_system", expectedCount: 8 },
722
+ // 3 entity kinds (@pave/domain SUBJECT_TYPES) + 4 missingness = 7
723
+ { file: "subjectType.v1.0.0.json", domain: "subject_type", expectedCount: 7 },
724
+ // 3 substantive age bands (@pave/domain AGE_BANDS_AT_EVENT minus `unknown`,
725
+ // which maps to the missingness sentinel) + 4 missingness = 7
726
+ { file: "minorAdultStatus.v1.0.0.json", domain: "minor_adult_status", expectedCount: 7 },
657
727
  ] as const;
658
728
 
659
729
  // ─── Helpers ────────────────────────────────────────────────────────────────
@@ -0,0 +1,150 @@
1
+ /**
2
+ * CVC `_status`/`_source` provenance parser — unit tests
3
+ *
4
+ * Every fixture string below is copied verbatim from a real, committed SOT
5
+ * file under `src/cvcs/` (not invented) — see the inline citation on each
6
+ * `it()` for the source file, so a reader can `grep` back to the original.
7
+ * Covers every branch `parseCvcStatus` exists to handle: the four maturity
8
+ * states, the structured-object `_status` shape (11 domains), the
9
+ * leading-token fallback (`share_purpose`'s "Synced…" — the one domain whose
10
+ * leading word is none of the three convention keywords), the
11
+ * self-contradictory `core_functions` case the parser is specifically
12
+ * designed to flag, and the `prototype/data/cvcs/*.yaml` source-path
13
+ * extraction.
14
+ */
15
+
16
+ import { describe, it, expect } from "vitest";
17
+
18
+ import { parseCvcStatus } from "../validation/cvcStatus.js";
19
+
20
+ describe("parseCvcStatus", () => {
21
+ it("classifies a DRAFT domain (accommodation_type, src/cvcs/accommodationType.v1.0.0.json)", () => {
22
+ const result = parseCvcStatus({
23
+ _status:
24
+ "DRAFT — TEMPORARY: net-new value-CVC not yet in Notion; provisional 900+ numbering; " +
25
+ "codes from prototype/data/cvcs/core_accommodation_type.yaml; PENDING canonical Notion " +
26
+ "authoring (PAVE Auditability backlog).",
27
+ _source: "prototype/data/cvcs/core_accommodation_type.yaml",
28
+ });
29
+ expect(result.maturity).toBe("draft");
30
+ expect(result.ambiguous).toBe(false);
31
+ expect(result.sourceIsPrototype).toBe(true);
32
+ expect(result.sourcePath).toBe("prototype/data/cvcs/core_accommodation_type.yaml");
33
+ expect(result.rawStatus).toContain("DRAFT — TEMPORARY");
34
+ });
35
+
36
+ it("classifies a PROVISIONAL domain (activity_type, src/cvcs/activityType.v1.0.0.json)", () => {
37
+ const result = parseCvcStatus({
38
+ _status:
39
+ "PROVISIONAL — net-new value-CVC not yet in Notion; provisional 900+ numbering; " +
40
+ "substantive values sourced verbatim from the PAVE @pave/domain enum of the same name " +
41
+ "(D10 source-from-platform-common). PENDING canonical Notion authoring + steward " +
42
+ "ratification of titles/definitions.",
43
+ _source: "pave-2.0/packages/domain/src/enums.ts",
44
+ });
45
+ expect(result.maturity).toBe("provisional");
46
+ expect(result.ambiguous).toBe(false);
47
+ // Cited source is a PAVE TS enum, not a prototype YAML dump.
48
+ expect(result.sourceIsPrototype).toBe(false);
49
+ expect(result.sourcePath).toBeNull();
50
+ });
51
+
52
+ it("classifies a CANONICAL provenance-note domain as its own maturity, not 'draft'/'final' (admin_roles, src/cvcs/adminRoles.v1.0.0.json)", () => {
53
+ const result = parseCvcStatus({
54
+ _status:
55
+ "CANONICAL — imported 0.8.13 from the Notion Final CVC codebook (CVC-134 `core - admin " +
56
+ "roles`, Owner Crysta Price, Status 'Drafted - Needs Review'). Administrative role " +
57
+ "vocabulary for the canonical authorization model (IC-66). DISTINCT from CVC-135 " +
58
+ "`user_roles` (the operational/practitioner role axis) — a person may hold both.",
59
+ _source:
60
+ "htilabstech/prototype@a596eb9 Final CVCs/System Roles, Permissions, & Account " +
61
+ "Management (IC-66)/core - admin roles (CVC-134)",
62
+ });
63
+ // A "CANONICAL" leading marker is a provenance note on an ALREADY-ratified
64
+ // file — kept as its own state, distinct from "final" (the absent-field
65
+ // legacy case), so a caller can tell "explicitly marked ratified" apart
66
+ // from "predates the convention entirely".
67
+ expect(result.maturity).toBe("canonical");
68
+ expect(result.ambiguous).toBe(false);
69
+ expect(result.sourceIsPrototype).toBe(false);
70
+ });
71
+
72
+ it("classifies an absent `_status` as 'final' — legacy/unmarked, predates the convention (administering_jurisdiction, src/cvcs/administeringJurisdiction.v1.0.0.json)", () => {
73
+ const result = parseCvcStatus({});
74
+ expect(result.maturity).toBe("final");
75
+ expect(result.rawStatus).toBeNull();
76
+ expect(result.ambiguous).toBe(false);
77
+ expect(result.sourceIsPrototype).toBe(false);
78
+ expect(result.sourcePath).toBeNull();
79
+ });
80
+
81
+ it("flags the self-contradictory core_functions case as ambiguous, generically — not a special case for this one domain (src/cvcs/coreFunctions.v1.0.0.json)", () => {
82
+ const result = parseCvcStatus({
83
+ _status:
84
+ "DRAFTED — NEEDS REVIEW: canonical Notion CVC-133 (core - functions), verified v1.0, " +
85
+ "ported verbatim from the Notion codebook. Canonical numbering (133), NOT provisional. " +
86
+ "Per-entry lifecycle Status (v1 / future / not-started) is carried in each definition.",
87
+ _source: "Notion CVC-133 core - functions (collection://3211ef14-abcd-8024-867d-000be4b35a79)",
88
+ });
89
+ // Leading token "DRAFTED" still drives the primary classification…
90
+ expect(result.maturity).toBe("draft");
91
+ // …but the string also asserts "NOT provisional" later on, which the
92
+ // parser catches generically (scans the whole string for a negated
93
+ // maturity keyword) rather than via a domain-name special case, so any
94
+ // future domain authored in this same self-contradictory shape is also
95
+ // caught automatically.
96
+ expect(result.ambiguous).toBe(true);
97
+ });
98
+
99
+ it("falls back to a whole-string keyword scan when the leading token is none of the three convention words (share_purpose, src/cvcs/sharePurpose.v1.0.0.json)", () => {
100
+ const result = parseCvcStatus({
101
+ _status:
102
+ "Synced verbatim from canonical CVC-84 (renamed `core-sharing_purpose` 2026-08-19). " +
103
+ "8 core rows from `core_share_purpose.yaml` + 4 LEADS-wing rows from " +
104
+ "`core_share_purpose_extensions_leads.yaml`… The wing rows were RATIFIED 2026-07-03 " +
105
+ "and live-synced 2026-08-19 (no longer proposal-only).",
106
+ _source: "htilabstech/prototype data/cvcs/core_share_purpose.yaml + core_share_purpose_extensions_leads.yaml",
107
+ });
108
+ // Leading token is "Synced" — none of draft/provisional/canonical. The
109
+ // body contains exactly one keyword family ("canonical"), so the parser
110
+ // accepts it unambiguously rather than defaulting to "final" (which per
111
+ // the module rule is reserved for an ABSENT `_status`, not merely an
112
+ // unrecognized leading word on a present one).
113
+ expect(result.maturity).toBe("canonical");
114
+ expect(result.ambiguous).toBe(false);
115
+ });
116
+
117
+ it("reads the structured-object `_status` shape via its `vocabStatus` field, not the whole object (citizenship, src/cvcs/citizenship.v1.0.0.json)", () => {
118
+ const result = parseCvcStatus({
119
+ _status: {
120
+ vocabStatus: "provisional-pending-notion-ratification",
121
+ authoredBy: "platform-common 0.8.13",
122
+ evidence:
123
+ "prototype@a596eb9 'Final CVCs/Socioeconomic Demographics (IC-69)/Nationality & " +
124
+ "Citizenship (IC-60)/core - citizenship — codebook 2.csv' (252 rows) + " +
125
+ "CVC_INDEX.md:25 (core - citizenship = CVC-182, status 'Not started').",
126
+ },
127
+ });
128
+ expect(result.maturity).toBe("provisional");
129
+ expect(result.rawStatus).toBe("provisional-pending-notion-ratification");
130
+ expect(result.ambiguous).toBe(false);
131
+ });
132
+
133
+ it("reads the structured-object `_status` shape's 'canonical' vocabStatus (person_relationships, src/cvcs/personRelationships.v1.0.0.json)", () => {
134
+ const result = parseCvcStatus({
135
+ _status: { vocabStatus: "canonical", authoredBy: "platform-common 0.8.14" },
136
+ });
137
+ expect(result.maturity).toBe("canonical");
138
+ expect(result.rawStatus).toBe("canonical");
139
+ expect(result.ambiguous).toBe(false);
140
+ });
141
+
142
+ it("ignores a non-string `_source` and a `_source` with no prototype YAML citation", () => {
143
+ const noSource = parseCvcStatus({ _status: "DRAFT — x" });
144
+ expect(noSource.sourceIsPrototype).toBe(false);
145
+ expect(noSource.sourcePath).toBeNull();
146
+
147
+ const nonStringSource = parseCvcStatus({ _status: "DRAFT — x", _source: 42 });
148
+ expect(nonStringSource.sourceIsPrototype).toBe(false);
149
+ });
150
+ });
@@ -73,6 +73,8 @@ const SOT_FILES: readonly SotFile[] = [
73
73
  { file: "highestEducationLevelCompleted.v1.0.0.json", expectedDomain: "highest_education_level_completed" },
74
74
  { file: "preferredContactMethod.v1.0.0.json", expectedDomain: "preferred_contact_method" },
75
75
  { file: "sharePurpose.v1.0.0.json", expectedDomain: "share_purpose" },
76
+ // CVC-306 — generated from prototype canon (scripts/gen-share-response-reason.py).
77
+ { file: "shareResponseReason.v1.0.0.json", expectedDomain: "share_response_reason" },
76
78
  { file: "facilitatorEntityType.v1.0.0.json", expectedDomain: "facilitator_entity_type" },
77
79
  { file: "facilitatorSubrole.v1.0.0.json", expectedDomain: "facilitator_subrole" },
78
80
  { file: "maritalStatusLegal.v1.0.0.json", expectedDomain: "marital_status_legal" },
@@ -206,6 +208,14 @@ const SOT_FILES: readonly SotFile[] = [
206
208
  { file: "whyNots.v1.0.0.json", expectedDomain: "why_nots" },
207
209
  // ─── 0.8.13 held-item resolutions (Job A) ───
208
210
  { file: "citizenship.v1.0.0.json", expectedDomain: "citizenship" },
211
+ // CVC-181 — the country list CVC-182 shares. Authored 2026-08-26.
212
+ { file: "countries.v1.0.0.json", expectedDomain: "countries" },
213
+ // CVC-231 — the Determination Helper category taxonomy. Authored 2026-08-30,
214
+ // on the number Jevon ratified to it on 2026-08-28.
215
+ {
216
+ file: "determinationHelperCategories.v1.0.0.json",
217
+ expectedDomain: "determination_helper_categories",
218
+ },
209
219
  { file: "traffickingRelevantRole.v1.0.0.json", expectedDomain: "trafficking_relevant_role" },
210
220
  // ─── Domains the hand-maintained list previously OMITTED (found by the
211
221
  // CVC drift gate, which scans the directory instead of a list). ───
@@ -223,6 +233,12 @@ const SOT_FILES: readonly SotFile[] = [
223
233
  { file: "sessionNoteVisibility.v1.0.0.json", expectedDomain: "session_note_visibility" },
224
234
  { file: "specialNeedsDisabilities.v1.0.0.json", expectedDomain: "special_needs_disabilities" },
225
235
  { file: "suggestionSource.v1.0.0.json", expectedDomain: "suggestion_source" },
236
+ // ─── GDR §10.1 CAR-contract vocabularies (provisional 900-block; PAVE
237
+ // @pave/domain verbatim; bead pv-pgdr-cvc-source-gdr-10-1-bulk-publish). ───
238
+ { file: "assertionStatus.v1.0.0.json", expectedDomain: "assertion_status" },
239
+ { file: "createdBySystem.v1.0.0.json", expectedDomain: "created_by_system" },
240
+ { file: "subjectType.v1.0.0.json", expectedDomain: "subject_type" },
241
+ { file: "minorAdultStatus.v1.0.0.json", expectedDomain: "minor_adult_status" },
226
242
  ] as const;
227
243
 
228
244
  function loadSot(file: string): unknown {