@htilabs/platform-common-models 0.8.9 → 0.8.12

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 (57) hide show
  1. package/dist/config/index.cjs +191 -0
  2. package/dist/config/index.cjs.map +1 -0
  3. package/dist/config/index.d.cts +101 -0
  4. package/dist/config/index.d.ts +101 -0
  5. package/dist/config/index.js +165 -0
  6. package/dist/config/index.js.map +1 -0
  7. package/dist/constants/index.cjs +2 -0
  8. package/dist/constants/index.cjs.map +1 -1
  9. package/dist/constants/index.d.cts +1 -1
  10. package/dist/constants/index.d.ts +1 -1
  11. package/dist/constants/index.js +2 -0
  12. package/dist/constants/index.js.map +1 -1
  13. package/dist/{cvcEntry-DaDrEuTa.d.cts → cvcEntry-BCj1OWqL.d.cts} +36 -36
  14. package/dist/{cvcEntry-DaDrEuTa.d.ts → cvcEntry-BCj1OWqL.d.ts} +36 -36
  15. package/dist/cvcs/index.cjs +1520 -5
  16. package/dist/cvcs/index.cjs.map +1 -1
  17. package/dist/cvcs/index.d.cts +3300 -1612
  18. package/dist/cvcs/index.d.ts +3300 -1612
  19. package/dist/cvcs/index.js +1513 -5
  20. package/dist/cvcs/index.js.map +1 -1
  21. package/dist/{index-EPjPjR0z.d.cts → index-CoVr1jIV.d.cts} +1 -1
  22. package/dist/{index-C0J3f169.d.ts → index-I-DiX9eQ.d.ts} +1 -1
  23. package/dist/index.cjs +1705 -7
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +216 -7
  26. package/dist/index.d.ts +216 -7
  27. package/dist/index.js +1691 -7
  28. package/dist/index.js.map +1 -1
  29. package/dist/models/index.d.cts +2 -2
  30. package/dist/models/index.d.ts +2 -2
  31. package/dist/{platform-auth-BSKYSDKe.d.cts → platform-auth-BwfZ0bxU.d.cts} +1 -1
  32. package/dist/{platform-auth-BSKYSDKe.d.ts → platform-auth-BwfZ0bxU.d.ts} +1 -1
  33. package/dist/schemas/index.cjs.map +1 -1
  34. package/dist/schemas/index.d.cts +11 -11
  35. package/dist/schemas/index.d.ts +11 -11
  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 +7 -1
  40. package/src/__tests__/__snapshots__/cvc-sot.snap +32 -4
  41. package/src/__tests__/cvc-sot-snapshot.test.ts +24 -2
  42. package/src/__tests__/cvc-structural.test.ts +11 -1
  43. package/src/__tests__/runtime-contract-validator.test.ts +556 -0
  44. package/src/config/fixtures/valid.yaml +90 -0
  45. package/src/config/index.ts +352 -0
  46. package/src/constants/ic.ts +14 -1
  47. package/src/cvcs/{assertionDomain.v1.0.0.json → assertionDomain.v1.1.0.json} +12 -3
  48. package/src/cvcs/{checkInPhase.v1.0.0.json → checkInPhase.v1.1.0.json} +20 -2
  49. package/src/cvcs/coreFunctions.v1.0.0.json +746 -0
  50. package/src/cvcs/coreReferralOutcome.v1.0.0.json +71 -0
  51. package/src/cvcs/index.ts +15 -1
  52. package/src/cvcs/needsAssessmentChangeType.v1.0.0.json +134 -0
  53. package/src/cvcs/riskBand.v1.0.0.json +98 -0
  54. package/src/cvcs/riskCategory.v1.0.0.json +134 -0
  55. package/src/cvcs/roiScope.v1.0.0.json +188 -0
  56. package/src/cvcs/roiStatus.v1.0.0.json +98 -0
  57. package/src/generated/cvc-enums.ts +225 -2
@@ -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
+ }
@@ -5429,7 +5429,7 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5429
5429
  categoryLabel: CVC_136_CATEGORY_LABELS[category],
5430
5430
  }));
5431
5431
 
5432
- // ─── CVC-136: full core-indicators value set (SOT-complete, 198 codes) ──
5432
+ // ─── CVC-136: full core-indicators value set (SOT-complete, 199 codes) ──
5433
5433
  // The complete CVC-136 'core - indicators' vocabulary per the Notion codebook
5434
5434
  // SOT (ADR-CONTRACT-cvc-136-indicator-structure, 198 codes, Ready-for-dev),
5435
5435
  // sourced verbatim from @htilabs/platform-codebook seed-data/entries.json.
@@ -5438,6 +5438,16 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5438
5438
  // (D10 — replaces per-app @pave/domain CVC_INDICATORS). Codes + labels are
5439
5439
  // codebook-authoritative; the 6-category UI grouping is NOT in the SOT and
5440
5440
  // stays scoped to CVC_136_ALERT_INDICATOR.
5441
+ //
5442
+ // 0.8.12 — 198 → 199: `unusual_work_circumstances_general` added per PAVE
5443
+ // docs/adrs/ADR-CONTRACT-cvc136-fraud-indicator-codes.md. That ADR reconciled
5444
+ // the risk-tree V-1 `determinedBy` indicators against the published 198 and
5445
+ // found exactly ONE genuine gap: the two "specific" unusual-work-circumstance
5446
+ // members (`owes_money_and_cannot_pay_off`, `restrictive_or_not_understood_
5447
+ // contract`) were already published, but the family had no general/other
5448
+ // catch-all. Level 1, following the family's "Unusual work circumstances:"
5449
+ // label convention. Codebook-name delivery only — no weights, no walker
5450
+ // re-wire (the risk-tree walker stays FROZEN under the scoring reversal).
5441
5451
  export const CVC_136_CORE_INDICATOR_VALUES = [
5442
5452
  "abuser_evading_legal_consequences",
5443
5453
  "abuser_has_weapon",
@@ -5607,6 +5617,7 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5607
5617
  "unexplained_frequent_travel_or_migration",
5608
5618
  "unsafe_working_conditions_long_hours_inadequate_breaks",
5609
5619
  "unusual_cash_or_unexplained_gifts",
5620
+ "unusual_work_circumstances_general",
5610
5621
  "urgent_medical_referral_needed",
5611
5622
  "vc_adverse_childhood_experiences",
5612
5623
  "vc_age_disparate_partner",
@@ -5811,6 +5822,8 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5811
5822
  "unexplained_frequent_travel_or_migration": "Unexplained frequent travel or migration (instability)",
5812
5823
  "unsafe_working_conditions_long_hours_inadequate_breaks": "Unsafe working conditions / long hours / inadequate breaks",
5813
5824
  "unusual_cash_or_unexplained_gifts": "Unusual amount of cash or unexplained gifts/resources",
5825
+ "unusual_work_circumstances_general":
5826
+ "Unusual work circumstances: general (unusual or unexpected work circumstances reported, not captured by a more specific unusual-work-circumstance indicator)",
5814
5827
  "urgent_medical_referral_needed": "Urgent medical referral needed",
5815
5828
  "vc_adverse_childhood_experiences": "Adverse childhood experiences",
5816
5829
  "vc_age_disparate_partner": "Age-disparate intimate partner",
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "domain": "assertion_domain",
3
3
  "name": "assertionDomain",
4
- "version": "1.0.0",
5
- "_status": "PROVISIONAL — net-new value-CVC not yet in Notion; provisional 900+ numbering; substantive values sourced verbatim from the PAVE @pave/domain enum of the same name (D10 source-from-platform-common). PENDING canonical Notion authoring + steward ratification of titles/definitions.",
6
- "_source": "pave-2.0/packages/domain/src/enums.ts",
4
+ "version": "1.1.0",
5
+ "_status": "PROVISIONAL — net-new value-CVC not yet in Notion; provisional 900+ numbering; substantive values sourced verbatim from the PAVE @pave/domain enum of the same name (D10 source-from-platform-common). PENDING canonical Notion authoring + steward ratification of titles/definitions. v1.1.0 appends `household_composition` (964-067) — PAVE-authored assertion_domain for the Core-Profile Household questionnaire answers, upstream-proposed per ADR-CONTRACT-household-composition-car.",
6
+ "_source": "pave-2.0/packages/domain/src/enums.ts; household_composition from pave-2.0/packages/domain/src/enums.ts HOUSEHOLD_COMPOSITION_ASSERTION_DOMAIN + docs/adrs/ADR-CONTRACT-household-composition-car.md",
7
7
  "levels": {
8
8
  "0": "Unknown or Missing",
9
9
  "1": "CAR assertion domain"
@@ -642,6 +642,15 @@
642
642
  "parentCode": null,
643
643
  "childCodes": [],
644
644
  "definition": "assertion_domain partition for CARs on Romantic Relationships (marital status, relationship status, romantic partners; core_romantic_relationship_change_type verbs). DISTINCT from household_relationships (HoH tenure). DRAFT-TEMPORARY direct import from prototype, pending Notion ratification. Resolves the romantic-domain 'new domain vs split' question as a net-new domain, subject to steward ratification."
645
+ },
646
+ {
647
+ "code": "964-067-000-000-000-000-000",
648
+ "key": "household_composition",
649
+ "title": "Household composition",
650
+ "selectable": true,
651
+ "parentCode": null,
652
+ "childCodes": [],
653
+ "definition": "Core-Profile household questionnaire answers (HH-CHILDREN / HH-CHILDREN-COUNT / HH-PETS / HH-PETS-KIND / HH-PETS-COUNT / HH-PETS-SAFE from the HouseholdPanel composite). DISTINCT from `household_relationships` (HoH-tenure semantics, keyed on the single HOH_TENURE_VALUE_CODE) and from `household_tenure`. Also distinct from the NeedsAssessment form's `household-composition` section (codes NEEDS-HH-1/1A/2/2A), which persists under the `needs_assessment` domain. Added in v1.1.0 from PAVE `@pave/domain` HOUSEHOLD_COMPOSITION_ASSERTION_DOMAIN (enums.ts) per ADR-CONTRACT-household-composition-car (pave-2.0-03b)."
645
654
  }
646
655
  ]
647
656
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "domain": "check_in_phase",
3
3
  "name": "Check-In Phase",
4
- "version": "1.0.0",
5
- "_status": "DRAFT — TEMPORARY: net-new value-CVC not yet in Notion; provisional 900+ numbering; codes from prototype/data/cvcs/core_check_in_phase.yaml; PENDING canonical Notion authoring (PAVE Auditability backlog). Flat single-select controlled set authored faithfully; the prototype YAML carries a per-entry program_type (residential|non_residential|any) dimension preserved inline in each definition. May collapse into IC-63 session templates at a later build phase.",
4
+ "version": "1.1.0",
5
+ "_status": "DRAFT — TEMPORARY: net-new value-CVC not yet in Notion; provisional 900+ numbering; codes from prototype/data/cvcs/core_check_in_phase.yaml; PENDING canonical Notion authoring (PAVE Auditability backlog). Flat single-select controlled set authored faithfully; the prototype YAML carries a per-entry program_type (residential|non_residential|any) dimension preserved inline in each definition. May collapse into IC-63 session templates at a later build phase. v1.1.0 appends `phase_2_followup` (907-012) and `phase_3_followup` (907-013). NOTE: no `exit_review` leaf is added — CVC-907 already carries `pre_exit_review` (907-010) and duplicating that semantic is explicitly declined.",
6
6
  "_source": "prototype/data/cvcs/core_check_in_phase.yaml",
7
7
  "levels": {
8
8
  "0": "Unknown or Missing",
@@ -147,6 +147,24 @@
147
147
  "parentCode": null,
148
148
  "childCodes": [],
149
149
  "definition": "Check-in after the survivor has exited the program. Captures sustained outcomes and ongoing support needs. program_type: any."
150
+ },
151
+ {
152
+ "code": "907-012-000-000-000-000-000",
153
+ "key": "phase_2_followup",
154
+ "title": "Phase 2 follow-up",
155
+ "selectable": true,
156
+ "parentCode": null,
157
+ "childCodes": [],
158
+ "definition": "Follow-up check-in attached to the Phase 2 (30-to-60-day) residential window — a follow-up touch inside the phase, as distinct from the phase-boundary check-in itself (`phase_2_60d`). program_type: residential. Added in v1.1.0."
159
+ },
160
+ {
161
+ "code": "907-013-000-000-000-000-000",
162
+ "key": "phase_3_followup",
163
+ "title": "Phase 3 follow-up",
164
+ "selectable": true,
165
+ "parentCode": null,
166
+ "childCodes": [],
167
+ "definition": "Follow-up check-in attached to the Phase 3 (60-to-90-day) residential window — a follow-up touch inside the phase, as distinct from the phase-boundary check-in itself (`phase_3_90d`). program_type: residential. Added in v1.1.0."
150
168
  }
151
169
  ]
152
170
  }