@htilabs/platform-common-models 0.13.1 → 0.14.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 (45) hide show
  1. package/dist/constants/index.cjs +33 -0
  2. package/dist/constants/index.cjs.map +1 -1
  3. package/dist/constants/index.d.cts +1 -1
  4. package/dist/constants/index.d.ts +1 -1
  5. package/dist/constants/index.js +29 -0
  6. package/dist/constants/index.js.map +1 -1
  7. package/dist/cvcs/index.cjs +96 -13
  8. package/dist/cvcs/index.cjs.map +1 -1
  9. package/dist/cvcs/index.d.cts +101 -12
  10. package/dist/cvcs/index.d.ts +101 -12
  11. package/dist/cvcs/index.js +96 -13
  12. package/dist/cvcs/index.js.map +1 -1
  13. package/dist/enums/index.cjs +7 -1
  14. package/dist/enums/index.cjs.map +1 -1
  15. package/dist/enums/index.d.cts +8 -2
  16. package/dist/enums/index.d.ts +8 -2
  17. package/dist/enums/index.js +7 -1
  18. package/dist/enums/index.js.map +1 -1
  19. package/dist/index.cjs +136 -14
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +132 -14
  24. package/dist/index.js.map +1 -1
  25. package/dist/{platform-auth-64U8jjuw.d.cts → platform-auth-CrF5U_JH.d.cts} +43 -2
  26. package/dist/{platform-auth-64U8jjuw.d.ts → platform-auth-CrF5U_JH.d.ts} +43 -2
  27. package/dist/schemas/index.cjs +234 -0
  28. package/dist/schemas/index.cjs.map +1 -1
  29. package/dist/schemas/index.js +234 -0
  30. package/dist/schemas/index.js.map +1 -1
  31. package/dist/types/index.d.cts +2 -2
  32. package/dist/types/index.d.ts +2 -2
  33. package/package.json +1 -1
  34. package/src/__sot__/coreIndicatorFields.ts +4 -4
  35. package/src/__sot__/coreIndicators.pin.json +62 -2
  36. package/src/__sot__/scoringEmits.pin.json +9 -4
  37. package/src/__tests__/__snapshots__/cvc-sot.snap +2 -2
  38. package/src/__tests__/cvc-136-scoring-invariant.test.ts +89 -28
  39. package/src/__tests__/cvc-drift-gate.test.ts +149 -27
  40. package/src/__tests__/cvc-sot-snapshot.test.ts +3 -1
  41. package/src/__tests__/cvc-structural.test.ts +1 -1
  42. package/src/constants/ic.ts +163 -3
  43. package/src/cvcs/{coreIndicators.v1.0.0.json → coreIndicators.v1.1.0.json} +93 -10
  44. package/src/cvcs/index.ts +1 -1
  45. package/src/generated/cvc-enums.ts +8 -2
@@ -371,15 +371,63 @@ const INDEX_ABSENT: Record<string, { cvc: number; reason: string }> = {
371
371
 
372
372
  /**
373
373
  * The ONLY codes CVC-136 may carry that `core_indicators.yaml` does not.
374
- * @hti/scoring EMITS these two, so dropping them would break the scoring
375
- * contract — scoring is genuinely AHEAD of the catalog here. They are flagged
376
- * `pendingUpstreamAdoption: true` in the SOT JSON. Upstream must adopt or
377
- * deprecate them; until then this list must stay EXACTLY these two.
374
+ * A code belongs here only while @hti/scoring EMITS it and the catalog has not
375
+ * adopted it — dropping such a code would break the scoring contract, so
376
+ * scoring is genuinely AHEAD of the catalog. Each must be flagged
377
+ * `pendingUpstreamAdoption: true` in the SOT JSON.
378
+ *
379
+ * EMPTY as of coreIndicators@c53378f / scoringEmits@9c209cf. From 0.8.13 it
380
+ * held exactly `coercive_debt_pressure_youth` and `debt_terms_deceptive_youth`;
381
+ * hti-scoring 9c209cf retired both emits in favour of the canonical
382
+ * `coercive_debt_pressure` / `debt_terms_deceptive` (whose upstream rows carry
383
+ * the `_youth` names as `legacy_aliases`) and the catalog never adopted them.
384
+ * Both left this allowlist and became DEPRECATED rows (see
385
+ * `CVC136_DEPRECATED` below) — not withdrawn, because PAVE 2.0 still writes
386
+ * them. Until scoring is ahead again this list must stay EXACTLY empty.
387
+ */
388
+ const SCORING_AHEAD_OF_CATALOG: readonly string[] = [];
389
+
390
+ /**
391
+ * CVC-136 keys the catalog no longer carries but a consumer still WRITES, kept
392
+ * read-only in the SOT as `selectable: false` + `deprecated: true` +
393
+ * `supersededBy: <canonical key>` (the CVC-69 `incidentParticipationRoles`
394
+ * v1.1.0 shape). A deprecated row is not an invention: it is a retired key with
395
+ * a resolution path INSIDE this SOT, so an assertion already stored under it
396
+ * never dangles and the positional number can never be reissued to another
397
+ * meaning.
398
+ *
399
+ * Why these two are here and not simply gone (verified 2026-10-06 against the
400
+ * consumers' `develop` heads, not assumed): PAVE 2.0 @ 07f3ccd emits both from
401
+ * the In-Depth Assessment — `IDA-syn-missing_care-4i` / `-4ii`
402
+ * (`packages/api-core/src/rules/assessments/ida/emits.ts`,
403
+ * `packages/assessments-registry/src/instruments/ida.ts`), keys both in
404
+ * `determination-evidence/crosswalk.ts`, and still scores them from its
405
+ * 2026-07-17 vendored `risk.weights.json` — so stored PAVE assertions can carry
406
+ * either key today. Thread @ 28580ab has no writer (its 2026-09-30 vendored
407
+ * weights do not emit them; its only mention is a generated prototype catalog
408
+ * copy nothing validates against). Removing the rows would leave PAVE's stored
409
+ * values with no resolution anywhere in platform-common (ADR row 9: "being
410
+ * written to survivor records today. This cannot stay unresolved.").
411
+ *
412
+ * EXIT CRITERIA — a row leaves this map only when (a) PAVE's IDA emits the
413
+ * canonical key instead (PAVE parity card) AND (b) stored `_youth` assertions
414
+ * have been migrated or confirmed absent in `platform-prod`. Until then this
415
+ * map must stay EXACTLY these two.
378
416
  */
379
- const SCORING_AHEAD_OF_CATALOG: readonly string[] = [
380
- "coercive_debt_pressure_youth",
381
- "debt_terms_deceptive_youth",
382
- ];
417
+ const CVC136_DEPRECATED: Readonly<Record<string, string>> = {
418
+ coercive_debt_pressure_youth: "coercive_debt_pressure",
419
+ debt_terms_deceptive_youth: "debt_terms_deceptive",
420
+ };
421
+
422
+ /**
423
+ * Positional CVC-136 numbers (the second segment of the code) that are HELD by a
424
+ * deprecated row and may never be issued to any other key. Pinned by value so a
425
+ * future refresh that drops the deprecated row and reuses the slot fails here.
426
+ */
427
+ const CVC136_HELD_SLOTS: Readonly<Record<string, string>> = {
428
+ "033": "coercive_debt_pressure_youth",
429
+ "050": "debt_terms_deceptive_youth",
430
+ };
383
431
 
384
432
  // ─── Helpers ────────────────────────────────────────────────────────────────
385
433
 
@@ -387,9 +435,18 @@ const CODE_RE = /^\d{3}(-\d{3}){6}$/;
387
435
  const KEY_RE = /^[a-z][a-z0-9_]*$/;
388
436
  const isMissingness = (e: Entry): boolean => e.code.split("-")[1] === "000";
389
437
  const substantiveOf = (d: Domain): Entry[] => d.entries.filter((e) => !isMissingness(e));
438
+ const isDeprecated = (e: Entry): boolean =>
439
+ (e as Entry & { deprecated?: unknown }).deprecated === true;
390
440
 
391
441
  const cvc136 = DOMAINS.find((d) => d.domain === "core_indicators")!;
442
+ /** Every substantive CVC-136 key, deprecated rows INCLUDED — the set a stored value must resolve against. */
392
443
  const cvc136Keys = new Set(substantiveOf(cvc136).map((e) => e.key));
444
+ /** The LIVE CVC-136 key set — what the catalog must account for and what a new write may use. */
445
+ const cvc136LiveKeys = new Set(
446
+ substantiveOf(cvc136)
447
+ .filter((e) => !isDeprecated(e))
448
+ .map((e) => e.key),
449
+ );
393
450
 
394
451
  // ═══════════════════════════════════════════════════════════════════════════
395
452
  // A. SCORING EXPRESSIBILITY
@@ -404,7 +461,7 @@ describe("GATE A — every code @hti/scoring emits exists in CVC-136", () => {
404
461
  `(This is how the entire perpetrator lane went missing — facilitator scoring\n` +
405
462
  " was unexpressible for an entire release.)\n\n" +
406
463
  ` MISSING: ${missing.join(", ")}\n\n` +
407
- "TO FIX: add each code to src/cvcs/coreIndicators.v1.0.0.json (sourced from\n" +
464
+ "TO FIX: add each code to src/cvcs/coreIndicators.v1.1.0.json (sourced from\n" +
408
465
  ` ${coreIndicatorsPin.sourceRepo}/${coreIndicatorsPin.sourceFile}` +
409
466
  ` @ ${coreIndicatorsPin.sourceSha}),\n` +
410
467
  " then regenerate CVC_136_CORE_INDICATOR_VALUES in src/constants/ic.ts.\n" +
@@ -423,8 +480,10 @@ describe("GATE B — CVC-136 invents nothing", () => {
423
480
  const catalog = new Set(coreIndicatorsPin.codes);
424
481
  const allowed = new Set(SCORING_AHEAD_OF_CATALOG);
425
482
 
426
- it("every CVC-136 code is in core_indicators.yaml or the annotated allowlist", () => {
427
- const invented = [...cvc136Keys].filter((k) => !catalog.has(k) && !allowed.has(k)).sort();
483
+ it("every LIVE CVC-136 code is in core_indicators.yaml or the annotated allowlist", () => {
484
+ // Deprecated rows are excluded here and policed by their own block below:
485
+ // they are retired keys with an in-SOT successor, not inventions.
486
+ const invented = [...cvc136LiveKeys].filter((k) => !catalog.has(k) && !allowed.has(k)).sort();
428
487
  if (invented.length > 0) {
429
488
  throw new Error(
430
489
  `${invented.length} INVENTED code(s) in CVC-136 — they exist in neither\n` +
@@ -434,7 +493,7 @@ describe("GATE B — CVC-136 invents nothing", () => {
434
493
  "(0.8.12 shipped 56 of these — `vc_*`, `csi_*`, `csctx_*`, `dv_*`, `net_*`,\n" +
435
494
  " `auto_*` rollup prefixes consumed by nobody. They are not indicators.)\n\n" +
436
495
  ` INVENTED: ${invented.join(", ")}\n\n` +
437
- "TO FIX: remove them from src/cvcs/coreIndicators.v1.0.0.json — OR, if\n" +
496
+ "TO FIX: remove them from src/cvcs/coreIndicators.v1.1.0.json — OR, if\n" +
438
497
  " @hti/scoring genuinely emits them ahead of the catalog, add them to\n" +
439
498
  " SCORING_AHEAD_OF_CATALOG in this file WITH `pendingUpstreamAdoption: true`\n" +
440
499
  " on the entry, and raise adoption with the codebook owner.",
@@ -443,12 +502,15 @@ describe("GATE B — CVC-136 invents nothing", () => {
443
502
  expect(invented).toEqual([]);
444
503
  });
445
504
 
446
- it("the scoring-ahead allowlist is EXACTLY the 2 known codes, each flagged", () => {
505
+ it("the scoring-ahead allowlist is EXACTLY empty; any future entry must be emitted, absent upstream, and flagged", () => {
447
506
  // Guard the escape hatch: it must not quietly become a dumping ground.
448
- expect([...SCORING_AHEAD_OF_CATALOG].sort()).toEqual([
449
- "coercive_debt_pressure_youth",
450
- "debt_terms_deceptive_youth",
451
- ]);
507
+ expect([...SCORING_AHEAD_OF_CATALOG].sort()).toEqual([]);
508
+ // The former `_youth` pair must not creep back in as LIVE rows by any route.
509
+ for (const code of Object.keys(CVC136_DEPRECATED)) {
510
+ expect(scoringEmitsPin.codes, `${code} is no longer emitted by scoring`).not.toContain(code);
511
+ expect(coreIndicatorsPin.codes, `${code} is still absent upstream`).not.toContain(code);
512
+ expect(cvc136LiveKeys.has(code), `${code} must not be a LIVE CVC-136 row`).toBe(false);
513
+ }
452
514
  for (const code of SCORING_AHEAD_OF_CATALOG) {
453
515
  expect(scoringEmitsPin.codes, `${code} must actually be emitted by scoring`).toContain(code);
454
516
  expect(coreIndicatorsPin.codes, `${code} must still be absent upstream`).not.toContain(code);
@@ -458,6 +520,50 @@ describe("GATE B — CVC-136 invents nothing", () => {
458
520
  expect(entry?.["pendingUpstreamAdoption"], `${code} must be flagged`).toBe(true);
459
521
  }
460
522
  });
523
+
524
+ it("the deprecated set is EXACTLY the 2 former scoring-ahead codes, each read-only with an in-SOT successor", () => {
525
+ const deprecatedRows = substantiveOf(cvc136).filter(isDeprecated) as (Entry & {
526
+ deprecated?: unknown;
527
+ supersededBy?: unknown;
528
+ pendingUpstreamAdoption?: unknown;
529
+ })[];
530
+ expect(deprecatedRows.map((e) => e.key).sort()).toEqual(Object.keys(CVC136_DEPRECATED).sort());
531
+ for (const row of deprecatedRows) {
532
+ const successor = CVC136_DEPRECATED[row.key];
533
+ expect(row.selectable, `${row.key} must not be offered for new writes`).toBe(false);
534
+ expect(row.supersededBy, `${row.key} must name its canonical successor`).toBe(successor);
535
+ expect(row.pendingUpstreamAdoption, `${row.key} is deprecated, not scoring-ahead`).toBeUndefined();
536
+ // The successor is a LIVE, selectable, catalog-backed row — so the
537
+ // resolution path a reader follows lands on something real.
538
+ const target = substantiveOf(cvc136).find((e) => e.key === successor);
539
+ expect(target, `${row.key} -> ${successor} must resolve in CVC-136`).toBeDefined();
540
+ expect(target!.selectable, `${successor} must be selectable`).toBe(true);
541
+ expect(isDeprecated(target!), `${successor} must not itself be deprecated`).toBe(false);
542
+ expect(catalog.has(successor), `${successor} must be in core_indicators.yaml`).toBe(true);
543
+ // A deprecated row has no emitter in scoring — if it did, it would be
544
+ // live (or scoring-ahead), not deprecated.
545
+ expect(scoringEmitsPin.codes, `${row.key} must not be emitted by scoring`).not.toContain(row.key);
546
+ }
547
+ });
548
+
549
+ it("the held positional slots (136-033, 136-050) belong to their deprecated keys and are never reissued", () => {
550
+ const bySlot = new Map<string, Entry[]>();
551
+ for (const e of substantiveOf(cvc136)) {
552
+ const slot = e.code.split("-")[1];
553
+ bySlot.set(slot, [...(bySlot.get(slot) ?? []), e]);
554
+ }
555
+ for (const [slot, holder] of Object.entries(CVC136_HELD_SLOTS)) {
556
+ const occupants = bySlot.get(slot) ?? [];
557
+ expect(
558
+ occupants.map((e) => e.key),
559
+ `slot 136-${slot} must be held by exactly its deprecated key`,
560
+ ).toEqual([holder]);
561
+ expect(isDeprecated(occupants[0]!), `slot 136-${slot} holder must be deprecated`).toBe(true);
562
+ }
563
+ // And no slot anywhere in CVC-136 is shared by two keys.
564
+ const shared = [...bySlot.entries()].filter(([, es]) => es.length > 1);
565
+ expect(shared.map(([s, es]) => `${s}: ${es.map((e) => e.key).join(",")}`)).toEqual([]);
566
+ });
461
567
  });
462
568
 
463
569
  // ═══════════════════════════════════════════════════════════════════════════
@@ -779,7 +885,7 @@ describe("GATE H — CVC-136 restates every field the catalog states", () => {
779
885
  ` ${absent.join(", ")}\n\n` +
780
886
  "GATE B only checks the other direction (CVC-136 invents nothing), so a\n" +
781
887
  " catalog code dropped on refresh would otherwise pass unnoticed.\n" +
782
- "TO FIX: add each to src/cvcs/coreIndicators.v1.0.0.json.",
888
+ "TO FIX: add each to src/cvcs/coreIndicators.v1.1.0.json.",
783
889
  );
784
890
  }
785
891
  expect(absent).toEqual([]);
@@ -818,7 +924,7 @@ describe("GATE H — CVC-136 restates every field the catalog states", () => {
818
924
  "0.8.17 dropped a label rename plus a deprecation qualifier).\n\n" +
819
925
  `${mismatches.join("\n")}\n\n` +
820
926
  "TO FIX: copy the `catalog:` value printed above into the matching entry\n" +
821
- " of src/cvcs/coreIndicators.v1.0.0.json.\n" +
927
+ " of src/cvcs/coreIndicators.v1.1.0.json.\n" +
822
928
  " COPY THE PRINTED VALUE, not the raw scalar out of\n" +
823
929
  ` ${coreIndicatorsPin.sourceRepo}/${coreIndicatorsPin.sourceFile}` +
824
930
  ` @ ${coreIndicatorsPin.sourceSha}.\n` +
@@ -1025,11 +1131,27 @@ describe("SOT pins carry their provenance", () => {
1025
1131
  // unchanged row, CVC-85 and CVC-145 status promotions) carry no pin delta:
1026
1132
  // the pin captures the NUMBER -> NAMES map, not the status column.
1027
1133
  // coreIndicators advanced to 84a1b67 in 0.8.14 (+5 upstream mints, 0
1028
- // withdrawn) and to 622410b in this refresh (+1: `active_protective_order`,
1134
+ // withdrawn) and to 622410b in the next refresh (+1: `active_protective_order`,
1029
1135
  // minted upstream 2026-08-08, `code_status: canonical`, plus the projected-
1030
- // field revisions on 136-007 / 136-094); scoringEmits is unchanged,
1031
- // so the 2 SCORING_AHEAD_OF_CATALOG codes remain ahead of the catalog
1032
- // exactly as before.
1136
+ // field revisions on 136-007 / 136-094); scoringEmits was unchanged there,
1137
+ // so the 2 SCORING_AHEAD_OF_CATALOG codes remained ahead of the catalog.
1138
+ //
1139
+ // 2026-10-06 — coreIndicators 622410b -> c53378f (214 -> 220: +6 upstream
1140
+ // mints `disclosed_fear_at_intake`, `does_not_control_housing`,
1141
+ // `oppressive_home_life`, `recent_separation`, `survival_sex`,
1142
+ // `unable_to_speak_freely`; 0 withdrawn; plus 1 projected-field revision,
1143
+ // the `exploitative_pricing_tier_low` (136-061) definition). scoringEmits
1144
+ // 9b5d654 -> 9c209cf (169 -> 174: +8 emitted / -3). The -3 includes both
1145
+ // SCORING_AHEAD_OF_CATALOG codes (`coercive_debt_pressure_youth`,
1146
+ // `debt_terms_deceptive_youth`): scoring now emits only the canonical
1147
+ // `coercive_debt_pressure` / `debt_terms_deceptive`, whose upstream rows
1148
+ // carry the `_youth` names as `legacy_aliases`, and the catalog never
1149
+ // adopted the `_youth` codes. They leave the allowlist (now EMPTY) but are
1150
+ // NOT withdrawn: PAVE 2.0 `develop` still writes both from the IDA, so
1151
+ // they become DEPRECATED rows (`CVC136_DEPRECATED`) with their canonical
1152
+ // successors — the CVC-69 v1.1.0 shape. The SOT file moves to v1.1.0 in
1153
+ // the same change (non-additive content under a published version trips
1154
+ // the seeder's §9.1.2 guard). cvcIndex stays at 622410b (not refreshed).
1033
1155
  //
1034
1156
  // coreIndicators was WIDENED (not bumped) to carry the projected `fields`
1035
1157
  // that GATE H enforces — same SHA, same 214 codes, more of what the catalog
@@ -1056,10 +1178,10 @@ describe("SOT pins carry their provenance", () => {
1056
1178
  // written next to it. This is the shape every reserved-row authoring should
1057
1179
  // take: bind, do not bump.
1058
1180
  expect(cvcIndexPin.sourceSha).toBe("622410b");
1059
- expect(coreIndicatorsPin.sourceSha).toBe("622410b");
1060
- expect(scoringEmitsPin.sourceSha).toBe("9b5d654");
1181
+ expect(coreIndicatorsPin.sourceSha).toBe("c53378f");
1182
+ expect(scoringEmitsPin.sourceSha).toBe("9c209cf");
1061
1183
  expect(Object.keys(cvcIndexPin.numbers).length, "cvcIndexPin.numbers rows").toBe(86);
1062
- expect(coreIndicatorsPin.codes.length).toBe(214);
1063
- expect(scoringEmitsPin.codes.length).toBe(169);
1184
+ expect(coreIndicatorsPin.codes.length).toBe(220);
1185
+ expect(scoringEmitsPin.codes.length).toBe(174);
1064
1186
  });
1065
1187
  });
@@ -663,7 +663,9 @@ const SOT_SPECS: readonly SotSpec[] = [
663
663
  { file: "coreDhState.v1.0.0.json", domain: "dh_state", expectedCount: 9 },
664
664
  // 0.8.14: 214 -> 219 (catalog refresh a596eb9 -> 84a1b67; +5 mints, 0 withdrawn).
665
665
  // 622410b refresh: 219 -> 220 (catalog refresh 84a1b67 -> 622410b; +1 mint, 0 withdrawn).
666
- { file: "coreIndicators.v1.0.0.json", domain: "core_indicators", expectedCount: 220 },
666
+ // c53378f refresh: 220 -> 224 (catalog refresh 622410b -> c53378f; +6 mints, 0 withdrawn
667
+ // upstream; the 2 scoring-ahead `_youth` codes withdrawn — hti-scoring 9c209cf no longer emits them).
668
+ { file: "coreIndicators.v1.1.0.json", domain: "core_indicators", expectedCount: 226 },
667
669
  { file: "riskSeverityBand.v1.0.0.json", domain: "risk_severity_band", expectedCount: 9 },
668
670
  { file: "adminRoles.v1.0.0.json", domain: "admin_roles", expectedCount: 14 },
669
671
  { file: "userRoles.v1.0.0.json", domain: "user_roles", expectedCount: 19 },
@@ -190,7 +190,7 @@ const SOT_FILES: readonly SotFile[] = [
190
190
  { file: "assertionDomain.v1.1.0.json", expectedDomain: "assertion_domain" },
191
191
  // ─── 0.8.13 canonical CVC batch ───
192
192
  { file: "coreDhState.v1.0.0.json", expectedDomain: "dh_state" },
193
- { file: "coreIndicators.v1.0.0.json", expectedDomain: "core_indicators" },
193
+ { file: "coreIndicators.v1.1.0.json", expectedDomain: "core_indicators" },
194
194
  { file: "riskSeverityBand.v1.0.0.json", expectedDomain: "risk_severity_band" },
195
195
  { file: "adminRoles.v1.0.0.json", expectedDomain: "admin_roles" },
196
196
  { file: "userRoles.v1.0.0.json", expectedDomain: "user_roles" },
@@ -5421,11 +5421,11 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5421
5421
  categoryLabel: CVC_136_CATEGORY_LABELS[category],
5422
5422
  }));
5423
5423
 
5424
- // ─── CVC-136: full core-indicators value set (CANONICAL, 216 codes) ─────
5424
+ // ─── CVC-136: full core-indicators value set (CANONICAL, 220 codes) ─────
5425
5425
  // The complete CVC-136 'core - indicators' vocabulary. As of 0.8.13 the
5426
5426
  // AUTHORITATIVE surface for this domain is the SOT JSON
5427
- // `src/cvcs/coreIndicators.v1.0.0.json` (220 entries = 216 substantive + the
5428
- // missingness quadruplet), which also carries the canonical `family`,
5427
+ // `src/cvcs/coreIndicators.v1.1.0.json` (226 entries = 220 live + 2 deprecated
5428
+ // + the missingness quadruplet), which also carries the canonical `family`,
5429
5429
  // `polarity`, `severity`, `isAlert` and `alertWhen` entry attributes. This
5430
5430
  // hand-coded array is kept in lockstep with that JSON as a flat key list for
5431
5431
  // existing importers; it is generated FROM it and must not diverge.
@@ -5535,6 +5535,88 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5535
5535
  // (Two remaining JSON-vs-YAML differences are round-trip artifacts, not
5536
5536
  // drift: an unescaped `fiancé` and unwrapped hard-wrapped lines.)
5537
5537
  //
5538
+ // Refresh to c53378f — 216 → 220 (catalog refresh, prototype 622410b →
5539
+ // c53378f, +6 upstream mints, 0 withdrawn upstream; @hti/scoring 9b5d654 →
5540
+ // 9c209cf, `emits_by_code` 169 → 174 (+8 / −3); the release number is
5541
+ // assigned by the standalone chore(release) commit, not claimed here).
5542
+ // Six catalog codes were missing from CVC-136 (GATE H) and three of them
5543
+ // are now EMITTED by @hti/scoring 9c209cf (GATE A). All six are carried
5544
+ // VERBATIM from the catalog's projected fields (`label` / `definition` /
5545
+ // `family` / `polarity` / `severity` / `is_alert` / `alert_when`) and
5546
+ // APPENDED at positional codes 136-217…136-222 (alphabetical by key) so
5547
+ // every previously issued code keeps its number.
5548
+ // + disclosed_fear_at_intake (CVC136-SEED-DECANON 2026-08-28,
5549
+ // Crysta R6) — "Disclosed fear of a specific person";
5550
+ // `lethality_dv` / `increases_risk` / `elevated` /
5551
+ // `isAlert: "thread_pave"` / `alertWhen: "current_only"`. Catalog-only;
5552
+ // not in `emits_by_code`.
5553
+ // + does_not_control_housing (INDICATORS-HOUSING-HOME-LIFE-2026-10-06,
5554
+ // Crysta ruling 2026-10-06: the OCAT HT-9 concept; IS-2.5.3 Tier 2
5555
+ // adults / Tier 3 minors; tree IV-B-3e) — "Limited independence: does
5556
+ // not control where they live"; `mechanism_control` / `increases_risk`
5557
+ // / `elevated` / `isAlert: "none"`. Emitted by @hti/scoring 9c209cf.
5558
+ // + oppressive_home_life (same ship; the Initial Screen's former
5559
+ // orphan, IS-2.8.1, VIII-D-1) — "Oppressive, unsafe, or unstable home
5560
+ // life"; `vulnerability_context` / `increases_risk` / `elevated` /
5561
+ // `isAlert: "none"`. Emitted by @hti/scoring 9c209cf.
5562
+ // + recent_separation (upstream mint between 622410b and
5563
+ // c53378f) — "Recent separation from abusive partner"; the catalog
5564
+ // definition grounds it in Campbell's Danger Assessment (the period
5565
+ // after separation is the highest-risk window for intimate-partner
5566
+ // homicide — the signal is about having got out, not current
5567
+ // cohabitation); `lethality_dv` / `depends` / `elevated` /
5568
+ // `isAlert: "thread_pave"` / `alertWhen: "recency_under_year"`.
5569
+ // Emitted by @hti/scoring 9c209cf.
5570
+ // + survival_sex (upstream mint between 622410b and
5571
+ // c53378f) — "Survival sex (sex exchanged to meet basic needs)"; per
5572
+ // the catalog a standalone activity signal that asserts the
5573
+ // circumstance of the exchange, never a trafficking determination;
5574
+ // `cs_industry_context` / `depends` / `elevated` / `isAlert: "none"`.
5575
+ // Catalog-only; not in `emits_by_code`.
5576
+ // + unable_to_speak_freely (upstream mint between 622410b and
5577
+ // c53378f) — "Unable to speak freely"; per the catalog, a third party
5578
+ // controls the conversation (insists on being present, answers or
5579
+ // interprets for the person, or the person is never encountered
5580
+ // alone), distinct from `inability_to_account_for_self`;
5581
+ // `mechanism_control` / `depends` / `elevated` /
5582
+ // `isAlert: "thread_pave"` / `alertWhen: "current_only"`. Catalog-only;
5583
+ // not in `emits_by_code`.
5584
+ //
5585
+ // DEPRECATED — the 2 former scoring-ahead codes. `coercive_debt_pressure_youth`
5586
+ // (136-033) and `debt_terms_deceptive_youth` (136-050) were carried since
5587
+ // 0.8.13 ONLY because @hti/scoring emitted them ahead of the catalog
5588
+ // (`pendingUpstreamAdoption: true`; `SCORING_AHEAD_OF_CATALOG` allowlist
5589
+ // in `cvc-drift-gate.test.ts`). hti-scoring 9c209cf retired both emits in
5590
+ // favour of the canonical `coercive_debt_pressure` (136-032) /
5591
+ // `debt_terms_deceptive` (136-049), whose upstream rows carry the `_youth`
5592
+ // names as `legacy_aliases`; the catalog never adopted them, so they leave
5593
+ // the allowlist (now EMPTY — the guard stays). They are NOT removed: PAVE
5594
+ // 2.0 `develop` @ 07f3ccd still WRITES both from the In-Depth Assessment
5595
+ // (`IDA-syn-missing_care-4i` / `-4ii`, `rules/assessments/ida/emits.ts`)
5596
+ // and scores them from its 2026-07-17 vendored weights, so an assertion
5597
+ // already stored under either key must keep resolving here. Both rows
5598
+ // become `selectable: false` + `deprecated: true` + `supersededBy` their
5599
+ // canonical sibling — the CVC-69 v1.1.0 shape — and stay in this array
5600
+ // and label map as VALID STORED VALUES (validate with
5601
+ // `CVC_136_CORE_INDICATOR_VALUES`; offer only
5602
+ // `ACTIVE_CVC_136_CORE_INDICATOR_VALUES`; normalise with
5603
+ // `canonicalCoreIndicator()`). Positional codes 136-033 / 136-050 are
5604
+ // HELD by the deprecated rows and never reissued. Because this refresh is
5605
+ // non-additive (two rows lose `selectable`, one definition changes) the
5606
+ // SOT file moves 1.0.0 -> 1.1.0 (seeder §9.1.2; the #188/#190 precedent).
5607
+ // Thread `develop` @ 28580ab has no writer of either key.
5608
+ //
5609
+ // PROJECTED-FIELD REVISION carried in the same refresh:
5610
+ // • `exploitative_pricing_tier_low` (136-061) — definition revised from
5611
+ // "unusually low hourly price relative to local median" to the pooled
5612
+ // ad-population baseline (parsed hourly rates under $50/hr; CVC-277
5613
+ // core-CS_price_tier_band; Sarah 2026-07-22, about the bottom
5614
+ // quartile), with the SRS "relative to the local median" framing kept
5615
+ // on record as the unbuilt per-market refinement. Catalog text verbatim.
5616
+ // `coreIndicators.pin.json` is refreshed to c53378f (220 codes) and
5617
+ // `scoringEmits.pin.json` to 9c209cf (174 codes) in the same change;
5618
+ // `cvcIndex.pin.json` stays at 622410b.
5619
+ //
5538
5620
  // CVC_136_ALERT_INDICATOR above is a legacy Thread-only surface with NO
5539
5621
  // canonical basis; it is deliberately left untouched in 0.8.13 (a separate
5540
5622
  // Thread cleanup). The canonical alert axis is the `isAlert` ATTRIBUTE on
@@ -5597,7 +5679,9 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5597
5679
  "denied_basic_needs",
5598
5680
  "depends_on_employer_for_immigration_status",
5599
5681
  "depends_on_spouse_or_family_for_immigration_status",
5682
+ "disclosed_fear_at_intake",
5600
5683
  "does_not_control_finances_or_earnings",
5684
+ "does_not_control_housing",
5601
5685
  "does_not_control_identity_documents",
5602
5686
  "elevated_lethality_risk_signal",
5603
5687
  "employer_keeps_pay_or_pays_less_than_expected",
@@ -5659,6 +5743,7 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5659
5743
  "new_to_commercial_sex_industry",
5660
5744
  "non_consensual_photography_or_recording",
5661
5745
  "not_in_control_of_immigration_documentation",
5746
+ "oppressive_home_life",
5662
5747
  "other_instability_or_vulnerability_factors",
5663
5748
  "owes_money_and_cannot_pay_off",
5664
5749
  "paid_or_owes_fee_to_arrange_travel_to_us",
@@ -5678,6 +5763,7 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5678
5763
  "promise_of_work_different_than_current_work",
5679
5764
  "received_things_of_value_while_missing_from_care",
5680
5765
  "recent_le_engagement",
5766
+ "recent_separation",
5681
5767
  "recruited_by_third_party_into_cs_industry",
5682
5768
  "regular_alcohol_use",
5683
5769
  "relies_on_temporary_resources_for_basic_needs",
@@ -5725,6 +5811,7 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5725
5811
  "suicidal_ideation_history",
5726
5812
  "suicidal_ideation_recent",
5727
5813
  "suicide_attempt_history",
5814
+ "survival_sex",
5728
5815
  "third_party_advertises_or_posts_for_person",
5729
5816
  "third_party_arranged_commercial_sex_acts",
5730
5817
  "threats_by_employer_or_partner",
@@ -5740,6 +5827,7 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5740
5827
  "trauma_perpetrator_is_current_manager",
5741
5828
  "travel_organized_by_third_party",
5742
5829
  "tricked_or_pressured_into_unwanted_acts",
5830
+ "unable_to_speak_freely",
5743
5831
  "under_18_advertised_age",
5744
5832
  "under_18_appears_underage",
5745
5833
  "under_18_known_age",
@@ -5819,7 +5907,9 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5819
5907
  "denied_basic_needs": "Denied basic needs (food, water, sleep, medical care)",
5820
5908
  "depends_on_employer_for_immigration_status": "Depends on employer for immigration status (tied visa / living with employer)",
5821
5909
  "depends_on_spouse_or_family_for_immigration_status": "Depends on spouse / family member for immigration status (tied family visa)",
5910
+ "disclosed_fear_at_intake": "Disclosed fear of a specific person",
5822
5911
  "does_not_control_finances_or_earnings": "Limited independence: does not control finances or earnings",
5912
+ "does_not_control_housing": "Limited independence: does not control where they live",
5823
5913
  "does_not_control_identity_documents": "Limited independence: does not control identity documents",
5824
5914
  "elevated_lethality_risk_signal": "Elevated lethality risk",
5825
5915
  "employer_keeps_pay_or_pays_less_than_expected": "Employer keeps portion of pay or pays less than expected",
@@ -5881,6 +5971,7 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5881
5971
  "new_to_commercial_sex_industry": "New to commercial sex industry (recent entry / early experience)",
5882
5972
  "non_consensual_photography_or_recording": "Non-consensual photography or recording",
5883
5973
  "not_in_control_of_immigration_documentation": "Not in control of immigration documentation",
5974
+ "oppressive_home_life": "Oppressive, unsafe, or unstable home life",
5884
5975
  "other_instability_or_vulnerability_factors": "Other instability/vulnerability factors (general)",
5885
5976
  "owes_money_and_cannot_pay_off": "Unusual work circumstances: owes money and cannot pay it off (debt pressure)",
5886
5977
  "paid_or_owes_fee_to_arrange_travel_to_us": "Paid or owes fee to arrange travel to U.S. (migration debt)",
@@ -5900,6 +5991,7 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5900
5991
  "promise_of_work_different_than_current_work": "Promise of work differed from current work (migration deception)",
5901
5992
  "received_things_of_value_while_missing_from_care": "Received money, drugs, or other things of value from someone while missing from care (youth)",
5902
5993
  "recent_le_engagement": "Recent law enforcement engagement",
5994
+ "recent_separation": "Recent separation from abusive partner",
5903
5995
  "recruited_by_third_party_into_cs_industry": "Recruited by another person/entity into commercial sex industry",
5904
5996
  "regular_alcohol_use": "Regular alcohol use",
5905
5997
  "relies_on_temporary_resources_for_basic_needs": "Does not consistently meet basic needs / relies on temporary resources",
@@ -5947,6 +6039,7 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5947
6039
  "suicidal_ideation_history": "Suicidal ideation (past)",
5948
6040
  "suicidal_ideation_recent": "Suicidal ideation (recent)",
5949
6041
  "suicide_attempt_history": "Past suicide attempt disclosed",
6042
+ "survival_sex": "Survival sex (sex exchanged to meet basic needs)",
5950
6043
  "third_party_advertises_or_posts_for_person": "Third party posts or manages the person's commercial-sex ads",
5951
6044
  "third_party_arranged_commercial_sex_acts": "Someone else arranged commercial sex acts (posting, scheduling, managing)",
5952
6045
  "threats_by_employer_or_partner": "Threats by employer/partner (general)",
@@ -5962,6 +6055,7 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5962
6055
  "trauma_perpetrator_is_current_manager": "Trauma perpetrator is a current manager / facilitator (trauma-bonded control)",
5963
6056
  "travel_organized_by_third_party": "Travel organized by a third party (sex provider does not control own movement)",
5964
6057
  "tricked_or_pressured_into_unwanted_acts": "Tricked or pressured into unwanted acts or activities (generic coercion)",
6058
+ "unable_to_speak_freely": "Unable to speak freely",
5965
6059
  "under_18_advertised_age": "Under 18 (ad-derived / advertised age)",
5966
6060
  "under_18_appears_underage": "Under 18 (appears underage; investigator assessment)",
5967
6061
  "under_18_known_age": "Under 18 (known age)",
@@ -5982,6 +6076,72 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5982
6076
  "youth_watched_filmed_or_photographed_sexually_explicit": "Watched, filmed, or photographed in sexually explicit manner (youth)",
5983
6077
  };
5984
6078
 
6079
+ /**
6080
+ * The CVC-136 keys deprecated on 2026-10-06, each mapped to its canonical
6081
+ * successor (SOT `coreIndicators.v1.1.0.json`: `deprecated: true` +
6082
+ * `supersededBy`). The CVC-69 `INCIDENT_PARTICIPATION_ROLE_SUPERSEDED_BY`
6083
+ * shape.
6084
+ *
6085
+ * A deprecated key is still a VALID STORED VALUE: it stays in
6086
+ * `CVC_136_CORE_INDICATOR_VALUES`, keeps its label, and still resolves in the
6087
+ * seeded registry — nothing persisted has to be rewritten. It is only no
6088
+ * longer offered for NEW writes (`selectable: false` in the SOT;
6089
+ * `ACTIVE_CVC_136_CORE_INDICATOR_VALUES` below). PAVE 2.0 `develop` still
6090
+ * emits both from the IDA; until that emitter binds the canonical key, a
6091
+ * reader that groups or scores by indicator should pass stored values
6092
+ * through `canonicalCoreIndicator()`.
6093
+ *
6094
+ * The mapping follows the canonical catalog, which carries each `_youth` name
6095
+ * as a `legacy_alias` of the successor row: the meaning is the same pattern
6096
+ * (coercive debt repayment / deceptive debt terms) with the youth
6097
+ * missing-from-care context moved off the code and onto the instrument.
6098
+ */
6099
+ export const CVC_136_CORE_INDICATOR_SUPERSEDED_BY = {
6100
+ coercive_debt_pressure_youth: "coercive_debt_pressure",
6101
+ debt_terms_deceptive_youth: "debt_terms_deceptive",
6102
+ } as const satisfies Partial<Record<CVC136CoreIndicator, CVC136CoreIndicator>>;
6103
+
6104
+ export type DeprecatedCVC136CoreIndicator =
6105
+ keyof typeof CVC_136_CORE_INDICATOR_SUPERSEDED_BY;
6106
+
6107
+ /** `true` iff `code` is a deprecated (read-only, superseded) CVC-136 key. */
6108
+ export function isDeprecatedCoreIndicator(
6109
+ code: unknown,
6110
+ ): code is DeprecatedCVC136CoreIndicator {
6111
+ return (
6112
+ typeof code === "string" &&
6113
+ Object.prototype.hasOwnProperty.call(CVC_136_CORE_INDICATOR_SUPERSEDED_BY, code)
6114
+ );
6115
+ }
6116
+
6117
+ /**
6118
+ * The canonical CVC-136 key for a stored value: the successor of a deprecated
6119
+ * key, otherwise the value unchanged. Pure; never validates — an unknown
6120
+ * string is returned as-is.
6121
+ */
6122
+ export function canonicalCoreIndicator<T extends string>(
6123
+ code: T,
6124
+ ): T | CVC136CoreIndicator {
6125
+ return isDeprecatedCoreIndicator(code)
6126
+ ? CVC_136_CORE_INDICATOR_SUPERSEDED_BY[code]
6127
+ : code;
6128
+ }
6129
+
6130
+ /** A CVC-136 key that may be written fresh: any value except the deprecated keys. */
6131
+ export type ActiveCVC136CoreIndicator = Exclude<
6132
+ CVC136CoreIndicator,
6133
+ DeprecatedCVC136CoreIndicator
6134
+ >;
6135
+
6136
+ /**
6137
+ * Every CVC-136 key that may be WRITTEN fresh: `CVC_136_CORE_INDICATOR_VALUES`
6138
+ * minus the deprecated keys. Use `CVC_136_CORE_INDICATOR_VALUES` to VALIDATE
6139
+ * stored values.
6140
+ */
6141
+ export const ACTIVE_CVC_136_CORE_INDICATOR_VALUES = CVC_136_CORE_INDICATOR_VALUES.filter(
6142
+ (v): v is ActiveCVC136CoreIndicator => !isDeprecatedCoreIndicator(v),
6143
+ );
6144
+
5985
6145
  // ─── CVC-67: HMIS Sex ────────────────────────────────────────────────────────
5986
6146
  // Biological sex for HMIS (Homeless Management Information System) reporting.
5987
6147
  // HUD 4.21 mapping - single select. Effective Oct 1, 2025.