@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,297 @@
1
+ /**
2
+ * @htilabs/platform-common-models — Organization program rows (`organizations.programs[]`)
3
+ *
4
+ * The ONE definition of the embedded program sub-document on the platform-db
5
+ * `organizations` collection, which both apps read and PAVE 2.0 writes.
6
+ *
7
+ * ## This is a FRAGMENT, not an Organization model
8
+ *
9
+ * No canonical Organization schema exists in this package (same posture as
10
+ * `schemas/team.ts` and `schemas/agency.ts`). `organizations` is written by
11
+ * PAVE 2.0 (`packages/db/src/models/organization.ts`) and read by Thread
12
+ * (`packages/db/src/models/platform/Organization.ts`, `select: false` on
13
+ * `programs`, read with `+programs`). Until this module, each app carried its
14
+ * own copy of the sub-schema — identical by hand. This module declares the
15
+ * program row ONCE; each consumer mounts it with
16
+ * {@link addOrganizationProgramsField} or builds the sub-schema with
17
+ * {@link buildOrganizationProgramSchema}.
18
+ *
19
+ * ## Canon
20
+ *
21
+ * - **UDD Program Data Object** (hti-features `udd-schemas/program/Program.v1.json`;
22
+ * profile confirmed by Crysta 2026-10-05): a Program (program / department /
23
+ * operational division / law-enforcement unit) is a fact about an
24
+ * ORGANIZATION — `org_id` is the owner. Its arrival is stored: `added_by`,
25
+ * `added_in_app`, `review_status`.
26
+ * - **PROGRAM-APP-ADDED** (prototype 2026-10-06; Crysta 2026-10-02: users
27
+ * "need to be able to capture org names and program names that may not be
28
+ * in existing list"): a program named inside an app is the organization's
29
+ * program from the moment it is typed, and waits for HTI Labs' review like a
30
+ * new organization does (GDR § 5.12 / § 5.16 rule 1). The steward's review
31
+ * queue in the HTI Platform confirms or rejects it; a confirmed row's "new"
32
+ * mark clears.
33
+ * - **ADR D13** (PAVE Greenfield): `SharingSettings` keys on
34
+ * `(organizationId, programId?)` — the program id is the join key an
35
+ * agency may share to.
36
+ *
37
+ * ## Field names
38
+ *
39
+ * Canon's program sheet spells these `program_id`, `label`, `review_status`,
40
+ * `added_by`, `added_in_app` (snake_case CSV columns). The live platform-db
41
+ * writers use camelCase (`programId`, `name`, `defaultSharingPolicy` are what
42
+ * PAVE 2.0 and Thread already store), so the arrival fields follow that
43
+ * convention: `reviewStatus`, `addedBy`, `addedInApp`, `addedInSession`.
44
+ *
45
+ * `addedInApp` is where the program was NAMED, not the program's own app
46
+ * (which app it operates in stays blank until the Admin Hub says).
47
+ *
48
+ * `addedInSession` is NOT on the UDD Program sheet (`Program.v1.json` carries
49
+ * `review_status · added_by · added_in_app` only). It is carried on the same
50
+ * precedent as the Org object's `added_in_session` (as-built OrgEntry overlay;
51
+ * RULED 2026-08-27 a migration note that retires into the `dataSource`
52
+ * provenance envelope at the cut-over) so a picker can tell "named in THIS
53
+ * session" from "awaiting review" across a reload. It retires with that trio.
54
+ *
55
+ * The sub-schema is STRICT (Mongoose default): a key outside the definition
56
+ * — including the sheet's snake_case spellings (`review_status`,
57
+ * `added_by`) — is dropped silently on cast, not rejected. Write camelCase.
58
+ *
59
+ * ## Who dedupes
60
+ *
61
+ * `programId` uniqueness and name-matching on add are the WRITER's job; the
62
+ * fragment enforces neither (two rows with one id validate and `$push`).
63
+ * PAVE 2.0's `POST /organizations/:id/programs` dedupes a typed name against
64
+ * the live rows (trimmed, case-insensitive) and mints `programId` server-side.
65
+ *
66
+ * ## Missingness
67
+ *
68
+ * `reviewStatus` is ABSENT (or null) on a steward row — nothing to review.
69
+ * There is no UNK / ANON / DNC here: the status is a lifecycle, not an
70
+ * answer anyone gives.
71
+ */
72
+
73
+ import { Schema } from "mongoose";
74
+ import type { InferRawDocType, Query } from "mongoose";
75
+
76
+ import { applyRunValidatorsIfUnset } from "./agency.js";
77
+
78
+ // ─── Review status ──────────────────────────────────────────────────
79
+
80
+ /**
81
+ * Review lifecycle of a program named inside an app (UDD Program
82
+ * `review_status`). The sheet's own words — a lane's `pending_steward` /
83
+ * `declined` never reach the stored row.
84
+ */
85
+ export const PROGRAM_REVIEW_STATUS = {
86
+ PENDING: "pending",
87
+ CONFIRMED: "confirmed",
88
+ REJECTED: "rejected",
89
+ } as const;
90
+
91
+ export type ProgramReviewStatus =
92
+ (typeof PROGRAM_REVIEW_STATUS)[keyof typeof PROGRAM_REVIEW_STATUS];
93
+
94
+ /** The three values, for `enum:` declarations and Zod `z.enum`. */
95
+ export const PROGRAM_REVIEW_STATUS_VALUES = Object.freeze([
96
+ PROGRAM_REVIEW_STATUS.PENDING,
97
+ PROGRAM_REVIEW_STATUS.CONFIRMED,
98
+ PROGRAM_REVIEW_STATUS.REJECTED,
99
+ ] as const);
100
+
101
+ export function isProgramReviewStatus(
102
+ value: unknown,
103
+ ): value is ProgramReviewStatus {
104
+ return (
105
+ typeof value === "string" &&
106
+ (PROGRAM_REVIEW_STATUS_VALUES as readonly string[]).includes(value)
107
+ );
108
+ }
109
+
110
+ // ─── Schema Definition ──────────────────────────────────────────────
111
+
112
+ /**
113
+ * One embedded Organization > Program row. `programId` + `name` are the
114
+ * load-bearing identity/label; everything else is optional and additive.
115
+ *
116
+ * `status` and `defaultSharingPolicy` are typed string codes (as PAVE 2.0 and
117
+ * Thread already store them — the CVC bind is a follow-up on the codebook,
118
+ * not this fragment).
119
+ */
120
+ export const organizationProgramSchemaDefinition = {
121
+ /** Stable identifier for the program within its Organization (server-minted). */
122
+ programId: { type: String, required: true },
123
+ /** Human-facing program name (canon `label`). */
124
+ name: { type: String, required: true },
125
+ /** Free-text program description. */
126
+ description: { type: String, required: false },
127
+ /** Lifecycle code; a `retired` program is not offered to pickers. */
128
+ status: { type: String, required: false },
129
+ /** Default sharing-policy code applied when sharing to this program (ADR D13). */
130
+ defaultSharingPolicy: { type: String, required: false },
131
+ /**
132
+ * pending · confirmed · rejected for a program named inside an app; absent on
133
+ * a steward row. A `rejected` row is never offered and never captures its
134
+ * name on a later add (a new row is minted).
135
+ */
136
+ reviewStatus: {
137
+ type: String,
138
+ required: false,
139
+ enum: [...PROGRAM_REVIEW_STATUS_VALUES],
140
+ },
141
+ /** The seat (user id) that named it inside an app. */
142
+ addedBy: { type: String, required: false },
143
+ /** The app it was NAMED in (`pave` · `thread` · `leads` · `platform`). */
144
+ addedInApp: { type: String, required: false },
145
+ /** The session it was named in, when there was one. */
146
+ addedInSession: { type: String, required: false },
147
+ } as const;
148
+
149
+ /**
150
+ * Build the program sub-schema. `{ _id: false }` — a program is identified by
151
+ * its own `programId`, not a Mongoose ObjectId (as both apps already do).
152
+ */
153
+ export function buildOrganizationProgramSchema(): Schema {
154
+ return new Schema(organizationProgramSchemaDefinition, { _id: false });
155
+ }
156
+
157
+ /**
158
+ * Build the `programs` field to add to an organization schema — a FRESH
159
+ * sub-schema per call. Mongoose does not clone a `Schema` instance on
160
+ * `schema.add()` or embedding, so a module-level instance would be shared by
161
+ * every consumer: a pre-hook, virtual or index one consumer put on its rows
162
+ * would run on, or be created for, every other consumer's documents (review
163
+ * finding, 2026-10-12). Each mount gets its own instance.
164
+ *
165
+ * `default: undefined` (NOT Mongoose's implicit `[]` for array paths): an
166
+ * organization without programs persists nothing and round-trips as absent,
167
+ * which keeps "none declared" distinct from "declared empty" and leaves every
168
+ * existing document's shape untouched.
169
+ */
170
+ export function buildOrganizationProgramsFieldDefinition(): {
171
+ programs: {
172
+ type: Schema[];
173
+ required: false;
174
+ default: undefined;
175
+ };
176
+ } {
177
+ return {
178
+ programs: {
179
+ type: [buildOrganizationProgramSchema()],
180
+ required: false,
181
+ default: undefined,
182
+ },
183
+ };
184
+ }
185
+
186
+ // ─── Schema Helper ──────────────────────────────────────────────────
187
+
188
+ /**
189
+ * Update operations on which the row validators (enum, `required`) are
190
+ * enforced by {@link addOrganizationProgramsField}. Mongoose skips validators
191
+ * on update operations by default, and `$push` of a program row is the write
192
+ * path this fragment exists for (PAVE's `POST /organizations/:id/programs`).
193
+ */
194
+ export const ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS = Object.freeze([
195
+ "updateOne",
196
+ "updateMany",
197
+ "findOneAndUpdate",
198
+ ] as const);
199
+
200
+ export interface AddOrganizationProgramsFieldOptions {
201
+ /** The path's `select` option; `false` is Thread's read posture. Omitted → Mongoose default. */
202
+ select?: boolean;
203
+ /**
204
+ * Install a `pre` hook on {@link ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS}
205
+ * that turns `runValidators` on unless the caller set it, so a `$push` of a
206
+ * row with a review status outside the vocabulary, or with no `programId`,
207
+ * is refused on the update paths exactly as on `save()` (the `agency.ts`
208
+ * precedent). Default `true`.
209
+ *
210
+ * SCHEMA-WIDE on these ops, not just `programs`: once mounted, every
211
+ * `updateOne` / `updateMany` / `findOneAndUpdate` on the consumer's schema
212
+ * runs validators for EVERY path it touches, unless the caller passes
213
+ * `runValidators` explicitly. A consumer that relied on Mongoose's default of
214
+ * skipping validators on updates for its other fields will see new
215
+ * rejections after mounting this. Pass `{ validateOnUpdate: false }` to opt
216
+ * out, or set `runValidators: false` on an individual query.
217
+ */
218
+ validateOnUpdate?: boolean;
219
+ }
220
+
221
+ /**
222
+ * Add the `programs[]` field to an existing organization schema.
223
+ *
224
+ * Adds no indexes. Installs the update-path validation hook described on
225
+ * {@link AddOrganizationProgramsFieldOptions} unless opted out. A consumer
226
+ * that wants `select: false` on the field (Thread) passes `{ select: false }`.
227
+ *
228
+ * REPLACES a `programs` path the consumer already declares (`schema.add`
229
+ * overwrites the path wholesale — the consumer's own sub-fields and its own
230
+ * `select` option do not survive). That is the point of ONE definition: a
231
+ * consumer removes its local `programs` declaration and passes its read
232
+ * posture here instead. A `console.warn` names the overwrite so a consumer
233
+ * that forgot does not lose `select: false` silently.
234
+ *
235
+ * @param schema - The consumer's organization schema
236
+ * @returns The same schema, for chaining
237
+ */
238
+ export function addOrganizationProgramsField<S extends Schema>(
239
+ schema: S,
240
+ options: AddOrganizationProgramsFieldOptions = {},
241
+ ): S {
242
+ if (schema.path("programs")) {
243
+ console.warn(
244
+ "[platform-common-models] addOrganizationProgramsField: replacing the " +
245
+ "schema's own `programs` path with the shared fragment; pass " +
246
+ "`{ select: false }` here if that is the consumer's read posture.",
247
+ );
248
+ }
249
+ schema.add({
250
+ programs: {
251
+ ...buildOrganizationProgramsFieldDefinition().programs,
252
+ ...(options.select !== undefined ? { select: options.select } : {}),
253
+ },
254
+ });
255
+ if (options.validateOnUpdate ?? true) {
256
+ schema.pre(
257
+ [...ORGANIZATION_PROGRAM_VALIDATED_UPDATE_OPS],
258
+ function (this: Query<unknown, unknown>) {
259
+ applyRunValidatorsIfUnset(this);
260
+ },
261
+ );
262
+ }
263
+ return schema;
264
+ }
265
+
266
+ // ─── Live-row rule ──────────────────────────────────────────────────
267
+
268
+ /**
269
+ * Whether a program row may be OFFERED (and matched by name on an add).
270
+ * A retired or rejected program is not a place anyone can be enrolled today,
271
+ * so pickers do not list it and typing its name mints a new row rather than
272
+ * binding to it (the prototype's independent pre-review catch, 2026-10-06).
273
+ */
274
+ export function isLiveOrganizationProgram(row: {
275
+ status?: string | null | undefined;
276
+ reviewStatus?: string | null | undefined;
277
+ }): boolean {
278
+ return (
279
+ row.status !== "retired" &&
280
+ row.reviewStatus !== PROGRAM_REVIEW_STATUS.REJECTED
281
+ );
282
+ }
283
+
284
+ // ─── Type Inference ─────────────────────────────────────────────────
285
+
286
+ /**
287
+ * Raw (persistence) shape of one program row, inferred from the DEFINITION.
288
+ *
289
+ * `programId` + `name` are required; every other field is optional (and may
290
+ * be `null`); `reviewStatus` is the three-word union. `{ _id: false }` matches
291
+ * the sub-schema, so the type carries no `_id` (the definition is `as const`
292
+ * so `required: false` stays a literal and is honoured by the inference).
293
+ */
294
+ export type OrganizationProgram = InferRawDocType<
295
+ typeof organizationProgramSchemaDefinition,
296
+ { _id: false; typeKey: "type" }
297
+ >;
@@ -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
- }
@@ -1,203 +0,0 @@
1
- {
2
- "domain": "user_roles",
3
- "name": "Core User Roles (CVC-135)",
4
- "version": "1.0.0",
5
- "_status": "CANONICAL — imported 0.8.13 from the Notion Final CVC codebook (CVC-135 `core - user roles`, Owner Crysta Price, Status 'Drafted - Needs Review'). Operational / practitioner role vocabulary for the canonical authorization model (IC-66). DISTINCT from CVC-134 `admin_roles` (the administrative role axis) — a person may hold both. Canonical codes are already snake_case and are carried verbatim in `canonicalCode`. 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 - user roles (CVC-135)",
7
- "levels": {
8
- "0": "Unknown or Missing",
9
- "1": "User role"
10
- },
11
- "entries": [
12
- {
13
- "code": "135-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
- "135-000-000-000-000-000-001",
20
- "135-000-000-000-000-000-002",
21
- "135-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": "135-000-000-000-000-000-001",
27
- "key": "unknown",
28
- "title": "Unknown",
29
- "selectable": true,
30
- "parentCode": "135-000-000-000-000-000-000",
31
- "childCodes": [],
32
- "definition": "Unknown or cannot be determined from the available information."
33
- },
34
- {
35
- "code": "135-000-000-000-000-000-002",
36
- "key": "anonymous",
37
- "title": "Anonymous / declined to answer",
38
- "selectable": true,
39
- "parentCode": "135-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": "135-000-000-000-000-000-003",
45
- "key": "data_not_collected",
46
- "title": "Data not collected",
47
- "selectable": true,
48
- "parentCode": "135-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": "135-001-000-000-000-000-000",
54
- "key": "case_nav",
55
- "title": "Case Advocate (Navigator / Service Coordinator)",
56
- "selectable": true,
57
- "parentCode": null,
58
- "childCodes": [],
59
- "definition": "Provides ongoing service coordination, referrals, and case documentation within survivor-services workflows.",
60
- "canonicalCode": "case_nav"
61
- },
62
- {
63
- "code": "135-002-000-000-000-000-000",
64
- "key": "healthcare_provider_medical",
65
- "title": "Certified Healthcare Provider (Medical)",
66
- "selectable": true,
67
- "parentCode": null,
68
- "childCodes": [],
69
- "definition": "Provides medical evaluation and treatment and may document clinical observations that support identification and care coordination, within MDT and sector constraints.",
70
- "canonicalCode": "healthcare_provider_medical"
71
- },
72
- {
73
- "code": "135-003-000-000-000-000-000",
74
- "key": "behavioral_health_provider",
75
- "title": "Certified Mental/Behavioral Health Provider (Therapy / Counseling)",
76
- "selectable": true,
77
- "parentCode": null,
78
- "childCodes": [],
79
- "definition": "Provides mental and behavioral healthcare services and documents therapeutic progress as part of the survivor’s care plan.",
80
- "canonicalCode": "behavioral_health_provider"
81
- },
82
- {
83
- "code": "135-004-000-000-000-000-000",
84
- "key": "hotline_op",
85
- "title": "Crisis Response Staff",
86
- "selectable": true,
87
- "parentCode": null,
88
- "childCodes": [],
89
- "definition": "Top-of-funnel intake role for hotline staff/volunteers. Supports intake and routing workflows with tightly constrained visibility.",
90
- "canonicalCode": "hotline_op"
91
- },
92
- {
93
- "code": "135-005-000-000-000-000-000",
94
- "key": "intel_analyst",
95
- "title": "Intelligence Analyst",
96
- "selectable": true,
97
- "parentCode": null,
98
- "childCodes": [],
99
- "definition": "Analyzes intelligence, creates intelligence artifacts, and supports network mapping and risk scoring within CI governance rules.",
100
- "canonicalCode": "intel_analyst"
101
- },
102
- {
103
- "code": "135-006-000-000-000-000-000",
104
- "key": "investigator",
105
- "title": "Investigator",
106
- "selectable": true,
107
- "parentCode": null,
108
- "childCodes": [],
109
- "definition": "Law enforcement investigator who triages leads, creates/claims investigations, collaborates, and performs deconfliction within policy constraints.",
110
- "canonicalCode": "investigator"
111
- },
112
- {
113
- "code": "135-007-000-000-000-000-000",
114
- "key": "le_liaison_vsp",
115
- "title": "LE Liaison (VSP-side Coordination)",
116
- "selectable": true,
117
- "parentCode": null,
118
- "childCodes": [],
119
- "definition": "VSP-side liaison who coordinates communication with law enforcement only under survivor consent, statutory mandate, or documented legal exception.",
120
- "canonicalCode": "le_liaison_vsp"
121
- },
122
- {
123
- "code": "135-008-000-000-000-000-000",
124
- "key": "legal_advocate",
125
- "title": "Legal Advocate (Survivor-facing Legal Services)",
126
- "selectable": true,
127
- "parentCode": null,
128
- "childCodes": [],
129
- "definition": "Provides civil, criminal, and/or immigration legal support and documents legal strategy and case-related filings (not a prosecutor role).",
130
- "canonicalCode": "legal_advocate"
131
- },
132
- {
133
- "code": "135-009-000-000-000-000-000",
134
- "key": "mandatory_reporter",
135
- "title": "Mandatory Reporter User",
136
- "selectable": true,
137
- "parentCode": null,
138
- "childCodes": [],
139
- "definition": "Authenticated external partner who submits mandatory reports/referrals with minimal follow-up visibility.",
140
- "canonicalCode": "mandatory_reporter"
141
- },
142
- {
143
- "code": "135-010-000-000-000-000-000",
144
- "key": "mdt_participant",
145
- "title": "MDT Participant",
146
- "selectable": true,
147
- "parentCode": null,
148
- "childCodes": [],
149
- "definition": "Cross-sector collaboration participant who can coordinate on a defined case context without broad case browsing.",
150
- "canonicalCode": "mdt_participant"
151
- },
152
- {
153
- "code": "135-011-000-000-000-000-000",
154
- "key": "prosecutor_review",
155
- "title": "Prosecutorial Reviewer",
156
- "selectable": true,
157
- "parentCode": null,
158
- "childCodes": [],
159
- "definition": "Reviews authorized export packages and prosecution-ready materials; updates prosecutorial milestones when permitted.",
160
- "canonicalCode": "prosecutor_review"
161
- },
162
- {
163
- "code": "135-012-000-000-000-000-000",
164
- "key": "public_reporter",
165
- "title": "Public Reporter",
166
- "selectable": true,
167
- "parentCode": null,
168
- "childCodes": [],
169
- "definition": "Uncredentialed public reporter who submits a tip/referral with minimal follow-up visibility.",
170
- "canonicalCode": "public_reporter"
171
- },
172
- {
173
- "code": "135-013-000-000-000-000-000",
174
- "key": "research_analytics",
175
- "title": "Research / Analytics User",
176
- "selectable": true,
177
- "parentCode": null,
178
- "childCodes": [],
179
- "definition": "Uses de-identified datasets and approved aggregate views for analytics and reporting.",
180
- "canonicalCode": "research_analytics"
181
- },
182
- {
183
- "code": "135-014-000-000-000-000-000",
184
- "key": "screener",
185
- "title": "Screener (Initial Screen)",
186
- "selectable": true,
187
- "parentCode": null,
188
- "childCodes": [],
189
- "definition": "Performs intake and initial screening and records indicators/risk flags. Does not perform formal determinations unless also occupying a certified role.",
190
- "canonicalCode": "screener"
191
- },
192
- {
193
- "code": "135-015-000-000-000-000-000",
194
- "key": "volunteer",
195
- "title": "Volunteer",
196
- "selectable": true,
197
- "parentCode": null,
198
- "childCodes": [],
199
- "definition": "Volunteer performing hotline/intake support work (often 24/7 coverage) under supervision. Participates in the intake workflow with tightly constrained visibility and no downstream casework authority.",
200
- "canonicalCode": "volunteer"
201
- }
202
- ]
203
- }