@htilabs/platform-common-models 0.8.8 → 0.9.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 (78) hide show
  1. package/README.md +44 -0
  2. package/dist/config/index.cjs +191 -0
  3. package/dist/config/index.cjs.map +1 -0
  4. package/dist/config/index.d.cts +101 -0
  5. package/dist/config/index.d.ts +101 -0
  6. package/dist/config/index.js +165 -0
  7. package/dist/config/index.js.map +1 -0
  8. package/dist/constants/index.cjs +5 -432
  9. package/dist/constants/index.cjs.map +1 -1
  10. package/dist/constants/index.d.cts +1 -1
  11. package/dist/constants/index.d.ts +1 -1
  12. package/dist/constants/index.js +5 -429
  13. package/dist/constants/index.js.map +1 -1
  14. package/dist/{cvcEntry-DaDrEuTa.d.cts → cvcEntry-0BIB9sen.d.cts} +44 -44
  15. package/dist/{cvcEntry-DaDrEuTa.d.ts → cvcEntry-0BIB9sen.d.ts} +44 -44
  16. package/dist/cvcs/index.cjs +5863 -7181
  17. package/dist/cvcs/index.cjs.map +1 -1
  18. package/dist/cvcs/index.d.cts +3127 -4581
  19. package/dist/cvcs/index.d.ts +3127 -4581
  20. package/dist/cvcs/index.js +5863 -7173
  21. package/dist/cvcs/index.js.map +1 -1
  22. package/dist/{index-C0J3f169.d.ts → index-CDoqrfc1.d.ts} +1 -1
  23. package/dist/{index-EPjPjR0z.d.cts → index-Zu_mOJRn.d.cts} +1 -1
  24. package/dist/index.cjs +1780 -3613
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +191 -544
  27. package/dist/index.d.ts +191 -544
  28. package/dist/index.js +5967 -7775
  29. package/dist/index.js.map +1 -1
  30. package/dist/models/index.d.cts +2 -2
  31. package/dist/models/index.d.ts +2 -2
  32. package/dist/{platform-auth-BSKYSDKe.d.cts → platform-auth-XVB9aHqR.d.cts} +3 -19
  33. package/dist/{platform-auth-BSKYSDKe.d.ts → platform-auth-XVB9aHqR.d.ts} +3 -19
  34. package/dist/schemas/index.cjs +9 -26
  35. package/dist/schemas/index.cjs.map +1 -1
  36. package/dist/schemas/index.d.cts +39 -35
  37. package/dist/schemas/index.d.ts +39 -35
  38. package/dist/schemas/index.js +9 -26
  39. package/dist/schemas/index.js.map +1 -1
  40. package/dist/types/index.d.cts +2 -2
  41. package/dist/types/index.d.ts +2 -2
  42. package/package.json +25 -19
  43. package/src/__tests__/__snapshots__/cvc-sot.snap +13 -77
  44. package/src/__tests__/cvc-sot-snapshot.test.ts +11 -62
  45. package/src/__tests__/cvc-structural.test.ts +2 -11
  46. package/src/__tests__/runtime-contract-validator.test.ts +556 -0
  47. package/src/config/fixtures/valid.yaml +90 -0
  48. package/src/config/index.ts +352 -0
  49. package/src/constants/ic.ts +3 -445
  50. package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +0 -9
  51. package/src/cvcs/hmisSex.v1.0.0.json +89 -0
  52. package/src/cvcs/identificationStatus.v1.0.0.json +0 -18
  53. package/src/cvcs/incomeBenefitsSources.v1.0.0.json +2 -31
  54. package/src/cvcs/index.ts +1 -17
  55. package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +96 -0
  56. package/src/cvcs/recencyBand.v1.0.0.json +57 -38
  57. package/src/cvcs/{serviceCategories.v1.1.0.json → serviceCategories.v1.0.0.json} +1091 -1091
  58. package/src/cvcs/serviceStates.v1.0.0.json +1 -23
  59. package/src/cvcs/sourceSubtype.v1.1.0.json +0 -36
  60. package/src/cvcs/verificationMethod.v1.0.0.json +0 -18
  61. package/src/generated/cvc-enums.ts +149 -572
  62. package/src/index.ts +20 -0
  63. package/src/schemas/common.ts +4 -0
  64. package/src/cvcs/activityType.v1.0.0.json +0 -143
  65. package/src/cvcs/assertionDomain.v1.0.0.json +0 -629
  66. package/src/cvcs/contactLinkType.v1.0.0.json +0 -89
  67. package/src/cvcs/hmisRelationshipToHoh.v1.0.0.json +0 -104
  68. package/src/cvcs/housingSubsidyTypes.v1.0.0.json +0 -159
  69. package/src/cvcs/htType.v1.0.0.json +0 -87
  70. package/src/cvcs/livingSituation.v1.0.0.json +0 -213
  71. package/src/cvcs/provenanceSourceId.v1.0.0.json +0 -134
  72. package/src/cvcs/radiusBucket.v1.0.0.json +0 -98
  73. package/src/cvcs/relationshipConcern.v1.0.0.json +0 -114
  74. package/src/cvcs/roiMethod.v1.0.0.json +0 -107
  75. package/src/cvcs/serviceAudience.v1.0.0.json +0 -96
  76. package/src/cvcs/sessionNoteVisibility.v1.0.0.json +0 -80
  77. package/src/cvcs/suggestionSource.v1.0.0.json +0 -71
  78. package/src/cvcs/victimAbuseTypes.v1.0.0.json +0 -276
@@ -1,5 +1,5 @@
1
- import { ek as PlatformToolValue, cR as FunctionStatusValue, eH as RoleLevelValue, eS as ShareViewValue, eg as PermissionStateValue } from '../platform-auth-BSKYSDKe.cjs';
2
- export { h as AccommodationValue, i as AgeBinReportingValue, j as AppScopeValue, k as ApparentAgeValue, cH as DataQualityValue, cP as FormStatusValue, cQ as FormTypeValue, cS as IC13Category, cU as IC13Value, cV as IC22Value, cW as IC23Value, cX as IC24Value, cY as IC25Value, cZ as IC49ReferralOutcomeValue, c_ as IC49ReferralVerificationValue, c$ as IC49Value, d0 as IC4Value, d2 as IC56Value, d3 as IC57Value, d5 as IC58Value, d6 as IC59Value, d7 as IC5Value, dY as IncidentInvolvementRoleValue, dZ as IncidentParticipationRoleValue, d_ as InteractionTypeValue, e1 as MinorAdultStatusValue, eh as PersonDisplayCategoryValue, ei as PersonRoleValue, ej as PersonTypeValue, eq as QuestionFormatValue, er as QuickStartTemplateId, eD as RecordStateValue, eF as RelationshipConcernValue, eG as RelationshipDynamicValue, eR as SessionStateValue, eT as SubmissionStateValue, eX as UserStatusValue } from '../platform-auth-BSKYSDKe.cjs';
1
+ import { P as PlatformToolValue, F as FunctionStatusValue, R as RoleLevelValue, S as ShareViewValue, a as PermissionStateValue } from '../platform-auth-XVB9aHqR.cjs';
2
+ export { A as AccommodationValue, b as AgeBinReportingValue, c as AppScopeValue, d as ApparentAgeValue, D as DataQualityValue, e as FormStatusValue, f as FormTypeValue, I as IC13Category, g as IC13Value, h as IC22Value, i as IC23Value, j as IC24Value, k as IC25Value, l as IC49ReferralOutcomeValue, m as IC49ReferralVerificationValue, n as IC49Value, o as IC4Value, p as IC56Value, q as IC57Value, r as IC58Value, s as IC59Value, t as IC5Value, u as IncidentInvolvementRoleValue, v as IncidentParticipationRoleValue, w as InteractionTypeValue, M as MinorAdultStatusValue, x as PersonDisplayCategoryValue, y as PersonRoleValue, z as PersonTypeValue, Q as QuestionFormatValue, B as QuickStartTemplateId, C as RecordStateValue, E as RelationshipConcernValue, G as RelationshipDynamicValue, H as SessionStateValue, J as SubmissionStateValue, U as UserStatusValue } from '../platform-auth-XVB9aHqR.cjs';
3
3
 
4
4
  /**
5
5
  * @htilabs/platform-common-models — Platform Authorization Types
@@ -1,5 +1,5 @@
1
- import { ek as PlatformToolValue, cR as FunctionStatusValue, eH as RoleLevelValue, eS as ShareViewValue, eg as PermissionStateValue } from '../platform-auth-BSKYSDKe.js';
2
- export { h as AccommodationValue, i as AgeBinReportingValue, j as AppScopeValue, k as ApparentAgeValue, cH as DataQualityValue, cP as FormStatusValue, cQ as FormTypeValue, cS as IC13Category, cU as IC13Value, cV as IC22Value, cW as IC23Value, cX as IC24Value, cY as IC25Value, cZ as IC49ReferralOutcomeValue, c_ as IC49ReferralVerificationValue, c$ as IC49Value, d0 as IC4Value, d2 as IC56Value, d3 as IC57Value, d5 as IC58Value, d6 as IC59Value, d7 as IC5Value, dY as IncidentInvolvementRoleValue, dZ as IncidentParticipationRoleValue, d_ as InteractionTypeValue, e1 as MinorAdultStatusValue, eh as PersonDisplayCategoryValue, ei as PersonRoleValue, ej as PersonTypeValue, eq as QuestionFormatValue, er as QuickStartTemplateId, eD as RecordStateValue, eF as RelationshipConcernValue, eG as RelationshipDynamicValue, eR as SessionStateValue, eT as SubmissionStateValue, eX as UserStatusValue } from '../platform-auth-BSKYSDKe.js';
1
+ import { P as PlatformToolValue, F as FunctionStatusValue, R as RoleLevelValue, S as ShareViewValue, a as PermissionStateValue } from '../platform-auth-XVB9aHqR.js';
2
+ export { A as AccommodationValue, b as AgeBinReportingValue, c as AppScopeValue, d as ApparentAgeValue, D as DataQualityValue, e as FormStatusValue, f as FormTypeValue, I as IC13Category, g as IC13Value, h as IC22Value, i as IC23Value, j as IC24Value, k as IC25Value, l as IC49ReferralOutcomeValue, m as IC49ReferralVerificationValue, n as IC49Value, o as IC4Value, p as IC56Value, q as IC57Value, r as IC58Value, s as IC59Value, t as IC5Value, u as IncidentInvolvementRoleValue, v as IncidentParticipationRoleValue, w as InteractionTypeValue, M as MinorAdultStatusValue, x as PersonDisplayCategoryValue, y as PersonRoleValue, z as PersonTypeValue, Q as QuestionFormatValue, B as QuickStartTemplateId, C as RecordStateValue, E as RelationshipConcernValue, G as RelationshipDynamicValue, H as SessionStateValue, J as SubmissionStateValue, U as UserStatusValue } from '../platform-auth-XVB9aHqR.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.8.8",
3
+ "version": "0.9.0",
4
4
  "description": "Shared constants, types, and models for HTI Labs applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -46,29 +46,17 @@
46
46
  "types": "./dist/cvcs/index.d.ts",
47
47
  "import": "./dist/cvcs/index.js",
48
48
  "require": "./dist/cvcs/index.cjs"
49
+ },
50
+ "./config": {
51
+ "types": "./dist/config/index.d.ts",
52
+ "import": "./dist/config/index.js",
53
+ "require": "./dist/config/index.cjs"
49
54
  }
50
55
  },
51
56
  "files": [
52
57
  "dist",
53
58
  "src"
54
59
  ],
55
- "scripts": {
56
- "build": "tsup",
57
- "dev": "tsup --watch",
58
- "typecheck": "tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
59
- "lint": "eslint src --ext .ts",
60
- "lint:fix": "eslint src --ext .ts --fix",
61
- "test": "vitest run",
62
- "test:watch": "vitest",
63
- "test:snapshot": "UPDATE_SNAPSHOT=1 vitest run",
64
- "clean": "rm -rf dist",
65
- "codegen:cvc": "tsx scripts/codegen-cvc-enums.ts",
66
- "codegen:cvc:check": "tsx scripts/codegen-cvc-enums.ts --check",
67
- "seed:cvc": "tsx scripts/seed-cvc.ts",
68
- "seed:cvc:all": "tsx scripts/seed-all-cvcs.ts",
69
- "test:seed": "node --import tsx --test scripts/seed-cvc.test.ts",
70
- "prepublishOnly": "npm run build"
71
- },
72
60
  "keywords": [
73
61
  "hti",
74
62
  "platform-common",
@@ -90,6 +78,7 @@
90
78
  "vitest": "^1.6.1"
91
79
  },
92
80
  "dependencies": {
81
+ "yaml": "^2.7.0",
93
82
  "zod": "^3.22.0"
94
83
  },
95
84
  "peerDependencies": {
@@ -102,5 +91,22 @@
102
91
  },
103
92
  "engines": {
104
93
  "node": ">=18.0.0"
94
+ },
95
+ "scripts": {
96
+ "build": "tsup",
97
+ "dev": "tsup --watch",
98
+ "typecheck": "tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
99
+ "lint": "eslint src --ext .ts",
100
+ "lint:fix": "eslint src --ext .ts --fix",
101
+ "test": "vitest run",
102
+ "test:watch": "vitest",
103
+ "test:snapshot": "UPDATE_SNAPSHOT=1 vitest run",
104
+ "clean": "rm -rf dist",
105
+ "codegen:cvc": "tsx scripts/codegen-cvc-enums.ts",
106
+ "codegen:cvc:check": "tsx scripts/codegen-cvc-enums.ts --check",
107
+ "seed:cvc": "tsx scripts/seed-cvc.ts",
108
+ "seed:cvc:all": "tsx scripts/seed-all-cvcs.ts",
109
+ "test:seed": "node --import tsx --test scripts/seed-cvc.test.ts",
110
+ "test:guard": "node --import tsx --test scripts/lib/confirmTargetDb.test.ts"
105
111
  }
106
- }
112
+ }
@@ -7,12 +7,12 @@
7
7
  "hash": "d50072fd907c64496508282036790f320d659ce4756bd48ad25487442e8997af"
8
8
  },
9
9
  "service_states": {
10
- "count": 17,
11
- "hash": "5dd12b9fecae79f0edc3d8ceba435d3d6ea2a9acddfea0ae4751b8eb3530d85e"
10
+ "count": 15,
11
+ "hash": "b76a5eec570bc807fb028fd55324a1cdb4c95ab1603bc779d292bc2356ee727d"
12
12
  },
13
13
  "service_categories": {
14
14
  "count": 151,
15
- "hash": "c8fc71e0265a8dace4ae7e53bc476934c1744a85331da2d2d294395a16defbd8"
15
+ "hash": "a7c7a9b09d46c5ba8f5608d3e44331b862b07d67fac969f4bf204dca82b5fbd5"
16
16
  },
17
17
  "incident_participation_roles": {
18
18
  "count": 19,
@@ -91,8 +91,8 @@
91
91
  "hash": "8aae59799013ec2d66f0477b44e1b3d556d00a6b908b5d0e0117e4e9a41ce5aa"
92
92
  },
93
93
  "highest_education_level_completed": {
94
- "count": 13,
95
- "hash": "44913932f5ae942b8512f89b3f354aad83c1d0e99e9d3f848dda49fb5cfb50f0"
94
+ "count": 12,
95
+ "hash": "a8ba9ca9af5c9f4ac5f900065f9356a935ca0543bf182f871cae61db9a276172"
96
96
  },
97
97
  "preferred_contact_method": {
98
98
  "count": 4,
@@ -163,8 +163,8 @@
163
163
  "hash": "f78d52bf1960fb88e12cefb895a3defbdba971abda49618216460ae330f4addb"
164
164
  },
165
165
  "income_benefits_sources": {
166
- "count": 41,
167
- "hash": "2c4c08fad1d49bf23f7cb3b1cec4f209b92cfac657b80e09ff0468420339a422"
166
+ "count": 38,
167
+ "hash": "f75a79ccd10cecdd37acf056d550f60eb86b8ef52b9b3f34bed49ef04c44dffc"
168
168
  },
169
169
  "enrollment_application_status": {
170
170
  "count": 12,
@@ -187,8 +187,8 @@
187
187
  "hash": "ba2c6ddb0ef60863d88690f8c82d54208c1eb13b3546e4a5e49c4a2ec8a7517c"
188
188
  },
189
189
  "source_subtype": {
190
- "count": 39,
191
- "hash": "90eefc3e2a4f924779239ae110fb271f8e5c1c34f30dc96ff0ffc40d23ed90e3"
190
+ "count": 35,
191
+ "hash": "3c039024ef731abc2eb9f3ba9ae1860b75531e1b92e58a6bf74402444f59b773"
192
192
  },
193
193
  "support_strength": {
194
194
  "count": 11,
@@ -207,8 +207,8 @@
207
207
  "hash": "5f98f5304468ccbc8b06c83388edcfc51abde67b3e8e7c66de55d9fafb0776c5"
208
208
  },
209
209
  "verification_method": {
210
- "count": 11,
211
- "hash": "ab1b4f974093be3a289544ecc859f86ae815109cba8a7b881d34828c505bf816"
210
+ "count": 9,
211
+ "hash": "7054ed373cb1b6c7f9a71e9729625bedb8128c94c1fd3afb3063fcc7e505ccfe"
212
212
  },
213
213
  "quality_flags": {
214
214
  "count": 9,
@@ -351,8 +351,8 @@
351
351
  "hash": "5d32f251b24af795609cf5a354de58f2a67fa0884e94c864a3b2425052542d3b"
352
352
  },
353
353
  "identification_status": {
354
- "count": 9,
355
- "hash": "123525b1e4f981f8fe18cdfb1e34abc93c280c3295296db1512e7ee1f8c341ea"
354
+ "count": 7,
355
+ "hash": "a247e3de63a950557afe4a072ff56bae82a92e51a0f92bd2d37f7187bb91218c"
356
356
  },
357
357
  "investigative_request_type": {
358
358
  "count": 8,
@@ -477,70 +477,6 @@
477
477
  "visa_type": {
478
478
  "count": 40,
479
479
  "hash": "df39913ea5401d187ba4b91b3f9b5d7c40811c8bbe4bdf4ae97ae2175a3cecc5"
480
- },
481
- "living_situation": {
482
- "count": 22,
483
- "hash": "a2cf23d69fd349c4091a3a7d0f3af7ea786a78b8fd3f7b34db97abbfa5adbc0b"
484
- },
485
- "service_audience": {
486
- "count": 9,
487
- "hash": "24e54f5cea374c1b7b743db491a8504c3c43f1c3a2e1cd6077fca65474e70682"
488
- },
489
- "hmis_relationship_to_hoh": {
490
- "count": 9,
491
- "hash": "93b7a0f327edbc77553c7ebee01f3ac59e1fe9b939cc930588d88704efd8274f"
492
- },
493
- "victim_abuse_types": {
494
- "count": 29,
495
- "hash": "03ce0a04e8a2ea49b39aaa45a7b11a2a9feb457637c6c6620a46fcb83e041442"
496
- },
497
- "ht_type": {
498
- "count": 8,
499
- "hash": "689c23880771fae764d0927f5872e250e0f6173eef0c162a192c477b6f638458"
500
- },
501
- "relationship_concern": {
502
- "count": 11,
503
- "hash": "03e18352e1ffb13a4e9b63e1f4043923f1da7e0153649db6940d0bb2653917d8"
504
- },
505
- "recency_band": {
506
- "count": 10,
507
- "hash": "b215354a1492256e7b235bcfcf96988227105458b0eb9e49bbea42386b5d4e3c"
508
- },
509
- "housing_subsidy_types": {
510
- "count": 16,
511
- "hash": "4341619e6016822fcc353987a635421c767391a85f2ff7602726ca02bfa0f4f7"
512
- },
513
- "assertion_domain": {
514
- "count": 68,
515
- "hash": "814b932cfd24f6d2f931c333806735c25c2239e32388918aafec090de4ef468a"
516
- },
517
- "activity_type": {
518
- "count": 14,
519
- "hash": "ac980d852c4efc88db745fae50e7cd9ef6f94df3f9d4f90603b2960af4f55a68"
520
- },
521
- "provenance_source_id": {
522
- "count": 13,
523
- "hash": "4452b7ce856f13be7d7bb4b578943d15eef105140ec88fe03a0d8370f9d98a28"
524
- },
525
- "radius_bucket": {
526
- "count": 9,
527
- "hash": "0c59ba7bd11ff24fe7420f9164a090016ff783a1666b2c380c8b4ee43f0c9d39"
528
- },
529
- "contact_link_type": {
530
- "count": 8,
531
- "hash": "2dd40c3fcaf9faabb8bf7524c8acfc82e20e020fb32b990e10df2efef95feda1"
532
- },
533
- "suggestion_source": {
534
- "count": 6,
535
- "hash": "773fc417d9f296b65f653f0c0a6b686a64bcf8838f9a3f39940b2b651ac273d9"
536
- },
537
- "roi_method": {
538
- "count": 10,
539
- "hash": "e9413c62e1b0879027a1509500f2e14faf7e0fa9bb60808dd6d1184de53c3087"
540
- },
541
- "session_note_visibility": {
542
- "count": 7,
543
- "hash": "6ad8e821e790b3ba303578c1ea78081d48264a96765299002b5545a7e78be3d0"
544
480
  }
545
481
  }
546
482
  }
@@ -61,12 +61,10 @@ const SOT_SPECS: readonly SotSpec[] = [
61
61
  // Spec §8.3 — "Entries: 4" + 4 missingness = 8
62
62
  { file: "serviceMechanisms.v1.0.0.json", domain: "service_mechanisms", expectedCount: 8 },
63
63
  // Spec §8.2 — "Entries: 10" + 4 missingness = 14; +1 (`unable_other_reason`
64
- // additive per Thread Phase-0 SOT Block D) = 15; +2 PROVISIONAL attempt-reason
65
- // buckets (`unable_to_provide_service_fit`, `unable_to_provide_access_barrier`)
66
- // for the Thread th-epqet.3 7-bucket lifecycle = 17.
67
- { file: "serviceStates.v1.0.0.json", domain: "service_states", expectedCount: 17 },
64
+ // additive per Thread Phase-0 SOT Block D) = 15.
65
+ { file: "serviceStates.v1.0.0.json", domain: "service_states", expectedCount: 15 },
68
66
  // Spec §8.1 — "Entries: 147" + 4 missingness = 151
69
- { file: "serviceCategories.v1.1.0.json", domain: "service_categories", expectedCount: 151 },
67
+ { file: "serviceCategories.v1.0.0.json", domain: "service_categories", expectedCount: 151 },
70
68
  // CVC-69 — 4 group parents + 11 role leaves + 4 missingness = 19
71
69
  {
72
70
  file: "incidentParticipationRoles.v1.0.0.json",
@@ -227,13 +225,12 @@ const SOT_SPECS: readonly SotSpec[] = [
227
225
  domain: "contact_safety_status",
228
226
  expectedCount: 6,
229
227
  },
230
- // CVC-180 — 7 flat Level-1 Census/ACS attainment entries + 1 additive
231
- // `trade_vocational` non-degree credential leaf (180-008) + 1 missingness
232
- // root + 4 canonical missingness children (includes PNA) = 13.
228
+ // CVC-180 — 7 flat Level-1 Census/ACS attainment entries + 1 missingness
229
+ // root + 4 canonical missingness children (includes PNA) = 12.
233
230
  {
234
231
  file: "highestEducationLevelCompleted.v1.0.0.json",
235
232
  domain: "highest_education_level_completed",
236
- expectedCount: 13,
233
+ expectedCount: 12,
237
234
  },
238
235
  // CVC-185 — 4 flat preferred-contact-method entries. No missingness entries
239
236
  // (variant 0 per Notion: absence encodes "no preference") = 4.
@@ -366,14 +363,11 @@ const SOT_SPECS: readonly SotSpec[] = [
366
363
  domain: "referral_entity_category",
367
364
  expectedCount: 43,
368
365
  },
369
- // CVC-171 — 5 L1 type groups + 30 L2 source codes + 1 additive L1
370
- // `victim_compensation` group leaf (171-006) + 5 missingness = 41.
371
- // Additive orphan leaves: informal_income (171-001-002) under earned_income
372
- // and family_friend_support (171-004-003) under transfer_support.
366
+ // CVC-171 — 5 L1 type groups + 28 L2 source codes + 5 missingness = 38.
373
367
  {
374
368
  file: "incomeBenefitsSources.v1.0.0.json",
375
369
  domain: "income_benefits_sources",
376
- expectedCount: 41,
370
+ expectedCount: 38,
377
371
  },
378
372
  // CVC-175 — 8 flat Level-1 enrollment lifecycle statuses + 1 missingness
379
373
  // root + 3 canonical missingness children = 12.
@@ -416,7 +410,7 @@ const SOT_SPECS: readonly SotSpec[] = [
416
410
  {
417
411
  file: "sourceSubtype.v1.1.0.json",
418
412
  domain: "source_subtype",
419
- expectedCount: 39,
413
+ expectedCount: 35,
420
414
  },
421
415
  // CVC-139 — support_strength (formerly evidence_tier). 7 substantive Level-1
422
416
  // entries + 1 missingness root + 3 canonical missingness children = 11.
@@ -454,7 +448,7 @@ const SOT_SPECS: readonly SotSpec[] = [
454
448
  {
455
449
  file: "verificationMethod.v1.0.0.json",
456
450
  domain: "verification_method",
457
- expectedCount: 11,
451
+ expectedCount: 9,
458
452
  },
459
453
  // CVC-144 — quality_flags. 5 substantive Level-1 entries
460
454
  // (circular_model_label_risk, data_redacted, inconsistent, self_report_only,
@@ -517,7 +511,7 @@ const SOT_SPECS: readonly SotSpec[] = [
517
511
  { file: "hopeScaleCaptureContext.v1.0.0.json", domain: "hope_scale_capture_context", expectedCount: 11 },
518
512
  { file: "hopeScaleResponseOptions.v1.0.0.json", domain: "hope_scale_response_options", expectedCount: 12 },
519
513
  { file: "hopeScaleTier.v1.0.0.json", domain: "hope_scale_tier", expectedCount: 8 },
520
- { file: "identificationStatus.v1.0.0.json", domain: "identification_status", expectedCount: 9 },
514
+ { file: "identificationStatus.v1.0.0.json", domain: "identification_status", expectedCount: 7 },
521
515
  { file: "investigativeRequestType.v1.0.0.json", domain: "investigative_request_type", expectedCount: 8 },
522
516
  { file: "languages.v1.0.0.json", domain: "languages", expectedCount: 212 },
523
517
  { file: "leReportStatus.v1.0.0.json", domain: "le_report_status", expectedCount: 8 },
@@ -549,51 +543,6 @@ const SOT_SPECS: readonly SotSpec[] = [
549
543
  { file: "threadType.v1.0.0.json", domain: "thread_type", expectedCount: 9 },
550
544
  { file: "verificationStatus.v1.0.0.json", domain: "verification_status", expectedCount: 7 },
551
545
  { file: "visaType.v1.0.0.json", domain: "visa_type", expectedCount: 40 },
552
- // ─── Net-new additive domains (CVC author missing-domains batch) ───
553
- // CVC-192 living_situation — 18 HMIS living-situation values + 1
554
- // missingness root + 3 canonical missingness children = 22.
555
- { file: "livingSituation.v1.0.0.json", domain: "living_situation", expectedCount: 22 },
556
- // CVC-45 service_audience — 5 audience values (primary_victim,
557
- // eligible_family_member, third_party, offender, personnel) + 1
558
- // missingness root + 3 canonical missingness children = 9.
559
- { file: "serviceAudience.v1.0.0.json", domain: "service_audience", expectedCount: 9 },
560
- // CVC-129 hmis_relationship_to_hoh — 5 HMIS 3.15 relationship codes + 1
561
- // missingness root + 3 canonical missingness children = 9. Entries carry
562
- // an `hmisCode` passthrough field (HMIS numerics 1/2/3/4/5/99).
563
- { file: "hmisRelationshipToHoh.v1.0.0.json", domain: "hmis_relationship_to_hoh", expectedCount: 9 },
564
- // CVC-73 victim_abuse_types — 25 non-HT VOCA abuse types + 1 missingness
565
- // root + 3 canonical missingness children = 29.
566
- { file: "victimAbuseTypes.v1.0.0.json", domain: "victim_abuse_types", expectedCount: 29 },
567
- // CVC-72 ht_type — 4 substantive types (sex, labor, sex_and_labor, none;
568
- // `none` = negative determination, canonical per Crysta directive 2026-05-27)
569
- // + 1 missingness root + 3 canonical missingness children = 8.
570
- { file: "htType.v1.0.0.json", domain: "ht_type", expectedCount: 8 },
571
- // PROVISIONAL CVC-231 relationship_concern — 7 TRA relationship-concern
572
- // codes + 1 missingness root + 3 canonical missingness children = 11.
573
- // CVC number is PROVISIONAL pending codebook-session ratification.
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 },
580
- // PROVISIONAL CVC-233 housing_subsidy_types — 12 HMIS-aligned subsidy types
581
- // (housing_choice_voucher, public_housing, project_based_rental_assistance,
582
- // permanent_supportive_housing, rapid_rehousing_assistance,
583
- // other_housing_subsidy, no_subsidy, plus additive va_supportive_housing,
584
- // grant_per_diem_transition_in_place, housing_stability_voucher,
585
- // family_unification_program, foster_youth_to_independence) + 1 missingness
586
- // root + 3 canonical missingness children = 16. CVC number is PROVISIONAL
587
- // pending ratification.
588
- { file: "housingSubsidyTypes.v1.0.0.json", domain: "housing_subsidy_types", expectedCount: 16 },
589
- { file: "assertionDomain.v1.0.0.json", domain: "assertion_domain", expectedCount: 68 },
590
- { file: "activityType.v1.0.0.json", domain: "activity_type", expectedCount: 14 },
591
- { file: "provenanceSourceId.v1.0.0.json", domain: "provenance_source_id", expectedCount: 13 },
592
- { file: "radiusBucket.v1.0.0.json", domain: "radius_bucket", expectedCount: 9 },
593
- { file: "contactLinkType.v1.0.0.json", domain: "contact_link_type", expectedCount: 8 },
594
- { file: "suggestionSource.v1.0.0.json", domain: "suggestion_source", expectedCount: 6 },
595
- { file: "roiMethod.v1.0.0.json", domain: "roi_method", expectedCount: 10 },
596
- { file: "sessionNoteVisibility.v1.0.0.json", domain: "session_note_visibility", expectedCount: 7 },
597
546
  ] as const;
598
547
 
599
548
  // ─── Helpers ────────────────────────────────────────────────────────────────
@@ -50,7 +50,7 @@ interface SotFile {
50
50
  const SOT_FILES: readonly SotFile[] = [
51
51
  { file: "serviceMechanisms.v1.0.0.json", expectedDomain: "service_mechanisms" },
52
52
  { file: "serviceStates.v1.0.0.json", expectedDomain: "service_states" },
53
- { file: "serviceCategories.v1.1.0.json", expectedDomain: "service_categories" },
53
+ { file: "serviceCategories.v1.0.0.json", expectedDomain: "service_categories" },
54
54
  { file: "incidentParticipationRoles.v1.0.0.json", expectedDomain: "incident_participation_roles" },
55
55
  { file: "incidentInvolvementRoles.v1.0.0.json", expectedDomain: "incident_involvement_roles" },
56
56
  { file: "raceEthnicity.v1.0.0.json", expectedDomain: "race_ethnicity" },
@@ -168,15 +168,6 @@ const SOT_FILES: readonly SotFile[] = [
168
168
  { file: "threadType.v1.0.0.json", expectedDomain: "thread_type" },
169
169
  { file: "verificationStatus.v1.0.0.json", expectedDomain: "verification_status" },
170
170
  { file: "visaType.v1.0.0.json", expectedDomain: "visa_type" },
171
- // ─── Net-new additive domains (CVC author missing-domains batch) ───
172
- { file: "livingSituation.v1.0.0.json", expectedDomain: "living_situation" },
173
- { file: "serviceAudience.v1.0.0.json", expectedDomain: "service_audience" },
174
- { file: "hmisRelationshipToHoh.v1.0.0.json", expectedDomain: "hmis_relationship_to_hoh" },
175
- { file: "victimAbuseTypes.v1.0.0.json", expectedDomain: "victim_abuse_types" },
176
- { file: "htType.v1.0.0.json", expectedDomain: "ht_type" },
177
- { file: "relationshipConcern.v1.0.0.json", expectedDomain: "relationship_concern" },
178
- { file: "recencyBand.v1.0.0.json", expectedDomain: "recency_band" },
179
- { file: "housingSubsidyTypes.v1.0.0.json", expectedDomain: "housing_subsidy_types" },
180
171
  ] as const;
181
172
 
182
173
  function loadSot(file: string): unknown {
@@ -255,7 +246,7 @@ describe("CVC structural invariants (locked spec §4)", () => {
255
246
  // Guard against a future regression where CvcEntrySchema stops passing
256
247
  // domain-specific fields through. Without this, C6 would silently pass
257
248
  // on an empty input.
258
- const raw = loadSot("serviceCategories.v1.1.0.json");
249
+ const raw = loadSot("serviceCategories.v1.0.0.json");
259
250
  const envelope = CvcEnvelopeSchema.parse(raw);
260
251
  const withRelevant = envelope.entries.filter((e) => {
261
252
  const field = (e as unknown as Record<string, unknown>)[