@htilabs/platform-common-models 0.12.3 → 0.13.0

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.
@@ -0,0 +1,301 @@
1
+ /**
2
+ * VICTIM ABUSE TYPES (CVC-73) — the canon v1.1 key-set pin
3
+ * ========================================================
4
+ *
5
+ * platform-common's CVC-73 mirror shipped STALE through 0.12.4: victimAbuseTypes
6
+ * v1.0.0 carried 25 substantive rows in the CVC-52 FUNDER dialect (adult/child
7
+ * age splits, `domestic_and_or_family_violence`, bare `other`, ...) plus an
8
+ * UNK/ANON/DNC block, while canon had been audited (2026-09-01, CVC73-AUDIT) and
9
+ * amended (2026-09-29, cyber_crimes) to 30 codes with no missingness. Nothing
10
+ * failed, because every gate in this package checks a SOT file against ITSELF
11
+ * (shape, tree, counts it was told) — none knew what canon's keys ARE.
12
+ *
13
+ * This test is that knowledge. The tables below are TRANSCRIBED from canon —
14
+ * htilabstech/prototype `data/cvcs/core_victim_abuse_types.yaml` @ 63913935
15
+ * (read from origin/main @ 06734d05) — NOT derived from the JSON, so a
16
+ * regenerated JSON that drifts from canon fails here instead of silently
17
+ * updating its own expectation. Canon line citations are to that blob:
18
+ *
19
+ * - The 30 codes, in canon row order (yaml `entries:` L185-L458).
20
+ * - "MISSINGNESS: deliberately none" (yaml L51-L57; gate G3 "FAILS if
21
+ * UNK/ANON/DNC appear here").
22
+ * - AGE + RECENCY are reporting gates, not codes (yaml L59-L64, Crysta R2):
23
+ * the adult/child split must NEVER come back as separate keys.
24
+ * - `trafficking_context: true` rows — censused, never counted (yaml L66-L72, R1).
25
+ * - `other_voca_ovc` is the only catch-all, `describe_required` (yaml L450-L458, R3).
26
+ *
27
+ * It also pins the FROZEN positional ordinals: a published ordinal is a
28
+ * concept's identity, never renumbered or reused (gen-victim-abuse-types.py).
29
+ */
30
+
31
+ import { readFileSync } from "node:fs";
32
+ import path from "node:path";
33
+ import { fileURLToPath } from "node:url";
34
+
35
+ import { describe, it, expect } from "vitest";
36
+
37
+ import { VictimAbuseTypesKeys } from "../generated/cvc-enums.js";
38
+
39
+ const here = path.dirname(fileURLToPath(import.meta.url));
40
+ const FILE = path.join(here, "..", "cvcs", "victimAbuseTypes.v1.1.0.json");
41
+
42
+ interface Entry {
43
+ code: string;
44
+ key: string;
45
+ title: string;
46
+ selectable: boolean;
47
+ parentCode: string | null;
48
+ childCodes: string[];
49
+ definition: string | null;
50
+ uiGroup: string;
51
+ ageRequired: boolean;
52
+ recencyRequired: boolean;
53
+ traffickingContext: boolean;
54
+ describeRequired: boolean;
55
+ }
56
+ interface Envelope {
57
+ domain: string;
58
+ version: string;
59
+ _status: string;
60
+ _source: string;
61
+ _supersedes: {
62
+ version: string;
63
+ keyMap: Record<string, string | null>;
64
+ retiredCodes: {
65
+ code: string;
66
+ key: string;
67
+ successor: string | null;
68
+ impliedAgeBandAtEvent?: "adult" | "minor";
69
+ }[];
70
+ notes: Record<string, string>;
71
+ };
72
+ uiGroups: { key: string; label: string }[];
73
+ levels: Record<string, string>;
74
+ entries: Entry[];
75
+ }
76
+
77
+ const env = JSON.parse(readFileSync(FILE, "utf8")) as Envelope;
78
+ const keys = env.entries.map((e) => e.key);
79
+
80
+ /** Canon v1.1 code → frozen ordinal, in canon row order (yaml L186-L450). */
81
+ const CANON: ReadonlyArray<readonly [key: string, ordinal: number]> = [
82
+ ["sexual_abuse_assault", 26],
83
+ ["domestic_family_violence", 9],
84
+ ["stalking_harassment", 22],
85
+ ["child_pornography", 7],
86
+ ["physical_abuse_or_neglect", 27],
87
+ ["physical_assault", 28],
88
+ ["commercial_sexual_exploitation_minor", 29],
89
+ ["sexual_exploitation", 30],
90
+ ["labor_exploitation", 31],
91
+ ["teen_dating_victimization", 24],
92
+ ["female_genital_mutilation_cutting", 32],
93
+ ["forced_marriage", 33],
94
+ ["gang_violence", 12],
95
+ ["kidnapping_noncustodial", 17],
96
+ ["kidnapping_custodial", 16],
97
+ ["elder_abuse_or_neglect", 11],
98
+ ["bullying", 4],
99
+ ["homicide", 14],
100
+ ["survivor_of_homicide_victim", 23],
101
+ ["hate_crime", 13],
102
+ ["robbery", 21],
103
+ ["burglary", 5],
104
+ ["arson", 3],
105
+ ["dui_dwi_incident", 10],
106
+ ["identity_theft_fraud_financial_crime", 15],
107
+ ["other_vehicular_victimization", 20],
108
+ ["cyber_crimes", 34],
109
+ ["terrorism", 25],
110
+ ["mass_violence", 18],
111
+ ["other_voca_ovc", 19],
112
+ ];
113
+
114
+ /**
115
+ * Every key v1.0.0 published (platform-common <= 0.12.4) that is NOT a canon
116
+ * key. None may reappear — each is either a funder-dialect spelling, an age
117
+ * split canon R2 forbids encoding, or a missingness token canon G3 forbids.
118
+ */
119
+ const RETIRED_V1_0_0_KEYS = [
120
+ "missingness_root",
121
+ "unknown",
122
+ "anonymous",
123
+ "data_not_collected",
124
+ "adult_physical_assault",
125
+ "adult_sexual_assault",
126
+ "child_physical_abuse_or_neglect",
127
+ "child_sexual_abuse_assault",
128
+ "domestic_and_or_family_violence",
129
+ "dui_dwi_incidents",
130
+ "elder_abuse",
131
+ "identity_theft",
132
+ "other",
133
+ "other_vehicular",
134
+ "survivors_of_homicide_victims",
135
+ ] as const;
136
+
137
+ /** v1.0.0 ordinals whose meaning canon changed — retired, never reused. */
138
+ const RETIRED_ORDINALS = [1, 2, 6, 8] as const;
139
+
140
+ const ord = (n: number): string => `073-${String(n).padStart(3, "0")}-000-000-000-000-000`;
141
+
142
+ describe("CVC-73 victim_abuse_types — canon v1.1 key set", () => {
143
+ it("is the v1.1.0 victim_abuse_types envelope", () => {
144
+ expect(env.domain).toBe("victim_abuse_types");
145
+ expect(env.version).toBe("1.1.0");
146
+ });
147
+
148
+ it("carries exactly canon's 30 keys, in canon row order", () => {
149
+ expect(keys).toEqual(CANON.map(([k]) => k));
150
+ expect(keys).toHaveLength(30);
151
+ });
152
+
153
+ it("every key sits on its FROZEN ordinal", () => {
154
+ const actual = Object.fromEntries(env.entries.map((e) => [e.key, e.code]));
155
+ const expected = Object.fromEntries(CANON.map(([k, n]) => [k, ord(n)]));
156
+ expect(actual).toEqual(expected);
157
+ });
158
+
159
+ it("no retired v1.0.0 ordinal is reused", () => {
160
+ const codes = new Set(env.entries.map((e) => e.code));
161
+ for (const n of RETIRED_ORDINALS) expect(codes.has(ord(n)), ord(n)).toBe(false);
162
+ });
163
+
164
+ it("carries NO missingness (canon L51: 'deliberately none'; G3)", () => {
165
+ expect(env.entries.filter((e) => e.code.split("-")[1] === "000")).toEqual([]);
166
+ expect(Object.keys(env.levels)).toEqual(["1"]);
167
+ });
168
+
169
+ it("no retired v1.0.0 key (funder dialect / age split / missingness) reappears", () => {
170
+ for (const k of RETIRED_V1_0_0_KEYS) expect(keys, k).not.toContain(k);
171
+ });
172
+
173
+ it("every entry is a flat, selectable, defined L1 row", () => {
174
+ for (const e of env.entries) {
175
+ expect(e.selectable, e.key).toBe(true);
176
+ expect(e.parentCode, e.key).toBeNull();
177
+ expect(e.childCodes, e.key).toEqual([]);
178
+ expect(e.definition, e.key).toBeTruthy();
179
+ expect(e.title, e.key).toBeTruthy();
180
+ }
181
+ });
182
+ });
183
+
184
+ describe("CVC-73 — the reporting gates and rulings canon encodes", () => {
185
+ const where = (pred: (e: Entry) => boolean): string[] =>
186
+ env.entries.filter(pred).map((e) => e.key).sort();
187
+
188
+ it("ageRequired marks exactly canon's VOCA age-split codes (R2)", () => {
189
+ expect(where((e) => e.ageRequired)).toEqual(
190
+ [
191
+ "commercial_sexual_exploitation_minor",
192
+ "labor_exploitation",
193
+ "physical_abuse_or_neglect",
194
+ "physical_assault",
195
+ "sexual_abuse_assault",
196
+ "sexual_exploitation",
197
+ ].sort(),
198
+ );
199
+ });
200
+
201
+ it("recencyRequired marks exactly the HMIS 4.11 code", () => {
202
+ expect(where((e) => e.recencyRequired)).toEqual(["domestic_family_violence"]);
203
+ });
204
+
205
+ it("traffickingContext marks exactly the three exploitation codes (R1)", () => {
206
+ expect(where((e) => e.traffickingContext)).toEqual(
207
+ ["commercial_sexual_exploitation_minor", "labor_exploitation", "sexual_exploitation"].sort(),
208
+ );
209
+ });
210
+
211
+ it("other_voca_ovc is the only catch-all, and requires a description (R3)", () => {
212
+ expect(where((e) => e.describeRequired)).toEqual(["other_voca_ovc"]);
213
+ });
214
+
215
+ it("every uiGroup is one of canon's ui_groups, in canon order (yaml L104-L149)", () => {
216
+ expect(env.uiGroups.map((g) => g.key)).toEqual([
217
+ "common",
218
+ "exploitation",
219
+ "ipv",
220
+ "property",
221
+ "public",
222
+ "other",
223
+ ]);
224
+ const groups = new Set(env.uiGroups.map((g) => g.key));
225
+ for (const e of env.entries) expect(groups.has(e.uiGroup), e.key).toBe(true);
226
+ });
227
+ });
228
+
229
+ describe("CVC-73 — supersession of v1.0.0 and provenance", () => {
230
+ it("_supersedes maps EVERY v1.0.0 key, to a live key or null", () => {
231
+ const live = new Set(keys);
232
+ const map = env._supersedes.keyMap;
233
+ expect(env._supersedes.version).toBe("1.0.0");
234
+ // 29 v1.0.0 entries: 4 missingness + 25 substantive.
235
+ expect(Object.keys(map)).toHaveLength(29);
236
+ for (const k of RETIRED_V1_0_0_KEYS) expect(Object.keys(map), k).toContain(k);
237
+ for (const [old, next] of Object.entries(map)) {
238
+ if (next !== null) expect(live.has(next), `${old} -> ${next}`).toBe(true);
239
+ }
240
+ for (const k of ["missingness_root", "unknown", "anonymous", "data_not_collected"]) {
241
+ expect(map[k], k).toBeNull();
242
+ }
243
+ });
244
+
245
+ it("the funder-dialect renames land on canon spellings", () => {
246
+ const map = env._supersedes.keyMap;
247
+ expect(map.domestic_and_or_family_violence).toBe("domestic_family_violence");
248
+ expect(map.adult_sexual_assault).toBe("sexual_abuse_assault");
249
+ expect(map.child_sexual_abuse_assault).toBe("sexual_abuse_assault");
250
+ expect(map.other).toBe("other_voca_ovc");
251
+ });
252
+
253
+ it("each retired age-split code records the age band its key implied", () => {
254
+ // Canon codebook 4: physical_assault Logic Notes "... when age_band_at_event
255
+ // = adult"; physical_abuse_or_neglect Guidance "set age_band_at_event = minor".
256
+ const bands = Object.fromEntries(
257
+ env._supersedes.retiredCodes
258
+ .filter((r) => r.impliedAgeBandAtEvent !== undefined)
259
+ .map((r) => [r.key, r.impliedAgeBandAtEvent]),
260
+ );
261
+ expect(bands).toEqual({
262
+ adult_physical_assault: "adult",
263
+ adult_sexual_assault: "adult",
264
+ child_physical_abuse_or_neglect: "minor",
265
+ child_sexual_abuse_assault: "minor",
266
+ });
267
+ });
268
+
269
+ it("flags that v1.0.0 `other` reads narrower under v1.1.0", () => {
270
+ const note = env._supersedes.notes.other;
271
+ for (const k of [
272
+ "commercial_sexual_exploitation_minor",
273
+ "sexual_exploitation",
274
+ "labor_exploitation",
275
+ "female_genital_mutilation_cutting",
276
+ "forced_marriage",
277
+ "cyber_crimes",
278
+ ]) {
279
+ expect(note, k).toContain(k);
280
+ }
281
+ });
282
+
283
+ it("_source pins the canon yaml at a SHA, read from origin/main", () => {
284
+ expect(env._source).toMatch(
285
+ /htilabstech\/prototype\/data\/cvcs\/core_victim_abuse_types\.yaml @ [0-9a-f]{8}/,
286
+ );
287
+ // The ref commit READ is deliberately NOT pinned (it would churn the SOT on
288
+ // every unrelated prototype commit) — only the canon-file commit is.
289
+ expect(env._source).toMatch(/read from origin\/main\)$/);
290
+ });
291
+
292
+ it("_status is a CANONICAL provenance note", () => {
293
+ expect(env._status.startsWith("CANONICAL — Notion CVC-73")).toBe(true);
294
+ });
295
+
296
+ it("the generated VictimAbuseTypesKeys is the same key → code map", () => {
297
+ expect(VictimAbuseTypesKeys).toEqual(
298
+ Object.fromEntries(env.entries.map((e) => [e.key, e.code])),
299
+ );
300
+ });
301
+ });
@@ -2,8 +2,8 @@
2
2
  "domain": "core_information_scope",
3
3
  "name": "Core Information Scope",
4
4
  "version": "1.0.0",
5
- "_status": "DRAFT: canonical number 236, self-declared by the source YAML (`cvc_id: CVC-236`); CVC_INDEX.md carries no row for it yet, so the drift gate classifies it INDEX_ABSENT. Sourced from canonical CVC-236 `core_information_scope` v2 (authored 2026-08-13, restructured 2026-08-14): 12 categories / 55 units. TWO GRAINS, deliberately modelled as hierarchy: L1 categories are the POLICY grain and are NOT selectable; L2 units are the AUTHORIZATION grain and are what an ROI or a share actually authorizes. This is the axis the sibling `roi_scope` domain deliberately omits — `roi_scope` is the flat item vocabulary, and its 27 substantive keys are a strict SUBSET of the 55 units here, with no renames and no collisions. That subset relationship is what makes adopting this domain additive: every stored ROI keeps its exact recorded meaning. `safe_locations` is PROVISIONAL and may be re-keyed by the Notion steward batch — pin the id with the product owner before any consumer treats it as stable. PENDING canonical Notion authoring + steward ratification.",
6
- "_source": "htilabstech/prototype/data/cvcs/core_information_scope.yaml @ 285a9f1d (CVC-236 v2, restructured 2026-08-14, amended 2026-09-29; read from origin/main; structural columns cross-checked against htilabstech/prototype/Final CVCs/System Roles, Permissions, & Account Management (IC-66)/core-information_scope — codebook.csv @ 285a9f1d)",
5
+ "_status": "DRAFT: canonical number 236, self-declared by the source YAML (`cvc_id: CVC-236`); CVC_INDEX.md carries no row for it yet, so the drift gate classifies it INDEX_ABSENT. Sourced from canonical CVC-236 `core_information_scope` v2 (authored 2026-08-13, restructured 2026-08-14): 12 categories / 56 units. TWO GRAINS, deliberately modelled as hierarchy: L1 categories are the POLICY grain and are NOT selectable; L2 units are the AUTHORIZATION grain and are what an ROI or a share actually authorizes. This is the axis the sibling `roi_scope` domain deliberately omits — `roi_scope` is the flat item vocabulary, and its 27 substantive keys are a strict SUBSET of the 56 units here, with no renames and no collisions. That subset relationship is what makes adopting this domain additive: every stored ROI keeps its exact recorded meaning. `safe_locations` is CANON since CVC236-AUDIT R1 (Crysta, 2026-09-08): id and label ratified and minted in the Notion codebook; the former PROVISIONAL marker is retired. PENDING canonical Notion authoring + steward ratification.",
6
+ "_source": "htilabstech/prototype/data/cvcs/core_information_scope.yaml @ 55088d44 (CVC-236 v2, restructured 2026-08-14, amended 2026-10-01; read from 46a60114; structural columns cross-checked against htilabstech/prototype/Final CVCs/System Roles, Permissions, & Account Management (IC-66)/core-information_scope — codebook.csv @ 55088d44)",
7
7
  "levels": {
8
8
  "0": "Unknown or Missing",
9
9
  "1": "Category (policy grain, not selectable)",
@@ -114,7 +114,7 @@
114
114
  "selectable": true,
115
115
  "parentCode": "236-001-000-000-000-000-000",
116
116
  "childCodes": [],
117
- "definition": "Addresses. Category `identifying`.",
117
+ "definition": "Addresses. Category `identifying`. LOCATION-TYPE-LOGIC 2026-10-01 (Crysta R1/R3): routed at TYPE grain since this date — the location entries whose CVC-191 reason declares share_unit addresses (the residence tier: current / prior residence · birthplace; the survivor's own whereabouts: current client/victim location · jurisdiction / routing · work / school / business · travel stop · other), each delivered with its type label. Where we met / where it happened rides encounter_location; trafficking-event locations ride victimization; legal locations ride system_involvement; the agency's own site rides nothing. The `address` assertion_domain stays mapped here for the viewing axis and the ADDRESS_* audit verbs.",
118
118
  "levelFloor": 3,
119
119
  "appRelevance": [
120
120
  "PAVE",
@@ -471,9 +471,10 @@
471
471
  "childCodes": [
472
472
  "236-003-001-000-000-000-000",
473
473
  "236-003-002-000-000-000-000",
474
- "236-003-003-000-000-000-000"
474
+ "236-003-003-000-000-000-000",
475
+ "236-003-004-000-000-000-000"
475
476
  ],
476
- "definition": "Contact & safety — policy-grain category. Units under it are the authorization grain. NARROWED 2026-08-14 (restructure ruling 2): contact/service history moved to the NEW services category. SUPERSEDES the 2026-08-13 deliberate-merge note; legacy `contact` grants resolve via the alias layer (CVC-69 precedent). LEADS flag dropped (no LEADS units — was an empty shell). | 2026-09-29 (PRIORITIES-SAFETY-SCOPE-UNIT, Crysta R1): third unit priorities_safety — the immediate-needs triage answers, one disclosure decision.",
477
+ "definition": "Contact & safety — policy-grain category. Units under it are the authorization grain. NARROWED 2026-08-14 (restructure ruling 2): contact/service history moved to the NEW services category. SUPERSEDES the 2026-08-13 deliberate-merge note; legacy `contact` grants resolve via the alias layer (CVC-69 precedent). LEADS flag dropped (no LEADS units — was an empty shell). | 2026-09-29 (PRIORITIES-SAFETY-SCOPE-UNIT, Crysta R1): third unit priorities_safety — the immediate-needs triage answers, one disclosure decision. | 2026-10-01 (LOCATION-TYPE-LOGIC, Crysta R2): fourth unit encounter_location — where we met / where it happened, the session- or event-anchored CVC-191 encounter reasons.",
477
478
  "levelFloor": 3,
478
479
  "appRelevance": [
479
480
  "PAVE",
@@ -505,7 +506,7 @@
505
506
  "selectable": true,
506
507
  "parentCode": "236-003-000-000-000-000-000",
507
508
  "childCodes": [],
508
- "definition": "Safe & confidential locations. Category `contact`. NEW 2026-08-18 (CASESHARE ADR settings-deltas WI-3, Ava directive — 'the safety floor sits above any agency's configuration'): the platform safety floor's example class (shelter placements / confidential program addresses) had NO CVC-236 item. Extends the standing agency-side confidential-address practice (surveys `confidential` flag → SRL masking) to the case-sharing layer. platform_floor marks it PLATFORM-OWNED — never enableable by any agency (HTI_PLATFORM_SAFETY_FLOOR + the § 5.79 resolver's floor layer 0); the generator therefore emits it to the platform scopeCatalog with `floor: true` and EXCLUDES it from the monolith PAVE/Thread share-drawer slice (that lane's floor semantics are deferred per the settings-deltas kickoff § 5 — an ordinary default-off toggle there would misstate 'never enableable'). Registry-homed 2026-08-19 after the value was first hand-authored inside the generator-owned platform block (broke the JSON gate — content lands HERE, never in the emitted block). PROVISIONAL vocabulary pending the CVC-236 Notion steward batch; id/label may be re-keyed by that batch.",
509
+ "definition": "Safe & confidential locations. Category `contact`. NEW 2026-08-18 (CASESHARE ADR settings-deltas WI-3, Ava directive — 'the safety floor sits above any agency's configuration'): the platform safety floor's example class (shelter placements / confidential program addresses) had NO CVC-236 item. Extends the standing agency-side confidential-address practice (surveys `confidential` flag → SRL masking) to the case-sharing layer. platform_floor marks it PLATFORM-OWNED — never enableable by any agency (HTI_PLATFORM_SAFETY_FLOOR + the § 5.79 resolver's floor layer 0); the generator therefore emits it to the platform scopeCatalog with `floor: true` and EXCLUDES it from the monolith PAVE/Thread share-drawer slice (that lane's floor semantics are deferred per the settings-deltas kickoff § 5 — an ordinary default-off toggle there would misstate 'never enableable'). Registry-homed 2026-08-19 after the value was first hand-authored inside the generator-owned platform block (broke the JSON gate — content lands HERE, never in the emitted block). RATIFIED 2026-09-08 (CVC236-AUDIT R1, Crysta): id and label are CANON and the row is now minted in the Notion codebook — this WAS the pending steward batch. Superseded the 21-day PROVISIONAL marker; retires RWT-NEW-caseshare-safe-locations-steward-2026-08-19.",
509
510
  "levelFloor": 3,
510
511
  "appRelevance": [
511
512
  "PAVE",
@@ -531,6 +532,22 @@
531
532
  "shareableDefault": true,
532
533
  "specialDataType": "survivor_confidential"
533
534
  },
535
+ {
536
+ "code": "236-003-004-000-000-000-000",
537
+ "key": "encounter_location",
538
+ "title": "Encounter location (where we met / where it happened)",
539
+ "selectable": true,
540
+ "parentCode": "236-003-000-000-000-000-000",
541
+ "childCodes": [],
542
+ "definition": "Encounter location (where we met / where it happened). Category `contact`. NEW 2026-10-01 (LOCATION-TYPE-LOGIC, Crysta R2): the location entries whose CVC-191 reason is session- or event-anchored — Meet / contact (the session card's Meetup / Incident role) and Incident — authorized as ONE disclosure decision, separate from Addresses. Why it exists: the session card's Meetup / Incident location is encounter-scoped (ADDRESS_INTEGRATION_PLAN row 3 — a meetup point that belongs to no person), so it was never on the survivor's record and never reached a share; Nate's PAVE 2.0 audit found the same hole from the other direction. Homed under Contact & safety on the 2026-09-29 R1 reasoning: where the survivor was found or met is the safety fact the next advocate needs. Routing is read from CVC-191 (`share_unit: encounter_location` on MEET_LOC + INCIDENT), never hand-listed here; the delivered copy carries each entry with its type label and the session it belongs to. The survivor's own current location stays under Addresses; the agency's own site rides nothing. UDD: capture.encounter_location (apps PAVE + Thread, assertion_domain address). Presets: full_collab (ROI) · Thread service_referral_packet + mandatory_report (derivation for veto, 2026-09-29 shape).",
543
+ "levelFloor": 3,
544
+ "appRelevance": [
545
+ "PAVE",
546
+ "Thread"
547
+ ],
548
+ "shareableDefault": true,
549
+ "specialDataType": "survivor_confidential"
550
+ },
534
551
  {
535
552
  "code": "236-004-000-000-000-000-000",
536
553
  "key": "services",
package/src/cvcs/index.ts CHANGED
@@ -62,6 +62,9 @@ import sexProviderSubroleSot from "./sexProviderSubrole.v1.0.0.json" with { type
62
62
  import relationshipTiesSot from "./relationshipTies.v1.0.0.json" with { type: "json" };
63
63
  import personRelationshipsSot from "./personRelationships.v1.0.0.json" with { type: "json" };
64
64
  import employmentStatusSot from "./employmentStatus.v1.0.0.json" with { type: "json" };
65
+ // CVC-191 — rows hand-authored 2026-04-22; the per-reason share-routing columns
66
+ // (tier · anchors · anchorDefault · shareUnit · safetyDefault) are overlaid from
67
+ // prototype canon by scripts/gen-location-type.py; re-run, don't hand-edit them.
65
68
  import locationTypeSot from "./locationType.v1.0.0.json" with { type: "json" };
66
69
  import referralEntityCategorySot from "./referralEntityCategory.v1.0.0.json" with { type: "json" };
67
70
  import incomeBenefitsSourcesSot from "./incomeBenefitsSources.v1.0.0.json" with { type: "json" };
@@ -146,7 +149,7 @@ import visaTypeSot from "./visaType.v1.0.0.json" with { type: "json" };
146
149
  import livingSituationSot from "./livingSituation.v1.0.0.json" with { type: "json" };
147
150
  import serviceAudienceSot from "./serviceAudience.v1.0.0.json" with { type: "json" };
148
151
  import hmisRelationshipToHohSot from "./hmisRelationshipToHoh.v1.0.0.json" with { type: "json" };
149
- import victimAbuseTypesSot from "./victimAbuseTypes.v1.0.0.json" with { type: "json" };
152
+ import victimAbuseTypesSot from "./victimAbuseTypes.v1.1.0.json" with { type: "json" };
150
153
  import htTypeSot from "./htType.v1.0.0.json" with { type: "json" };
151
154
  import relationshipConcernSot from "./relationshipConcern.v1.0.0.json" with { type: "json" };
152
155
  import recencyBandSot from "./recencyBand.v1.0.0.json" with { type: "json" };
@@ -2,6 +2,7 @@
2
2
  "domain": "location_type",
3
3
  "name": "Core Location Type",
4
4
  "version": "1.0.0",
5
+ "_source": "Rows: hand-authored 2026-04-22 from the April Notion codebook export (co-8ff.5.12); codes, keys, titles and definitions are unchanged since. LOGIC columns (tier · anchors · anchorDefault · shareUnit · safetyDefault): htilabstech/prototype/data/cvcs/core_location_type.yaml @ 55088d44 (CVC-191 v1.1, logic amended 2026-10-01; read from origin/main; cross-checked against htilabstech/prototype/Final CVCs/Location (IC-4)/core - location_type — codebook 1.csv + 2.csv @ 55088d44), overlaid by scripts/gen-location-type.py. NOT absorbed: 8 canon rows the package does not publish (TRAFFICKING_OCCURRENCE, VICTIM_IDENTIFICATION, COMMERCIAL_SEX_AD_POSTING, TRAFFICKING_RECRUITMENT, BIRTHPLACE, COURT_LOCATION, LE_INTERVIEW_LOCATION, LE_AGENCY_LOCATION) and the 4 labels canon reworded on 2026-08-28.",
5
6
  "levels": {
6
7
  "0": "Unknown or Missing",
7
8
  "1": "Category"
@@ -27,7 +28,12 @@
27
28
  "selectable": true,
28
29
  "parentCode": "191-000-000-000-000-000-000",
29
30
  "childCodes": [],
30
- "definition": "Unknown or cannot be determined from the available information."
31
+ "definition": "Unknown or cannot be determined from the available information.",
32
+ "tier": "sentinel",
33
+ "anchors": [],
34
+ "anchorDefault": null,
35
+ "shareUnit": null,
36
+ "safetyDefault": null
31
37
  },
32
38
  {
33
39
  "code": "191-000-000-000-000-000-002",
@@ -36,7 +42,12 @@
36
42
  "selectable": true,
37
43
  "parentCode": "191-000-000-000-000-000-000",
38
44
  "childCodes": [],
39
- "definition": "Information may be withheld by preference or due to redaction; identity is anonymous or redacted."
45
+ "definition": "Information may be withheld by preference or due to redaction; identity is anonymous or redacted.",
46
+ "tier": "sentinel",
47
+ "anchors": [],
48
+ "anchorDefault": null,
49
+ "shareUnit": null,
50
+ "safetyDefault": null
40
51
  },
41
52
  {
42
53
  "code": "191-000-000-000-000-000-003",
@@ -45,7 +56,12 @@
45
56
  "selectable": true,
46
57
  "parentCode": "191-000-000-000-000-000-000",
47
58
  "childCodes": [],
48
- "definition": "No attempt was made to collect the information."
59
+ "definition": "No attempt was made to collect the information.",
60
+ "tier": "sentinel",
61
+ "anchors": [],
62
+ "anchorDefault": null,
63
+ "shareUnit": null,
64
+ "safetyDefault": null
49
65
  },
50
66
  {
51
67
  "code": "191-001-000-000-000-000-000",
@@ -54,7 +70,14 @@
54
70
  "selectable": true,
55
71
  "parentCode": null,
56
72
  "childCodes": [],
57
- "definition": "Where the client/person currently resides (residential location)."
73
+ "definition": "Where the client/person currently resides (residential location).",
74
+ "tier": "residence",
75
+ "anchors": [
76
+ "person"
77
+ ],
78
+ "anchorDefault": "person",
79
+ "shareUnit": "addresses",
80
+ "safetyDefault": "ask"
58
81
  },
59
82
  {
60
83
  "code": "191-002-000-000-000-000-000",
@@ -63,7 +86,16 @@
63
86
  "selectable": true,
64
87
  "parentCode": null,
65
88
  "childCodes": [],
66
- "definition": "The physical site where a service instance was delivered (office, outreach site, partner site, on-scene)."
89
+ "definition": "The physical site where a service instance was delivered (office, outreach site, partner site, on-scene).",
90
+ "tier": "service",
91
+ "anchors": [
92
+ "service_instance",
93
+ "agency_program",
94
+ "person"
95
+ ],
96
+ "anchorDefault": "service_instance",
97
+ "shareUnit": "service_history",
98
+ "safetyDefault": "ask"
67
99
  },
68
100
  {
69
101
  "code": "191-003-000-000-000-000-000",
@@ -72,7 +104,14 @@
72
104
  "selectable": true,
73
105
  "parentCode": null,
74
106
  "childCodes": [],
75
- "definition": "Where the client/victim/caller is physically located at the time of contact or service (operational safety location)."
107
+ "definition": "Where the client/victim/caller is physically located at the time of contact or service (operational safety location).",
108
+ "tier": "encounter",
109
+ "anchors": [
110
+ "person"
111
+ ],
112
+ "anchorDefault": "person",
113
+ "shareUnit": "addresses",
114
+ "safetyDefault": "ask"
76
115
  },
77
116
  {
78
117
  "code": "191-004-000-000-000-000-000",
@@ -81,7 +120,16 @@
81
120
  "selectable": true,
82
121
  "parentCode": null,
83
122
  "childCodes": [],
84
- "definition": "A location where an in-person meeting/contact/event occurred (e.g., meet location, arrest location, outreach contact site)."
123
+ "definition": "A location where an in-person meeting/contact/event occurred (e.g., meet location, arrest location, outreach contact site).",
124
+ "tier": "encounter",
125
+ "anchors": [
126
+ "session",
127
+ "event",
128
+ "person"
129
+ ],
130
+ "anchorDefault": "session",
131
+ "shareUnit": "encounter_location",
132
+ "safetyDefault": "ask"
85
133
  },
86
134
  {
87
135
  "code": "191-005-000-000-000-000-000",
@@ -90,7 +138,14 @@
90
138
  "selectable": true,
91
139
  "parentCode": null,
92
140
  "childCodes": [],
93
- "definition": "Where the client/person previously resided (historical residential location)."
141
+ "definition": "Where the client/person previously resided (historical residential location).",
142
+ "tier": "residence",
143
+ "anchors": [
144
+ "person"
145
+ ],
146
+ "anchorDefault": "person",
147
+ "shareUnit": "addresses",
148
+ "safetyDefault": "ask"
94
149
  },
95
150
  {
96
151
  "code": "191-006-000-000-000-000-000",
@@ -99,7 +154,14 @@
99
154
  "selectable": true,
100
155
  "parentCode": null,
101
156
  "childCodes": [],
102
- "definition": "A location used to determine jurisdiction, eligibility, or referral routing (e.g., county, city, CoC code, service area)."
157
+ "definition": "A location used to determine jurisdiction, eligibility, or referral routing (e.g., county, city, CoC code, service area).",
158
+ "tier": "encounter",
159
+ "anchors": [
160
+ "person"
161
+ ],
162
+ "anchorDefault": "person",
163
+ "shareUnit": "addresses",
164
+ "safetyDefault": "ask"
103
165
  },
104
166
  {
105
167
  "code": "191-007-000-000-000-000-000",
@@ -108,7 +170,14 @@
108
170
  "selectable": true,
109
171
  "parentCode": null,
110
172
  "childCodes": [],
111
- "definition": "A location inferred from ads/postings (posting city/region/board) used for analytics such as base location, travel, and heat maps."
173
+ "definition": "A location inferred from ads/postings (posting city/region/board) used for analytics such as base location, travel, and heat maps.",
174
+ "tier": "derived",
175
+ "anchors": [
176
+ "person"
177
+ ],
178
+ "anchorDefault": "person",
179
+ "shareUnit": "commercial_activity",
180
+ "safetyDefault": null
112
181
  },
113
182
  {
114
183
  "code": "191-008-000-000-000-000-000",
@@ -117,7 +186,15 @@
117
186
  "selectable": true,
118
187
  "parentCode": null,
119
188
  "childCodes": [],
120
- "definition": "A location representing a travel instance or visit (part of a travel log/itinerary), with time bounds."
189
+ "definition": "A location representing a travel instance or visit (part of a travel log/itinerary), with time bounds.",
190
+ "tier": "encounter",
191
+ "anchors": [
192
+ "person",
193
+ "event"
194
+ ],
195
+ "anchorDefault": "person",
196
+ "shareUnit": "addresses",
197
+ "safetyDefault": "ask"
121
198
  },
122
199
  {
123
200
  "code": "191-009-000-000-000-000-000",
@@ -126,7 +203,14 @@
126
203
  "selectable": true,
127
204
  "parentCode": null,
128
205
  "childCodes": [],
129
- "definition": "A location associated with work, school, or business activity (legal or illicit), including known venues tied to an entity."
206
+ "definition": "A location associated with work, school, or business activity (legal or illicit), including known venues tied to an entity.",
207
+ "tier": "encounter",
208
+ "anchors": [
209
+ "person"
210
+ ],
211
+ "anchorDefault": "person",
212
+ "shareUnit": "addresses",
213
+ "safetyDefault": "ask"
130
214
  },
131
215
  {
132
216
  "code": "191-010-000-000-000-000-000",
@@ -135,7 +219,14 @@
135
219
  "selectable": true,
136
220
  "parentCode": null,
137
221
  "childCodes": [],
138
- "definition": "A location inferred from an IP address (geolocation-derived), used as a signal rather than a confirmed physical location."
222
+ "definition": "A location inferred from an IP address (geolocation-derived), used as a signal rather than a confirmed physical location.",
223
+ "tier": "derived",
224
+ "anchors": [
225
+ "person"
226
+ ],
227
+ "anchorDefault": "person",
228
+ "shareUnit": "commercial_activity",
229
+ "safetyDefault": null
139
230
  },
140
231
  {
141
232
  "code": "191-011-000-000-000-000-000",
@@ -144,7 +235,14 @@
144
235
  "selectable": true,
145
236
  "parentCode": null,
146
237
  "childCodes": [],
147
- "definition": "A location describing a program, shelter, project site, or provider location used for reporting (e.g., HMIS project descriptor)."
238
+ "definition": "A location describing a program, shelter, project site, or provider location used for reporting (e.g., HMIS project descriptor).",
239
+ "tier": "service",
240
+ "anchors": [
241
+ "agency_program"
242
+ ],
243
+ "anchorDefault": "agency_program",
244
+ "shareUnit": null,
245
+ "safetyDefault": "safe"
148
246
  },
149
247
  {
150
248
  "code": "191-012-000-000-000-000-000",
@@ -153,7 +251,16 @@
153
251
  "selectable": true,
154
252
  "parentCode": null,
155
253
  "childCodes": [],
156
- "definition": "A catch-all value used when none of the defined location types apply or when the role/context is unclear."
254
+ "definition": "A catch-all value used when none of the defined location types apply or when the role/context is unclear.",
255
+ "tier": "encounter",
256
+ "anchors": [
257
+ "person",
258
+ "session",
259
+ "event"
260
+ ],
261
+ "anchorDefault": "person",
262
+ "shareUnit": "addresses",
263
+ "safetyDefault": "ask"
157
264
  },
158
265
  {
159
266
  "code": "191-013-000-000-000-000-000",
@@ -162,7 +269,15 @@
162
269
  "selectable": true,
163
270
  "parentCode": null,
164
271
  "childCodes": [],
165
- "definition": "Location associated with an incident (e.g., where an event occurred, was reported, or was investigated), distinct from current residence, jurisdiction/routing, or service delivery context."
272
+ "definition": "Location associated with an incident (e.g., where an event occurred, was reported, or was investigated), distinct from current residence, jurisdiction/routing, or service delivery context.",
273
+ "tier": "encounter",
274
+ "anchors": [
275
+ "session",
276
+ "event"
277
+ ],
278
+ "anchorDefault": "event",
279
+ "shareUnit": "encounter_location",
280
+ "safetyDefault": "ask"
166
281
  }
167
282
  ]
168
283
  }