@htilabs/platform-common-models 0.8.14 → 0.8.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htilabs/platform-common-models",
3
- "version": "0.8.14",
3
+ "version": "0.8.16",
4
4
  "description": "Shared constants, types, and models for HTI Labs applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -62,30 +62,6 @@
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
- },
89
65
  "keywords": [
90
66
  "hti",
91
67
  "platform-common",
@@ -120,5 +96,28 @@
120
96
  },
121
97
  "engines": {
122
98
  "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"
123
122
  }
124
- }
123
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "domain": "case_share_state",
3
+ "name": "Core Case Share State",
4
+ "version": "1.0.0",
5
+ "levels": { "1": "State" },
6
+ "entries": [
7
+ {
8
+ "code": "925-001-000-000-000-000-000",
9
+ "key": "pending",
10
+ "title": "Pending",
11
+ "selectable": true,
12
+ "parentCode": null,
13
+ "childCodes": [],
14
+ "definition": "The share has been delivered to the receiving party and is awaiting a claim. No one on the receiving side has taken responsibility for it yet, and no client content has been disclosed."
15
+ },
16
+ {
17
+ "code": "925-002-000-000-000-000-000",
18
+ "key": "claimed",
19
+ "title": "Claimed",
20
+ "selectable": true,
21
+ "parentCode": null,
22
+ "childCodes": [],
23
+ "definition": "A team on the receiving side has taken custody of the share but has not yet accepted it. Claiming assigns responsibility only; it discloses no client content, so a claimed share is still outstanding work rather than a completed exchange."
24
+ },
25
+ {
26
+ "code": "925-003-000-000-000-000-000",
27
+ "key": "accepted_awaiting_review",
28
+ "title": "Accepted — awaiting review",
29
+ "selectable": true,
30
+ "parentCode": null,
31
+ "childCodes": [],
32
+ "definition": "The share has been accepted and its content disclosed, but one or more delivered persons matched an existing record ambiguously and are held for a human decision before the receiving record is linked."
33
+ },
34
+ {
35
+ "code": "925-004-000-000-000-000-000",
36
+ "key": "accepted",
37
+ "title": "Accepted",
38
+ "selectable": true,
39
+ "parentCode": null,
40
+ "childCodes": [],
41
+ "definition": "The share has been accepted, its content disclosed, and the link to the receiving party's record written. Terminal."
42
+ },
43
+ {
44
+ "code": "925-005-000-000-000-000-000",
45
+ "key": "declined",
46
+ "title": "Declined",
47
+ "selectable": true,
48
+ "parentCode": null,
49
+ "childCodes": [],
50
+ "definition": "The receiving party refused the share at the claim decision point, BEFORE its content was disclosed. Distinct from rejected: no client information was released, so the refusal carries no disclosure to account for. Terminal."
51
+ },
52
+ {
53
+ "code": "925-006-000-000-000-000-000",
54
+ "key": "rejected",
55
+ "title": "Rejected",
56
+ "selectable": true,
57
+ "parentCode": null,
58
+ "childCodes": [],
59
+ "definition": "The receiving party refused the share AFTER accepting it and reviewing its content. Distinct from declined: the disclosure already occurred and remains subject to the receiving party's retention and audit obligations. Terminal."
60
+ }
61
+ ]
62
+ }
@@ -0,0 +1,116 @@
1
+ {
2
+ "domain": "criminal_org_category",
3
+ "name": "Criminal Organization Category",
4
+ "version": "1.0.0",
5
+ "_status": "DRAFT — TEMPORARY: net-new value-CVC not yet in Notion; provisional 990 numbering; codes from prototype/data/cvcs/core_criminal_org_category.yaml (WIKI 7-type taxonomy, name signed off Crysta-proxy 2026-06-06); PENDING canonical Notion authoring. Categorizes each criminal-organization registry record; the registry (org records) is reference data seeded separately, keyed by this category code.",
6
+ "_source": "prototype/data/cvcs/core_criminal_org_category.yaml",
7
+ "levels": {
8
+ "0": "Unknown or Missing",
9
+ "1": "Criminal organization category"
10
+ },
11
+ "entries": [
12
+ {
13
+ "code": "990-000-000-000-000-000-000",
14
+ "key": "missingness_root",
15
+ "title": "Unknown, Redacted, or Missing",
16
+ "selectable": false,
17
+ "parentCode": null,
18
+ "childCodes": [
19
+ "990-000-000-000-000-000-001",
20
+ "990-000-000-000-000-000-002",
21
+ "990-000-000-000-000-000-003"
22
+ ],
23
+ "definition": "Root group for values indicating absent, withheld, or uncollected data. Variant: 3-value (unknown, anonymous, data_not_collected) under the workspace standard ANON semantic. The prototype YAML's single UNK sentinel (organization category cannot be determined) maps to the unknown child."
24
+ },
25
+ {
26
+ "code": "990-000-000-000-000-000-001",
27
+ "key": "unknown",
28
+ "title": "Unknown",
29
+ "selectable": true,
30
+ "parentCode": "990-000-000-000-000-000-000",
31
+ "childCodes": [],
32
+ "definition": "Organization category cannot be determined at time of entry. Carries the prototype's UNK case."
33
+ },
34
+ {
35
+ "code": "990-000-000-000-000-000-002",
36
+ "key": "anonymous",
37
+ "title": "Anonymous / declined to answer",
38
+ "selectable": true,
39
+ "parentCode": "990-000-000-000-000-000-000",
40
+ "childCodes": [],
41
+ "definition": "Value is intentionally withheld or redacted. Combines declined-to-answer and redacted/anonymous semantics under the workspace standard ANON sentinel."
42
+ },
43
+ {
44
+ "code": "990-000-000-000-000-000-003",
45
+ "key": "data_not_collected",
46
+ "title": "Data not collected",
47
+ "selectable": true,
48
+ "parentCode": "990-000-000-000-000-000-000",
49
+ "childCodes": [],
50
+ "definition": "No attempt was made to collect the value."
51
+ },
52
+ {
53
+ "code": "990-001-000-000-000-000-000",
54
+ "key": "street_gang",
55
+ "title": "Street gang / neighborhood-based gang",
56
+ "selectable": true,
57
+ "parentCode": null,
58
+ "childCodes": [],
59
+ "definition": "Territorial, often city/neighborhood-based; multi-generational. Examples: Bloods, Crips, Latin Kings, Gangster Disciples. WIKI subtypes: African-American, Latino/Hispanic, hybrid/multiracial, Asian street gangs. A trafficking street gang stays street_gang (structure, not activity)."
60
+ },
61
+ {
62
+ "code": "990-002-000-000-000-000-000",
63
+ "key": "prison_gang",
64
+ "title": "Prison gang",
65
+ "selectable": true,
66
+ "parentCode": null,
67
+ "childCodes": [],
68
+ "definition": "Originate and operate primarily inside prisons; influence street gangs. Often racialized; can be linked with cartels or domestic groups. Examples: Aryan Brotherhood, Mexican Mafia (La Eme), Black Guerrilla Family."
69
+ },
70
+ {
71
+ "code": "990-003-000-000-000-000-000",
72
+ "key": "outlaw_motorcycle_gang",
73
+ "title": "Outlaw motorcycle gang (OMG)",
74
+ "selectable": true,
75
+ "parentCode": null,
76
+ "childCodes": [],
77
+ "definition": "Highly structured; emphasize brotherhood and loyalty. Often involved in drug and weapons trafficking, extortion, and FBI/DOJ-documented prostitution rackets. Examples: Hells Angels, Mongols, Bandidos, Outlaws."
78
+ },
79
+ {
80
+ "code": "990-004-000-000-000-000-000",
81
+ "key": "tco_cartel",
82
+ "title": "Transnational criminal organization (TCO) / cartel",
83
+ "selectable": true,
84
+ "parentCode": null,
85
+ "childCodes": [],
86
+ "definition": "Operate across borders; organized hierarchies; high levels of violence and corruption. Examples: Sinaloa Cartel, CJNG, Gulf Cartel (CDG), MS-13 (hybrid). WIKI subtypes: Mexican cartels, Central American groups, Colombian cartels, Asian cartels (e.g. Triads, Yakuza). A trafficking cartel stays tco_cartel (structure, not activity)."
87
+ },
88
+ {
89
+ "code": "990-005-000-000-000-000-000",
90
+ "key": "white_supremacist_extremist",
91
+ "title": "White supremacist / extremist gang",
92
+ "selectable": true,
93
+ "parentCode": null,
94
+ "childCodes": [],
95
+ "definition": "Blend gang culture with hate ideology; often recruit in prisons. Some are considered both prison and extremist gangs. Examples: Peckerwoods, Aryan Circle, Nazi Low Riders."
96
+ },
97
+ {
98
+ "code": "990-006-000-000-000-000-000",
99
+ "key": "organized_crime_family",
100
+ "title": "Organized crime family (traditional mafia)",
101
+ "selectable": true,
102
+ "parentCode": null,
103
+ "childCodes": [],
104
+ "definition": "Focus on racketeering, gambling, extortion; more secretive and hierarchical. Tends to be older, less visible but still active. Examples: Italian-American Mafia (e.g. Gambino family), Russian Mafia."
105
+ },
106
+ {
107
+ "code": "990-007-000-000-000-000-000",
108
+ "key": "familial_or_independent_trafficking_network",
109
+ "title": "Familial or independent trafficking network",
110
+ "selectable": true,
111
+ "parentCode": null,
112
+ "childCodes": [],
113
+ "definition": "STRUCTURAL category (renamed 2026-06-08 from human_trafficking_smuggling_network to restore mutual exclusivity): a family-based or standalone trafficking/smuggling network that is NOT a street/prison gang, cartel/TCO, outlaw motorcycle gang, organized crime family, or extremist organization. Examples: Tenancingo-style familial sex-trafficking networks (e.g. Rendon-Reyes, Granados); ethnic standalone networks (e.g. Thai/Intarathong). This category — or documented trafficking/prostitution activity on any org — is the load-bearing signal for the facilitator model's stronger trafficking-affiliation leaf."
114
+ }
115
+ ]
116
+ }
package/src/cvcs/index.ts CHANGED
@@ -44,6 +44,8 @@ import contactSafetyStatusSot from "./contactSafetyStatus.v1.0.0.json" with { ty
44
44
  import highestEducationLevelCompletedSot from "./highestEducationLevelCompleted.v1.0.0.json" with { type: "json" };
45
45
  import preferredContactMethodSot from "./preferredContactMethod.v1.0.0.json" with { type: "json" };
46
46
  import sharePurposeSot from "./sharePurpose.v1.0.0.json" with { type: "json" };
47
+ import referralOriginSot from "./referralOrigin.v1.0.0.json" with { type: "json" };
48
+ import caseShareStateSot from "./caseShareState.v1.0.0.json" with { type: "json" };
47
49
  import facilitatorEntityTypeSot from "./facilitatorEntityType.v1.0.0.json" with { type: "json" };
48
50
  import facilitatorSubroleSot from "./facilitatorSubrole.v1.0.0.json" with { type: "json" };
49
51
  import maritalStatusLegalSot from "./maritalStatusLegal.v1.0.0.json" with { type: "json" };
@@ -200,6 +202,13 @@ import minorAdultStatusSot from "./minorAdultStatus.v1.0.0.json" with { type: "j
200
202
  // across the merged tree. Coexists with the `CVC_67_HMIS_SEX` constants in
201
203
  // `../constants/ic.ts`; the JSON is the SOT, the constants are the legacy view.
202
204
  import hmisSexSot from "./hmisSex.v1.0.0.json" with { type: "json" };
205
+ // Domain authored in PR #142 (0.8.15) alongside the codegen manifest entry in
206
+ // scripts/codegen-cvc-enums.ts, but never wired into this barrel — the SOT
207
+ // JSON shipped and `src/generated/cvc-enums.ts` regenerated correctly (it
208
+ // reads `src/cvcs/*.json` directly), but this file does not, so the export
209
+ // never reached the compiled `dist/cvcs/`. Wired in here so downstream
210
+ // consumers that derive their key maps from `./cvcs` (e.g. PAVE) can see it.
211
+ import criminalOrgCategorySot from "./criminalOrgCategory.v1.0.0.json" with { type: "json" };
203
212
 
204
213
  export {
205
214
  serviceCategoriesSot,
@@ -227,6 +236,8 @@ export {
227
236
  highestEducationLevelCompletedSot,
228
237
  preferredContactMethodSot,
229
238
  sharePurposeSot,
239
+ referralOriginSot,
240
+ caseShareStateSot,
230
241
  facilitatorEntityTypeSot,
231
242
  facilitatorSubroleSot,
232
243
  maritalStatusLegalSot,
@@ -374,4 +385,5 @@ export {
374
385
  subjectTypeSot,
375
386
  minorAdultStatusSot,
376
387
  hmisSexSot,
388
+ criminalOrgCategorySot,
377
389
  };
@@ -0,0 +1,26 @@
1
+ {
2
+ "domain": "referral_origin",
3
+ "name": "Core Referral Origin",
4
+ "version": "1.0.0",
5
+ "levels": { "1": "Origin" },
6
+ "entries": [
7
+ {
8
+ "code": "909-001-000-000-000-000-000",
9
+ "key": "internal",
10
+ "title": "Internal",
11
+ "selectable": true,
12
+ "parentCode": null,
13
+ "childCodes": [],
14
+ "definition": "A referral whose sending and receiving parties sit within the same agency or account boundary, so completing it involves no disclosure of client information across an organizational boundary."
15
+ },
16
+ {
17
+ "code": "909-002-000-000-000-000-000",
18
+ "key": "external",
19
+ "title": "External",
20
+ "selectable": true,
21
+ "parentCode": null,
22
+ "childCodes": [],
23
+ "definition": "A referral whose receiving party is a different agency, making acceptance a cross-agency disclosure of client information. Where an implementation cannot positively determine the origin, it must treat the referral as external, so that the stronger disclosure controls apply by default rather than the weaker ones."
24
+ }
25
+ ]
26
+ }
@@ -889,6 +889,34 @@ export const SharePurposeKeys = {
889
889
 
890
890
  export type SharePurposeKey = keyof typeof SharePurposeKeys;
891
891
 
892
+ /**
893
+ * Key → positional code map for the `referral_origin` CVC domain.
894
+ *
895
+ * Domain: `referral_origin` · Version: 1.0.0 · Entries: 2
896
+ */
897
+ export const ReferralOriginKeys = {
898
+ internal: "909-001-000-000-000-000-000",
899
+ external: "909-002-000-000-000-000-000",
900
+ } as const;
901
+
902
+ export type ReferralOriginKey = keyof typeof ReferralOriginKeys;
903
+
904
+ /**
905
+ * Key → positional code map for the `case_share_state` CVC domain.
906
+ *
907
+ * Domain: `case_share_state` · Version: 1.0.0 · Entries: 6
908
+ */
909
+ export const CaseShareStateKeys = {
910
+ pending: "925-001-000-000-000-000-000",
911
+ claimed: "925-002-000-000-000-000-000",
912
+ accepted_awaiting_review: "925-003-000-000-000-000-000",
913
+ accepted: "925-004-000-000-000-000-000",
914
+ declined: "925-005-000-000-000-000-000",
915
+ rejected: "925-006-000-000-000-000-000",
916
+ } as const;
917
+
918
+ export type CaseShareStateKey = keyof typeof CaseShareStateKeys;
919
+
892
920
  /**
893
921
  * Key → positional code map for the `facilitator_entity_type` CVC domain.
894
922
  *
@@ -5099,3 +5127,24 @@ export const MinorAdultStatusKeys = {
5099
5127
  } as const;
5100
5128
 
5101
5129
  export type MinorAdultStatusKey = keyof typeof MinorAdultStatusKeys;
5130
+
5131
+ /**
5132
+ * Key → positional code map for the `criminal_org_category` CVC domain (WIKI 7-type taxonomy for the criminal-org registry; ported from prototype/data/cvcs/core_criminal_org_category.yaml; PROVISIONAL at 990 — net-new, PENDING canonical Notion authoring).
5133
+ *
5134
+ * Domain: `criminal_org_category` · Version: 1.0.0 · Entries: 11
5135
+ */
5136
+ export const CriminalOrgCategoryKeys = {
5137
+ missingness_root: "990-000-000-000-000-000-000",
5138
+ unknown: "990-000-000-000-000-000-001",
5139
+ anonymous: "990-000-000-000-000-000-002",
5140
+ data_not_collected: "990-000-000-000-000-000-003",
5141
+ street_gang: "990-001-000-000-000-000-000",
5142
+ prison_gang: "990-002-000-000-000-000-000",
5143
+ outlaw_motorcycle_gang: "990-003-000-000-000-000-000",
5144
+ tco_cartel: "990-004-000-000-000-000-000",
5145
+ white_supremacist_extremist: "990-005-000-000-000-000-000",
5146
+ organized_crime_family: "990-006-000-000-000-000-000",
5147
+ familial_or_independent_trafficking_network: "990-007-000-000-000-000-000",
5148
+ } as const;
5149
+
5150
+ export type CriminalOrgCategoryKey = keyof typeof CriminalOrgCategoryKeys;