@htilabs/platform-common-models 0.13.1 → 0.14.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.
Files changed (45) hide show
  1. package/dist/constants/index.cjs +33 -0
  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 +29 -0
  6. package/dist/constants/index.js.map +1 -1
  7. package/dist/cvcs/index.cjs +96 -13
  8. package/dist/cvcs/index.cjs.map +1 -1
  9. package/dist/cvcs/index.d.cts +101 -12
  10. package/dist/cvcs/index.d.ts +101 -12
  11. package/dist/cvcs/index.js +96 -13
  12. package/dist/cvcs/index.js.map +1 -1
  13. package/dist/enums/index.cjs +7 -1
  14. package/dist/enums/index.cjs.map +1 -1
  15. package/dist/enums/index.d.cts +8 -2
  16. package/dist/enums/index.d.ts +8 -2
  17. package/dist/enums/index.js +7 -1
  18. package/dist/enums/index.js.map +1 -1
  19. package/dist/index.cjs +136 -14
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +132 -14
  24. package/dist/index.js.map +1 -1
  25. package/dist/{platform-auth-64U8jjuw.d.cts → platform-auth-CrF5U_JH.d.cts} +43 -2
  26. package/dist/{platform-auth-64U8jjuw.d.ts → platform-auth-CrF5U_JH.d.ts} +43 -2
  27. package/dist/schemas/index.cjs +234 -0
  28. package/dist/schemas/index.cjs.map +1 -1
  29. package/dist/schemas/index.js +234 -0
  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 +1 -1
  34. package/src/__sot__/coreIndicatorFields.ts +4 -4
  35. package/src/__sot__/coreIndicators.pin.json +62 -2
  36. package/src/__sot__/scoringEmits.pin.json +9 -4
  37. package/src/__tests__/__snapshots__/cvc-sot.snap +2 -2
  38. package/src/__tests__/cvc-136-scoring-invariant.test.ts +89 -28
  39. package/src/__tests__/cvc-drift-gate.test.ts +149 -27
  40. package/src/__tests__/cvc-sot-snapshot.test.ts +3 -1
  41. package/src/__tests__/cvc-structural.test.ts +1 -1
  42. package/src/constants/ic.ts +163 -3
  43. package/src/cvcs/{coreIndicators.v1.0.0.json → coreIndicators.v1.1.0.json} +93 -10
  44. package/src/cvcs/index.ts +1 -1
  45. package/src/generated/cvc-enums.ts +8 -2
@@ -1,5 +1,5 @@
1
- import { e8 as PlatformToolValue, cE as FunctionStatusValue, ev as RoleLevelValue, eG as ShareViewValue, e4 as PermissionStateValue } from '../platform-auth-64U8jjuw.cjs';
2
- export { i as AccommodationValue, k as AgeBinReportingValue, l as AppScopeValue, m as ApparentAgeValue, ct as DataQualityValue, cC as FormStatusValue, cD as FormTypeValue, cF as IC13Category, cH as IC13Value, cI as IC22Value, cJ as IC23Value, cK as IC24Value, cL as IC25Value, cM as IC49ReferralOutcomeValue, cN as IC49ReferralVerificationValue, cO as IC49Value, cP as IC4Value, cR as IC56Value, cS as IC57Value, cU as IC58Value, cV as IC59Value, cW as IC5Value, dM as IncidentInvolvementRoleValue, dN as IncidentParticipationRoleValue, dO as InteractionTypeValue, dR as MinorAdultStatusValue, e5 as PersonDisplayCategoryValue, e6 as PersonRoleValue, e7 as PersonTypeValue, ee as QuestionFormatValue, ef as QuickStartTemplateId, er as RecordStateValue, et as RelationshipConcernValue, eu as RelationshipDynamicValue, eF as SessionStateValue, eH as SubmissionStateValue, eL as UserStatusValue } from '../platform-auth-64U8jjuw.cjs';
1
+ import { ec as PlatformToolValue, cI as FunctionStatusValue, ez as RoleLevelValue, eK as ShareViewValue, e8 as PermissionStateValue } from '../platform-auth-CrF5U_JH.cjs';
2
+ export { j as AccommodationValue, m as AgeBinReportingValue, n as AppScopeValue, o as ApparentAgeValue, cw as DataQualityValue, cG as FormStatusValue, cH as FormTypeValue, cJ as IC13Category, cL as IC13Value, cM as IC22Value, cN as IC23Value, cO as IC24Value, cP as IC25Value, cQ as IC49ReferralOutcomeValue, cR as IC49ReferralVerificationValue, cS as IC49Value, cT as IC4Value, cV as IC56Value, cW as IC57Value, cY as IC58Value, cZ as IC59Value, c_ as IC5Value, dQ as IncidentInvolvementRoleValue, dR as IncidentParticipationRoleValue, dS as InteractionTypeValue, dV as MinorAdultStatusValue, e9 as PersonDisplayCategoryValue, ea as PersonRoleValue, eb as PersonTypeValue, ei as QuestionFormatValue, ej as QuickStartTemplateId, ev as RecordStateValue, ex as RelationshipConcernValue, ey as RelationshipDynamicValue, eJ as SessionStateValue, eL as SubmissionStateValue, eP as UserStatusValue } from '../platform-auth-CrF5U_JH.cjs';
3
3
 
4
4
  /**
5
5
  * @htilabs/platform-common-models — Platform Authorization Types
@@ -1,5 +1,5 @@
1
- import { e8 as PlatformToolValue, cE as FunctionStatusValue, ev as RoleLevelValue, eG as ShareViewValue, e4 as PermissionStateValue } from '../platform-auth-64U8jjuw.js';
2
- export { i as AccommodationValue, k as AgeBinReportingValue, l as AppScopeValue, m as ApparentAgeValue, ct as DataQualityValue, cC as FormStatusValue, cD as FormTypeValue, cF as IC13Category, cH as IC13Value, cI as IC22Value, cJ as IC23Value, cK as IC24Value, cL as IC25Value, cM as IC49ReferralOutcomeValue, cN as IC49ReferralVerificationValue, cO as IC49Value, cP as IC4Value, cR as IC56Value, cS as IC57Value, cU as IC58Value, cV as IC59Value, cW as IC5Value, dM as IncidentInvolvementRoleValue, dN as IncidentParticipationRoleValue, dO as InteractionTypeValue, dR as MinorAdultStatusValue, e5 as PersonDisplayCategoryValue, e6 as PersonRoleValue, e7 as PersonTypeValue, ee as QuestionFormatValue, ef as QuickStartTemplateId, er as RecordStateValue, et as RelationshipConcernValue, eu as RelationshipDynamicValue, eF as SessionStateValue, eH as SubmissionStateValue, eL as UserStatusValue } from '../platform-auth-64U8jjuw.js';
1
+ import { ec as PlatformToolValue, cI as FunctionStatusValue, ez as RoleLevelValue, eK as ShareViewValue, e8 as PermissionStateValue } from '../platform-auth-CrF5U_JH.js';
2
+ export { j as AccommodationValue, m as AgeBinReportingValue, n as AppScopeValue, o as ApparentAgeValue, cw as DataQualityValue, cG as FormStatusValue, cH as FormTypeValue, cJ as IC13Category, cL as IC13Value, cM as IC22Value, cN as IC23Value, cO as IC24Value, cP as IC25Value, cQ as IC49ReferralOutcomeValue, cR as IC49ReferralVerificationValue, cS as IC49Value, cT as IC4Value, cV as IC56Value, cW as IC57Value, cY as IC58Value, cZ as IC59Value, c_ as IC5Value, dQ as IncidentInvolvementRoleValue, dR as IncidentParticipationRoleValue, dS as InteractionTypeValue, dV as MinorAdultStatusValue, e9 as PersonDisplayCategoryValue, ea as PersonRoleValue, eb as PersonTypeValue, ei as QuestionFormatValue, ej as QuickStartTemplateId, ev as RecordStateValue, ex as RelationshipConcernValue, ey as RelationshipDynamicValue, eJ as SessionStateValue, eL as SubmissionStateValue, eP as UserStatusValue } from '../platform-auth-CrF5U_JH.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.13.1",
3
+ "version": "0.14.0",
4
4
  "description": "Shared constants, types, and models for HTI Labs applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * This module is the fix. It defines the PROJECTION — the seven fields of an
23
23
  * indicator that platform-common actually restates in
24
- * `src/cvcs/coreIndicators.v1.0.0.json` — and the NORMALIZATION that makes a
24
+ * `src/cvcs/coreIndicators.v1.1.0.json` — and the NORMALIZATION that makes a
25
25
  * YAML scalar and a JSON string comparable. `scripts/sot-pins.ts` uses it to
26
26
  * widen the pin; `src/__tests__/cvc-drift-gate.test.ts` (GATE H) uses it to
27
27
  * assert the shipped CVC-136 restates every pinned field faithfully.
@@ -75,7 +75,7 @@ const CATALOG_TO_PROJECTED: ReadonlyArray<readonly [string, ProjectedField]> = [
75
75
  ];
76
76
 
77
77
  /**
78
- * `coreIndicators.v1.0.0.json` entry field name -> projected name. Note the one
78
+ * `coreIndicators.v1.1.0.json` entry field name -> projected name. Note the one
79
79
  * genuine rename: the CVC envelope calls the catalog's `label` a `title`,
80
80
  * because `title` is the envelope-wide field for a human-readable value name.
81
81
  * That rename is structural and deliberate — it is NOT drift.
@@ -279,7 +279,7 @@ export function normalizeCatalogValue(
279
279
  return normalizeProjectedValue(field, value, "catalog");
280
280
  }
281
281
 
282
- /** Normalize one value that came from `src/cvcs/coreIndicators.v1.0.0.json`. */
282
+ /** Normalize one value that came from `src/cvcs/coreIndicators.v1.1.0.json`. */
283
283
  export function normalizeSotValue(field: ProjectedField, value: string | null): string | null {
284
284
  return normalizeProjectedValue(field, value, "sot");
285
285
  }
@@ -325,7 +325,7 @@ export function projectCatalogEntry(entry: Record<string, unknown>): ProjectedIn
325
325
  return project(entry, CATALOG_TO_PROJECTED);
326
326
  }
327
327
 
328
- /** Project one `src/cvcs/coreIndicators.v1.0.0.json` entry. */
328
+ /** Project one `src/cvcs/coreIndicators.v1.1.0.json` entry. */
329
329
  export function projectSotEntry(entry: Record<string, unknown>): ProjectedIndicatorFields {
330
330
  return project(entry, SOT_TO_PROJECTED);
331
331
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sourceRepo": "htilabstech/prototype",
3
3
  "sourceFile": "data/core_indicators.yaml",
4
- "sourceSha": "622410b",
4
+ "sourceSha": "c53378f",
5
5
  "codes": [
6
6
  "abuser_evading_legal_consequences",
7
7
  "abuser_has_weapon",
@@ -56,7 +56,9 @@
56
56
  "denied_basic_needs",
57
57
  "depends_on_employer_for_immigration_status",
58
58
  "depends_on_spouse_or_family_for_immigration_status",
59
+ "disclosed_fear_at_intake",
59
60
  "does_not_control_finances_or_earnings",
61
+ "does_not_control_housing",
60
62
  "does_not_control_identity_documents",
61
63
  "elevated_lethality_risk_signal",
62
64
  "employer_keeps_pay_or_pays_less_than_expected",
@@ -118,6 +120,7 @@
118
120
  "new_to_commercial_sex_industry",
119
121
  "non_consensual_photography_or_recording",
120
122
  "not_in_control_of_immigration_documentation",
123
+ "oppressive_home_life",
121
124
  "other_instability_or_vulnerability_factors",
122
125
  "owes_money_and_cannot_pay_off",
123
126
  "paid_or_owes_fee_to_arrange_travel_to_us",
@@ -137,6 +140,7 @@
137
140
  "promise_of_work_different_than_current_work",
138
141
  "received_things_of_value_while_missing_from_care",
139
142
  "recent_le_engagement",
143
+ "recent_separation",
140
144
  "recruited_by_third_party_into_cs_industry",
141
145
  "regular_alcohol_use",
142
146
  "relies_on_temporary_resources_for_basic_needs",
@@ -184,6 +188,7 @@
184
188
  "suicidal_ideation_history",
185
189
  "suicidal_ideation_recent",
186
190
  "suicide_attempt_history",
191
+ "survival_sex",
187
192
  "third_party_advertises_or_posts_for_person",
188
193
  "third_party_arranged_commercial_sex_acts",
189
194
  "threats_by_employer_or_partner",
@@ -199,6 +204,7 @@
199
204
  "trauma_perpetrator_is_current_manager",
200
205
  "travel_organized_by_third_party",
201
206
  "tricked_or_pressured_into_unwanted_acts",
207
+ "unable_to_speak_freely",
202
208
  "under_18_advertised_age",
203
209
  "under_18_appears_underage",
204
210
  "under_18_known_age",
@@ -696,6 +702,15 @@
696
702
  "isAlert": "none",
697
703
  "alertWhen": null
698
704
  },
705
+ "disclosed_fear_at_intake": {
706
+ "label": "Disclosed fear of a specific person",
707
+ "definition": "The person has told a worker they are afraid of a named or identifiable individual — commonly a former or current partner. Distinct from concerning_mannerisms_anxious_fearful_depressed, which is affect a worker observes rather than something the person said, and from threats_of_harm, which requires a threat to have been made; fear can be current and well-founded with no fresh threat.",
708
+ "family": "lethality_dv",
709
+ "polarity": "increases_risk",
710
+ "severity": "elevated",
711
+ "isAlert": "thread_pave",
712
+ "alertWhen": "current_only"
713
+ },
699
714
  "does_not_control_finances_or_earnings": {
700
715
  "label": "Limited independence: does not control finances or earnings",
701
716
  "definition": "Indication that the person does not control their money or earnings, such as having earnings taken or being unable to access or manage finances.",
@@ -705,6 +720,15 @@
705
720
  "isAlert": "thread_pave",
706
721
  "alertWhen": "current_only"
707
722
  },
723
+ "does_not_control_housing": {
724
+ "label": "Limited independence: does not control where they live",
725
+ "definition": "Indication that an employer, partner, or other person decides where the person lives — housing is assigned or controlled by someone else, rather than chosen by the person.",
726
+ "family": "mechanism_control",
727
+ "polarity": "increases_risk",
728
+ "severity": "elevated",
729
+ "isAlert": "none",
730
+ "alertWhen": null
731
+ },
708
732
  "does_not_control_identity_documents": {
709
733
  "label": "Limited independence: does not control identity documents",
710
734
  "definition": "Indication that the person does not control their identification or identity documents (someone else holds them or access is restricted).",
@@ -770,7 +794,7 @@
770
794
  },
771
795
  "exploitative_pricing_tier_low": {
772
796
  "label": "Exploitative pricing tier (very low relative price)",
773
- "definition": "Ad-derived pricing tier indicates unusually low hourly price relative to local median, potentially signaling economic duress and vulnerability.",
797
+ "definition": "Ad-derived pricing tier is LOW-dominant — the person's parsed hourly rates fall under $50/hr against the pooled ad population (CVC-277 core-CS_price_tier_band; Sarah 2026-07-22 pooled baseline, about the bottom quartile) — potentially signaling economic duress and vulnerability. The SRS design framed this as \"relative to the local median\"; a per-market baseline is the refinement on record, not built.",
774
798
  "family": "unfamilied",
775
799
  "polarity": "depends",
776
800
  "severity": "informational",
@@ -1254,6 +1278,15 @@
1254
1278
  "isAlert": "platform",
1255
1279
  "alertWhen": "current_only"
1256
1280
  },
1281
+ "oppressive_home_life": {
1282
+ "label": "Oppressive, unsafe, or unstable home life",
1283
+ "definition": "Indication that the person's current home life is oppressive, unsafe, or unstable — a present-condition vulnerability, distinct from the childhood household challenges history (VIII-B).",
1284
+ "family": "vulnerability_context",
1285
+ "polarity": "increases_risk",
1286
+ "severity": "elevated",
1287
+ "isAlert": "none",
1288
+ "alertWhen": null
1289
+ },
1257
1290
  "other_instability_or_vulnerability_factors": {
1258
1291
  "label": "Other instability/vulnerability factors (general)",
1259
1292
  "definition": "Initial Screening Tool general indicator (can be selected on its own; contributes to its 8 sub-indicators when no specific sub is ticked)",
@@ -1425,6 +1458,15 @@
1425
1458
  "isAlert": "pave",
1426
1459
  "alertWhen": "recency_under_year"
1427
1460
  },
1461
+ "recent_separation": {
1462
+ "label": "Recent separation from abusive partner",
1463
+ "definition": "Indication that the person has recently left or separated from an abusive partner. Campbell's Danger Assessment treats the period following separation as the highest-risk window for intimate-partner homicide — the signal is about having got out, not about current cohabitation.",
1464
+ "family": "lethality_dv",
1465
+ "polarity": "depends",
1466
+ "severity": "elevated",
1467
+ "isAlert": "thread_pave",
1468
+ "alertWhen": "recency_under_year"
1469
+ },
1428
1470
  "recruited_by_third_party_into_cs_industry": {
1429
1471
  "label": "Recruited by another person/entity into commercial sex industry",
1430
1472
  "definition": "Indication that another person or entity recruited the person into the commercial sex industry.",
@@ -1848,6 +1890,15 @@
1848
1890
  "isAlert": "pave",
1849
1891
  "alertWhen": "always"
1850
1892
  },
1893
+ "survival_sex": {
1894
+ "label": "Survival sex (sex exchanged to meet basic needs)",
1895
+ "definition": "Indication that the person exchanges sex acts to meet basic survival needs — housing, food, drugs, protection, or money for essentials — rather than as an income choice. A standalone activity signal that can coexist with, or exist entirely without, a trafficking determination; it asserts the circumstance of the exchange, never the determination.",
1896
+ "family": "cs_industry_context",
1897
+ "polarity": "depends",
1898
+ "severity": "elevated",
1899
+ "isAlert": "none",
1900
+ "alertWhen": null
1901
+ },
1851
1902
  "third_party_advertises_or_posts_for_person": {
1852
1903
  "label": "Third party posts or manages the person's commercial-sex ads",
1853
1904
  "definition": "Indication that a third party (facilitator) creates, posts, pays for, or controls the commercial-sex advertisements that market the person — distinct from the person posting their own ads. Registered on confirming a posted_by / responsible_for ad or image link (LEADS link model; spec § 13.5).",
@@ -1983,6 +2034,15 @@
1983
2034
  "isAlert": "thread_pave",
1984
2035
  "alertWhen": "current_only"
1985
2036
  },
2037
+ "unable_to_speak_freely": {
2038
+ "label": "Unable to speak freely",
2039
+ "definition": "Indication that the person is not able to speak for themselves — a third party insists on being present, answers on their behalf, or interprets for them, or the person is never encountered alone. Distinct from inability_to_account_for_self, which is about the person's own account being scripted or confused; this is about another party controlling the conversation.",
2040
+ "family": "mechanism_control",
2041
+ "polarity": "depends",
2042
+ "severity": "elevated",
2043
+ "isAlert": "thread_pave",
2044
+ "alertWhen": "current_only"
2045
+ },
1986
2046
  "under_18_advertised_age": {
1987
2047
  "label": "Under 18 (ad-derived / advertised age)",
1988
2048
  "definition": "Ad-derived signal that the person is advertised as under 18 (age field or age-indicator phrases).",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sourceRepo": "htilabstech/hti-scoring",
3
3
  "sourceFile": "weights/risk.weights.json",
4
- "sourceSha": "9b5d654",
4
+ "sourceSha": "9c209cf",
5
5
  "codes": [
6
6
  "abuser_evading_legal_consequences",
7
7
  "abuser_has_weapon",
@@ -25,24 +25,27 @@
25
25
  "branding_or_unusual_tattoos_tied_to_control",
26
26
  "cannot_stop_working_or_freely_leave",
27
27
  "child_not_abusers_in_household",
28
+ "child_welfare_system_involvement",
29
+ "clients_unaware_of_third_party_coordination",
28
30
  "coerced_to_misrepresent_identity_or_activity",
29
31
  "coercive_debt_pressure",
30
- "coercive_debt_pressure_youth",
31
32
  "coercive_migration_or_forced_travel",
32
33
  "cognitive_or_functional_impairment_affecting_consent",
33
34
  "commercial_sex_association_words_or_places",
34
35
  "concerning_mannerisms_anxious_fearful_depressed",
35
36
  "concerning_sexual_behavior_pattern",
37
+ "constraints_due_to_legal_status",
36
38
  "control_quota_required",
37
39
  "cs_activity_criminal_org_connection",
38
40
  "cs_industry_related_criminal_history",
39
41
  "current_injuries_from_abuser",
40
42
  "currently_minor_in_commercial_sex",
41
43
  "debt_terms_deceptive",
42
- "debt_terms_deceptive_youth",
43
44
  "denied_basic_needs",
44
45
  "depends_on_employer_for_immigration_status",
46
+ "depends_on_spouse_or_family_for_immigration_status",
45
47
  "does_not_control_finances_or_earnings",
48
+ "does_not_control_housing",
46
49
  "does_not_control_identity_documents",
47
50
  "employer_keeps_pay_or_pays_less_than_expected",
48
51
  "engages_in_commercial_sex_act",
@@ -80,11 +83,11 @@
80
83
  "inability_to_account_for_self",
81
84
  "intimate_partner_violence_reported_to_law_enforcement",
82
85
  "juvenile_justice_or_child_welfare_involvement",
86
+ "juvenile_justice_system_involvement",
83
87
  "labor_services_activity_recorded",
84
88
  "limited_english_proficiency",
85
89
  "limited_independence",
86
90
  "lives_or_sleeps_at_place_of_work",
87
- "living_with_abuser",
88
91
  "meets_or_has_sex_with_internet_contacts",
89
92
  "monitored_or_isolated_by_controlling_party",
90
93
  "much_older_intimate_partner",
@@ -93,6 +96,7 @@
93
96
  "new_to_commercial_sex_industry",
94
97
  "non_consensual_photography_or_recording",
95
98
  "not_in_control_of_immigration_documentation",
99
+ "oppressive_home_life",
96
100
  "other_instability_or_vulnerability_factors",
97
101
  "owes_money_and_cannot_pay_off",
98
102
  "paid_or_owes_fee_to_arrange_travel_to_us",
@@ -109,6 +113,7 @@
109
113
  "prior_victimization_or_abuse_history",
110
114
  "promise_of_work_different_than_current_work",
111
115
  "received_things_of_value_while_missing_from_care",
116
+ "recent_separation",
112
117
  "recruited_by_third_party_into_cs_industry",
113
118
  "relies_on_temporary_resources_for_basic_needs",
114
119
  "reports_physical_harm_by_employer_or_partner",
@@ -599,8 +599,8 @@
599
599
  "hash": "90aec290aa586a9bbc098c0c8a19536e06b705b054e4444ff6461a9913340a5c"
600
600
  },
601
601
  "core_indicators": {
602
- "count": 220,
603
- "hash": "634ba69f31273bace3c3be9509aba41f4c348086210905e42a6f97d393c64fbb"
602
+ "count": 226,
603
+ "hash": "5e62f299607d1e2acb361c7594606b85cfc5c2720a4d97ec0da19c60926c87a1"
604
604
  },
605
605
  "risk_severity_band": {
606
606
  "count": 9,
@@ -18,20 +18,25 @@
18
18
  * THE PIN
19
19
  * -------
20
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).
21
+ * `weights/risk.weights.json` at htilabstech/hti-scoring@9c209cf (174 codes).
22
22
  * It is a COMMITTED PIN, not a live read - platform-common must not take a
23
23
  * build-time dependency on the scoring repo. When @hti/scoring starts emitting
24
24
  * a new code, bumping this list is a deliberate, reviewable commit that forces
25
25
  * the matching CVC-136 entry to be authored in the same PR.
26
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.
27
+ * SCORING IS NO LONGER AHEAD OF THE CODEBOOK (0 CODES)
28
+ * ----------------------------------------------------
29
+ * From 0.8.13 through the 622410b refresh, `coercive_debt_pressure_youth` and
30
+ * `debt_terms_deceptive_youth` were emitted by @hti/scoring (9b5d654) but
31
+ * were NOT in the prototype's canonical `data/core_indicators.yaml`. They were
32
+ * KEPT and flagged `pendingUpstreamAdoption: true` because dropping a code
33
+ * scoring emits would break the scoring contract — that is the trap this test
34
+ * exists to prevent. hti-scoring 9c209cf retired both emits in favour of the
35
+ * canonical `coercive_debt_pressure` / `debt_terms_deceptive` (whose upstream
36
+ * rows carry the `_youth` names as `legacy_aliases`), and the catalog never
37
+ * adopted them, so at c53378f / 9c209cf they are WITHDRAWN: no emitter, no
38
+ * catalog row, nothing left to protect. `PENDING_UPSTREAM_ADOPTION` is kept as
39
+ * an EMPTY list so the next genuinely-ahead emit has a named place to land.
35
40
  */
36
41
 
37
42
  import { readFileSync } from "node:fs";
@@ -49,12 +54,19 @@ const SOT_FILE = path.resolve(
49
54
  __dirname,
50
55
  "..",
51
56
  "cvcs",
52
- "coreIndicators.v1.0.0.json",
57
+ "coreIndicators.v1.1.0.json",
53
58
  );
54
59
 
55
60
  /**
56
61
  * `Object.keys(RISK_WEIGHTS.emits_by_code)` at
57
- * htilabstech/hti-scoring@9b5d654 (weights/risk.weights.json). 169 codes.
62
+ * htilabstech/hti-scoring@9c209cf (weights/risk.weights.json). 174 codes.
63
+ * 9b5d654 -> 9c209cf: +8 (`child_welfare_system_involvement`,
64
+ * `clients_unaware_of_third_party_coordination`,
65
+ * `constraints_due_to_legal_status`,
66
+ * `depends_on_spouse_or_family_for_immigration_status`,
67
+ * `does_not_control_housing`, `juvenile_justice_system_involvement`,
68
+ * `oppressive_home_life`, `recent_separation`) / -3 (`living_with_abuser`,
69
+ * `coercive_debt_pressure_youth`, `debt_terms_deceptive_youth`).
58
70
  * PINNED - see the module header before editing.
59
71
  */
60
72
  const SCORING_EMITS_BY_CODE: readonly string[] = [
@@ -80,24 +92,27 @@ const SCORING_EMITS_BY_CODE: readonly string[] = [
80
92
  "branding_or_unusual_tattoos_tied_to_control",
81
93
  "cannot_stop_working_or_freely_leave",
82
94
  "child_not_abusers_in_household",
95
+ "child_welfare_system_involvement",
96
+ "clients_unaware_of_third_party_coordination",
83
97
  "coerced_to_misrepresent_identity_or_activity",
84
98
  "coercive_debt_pressure",
85
- "coercive_debt_pressure_youth",
86
99
  "coercive_migration_or_forced_travel",
87
100
  "cognitive_or_functional_impairment_affecting_consent",
88
101
  "commercial_sex_association_words_or_places",
89
102
  "concerning_mannerisms_anxious_fearful_depressed",
90
103
  "concerning_sexual_behavior_pattern",
104
+ "constraints_due_to_legal_status",
91
105
  "control_quota_required",
92
106
  "cs_activity_criminal_org_connection",
93
107
  "cs_industry_related_criminal_history",
94
108
  "current_injuries_from_abuser",
95
109
  "currently_minor_in_commercial_sex",
96
110
  "debt_terms_deceptive",
97
- "debt_terms_deceptive_youth",
98
111
  "denied_basic_needs",
99
112
  "depends_on_employer_for_immigration_status",
113
+ "depends_on_spouse_or_family_for_immigration_status",
100
114
  "does_not_control_finances_or_earnings",
115
+ "does_not_control_housing",
101
116
  "does_not_control_identity_documents",
102
117
  "employer_keeps_pay_or_pays_less_than_expected",
103
118
  "engages_in_commercial_sex_act",
@@ -135,11 +150,11 @@ const SCORING_EMITS_BY_CODE: readonly string[] = [
135
150
  "inability_to_account_for_self",
136
151
  "intimate_partner_violence_reported_to_law_enforcement",
137
152
  "juvenile_justice_or_child_welfare_involvement",
153
+ "juvenile_justice_system_involvement",
138
154
  "labor_services_activity_recorded",
139
155
  "limited_english_proficiency",
140
156
  "limited_independence",
141
157
  "lives_or_sleeps_at_place_of_work",
142
- "living_with_abuser",
143
158
  "meets_or_has_sex_with_internet_contacts",
144
159
  "monitored_or_isolated_by_controlling_party",
145
160
  "much_older_intimate_partner",
@@ -148,6 +163,7 @@ const SCORING_EMITS_BY_CODE: readonly string[] = [
148
163
  "new_to_commercial_sex_industry",
149
164
  "non_consensual_photography_or_recording",
150
165
  "not_in_control_of_immigration_documentation",
166
+ "oppressive_home_life",
151
167
  "other_instability_or_vulnerability_factors",
152
168
  "owes_money_and_cannot_pay_off",
153
169
  "paid_or_owes_fee_to_arrange_travel_to_us",
@@ -164,6 +180,7 @@ const SCORING_EMITS_BY_CODE: readonly string[] = [
164
180
  "prior_victimization_or_abuse_history",
165
181
  "promise_of_work_different_than_current_work",
166
182
  "received_things_of_value_while_missing_from_care",
183
+ "recent_separation",
167
184
  "recruited_by_third_party_into_cs_industry",
168
185
  "relies_on_temporary_resources_for_basic_needs",
169
186
  "reports_physical_harm_by_employer_or_partner",
@@ -229,11 +246,11 @@ const SCORING_EMITS_BY_CODE: readonly string[] = [
229
246
  "youth_watched_filmed_or_photographed_sexually_explicit",
230
247
  ];
231
248
 
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
- ];
249
+ /**
250
+ * Codes @hti/scoring emits that upstream `core_indicators.yaml` has not yet
251
+ * adopted. EMPTY as of c53378f / 9c209cf — see the module header.
252
+ */
253
+ const PENDING_UPSTREAM_ADOPTION: readonly string[] = [];
237
254
 
238
255
  const envelope = CvcEnvelopeSchema.parse(
239
256
  JSON.parse(readFileSync(SOT_FILE, "utf-8")),
@@ -244,6 +261,8 @@ const substantive = envelope.entries.filter(
244
261
  (e) => e.code.split("-")[1] !== "000",
245
262
  );
246
263
  const substantiveKeys = new Set(substantive.map((e) => e.key));
264
+ const isDeprecated = (e: object): boolean =>
265
+ (e as { deprecated?: unknown }).deprecated === true;
247
266
 
248
267
  describe("CVC-136 core_indicators", () => {
249
268
  it("is numbered 136 in segment 1 of every code", () => {
@@ -261,14 +280,22 @@ describe("CVC-136 core_indicators", () => {
261
280
  ]);
262
281
  });
263
282
 
264
- it("has exactly 216 substantive codes (214 canonical + 2 scoring-ahead)", () => {
283
+ it("has exactly 222 substantive codes (220 canonical + 0 scoring-ahead + 2 deprecated)", () => {
265
284
  // 0.8.14 refreshed the catalog pin a596eb9 (208) -> 84a1b67 (213):
266
285
  // +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);
286
+ // 622410b refresh: 84a1b67 (213) -> 622410b (214): +1 upstream mint
287
+ // (`active_protective_order`, minted 2026-08-08), 0 withdrawn.
288
+ // c53378f refresh: 622410b (214) -> c53378f (220): +6 upstream mints
289
+ // (`disclosed_fear_at_intake`, `does_not_control_housing`,
290
+ // `oppressive_home_life`, `recent_separation`, `survival_sex`,
291
+ // `unable_to_speak_freely`), 0 withdrawn upstream; the 2 scoring-ahead
292
+ // `_youth` codes leave the allowlist (scoring 9c209cf no longer emits
293
+ // them) and become DEPRECATED read-only rows — kept because PAVE 2.0
294
+ // `develop` still writes both from the IDA (see the drift gate's
295
+ // `CVC136_DEPRECATED`). SOT version 1.0.0 -> 1.1.0 in the same change.
296
+ expect(substantive.length).toBe(222);
297
+ expect(substantive.filter((e) => !isDeprecated(e)).length).toBe(220);
298
+ expect(envelope.entries.length).toBe(226);
272
299
  });
273
300
 
274
301
  it("has no duplicate keys", () => {
@@ -277,8 +304,8 @@ describe("CVC-136 core_indicators", () => {
277
304
  });
278
305
 
279
306
  describe("CVC-136 <-> @hti/scoring emits_by_code invariant", () => {
280
- it("pins exactly 169 emitted codes", () => {
281
- expect(new Set(SCORING_EMITS_BY_CODE).size).toBe(169);
307
+ it("pins exactly 174 emitted codes", () => {
308
+ expect(new Set(SCORING_EMITS_BY_CODE).size).toBe(174);
282
309
  });
283
310
 
284
311
  it("EVERY code @hti/scoring emits exists in CVC-136", () => {
@@ -295,7 +322,9 @@ describe("CVC-136 <-> @hti/scoring emits_by_code invariant", () => {
295
322
  expect(missing).toHaveLength(0);
296
323
  });
297
324
 
298
- it("the 2 scoring-ahead codes are present and flagged pendingUpstreamAdoption", () => {
325
+ it("the scoring-ahead list is EMPTY; any entry must be present and flagged pendingUpstreamAdoption", () => {
326
+ // Guard the escape hatch: scoring is not ahead of the catalog at 9c209cf.
327
+ expect(PENDING_UPSTREAM_ADOPTION).toEqual([]);
299
328
  for (const code of PENDING_UPSTREAM_ADOPTION) {
300
329
  const entry = substantive.find((e) => e.key === code);
301
330
  expect(entry, `${code} must be present in CVC-136`).toBeDefined();
@@ -317,6 +346,38 @@ describe("CVC-136 <-> @hti/scoring emits_by_code invariant", () => {
317
346
  expect(substantiveKeys.has("unusual_work_circumstances_general")).toBe(false);
318
347
  expect(substantiveKeys.has("unusual_work_circumstances")).toBe(true);
319
348
  });
349
+
350
+ it("the former `_youth` scoring-ahead codes are DEPRECATED (read-only, superseded), never live; their canonical rows ship", () => {
351
+ // hti-scoring 9c209cf retired these emits and the catalog never adopted
352
+ // them — but PAVE 2.0 `develop` @ 07f3ccd still writes both from the IDA
353
+ // (`IDA-syn-missing_care-4i`/`-4ii`), so the keys stay resolvable here as
354
+ // deprecated rows pointing at their canonical successors.
355
+ for (const [key, successor] of [
356
+ ["coercive_debt_pressure_youth", "coercive_debt_pressure"],
357
+ ["debt_terms_deceptive_youth", "debt_terms_deceptive"],
358
+ ] as const) {
359
+ const row = substantive.find((e) => e.key === key) as
360
+ | (typeof substantive)[number] & { deprecated?: unknown; supersededBy?: unknown }
361
+ | undefined;
362
+ expect(row, `${key} must still resolve`).toBeDefined();
363
+ expect(row!.selectable).toBe(false);
364
+ expect(row!.deprecated).toBe(true);
365
+ expect(row!.supersededBy).toBe(successor);
366
+ expect(SCORING_EMITS_BY_CODE, `${key} is not emitted`).not.toContain(key);
367
+ expect(substantiveKeys.has(successor)).toBe(true);
368
+ expect(SCORING_EMITS_BY_CODE, `${successor} is emitted`).toContain(successor);
369
+ }
370
+ });
371
+
372
+ it("the hardcoded emit set is identical to scoringEmits.pin.json (one SoT, pinned twice on purpose)", () => {
373
+ // Two declarations of the 174-code emit set exist — this hand-pinned list
374
+ // (so a pin-file edit alone cannot move the invariant) and the generated
375
+ // pin — and they must never drift apart.
376
+ const pin = JSON.parse(
377
+ readFileSync(path.resolve(__dirname, "..", "__sot__", "scoringEmits.pin.json"), "utf8"),
378
+ ) as { codes: string[] };
379
+ expect([...SCORING_EMITS_BY_CODE].sort()).toEqual([...pin.codes].sort());
380
+ });
320
381
  });
321
382
 
322
383
  describe("CVC-136 SOT JSON <-> hand-coded ic.ts array", () => {