@htilabs/platform-common-models 0.12.0 → 0.12.1
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.
- package/dist/config/index.cjs +0 -81
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +4 -79
- package/dist/config/index.d.ts +4 -79
- package/dist/config/index.js +1 -79
- package/dist/config/index.js.map +1 -1
- package/dist/constants/index.cjs +18 -2
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +18 -2
- package/dist/constants/index.js.map +1 -1
- package/dist/cvc-Cp4uWnAa.d.cts +298 -0
- package/dist/cvc-Cp4uWnAa.d.ts +298 -0
- package/dist/cvcs/index.cjs +6678 -221
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +15019 -8052
- package/dist/cvcs/index.d.ts +15019 -8052
- package/dist/cvcs/index.js +6666 -221
- package/dist/cvcs/index.js.map +1 -1
- package/dist/enums/index.cjs +4557 -0
- package/dist/enums/index.cjs.map +1 -0
- package/dist/enums/index.d.cts +5257 -0
- package/dist/enums/index.d.ts +5257 -0
- package/dist/enums/index.js +4354 -0
- package/dist/enums/index.js.map +1 -0
- package/dist/{index-I-DiX9eQ.d.ts → index-CDoqrfc1.d.ts} +1 -1
- package/dist/{index-CoVr1jIV.d.cts → index-Zu_mOJRn.d.cts} +1 -1
- package/dist/index.cjs +7219 -232
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -4700
- package/dist/index.d.ts +7 -4700
- package/dist/index.js +7195 -232
- package/dist/index.js.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/mongo/index.cjs +0 -1
- package/dist/mongo/index.cjs.map +1 -1
- package/dist/mongo/index.js +1 -2
- package/dist/mongo/index.js.map +1 -1
- package/dist/{platform-auth-v53r3BhN.d.cts → platform-auth-Dv5fu0Fh.d.cts} +5 -4
- package/dist/{platform-auth-v53r3BhN.d.ts → platform-auth-Dv5fu0Fh.d.ts} +5 -4
- package/dist/schemas/index.cjs +5 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +25 -25
- package/dist/schemas/index.d.ts +25 -25
- package/dist/schemas/index.js +5 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/validation/index.cjs +58 -0
- package/dist/validation/index.cjs.map +1 -1
- package/dist/validation/index.d.cts +82 -283
- package/dist/validation/index.d.ts +82 -283
- package/dist/validation/index.js +57 -0
- package/dist/validation/index.js.map +1 -1
- package/package.json +10 -1
- package/src/__sot__/README.md +36 -1
- package/src/__sot__/coreIndicatorFields.ts +331 -0
- package/src/__sot__/coreIndicators.pin.json +1936 -2
- package/src/__sot__/cvcIndex.pin.json +8 -4
- package/src/__tests__/__snapshots__/cvc-sot.snap +41 -13
- package/src/__tests__/core-information-scope-invariant.test.ts +134 -0
- package/src/__tests__/cvc-136-scoring-invariant.test.ts +8 -3
- package/src/__tests__/cvc-181-182-country-parity.test.ts +163 -0
- package/src/__tests__/cvc-drift-gate.test.ts +445 -12
- package/src/__tests__/cvc-sot-snapshot.test.ts +73 -11
- package/src/__tests__/cvc-status-parser.test.ts +150 -0
- package/src/__tests__/cvc-structural.test.ts +14 -0
- package/src/__tests__/runtime-contract-validator.test.ts +1 -325
- package/src/config/index.ts +4 -189
- package/src/constants/ic.ts +120 -3
- package/src/cvcs/assertionDomain.v1.1.0.json +19 -1
- package/src/cvcs/assertionStatus.v1.0.0.json +80 -0
- package/src/cvcs/carCorrectionReason.v1.0.0.json +89 -0
- package/src/cvcs/caseShareState.v1.0.0.json +62 -0
- package/src/cvcs/coreIndicators.v1.0.0.json +83 -5
- package/src/cvcs/coreInformationScope.v1.0.0.json +1165 -0
- package/src/cvcs/countries.v1.0.0.json +3077 -0
- package/src/cvcs/createdBySystem.v1.0.0.json +89 -0
- package/src/cvcs/criminalOrgCategory.v1.0.0.json +116 -0
- package/src/cvcs/determinationHelperCategories.v1.0.0.json +1166 -0
- package/src/cvcs/incidentParticipationRoles.v1.0.0.json +11 -1
- package/src/cvcs/index.ts +32 -0
- package/src/cvcs/minorAdultStatus.v1.0.0.json +80 -0
- package/src/cvcs/personRelationships.v1.0.0.json +67 -2
- package/src/cvcs/referralOrigin.v1.0.0.json +26 -0
- package/src/cvcs/relationshipConcern.v1.0.0.json +28 -19
- package/src/cvcs/riskIdentificationMilestone.v1.0.0.json +109 -0
- package/src/cvcs/sessionTemplate.v1.0.0.json +22 -0
- package/src/cvcs/sharePurpose.v1.0.0.json +80 -12
- package/src/cvcs/subjectType.v1.0.0.json +80 -0
- package/src/generated/cvc-enums.ts +606 -20
- package/src/validation/cvcStatus.ts +209 -0
- package/src/validation/index.ts +1 -0
- package/dist/{cvcEntry-BCj1OWqL.d.cts → cvcEntry-0BIB9sen.d.cts} +8 -8
- package/dist/{cvcEntry-BCj1OWqL.d.ts → cvcEntry-0BIB9sen.d.ts} +8 -8
|
@@ -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 +
|
|
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:
|
|
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 —
|
|
246
|
-
//
|
|
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:
|
|
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:
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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,33 @@ 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
|
-
|
|
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
|
+
},
|
|
650
696
|
// CVC-235 — 4 L1 trafficking-relevant roles + 1 missingness root + 3 canonical
|
|
651
697
|
// missingness children = 8.
|
|
652
698
|
{
|
|
@@ -654,6 +700,22 @@ const SOT_SPECS: readonly SotSpec[] = [
|
|
|
654
700
|
domain: "trafficking_relevant_role",
|
|
655
701
|
expectedCount: 8,
|
|
656
702
|
},
|
|
703
|
+
// ─── GDR §10.1 CAR-contract vocabularies (provisional 900-block; PAVE
|
|
704
|
+
// @pave/domain verbatim; bead pv-pgdr-cvc-source-gdr-10-1-bulk-publish). ───
|
|
705
|
+
// 3 lifecycle states (@pave/domain ASSERTION_STATUSES) + 4 missingness = 7
|
|
706
|
+
{ file: "assertionStatus.v1.0.0.json", domain: "assertion_status", expectedCount: 7 },
|
|
707
|
+
// 4 correction/retraction reasons (@pave/domain CAR_CORRECTION_REASONS —
|
|
708
|
+
// entered_in_error, duplicate, superseded_externally — plus
|
|
709
|
+
// removed_by_recipient_curation for the CaseShare curation lane) + 4
|
|
710
|
+
// missingness = 8
|
|
711
|
+
{ file: "carCorrectionReason.v1.0.0.json", domain: "car_correction_reason", expectedCount: 8 },
|
|
712
|
+
// 4 actor classes (@pave/domain CREATED_BY_SYSTEMS) + 4 missingness = 8
|
|
713
|
+
{ file: "createdBySystem.v1.0.0.json", domain: "created_by_system", expectedCount: 8 },
|
|
714
|
+
// 3 entity kinds (@pave/domain SUBJECT_TYPES) + 4 missingness = 7
|
|
715
|
+
{ file: "subjectType.v1.0.0.json", domain: "subject_type", expectedCount: 7 },
|
|
716
|
+
// 3 substantive age bands (@pave/domain AGE_BANDS_AT_EVENT minus `unknown`,
|
|
717
|
+
// which maps to the missingness sentinel) + 4 missingness = 7
|
|
718
|
+
{ file: "minorAdultStatus.v1.0.0.json", domain: "minor_adult_status", expectedCount: 7 },
|
|
657
719
|
] as const;
|
|
658
720
|
|
|
659
721
|
// ─── 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
|
+
});
|
|
@@ -206,6 +206,14 @@ const SOT_FILES: readonly SotFile[] = [
|
|
|
206
206
|
{ file: "whyNots.v1.0.0.json", expectedDomain: "why_nots" },
|
|
207
207
|
// ─── 0.8.13 held-item resolutions (Job A) ───
|
|
208
208
|
{ file: "citizenship.v1.0.0.json", expectedDomain: "citizenship" },
|
|
209
|
+
// CVC-181 — the country list CVC-182 shares. Authored 2026-08-26.
|
|
210
|
+
{ file: "countries.v1.0.0.json", expectedDomain: "countries" },
|
|
211
|
+
// CVC-231 — the Determination Helper category taxonomy. Authored 2026-08-30,
|
|
212
|
+
// on the number Jevon ratified to it on 2026-08-28.
|
|
213
|
+
{
|
|
214
|
+
file: "determinationHelperCategories.v1.0.0.json",
|
|
215
|
+
expectedDomain: "determination_helper_categories",
|
|
216
|
+
},
|
|
209
217
|
{ file: "traffickingRelevantRole.v1.0.0.json", expectedDomain: "trafficking_relevant_role" },
|
|
210
218
|
// ─── Domains the hand-maintained list previously OMITTED (found by the
|
|
211
219
|
// CVC drift gate, which scans the directory instead of a list). ───
|
|
@@ -223,6 +231,12 @@ const SOT_FILES: readonly SotFile[] = [
|
|
|
223
231
|
{ file: "sessionNoteVisibility.v1.0.0.json", expectedDomain: "session_note_visibility" },
|
|
224
232
|
{ file: "specialNeedsDisabilities.v1.0.0.json", expectedDomain: "special_needs_disabilities" },
|
|
225
233
|
{ file: "suggestionSource.v1.0.0.json", expectedDomain: "suggestion_source" },
|
|
234
|
+
// ─── GDR §10.1 CAR-contract vocabularies (provisional 900-block; PAVE
|
|
235
|
+
// @pave/domain verbatim; bead pv-pgdr-cvc-source-gdr-10-1-bulk-publish). ───
|
|
236
|
+
{ file: "assertionStatus.v1.0.0.json", expectedDomain: "assertion_status" },
|
|
237
|
+
{ file: "createdBySystem.v1.0.0.json", expectedDomain: "created_by_system" },
|
|
238
|
+
{ file: "subjectType.v1.0.0.json", expectedDomain: "subject_type" },
|
|
239
|
+
{ file: "minorAdultStatus.v1.0.0.json", expectedDomain: "minor_adult_status" },
|
|
226
240
|
] as const;
|
|
227
241
|
|
|
228
242
|
function loadSot(file: string): unknown {
|