@htilabs/platform-common-models 0.8.7 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +44 -0
  2. package/dist/config/index.cjs +191 -0
  3. package/dist/config/index.cjs.map +1 -0
  4. package/dist/config/index.d.cts +101 -0
  5. package/dist/config/index.d.ts +101 -0
  6. package/dist/config/index.js +165 -0
  7. package/dist/config/index.js.map +1 -0
  8. package/dist/constants/index.cjs +5 -28
  9. package/dist/constants/index.cjs.map +1 -1
  10. package/dist/constants/index.d.cts +1 -1
  11. package/dist/constants/index.d.ts +1 -1
  12. package/dist/constants/index.js +5 -27
  13. package/dist/constants/index.js.map +1 -1
  14. package/dist/{cvcEntry-DaDrEuTa.d.cts → cvcEntry-0BIB9sen.d.cts} +44 -44
  15. package/dist/{cvcEntry-DaDrEuTa.d.ts → cvcEntry-0BIB9sen.d.ts} +44 -44
  16. package/dist/cvcs/index.cjs +3 -1321
  17. package/dist/cvcs/index.cjs.map +1 -1
  18. package/dist/cvcs/index.d.cts +1195 -2649
  19. package/dist/cvcs/index.d.ts +1195 -2649
  20. package/dist/cvcs/index.js +3 -1313
  21. package/dist/cvcs/index.js.map +1 -1
  22. package/dist/{index-C0J3f169.d.ts → index-CDoqrfc1.d.ts} +1 -1
  23. package/dist/{index-EPjPjR0z.d.cts → index-Zu_mOJRn.d.cts} +1 -1
  24. package/dist/index.cjs +121 -1550
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +48 -401
  27. package/dist/index.d.ts +48 -401
  28. package/dist/index.js +120 -1526
  29. package/dist/index.js.map +1 -1
  30. package/dist/models/index.d.cts +2 -2
  31. package/dist/models/index.d.ts +2 -2
  32. package/dist/{platform-auth-BdnJUisw.d.cts → platform-auth-XVB9aHqR.d.cts} +3 -16
  33. package/dist/{platform-auth-BdnJUisw.d.ts → platform-auth-XVB9aHqR.d.ts} +3 -16
  34. package/dist/schemas/index.cjs +9 -26
  35. package/dist/schemas/index.cjs.map +1 -1
  36. package/dist/schemas/index.d.cts +39 -35
  37. package/dist/schemas/index.d.ts +39 -35
  38. package/dist/schemas/index.js +9 -26
  39. package/dist/schemas/index.js.map +1 -1
  40. package/dist/types/index.d.cts +2 -2
  41. package/dist/types/index.d.ts +2 -2
  42. package/package.json +25 -19
  43. package/src/__tests__/__snapshots__/cvc-sot.snap +12 -76
  44. package/src/__tests__/cvc-sot-snapshot.test.ts +10 -61
  45. package/src/__tests__/cvc-structural.test.ts +0 -9
  46. package/src/__tests__/runtime-contract-validator.test.ts +556 -0
  47. package/src/config/fixtures/valid.yaml +90 -0
  48. package/src/config/index.ts +352 -0
  49. package/src/constants/ic.ts +3 -31
  50. package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +0 -9
  51. package/src/cvcs/hmisSex.v1.0.0.json +89 -0
  52. package/src/cvcs/identificationStatus.v1.0.0.json +0 -18
  53. package/src/cvcs/incomeBenefitsSources.v1.0.0.json +2 -31
  54. package/src/cvcs/index.ts +0 -16
  55. package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +96 -0
  56. package/src/cvcs/recencyBand.v1.0.0.json +57 -38
  57. package/src/cvcs/serviceStates.v1.0.0.json +1 -23
  58. package/src/cvcs/sourceSubtype.v1.1.0.json +0 -36
  59. package/src/cvcs/verificationMethod.v1.0.0.json +0 -18
  60. package/src/generated/cvc-enums.ts +6 -429
  61. package/src/index.ts +20 -0
  62. package/src/schemas/common.ts +4 -0
  63. package/src/cvcs/activityType.v1.0.0.json +0 -143
  64. package/src/cvcs/assertionDomain.v1.0.0.json +0 -629
  65. package/src/cvcs/contactLinkType.v1.0.0.json +0 -89
  66. package/src/cvcs/hmisRelationshipToHoh.v1.0.0.json +0 -104
  67. package/src/cvcs/housingSubsidyTypes.v1.0.0.json +0 -159
  68. package/src/cvcs/htType.v1.0.0.json +0 -87
  69. package/src/cvcs/livingSituation.v1.0.0.json +0 -213
  70. package/src/cvcs/provenanceSourceId.v1.0.0.json +0 -134
  71. package/src/cvcs/radiusBucket.v1.0.0.json +0 -98
  72. package/src/cvcs/relationshipConcern.v1.0.0.json +0 -114
  73. package/src/cvcs/roiMethod.v1.0.0.json +0 -107
  74. package/src/cvcs/serviceAudience.v1.0.0.json +0 -96
  75. package/src/cvcs/sessionNoteVisibility.v1.0.0.json +0 -80
  76. package/src/cvcs/suggestionSource.v1.0.0.json +0 -71
  77. package/src/cvcs/victimAbuseTypes.v1.0.0.json +0 -276
@@ -0,0 +1,352 @@
1
+ /**
2
+ * @htilabs/platform-common-models — Runtime Config Contract Validator
3
+ *
4
+ * Implements contract R12.1 (platform-common home):
5
+ * - validateAgainstContract(runtimeYamlPath, opts?) — startup validator (R3.2)
6
+ * - createConfigEndpoint(runtimeYamlPath, opts?) — /api/config factory (R7)
7
+ *
8
+ * Consumers MUST call validateAgainstContract once at process startup, before
9
+ * any other initialization that reads env vars. Build-phase variables
10
+ * (phase: build) are NOT checked at runtime per R3.4.
11
+ *
12
+ * No secret VALUES are read, stored, or returned here. Secret env vars are
13
+ * validated for presence but their values are never logged or exposed.
14
+ *
15
+ * Dual ESM + CJS via tsup. Plain JS consumers (pave, leads) use require():
16
+ * const { validateAgainstContract } = require('@htilabs/platform-common-models/config');
17
+ */
18
+
19
+ import { readFileSync } from "node:fs";
20
+ import { parse } from "yaml";
21
+
22
+ // ─── Schema types (mirrors thread's runtime-config-lib.ts VariableSpec) ──────
23
+
24
+ export interface VariableSpec {
25
+ type: "string" | "boolean" | "number" | "enum" | "url" | "json";
26
+ required: boolean;
27
+ secret: boolean;
28
+ description: string;
29
+ phase?: "runtime" | "build";
30
+ values?: string[];
31
+ default?: Record<string, unknown>;
32
+ provider?: string;
33
+ name?: string;
34
+ client_visible?: boolean;
35
+ deprecated?: { since: string; remove_after?: string; replacement?: string };
36
+ }
37
+
38
+ export interface ServiceContract {
39
+ service: string;
40
+ version: number;
41
+ environments: string[];
42
+ // Thread extensions (tolerated, not required — R1.1 note)
43
+ port?: number;
44
+ build_secrets?: string[];
45
+ variables: Record<string, VariableSpec>;
46
+ }
47
+
48
+ /** Typed config accessor returned by validateAgainstContract. */
49
+ export type TypedConfig = Record<string, string | boolean | number | unknown>;
50
+
51
+ export interface ValidateOptions {
52
+ /**
53
+ * Environment name used to select per-env defaults (e.g. "local", "test").
54
+ * Defaults to process.env.NODE_ENV, then "local".
55
+ */
56
+ env?: string;
57
+ /**
58
+ * If true, do not call process.exit(1) on failure; throw instead.
59
+ * Useful for tests. Defaults to false (production mode exits).
60
+ */
61
+ throwOnFailure?: boolean;
62
+ }
63
+
64
+ export interface EndpointOptions {
65
+ /** Cache-Control header value. Defaults to "private, no-store". */
66
+ cacheControl?: string;
67
+ }
68
+
69
+ /**
70
+ * A framework-agnostic route handler that returns a JSON response.
71
+ * Compatible with:
72
+ * - Next.js App Router: export const GET = createConfigEndpoint(...)
73
+ * - Fastify: instance.get('/api/config', createConfigEndpoint(...))
74
+ * - Express: app.get('/api/config', createConfigEndpoint(...))
75
+ */
76
+ export type RouteHandler = (
77
+ req?: unknown,
78
+ res?: unknown,
79
+ ) => Promise<Response | void> | Response | void;
80
+
81
+ // ─── YAML parser ──────────────────────────────────────────────────────────────
82
+
83
+ function loadContract(runtimeYamlPath: string): ServiceContract {
84
+ let raw: string;
85
+ try {
86
+ raw = readFileSync(runtimeYamlPath, "utf8");
87
+ } catch (err) {
88
+ const msg =
89
+ err instanceof Error ? err.message : String(err);
90
+ throw new Error(
91
+ `[platform-common/config] Cannot read ${runtimeYamlPath}: ${msg}`,
92
+ );
93
+ }
94
+ const parsed = parse(raw) as ServiceContract | null;
95
+ if (!parsed || typeof parsed !== "object") {
96
+ throw new Error(
97
+ `[platform-common/config] ${runtimeYamlPath}: not a YAML mapping`,
98
+ );
99
+ }
100
+ if (parsed.version !== 1) {
101
+ throw new Error(
102
+ `[platform-common/config] ${runtimeYamlPath}: unsupported contract version ${parsed.version} (expected 1)`,
103
+ );
104
+ }
105
+ if (!parsed.variables || typeof parsed.variables !== "object") {
106
+ throw new Error(
107
+ `[platform-common/config] ${runtimeYamlPath}: missing "variables" map`,
108
+ );
109
+ }
110
+ return parsed;
111
+ }
112
+
113
+ // ─── Coercion ────────────────────────────────────────────────────────────────
114
+
115
+ /**
116
+ * Coerce a raw environment string value to the declared type.
117
+ * Returns [ok, coerced] or [false, errorMessage].
118
+ */
119
+ function coerce(
120
+ key: string,
121
+ raw: string,
122
+ spec: VariableSpec,
123
+ ): [true, unknown] | [false, string] {
124
+ switch (spec.type) {
125
+ case "boolean": {
126
+ if (raw === "true" || raw === "1") return [true, true];
127
+ if (raw === "false" || raw === "0") return [true, false];
128
+ return [false, `${key}: expected boolean ("true"/"false"/"1"/"0"), got "${raw}"`];
129
+ }
130
+ case "number": {
131
+ const n = Number(raw);
132
+ if (!Number.isFinite(n)) {
133
+ return [false, `${key}: expected number, got "${raw}"`];
134
+ }
135
+ return [true, n];
136
+ }
137
+ case "enum": {
138
+ const vals = spec.values ?? [];
139
+ if (!vals.includes(raw)) {
140
+ return [false, `${key}: expected one of [${vals.join(", ")}], got "${raw}"`];
141
+ }
142
+ return [true, raw];
143
+ }
144
+ case "url": {
145
+ try {
146
+ new URL(raw);
147
+ return [true, raw];
148
+ } catch {
149
+ return [false, `${key}: expected a valid URL, got "${raw}"`];
150
+ }
151
+ }
152
+ case "json": {
153
+ try {
154
+ const parsed = JSON.parse(raw) as unknown;
155
+ return [true, parsed];
156
+ } catch {
157
+ return [false, `${key}: expected valid JSON, got "${raw}"`];
158
+ }
159
+ }
160
+ default:
161
+ // string
162
+ return [true, raw];
163
+ }
164
+ }
165
+
166
+ // ─── Default application ─────────────────────────────────────────────────────
167
+
168
+ /**
169
+ * Returns the default value for a variable in the given environment,
170
+ * or undefined if no default applies.
171
+ *
172
+ * Exact env match only — defaults are per-environment and MUST NOT bleed
173
+ * across envs. (A local default stays local; it does not fall back into prod.)
174
+ */
175
+ function resolveDefault(
176
+ spec: VariableSpec,
177
+ env: string,
178
+ ): string | undefined {
179
+ if (!spec.default) return undefined;
180
+ const v = spec.default[env];
181
+ if (v === undefined) return undefined;
182
+ return String(v);
183
+ }
184
+
185
+ // ─── validateAgainstContract ─────────────────────────────────────────────────
186
+
187
+ /**
188
+ * Parse `runtimeYamlPath`, coerce every runtime-phase variable from
189
+ * `process.env` (with per-env defaults applied), and fail fast on any
190
+ * missing or invalid required variable (R3.2).
191
+ *
192
+ * Build-phase variables (phase: build) are skipped per R3.4.
193
+ *
194
+ * Returns a typed config object keyed by variable name.
195
+ */
196
+ export function validateAgainstContract(
197
+ runtimeYamlPath: string,
198
+ opts: ValidateOptions = {},
199
+ ): TypedConfig {
200
+ const contract = loadContract(runtimeYamlPath);
201
+ const env =
202
+ opts.env ??
203
+ (process.env.NODE_ENV as string | undefined) ??
204
+ "local";
205
+
206
+ const errors: string[] = [];
207
+ const result: TypedConfig = {};
208
+
209
+ for (const [key, spec] of Object.entries(contract.variables)) {
210
+ // R3.4: skip build-phase variables entirely at runtime.
211
+ if (spec.phase === "build") continue;
212
+
213
+ const rawFromEnv = process.env[key];
214
+ const defaultValue = resolveDefault(spec, env);
215
+ const effective = rawFromEnv ?? defaultValue;
216
+
217
+ if (effective === undefined || effective === "") {
218
+ if (spec.required) {
219
+ errors.push(
220
+ `${key}: required but not set (no value in process.env and no default for env "${env}")`,
221
+ );
222
+ }
223
+ // Not required and not set — omit from result.
224
+ continue;
225
+ }
226
+
227
+ const [ok, coerced] = coerce(key, effective, spec);
228
+ if (!ok) {
229
+ errors.push(coerced as string);
230
+ continue;
231
+ }
232
+ result[key] = coerced;
233
+ }
234
+
235
+ if (errors.length > 0) {
236
+ const message = [
237
+ `[platform-common/config] validateAgainstContract failed for ${runtimeYamlPath}`,
238
+ `${errors.length} variable(s) missing or invalid:`,
239
+ ...errors.map((e) => ` - ${e}`),
240
+ ].join("\n");
241
+
242
+ if (opts.throwOnFailure) {
243
+ throw new Error(message);
244
+ }
245
+ console.error(message);
246
+ process.exit(1);
247
+ }
248
+
249
+ return result;
250
+ }
251
+
252
+ // ─── createConfigEndpoint ────────────────────────────────────────────────────
253
+
254
+ /**
255
+ * Build a static JSON payload containing only variables that are
256
+ * client_visible: true AND secret: false (R7.2, R7.3). Reads process.env
257
+ * once at factory call time.
258
+ */
259
+ function buildClientPayload(
260
+ contract: ServiceContract,
261
+ env: string,
262
+ ): Record<string, unknown> {
263
+ const payload: Record<string, unknown> = {};
264
+
265
+ for (const [key, spec] of Object.entries(contract.variables)) {
266
+ // R7.3: never expose secrets.
267
+ if (spec.secret) continue;
268
+ // R7.2: only expose client_visible vars.
269
+ if (!spec.client_visible) continue;
270
+ // R3.4: build-phase vars are not available at runtime.
271
+ if (spec.phase === "build") continue;
272
+
273
+ const raw = process.env[key] ?? resolveDefault(spec, env);
274
+ if (raw === undefined) continue;
275
+
276
+ const [ok, coerced] = coerce(key, raw, spec);
277
+ payload[key] = ok ? coerced : raw;
278
+ }
279
+
280
+ return payload;
281
+ }
282
+
283
+ /**
284
+ * Route-handler factory for GET /api/config (R7.1).
285
+ *
286
+ * Reads the contract and process.env once at factory-call time and caches
287
+ * the JSON payload. The returned handler is compatible with:
288
+ *
289
+ * Next.js App Router:
290
+ * export const GET = createConfigEndpoint(path);
291
+ *
292
+ * Fastify:
293
+ * instance.get('/api/config', createConfigEndpoint(path));
294
+ *
295
+ * Express:
296
+ * app.get('/api/config', createConfigEndpoint(path));
297
+ *
298
+ * The handler detects the calling convention at runtime:
299
+ * - Next.js / fetch-native: called with no arguments; returns a Response.
300
+ * - Express: called with (req, res); calls res.json() and returns void.
301
+ * - Fastify: called with (req, reply); calls reply.send() and returns void.
302
+ */
303
+ export function createConfigEndpoint(
304
+ runtimeYamlPath: string,
305
+ opts: EndpointOptions = {},
306
+ ): RouteHandler {
307
+ const contract = loadContract(runtimeYamlPath);
308
+ const env =
309
+ (process.env.NODE_ENV as string | undefined) ?? "local";
310
+ const payload = buildClientPayload(contract, env);
311
+ const cacheControl = opts.cacheControl ?? "private, no-store";
312
+ const body = JSON.stringify(payload);
313
+
314
+ return function configHandler(
315
+ _req?: unknown,
316
+ res?: unknown,
317
+ ): Promise<Response | void> | Response | void {
318
+ // Express-shaped: res has .json()
319
+ if (res && typeof (res as Record<string, unknown>)["json"] === "function") {
320
+ const r = res as {
321
+ setHeader: (k: string, v: string) => void;
322
+ json: (data: unknown) => void;
323
+ };
324
+ r.setHeader("Cache-Control", cacheControl);
325
+ r.setHeader("Content-Type", "application/json");
326
+ r.json(payload);
327
+ return;
328
+ }
329
+
330
+ // Fastify-shaped: res has .send()
331
+ if (res && typeof (res as Record<string, unknown>)["send"] === "function") {
332
+ const r = res as {
333
+ header: (k: string, v: string) => void;
334
+ type: (ct: string) => void;
335
+ send: (data: string) => void;
336
+ };
337
+ r.header("Cache-Control", cacheControl);
338
+ r.type("application/json");
339
+ r.send(body);
340
+ return;
341
+ }
342
+
343
+ // Next.js / fetch-native (no res argument, or unrecognised res)
344
+ return new Response(body, {
345
+ status: 200,
346
+ headers: {
347
+ "Content-Type": "application/json",
348
+ "Cache-Control": cacheControl,
349
+ },
350
+ });
351
+ };
352
+ }
@@ -701,27 +701,13 @@ export const IC_56_SERVICE_DELIVERY_CHANNEL = {
701
701
  PHONE: 3,
702
702
  EMAIL_TEXT_CHAT: 4,
703
703
  VIRTUAL: 5,
704
- // PROVISIONAL — group delivery channels surfaced by the Thread canonical
705
- // "How was the service delivered?" picker. Authored ahead of codebook /
706
- // Notion ratification; flagged provisional pending SOT sign-off.
707
- GROUP_IN_PERSON: 6,
708
- GROUP_REMOTE: 7,
709
704
  } as const;
710
705
 
711
706
  export type IC56Value =
712
707
  (typeof IC_56_SERVICE_DELIVERY_CHANNEL)[keyof typeof IC_56_SERVICE_DELIVERY_CHANNEL];
713
708
 
714
- /** Level 1 values only (excludes missingness codes). 6/7 are PROVISIONAL. */
715
- export type IC56ChannelValue = 1 | 2 | 3 | 4 | 5 | 6 | 7;
716
-
717
- /**
718
- * PROVISIONAL IC-56 channel values pending codebook ratification.
719
- * Consumers may gate on this set to surface a "draft" affordance.
720
- */
721
- export const IC_56_PROVISIONAL_CHANNELS: ReadonlySet<number> = new Set([
722
- IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_IN_PERSON,
723
- IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_REMOTE,
724
- ]);
709
+ /** Level 1 values only (excludes missingness codes). */
710
+ export type IC56ChannelValue = 1 | 2 | 3 | 4 | 5;
725
711
 
726
712
  export const IC_56_LABELS: Record<IC56Value, string> = {
727
713
  [IC_56_SERVICE_DELIVERY_CHANNEL.DATA_NOT_COLLECTED]: "Data Not Collected",
@@ -732,8 +718,6 @@ export const IC_56_LABELS: Record<IC56Value, string> = {
732
718
  [IC_56_SERVICE_DELIVERY_CHANNEL.PHONE]: "Phone",
733
719
  [IC_56_SERVICE_DELIVERY_CHANNEL.EMAIL_TEXT_CHAT]: "Email / Text / Chat",
734
720
  [IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL]: "Virtual",
735
- [IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_IN_PERSON]: "Group (in-person)",
736
- [IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_REMOTE]: "Group (remote)",
737
721
  };
738
722
 
739
723
  export const IC_56_DESCRIPTIONS: Record<IC56Value, string> = {
@@ -750,10 +734,6 @@ export const IC_56_DESCRIPTIONS: Record<IC56Value, string> = {
750
734
  [IC_56_SERVICE_DELIVERY_CHANNEL.EMAIL_TEXT_CHAT]:
751
735
  "Email, text message, or chat",
752
736
  [IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL]: "Virtual / video call",
753
- [IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_IN_PERSON]:
754
- "Group session delivered in person (support group, class, workshop)",
755
- [IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_REMOTE]:
756
- "Group session delivered remotely (virtual support group, webinar)",
757
737
  };
758
738
 
759
739
  /**
@@ -771,7 +751,7 @@ export function isIC56Missingness(code: number): boolean {
771
751
  * @returns True if the code represents an actual delivery channel
772
752
  */
773
753
  export function isIC56ValidChannel(code: number): code is IC56ChannelValue {
774
- return code >= 1 && code <= 7;
754
+ return code >= 1 && code <= 5;
775
755
  }
776
756
 
777
757
  /** Options array for dropdown/radio components (Level 1 only). */
@@ -796,14 +776,6 @@ export const IC_56_OPTIONS = [
796
776
  value: IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL,
797
777
  label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL],
798
778
  },
799
- {
800
- value: IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_IN_PERSON,
801
- label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_IN_PERSON],
802
- },
803
- {
804
- value: IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_REMOTE,
805
- label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.GROUP_REMOTE],
806
- },
807
779
  ] as const;
808
780
 
809
781
  // ─── IC-57: Service Audience / Beneficiary ──────────────────────────
@@ -70,15 +70,6 @@
70
70
  "childCodes": [],
71
71
  "definition": "Completed a master's, doctoral, or professional degree (MA, MS, MBA, JD, MD, PhD, or equivalent). Aligns with Census/ACS 'Graduate or professional degree'."
72
72
  },
73
- {
74
- "code": "180-008-000-000-000-000-000",
75
- "key": "trade_vocational",
76
- "title": "Trade or vocational credential",
77
- "selectable": true,
78
- "parentCode": null,
79
- "childCodes": [],
80
- "definition": "Completed a trade, vocational, or technical credential (apprenticeship, licensure, or postsecondary non-degree award) rather than an academic degree."
81
- },
82
73
  {
83
74
  "code": "180-000-000-000-000-000-000",
84
75
  "key": "missingness_root",
@@ -0,0 +1,89 @@
1
+ {
2
+ "domain": "hmis_sex",
3
+ "name": "Core HMIS Sex",
4
+ "version": "1.0.0",
5
+ "levels": {
6
+ "0": "Unknown or Missing",
7
+ "1": "Sex"
8
+ },
9
+ "entries": [
10
+ {
11
+ "code": "067-000-000-000-000-000-000",
12
+ "key": "missingness_root",
13
+ "title": "Unknown, Redacted, or Missing",
14
+ "selectable": false,
15
+ "parentCode": null,
16
+ "childCodes": [
17
+ "067-000-000-000-000-000-001",
18
+ "067-000-000-000-000-000-002",
19
+ "067-000-000-000-000-000-003",
20
+ "067-000-000-000-000-000-004",
21
+ "067-000-000-000-000-000-005"
22
+ ],
23
+ "definition": "Root group for values indicating absent, withheld, or uncollected data."
24
+ },
25
+ {
26
+ "code": "067-000-000-000-000-000-001",
27
+ "key": "unknown",
28
+ "title": "Unknown",
29
+ "selectable": true,
30
+ "parentCode": "067-000-000-000-000-000-000",
31
+ "childCodes": [],
32
+ "definition": "Value is unknown at time of entry."
33
+ },
34
+ {
35
+ "code": "067-000-000-000-000-000-002",
36
+ "key": "anonymous",
37
+ "title": "Anonymous",
38
+ "selectable": true,
39
+ "parentCode": "067-000-000-000-000-000-000",
40
+ "childCodes": [],
41
+ "definition": "Value is intentionally withheld or redacted."
42
+ },
43
+ {
44
+ "code": "067-000-000-000-000-000-003",
45
+ "key": "data_not_collected",
46
+ "title": "Data not collected",
47
+ "selectable": true,
48
+ "parentCode": "067-000-000-000-000-000-000",
49
+ "childCodes": [],
50
+ "definition": "Use this response if the staff does not ask the person to provide their sex."
51
+ },
52
+ {
53
+ "code": "067-000-000-000-000-000-004",
54
+ "key": "client_doesn_t_know",
55
+ "title": "Client doesn't know",
56
+ "selectable": true,
57
+ "parentCode": "067-000-000-000-000-000-000",
58
+ "childCodes": [],
59
+ "definition": "\"Client doesn't know\" should only be selected when a person does not know their sex from among the responses."
60
+ },
61
+ {
62
+ "code": "067-000-000-000-000-000-005",
63
+ "key": "client_prefers_not_to_answer",
64
+ "title": "Client prefers not to answer",
65
+ "selectable": true,
66
+ "parentCode": "067-000-000-000-000-000-000",
67
+ "childCodes": [],
68
+ "definition": "\"Client prefers not to answer\" should only be selected when a person chooses not to identify their sex from among the responses."
69
+ },
70
+ {
71
+ "code": "067-001-000-000-000-000-000",
72
+ "key": "female",
73
+ "title": "Female",
74
+ "selectable": true,
75
+ "parentCode": null,
76
+ "childCodes": [],
77
+ "definition": "A person of the sex characterized by a reproductive system with the biological function of producing eggs (ova)."
78
+ },
79
+ {
80
+ "code": "067-002-000-000-000-000-000",
81
+ "key": "male",
82
+ "title": "Male",
83
+ "selectable": true,
84
+ "parentCode": null,
85
+ "childCodes": [],
86
+ "definition": "A person of the sex characterized by a reproductive system with the biological function of producing sperm."
87
+ }
88
+ ]
89
+ }
@@ -75,24 +75,6 @@
75
75
  "parentCode": null,
76
76
  "childCodes": [],
77
77
  "definition": "Advocate's deliberate choice to keep the person's name off the subject's record even when known (privacy / safety / legal-strategy reasons), or when documenting the name would risk the survivor or third party. Pairs with Name kind 'Anonymous'. This is a capture-intent posture, distinct from the missingness 'anonymous' sentinel."
78
- },
79
- {
80
- "code": "929-004-000-000-000-000-000",
81
- "key": "estimated_persona",
82
- "title": "Estimated persona",
83
- "selectable": true,
84
- "parentCode": null,
85
- "childCodes": [],
86
- "definition": "A persona that exists in data/systems (resolved _id with linked source records) but has NOT been confirmed to represent a real person. Typically inferred (entity resolution / algorithm-clustered ads); maps 1:1 to the LEADS IDB 'not verified' icon. An estimated_persona record must never render as an identified person. Added 2026-06-12 per ruling M3 (Terry) so the platform-milestone IDENTIFICATION value maps exactly; RENAMED that day from the prototype's working code SYSTEM_ENTITY to avoid collision with facilitator_entity_type. Previously approximated as unidentified."
87
- },
88
- {
89
- "code": "929-005-000-000-000-000-000",
90
- "key": "confirmed",
91
- "title": "Confirmed (identity unknown)",
92
- "selectable": true,
93
- "parentCode": null,
94
- "childCodes": [],
95
- "definition": "Confirmed to be a real person, but the specific identity is unknown — the 'real person, identity unknown' degree that sat between unidentified and identified with no code before 2026-06-12 (ruling M3). Distinct from unidentified (capture intent: known-of via relationship, no name) in that confirmation is an explicit analyst/advocate determination that the entity is real."
96
78
  }
97
79
  ]
98
80
  }
@@ -65,8 +65,7 @@
65
65
  "selectable": false,
66
66
  "parentCode": null,
67
67
  "childCodes": [
68
- "171-001-001-000-000-000-000",
69
- "171-001-002-000-000-000-000"
68
+ "171-001-001-000-000-000-000"
70
69
  ],
71
70
  "definition": "Income from wages, salary, tips, gig/contract work, or other paid employment."
72
71
  },
@@ -79,15 +78,6 @@
79
78
  "childCodes": [],
80
79
  "definition": "Income from wages, salary, tips, gig/contract work, or other paid employment. Includes informal earned income that is not supported by official documentation."
81
80
  },
82
- {
83
- "code": "171-001-002-000-000-000-000",
84
- "key": "informal_income",
85
- "title": "Informal / undocumented income",
86
- "selectable": true,
87
- "parentCode": "171-001-000-000-000-000-000",
88
- "childCodes": [],
89
- "definition": "Informal or undocumented income, e.g. cash work or side activity not captured by formal employment or a benefit program."
90
- },
91
81
  {
92
82
  "code": "171-002-000-000-000-000-000",
93
83
  "key": "cash_benefit",
@@ -336,8 +326,7 @@
336
326
  "parentCode": null,
337
327
  "childCodes": [
338
328
  "171-004-001-000-000-000-000",
339
- "171-004-002-000-000-000-000",
340
- "171-004-003-000-000-000-000"
329
+ "171-004-002-000-000-000-000"
341
330
  ],
342
331
  "definition": "Income received as interpersonal transfers or support payments (e.g., child support, spousal support)."
343
332
  },
@@ -359,15 +348,6 @@
359
348
  "childCodes": [],
360
349
  "definition": "All periodic payments received from an ex-spouse as alimony or spousal support. Excludes one-time property settlements."
361
350
  },
362
- {
363
- "code": "171-004-003-000-000-000-000",
364
- "key": "family_friend_support",
365
- "title": "Family / friend financial support",
366
- "selectable": true,
367
- "parentCode": "171-004-000-000-000-000-000",
368
- "childCodes": [],
369
- "definition": "Informal financial support from family or friends, not a documented benefit program."
370
- },
371
351
  {
372
352
  "code": "171-005-000-000-000-000-000",
373
353
  "key": "other_unspecified",
@@ -407,15 +387,6 @@
407
387
  "parentCode": "171-005-000-000-000-000-000",
408
388
  "childCodes": [],
409
389
  "definition": "Income received as a stipend, scholarship refund, training allowance, or other education-related payment that can function as income for living expenses. Funder-specific exclusions may apply (e.g., SSVF)."
410
- },
411
- {
412
- "code": "171-006-000-000-000-000-000",
413
- "key": "victim_compensation",
414
- "title": "Crime victim compensation",
415
- "selectable": true,
416
- "parentCode": null,
417
- "childCodes": [],
418
- "definition": "Income or benefits from a state or federal crime-victim compensation program (e.g. VOCA-funded victim compensation)."
419
390
  }
420
391
  ]
421
392
  }
package/src/cvcs/index.ts CHANGED
@@ -138,14 +138,6 @@ import threadTypeSot from "./threadType.v1.0.0.json" with { type: "json" };
138
138
  import signatureTypeSot from "./signatureType.v1.0.0.json" with { type: "json" };
139
139
  import verificationStatusSot from "./verificationStatus.v1.0.0.json" with { type: "json" };
140
140
  import visaTypeSot from "./visaType.v1.0.0.json" with { type: "json" };
141
- import livingSituationSot from "./livingSituation.v1.0.0.json" with { type: "json" };
142
- import serviceAudienceSot from "./serviceAudience.v1.0.0.json" with { type: "json" };
143
- import hmisRelationshipToHohSot from "./hmisRelationshipToHoh.v1.0.0.json" with { type: "json" };
144
- import victimAbuseTypesSot from "./victimAbuseTypes.v1.0.0.json" with { type: "json" };
145
- import htTypeSot from "./htType.v1.0.0.json" with { type: "json" };
146
- import relationshipConcernSot from "./relationshipConcern.v1.0.0.json" with { type: "json" };
147
- import recencyBandSot from "./recencyBand.v1.0.0.json" with { type: "json" };
148
- import housingSubsidyTypesSot from "./housingSubsidyTypes.v1.0.0.json" with { type: "json" };
149
141
 
150
142
  export {
151
143
  serviceCategoriesSot,
@@ -267,12 +259,4 @@ export {
267
259
  signatureTypeSot,
268
260
  verificationStatusSot,
269
261
  visaTypeSot,
270
- livingSituationSot,
271
- serviceAudienceSot,
272
- hmisRelationshipToHohSot,
273
- victimAbuseTypesSot,
274
- htTypeSot,
275
- relationshipConcernSot,
276
- recencyBandSot,
277
- housingSubsidyTypesSot,
278
262
  };