@htilabs/platform-common-models 0.8.16 → 0.8.18
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.
- package/dist/constants/index.cjs +3 -1
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +3 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/{cvcEntry-0BIB9sen.d.cts → cvcEntry-DaDrEuTa.d.cts} +44 -44
- package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-DaDrEuTa.d.ts} +44 -44
- package/dist/cvcs/index.cjs +4348 -17
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +10835 -6179
- package/dist/cvcs/index.d.ts +10835 -6179
- package/dist/cvcs/index.js +8776 -4447
- package/dist/cvcs/index.js.map +1 -1
- package/dist/{index-CDoqrfc1.d.ts → index-C0J3f169.d.ts} +1 -1
- package/dist/{index-Zu_mOJRn.d.cts → index-EPjPjR0z.d.cts} +1 -1
- package/dist/index.cjs +4690 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +353 -8
- package/dist/index.d.ts +353 -8
- package/dist/index.js +4686 -20
- package/dist/index.js.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/{platform-auth-AsfnIXfK.d.cts → platform-auth-CvQkzOy1.d.cts} +1 -1
- package/dist/{platform-auth-AsfnIXfK.d.ts → platform-auth-CvQkzOy1.d.ts} +1 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +35 -35
- package/dist/schemas/index.d.ts +35 -35
- package/dist/schemas/index.js.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +26 -25
- package/src/__sot__/README.md +36 -1
- package/src/__sot__/coreIndicatorFields.ts +331 -0
- package/src/__sot__/coreIndicators.pin.json +1931 -2
- package/src/__sot__/cvcIndex.pin.json +8 -4
- package/src/__tests__/__snapshots__/cvc-sot.snap +8 -4
- package/src/__tests__/core-information-scope-invariant.test.ts +134 -0
- package/src/__tests__/cvc-136-scoring-invariant.test.ts +7 -5
- package/src/__tests__/cvc-181-182-country-parity.test.ts +163 -0
- package/src/__tests__/cvc-drift-gate.test.ts +392 -9
- package/src/__tests__/cvc-sot-snapshot.test.ts +17 -4
- package/src/__tests__/cvc-structural.test.ts +2 -0
- package/src/constants/ic.ts +88 -4
- package/src/cvcs/coreIndicators.v1.0.0.json +18 -5
- package/src/cvcs/coreInformationScope.v1.0.0.json +1165 -0
- package/src/cvcs/countries.v1.0.0.json +3077 -0
- package/src/cvcs/index.ts +4 -0
- package/src/cvcs/sharePurpose.v1.0.0.json +80 -12
- package/src/generated/cvc-enums.ts +352 -3
package/src/constants/ic.ts
CHANGED
|
@@ -2632,6 +2632,20 @@ export const CVC_122_LABELS: Record<CVC122Value, string> = {
|
|
|
2632
2632
|
|
|
2633
2633
|
// ─── CVC-181: Countries (ISO 3166-1 alpha-2) ────────────────────────
|
|
2634
2634
|
// Full list of countries using ISO 3166-1 alpha-2 codes.
|
|
2635
|
+
//
|
|
2636
|
+
// AS OF 2026-08-26 THE SOT IS `src/cvcs/countries.v1.0.0.json`, authored from the
|
|
2637
|
+
// canonical `core - countries — codebook 2.csv`. These two constants predate it and
|
|
2638
|
+
// are RETAINED for existing consumers; new code should import `CountryKeys` from
|
|
2639
|
+
// `src/generated/cvc-enums.ts` (or `countriesSot`) instead.
|
|
2640
|
+
//
|
|
2641
|
+
// The ISO SET here is exact — all 249 codes, no additions, no omissions, verified
|
|
2642
|
+
// against the codebook. `CVC_181_LABELS`, however, carries SHORT-FORM display labels
|
|
2643
|
+
// that differ from the canonical label on 16 codes: BO, CD, IR, KP, KR, LA, MK, FM,
|
|
2644
|
+
// MD, PS, SH, SY, TW, TZ, VE, VN ("Vietnam" vs "Viet Nam", "Korea, South" vs "Korea,
|
|
2645
|
+
// Republic of", …). The SOT JSON carries the canonical spelling verbatim in both
|
|
2646
|
+
// `title` and `canonicalLabel`. That divergence is display-only — nothing keys off
|
|
2647
|
+
// these strings — but it is real, and collapsing the two surfaces onto one label set
|
|
2648
|
+
// is its own decision (a visible UI change), deliberately not made here.
|
|
2635
2649
|
|
|
2636
2650
|
export const CVC_181_COUNTRIES = {
|
|
2637
2651
|
US: "US",
|
|
@@ -5245,10 +5259,10 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
|
|
|
5245
5259
|
categoryLabel: CVC_136_CATEGORY_LABELS[category],
|
|
5246
5260
|
}));
|
|
5247
5261
|
|
|
5248
|
-
// ─── CVC-136: full core-indicators value set (CANONICAL,
|
|
5262
|
+
// ─── CVC-136: full core-indicators value set (CANONICAL, 216 codes) ─────
|
|
5249
5263
|
// The complete CVC-136 'core - indicators' vocabulary. As of 0.8.13 the
|
|
5250
5264
|
// AUTHORITATIVE surface for this domain is the SOT JSON
|
|
5251
|
-
// `src/cvcs/coreIndicators.v1.0.0.json` (
|
|
5265
|
+
// `src/cvcs/coreIndicators.v1.0.0.json` (220 entries = 216 substantive + the
|
|
5252
5266
|
// missingness quadruplet), which also carries the canonical `family`,
|
|
5253
5267
|
// `polarity`, `severity`, `isAlert` and `alertWhen` entry attributes. This
|
|
5254
5268
|
// hand-coded array is kept in lockstep with that JSON as a flat key list for
|
|
@@ -5272,7 +5286,7 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
|
|
|
5272
5286
|
// `emits_by_code` (weights/risk.weights.json @ 9b5d654) is present here.
|
|
5273
5287
|
// Enforced by `src/__tests__/cvc-136-scoring-invariant.test.ts`.
|
|
5274
5288
|
//
|
|
5275
|
-
// 0.
|
|
5289
|
+
// 0.8.14 — 210 → 215 (catalog refresh, prototype a596eb9 → 84a1b677).
|
|
5276
5290
|
// The upstream catalog grew by 5 and withdrew none. All five are minted
|
|
5277
5291
|
// upstream with `code_status: canonical` (three carry the 2026-07-17
|
|
5278
5292
|
// TRA-vetting provenance), so this is catalog CATCH-UP, not invention —
|
|
@@ -5291,6 +5305,74 @@ export const CVC_136_OPTIONS: readonly CVC136Option[] = Object.entries(
|
|
|
5291
5305
|
// New SOT entries are APPENDED at positional codes 136-211…136-215 so
|
|
5292
5306
|
// every previously issued code keeps its number.
|
|
5293
5307
|
//
|
|
5308
|
+
// Refresh to 622410b — 215 → 216 (catalog refresh, prototype 84a1b67 →
|
|
5309
|
+
// 622410b; the release number is assigned by the standalone chore(release)
|
|
5310
|
+
// commit, not claimed here).
|
|
5311
|
+
// The upstream catalog grew by 1 and withdrew none, so this is again
|
|
5312
|
+
// catalog CATCH-UP rather than net-new authoring: GATE B would have
|
|
5313
|
+
// reported the code as INVENTED only because the pin was stale.
|
|
5314
|
+
// + active_protective_order (AE-3 / q-ar-3)
|
|
5315
|
+
// Minted upstream 2026-08-08 with `code_status: canonical` (prototype
|
|
5316
|
+
// `4b3d40e4`, "Catalogue the protective-order disclosure"), emitted by the
|
|
5317
|
+
// INTAKE_MAP on `q-ar-3 == yes`. Definition, `family`, `polarity`,
|
|
5318
|
+
// `severity` and `is_alert` are carried VERBATIM from the catalog:
|
|
5319
|
+
// `lethality_dv` / `depends` / `caution` / `none`. The `isAlert: "none"`
|
|
5320
|
+
// is load-bearing and deliberate — per the Crysta ruling of 2026-08-08 the
|
|
5321
|
+
// code is catalogued DESCRIPTIVE and is NOT tree-mapped, because an order
|
|
5322
|
+
// is a protective act, not an alert condition; tree-mapping it would score
|
|
5323
|
+
// a survivor higher for having sought court protection. The counterparty-
|
|
5324
|
+
// gated scoring reads live elsewhere (`protection_order_against_trafficker`
|
|
5325
|
+
// on the Severity model; perpetrator leaf P-II-D). The signal reaches the
|
|
5326
|
+
// Severity model through the catalog's `lane_tiers`
|
|
5327
|
+
// (safety_planning: elevated · domestic_family_violence: review), which is
|
|
5328
|
+
// not a platform-common surface.
|
|
5329
|
+
// PAVE 2.0 needs this to express the AE-3 intake emission; without it the
|
|
5330
|
+
// AE instrument writes an assertion against a code that resolves to
|
|
5331
|
+
// nothing. `coreIndicators.pin.json` is refreshed to 622410b (214 codes)
|
|
5332
|
+
// in the same change; the 2 scoring-ahead codes remain absent upstream and
|
|
5333
|
+
// stay on the `SCORING_AHEAD_OF_CATALOG` allowlist, unchanged at exactly 2.
|
|
5334
|
+
// The new SOT entry is APPENDED at positional code 136-216 so every
|
|
5335
|
+
// previously issued code keeps its number.
|
|
5336
|
+
//
|
|
5337
|
+
// NOT ADDED, deliberately: `substance_use_concerns`. It is NOT a code in
|
|
5338
|
+
// the canonical catalog — it is a `legacy_aliases` member of the canonical
|
|
5339
|
+
// `serious_substance_use_or_introduced_to_drugs` (136-142, shipped since
|
|
5340
|
+
// 0.8.13, `vulnerability_context` / `depends` / `elevated` /
|
|
5341
|
+
// `isAlert: "pave"` / `alertWhen: "recency_under_year"`). Adding it as its
|
|
5342
|
+
// own code would be exactly the invention GATE B exists to stop. Consumers
|
|
5343
|
+
// binding a BH-2 substance-use emission must bind the canonical key.
|
|
5344
|
+
//
|
|
5345
|
+
// PROJECTED-FIELD REVISIONS carried in the same refresh. A pin bump is a
|
|
5346
|
+
// promise of FULL conformance to the pinned catalog, not just of its new
|
|
5347
|
+
// codes — the 84a1b67 → 622410b delta also revised two shipping codes, and
|
|
5348
|
+
// both are carried here (SOT JSON + this label map):
|
|
5349
|
+
// • `acknowledgement_or_report_of_human_trafficking` (136-007) — label
|
|
5350
|
+
// "Acknowledgement or report of human trafficking" →
|
|
5351
|
+
// "Human trafficking disclosure or report".
|
|
5352
|
+
// • `juvenile_justice_or_child_welfare_involvement` (136-094) —
|
|
5353
|
+
// definition gained "(system unspecified — deprecated combined code;
|
|
5354
|
+
// see read-time alias policy above)". LOAD-BEARING: the definition is
|
|
5355
|
+
// the only projected field that tells a consumer this code is
|
|
5356
|
+
// DEPRECATED. Upstream split it 2026-06-08 (Ava) into
|
|
5357
|
+
// `juvenile_justice_system_involvement` (136-095) +
|
|
5358
|
+
// `child_welfare_system_involvement` at the Core Profile capture layer,
|
|
5359
|
+
// and the Phase 2C combined→split migration (2026-08-02, Crysta) makes
|
|
5360
|
+
// the read-time alias policy binding: the row is NEVER deleted and
|
|
5361
|
+
// stored CARs are NEVER rewritten — a combined-code CAR resolves at
|
|
5362
|
+
// read/aggregation time as BOTH split codes, so any consumer keyed by a
|
|
5363
|
+
// split code must also key this one. Residual emitters are only the
|
|
5364
|
+
// captures that genuinely cannot name the system (IS-3.2.4 manual Yes;
|
|
5365
|
+
// TRA-34c parent-category-selected with no system subtype). The full
|
|
5366
|
+
// policy text lives in the catalog comment block above the row in
|
|
5367
|
+
// `data/core_indicators.yaml` @ 622410b.
|
|
5368
|
+
// Also reconciled here, INHERITED from the previous refresh: the
|
|
5369
|
+
// `sexualized_content_performance_activity` (136-146) definition. The
|
|
5370
|
+
// a596eb9 → 84a1b67 delta appended the SEXUALIZED-CONTENT-SPLIT-2026-07-15
|
|
5371
|
+
// UMBRELLA NOTE to it, and 0.8.14 shipped the pin bump without it, so the
|
|
5372
|
+
// definition has been stale since. It now carries the catalog text verbatim.
|
|
5373
|
+
// (Two remaining JSON-vs-YAML differences are round-trip artifacts, not
|
|
5374
|
+
// drift: an unescaped `fiancé` and unwrapped hard-wrapped lines.)
|
|
5375
|
+
//
|
|
5294
5376
|
// CVC_136_ALERT_INDICATOR above is a legacy Thread-only surface with NO
|
|
5295
5377
|
// canonical basis; it is deliberately left untouched in 0.8.13 (a separate
|
|
5296
5378
|
// Thread cleanup). The canonical alert axis is the `isAlert` ATTRIBUTE on
|
|
@@ -5305,6 +5387,7 @@ export const CVC_136_CORE_INDICATOR_VALUES = [
|
|
|
5305
5387
|
"abuser_unemployed",
|
|
5306
5388
|
"access_to_vulnerable_individuals",
|
|
5307
5389
|
"acknowledgement_or_report_of_human_trafficking",
|
|
5390
|
+
"active_protective_order",
|
|
5308
5391
|
"ads_available_247",
|
|
5309
5392
|
"ads_imply_multiple_workers",
|
|
5310
5393
|
"ads_prost_slang",
|
|
@@ -5525,7 +5608,8 @@ export const CVC_136_CORE_INDICATOR_LABELS: Record<CVC136CoreIndicator, string>
|
|
|
5525
5608
|
"abuser_threatened_suicide": "Abuser threatened suicide",
|
|
5526
5609
|
"abuser_unemployed": "Abuser is unemployed",
|
|
5527
5610
|
"access_to_vulnerable_individuals": "Access to or connections with vulnerable individuals",
|
|
5528
|
-
"acknowledgement_or_report_of_human_trafficking": "
|
|
5611
|
+
"acknowledgement_or_report_of_human_trafficking": "Human trafficking disclosure or report",
|
|
5612
|
+
"active_protective_order": "Active protective order (client-reported)",
|
|
5529
5613
|
"ads_available_247": "Advertises available anytime / 24-7",
|
|
5530
5614
|
"ads_imply_multiple_workers": "Ads imply multiple workers",
|
|
5531
5615
|
"ads_prost_slang": "Ad uses prostitution slang",
|
|
@@ -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
|
|
6
|
-
"_source": "htilabstech/prototype@
|
|
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)",
|
|
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": "
|
|
138
|
+
"title": "Human trafficking disclosure or report",
|
|
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.",
|
|
1289
|
+
"definition": "Indication of involvement with juvenile justice and/or child welfare systems (system unspecified — deprecated combined code; see read-time alias policy above).",
|
|
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.",
|
|
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).",
|
|
1980
1980
|
"family": "cs_industry_context",
|
|
1981
1981
|
"polarity": "increases_risk",
|
|
1982
1982
|
"severity": "elevated",
|
|
@@ -2900,6 +2900,19 @@
|
|
|
2900
2900
|
"polarity": "increases_risk",
|
|
2901
2901
|
"severity": "severe",
|
|
2902
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"
|
|
2903
2916
|
}
|
|
2904
2917
|
]
|
|
2905
2918
|
}
|