@htilabs/platform-common-models 0.8.12 → 0.8.14
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/README.md +44 -0
- package/dist/config/index.cjs +4 -0
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +16 -1
- package/dist/config/index.d.ts +16 -1
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -1
- package/dist/constants/index.cjs +143 -287
- 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 +143 -275
- package/dist/constants/index.js.map +1 -1
- package/dist/cvcs/index.cjs +12173 -969
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +14927 -2662
- package/dist/cvcs/index.d.ts +14927 -2662
- package/dist/cvcs/index.js +12141 -968
- package/dist/cvcs/index.js.map +1 -1
- 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 +13297 -1361
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1118 -130
- package/dist/index.d.ts +1118 -130
- package/dist/index.js +13239 -1346
- 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 +383 -0
- package/dist/mongo/index.cjs.map +1 -0
- package/dist/mongo/index.d.cts +221 -0
- package/dist/mongo/index.d.ts +221 -0
- package/dist/mongo/index.js +351 -0
- package/dist/mongo/index.js.map +1 -0
- package/dist/{platform-auth-BwfZ0bxU.d.cts → platform-auth-AsfnIXfK.d.cts} +2 -74
- package/dist/{platform-auth-BwfZ0bxU.d.ts → platform-auth-AsfnIXfK.d.ts} +2 -74
- package/dist/schemas/index.cjs +5 -153
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +29 -25
- package/dist/schemas/index.d.ts +29 -25
- package/dist/schemas/index.js +5 -153
- package/dist/schemas/index.js.map +1 -1
- package/dist/services/index.cjs +0 -3
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.js +0 -3
- package/dist/services/index.js.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +13 -1
- package/src/__sot__/README.md +56 -0
- package/src/__sot__/coreIndicators.pin.json +220 -0
- package/src/__sot__/cvcIndex.pin.json +268 -0
- package/src/__sot__/scoringEmits.pin.json +176 -0
- package/src/__tests__/__snapshots__/cvc-sot.snap +125 -37
- package/src/__tests__/cvc-136-scoring-invariant.test.ts +326 -0
- package/src/__tests__/cvc-drift-gate.test.ts +607 -0
- package/src/__tests__/cvc-sot-snapshot.test.ts +50 -8
- package/src/__tests__/cvc-structural.test.ts +43 -1
- package/src/__tests__/mongo-verifier.test.ts +502 -0
- package/src/config/index.ts +8 -2
- package/src/constants/ic.ts +213 -333
- package/src/constants/service-catalog.ts +4 -2
- package/src/cvcs/adminRoles.v1.0.0.json +153 -0
- package/src/cvcs/administeringJurisdiction.v1.0.0.json +40 -40
- package/src/cvcs/ageBinReporting.v1.0.0.json +40 -40
- package/src/cvcs/assertionDomain.v1.1.0.json +78 -105
- package/src/cvcs/assertionStatus.v1.0.0.json +80 -0
- package/src/cvcs/citizenship.v1.0.0.json +3062 -0
- package/src/cvcs/contactInfoTypes.v1.0.0.json +40 -40
- package/src/cvcs/coreDhState.v1.0.0.json +113 -0
- package/src/cvcs/coreIndicators.v1.0.0.json +2905 -0
- package/src/cvcs/createdBySystem.v1.0.0.json +89 -0
- package/src/cvcs/employmentStatus.v1.0.0.json +60 -60
- package/src/cvcs/exploitationType.v1.0.0.json +106 -0
- package/src/cvcs/facilitatorEntityType.v1.0.0.json +40 -40
- package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +50 -50
- package/src/cvcs/hmisCurrentLivingSituation.v1.0.0.json +409 -0
- package/src/cvcs/hmisSex.v1.0.0.json +89 -0
- package/src/cvcs/homelessStatus.v1.0.0.json +27 -27
- package/src/cvcs/housingSubsidyTypes.v1.0.0.json +26 -24
- package/src/cvcs/incarcerationEpisodeType.v1.0.0.json +106 -0
- package/src/cvcs/incidentInvolvementRoles.v1.0.0.json +40 -40
- package/src/cvcs/incidentParticipationRoles.v1.0.0.json +40 -40
- package/src/cvcs/index.ts +73 -2
- package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +106 -0
- package/src/cvcs/juvenileJusticeInvolvementStatus.v1.0.0.json +32 -32
- package/src/cvcs/militaryBranch.v1.0.0.json +20 -20
- package/src/cvcs/militaryStatus.v1.0.0.json +20 -20
- package/src/cvcs/minorAdultStatus.v1.0.0.json +80 -0
- package/src/cvcs/nameType.v1.0.0.json +40 -40
- package/src/cvcs/offenderStatus.v1.0.0.json +40 -40
- package/src/cvcs/offenderStatusFamily.v1.0.0.json +36 -36
- package/src/cvcs/poPetitionBasis.v1.0.0.json +96 -0
- package/src/cvcs/poStatus.v1.0.0.json +144 -0
- package/src/cvcs/poViolationStatus.v1.0.0.json +76 -0
- package/src/cvcs/radiusBucket.v1.0.0.json +23 -11
- package/src/cvcs/recencyBand.v1.0.0.json +126 -42
- package/src/cvcs/referralEntityCategory.v1.0.0.json +40 -40
- package/src/cvcs/riskSeverityBand.v1.0.0.json +139 -0
- package/src/cvcs/roiScope.v1.0.0.json +111 -3
- package/src/cvcs/roiStatus.v1.0.0.json +18 -10
- package/src/cvcs/romanticRelationshipChangeType.v1.0.0.json +2 -1
- package/src/cvcs/serviceCategories.v1.0.0.json +44 -44
- package/src/cvcs/serviceDeliveryChannel.v1.0.0.json +147 -0
- package/src/cvcs/serviceMechanisms.v1.0.0.json +36 -36
- package/src/cvcs/serviceStates.v1.0.0.json +40 -40
- package/src/cvcs/sessionTemplate.v1.0.0.json +261 -0
- package/src/cvcs/sexProviderSubrole.v1.0.0.json +35 -28
- package/src/cvcs/smtType.v1.0.0.json +40 -40
- package/src/cvcs/sourceCategory.v1.1.0.json +8 -1
- package/src/cvcs/sourceInstrument.v1.0.0.json +458 -0
- package/src/cvcs/sourceSystem.v1.0.0.json +203 -0
- package/src/cvcs/subjectType.v1.0.0.json +80 -0
- package/src/cvcs/traffickingRelevantRole.v1.0.0.json +104 -0
- package/src/cvcs/userRoles.v1.0.0.json +203 -0
- package/src/cvcs/victimStatusFamily.v1.0.0.json +40 -40
- package/src/cvcs/whyNots.v1.0.0.json +385 -0
- package/src/generated/cvc-enums.ts +1121 -127
- package/src/index.ts +20 -0
- package/src/mongo/catalog.ts +65 -0
- package/src/mongo/contract.ts +157 -0
- package/src/mongo/index.ts +343 -0
- package/src/mongo/similarity.ts +133 -0
- package/src/mongo/uri.ts +53 -0
- package/src/schemas/common.ts +4 -0
- package/src/services/cvcRegistryService.ts +1 -1
- package/src/cvcs/riskBand.v1.0.0.json +0 -98
- package/dist/{cvcEntry-BCj1OWqL.d.cts → cvcEntry-0BIB9sen.d.cts} +8 -8
- package/dist/{cvcEntry-BCj1OWqL.d.ts → cvcEntry-0BIB9sen.d.ts} +8 -8
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
"cvcs": {
|
|
5
5
|
"service_mechanisms": {
|
|
6
6
|
"count": 8,
|
|
7
|
-
"hash": "
|
|
7
|
+
"hash": "595579a8f47c7fb87a2847c562a1d8ad53052f310a79bc586c3a92f923e484a6"
|
|
8
8
|
},
|
|
9
9
|
"service_states": {
|
|
10
10
|
"count": 17,
|
|
11
|
-
"hash": "
|
|
11
|
+
"hash": "8830b83c0129b7aef25f1a16af5842e12b2d0bdeaebe21f7bafce549a95f0e20"
|
|
12
12
|
},
|
|
13
13
|
"service_categories": {
|
|
14
14
|
"count": 151,
|
|
15
|
-
"hash": "
|
|
15
|
+
"hash": "68c5fee27fb5826ed86ff8e9387ec00ae8813029c87f9d5349c7ce2d5c640eaf"
|
|
16
16
|
},
|
|
17
17
|
"incident_participation_roles": {
|
|
18
18
|
"count": 19,
|
|
19
|
-
"hash": "
|
|
19
|
+
"hash": "ccf9a360f09fbf58f93b92bed296d16678ff8c8955088407d2e641d6d9d72ba3"
|
|
20
20
|
},
|
|
21
21
|
"incident_involvement_roles": {
|
|
22
22
|
"count": 10,
|
|
23
|
-
"hash": "
|
|
23
|
+
"hash": "f9619dff97cd50873920c527c3b8fb2338773a7701f108bc1c8d22e642220850"
|
|
24
24
|
},
|
|
25
25
|
"race_ethnicity": {
|
|
26
26
|
"count": 14,
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
},
|
|
49
49
|
"name_type": {
|
|
50
50
|
"count": 12,
|
|
51
|
-
"hash": "
|
|
51
|
+
"hash": "290c0dbc5479a0ed095f98295886f65af5427dae4d924307b098cdfc360f3678"
|
|
52
52
|
},
|
|
53
53
|
"age_bin_reporting": {
|
|
54
54
|
"count": 11,
|
|
55
|
-
"hash": "
|
|
55
|
+
"hash": "e6c10d87d4f53bbb861147a081260c5adc8facb8fdd53f5dbf1bb41133d4d8cc"
|
|
56
56
|
},
|
|
57
57
|
"juvenile_justice_involvement_status": {
|
|
58
58
|
"count": 7,
|
|
59
|
-
"hash": "
|
|
59
|
+
"hash": "a1ea85245f114ac04e13b18c187c34d966f0af25825db6976b971391e01bc3f3"
|
|
60
60
|
},
|
|
61
61
|
"eye_color": {
|
|
62
62
|
"count": 11,
|
|
@@ -64,27 +64,27 @@
|
|
|
64
64
|
},
|
|
65
65
|
"smt_type": {
|
|
66
66
|
"count": 11,
|
|
67
|
-
"hash": "
|
|
67
|
+
"hash": "5187f29a02f8552222d53cfacce80ff27fe21a78df55360a4aba0f133eb06275"
|
|
68
68
|
},
|
|
69
69
|
"offender_status": {
|
|
70
70
|
"count": 9,
|
|
71
|
-
"hash": "
|
|
71
|
+
"hash": "02c39a437604d34e8e40256578124cd4497532cad8bb24c61b2f3bfb02fe2085"
|
|
72
72
|
},
|
|
73
73
|
"offender_status_family": {
|
|
74
74
|
"count": 8,
|
|
75
|
-
"hash": "
|
|
75
|
+
"hash": "13557efff19a69fe4451ea9300403b501eb4136146a5c1da8c73eaaf167ed219"
|
|
76
76
|
},
|
|
77
77
|
"military_status": {
|
|
78
78
|
"count": 6,
|
|
79
|
-
"hash": "
|
|
79
|
+
"hash": "3333618bccfd568ca064c3d0e52d04d496c57485d7ce1624120119e41e8c2d64"
|
|
80
80
|
},
|
|
81
81
|
"military_branch": {
|
|
82
82
|
"count": 8,
|
|
83
|
-
"hash": "
|
|
83
|
+
"hash": "f02b2865e23ef7abdebca77eafa921fb663cc3a82d480a251fcda8ef8433911f"
|
|
84
84
|
},
|
|
85
85
|
"contact_info_types": {
|
|
86
86
|
"count": 24,
|
|
87
|
-
"hash": "
|
|
87
|
+
"hash": "f356d68ce8658f761203e57ad61a2f39be5e9874379a92aec93755cfebe6ea1e"
|
|
88
88
|
},
|
|
89
89
|
"contact_safety_status": {
|
|
90
90
|
"count": 6,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"highest_education_level_completed": {
|
|
94
94
|
"count": 13,
|
|
95
|
-
"hash": "
|
|
95
|
+
"hash": "5e440a30a194b0df89e23bc8072d306876dfb2bd366129bbe1faef1babb4b6ef"
|
|
96
96
|
},
|
|
97
97
|
"preferred_contact_method": {
|
|
98
98
|
"count": 4,
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
"facilitator_entity_type": {
|
|
106
106
|
"count": 14,
|
|
107
|
-
"hash": "
|
|
107
|
+
"hash": "cb38a134585eb782e3adf6b71e89766fa4da4a9a45ce92f2848ba97043b96e3e"
|
|
108
108
|
},
|
|
109
109
|
"facilitator_subrole": {
|
|
110
110
|
"count": 37,
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
},
|
|
129
129
|
"homeless_status": {
|
|
130
130
|
"count": 9,
|
|
131
|
-
"hash": "
|
|
131
|
+
"hash": "d77896cdbcb976e0934678ba6887de6e5de7cb93412b2f521ffe16cb082674e6"
|
|
132
132
|
},
|
|
133
133
|
"victim_status_family": {
|
|
134
134
|
"count": 9,
|
|
135
|
-
"hash": "
|
|
135
|
+
"hash": "b6850942b4582b30efed921356435f8eaf8f45a2d86754e3008398c97be8606c"
|
|
136
136
|
},
|
|
137
137
|
"hair_color": {
|
|
138
138
|
"count": 10,
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
},
|
|
141
141
|
"sex_provider_subrole": {
|
|
142
142
|
"count": 7,
|
|
143
|
-
"hash": "
|
|
143
|
+
"hash": "9141e81b57d90fc5a40a8511cfc870290a1bdf80a2a28bfa0a0c959537f8e14b"
|
|
144
144
|
},
|
|
145
145
|
"relationship_ties": {
|
|
146
146
|
"count": 28,
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
},
|
|
153
153
|
"employment_status": {
|
|
154
154
|
"count": 29,
|
|
155
|
-
"hash": "
|
|
155
|
+
"hash": "66cc1e58a53c60fc66be85a7bd688adffdd372e2686ce4fb1b1d28cfe8a66b0f"
|
|
156
156
|
},
|
|
157
157
|
"location_type": {
|
|
158
158
|
"count": 17,
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
},
|
|
161
161
|
"referral_entity_category": {
|
|
162
162
|
"count": 43,
|
|
163
|
-
"hash": "
|
|
163
|
+
"hash": "f2a551981afc2f8f6aa6ac02d37ca72ad809c6c6e407f63f05fb4f9f74a8af9c"
|
|
164
164
|
},
|
|
165
165
|
"income_benefits_sources": {
|
|
166
166
|
"count": 41,
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
},
|
|
173
173
|
"administering_jurisdiction": {
|
|
174
174
|
"count": 10,
|
|
175
|
-
"hash": "
|
|
175
|
+
"hash": "11d0cca8132d86ea31a609931baf630c0cf96c2da16b736fb6e49254551019c2"
|
|
176
176
|
},
|
|
177
177
|
"frequency_cadence": {
|
|
178
178
|
"count": 11,
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
},
|
|
185
185
|
"source_category": {
|
|
186
186
|
"count": 9,
|
|
187
|
-
"hash": "
|
|
187
|
+
"hash": "1caf1295abc2bd190d6dc8891af15db2d8afd14a5238b9c4a8038b186aa9743f"
|
|
188
188
|
},
|
|
189
189
|
"source_subtype": {
|
|
190
190
|
"count": 39,
|
|
@@ -503,16 +503,16 @@
|
|
|
503
503
|
"hash": "03e18352e1ffb13a4e9b63e1f4043923f1da7e0153649db6940d0bb2653917d8"
|
|
504
504
|
},
|
|
505
505
|
"recency_band": {
|
|
506
|
-
"count":
|
|
507
|
-
"hash": "
|
|
506
|
+
"count": 12,
|
|
507
|
+
"hash": "d371ef9d6edcf7c44c6e683bd5cc1fddbc7eac9f80983f787130fbfe16638c48"
|
|
508
508
|
},
|
|
509
509
|
"housing_subsidy_types": {
|
|
510
510
|
"count": 16,
|
|
511
|
-
"hash": "
|
|
511
|
+
"hash": "995a3170efe8219c0bfe0a174abb2389c86bf94423a70a5ce2b2feb3d9e6b3fa"
|
|
512
512
|
},
|
|
513
513
|
"assertion_domain": {
|
|
514
|
-
"count":
|
|
515
|
-
"hash": "
|
|
514
|
+
"count": 68,
|
|
515
|
+
"hash": "6076e65b804f6e7d3b8385fecfb5114b710ecf672ca13d1e97e5fe0e412b1041"
|
|
516
516
|
},
|
|
517
517
|
"activity_type": {
|
|
518
518
|
"count": 14,
|
|
@@ -524,7 +524,7 @@
|
|
|
524
524
|
},
|
|
525
525
|
"radius_bucket": {
|
|
526
526
|
"count": 9,
|
|
527
|
-
"hash": "
|
|
527
|
+
"hash": "f230944b4acc01997edafe36eaa8a96a6c599c16f59cab8269259333a69768ac"
|
|
528
528
|
},
|
|
529
529
|
"contact_link_type": {
|
|
530
530
|
"count": 8,
|
|
@@ -568,16 +568,12 @@
|
|
|
568
568
|
},
|
|
569
569
|
"romantic_relationship_change_type": {
|
|
570
570
|
"count": 16,
|
|
571
|
-
"hash": "
|
|
571
|
+
"hash": "746554af4c41ec04be2b7209caf5bd05a29df770111d208ea6c04fa181b8eb83"
|
|
572
572
|
},
|
|
573
573
|
"risk_category": {
|
|
574
574
|
"count": 13,
|
|
575
575
|
"hash": "8f650b786261619b2468eb3982c6146c21fa2ee3b1aa4504aa1084ad82543548"
|
|
576
576
|
},
|
|
577
|
-
"risk_band": {
|
|
578
|
-
"count": 9,
|
|
579
|
-
"hash": "9d45121aecfe8f56b104ccd8e538f91a70e70abdfac4e1428ec50355011f43c2"
|
|
580
|
-
},
|
|
581
577
|
"core_functions": {
|
|
582
578
|
"count": 81,
|
|
583
579
|
"hash": "5ed3bb6231e610bd6646f0d37e4bb6474d0c66a8c1e9ff6912ee2c00d1ccf534"
|
|
@@ -587,16 +583,108 @@
|
|
|
587
583
|
"hash": "17303a3d9171a32d4302d94edfee67432bd46f102c39ef1db083b9628518f91e"
|
|
588
584
|
},
|
|
589
585
|
"roi_scope": {
|
|
590
|
-
"count":
|
|
591
|
-
"hash": "
|
|
586
|
+
"count": 31,
|
|
587
|
+
"hash": "079c1f421f0af3a3994b9735bd7df509de0a1b3aead22f6235b63a134210c33b"
|
|
592
588
|
},
|
|
593
589
|
"roi_status": {
|
|
594
590
|
"count": 9,
|
|
595
|
-
"hash": "
|
|
591
|
+
"hash": "8e9d079a860df143a08cb70b16045c611c89d6ec1f8692fac8966c66908f2b7b"
|
|
596
592
|
},
|
|
597
593
|
"core_referral_outcome": {
|
|
598
594
|
"count": 6,
|
|
599
595
|
"hash": "21308ee9fa9e4630e2a9faef4ae3e1754213d4b0acc4447f601a880edf74e2f8"
|
|
596
|
+
},
|
|
597
|
+
"dh_state": {
|
|
598
|
+
"count": 9,
|
|
599
|
+
"hash": "90aec290aa586a9bbc098c0c8a19536e06b705b054e4444ff6461a9913340a5c"
|
|
600
|
+
},
|
|
601
|
+
"core_indicators": {
|
|
602
|
+
"count": 219,
|
|
603
|
+
"hash": "b389bf68c84985e66445ac9a42b5c98ca36f10592dc820f909fc4e71c7f421bc"
|
|
604
|
+
},
|
|
605
|
+
"risk_severity_band": {
|
|
606
|
+
"count": 9,
|
|
607
|
+
"hash": "fc28328eb2b77e69c2a0d3a64add6de290687376506b053363756564d510448d"
|
|
608
|
+
},
|
|
609
|
+
"admin_roles": {
|
|
610
|
+
"count": 14,
|
|
611
|
+
"hash": "100b1ca9c69052c211bd591a75454c7a371da3825baa8a624579cf18f3ffb0b7"
|
|
612
|
+
},
|
|
613
|
+
"user_roles": {
|
|
614
|
+
"count": 19,
|
|
615
|
+
"hash": "978bc51bcff26af6ca265df119f368a790d31d3662bc947d01bb7fec3e39d4b3"
|
|
616
|
+
},
|
|
617
|
+
"hmis_current_living_situation": {
|
|
618
|
+
"count": 33,
|
|
619
|
+
"hash": "be6cead32a5d39c99a4b6d5d860ba736c74e28ab877591135a52823b1adfe0e6"
|
|
620
|
+
},
|
|
621
|
+
"juvenile_justice_episode_type": {
|
|
622
|
+
"count": 9,
|
|
623
|
+
"hash": "2b3c256979ba48e8c96e56587b32323da52d0542563036d1f064d7e5babefb81"
|
|
624
|
+
},
|
|
625
|
+
"incarceration_episode_type": {
|
|
626
|
+
"count": 9,
|
|
627
|
+
"hash": "52472cc461d57c684d546eef21c10b2a78458f6d50352226db0f8862b209a0e4"
|
|
628
|
+
},
|
|
629
|
+
"exploitation_type": {
|
|
630
|
+
"count": 9,
|
|
631
|
+
"hash": "3edd24b55ff7f26f1039a1f9fe48386d16f08dc9f68a05b6ba4afe93b53b2606"
|
|
632
|
+
},
|
|
633
|
+
"source_system": {
|
|
634
|
+
"count": 19,
|
|
635
|
+
"hash": "059cedc420b9724e7394ba8356f3a381932548c505d7c22e9b2708b1b07a4ef3"
|
|
636
|
+
},
|
|
637
|
+
"source_instrument": {
|
|
638
|
+
"count": 41,
|
|
639
|
+
"hash": "3e10b9e2ad96b4a2cb79dc56e8de785620207b9fea819d711085a2e7df53251e"
|
|
640
|
+
},
|
|
641
|
+
"po_petition_basis": {
|
|
642
|
+
"count": 8,
|
|
643
|
+
"hash": "0b1f95119f6cfd8a4791337463a200b7ad0f4a09d396e7aec2b93f2e0b18586d"
|
|
644
|
+
},
|
|
645
|
+
"po_status": {
|
|
646
|
+
"count": 12,
|
|
647
|
+
"hash": "67b982ca3f0bd4a1b628d35c6f432d362d8b14291dfc0b82056c03164b25fab2"
|
|
648
|
+
},
|
|
649
|
+
"po_violation_status": {
|
|
650
|
+
"count": 6,
|
|
651
|
+
"hash": "53a0ad169d2e5ff34ffa9b246eacbde2efb9b31baf763bfa1d3be53f0fbedd3c"
|
|
652
|
+
},
|
|
653
|
+
"session_template": {
|
|
654
|
+
"count": 23,
|
|
655
|
+
"hash": "c6e7ec45ab8c3d99e938ac55b1007107edee5885bff53f203945ed3a6cba25ac"
|
|
656
|
+
},
|
|
657
|
+
"service_delivery_channel": {
|
|
658
|
+
"count": 11,
|
|
659
|
+
"hash": "9318fd371d4418222eab7d1ac520c245f9d45f838a22efe31937669a01fdf26b"
|
|
660
|
+
},
|
|
661
|
+
"why_nots": {
|
|
662
|
+
"count": 32,
|
|
663
|
+
"hash": "c79f3a30eaa522190b54edd833202c1f37037f541d9d2eac65b22488da56619d"
|
|
664
|
+
},
|
|
665
|
+
"citizenship": {
|
|
666
|
+
"count": 253,
|
|
667
|
+
"hash": "83962425a6a987b46bd89f596feefe5758f25993137010bb417823b83c4ae31f"
|
|
668
|
+
},
|
|
669
|
+
"trafficking_relevant_role": {
|
|
670
|
+
"count": 8,
|
|
671
|
+
"hash": "1a4ea2992cc501179adafd192d7a2f1733ffe48c1ba26e1e61a3c757b2d62b32"
|
|
672
|
+
},
|
|
673
|
+
"assertion_status": {
|
|
674
|
+
"count": 7,
|
|
675
|
+
"hash": "a1914348815dabc7171ed4ea632383d39f31764d390c43d6b1d359eae465807f"
|
|
676
|
+
},
|
|
677
|
+
"created_by_system": {
|
|
678
|
+
"count": 8,
|
|
679
|
+
"hash": "35ea022a704b4eee7b493ea3c9a8a5d2ffa41c4cacbe9f899cc1336e73808fc2"
|
|
680
|
+
},
|
|
681
|
+
"subject_type": {
|
|
682
|
+
"count": 7,
|
|
683
|
+
"hash": "81ad6c7fbb74bbb6d9c6f316df3275fd57a1646dedb4fb47472ee77fb2482f99"
|
|
684
|
+
},
|
|
685
|
+
"minor_adult_status": {
|
|
686
|
+
"count": 7,
|
|
687
|
+
"hash": "9d8972c65373a9981aab6b8749661659ecc632004e67bc9c2b3c88aa76f30977"
|
|
600
688
|
}
|
|
601
689
|
}
|
|
602
690
|
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CVC-136 <-> @hti/scoring invariant test (0.8.13)
|
|
3
|
+
*
|
|
4
|
+
* THE INVARIANT
|
|
5
|
+
* -------------
|
|
6
|
+
* Every indicator code that @hti/scoring EMITS must exist in the CVC-136
|
|
7
|
+
* `core_indicators` vocabulary. @hti/scoring is the declared scoring SOT
|
|
8
|
+
* (ADR-CONTRACT-scoring-vocab-model-boundary). If platform-common drops or
|
|
9
|
+
* renames a code that scoring emits, the risk pipeline silently writes
|
|
10
|
+
* assertions against an indicator code that resolves to nothing.
|
|
11
|
+
*
|
|
12
|
+
* That is exactly the class of drift 0.8.13 repaired: 0.8.12 shipped 199
|
|
13
|
+
* hand-coded CVC-136 codes, of which 54 were invented rollup prefixes
|
|
14
|
+
* (`vc_*`, `csi_*`, `csctx_*`, `dv_*`, `net_*`, `auto_*`) that existed nowhere
|
|
15
|
+
* upstream and were consumed by nobody, while 66 real canonical codes were
|
|
16
|
+
* MISSING. This test makes that impossible to reintroduce.
|
|
17
|
+
*
|
|
18
|
+
* THE PIN
|
|
19
|
+
* -------
|
|
20
|
+
* `SCORING_EMITS_BY_CODE` is the key set of `emits_by_code` in
|
|
21
|
+
* `weights/risk.weights.json` at htilabstech/hti-scoring@9b5d654 (169 codes).
|
|
22
|
+
* It is a COMMITTED PIN, not a live read - platform-common must not take a
|
|
23
|
+
* build-time dependency on the scoring repo. When @hti/scoring starts emitting
|
|
24
|
+
* a new code, bumping this list is a deliberate, reviewable commit that forces
|
|
25
|
+
* the matching CVC-136 entry to be authored in the same PR.
|
|
26
|
+
*
|
|
27
|
+
* SCORING IS AHEAD OF THE CODEBOOK ON 2 CODES
|
|
28
|
+
* -------------------------------------------
|
|
29
|
+
* `coercive_debt_pressure_youth` and `debt_terms_deceptive_youth` are emitted
|
|
30
|
+
* by @hti/scoring but are NOT in the prototype's canonical
|
|
31
|
+
* `data/core_indicators.yaml` (208 codes) at HEAD a596eb9. They are KEPT
|
|
32
|
+
* (210 = 208 + 2) and flagged `pendingUpstreamAdoption: true` in the SOT JSON.
|
|
33
|
+
* Dropping them because they are "not in the prototype" would break the
|
|
34
|
+
* scoring contract. That is the trap this test exists to prevent.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
import { readFileSync } from "node:fs";
|
|
38
|
+
import path from "node:path";
|
|
39
|
+
import { fileURLToPath } from "node:url";
|
|
40
|
+
|
|
41
|
+
import { describe, it, expect } from "vitest";
|
|
42
|
+
|
|
43
|
+
import { CVC_136_CORE_INDICATOR_VALUES } from "../constants/ic.js";
|
|
44
|
+
import { CvcEnvelopeSchema } from "../validation/cvc.js";
|
|
45
|
+
|
|
46
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
47
|
+
const __dirname = path.dirname(__filename);
|
|
48
|
+
const SOT_FILE = path.resolve(
|
|
49
|
+
__dirname,
|
|
50
|
+
"..",
|
|
51
|
+
"cvcs",
|
|
52
|
+
"coreIndicators.v1.0.0.json",
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* `Object.keys(RISK_WEIGHTS.emits_by_code)` at
|
|
57
|
+
* htilabstech/hti-scoring@9b5d654 (weights/risk.weights.json). 169 codes.
|
|
58
|
+
* PINNED - see the module header before editing.
|
|
59
|
+
*/
|
|
60
|
+
const SCORING_EMITS_BY_CODE: readonly string[] = [
|
|
61
|
+
"abuser_evading_legal_consequences",
|
|
62
|
+
"abuser_has_weapon",
|
|
63
|
+
"abuser_substance_use",
|
|
64
|
+
"abuser_threatened_suicide",
|
|
65
|
+
"abuser_unemployed",
|
|
66
|
+
"access_to_vulnerable_individuals",
|
|
67
|
+
"acknowledgement_or_report_of_human_trafficking",
|
|
68
|
+
"adverse_childhood_household_challenges",
|
|
69
|
+
"appears_controlling_relationship",
|
|
70
|
+
"association_commercial_sex",
|
|
71
|
+
"atypical_or_high_risk_payment_method",
|
|
72
|
+
"autonomy_choice_in_clients",
|
|
73
|
+
"autonomy_choice_in_services",
|
|
74
|
+
"autonomy_controls_own_finances",
|
|
75
|
+
"autonomy_organizes_own_travel",
|
|
76
|
+
"autonomy_posts_own_ads",
|
|
77
|
+
"autonomy_sets_own_schedule",
|
|
78
|
+
"autonomy_sets_up_own_dates",
|
|
79
|
+
"battered_while_pregnant_history",
|
|
80
|
+
"branding_or_unusual_tattoos_tied_to_control",
|
|
81
|
+
"cannot_stop_working_or_freely_leave",
|
|
82
|
+
"child_not_abusers_in_household",
|
|
83
|
+
"coerced_to_misrepresent_identity_or_activity",
|
|
84
|
+
"coercive_debt_pressure",
|
|
85
|
+
"coercive_debt_pressure_youth",
|
|
86
|
+
"coercive_migration_or_forced_travel",
|
|
87
|
+
"cognitive_or_functional_impairment_affecting_consent",
|
|
88
|
+
"commercial_sex_association_words_or_places",
|
|
89
|
+
"concerning_mannerisms_anxious_fearful_depressed",
|
|
90
|
+
"concerning_sexual_behavior_pattern",
|
|
91
|
+
"control_quota_required",
|
|
92
|
+
"cs_activity_criminal_org_connection",
|
|
93
|
+
"cs_industry_related_criminal_history",
|
|
94
|
+
"current_injuries_from_abuser",
|
|
95
|
+
"currently_minor_in_commercial_sex",
|
|
96
|
+
"debt_terms_deceptive",
|
|
97
|
+
"debt_terms_deceptive_youth",
|
|
98
|
+
"denied_basic_needs",
|
|
99
|
+
"depends_on_employer_for_immigration_status",
|
|
100
|
+
"does_not_control_finances_or_earnings",
|
|
101
|
+
"does_not_control_identity_documents",
|
|
102
|
+
"employer_keeps_pay_or_pays_less_than_expected",
|
|
103
|
+
"engages_in_commercial_sex_act",
|
|
104
|
+
"entered_commercial_sex_industry_as_minor",
|
|
105
|
+
"entered_cs_due_to_survival_needs",
|
|
106
|
+
"entered_into_network_of_sex_providers_early",
|
|
107
|
+
"exploitative_working_conditions",
|
|
108
|
+
"fled_conflict_violence_or_persecution",
|
|
109
|
+
"forced_to_commit_crimes",
|
|
110
|
+
"forced_to_use_false_documents",
|
|
111
|
+
"foreign_born_or_recently_arrived",
|
|
112
|
+
"foreign_born_risk_factors",
|
|
113
|
+
"frequent_changes_in_residence",
|
|
114
|
+
"frequent_travel_or_location_changes",
|
|
115
|
+
"frequently_at_hotels_or_many_hotel_keys",
|
|
116
|
+
"has_ads_on_commercial_sex_site",
|
|
117
|
+
"has_facilitators_involved",
|
|
118
|
+
"has_management_or_representation",
|
|
119
|
+
"has_no_personal_items_or_possessions",
|
|
120
|
+
"head_injury_history",
|
|
121
|
+
"head_injury_loss_of_consciousness",
|
|
122
|
+
"health_related_vulnerability",
|
|
123
|
+
"hierarchical_management_structure_identified",
|
|
124
|
+
"high_risk_sexual_behavior",
|
|
125
|
+
"high_security_measures_at_work_or_living_location",
|
|
126
|
+
"highly_irregular_school_attendance",
|
|
127
|
+
"history_emotional_abuse",
|
|
128
|
+
"history_of_mental_health_issues",
|
|
129
|
+
"history_of_running_away_or_missing_from_care",
|
|
130
|
+
"history_of_strangulation",
|
|
131
|
+
"history_physical_or_sexual_abuse_or_dv",
|
|
132
|
+
"homeless_or_unstably_housed",
|
|
133
|
+
"immigration_related_exploitation_risk",
|
|
134
|
+
"in_commercial_sex_industry_recorded",
|
|
135
|
+
"inability_to_account_for_self",
|
|
136
|
+
"intimate_partner_violence_reported_to_law_enforcement",
|
|
137
|
+
"juvenile_justice_or_child_welfare_involvement",
|
|
138
|
+
"labor_services_activity_recorded",
|
|
139
|
+
"limited_english_proficiency",
|
|
140
|
+
"limited_independence",
|
|
141
|
+
"lives_or_sleeps_at_place_of_work",
|
|
142
|
+
"living_with_abuser",
|
|
143
|
+
"meets_or_has_sex_with_internet_contacts",
|
|
144
|
+
"monitored_or_isolated_by_controlling_party",
|
|
145
|
+
"much_older_intimate_partner",
|
|
146
|
+
"nervous_about_immigration_documentation",
|
|
147
|
+
"network_multiple_sex_providers_named",
|
|
148
|
+
"new_to_commercial_sex_industry",
|
|
149
|
+
"non_consensual_photography_or_recording",
|
|
150
|
+
"not_in_control_of_immigration_documentation",
|
|
151
|
+
"other_instability_or_vulnerability_factors",
|
|
152
|
+
"owes_money_and_cannot_pay_off",
|
|
153
|
+
"paid_or_owes_fee_to_arrange_travel_to_us",
|
|
154
|
+
"paid_or_owes_recruitment_fee_to_employer",
|
|
155
|
+
"payment_routed_through_third_party",
|
|
156
|
+
"pending_federal_protection",
|
|
157
|
+
"performing_different_work_than_promised",
|
|
158
|
+
"physical_violence_increasing",
|
|
159
|
+
"poverty_or_severe_financial_strain",
|
|
160
|
+
"precarious_immigration_status",
|
|
161
|
+
"pressured_or_forced_sex_act",
|
|
162
|
+
"prior_medical_attention_from_abuse",
|
|
163
|
+
"prior_tvap_disconnection",
|
|
164
|
+
"prior_victimization_or_abuse_history",
|
|
165
|
+
"promise_of_work_different_than_current_work",
|
|
166
|
+
"received_things_of_value_while_missing_from_care",
|
|
167
|
+
"recruited_by_third_party_into_cs_industry",
|
|
168
|
+
"relies_on_temporary_resources_for_basic_needs",
|
|
169
|
+
"reports_physical_harm_by_employer_or_partner",
|
|
170
|
+
"reports_physical_harm_to_others_by_employer_or_partner",
|
|
171
|
+
"restrictive_living_or_working_conditions",
|
|
172
|
+
"restrictive_or_not_understood_contract",
|
|
173
|
+
"risk_factors_commercial_sex",
|
|
174
|
+
"serious_substance_use_or_introduced_to_drugs",
|
|
175
|
+
"several_cell_phones_or_frequent_number_changes",
|
|
176
|
+
"sex_acts_in_own_residence",
|
|
177
|
+
"sexual_exploitation",
|
|
178
|
+
"signs_of_physical_abuse_confinement_or_neglect",
|
|
179
|
+
"signs_of_physical_harm_or_abuse",
|
|
180
|
+
"social_isolation_or_no_supportive_relationships",
|
|
181
|
+
"stalking_property_intrusion",
|
|
182
|
+
"stalking_surveillance",
|
|
183
|
+
"stalking_unwanted_contact",
|
|
184
|
+
"strangulation_acute_symptoms",
|
|
185
|
+
"strangulation_loss_of_consciousness",
|
|
186
|
+
"strangulation_repeated",
|
|
187
|
+
"subject_arrested_dv_sv_cs",
|
|
188
|
+
"subject_has_illegal_weapons",
|
|
189
|
+
"subject_is_sex_offender",
|
|
190
|
+
"subject_legally_barred_weapons",
|
|
191
|
+
"subject_perpetrated_abuse_history",
|
|
192
|
+
"subject_perpetrated_emotional_stalking_current",
|
|
193
|
+
"subject_perpetrated_emotional_stalking_past",
|
|
194
|
+
"subject_perpetrated_ipv_current",
|
|
195
|
+
"subject_perpetrated_ipv_past",
|
|
196
|
+
"subject_perpetrated_physical_abuse_current",
|
|
197
|
+
"subject_perpetrated_physical_abuse_past",
|
|
198
|
+
"subject_perpetrated_sexual_abuse_current",
|
|
199
|
+
"subject_perpetrated_sexual_abuse_past",
|
|
200
|
+
"subject_violent_felony",
|
|
201
|
+
"substance_use_while_working",
|
|
202
|
+
"suicidal_ideation_history",
|
|
203
|
+
"suicidal_ideation_recent",
|
|
204
|
+
"third_party_arranged_commercial_sex_acts",
|
|
205
|
+
"threats_by_employer_or_partner",
|
|
206
|
+
"threats_of_harm",
|
|
207
|
+
"threats_of_legal_trouble_or_deportation",
|
|
208
|
+
"threats_related_to_migration_debt",
|
|
209
|
+
"threats_to_family_friends_or_close_associates",
|
|
210
|
+
"threats_to_kill_victim_or_children",
|
|
211
|
+
"trafficking_experience_past_10plusy",
|
|
212
|
+
"trafficking_experience_past_3to10y",
|
|
213
|
+
"trafficking_experience_past_lt3y",
|
|
214
|
+
"travel_organized_by_third_party",
|
|
215
|
+
"tricked_or_pressured_into_unwanted_acts",
|
|
216
|
+
"unexplained_frequent_travel_or_migration",
|
|
217
|
+
"unsafe_working_conditions_long_hours_inadequate_breaks",
|
|
218
|
+
"unusual_cash_or_unexplained_gifts",
|
|
219
|
+
"unusual_work_circumstances",
|
|
220
|
+
"urgent_medical_referral_needed",
|
|
221
|
+
"victim_believes_abuser_capable_of_killing",
|
|
222
|
+
"victimization_history_composite",
|
|
223
|
+
"violence_or_threats_at_work_site",
|
|
224
|
+
"weapon_used_or_threatened_against_victim",
|
|
225
|
+
"work_frequency_high_volume",
|
|
226
|
+
"workplace_emotional_climate_of_fear",
|
|
227
|
+
"works_across_multiple_cities_or_locations",
|
|
228
|
+
"works_for_little_or_no_pay",
|
|
229
|
+
"youth_watched_filmed_or_photographed_sexually_explicit",
|
|
230
|
+
];
|
|
231
|
+
|
|
232
|
+
/** Codes @hti/scoring emits that upstream `core_indicators.yaml` has not yet adopted. */
|
|
233
|
+
const PENDING_UPSTREAM_ADOPTION: readonly string[] = [
|
|
234
|
+
"coercive_debt_pressure_youth",
|
|
235
|
+
"debt_terms_deceptive_youth",
|
|
236
|
+
];
|
|
237
|
+
|
|
238
|
+
const envelope = CvcEnvelopeSchema.parse(
|
|
239
|
+
JSON.parse(readFileSync(SOT_FILE, "utf-8")),
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
/** Substantive (non-missingness) entries: segment 2 of the code is non-zero. */
|
|
243
|
+
const substantive = envelope.entries.filter(
|
|
244
|
+
(e) => e.code.split("-")[1] !== "000",
|
|
245
|
+
);
|
|
246
|
+
const substantiveKeys = new Set(substantive.map((e) => e.key));
|
|
247
|
+
|
|
248
|
+
describe("CVC-136 core_indicators", () => {
|
|
249
|
+
it("is numbered 136 in segment 1 of every code", () => {
|
|
250
|
+
for (const entry of envelope.entries) {
|
|
251
|
+
expect(entry.code.split("-")[0]).toBe("136");
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("opens with the mandatory missingness quadruplet", () => {
|
|
256
|
+
expect(envelope.entries.slice(0, 4).map((e) => e.key)).toEqual([
|
|
257
|
+
"missingness_root",
|
|
258
|
+
"unknown",
|
|
259
|
+
"anonymous",
|
|
260
|
+
"data_not_collected",
|
|
261
|
+
]);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
it("has exactly 215 substantive codes (213 canonical + 2 scoring-ahead)", () => {
|
|
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);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("has no duplicate keys", () => {
|
|
273
|
+
expect(substantiveKeys.size).toBe(substantive.length);
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
describe("CVC-136 <-> @hti/scoring emits_by_code invariant", () => {
|
|
278
|
+
it("pins exactly 169 emitted codes", () => {
|
|
279
|
+
expect(new Set(SCORING_EMITS_BY_CODE).size).toBe(169);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("EVERY code @hti/scoring emits exists in CVC-136", () => {
|
|
283
|
+
const missing = SCORING_EMITS_BY_CODE.filter(
|
|
284
|
+
(code) => !substantiveKeys.has(code),
|
|
285
|
+
);
|
|
286
|
+
if (missing.length > 0) {
|
|
287
|
+
throw new Error(
|
|
288
|
+
"CVC-136 is missing indicator codes that @hti/scoring EMITS. The risk " +
|
|
289
|
+
"pipeline would write assertions against codes that resolve to nothing.\n" +
|
|
290
|
+
`Missing (${missing.length}): ${missing.join(", ")}`,
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
expect(missing).toHaveLength(0);
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it("the 2 scoring-ahead codes are present and flagged pendingUpstreamAdoption", () => {
|
|
297
|
+
for (const code of PENDING_UPSTREAM_ADOPTION) {
|
|
298
|
+
const entry = substantive.find((e) => e.key === code);
|
|
299
|
+
expect(entry, `${code} must be present in CVC-136`).toBeDefined();
|
|
300
|
+
expect(
|
|
301
|
+
(entry as unknown as Record<string, unknown>)["pendingUpstreamAdoption"],
|
|
302
|
+
).toBe(true);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
it("none of the 54 withdrawn invented rollup codes came back", () => {
|
|
307
|
+
const inventedPrefixes = ["vc_", "csi_", "csctx_", "dv_", "net_", "auto_"];
|
|
308
|
+
const resurrected = [...substantiveKeys].filter((key) =>
|
|
309
|
+
inventedPrefixes.some((p) => key.startsWith(p)),
|
|
310
|
+
);
|
|
311
|
+
expect(resurrected).toEqual([]);
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
it("`unusual_work_circumstances_general` stays withdrawn; the canonical code ships", () => {
|
|
315
|
+
expect(substantiveKeys.has("unusual_work_circumstances_general")).toBe(false);
|
|
316
|
+
expect(substantiveKeys.has("unusual_work_circumstances")).toBe(true);
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
describe("CVC-136 SOT JSON <-> hand-coded ic.ts array", () => {
|
|
321
|
+
it("CVC_136_CORE_INDICATOR_VALUES is exactly the SOT substantive key set", () => {
|
|
322
|
+
expect([...CVC_136_CORE_INDICATOR_VALUES].sort()).toEqual(
|
|
323
|
+
[...substantiveKeys].sort(),
|
|
324
|
+
);
|
|
325
|
+
});
|
|
326
|
+
});
|