@htilabs/platform-common-models 0.8.24 → 0.12.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 (91) hide show
  1. package/dist/config/index.cjs +81 -0
  2. package/dist/config/index.cjs.map +1 -1
  3. package/dist/config/index.d.cts +79 -4
  4. package/dist/config/index.d.ts +79 -4
  5. package/dist/config/index.js +79 -1
  6. package/dist/config/index.js.map +1 -1
  7. package/dist/constants/index.cjs +2 -18
  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 -18
  12. package/dist/constants/index.js.map +1 -1
  13. package/dist/{cvcEntry-ctHTp2df.d.cts → cvcEntry-BCj1OWqL.d.cts} +44 -44
  14. package/dist/{cvcEntry-ctHTp2df.d.ts → cvcEntry-BCj1OWqL.d.ts} +44 -44
  15. package/dist/cvcs/index.cjs +217 -6674
  16. package/dist/cvcs/index.cjs.map +1 -1
  17. package/dist/cvcs/index.d.cts +8057 -15024
  18. package/dist/cvcs/index.d.ts +8057 -15024
  19. package/dist/cvcs/index.js +217 -6662
  20. package/dist/cvcs/index.js.map +1 -1
  21. package/dist/{index-qreOzXYS.d.cts → index-CoVr1jIV.d.cts} +1 -1
  22. package/dist/{index-4DiJrn7y.d.ts → index-I-DiX9eQ.d.ts} +1 -1
  23. package/dist/index.cjs +230 -7217
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +26 -588
  26. package/dist/index.d.ts +26 -588
  27. package/dist/index.js +230 -7193
  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/mongo/index.cjs +1 -0
  32. package/dist/mongo/index.cjs.map +1 -1
  33. package/dist/mongo/index.js +2 -1
  34. package/dist/mongo/index.js.map +1 -1
  35. package/dist/{platform-auth-91Hcl8F8.d.cts → platform-auth-v53r3BhN.d.cts} +3 -4
  36. package/dist/{platform-auth-91Hcl8F8.d.ts → platform-auth-v53r3BhN.d.ts} +3 -4
  37. package/dist/schemas/index.cjs +1 -5
  38. package/dist/schemas/index.cjs.map +1 -1
  39. package/dist/schemas/index.d.cts +35 -35
  40. package/dist/schemas/index.d.ts +35 -35
  41. package/dist/schemas/index.js +1 -5
  42. package/dist/schemas/index.js.map +1 -1
  43. package/dist/types/index.d.cts +2 -2
  44. package/dist/types/index.d.ts +2 -2
  45. package/dist/validation/index.cjs +0 -58
  46. package/dist/validation/index.cjs.map +1 -1
  47. package/dist/validation/index.d.cts +283 -82
  48. package/dist/validation/index.d.ts +283 -82
  49. package/dist/validation/index.js +0 -57
  50. package/dist/validation/index.js.map +1 -1
  51. package/package.json +22 -26
  52. package/src/__sot__/README.md +1 -36
  53. package/src/__sot__/coreIndicators.pin.json +2 -1936
  54. package/src/__sot__/cvcIndex.pin.json +4 -8
  55. package/src/__tests__/__snapshots__/cvc-sot.snap +13 -41
  56. package/src/__tests__/cvc-136-scoring-invariant.test.ts +3 -8
  57. package/src/__tests__/cvc-drift-gate.test.ts +12 -445
  58. package/src/__tests__/cvc-sot-snapshot.test.ts +11 -73
  59. package/src/__tests__/cvc-structural.test.ts +0 -14
  60. package/src/__tests__/runtime-contract-validator.test.ts +325 -1
  61. package/src/config/index.ts +189 -4
  62. package/src/constants/ic.ts +3 -120
  63. package/src/cvcs/assertionDomain.v1.1.0.json +1 -19
  64. package/src/cvcs/coreIndicators.v1.0.0.json +5 -83
  65. package/src/cvcs/incidentParticipationRoles.v1.0.0.json +1 -11
  66. package/src/cvcs/index.ts +0 -32
  67. package/src/cvcs/personRelationships.v1.0.0.json +2 -67
  68. package/src/cvcs/relationshipConcern.v1.0.0.json +19 -28
  69. package/src/cvcs/sessionTemplate.v1.0.0.json +0 -22
  70. package/src/cvcs/sharePurpose.v1.0.0.json +12 -80
  71. package/src/generated/cvc-enums.ts +20 -606
  72. package/src/validation/index.ts +0 -1
  73. package/dist/cvc-C7qdsXYK.d.cts +0 -298
  74. package/dist/cvc-C7qdsXYK.d.ts +0 -298
  75. package/src/__sot__/coreIndicatorFields.ts +0 -331
  76. package/src/__tests__/core-information-scope-invariant.test.ts +0 -134
  77. package/src/__tests__/cvc-181-182-country-parity.test.ts +0 -163
  78. package/src/__tests__/cvc-status-parser.test.ts +0 -150
  79. package/src/cvcs/assertionStatus.v1.0.0.json +0 -80
  80. package/src/cvcs/carCorrectionReason.v1.0.0.json +0 -89
  81. package/src/cvcs/caseShareState.v1.0.0.json +0 -62
  82. package/src/cvcs/coreInformationScope.v1.0.0.json +0 -1165
  83. package/src/cvcs/countries.v1.0.0.json +0 -3077
  84. package/src/cvcs/createdBySystem.v1.0.0.json +0 -89
  85. package/src/cvcs/criminalOrgCategory.v1.0.0.json +0 -116
  86. package/src/cvcs/determinationHelperCategories.v1.0.0.json +0 -1166
  87. package/src/cvcs/minorAdultStatus.v1.0.0.json +0 -80
  88. package/src/cvcs/referralOrigin.v1.0.0.json +0 -26
  89. package/src/cvcs/riskIdentificationMilestone.v1.0.0.json +0 -109
  90. package/src/cvcs/subjectType.v1.0.0.json +0 -80
  91. package/src/validation/cvcStatus.ts +0 -209
@@ -9,6 +9,16 @@
9
9
  * any other initialization that reads env vars. Build-phase variables
10
10
  * (phase: build) are NOT checked at runtime per R3.4.
11
11
  *
12
+ * validateAgainstContract also LOADS config, not just validates it: it applies
13
+ * the contract's per-tier defaults into process.env so that code reading
14
+ * process.env.FOO directly sees the same value the validator resolved. This is
15
+ * what removes the need for a materialized `.env.generated` file in local dev.
16
+ *
17
+ * Precedence, highest first:
18
+ * 1. .env.local — local developer overrides; beat everything
19
+ * 2. process.env — real deployed / materialized task-def values
20
+ * 3. contract default — spec.default[<tier>]
21
+ *
12
22
  * No secret VALUES are read, stored, or returned here. Secret env vars are
13
23
  * validated for presence but their values are never logged or exposed.
14
24
  *
@@ -16,7 +26,9 @@
16
26
  * const { validateAgainstContract } = require('@htilabs/platform-common-models/config');
17
27
  */
18
28
 
19
- import { readFileSync } from "node:fs";
29
+ import { existsSync, readFileSync } from "node:fs";
30
+ import { join } from "node:path";
31
+
20
32
  import { parse } from "yaml";
21
33
 
22
34
  // ─── Schema types (mirrors thread's runtime-config-lib.ts VariableSpec) ──────
@@ -65,6 +77,22 @@ export interface ValidateOptions {
65
77
  * Useful for tests. Defaults to false (production mode exits).
66
78
  */
67
79
  throwOnFailure?: boolean;
80
+ /**
81
+ * Apply the contract's defaults for the resolved env into process.env for
82
+ * every runtime variable that is not already set. Defaults to true.
83
+ * An existing process.env value is never overwritten.
84
+ */
85
+ applyDefaults?: boolean;
86
+ /**
87
+ * Load `.env.local` and apply it over process.env before anything else.
88
+ * Defaults to true; the file is optional, so a missing file is a no-op.
89
+ */
90
+ applyEnvLocal?: boolean;
91
+ /**
92
+ * Explicit path to the `.env.local` override file.
93
+ * Defaults to `<process.cwd()>/.env.local`.
94
+ */
95
+ envLocalPath?: string;
68
96
  }
69
97
 
70
98
  export interface EndpointOptions {
@@ -188,12 +216,160 @@ export function resolveDefault(
188
216
  return String(v);
189
217
  }
190
218
 
219
+ /**
220
+ * Write the contract's defaults for `env` into process.env for every
221
+ * runtime-phase variable that is not already set.
222
+ *
223
+ * A value already present in process.env — a real deployed env var, or one
224
+ * materialized into a task definition — always wins and is left untouched.
225
+ * An explicitly empty value ("") counts as present: it is a deliberate
226
+ * choice by whoever set it, and the required-variable check still rejects it.
227
+ *
228
+ * Build-phase variables are skipped (R3.4); secret variables are NOT skipped,
229
+ * so process.env agrees with the value the validator itself resolved. Secret
230
+ * values are never logged.
231
+ *
232
+ * Returns the names of the variables that were applied.
233
+ */
234
+ export function applyContractDefaults(
235
+ contract: ServiceContract,
236
+ env: string,
237
+ ): string[] {
238
+ const applied: string[] = [];
239
+
240
+ for (const [key, spec] of Object.entries(contract.variables)) {
241
+ if (spec.phase === "build") continue;
242
+ if (process.env[key] !== undefined) continue;
243
+
244
+ const value = resolveDefault(spec, env);
245
+ if (value === undefined) continue;
246
+
247
+ process.env[key] = value;
248
+ applied.push(key);
249
+ }
250
+
251
+ return applied;
252
+ }
253
+
254
+ // ─── .env.local overrides ────────────────────────────────────────────────────
255
+
256
+ /** `KEY=`, `export KEY=`; everything after the first `=` is the raw value. */
257
+ const DOTENV_LINE = /^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=(.*)$/;
258
+
259
+ /** Index of the next `quote` not preceded by a backslash, or -1. */
260
+ function indexOfUnescaped(s: string, quote: string): number {
261
+ for (let i = 0; i < s.length; i += 1) {
262
+ if (s[i] === "\\") {
263
+ i += 1;
264
+ continue;
265
+ }
266
+ if (s[i] === quote) return i;
267
+ }
268
+ return -1;
269
+ }
270
+
271
+ /**
272
+ * Parse `.env` file content into a plain object.
273
+ *
274
+ * Supported: blank lines, `#` comments, an optional `export ` prefix,
275
+ * single-quoted / double-quoted / backtick-quoted values (which may span
276
+ * multiple lines), and `\n` `\r` `\t` `\\` escapes inside double quotes.
277
+ * An unquoted value ends at a ` #` inline comment, so `#` may still be used
278
+ * freely inside a quoted value or in the middle of a bare word.
279
+ *
280
+ * Malformed lines are skipped rather than thrown on: a typo in a developer's
281
+ * local override file should not take down the whole process.
282
+ */
283
+ export function parseDotenv(content: string): Record<string, string> {
284
+ const out: Record<string, string> = {};
285
+ const lines = content.split(/\r?\n/);
286
+
287
+ for (let i = 0; i < lines.length; i += 1) {
288
+ const trimmed = lines[i].trim();
289
+ if (trimmed === "" || trimmed.startsWith("#")) continue;
290
+
291
+ const match = DOTENV_LINE.exec(trimmed);
292
+ if (!match) continue;
293
+
294
+ const key = match[1];
295
+ const rest = match[2].trim();
296
+ const quote = rest.charAt(0);
297
+
298
+ if (quote === '"' || quote === "'" || quote === "`") {
299
+ // Quoted value — keep consuming lines until the closing quote.
300
+ let body = rest.slice(1);
301
+ let end = indexOfUnescaped(body, quote);
302
+ while (end === -1 && i + 1 < lines.length) {
303
+ i += 1;
304
+ body += `\n${lines[i]}`;
305
+ end = indexOfUnescaped(body, quote);
306
+ }
307
+ if (end === -1) continue; // unterminated quote — skip the entry
308
+
309
+ const value = body.slice(0, end);
310
+ out[key] =
311
+ quote === '"'
312
+ ? value
313
+ .replace(/\\n/g, "\n")
314
+ .replace(/\\r/g, "\r")
315
+ .replace(/\\t/g, "\t")
316
+ .replace(/\\"/g, '"')
317
+ .replace(/\\\\/g, "\\")
318
+ : value;
319
+ continue;
320
+ }
321
+
322
+ out[key] = rest.split(/\s+#/)[0].trimEnd();
323
+ }
324
+
325
+ return out;
326
+ }
327
+
328
+ /**
329
+ * Apply `.env.local` over process.env.
330
+ *
331
+ * `.env.local` has the last word in local development: it overwrites values
332
+ * already present in process.env, and it runs before defaults are applied, so
333
+ * it also beats every contract default. It may declare variables the contract
334
+ * does not know about — a developer can add config without editing the
335
+ * contract. The file is optional; a missing file is a no-op.
336
+ *
337
+ * Returns the names of the variables that were applied.
338
+ */
339
+ export function applyEnvLocal(path?: string): string[] {
340
+ const file = path ?? join(process.cwd(), ".env.local");
341
+ if (!existsSync(file)) return [];
342
+
343
+ let raw: string;
344
+ try {
345
+ raw = readFileSync(file, "utf8");
346
+ } catch (err) {
347
+ const msg = err instanceof Error ? err.message : String(err);
348
+ throw new Error(`[platform-common/config] Cannot read ${file}: ${msg}`);
349
+ }
350
+
351
+ const parsed = parseDotenv(raw);
352
+ for (const [key, value] of Object.entries(parsed)) {
353
+ process.env[key] = value;
354
+ }
355
+
356
+ return Object.keys(parsed);
357
+ }
358
+
191
359
  // ─── validateAgainstContract ─────────────────────────────────────────────────
192
360
 
193
361
  /**
194
- * Parse `runtimeYamlPath`, coerce every runtime-phase variable from
195
- * `process.env` (with per-env defaults applied), and fail fast on any
196
- * missing or invalid required variable (R3.2).
362
+ * Parse `runtimeYamlPath`, load config into `process.env`, coerce every
363
+ * runtime-phase variable, and fail fast on any missing or invalid required
364
+ * variable (R3.2).
365
+ *
366
+ * Loading happens before validation, in precedence order:
367
+ * 1. `.env.local` is applied over process.env (opts.applyEnvLocal)
368
+ * 2. contract defaults for the resolved env fill anything still unset
369
+ * (opts.applyDefaults)
370
+ *
371
+ * `.env.local` is applied first so a developer can set NODE_ENV there and
372
+ * have it select the tier whose defaults are applied.
197
373
  *
198
374
  * Build-phase variables (phase: build) are skipped per R3.4.
199
375
  *
@@ -204,11 +380,20 @@ export function validateAgainstContract(
204
380
  opts: ValidateOptions = {},
205
381
  ): TypedConfig {
206
382
  const contract = loadContract(runtimeYamlPath);
383
+
384
+ if (opts.applyEnvLocal !== false) {
385
+ applyEnvLocal(opts.envLocalPath);
386
+ }
387
+
207
388
  const env =
208
389
  opts.env ??
209
390
  (process.env.NODE_ENV as string | undefined) ??
210
391
  "local";
211
392
 
393
+ if (opts.applyDefaults !== false) {
394
+ applyContractDefaults(contract, env);
395
+ }
396
+
212
397
  const errors: string[] = [];
213
398
  const result: TypedConfig = {};
214
399
 
@@ -1986,7 +1986,6 @@ export const INCIDENT_PARTICIPATION_ROLE = {
1986
1986
  DATA_ENTRY: "data_entry",
1987
1987
  OTHER_INCIDENT_RESPONDER: "other_incident_responder",
1988
1988
  RESPONDING_OFFICER: "responding_officer",
1989
- LEGAL_PROFESSIONAL: "legal_professional",
1990
1989
  UNKNOWN: "unknown",
1991
1990
  ANONYMOUS: "anonymous",
1992
1991
  DATA_NOT_COLLECTED: "data_not_collected",
@@ -2007,7 +2006,6 @@ export const INCIDENT_PARTICIPATION_ROLE_VALUES = [
2007
2006
  INCIDENT_PARTICIPATION_ROLE.DATA_ENTRY,
2008
2007
  INCIDENT_PARTICIPATION_ROLE.OTHER_INCIDENT_RESPONDER,
2009
2008
  INCIDENT_PARTICIPATION_ROLE.RESPONDING_OFFICER,
2010
- INCIDENT_PARTICIPATION_ROLE.LEGAL_PROFESSIONAL,
2011
2009
  INCIDENT_PARTICIPATION_ROLE.UNKNOWN,
2012
2010
  INCIDENT_PARTICIPATION_ROLE.ANONYMOUS,
2013
2011
  INCIDENT_PARTICIPATION_ROLE.DATA_NOT_COLLECTED,
@@ -2032,7 +2030,6 @@ export const INCIDENT_PARTICIPATION_ROLE_LABELS: Record<
2032
2030
  [INCIDENT_PARTICIPATION_ROLE.OTHER_INCIDENT_RESPONDER]:
2033
2031
  "VSP or Other Incident Responder",
2034
2032
  [INCIDENT_PARTICIPATION_ROLE.RESPONDING_OFFICER]: "LE Responding Officer",
2035
- [INCIDENT_PARTICIPATION_ROLE.LEGAL_PROFESSIONAL]: "Legal Professional",
2036
2033
  [INCIDENT_PARTICIPATION_ROLE.UNKNOWN]: "Unknown",
2037
2034
  [INCIDENT_PARTICIPATION_ROLE.ANONYMOUS]: "Anonymous",
2038
2035
  [INCIDENT_PARTICIPATION_ROLE.DATA_NOT_COLLECTED]: "Not Collected",
@@ -2059,7 +2056,6 @@ export const PARTICIPATION_ROLE_CATEGORIES = {
2059
2056
  SYSTEM_PROFESSIONAL: [
2060
2057
  INCIDENT_PARTICIPATION_ROLE.SERVICE_PROVIDER_STAFF,
2061
2058
  INCIDENT_PARTICIPATION_ROLE.MEDICAL_PROVIDER_STAFF,
2062
- INCIDENT_PARTICIPATION_ROLE.LEGAL_PROFESSIONAL,
2063
2059
  ],
2064
2060
  } as const;
2065
2061
 
@@ -2636,20 +2632,6 @@ export const CVC_122_LABELS: Record<CVC122Value, string> = {
2636
2632
 
2637
2633
  // ─── CVC-181: Countries (ISO 3166-1 alpha-2) ────────────────────────
2638
2634
  // Full list of countries using ISO 3166-1 alpha-2 codes.
2639
- //
2640
- // AS OF 2026-08-26 THE SOT IS `src/cvcs/countries.v1.0.0.json`, authored from the
2641
- // canonical `core - countries — codebook 2.csv`. These two constants predate it and
2642
- // are RETAINED for existing consumers; new code should import `CountryKeys` from
2643
- // `src/generated/cvc-enums.ts` (or `countriesSot`) instead.
2644
- //
2645
- // The ISO SET here is exact — all 249 codes, no additions, no omissions, verified
2646
- // against the codebook. `CVC_181_LABELS`, however, carries SHORT-FORM display labels
2647
- // that differ from the canonical label on 16 codes: BO, CD, IR, KP, KR, LA, MK, FM,
2648
- // MD, PS, SH, SY, TW, TZ, VE, VN ("Vietnam" vs "Viet Nam", "Korea, South" vs "Korea,
2649
- // Republic of", …). The SOT JSON carries the canonical spelling verbatim in both
2650
- // `title` and `canonicalLabel`. That divergence is display-only — nothing keys off
2651
- // these strings — but it is real, and collapsing the two surfaces onto one label set
2652
- // is its own decision (a visible UI change), deliberately not made here.
2653
2635
 
2654
2636
  export const CVC_181_COUNTRIES = {
2655
2637
  US: "US",
@@ -5263,10 +5245,10 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5263
5245
  categoryLabel: CVC_136_CATEGORY_LABELS[category],
5264
5246
  }));
5265
5247
 
5266
- // ─── CVC-136: full core-indicators value set (CANONICAL, 216 codes) ─────
5248
+ // ─── CVC-136: full core-indicators value set (CANONICAL, 210 codes) ─────
5267
5249
  // The complete CVC-136 'core - indicators' vocabulary. As of 0.8.13 the
5268
5250
  // AUTHORITATIVE surface for this domain is the SOT JSON
5269
- // `src/cvcs/coreIndicators.v1.0.0.json` (220 entries = 216 substantive + the
5251
+ // `src/cvcs/coreIndicators.v1.0.0.json` (214 entries = 210 substantive + the
5270
5252
  // missingness quadruplet), which also carries the canonical `family`,
5271
5253
  // `polarity`, `severity`, `isAlert` and `alertWhen` entry attributes. This
5272
5254
  // hand-coded array is kept in lockstep with that JSON as a flat key list for
@@ -5290,93 +5272,6 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
5290
5272
  // `emits_by_code` (weights/risk.weights.json @ 9b5d654) is present here.
5291
5273
  // Enforced by `src/__tests__/cvc-136-scoring-invariant.test.ts`.
5292
5274
  //
5293
- // 0.8.14 — 210 → 215 (catalog refresh, prototype a596eb9 → 84a1b677).
5294
- // The upstream catalog grew by 5 and withdrew none. All five are minted
5295
- // upstream with `code_status: canonical` (three carry the 2026-07-17
5296
- // TRA-vetting provenance), so this is catalog CATCH-UP, not invention —
5297
- // GATE B in `cvc-drift-gate.test.ts` flagged them only because the pin was
5298
- // stale. `coreIndicators.pin.json` is refreshed to 84a1b677 (213 codes) in
5299
- // the same change; the 2 scoring-ahead codes remain absent upstream and
5300
- // stay on the `SCORING_AHEAD_OF_CATALOG` allowlist, unchanged.
5301
- // + clients_unaware_of_third_party_coordination (TRA-7-aware)
5302
- // + depends_on_spouse_or_family_for_immigration_status (TRA-14 × TRA-22)
5303
- // + sexualized_content_in_person_performance_activity (DH § II 2.2.3)
5304
- // + sexualized_content_online_performance_activity (DH § II 2.2.2)
5305
- // + trauma_perpetrator_is_current_manager (engine-derived)
5306
- // PAVE 2.0 needs the first two to express `trafficking_risk_assessment`
5307
- // emissions; without them the TRA writes assertions against codes that
5308
- // resolve to nothing.
5309
- // New SOT entries are APPENDED at positional codes 136-211…136-215 so
5310
- // every previously issued code keeps its number.
5311
- //
5312
- // Refresh to 622410b — 215 → 216 (catalog refresh, prototype 84a1b67 →
5313
- // 622410b; the release number is assigned by the standalone chore(release)
5314
- // commit, not claimed here).
5315
- // The upstream catalog grew by 1 and withdrew none, so this is again
5316
- // catalog CATCH-UP rather than net-new authoring: GATE B would have
5317
- // reported the code as INVENTED only because the pin was stale.
5318
- // + active_protective_order (AE-3 / q-ar-3)
5319
- // Minted upstream 2026-08-08 with `code_status: canonical` (prototype
5320
- // `4b3d40e4`, "Catalogue the protective-order disclosure"), emitted by the
5321
- // INTAKE_MAP on `q-ar-3 == yes`. Definition, `family`, `polarity`,
5322
- // `severity` and `is_alert` are carried VERBATIM from the catalog:
5323
- // `lethality_dv` / `depends` / `caution` / `none`. The `isAlert: "none"`
5324
- // is load-bearing and deliberate — per the Crysta ruling of 2026-08-08 the
5325
- // code is catalogued DESCRIPTIVE and is NOT tree-mapped, because an order
5326
- // is a protective act, not an alert condition; tree-mapping it would score
5327
- // a survivor higher for having sought court protection. The counterparty-
5328
- // gated scoring reads live elsewhere (`protection_order_against_trafficker`
5329
- // on the Severity model; perpetrator leaf P-II-D). The signal reaches the
5330
- // Severity model through the catalog's `lane_tiers`
5331
- // (safety_planning: elevated · domestic_family_violence: review), which is
5332
- // not a platform-common surface.
5333
- // PAVE 2.0 needs this to express the AE-3 intake emission; without it the
5334
- // AE instrument writes an assertion against a code that resolves to
5335
- // nothing. `coreIndicators.pin.json` is refreshed to 622410b (214 codes)
5336
- // in the same change; the 2 scoring-ahead codes remain absent upstream and
5337
- // stay on the `SCORING_AHEAD_OF_CATALOG` allowlist, unchanged at exactly 2.
5338
- // The new SOT entry is APPENDED at positional code 136-216 so every
5339
- // previously issued code keeps its number.
5340
- //
5341
- // NOT ADDED, deliberately: `substance_use_concerns`. It is NOT a code in
5342
- // the canonical catalog — it is a `legacy_aliases` member of the canonical
5343
- // `serious_substance_use_or_introduced_to_drugs` (136-142, shipped since
5344
- // 0.8.13, `vulnerability_context` / `depends` / `elevated` /
5345
- // `isAlert: "pave"` / `alertWhen: "recency_under_year"`). Adding it as its
5346
- // own code would be exactly the invention GATE B exists to stop. Consumers
5347
- // binding a BH-2 substance-use emission must bind the canonical key.
5348
- //
5349
- // PROJECTED-FIELD REVISIONS carried in the same refresh. A pin bump is a
5350
- // promise of FULL conformance to the pinned catalog, not just of its new
5351
- // codes — the 84a1b67 → 622410b delta also revised two shipping codes, and
5352
- // both are carried here (SOT JSON + this label map):
5353
- // • `acknowledgement_or_report_of_human_trafficking` (136-007) — label
5354
- // "Acknowledgement or report of human trafficking" →
5355
- // "Human trafficking disclosure or report".
5356
- // • `juvenile_justice_or_child_welfare_involvement` (136-094) —
5357
- // definition gained "(system unspecified — deprecated combined code;
5358
- // see read-time alias policy above)". LOAD-BEARING: the definition is
5359
- // the only projected field that tells a consumer this code is
5360
- // DEPRECATED. Upstream split it 2026-06-08 (Ava) into
5361
- // `juvenile_justice_system_involvement` (136-095) +
5362
- // `child_welfare_system_involvement` at the Core Profile capture layer,
5363
- // and the Phase 2C combined→split migration (2026-08-02, Crysta) makes
5364
- // the read-time alias policy binding: the row is NEVER deleted and
5365
- // stored CARs are NEVER rewritten — a combined-code CAR resolves at
5366
- // read/aggregation time as BOTH split codes, so any consumer keyed by a
5367
- // split code must also key this one. Residual emitters are only the
5368
- // captures that genuinely cannot name the system (IS-3.2.4 manual Yes;
5369
- // TRA-34c parent-category-selected with no system subtype). The full
5370
- // policy text lives in the catalog comment block above the row in
5371
- // `data/core_indicators.yaml` @ 622410b.
5372
- // Also reconciled here, INHERITED from the previous refresh: the
5373
- // `sexualized_content_performance_activity` (136-146) definition. The
5374
- // a596eb9 → 84a1b67 delta appended the SEXUALIZED-CONTENT-SPLIT-2026-07-15
5375
- // UMBRELLA NOTE to it, and 0.8.14 shipped the pin bump without it, so the
5376
- // definition has been stale since. It now carries the catalog text verbatim.
5377
- // (Two remaining JSON-vs-YAML differences are round-trip artifacts, not
5378
- // drift: an unescaped `fiancé` and unwrapped hard-wrapped lines.)
5379
- //
5380
5275
  // CVC_136_ALERT_INDICATOR above is a legacy Thread-only surface with NO
5381
5276
  // canonical basis; it is deliberately left untouched in 0.8.13 (a separate
5382
5277
  // Thread cleanup). The canonical alert axis is the `isAlert` ATTRIBUTE on
@@ -5391,7 +5286,6 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5391
5286
  "abuser_unemployed",
5392
5287
  "access_to_vulnerable_individuals",
5393
5288
  "acknowledgement_or_report_of_human_trafficking",
5394
- "active_protective_order",
5395
5289
  "ads_available_247",
5396
5290
  "ads_imply_multiple_workers",
5397
5291
  "ads_prost_slang",
@@ -5415,7 +5309,6 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5415
5309
  "cannot_stop_working_or_freely_leave",
5416
5310
  "child_not_abusers_in_household",
5417
5311
  "child_welfare_system_involvement",
5418
- "clients_unaware_of_third_party_coordination",
5419
5312
  "coerced_to_misrepresent_identity_or_activity",
5420
5313
  "coercive_debt_pressure",
5421
5314
  "coercive_debt_pressure_youth",
@@ -5438,7 +5331,6 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5438
5331
  "debt_terms_deceptive_youth",
5439
5332
  "denied_basic_needs",
5440
5333
  "depends_on_employer_for_immigration_status",
5441
- "depends_on_spouse_or_family_for_immigration_status",
5442
5334
  "does_not_control_finances_or_earnings",
5443
5335
  "does_not_control_identity_documents",
5444
5336
  "elevated_lethality_risk_signal",
@@ -5532,8 +5424,6 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5532
5424
  "several_cell_phones_or_frequent_number_changes",
5533
5425
  "sex_acts_in_own_residence",
5534
5426
  "sexual_exploitation",
5535
- "sexualized_content_in_person_performance_activity",
5536
- "sexualized_content_online_performance_activity",
5537
5427
  "sexualized_content_performance_activity",
5538
5428
  "shared_contact_network",
5539
5429
  "signs_of_physical_abuse_confinement_or_neglect",
@@ -5579,7 +5469,6 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
5579
5469
  "trafficking_experience_past_10plusy",
5580
5470
  "trafficking_experience_past_3to10y",
5581
5471
  "trafficking_experience_past_lt3y",
5582
- "trauma_perpetrator_is_current_manager",
5583
5472
  "travel_organized_by_third_party",
5584
5473
  "tricked_or_pressured_into_unwanted_acts",
5585
5474
  "under_18_advertised_age",
@@ -5612,8 +5501,7 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5612
5501
  "abuser_threatened_suicide": "Abuser threatened suicide",
5613
5502
  "abuser_unemployed": "Abuser is unemployed",
5614
5503
  "access_to_vulnerable_individuals": "Access to or connections with vulnerable individuals",
5615
- "acknowledgement_or_report_of_human_trafficking": "Human trafficking disclosure or report",
5616
- "active_protective_order": "Active protective order (client-reported)",
5504
+ "acknowledgement_or_report_of_human_trafficking": "Acknowledgement or report of human trafficking",
5617
5505
  "ads_available_247": "Advertises available anytime / 24-7",
5618
5506
  "ads_imply_multiple_workers": "Ads imply multiple workers",
5619
5507
  "ads_prost_slang": "Ad uses prostitution slang",
@@ -5637,7 +5525,6 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5637
5525
  "cannot_stop_working_or_freely_leave": "Cannot stop working or freely leave home/work",
5638
5526
  "child_not_abusers_in_household": "Child in household who is not the abuser's biological child",
5639
5527
  "child_welfare_system_involvement": "Child welfare system involvement (history)",
5640
- "clients_unaware_of_third_party_coordination": "Clients unaware they are coordinating with a third party (concealed dispatch)",
5641
5528
  "coerced_to_misrepresent_identity_or_activity": "Coerced to misrepresent age, identity, or work activity to outsiders",
5642
5529
  "coercive_debt_pressure": "Pressured to do things to pay off debt (coercive debt repayment)",
5643
5530
  "coercive_debt_pressure_youth": "Pressured to do things to pay off debt (youth missing-from-care)",
@@ -5660,7 +5547,6 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5660
5547
  "debt_terms_deceptive_youth": "Debt repayment terms differed from what was expected (youth missing-from-care)",
5661
5548
  "denied_basic_needs": "Denied basic needs (food, water, sleep, medical care)",
5662
5549
  "depends_on_employer_for_immigration_status": "Depends on employer for immigration status (tied visa / living with employer)",
5663
- "depends_on_spouse_or_family_for_immigration_status": "Depends on spouse / family member for immigration status (tied family visa)",
5664
5550
  "does_not_control_finances_or_earnings": "Limited independence: does not control finances or earnings",
5665
5551
  "does_not_control_identity_documents": "Limited independence: does not control identity documents",
5666
5552
  "elevated_lethality_risk_signal": "Elevated lethality risk",
@@ -5754,8 +5640,6 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5754
5640
  "several_cell_phones_or_frequent_number_changes": "Several cell phones or frequently changing phone number",
5755
5641
  "sex_acts_in_own_residence": "Sex acts take place in person's own residence",
5756
5642
  "sexual_exploitation": "Sexual exploitation (general)",
5757
- "sexualized_content_in_person_performance_activity": "In-person sexualized performance / appearance-based activity",
5758
- "sexualized_content_online_performance_activity": "Online sexual performance / interactive sexual content activity",
5759
5643
  "sexualized_content_performance_activity": "Sexualized content, performance, or communications activity",
5760
5644
  "shared_contact_network": "Shares a contact network (phones/handles)",
5761
5645
  "signs_of_physical_abuse_confinement_or_neglect": "Signs of physical abuse, confinement, or neglect (observed)",
@@ -5801,7 +5685,6 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
5801
5685
  "trafficking_experience_past_10plusy": "Trafficking experience recency: 10+ years since last experience",
5802
5686
  "trafficking_experience_past_3to10y": "Trafficking experience recency: 3–10 years since last experience",
5803
5687
  "trafficking_experience_past_lt3y": "Trafficking experience recency: less than 3 years since last experience",
5804
- "trauma_perpetrator_is_current_manager": "Trauma perpetrator is a current manager / facilitator (trauma-bonded control)",
5805
5688
  "travel_organized_by_third_party": "Travel organized by a third party (sex provider does not control own movement)",
5806
5689
  "tricked_or_pressured_into_unwanted_acts": "Tricked or pressured into unwanted acts or activities (generic coercion)",
5807
5690
  "under_18_advertised_age": "Under 18 (ad-derived / advertised age)",
@@ -2,7 +2,7 @@
2
2
  "domain": "assertion_domain",
3
3
  "name": "Assertion Domain (CVC-159)",
4
4
  "version": "2.0.0",
5
- "_status": "CANONICAL — RENUMBERED 0.8.13 from provisional CVC-964 to canonical CVC-159. Live prototype HEAD a596eb9: `Final CVCs` -> `core - assertion_domain` = CVC-159 (vocab_status 'Ready for dev', Verification 'Verified'), corroborated by 17 `data/cvcs/core_assertion_domain_extensions_*.yaml` files that all declare `cvc: core - assertion_domain`. CVC-159 was freed by deleting the 100%-unbound hand-coded `CVC_159_RELATIONSHIP_TIES` family from `src/constants/ic.ts`; `relationship_ties` keeps its canonical CVC-158. Consumers persist KEYS, not wire codes, so the renumber is compile-clean (regenerate `cvcKeys.ts`). WITHDRAWN in 0.8.13 (all three have ZERO occurrences at prototype HEAD): `romantic_relationship` (964-066) — upstream the romantic-partner lifecycle routes to `household_relationships`, see `data/cvcs/core_romantic_relationship_change_type.yaml`; `household_tenure` (964-045); `household_composition` (964-067). All three fold into `household_relationships` (554 occurrences at HEAD). NOTE: `romantic_partner` is a relationship-type VALUE code (1,575 occurrences), never an assertion domain — it is correctly not modelled here. `child_profile` (159-065) is KEPT: 353 occurrences at HEAD. Segment-2 ordinals are preserved across the renumber (gaps at 045/066/067 are intentional; no data migration exists, but stable ordinals keep the diff reviewable). The 37 domains PAVE ships that are absent from the Final CVC-159 export all have substantial upstream occurrence counts and are retained as proposed CVC-159 extensions. | 0.8.20: ADDED `signal_identification` (159-066) and `investigative_legal` (159-067) -- retroactive homing of the Track-1 identification-rung emitter live since 2026-08-23; both ratified in the CVC-159 codebook 2026-08-29 (prototype PR #519, hti-features PR #34). Ordinals 066/067 were free: the 0.8.13 withdrawals that reserved those slots were under the OLD CVC-964 numbering and the 159 equivalents were never issued -- verified zero references to 159-066/159-067 anywhere in the repo or the published dist before assigning. The 045 gap remains reserved. The rung VALUE set those two domains carry lives in its own vocabulary (`riskIdentificationMilestone`, CVC-267) rather than as Level-2 rows here: `AssertionDomainKeys` is consumed as THE SET OF DOMAINS, and folding values into it breaks that contract for every consumer -- PAVE's `Record<AssertionDomain, DomainValueVocabulary>` totality gate would demand a domain classification for `on_radar`. CVC-159 stays Level-1 only.",
5
+ "_status": "CANONICAL — RENUMBERED 0.8.13 from provisional CVC-964 to canonical CVC-159. Live prototype HEAD a596eb9: `Final CVCs` -> `core - assertion_domain` = CVC-159 (vocab_status 'Ready for dev', Verification 'Verified'), corroborated by 17 `data/cvcs/core_assertion_domain_extensions_*.yaml` files that all declare `cvc: core - assertion_domain`. CVC-159 was freed by deleting the 100%-unbound hand-coded `CVC_159_RELATIONSHIP_TIES` family from `src/constants/ic.ts`; `relationship_ties` keeps its canonical CVC-158. Consumers persist KEYS, not wire codes, so the renumber is compile-clean (regenerate `cvcKeys.ts`). WITHDRAWN in 0.8.13 (all three have ZERO occurrences at prototype HEAD): `romantic_relationship` (964-066) — upstream the romantic-partner lifecycle routes to `household_relationships`, see `data/cvcs/core_romantic_relationship_change_type.yaml`; `household_tenure` (964-045); `household_composition` (964-067). All three fold into `household_relationships` (554 occurrences at HEAD). NOTE: `romantic_partner` is a relationship-type VALUE code (1,575 occurrences), never an assertion domain — it is correctly not modelled here. `child_profile` (159-065) is KEPT: 353 occurrences at HEAD. Segment-2 ordinals are preserved across the renumber (gaps at 045/066/067 are intentional; no data migration exists, but stable ordinals keep the diff reviewable). The 37 domains PAVE ships that are absent from the Final CVC-159 export all have substantial upstream occurrence counts and are retained as proposed CVC-159 extensions.",
6
6
  "_source": "htilabstech/prototype@a596eb9 Final CVCs/Assertion Contract/core - assertion_domain.md (CVC-159) + 17 core_assertion_domain_extensions_*.yaml",
7
7
  "levels": {
8
8
  "0": "Unknown or Missing",
@@ -624,24 +624,6 @@
624
624
  "parentCode": null,
625
625
  "childCodes": [],
626
626
  "definition": "assertion_domain partition for CARs on a Child profile subject-record entity (Add Child / Edit Child; core_child_change_type verbs). DRAFT-TEMPORARY direct import from prototype, pending Notion ratification."
627
- },
628
- {
629
- "code": "159-066-000-000-000-000-000",
630
- "key": "signal_identification",
631
- "title": "Signal / Identification",
632
- "selectable": true,
633
- "parentCode": null,
634
- "childCodes": [],
635
- "definition": "The identification-funnel pipeline domain: a subject's position on the reach ladder (on_radar -> screened -> at_risk -> assessed), asserted by the `identification_rung_reached` CAR whose `assertion_value_code` is the rung (CVC-267). Ratified 2026-08-29 as retroactive codebook homing of a live emitter that has minted rung CARs since 2026-08-23 (Crysta ruling, milestone-residue R1). A rung CAR asserts that a subject REACHED a rung; it never restates a determination -- it joins the derived milestone row via `pm_ref`, and the derived row remains the derived row (a milestone row never IS the CAR). Distinct from `identification_status` (CVC-241), the identity-CONFIDENCE axis; per the 2026-06-30 naming directive that axis is named `identity_status` and 'identification ladder' is a retired synonym for it -- display copy for THIS domain says 'identification funnel' or 'pipeline rungs', never bare 'identification ladder'. The `determined` rung is filed under BOTH this domain and `investigative_legal` (ruling 2026-08-29); its STORED domain stays `investigative_legal` as built."
636
- },
637
- {
638
- "code": "159-067-000-000-000-000-000",
639
- "key": "investigative_legal",
640
- "title": "Investigative / Legal",
641
- "selectable": true,
642
- "parentCode": null,
643
- "childCodes": [],
644
- "definition": "The investigation-and-legal-process domain. Carries `TRAFFICKING_STATUS` (CVC-267) and is the STORED `assertion_domain` of the `determined` rung of the identification funnel -- the rung measures reaching a conclusion in a safe setting, not which conclusion, so a no-indication determination still counts. Ratified 2026-08-29 alongside `signal_identification`: it is live in the same emitter and was equally unhomed. Filed-under-both (ruling 2026-08-29): data relevant to multiple milestone topics is documented under every topic it is relevant for, while CVC-159's one-assertion-one-domain rule keeps the STORED domain single -- nothing re-mints."
645
627
  }
646
628
  ]
647
629
  }
@@ -2,8 +2,8 @@
2
2
  "domain": "core_indicators",
3
3
  "name": "Core Indicators (CVC-136)",
4
4
  "version": "1.0.0",
5
- "_status": "CANONICAL — re-sourced from the live canonical catalog `data/core_indicators.yaml` @ prototype HEAD 622410b (214 codes; +1 vs the 0.8.14 pin 84a1b67, 0 withdrawn, plus the projected-field revisions on 136-007 / 136-094 the same delta carried), plus 2 codes that @hti/scoring (`weights/risk.weights.json` @ 9b5d654, `emits_by_code`) emits but the codebook has not yet adopted (`coercive_debt_pressure_youth`, `debt_terms_deceptive_youth`), each flagged `pendingUpstreamAdoption: true`. 216 substantive + the missingness quadruplet = 220 entries. New codes are APPENDED at 216 so every previously issued positional code stays stable.",
6
- "_source": "htilabstech/prototype@622410b data/core_indicators.yaml + htilabstech/hti-scoring@9b5d654 weights/risk.weights.json (emits_by_code)",
5
+ "_status": "CANONICAL — re-sourced 0.8.13 from the live canonical catalog `data/core_indicators.yaml` @ prototype HEAD a596eb9 (208 codes), plus 2 codes that @hti/scoring (`weights/risk.weights.json` @ 9b5d654, `emits_by_code`) emits but the codebook has not yet adopted (`coercive_debt_pressure_youth`, `debt_terms_deceptive_youth`) = 210 substantive codes. 0.8.12 shipped 199 hand-coded codes in `src/constants/ic.ts` (`CVC_136_CORE_INDICATOR_VALUES`); 54 of those were invented rollup prefixes (`vc_*`, `csi_*`, `csctx_*`, `dv_*`, `net_*`, `auto_*`) with zero occurrences upstream and zero consumers in @hti/scoring, and 1 (`unusual_work_circumstances_general`) was coined from a label's parenthetical; all 55 are WITHDRAWN. 66 canonical codes that were missing are ADDED. Math: 199 - 1 - 54 + 66 = 210. HARD INVARIANT (enforced by `src/__tests__/cvc-136-scoring-invariant.test.ts`): every one of the 169 codes in @hti/scoring's `emits_by_code` is present in this domain. Entry attributes `family` / `polarity` / `severity` / `isAlert` / `alertWhen` are carried verbatim from the canonical catalog. `isAlert` is the ALERT AXIS: the alert list is a DERIVED VIEW over this domain (isAlert in {thread_pave, platform, pave}), not a separate taxonomy.",
6
+ "_source": "htilabstech/prototype@a596eb9 data/core_indicators.yaml + htilabstech/hti-scoring@9b5d654 weights/risk.weights.json (emits_by_code)",
7
7
  "levels": {
8
8
  "0": "Unknown or Missing",
9
9
  "1": "Indicator"
@@ -135,7 +135,7 @@
135
135
  {
136
136
  "code": "136-007-000-000-000-000-000",
137
137
  "key": "acknowledgement_or_report_of_human_trafficking",
138
- "title": "Human trafficking disclosure or report",
138
+ "title": "Acknowledgement or report of human trafficking",
139
139
  "selectable": true,
140
140
  "parentCode": null,
141
141
  "childCodes": [],
@@ -1286,7 +1286,7 @@
1286
1286
  "selectable": true,
1287
1287
  "parentCode": null,
1288
1288
  "childCodes": [],
1289
- "definition": "Indication of involvement with juvenile justice and/or child welfare systems (system unspecified — deprecated combined code; see read-time alias policy above).",
1289
+ "definition": "Indication of involvement with juvenile justice and/or child welfare systems.",
1290
1290
  "family": "vulnerability_context",
1291
1291
  "polarity": "depends",
1292
1292
  "severity": "elevated",
@@ -1976,7 +1976,7 @@
1976
1976
  "selectable": true,
1977
1977
  "parentCode": null,
1978
1978
  "childCodes": [],
1979
- "definition": "Canonical activity evidence (DH § II Activity 2.2 family) that the person engages in sexualized content, performance, or communications activity — recorded descriptively on a location capture; derivation happens in the risk tree. UMBRELLA NOTE (SEXUALIZED-CONTENT-SPLIT-2026-07-15, Crysta directive executing the 2026-07-15 Q2 ruling's codified path) — new capture that CAN distinguish online vs in-person fires the split variants below instead; this umbrella stays valid for existing captures and for sources that cannot make the distinction, and remains DOCK-ONLY in the DH (no prompt route — an honest prompt answer is impossible without the split).",
1979
+ "definition": "Canonical activity evidence (DH § II Activity 2.2 family) that the person engages in sexualized content, performance, or communications activity — recorded descriptively on a location capture; derivation happens in the risk tree.",
1980
1980
  "family": "cs_industry_context",
1981
1981
  "polarity": "increases_risk",
1982
1982
  "severity": "elevated",
@@ -2835,84 +2835,6 @@
2835
2835
  "polarity": "increases_risk",
2836
2836
  "severity": "elevated",
2837
2837
  "isAlert": "none"
2838
- },
2839
- {
2840
- "code": "136-211-000-000-000-000-000",
2841
- "key": "clients_unaware_of_third_party_coordination",
2842
- "title": "Clients unaware they are coordinating with a third party (concealed dispatch)",
2843
- "selectable": true,
2844
- "parentCode": null,
2845
- "childCodes": [],
2846
- "definition": "LEADS TRA-7-aware captured that sex buyers reaching out to \"the person\" are in fact coordinating with a third party (dispatcher / manager / call service) WITHOUT knowing it — a concealed-intermediary booking pattern. Concealment of the coordinating third party from buyers is a control + facilitation marker over and above third-party coordination itself (which TRA-7 sometimes/never + TRA-7-who already capture): the operation is actively passing as the provider. Authored 2026-07-17 (TRA-VETTING, Crysta: \"let's author one\") for the restored production follow-up question.",
2847
- "family": "mechanism_control",
2848
- "polarity": "increases_risk",
2849
- "severity": "elevated",
2850
- "isAlert": "none"
2851
- },
2852
- {
2853
- "code": "136-212-000-000-000-000-000",
2854
- "key": "depends_on_spouse_or_family_for_immigration_status",
2855
- "title": "Depends on spouse / family member for immigration status (tied family visa)",
2856
- "selectable": true,
2857
- "parentCode": null,
2858
- "childCodes": [],
2859
- "definition": "Indication the person's legal ability to remain in the U.S. depends on a spouse, fiancé(e), or family member (family/fiancé-based immigrant visa or derivative status) while their current status is a valid or overstayed visa. The family twin of depends_on_employer_for_immigration_status: a visa tied to a potentially abusive relationship is a major dependence vulnerability and a coercion lever (\"stay / comply or lose your status\"). Authored 2026-07-17 (TRA-VETTING open-items round, Crysta: dependence \"whether it is via your husband or your employer is a MAJOR vulnerability\").",
2860
- "family": "mechanism_control",
2861
- "polarity": "depends",
2862
- "severity": "elevated",
2863
- "isAlert": "none"
2864
- },
2865
- {
2866
- "code": "136-213-000-000-000-000-000",
2867
- "key": "sexualized_content_in_person_performance_activity",
2868
- "title": "In-person sexualized performance / appearance-based activity",
2869
- "selectable": true,
2870
- "parentCode": null,
2871
- "childCodes": [],
2872
- "definition": "Canonical activity evidence (DH § II Activity 2.2.3) that the person engages in in-person sexualized, erotic, appearance-based, or entertainment activity with sexualized expectations — stripping, dancing, posing, hostess or venue work, escort/companionship without an established sex act — sex-market-adjacent, recorded descriptively; not necessarily a sex act for value.",
2873
- "family": "cs_industry_context",
2874
- "polarity": "increases_risk",
2875
- "severity": "elevated",
2876
- "isAlert": "none"
2877
- },
2878
- {
2879
- "code": "136-214-000-000-000-000-000",
2880
- "key": "sexualized_content_online_performance_activity",
2881
- "title": "Online sexual performance / interactive sexual content activity",
2882
- "selectable": true,
2883
- "parentCode": null,
2884
- "childCodes": [],
2885
- "definition": "Canonical activity evidence (DH § II Activity 2.2.2) that the person engages in sexualized or sexually explicit activity performed, streamed, recorded, messaged, or displayed through online or digital platforms — webcamming, livestreams, paid chats, content-platform work — recorded descriptively whether or not a commercial sex act is established.",
2886
- "family": "cs_industry_context",
2887
- "polarity": "increases_risk",
2888
- "severity": "elevated",
2889
- "isAlert": "none"
2890
- },
2891
- {
2892
- "code": "136-215-000-000-000-000-000",
2893
- "key": "trauma_perpetrator_is_current_manager",
2894
- "title": "Trauma perpetrator is a current manager / facilitator (trauma-bonded control)",
2895
- "selectable": true,
2896
- "parentCode": null,
2897
- "childCodes": [],
2898
- "definition": "ENGINE-DERIVED conjunction: the same person the subject named as a trauma perpetrator (TRA-35 sexual violence / physical abuse / emotional-verbal-stalking capture) ALSO holds an operational-control edge over the subject (a TRA facilitation who-answer — posts ads / arranges dates / controls or keeps earnings / receives payments / organizes travel / holds documentation / above in the operation — or a relationship pair with a facilitator/offender role signal of their own). Two independently-captured facts joined on person identity — never an assumption (Crysta 2026-07-17: \"these are two different questions\"). The conjunction is the classic trauma-bonded, difficult-to-leave control situation.",
2899
- "family": "mechanism_control",
2900
- "polarity": "increases_risk",
2901
- "severity": "severe",
2902
- "isAlert": "none"
2903
- },
2904
- {
2905
- "code": "136-216-000-000-000-000-000",
2906
- "key": "active_protective_order",
2907
- "title": "Active protective order (client-reported)",
2908
- "selectable": true,
2909
- "parentCode": null,
2910
- "childCodes": [],
2911
- "definition": "The client reported in intake screening that they currently hold a temporary or permanent protective order. A legal-status + safety-planning fact, NOT a trafficking-risk driver — catalogued descriptive, deliberately NOT tree-mapped (Crysta ruling 2026-08-08). The screening question captures no counterparty, so this code says only \"an order exists\", never who it restrains. The scoring reads of a protective order are counterparty-gated and record-keyed elsewhere and must stay there — the Severity acute driver protection_order_against_trafficker (relational; investigativeSeverity.ts) and the perpetrator leaf P-II-D (fires only on defendantPersonId === subject). Tree-mapping this code would score a survivor higher for having sought court protection, which is the Ship-B inversion (a victim's own order raising her P-II) relocated to the victim tree.",
2912
- "family": "lethality_dv",
2913
- "polarity": "depends",
2914
- "severity": "caution",
2915
- "isAlert": "none"
2916
2838
  }
2917
2839
  ]
2918
2840
  }