@htilabs/platform-common-models 0.19.0 → 0.20.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.
- package/dist/cvcs/index.cjs +4769 -643
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +5036 -606
- package/dist/cvcs/index.d.ts +5036 -606
- package/dist/cvcs/index.js +4769 -643
- package/dist/cvcs/index.js.map +1 -1
- package/dist/enums/index.cjs +74 -1
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.cts +77 -4
- package/dist/enums/index.d.ts +77 -4
- package/dist/enums/index.js +74 -1
- package/dist/enums/index.js.map +1 -1
- package/dist/index.cjs +5199 -588
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5189 -588
- package/dist/index.js.map +1 -1
- package/dist/information-scope/index.cjs +440 -0
- package/dist/information-scope/index.cjs.map +1 -0
- package/dist/information-scope/index.d.cts +313 -0
- package/dist/information-scope/index.d.ts +313 -0
- package/dist/information-scope/index.js +404 -0
- package/dist/information-scope/index.js.map +1 -0
- package/dist/services/index.cjs +414 -2
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +403 -1
- package/dist/services/index.js.map +1 -1
- package/package.json +32 -26
- package/src/__tests__/__snapshots__/cvc-sot.snap +3 -3
- package/src/__tests__/core-information-scope-invariant.test.ts +709 -456
- package/src/__tests__/cvc-sot-snapshot.test.ts +16 -17
- package/src/__tests__/cvc-structural.test.ts +2 -2
- package/src/__tests__/location-type-routing-invariant.test.ts +25 -8
- package/src/cvcs/coreInformationScope.v2.0.0.json +5396 -0
- package/src/cvcs/index.ts +2 -2
- package/src/cvcs/roiScope.v1.3.0.json +360 -0
- package/src/generated/cvc-enums.ts +77 -4
- package/src/services/__tests__/fixtures/infoscope-v4/information_scope_v4.migrations.csv +106 -0
- package/src/services/__tests__/fixtures/infoscope-v4/information_scope_v4.rows.csv +117 -0
- package/src/services/__tests__/fixtures/infoscope-v4/loadInfoscopeV4Fixtures.ts +116 -0
- package/src/services/__tests__/informationScopeResolver.test.ts +964 -0
- package/src/services/index.ts +10 -3
- package/src/services/informationScope.ts +10 -0
- package/src/services/informationScopeResolver.ts +672 -0
- package/src/services/informationScopeSot.ts +161 -0
- package/src/cvcs/coreInformationScope.v1.1.0.json +0 -1290
- package/src/cvcs/roiScope.v1.2.0.json +0 -340
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# source: htilabstech/prototype docs/share-roi/information_scope_v4.rows.csv @ 6dab8a9532cf1b94cdce3e475906df839359ad80 (byte-identical at 00179edc); verbatim below this line, re-copy never hand-edit (the test checks the git blob hash)
|
|
2
|
+
code,label,parent,depth,row_type,kind_branch,PAVE,Thread,LEADS,selectable,shareable_default,platform_floor,level_floor,special_data_type,status,replaces_v3,notes
|
|
3
|
+
system,System metadata,,0,category,,yes,yes,yes,yes,on,,1,none,as_today,,"Always included: viewing-side force-added to every visible set; sharing-side system_info is required on every ROI and share and cannot be deselected. 260 fields (platform directories, policies, grants, sessions, the rails) — one branch, one sub-category, by design (Phase 2 § 4)."
|
|
4
|
+
system_info,System info,system,1,subcategory,,yes,yes,yes,yes,on,,1,none,as_today,,
|
|
5
|
+
notes,Narrative notes,,0,category,,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,"Signed Narrative notes spec v2 (Crysta 2026-10-05) reproduced as it stands: holds only the notes whose home is a session of the case or the case itself; a note written inside an instrument, on the Findings surface, or on another record rides with that record (and, under rule 1, under the branch of the person whose record it is)."
|
|
6
|
+
session_summary,Session summary,notes,1,subcategory,,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,
|
|
7
|
+
case_notes,Session & case notes,notes,1,subcategory,,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,
|
|
8
|
+
primary_client,Primary client / case subject,,0,branch,client,yes,yes,yes,yes,on,,1,survivor_confidential,new,,"NEW (rule 1). Everything the record says about the client, grouped by kind (rule 2). Selecting it selects every category beneath; any child can be de-selected. The level-1 search stub (names · case id · DOB) lives in its Identifying information."
|
|
9
|
+
identifying,Identifying information,primary_client,1,category,client,yes,yes,yes,yes,on,,3,survivor_confidential,as_today,,"As today, minus what moved: the relationship records, the household roster, the person tiles of other people, the pets and the relationship dynamic leave (to Relationships & household · the person's branch · Victimization records). What STAYS on the category at category grain, by rule 3 ('not a gap to fill'): living situation · homeless status · housing subsidy · collection context · employment · income · education · occupational background · veteran status · rural · language · English proficiency · birth country / state · citizenship · physical description (hair · eyes · marks and tattoos) · vehicle · vital status · age band · the Core Profile container."
|
|
10
|
+
names,Names + aliases,identifying,2,subcategory,client,yes,yes,yes,yes,on,,1,survivor_confidential,as_today,,the level-1 search stub — on while everything else is off
|
|
11
|
+
dob,Date of birth,identifying,2,subcategory,client,yes,yes,yes,yes,on,,1,survivor_confidential,as_today,,the level-1 search stub — on while everything else is off
|
|
12
|
+
addresses,Addresses,identifying,2,subcategory,client,yes,yes,yes,yes,on,,3,survivor_confidential,as_today,,where the client lives is plausibly withheld while identity is included (safety); routed at TYPE grain per CVC-191 since 2026-10-01
|
|
13
|
+
additional_ids,Additional identifiers,identifying,2,subcategory,client,yes,yes,yes,yes,on,,3,survivor_confidential,as_today,,case ids and government identifiers are plausibly withheld while the name is included
|
|
14
|
+
demographics,Demographics,identifying,2,subcategory,client,yes,yes,yes,yes,on,,3,survivor_confidential,as_today,,race · tribe · gender · orientation · pronouns are plausibly withheld from a referral that needs the name
|
|
15
|
+
identifying.other,Everything else in Identifying information (living situation · work & income · education · languages · citizenship · physical description · vehicle),identifying,2,category_rest,client,yes,yes,yes,no,on,,3,survivor_confidential,new,,"the category-grain facts, as one non-selectable row — rule 3 says they sit on the category; this is how the picker keeps them when a child is un-ticked"
|
|
16
|
+
contact,Contact & safety,primary_client,1,category,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,"As today. The emergency contact's DESIGNATION (that this person may be called, for what — CVC-300/301, the 'why this person' note) is the client's fact and rides Contact info + safety preferences (Person decision E, 2026-10-08); the contact's own record rides Other named persons › Other people."
|
|
17
|
+
contact_info,Contact info + safety preferences,contact,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,plausibly included on its own (a callback number) or withheld (a safety handoff)
|
|
18
|
+
safe_locations,Safe & confidential locations,contact,2,subcategory,client,yes,yes,n/a,yes,off,yes,3,survivor_confidential,as_today,,must be OFF (locked) while its neighbours are on — the platform safety floor (Ava 2026-08-18; ratified 2026-09-08)
|
|
19
|
+
priorities_safety,Priorities & Safety (immediate needs triage),contact,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,one instrument-grain disclosure (Crysta R1 2026-09-29) — plausibly included without contact details
|
|
20
|
+
encounter_location,Encounter location (where we met / where it happened),contact,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,"ruled separate from Addresses (Crysta R2 2026-10-01): a risk-only handoff withholds it, a referral or mandated report carries it"
|
|
21
|
+
health_accommodation,Health & accommodation,primary_client,1,category,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,"SIMPLIFIED 2026-10-09 (Crysta: 'there is no difference in sensitivity between mental health status, substance use status, and HIV status … SIMPLIFY'): two sub-categories, the Notes / Instruments shape. Health status carries every health fact — mental health, substance use, chronic conditions, disability, HIV, pregnancy, medications, allergies, insurance, primary care, preferred hospital, preventative-care needs (the Medical Health card's 26 controls land here once their fields are minted). Accommodation needs is what a housing or program referral asks for on its own. One fact of a kind is never its own sub-row because it was judged more sensitive than its peers."
|
|
22
|
+
health_status,Health status,health_accommodation,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,new,mental_health_status substance_use_status chronic_health_status disability_subtypes hiv_status,"the person's health, as one row — a medical referral includes it whole"
|
|
23
|
+
accommodation_needs,Accommodation needs,health_accommodation,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,a housing or program referral plausibly includes accommodation needs and nothing else from Health
|
|
24
|
+
immigration_legal_status,Immigration & legal status,primary_client,1,category,client,yes,n/a,yes,yes,off,,3,survivor_confidential,as_today,,"As today — the whole category off by default. SIMPLIFIED 2026-10-09 (Crysta: 'on immigration, there is no difference in the sensitivities of those subcategories'): two sub-categories. Immigration status is what the person holds (status, visa class, A-number, foreign-national read); Applications & engagement is what is in flight (federal protection applications, TVAP enrollment, whether the survivor reported to law enforcement). Thread capture of these facts, when it lands, adds Thread to app_relevance — not a tree change."
|
|
25
|
+
immigration_status,Immigration status,immigration_legal_status,2,subcategory,client,yes,n/a,yes,yes,off,,3,survivor_confidential,as_today, uscis_alien_number,"what the person holds — status, visa class, A-number"
|
|
26
|
+
immigration_applications,"Applications, enrollments & law enforcement engagement",immigration_legal_status,2,subcategory,client,yes,n/a,n/a,yes,off,,3,survivor_confidential,new,federal_protection_applications tvap_enrollment le_report_status,"what is in flight — a pending T/U application, a TVAP enrollment, whether the survivor reported"
|
|
27
|
+
risk,Risk-related,primary_client,1,category,client,yes,yes,yes,yes,on,,3,survivor_confidential,as_today,,"As today minus the offender's record: 'Offender + facilitator records' (offender_facilitator) MOVES to Other named persons › People who caused harm as the whole type row (the offender's identity, status, role, description). What the CLIENT experienced stays here: Victimization records (incl. the relationship dynamic as behaviour + direction — Crysta 2026-10-02; and the client's own trafficking-relevant role, worker sub-role, functional role, labor sector), System involvement (the protection order WHOLE, respondent named — Crysta R3 2026-10-01, 'keep' 2026-10-06), Overall risk level. Build rule, not a row: an indicator derived from a fact whose row is not selected is held back (INFOSCOPE_PHASE3_NOTES § 3)."
|
|
28
|
+
screen_indicators,Overall risk level,risk,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,the risk-only handoff's spine — plausibly included alone
|
|
29
|
+
victimization,Victimization records,risk,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,"plausibly withheld while the overall risk level is included; gains the relationship dynamic (behaviour + direction, naming no one) and the client's own role facts"
|
|
30
|
+
system_involvement,System involvement,risk,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,legal facts (protection order · CW · JJ · missing from care) are plausibly withheld while victimization is included
|
|
31
|
+
derived_risk_signals,Derived risk signals (LEADS),risk,2,subcategory,client,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,LEADS — parked; unchanged
|
|
32
|
+
services,Services & case history,primary_client,1,category,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,"As today: three sub-categories in rising sensitivity, separately decidable (Crysta 2026-08-13/14). A service whose audience is a family member is still the client's case history (the service instance is on the client's record)."
|
|
33
|
+
contact_history,Contact history with this agency,services,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,that contact happened — plausibly the only thing a safety handoff carries
|
|
34
|
+
service_history,Service referrals + needs,services,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,what services — plausibly included without the plans
|
|
35
|
+
plans_goals,"Service plans, goals + achievements",services,2,subcategory,client,yes,yes,n/a,yes,on,,3,survivor_confidential,as_today,,"the plans — the most sensitive step, plausibly withheld"
|
|
36
|
+
instruments,Screens & assessments,primary_client,1,category,client,yes,yes,yes,yes,on,,3,survivor_confidential,as_today,,"Signed Instruments spec v4 (Crysta 2026-10-05) + Selectable in UI (2026-10-08) reproduced as they stand. A run whose subject is another named person routes to that person's type › Screens & assessments › the same part (rule 1); the 28 instrument rows exist once, here."
|
|
37
|
+
instrument_summary,Summary & outcome,instruments,2,subcategory,client,yes,yes,yes,yes,on,,3,survivor_confidential,as_today,,the Summary / Full test is rule 3's own example
|
|
38
|
+
summary_initial_screen,Initial Screen — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,yes,no,on,,3,survivor_confidential,as_today,,
|
|
39
|
+
summary_mental_health_screen,Mental Health Screen — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
40
|
+
summary_behavioral_health_intake,Behavioral Health Intake — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
41
|
+
summary_trauma_and_coping_screen,Trauma & Coping Screen — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
42
|
+
summary_ae_intake,Abuse / Exploitation Intake — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
43
|
+
summary_ida,In-Depth Assessment — summary & outcome,instrument_summary,3,instrument row,client,yes,n/a,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
44
|
+
summary_lap,Lethality Assessment (LAP) — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
45
|
+
summary_danger_assessment,Danger Assessment — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
46
|
+
summary_stalking_assessment,Stalking Assessment — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
47
|
+
summary_injury_and_strangulation,Injury & Strangulation Screening — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
48
|
+
summary_hope_scale,Hope Scales — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
49
|
+
summary_needs_assessment,Needs Assessment — summary & outcome,instrument_summary,3,instrument row,client,yes,yes,n/a,no,on,,3,survivor_confidential,as_today,,
|
|
50
|
+
summary_tra,Trafficking Risk Assessment — summary & outcome,instrument_summary,3,instrument row,client,yes,n/a,yes,no,on,,3,survivor_confidential,as_today,,
|
|
51
|
+
summary_findings,Findings — summary & outcome,instrument_summary,3,instrument row,client,yes,n/a,yes,no,on,,3,survivor_confidential,as_today,,
|
|
52
|
+
instrument_full,"Full questions, narratives & notes",instruments,2,subcategory,client,yes,yes,yes,yes,off,,3,survivor_confidential,as_today,,must be OFF while Summary is on (spec R6)
|
|
53
|
+
full_initial_screen,Initial Screen — full,instrument_full,3,instrument row,client,yes,yes,yes,no,off,,3,survivor_confidential,as_today,,
|
|
54
|
+
full_mental_health_screen,Mental Health Screen — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
55
|
+
full_behavioral_health_intake,Behavioral Health Intake — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
56
|
+
full_trauma_and_coping_screen,Trauma & Coping Screen — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
57
|
+
full_ae_intake,Abuse / Exploitation Intake — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
58
|
+
full_ida,In-Depth Assessment — full,instrument_full,3,instrument row,client,yes,n/a,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
59
|
+
full_lap,Lethality Assessment (LAP) — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
60
|
+
full_danger_assessment,Danger Assessment — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
61
|
+
full_stalking_assessment,Stalking Assessment — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
62
|
+
full_injury_and_strangulation,Injury & Strangulation Screening — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
63
|
+
full_hope_scale,Hope Scales — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
64
|
+
full_needs_assessment,Needs Assessment — full,instrument_full,3,instrument row,client,yes,yes,n/a,no,off,,3,survivor_confidential,as_today,,
|
|
65
|
+
full_tra,Trafficking Risk Assessment — full,instrument_full,3,instrument row,client,yes,n/a,yes,no,off,,3,survivor_confidential,as_today,,
|
|
66
|
+
full_findings,Findings — full,instrument_full,3,instrument row,client,yes,n/a,yes,no,off,,3,survivor_confidential,as_today,,
|
|
67
|
+
relationships_household,Relationships & household,primary_client,1,category,client,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,"NEW (Crysta 2026-10-02: 'A new Relationship category holds the relationship record and household membership'). The CLIENT's account of the people around them: each relationship record (type and side, ongoing / dates, the ties — cohabiting · has children together · legally married · shared lease …, the kinship basis, the rating, how we know), the household roster (each member, relationship to the head of household, currently staying / present today; the quick questions: children at home · pets at home · a safe place for the pets), the client's own marital and relationship status, the pets (name · type · role · owner; the photo and the safety basis ride the pet), the session roster and the network tiles as REFERENCES. Each entry names the other person — name + kind of person (People who caused harm · Eligible family member · Other) — and carries NOTHING ELSE about them: the person's own record rides under Other named persons › their type. NO sub-categories (rule 3: nobody plausibly includes the ties and not the household, or the other way round, often enough to split today — 'it's easier to later break a category down further'; the one case that would, a shelter referral wanting 'who lives there' alone, is recorded in INFOSCOPE_PHASE3_NOTES D2). NOT here: the relationship dynamic (threats · controlling behaviour · abuse) — Victimization records, as behaviour + direction, naming no one (Crysta 2026-10-02); custody and parental rights ARE here (the client's relationship to the child)."
|
|
68
|
+
other_named_persons,Other named persons,,0,branch,,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,"NEW (rule 1). Every other human named on the record is a Person of their own (Crysta 2026-10-08, Person decision E) and their own record rides HERE, under their type. 'About whom' is decided per person at share or release time: the 'This person caused harm' switch, on anywhere for this person on this client, makes them People who caused harm; the 'Eligible family member' switch, asserted by the advocate, makes them an Eligible family member; a person with both is listed with the people who caused harm (and keeps the VAWA handling a family member gets); everyone else is Other people on the case (defaults for veto — INFOSCOPE_PHASE3_NOTES D13). Selecting a type selects everything under it; a release or a policy selects a KIND of person, never a named person (Crysta 2026-10-05: 'Only a type of person'). Personnel / staff are outside this branch (System info). Under each type the same eight categories (rule 2), at category grain except where rule 3's second clause forces a row that must be off while its neighbours are on."
|
|
69
|
+
offenders,People who caused harm,other_named_persons,1,person_type,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,"Crysta's word: offenders. The person's own record as it sits on the client's record — identity, contact, description, vehicles, the offender parts (status, trafficking-relevant role, facilitator function, gang ties, incarceration), the TRA perpetrator record. Hand-selected only; no preset selects it (derivation for veto)."
|
|
70
|
+
offenders.identifying,Identifying information,offenders,2,category,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
71
|
+
offenders.contact,Contact & safety,offenders,2,category,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
72
|
+
offenders.safe_locations,Safe & confidential locations,offenders.contact,3,subcategory,offenders,yes,yes,n/a,yes,off,yes,3,survivor_confidential,new,,
|
|
73
|
+
offenders.health_accommodation,Health & accommodation,offenders,2,category,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
74
|
+
offenders.immigration_legal_status,Immigration & legal status,offenders,2,category,offenders,yes,yes,n/a,yes,off,,3,survivor_confidential,new,,
|
|
75
|
+
offenders.risk,Risk-related,offenders,2,category,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
76
|
+
offenders.services,Services & case history,offenders,2,category,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
77
|
+
offenders.instruments,Screens & assessments,offenders,2,category,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
78
|
+
offenders.instrument_summary,Summary & outcome,offenders.instruments,3,subcategory,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
79
|
+
offenders.instrument_full,"Full questions, narratives & notes",offenders.instruments,3,subcategory,offenders,yes,yes,n/a,yes,off,,3,survivor_confidential,new,,
|
|
80
|
+
offenders.relationships_household,Relationships & household,offenders,2,category,offenders,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
81
|
+
family,Eligible family members,other_named_persons,1,person_type,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,"Crysta's word: eligible family members (EFM — asserted by the advocate with the switch, never derived from the relationship). The person's own record: the child's identity, school, health, legal facts (Person decision E, 2026-10-08)."
|
|
82
|
+
family.identifying,Identifying information,family,2,category,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
83
|
+
family.contact,Contact & safety,family,2,category,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
84
|
+
family.safe_locations,Safe & confidential locations,family.contact,3,subcategory,family,yes,yes,n/a,yes,off,yes,3,survivor_confidential,new,,
|
|
85
|
+
family.health_accommodation,Health & accommodation,family,2,category,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
86
|
+
family.immigration_legal_status,Immigration & legal status,family,2,category,family,yes,yes,n/a,yes,off,,3,survivor_confidential,new,,
|
|
87
|
+
family.risk,Risk-related,family,2,category,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
88
|
+
family.services,Services & case history,family,2,category,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
89
|
+
family.instruments,Screens & assessments,family,2,category,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
90
|
+
family.instrument_summary,Summary & outcome,family.instruments,3,subcategory,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
91
|
+
family.instrument_full,"Full questions, narratives & notes",family.instruments,3,subcategory,family,yes,yes,n/a,yes,off,,3,survivor_confidential,new,,
|
|
92
|
+
family.relationships_household,Relationships & household,family,2,category,family,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
93
|
+
others,Other people on the case,other_named_persons,1,person_type,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,"Everyone else named: a witness, Thread's caller, a household member who is neither family nor harmful, the emergency contact's own record, the child's other parent, a named associate (LEADS). Hand-selected only; no preset selects it (derivation for veto)."
|
|
94
|
+
others.identifying,Identifying information,others,2,category,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
95
|
+
others.contact,Contact & safety,others,2,category,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
96
|
+
others.safe_locations,Safe & confidential locations,others.contact,3,subcategory,others,yes,yes,n/a,yes,off,yes,3,survivor_confidential,new,,
|
|
97
|
+
others.health_accommodation,Health & accommodation,others,2,category,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
98
|
+
others.immigration_legal_status,Immigration & legal status,others,2,category,others,yes,yes,n/a,yes,off,,3,survivor_confidential,new,,
|
|
99
|
+
others.risk,Risk-related,others,2,category,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
100
|
+
others.services,Services & case history,others,2,category,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
101
|
+
others.instruments,Screens & assessments,others,2,category,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
102
|
+
others.instrument_summary,Summary & outcome,others.instruments,3,subcategory,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
103
|
+
others.instrument_full,"Full questions, narratives & notes",others.instruments,3,subcategory,others,yes,yes,n/a,yes,off,,3,survivor_confidential,new,,
|
|
104
|
+
others.relationships_household,Relationships & household,others,2,category,others,yes,yes,n/a,yes,on,,3,survivor_confidential,new,,
|
|
105
|
+
network_associations,Network & associations,,1,category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
106
|
+
network_membership,Network membership + lineage,network_associations,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
107
|
+
persona_links,Persona + subject identity links,network_associations,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
108
|
+
commercial_activity,Commercial activity,,1,category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
109
|
+
ad_content,Ad postings + content,commercial_activity,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
110
|
+
commercial_patterns,"Derived commercial patterns (pricing, schedule, venues)",commercial_activity,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
111
|
+
investigative_work_product,Investigative work product,,1,category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
112
|
+
case_determinations,"Determinations, dispositions + identity rulings",investigative_work_product,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
113
|
+
case_lifecycle,"Case stage, phases + milestones",investigative_work_product,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
114
|
+
case_attachments,Case attachments + extracted content,investigative_work_product,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,evidence,as_today,,
|
|
115
|
+
object_identifiers,Object identifiers,,1,category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
116
|
+
phone_identifiers,Phone identifiers + phone intelligence,object_identifiers,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
117
|
+
object_identity_attributes,"Object identity attributes (names, trade names, ages)",object_identifiers,2,sub-category,leads,n/a,n/a,yes,yes,on,,3,criminal_intelligence,as_today,,
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the canon's generated CVC-236 v4 CSV pair (prototype
|
|
3
|
+
* docs/share-roi/information_scope_v4.{rows,migrations}.csv @ 6dab8a95,
|
|
4
|
+
* byte-identical at 00179edc) into the resolver's input shapes. Test-only:
|
|
5
|
+
* the resolver tests bind to the SOT; this pair is the cross-check.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
ScopeKindBranch,
|
|
15
|
+
ScopeMigration,
|
|
16
|
+
ScopeMigrationRule,
|
|
17
|
+
ScopeRow,
|
|
18
|
+
ScopeRowStatus,
|
|
19
|
+
ScopeRowType,
|
|
20
|
+
ScopeSpecialDataType,
|
|
21
|
+
} from "../../../informationScopeResolver.js";
|
|
22
|
+
|
|
23
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
|
|
25
|
+
export const INFOSCOPE_V4_CANON_SHA = "6dab8a9532cf1b94cdce3e475906df839359ad80";
|
|
26
|
+
|
|
27
|
+
/** `git rev-parse <sha>:docs/share-roi/<file>` at 6dab8a95 and at 00179edc. */
|
|
28
|
+
export const INFOSCOPE_V4_CANON_BLOBS = {
|
|
29
|
+
"information_scope_v4.rows.csv": "f2106e7b107a8bf3de7e266f720f2c0af40ee236",
|
|
30
|
+
"information_scope_v4.migrations.csv": "24ffeda4b5185d6c7a17ca907a531a7879557fb8",
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
export type InfoscopeFixture = keyof typeof INFOSCOPE_V4_CANON_BLOBS;
|
|
34
|
+
|
|
35
|
+
export const fixtureText = (f: InfoscopeFixture): string => readFileSync(path.join(here, f), "utf8");
|
|
36
|
+
|
|
37
|
+
/** The git blob hash of the fixture body (the file minus its `# source:` line). */
|
|
38
|
+
export function fixtureBodyBlobSha(f: InfoscopeFixture): string {
|
|
39
|
+
const text = fixtureText(f);
|
|
40
|
+
const body = Buffer.from(text.slice(text.indexOf("\n") + 1), "utf8");
|
|
41
|
+
return createHash("sha1")
|
|
42
|
+
.update(Buffer.concat([Buffer.from(`blob ${body.length}\0`, "utf8"), body]))
|
|
43
|
+
.digest("hex");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** RFC-4180-ish: quoted fields, doubled quotes, commas inside quotes. `#` lines are comments. */
|
|
47
|
+
export function parseCsv(text: string): Record<string, string>[] {
|
|
48
|
+
const records: string[][] = [];
|
|
49
|
+
let field = "";
|
|
50
|
+
let rec: string[] = [];
|
|
51
|
+
let quoted = false;
|
|
52
|
+
const body = text
|
|
53
|
+
.split("\n")
|
|
54
|
+
.filter((l) => !l.startsWith("#"))
|
|
55
|
+
.join("\n");
|
|
56
|
+
for (let i = 0; i < body.length; i += 1) {
|
|
57
|
+
const ch = body[i];
|
|
58
|
+
if (quoted) {
|
|
59
|
+
if (ch === '"' && body[i + 1] === '"') {
|
|
60
|
+
field += '"';
|
|
61
|
+
i += 1;
|
|
62
|
+
} else if (ch === '"') quoted = false;
|
|
63
|
+
else field += ch;
|
|
64
|
+
} else if (ch === '"') quoted = true;
|
|
65
|
+
else if (ch === ",") {
|
|
66
|
+
rec.push(field);
|
|
67
|
+
field = "";
|
|
68
|
+
} else if (ch === "\n") {
|
|
69
|
+
rec.push(field);
|
|
70
|
+
records.push(rec);
|
|
71
|
+
rec = [];
|
|
72
|
+
field = "";
|
|
73
|
+
} else if (ch !== "\r") field += ch;
|
|
74
|
+
}
|
|
75
|
+
if (field !== "" || rec.length > 0) {
|
|
76
|
+
rec.push(field);
|
|
77
|
+
records.push(rec);
|
|
78
|
+
}
|
|
79
|
+
const [header, ...rows] = records.filter((r) => r.length > 1 || r[0] !== "");
|
|
80
|
+
return rows.map((r) => Object.fromEntries(header.map((h, i) => [h, r[i] ?? ""])));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The rows CSV as `ScopeRow`s (same fields `scopeRowsFromSot` emits). */
|
|
84
|
+
export function loadCsvRows(): ScopeRow[] {
|
|
85
|
+
return parseCsv(fixtureText("information_scope_v4.rows.csv")).map((r) => {
|
|
86
|
+
const kindBranch = (r.kind_branch === "" ? null : r.kind_branch) as ScopeKindBranch;
|
|
87
|
+
const row: ScopeRow = {
|
|
88
|
+
scopeCode: r.code,
|
|
89
|
+
parentScopeCode: r.parent === "" ? null : r.parent,
|
|
90
|
+
rowType: r.row_type as ScopeRowType,
|
|
91
|
+
kindBranch,
|
|
92
|
+
apps: { pave: r.PAVE === "yes", thread: r.Thread === "yes", leads: r.LEADS === "yes" },
|
|
93
|
+
selectable: r.selectable === "yes",
|
|
94
|
+
shareableDefault: r.shareable_default !== "off",
|
|
95
|
+
platformFloor: r.platform_floor === "yes",
|
|
96
|
+
levelFloor: Number(r.level_floor) as 1 | 3,
|
|
97
|
+
specialDataType: r.special_data_type as ScopeSpecialDataType,
|
|
98
|
+
status: r.status as ScopeRowStatus,
|
|
99
|
+
replacesV3: r.replaces_v3.split(/\s+/).filter(Boolean),
|
|
100
|
+
};
|
|
101
|
+
// The CSV has no kind_row column: a per-kind code is `<kind>.<row>` (D15).
|
|
102
|
+
if (r.row_type !== "person_type" && r.code.startsWith(`${r.kind_branch}.`)) {
|
|
103
|
+
row.kindRow = r.code.slice(r.kind_branch.length + 1);
|
|
104
|
+
}
|
|
105
|
+
return row;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function loadCsvMigrations(): ScopeMigration[] {
|
|
110
|
+
return parseCsv(fixtureText("information_scope_v4.migrations.csv")).map((m) => ({
|
|
111
|
+
from: m.v3_code,
|
|
112
|
+
to: m.v4_reads_as === "(nothing)" ? [] : m.v4_reads_as.split(/\s+/).filter(Boolean),
|
|
113
|
+
rule: m.rule as ScopeMigrationRule,
|
|
114
|
+
note: m.note,
|
|
115
|
+
}));
|
|
116
|
+
}
|