@htilabs/platform-common-models 0.8.16 → 0.8.17

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 (45) hide show
  1. package/dist/constants/index.cjs +3 -1
  2. package/dist/constants/index.cjs.map +1 -1
  3. package/dist/constants/index.d.cts +1 -1
  4. package/dist/constants/index.d.ts +1 -1
  5. package/dist/constants/index.js +3 -1
  6. package/dist/constants/index.js.map +1 -1
  7. package/dist/{cvcEntry-0BIB9sen.d.cts → cvcEntry-DaDrEuTa.d.cts} +44 -44
  8. package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-DaDrEuTa.d.ts} +44 -44
  9. package/dist/cvcs/index.cjs +1267 -17
  10. package/dist/cvcs/index.cjs.map +1 -1
  11. package/dist/cvcs/index.d.cts +3016 -1698
  12. package/dist/cvcs/index.d.ts +3016 -1698
  13. package/dist/cvcs/index.js +1266 -17
  14. package/dist/cvcs/index.js.map +1 -1
  15. package/dist/{index-CDoqrfc1.d.ts → index-C0J3f169.d.ts} +1 -1
  16. package/dist/{index-Zu_mOJRn.d.cts → index-EPjPjR0z.d.cts} +1 -1
  17. package/dist/index.cjs +1351 -20
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +91 -8
  20. package/dist/index.d.ts +91 -8
  21. package/dist/index.js +1349 -20
  22. package/dist/index.js.map +1 -1
  23. package/dist/models/index.d.cts +2 -2
  24. package/dist/models/index.d.ts +2 -2
  25. package/dist/{platform-auth-AsfnIXfK.d.cts → platform-auth-CvQkzOy1.d.cts} +1 -1
  26. package/dist/{platform-auth-AsfnIXfK.d.ts → platform-auth-CvQkzOy1.d.ts} +1 -1
  27. package/dist/schemas/index.cjs.map +1 -1
  28. package/dist/schemas/index.d.cts +35 -35
  29. package/dist/schemas/index.d.ts +35 -35
  30. package/dist/schemas/index.js.map +1 -1
  31. package/dist/types/index.d.cts +2 -2
  32. package/dist/types/index.d.ts +2 -2
  33. package/package.json +26 -25
  34. package/src/__sot__/coreIndicators.pin.json +2 -1
  35. package/src/__tests__/__snapshots__/cvc-sot.snap +4 -4
  36. package/src/__tests__/core-information-scope-invariant.test.ts +134 -0
  37. package/src/__tests__/cvc-136-scoring-invariant.test.ts +7 -5
  38. package/src/__tests__/cvc-drift-gate.test.ts +26 -5
  39. package/src/__tests__/cvc-sot-snapshot.test.ts +11 -4
  40. package/src/constants/ic.ts +74 -4
  41. package/src/cvcs/coreIndicators.v1.0.0.json +18 -5
  42. package/src/cvcs/coreInformationScope.v1.0.0.json +1165 -0
  43. package/src/cvcs/index.ts +2 -0
  44. package/src/cvcs/sharePurpose.v1.0.0.json +80 -12
  45. package/src/generated/cvc-enums.ts +88 -3
@@ -1,5 +1,5 @@
1
- import { P as PlatformToolValue, F as FunctionStatusValue, R as RoleLevelValue, S as ShareViewValue, a as PermissionStateValue } from '../platform-auth-AsfnIXfK.cjs';
2
- export { A as AccommodationValue, b as AgeBinReportingValue, c as AppScopeValue, d as ApparentAgeValue, D as DataQualityValue, e as FormStatusValue, f as FormTypeValue, I as IC13Category, g as IC13Value, h as IC22Value, i as IC23Value, j as IC24Value, k as IC25Value, l as IC49ReferralOutcomeValue, m as IC49ReferralVerificationValue, n as IC49Value, o as IC4Value, p as IC56Value, q as IC57Value, r as IC58Value, s as IC59Value, t as IC5Value, u as IncidentInvolvementRoleValue, v as IncidentParticipationRoleValue, w as InteractionTypeValue, M as MinorAdultStatusValue, x as PersonDisplayCategoryValue, y as PersonRoleValue, z as PersonTypeValue, Q as QuestionFormatValue, B as QuickStartTemplateId, C as RecordStateValue, E as RelationshipConcernValue, G as RelationshipDynamicValue, H as SessionStateValue, J as SubmissionStateValue, U as UserStatusValue } from '../platform-auth-AsfnIXfK.cjs';
1
+ import { P as PlatformToolValue, F as FunctionStatusValue, R as RoleLevelValue, S as ShareViewValue, a as PermissionStateValue } from '../platform-auth-CvQkzOy1.cjs';
2
+ export { A as AccommodationValue, b as AgeBinReportingValue, c as AppScopeValue, d as ApparentAgeValue, D as DataQualityValue, e as FormStatusValue, f as FormTypeValue, I as IC13Category, g as IC13Value, h as IC22Value, i as IC23Value, j as IC24Value, k as IC25Value, l as IC49ReferralOutcomeValue, m as IC49ReferralVerificationValue, n as IC49Value, o as IC4Value, p as IC56Value, q as IC57Value, r as IC58Value, s as IC59Value, t as IC5Value, u as IncidentInvolvementRoleValue, v as IncidentParticipationRoleValue, w as InteractionTypeValue, M as MinorAdultStatusValue, x as PersonDisplayCategoryValue, y as PersonRoleValue, z as PersonTypeValue, Q as QuestionFormatValue, B as QuickStartTemplateId, C as RecordStateValue, E as RelationshipConcernValue, G as RelationshipDynamicValue, H as SessionStateValue, J as SubmissionStateValue, U as UserStatusValue } from '../platform-auth-CvQkzOy1.cjs';
3
3
 
4
4
  /**
5
5
  * @htilabs/platform-common-models — Platform Authorization Types
@@ -1,5 +1,5 @@
1
- import { P as PlatformToolValue, F as FunctionStatusValue, R as RoleLevelValue, S as ShareViewValue, a as PermissionStateValue } from '../platform-auth-AsfnIXfK.js';
2
- export { A as AccommodationValue, b as AgeBinReportingValue, c as AppScopeValue, d as ApparentAgeValue, D as DataQualityValue, e as FormStatusValue, f as FormTypeValue, I as IC13Category, g as IC13Value, h as IC22Value, i as IC23Value, j as IC24Value, k as IC25Value, l as IC49ReferralOutcomeValue, m as IC49ReferralVerificationValue, n as IC49Value, o as IC4Value, p as IC56Value, q as IC57Value, r as IC58Value, s as IC59Value, t as IC5Value, u as IncidentInvolvementRoleValue, v as IncidentParticipationRoleValue, w as InteractionTypeValue, M as MinorAdultStatusValue, x as PersonDisplayCategoryValue, y as PersonRoleValue, z as PersonTypeValue, Q as QuestionFormatValue, B as QuickStartTemplateId, C as RecordStateValue, E as RelationshipConcernValue, G as RelationshipDynamicValue, H as SessionStateValue, J as SubmissionStateValue, U as UserStatusValue } from '../platform-auth-AsfnIXfK.js';
1
+ import { P as PlatformToolValue, F as FunctionStatusValue, R as RoleLevelValue, S as ShareViewValue, a as PermissionStateValue } from '../platform-auth-CvQkzOy1.js';
2
+ export { A as AccommodationValue, b as AgeBinReportingValue, c as AppScopeValue, d as ApparentAgeValue, D as DataQualityValue, e as FormStatusValue, f as FormTypeValue, I as IC13Category, g as IC13Value, h as IC22Value, i as IC23Value, j as IC24Value, k as IC25Value, l as IC49ReferralOutcomeValue, m as IC49ReferralVerificationValue, n as IC49Value, o as IC4Value, p as IC56Value, q as IC57Value, r as IC58Value, s as IC59Value, t as IC5Value, u as IncidentInvolvementRoleValue, v as IncidentParticipationRoleValue, w as InteractionTypeValue, M as MinorAdultStatusValue, x as PersonDisplayCategoryValue, y as PersonRoleValue, z as PersonTypeValue, Q as QuestionFormatValue, B as QuickStartTemplateId, C as RecordStateValue, E as RelationshipConcernValue, G as RelationshipDynamicValue, H as SessionStateValue, J as SubmissionStateValue, U as UserStatusValue } from '../platform-auth-CvQkzOy1.js';
3
3
 
4
4
  /**
5
5
  * @htilabs/platform-common-models — Platform Authorization Types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htilabs/platform-common-models",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "description": "Shared constants, types, and models for HTI Labs applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -62,6 +62,30 @@
62
62
  "dist",
63
63
  "src"
64
64
  ],
65
+ "scripts": {
66
+ "build": "tsup",
67
+ "dev": "tsup --watch",
68
+ "typecheck": "tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
69
+ "lint": "eslint src --ext .ts",
70
+ "lint:fix": "eslint src --ext .ts --fix",
71
+ "test": "vitest run",
72
+ "test:watch": "vitest",
73
+ "test:snapshot": "UPDATE_SNAPSHOT=1 vitest run",
74
+ "clean": "rm -rf dist",
75
+ "codegen:cvc": "tsx scripts/codegen-cvc-enums.ts",
76
+ "codegen:cvc:check": "tsx scripts/codegen-cvc-enums.ts --check",
77
+ "sot:pins": "tsx scripts/sot-pins.ts",
78
+ "sot:pins:check": "tsx scripts/sot-pins.ts --check",
79
+ "gate:cvc": "vitest run src/__tests__/cvc-drift-gate.test.ts",
80
+ "bridge:codebook": "tsx scripts/codebook-bridge.ts",
81
+ "bridge:codebook:check": "tsx scripts/codebook-bridge.ts --check",
82
+ "test:bridge": "node --import tsx --test scripts/codebook-bridge.test.ts",
83
+ "seed:cvc": "tsx scripts/seed-cvc.ts",
84
+ "seed:cvc:all": "tsx scripts/seed-all-cvcs.ts",
85
+ "test:seed": "node --import tsx --test scripts/seed-cvc.test.ts",
86
+ "test:guard": "node --import tsx --test scripts/lib/confirmTargetDb.test.ts",
87
+ "prepublishOnly": "npm run build"
88
+ },
65
89
  "keywords": [
66
90
  "hti",
67
91
  "platform-common",
@@ -96,28 +120,5 @@
96
120
  },
97
121
  "engines": {
98
122
  "node": ">=18.0.0"
99
- },
100
- "scripts": {
101
- "build": "tsup",
102
- "dev": "tsup --watch",
103
- "typecheck": "tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
104
- "lint": "eslint src --ext .ts",
105
- "lint:fix": "eslint src --ext .ts --fix",
106
- "test": "vitest run",
107
- "test:watch": "vitest",
108
- "test:snapshot": "UPDATE_SNAPSHOT=1 vitest run",
109
- "clean": "rm -rf dist",
110
- "codegen:cvc": "tsx scripts/codegen-cvc-enums.ts",
111
- "codegen:cvc:check": "tsx scripts/codegen-cvc-enums.ts --check",
112
- "sot:pins": "tsx scripts/sot-pins.ts",
113
- "sot:pins:check": "tsx scripts/sot-pins.ts --check",
114
- "gate:cvc": "vitest run src/__tests__/cvc-drift-gate.test.ts",
115
- "bridge:codebook": "tsx scripts/codebook-bridge.ts",
116
- "bridge:codebook:check": "tsx scripts/codebook-bridge.ts --check",
117
- "test:bridge": "node --import tsx --test scripts/codebook-bridge.test.ts",
118
- "seed:cvc": "tsx scripts/seed-cvc.ts",
119
- "seed:cvc:all": "tsx scripts/seed-all-cvcs.ts",
120
- "test:seed": "node --import tsx --test scripts/seed-cvc.test.ts",
121
- "test:guard": "node --import tsx --test scripts/lib/confirmTargetDb.test.ts"
122
123
  }
123
- }
124
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sourceRepo": "htilabstech/prototype",
3
3
  "sourceFile": "data/core_indicators.yaml",
4
- "sourceSha": "84a1b67",
4
+ "sourceSha": "622410b",
5
5
  "codes": [
6
6
  "abuser_evading_legal_consequences",
7
7
  "abuser_has_weapon",
@@ -10,6 +10,7 @@
10
10
  "abuser_unemployed",
11
11
  "access_to_vulnerable_individuals",
12
12
  "acknowledgement_or_report_of_human_trafficking",
13
+ "active_protective_order",
13
14
  "ads_available_247",
14
15
  "ads_imply_multiple_workers",
15
16
  "ads_prost_slang",
@@ -99,8 +99,8 @@
99
99
  "hash": "c3fcaec7ef08f185748463adc1e73dc6a1ff196601f16a6453f737577f3dfd90"
100
100
  },
101
101
  "share_purpose": {
102
- "count": 8,
103
- "hash": "ccefed1af82759ca59ad45e3850119db87e3411db57d9ce3039d874474498422"
102
+ "count": 12,
103
+ "hash": "a3ecb1ffab4f32c5cd19afbc43278f0de0538c608464ae434595a7ff98552f65"
104
104
  },
105
105
  "facilitator_entity_type": {
106
106
  "count": 14,
@@ -599,8 +599,8 @@
599
599
  "hash": "90aec290aa586a9bbc098c0c8a19536e06b705b054e4444ff6461a9913340a5c"
600
600
  },
601
601
  "core_indicators": {
602
- "count": 219,
603
- "hash": "b389bf68c84985e66445ac9a42b5c98ca36f10592dc820f909fc4e71c7f421bc"
602
+ "count": 220,
603
+ "hash": "634ba69f31273bace3c3be9509aba41f4c348086210905e42a6f97d393c64fbb"
604
604
  },
605
605
  "risk_severity_band": {
606
606
  "count": 9,
@@ -0,0 +1,134 @@
1
+ /**
2
+ * CORE INFORMATION SCOPE (CVC-236) — the invariants adoption depends on
3
+ * ==================================================================
4
+ *
5
+ * Two vocabularies describe the same thing at different grains:
6
+ *
7
+ * `roi_scope` flat item vocabulary, 27 substantive keys, no category axis
8
+ * `core_information_scope` 12 policy-grain CATEGORIES + 54 authorization-grain UNITS
9
+ *
10
+ * PAVE and Thread are both pinned to `roi_scope` today, and both persist stored
11
+ * ROIs against it. Migrating them to this domain is safe for exactly one reason:
12
+ * every substantive `roi_scope` key survives here, spelled identically, so a
13
+ * stored ROI keeps its exact recorded meaning. That is not a nice-to-have — an
14
+ * ROI whose meaning widens is a CONSENT change wearing a data change's clothes,
15
+ * and one already shipped on the CaseShare lane when a coarse->granular table
16
+ * expanded `caseNotes` to include screening notes the survivor never authorized.
17
+ *
18
+ * So the subset property below is the whole basis for calling adoption additive.
19
+ * If it ever fails, adoption stops being a migration and becomes a re-consent.
20
+ *
21
+ * The grain invariants matter for a different reason: canon states that
22
+ * categories are the POLICY grain and units are the AUTHORIZATION grain. A
23
+ * selectable category would let a policy row be cited as if it were consent.
24
+ */
25
+
26
+ import { readFileSync } from "node:fs";
27
+ import path from "node:path";
28
+ import { fileURLToPath } from "node:url";
29
+
30
+ import { describe, it, expect } from "vitest";
31
+
32
+ const here = path.dirname(fileURLToPath(import.meta.url));
33
+ const cvcDir = path.join(here, "..", "cvcs");
34
+
35
+ interface Entry {
36
+ code: string;
37
+ key: string;
38
+ selectable: boolean;
39
+ parentCode: string | null;
40
+ childCodes: string[];
41
+ shareableDefault?: boolean;
42
+ required?: boolean;
43
+ platformFloor?: boolean;
44
+ }
45
+
46
+ const read = (f: string): { entries: Entry[]; levels: Record<string, string> } =>
47
+ JSON.parse(readFileSync(path.join(cvcDir, f), "utf8")) as {
48
+ entries: Entry[];
49
+ levels: Record<string, string>;
50
+ };
51
+
52
+ const scope = read("coreInformationScope.v1.0.0.json");
53
+ const roi = read("roiScope.v1.0.0.json");
54
+
55
+ const byCode = new Map(scope.entries.map((e) => [e.code, e]));
56
+ const MISSINGNESS = new Set([
57
+ "missingness_root",
58
+ "unknown",
59
+ "anonymous",
60
+ "data_not_collected",
61
+ ]);
62
+
63
+ const isMissingness = (e: Entry): boolean =>
64
+ MISSINGNESS.has(e.key) ||
65
+ (e.parentCode !== null && byCode.get(e.parentCode)?.key === "missingness_root");
66
+
67
+ const categories = scope.entries.filter(
68
+ (e) => e.parentCode === null && !isMissingness(e),
69
+ );
70
+ const units = scope.entries.filter(
71
+ (e) => e.parentCode !== null && !isMissingness(e),
72
+ );
73
+
74
+ describe("core_information_scope — adoption invariants", () => {
75
+ it("carries every substantive roi_scope key, spelled identically", () => {
76
+ const roiSubstantive = roi.entries
77
+ .map((e) => e.key)
78
+ .filter((k) => !MISSINGNESS.has(k));
79
+ const unitKeys = new Set(units.map((u) => u.key));
80
+ const missing = roiSubstantive.filter((k) => !unitKeys.has(k));
81
+
82
+ // A failure here means a stored ROI can no longer be expressed in the new
83
+ // vocabulary — re-consent, not migration.
84
+ expect(missing).toEqual([]);
85
+ expect(roiSubstantive.length).toBe(27);
86
+ });
87
+
88
+ it("is a strict superset — the additions are additions, not renames", () => {
89
+ expect(units.length).toBeGreaterThan(27);
90
+ expect(units).toHaveLength(54);
91
+ });
92
+
93
+ it("keeps the two grains distinct: categories decide policy, units carry consent", () => {
94
+ expect(categories).toHaveLength(12);
95
+ expect(categories.every((c) => c.selectable === false)).toBe(true);
96
+ expect(units.every((u) => u.selectable === true)).toBe(true);
97
+ });
98
+
99
+ it("wires every unit to exactly one category, reciprocally", () => {
100
+ for (const u of units) {
101
+ const parent = byCode.get(u.parentCode as string);
102
+ expect(parent, `unit ${u.key} has a dangling parent`).toBeDefined();
103
+ expect(parent?.selectable, `unit ${u.key} hangs off a selectable row`).toBe(
104
+ false,
105
+ );
106
+ expect(parent?.childCodes, `category ${parent?.key} disowns ${u.key}`).toContain(
107
+ u.code,
108
+ );
109
+ }
110
+ expect(categories.flatMap((c) => c.childCodes)).toHaveLength(units.length);
111
+ });
112
+
113
+ it("publishes the posture sets as data, so they stop being literals", () => {
114
+ const of = (p: (u: Entry) => boolean): string[] =>
115
+ units.filter(p).map((u) => u.key).sort();
116
+
117
+ // shareable_default:false — the picker must not pre-check these.
118
+ expect(of((u) => u.shareableDefault === false)).toEqual([
119
+ "federal_protection_applications",
120
+ "hiv_status",
121
+ "immigration_status",
122
+ "le_report_status",
123
+ "safe_locations",
124
+ "tvap_enrollment",
125
+ "uscis_alien_number",
126
+ ]);
127
+
128
+ // The platform safety floor — enforceable BELOW the scope layer.
129
+ expect(of((u) => u.platformFloor === true)).toEqual(["safe_locations"]);
130
+
131
+ // Always included; currently a hardcoded string in both apps.
132
+ expect(of((u) => u.required === true)).toEqual(["system_info"]);
133
+ });
134
+ });
@@ -261,12 +261,14 @@ describe("CVC-136 core_indicators", () => {
261
261
  ]);
262
262
  });
263
263
 
264
- it("has exactly 215 substantive codes (213 canonical + 2 scoring-ahead)", () => {
264
+ it("has exactly 216 substantive codes (214 canonical + 2 scoring-ahead)", () => {
265
265
  // 0.8.14 refreshed the catalog pin a596eb9 (208) -> 84a1b67 (213):
266
- // +5 upstream mints, 0 withdrawn. The 2 scoring-ahead codes are unchanged
267
- // and still absent upstream.
268
- expect(substantive.length).toBe(215);
269
- expect(envelope.entries.length).toBe(219);
266
+ // +5 upstream mints, 0 withdrawn.
267
+ // This refresh took it again 84a1b67 (213) -> 622410b (214): +1 upstream
268
+ // mint (`active_protective_order`, minted 2026-08-08), 0 withdrawn. The 2
269
+ // scoring-ahead codes are unchanged and still absent upstream.
270
+ expect(substantive.length).toBe(216);
271
+ expect(envelope.entries.length).toBe(220);
270
272
  });
271
273
 
272
274
  it("has no duplicate keys", () => {
@@ -218,6 +218,18 @@ const INDEX_ABSENT: Record<string, { cvc: number; reason: string }> = {
218
218
  // but CVC_INDEX.md carries no row. Not a squat (nothing else claims these
219
219
  // numbers) — but each needs a Notion index row to become verifiable.
220
220
  service_categories: { cvc: 22, reason: "no CVC_INDEX row" },
221
+ // Authored directly in the live Notion inline DB (2026-08-13, restructured
222
+ // 2026-08-14), so no `Final CVCs/` export exists yet and extract_final_cvcs.py
223
+ // emits no row. The number is the domain's own self-declaration —
224
+ // `data/cvcs/core_information_scope.yaml` carries `cvc_id: "CVC-236"` — and
225
+ // nothing else claims 236 (233 and 235 and 238 are bound elsewhere; 236 and
226
+ // 237 are unoccupied), so this is index-absent rather than a squat. NOT parked
227
+ // at 900+ on purpose: that block is for vocabularies with no canonical number,
228
+ // and parking a numbered domain there would leave 236 looking free.
229
+ core_information_scope: {
230
+ cvc: 236,
231
+ reason: "authored in the live Notion inline DB; no Final CVCs/ export yet",
232
+ },
221
233
  // Trunk-only domain: authored on `kl-develop` (80341e0, "promote CVC-17 +
222
234
  // CVC-67 to SOT"), which the canonical 0.8.13 line never saw. Its sibling
223
235
  // CVC-17 (gender_identity) IS in CVC_INDEX.md and is bound above; 67 is not
@@ -594,14 +606,23 @@ describe("SOT pins carry their provenance", () => {
594
606
  });
595
607
 
596
608
  it("the pinned SOT is the one this release was authored against", () => {
597
- // cvcIndex stays at a596eb9 — the CVC NUMBER<->NAME registry did not move.
609
+ // cvcIndex stays at a596eb9 — deliberately NOT bumped here. CVC_INDEX.md
610
+ // HAS moved upstream (2026-08-02 targeted live refresh: CVC-93/95/159/177/196
611
+ // rows), but absorbing it means reconciling INDEX_ABSENT for
612
+ // juvenile_justice_involvement_status (95) and the child-welfare rows (93/196),
613
+ // which is its own reconcile — a pin bump without conformance is exactly the
614
+ // lie sot-pins.ts warns about. Tracked separately; `sot:pins:check` will keep
615
+ // reporting cvcIndex drift until it lands.
598
616
  // coreIndicators advanced to 84a1b67 in 0.8.14 (+5 upstream mints, 0
599
- // withdrawn); scoringEmits is unchanged, so the 2 SCORING_AHEAD_OF_CATALOG
600
- // codes remain ahead of the catalog exactly as before.
617
+ // withdrawn) and to 622410b in this refresh (+1: `active_protective_order`,
618
+ // minted upstream 2026-08-08, `code_status: canonical`, plus the projected-
619
+ // field revisions on 136-007 / 136-094); scoringEmits is unchanged,
620
+ // so the 2 SCORING_AHEAD_OF_CATALOG codes remain ahead of the catalog
621
+ // exactly as before.
601
622
  expect(cvcIndexPin.sourceSha).toBe("a596eb9");
602
- expect(coreIndicatorsPin.sourceSha).toBe("84a1b67");
623
+ expect(coreIndicatorsPin.sourceSha).toBe("622410b");
603
624
  expect(scoringEmitsPin.sourceSha).toBe("9b5d654");
604
- expect(coreIndicatorsPin.codes.length).toBe(213);
625
+ expect(coreIndicatorsPin.codes.length).toBe(214);
605
626
  expect(scoringEmitsPin.codes.length).toBe(169);
606
627
  });
607
628
  });
@@ -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;
@@ -628,7 +634,8 @@ const SOT_SPECS: readonly SotSpec[] = [
628
634
  // ─── 0.8.13 canonical CVC batch ───
629
635
  { file: "coreDhState.v1.0.0.json", domain: "dh_state", expectedCount: 9 },
630
636
  // 0.8.14: 214 -> 219 (catalog refresh a596eb9 -> 84a1b67; +5 mints, 0 withdrawn).
631
- { file: "coreIndicators.v1.0.0.json", domain: "core_indicators", expectedCount: 219 },
637
+ // 622410b refresh: 219 -> 220 (catalog refresh 84a1b67 -> 622410b; +1 mint, 0 withdrawn).
638
+ { file: "coreIndicators.v1.0.0.json", domain: "core_indicators", expectedCount: 220 },
632
639
  { file: "riskSeverityBand.v1.0.0.json", domain: "risk_severity_band", expectedCount: 9 },
633
640
  { file: "adminRoles.v1.0.0.json", domain: "admin_roles", expectedCount: 14 },
634
641
  { file: "userRoles.v1.0.0.json", domain: "user_roles", expectedCount: 19 },
@@ -5245,10 +5245,10 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5245
5245
  categoryLabel: CVC_136_CATEGORY_LABELS[category],
5246
5246
  }));
5247
5247
 
5248
- // ─── CVC-136: full core-indicators value set (CANONICAL, 215 codes) ─────
5248
+ // ─── CVC-136: full core-indicators value set (CANONICAL, 216 codes) ─────
5249
5249
  // The complete CVC-136 'core - indicators' vocabulary. As of 0.8.13 the
5250
5250
  // AUTHORITATIVE surface for this domain is the SOT JSON
5251
- // `src/cvcs/coreIndicators.v1.0.0.json` (219 entries = 215 substantive + the
5251
+ // `src/cvcs/coreIndicators.v1.0.0.json` (220 entries = 216 substantive + the
5252
5252
  // missingness quadruplet), which also carries the canonical `family`,
5253
5253
  // `polarity`, `severity`, `isAlert` and `alertWhen` entry attributes. This
5254
5254
  // hand-coded array is kept in lockstep with that JSON as a flat key list for
@@ -5272,7 +5272,7 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5272
5272
  // `emits_by_code` (weights/risk.weights.json @ 9b5d654) is present here.
5273
5273
  // Enforced by `src/__tests__/cvc-136-scoring-invariant.test.ts`.
5274
5274
  //
5275
- // 0.11.1 — 210 → 215 (catalog refresh, prototype a596eb9 → 84a1b677).
5275
+ // 0.8.14 — 210 → 215 (catalog refresh, prototype a596eb9 → 84a1b677).
5276
5276
  // The upstream catalog grew by 5 and withdrew none. All five are minted
5277
5277
  // upstream with `code_status: canonical` (three carry the 2026-07-17
5278
5278
  // TRA-vetting provenance), so this is catalog CATCH-UP, not invention —
@@ -5291,6 +5291,74 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5291
5291
  // New SOT entries are APPENDED at positional codes 136-211…136-215 so
5292
5292
  // every previously issued code keeps its number.
5293
5293
  //
5294
+ // Refresh to 622410b — 215 → 216 (catalog refresh, prototype 84a1b67 →
5295
+ // 622410b; the release number is assigned by the standalone chore(release)
5296
+ // commit, not claimed here).
5297
+ // The upstream catalog grew by 1 and withdrew none, so this is again
5298
+ // catalog CATCH-UP rather than net-new authoring: GATE B would have
5299
+ // reported the code as INVENTED only because the pin was stale.
5300
+ // + active_protective_order (AE-3 / q-ar-3)
5301
+ // Minted upstream 2026-08-08 with `code_status: canonical` (prototype
5302
+ // `4b3d40e4`, "Catalogue the protective-order disclosure"), emitted by the
5303
+ // INTAKE_MAP on `q-ar-3 == yes`. Definition, `family`, `polarity`,
5304
+ // `severity` and `is_alert` are carried VERBATIM from the catalog:
5305
+ // `lethality_dv` / `depends` / `caution` / `none`. The `isAlert: "none"`
5306
+ // is load-bearing and deliberate — per the Crysta ruling of 2026-08-08 the
5307
+ // code is catalogued DESCRIPTIVE and is NOT tree-mapped, because an order
5308
+ // is a protective act, not an alert condition; tree-mapping it would score
5309
+ // a survivor higher for having sought court protection. The counterparty-
5310
+ // gated scoring reads live elsewhere (`protection_order_against_trafficker`
5311
+ // on the Severity model; perpetrator leaf P-II-D). The signal reaches the
5312
+ // Severity model through the catalog's `lane_tiers`
5313
+ // (safety_planning: elevated · domestic_family_violence: review), which is
5314
+ // not a platform-common surface.
5315
+ // PAVE 2.0 needs this to express the AE-3 intake emission; without it the
5316
+ // AE instrument writes an assertion against a code that resolves to
5317
+ // nothing. `coreIndicators.pin.json` is refreshed to 622410b (214 codes)
5318
+ // in the same change; the 2 scoring-ahead codes remain absent upstream and
5319
+ // stay on the `SCORING_AHEAD_OF_CATALOG` allowlist, unchanged at exactly 2.
5320
+ // The new SOT entry is APPENDED at positional code 136-216 so every
5321
+ // previously issued code keeps its number.
5322
+ //
5323
+ // NOT ADDED, deliberately: `substance_use_concerns`. It is NOT a code in
5324
+ // the canonical catalog — it is a `legacy_aliases` member of the canonical
5325
+ // `serious_substance_use_or_introduced_to_drugs` (136-142, shipped since
5326
+ // 0.8.13, `vulnerability_context` / `depends` / `elevated` /
5327
+ // `isAlert: "pave"` / `alertWhen: "recency_under_year"`). Adding it as its
5328
+ // own code would be exactly the invention GATE B exists to stop. Consumers
5329
+ // binding a BH-2 substance-use emission must bind the canonical key.
5330
+ //
5331
+ // PROJECTED-FIELD REVISIONS carried in the same refresh. A pin bump is a
5332
+ // promise of FULL conformance to the pinned catalog, not just of its new
5333
+ // codes — the 84a1b67 → 622410b delta also revised two shipping codes, and
5334
+ // both are carried here (SOT JSON + this label map):
5335
+ // • `acknowledgement_or_report_of_human_trafficking` (136-007) — label
5336
+ // "Acknowledgement or report of human trafficking" →
5337
+ // "Human trafficking disclosure or report".
5338
+ // • `juvenile_justice_or_child_welfare_involvement` (136-094) —
5339
+ // definition gained "(system unspecified — deprecated combined code;
5340
+ // see read-time alias policy above)". LOAD-BEARING: the definition is
5341
+ // the only projected field that tells a consumer this code is
5342
+ // DEPRECATED. Upstream split it 2026-06-08 (Ava) into
5343
+ // `juvenile_justice_system_involvement` (136-095) +
5344
+ // `child_welfare_system_involvement` at the Core Profile capture layer,
5345
+ // and the Phase 2C combined→split migration (2026-08-02, Crysta) makes
5346
+ // the read-time alias policy binding: the row is NEVER deleted and
5347
+ // stored CARs are NEVER rewritten — a combined-code CAR resolves at
5348
+ // read/aggregation time as BOTH split codes, so any consumer keyed by a
5349
+ // split code must also key this one. Residual emitters are only the
5350
+ // captures that genuinely cannot name the system (IS-3.2.4 manual Yes;
5351
+ // TRA-34c parent-category-selected with no system subtype). The full
5352
+ // policy text lives in the catalog comment block above the row in
5353
+ // `data/core_indicators.yaml` @ 622410b.
5354
+ // Also reconciled here, INHERITED from the previous refresh: the
5355
+ // `sexualized_content_performance_activity` (136-146) definition. The
5356
+ // a596eb9 → 84a1b67 delta appended the SEXUALIZED-CONTENT-SPLIT-2026-07-15
5357
+ // UMBRELLA NOTE to it, and 0.8.14 shipped the pin bump without it, so the
5358
+ // definition has been stale since. It now carries the catalog text verbatim.
5359
+ // (Two remaining JSON-vs-YAML differences are round-trip artifacts, not
5360
+ // drift: an unescaped `fiancé` and unwrapped hard-wrapped lines.)
5361
+ //
5294
5362
  // CVC_136_ALERT_INDICATOR above is a legacy Thread-only surface with NO
5295
5363
  // canonical basis; it is deliberately left untouched in 0.8.13 (a separate
5296
5364
  // Thread cleanup). The canonical alert axis is the `isAlert` ATTRIBUTE on
@@ -5305,6 +5373,7 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5305
5373
  "abuser_unemployed",
5306
5374
  "access_to_vulnerable_individuals",
5307
5375
  "acknowledgement_or_report_of_human_trafficking",
5376
+ "active_protective_order",
5308
5377
  "ads_available_247",
5309
5378
  "ads_imply_multiple_workers",
5310
5379
  "ads_prost_slang",
@@ -5525,7 +5594,8 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5525
5594
  "abuser_threatened_suicide": "Abuser threatened suicide",
5526
5595
  "abuser_unemployed": "Abuser is unemployed",
5527
5596
  "access_to_vulnerable_individuals": "Access to or connections with vulnerable individuals",
5528
- "acknowledgement_or_report_of_human_trafficking": "Acknowledgement or report of human trafficking",
5597
+ "acknowledgement_or_report_of_human_trafficking": "Human trafficking disclosure or report",
5598
+ "active_protective_order": "Active protective order (client-reported)",
5529
5599
  "ads_available_247": "Advertises available anytime / 24-7",
5530
5600
  "ads_imply_multiple_workers": "Ads imply multiple workers",
5531
5601
  "ads_prost_slang": "Ad uses prostitution slang",
@@ -2,8 +2,8 @@
2
2
  "domain": "core_indicators",
3
3
  "name": "Core Indicators (CVC-136)",
4
4
  "version": "1.0.0",
5
- "_status": "CANONICAL — re-sourced 0.11.1 from the live canonical catalog `data/core_indicators.yaml` @ prototype HEAD 84a1b677 (213 codes; +5 vs the 0.8.13 pin a596eb9, 0 withdrawn), plus 2 codes that @hti/scoring (`weights/risk.weights.json` @ 9b5d654, `emits_by_code`) emits but the codebook has not yet adopted (`coercive_debt_pressure_youth`, `debt_terms_deceptive_youth`), each flagged `pendingUpstreamAdoption: true`. 215 substantive + the missingness quadruplet = 219 entries. New codes are APPENDED at 211-215 so every previously issued positional code stays stable.",
6
- "_source": "htilabstech/prototype@84a1b677 data/core_indicators.yaml + htilabstech/hti-scoring@9b5d654 weights/risk.weights.json (emits_by_code)",
5
+ "_status": "CANONICAL — re-sourced from the live canonical catalog `data/core_indicators.yaml` @ prototype HEAD 622410b (214 codes; +1 vs the 0.8.14 pin 84a1b67, 0 withdrawn, plus the projected-field revisions on 136-007 / 136-094 the same delta carried), plus 2 codes that @hti/scoring (`weights/risk.weights.json` @ 9b5d654, `emits_by_code`) emits but the codebook has not yet adopted (`coercive_debt_pressure_youth`, `debt_terms_deceptive_youth`), each flagged `pendingUpstreamAdoption: true`. 216 substantive + the missingness quadruplet = 220 entries. New codes are APPENDED at 216 so every previously issued positional code stays stable.",
6
+ "_source": "htilabstech/prototype@622410b data/core_indicators.yaml + htilabstech/hti-scoring@9b5d654 weights/risk.weights.json (emits_by_code)",
7
7
  "levels": {
8
8
  "0": "Unknown or Missing",
9
9
  "1": "Indicator"
@@ -135,7 +135,7 @@
135
135
  {
136
136
  "code": "136-007-000-000-000-000-000",
137
137
  "key": "acknowledgement_or_report_of_human_trafficking",
138
- "title": "Acknowledgement or report of human trafficking",
138
+ "title": "Human trafficking disclosure or report",
139
139
  "selectable": true,
140
140
  "parentCode": null,
141
141
  "childCodes": [],
@@ -1286,7 +1286,7 @@
1286
1286
  "selectable": true,
1287
1287
  "parentCode": null,
1288
1288
  "childCodes": [],
1289
- "definition": "Indication of involvement with juvenile justice and/or child welfare systems.",
1289
+ "definition": "Indication of involvement with juvenile justice and/or child welfare systems (system unspecified — deprecated combined code; see read-time alias policy above).",
1290
1290
  "family": "vulnerability_context",
1291
1291
  "polarity": "depends",
1292
1292
  "severity": "elevated",
@@ -1976,7 +1976,7 @@
1976
1976
  "selectable": true,
1977
1977
  "parentCode": null,
1978
1978
  "childCodes": [],
1979
- "definition": "Canonical activity evidence (DH § II Activity 2.2 family) that the person engages in sexualized content, performance, or communications activity — recorded descriptively on a location capture; derivation happens in the risk tree.",
1979
+ "definition": "Canonical activity evidence (DH § II Activity 2.2 family) that the person engages in sexualized content, performance, or communications activity — recorded descriptively on a location capture; derivation happens in the risk tree. UMBRELLA NOTE (SEXUALIZED-CONTENT-SPLIT-2026-07-15, Crysta directive executing the 2026-07-15 Q2 ruling's codified path) — new capture that CAN distinguish online vs in-person fires the split variants below instead; this umbrella stays valid for existing captures and for sources that cannot make the distinction, and remains DOCK-ONLY in the DH (no prompt route — an honest prompt answer is impossible without the split).",
1980
1980
  "family": "cs_industry_context",
1981
1981
  "polarity": "increases_risk",
1982
1982
  "severity": "elevated",
@@ -2900,6 +2900,19 @@
2900
2900
  "polarity": "increases_risk",
2901
2901
  "severity": "severe",
2902
2902
  "isAlert": "none"
2903
+ },
2904
+ {
2905
+ "code": "136-216-000-000-000-000-000",
2906
+ "key": "active_protective_order",
2907
+ "title": "Active protective order (client-reported)",
2908
+ "selectable": true,
2909
+ "parentCode": null,
2910
+ "childCodes": [],
2911
+ "definition": "The client reported in intake screening that they currently hold a temporary or permanent protective order. A legal-status + safety-planning fact, NOT a trafficking-risk driver — catalogued descriptive, deliberately NOT tree-mapped (Crysta ruling 2026-08-08). The screening question captures no counterparty, so this code says only \"an order exists\", never who it restrains. The scoring reads of a protective order are counterparty-gated and record-keyed elsewhere and must stay there — the Severity acute driver protection_order_against_trafficker (relational; investigativeSeverity.ts) and the perpetrator leaf P-II-D (fires only on defendantPersonId === subject). Tree-mapping this code would score a survivor higher for having sought court protection, which is the Ship-B inversion (a victim's own order raising her P-II) relocated to the victim tree.",
2912
+ "family": "lethality_dv",
2913
+ "polarity": "depends",
2914
+ "severity": "caution",
2915
+ "isAlert": "none"
2903
2916
  }
2904
2917
  ]
2905
2918
  }