@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
@@ -0,0 +1,233 @@
1
+ {
2
+ "_note": "Every key @htilabs/platform-common-models has ever published for core_functions, with its segment-1 prefix. APPEND-ONLY: a published key never moves and is never removed (a key canon drops stays here as a tombstone). Written by scripts/gen-core-functions.py; read by it and by GATE I (src/__tests__/core-functions-canon.test.ts). Do not hand-edit.",
3
+ "prefixes": {
4
+ "account_suspend": 1,
5
+ "aggregate_data_query_generate": 2,
6
+ "api_key_manage": 3,
7
+ "assessments_conduct": 4,
8
+ "audit_anomaly_review": 5,
9
+ "audit_log_view_member": 6,
10
+ "audit_log_view_team": 7,
11
+ "auth_model_manage_platform": 8,
12
+ "break_glass": 9,
13
+ "case_assign_reassign": 10,
14
+ "case_claim": 11,
15
+ "case_collaborator_add": 12,
16
+ "case_edit": 13,
17
+ "case_needs_action_flag_manage": 14,
18
+ "case_outcomes_edit": 15,
19
+ "case_purge": 16,
20
+ "case_reopen": 17,
21
+ "case_side_panel_use": 18,
22
+ "case_transfer_bulk": 19,
23
+ "case_view": 20,
24
+ "ci_periodic_review": 21,
25
+ "ci_record_purge_or_retire": 22,
26
+ "ci_record_validate": 23,
27
+ "ci_to_evidence_export_authorize": 24,
28
+ "dashboard_approve_shared": 25,
29
+ "data_qa_workflow_run": 26,
30
+ "deconfliction_alert_acknowledge": 27,
31
+ "determination_perform": 28,
32
+ "disclose_external": 29,
33
+ "disclose_external_request": 30,
34
+ "export_deidentified": 31,
35
+ "export_disclosure_log_review": 32,
36
+ "export_template_config_manage": 33,
37
+ "gov_data_quality_review": 34,
38
+ "idb_record_create": 35,
39
+ "incident_response_remediate": 36,
40
+ "investigation_create_claim": 37,
41
+ "investigative_database_search": 38,
42
+ "lead_create": 39,
43
+ "lead_publish": 40,
44
+ "magic_link_share_send": 41,
45
+ "member_account_report_generate": 42,
46
+ "member_onboarding_support": 43,
47
+ "open_source_search": 44,
48
+ "outbound_share_followup_review": 45,
49
+ "person_association_update": 46,
50
+ "platform_perm_modify": 47,
51
+ "platform_policy_enforcement_manage": 48,
52
+ "record_print": 49,
53
+ "referral_receive_external": 50,
54
+ "referral_receive_internal": 51,
55
+ "referral_send_external": 52,
56
+ "referral_send_internal": 53,
57
+ "reporting_dashboard_config_manage": 54,
58
+ "retention_compliance_review": 55,
59
+ "roi_submit_manage": 56,
60
+ "role_assign": 57,
61
+ "roles_accounts_toggle": 58,
62
+ "sandbox_environment_manage": 59,
63
+ "screening_conduct": 60,
64
+ "screening_view": 61,
65
+ "security_restrict_apply": 62,
66
+ "session_create": 63,
67
+ "share_approve": 64,
68
+ "share_config": 65,
69
+ "share_rule_approve_cross_agency": 66,
70
+ "share_vsp_to_le": 67,
71
+ "support_ticket_triage": 68,
72
+ "system_diagnostics_view": 69,
73
+ "team_config_manage": 70,
74
+ "team_membership_manage": 71,
75
+ "team_workflow_config_manage": 72,
76
+ "thread_share_accept": 73,
77
+ "thread_share_send": 74,
78
+ "training_content_upload": 75,
79
+ "training_gate_manage": 76,
80
+ "usr_manage": 77,
81
+ "note_open_departed_author": 78,
82
+ "agency_info_manage": 79,
83
+ "srl_manage": 80,
84
+ "mandatory_report_send": 81,
85
+ "indicator_manual_add": 82,
86
+ "message_send": 83,
87
+ "workgroup_manage": 84,
88
+ "message_moderate": 85,
89
+ "announcement_publish": 86,
90
+ "supervisee_thread_view": 87,
91
+ "case_status_manage": 88,
92
+ "enrollment_manage": 89,
93
+ "exit_discharge_conduct": 90,
94
+ "goals_plan_manage": 91,
95
+ "lead_triage_manage": 92,
96
+ "milestone_log": 93,
97
+ "needs_priorities_conduct": 94,
98
+ "profile_domain_edit": 95,
99
+ "record_activity_view": 96,
100
+ "service_log_manage": 97,
101
+ "case_close": 98,
102
+ "case_visibility_manage": 99,
103
+ "person_merge_manage": 100,
104
+ "investigation_session_run": 101,
105
+ "lead_route_assign": 102,
106
+ "onboarding_config_sign_off": 103,
107
+ "hmis_export_generate": 104,
108
+ "team_share_narrowing": 105,
109
+ "viewing_config_manage": 106,
110
+ "network_corpus_access": 107,
111
+ "viewing_level_1_search": 108,
112
+ "viewing_level_2_autocomplete": 109,
113
+ "viewing_level_3_components": 110,
114
+ "investigative_request_send": 111,
115
+ "deconfliction_unmask": 112,
116
+ "share_revoke": 113
117
+ },
118
+ "since": {
119
+ "account_suspend": "1.0.0",
120
+ "aggregate_data_query_generate": "1.0.0",
121
+ "api_key_manage": "1.0.0",
122
+ "assessments_conduct": "1.0.0",
123
+ "audit_anomaly_review": "1.0.0",
124
+ "audit_log_view_member": "1.0.0",
125
+ "audit_log_view_team": "1.0.0",
126
+ "auth_model_manage_platform": "1.0.0",
127
+ "break_glass": "1.0.0",
128
+ "case_assign_reassign": "1.0.0",
129
+ "case_claim": "1.0.0",
130
+ "case_collaborator_add": "1.0.0",
131
+ "case_edit": "1.0.0",
132
+ "case_needs_action_flag_manage": "1.0.0",
133
+ "case_outcomes_edit": "1.0.0",
134
+ "case_purge": "1.0.0",
135
+ "case_reopen": "1.0.0",
136
+ "case_side_panel_use": "1.0.0",
137
+ "case_transfer_bulk": "1.0.0",
138
+ "case_view": "1.0.0",
139
+ "ci_periodic_review": "1.0.0",
140
+ "ci_record_purge_or_retire": "1.0.0",
141
+ "ci_record_validate": "1.0.0",
142
+ "ci_to_evidence_export_authorize": "1.0.0",
143
+ "dashboard_approve_shared": "1.0.0",
144
+ "data_qa_workflow_run": "1.0.0",
145
+ "deconfliction_alert_acknowledge": "1.0.0",
146
+ "determination_perform": "1.0.0",
147
+ "disclose_external": "1.0.0",
148
+ "disclose_external_request": "1.0.0",
149
+ "export_deidentified": "1.0.0",
150
+ "export_disclosure_log_review": "1.0.0",
151
+ "export_template_config_manage": "1.0.0",
152
+ "gov_data_quality_review": "1.0.0",
153
+ "idb_record_create": "1.0.0",
154
+ "incident_response_remediate": "1.0.0",
155
+ "investigation_create_claim": "1.0.0",
156
+ "investigative_database_search": "1.0.0",
157
+ "lead_create": "1.0.0",
158
+ "lead_publish": "1.0.0",
159
+ "magic_link_share_send": "1.0.0",
160
+ "member_account_report_generate": "1.0.0",
161
+ "member_onboarding_support": "1.0.0",
162
+ "open_source_search": "1.0.0",
163
+ "outbound_share_followup_review": "1.0.0",
164
+ "person_association_update": "1.0.0",
165
+ "platform_perm_modify": "1.0.0",
166
+ "platform_policy_enforcement_manage": "1.0.0",
167
+ "record_print": "1.0.0",
168
+ "referral_receive_external": "1.0.0",
169
+ "referral_receive_internal": "1.0.0",
170
+ "referral_send_external": "1.0.0",
171
+ "referral_send_internal": "1.0.0",
172
+ "reporting_dashboard_config_manage": "1.0.0",
173
+ "retention_compliance_review": "1.0.0",
174
+ "roi_submit_manage": "1.0.0",
175
+ "role_assign": "1.0.0",
176
+ "roles_accounts_toggle": "1.0.0",
177
+ "sandbox_environment_manage": "1.0.0",
178
+ "screening_conduct": "1.0.0",
179
+ "screening_view": "1.0.0",
180
+ "security_restrict_apply": "1.0.0",
181
+ "session_create": "1.0.0",
182
+ "share_approve": "1.0.0",
183
+ "share_config": "1.0.0",
184
+ "share_rule_approve_cross_agency": "1.0.0",
185
+ "share_vsp_to_le": "1.0.0",
186
+ "support_ticket_triage": "1.0.0",
187
+ "system_diagnostics_view": "1.0.0",
188
+ "team_config_manage": "1.0.0",
189
+ "team_membership_manage": "1.0.0",
190
+ "team_workflow_config_manage": "1.0.0",
191
+ "thread_share_accept": "1.0.0",
192
+ "thread_share_send": "1.0.0",
193
+ "training_content_upload": "1.0.0",
194
+ "training_gate_manage": "1.0.0",
195
+ "usr_manage": "1.0.0",
196
+ "note_open_departed_author": "1.1.0",
197
+ "agency_info_manage": "1.2.0",
198
+ "srl_manage": "1.2.0",
199
+ "mandatory_report_send": "1.2.0",
200
+ "indicator_manual_add": "1.2.0",
201
+ "message_send": "1.2.0",
202
+ "workgroup_manage": "1.2.0",
203
+ "message_moderate": "1.2.0",
204
+ "announcement_publish": "1.2.0",
205
+ "supervisee_thread_view": "1.2.0",
206
+ "case_status_manage": "1.2.0",
207
+ "enrollment_manage": "1.2.0",
208
+ "exit_discharge_conduct": "1.2.0",
209
+ "goals_plan_manage": "1.2.0",
210
+ "lead_triage_manage": "1.2.0",
211
+ "milestone_log": "1.2.0",
212
+ "needs_priorities_conduct": "1.2.0",
213
+ "profile_domain_edit": "1.2.0",
214
+ "record_activity_view": "1.2.0",
215
+ "service_log_manage": "1.2.0",
216
+ "case_close": "1.2.0",
217
+ "case_visibility_manage": "1.2.0",
218
+ "person_merge_manage": "1.2.0",
219
+ "investigation_session_run": "1.2.0",
220
+ "lead_route_assign": "1.2.0",
221
+ "onboarding_config_sign_off": "1.2.0",
222
+ "hmis_export_generate": "1.2.0",
223
+ "team_share_narrowing": "1.2.0",
224
+ "viewing_config_manage": "1.2.0",
225
+ "network_corpus_access": "1.2.0",
226
+ "viewing_level_1_search": "1.2.0",
227
+ "viewing_level_2_autocomplete": "1.2.0",
228
+ "viewing_level_3_components": "1.2.0",
229
+ "investigative_request_send": "1.2.0",
230
+ "deconfliction_unmask": "1.2.0",
231
+ "share_revoke": "1.2.0"
232
+ }
233
+ }
@@ -0,0 +1,137 @@
1
+ /**
2
+ * THE FIELD HALF OF THE ROLE PINS (userRoles + adminRoles)
3
+ * ========================================================
4
+ *
5
+ * `userRoles.pin.json` and `adminRoles.pin.json` snapshot the two canonical
6
+ * role vocabularies in `htilabstech/prototype`:
7
+ *
8
+ * - CVC-135 `data/cvcs/core_user_role.yaml` — "THE SSOT for the platform's
9
+ * OPERATIONAL user role bundles" (the casework-capability axis);
10
+ * - CVC-134 `data/cvcs/core_admin_role.yaml` — the ADMINISTRATIVE /
11
+ * control-plane axis ("admin ≠ content visibility").
12
+ *
13
+ * The package's `src/cvcs/userRoles.v*.json` / `adminRoles.v*.json` are
14
+ * downstream of them: regenerated by `scripts/gen-user-roles.py` /
15
+ * `scripts/gen-admin-roles.py` (both thin configs of `scripts/role_vocab.py`),
16
+ * never hand-edited.
17
+ *
18
+ * Why a pin at all: both 1.0.0 files were hand-imported in 0.8.13 from the June
19
+ * Notion export and validated against themselves. They drifted the way CVC-133
20
+ * did (`coreFunctions.pin.json`, #202): canon re-keyed `hotline_op` to
21
+ * `crisis_response`, retitled PLT-ADM, rewrote most definitions and grew
22
+ * per-role fields (`reach`, `display_label`, …), and nothing failed. With these
23
+ * pins, GATE J (`user-roles-canon.test.ts`) and GATE K
24
+ * (`admin-roles-canon.test.ts`) assert on every PR that the shipped SOT restates
25
+ * every canon role and every projected field, and nothing canon does not carry;
26
+ * `sot:pins:check` detects when canon moves.
27
+ *
28
+ * The PROJECTION is every per-role field canon carries — the pin derivation
29
+ * REFUSES a canon field outside it, so a new canon field cannot be dropped
30
+ * silently (the same refusal the generators make). An absent field projects
31
+ * as `null`; the SOT omits it.
32
+ *
33
+ * Lives in `src/` (not `scripts/`) for the same tsconfig `rootDir` reason as
34
+ * `coreIndicatorFields.ts`.
35
+ */
36
+
37
+ type FieldKind = "string" | "boolean" | "string[]";
38
+
39
+ /** What each projected canon field must be. `label` / `definition` are required; the rest are optional. */
40
+ const USER_ROLE_FIELD_KINDS = {
41
+ label: "string",
42
+ definition: "string",
43
+ display_label: "string",
44
+ platform_tools: "string[]",
45
+ flags: "string[]",
46
+ } as const satisfies Record<string, FieldKind>;
47
+
48
+ const ADMIN_ROLE_FIELD_KINDS = {
49
+ label: "string",
50
+ definition: "string",
51
+ display_label: "string",
52
+ required: "boolean",
53
+ required_when: "string",
54
+ reach: "string",
55
+ scope: "string",
56
+ plain_language: "string",
57
+ } as const satisfies Record<string, FieldKind>;
58
+
59
+ type Projected<K extends Record<string, FieldKind>> = {
60
+ readonly [F in keyof K]: F extends "label" | "definition"
61
+ ? string
62
+ : K[F] extends "boolean"
63
+ ? boolean | null
64
+ : K[F] extends "string[]"
65
+ ? readonly string[] | null
66
+ : string | null;
67
+ };
68
+
69
+ export type ProjectedUserRoleFields = Projected<typeof USER_ROLE_FIELD_KINDS>;
70
+ export type ProjectedAdminRoleFields = Projected<typeof ADMIN_ROLE_FIELD_KINDS>;
71
+ export type ProjectedRoleFields = ProjectedUserRoleFields | ProjectedAdminRoleFields;
72
+
73
+ export const PROJECTED_USER_ROLE_FIELDS = Object.keys(
74
+ USER_ROLE_FIELD_KINDS,
75
+ ) as readonly (keyof ProjectedUserRoleFields)[];
76
+ export const PROJECTED_ADMIN_ROLE_FIELDS = Object.keys(
77
+ ADMIN_ROLE_FIELD_KINDS,
78
+ ) as readonly (keyof ProjectedAdminRoleFields)[];
79
+
80
+ /** Collapse a yaml block scalar to one line — the generator's `flat()`. */
81
+ export function flattenDefinition(s: string): string {
82
+ return s.split(/\s+/).filter(Boolean).join(" ");
83
+ }
84
+
85
+ /** snake_case canon field -> the SOT entry's camelCase field (the generator's `camel()`). */
86
+ export function sotFieldName(canonField: string): string {
87
+ return canonField.replace(/_([a-z])/g, (_, c: string) => c.toUpperCase());
88
+ }
89
+
90
+ function project<K extends Record<string, FieldKind>>(
91
+ kinds: K,
92
+ file: string,
93
+ row: Readonly<Record<string, unknown>>,
94
+ ): Projected<K> {
95
+ const code = String(row["code"]);
96
+ const unknown = Object.keys(row).filter((k) => k !== "code" && !(k in kinds));
97
+ if (unknown.length > 0) {
98
+ throw new Error(
99
+ `${file} row ${code}: unrecognized field(s) ${unknown.join(", ")} — extend the projection in ` +
100
+ "src/__sot__/roleFields.ts AND the generator config together (never drop a canon field silently).",
101
+ );
102
+ }
103
+ const out: Record<string, unknown> = {};
104
+ for (const [field, kind] of Object.entries(kinds)) {
105
+ const v = row[field];
106
+ if (v === undefined || v === null) {
107
+ if (field === "label" || field === "definition") {
108
+ throw new Error(`${file} row ${code}: ${field} is missing`);
109
+ }
110
+ out[field] = null;
111
+ continue;
112
+ }
113
+ const ok =
114
+ kind === "string"
115
+ ? typeof v === "string"
116
+ : kind === "boolean"
117
+ ? typeof v === "boolean"
118
+ : Array.isArray(v) && v.every((x) => typeof x === "string");
119
+ if (!ok) throw new Error(`${file} row ${code}: ${field} is not a ${kind}`);
120
+ out[field] = field === "definition" ? flattenDefinition(v as string) : v;
121
+ }
122
+ return out as Projected<K>;
123
+ }
124
+
125
+ /** Project one canon CVC-135 row (a parsed `entries[]` item of core_user_role.yaml). */
126
+ export function projectUserRoleRow(
127
+ row: Readonly<Record<string, unknown>>,
128
+ ): ProjectedUserRoleFields {
129
+ return project(USER_ROLE_FIELD_KINDS, "core_user_role.yaml", row);
130
+ }
131
+
132
+ /** Project one canon CVC-134 row (a parsed `entries[]` item of core_admin_role.yaml). */
133
+ export function projectAdminRoleRow(
134
+ row: Readonly<Record<string, unknown>>,
135
+ ): ProjectedAdminRoleFields {
136
+ return project(ADMIN_ROLE_FIELD_KINDS, "core_admin_role.yaml", row);
137
+ }
@@ -0,0 +1,174 @@
1
+ {
2
+ "sourceRepo": "htilabstech/prototype",
3
+ "sourceFile": "data/cvcs/core_user_role.yaml",
4
+ "sourceSha": "d85f05b",
5
+ "codes": [
6
+ "behavioral_health_provider",
7
+ "case_nav",
8
+ "crisis_response",
9
+ "healthcare_provider_medical",
10
+ "intel_analyst",
11
+ "investigator",
12
+ "le_liaison_vsp",
13
+ "legal_advocate",
14
+ "mandatory_reporter",
15
+ "mdt_participant",
16
+ "prosecutor_review",
17
+ "public_reporter",
18
+ "research_analytics",
19
+ "screener",
20
+ "volunteer"
21
+ ],
22
+ "roleFields": {
23
+ "behavioral_health_provider": {
24
+ "label": "Certified Mental/Behavioral Health Provider",
25
+ "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.",
26
+ "display_label": "Behavioral Health Provider",
27
+ "platform_tools": [
28
+ "PAVE"
29
+ ],
30
+ "flags": null
31
+ },
32
+ "case_nav": {
33
+ "label": "Case Navigator/Advocate",
34
+ "definition": "Provides ongoing service coordination, referrals, and case documentation within survivor-services workflows.",
35
+ "display_label": null,
36
+ "platform_tools": [
37
+ "PAVE"
38
+ ],
39
+ "flags": null
40
+ },
41
+ "crisis_response": {
42
+ "label": "Crisis Response",
43
+ "definition": "Top-of-funnel intake role for hotline staff. Supports intake and routing workflows with tightly constrained visibility.",
44
+ "display_label": null,
45
+ "platform_tools": [
46
+ "Thread",
47
+ "PAVE"
48
+ ],
49
+ "flags": null
50
+ },
51
+ "healthcare_provider_medical": {
52
+ "label": "Certified Healthcare Provider (Medical)",
53
+ "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.",
54
+ "display_label": "Healthcare Provider",
55
+ "platform_tools": [
56
+ "PAVE"
57
+ ],
58
+ "flags": null
59
+ },
60
+ "intel_analyst": {
61
+ "label": "Intelligence Analyst",
62
+ "definition": "Analyzes intelligence, creates intelligence artifacts, and supports network mapping and risk scoring within CI governance rules.",
63
+ "display_label": null,
64
+ "platform_tools": [
65
+ "LEADS"
66
+ ],
67
+ "flags": null
68
+ },
69
+ "investigator": {
70
+ "label": "Investigator",
71
+ "definition": "Law-enforcement investigator who triages leads, creates/claims investigations, collaborates, and performs deconfliction within policy constraints.",
72
+ "display_label": null,
73
+ "platform_tools": [
74
+ "LEADS"
75
+ ],
76
+ "flags": null
77
+ },
78
+ "le_liaison_vsp": {
79
+ "label": "VSP LE Liaison",
80
+ "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).",
81
+ "display_label": null,
82
+ "platform_tools": [
83
+ "PAVE",
84
+ "Thread"
85
+ ],
86
+ "flags": null
87
+ },
88
+ "legal_advocate": {
89
+ "label": "Legal Advocate",
90
+ "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.",
91
+ "display_label": null,
92
+ "platform_tools": [
93
+ "PAVE"
94
+ ],
95
+ "flags": null
96
+ },
97
+ "mandatory_reporter": {
98
+ "label": "Mandatory Reporter User",
99
+ "definition": "Authenticated external partner who submits mandatory reports/referrals with minimal follow-up visibility. Strictly submit-only.",
100
+ "display_label": null,
101
+ "platform_tools": [
102
+ "Thread",
103
+ "PAVE"
104
+ ],
105
+ "flags": null
106
+ },
107
+ "mdt_participant": {
108
+ "label": "MDT Participant",
109
+ "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.",
110
+ "display_label": null,
111
+ "platform_tools": [
112
+ "PAVE",
113
+ "LEADS",
114
+ "Thread"
115
+ ],
116
+ "flags": null
117
+ },
118
+ "prosecutor_review": {
119
+ "label": "Prosecutorial Reviewer",
120
+ "definition": "Reviews authorized export packages and prosecution-ready materials; updates prosecutorial milestones when permitted. Package-scoped.",
121
+ "display_label": null,
122
+ "platform_tools": [
123
+ "LEADS"
124
+ ],
125
+ "flags": null
126
+ },
127
+ "public_reporter": {
128
+ "label": "Public Reporter",
129
+ "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.",
130
+ "display_label": null,
131
+ "platform_tools": [
132
+ "Thread"
133
+ ],
134
+ "flags": null
135
+ },
136
+ "research_analytics": {
137
+ "label": "Research/Analytics",
138
+ "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.",
139
+ "display_label": null,
140
+ "platform_tools": [
141
+ "Platform",
142
+ "Echo"
143
+ ],
144
+ "flags": [
145
+ "HTI-only"
146
+ ]
147
+ },
148
+ "screener": {
149
+ "label": "Screener (Initial Screen)",
150
+ "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.",
151
+ "display_label": null,
152
+ "platform_tools": [
153
+ "PAVE",
154
+ "Thread"
155
+ ],
156
+ "flags": null
157
+ },
158
+ "volunteer": {
159
+ "label": "Volunteer",
160
+ "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.",
161
+ "display_label": null,
162
+ "platform_tools": [
163
+ "Thread",
164
+ "PAVE"
165
+ ],
166
+ "flags": null
167
+ }
168
+ },
169
+ "legacyCodes": {
170
+ "case_advocate": "case_nav",
171
+ "hotline_op": "crisis_response",
172
+ "leads_investigator": "investigator"
173
+ }
174
+ }
@@ -0,0 +1,103 @@
1
+ {
2
+ "_note": "Every key @htilabs/platform-common-models has ever published for user_roles (CVC-135), with its segment-1 prefix. APPEND-ONLY: a published code never moves or changes meaning. A canon re-key (legacy_codes, old key published) moves the KEY onto the same prefix and is recorded under `renamed`; a canon legacy code this package never published is recorded under `aliases`; a withdrawn code is recorded under `retired` and never reused. Written by scripts/gen-user-roles.py; read by it and by GATE J (src/__tests__/user-roles-canon.test.ts). Do not hand-edit.",
3
+ "prefixes": {
4
+ "case_nav": 1,
5
+ "healthcare_provider_medical": 2,
6
+ "behavioral_health_provider": 3,
7
+ "crisis_response": 4,
8
+ "intel_analyst": 5,
9
+ "investigator": 6,
10
+ "le_liaison_vsp": 7,
11
+ "legal_advocate": 8,
12
+ "mandatory_reporter": 9,
13
+ "mdt_participant": 10,
14
+ "prosecutor_review": 11,
15
+ "public_reporter": 12,
16
+ "research_analytics": 13,
17
+ "screener": 14,
18
+ "volunteer": 15
19
+ },
20
+ "since": {
21
+ "case_nav": "1.0.0",
22
+ "healthcare_provider_medical": "1.0.0",
23
+ "behavioral_health_provider": "1.0.0",
24
+ "crisis_response": "2.0.0",
25
+ "intel_analyst": "1.0.0",
26
+ "investigator": "1.0.0",
27
+ "le_liaison_vsp": "1.0.0",
28
+ "legal_advocate": "1.0.0",
29
+ "mandatory_reporter": "1.0.0",
30
+ "mdt_participant": "1.0.0",
31
+ "prosecutor_review": "1.0.0",
32
+ "public_reporter": "1.0.0",
33
+ "research_analytics": "1.0.0",
34
+ "screener": "1.0.0",
35
+ "volunteer": "1.0.0"
36
+ },
37
+ "renamed": {
38
+ "hotline_op": {
39
+ "to": "crisis_response",
40
+ "prefix": 4,
41
+ "version": "2.0.0"
42
+ }
43
+ },
44
+ "aliases": {
45
+ "case_advocate": {
46
+ "to": "case_nav",
47
+ "canonical": "case_advocate",
48
+ "version": "2.0.0"
49
+ },
50
+ "leads_investigator": {
51
+ "to": "investigator",
52
+ "canonical": "leads_investigator",
53
+ "version": "2.0.0"
54
+ }
55
+ },
56
+ "retired": {
57
+ "missingness_root": {
58
+ "code": "135-000-000-000-000-000-000",
59
+ "successor": null,
60
+ "reason": "missingness (canon G3)",
61
+ "version": "2.0.0"
62
+ },
63
+ "unknown": {
64
+ "code": "135-000-000-000-000-000-001",
65
+ "successor": null,
66
+ "reason": "missingness (canon G3)",
67
+ "version": "2.0.0"
68
+ },
69
+ "anonymous": {
70
+ "code": "135-000-000-000-000-000-002",
71
+ "successor": null,
72
+ "reason": "missingness (canon G3)",
73
+ "version": "2.0.0"
74
+ },
75
+ "data_not_collected": {
76
+ "code": "135-000-000-000-000-000-003",
77
+ "successor": null,
78
+ "reason": "missingness (canon G3)",
79
+ "version": "2.0.0"
80
+ }
81
+ },
82
+ "supersededKeys": [
83
+ "missingness_root",
84
+ "unknown",
85
+ "anonymous",
86
+ "data_not_collected",
87
+ "case_nav",
88
+ "healthcare_provider_medical",
89
+ "behavioral_health_provider",
90
+ "hotline_op",
91
+ "intel_analyst",
92
+ "investigator",
93
+ "le_liaison_vsp",
94
+ "legal_advocate",
95
+ "mandatory_reporter",
96
+ "mdt_participant",
97
+ "prosecutor_review",
98
+ "public_reporter",
99
+ "research_analytics",
100
+ "screener",
101
+ "volunteer"
102
+ ]
103
+ }
@@ -575,8 +575,8 @@
575
575
  "hash": "8f650b786261619b2468eb3982c6146c21fa2ee3b1aa4504aa1084ad82543548"
576
576
  },
577
577
  "core_functions": {
578
- "count": 82,
579
- "hash": "2a9b7ed4af3c984d4818d7eb7a7997d9aa04cd0f74f22a48d80787282316be9c"
578
+ "count": 117,
579
+ "hash": "1f932b9b4900bc3870dee8c64fbd4cb4850ef5cbbcebaff4b330936e494f17c5"
580
580
  },
581
581
  "needs_assessment_change_type": {
582
582
  "count": 13,
@@ -607,12 +607,12 @@
607
607
  "hash": "fc28328eb2b77e69c2a0d3a64add6de290687376506b053363756564d510448d"
608
608
  },
609
609
  "admin_roles": {
610
- "count": 14,
611
- "hash": "100b1ca9c69052c211bd591a75454c7a371da3825baa8a624579cf18f3ffb0b7"
610
+ "count": 10,
611
+ "hash": "f3000985fe507e64491dacb7a25fdfa7045843ace63e01c0b7a4e74e1629ab72"
612
612
  },
613
613
  "user_roles": {
614
- "count": 19,
615
- "hash": "978bc51bcff26af6ca265df119f368a790d31d3662bc947d01bb7fec3e39d4b3"
614
+ "count": 15,
615
+ "hash": "ee89f996112d450e5b766b582b7279b8860db62a6278b54e44f351748ed2194d"
616
616
  },
617
617
  "hmis_current_living_situation": {
618
618
  "count": 33,