@htilabs/platform-common-models 0.8.12 → 0.8.13

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 (95) hide show
  1. package/dist/constants/index.cjs +133 -287
  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 +133 -275
  6. package/dist/constants/index.js.map +1 -1
  7. package/dist/cvcs/index.cjs +11670 -969
  8. package/dist/cvcs/index.cjs.map +1 -1
  9. package/dist/cvcs/index.d.cts +14727 -3020
  10. package/dist/cvcs/index.d.ts +14727 -3020
  11. package/dist/cvcs/index.js +11643 -968
  12. package/dist/cvcs/index.js.map +1 -1
  13. package/dist/index.cjs +12718 -1360
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +1012 -128
  16. package/dist/index.d.ts +1012 -128
  17. package/dist/index.js +12671 -1345
  18. package/dist/index.js.map +1 -1
  19. package/dist/{platform-auth-BwfZ0bxU.d.cts → platform-auth-BfCMuAlC.d.cts} +2 -74
  20. package/dist/{platform-auth-BwfZ0bxU.d.ts → platform-auth-BfCMuAlC.d.ts} +2 -74
  21. package/dist/schemas/index.cjs +0 -152
  22. package/dist/schemas/index.cjs.map +1 -1
  23. package/dist/schemas/index.js +0 -152
  24. package/dist/schemas/index.js.map +1 -1
  25. package/dist/services/index.cjs +0 -3
  26. package/dist/services/index.cjs.map +1 -1
  27. package/dist/services/index.js +0 -3
  28. package/dist/services/index.js.map +1 -1
  29. package/dist/types/index.d.cts +2 -2
  30. package/dist/types/index.d.ts +2 -2
  31. package/package.json +4 -1
  32. package/src/__sot__/README.md +56 -0
  33. package/src/__sot__/coreIndicators.pin.json +215 -0
  34. package/src/__sot__/cvcIndex.pin.json +268 -0
  35. package/src/__sot__/scoringEmits.pin.json +176 -0
  36. package/src/__tests__/__snapshots__/cvc-sot.snap +109 -37
  37. package/src/__tests__/cvc-136-scoring-invariant.test.ts +323 -0
  38. package/src/__tests__/cvc-drift-gate.test.ts +596 -0
  39. package/src/__tests__/cvc-sot-snapshot.test.ts +38 -8
  40. package/src/__tests__/cvc-structural.test.ts +37 -1
  41. package/src/constants/ic.ts +184 -333
  42. package/src/constants/service-catalog.ts +4 -2
  43. package/src/cvcs/adminRoles.v1.0.0.json +153 -0
  44. package/src/cvcs/administeringJurisdiction.v1.0.0.json +40 -40
  45. package/src/cvcs/ageBinReporting.v1.0.0.json +40 -40
  46. package/src/cvcs/assertionDomain.v1.1.0.json +78 -105
  47. package/src/cvcs/citizenship.v1.0.0.json +3062 -0
  48. package/src/cvcs/contactInfoTypes.v1.0.0.json +40 -40
  49. package/src/cvcs/coreDhState.v1.0.0.json +113 -0
  50. package/src/cvcs/coreIndicators.v1.0.0.json +2840 -0
  51. package/src/cvcs/employmentStatus.v1.0.0.json +60 -60
  52. package/src/cvcs/exploitationType.v1.0.0.json +106 -0
  53. package/src/cvcs/facilitatorEntityType.v1.0.0.json +40 -40
  54. package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +50 -50
  55. package/src/cvcs/hmisCurrentLivingSituation.v1.0.0.json +409 -0
  56. package/src/cvcs/homelessStatus.v1.0.0.json +27 -27
  57. package/src/cvcs/housingSubsidyTypes.v1.0.0.json +26 -24
  58. package/src/cvcs/incarcerationEpisodeType.v1.0.0.json +106 -0
  59. package/src/cvcs/incidentInvolvementRoles.v1.0.0.json +40 -40
  60. package/src/cvcs/incidentParticipationRoles.v1.0.0.json +40 -40
  61. package/src/cvcs/index.ts +55 -2
  62. package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +106 -0
  63. package/src/cvcs/juvenileJusticeInvolvementStatus.v1.0.0.json +32 -32
  64. package/src/cvcs/militaryBranch.v1.0.0.json +20 -20
  65. package/src/cvcs/militaryStatus.v1.0.0.json +20 -20
  66. package/src/cvcs/nameType.v1.0.0.json +40 -40
  67. package/src/cvcs/offenderStatus.v1.0.0.json +40 -40
  68. package/src/cvcs/offenderStatusFamily.v1.0.0.json +36 -36
  69. package/src/cvcs/poPetitionBasis.v1.0.0.json +96 -0
  70. package/src/cvcs/poStatus.v1.0.0.json +144 -0
  71. package/src/cvcs/poViolationStatus.v1.0.0.json +76 -0
  72. package/src/cvcs/radiusBucket.v1.0.0.json +23 -11
  73. package/src/cvcs/recencyBand.v1.0.0.json +126 -42
  74. package/src/cvcs/referralEntityCategory.v1.0.0.json +40 -40
  75. package/src/cvcs/riskSeverityBand.v1.0.0.json +139 -0
  76. package/src/cvcs/roiScope.v1.0.0.json +111 -3
  77. package/src/cvcs/roiStatus.v1.0.0.json +18 -10
  78. package/src/cvcs/romanticRelationshipChangeType.v1.0.0.json +2 -1
  79. package/src/cvcs/serviceCategories.v1.0.0.json +44 -44
  80. package/src/cvcs/serviceDeliveryChannel.v1.0.0.json +147 -0
  81. package/src/cvcs/serviceMechanisms.v1.0.0.json +36 -36
  82. package/src/cvcs/serviceStates.v1.0.0.json +40 -40
  83. package/src/cvcs/sessionTemplate.v1.0.0.json +261 -0
  84. package/src/cvcs/sexProviderSubrole.v1.0.0.json +35 -28
  85. package/src/cvcs/smtType.v1.0.0.json +40 -40
  86. package/src/cvcs/sourceCategory.v1.1.0.json +8 -1
  87. package/src/cvcs/sourceInstrument.v1.0.0.json +458 -0
  88. package/src/cvcs/sourceSystem.v1.0.0.json +203 -0
  89. package/src/cvcs/traffickingRelevantRole.v1.0.0.json +104 -0
  90. package/src/cvcs/userRoles.v1.0.0.json +203 -0
  91. package/src/cvcs/victimStatusFamily.v1.0.0.json +40 -40
  92. package/src/cvcs/whyNots.v1.0.0.json +385 -0
  93. package/src/generated/cvc-enums.ts +1047 -127
  94. package/src/services/cvcRegistryService.ts +1 -1
  95. package/src/cvcs/riskBand.v1.0.0.json +0 -98
@@ -572,11 +572,13 @@ const SOT_SPECS: readonly SotSpec[] = [
572
572
  // codes + 1 missingness root + 3 canonical missingness children = 11.
573
573
  // CVC number is PROVISIONAL pending codebook-session ratification.
574
574
  { file: "relationshipConcern.v1.0.0.json", domain: "relationship_concern", expectedCount: 11 },
575
- // PROVISIONAL CVC-232 recency_band — 6 time-window bands (within_3_months,
576
- // months_3_to_6, months_6_to_12, one_year_or_more, years_3_to_10,
577
- // ten_plus_years) + 1 missingness root + 3 canonical missingness children = 10.
578
- // CVC number is PROVISIONAL pending codebook-session ratification.
579
- { file: "recencyBand.v1.0.0.json", domain: "recency_band", expectedCount: 10 },
575
+ // CVC-137 recency_band — the CANONICAL 8-band key system adopted in 0.8.13
576
+ // (w3m, m3_6, m6_12, y1p, y1_3, y3_10, y10p, ylt3 — the lowercase
577
+ // transliterations of W3M/M3_6/M6_12/Y1P/Y1_3/Y3_10/Y10P/YLT3, carried
578
+ // verbatim in `canonicalCode`) + 1 missingness root + 3 canonical missingness
579
+ // children = 12. Replaces the 6 semantic slugs shipped before 0.8.13; all 6
580
+ // map 1:1 onto a canonical band, and y1_3 / ylt3 are net-new.
581
+ { file: "recencyBand.v1.0.0.json", domain: "recency_band", expectedCount: 12 },
580
582
  // PROVISIONAL CVC-233 housing_subsidy_types — 12 HMIS-aligned subsidy types
581
583
  // (housing_choice_voucher, public_housing, project_based_rental_assistance,
582
584
  // permanent_supportive_housing, rapid_rehousing_assistance,
@@ -586,7 +588,7 @@ const SOT_SPECS: readonly SotSpec[] = [
586
588
  // root + 3 canonical missingness children = 16. CVC number is PROVISIONAL
587
589
  // pending ratification.
588
590
  { file: "housingSubsidyTypes.v1.0.0.json", domain: "housing_subsidy_types", expectedCount: 16 },
589
- { file: "assertionDomain.v1.1.0.json", domain: "assertion_domain", expectedCount: 71 },
591
+ { file: "assertionDomain.v1.1.0.json", domain: "assertion_domain", expectedCount: 68 },
590
592
  { file: "activityType.v1.0.0.json", domain: "activity_type", expectedCount: 14 },
591
593
  { file: "provenanceSourceId.v1.0.0.json", domain: "provenance_source_id", expectedCount: 13 },
592
594
  { file: "radiusBucket.v1.0.0.json", domain: "radius_bucket", expectedCount: 9 },
@@ -608,7 +610,6 @@ const SOT_SPECS: readonly SotSpec[] = [
608
610
  // 5 bands (severe/elevated/review/watch/stable — `stable` is the cutoff-less
609
611
  // fall-through floor, so the count is 5, NOT the 4 numeric BandCutoffs
610
612
  // fields) + 4 missingness = 9
611
- { file: "riskBand.v1.0.0.json", domain: "risk_band", expectedCount: 9 },
612
613
  // ─── 0.8.12 vocabulary batch ───
613
614
  // CANONICAL Notion CVC-133 `core - functions` (verified v1.0): 77 functions
614
615
  // + 4 missingness = 81
@@ -618,12 +619,41 @@ const SOT_SPECS: readonly SotSpec[] = [
618
619
  { file: "needsAssessmentChangeType.v1.0.0.json", domain: "needs_assessment_change_type", expectedCount: 13 },
619
620
  // 15 ROI scope items (@pave/domain ROI_SCOPE_KEYS — the PAVE-seed-attested
620
621
  // subset of the prototype's 27-item UI superset) + 4 = 19
621
- { file: "roiScope.v1.0.0.json", domain: "roi_scope", expectedCount: 19 },
622
+ { file: "roiScope.v1.0.0.json", domain: "roi_scope", expectedCount: 31 },
622
623
  // 5 stored-ROI lifecycle states (@pave/domain ROI_STATUSES) + 4 = 9
623
624
  { file: "roiStatus.v1.0.0.json", domain: "roi_status", expectedCount: 9 },
624
625
  // 2 HMIS FY2026 "P2 Referrals Provided" outcomes (attained / not_attained)
625
626
  // + 4 = 6. The not-attained REASON is a separate axis, not folded in here.
626
627
  { file: "coreReferralOutcome.v1.0.0.json", domain: "core_referral_outcome", expectedCount: 6 },
628
+ // ─── 0.8.13 canonical CVC batch ───
629
+ { file: "coreDhState.v1.0.0.json", domain: "dh_state", expectedCount: 9 },
630
+ { file: "coreIndicators.v1.0.0.json", domain: "core_indicators", expectedCount: 214 },
631
+ { file: "riskSeverityBand.v1.0.0.json", domain: "risk_severity_band", expectedCount: 9 },
632
+ { file: "adminRoles.v1.0.0.json", domain: "admin_roles", expectedCount: 14 },
633
+ { file: "userRoles.v1.0.0.json", domain: "user_roles", expectedCount: 19 },
634
+ { file: "hmisCurrentLivingSituation.v1.0.0.json", domain: "hmis_current_living_situation", expectedCount: 33 },
635
+ { file: "juvenileJusticeEpisodeType.v1.0.0.json", domain: "juvenile_justice_episode_type", expectedCount: 9 },
636
+ { file: "incarcerationEpisodeType.v1.0.0.json", domain: "incarceration_episode_type", expectedCount: 9 },
637
+ { file: "exploitationType.v1.0.0.json", domain: "exploitation_type", expectedCount: 9 },
638
+ { file: "sourceSystem.v1.0.0.json", domain: "source_system", expectedCount: 19 },
639
+ { file: "sourceInstrument.v1.0.0.json", domain: "source_instrument", expectedCount: 41 },
640
+ { file: "poPetitionBasis.v1.0.0.json", domain: "po_petition_basis", expectedCount: 8 },
641
+ { file: "poStatus.v1.0.0.json", domain: "po_status", expectedCount: 12 },
642
+ { file: "poViolationStatus.v1.0.0.json", domain: "po_violation_status", expectedCount: 6 },
643
+ { file: "sessionTemplate.v1.0.0.json", domain: "session_template", expectedCount: 23 },
644
+ { file: "serviceDeliveryChannel.v1.0.0.json", domain: "service_delivery_channel", expectedCount: 11 },
645
+ { file: "whyNots.v1.0.0.json", domain: "why_nots", expectedCount: 32 },
646
+ // CVC-182 — 249 countries (codes MINTED; upstream Code column is blank) + 1
647
+ // missingness root + 3 canonical missingness children (Unknown / Declined to
648
+ // asnwer / Not collected, carried verbatim from the codebook) = 253.
649
+ { file: "citizenship.v1.0.0.json", domain: "citizenship", expectedCount: 253 },
650
+ // CVC-235 — 4 L1 trafficking-relevant roles + 1 missingness root + 3 canonical
651
+ // missingness children = 8.
652
+ {
653
+ file: "traffickingRelevantRole.v1.0.0.json",
654
+ domain: "trafficking_relevant_role",
655
+ expectedCount: 8,
656
+ },
627
657
  ] as const;
628
658
 
629
659
  // ─── Helpers ────────────────────────────────────────────────────────────────
@@ -179,7 +179,6 @@ const SOT_FILES: readonly SotFile[] = [
179
179
  { file: "housingSubsidyTypes.v1.0.0.json", expectedDomain: "housing_subsidy_types" },
180
180
  // ─── Risk taxonomy (names-only projection of the @hti/scoring SOT) ───
181
181
  { file: "riskCategory.v1.0.0.json", expectedDomain: "risk_category" },
182
- { file: "riskBand.v1.0.0.json", expectedDomain: "risk_band" },
183
182
  // ─── 0.8.12 vocabulary batch ───
184
183
  { file: "coreFunctions.v1.0.0.json", expectedDomain: "core_functions" },
185
184
  { file: "needsAssessmentChangeType.v1.0.0.json", expectedDomain: "needs_assessment_change_type" },
@@ -187,6 +186,43 @@ const SOT_FILES: readonly SotFile[] = [
187
186
  { file: "roiStatus.v1.0.0.json", expectedDomain: "roi_status" },
188
187
  { file: "coreReferralOutcome.v1.0.0.json", expectedDomain: "core_referral_outcome" },
189
188
  { file: "assertionDomain.v1.1.0.json", expectedDomain: "assertion_domain" },
189
+ // ─── 0.8.13 canonical CVC batch ───
190
+ { file: "coreDhState.v1.0.0.json", expectedDomain: "dh_state" },
191
+ { file: "coreIndicators.v1.0.0.json", expectedDomain: "core_indicators" },
192
+ { file: "riskSeverityBand.v1.0.0.json", expectedDomain: "risk_severity_band" },
193
+ { file: "adminRoles.v1.0.0.json", expectedDomain: "admin_roles" },
194
+ { file: "userRoles.v1.0.0.json", expectedDomain: "user_roles" },
195
+ { file: "hmisCurrentLivingSituation.v1.0.0.json", expectedDomain: "hmis_current_living_situation" },
196
+ { file: "juvenileJusticeEpisodeType.v1.0.0.json", expectedDomain: "juvenile_justice_episode_type" },
197
+ { file: "incarcerationEpisodeType.v1.0.0.json", expectedDomain: "incarceration_episode_type" },
198
+ { file: "exploitationType.v1.0.0.json", expectedDomain: "exploitation_type" },
199
+ { file: "sourceSystem.v1.0.0.json", expectedDomain: "source_system" },
200
+ { file: "sourceInstrument.v1.0.0.json", expectedDomain: "source_instrument" },
201
+ { file: "poPetitionBasis.v1.0.0.json", expectedDomain: "po_petition_basis" },
202
+ { file: "poStatus.v1.0.0.json", expectedDomain: "po_status" },
203
+ { file: "poViolationStatus.v1.0.0.json", expectedDomain: "po_violation_status" },
204
+ { file: "sessionTemplate.v1.0.0.json", expectedDomain: "session_template" },
205
+ { file: "serviceDeliveryChannel.v1.0.0.json", expectedDomain: "service_delivery_channel" },
206
+ { file: "whyNots.v1.0.0.json", expectedDomain: "why_nots" },
207
+ // ─── 0.8.13 held-item resolutions (Job A) ───
208
+ { file: "citizenship.v1.0.0.json", expectedDomain: "citizenship" },
209
+ { file: "traffickingRelevantRole.v1.0.0.json", expectedDomain: "trafficking_relevant_role" },
210
+ // ─── Domains the hand-maintained list previously OMITTED (found by the
211
+ // CVC drift gate, which scans the directory instead of a list). ───
212
+ { file: "activityType.v1.0.0.json", expectedDomain: "activity_type" },
213
+ { file: "childChangeType.v1.0.0.json", expectedDomain: "child_change_type" },
214
+ { file: "contactLinkType.v1.0.0.json", expectedDomain: "contact_link_type" },
215
+ { file: "hivStatus.v1.0.0.json", expectedDomain: "hiv_status" },
216
+ { file: "immigrationLegalStatusChangeType.v1.0.0.json", expectedDomain: "immigration_legal_status_change_type" },
217
+ { file: "mentalHealthStatus.v1.0.0.json", expectedDomain: "mental_health_status" },
218
+ { file: "programEnrollmentChangeType.v1.0.0.json", expectedDomain: "program_enrollment_change_type" },
219
+ { file: "provenanceSourceId.v1.0.0.json", expectedDomain: "provenance_source_id" },
220
+ { file: "radiusBucket.v1.0.0.json", expectedDomain: "radius_bucket" },
221
+ { file: "roiMethod.v1.0.0.json", expectedDomain: "roi_method" },
222
+ { file: "romanticRelationshipChangeType.v1.0.0.json", expectedDomain: "romantic_relationship_change_type" },
223
+ { file: "sessionNoteVisibility.v1.0.0.json", expectedDomain: "session_note_visibility" },
224
+ { file: "specialNeedsDisabilities.v1.0.0.json", expectedDomain: "special_needs_disabilities" },
225
+ { file: "suggestionSource.v1.0.0.json", expectedDomain: "suggestion_source" },
190
226
  ] as const;
191
227
 
192
228
  function loadSot(file: string): unknown {