@htilabs/platform-common-models 0.21.0 → 0.23.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 (71) hide show
  1. package/dist/authz/index.cjs +539 -0
  2. package/dist/authz/index.cjs.map +1 -0
  3. package/dist/authz/index.d.cts +210 -0
  4. package/dist/authz/index.d.ts +210 -0
  5. package/dist/authz/index.js +507 -0
  6. package/dist/authz/index.js.map +1 -0
  7. package/dist/constants/index.d.cts +2 -1
  8. package/dist/constants/index.d.ts +2 -1
  9. package/dist/cvcs/index.cjs +936 -243
  10. package/dist/cvcs/index.cjs.map +1 -1
  11. package/dist/cvcs/index.d.cts +986 -254
  12. package/dist/cvcs/index.d.ts +986 -254
  13. package/dist/cvcs/index.js +936 -243
  14. package/dist/cvcs/index.js.map +1 -1
  15. package/dist/enums/index.cjs +37 -10
  16. package/dist/enums/index.cjs.map +1 -1
  17. package/dist/enums/index.d.cts +42 -15
  18. package/dist/enums/index.d.ts +42 -15
  19. package/dist/enums/index.js +37 -10
  20. package/dist/enums/index.js.map +1 -1
  21. package/dist/{platform-auth-CvAYFVhK.d.cts → ic-DpKrdgQP.d.cts} +1 -78
  22. package/dist/{platform-auth-CvAYFVhK.d.ts → ic-DpKrdgQP.d.ts} +1 -78
  23. package/dist/index.cjs +1328 -253
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +4 -2
  26. package/dist/index.d.ts +4 -2
  27. package/dist/index.js +1313 -253
  28. package/dist/index.js.map +1 -1
  29. package/dist/platform-auth-B49Ly57B.d.cts +78 -0
  30. package/dist/platform-auth-B49Ly57B.d.ts +78 -0
  31. package/dist/schemas/index.cjs +104 -0
  32. package/dist/schemas/index.cjs.map +1 -1
  33. package/dist/schemas/index.d.cts +240 -1
  34. package/dist/schemas/index.d.ts +240 -1
  35. package/dist/schemas/index.js +95 -0
  36. package/dist/schemas/index.js.map +1 -1
  37. package/dist/types/index.d.cts +2 -2
  38. package/dist/types/index.d.ts +2 -2
  39. package/package.json +6 -1
  40. package/src/__sot__/README.md +3 -0
  41. package/src/__sot__/adminRoles.pin.json +122 -0
  42. package/src/__sot__/adminRoles.published.json +77 -0
  43. package/src/__sot__/coreFunctionFields.ts +137 -0
  44. package/src/__sot__/coreFunctions.pin.json +1659 -0
  45. package/src/__sot__/coreFunctions.published.json +233 -0
  46. package/src/__sot__/roleFields.ts +137 -0
  47. package/src/__sot__/userRoles.pin.json +174 -0
  48. package/src/__sot__/userRoles.published.json +103 -0
  49. package/src/__tests__/__snapshots__/cvc-sot.snap +6 -6
  50. package/src/__tests__/admin-roles-canon.test.ts +80 -0
  51. package/src/__tests__/authz-resolve.test.ts +712 -0
  52. package/src/__tests__/core-functions-canon.test.ts +358 -24
  53. package/src/__tests__/cvc-sot-snapshot.test.ts +17 -6
  54. package/src/__tests__/cvc-status-parser.test.ts +2 -2
  55. package/src/__tests__/cvc-structural.test.ts +3 -3
  56. package/src/__tests__/organization-program.test.ts +254 -0
  57. package/src/__tests__/role-vocab-gate.ts +279 -0
  58. package/src/__tests__/user-roles-canon.test.ts +104 -0
  59. package/src/authz/index.ts +9 -0
  60. package/src/authz/resolveEffectiveFunctions.ts +454 -0
  61. package/src/cvcs/adminRoles.v2.0.0.json +197 -0
  62. package/src/cvcs/{coreFunctions.v1.1.0.json → coreFunctions.v1.3.0.json} +646 -90
  63. package/src/cvcs/index.ts +3 -3
  64. package/src/cvcs/userRoles.v2.0.0.json +296 -0
  65. package/src/generated/coreFunctionsEvaluable.ts +101 -0
  66. package/src/generated/cvc-enums.ts +42 -15
  67. package/src/index.ts +4 -0
  68. package/src/schemas/index.ts +18 -0
  69. package/src/schemas/organization-program.ts +297 -0
  70. package/src/cvcs/adminRoles.v1.0.0.json +0 -153
  71. package/src/cvcs/userRoles.v1.0.0.json +0 -203
package/src/cvcs/index.ts CHANGED
@@ -162,7 +162,7 @@ import immigrationLegalStatusChangeTypeSot from "./immigrationLegalStatusChangeT
162
162
  import programEnrollmentChangeTypeSot from "./programEnrollmentChangeType.v1.0.0.json" with { type: "json" };
163
163
  import romanticRelationshipChangeTypeSot from "./romanticRelationshipChangeType.v1.0.0.json" with { type: "json" };
164
164
  import riskCategorySot from "./riskCategory.v1.0.0.json" with { type: "json" };
165
- import coreFunctionsSot from "./coreFunctions.v1.1.0.json" with { type: "json" };
165
+ import coreFunctionsSot from "./coreFunctions.v1.3.0.json" with { type: "json" };
166
166
  import needsAssessmentChangeTypeSot from "./needsAssessmentChangeType.v1.0.0.json" with { type: "json" };
167
167
  import coreInformationScopeSot from "./coreInformationScope.v2.1.0.json" with { type: "json" };
168
168
  import roiScopeSot from "./roiScope.v1.4.0.json" with { type: "json" };
@@ -172,8 +172,8 @@ import coreIndicatorsSot from "./coreIndicators.v1.1.0.json" with { type: "json"
172
172
  import coreDhStateSot from "./coreDhState.v1.0.0.json" with { type: "json" };
173
173
  import riskSeverityBandSot from "./riskSeverityBand.v1.0.0.json" with { type: "json" };
174
174
  import riskIdentificationMilestoneSot from "./riskIdentificationMilestone.v1.0.0.json" with { type: "json" };
175
- import adminRolesSot from "./adminRoles.v1.0.0.json" with { type: "json" };
176
- import userRolesSot from "./userRoles.v1.0.0.json" with { type: "json" };
175
+ import adminRolesSot from "./adminRoles.v2.0.0.json" with { type: "json" };
176
+ import userRolesSot from "./userRoles.v2.0.0.json" with { type: "json" };
177
177
  import hmisCurrentLivingSituationSot from "./hmisCurrentLivingSituation.v1.0.0.json" with { type: "json" };
178
178
  import juvenileJusticeEpisodeTypeSot from "./juvenileJusticeEpisodeType.v1.0.0.json" with { type: "json" };
179
179
  import incarcerationEpisodeTypeSot from "./incarcerationEpisodeType.v1.0.0.json" with { type: "json" };
@@ -0,0 +1,296 @@
1
+ {
2
+ "domain": "user_roles",
3
+ "name": "Core User Roles (CVC-135)",
4
+ "version": "2.0.0",
5
+ "_status": "CANONICAL — Notion CVC-135 (core - user roles), active (verification: unverified); GENERATED from the prototype repo's data/cvcs/core_user_role.yaml (\"THE SSOT for the platform's OPERATIONAL user role bundles\", transcribed from the live Notion codebook 2026-09-06) by scripts/gen-user-roles.py — never hand-edit. Canonical numbering (135). Operational / practitioner role axis of the canonical authorization model (IC-66); DISTINCT from CVC-134 `admin_roles` — a person may hold both. A seat holds ZERO OR MORE user roles (canon `is_list`). The package key IS canon's code, carried verbatim in `canonicalCode`. 15 canon roles = 15 entries. NO missingness codes, deliberately (canon: a role is assigned, never observed; an unassigned seat carries an empty list; gate G3) — the 1.0.0 quadruplet is withdrawn (`_supersedes.retiredCodes`). Every canon `legacy_codes` line (old -> live, migrate on read) resolves through `_supersedes.keyMap`: a published old key is re-keyed in place at the same code, a never-published one is an alias. Canon's `display_label` (the 20-char topbar-chip short form; absent = use `title`), `platform_tools` and `flags` ride on each entry as `displayLabel` / `platformTools` / `flags` where canon carries them.",
6
+ "_supersedes": {
7
+ "version": "1.0.0",
8
+ "keyMap": {
9
+ "missingness_root": null,
10
+ "unknown": null,
11
+ "anonymous": null,
12
+ "data_not_collected": null,
13
+ "case_nav": "case_nav",
14
+ "healthcare_provider_medical": "healthcare_provider_medical",
15
+ "behavioral_health_provider": "behavioral_health_provider",
16
+ "hotline_op": "crisis_response",
17
+ "intel_analyst": "intel_analyst",
18
+ "investigator": "investigator",
19
+ "le_liaison_vsp": "le_liaison_vsp",
20
+ "legal_advocate": "legal_advocate",
21
+ "mandatory_reporter": "mandatory_reporter",
22
+ "mdt_participant": "mdt_participant",
23
+ "prosecutor_review": "prosecutor_review",
24
+ "public_reporter": "public_reporter",
25
+ "research_analytics": "research_analytics",
26
+ "screener": "screener",
27
+ "volunteer": "volunteer",
28
+ "case_advocate": "case_nav",
29
+ "leads_investigator": "investigator"
30
+ },
31
+ "retiredCodes": [
32
+ {
33
+ "code": "135-000-000-000-000-000-000",
34
+ "key": "missingness_root",
35
+ "successor": null,
36
+ "reason": "missingness (canon G3)"
37
+ },
38
+ {
39
+ "code": "135-000-000-000-000-000-001",
40
+ "key": "unknown",
41
+ "successor": null,
42
+ "reason": "missingness (canon G3)"
43
+ },
44
+ {
45
+ "code": "135-000-000-000-000-000-002",
46
+ "key": "anonymous",
47
+ "successor": null,
48
+ "reason": "missingness (canon G3)"
49
+ },
50
+ {
51
+ "code": "135-000-000-000-000-000-003",
52
+ "key": "data_not_collected",
53
+ "successor": null,
54
+ "reason": "missingness (canon G3)"
55
+ }
56
+ ],
57
+ "notes": {
58
+ "hotline_op": "RE-KEYED IN PLACE in 2.0.0: `hotline_op` is canon's `crisis_response` at the SAME code 135-004-000-000-000-000-000 — the same role, renamed in canon (data/cvcs/core_user_role.yaml legacy_codes: `hotline_op: crisis_response`; \"migrate ON READ; nothing stored is ever rewritten\"). The wire code is unchanged, but the key and canonicalCode are not: a store that holds the key or canonicalCode (every current consumer) must resolve `hotline_op` through this keyMap on read. Canon: the roster re-keyed 2026-08-14.",
59
+ "case_advocate": "LEGACY ALIAS (since 2.0.0): canon data/cvcs/core_user_role.yaml legacy_codes `case_advocate: case_nav`. `case_advocate` was never a key of this package; it is mapped here so a stored `case_advocate` resolves to `case_nav` the same way a re-keyed key does. Canon: the pre-2026-08 roster spelling.",
60
+ "leads_investigator": "LEGACY ALIAS (since 2.0.0): canon data/cvcs/core_user_role.yaml legacy_codes `leads_investigator: investigator`. `leads_investigator` was never a key of this package; it is mapped here so a stored `leads_investigator` resolves to `investigator` the same way a re-keyed key does. Canon: a prototype informal string (the HTI_hasLEADSAccess defect, CVC134-135-AUDIT).",
61
+ "missingness": "WITHDRAWN: canon CVC-135 declares NO missingness codes, deliberately (yaml header: \"A role is ASSIGNED, never observed, so there is nothing for UNK / ANON / DNC to mean here — an unassigned seat carries an empty list, not a sentinel\"; the CVC-73 precedent, gated by G3). The four 1.0.0 missingness codes 135-000-* are retired the victimAbuseTypes 1.1.0 way: no entry, keyMap -> null, listed in retiredCodes, recorded in the ledger so a code is never reused. A stored missingness key has no successor: read it as an empty role list."
62
+ },
63
+ "appended": [],
64
+ "refreshed": [
65
+ "case_nav",
66
+ "healthcare_provider_medical",
67
+ "behavioral_health_provider",
68
+ "crisis_response",
69
+ "investigator",
70
+ "le_liaison_vsp",
71
+ "legal_advocate",
72
+ "mandatory_reporter",
73
+ "mdt_participant",
74
+ "prosecutor_review",
75
+ "public_reporter",
76
+ "research_analytics",
77
+ "screener",
78
+ "volunteer"
79
+ ],
80
+ "tombstoned": []
81
+ },
82
+ "_source": "htilabstech/prototype data/cvcs/core_user_role.yaml @ f6d7b8e4 (last commit touching canon on the canonical branch); Notion https://app.notion.com/p/3221ef14abcd800e9af3fca466883ba0 (collection://3221ef14-abcd-8099-b762-000b5f5397f2). The June codebook CSV exports the 1.0.0 file was built from (prototype a596eb9) are superseded by the yaml and not read.",
83
+ "levels": {
84
+ "1": "User role"
85
+ },
86
+ "entries": [
87
+ {
88
+ "code": "135-001-000-000-000-000-000",
89
+ "key": "case_nav",
90
+ "title": "Case Navigator/Advocate",
91
+ "selectable": true,
92
+ "parentCode": null,
93
+ "childCodes": [],
94
+ "definition": "Provides ongoing service coordination, referrals, and case documentation within survivor-services workflows.",
95
+ "canonicalCode": "case_nav",
96
+ "platformTools": [
97
+ "PAVE"
98
+ ]
99
+ },
100
+ {
101
+ "code": "135-002-000-000-000-000-000",
102
+ "key": "healthcare_provider_medical",
103
+ "title": "Certified Healthcare Provider (Medical)",
104
+ "selectable": true,
105
+ "parentCode": null,
106
+ "childCodes": [],
107
+ "definition": "Provides medical evaluation and treatment and may document clinical observations supporting identification and care coordination, within MDT and sector constraints. Combines SANE/forensic nursing and general medical clinicians to avoid proliferating medical sub-roles.",
108
+ "canonicalCode": "healthcare_provider_medical",
109
+ "displayLabel": "Healthcare Provider",
110
+ "platformTools": [
111
+ "PAVE"
112
+ ]
113
+ },
114
+ {
115
+ "code": "135-003-000-000-000-000-000",
116
+ "key": "behavioral_health_provider",
117
+ "title": "Certified Mental/Behavioral Health Provider",
118
+ "selectable": true,
119
+ "parentCode": null,
120
+ "childCodes": [],
121
+ "definition": "Provides mental and behavioral healthcare services and documents therapeutic progress as part of the survivor's care plan (therapy / counselling). Scope access to clinically relevant information only.",
122
+ "canonicalCode": "behavioral_health_provider",
123
+ "displayLabel": "Behavioral Health Provider",
124
+ "platformTools": [
125
+ "PAVE"
126
+ ]
127
+ },
128
+ {
129
+ "code": "135-004-000-000-000-000-000",
130
+ "key": "crisis_response",
131
+ "title": "Crisis Response",
132
+ "selectable": true,
133
+ "parentCode": null,
134
+ "childCodes": [],
135
+ "definition": "Top-of-funnel intake role for hotline staff. Supports intake and routing workflows with tightly constrained visibility.",
136
+ "canonicalCode": "crisis_response",
137
+ "platformTools": [
138
+ "Thread",
139
+ "PAVE"
140
+ ]
141
+ },
142
+ {
143
+ "code": "135-005-000-000-000-000-000",
144
+ "key": "intel_analyst",
145
+ "title": "Intelligence Analyst",
146
+ "selectable": true,
147
+ "parentCode": null,
148
+ "childCodes": [],
149
+ "definition": "Analyzes intelligence, creates intelligence artifacts, and supports network mapping and risk scoring within CI governance rules.",
150
+ "canonicalCode": "intel_analyst",
151
+ "platformTools": [
152
+ "LEADS"
153
+ ]
154
+ },
155
+ {
156
+ "code": "135-006-000-000-000-000-000",
157
+ "key": "investigator",
158
+ "title": "Investigator",
159
+ "selectable": true,
160
+ "parentCode": null,
161
+ "childCodes": [],
162
+ "definition": "Law-enforcement investigator who triages leads, creates/claims investigations, collaborates, and performs deconfliction within policy constraints.",
163
+ "canonicalCode": "investigator",
164
+ "platformTools": [
165
+ "LEADS"
166
+ ]
167
+ },
168
+ {
169
+ "code": "135-007-000-000-000-000-000",
170
+ "key": "le_liaison_vsp",
171
+ "title": "VSP LE Liaison",
172
+ "selectable": true,
173
+ "parentCode": null,
174
+ "childCodes": [],
175
+ "definition": "VSP-side liaison who coordinates communication with law enforcement only under survivor consent, statutory mandate, or documented legal exception. Distinct from MDT Participant (collaboration within a defined case context) and from Case Navigator/Advocate (services and documentation).",
176
+ "canonicalCode": "le_liaison_vsp",
177
+ "platformTools": [
178
+ "PAVE",
179
+ "Thread"
180
+ ]
181
+ },
182
+ {
183
+ "code": "135-008-000-000-000-000-000",
184
+ "key": "legal_advocate",
185
+ "title": "Legal Advocate",
186
+ "selectable": true,
187
+ "parentCode": null,
188
+ "childCodes": [],
189
+ "definition": "Provides civil, criminal, and/or immigration legal support and documents legal strategy and case-related filings. Survivor-facing legal services, NOT a prosecutor role.",
190
+ "canonicalCode": "legal_advocate",
191
+ "platformTools": [
192
+ "PAVE"
193
+ ]
194
+ },
195
+ {
196
+ "code": "135-009-000-000-000-000-000",
197
+ "key": "mandatory_reporter",
198
+ "title": "Mandatory Reporter User",
199
+ "selectable": true,
200
+ "parentCode": null,
201
+ "childCodes": [],
202
+ "definition": "Authenticated external partner who submits mandatory reports/referrals with minimal follow-up visibility. Strictly submit-only.",
203
+ "canonicalCode": "mandatory_reporter",
204
+ "platformTools": [
205
+ "Thread",
206
+ "PAVE"
207
+ ]
208
+ },
209
+ {
210
+ "code": "135-010-000-000-000-000-000",
211
+ "key": "mdt_participant",
212
+ "title": "MDT Participant",
213
+ "selectable": true,
214
+ "parentCode": null,
215
+ "childCodes": [],
216
+ "definition": "Cross-sector collaboration participant who can coordinate on a defined case context without broad case browsing. Intentionally narrow: participation in a defined collaboration space, not a sector override.",
217
+ "canonicalCode": "mdt_participant",
218
+ "platformTools": [
219
+ "PAVE",
220
+ "LEADS",
221
+ "Thread"
222
+ ]
223
+ },
224
+ {
225
+ "code": "135-011-000-000-000-000-000",
226
+ "key": "prosecutor_review",
227
+ "title": "Prosecutorial Reviewer",
228
+ "selectable": true,
229
+ "parentCode": null,
230
+ "childCodes": [],
231
+ "definition": "Reviews authorized export packages and prosecution-ready materials; updates prosecutorial milestones when permitted. Package-scoped.",
232
+ "canonicalCode": "prosecutor_review",
233
+ "platformTools": [
234
+ "LEADS"
235
+ ]
236
+ },
237
+ {
238
+ "code": "135-012-000-000-000-000-000",
239
+ "key": "public_reporter",
240
+ "title": "Public Reporter",
241
+ "selectable": true,
242
+ "parentCode": null,
243
+ "childCodes": [],
244
+ "definition": "Uncredentialed public reporter who submits a tip/referral with minimal follow-up visibility. Un-authenticated and one-way by default. Not to be conflated with Mandatory Reporter, which is an authenticated partner role.",
245
+ "canonicalCode": "public_reporter",
246
+ "platformTools": [
247
+ "Thread"
248
+ ]
249
+ },
250
+ {
251
+ "code": "135-013-000-000-000-000-000",
252
+ "key": "research_analytics",
253
+ "title": "Research/Analytics",
254
+ "selectable": true,
255
+ "parentCode": null,
256
+ "childCodes": [],
257
+ "definition": "Uses de-identified datasets and approved aggregate views for analytics and reporting. HTI-only platform-set role; strictly de-identified / aggregate-only by default. Not a member agency role.",
258
+ "canonicalCode": "research_analytics",
259
+ "platformTools": [
260
+ "Platform",
261
+ "Echo"
262
+ ],
263
+ "flags": [
264
+ "HTI-only"
265
+ ]
266
+ },
267
+ {
268
+ "code": "135-014-000-000-000-000-000",
269
+ "key": "screener",
270
+ "title": "Screener (Initial Screen)",
271
+ "selectable": true,
272
+ "parentCode": null,
273
+ "childCodes": [],
274
+ "definition": "Performs intake and initial screening and records indicators/risk flags. Does not perform formal determinations — NEVER-bound for that function — unless the person also holds a second role that grants it.",
275
+ "canonicalCode": "screener",
276
+ "platformTools": [
277
+ "PAVE",
278
+ "Thread"
279
+ ]
280
+ },
281
+ {
282
+ "code": "135-015-000-000-000-000-000",
283
+ "key": "volunteer",
284
+ "title": "Volunteer",
285
+ "selectable": true,
286
+ "parentCode": null,
287
+ "childCodes": [],
288
+ "definition": "Volunteer performing hotline/intake support work under supervision. Modelled as \"hotline volunteer\", not \"general volunteer\": intake creation + routing only, with no downstream casework authority.",
289
+ "canonicalCode": "volunteer",
290
+ "platformTools": [
291
+ "Thread",
292
+ "PAVE"
293
+ ]
294
+ }
295
+ ]
296
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @htilabs/platform-common-models — CVC-133 evaluable function keys
3
+ *
4
+ * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.
5
+ * Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.
6
+ *
7
+ * The keys of coreFunctions.v1.3.0.json whose canon flags are v1 && !retired
8
+ * (canon @ f4356aa4): the only functions the shared authorization resolver
9
+ * evaluates (rule 8). GATE I asserts this equals the SOT.
10
+ */
11
+
12
+ export const CORE_FUNCTIONS_EVALUABLE_SOT_VERSION = "1.3.0";
13
+
14
+ export const CORE_FUNCTIONS_EVALUABLE_KEYS: readonly string[] = [
15
+ "agency_info_manage",
16
+ "announcement_publish",
17
+ "api_key_manage",
18
+ "assessments_conduct",
19
+ "auth_model_manage_platform",
20
+ "case_assign_reassign",
21
+ "case_claim",
22
+ "case_close",
23
+ "case_collaborator_add",
24
+ "case_edit",
25
+ "case_reopen",
26
+ "case_side_panel_use",
27
+ "case_status_manage",
28
+ "case_transfer_bulk",
29
+ "case_view",
30
+ "case_visibility_manage",
31
+ "ci_periodic_review",
32
+ "ci_record_purge_or_retire",
33
+ "ci_record_validate",
34
+ "ci_to_evidence_export_authorize",
35
+ "deconfliction_alert_acknowledge",
36
+ "deconfliction_unmask",
37
+ "determination_perform",
38
+ "disclose_external_request",
39
+ "enrollment_manage",
40
+ "exit_discharge_conduct",
41
+ "export_deidentified",
42
+ "goals_plan_manage",
43
+ "idb_record_create",
44
+ "indicator_manual_add",
45
+ "investigation_create_claim",
46
+ "investigation_session_run",
47
+ "investigative_database_search",
48
+ "investigative_request_send",
49
+ "lead_create",
50
+ "lead_publish",
51
+ "lead_route_assign",
52
+ "lead_triage_manage",
53
+ "magic_link_share_send",
54
+ "mandatory_report_send",
55
+ "member_account_report_generate",
56
+ "member_onboarding_support",
57
+ "message_moderate",
58
+ "message_send",
59
+ "milestone_log",
60
+ "needs_priorities_conduct",
61
+ "network_corpus_access",
62
+ "note_open_departed_author",
63
+ "onboarding_config_sign_off",
64
+ "open_source_search",
65
+ "person_association_update",
66
+ "person_merge_manage",
67
+ "platform_perm_modify",
68
+ "profile_domain_edit",
69
+ "record_activity_view",
70
+ "record_print",
71
+ "referral_receive_external",
72
+ "referral_receive_internal",
73
+ "referral_send_external",
74
+ "referral_send_internal",
75
+ "roi_submit_manage",
76
+ "role_assign",
77
+ "roles_accounts_toggle",
78
+ "sandbox_environment_manage",
79
+ "screening_conduct",
80
+ "screening_view",
81
+ "service_log_manage",
82
+ "session_create",
83
+ "share_config",
84
+ "share_revoke",
85
+ "share_rule_approve_cross_agency",
86
+ "share_vsp_to_le",
87
+ "srl_manage",
88
+ "supervisee_thread_view",
89
+ "support_ticket_triage",
90
+ "system_diagnostics_view",
91
+ "team_config_manage",
92
+ "team_membership_manage",
93
+ "team_share_narrowing",
94
+ "team_workflow_config_manage",
95
+ "training_gate_manage",
96
+ "usr_manage",
97
+ "viewing_config_manage",
98
+ "viewing_level_1_search",
99
+ "viewing_level_2_autocomplete",
100
+ "viewing_level_3_components",
101
+ ];
@@ -3987,9 +3987,9 @@ export const RiskCategoryKeys = {
3987
3987
  export type RiskCategoryKey = keyof typeof RiskCategoryKeys;
3988
3988
 
3989
3989
  /**
3990
- * Key → positional code map for the `core_functions` CVC domain (CANONICAL Notion CVC-133 `core - functions`, verified v1.0 — the Canonical Authorization Model function registry: 78 functions (the verified 77 + `note_open_departed_author`, 133-078, appended 2026-10-05) the roles → functions → gates/tiers graph is built over. NOT provisional numbering. Per-entry lifecycle Status (v1 / future / not-started), Platform Relevance, user/admin relevance and Category are carried in each entry's definition, since the CVC entry schema has no fields for them).
3990
+ * Key → positional code map for the `core_functions` CVC domain (CANONICAL Notion CVC-133 `core - functions`, Active v2.0 — the Canonical Authorization Model function registry; SOT v1.3.0 is GENERATED from the prototype repo's data/cvcs/core_functions.yaml by scripts/gen-core-functions.py: 113 functions — the 78 published by 1.0.0/1.1.0 at their codes plus 35 appended at 133-079 … 133-113 — the roles → functions → gates/tiers graph is built over. NOT provisional numbering. Each entry carries canon's `v1` / `retired` flags as structured booleans (since 1.3.0, read by the shared authorization resolver); Platform Relevance, user/admin relevance and Category ride the definition suffix; bounds are not carried).
3991
3991
  *
3992
- * Domain: `core_functions` · Version: 1.1.0 · Entries: 82
3992
+ * Domain: `core_functions` · Version: 1.3.0 · Entries: 117
3993
3993
  */
3994
3994
  export const CoreFunctionsKeys = {
3995
3995
  missingness_root: "133-000-000-000-000-000-000",
@@ -4074,6 +4074,41 @@ export const CoreFunctionsKeys = {
4074
4074
  training_gate_manage: "133-076-000-000-000-000-000",
4075
4075
  usr_manage: "133-077-000-000-000-000-000",
4076
4076
  note_open_departed_author: "133-078-000-000-000-000-000",
4077
+ agency_info_manage: "133-079-000-000-000-000-000",
4078
+ srl_manage: "133-080-000-000-000-000-000",
4079
+ mandatory_report_send: "133-081-000-000-000-000-000",
4080
+ indicator_manual_add: "133-082-000-000-000-000-000",
4081
+ message_send: "133-083-000-000-000-000-000",
4082
+ workgroup_manage: "133-084-000-000-000-000-000",
4083
+ message_moderate: "133-085-000-000-000-000-000",
4084
+ announcement_publish: "133-086-000-000-000-000-000",
4085
+ supervisee_thread_view: "133-087-000-000-000-000-000",
4086
+ case_status_manage: "133-088-000-000-000-000-000",
4087
+ enrollment_manage: "133-089-000-000-000-000-000",
4088
+ exit_discharge_conduct: "133-090-000-000-000-000-000",
4089
+ goals_plan_manage: "133-091-000-000-000-000-000",
4090
+ lead_triage_manage: "133-092-000-000-000-000-000",
4091
+ milestone_log: "133-093-000-000-000-000-000",
4092
+ needs_priorities_conduct: "133-094-000-000-000-000-000",
4093
+ profile_domain_edit: "133-095-000-000-000-000-000",
4094
+ record_activity_view: "133-096-000-000-000-000-000",
4095
+ service_log_manage: "133-097-000-000-000-000-000",
4096
+ case_close: "133-098-000-000-000-000-000",
4097
+ case_visibility_manage: "133-099-000-000-000-000-000",
4098
+ person_merge_manage: "133-100-000-000-000-000-000",
4099
+ investigation_session_run: "133-101-000-000-000-000-000",
4100
+ lead_route_assign: "133-102-000-000-000-000-000",
4101
+ onboarding_config_sign_off: "133-103-000-000-000-000-000",
4102
+ hmis_export_generate: "133-104-000-000-000-000-000",
4103
+ team_share_narrowing: "133-105-000-000-000-000-000",
4104
+ viewing_config_manage: "133-106-000-000-000-000-000",
4105
+ network_corpus_access: "133-107-000-000-000-000-000",
4106
+ viewing_level_1_search: "133-108-000-000-000-000-000",
4107
+ viewing_level_2_autocomplete: "133-109-000-000-000-000-000",
4108
+ viewing_level_3_components: "133-110-000-000-000-000-000",
4109
+ investigative_request_send: "133-111-000-000-000-000-000",
4110
+ deconfliction_unmask: "133-112-000-000-000-000-000",
4111
+ share_revoke: "133-113-000-000-000-000-000",
4077
4112
  } as const;
4078
4113
 
4079
4114
  export type CoreFunctionsKey = keyof typeof CoreFunctionsKeys;
@@ -4627,15 +4662,11 @@ export const RiskSeverityBandKeys = {
4627
4662
  export type RiskSeverityBandKey = keyof typeof RiskSeverityBandKeys;
4628
4663
 
4629
4664
  /**
4630
- * Key → positional code map for the `admin_roles` CVC domain (CVC-134). Administrative role axis of the canonical authorization model (IC-66); distinct from CVC-135 `user_roles`.
4665
+ * Key → positional code map for the `admin_roles` CVC domain (CVC-134). Administrative / control-plane role axis of the canonical authorization model (IC-66; admin ≠ content visibility); distinct from CVC-135 `user_roles`. SOT v2.0.0 is GENERATED from the prototype repo's data/cvcs/core_admin_role.yaml by scripts/gen-admin-roles.py. Keys transliterate canon's hyphenated codes (`PLT-ADM` → `plt_adm`; canon spelling on `canonicalCode`). No missingness keys (the 1.0.0 quadruplet is withdrawn). Canon's legacy `ACCT-ADM` resolves to `mem_adm` through `adminRolesSot._supersedes.keyMap`, which is key-space (look up `acct_adm`: lowercase, `-` → `_`).
4631
4666
  *
4632
- * Domain: `admin_roles` · Version: 1.0.0 · Entries: 14
4667
+ * Domain: `admin_roles` · Version: 2.0.0 · Entries: 10
4633
4668
  */
4634
4669
  export const AdminRoleKeys = {
4635
- missingness_root: "134-000-000-000-000-000-000",
4636
- unknown: "134-000-000-000-000-000-001",
4637
- anonymous: "134-000-000-000-000-000-002",
4638
- data_not_collected: "134-000-000-000-000-000-003",
4639
4670
  plt_adm: "134-001-000-000-000-000-000",
4640
4671
  plt_sup: "134-002-000-000-000-000-000",
4641
4672
  mem_adm: "134-003-000-000-000-000-000",
@@ -4651,19 +4682,15 @@ export const AdminRoleKeys = {
4651
4682
  export type AdminRoleKey = keyof typeof AdminRoleKeys;
4652
4683
 
4653
4684
  /**
4654
- * Key → positional code map for the `user_roles` CVC domain (CVC-135). Operational / practitioner role axis of the canonical authorization model (IC-66); distinct from CVC-134 `admin_roles`.
4685
+ * Key → positional code map for the `user_roles` CVC domain (CVC-135). Operational / practitioner role axis of the canonical authorization model (IC-66); distinct from CVC-134 `admin_roles`. SOT v2.0.0 is GENERATED from the prototype repo's data/cvcs/core_user_role.yaml by scripts/gen-user-roles.py; canon re-keyed `hotline_op` to `crisis_response` at the same code (135-004). No missingness keys (the 1.0.0 quadruplet is withdrawn; a role is assigned, never observed). A stored `hotline_op`, or canon's legacy `case_advocate` / `leads_investigator`, resolves through `userRolesSot._supersedes.keyMap`.
4655
4686
  *
4656
- * Domain: `user_roles` · Version: 1.0.0 · Entries: 19
4687
+ * Domain: `user_roles` · Version: 2.0.0 · Entries: 15
4657
4688
  */
4658
4689
  export const UserRoleKeys = {
4659
- missingness_root: "135-000-000-000-000-000-000",
4660
- unknown: "135-000-000-000-000-000-001",
4661
- anonymous: "135-000-000-000-000-000-002",
4662
- data_not_collected: "135-000-000-000-000-000-003",
4663
4690
  case_nav: "135-001-000-000-000-000-000",
4664
4691
  healthcare_provider_medical: "135-002-000-000-000-000-000",
4665
4692
  behavioral_health_provider: "135-003-000-000-000-000-000",
4666
- hotline_op: "135-004-000-000-000-000-000",
4693
+ crisis_response: "135-004-000-000-000-000-000",
4667
4694
  intel_analyst: "135-005-000-000-000-000-000",
4668
4695
  investigator: "135-006-000-000-000-000-000",
4669
4696
  le_liaison_vsp: "135-007-000-000-000-000-000",
package/src/index.ts CHANGED
@@ -52,6 +52,10 @@ export * from "./generated/cvc-enums.js";
52
52
  // Export services (requires mongoose peer dependency)
53
53
  export * from "./services/index.js";
54
54
 
55
+ // Shared CVC-133 authorization resolver (pure; no mongoose, no I/O). Browser
56
+ // consumers import it from the `@htilabs/platform-common-models/authz` subpath.
57
+ export * from "./authz/index.js";
58
+
55
59
  // ─── CVC validation surface (Zod schemas + inferred types) ──────────────────
56
60
  // Per co-am3.7 (Phase 1.7) bead: re-export the Zod schemas, plus the inferred
57
61
  // scalar types and `CvcDomain`. The Zod-inferred entry shape is exposed via
@@ -132,3 +132,21 @@ export {
132
132
  type OrgTypeFieldsHolder,
133
133
  type AgencyOrgTypeFields,
134
134
  } from "./agency.js";
135
+
136
+ // Organization program rows (`organizations.programs[]`): the one definition
137
+ // both apps mount (`addOrganizationProgramsField`), the review-status
138
+ // vocabulary and the live-row rule
139
+ export {
140
+ PROGRAM_REVIEW_STATUS,
141
+ PROGRAM_REVIEW_STATUS_VALUES,
142
+ organizationProgramSchemaDefinition,
143
+ buildOrganizationProgramsFieldDefinition,
144
+ ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS,
145
+ buildOrganizationProgramSchema,
146
+ addOrganizationProgramsField,
147
+ type AddOrganizationProgramsFieldOptions,
148
+ isLiveOrganizationProgram,
149
+ isProgramReviewStatus,
150
+ type OrganizationProgram,
151
+ type ProgramReviewStatus,
152
+ } from "./organization-program.js";