@htilabs/platform-common-models 0.22.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 (61) 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 +647 -353
  10. package/dist/cvcs/index.cjs.map +1 -1
  11. package/dist/cvcs/index.d.cts +658 -362
  12. package/dist/cvcs/index.d.ts +658 -362
  13. package/dist/cvcs/index.js +647 -353
  14. package/dist/cvcs/index.js.map +1 -1
  15. package/dist/enums/index.cjs +1 -9
  16. package/dist/enums/index.cjs.map +1 -1
  17. package/dist/enums/index.d.cts +7 -15
  18. package/dist/enums/index.d.ts +7 -15
  19. package/dist/enums/index.js +1 -9
  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 +899 -362
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +3 -1
  26. package/dist/index.d.ts +3 -1
  27. package/dist/index.js +893 -362
  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/types/index.d.cts +2 -2
  32. package/dist/types/index.d.ts +2 -2
  33. package/package.json +6 -1
  34. package/src/__sot__/README.md +3 -1
  35. package/src/__sot__/adminRoles.pin.json +122 -0
  36. package/src/__sot__/adminRoles.published.json +77 -0
  37. package/src/__sot__/coreFunctionFields.ts +16 -0
  38. package/src/__sot__/coreFunctions.pin.json +114 -1
  39. package/src/__sot__/roleFields.ts +137 -0
  40. package/src/__sot__/userRoles.pin.json +174 -0
  41. package/src/__sot__/userRoles.published.json +103 -0
  42. package/src/__tests__/__snapshots__/cvc-sot.snap +5 -5
  43. package/src/__tests__/admin-roles-canon.test.ts +80 -0
  44. package/src/__tests__/authz-resolve.test.ts +712 -0
  45. package/src/__tests__/core-functions-canon.test.ts +62 -12
  46. package/src/__tests__/cvc-sot-snapshot.test.ts +12 -4
  47. package/src/__tests__/cvc-status-parser.test.ts +1 -1
  48. package/src/__tests__/cvc-structural.test.ts +3 -3
  49. package/src/__tests__/role-vocab-gate.ts +279 -0
  50. package/src/__tests__/user-roles-canon.test.ts +104 -0
  51. package/src/authz/index.ts +9 -0
  52. package/src/authz/resolveEffectiveFunctions.ts +454 -0
  53. package/src/cvcs/adminRoles.v2.0.0.json +197 -0
  54. package/src/cvcs/{coreFunctions.v1.2.0.json → coreFunctions.v1.3.0.json} +357 -200
  55. package/src/cvcs/index.ts +3 -3
  56. package/src/cvcs/userRoles.v2.0.0.json +296 -0
  57. package/src/generated/coreFunctionsEvaluable.ts +101 -0
  58. package/src/generated/cvc-enums.ts +7 -15
  59. package/src/index.ts +4 -0
  60. package/src/cvcs/adminRoles.v1.0.0.json +0 -153
  61. 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.2.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`, Active v2.0 — the Canonical Authorization Model function registry; SOT v1.2.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. Per-entry lifecycle Status (v1 / not v1), Platform Relevance, user/admin relevance and Category are carried in each entry's definition suffix, since the CVC entry schema has no fields for them; bounds are not carried).
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.2.0 · Entries: 117
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",
@@ -4662,15 +4662,11 @@ export const RiskSeverityBandKeys = {
4662
4662
  export type RiskSeverityBandKey = keyof typeof RiskSeverityBandKeys;
4663
4663
 
4664
4664
  /**
4665
- * 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, `-` → `_`).
4666
4666
  *
4667
- * Domain: `admin_roles` · Version: 1.0.0 · Entries: 14
4667
+ * Domain: `admin_roles` · Version: 2.0.0 · Entries: 10
4668
4668
  */
4669
4669
  export const AdminRoleKeys = {
4670
- missingness_root: "134-000-000-000-000-000-000",
4671
- unknown: "134-000-000-000-000-000-001",
4672
- anonymous: "134-000-000-000-000-000-002",
4673
- data_not_collected: "134-000-000-000-000-000-003",
4674
4670
  plt_adm: "134-001-000-000-000-000-000",
4675
4671
  plt_sup: "134-002-000-000-000-000-000",
4676
4672
  mem_adm: "134-003-000-000-000-000-000",
@@ -4686,19 +4682,15 @@ export const AdminRoleKeys = {
4686
4682
  export type AdminRoleKey = keyof typeof AdminRoleKeys;
4687
4683
 
4688
4684
  /**
4689
- * 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`.
4690
4686
  *
4691
- * Domain: `user_roles` · Version: 1.0.0 · Entries: 19
4687
+ * Domain: `user_roles` · Version: 2.0.0 · Entries: 15
4692
4688
  */
4693
4689
  export const UserRoleKeys = {
4694
- missingness_root: "135-000-000-000-000-000-000",
4695
- unknown: "135-000-000-000-000-000-001",
4696
- anonymous: "135-000-000-000-000-000-002",
4697
- data_not_collected: "135-000-000-000-000-000-003",
4698
4690
  case_nav: "135-001-000-000-000-000-000",
4699
4691
  healthcare_provider_medical: "135-002-000-000-000-000-000",
4700
4692
  behavioral_health_provider: "135-003-000-000-000-000-000",
4701
- hotline_op: "135-004-000-000-000-000-000",
4693
+ crisis_response: "135-004-000-000-000-000-000",
4702
4694
  intel_analyst: "135-005-000-000-000-000-000",
4703
4695
  investigator: "135-006-000-000-000-000-000",
4704
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
@@ -1,153 +0,0 @@
1
- {
2
- "domain": "admin_roles",
3
- "name": "Core Admin Roles (CVC-134)",
4
- "version": "1.0.0",
5
- "_status": "CANONICAL — imported 0.8.13 from the Notion Final CVC codebook (CVC-134 `core - admin roles`, Owner Crysta Price, Status 'Drafted - Needs Review'). Administrative role vocabulary for the canonical authorization model (IC-66). DISTINCT from CVC-135 `user_roles` (the operational/practitioner role axis) — a person may hold both. Entry keys are the underscore transliterations of the canonical hyphenated codes (`PLT-ADM` -> `plt_adm`), which are carried verbatim in `canonicalCode` because CVC keys must match /^[a-z][a-z0-9_]*$/. The Final codebook carries no missingness rows; the quadruplet is added per SOT convention.",
6
- "_source": "htilabstech/prototype@a596eb9 Final CVCs/System Roles, Permissions, & Account Management (IC-66)/core - admin roles (CVC-134)",
7
- "levels": {
8
- "0": "Unknown or Missing",
9
- "1": "Admin role"
10
- },
11
- "entries": [
12
- {
13
- "code": "134-000-000-000-000-000-000",
14
- "key": "missingness_root",
15
- "title": "Unknown, Redacted, or Missing",
16
- "selectable": false,
17
- "parentCode": null,
18
- "childCodes": [
19
- "134-000-000-000-000-000-001",
20
- "134-000-000-000-000-000-002",
21
- "134-000-000-000-000-000-003"
22
- ],
23
- "definition": "Root group for values indicating absent, withheld, or uncollected data. Variant: 3-value (unknown, anonymous, data_not_collected) under the workspace standard ANON semantic."
24
- },
25
- {
26
- "code": "134-000-000-000-000-000-001",
27
- "key": "unknown",
28
- "title": "Unknown",
29
- "selectable": true,
30
- "parentCode": "134-000-000-000-000-000-000",
31
- "childCodes": [],
32
- "definition": "Unknown or cannot be determined from the available information."
33
- },
34
- {
35
- "code": "134-000-000-000-000-000-002",
36
- "key": "anonymous",
37
- "title": "Anonymous / declined to answer",
38
- "selectable": true,
39
- "parentCode": "134-000-000-000-000-000-000",
40
- "childCodes": [],
41
- "definition": "Value is intentionally withheld or redacted. Combines declined-to-answer and redacted/anonymous semantics under the workspace standard ANON sentinel."
42
- },
43
- {
44
- "code": "134-000-000-000-000-000-003",
45
- "key": "data_not_collected",
46
- "title": "Data not collected",
47
- "selectable": true,
48
- "parentCode": "134-000-000-000-000-000-000",
49
- "childCodes": [],
50
- "definition": "No attempt was made to collect the value. System-only sentinel per GLOBAL_DESIGN_RULES."
51
- },
52
- {
53
- "code": "134-001-000-000-000-000-000",
54
- "key": "plt_adm",
55
- "title": "Platform Admin / Owner",
56
- "selectable": true,
57
- "parentCode": null,
58
- "childCodes": [],
59
- "definition": "Global administrator of platform services (Trail, CaseShare, Toby, Echo). Owns platform-level specification and enforcement of roles, functions, gates, and global governance.",
60
- "canonicalCode": "PLT-ADM"
61
- },
62
- {
63
- "code": "134-002-000-000-000-000-000",
64
- "key": "plt_sup",
65
- "title": "Platform Support Admin",
66
- "selectable": true,
67
- "parentCode": null,
68
- "childCodes": [],
69
- "definition": "Support-oriented platform administrator for HTI Labs: handles bug reports, onboarding support, troubleshooting, and account support without inheriting full Platform Admin powers.",
70
- "canonicalCode": "PLT-SUP"
71
- },
72
- {
73
- "code": "134-003-000-000-000-000-000",
74
- "key": "mem_adm",
75
- "title": "Account Admin (Member Administrator)",
76
- "selectable": true,
77
- "parentCode": null,
78
- "childCodes": [],
79
- "definition": "Network Rules-defined administrator for a Member Account; accountable for user management, compliance posture, and coordination with HTI.",
80
- "canonicalCode": "MEM-ADM"
81
- },
82
- {
83
- "code": "134-004-000-000-000-000-000",
84
- "key": "team_adm",
85
- "title": "Team Admin",
86
- "selectable": true,
87
- "parentCode": null,
88
- "childCodes": [],
89
- "definition": "Delegated administrative role (optional) used to operate one-to-many teams as workflow containers; appropriate for supervisors over teams and most operational configuration.",
90
- "canonicalCode": "TEAM-ADM"
91
- },
92
- {
93
- "code": "134-005-000-000-000-000-000",
94
- "key": "aud",
95
- "title": "Compliance / Auditor",
96
- "selectable": true,
97
- "parentCode": null,
98
- "childCodes": [],
99
- "definition": "Read-only oversight role for audit logs, retention, and configuration; no case content access (typically de-identified).",
100
- "canonicalCode": "AUD"
101
- },
102
- {
103
- "code": "134-006-000-000-000-000-000",
104
- "key": "data_adm",
105
- "title": "Data & Reporting Admin",
106
- "selectable": true,
107
- "parentCode": null,
108
- "childCodes": [],
109
- "definition": "Administrative role for reporting configuration, exports, data QA workflows, and grant reporting in Echo, used when separation from MEM-ADM is needed. Access de-identified data.",
110
- "canonicalCode": "DATA-ADM"
111
- },
112
- {
113
- "code": "134-007-000-000-000-000-000",
114
- "key": "gov_aud",
115
- "title": "Governance Auditor",
116
- "selectable": true,
117
- "parentCode": null,
118
- "childCodes": [],
119
- "definition": "Optional role for governance-based data review and spot checks; participation is opt-in.",
120
- "canonicalCode": "GOV-AUD"
121
- },
122
- {
123
- "code": "134-008-000-000-000-000-000",
124
- "key": "ciro",
125
- "title": "Criminal Intelligence Review Officer",
126
- "selectable": true,
127
- "parentCode": null,
128
- "childCodes": [],
129
- "definition": "Designated member-account authority responsible for governance oversight of Criminal Intelligence (CI) within LEADS-enabled accounts, including validation rules, periodic review, purge/retention compliance, and controlled authorization of CI → evidence exports (as explicit approval-gated actions).",
130
- "canonicalCode": "CIRO"
131
- },
132
- {
133
- "code": "134-009-000-000-000-000-000",
134
- "key": "sup",
135
- "title": "Supervisor",
136
- "selectable": true,
137
- "parentCode": null,
138
- "childCodes": [],
139
- "definition": "Agency-set supervisory role used to oversee day-to-day case workflow within a team or program. Focuses on operational triage and case assignment, without broader account governance powers (user management, sharing policy, team structure) or destructive enforcement actions.",
140
- "canonicalCode": "SUP"
141
- },
142
- {
143
- "code": "134-010-000-000-000-000-000",
144
- "key": "train_adm",
145
- "title": "Training Admin",
146
- "selectable": true,
147
- "parentCode": null,
148
- "childCodes": [],
149
- "definition": null,
150
- "canonicalCode": "TRAIN-ADM"
151
- }
152
- ]
153
- }