@htilabs/platform-common-models 0.61.0 → 0.62.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/README.md +9 -0
- package/dist/authz/index.cjs +104 -0
- package/dist/authz/index.cjs.map +1 -1
- package/dist/authz/index.d.cts +21 -1
- package/dist/authz/index.d.ts +21 -1
- package/dist/authz/index.js +101 -0
- package/dist/authz/index.js.map +1 -1
- package/dist/{index-DvAypMJV.d.ts → index-Bh1zO_Vu.d.ts} +1 -1
- package/dist/{index-Bj-s0nZy.d.cts → index-XWSYon40.d.cts} +1 -1
- package/dist/index.cjs +104 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +101 -0
- 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/schemas/index.d.cts +25 -25
- package/dist/schemas/index.d.ts +25 -25
- package/package.json +1 -1
- package/src/__tests__/authz-resolve.test.ts +3 -0
- package/src/__tests__/core-function-notes.test.ts +35 -0
- package/src/authz/functionNotes.ts +20 -0
- package/src/authz/index.ts +1 -0
- package/src/generated/coreFunctionNotes.ts +107 -0
- package/dist/{cvcEntry-BLeRivoF.d.cts → cvcEntry-D787utvP.d.cts} +8 -8
- package/dist/{cvcEntry-BLeRivoF.d.ts → cvcEntry-D787utvP.d.ts} +8 -8
package/dist/authz/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/platform-auth.ts","../../src/generated/cvc-enums.ts","../../src/generated/coreFunctionsEvaluable.ts","../../src/authz/storedReads.ts","../../src/authz/resolveEffectiveFunctions.ts","../../src/generated/coreFunctionDefaultBounds.ts","../../src/authz/defaultBounds.ts","../../src/generated/authzBrowserTables.ts","../../src/authz/roleCodes.ts","../../src/authz/functionDoor.ts","../../src/authz/viewingPolicy.ts","../../src/authz/viewingScope.ts"],"sourcesContent":["/**\n * @htilabs/platform-common-models — Platform Authorization Constants\n *\n * Enums and labels for the platform role/function permission model.\n * Includes permission states, share view levels, tool codes, role levels,\n * and function implementation statuses.\n *\n * Source: PLATFORM_AUTH_SPEC.md Sections 5 + 6\n */\n\n// ─── Permission State (4-state role→function mapping) ──────────────\n\nexport const PERMISSION_STATE = {\n /** Role can always perform this function (mandatory, cannot disable). */\n ALWAYS: \"ALWAYS\",\n /** Default On — user can opt off. */\n PREF_YES: \"PREF_YES\",\n /** Default Off — user can opt in. */\n PREF_NO: \"PREF_NO\",\n /** Role is explicitly barred from this function. */\n NEVER: \"NEVER\",\n} as const;\n\nexport type PermissionStateValue =\n (typeof PERMISSION_STATE)[keyof typeof PERMISSION_STATE];\n\nexport const PERMISSION_STATE_VALUES = [\n PERMISSION_STATE.ALWAYS,\n PERMISSION_STATE.PREF_YES,\n PERMISSION_STATE.PREF_NO,\n PERMISSION_STATE.NEVER,\n] as const;\n\nexport const PERMISSION_STATE_LABELS: Record<PermissionStateValue, string> = {\n [PERMISSION_STATE.ALWAYS]: \"Always\",\n [PERMISSION_STATE.PREF_YES]: \"Default On\",\n [PERMISSION_STATE.PREF_NO]: \"Default Off\",\n [PERMISSION_STATE.NEVER]: \"Never\",\n};\n\n/** UI display metadata for permission states (colors, icons). */\nexport const PERMISSION_STATE_DISPLAY: Record<\n PermissionStateValue,\n { label: string; color: string; bgColor: string; icon: string }\n> = {\n [PERMISSION_STATE.ALWAYS]: {\n label: \"Always\",\n color: \"#2e7d32\",\n bgColor: \"#e8f5e9\",\n icon: \"\\u{1F512}\",\n },\n [PERMISSION_STATE.PREF_YES]: {\n label: \"Default On\",\n color: \"#1565c0\",\n bgColor: \"#e3f2fd\",\n icon: \"\\u{1F513}\",\n },\n [PERMISSION_STATE.PREF_NO]: {\n label: \"Default Off\",\n color: \"#e65100\",\n bgColor: \"#fff3e0\",\n icon: \"\\u{1F513}\",\n },\n [PERMISSION_STATE.NEVER]: {\n label: \"Never\",\n color: \"#c62828\",\n bgColor: \"#ffebee\",\n icon: \"\\u{1F512}\",\n },\n};\n\n// ─── Codebook default bound (CVC-133 `bounds:`, per role × function) ──\n\n/**\n * The state the CVC-133 codebook gives one role for one function: the four\n * PERMISSION_STATE values plus `NA` (\"Not relevant\": canon's\n * `not_applicable_roles`). Canon's `always` / `default_on` / `default_off` /\n * `never` read ALWAYS / PREF_YES / PREF_NO / NEVER. A role the codebook does\n * not name for a function has NO default bound (\"unbound\"), which is an absent\n * key, never a sixth value.\n *\n * `NA` is deliberately NOT a PERMISSION_STATE: it is codebook vocabulary, not\n * a grantable policy state. The shared resolver reads a stored `NA` as NEVER\n * at every tier (and any other value outside PERMISSION_STATE as malformed,\n * which also denies).\n */\nexport const DEFAULT_BOUND_STATE = {\n ...PERMISSION_STATE,\n /** Not relevant — canon's `not_applicable_roles` for this function. */\n NA: \"NA\",\n} as const;\n\nexport type DefaultBoundStateValue =\n (typeof DEFAULT_BOUND_STATE)[keyof typeof DEFAULT_BOUND_STATE];\n\nexport const DEFAULT_BOUND_STATE_VALUES = [\n ...PERMISSION_STATE_VALUES,\n DEFAULT_BOUND_STATE.NA,\n] as const;\n\n/**\n * Labels for a Tier-1 (platform role) state, which may be the codebook's `NA`\n * since 0.24.0. `PERMISSION_STATE_LABELS` / `PERMISSION_STATE_DISPLAY` keep\n * their four keys (agency and team states have no NA); index THESE with a\n * `PlatformRoleDef.functions` value, or a stored \"NA\" looks up `undefined`.\n * \"Not relevant\" is the codebook chip label (platform-prototype @ a6f1f3a\n * `src/screens.jsx:19151` `PB_STATE_SHORT.na`).\n */\nexport const DEFAULT_BOUND_STATE_LABELS: Record<DefaultBoundStateValue, string> = {\n ...PERMISSION_STATE_LABELS,\n [DEFAULT_BOUND_STATE.NA]: \"Not relevant\",\n};\n\n/**\n * `PERMISSION_STATE_DISPLAY` plus `NA`. Like the other four entries these are\n * package display defaults, not canon tokens (canon inks NA with\n * `--highlight-sandstone-gold`, `assets/app-styles.css:12318`).\n */\nexport const DEFAULT_BOUND_STATE_DISPLAY: Record<\n DefaultBoundStateValue,\n { label: string; color: string; bgColor: string; icon: string }\n> = {\n ...PERMISSION_STATE_DISPLAY,\n [DEFAULT_BOUND_STATE.NA]: {\n label: \"Not relevant\",\n color: \"#616161\",\n bgColor: \"#f5f5f5\",\n icon: \"\\u25CC\",\n },\n};\n\n// ─── Share View (data visibility for shared records) ───────────────\n\nexport const SHARE_VIEW = {\n /** System metadata only (partial access). */\n SYS_INFO: \"sys_info\",\n /** Full case/record content. */\n ALL: \"all\",\n /** No data access. */\n NONE: \"none\",\n} as const;\n\nexport type ShareViewValue = (typeof SHARE_VIEW)[keyof typeof SHARE_VIEW];\n\nexport const SHARE_VIEW_VALUES = [\n SHARE_VIEW.SYS_INFO,\n SHARE_VIEW.ALL,\n SHARE_VIEW.NONE,\n] as const;\n\nexport const SHARE_VIEW_LABELS: Record<ShareViewValue, string> = {\n [SHARE_VIEW.SYS_INFO]: \"System Info Only\",\n [SHARE_VIEW.ALL]: \"Full Content\",\n [SHARE_VIEW.NONE]: \"No Data Access\",\n};\n\n// ─── Platform Tool Codes ───────────────────────────────────────────\n\nexport const PLATFORM_TOOL = {\n PAVE: \"PAVE\",\n ECHO: \"ECHO\",\n LEADS: \"LEADS\",\n THREAD: \"THREAD\",\n TRAIL: \"TRAIL\",\n PLATFORM: \"PLATFORM\",\n} as const;\n\nexport type PlatformToolValue =\n (typeof PLATFORM_TOOL)[keyof typeof PLATFORM_TOOL];\n\nexport const PLATFORM_TOOL_VALUES = [\n PLATFORM_TOOL.PAVE,\n PLATFORM_TOOL.ECHO,\n PLATFORM_TOOL.LEADS,\n PLATFORM_TOOL.THREAD,\n PLATFORM_TOOL.TRAIL,\n PLATFORM_TOOL.PLATFORM,\n] as const;\n\nexport const PLATFORM_TOOL_LABELS: Record<PlatformToolValue, string> = {\n [PLATFORM_TOOL.PAVE]: \"PAVE\",\n [PLATFORM_TOOL.ECHO]: \"Echo\",\n [PLATFORM_TOOL.LEADS]: \"LEADS\",\n [PLATFORM_TOOL.THREAD]: \"Thread\",\n [PLATFORM_TOOL.TRAIL]: \"Trail\",\n [PLATFORM_TOOL.PLATFORM]: \"Platform\",\n};\n\n// ─── Role Level (hierarchy tiers) ──────────────────────────────────\n\nexport const ROLE_LEVEL = {\n /** User-facing roles (staff, volunteers, practitioners). */\n OPERATIONAL: \"operational\",\n /** Agency-level admin roles. */\n AGENCY: \"agency\",\n /** Team-level admin roles. */\n TEAM: \"team\",\n /** HTI-wide platform admin. */\n PLATFORM: \"platform\",\n /** External governance/oversight roles. */\n OVERSIGHT: \"oversight\",\n} as const;\n\nexport type RoleLevelValue = (typeof ROLE_LEVEL)[keyof typeof ROLE_LEVEL];\n\nexport const ROLE_LEVEL_VALUES = [\n ROLE_LEVEL.OPERATIONAL,\n ROLE_LEVEL.AGENCY,\n ROLE_LEVEL.TEAM,\n ROLE_LEVEL.PLATFORM,\n ROLE_LEVEL.OVERSIGHT,\n] as const;\n\nexport const ROLE_LEVEL_LABELS: Record<RoleLevelValue, string> = {\n [ROLE_LEVEL.OPERATIONAL]: \"Operational\",\n [ROLE_LEVEL.AGENCY]: \"Agency\",\n [ROLE_LEVEL.TEAM]: \"Team\",\n [ROLE_LEVEL.PLATFORM]: \"Platform\",\n [ROLE_LEVEL.OVERSIGHT]: \"Oversight\",\n};\n\n// ─── Function Implementation Status ────────────────────────────────\n\nexport const FUNCTION_STATUS = {\n NOT_STARTED: \"Not started\",\n DEFINED_NEW: \"Defined; new function\",\n DEFINED_EXISTING: \"Defined; existing PAVE function\",\n FUNCTIONAL: \"Functional on all apps\",\n FUTURE: \"Future function (not v1)\",\n} as const;\n\nexport type FunctionStatusValue =\n (typeof FUNCTION_STATUS)[keyof typeof FUNCTION_STATUS];\n\nexport const FUNCTION_STATUS_VALUES = [\n FUNCTION_STATUS.NOT_STARTED,\n FUNCTION_STATUS.DEFINED_NEW,\n FUNCTION_STATUS.DEFINED_EXISTING,\n FUNCTION_STATUS.FUNCTIONAL,\n FUNCTION_STATUS.FUTURE,\n] as const;\n\nexport const FUNCTION_STATUS_LABELS: Record<FunctionStatusValue, string> = {\n [FUNCTION_STATUS.NOT_STARTED]: \"Not Started\",\n [FUNCTION_STATUS.DEFINED_NEW]: \"Defined (New)\",\n [FUNCTION_STATUS.DEFINED_EXISTING]: \"Defined (Existing PAVE)\",\n [FUNCTION_STATUS.FUNCTIONAL]: \"Functional\",\n [FUNCTION_STATUS.FUTURE]: \"Future (Not v1)\",\n};\n","/**\n * @htilabs/platform-common-models — Generated CVC Key Enums\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `npm run codegen:cvc` (see scripts/codegen-cvc-enums.ts).\n *\n * Provides compile-time `key → code` maps for each CVC domain so TypeScript\n * consumers get autocompletion and type safety on CVC keys. The runtime\n * equivalent is `CvcRegistryService.getEntryByKey()`. Locked spec §9.4.\n */\n\n/**\n * Key → positional code map for the `service_categories` CVC domain (CVC-22, canonical; SOT v2.1.0 GENERATED from prototype canon `data/cvcs/core_service_categories.yaml` by scripts/gen-service-categories.py). Keys are stable across v1.2.0 → v2.0.0 → v2.1.0 (2.1.0 adds the LAP · INS · TRA rows, nothing moved); POSITIONAL CODES MOVED in v2.0.0 (a v1.2.0 code may name a different category — translate through the key, see `serviceCategoriesSot._supersedes.codeMoves`). Store the key. Every SOT entry also carries canon's rename/move-stable `vscatId` (a static-SOT field — the cvc_entities seeder does not persist it). Reseeding the shared registry to 2.0.0 is a coordinated cutover — see README § service_categories 2.0.0.\n *\n * Domain: `service_categories` · Version: 2.1.0 · Entries: 158\n */\nexport const ServiceCategoryKeys = {\n missingness_root: \"022-000-000-000-000-000-000\",\n unknown: \"022-000-000-000-000-000-001\",\n anonymous: \"022-000-000-000-000-000-002\",\n data_not_collected: \"022-000-000-000-000-000-003\",\n basic_needs: \"022-001-000-000-000-000-000\",\n immediate_safety_planning: \"022-001-001-000-000-000-000\",\n emergency_crisis_safety_support: \"022-001-001-001-000-000-000\",\n on_scene_crisis_response: \"022-001-001-001-001-000-000\",\n hotline_crisis_line: \"022-001-001-001-002-000-000\",\n crisis_intervention_in_person: \"022-001-001-001-003-000-000\",\n food: \"022-001-002-000-000-000-000\",\n clothing_shoes_accessories: \"022-001-003-000-000-000-000\",\n over_the_counter_medications: \"022-001-004-000-000-000-000\",\n hygiene_items_personal_care: \"022-001-005-000-000-000-000\",\n communications_connectivity: \"022-001-006-000-000-000-000\",\n interpreter_services: \"022-001-007-000-000-000-000\",\n elder_assistance: \"022-001-008-000-000-000-000\",\n housing_services: \"022-002-000-000-000-000-000\",\n emergency_shelter: \"022-002-001-000-000-000-000\",\n day_shelter_dropin: \"022-002-001-001-000-000-000\",\n host_homes_safe_homes: \"022-002-001-002-000-000-000\",\n congregate_shelter_bednight: \"022-002-001-003-000-000-000\",\n emergency_hotel_motel: \"022-002-001-004-000-000-000\",\n night_by_night_shelter: \"022-002-001-005-000-000-000\",\n transitional_housing: \"022-002-002-000-000-000-000\",\n housing_renovation_modification: \"022-002-003-000-000-000-000\",\n housing_navigation_placement: \"022-002-004-000-000-000-000\",\n housing_financial_assistance: \"022-002-004-001-000-000-000\",\n rental_payment_assistance: \"022-002-004-001-001-000-000\",\n security_deposit_allowance: \"022-002-004-001-001-001-000\",\n utility_assistance: \"022-002-004-001-001-002-000\",\n relocation_moving_assistance: \"022-002-004-002-000-000-000\",\n housing_stabilization_eviction_prevention: \"022-002-005-000-000-000-000\",\n tenant_based_scattered_site: \"022-002-006-000-000-000-000\",\n household_setup_goods: \"022-002-007-000-000-000-000\",\n social_support_community_engagement: \"022-003-000-000-000-000-000\",\n gift_holiday_resources: \"022-003-001-000-000-000-000\",\n peer_facilitated_supportive_group: \"022-003-002-000-000-000-000\",\n community_service_learning: \"022-003-003-000-000-000-000\",\n cultural_needs_support: \"022-003-004-000-000-000-000\",\n survivor_support_psychoeducation: \"022-003-005-000-000-000-000\",\n transportation: \"022-004-000-000-000-000-000\",\n transportation_assistance_direct: \"022-004-001-000-000-000-000\",\n transportation_direct_emergency: \"022-004-001-001-000-000-000\",\n taxi_rideshare_voucher: \"022-004-002-000-000-000-000\",\n taxi_rideshare_emergency: \"022-004-002-001-000-000-000\",\n bus_fare_pass: \"022-004-003-000-000-000-000\",\n bus_fare_pass_emergency: \"022-004-003-001-000-000-000\",\n gift_card_gas_card: \"022-004-004-000-000-000-000\",\n gift_card_gas_card_emergency: \"022-004-004-001-000-000-000\",\n airline_tickets: \"022-004-005-000-000-000-000\",\n airline_tickets_emergency: \"022-004-005-001-000-000-000\",\n legal_services: \"022-005-000-000-000-000-000\",\n immigration_relief: \"022-005-001-000-000-000-000\",\n repatriation: \"022-005-001-001-000-000-000\",\n family_law: \"022-005-002-000-000-000-000\",\n criminal_support: \"022-005-003-000-000-000-000\",\n victim_impact_statement: \"022-005-003-001-000-000-000\",\n perpetrator_accountability: \"022-005-003-002-000-000-000\",\n victim_compensation: \"022-005-003-003-000-000-000\",\n victims_rights_representation: \"022-005-003-004-000-000-000\",\n criminal_record_relief: \"022-005-003-005-000-000-000\",\n emergency_safety_assistance: \"022-005-004-000-000-000-000\",\n civil_support: \"022-005-005-000-000-000-000\",\n protection_restraining_orders: \"022-005-005-001-000-000-000\",\n public_benefits_law: \"022-005-005-002-000-000-000\",\n healthcare: \"022-006-000-000-000-000-000\",\n medical: \"022-006-001-000-000-000-000\",\n forensic_exam_interview: \"022-006-001-001-000-000-000\",\n specialized_assessments: \"022-006-001-001-001-000-000\",\n counseling_evaluation_assessment: \"022-006-001-001-001-001-000\",\n stalking_assessment: \"022-006-001-001-001-002-000\",\n danger_assessment: \"022-006-001-001-001-003-000\",\n indepth_assessment: \"022-006-001-001-001-004-000\",\n dv_exam: \"022-006-001-001-002-000-000\",\n sane_exam: \"022-006-001-001-003-000-000\",\n std_testing: \"022-006-001-001-004-000-000\",\n outpatient_medical: \"022-006-001-002-000-000-000\",\n vision: \"022-006-001-002-001-000-000\",\n dental: \"022-006-001-002-002-000-000\",\n pet_medical: \"022-006-001-002-003-000-000\",\n tattoo_removal: \"022-006-001-002-004-000-000\",\n emergency_medical_care: \"022-006-001-003-000-000-000\",\n pregnancy_care: \"022-006-001-004-000-000-000\",\n prenatal_care: \"022-006-001-004-001-000-000\",\n postnatal_care_client: \"022-006-001-004-002-000-000\",\n postnatal_care_newborn: \"022-006-001-004-003-000-000\",\n emotional_support_mental_health: \"022-006-002-000-000-000-000\",\n behavioral_occupational_support: \"022-006-002-001-000-000-000\",\n substance_abuse_treatment: \"022-006-002-001-001-000-000\",\n coping_strategy_support: \"022-006-002-001-002-000-000\",\n individual_counseling: \"022-006-002-002-000-000-000\",\n group_counseling: \"022-006-002-003-000-000-000\",\n other_therapy: \"022-006-002-004-000-000-000\",\n family_counseling: \"022-006-002-005-000-000-000\",\n counseling_treatment_planning: \"022-006-002-006-000-000-000\",\n counseling_treatment_plan_review: \"022-006-002-007-000-000-000\",\n financial_and_employment: \"022-007-000-000-000-000-000\",\n financial_support: \"022-007-001-000-000-000-000\",\n emergency_financial_assistance: \"022-007-001-001-000-000-000\",\n budgeting_financial_capability: \"022-007-001-002-000-000-000\",\n employment_support: \"022-007-002-000-000-000-000\",\n employment_assistance_job_search: \"022-007-002-001-000-000-000\",\n job_vocation_training: \"022-007-002-002-000-000-000\",\n supported_employment: \"022-007-002-003-000-000-000\",\n informal_education_life_skills: \"022-008-000-000-000-000-000\",\n basic_life_skills_self_care: \"022-008-001-000-000-000-000\",\n accessibility_disability_support: \"022-008-002-000-000-000-000\",\n parenting_education: \"022-008-003-000-000-000-000\",\n learning_language_classes: \"022-008-004-000-000-000-000\",\n formal_education_academic_support: \"022-008-005-000-000-000-000\",\n adult_school_ged: \"022-008-005-001-000-000-000\",\n child_school_enrollment: \"022-008-005-002-000-000-000\",\n dependents: \"022-009-000-000-000-000-000\",\n child_care: \"022-009-001-000-000-000-000\",\n childrens_activities: \"022-009-001-001-000-000-000\",\n children_youth_baby_supplies: \"022-009-001-002-000-000-000\",\n pet_care: \"022-009-002-000-000-000-000\",\n case_coordination: \"022-010-000-000-000-000-000\",\n intake: \"022-010-001-000-000-000-000\",\n screening: \"022-010-001-001-000-000-000\",\n needs_assessment: \"022-010-001-001-001-000-000\",\n initial_screen: \"022-010-001-001-002-000-000\",\n housing_eligibility_determination: \"022-010-001-001-003-000-000\",\n coordinated_entry: \"022-010-001-001-003-001-000\",\n behavioral_issues_screen: \"022-010-001-001-004-000-000\",\n tvap: \"022-010-001-001-005-000-000\",\n lethality_assessment: \"022-010-001-001-006-000-000\",\n injury_strangulation_screen: \"022-010-001-001-007-000-000\",\n trafficking_risk_assessment: \"022-010-001-001-008-000-000\",\n advocacy: \"022-010-002-000-000-000-000\",\n medical_advocacy: \"022-010-002-001-000-000-000\",\n advocacy_emergency_medical: \"022-010-002-001-001-000-000\",\n advocacy_forensic_exam: \"022-010-002-001-002-000-000\",\n court_advocacy: \"022-010-002-002-000-000-000\",\n family_reunification: \"022-010-002-002-001-000-000\",\n crime_scene_clean_up: \"022-010-002-002-002-000-000\",\n law_enforcement_interview_support: \"022-010-002-002-003-000-000\",\n prosecution_interview_advocacy: \"022-010-002-002-004-000-000\",\n immigration_advocacy_support: \"022-010-002-002-005-000-000\",\n documentation_records_retrieval: \"022-010-002-003-000-000-000\",\n obtaining_drivers_license: \"022-010-002-003-001-000-000\",\n obtaining_insurance: \"022-010-002-003-002-000-000\",\n drivers_car_insurance: \"022-010-002-003-002-001-000\",\n medical_insurance: \"022-010-002-003-002-002-000\",\n faith_resource: \"022-010-002-004-000-000-000\",\n income_benefits_navigation: \"022-010-002-005-000-000-000\",\n government_services_special_programs: \"022-010-002-005-001-000-000\",\n banking_notary: \"022-010-002-006-000-000-000\",\n intervention_employer_creditor_academic: \"022-010-002-007-000-000-000\",\n case_management_supportive_services: \"022-010-003-000-000-000-000\",\n intra_agency_provider_coordination: \"022-010-003-001-000-000-000\",\n inter_agency_consultation: \"022-010-003-002-000-000-000\",\n service_plan: \"022-010-003-003-000-000-000\",\n hope_scale_and_plan: \"022-010-003-003-001-000-000\",\n post_exit_plan: \"022-010-003-004-000-000-000\",\n advanced_directives: \"022-010-003-005-000-000-000\",\n other_services: \"022-011-000-000-000-000-000\",\n} as const;\n\nexport type ServiceCategoryKey = keyof typeof ServiceCategoryKeys;\n\n/**\n * Key → positional code map for the `service_states` CVC domain (CVC-49, canonical; SOT v1.2.0 GENERATED from prototype canon `data/cvcs/core_service_state.yaml` by scripts/gen-service-states.py). The stored lifecycle state of ONE service instance — the CVC-49 CODE at rest (Crysta ruling E, 2026-10-07); the app's stamp words are display. Eight keys are DEPRECATED read-only rows (`selectable: false`, `deprecated: true`): the four 'Unable due to …' sub-rows canon archived onto CVC-219 why-nots, the two provisional sub-rows, and `anonymous` / `data_not_collected` (level 0 is UNK alone). The stamp → code crosswalk is `serviceStatesSot.stampCrosswalk` and `SERVICE_STATE_STAMP_CROSSWALK`.\n *\n * Domain: `service_states` · Version: 1.2.0 · Entries: 17\n */\nexport const ServiceStateKeys = {\n missingness_root: \"049-000-000-000-000-000-000\",\n unknown: \"049-000-000-000-000-000-001\",\n anonymous: \"049-000-000-000-000-000-002\",\n data_not_collected: \"049-000-000-000-000-000-003\",\n need_identified: \"049-001-000-000-000-000-000\",\n offered: \"049-002-000-000-000-000-000\",\n scheduled_in_progress: \"049-003-000-000-000-000-000\",\n delivered: \"049-004-000-000-000-000-000\",\n completed: \"049-005-000-000-000-000-000\",\n declined_by_client: \"049-006-000-000-000-000-000\",\n unable_to_provide: \"049-007-000-000-000-000-000\",\n unable_to_provide_eligibility: \"049-007-001-000-000-000-000\",\n unable_to_provide_capacity: \"049-007-002-000-000-000-000\",\n unable_to_provide_resource: \"049-007-003-000-000-000-000\",\n unable_other_reason: \"049-007-004-000-000-000-000\",\n unable_to_provide_service_fit: \"049-007-005-000-000-000-000\",\n unable_to_provide_access_barrier: \"049-007-006-000-000-000-000\",\n} as const;\n\nexport type ServiceStateKey = keyof typeof ServiceStateKeys;\n\n/**\n * Key → positional code map for the `service_mechanisms` CVC domain (CVC-25, canonical; SOT v1.1.0 GENERATED from prototype canon `data/cvcs/core_service_mechanisms.yaml` by scripts/gen-service-mechanisms.py). HOW a service was delivered — ONE OR MORE per service instance (a list, CVC25-AUDIT R1); a `referred` stamp requires `support_via_referral` among them. Every substantive entry carries canon's minted token on `canonicalCode` (REFERRAL · INFORMATIONAL · DIRECT_STAFF · FINANCIAL_MATERIAL; UNK · ANON · DNC) — `SERVICE_MECHANISM_CANONICAL_CODE` is the key → token map, `serviceMechanismKeyForCanonicalCode` the inverse.\n *\n * Domain: `service_mechanisms` · Version: 1.1.0 · Entries: 8\n */\nexport const ServiceMechanismKeys = {\n missingness_root: \"025-000-000-000-000-000-000\",\n unknown: \"025-000-000-000-000-000-001\",\n anonymous: \"025-000-000-000-000-000-002\",\n data_not_collected: \"025-000-000-000-000-000-003\",\n support_via_referral: \"025-001-000-000-000-000-000\",\n informational_support: \"025-002-000-000-000-000-000\",\n direct_staff_contractor: \"025-003-000-000-000-000-000\",\n financial_material_assistance: \"025-004-000-000-000-000-000\",\n} as const;\n\nexport type ServiceMechanismKey = keyof typeof ServiceMechanismKeys;\n\n/**\n * Key → positional code map for the `incident_participation_roles` CVC domain.\n *\n * Domain: `incident_participation_roles` · Version: 1.1.0 · Entries: 31\n */\nexport const IncidentParticipationRoleKeys = {\n missingness_root: \"069-000-000-000-000-000-000\",\n unknown: \"069-000-000-000-000-000-001\",\n anonymous: \"069-000-000-000-000-000-002\",\n data_not_collected: \"069-000-000-000-000-000-003\",\n client_group: \"069-001-000-000-000-000-000\",\n client_subject: \"069-001-001-000-000-000-000\",\n caller_reporter_group: \"069-002-000-000-000-000-000\",\n caller_self: \"069-002-001-000-000-000-000\",\n caller_third_party: \"069-002-002-000-000-000-000\",\n reporter: \"069-002-003-000-000-000-000\",\n support_network_group: \"069-003-000-000-000-000-000\",\n family_member_or_guardian: \"069-003-001-000-000-000-000\",\n friend_or_peer: \"069-003-002-000-000-000-000\",\n system_professional_group: \"069-004-000-000-000-000-000\",\n service_provider_staff: \"069-004-001-000-000-000-000\",\n medical_provider_staff: \"069-004-002-000-000-000-000\",\n data_entry: \"069-004-003-000-000-000-000\",\n other_incident_responder: \"069-004-004-000-000-000-000\",\n responding_officer: \"069-004-005-000-000-000-000\",\n legal_professional: \"069-004-006-000-000-000-000\",\n prosecutor: \"069-004-006-001-000-000-000\",\n vsp_staff: \"069-004-007-000-000-000-000\",\n healthcare_provider_staff: \"069-004-008-000-000-000-000\",\n law_enforcement_personnel: \"069-004-009-000-000-000-000\",\n lead_investigator: \"069-004-009-001-000-000-000\",\n investigator: \"069-004-009-002-000-000-000\",\n analyst: \"069-004-009-003-000-000-000\",\n le_officer: \"069-004-009-004-000-000-000\",\n other_response_personnel: \"069-004-010-000-000-000-000\",\n data_entry_staff: \"069-004-011-000-000-000-000\",\n task_force: \"069-004-012-000-000-000-000\",\n} as const;\n\nexport type IncidentParticipationRoleKey = keyof typeof IncidentParticipationRoleKeys;\n\n/**\n * Key → positional code map for the `incident_involvement_roles` CVC domain.\n *\n * Domain: `incident_involvement_roles` · Version: 1.0.0 · Entries: 10\n */\nexport const IncidentInvolvementRoleKeys = {\n missingness_root: \"130-000-000-000-000-000-000\",\n unknown: \"130-000-000-000-000-000-001\",\n anonymous: \"130-000-000-000-000-000-002\",\n data_not_collected: \"130-000-000-000-000-000-003\",\n victim_primary: \"130-001-000-000-000-000-000\",\n victim_secondary: \"130-002-000-000-000-000-000\",\n victim_other: \"130-003-000-000-000-000-000\",\n offender: \"130-004-000-000-000-000-000\",\n witness: \"130-005-000-000-000-000-000\",\n dependent: \"130-006-000-000-000-000-000\",\n} as const;\n\nexport type IncidentInvolvementRoleKey = keyof typeof IncidentInvolvementRoleKeys;\n\n/**\n * Key → positional code map for the `race_ethnicity` CVC domain.\n *\n * Domain: `race_ethnicity` · Version: 1.1.0 · Entries: 14\n */\nexport const RaceEthnicityKeys = {\n missingness_root: \"076-000-000-000-000-000-000\",\n unknown: \"076-000-000-000-000-000-001\",\n anonymous: \"076-000-000-000-000-000-002\",\n data_not_collected: \"076-000-000-000-000-000-003\",\n prefer_not_to_answer: \"076-000-000-000-000-000-004\",\n american_indian_or_alaska_native: \"076-001-000-000-000-000-000\",\n asian: \"076-002-000-000-000-000-000\",\n black_or_african_american: \"076-003-000-000-000-000-000\",\n hispanic_or_latino: \"076-004-000-000-000-000-000\",\n middle_eastern_or_north_african: \"076-005-000-000-000-000-000\",\n multiple_races: \"076-006-000-000-000-000-000\",\n native_hawaiian_or_pacific_islander: \"076-007-000-000-000-000-000\",\n other_self_described: \"076-008-000-000-000-000-000\",\n white: \"076-009-000-000-000-000-000\",\n} as const;\n\nexport type RaceEthnicityKey = keyof typeof RaceEthnicityKeys;\n\n/**\n * Key → positional code map for the `primary_language` CVC domain.\n *\n * Domain: `primary_language` · Version: 1.0.0 · Entries: 191\n */\nexport const PrimaryLanguageKeys = {\n missingness_root: \"122-000-000-000-000-000-000\",\n unknown: \"122-000-000-000-000-000-001\",\n anonymous: \"122-000-000-000-000-000-002\",\n data_not_collected: \"122-000-000-000-000-000-003\",\n abkhazian: \"122-001-000-000-000-000-000\",\n afar: \"122-002-000-000-000-000-000\",\n afrikaans: \"122-003-000-000-000-000-000\",\n akan: \"122-004-000-000-000-000-000\",\n albanian: \"122-005-000-000-000-000-000\",\n american_sign_language: \"122-006-000-000-000-000-000\",\n amharic: \"122-007-000-000-000-000-000\",\n arabic: \"122-008-000-000-000-000-000\",\n aragonese: \"122-009-000-000-000-000-000\",\n armenian: \"122-010-000-000-000-000-000\",\n assamese: \"122-011-000-000-000-000-000\",\n avaric: \"122-012-000-000-000-000-000\",\n avestan: \"122-013-000-000-000-000-000\",\n aymara: \"122-014-000-000-000-000-000\",\n azerbaijani: \"122-015-000-000-000-000-000\",\n bambara: \"122-016-000-000-000-000-000\",\n bashkir: \"122-017-000-000-000-000-000\",\n basque: \"122-018-000-000-000-000-000\",\n belarusian: \"122-019-000-000-000-000-000\",\n bengali: \"122-020-000-000-000-000-000\",\n bislama: \"122-021-000-000-000-000-000\",\n bosnian: \"122-022-000-000-000-000-000\",\n breton: \"122-023-000-000-000-000-000\",\n bulgarian: \"122-024-000-000-000-000-000\",\n burmese: \"122-025-000-000-000-000-000\",\n catalan_valencian: \"122-026-000-000-000-000-000\",\n central_khmer: \"122-027-000-000-000-000-000\",\n chamorro: \"122-028-000-000-000-000-000\",\n chechen: \"122-029-000-000-000-000-000\",\n chichewa_chewa_nyanja: \"122-030-000-000-000-000-000\",\n chinese: \"122-031-000-000-000-000-000\",\n chinese_cantonese: \"122-032-000-000-000-000-000\",\n chinese_mandarin: \"122-033-000-000-000-000-000\",\n church_slavic_old_slavonic_church_slavonic_old_bulgarian_old_church_slavonic: \"122-034-000-000-000-000-000\",\n chuvash: \"122-035-000-000-000-000-000\",\n cornish: \"122-036-000-000-000-000-000\",\n corsican: \"122-037-000-000-000-000-000\",\n cree: \"122-038-000-000-000-000-000\",\n croatian: \"122-039-000-000-000-000-000\",\n czech: \"122-040-000-000-000-000-000\",\n danish: \"122-041-000-000-000-000-000\",\n divehi_dhivehi_maldivian: \"122-042-000-000-000-000-000\",\n dutch_flemish: \"122-043-000-000-000-000-000\",\n dzongkha: \"122-044-000-000-000-000-000\",\n english: \"122-045-000-000-000-000-000\",\n esperanto: \"122-046-000-000-000-000-000\",\n estonian: \"122-047-000-000-000-000-000\",\n ewe: \"122-048-000-000-000-000-000\",\n faroese: \"122-049-000-000-000-000-000\",\n fijian: \"122-050-000-000-000-000-000\",\n finnish: \"122-051-000-000-000-000-000\",\n french: \"122-052-000-000-000-000-000\",\n fulah: \"122-053-000-000-000-000-000\",\n gaelic_scottish_gaelic: \"122-054-000-000-000-000-000\",\n galician: \"122-055-000-000-000-000-000\",\n ganda: \"122-056-000-000-000-000-000\",\n georgian: \"122-057-000-000-000-000-000\",\n german: \"122-058-000-000-000-000-000\",\n guarani: \"122-059-000-000-000-000-000\",\n gujarati: \"122-060-000-000-000-000-000\",\n haitian_haitian_creole: \"122-061-000-000-000-000-000\",\n hausa: \"122-062-000-000-000-000-000\",\n hebrew: \"122-063-000-000-000-000-000\",\n herero: \"122-064-000-000-000-000-000\",\n hindi: \"122-065-000-000-000-000-000\",\n hiri_motu: \"122-066-000-000-000-000-000\",\n hungarian: \"122-067-000-000-000-000-000\",\n icelandic: \"122-068-000-000-000-000-000\",\n ido: \"122-069-000-000-000-000-000\",\n igbo: \"122-070-000-000-000-000-000\",\n indonesian: \"122-071-000-000-000-000-000\",\n interlingua: \"122-072-000-000-000-000-000\",\n interlingue_occidental: \"122-073-000-000-000-000-000\",\n inuktitut: \"122-074-000-000-000-000-000\",\n inupiaq: \"122-075-000-000-000-000-000\",\n irish: \"122-076-000-000-000-000-000\",\n italian: \"122-077-000-000-000-000-000\",\n japanese: \"122-078-000-000-000-000-000\",\n javanese: \"122-079-000-000-000-000-000\",\n kalaallisut_greenlandic: \"122-080-000-000-000-000-000\",\n kannada: \"122-081-000-000-000-000-000\",\n kanuri: \"122-082-000-000-000-000-000\",\n kashmiri: \"122-083-000-000-000-000-000\",\n kazakh: \"122-084-000-000-000-000-000\",\n kikuyu_gikuyu: \"122-085-000-000-000-000-000\",\n kinyarwanda: \"122-086-000-000-000-000-000\",\n kirghiz_kyrgyz: \"122-087-000-000-000-000-000\",\n komi: \"122-088-000-000-000-000-000\",\n kongo: \"122-089-000-000-000-000-000\",\n korean: \"122-090-000-000-000-000-000\",\n kuanyama_kwanyama: \"122-091-000-000-000-000-000\",\n kurdish: \"122-092-000-000-000-000-000\",\n lao: \"122-093-000-000-000-000-000\",\n latin: \"122-094-000-000-000-000-000\",\n latvian: \"122-095-000-000-000-000-000\",\n limburgan_limburger_limburgish: \"122-096-000-000-000-000-000\",\n lingala: \"122-097-000-000-000-000-000\",\n lithuanian: \"122-098-000-000-000-000-000\",\n luba_katanga: \"122-099-000-000-000-000-000\",\n luxembourgish_letzeburgesch: \"122-100-000-000-000-000-000\",\n macedonian: \"122-101-000-000-000-000-000\",\n malagasy: \"122-102-000-000-000-000-000\",\n malay: \"122-103-000-000-000-000-000\",\n malayalam: \"122-104-000-000-000-000-000\",\n maltese: \"122-105-000-000-000-000-000\",\n manx: \"122-106-000-000-000-000-000\",\n maori: \"122-107-000-000-000-000-000\",\n marathi: \"122-108-000-000-000-000-000\",\n marshallese: \"122-109-000-000-000-000-000\",\n modern_greek: \"122-110-000-000-000-000-000\",\n mongolian: \"122-111-000-000-000-000-000\",\n nauru: \"122-112-000-000-000-000-000\",\n navajo_navaho: \"122-113-000-000-000-000-000\",\n ndonga: \"122-114-000-000-000-000-000\",\n nepali: \"122-115-000-000-000-000-000\",\n north_ndebele: \"122-116-000-000-000-000-000\",\n northern_sami: \"122-117-000-000-000-000-000\",\n norwegian: \"122-118-000-000-000-000-000\",\n norwegian_bokmal: \"122-119-000-000-000-000-000\",\n norwegian_nynorsk: \"122-120-000-000-000-000-000\",\n occitan: \"122-121-000-000-000-000-000\",\n ojibwa: \"122-122-000-000-000-000-000\",\n oriya: \"122-123-000-000-000-000-000\",\n oromo: \"122-124-000-000-000-000-000\",\n ossetian_ossetic: \"122-125-000-000-000-000-000\",\n other_language: \"122-126-000-000-000-000-000\",\n pali: \"122-127-000-000-000-000-000\",\n panjabi_punjabi: \"122-128-000-000-000-000-000\",\n persian: \"122-129-000-000-000-000-000\",\n polish: \"122-130-000-000-000-000-000\",\n portuguese: \"122-131-000-000-000-000-000\",\n pushto_pashto: \"122-132-000-000-000-000-000\",\n quechua: \"122-133-000-000-000-000-000\",\n romanian_moldavian_moldovan: \"122-134-000-000-000-000-000\",\n romansh: \"122-135-000-000-000-000-000\",\n rundi: \"122-136-000-000-000-000-000\",\n russian: \"122-137-000-000-000-000-000\",\n samoan: \"122-138-000-000-000-000-000\",\n sango: \"122-139-000-000-000-000-000\",\n sanskrit: \"122-140-000-000-000-000-000\",\n sardinian: \"122-141-000-000-000-000-000\",\n serbian: \"122-142-000-000-000-000-000\",\n shona: \"122-143-000-000-000-000-000\",\n sichuan_yi_nuosu: \"122-144-000-000-000-000-000\",\n sindhi: \"122-145-000-000-000-000-000\",\n sinhala_sinhalese: \"122-146-000-000-000-000-000\",\n slovak: \"122-147-000-000-000-000-000\",\n slovenian: \"122-148-000-000-000-000-000\",\n somali: \"122-149-000-000-000-000-000\",\n sotho_southern: \"122-150-000-000-000-000-000\",\n south_ndebele: \"122-151-000-000-000-000-000\",\n spanish: \"122-152-000-000-000-000-000\",\n sundanese: \"122-153-000-000-000-000-000\",\n swahili: \"122-154-000-000-000-000-000\",\n swati: \"122-155-000-000-000-000-000\",\n swedish: \"122-156-000-000-000-000-000\",\n tagalog: \"122-157-000-000-000-000-000\",\n tahitian: \"122-158-000-000-000-000-000\",\n tajik: \"122-159-000-000-000-000-000\",\n tamil: \"122-160-000-000-000-000-000\",\n tatar: \"122-161-000-000-000-000-000\",\n telugu: \"122-162-000-000-000-000-000\",\n thai: \"122-163-000-000-000-000-000\",\n tibetan: \"122-164-000-000-000-000-000\",\n tigrinya: \"122-165-000-000-000-000-000\",\n tonga: \"122-166-000-000-000-000-000\",\n tsonga: \"122-167-000-000-000-000-000\",\n tswana: \"122-168-000-000-000-000-000\",\n turkish: \"122-169-000-000-000-000-000\",\n turkmen: \"122-170-000-000-000-000-000\",\n twi: \"122-171-000-000-000-000-000\",\n uighur_uyghur: \"122-172-000-000-000-000-000\",\n ukrainian: \"122-173-000-000-000-000-000\",\n urdu: \"122-174-000-000-000-000-000\",\n uzbek: \"122-175-000-000-000-000-000\",\n venda: \"122-176-000-000-000-000-000\",\n vietnamese: \"122-177-000-000-000-000-000\",\n volapuk: \"122-178-000-000-000-000-000\",\n walloon: \"122-179-000-000-000-000-000\",\n welsh: \"122-180-000-000-000-000-000\",\n western_frisian: \"122-181-000-000-000-000-000\",\n wolof: \"122-182-000-000-000-000-000\",\n xhosa: \"122-183-000-000-000-000-000\",\n yiddish: \"122-184-000-000-000-000-000\",\n yoruba: \"122-185-000-000-000-000-000\",\n zhuang_chuang: \"122-186-000-000-000-000-000\",\n zulu: \"122-187-000-000-000-000-000\",\n} as const;\n\nexport type PrimaryLanguageKey = keyof typeof PrimaryLanguageKeys;\n\n/**\n * Key → positional code map for the `orientation_identity` CVC domain.\n *\n * Domain: `orientation_identity` · Version: 1.0.0 · Entries: 9\n */\nexport const OrientationIdentityKeys = {\n missingness_root: \"016-000-000-000-000-000-000\",\n unknown: \"016-000-000-000-000-000-001\",\n anonymous: \"016-000-000-000-000-000-002\",\n data_not_collected: \"016-000-000-000-000-000-003\",\n prefer_not_to_answer: \"016-000-000-000-000-000-004\",\n bisexual: \"016-001-000-000-000-000-000\",\n gay_or_lesbian: \"016-002-000-000-000-000-000\",\n other_self_described: \"016-003-000-000-000-000-000\",\n straight: \"016-004-000-000-000-000-000\",\n} as const;\n\nexport type OrientationIdentityKey = keyof typeof OrientationIdentityKeys;\n\n/**\n * Key → positional code map for the `pronouns` CVC domain.\n *\n * Domain: `pronouns` · Version: 1.0.0 · Entries: 8\n */\nexport const PronounsKeys = {\n missingness_root: \"147-000-000-000-000-000-000\",\n unknown: \"147-000-000-000-000-000-001\",\n anonymous: \"147-000-000-000-000-000-002\",\n data_not_collected: \"147-000-000-000-000-000-003\",\n he_him: \"147-001-000-000-000-000-000\",\n she_her: \"147-002-000-000-000-000-000\",\n they_them: \"147-003-000-000-000-000-000\",\n other_self_described: \"147-004-000-000-000-000-000\",\n} as const;\n\nexport type PronounsKey = keyof typeof PronounsKeys;\n\n/**\n * Key → positional code map for the `gender_identity` CVC domain.\n *\n * Domain: `gender_identity` · Version: 1.0.0 · Entries: 12\n */\nexport const GenderIdentityKeys = {\n missingness_root: \"017-000-000-000-000-000-000\",\n unknown: \"017-000-000-000-000-000-001\",\n anonymous: \"017-000-000-000-000-000-002\",\n data_not_collected: \"017-000-000-000-000-000-003\",\n prefer_not_to_answer: \"017-000-000-000-000-000-004\",\n female: \"017-001-000-000-000-000-000\",\n male: \"017-002-000-000-000-000-000\",\n non_binary: \"017-003-000-000-000-000-000\",\n other: \"017-004-000-000-000-000-000\",\n transgender: \"017-005-000-000-000-000-000\",\n transgender_ftm: \"017-005-001-000-000-000-000\",\n transgender_mtf: \"017-005-002-000-000-000-000\",\n} as const;\n\nexport type GenderIdentityKey = keyof typeof GenderIdentityKeys;\n\n/**\n * Key → positional code map for the `tribes` CVC domain.\n *\n * Domain: `tribes` · Version: 1.0.0 · Entries: 53\n */\nexport const TribesKeys = {\n missingness_root: \"148-000-000-000-000-000-000\",\n unknown: \"148-000-000-000-000-000-001\",\n anonymous: \"148-000-000-000-000-000-002\",\n data_not_collected: \"148-000-000-000-000-000-003\",\n cherokee_nation: \"148-001-000-000-000-000-000\",\n muscogee_creek: \"148-002-000-000-000-000-000\",\n choctaw_nation: \"148-003-000-000-000-000-000\",\n chickasaw_nation: \"148-004-000-000-000-000-000\",\n seminole_nation: \"148-005-000-000-000-000-000\",\n osage_nation: \"148-006-000-000-000-000-000\",\n cheyenne_arapaho: \"148-007-000-000-000-000-000\",\n comanche_nation: \"148-008-000-000-000-000-000\",\n kiowa_tribe: \"148-009-000-000-000-000-000\",\n apache_tribe_ok: \"148-010-000-000-000-000-000\",\n caddo_nation: \"148-011-000-000-000-000-000\",\n wichita_affiliated: \"148-012-000-000-000-000-000\",\n delaware_nation: \"148-013-000-000-000-000-000\",\n delaware_tribe_indians: \"148-014-000-000-000-000-000\",\n pawnee_nation: \"148-015-000-000-000-000-000\",\n ponca_tribe_ok: \"148-016-000-000-000-000-000\",\n otoe_missouria: \"148-017-000-000-000-000-000\",\n kaw_nation: \"148-018-000-000-000-000-000\",\n tonkawa_tribe: \"148-019-000-000-000-000-000\",\n iowa_tribe_ok: \"148-020-000-000-000-000-000\",\n sac_fox_ok: \"148-021-000-000-000-000-000\",\n kickapoo_tribe_ok: \"148-022-000-000-000-000-000\",\n potawatomi_citizen: \"148-023-000-000-000-000-000\",\n absentee_shawnee: \"148-024-000-000-000-000-000\",\n eastern_shawnee: \"148-025-000-000-000-000-000\",\n shawnee_tribe: \"148-026-000-000-000-000-000\",\n quapaw_nation: \"148-027-000-000-000-000-000\",\n peoria_tribe: \"148-028-000-000-000-000-000\",\n miami_tribe: \"148-029-000-000-000-000-000\",\n modoc_nation: \"148-030-000-000-000-000-000\",\n ottawa_tribe: \"148-031-000-000-000-000-000\",\n seneca_cayuga: \"148-032-000-000-000-000-000\",\n wyandotte_nation: \"148-033-000-000-000-000-000\",\n united_keetoowah: \"148-034-000-000-000-000-000\",\n thlopthlocco: \"148-035-000-000-000-000-000\",\n alabama_quassarte: \"148-036-000-000-000-000-000\",\n kialegee: \"148-037-000-000-000-000-000\",\n fort_sill_apache: \"148-038-000-000-000-000-000\",\n ponca_ne: \"148-039-000-000-000-000-000\",\n omaha_tribe: \"148-040-000-000-000-000-000\",\n winnebago_ne: \"148-041-000-000-000-000-000\",\n santee_sioux: \"148-042-000-000-000-000-000\",\n sioux_specify: \"148-043-000-000-000-000-000\",\n apache_specify: \"148-044-000-000-000-000-000\",\n pueblo_specify: \"148-045-000-000-000-000-000\",\n navajo_specify: \"148-046-000-000-000-000-000\",\n ojibwe_chippewa_specify: \"148-047-000-000-000-000-000\",\n ute_specify: \"148-048-000-000-000-000-000\",\n other_self_described: \"148-049-000-000-000-000-000\",\n} as const;\n\nexport type TribesKey = keyof typeof TribesKeys;\n\n/**\n * Key → positional code map for the `name_type` CVC domain.\n *\n * Domain: `name_type` · Version: 1.0.0 · Entries: 12\n */\nexport const NameTypeKeys = {\n missingness_root: \"001-000-000-000-000-000-000\",\n unknown: \"001-000-000-000-000-000-001\",\n anonymous: \"001-000-000-000-000-000-002\",\n data_not_collected: \"001-000-000-000-000-000-003\",\n alias: \"001-001-000-000-000-000-000\",\n code_name: \"001-002-000-000-000-000-000\",\n handle_screenname: \"001-003-000-000-000-000-000\",\n legal: \"001-004-000-000-000-000-000\",\n maiden_former: \"001-005-000-000-000-000-000\",\n nickname: \"001-006-000-000-000-000-000\",\n street_name: \"001-007-000-000-000-000-000\",\n trade_name_stage_name: \"001-008-000-000-000-000-000\",\n} as const;\n\nexport type NameTypeKey = keyof typeof NameTypeKeys;\n\n/**\n * Key → positional code map for the `age_bin_reporting` CVC domain.\n *\n * Domain: `age_bin_reporting` · Version: 1.0.0 · Entries: 11\n */\nexport const AgeBinReportingKeys = {\n missingness_root: \"051-000-000-000-000-000-000\",\n unknown: \"051-000-000-000-000-000-001\",\n anonymous: \"051-000-000-000-000-000-002\",\n data_not_collected: \"051-000-000-000-000-000-003\",\n age_0_12: \"051-001-000-000-000-000-000\",\n age_13_17: \"051-002-000-000-000-000-000\",\n age_18_24: \"051-003-000-000-000-000-000\",\n age_25_59: \"051-004-000-000-000-000-000\",\n age_60_plus: \"051-005-000-000-000-000-000\",\n not_reported: \"051-006-000-000-000-000-000\",\n not_tracked: \"051-007-000-000-000-000-000\",\n} as const;\n\nexport type AgeBinReportingKey = keyof typeof AgeBinReportingKeys;\n\n/**\n * Key → positional code map for the `juvenile_justice_involvement_status` CVC domain.\n *\n * Domain: `juvenile_justice_involvement_status` · Version: 1.0.0 · Entries: 7\n */\nexport const JuvenileJusticeInvolvementStatusKeys = {\n missingness_root: \"095-000-000-000-000-000-000\",\n unknown: \"095-000-000-000-000-000-001\",\n prefer_not_to_answer: \"095-000-000-000-000-000-002\",\n data_not_collected: \"095-000-000-000-000-000-003\",\n current: \"095-001-000-000-000-000-000\",\n never: \"095-002-000-000-000-000-000\",\n previous: \"095-003-000-000-000-000-000\",\n} as const;\n\nexport type JuvenileJusticeInvolvementStatusKey = keyof typeof JuvenileJusticeInvolvementStatusKeys;\n\n/**\n * Key → positional code map for the `eye_color` CVC domain.\n *\n * Domain: `eye_color` · Version: 1.0.0 · Entries: 11\n */\nexport const EyeColorKeys = {\n missingness_root: \"150-000-000-000-000-000-000\",\n unknown: \"150-000-000-000-000-000-001\",\n anonymous: \"150-000-000-000-000-000-002\",\n data_not_collected: \"150-000-000-000-000-000-003\",\n black: \"150-001-000-000-000-000-000\",\n blue: \"150-002-000-000-000-000-000\",\n brown: \"150-003-000-000-000-000-000\",\n gray: \"150-004-000-000-000-000-000\",\n green: \"150-005-000-000-000-000-000\",\n hazel: \"150-006-000-000-000-000-000\",\n other: \"150-007-000-000-000-000-000\",\n} as const;\n\nexport type EyeColorKey = keyof typeof EyeColorKeys;\n\n/**\n * Key → positional code map for the `smt_type` CVC domain.\n *\n * Domain: `smt_type` · Version: 1.0.0 · Entries: 11\n */\nexport const SmtTypeKeys = {\n missingness_root: \"153-000-000-000-000-000-000\",\n unknown: \"153-000-000-000-000-000-001\",\n anonymous: \"153-000-000-000-000-000-002\",\n data_not_collected: \"153-000-000-000-000-000-003\",\n birthmark: \"153-001-000-000-000-000-000\",\n brand: \"153-002-000-000-000-000-000\",\n mark: \"153-003-000-000-000-000-000\",\n piercing: \"153-004-000-000-000-000-000\",\n scar: \"153-005-000-000-000-000-000\",\n tattoo: \"153-006-000-000-000-000-000\",\n other: \"153-007-000-000-000-000-000\",\n} as const;\n\nexport type SmtTypeKey = keyof typeof SmtTypeKeys;\n\n/**\n * Key → positional code map for the `offender_status` CVC domain.\n *\n * Domain: `offender_status` · Version: 1.0.0 · Entries: 9\n */\nexport const OffenderStatusKeys = {\n missingness_root: \"164-000-000-000-000-000-000\",\n unknown: \"164-000-000-000-000-000-001\",\n anonymous: \"164-000-000-000-000-000-002\",\n data_not_collected: \"164-000-000-000-000-000-003\",\n suspected_offender: \"164-001-000-000-000-000-000\",\n person_of_interest: \"164-002-000-000-000-000-000\",\n cleared_excluded: \"164-003-000-000-000-000-000\",\n charged: \"164-004-000-000-000-000-000\",\n convicted: \"164-005-000-000-000-000-000\",\n} as const;\n\nexport type OffenderStatusKey = keyof typeof OffenderStatusKeys;\n\n/**\n * Key → positional code map for the `offender_status_family` CVC domain.\n *\n * Domain: `offender_status_family` · Version: 1.0.0 · Entries: 8\n */\nexport const OffenderStatusFamilyKeys = {\n missingness_root: \"167-000-000-000-000-000-000\",\n unknown: \"167-000-000-000-000-000-001\",\n anonymous: \"167-000-000-000-000-000-002\",\n data_not_collected: \"167-000-000-000-000-000-003\",\n no_indication: \"167-001-000-000-000-000-000\",\n non_trafficking_exploitation_offender: \"167-002-000-000-000-000-000\",\n potential_trafficking_offender: \"167-003-000-000-000-000-000\",\n trafficking_offender: \"167-004-000-000-000-000-000\",\n} as const;\n\nexport type OffenderStatusFamilyKey = keyof typeof OffenderStatusFamilyKeys;\n\n/**\n * Key → positional code map for the `military_status` CVC domain.\n *\n * Domain: `military_status` · Version: 1.0.0 · Entries: 6\n */\nexport const MilitaryStatusKeys = {\n missingness_root: \"121-000-000-000-000-000-000\",\n unknown: \"121-000-000-000-000-000-001\",\n active_duty: \"121-001-000-000-000-000-000\",\n retired: \"121-002-000-000-000-000-000\",\n discharged: \"121-003-000-000-000-000-000\",\n reserve: \"121-004-000-000-000-000-000\",\n} as const;\n\nexport type MilitaryStatusKey = keyof typeof MilitaryStatusKeys;\n\n/**\n * Key → positional code map for the `military_branch` CVC domain.\n *\n * Domain: `military_branch` · Version: 1.0.0 · Entries: 8\n */\nexport const MilitaryBranchKeys = {\n missingness_root: \"120-000-000-000-000-000-000\",\n unknown: \"120-000-000-000-000-000-001\",\n army: \"120-001-000-000-000-000-000\",\n navy: \"120-002-000-000-000-000-000\",\n air_force: \"120-003-000-000-000-000-000\",\n marines: \"120-004-000-000-000-000-000\",\n coast_guard: \"120-005-000-000-000-000-000\",\n space_force: \"120-006-000-000-000-000-000\",\n} as const;\n\nexport type MilitaryBranchKey = keyof typeof MilitaryBranchKeys;\n\n/**\n * Key → positional code map for the `contact_info_types` CVC domain.\n *\n * Domain: `contact_info_types` · Version: 1.0.0 · Entries: 24\n */\nexport const ContactInfoTypeKeys = {\n missingness_root: \"149-000-000-000-000-000-000\",\n unknown: \"149-000-000-000-000-000-001\",\n anonymous: \"149-000-000-000-000-000-002\",\n data_not_collected: \"149-000-000-000-000-000-003\",\n phone: \"149-001-000-000-000-000-000\",\n email: \"149-002-000-000-000-000-000\",\n app: \"149-003-000-000-000-000-000\",\n app_whatsapp: \"149-003-001-000-000-000-000\",\n app_wechat: \"149-003-002-000-000-000-000\",\n app_kik: \"149-003-003-000-000-000-000\",\n app_paypal: \"149-003-004-000-000-000-000\",\n app_cash_app: \"149-003-005-000-000-000-000\",\n app_venmo: \"149-003-006-000-000-000-000\",\n app_other: \"149-003-007-000-000-000-000\",\n social_media: \"149-004-000-000-000-000-000\",\n social_media_facebook: \"149-004-001-000-000-000-000\",\n social_media_instagram: \"149-004-002-000-000-000-000\",\n social_media_x: \"149-004-003-000-000-000-000\",\n social_media_tiktok: \"149-004-004-000-000-000-000\",\n social_media_reddit: \"149-004-005-000-000-000-000\",\n social_media_youtube: \"149-004-006-000-000-000-000\",\n social_media_snapchat: \"149-004-007-000-000-000-000\",\n social_media_onlyfans: \"149-004-008-000-000-000-000\",\n social_media_other: \"149-004-009-000-000-000-000\",\n} as const;\n\nexport type ContactInfoTypeKey = keyof typeof ContactInfoTypeKeys;\n\n/**\n * Key → positional code map for the `contact_safety_status` CVC domain.\n *\n * Domain: `contact_safety_status` · Version: 1.0.0 · Entries: 6\n */\nexport const ContactSafetyStatusKeys = {\n missingness_root: \"155-000-000-000-000-000-000\",\n unknown: \"155-000-000-000-000-000-001\",\n anonymous: \"155-000-000-000-000-000-002\",\n data_not_collected: \"155-000-000-000-000-000-003\",\n safe: \"155-001-000-000-000-000-000\",\n not_safe: \"155-002-000-000-000-000-000\",\n} as const;\n\nexport type ContactSafetyStatusKey = keyof typeof ContactSafetyStatusKeys;\n\n/**\n * Key → positional code map for the `highest_education_level_completed` CVC domain.\n *\n * Domain: `highest_education_level_completed` · Version: 1.1.0 · Entries: 13\n */\nexport const HighestEducationLevelCompletedKeys = {\n missingness_root: \"180-000-000-000-000-000-000\",\n unknown: \"180-000-000-000-000-000-001\",\n anonymous: \"180-000-000-000-000-000-002\",\n data_not_collected: \"180-000-000-000-000-000-003\",\n prefer_not_to_answer: \"180-000-000-000-000-000-004\",\n less_than_high_school: \"180-001-000-000-000-000-000\",\n high_school_diploma: \"180-002-000-000-000-000-000\",\n ged: \"180-003-000-000-000-000-000\",\n some_college: \"180-004-000-000-000-000-000\",\n associates: \"180-005-000-000-000-000-000\",\n bachelors: \"180-006-000-000-000-000-000\",\n graduate_professional: \"180-007-000-000-000-000-000\",\n trade_vocational: \"180-008-000-000-000-000-000\",\n} as const;\n\nexport type HighestEducationLevelCompletedKey = keyof typeof HighestEducationLevelCompletedKeys;\n\n/**\n * Key → positional code map for the `preferred_contact_method` CVC domain.\n *\n * Domain: `preferred_contact_method` · Version: 1.0.0 · Entries: 4\n */\nexport const PreferredContactMethodKeys = {\n call: \"185-001-000-000-000-000-000\",\n text: \"185-002-000-000-000-000-000\",\n email: \"185-003-000-000-000-000-000\",\n messaging_app_dm: \"185-004-000-000-000-000-000\",\n} as const;\n\nexport type PreferredContactMethodKey = keyof typeof PreferredContactMethodKeys;\n\n/**\n * Key → positional code map for the `share_purpose` CVC domain.\n *\n * Domain: `share_purpose` · Version: 1.1.0 · Entries: 12\n */\nexport const SharePurposeKeys = {\n referral: \"084-001-000-000-000-000-000\",\n case_collaboration: \"084-002-000-000-000-000-000\",\n deconfliction: \"084-003-000-000-000-000-000\",\n mandatory_reporting: \"084-004-000-000-000-000-000\",\n authority_reporting: \"084-005-000-000-000-000-000\",\n automatic_account_share: \"084-006-000-000-000-000-000\",\n discretionary_share: \"084-007-000-000-000-000-000\",\n records_request: \"084-008-000-000-000-000-000\",\n investigation_support: \"084-009-000-000-000-000-000\",\n threat_prevention: \"084-010-000-000-000-000-000\",\n awareness_product: \"084-011-000-000-000-000-000\",\n prosecution_support: \"084-012-000-000-000-000-000\",\n} as const;\n\nexport type SharePurposeKey = keyof typeof SharePurposeKeys;\n\n/**\n * Key → positional code map for the `referral_origin` CVC domain.\n *\n * Domain: `referral_origin` · Version: 1.0.0 · Entries: 2\n */\nexport const ReferralOriginKeys = {\n internal: \"909-001-000-000-000-000-000\",\n external: \"909-002-000-000-000-000-000\",\n} as const;\n\nexport type ReferralOriginKey = keyof typeof ReferralOriginKeys;\n\n/**\n * Key → positional code map for the `case_share_state` CVC domain (canon CVC-304 `core-case_share_review_state`, re-mirrored from prototype origin/main canon by scripts/gen-case-share-state.py). The recipient-side review lifecycle of an inbound case share. `accepted_awaiting_review` = field-by-field review in flight (NOT a duplicate-person hold); it releases to `accepted` only when a case is linked and every blocking conflict is decided. Keys and 925-NNN codes are frozen since v1.0.0.\n *\n * Domain: `case_share_state` · Version: 1.2.0 · Entries: 6\n */\nexport const CaseShareStateKeys = {\n pending: \"925-001-000-000-000-000-000\",\n claimed: \"925-002-000-000-000-000-000\",\n accepted_awaiting_review: \"925-003-000-000-000-000-000\",\n accepted: \"925-004-000-000-000-000-000\",\n declined: \"925-005-000-000-000-000-000\",\n rejected: \"925-006-000-000-000-000-000\",\n} as const;\n\nexport type CaseShareStateKey = keyof typeof CaseShareStateKeys;\n\n/**\n * Key → positional code map for the `share_response_reason` CVC domain (CVC-306, canonical v1.1 `Active` after the 2026-09-14 SHARING-FAMILY-AUDIT; generated from prototype origin/main canon by scripts/gen-share-response-reason.py). The structured reasons a recipient gives when responding to an inbound case share. ONE codebook with per-CONTEXT selectability carried per entry as `contexts` (`field_review` · `decline_share` · `reject_share`) — build a context's picker by filtering on `contexts`, not on this key map. The single L0 sentinel (`unknown`, canonical UNK) is ingestion-only and never a picker chip; the codebook's archived DNC row is omitted.\n *\n * Domain: `share_response_reason` · Version: 1.0.0 · Entries: 12\n */\nexport const ShareResponseReasonKeys = {\n missingness_root: \"306-000-000-000-000-000-000\",\n unknown: \"306-000-000-000-000-000-001\",\n information_incorrect: \"306-001-000-000-000-000-000\",\n not_relevant_for_client: \"306-002-000-000-000-000-000\",\n duplicate_already_have: \"306-003-000-000-000-000-000\",\n client_declined_recording: \"306-004-000-000-000-000-000\",\n wrong_agency_service_area: \"306-005-000-000-000-000-000\",\n not_our_client: \"306-006-000-000-000-000-000\",\n sent_in_error: \"306-007-000-000-000-000-000\",\n no_capacity: \"306-008-000-000-000-000-000\",\n cannot_verify_conflicts: \"306-009-000-000-000-000-000\",\n wrong_person: \"306-010-000-000-000-000-000\",\n} as const;\n\nexport type ShareResponseReasonKey = keyof typeof ShareResponseReasonKeys;\n\n/**\n * Key → positional code map for the `record_removal_reason` CVC domain (CVC-282 `core-record_removal_reason`, ratified by Crysta 2026-07-04, Active / v1.1 after the 2026-09-28 CVC-BATCH-K audit; generated from prototype origin/main canon by scripts/gen-record-removal-reason.py). WHY a record was removed; each code routes to a ratified verb. Ordinals follow the mirror's ratified order and are frozen. The single L0 sentinel (`unknown`, canonical UNK) is ingestion-only and never a picker option; the codebook's retired ANON and archived DNC rows are omitted. @htilabs/platform-common-car maps each code to the CVC-337 correction reason a removed record's claims are retracted with.\n *\n * Domain: `record_removal_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const RecordRemovalReasonKeys = {\n missingness_root: \"282-000-000-000-000-000-000\",\n unknown: \"282-000-000-000-000-000-001\",\n created_in_error: \"282-001-000-000-000-000-000\",\n wrong_subject: \"282-002-000-000-000-000-000\",\n no_longer_relevant: \"282-003-000-000-000-000-000\",\n legal_mandate_expungement: \"282-004-000-000-000-000-000\",\n legal_mandate_confidentiality: \"282-005-000-000-000-000-000\",\n legal_mandate_court_order: \"282-006-000-000-000-000-000\",\n duplicate: \"282-007-000-000-000-000-000\",\n spam_bad_data: \"282-008-000-000-000-000-000\",\n} as const;\n\nexport type RecordRemovalReasonKey = keyof typeof RecordRemovalReasonKeys;\n\n/**\n * Key → positional code map for the `vehicle_color` CVC domain (CVC-257 `core-vehicle_color`, Active / v2 after the 2026-09-04 vehicle-family audit, Crysta rulings R1-R4; generated from prototype origin/main canon by scripts/gen-vehicle-vocabulary.py). One coded list for PAVE and LEADS (R1). Canon's three-letter code (BLK, SIL, … — R2, matching hair and eye colour) rides on each entry as `canonicalCode`; the key is the label slug. `other` (OTH) keeps the original wording in the companion field `color_other`. Values stored before 2026-09-04 resolve through the SOT's `legacyValueMap` on read. UNK is pickable; ANON comes only from the decline affordances; DNC is system-stamped only.\n *\n * Domain: `vehicle_color` · Version: 1.0.0 · Entries: 15\n */\nexport const VehicleColorKeys = {\n missingness_root: \"257-000-000-000-000-000-000\",\n unknown: \"257-000-000-000-000-000-001\",\n anonymous: \"257-000-000-000-000-000-002\",\n data_not_collected: \"257-000-000-000-000-000-003\",\n black: \"257-001-000-000-000-000-000\",\n white: \"257-002-000-000-000-000-000\",\n silver: \"257-003-000-000-000-000-000\",\n gray: \"257-004-000-000-000-000-000\",\n red: \"257-005-000-000-000-000-000\",\n blue: \"257-006-000-000-000-000-000\",\n green: \"257-007-000-000-000-000-000\",\n yellow: \"257-008-000-000-000-000-000\",\n brown: \"257-009-000-000-000-000-000\",\n tan: \"257-010-000-000-000-000-000\",\n other: \"257-011-000-000-000-000-000\",\n} as const;\n\nexport type VehicleColorKey = keyof typeof VehicleColorKeys;\n\n/**\n * Key → positional code map for the `vehicle_body_type` CVC domain (CVC-258 `core-vehicle_body_type`, Active / v2 after the 2026-09-04 vehicle-family audit; generated from prototype origin/main canon by scripts/gen-vehicle-vocabulary.py). Lowercase level-1 codes are the keys. Optional and never required: an absent value is the ordinary state, and a deliberate `unknown` (UNK) persists and reads differently from absent (R3). `glyph` is a rendering detail only. LEADS only — PAVE has no body-type field.\n *\n * Domain: `vehicle_body_type` · Version: 1.0.0 · Entries: 12\n */\nexport const VehicleBodyTypeKeys = {\n missingness_root: \"258-000-000-000-000-000-000\",\n unknown: \"258-000-000-000-000-000-001\",\n anonymous: \"258-000-000-000-000-000-002\",\n data_not_collected: \"258-000-000-000-000-000-003\",\n sedan: \"258-001-000-000-000-000-000\",\n suv: \"258-002-000-000-000-000-000\",\n pickup: \"258-003-000-000-000-000-000\",\n van: \"258-004-000-000-000-000-000\",\n coupe: \"258-005-000-000-000-000-000\",\n motorcycle: \"258-006-000-000-000-000-000\",\n commercial: \"258-007-000-000-000-000-000\",\n other: \"258-008-000-000-000-000-000\",\n} as const;\n\nexport type VehicleBodyTypeKey = keyof typeof VehicleBodyTypeKeys;\n\n/**\n * Key → positional code map for the `share_cadence` CVC domain (CVC-85 `core-share_cadence`, approved 2026-08-12, Active after the 2026-09-14 SHARING-FAMILY-AUDIT; generated from prototype canon by scripts/gen-share-cadence.py). The temporal shape of sharing: `point_in_time` (one-shot), `ongoing` (time-bounded channel), `automatic` (settings-determined). Cadence authorizes nothing. Configured on the partner relationship, DERIVED on the share record (never an end-user picker). No level-0 wing: an underivable cadence is absent, not a code.\n *\n * Domain: `share_cadence` · Version: 1.0.0 · Entries: 3\n */\nexport const ShareCadenceKeys = {\n point_in_time: \"085-001-000-000-000-000-000\",\n ongoing: \"085-002-000-000-000-000-000\",\n automatic: \"085-003-000-000-000-000-000\",\n} as const;\n\nexport type ShareCadenceKey = keyof typeof ShareCadenceKeys;\n\n/**\n * Key → positional code map for the `facilitator_entity_type` CVC domain.\n *\n * Domain: `facilitator_entity_type` · Version: 1.0.0 · Entries: 14\n */\nexport const FacilitatorEntityTypeKeys = {\n missingness_root: \"165-000-000-000-000-000-000\",\n unknown: \"165-000-000-000-000-000-001\",\n anonymous: \"165-000-000-000-000-000-002\",\n data_not_collected: \"165-000-000-000-000-000-003\",\n individual_person: \"165-001-000-000-000-000-000\",\n call_service: \"165-002-000-000-000-000-000\",\n escort_agency: \"165-003-000-000-000-000-000\",\n illicit_massage_business: \"165-004-000-000-000-000-000\",\n brothel_or_residence_operation: \"165-005-000-000-000-000-000\",\n strip_club_bar_casino_facilitator: \"165-006-000-000-000-000-000\",\n staffing_intermediary_or_labor_broker: \"165-007-000-000-000-000-000\",\n employer_or_worksite_operator: \"165-008-000-000-000-000-000\",\n multi_level_enterprise_or_organization: \"165-009-000-000-000-000-000\",\n other_business_or_establishment: \"165-010-000-000-000-000-000\",\n} as const;\n\nexport type FacilitatorEntityTypeKey = keyof typeof FacilitatorEntityTypeKeys;\n\n/**\n * Key → positional code map for the `facilitator_subrole` CVC domain.\n *\n * Domain: `facilitator_subrole` · Version: 1.0.0 · Entries: 37\n */\nexport const FacilitatorSubroleKeys = {\n missingness_root: \"162-000-000-000-000-000-000\",\n unknown: \"162-000-000-000-000-000-001\",\n anonymous: \"162-000-000-000-000-000-002\",\n data_not_collected: \"162-000-000-000-000-000-003\",\n recruiter: \"162-001-000-000-000-000-000\",\n operational_management: \"162-002-000-000-000-000-000\",\n mgr: \"162-002-001-000-000-000-000\",\n worksite_supervisor_foreman: \"162-002-002-000-000-000-000\",\n comms_advertising: \"162-003-000-000-000-000-000\",\n advertiser_webmaster: \"162-003-001-000-000-000-000\",\n content_creator: \"162-003-002-000-000-000-000\",\n comms_account_control: \"162-003-003-000-000-000-000\",\n dispatch_booking: \"162-004-000-000-000-000-000\",\n dispatcher_call_center: \"162-004-001-000-000-000-000\",\n enforcement_security: \"162-005-000-000-000-000-000\",\n enforcer_security: \"162-005-001-000-000-000-000\",\n lookout_spotter: \"162-005-002-000-000-000-000\",\n financial_control: \"162-006-000-000-000-000-000\",\n financial_facilitator: \"162-006-001-000-000-000-000\",\n debt_fee_collector: \"162-006-002-000-000-000-000\",\n money_launderer: \"162-006-003-000-000-000-000\",\n account_wallet_holder: \"162-006-004-000-000-000-000\",\n transportation_movement: \"162-007-000-000-000-000-000\",\n driver_transporter: \"162-007-001-000-000-000-000\",\n handling_supervision: \"162-008-000-000-000-000-000\",\n handler_minder: \"162-008-001-000-000-000-000\",\n document_identity_control: \"162-009-000-000-000-000-000\",\n document_identity_facilitator: \"162-009-001-000-000-000-000\",\n immigration_visa_controller: \"162-009-002-000-000-000-000\",\n labor_intermediation_worksite_control: \"162-010-000-000-000-000-000\",\n labor_broker_contractor: \"162-010-001-000-000-000-000\",\n housing_venue_harboring: \"162-011-000-000-000-000-000\",\n housing_room_provider: \"162-011-001-000-000-000-000\",\n ownership_enterprise: \"162-012-000-000-000-000-000\",\n owner_operator: \"162-012-001-000-000-000-000\",\n other: \"162-013-000-000-000-000-000\",\n other_unspec: \"162-013-001-000-000-000-000\",\n} as const;\n\nexport type FacilitatorSubroleKey = keyof typeof FacilitatorSubroleKeys;\n\n/**\n * Key → positional code map for the `marital_status_legal` CVC domain.\n *\n * Domain: `marital_status_legal` · Version: 1.0.0 · Entries: 9\n */\nexport const MaritalStatusLegalKeys = {\n missingness_root: \"156-000-000-000-000-000-000\",\n unknown: \"156-000-000-000-000-000-001\",\n anonymous: \"156-000-000-000-000-000-002\",\n data_not_collected: \"156-000-000-000-000-000-003\",\n married: \"156-001-000-000-000-000-000\",\n never_married: \"156-002-000-000-000-000-000\",\n divorced: \"156-003-000-000-000-000-000\",\n separated: \"156-004-000-000-000-000-000\",\n widowed: \"156-005-000-000-000-000-000\",\n} as const;\n\nexport type MaritalStatusLegalKey = keyof typeof MaritalStatusLegalKeys;\n\n/**\n * Key → positional code map for the `relationship_status_current` CVC domain.\n *\n * Domain: `relationship_status_current` · Version: 1.0.0 · Entries: 6\n */\nexport const RelationshipStatusCurrentKeys = {\n missingness_root: \"157-000-000-000-000-000-000\",\n unknown: \"157-000-000-000-000-000-001\",\n anonymous: \"157-000-000-000-000-000-002\",\n data_not_collected: \"157-000-000-000-000-000-003\",\n partnered: \"157-001-000-000-000-000-000\",\n not_partnered: \"157-002-000-000-000-000-000\",\n} as const;\n\nexport type RelationshipStatusCurrentKey = keyof typeof RelationshipStatusCurrentKeys;\n\n/**\n * Key → positional code map for the `has_tattoos` CVC domain.\n *\n * Domain: `has_tattoos` · Version: 1.0.0 · Entries: 6\n */\nexport const HasTattoosKeys = {\n missingness_root: \"152-000-000-000-000-000-000\",\n unknown: \"152-000-000-000-000-000-001\",\n anonymous: \"152-000-000-000-000-000-002\",\n data_not_collected: \"152-000-000-000-000-000-003\",\n yes: \"152-001-000-000-000-000-000\",\n no: \"152-002-000-000-000-000-000\",\n} as const;\n\nexport type HasTattoosKey = keyof typeof HasTattoosKeys;\n\n/**\n * Key → positional code map for the `facilitator_label_used_in_source` CVC domain.\n *\n * Domain: `facilitator_label_used_in_source` · Version: 1.0.0 · Entries: 16\n */\nexport const FacilitatorLabelUsedInSourceKeys = {\n missingness_root: \"166-000-000-000-000-000-000\",\n unknown: \"166-000-000-000-000-000-001\",\n anonymous: \"166-000-000-000-000-000-002\",\n data_not_collected: \"166-000-000-000-000-000-003\",\n boss: \"166-001-000-000-000-000-000\",\n bottom: \"166-002-000-000-000-000-000\",\n boyfriend_or_intimate_partner: \"166-003-000-000-000-000-000\",\n coyote: \"166-004-000-000-000-000-000\",\n fraudulent_job_recruiter: \"166-005-000-000-000-000-000\",\n madame: \"166-006-000-000-000-000-000\",\n neighbor: \"166-007-000-000-000-000-000\",\n parent_or_guardian: \"166-008-000-000-000-000-000\",\n peer_recruiter: \"166-009-000-000-000-000-000\",\n pimp: \"166-010-000-000-000-000-000\",\n romeo_recruiter: \"166-011-000-000-000-000-000\",\n other_source_term: \"166-012-000-000-000-000-000\",\n} as const;\n\nexport type FacilitatorLabelUsedInSourceKey = keyof typeof FacilitatorLabelUsedInSourceKeys;\n\n/**\n * Key → positional code map for the `homeless_status` CVC domain.\n *\n * Domain: `homeless_status` · Version: 1.0.0 · Entries: 9\n */\nexport const HomelessStatusKeys = {\n missingness_root: \"096-000-000-000-000-000-000\",\n unknown: \"096-000-000-000-000-000-001\",\n anonymous: \"096-000-000-000-000-000-002\",\n data_not_collected: \"096-000-000-000-000-000-003\",\n client_doesnt_know: \"096-000-000-000-000-000-004\",\n client_refused: \"096-000-000-000-000-000-005\",\n current: \"096-001-000-000-000-000-000\",\n former: \"096-002-000-000-000-000-000\",\n never: \"096-003-000-000-000-000-000\",\n} as const;\n\nexport type HomelessStatusKey = keyof typeof HomelessStatusKeys;\n\n/**\n * Key → positional code map for the `victim_status_family` CVC domain.\n *\n * Domain: `victim_status_family` · Version: 1.0.0 · Entries: 9\n */\nexport const VictimStatusFamilyKeys = {\n missingness_root: \"020-000-000-000-000-000-000\",\n unknown: \"020-000-000-000-000-000-001\",\n anonymous: \"020-000-000-000-000-000-002\",\n data_not_collected: \"020-000-000-000-000-000-003\",\n no_indication: \"020-001-000-000-000-000-000\",\n voluntary_industry_engagement: \"020-002-000-000-000-000-000\",\n non_trafficking_exploitation: \"020-003-000-000-000-000-000\",\n potential_trafficking_victim: \"020-004-000-000-000-000-000\",\n trafficking_victim: \"020-005-000-000-000-000-000\",\n} as const;\n\nexport type VictimStatusFamilyKey = keyof typeof VictimStatusFamilyKeys;\n\n/**\n * Key → positional code map for the `hair_color` CVC domain.\n *\n * Domain: `hair_color` · Version: 1.0.0 · Entries: 10\n */\nexport const HairColorKeys = {\n missingness_root: \"151-000-000-000-000-000-000\",\n unknown: \"151-000-000-000-000-000-001\",\n anonymous: \"151-000-000-000-000-000-002\",\n data_not_collected: \"151-000-000-000-000-000-003\",\n black: \"151-001-000-000-000-000-000\",\n blonde: \"151-002-000-000-000-000-000\",\n brown: \"151-003-000-000-000-000-000\",\n gray_white: \"151-004-000-000-000-000-000\",\n red: \"151-005-000-000-000-000-000\",\n other: \"151-006-000-000-000-000-000\",\n} as const;\n\nexport type HairColorKey = keyof typeof HairColorKeys;\n\n/**\n * Key → positional code map for the `sex_provider_subrole` CVC domain.\n *\n * Domain: `sex_provider_subrole` · Version: 1.0.0 · Entries: 7\n */\nexport const SexProviderSubroleKeys = {\n missingness_root: \"161-000-000-000-000-000-000\",\n unknown: \"161-000-000-000-000-000-001\",\n anonymous: \"161-000-000-000-000-000-002\",\n data_not_collected: \"161-000-000-000-000-000-003\",\n bottom: \"161-001-000-000-000-000-000\",\n escort: \"161-002-000-000-000-000-000\",\n stripper_exotic_dancer: \"161-003-000-000-000-000-000\",\n} as const;\n\nexport type SexProviderSubroleKey = keyof typeof SexProviderSubroleKeys;\n\n/**\n * Key → positional code map for the `relationship_ties` CVC domain.\n *\n * Domain: `relationship_ties` · Version: 1.0.0 · Entries: 28\n */\nexport const RelationshipTiesKeys = {\n missingness_root: \"158-000-000-000-000-000-000\",\n unknown: \"158-000-000-000-000-000-001\",\n anonymous: \"158-000-000-000-000-000-002\",\n data_not_collected: \"158-000-000-000-000-000-003\",\n household_living: \"158-001-000-000-000-000-000\",\n cohabitating: \"158-001-001-000-000-000-000\",\n shared_care_environment: \"158-001-002-000-000-000-000\",\n child_family: \"158-002-000-000-000-000-000\",\n has_children_together: \"158-002-001-000-000-000-000\",\n co_parenting: \"158-002-002-000-000-000-000\",\n family_care_obligation: \"158-002-003-000-000-000-000\",\n legal_formal: \"158-003-000-000-000-000-000\",\n legally_married: \"158-003-001-000-000-000-000\",\n legal_guardianship: \"158-003-002-000-000-000-000\",\n custody_or_visitation_link: \"158-003-003-000-000-000-000\",\n protective_order_link: \"158-003-004-000-000-000-000\",\n shared_legal_case_or_order: \"158-003-005-000-000-000-000\",\n financial_resource: \"158-004-000-000-000-000-000\",\n financial_dependence: \"158-004-001-000-000-000-000\",\n shared_finances: \"158-004-002-000-000-000-000\",\n shared_property_or_lease: \"158-004-003-000-000-000-000\",\n shared_employment_or_income_link: \"158-004-004-000-000-000-000\",\n access_logistics: \"158-005-000-000-000-000-000\",\n transportation_dependence: \"158-005-001-000-000-000-000\",\n communication_access_link: \"158-005-002-000-000-000-000\",\n document_or_id_link: \"158-005-003-000-000-000-000\",\n regular_unavoidable_contact: \"158-005-004-000-000-000-000\",\n other_fallback: \"158-006-000-000-000-000-000\",\n} as const;\n\nexport type RelationshipTiesKey = keyof typeof RelationshipTiesKeys;\n\n/**\n * Key → positional code map for the `person_relationships` CVC domain.\n *\n * Domain: `person_relationships` · Version: 1.0.0 · Entries: 94\n */\nexport const PersonRelationshipsKeys = {\n missingness_root: \"126-000-000-000-000-000-000\",\n anonymous: \"126-000-000-000-000-000-002\",\n data_not_collected: \"126-000-000-000-000-000-003\",\n familial: \"126-001-000-000-000-000-000\",\n grandparent_grandchild: \"126-001-001-000-000-000-000\",\n grandchild_of: \"126-001-001-001-000-000-000\",\n grandparent_of: \"126-001-001-002-000-000-000\",\n guardian_dependent: \"126-001-002-000-000-000-000\",\n dependent_of: \"126-001-002-001-000-000-000\",\n guardian_of: \"126-001-002-002-000-000-000\",\n in_law: \"126-001-003-000-000-000-000\",\n other_relative: \"126-001-004-000-000-000-000\",\n parent_child: \"126-001-005-000-000-000-000\",\n child_of: \"126-001-005-001-000-000-000\",\n parent_of: \"126-001-005-002-000-000-000\",\n sibling: \"126-001-006-000-000-000-000\",\n parental_figure_dependent: \"126-001-007-000-000-000-000\",\n dependent_of_parental_figure: \"126-001-007-001-000-000-000\",\n parental_figure_of: \"126-001-007-002-000-000-000\",\n romantic_partner: \"126-002-000-000-000-000-000\",\n dating_relationship: \"126-002-001-000-000-000-000\",\n spouse_partner: \"126-002-002-000-000-000-000\",\n intimate_romantic_partner: \"126-002-003-000-000-000-000\",\n intimate_partner_prior: \"126-002-004-000-000-000-000\",\n care_household: \"126-003-000-000-000-000-000\",\n caregiver_care_recipient: \"126-003-001-000-000-000-000\",\n care_recipient_of: \"126-003-001-001-000-000-000\",\n caregiver_of: \"126-003-001-002-000-000-000\",\n support_person: \"126-003-002-000-000-000-000\",\n support_person_of: \"126-003-002-001-000-000-000\",\n has_support_person: \"126-003-002-002-000-000-000\",\n household_member: \"126-003-003-000-000-000-000\",\n social: \"126-004-000-000-000-000-000\",\n acquaintance: \"126-004-001-000-000-000-000\",\n friend_peer: \"126-004-002-000-000-000-000\",\n known_associate: \"126-004-003-000-000-000-000\",\n social_media_connection: \"126-004-004-000-000-000-000\",\n work_economic: \"126-005-000-000-000-000-000\",\n coworker_colleague: \"126-005-001-000-000-000-000\",\n creditor_debtor: \"126-005-002-000-000-000-000\",\n creditor_of: \"126-005-002-001-000-000-000\",\n debtor_of: \"126-005-002-002-000-000-000\",\n employer_employee: \"126-005-003-000-000-000-000\",\n employee_of: \"126-005-003-001-000-000-000\",\n employer_of: \"126-005-003-002-000-000-000\",\n landlord_tenant: \"126-005-004-000-000-000-000\",\n landlord_of: \"126-005-004-001-000-000-000\",\n tenant_of: \"126-005-004-002-000-000-000\",\n supervisor_subordinate: \"126-005-005-000-000-000-000\",\n subordinate_of: \"126-005-005-001-000-000-000\",\n supervisor_of: \"126-005-005-002-000-000-000\",\n service_system: \"126-006-000-000-000-000-000\",\n advocate_client: \"126-006-001-000-000-000-000\",\n advocate_of: \"126-006-001-001-000-000-000\",\n client_of_advocate: \"126-006-001-002-000-000-000\",\n attorney_client: \"126-006-002-000-000-000-000\",\n attorney_of: \"126-006-002-001-000-000-000\",\n client_of_attorney: \"126-006-002-002-000-000-000\",\n caseworker_client: \"126-006-003-000-000-000-000\",\n caseworker_of: \"126-006-003-001-000-000-000\",\n client_of_caseworker: \"126-006-003-002-000-000-000\",\n officer_subject: \"126-006-004-000-000-000-000\",\n officer_of: \"126-006-004-001-000-000-000\",\n subject_of_officer: \"126-006-004-002-000-000-000\",\n provider_client: \"126-006-005-000-000-000-000\",\n client_of_provider: \"126-006-005-001-000-000-000\",\n provider_of: \"126-006-005-002-000-000-000\",\n teacher_student: \"126-006-006-000-000-000-000\",\n student_of: \"126-006-006-001-000-000-000\",\n teacher_of: \"126-006-006-002-000-000-000\",\n exploitation_trafficking: \"126-007-000-000-000-000-000\",\n buyer_target_person: \"126-007-001-000-000-000-000\",\n buyer_of: \"126-007-001-001-000-000-000\",\n target_of_buyer: \"126-007-001-002-000-000-000\",\n controller_target_person: \"126-007-002-000-000-000-000\",\n controller_of: \"126-007-002-001-000-000-000\",\n target_of_controller: \"126-007-002-002-000-000-000\",\n facilitator_target_person: \"126-007-003-000-000-000-000\",\n facilitator_of: \"126-007-003-001-000-000-000\",\n target_of_facilitator: \"126-007-003-002-000-000-000\",\n recruiter_recruited_person: \"126-007-004-000-000-000-000\",\n recruited_by: \"126-007-004-001-000-000-000\",\n recruiter_of: \"126-007-004-002-000-000-000\",\n trafficker_victim: \"126-007-005-000-000-000-000\",\n trafficker_of: \"126-007-005-001-000-000-000\",\n victim_of_trafficker: \"126-007-005-002-000-000-000\",\n other_unspecified: \"126-008-000-000-000-000-000\",\n other_person_relationship: \"126-008-001-000-000-000-000\",\n person_pet: \"126-008-002-000-000-000-000\",\n pet_caregiver_of: \"126-008-002-001-000-000-000\",\n pet_of: \"126-008-002-002-000-000-000\",\n pet_owner_of: \"126-008-002-003-000-000-000\",\n relationship_unknown: \"126-008-003-000-000-000-000\",\n stranger: \"126-008-004-000-000-000-000\",\n} as const;\n\nexport type PersonRelationshipsKey = keyof typeof PersonRelationshipsKeys;\n\n/**\n * Key → positional code map for the `employment_status` CVC domain.\n *\n * Domain: `employment_status` · Version: 1.0.0 · Entries: 29\n */\nexport const EmploymentStatusKeys = {\n missingness_root: \"179-000-000-000-000-000-000\",\n unknown: \"179-000-000-000-000-000-001\",\n anonymous: \"179-000-000-000-000-000-002\",\n data_not_collected: \"179-000-000-000-000-000-003\",\n client_doesnt_know: \"179-000-000-000-000-000-004\",\n client_refused: \"179-000-000-000-000-000-005\",\n employed: \"179-001-000-000-000-000-000\",\n full_time: \"179-001-001-000-000-000-000\",\n part_time: \"179-001-002-000-000-000-000\",\n seasonal_sporadic: \"179-001-003-000-000-000-000\",\n self_employed: \"179-001-004-000-000-000-000\",\n informal_cash_gig: \"179-001-005-000-000-000-000\",\n multiple_jobs: \"179-001-006-000-000-000-000\",\n unpaid_family_worker: \"179-001-007-000-000-000-000\",\n unemployed: \"179-002-000-000-000-000-000\",\n looking_for_work: \"179-002-001-000-000-000-000\",\n actively_seeking: \"179-002-002-000-000-000-000\",\n first_time_job_seeker: \"179-002-003-000-000-000-000\",\n recently_laid_off: \"179-002-004-000-000-000-000\",\n long_term_unemployed: \"179-002-005-000-000-000-000\",\n not_in_labor_force: \"179-003-000-000-000-000-000\",\n not_looking_for_work: \"179-003-001-000-000-000-000\",\n unable_to_work: \"179-003-002-000-000-000-000\",\n student: \"179-003-003-000-000-000-000\",\n caregiver: \"179-003-004-000-000-000-000\",\n disabled: \"179-003-005-000-000-000-000\",\n retired: \"179-003-006-000-000-000-000\",\n discouraged_worker: \"179-003-007-000-000-000-000\",\n other_reason: \"179-003-008-000-000-000-000\",\n} as const;\n\nexport type EmploymentStatusKey = keyof typeof EmploymentStatusKeys;\n\n/**\n * Key → positional code map for the `location_type` CVC domain (CVC-191). Each entry also carries canon's 2026-10-01 share-routing columns (`tier` · `anchors` · `anchorDefault` · `shareUnit` · `safetyDefault`, overlaid by scripts/gen-location-type.py): route a stored location by its reason's `shareUnit` (a `core_information_scope` key; null = never delivered), not by a hand-kept map.\n *\n * Domain: `location_type` · Version: 1.0.0 · Entries: 17\n */\nexport const LocationTypeKeys = {\n missingness_root: \"191-000-000-000-000-000-000\",\n unknown: \"191-000-000-000-000-000-001\",\n anonymous: \"191-000-000-000-000-000-002\",\n data_not_collected: \"191-000-000-000-000-000-003\",\n current_residence: \"191-001-000-000-000-000-000\",\n service_delivery_location: \"191-002-000-000-000-000-000\",\n current_client_location: \"191-003-000-000-000-000-000\",\n meet_contact_location: \"191-004-000-000-000-000-000\",\n prior_residence: \"191-005-000-000-000-000-000\",\n jurisdiction_routing_location: \"191-006-000-000-000-000-000\",\n ad_location_derived: \"191-007-000-000-000-000-000\",\n travel_stop_visit: \"191-008-000-000-000-000-000\",\n work_school_business: \"191-009-000-000-000-000-000\",\n ip_derived_location: \"191-010-000-000-000-000-000\",\n program_project_location: \"191-011-000-000-000-000-000\",\n other: \"191-012-000-000-000-000-000\",\n incident: \"191-013-000-000-000-000-000\",\n} as const;\n\nexport type LocationTypeKey = keyof typeof LocationTypeKeys;\n\n/**\n * Key → positional code map for the `referral_entity_category` CVC domain.\n *\n * Domain: `referral_entity_category` · Version: 1.2.0 · Entries: 47\n */\nexport const ReferralEntityCategoryKeys = {\n missingness_root: \"048-000-000-000-000-000-000\",\n unknown: \"048-000-000-000-000-000-001\",\n anonymous: \"048-000-000-000-000-000-002\",\n data_not_collected: \"048-000-000-000-000-000-003\",\n self_referred: \"048-001-000-000-000-000-000\",\n family_guardian_friend: \"048-002-000-000-000-000-000\",\n peer: \"048-003-000-000-000-000-000\",\n other_individual: \"048-004-000-000-000-000-000\",\n housing_shelter_continuum: \"048-005-000-000-000-000-000\",\n outreach_project: \"048-005-001-000-000-000-000\",\n temporary_shelter: \"048-005-002-000-000-000-000\",\n residential_project: \"048-005-003-000-000-000-000\",\n hotlines: \"048-006-000-000-000-000-000\",\n national_hotline: \"048-006-001-000-000-000-000\",\n local_other_hotline: \"048-006-002-000-000-000-000\",\n hotline: \"048-006-003-000-000-000-000\",\n justice_protective_systems: \"048-007-000-000-000-000-000\",\n child_welfare_cps: \"048-007-001-000-000-000-000\",\n juvenile_justice: \"048-007-002-000-000-000-000\",\n law_enforcement: \"048-007-003-000-000-000-000\",\n local_law_enforcement: \"048-007-003-001-000-000-000\",\n state_law_enforcement: \"048-007-003-002-000-000-000\",\n federal_law_enforcement: \"048-007-003-003-000-000-000\",\n tribal_law_enforcement: \"048-007-003-004-000-000-000\",\n other_law_enforcement: \"048-007-003-005-000-000-000\",\n courts_prosecution: \"048-007-004-000-000-000-000\",\n correction_probation: \"048-007-005-000-000-000-000\",\n adult_protective_services: \"048-007-006-000-000-000-000\",\n health_behavioral_health: \"048-008-000-000-000-000-000\",\n inpatient_psychiatric_facility: \"048-008-001-000-000-000-000\",\n healthcare_provider: \"048-008-002-000-000-000-000\",\n education: \"048-009-000-000-000-000-000\",\n school_academic_institution: \"048-009-001-000-000-000-000\",\n victim_community_service_providers: \"048-010-000-000-000-000-000\",\n child_advocacy_center: \"048-010-001-000-000-000-000\",\n victim_service_provider: \"048-010-002-000-000-000-000\",\n community_based_service_provider: \"048-010-003-000-000-000-000\",\n legal_services_provider: \"048-010-004-000-000-000-000\",\n coordination_governance: \"048-011-000-000-000-000-000\",\n mdt: \"048-011-001-000-000-000-000\",\n coalition: \"048-011-002-000-000-000-000\",\n internal: \"048-012-000-000-000-000-000\",\n own_agency_internal: \"048-012-001-000-000-000-000\",\n other_entity: \"048-013-000-000-000-000-000\",\n employer: \"048-013-001-000-000-000-000\",\n benefits_public_assistance_office: \"048-013-002-000-000-000-000\",\n other_organization: \"048-013-003-000-000-000-000\",\n} as const;\n\nexport type ReferralEntityCategoryKey = keyof typeof ReferralEntityCategoryKeys;\n\n/**\n * Key → positional code map for the `income_benefits_sources` CVC domain.\n *\n * Domain: `income_benefits_sources` · Version: 1.1.0 · Entries: 41\n */\nexport const IncomeBenefitsSourcesKeys = {\n missingness_root: \"171-000-000-000-000-000-000\",\n unknown: \"171-000-000-000-000-000-001\",\n anonymous: \"171-000-000-000-000-000-002\",\n data_not_collected: \"171-000-000-000-000-000-003\",\n prefer_not_to_answer: \"171-000-000-000-000-000-004\",\n earned_income: \"171-001-000-000-000-000-000\",\n employment: \"171-001-001-000-000-000-000\",\n informal_income: \"171-001-002-000-000-000-000\",\n cash_benefit: \"171-002-000-000-000-000-000\",\n unemployment_insurance: \"171-002-001-000-000-000-000\",\n supplemental_security_income: \"171-002-002-000-000-000-000\",\n social_security_disability_insurance: \"171-002-003-000-000-000-000\",\n va_service_connected_disability: \"171-002-004-000-000-000-000\",\n va_non_service_connected_pension: \"171-002-005-000-000-000-000\",\n private_disability_insurance: \"171-002-006-000-000-000-000\",\n workers_compensation: \"171-002-007-000-000-000-000\",\n tanf: \"171-002-008-000-000-000-000\",\n general_assistance: \"171-002-009-000-000-000-000\",\n social_security_retirement: \"171-002-010-000-000-000-000\",\n pension_or_retirement_from_former_job: \"171-002-011-000-000-000-000\",\n social_security_generic: \"171-002-012-000-000-000-000\",\n va_benefits_generic: \"171-002-013-000-000-000-000\",\n in_kind_benefit: \"171-003-000-000-000-000-000\",\n snap: \"171-003-001-000-000-000-000\",\n wic: \"171-003-002-000-000-000-000\",\n tanf_child_care: \"171-003-003-000-000-000-000\",\n tanf_transportation: \"171-003-004-000-000-000-000\",\n tanf_other_funded_services: \"171-003-005-000-000-000-000\",\n medicaid: \"171-003-006-000-000-000-000\",\n medicare: \"171-003-007-000-000-000-000\",\n housing_assistance: \"171-003-008-000-000-000-000\",\n childcare_subsidy: \"171-003-009-000-000-000-000\",\n transfer_support: \"171-004-000-000-000-000-000\",\n child_support: \"171-004-001-000-000-000-000\",\n alimony_spousal_support: \"171-004-002-000-000-000-000\",\n family_friend_support: \"171-004-003-000-000-000-000\",\n other_unspecified: \"171-005-000-000-000-000-000\",\n other_income: \"171-005-001-000-000-000-000\",\n other_benefit: \"171-005-002-000-000-000-000\",\n education_stipend: \"171-005-003-000-000-000-000\",\n victim_compensation: \"171-006-000-000-000-000-000\",\n} as const;\n\nexport type IncomeBenefitsSourcesKey = keyof typeof IncomeBenefitsSourcesKeys;\n\n/**\n * Key → positional code map for the `enrollment_application_status` CVC domain.\n *\n * Domain: `enrollment_application_status` · Version: 1.0.0 · Entries: 12\n */\nexport const EnrollmentApplicationStatusKeys = {\n missingness_root: \"175-000-000-000-000-000-000\",\n unknown: \"175-000-000-000-000-000-001\",\n anonymous: \"175-000-000-000-000-000-002\",\n data_not_collected: \"175-000-000-000-000-000-003\",\n approved: \"175-001-000-000-000-000-000\",\n applied: \"175-002-000-000-000-000-000\",\n not_applied: \"175-003-000-000-000-000-000\",\n pending: \"175-004-000-000-000-000-000\",\n active: \"175-005-000-000-000-000-000\",\n denied: \"175-006-000-000-000-000-000\",\n closed: \"175-007-000-000-000-000-000\",\n expired: \"175-008-000-000-000-000-000\",\n} as const;\n\nexport type EnrollmentApplicationStatusKey = keyof typeof EnrollmentApplicationStatusKeys;\n\n/**\n * Key → positional code map for the `administering_jurisdiction` CVC domain.\n *\n * Domain: `administering_jurisdiction` · Version: 1.0.0 · Entries: 10\n */\nexport const AdministeringJurisdictionKeys = {\n missingness_root: \"177-000-000-000-000-000-000\",\n unknown: \"177-000-000-000-000-000-001\",\n anonymous: \"177-000-000-000-000-000-002\",\n data_not_collected: \"177-000-000-000-000-000-003\",\n federal: \"177-001-000-000-000-000-000\",\n state: \"177-002-000-000-000-000-000\",\n county: \"177-003-000-000-000-000-000\",\n city: \"177-004-000-000-000-000-000\",\n tribal: \"177-005-000-000-000-000-000\",\n territory: \"177-006-000-000-000-000-000\",\n} as const;\n\nexport type AdministeringJurisdictionKey = keyof typeof AdministeringJurisdictionKeys;\n\n/**\n * Key → positional code map for the `frequency_cadence` CVC domain.\n *\n * Domain: `frequency_cadence` · Version: 1.0.0 · Entries: 11\n */\nexport const FrequencyCadenceKeys = {\n missingness_root: \"176-000-000-000-000-000-000\",\n unknown: \"176-000-000-000-000-000-001\",\n anonymous: \"176-000-000-000-000-000-002\",\n data_not_collected: \"176-000-000-000-000-000-003\",\n daily: \"176-001-000-000-000-000-000\",\n weekly: \"176-002-000-000-000-000-000\",\n biweekly: \"176-003-000-000-000-000-000\",\n monthly: \"176-004-000-000-000-000-000\",\n quarterly: \"176-005-000-000-000-000-000\",\n annual: \"176-006-000-000-000-000-000\",\n one_time: \"176-007-000-000-000-000-000\",\n} as const;\n\nexport type FrequencyCadenceKey = keyof typeof FrequencyCadenceKeys;\n\n/**\n * Key → positional code map for the `inference_type` CVC domain.\n *\n * Domain: `inference_type` · Version: 1.0.0 · Entries: 7\n */\nexport const InferenceTypeKeys = {\n missingness_root: \"142-000-000-000-000-000-000\",\n unknown: \"142-000-000-000-000-000-001\",\n anonymous: \"142-000-000-000-000-000-002\",\n data_not_collected: \"142-000-000-000-000-000-003\",\n manual: \"142-001-000-000-000-000-000\",\n rules: \"142-002-000-000-000-000-000\",\n model: \"142-003-000-000-000-000-000\",\n} as const;\n\nexport type InferenceTypeKey = keyof typeof InferenceTypeKeys;\n\n/**\n * Key → positional code map for the `source_category` CVC domain.\n *\n * Domain: `source_category` · Version: 1.1.0 · Entries: 9\n */\nexport const SourceCategoryKeys = {\n missingness_root: \"140-000-000-000-000-000-000\",\n unknown: \"140-000-000-000-000-000-001\",\n anonymous: \"140-000-000-000-000-000-002\",\n data_not_collected: \"140-000-000-000-000-000-003\",\n human: \"140-001-000-000-000-000-000\",\n institutional_record: \"140-002-000-000-000-000-000\",\n legal_evidentiary: \"140-003-000-000-000-000-000\",\n machine: \"140-004-000-000-000-000-000\",\n open_source: \"140-005-000-000-000-000-000\",\n} as const;\n\nexport type SourceCategoryKey = keyof typeof SourceCategoryKeys;\n\n/**\n * Key → positional code map for the `source_subtype` CVC domain.\n *\n * Domain: `source_subtype` · Version: 1.2.0 · Entries: 39\n */\nexport const SourceSubtypeKeys = {\n missingness_root: \"141-000-000-000-000-000-000\",\n unknown: \"141-000-000-000-000-000-001\",\n anonymous: \"141-000-000-000-000-000-002\",\n data_not_collected: \"141-000-000-000-000-000-003\",\n ads_profile_website: \"141-001-000-000-000-000-000\",\n aggregation_output: \"141-002-000-000-000-000-000\",\n benefits_record: \"141-003-000-000-000-000-000\",\n charge_document: \"141-004-000-000-000-000-000\",\n child_welfare_record: \"141-005-000-000-000-000-000\",\n conviction_record: \"141-006-000-000-000-000-000\",\n corrections_record: \"141-007-000-000-000-000-000\",\n court_record: \"141-008-000-000-000-000-000\",\n employment_hr_record: \"141-009-000-000-000-000-000\",\n forensic_medical_exam: \"141-010-000-000-000-000-000\",\n immigration_record: \"141-011-000-000-000-000-000\",\n law_enforcement_assessment: \"141-012-000-000-000-000-000\",\n medical_record: \"141-013-000-000-000-000-000\",\n model_output: \"141-014-000-000-000-000-000\",\n news_media: \"141-015-000-000-000-000-000\",\n official_id_document: \"141-016-000-000-000-000-000\",\n parser_extraction: \"141-017-000-000-000-000-000\",\n partner_agency_case_note: \"141-018-000-000-000-000-000\",\n public_registry: \"141-019-000-000-000-000-000\",\n reviews_forums_comments: \"141-020-000-000-000-000-000\",\n rules_engine: \"141-021-000-000-000-000-000\",\n school_record: \"141-022-000-000-000-000-000\",\n search_warrant_return: \"141-023-000-000-000-000-000\",\n service_provider_assessment: \"141-024-000-000-000-000-000\",\n service_provider_case_note: \"141-025-000-000-000-000-000\",\n shelter_program_record: \"141-026-000-000-000-000-000\",\n social_media: \"141-027-000-000-000-000-000\",\n staff_observation: \"141-028-000-000-000-000-000\",\n system_import: \"141-029-000-000-000-000-000\",\n third_party_report: \"141-030-000-000-000-000-000\",\n victim_disclosure: \"141-031-000-000-000-000-000\",\n advocate_capture: \"141-032-000-000-000-000-000\",\n advocate_assessment: \"141-033-000-000-000-000-000\",\n child_welfare_episode_edit: \"141-034-000-000-000-000-000\",\n juvenile_justice_episode_edit: \"141-035-000-000-000-000-000\",\n} as const;\n\nexport type SourceSubtypeKey = keyof typeof SourceSubtypeKeys;\n\n/**\n * Key → positional code map for the `support_strength` CVC domain.\n *\n * Domain: `support_strength` · Version: 1.0.0 · Entries: 11\n */\nexport const SupportStrengthKeys = {\n missingness_root: \"139-000-000-000-000-000-000\",\n unknown: \"139-000-000-000-000-000-001\",\n anonymous: \"139-000-000-000-000-000-002\",\n data_not_collected: \"139-000-000-000-000-000-003\",\n adjudicated: \"139-001-000-000-000-000-000\",\n allegation: \"139-002-000-000-000-000-000\",\n corroborated: \"139-003-000-000-000-000-000\",\n minimally_supported: \"139-004-000-000-000-000-000\",\n multi_source_corroborated: \"139-005-000-000-000-000-000\",\n official_record_supported: \"139-006-000-000-000-000-000\",\n strongly_supported: \"139-007-000-000-000-000-000\",\n} as const;\n\nexport type SupportStrengthKey = keyof typeof SupportStrengthKeys;\n\n/**\n * Key → positional code map for the `determination_level` CVC domain.\n *\n * Domain: `determination_level` · Version: 1.0.0 · Entries: 9\n */\nexport const DeterminationLevelKeys = {\n missingness_root: \"138-000-000-000-000-000-000\",\n unknown: \"138-000-000-000-000-000-001\",\n anonymous: \"138-000-000-000-000-000-002\",\n data_not_collected: \"138-000-000-000-000-000-003\",\n disclosed: \"138-001-000-000-000-000-000\",\n estimated: \"138-002-000-000-000-000-000\",\n reported: \"138-003-000-000-000-000-000\",\n suspected: \"138-004-000-000-000-000-000\",\n verified: \"138-005-000-000-000-000-000\",\n} as const;\n\nexport type DeterminationLevelKey = keyof typeof DeterminationLevelKeys;\n\n/**\n * Key → positional code map for the `role_context` CVC domain.\n *\n * Domain: `role_context` · Version: 1.0.0 · Entries: 7\n */\nexport const RoleContextKeys = {\n missingness_root: \"160-000-000-000-000-000-000\",\n unknown: \"160-000-000-000-000-000-001\",\n anonymous: \"160-000-000-000-000-000-002\",\n data_not_collected: \"160-000-000-000-000-000-003\",\n both: \"160-001-000-000-000-000-000\",\n offender: \"160-002-000-000-000-000-000\",\n victim: \"160-003-000-000-000-000-000\",\n} as const;\n\nexport type RoleContextKey = keyof typeof RoleContextKeys;\n\n/**\n * Key → positional code map for the `time_scope` CVC domain.\n *\n * Domain: `time_scope` · Version: 1.0.0 · Entries: 6\n */\nexport const TimeScopeKeys = {\n missingness_root: \"174-000-000-000-000-000-000\",\n unknown: \"174-000-000-000-000-000-001\",\n anonymous: \"174-000-000-000-000-000-002\",\n data_not_collected: \"174-000-000-000-000-000-003\",\n current: \"174-001-000-000-000-000-000\",\n prior: \"174-002-000-000-000-000-000\",\n} as const;\n\nexport type TimeScopeKey = keyof typeof TimeScopeKeys;\n\n/**\n * Key → positional code map for the `verification_method` CVC domain.\n *\n * Domain: `verification_method` · Version: 1.2.0 · Entries: 13\n */\nexport const VerificationMethodKeys = {\n missingness_root: \"143-000-000-000-000-000-000\",\n unknown: \"143-000-000-000-000-000-001\",\n anonymous: \"143-000-000-000-000-000-002\",\n data_not_collected: \"143-000-000-000-000-000-003\",\n court_record_confirmed: \"143-001-000-000-000-000-000\",\n evidence_threshold_met: \"143-002-000-000-000-000-000\",\n multi_source_corroboration: \"143-003-000-000-000-000-000\",\n qa_audit_passed: \"143-004-000-000-000-000-000\",\n supervisor_review: \"143-005-000-000-000-000-000\",\n rules: \"143-006-000-000-000-000-000\",\n still_reaches: \"143-007-000-000-000-000-000\",\n doc_signed: \"143-008-000-000-000-000-000\",\n findings_seal: \"143-009-000-000-000-000-000\",\n} as const;\n\nexport type VerificationMethodKey = keyof typeof VerificationMethodKeys;\n\n/**\n * Key → positional code map for the `verification_status` CVC domain.\n *\n * Domain: `verification_status` · Version: 1.0.0 · Entries: 7\n */\nexport const VerificationStatusKeys = {\n missingness_root: \"962-000-000-000-000-000-000\",\n unknown: \"962-000-000-000-000-000-001\",\n anonymous: \"962-000-000-000-000-000-002\",\n data_not_collected: \"962-000-000-000-000-000-003\",\n yes: \"962-001-000-000-000-000-000\",\n no: \"962-002-000-000-000-000-000\",\n i_can_get_it: \"962-003-000-000-000-000-000\",\n} as const;\n\nexport type VerificationStatusKey = keyof typeof VerificationStatusKeys;\n\n/**\n * Key → positional code map for the `visa_type` CVC domain.\n *\n * Domain: `visa_type` · Version: 1.0.0 · Entries: 40\n */\nexport const VisaTypeKeys = {\n missingness_root: \"963-000-000-000-000-000-000\",\n unknown: \"963-000-000-000-000-000-001\",\n anonymous: \"963-000-000-000-000-000-002\",\n data_not_collected: \"963-000-000-000-000-000-003\",\n us_citizen: \"963-001-000-000-000-000-000\",\n none_undocumented: \"963-002-000-000-000-000-000\",\n lpr: \"963-003-000-000-000-000-000\",\n b_1: \"963-004-000-000-000-000-000\",\n b_2: \"963-005-000-000-000-000-000\",\n f_1: \"963-006-000-000-000-000-000\",\n m_1: \"963-007-000-000-000-000-000\",\n j_1: \"963-008-000-000-000-000-000\",\n h_1b: \"963-009-000-000-000-000-000\",\n h_2a: \"963-010-000-000-000-000-000\",\n h_2b: \"963-011-000-000-000-000-000\",\n l_1: \"963-012-000-000-000-000-000\",\n o_1: \"963-013-000-000-000-000-000\",\n tn: \"963-014-000-000-000-000-000\",\n k_1: \"963-015-000-000-000-000-000\",\n k_3: \"963-016-000-000-000-000-000\",\n t_1: \"963-017-000-000-000-000-000\",\n t_2: \"963-018-000-000-000-000-000\",\n t_3: \"963-019-000-000-000-000-000\",\n t_4: \"963-020-000-000-000-000-000\",\n t_5: \"963-021-000-000-000-000-000\",\n t_6: \"963-022-000-000-000-000-000\",\n u_1: \"963-023-000-000-000-000-000\",\n u_2: \"963-024-000-000-000-000-000\",\n u_3: \"963-025-000-000-000-000-000\",\n u_4: \"963-026-000-000-000-000-000\",\n u_5: \"963-027-000-000-000-000-000\",\n vawa_self_petitioner: \"963-028-000-000-000-000-000\",\n asylum_pending: \"963-029-000-000-000-000-000\",\n asylum_granted: \"963-030-000-000-000-000-000\",\n refugee: \"963-031-000-000-000-000-000\",\n sij: \"963-032-000-000-000-000-000\",\n parole_humanitarian: \"963-033-000-000-000-000-000\",\n esta: \"963-034-000-000-000-000-000\",\n diplomatic: \"963-035-000-000-000-000-000\",\n other: \"963-036-000-000-000-000-000\",\n} as const;\n\nexport type VisaTypeKey = keyof typeof VisaTypeKeys;\n\n/**\n * Key → positional code map for the `quality_flags` CVC domain.\n *\n * Domain: `quality_flags` · Version: 1.0.0 · Entries: 9\n */\nexport const QualityFlagsKeys = {\n missingness_root: \"144-000-000-000-000-000-000\",\n unknown: \"144-000-000-000-000-000-001\",\n anonymous: \"144-000-000-000-000-000-002\",\n data_not_collected: \"144-000-000-000-000-000-003\",\n circular_model_label_risk: \"144-001-000-000-000-000-000\",\n data_redacted: \"144-002-000-000-000-000-000\",\n inconsistent: \"144-003-000-000-000-000-000\",\n self_report_only: \"144-004-000-000-000-000-000\",\n single_source: \"144-005-000-000-000-000-000\",\n} as const;\n\nexport type QualityFlagsKey = keyof typeof QualityFlagsKeys;\n\n/**\n * Key → positional code map for the `contact_info_use_type` CVC domain.\n *\n * Domain: `contact_info_use_type` · Version: 1.0.0 · Entries: 8\n */\nexport const ContactInfoUseTypeKeys = {\n missingness_root: \"154-000-000-000-000-000-000\",\n unknown: \"154-000-000-000-000-000-001\",\n anonymous: \"154-000-000-000-000-000-002\",\n data_not_collected: \"154-000-000-000-000-000-003\",\n business_commercial_sex: \"154-001-000-000-000-000-000\",\n business_non_cs: \"154-002-000-000-000-000-000\",\n mixed_use: \"154-003-000-000-000-000-000\",\n personal: \"154-004-000-000-000-000-000\",\n} as const;\n\nexport type ContactInfoUseTypeKey = keyof typeof ContactInfoUseTypeKeys;\n\n/**\n * Key → positional code map for the `session_state` CVC domain.\n *\n * Domain: `session_state` · Version: 1.0.0 · Entries: 9\n */\nexport const SessionStateKeys = {\n missingness_root: \"216-000-000-000-000-000-000\",\n unknown: \"216-000-000-000-000-000-001\",\n anonymous: \"216-000-000-000-000-000-002\",\n data_not_collected: \"216-000-000-000-000-000-003\",\n session_action_needed: \"216-001-000-000-000-000-000\",\n session_closed: \"216-002-000-000-000-000-000\",\n session_discarded: \"216-003-000-000-000-000-000\",\n session_in_progress: \"216-004-000-000-000-000-000\",\n session_initialized: \"216-005-000-000-000-000-000\",\n} as const;\n\nexport type SessionStateKey = keyof typeof SessionStateKeys;\n\n/**\n * Key → positional code map for the `relationship_dynamics` CVC domain.\n *\n * Domain: `relationship_dynamics` · Version: 1.0.0 · Entries: 42\n */\nexport const RelationshipDynamicsKeys = {\n missingness_root: \"145-000-000-000-000-000-000\",\n unknown: \"145-000-000-000-000-000-001\",\n anonymous: \"145-000-000-000-000-000-002\",\n data_not_collected: \"145-000-000-000-000-000-003\",\n coercion_threats: \"145-001-000-000-000-000-000\",\n threats_of_harm: \"145-001-001-000-000-000-000\",\n threatens_physical_harm_to_subject: \"145-001-001-001-000-000-000\",\n physically_harm_threatened_by_subject: \"145-001-001-002-000-000-000\",\n threats_to_family_friends: \"145-001-002-000-000-000-000\",\n threatens_family_friends_of_subject: \"145-001-002-001-000-000-000\",\n family_friends_threatened_by_subject: \"145-001-002-002-000-000-000\",\n threats_of_legal_trouble: \"145-001-003-000-000-000-000\",\n other_threats_to_subject: \"145-001-003-001-000-000-000\",\n other_threats_by_subject: \"145-001-003-002-000-000-000\",\n control_monitoring: \"145-002-000-000-000-000-000\",\n controlling_behavior: \"145-002-001-000-000-000-000\",\n appears_controlling_of_subject: \"145-002-001-001-000-000-000\",\n appears_controlled_by_subject: \"145-002-001-002-000-000-000\",\n abuse_dynamics: \"145-003-000-000-000-000-000\",\n emotional_verbal_abuse: \"145-003-001-000-000-000-000\",\n emotionally_verbally_abuses_subject: \"145-003-001-001-000-000-000\",\n emotionally_verbally_abused_by_subject: \"145-003-001-002-000-000-000\",\n physical_abuse: \"145-003-002-000-000-000-000\",\n physically_abuses_subject: \"145-003-002-001-000-000-000\",\n physically_abused_by_subject: \"145-003-002-002-000-000-000\",\n sexual_abuse: \"145-003-003-000-000-000-000\",\n sexually_abuses_subject: \"145-003-003-001-000-000-000\",\n sexually_abused_by_subject: \"145-003-003-002-000-000-000\",\n family_friends_physically_abused: \"145-003-004-000-000-000-000\",\n physically_abuses_family_friends_of_subject: \"145-003-004-001-000-000-000\",\n family_friends_physically_abused_by_subject: \"145-003-004-002-000-000-000\",\n resource_control: \"145-004-000-000-000-000-000\",\n controls_documentation: \"145-004-001-000-000-000-000\",\n controls_documentation_of_subject: \"145-004-001-001-000-000-000\",\n documentation_controlled_by_subject: \"145-004-001-002-000-000-000\",\n controls_finances: \"145-004-002-000-000-000-000\",\n controls_finances_of_subject: \"145-004-002-001-000-000-000\",\n finances_controlled_by_subject: \"145-004-002-002-000-000-000\",\n power_imbalance: \"145-005-000-000-000-000-000\",\n age_disparity: \"145-005-001-000-000-000-000\",\n is_much_older_than_subject: \"145-005-001-001-000-000-000\",\n is_much_younger_than_subject: \"145-005-001-002-000-000-000\",\n} as const;\n\nexport type RelationshipDynamicsKey = keyof typeof RelationshipDynamicsKeys;\n\n/**\n * Key → positional code map for the `collection_context` CVC domain.\n *\n * Domain: `collection_context` · Version: 1.0.0 · Entries: 8\n */\nexport const CollectionContextKeys = {\n missingness_root: \"195-000-000-000-000-000-000\",\n unknown: \"195-000-000-000-000-000-001\",\n anonymous: \"195-000-000-000-000-000-002\",\n data_not_collected: \"195-000-000-000-000-000-003\",\n contact: \"195-001-000-000-000-000-000\",\n enrollment_entry: \"195-002-000-000-000-000-000\",\n enrollment_exit: \"195-003-000-000-000-000-000\",\n post_exit: \"195-004-000-000-000-000-000\",\n} as const;\n\nexport type CollectionContextKey = keyof typeof CollectionContextKeys;\n\n/**\n * Key → positional code map for the `languages` CVC domain.\n *\n * Domain: `languages` · Version: 1.0.0 · Entries: 212\n */\nexport const LanguagesKeys = {\n missingness_root: \"223-000-000-000-000-000-000\",\n unknown: \"223-000-000-000-000-000-001\",\n anonymous: \"223-000-000-000-000-000-002\",\n data_not_collected: \"223-000-000-000-000-000-003\",\n english: \"223-001-000-000-000-000-000\",\n spanish: \"223-002-000-000-000-000-000\",\n vietnamese: \"223-003-000-000-000-000-000\",\n arabic_modern_standard: \"223-004-000-000-000-000-000\",\n chinese_mandarin: \"223-005-000-000-000-000-000\",\n cantonese: \"223-006-000-000-000-000-000\",\n korean: \"223-007-000-000-000-000-000\",\n hindi: \"223-008-000-000-000-000-000\",\n tagalog_filipino: \"223-009-000-000-000-000-000\",\n french: \"223-010-000-000-000-000-000\",\n portuguese: \"223-011-000-000-000-000-000\",\n american_sign_language_asl: \"223-012-000-000-000-000-000\",\n russian: \"223-013-000-000-000-000-000\",\n polish: \"223-014-000-000-000-000-000\",\n haitian_creole: \"223-015-000-000-000-000-000\",\n italian: \"223-016-000-000-000-000-000\",\n german: \"223-017-000-000-000-000-000\",\n punjabi: \"223-018-000-000-000-000-000\",\n urdu: \"223-019-000-000-000-000-000\",\n persian_farsi: \"223-020-000-000-000-000-000\",\n abkhazian: \"223-021-000-000-000-000-000\",\n afar: \"223-022-000-000-000-000-000\",\n afrikaans: \"223-023-000-000-000-000-000\",\n akan: \"223-024-000-000-000-000-000\",\n albanian: \"223-025-000-000-000-000-000\",\n amharic: \"223-026-000-000-000-000-000\",\n aragonese: \"223-027-000-000-000-000-000\",\n armenian: \"223-028-000-000-000-000-000\",\n assamese: \"223-029-000-000-000-000-000\",\n avaric: \"223-030-000-000-000-000-000\",\n avestan: \"223-031-000-000-000-000-000\",\n aymara: \"223-032-000-000-000-000-000\",\n azerbaijani: \"223-033-000-000-000-000-000\",\n bambara: \"223-034-000-000-000-000-000\",\n bashkir: \"223-035-000-000-000-000-000\",\n basque: \"223-036-000-000-000-000-000\",\n belarusian: \"223-037-000-000-000-000-000\",\n bengali_bangla: \"223-038-000-000-000-000-000\",\n bihari: \"223-039-000-000-000-000-000\",\n bislama: \"223-040-000-000-000-000-000\",\n bosnian: \"223-041-000-000-000-000-000\",\n breton: \"223-042-000-000-000-000-000\",\n bulgarian: \"223-043-000-000-000-000-000\",\n burmese: \"223-044-000-000-000-000-000\",\n catalan: \"223-045-000-000-000-000-000\",\n chamorro: \"223-046-000-000-000-000-000\",\n chechen: \"223-047-000-000-000-000-000\",\n chichewa: \"223-048-000-000-000-000-000\",\n chuvash: \"223-049-000-000-000-000-000\",\n cornish: \"223-050-000-000-000-000-000\",\n corsican: \"223-051-000-000-000-000-000\",\n cree: \"223-052-000-000-000-000-000\",\n croatian: \"223-053-000-000-000-000-000\",\n czech: \"223-054-000-000-000-000-000\",\n danish: \"223-055-000-000-000-000-000\",\n divehi_maldivian: \"223-056-000-000-000-000-000\",\n dutch: \"223-057-000-000-000-000-000\",\n dzongkha: \"223-058-000-000-000-000-000\",\n esperanto: \"223-059-000-000-000-000-000\",\n estonian: \"223-060-000-000-000-000-000\",\n ewe: \"223-061-000-000-000-000-000\",\n faroese: \"223-062-000-000-000-000-000\",\n fijian: \"223-063-000-000-000-000-000\",\n finnish: \"223-064-000-000-000-000-000\",\n fulah: \"223-065-000-000-000-000-000\",\n galician: \"223-066-000-000-000-000-000\",\n georgian: \"223-067-000-000-000-000-000\",\n greek: \"223-068-000-000-000-000-000\",\n guarani: \"223-069-000-000-000-000-000\",\n gujarati: \"223-070-000-000-000-000-000\",\n hausa: \"223-071-000-000-000-000-000\",\n hebrew: \"223-072-000-000-000-000-000\",\n herero: \"223-073-000-000-000-000-000\",\n hiri_motu: \"223-074-000-000-000-000-000\",\n hungarian: \"223-075-000-000-000-000-000\",\n interlingua: \"223-076-000-000-000-000-000\",\n indonesian: \"223-077-000-000-000-000-000\",\n interlingue: \"223-078-000-000-000-000-000\",\n irish: \"223-079-000-000-000-000-000\",\n igbo: \"223-080-000-000-000-000-000\",\n inupiaq: \"223-081-000-000-000-000-000\",\n ido: \"223-082-000-000-000-000-000\",\n icelandic: \"223-083-000-000-000-000-000\",\n inuktitut: \"223-084-000-000-000-000-000\",\n japanese: \"223-085-000-000-000-000-000\",\n javanese: \"223-086-000-000-000-000-000\",\n kalaallisut_greenlandic: \"223-087-000-000-000-000-000\",\n kannada: \"223-088-000-000-000-000-000\",\n kanuri: \"223-089-000-000-000-000-000\",\n kashmiri: \"223-090-000-000-000-000-000\",\n kazakh: \"223-091-000-000-000-000-000\",\n khmer: \"223-092-000-000-000-000-000\",\n kikuyu: \"223-093-000-000-000-000-000\",\n kinyarwanda: \"223-094-000-000-000-000-000\",\n kyrgyz: \"223-095-000-000-000-000-000\",\n komi: \"223-096-000-000-000-000-000\",\n kongo: \"223-097-000-000-000-000-000\",\n kurdish_general: \"223-098-000-000-000-000-000\",\n kuanyama: \"223-099-000-000-000-000-000\",\n latin: \"223-100-000-000-000-000-000\",\n luxembourgish: \"223-101-000-000-000-000-000\",\n luganda: \"223-102-000-000-000-000-000\",\n limburgish: \"223-103-000-000-000-000-000\",\n lingala: \"223-104-000-000-000-000-000\",\n lao: \"223-105-000-000-000-000-000\",\n lithuanian: \"223-106-000-000-000-000-000\",\n luba_katanga: \"223-107-000-000-000-000-000\",\n latvian: \"223-108-000-000-000-000-000\",\n manx: \"223-109-000-000-000-000-000\",\n macedonian: \"223-110-000-000-000-000-000\",\n malagasy: \"223-111-000-000-000-000-000\",\n malay: \"223-112-000-000-000-000-000\",\n malayalam: \"223-113-000-000-000-000-000\",\n maltese: \"223-114-000-000-000-000-000\",\n maori: \"223-115-000-000-000-000-000\",\n marathi: \"223-116-000-000-000-000-000\",\n marshallese: \"223-117-000-000-000-000-000\",\n mongolian: \"223-118-000-000-000-000-000\",\n nauru: \"223-119-000-000-000-000-000\",\n navajo: \"223-120-000-000-000-000-000\",\n norwegian_bokmal: \"223-121-000-000-000-000-000\",\n north_ndebele: \"223-122-000-000-000-000-000\",\n nepali: \"223-123-000-000-000-000-000\",\n ndonga: \"223-124-000-000-000-000-000\",\n norwegian_nynorsk: \"223-125-000-000-000-000-000\",\n norwegian: \"223-126-000-000-000-000-000\",\n sichuan_yi: \"223-127-000-000-000-000-000\",\n south_ndebele: \"223-128-000-000-000-000-000\",\n occitan: \"223-129-000-000-000-000-000\",\n ojibwe: \"223-130-000-000-000-000-000\",\n old_church_slavonic: \"223-131-000-000-000-000-000\",\n oromo: \"223-132-000-000-000-000-000\",\n odia_oriya: \"223-133-000-000-000-000-000\",\n ossetian: \"223-134-000-000-000-000-000\",\n pali: \"223-135-000-000-000-000-000\",\n pashto: \"223-136-000-000-000-000-000\",\n quechua: \"223-137-000-000-000-000-000\",\n romansh: \"223-138-000-000-000-000-000\",\n rundi: \"223-139-000-000-000-000-000\",\n romanian: \"223-140-000-000-000-000-000\",\n sanskrit: \"223-141-000-000-000-000-000\",\n sardinian: \"223-142-000-000-000-000-000\",\n sindhi: \"223-143-000-000-000-000-000\",\n northern_sami: \"223-144-000-000-000-000-000\",\n samoan: \"223-145-000-000-000-000-000\",\n sango: \"223-146-000-000-000-000-000\",\n serbian: \"223-147-000-000-000-000-000\",\n scottish_gaelic: \"223-148-000-000-000-000-000\",\n shona: \"223-149-000-000-000-000-000\",\n sinhala: \"223-150-000-000-000-000-000\",\n slovak: \"223-151-000-000-000-000-000\",\n slovenian: \"223-152-000-000-000-000-000\",\n somali: \"223-153-000-000-000-000-000\",\n southern_sotho: \"223-154-000-000-000-000-000\",\n sundanese: \"223-155-000-000-000-000-000\",\n swahili: \"223-156-000-000-000-000-000\",\n swati: \"223-157-000-000-000-000-000\",\n swedish: \"223-158-000-000-000-000-000\",\n tamil: \"223-159-000-000-000-000-000\",\n telugu: \"223-160-000-000-000-000-000\",\n tajik: \"223-161-000-000-000-000-000\",\n thai: \"223-162-000-000-000-000-000\",\n tigrinya: \"223-163-000-000-000-000-000\",\n tibetan: \"223-164-000-000-000-000-000\",\n turkmen: \"223-165-000-000-000-000-000\",\n tswana: \"223-166-000-000-000-000-000\",\n tongan: \"223-167-000-000-000-000-000\",\n turkish: \"223-168-000-000-000-000-000\",\n tsonga: \"223-169-000-000-000-000-000\",\n tatar: \"223-170-000-000-000-000-000\",\n twi: \"223-171-000-000-000-000-000\",\n tahitian: \"223-172-000-000-000-000-000\",\n uyghur: \"223-173-000-000-000-000-000\",\n ukrainian: \"223-174-000-000-000-000-000\",\n uzbek: \"223-175-000-000-000-000-000\",\n venda: \"223-176-000-000-000-000-000\",\n volapuk: \"223-177-000-000-000-000-000\",\n walloon: \"223-178-000-000-000-000-000\",\n welsh: \"223-179-000-000-000-000-000\",\n wolof: \"223-180-000-000-000-000-000\",\n western_frisian: \"223-181-000-000-000-000-000\",\n xhosa: \"223-182-000-000-000-000-000\",\n yiddish: \"223-183-000-000-000-000-000\",\n yoruba: \"223-184-000-000-000-000-000\",\n zhuang: \"223-185-000-000-000-000-000\",\n zulu: \"223-186-000-000-000-000-000\",\n hakka_chinese: \"223-187-000-000-000-000-000\",\n min_nan_chinese_hokkien_taiwanese: \"223-188-000-000-000-000-000\",\n wu_chinese_shanghainese: \"223-189-000-000-000-000-000\",\n egyptian_arabic: \"223-190-000-000-000-000-000\",\n iraqi_arabic_mesopotamian: \"223-191-000-000-000-000-000\",\n levantine_arabic: \"223-192-000-000-000-000-000\",\n dari_afghan_persian: \"223-193-000-000-000-000-000\",\n central_kurdish_sorani: \"223-194-000-000-000-000-000\",\n northern_kurdish_kurmanji: \"223-195-000-000-000-000-000\",\n filipino_national_variety: \"223-196-000-000-000-000-000\",\n hmong: \"223-197-000-000-000-000-000\",\n iu_mien: \"223-198-000-000-000-000-000\",\n karen: \"223-199-000-000-000-000-000\",\n chuukese: \"223-200-000-000-000-000-000\",\n pohnpeian: \"223-201-000-000-000-000-000\",\n yapese: \"223-202-000-000-000-000-000\",\n papiamento: \"223-203-000-000-000-000-000\",\n nigerian_pidgin: \"223-204-000-000-000-000-000\",\n british_sign_language_bsl: \"223-205-000-000-000-000-000\",\n french_sign_language_lsf: \"223-206-000-000-000-000-000\",\n mexican_sign_language_lsm: \"223-207-000-000-000-000-000\",\n brazilian_sign_language_libras: \"223-208-000-000-000-000-000\",\n} as const;\n\nexport type LanguagesKey = keyof typeof LanguagesKeys;\n\n/**\n * Key → positional code map for the `hmis_project_type` CVC domain.\n *\n * Domain: `hmis_project_type` · Version: 1.0.0 · Entries: 18\n */\nexport const HmisProjectTypeKeys = {\n missingness_root: \"225-000-000-000-000-000-000\",\n unknown: \"225-000-000-000-000-000-001\",\n anonymous: \"225-000-000-000-000-000-002\",\n data_not_collected: \"225-000-000-000-000-000-003\",\n street_outreach: \"225-001-000-000-000-000-000\",\n emergency_shelter_entry_exit: \"225-002-000-000-000-000-000\",\n emergency_shelter_night_by_night: \"225-003-000-000-000-000-000\",\n transitional_housing: \"225-004-000-000-000-000-000\",\n ph_permanent_supportive_housing: \"225-005-000-000-000-000-000\",\n services_only: \"225-006-000-000-000-000-000\",\n other: \"225-007-000-000-000-000-000\",\n safe_haven: \"225-008-000-000-000-000-000\",\n ph_housing_only: \"225-009-000-000-000-000-000\",\n ph_housing_with_services: \"225-010-000-000-000-000-000\",\n day_shelter: \"225-011-000-000-000-000-000\",\n homelessness_prevention: \"225-012-000-000-000-000-000\",\n ph_rapid_re_housing: \"225-013-000-000-000-000-000\",\n coordinated_entry: \"225-014-000-000-000-000-000\",\n} as const;\n\nexport type HmisProjectTypeKey = keyof typeof HmisProjectTypeKeys;\n\n/**\n * Key → positional code map for the `da_incident_severity` CVC domain.\n *\n * Domain: `da_incident_severity` · Version: 1.0.0 · Entries: 9\n */\nexport const DaIncidentSeverityKeys = {\n missingness_root: \"228-000-000-000-000-000-000\",\n unknown: \"228-000-000-000-000-000-001\",\n anonymous: \"228-000-000-000-000-000-002\",\n data_not_collected: \"228-000-000-000-000-000-003\",\n severity_1: \"228-001-000-000-000-000-000\",\n severity_2: \"228-002-000-000-000-000-000\",\n severity_3: \"228-003-000-000-000-000-000\",\n severity_4: \"228-004-000-000-000-000-000\",\n severity_5: \"228-005-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentSeverityKey = keyof typeof DaIncidentSeverityKeys;\n\n/**\n * Key → positional code map for the `exit_reasons` CVC domain.\n *\n * Domain: `exit_reasons` · Version: 1.0.0 · Entries: 23\n */\nexport const ExitReasonsKeys = {\n missingness_root: \"220-000-000-000-000-000-000\",\n unknown: \"220-000-000-000-000-000-001\",\n anonymous: \"220-000-000-000-000-000-002\",\n data_not_collected: \"220-000-000-000-000-000-003\",\n completed_program: \"220-001-000-000-000-000-000\",\n reached_maximum_allowed_stay: \"220-002-000-000-000-000-000\",\n transferred_to_another_program_internal: \"220-003-000-000-000-000-000\",\n transferred_to_another_program_external: \"220-004-000-000-000-000-000\",\n left_early_voluntarily: \"220-005-000-000-000-000-000\",\n exited_for_safety_survivor_initiated: \"220-006-000-000-000-000-000\",\n relocated_geographically: \"220-007-000-000-000-000-000\",\n exited_by_program_behavioral_violation: \"220-008-000-000-000-000-000\",\n exited_by_program_safety_to_others: \"220-009-000-000-000-000-000\",\n needs_beyond_program_scope: \"220-010-000-000-000-000-000\",\n health_related_exit: \"220-011-000-000-000-000-000\",\n placement_changed_by_authority: \"220-012-000-000-000-000-000\",\n deported: \"220-013-000-000-000-000-000\",\n recertification_lapsed: \"220-014-000-000-000-000-000\",\n program_ended: \"220-015-000-000-000-000-000\",\n lost_to_followup: \"220-016-000-000-000-000-000\",\n auto_exit_no_exit_interview: \"220-017-000-000-000-000-000\",\n deceased: \"220-018-000-000-000-000-000\",\n other: \"220-019-000-000-000-000-000\",\n} as const;\n\nexport type ExitReasonsKey = keyof typeof ExitReasonsKeys;\n\n/**\n * Key → positional code map for the `mid_stay_event_type` CVC domain.\n *\n * Domain: `mid_stay_event_type` · Version: 1.0.0 · Entries: 11\n */\nexport const MidStayEventTypeKeys = {\n missingness_root: \"221-000-000-000-000-000-000\",\n unknown: \"221-000-000-000-000-000-001\",\n anonymous: \"221-000-000-000-000-000-002\",\n data_not_collected: \"221-000-000-000-000-000-003\",\n room_transfer: \"221-001-000-000-000-000-000\",\n overnight_pass_approved: \"221-002-000-000-000-000-000\",\n bed_vacated_no_contact: \"221-003-000-000-000-000-000\",\n care_plan_review: \"221-004-000-000-000-000-000\",\n internal_referral: \"221-005-000-000-000-000-000\",\n safety_check_in: \"221-006-000-000-000-000-000\",\n other: \"221-007-000-000-000-000-000\",\n} as const;\n\nexport type MidStayEventTypeKey = keyof typeof MidStayEventTypeKeys;\n\n/**\n * Key → positional code map for the `pet_exit_reason` CVC domain.\n *\n * Domain: `pet_exit_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const PetExitReasonKeys = {\n missingness_root: \"222-000-000-000-000-000-000\",\n unknown: \"222-000-000-000-000-000-001\",\n anonymous: \"222-000-000-000-000-000-002\",\n data_not_collected: \"222-000-000-000-000-000-003\",\n permanent_placement: \"222-001-000-000-000-000-000\",\n survivor_exit: \"222-002-000-000-000-000-000\",\n alternative_care: \"222-003-000-000-000-000-000\",\n behavioral_incident: \"222-004-000-000-000-000-000\",\n health_issue: \"222-005-000-000-000-000-000\",\n other: \"222-006-000-000-000-000-000\",\n} as const;\n\nexport type PetExitReasonKey = keyof typeof PetExitReasonKeys;\n\n/**\n * Key → positional code map for the `funder` CVC domain.\n *\n * Domain: `funder` · Version: 1.0.0 · Entries: 12\n */\nexport const FunderKeys = {\n missingness_root: \"226-000-000-000-000-000-000\",\n unknown: \"226-000-000-000-000-000-001\",\n anonymous: \"226-000-000-000-000-000-002\",\n data_not_collected: \"226-000-000-000-000-000-003\",\n hud_coc: \"226-001-000-000-000-000-000\",\n hud_esg: \"226-002-000-000-000-000-000\",\n hhs_rhy: \"226-003-000-000-000-000-000\",\n hhs_path: \"226-004-000-000-000-000-000\",\n ovc_ecm: \"226-005-000-000-000-000-000\",\n voca: \"226-006-000-000-000-000-000\",\n fvpsa: \"226-007-000-000-000-000-000\",\n other: \"226-008-000-000-000-000-000\",\n} as const;\n\nexport type FunderKey = keyof typeof FunderKeys;\n\n/**\n * Key → positional code map for the `accommodation_type` CVC domain.\n *\n * Domain: `accommodation_type` · Version: 1.0.0 · Entries: 10\n */\nexport const AccommodationTypeKeys = {\n missingness_root: \"900-000-000-000-000-000-000\",\n unknown: \"900-000-000-000-000-000-001\",\n anonymous: \"900-000-000-000-000-000-002\",\n data_not_collected: \"900-000-000-000-000-000-003\",\n sensory: \"900-001-000-000-000-000-000\",\n mobility: \"900-002-000-000-000-000-000\",\n communication_cognitive: \"900-003-000-000-000-000-000\",\n medical_dietary: \"900-004-000-000-000-000-000\",\n service_animal: \"900-005-000-000-000-000-000\",\n other: \"900-006-000-000-000-000-000\",\n} as const;\n\nexport type AccommodationTypeKey = keyof typeof AccommodationTypeKeys;\n\n/**\n * Key → positional code map for the `action_step_completion_status` CVC domain.\n *\n * Domain: `action_step_completion_status` · Version: 1.0.0 · Entries: 8\n */\nexport const ActionStepCompletionStatusKeys = {\n missingness_root: \"901-000-000-000-000-000-000\",\n unknown: \"901-000-000-000-000-000-001\",\n anonymous: \"901-000-000-000-000-000-002\",\n data_not_collected: \"901-000-000-000-000-000-003\",\n yes: \"901-001-000-000-000-000-000\",\n no: \"901-002-000-000-000-000-000\",\n unknown_na: \"901-003-000-000-000-000-000\",\n unanswered: \"901-004-000-000-000-000-000\",\n} as const;\n\nexport type ActionStepCompletionStatusKey = keyof typeof ActionStepCompletionStatusKeys;\n\n/**\n * Key → positional code map for the `action_step_type` CVC domain.\n *\n * Domain: `action_step_type` · Version: 1.0.0 · Entries: 6\n */\nexport const ActionStepTypeKeys = {\n missingness_root: \"902-000-000-000-000-000-000\",\n unknown: \"902-000-000-000-000-000-001\",\n anonymous: \"902-000-000-000-000-000-002\",\n data_not_collected: \"902-000-000-000-000-000-003\",\n client_action: \"902-001-000-000-000-000-000\",\n advocate_action: \"902-002-000-000-000-000-000\",\n} as const;\n\nexport type ActionStepTypeKey = keyof typeof ActionStepTypeKeys;\n\n/**\n * Key → positional code map for the `announcement_audience_scope` CVC domain.\n *\n * Domain: `announcement_audience_scope` · Version: 1.0.0 · Entries: 7\n */\nexport const AnnouncementAudienceScopeKeys = {\n missingness_root: \"903-000-000-000-000-000-000\",\n unknown: \"903-000-000-000-000-000-001\",\n anonymous: \"903-000-000-000-000-000-002\",\n data_not_collected: \"903-000-000-000-000-000-003\",\n all: \"903-001-000-000-000-000-000\",\n role: \"903-002-000-000-000-000-000\",\n working_group: \"903-003-000-000-000-000-000\",\n} as const;\n\nexport type AnnouncementAudienceScopeKey = keyof typeof AnnouncementAudienceScopeKeys;\n\n/**\n * Key → positional code map for the `announcement_response_type` CVC domain.\n *\n * Domain: `announcement_response_type` · Version: 1.0.0 · Entries: 8\n */\nexport const AnnouncementResponseTypeKeys = {\n missingness_root: \"904-000-000-000-000-000-000\",\n unknown: \"904-000-000-000-000-000-001\",\n anonymous: \"904-000-000-000-000-000-002\",\n data_not_collected: \"904-000-000-000-000-000-003\",\n none: \"904-001-000-000-000-000-000\",\n acknowledge: \"904-002-000-000-000-000-000\",\n rsvp: \"904-003-000-000-000-000-000\",\n register: \"904-004-000-000-000-000-000\",\n} as const;\n\nexport type AnnouncementResponseTypeKey = keyof typeof AnnouncementResponseTypeKeys;\n\n/**\n * Key → positional code map for the `basis_quick_picks` CVC domain.\n *\n * Domain: `basis_quick_picks` · Version: 1.0.0 · Entries: 11\n */\nexport const BasisQuickPicksKeys = {\n missingness_root: \"905-000-000-000-000-000-000\",\n unknown: \"905-000-000-000-000-000-001\",\n anonymous: \"905-000-000-000-000-000-002\",\n data_not_collected: \"905-000-000-000-000-000-003\",\n client_disclosed_directly: \"905-001-000-000-000-000-000\",\n third_party_reported: \"905-002-000-000-000-000-000\",\n staff_observed: \"905-003-000-000-000-000-000\",\n provider_assessed: \"905-004-000-000-000-000-000\",\n record_document_reviewed: \"905-005-000-000-000-000-000\",\n public_source_online: \"905-006-000-000-000-000-000\",\n system_imported_machine_derived: \"905-007-000-000-000-000-000\",\n} as const;\n\nexport type BasisQuickPicksKey = keyof typeof BasisQuickPicksKeys;\n\n/**\n * Key → positional code map for the `check_in_activity` CVC domain.\n *\n * Domain: `check_in_activity` · Version: 1.0.0 · Entries: 24\n */\nexport const CheckInActivityKeys = {\n missingness_root: \"906-000-000-000-000-000-000\",\n unknown: \"906-000-000-000-000-000-001\",\n anonymous: \"906-000-000-000-000-000-002\",\n data_not_collected: \"906-000-000-000-000-000-003\",\n update_hope_plan: \"906-001-000-000-000-000-000\",\n review_update_safety_plan: \"906-002-000-000-000-000-000\",\n update_needs_assessment: \"906-003-000-000-000-000-000\",\n counseling_check_in: \"906-004-000-000-000-000-000\",\n prss_wellness_check_in: \"906-005-000-000-000-000-000\",\n medical_check_in: \"906-006-000-000-000-000-000\",\n housing_exit_plan_check_in: \"906-007-000-000-000-000-000\",\n offer_education_dv_sa_ht_stk: \"906-008-000-000-000-000-000\",\n schedule_next_meeting: \"906-009-000-000-000-000-000\",\n room_check: \"906-010-000-000-000-000-000\",\n pet_kennel_check: \"906-011-000-000-000-000-000\",\n boutique_essential_closet_visit: \"906-012-000-000-000-000-000\",\n transportation_request: \"906-013-000-000-000-000-000\",\n needs_financial_request: \"906-014-000-000-000-000-000\",\n review_confidentiality: \"906-015-000-000-000-000-000\",\n review_do_no_harm_agreement: \"906-016-000-000-000-000-000\",\n educate_guest_staff_rights: \"906-017-000-000-000-000-000\",\n complete_hope_scale: \"906-018-000-000-000-000-000\",\n set_soft_target_date: \"906-019-000-000-000-000-000\",\n other_activity: \"906-020-000-000-000-000-000\",\n} as const;\n\nexport type CheckInActivityKey = keyof typeof CheckInActivityKeys;\n\n/**\n * Key → positional code map for the `check_in_phase` CVC domain.\n *\n * Domain: `check_in_phase` · Version: 1.1.0 · Entries: 17\n */\nexport const CheckInPhaseKeys = {\n missingness_root: \"907-000-000-000-000-000-000\",\n unknown: \"907-000-000-000-000-000-001\",\n anonymous: \"907-000-000-000-000-000-002\",\n data_not_collected: \"907-000-000-000-000-000-003\",\n welcome_week: \"907-001-000-000-000-000-000\",\n phase_1_30d: \"907-002-000-000-000-000-000\",\n phase_2_60d: \"907-003-000-000-000-000-000\",\n phase_3_90d: \"907-004-000-000-000-000-000\",\n phase_4_120d_plus: \"907-005-000-000-000-000-000\",\n initial_intake: \"907-006-000-000-000-000-000\",\n routine_interval: \"907-007-000-000-000-000-000\",\n milestone_review: \"907-008-000-000-000-000-000\",\n crisis_response_followup: \"907-009-000-000-000-000-000\",\n pre_exit_review: \"907-010-000-000-000-000-000\",\n post_exit_followup: \"907-011-000-000-000-000-000\",\n phase_2_followup: \"907-012-000-000-000-000-000\",\n phase_3_followup: \"907-013-000-000-000-000-000\",\n} as const;\n\nexport type CheckInPhaseKey = keyof typeof CheckInPhaseKeys;\n\n/**\n * Key → positional code map for the `child_behavioral_concerns` CVC domain.\n *\n * Domain: `child_behavioral_concerns` · Version: 1.0.0 · Entries: 16\n */\nexport const ChildBehavioralConcernsKeys = {\n missingness_root: \"908-000-000-000-000-000-000\",\n unknown: \"908-000-000-000-000-000-001\",\n anonymous: \"908-000-000-000-000-000-002\",\n data_not_collected: \"908-000-000-000-000-000-003\",\n theft: \"908-001-000-000-000-000-000\",\n difficulty_making_friends: \"908-002-000-000-000-000-000\",\n withdrawn: \"908-003-000-000-000-000-000\",\n bed_wetting: \"908-004-000-000-000-000-000\",\n harming_animals: \"908-005-000-000-000-000-000\",\n fighting: \"908-006-000-000-000-000-000\",\n bullying_others: \"908-007-000-000-000-000-000\",\n being_bullied: \"908-008-000-000-000-000-000\",\n sexual_acting_out: \"908-009-000-000-000-000-000\",\n substance_use: \"908-010-000-000-000-000-000\",\n frequent_moves: \"908-011-000-000-000-000-000\",\n other: \"908-012-000-000-000-000-000\",\n} as const;\n\nexport type ChildBehavioralConcernsKey = keyof typeof ChildBehavioralConcernsKeys;\n\n/**\n * Key → positional code map for the `child_custody_arrangement` CVC domain.\n *\n * Domain: `child_custody_arrangement` · Version: 1.0.0 · Entries: 19\n */\nexport const ChildCustodyArrangementKeys = {\n missingness_root: \"910-000-000-000-000-000-000\",\n unknown: \"910-000-000-000-000-000-001\",\n anonymous: \"910-000-000-000-000-000-002\",\n data_not_collected: \"910-000-000-000-000-000-003\",\n court_ordered_sole_client: \"910-001-000-000-000-000-000\",\n court_ordered_sole_other: \"910-002-000-000-000-000-000\",\n court_ordered_shared: \"910-003-000-000-000-000-000\",\n voluntary_informal_client: \"910-004-000-000-000-000-000\",\n voluntary_informal_other: \"910-005-000-000-000-000-000\",\n shared_informal: \"910-006-000-000-000-000-000\",\n rights_surrendered_voluntary: \"910-007-000-000-000-000-000\",\n rights_terminated_court: \"910-008-000-000-000-000-000\",\n kinship_care: \"910-009-000-000-000-000-000\",\n foster_care: \"910-010-000-000-000-000-000\",\n adopted_out: \"910-011-000-000-000-000-000\",\n pending_legal_process: \"910-012-000-000-000-000-000\",\n unknown_status: \"910-013-000-000-000-000-000\",\n not_applicable: \"910-014-000-000-000-000-000\",\n other: \"910-015-000-000-000-000-000\",\n} as const;\n\nexport type ChildCustodyArrangementKey = keyof typeof ChildCustodyArrangementKeys;\n\n/**\n * Key → positional code map for the `da_incident_archive_reason` CVC domain.\n *\n * Domain: `da_incident_archive_reason` · Version: 1.0.0 · Entries: 8\n */\nexport const DaIncidentArchiveReasonKeys = {\n missingness_root: \"911-000-000-000-000-000-000\",\n unknown: \"911-000-000-000-000-000-001\",\n anonymous: \"911-000-000-000-000-000-002\",\n data_not_collected: \"911-000-000-000-000-000-003\",\n inaccurate: \"911-001-000-000-000-000-000\",\n duplicate: \"911-002-000-000-000-000-000\",\n captured_in_error: \"911-003-000-000-000-000-000\",\n survivor_retracted: \"911-004-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentArchiveReasonKey = keyof typeof DaIncidentArchiveReasonKeys;\n\n/**\n * Key → positional code map for the `da_incident_confidence` CVC domain.\n *\n * Domain: `da_incident_confidence` · Version: 1.0.0 · Entries: 7\n */\nexport const DaIncidentConfidenceKeys = {\n missingness_root: \"912-000-000-000-000-000-000\",\n unknown: \"912-000-000-000-000-000-001\",\n anonymous: \"912-000-000-000-000-000-002\",\n data_not_collected: \"912-000-000-000-000-000-003\",\n exact: \"912-001-000-000-000-000-000\",\n approximate: \"912-002-000-000-000-000-000\",\n uncertain: \"912-003-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentConfidenceKey = keyof typeof DaIncidentConfidenceKeys;\n\n/**\n * Key → positional code map for the `da_incident_day_approx` CVC domain.\n *\n * Domain: `da_incident_day_approx` · Version: 1.0.0 · Entries: 8\n */\nexport const DaIncidentDayApproxKeys = {\n missingness_root: \"913-000-000-000-000-000-000\",\n unknown: \"913-000-000-000-000-000-001\",\n anonymous: \"913-000-000-000-000-000-002\",\n data_not_collected: \"913-000-000-000-000-000-003\",\n early: \"913-001-000-000-000-000-000\",\n mid: \"913-002-000-000-000-000-000\",\n late: \"913-003-000-000-000-000-000\",\n unspecified: \"913-004-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentDayApproxKey = keyof typeof DaIncidentDayApproxKeys;\n\n/**\n * Key → positional code map for the `disability_subtype` CVC domain.\n *\n * Domain: `disability_subtype` · Version: 1.0.0 · Entries: 12\n */\nexport const DisabilitySubtypeKeys = {\n missingness_root: \"914-000-000-000-000-000-000\",\n unknown: \"914-000-000-000-000-000-001\",\n anonymous: \"914-000-000-000-000-000-002\",\n data_not_collected: \"914-000-000-000-000-000-003\",\n vision: \"914-001-000-000-000-000-000\",\n hearing: \"914-002-000-000-000-000-000\",\n speech: \"914-003-000-000-000-000-000\",\n cognitive_developmental: \"914-004-000-000-000-000-000\",\n physical: \"914-005-000-000-000-000-000\",\n mental: \"914-006-000-000-000-000-000\",\n other: \"914-007-000-000-000-000-000\",\n exists_but_type_unknown: \"914-008-000-000-000-000-000\",\n} as const;\n\nexport type DisabilitySubtypeKey = keyof typeof DisabilitySubtypeKeys;\n\n/**\n * Key → positional code map for the `discretion_level` CVC domain.\n *\n * Domain: `discretion_level` · Version: 1.0.0 · Entries: 8\n */\nexport const DiscretionLevelKeys = {\n missingness_root: \"915-000-000-000-000-000-000\",\n unknown: \"915-000-000-000-000-000-001\",\n anonymous: \"915-000-000-000-000-000-002\",\n data_not_collected: \"915-000-000-000-000-000-003\",\n full_disclosure: \"915-001-000-000-000-000-000\",\n discrete_message: \"915-002-000-000-000-000-000\",\n vsp_only_no_agency_name: \"915-003-000-000-000-000-000\",\n code_word_verification_required: \"915-004-000-000-000-000-000\",\n} as const;\n\nexport type DiscretionLevelKey = keyof typeof DiscretionLevelKeys;\n\n/**\n * Key → positional code map for the `emergency_contact_call_reason` CVC domain.\n *\n * Domain: `emergency_contact_call_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const EmergencyContactCallReasonKeys = {\n missingness_root: \"916-000-000-000-000-000-000\",\n unknown: \"916-000-000-000-000-000-001\",\n anonymous: \"916-000-000-000-000-000-002\",\n data_not_collected: \"916-000-000-000-000-000-003\",\n medical_incapacity: \"916-001-000-000-000-000-000\",\n safety_concern_survivor_missing: \"916-002-000-000-000-000-000\",\n child_emergency_client_unreachable: \"916-003-000-000-000-000-000\",\n logistics_children_pet_care_needed: \"916-004-000-000-000-000-000\",\n logistics_belongings_or_mail_pickup: \"916-005-000-000-000-000-000\",\n other: \"916-006-000-000-000-000-000\",\n} as const;\n\nexport type EmergencyContactCallReasonKey = keyof typeof EmergencyContactCallReasonKeys;\n\n/**\n * Key → positional code map for the `emergency_contact_permissions` CVC domain.\n *\n * Domain: `emergency_contact_permissions` · Version: 1.0.0 · Entries: 12\n */\nexport const EmergencyContactPermissionsKeys = {\n missingness_root: \"917-000-000-000-000-000-000\",\n unknown: \"917-000-000-000-000-000-001\",\n anonymous: \"917-000-000-000-000-000-002\",\n data_not_collected: \"917-000-000-000-000-000-003\",\n may_be_told_of_status: \"917-001-000-000-000-000-000\",\n may_receive_location: \"917-002-000-000-000-000-000\",\n may_pickup_children: \"917-003-000-000-000-000-000\",\n may_pickup_pets: \"917-004-000-000-000-000-000\",\n may_pickup_mail: \"917-005-000-000-000-000-000\",\n may_pickup_belongings: \"917-006-000-000-000-000-000\",\n may_act_on_clients_behalf_general: \"917-007-000-000-000-000-000\",\n may_make_medical_decisions: \"917-008-000-000-000-000-000\",\n} as const;\n\nexport type EmergencyContactPermissionsKey = keyof typeof EmergencyContactPermissionsKeys;\n\n/**\n * Key → positional code map for the `emergency_exit_cascade` CVC domain.\n *\n * Domain: `emergency_exit_cascade` · Version: 1.0.0 · Entries: 8\n */\nexport const EmergencyExitCascadeKeys = {\n missingness_root: \"918-000-000-000-000-000-000\",\n unknown: \"918-000-000-000-000-000-001\",\n anonymous: \"918-000-000-000-000-000-002\",\n data_not_collected: \"918-000-000-000-000-000-003\",\n safety_plan_updated: \"918-001-000-000-000-000-000\",\n emergency_contacts_notified: \"918-002-000-000-000-000-000\",\n destination_confidential: \"918-003-000-000-000-000-000\",\n risk_algo_reevaluated: \"918-004-000-000-000-000-000\",\n} as const;\n\nexport type EmergencyExitCascadeKey = keyof typeof EmergencyExitCascadeKeys;\n\n/**\n * Key → positional code map for the `exit_process_checklist_item` CVC domain.\n *\n * Domain: `exit_process_checklist_item` · Version: 1.0.0 · Entries: 15\n */\nexport const ExitProcessChecklistItemKeys = {\n missingness_root: \"919-000-000-000-000-000-000\",\n unknown: \"919-000-000-000-000-000-001\",\n anonymous: \"919-000-000-000-000-000-002\",\n data_not_collected: \"919-000-000-000-000-000-003\",\n discuss_exit_reasons: \"919-001-000-000-000-000-000\",\n locks_returned: \"919-002-000-000-000-000-000\",\n evaluation_form_sent: \"919-003-000-000-000-000-000\",\n forwarding_address_requested: \"919-004-000-000-000-000-000\",\n spiritual_care_offered: \"919-005-000-000-000-000-000\",\n schools_notified: \"919-006-000-000-000-000-000\",\n counselor_notified: \"919-007-000-000-000-000-000\",\n whiteboard_locker_erased: \"919-008-000-000-000-000-000\",\n team_discharge_informed: \"919-009-000-000-000-000-000\",\n room_turnover_form_completed: \"919-010-000-000-000-000-000\",\n other: \"919-011-000-000-000-000-000\",\n} as const;\n\nexport type ExitProcessChecklistItemKey = keyof typeof ExitProcessChecklistItemKeys;\n\n/**\n * Key → positional code map for the `facial_hair` CVC domain.\n *\n * Domain: `facial_hair` · Version: 1.0.0 · Entries: 6\n */\nexport const FacialHairKeys = {\n missingness_root: \"920-000-000-000-000-000-000\",\n unknown: \"920-000-000-000-000-000-001\",\n anonymous: \"920-000-000-000-000-000-002\",\n data_not_collected: \"920-000-000-000-000-000-003\",\n yes: \"920-001-000-000-000-000-000\",\n no: \"920-002-000-000-000-000-000\",\n} as const;\n\nexport type FacialHairKey = keyof typeof FacialHairKeys;\n\n/**\n * Key → positional code map for the `goal_category` CVC domain.\n *\n * Domain: `goal_category` · Version: 1.0.0 · Entries: 16\n */\nexport const GoalCategoryKeys = {\n missingness_root: \"921-000-000-000-000-000-000\",\n unknown: \"921-000-000-000-000-000-001\",\n anonymous: \"921-000-000-000-000-000-002\",\n data_not_collected: \"921-000-000-000-000-000-003\",\n basic_needs: \"921-001-000-000-000-000-000\",\n housing: \"921-002-000-000-000-000-000\",\n social_support_community_engagement: \"921-003-000-000-000-000-000\",\n transportation: \"921-004-000-000-000-000-000\",\n legal: \"921-005-000-000-000-000-000\",\n healthcare: \"921-006-000-000-000-000-000\",\n financial_and_employment: \"921-007-000-000-000-000-000\",\n informal_education_life_skills: \"921-008-000-000-000-000-000\",\n dependents: \"921-009-000-000-000-000-000\",\n case_coordination: \"921-010-000-000-000-000-000\",\n other_services: \"921-011-000-000-000-000-000\",\n safety: \"921-012-000-000-000-000-000\",\n} as const;\n\nexport type GoalCategoryKey = keyof typeof GoalCategoryKeys;\n\n/**\n * Key → positional code map for the `goal_priority` CVC domain.\n *\n * Domain: `goal_priority` · Version: 1.0.0 · Entries: 7\n */\nexport const GoalPriorityKeys = {\n missingness_root: \"922-000-000-000-000-000-000\",\n unknown: \"922-000-000-000-000-000-001\",\n anonymous: \"922-000-000-000-000-000-002\",\n data_not_collected: \"922-000-000-000-000-000-003\",\n high: \"922-001-000-000-000-000-000\",\n medium: \"922-002-000-000-000-000-000\",\n low: \"922-003-000-000-000-000-000\",\n} as const;\n\nexport type GoalPriorityKey = keyof typeof GoalPriorityKeys;\n\n/**\n * Key → positional code map for the `goal_status` CVC domain.\n *\n * Domain: `goal_status` · Version: 1.0.0 · Entries: 9\n */\nexport const GoalStatusKeys = {\n missingness_root: \"923-000-000-000-000-000-000\",\n unknown: \"923-000-000-000-000-000-001\",\n anonymous: \"923-000-000-000-000-000-002\",\n data_not_collected: \"923-000-000-000-000-000-003\",\n drafted: \"923-001-000-000-000-000-000\",\n in_progress: \"923-002-000-000-000-000-000\",\n on_hold: \"923-003-000-000-000-000-000\",\n completed: \"923-004-000-000-000-000-000\",\n withdrawn: \"923-005-000-000-000-000-000\",\n} as const;\n\nexport type GoalStatusKey = keyof typeof GoalStatusKeys;\n\n/**\n * Key → positional code map for the `goal_withdrawal_reason` CVC domain.\n *\n * Domain: `goal_withdrawal_reason` · Version: 1.0.0 · Entries: 11\n */\nexport const GoalWithdrawalReasonKeys = {\n missingness_root: \"924-000-000-000-000-000-000\",\n unknown: \"924-000-000-000-000-000-001\",\n anonymous: \"924-000-000-000-000-000-002\",\n data_not_collected: \"924-000-000-000-000-000-003\",\n client_changed_priorities: \"924-001-000-000-000-000-000\",\n no_longer_relevant: \"924-002-000-000-000-000-000\",\n external_barrier_insurmountable: \"924-003-000-000-000-000-000\",\n alternative_path_chosen: \"924-004-000-000-000-000-000\",\n insufficient_resources: \"924-005-000-000-000-000-000\",\n client_declined_to_specify: \"924-006-000-000-000-000-000\",\n other: \"924-007-000-000-000-000-000\",\n} as const;\n\nexport type GoalWithdrawalReasonKey = keyof typeof GoalWithdrawalReasonKeys;\n\n/**\n * Key → positional code map for the `hope_scale_capture_context` CVC domain.\n *\n * Domain: `hope_scale_capture_context` · Version: 1.0.0 · Entries: 11\n */\nexport const HopeScaleCaptureContextKeys = {\n missingness_root: \"926-000-000-000-000-000-000\",\n unknown: \"926-000-000-000-000-000-001\",\n anonymous: \"926-000-000-000-000-000-002\",\n data_not_collected: \"926-000-000-000-000-000-003\",\n welcome_week: \"926-001-000-000-000-000-000\",\n phase_1_checkin: \"926-002-000-000-000-000-000\",\n phase_2_checkin: \"926-003-000-000-000-000-000\",\n phase_3_checkin: \"926-004-000-000-000-000-000\",\n phase_4_checkin: \"926-005-000-000-000-000-000\",\n ad_hoc: \"926-006-000-000-000-000-000\",\n amendment: \"926-007-000-000-000-000-000\",\n} as const;\n\nexport type HopeScaleCaptureContextKey = keyof typeof HopeScaleCaptureContextKeys;\n\n/**\n * Key → positional code map for the `hope_scale_response_options` CVC domain.\n *\n * Domain: `hope_scale_response_options` · Version: 1.0.0 · Entries: 12\n */\nexport const HopeScaleResponseOptionsKeys = {\n missingness_root: \"927-000-000-000-000-000-000\",\n unknown: \"927-000-000-000-000-000-001\",\n anonymous: \"927-000-000-000-000-000-002\",\n data_not_collected: \"927-000-000-000-000-000-003\",\n definitely_false: \"927-001-000-000-000-000-000\",\n mostly_false: \"927-002-000-000-000-000-000\",\n somewhat_false: \"927-003-000-000-000-000-000\",\n slightly_false: \"927-004-000-000-000-000-000\",\n slightly_true: \"927-005-000-000-000-000-000\",\n somewhat_true: \"927-006-000-000-000-000-000\",\n mostly_true: \"927-007-000-000-000-000-000\",\n definitely_true: \"927-008-000-000-000-000-000\",\n} as const;\n\nexport type HopeScaleResponseOptionsKey = keyof typeof HopeScaleResponseOptionsKeys;\n\n/**\n * Key → positional code map for the `hope_scale_tier` CVC domain.\n *\n * Domain: `hope_scale_tier` · Version: 1.0.0 · Entries: 8\n */\nexport const HopeScaleTierKeys = {\n missingness_root: \"928-000-000-000-000-000-000\",\n unknown: \"928-000-000-000-000-000-001\",\n anonymous: \"928-000-000-000-000-000-002\",\n data_not_collected: \"928-000-000-000-000-000-003\",\n building: \"928-001-000-000-000-000-000\",\n hopeful: \"928-002-000-000-000-000-000\",\n moderately_hopeful: \"928-003-000-000-000-000-000\",\n high_hope: \"928-004-000-000-000-000-000\",\n} as const;\n\nexport type HopeScaleTierKey = keyof typeof HopeScaleTierKeys;\n\n/**\n * Key → positional code map for the `identification_status` CVC domain.\n *\n * Domain: `identification_status` · Version: 1.0.0 · Entries: 9\n */\nexport const IdentificationStatusKeys = {\n missingness_root: \"929-000-000-000-000-000-000\",\n unknown: \"929-000-000-000-000-000-001\",\n anonymous: \"929-000-000-000-000-000-002\",\n data_not_collected: \"929-000-000-000-000-000-003\",\n identified: \"929-001-000-000-000-000-000\",\n unidentified: \"929-002-000-000-000-000-000\",\n anonymous_posture: \"929-003-000-000-000-000-000\",\n estimated_persona: \"929-004-000-000-000-000-000\",\n confirmed: \"929-005-000-000-000-000-000\",\n} as const;\n\nexport type IdentificationStatusKey = keyof typeof IdentificationStatusKeys;\n\n/**\n * Key → positional code map for the `investigative_request_type` CVC domain.\n *\n * Domain: `investigative_request_type` · Version: 1.0.0 · Entries: 8\n */\nexport const InvestigativeRequestTypeKeys = {\n missingness_root: \"931-000-000-000-000-000-000\",\n unknown: \"931-000-000-000-000-000-001\",\n anonymous: \"931-000-000-000-000-000-002\",\n data_not_collected: \"931-000-000-000-000-000-003\",\n request_a_lead: \"931-001-000-000-000-000-000\",\n ask_about_a_network: \"931-002-000-000-000-000-000\",\n submit_case_info_for_buildout: \"931-003-000-000-000-000-000\",\n other: \"931-004-000-000-000-000-000\",\n} as const;\n\nexport type InvestigativeRequestTypeKey = keyof typeof InvestigativeRequestTypeKeys;\n\n/**\n * Key → positional code map for the `le_report_status` CVC domain.\n *\n * Domain: `le_report_status` · Version: 1.0.0 · Entries: 8\n */\nexport const LeReportStatusKeys = {\n missingness_root: \"932-000-000-000-000-000-000\",\n unknown: \"932-000-000-000-000-000-001\",\n anonymous: \"932-000-000-000-000-000-002\",\n data_not_collected: \"932-000-000-000-000-000-003\",\n yes_reported: \"932-001-000-000-000-000-000\",\n no_not_reported: \"932-002-000-000-000-000-000\",\n scheduled: \"932-003-000-000-000-000-000\",\n declined_to_report: \"932-004-000-000-000-000-000\",\n} as const;\n\nexport type LeReportStatusKey = keyof typeof LeReportStatusKeys;\n\n/**\n * Key → positional code map for the `legal_action_type` CVC domain.\n *\n * Domain: `legal_action_type` · Version: 1.0.0 · Entries: 11\n */\nexport const LegalActionTypeKeys = {\n missingness_root: \"933-000-000-000-000-000-000\",\n unknown: \"933-000-000-000-000-000-001\",\n anonymous: \"933-000-000-000-000-000-002\",\n data_not_collected: \"933-000-000-000-000-000-003\",\n continued_presence: \"933-001-000-000-000-000-000\",\n t_visa: \"933-002-000-000-000-000-000\",\n u_visa: \"933-003-000-000-000-000-000\",\n vawa_self_petition: \"933-004-000-000-000-000-000\",\n asylum: \"933-005-000-000-000-000-000\",\n sij: \"933-006-000-000-000-000-000\",\n other: \"933-007-000-000-000-000-000\",\n} as const;\n\nexport type LegalActionTypeKey = keyof typeof LegalActionTypeKeys;\n\n/**\n * Key → positional code map for the `message_report_reason` CVC domain.\n *\n * Domain: `message_report_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const MessageReportReasonKeys = {\n missingness_root: \"935-000-000-000-000-000-000\",\n unknown: \"935-000-000-000-000-000-001\",\n anonymous: \"935-000-000-000-000-000-002\",\n data_not_collected: \"935-000-000-000-000-000-003\",\n inappropriate: \"935-001-000-000-000-000-000\",\n harassment: \"935-002-000-000-000-000-000\",\n safety_concern: \"935-003-000-000-000-000-000\",\n spam: \"935-004-000-000-000-000-000\",\n off_topic: \"935-005-000-000-000-000-000\",\n other: \"935-006-000-000-000-000-000\",\n} as const;\n\nexport type MessageReportReasonKey = keyof typeof MessageReportReasonKeys;\n\n/**\n * Key → positional code map for the `milestone_type` CVC domain.\n *\n * Domain: `milestone_type` · Version: 1.0.0 · Entries: 17\n */\nexport const MilestoneTypeKeys = {\n missingness_root: \"936-000-000-000-000-000-000\",\n unknown: \"936-000-000-000-000-000-001\",\n anonymous: \"936-000-000-000-000-000-002\",\n data_not_collected: \"936-000-000-000-000-000-003\",\n edu_grade_complete: \"936-001-000-000-000-000-000\",\n edu_ged_hs_diploma: \"936-002-000-000-000-000-000\",\n edu_higher_ed_degree: \"936-003-000-000-000-000-000\",\n edu_trade_school_degree: \"936-004-000-000-000-000-000\",\n obtained_employment: \"936-005-000-000-000-000-000\",\n received_housing_offer: \"936-006-000-000-000-000-000\",\n recovery_anniversary: \"936-007-000-000-000-000-000\",\n parenting_class_completed: \"936-008-000-000-000-000-000\",\n opened_bank_account: \"936-009-000-000-000-000-000\",\n baptism: \"936-010-000-000-000-000-000\",\n spiritual_decision: \"936-011-000-000-000-000-000\",\n baby_child_youth_dedication: \"936-012-000-000-000-000-000\",\n other: \"936-013-000-000-000-000-000\",\n} as const;\n\nexport type MilestoneTypeKey = keyof typeof MilestoneTypeKeys;\n\n/**\n * Key → positional code map for the `needs_residential_again` CVC domain.\n *\n * Domain: `needs_residential_again` · Version: 1.0.0 · Entries: 7\n */\nexport const NeedsResidentialAgainKeys = {\n missingness_root: \"937-000-000-000-000-000-000\",\n unknown: \"937-000-000-000-000-000-001\",\n anonymous: \"937-000-000-000-000-000-002\",\n data_not_collected: \"937-000-000-000-000-000-003\",\n yes: \"937-001-000-000-000-000-000\",\n no: \"937-002-000-000-000-000-000\",\n maybe: \"937-003-000-000-000-000-000\",\n} as const;\n\nexport type NeedsResidentialAgainKey = keyof typeof NeedsResidentialAgainKeys;\n\n/**\n * Key → positional code map for the `pet_relationship_basis` CVC domain.\n *\n * Domain: `pet_relationship_basis` · Version: 1.0.0 · Entries: 7\n */\nexport const PetRelationshipBasisKeys = {\n missingness_root: \"938-000-000-000-000-000-000\",\n unknown: \"938-000-000-000-000-000-001\",\n anonymous: \"938-000-000-000-000-000-002\",\n data_not_collected: \"938-000-000-000-000-000-003\",\n household_pet: \"938-001-000-000-000-000-000\",\n service_animal: \"938-002-000-000-000-000-000\",\n fostered: \"938-003-000-000-000-000-000\",\n} as const;\n\nexport type PetRelationshipBasisKey = keyof typeof PetRelationshipBasisKeys;\n\n/**\n * Key → positional code map for the `program_specific_code` CVC domain.\n *\n * Domain: `program_specific_code` · Version: 1.0.0 · Entries: 12\n */\nexport const ProgramSpecificCodeKeys = {\n missingness_root: \"940-000-000-000-000-000-000\",\n unknown: \"940-000-000-000-000-000-001\",\n anonymous: \"940-000-000-000-000-000-002\",\n data_not_collected: \"940-000-000-000-000-000-003\",\n tvap: \"940-001-000-000-000-000-000\",\n t_visa_legal_aid_program: \"940-002-000-000-000-000-000\",\n u_visa_legal_aid_program: \"940-003-000-000-000-000-000\",\n vawa_legal_aid_program: \"940-004-000-000-000-000-000\",\n asylum_legal_aid_program: \"940-005-000-000-000-000-000\",\n sij_legal_aid_program: \"940-006-000-000-000-000-000\",\n immigration_relief_program_other: \"940-007-000-000-000-000-000\",\n other: \"940-008-000-000-000-000-000\",\n} as const;\n\nexport type ProgramSpecificCodeKey = keyof typeof ProgramSpecificCodeKeys;\n\n/**\n * Key → positional code map for the `proof_of_id_type` CVC domain.\n *\n * Domain: `proof_of_id_type` · Version: 1.0.0 · Entries: 19\n */\nexport const ProofOfIdTypeKeys = {\n missingness_root: \"941-000-000-000-000-000-000\",\n unknown: \"941-000-000-000-000-000-001\",\n anonymous: \"941-000-000-000-000-000-002\",\n data_not_collected: \"941-000-000-000-000-000-003\",\n none: \"941-001-000-000-000-000-000\",\n passport_us: \"941-002-000-000-000-000-000\",\n drivers_license: \"941-003-000-000-000-000-000\",\n state_id: \"941-004-000-000-000-000-000\",\n military_id: \"941-005-000-000-000-000-000\",\n tribal_id: \"941-006-000-000-000-000-000\",\n uscis_document: \"941-007-000-000-000-000-000\",\n green_card: \"941-008-000-000-000-000-000\",\n foreign_passport: \"941-009-000-000-000-000-000\",\n foreign_national_id: \"941-010-000-000-000-000-000\",\n consular_id: \"941-011-000-000-000-000-000\",\n birth_certificate: \"941-012-000-000-000-000-000\",\n social_security_card: \"941-013-000-000-000-000-000\",\n school_id: \"941-014-000-000-000-000-000\",\n other: \"941-015-000-000-000-000-000\",\n} as const;\n\nexport type ProofOfIdTypeKey = keyof typeof ProofOfIdTypeKeys;\n\n/**\n * Key → positional code map for the `reference_link_type` CVC domain.\n *\n * Domain: `reference_link_type` · Version: 1.0.0 · Entries: 12\n */\nexport const ReferenceLinkTypeKeys = {\n missingness_root: \"942-000-000-000-000-000-000\",\n unknown: \"942-000-000-000-000-000-001\",\n anonymous: \"942-000-000-000-000-000-002\",\n data_not_collected: \"942-000-000-000-000-000-003\",\n case: \"942-001-000-000-000-000-000\",\n service: \"942-002-000-000-000-000-000\",\n working_group: \"942-003-000-000-000-000-000\",\n training: \"942-004-000-000-000-000-000\",\n agency: \"942-005-000-000-000-000-000\",\n share: \"942-006-000-000-000-000-000\",\n user: \"942-007-000-000-000-000-000\",\n thread: \"942-008-000-000-000-000-000\",\n} as const;\n\nexport type ReferenceLinkTypeKey = keyof typeof ReferenceLinkTypeKeys;\n\n/**\n * Key → positional code map for the `returned_to_abuser_status` CVC domain.\n *\n * Domain: `returned_to_abuser_status` · Version: 1.0.0 · Entries: 7\n */\nexport const ReturnedToAbuserStatusKeys = {\n missingness_root: \"944-000-000-000-000-000-000\",\n unknown: \"944-000-000-000-000-000-001\",\n anonymous: \"944-000-000-000-000-000-002\",\n data_not_collected: \"944-000-000-000-000-000-003\",\n yes: \"944-001-000-000-000-000-000\",\n no: \"944-002-000-000-000-000-000\",\n unanswered: \"944-003-000-000-000-000-000\",\n} as const;\n\nexport type ReturnedToAbuserStatusKey = keyof typeof ReturnedToAbuserStatusKeys;\n\n/**\n * Key → positional code map for the `rsvp_response` CVC domain.\n *\n * Domain: `rsvp_response` · Version: 1.0.0 · Entries: 7\n */\nexport const RsvpResponseKeys = {\n missingness_root: \"946-000-000-000-000-000-000\",\n unknown: \"946-000-000-000-000-000-001\",\n anonymous: \"946-000-000-000-000-000-002\",\n data_not_collected: \"946-000-000-000-000-000-003\",\n rsvp_yes: \"946-001-000-000-000-000-000\",\n rsvp_maybe: \"946-002-000-000-000-000-000\",\n rsvp_no: \"946-003-000-000-000-000-000\",\n} as const;\n\nexport type RsvpResponseKey = keyof typeof RsvpResponseKeys;\n\n/**\n * Key → positional code map for the `service_plan_closure_reason` CVC domain.\n *\n * Domain: `service_plan_closure_reason` · Version: 1.0.0 · Entries: 12\n */\nexport const ServicePlanClosureReasonKeys = {\n missingness_root: \"947-000-000-000-000-000-000\",\n unknown: \"947-000-000-000-000-000-001\",\n anonymous: \"947-000-000-000-000-000-002\",\n data_not_collected: \"947-000-000-000-000-000-003\",\n program_exit_goals_reached: \"947-001-000-000-000-000-000\",\n program_exit_incomplete: \"947-002-000-000-000-000-000\",\n transferred: \"947-003-000-000-000-000-000\",\n aged_out: \"947-004-000-000-000-000-000\",\n lost_contact: \"947-005-000-000-000-000-000\",\n survivor_withdrew: \"947-006-000-000-000-000-000\",\n agency_terminated: \"947-007-000-000-000-000-000\",\n other: \"947-008-000-000-000-000-000\",\n} as const;\n\nexport type ServicePlanClosureReasonKey = keyof typeof ServicePlanClosureReasonKeys;\n\n/**\n * Key → positional code map for the `service_plan_review_snooze_reason` CVC domain.\n *\n * Domain: `service_plan_review_snooze_reason` · Version: 1.0.0 · Entries: 11\n */\nexport const ServicePlanReviewSnoozeReasonKeys = {\n missingness_root: \"948-000-000-000-000-000-000\",\n unknown: \"948-000-000-000-000-000-001\",\n anonymous: \"948-000-000-000-000-000-002\",\n data_not_collected: \"948-000-000-000-000-000-003\",\n survivor_unreachable: \"948-001-000-000-000-000-000\",\n schedule_conflict: \"948-002-000-000-000-000-000\",\n survivor_traveling_or_out_of_contact: \"948-003-000-000-000-000-000\",\n advocate_caseload_spike: \"948-004-000-000-000-000-000\",\n safety_circumstance: \"948-005-000-000-000-000-000\",\n awaiting_information_from_external_party: \"948-006-000-000-000-000-000\",\n other: \"948-007-000-000-000-000-000\",\n} as const;\n\nexport type ServicePlanReviewSnoozeReasonKey = keyof typeof ServicePlanReviewSnoozeReasonKeys;\n\n/**\n * Key → positional code map for the `service_source` CVC domain.\n *\n * Domain: `service_source` · Version: 1.0.0 · Entries: 6\n */\nexport const ServiceSourceKeys = {\n missingness_root: \"949-000-000-000-000-000-000\",\n unknown: \"949-000-000-000-000-000-001\",\n anonymous: \"949-000-000-000-000-000-002\",\n data_not_collected: \"949-000-000-000-000-000-003\",\n your_program: \"949-001-000-000-000-000-000\",\n other_agency: \"949-002-000-000-000-000-000\",\n} as const;\n\nexport type ServiceSourceKey = keyof typeof ServiceSourceKeys;\n\n/**\n * Key → positional code map for the `severity_follow_up` CVC domain.\n *\n * Domain: `severity_follow_up` · Version: 1.0.0 · Entries: 8\n */\nexport const SeverityFollowUpKeys = {\n missingness_root: \"951-000-000-000-000-000-000\",\n unknown: \"951-000-000-000-000-000-001\",\n anonymous: \"951-000-000-000-000-000-002\",\n data_not_collected: \"951-000-000-000-000-000-003\",\n yes: \"951-001-000-000-000-000-000\",\n no: \"951-002-000-000-000-000-000\",\n client_doesnt_know: \"951-003-000-000-000-000-000\",\n prefer_not_to_answer: \"951-004-000-000-000-000-000\",\n} as const;\n\nexport type SeverityFollowUpKey = keyof typeof SeverityFollowUpKeys;\n\n/**\n * Key → positional code map for the `signature_method` CVC domain.\n *\n * Domain: `signature_method` · Version: 1.0.0 · Entries: 8\n */\nexport const SignatureMethodKeys = {\n missingness_root: \"952-000-000-000-000-000-000\",\n unknown: \"952-000-000-000-000-000-001\",\n anonymous: \"952-000-000-000-000-000-002\",\n data_not_collected: \"952-000-000-000-000-000-003\",\n digital_typed: \"952-001-000-000-000-000-000\",\n digital_drawn: \"952-002-000-000-000-000-000\",\n verbal_recorded: \"952-003-000-000-000-000-000\",\n written_scanned: \"952-004-000-000-000-000-000\",\n} as const;\n\nexport type SignatureMethodKey = keyof typeof SignatureMethodKeys;\n\n/**\n * Key → positional code map for the `signature_type` CVC domain.\n *\n * Domain: `signature_type` · Version: 1.0.0 · Entries: 8\n */\nexport const SignatureTypeKeys = {\n missingness_root: \"953-000-000-000-000-000-000\",\n unknown: \"953-000-000-000-000-000-001\",\n anonymous: \"953-000-000-000-000-000-002\",\n data_not_collected: \"953-000-000-000-000-000-003\",\n client_at_creation: \"953-001-000-000-000-000-000\",\n advocate_at_creation: \"953-002-000-000-000-000-000\",\n client_at_completion: \"953-003-000-000-000-000-000\",\n advocate_at_completion: \"953-004-000-000-000-000-000\",\n} as const;\n\nexport type SignatureTypeKey = keyof typeof SignatureTypeKeys;\n\n/**\n * Key → positional code map for the `smt_body_location` CVC domain.\n *\n * Domain: `smt_body_location` · Version: 1.0.0 · Entries: 33\n */\nexport const SmtBodyLocationKeys = {\n missingness_root: \"954-000-000-000-000-000-000\",\n unknown: \"954-000-000-000-000-000-001\",\n anonymous: \"954-000-000-000-000-000-002\",\n data_not_collected: \"954-000-000-000-000-000-003\",\n head: \"954-001-000-000-000-000-000\",\n face: \"954-002-000-000-000-000-000\",\n scalp: \"954-003-000-000-000-000-000\",\n neck: \"954-004-000-000-000-000-000\",\n ear_l: \"954-005-000-000-000-000-000\",\n ear_r: \"954-006-000-000-000-000-000\",\n chest: \"954-007-000-000-000-000-000\",\n back: \"954-008-000-000-000-000-000\",\n abdomen: \"954-009-000-000-000-000-000\",\n shoulder_l: \"954-010-000-000-000-000-000\",\n shoulder_r: \"954-011-000-000-000-000-000\",\n arm_l: \"954-012-000-000-000-000-000\",\n arm_r: \"954-013-000-000-000-000-000\",\n wrist_l: \"954-014-000-000-000-000-000\",\n wrist_r: \"954-015-000-000-000-000-000\",\n hand_l: \"954-016-000-000-000-000-000\",\n hand_r: \"954-017-000-000-000-000-000\",\n finger_l: \"954-018-000-000-000-000-000\",\n finger_r: \"954-019-000-000-000-000-000\",\n leg_l: \"954-020-000-000-000-000-000\",\n leg_r: \"954-021-000-000-000-000-000\",\n ankle_l: \"954-022-000-000-000-000-000\",\n ankle_r: \"954-023-000-000-000-000-000\",\n foot_l: \"954-024-000-000-000-000-000\",\n foot_r: \"954-025-000-000-000-000-000\",\n hip_l: \"954-026-000-000-000-000-000\",\n hip_r: \"954-027-000-000-000-000-000\",\n buttocks: \"954-028-000-000-000-000-000\",\n other: \"954-029-000-000-000-000-000\",\n} as const;\n\nexport type SmtBodyLocationKey = keyof typeof SmtBodyLocationKeys;\n\n/**\n * Key → positional code map for the `smt_name_relation` CVC domain.\n *\n * Domain: `smt_name_relation` · Version: 1.0.0 · Entries: 11\n */\nexport const SmtNameRelationKeys = {\n missingness_root: \"955-000-000-000-000-000-000\",\n unknown: \"955-000-000-000-000-000-001\",\n anonymous: \"955-000-000-000-000-000-002\",\n data_not_collected: \"955-000-000-000-000-000-003\",\n self: \"955-001-000-000-000-000-000\",\n child: \"955-002-000-000-000-000-000\",\n partner: \"955-003-000-000-000-000-000\",\n other_family: \"955-004-000-000-000-000-000\",\n trafficker: \"955-005-000-000-000-000-000\",\n deceased: \"955-006-000-000-000-000-000\",\n other_relation: \"955-007-000-000-000-000-000\",\n} as const;\n\nexport type SmtNameRelationKey = keyof typeof SmtNameRelationKeys;\n\n/**\n * Key → positional code map for the `smt_significance_flags` CVC domain.\n *\n * Domain: `smt_significance_flags` · Version: 1.0.0 · Entries: 11\n */\nexport const SmtSignificanceFlagsKeys = {\n missingness_root: \"956-000-000-000-000-000-000\",\n unknown: \"956-000-000-000-000-000-001\",\n anonymous: \"956-000-000-000-000-000-002\",\n data_not_collected: \"956-000-000-000-000-000-003\",\n gang: \"956-001-000-000-000-000-000\",\n trafficking: \"956-002-000-000-000-000-000\",\n name: \"956-003-000-000-000-000-000\",\n memorial: \"956-004-000-000-000-000-000\",\n religious_cultural: \"956-005-000-000-000-000-000\",\n other: \"956-006-000-000-000-000-000\",\n none_non_specific: \"956-007-000-000-000-000-000\",\n} as const;\n\nexport type SmtSignificanceFlagsKey = keyof typeof SmtSignificanceFlagsKeys;\n\n/**\n * Key → positional code map for the `substance_use_status` CVC domain.\n *\n * Domain: `substance_use_status` · Version: 1.0.0 · Entries: 8\n */\nexport const SubstanceUseStatusKeys = {\n missingness_root: \"958-000-000-000-000-000-000\",\n unknown: \"958-000-000-000-000-000-001\",\n anonymous: \"958-000-000-000-000-000-002\",\n data_not_collected: \"958-000-000-000-000-000-003\",\n no: \"958-001-000-000-000-000-000\",\n alcohol: \"958-002-000-000-000-000-000\",\n drug: \"958-003-000-000-000-000-000\",\n both: \"958-004-000-000-000-000-000\",\n} as const;\n\nexport type SubstanceUseStatusKey = keyof typeof SubstanceUseStatusKeys;\n\n/**\n * Key → positional code map for the `support_topic` CVC domain.\n *\n * Domain: `support_topic` · Version: 1.0.0 · Entries: 11\n */\nexport const SupportTopicKeys = {\n missingness_root: \"959-000-000-000-000-000-000\",\n unknown: \"959-000-000-000-000-000-001\",\n anonymous: \"959-000-000-000-000-000-002\",\n data_not_collected: \"959-000-000-000-000-000-003\",\n how_to_use_platform: \"959-001-000-000-000-000-000\",\n something_broken: \"959-002-000-000-000-000-000\",\n data_record_issue: \"959-003-000-000-000-000-000\",\n account_access: \"959-004-000-000-000-000-000\",\n request_training: \"959-005-000-000-000-000-000\",\n feature_request: \"959-006-000-000-000-000-000\",\n other: \"959-007-000-000-000-000-000\",\n} as const;\n\nexport type SupportTopicKey = keyof typeof SupportTopicKeys;\n\n/**\n * Key → positional code map for the `thread_status` CVC domain.\n *\n * Domain: `thread_status` · Version: 1.0.0 · Entries: 7\n */\nexport const ThreadStatusKeys = {\n missingness_root: \"960-000-000-000-000-000-000\",\n unknown: \"960-000-000-000-000-000-001\",\n anonymous: \"960-000-000-000-000-000-002\",\n data_not_collected: \"960-000-000-000-000-000-003\",\n open: \"960-001-000-000-000-000-000\",\n resolved: \"960-002-000-000-000-000-000\",\n archived: \"960-003-000-000-000-000-000\",\n} as const;\n\nexport type ThreadStatusKey = keyof typeof ThreadStatusKeys;\n\n/**\n * Key → positional code map for the `thread_type` CVC domain.\n *\n * Domain: `thread_type` · Version: 1.0.0 · Entries: 9\n */\nexport const ThreadTypeKeys = {\n missingness_root: \"961-000-000-000-000-000-000\",\n unknown: \"961-000-000-000-000-000-001\",\n anonymous: \"961-000-000-000-000-000-002\",\n data_not_collected: \"961-000-000-000-000-000-003\",\n support: \"961-001-000-000-000-000-000\",\n community_partner: \"961-002-000-000-000-000-000\",\n working_group: \"961-003-000-000-000-000-000\",\n announcement: \"961-004-000-000-000-000-000\",\n investigative_request: \"961-005-000-000-000-000-000\",\n} as const;\n\nexport type ThreadTypeKey = keyof typeof ThreadTypeKeys;\n\n/**\n * Key → positional code map for the `living_situation` CVC domain.\n *\n * Domain: `living_situation` · Version: 1.0.0 · Entries: 22\n */\nexport const LivingSituationKeys = {\n missingness_root: \"192-000-000-000-000-000-000\",\n unknown: \"192-000-000-000-000-000-001\",\n anonymous: \"192-000-000-000-000-000-002\",\n data_not_collected: \"192-000-000-000-000-000-003\",\n unsheltered: \"192-001-000-000-000-000-000\",\n emergency_shelter: \"192-002-000-000-000-000-000\",\n safe_haven: \"192-003-000-000-000-000-000\",\n dv_shelter_safe_house: \"192-004-000-000-000-000-000\",\n homeless_unspecified: \"192-005-000-000-000-000-000\",\n hospital_medical: \"192-006-000-000-000-000-000\",\n psychiatric_residential_facility: \"192-007-000-000-000-000-000\",\n substance_use_treatment_residential: \"192-008-000-000-000-000-000\",\n incarcerated: \"192-009-000-000-000-000-000\",\n cw_foster_care: \"192-010-000-000-000-000-000\",\n cw_kinship: \"192-011-000-000-000-000-000\",\n long_term_care: \"192-012-000-000-000-000-000\",\n transitional_housing_program: \"192-013-000-000-000-000-000\",\n temp_housing_program: \"192-014-000-000-000-000-000\",\n hotel_motel_non_shelter: \"192-015-000-000-000-000-000\",\n own_rent: \"192-016-000-000-000-000-000\",\n with_family_friends: \"192-017-000-000-000-000-000\",\n other: \"192-018-000-000-000-000-000\",\n} as const;\n\nexport type LivingSituationKey = keyof typeof LivingSituationKeys;\n\n/**\n * Key → positional code map for the `service_audience` CVC domain.\n *\n * Domain: `service_audience` · Version: 1.0.0 · Entries: 9\n */\nexport const ServiceAudienceKeys = {\n missingness_root: \"045-000-000-000-000-000-000\",\n unknown: \"045-000-000-000-000-000-001\",\n anonymous: \"045-000-000-000-000-000-002\",\n data_not_collected: \"045-000-000-000-000-000-003\",\n primary_victim: \"045-001-000-000-000-000-000\",\n eligible_family_member: \"045-002-000-000-000-000-000\",\n third_party: \"045-003-000-000-000-000-000\",\n offender: \"045-004-000-000-000-000-000\",\n personnel: \"045-005-000-000-000-000-000\",\n} as const;\n\nexport type ServiceAudienceKey = keyof typeof ServiceAudienceKeys;\n\n/**\n * Key → positional code map for the `hmis_relationship_to_hoh` CVC domain.\n *\n * Domain: `hmis_relationship_to_hoh` · Version: 1.0.0 · Entries: 9\n */\nexport const HmisRelationshipToHohKeys = {\n missingness_root: \"129-000-000-000-000-000-000\",\n unknown: \"129-000-000-000-000-000-001\",\n anonymous: \"129-000-000-000-000-000-002\",\n data_not_collected: \"129-000-000-000-000-000-003\",\n self_hoh: \"129-001-000-000-000-000-000\",\n child_of_hoh: \"129-002-000-000-000-000-000\",\n spouse_or_partner_of_hoh: \"129-003-000-000-000-000-000\",\n other_relative_of_hoh: \"129-004-000-000-000-000-000\",\n non_relation_member: \"129-005-000-000-000-000-000\",\n} as const;\n\nexport type HmisRelationshipToHohKey = keyof typeof HmisRelationshipToHohKeys;\n\n/**\n * Key → positional code map for the `victim_abuse_types` CVC domain.\n *\n * Domain: `victim_abuse_types` · Version: 1.1.0 · Entries: 30\n */\nexport const VictimAbuseTypesKeys = {\n arson: \"073-003-000-000-000-000-000\",\n bullying: \"073-004-000-000-000-000-000\",\n burglary: \"073-005-000-000-000-000-000\",\n child_pornography: \"073-007-000-000-000-000-000\",\n domestic_family_violence: \"073-009-000-000-000-000-000\",\n dui_dwi_incident: \"073-010-000-000-000-000-000\",\n elder_abuse_or_neglect: \"073-011-000-000-000-000-000\",\n gang_violence: \"073-012-000-000-000-000-000\",\n hate_crime: \"073-013-000-000-000-000-000\",\n homicide: \"073-014-000-000-000-000-000\",\n identity_theft_fraud_financial_crime: \"073-015-000-000-000-000-000\",\n kidnapping_custodial: \"073-016-000-000-000-000-000\",\n kidnapping_noncustodial: \"073-017-000-000-000-000-000\",\n mass_violence: \"073-018-000-000-000-000-000\",\n other_voca_ovc: \"073-019-000-000-000-000-000\",\n other_vehicular_victimization: \"073-020-000-000-000-000-000\",\n robbery: \"073-021-000-000-000-000-000\",\n stalking_harassment: \"073-022-000-000-000-000-000\",\n survivor_of_homicide_victim: \"073-023-000-000-000-000-000\",\n teen_dating_victimization: \"073-024-000-000-000-000-000\",\n terrorism: \"073-025-000-000-000-000-000\",\n sexual_abuse_assault: \"073-026-000-000-000-000-000\",\n physical_abuse_or_neglect: \"073-027-000-000-000-000-000\",\n physical_assault: \"073-028-000-000-000-000-000\",\n commercial_sexual_exploitation_minor: \"073-029-000-000-000-000-000\",\n sexual_exploitation: \"073-030-000-000-000-000-000\",\n labor_exploitation: \"073-031-000-000-000-000-000\",\n female_genital_mutilation_cutting: \"073-032-000-000-000-000-000\",\n forced_marriage: \"073-033-000-000-000-000-000\",\n cyber_crimes: \"073-034-000-000-000-000-000\",\n} as const;\n\nexport type VictimAbuseTypesKey = keyof typeof VictimAbuseTypesKeys;\n\n/**\n * Key → positional code map for the `ht_type` CVC domain.\n *\n * Domain: `ht_type` · Version: 1.0.0 · Entries: 8\n */\nexport const HtTypeKeys = {\n missingness_root: \"072-000-000-000-000-000-000\",\n unknown: \"072-000-000-000-000-000-001\",\n anonymous: \"072-000-000-000-000-000-002\",\n data_not_collected: \"072-000-000-000-000-000-003\",\n sex: \"072-001-000-000-000-000-000\",\n labor: \"072-002-000-000-000-000-000\",\n sex_and_labor: \"072-003-000-000-000-000-000\",\n none: \"072-004-000-000-000-000-000\",\n} as const;\n\nexport type HtTypeKey = keyof typeof HtTypeKeys;\n\n/**\n * Key → positional code map for the `relationship_concern` CVC domain (PROVISIONAL CVC-991 — pending codebook ratification; renumbered from provisional 231 on CVC-231's ratification to the Determination Helper categories, 2026-08-28).\n *\n * Domain: `relationship_concern` · Version: 1.1.0 · Entries: 11\n */\nexport const RelationshipConcernKeys = {\n missingness_root: \"991-000-000-000-000-000-000\",\n unknown: \"991-000-000-000-000-000-001\",\n anonymous: \"991-000-000-000-000-000-002\",\n data_not_collected: \"991-000-000-000-000-000-003\",\n appears_controlling: \"991-001-000-000-000-000-000\",\n is_much_older: \"991-002-000-000-000-000-000\",\n physically_abusive: \"991-003-000-000-000-000-000\",\n emotionally_abusive: \"991-004-000-000-000-000-000\",\n has_legal_involvement: \"991-005-000-000-000-000-000\",\n is_known_trafficker_or_suspect: \"991-006-000-000-000-000-000\",\n other_concern: \"991-007-000-000-000-000-000\",\n} as const;\n\nexport type RelationshipConcernKey = keyof typeof RelationshipConcernKeys;\n\n/**\n * Key → positional code map for the `recency_band` CVC domain (PROVISIONAL CVC-232 — pending codebook ratification).\n *\n * Domain: `recency_band` · Version: 1.0.0 · Entries: 12\n */\nexport const RecencyBandKeys = {\n missingness_root: \"137-000-000-000-000-000-000\",\n unknown: \"137-000-000-000-000-000-001\",\n anonymous: \"137-000-000-000-000-000-002\",\n data_not_collected: \"137-000-000-000-000-000-003\",\n w3m: \"137-001-000-000-000-000-000\",\n m3_6: \"137-002-000-000-000-000-000\",\n m6_12: \"137-003-000-000-000-000-000\",\n y1p: \"137-004-000-000-000-000-000\",\n y1_3: \"137-005-000-000-000-000-000\",\n y3_10: \"137-006-000-000-000-000-000\",\n y10p: \"137-007-000-000-000-000-000\",\n ylt3: \"137-008-000-000-000-000-000\",\n} as const;\n\nexport type RecencyBandKey = keyof typeof RecencyBandKeys;\n\n/**\n * Key → positional code map for the `housing_subsidy_types` CVC domain (CVC-194 `core - housing subsidy types`, IC-73; SOT v2.0.0 re-synced to the live Notion codebook, CVC194-AUDIT). HUD's dependent subsidy-type field (asked only when living situation / destination = 435): the eleven HUD FY2026 list 3.12.A responses + the HTI `other_housing_subsidy` (OTHER) extension + the UNK / ANON / DNC triplet. Each codebook row carries its Notion Code on `canonicalCode` and its 3.12.A value on `hmisCode`; `data_not_collected` is system-stamped only (`neverPickable`). `no_subsidy` is NOT a codebook row: kept live for the needs-assessment subsidy question pending Crysta's ruling (no `canonicalCode`, no HUD value). 2.0.0 REMOVED `project_based_rental_assistance` (194-003 retired, no successor; see `housingSubsidyTypesSot._supersedes`).\n *\n * Domain: `housing_subsidy_types` · Version: 2.0.0 · Entries: 17\n */\nexport const HousingSubsidyTypesKeys = {\n missingness_root: \"194-000-000-000-000-000-000\",\n unknown: \"194-000-000-000-000-000-001\",\n anonymous: \"194-000-000-000-000-000-002\",\n data_not_collected: \"194-000-000-000-000-000-003\",\n housing_choice_voucher: \"194-001-000-000-000-000-000\",\n public_housing: \"194-002-000-000-000-000-000\",\n permanent_supportive_housing: \"194-004-000-000-000-000-000\",\n rapid_rehousing_assistance: \"194-005-000-000-000-000-000\",\n other_housing_subsidy: \"194-006-000-000-000-000-000\",\n no_subsidy: \"194-007-000-000-000-000-000\",\n va_supportive_housing: \"194-008-000-000-000-000-000\",\n grant_per_diem_transition_in_place: \"194-009-000-000-000-000-000\",\n housing_stability_voucher: \"194-010-000-000-000-000-000\",\n family_unification_program: \"194-011-000-000-000-000-000\",\n foster_youth_to_independence: \"194-012-000-000-000-000-000\",\n other_rental_subsidy: \"194-013-000-000-000-000-000\",\n other_formerly_homeless: \"194-014-000-000-000-000-000\",\n} as const;\n\nexport type HousingSubsidyTypesKey = keyof typeof HousingSubsidyTypesKeys;\n\n/**\n * Key → positional code map for the `assertion_domain` CVC domain (CAR assertion domain; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `assertion_domain` · Version: 1.2.3 · Entries: 77\n */\nexport const AssertionDomainKeys = {\n missingness_root: \"159-000-000-000-000-000-000\",\n unknown: \"159-000-000-000-000-000-001\",\n anonymous: \"159-000-000-000-000-000-002\",\n data_not_collected: \"159-000-000-000-000-000-003\",\n indicator: \"159-001-000-000-000-000-000\",\n risk_signal: \"159-002-000-000-000-000-000\",\n victim_status: \"159-003-000-000-000-000-000\",\n offender_status: \"159-004-000-000-000-000-000\",\n domain_determination: \"159-005-000-000-000-000-000\",\n victimization_or_abuse_type: \"159-006-000-000-000-000-000\",\n assessment_scale: \"159-007-000-000-000-000-000\",\n recommended_followup: \"159-008-000-000-000-000-000\",\n relationship: \"159-009-000-000-000-000-000\",\n household_relationships: \"159-010-000-000-000-000-000\",\n relationship_tie: \"159-011-000-000-000-000-000\",\n relationship_dynamics: \"159-012-000-000-000-000-000\",\n relationship_status_current: \"159-013-000-000-000-000-000\",\n marital_status_legal: \"159-014-000-000-000-000-000\",\n core_profile: \"159-015-000-000-000-000-000\",\n person_tile: \"159-016-000-000-000-000-000\",\n person_relationship: \"159-017-000-000-000-000-000\",\n relevant_people: \"159-018-000-000-000-000-000\",\n name: \"159-019-000-000-000-000-000\",\n contact_info: \"159-020-000-000-000-000-000\",\n address: \"159-021-000-000-000-000-000\",\n vehicle: \"159-022-000-000-000-000-000\",\n income_history: \"159-023-000-000-000-000-000\",\n physical_description: \"159-024-000-000-000-000-000\",\n living_situation: \"159-025-000-000-000-000-000\",\n pet: \"159-026-000-000-000-000-000\",\n protection_order: \"159-027-000-000-000-000-000\",\n log_entry: \"159-028-000-000-000-000-000\",\n session_note: \"159-029-000-000-000-000-000\",\n referral_source: \"159-030-000-000-000-000-000\",\n org_directory: \"159-031-000-000-000-000-000\",\n person_directory: \"159-032-000-000-000-000-000\",\n service_delivery: \"159-033-000-000-000-000-000\",\n needs_assessment: \"159-034-000-000-000-000-000\",\n priorities_and_safety: \"159-035-000-000-000-000-000\",\n share: \"159-036-000-000-000-000-000\",\n roi: \"159-037-000-000-000-000-000\",\n external_recipient: \"159-038-000-000-000-000-000\",\n access_accommodations: \"159-039-000-000-000-000-000\",\n danger_assessment: \"159-040-000-000-000-000-000\",\n hope_scale: \"159-041-000-000-000-000-000\",\n injury_and_strangulation: \"159-042-000-000-000-000-000\",\n lethality_assessment_program: \"159-043-000-000-000-000-000\",\n occupational_background: \"159-044-000-000-000-000-000\",\n program_enrollment: \"159-046-000-000-000-000-000\",\n program_enrollment_exit_wizard: \"159-047-000-000-000-000-000\",\n goal: \"159-048-000-000-000-000-000\",\n action_step: \"159-049-000-000-000-000-000\",\n milestone: \"159-050-000-000-000-000-000\",\n check_in: \"159-051-000-000-000-000-000\",\n goal_signature: \"159-052-000-000-000-000-000\",\n subject_functional_role: \"159-053-000-000-000-000-000\",\n worker_subrole: \"159-054-000-000-000-000-000\",\n offender_status_family: \"159-055-000-000-000-000-000\",\n assessment_rating: \"159-056-000-000-000-000-000\",\n immigration_legal_status: \"159-057-000-000-000-000-000\",\n persons_network: \"159-058-000-000-000-000-000\",\n lifecycle_services: \"159-059-000-000-000-000-000\",\n juvenile_justice_involvement: \"159-060-000-000-000-000-000\",\n child_welfare_involvement: \"159-061-000-000-000-000-000\",\n facilitator_role: \"159-062-000-000-000-000-000\",\n facilitator_subrole: \"159-063-000-000-000-000-000\",\n facilitator_entity_type: \"159-064-000-000-000-000-000\",\n child_profile: \"159-065-000-000-000-000-000\",\n signal_identification: \"159-066-000-000-000-000-000\",\n investigative_legal: \"159-067-000-000-000-000-000\",\n age_reporting: \"159-068-000-000-000-000-000\",\n race_ethnicity_reporting: \"159-069-000-000-000-000-000\",\n gender_reporting: \"159-070-000-000-000-000-000\",\n disability_reporting: \"159-071-000-000-000-000-000\",\n veteran_status: \"159-072-000-000-000-000-000\",\n english_proficiency: \"159-073-000-000-000-000-000\",\n birth_country_reporting: \"159-074-000-000-000-000-000\",\n} as const;\n\nexport type AssertionDomainKey = keyof typeof AssertionDomainKeys;\n\n/**\n * Key → positional code map for the `race_ethnicity_reporting` CVC domain (CVC-37 VOCA/OVC race/ethnicity list and its CVC-76 crosswalk; since 2026-11-10 no longer the `race_ethnicity_reporting` claim’s vocabulary — the claim stores the CVC-76 Level-1 codes).\n *\n * Domain: `race_ethnicity_reporting` · Version: 1.0.1 · Entries: 10\n */\nexport const RaceEthnicityReportingKeys = {\n missingness_root: \"037-000-000-000-000-000-000\",\n not_reported: \"037-000-000-000-000-000-001\",\n american_indian_alaska_native: \"037-001-000-000-000-000-000\",\n asian: \"037-002-000-000-000-000-000\",\n black_african_american: \"037-003-000-000-000-000-000\",\n hispanic_latino: \"037-004-000-000-000-000-000\",\n native_hawaiian_pacific_islander: \"037-005-000-000-000-000-000\",\n white: \"037-006-000-000-000-000-000\",\n some_other_race: \"037-007-000-000-000-000-000\",\n multiple_races: \"037-008-000-000-000-000-000\",\n} as const;\n\nexport type RaceEthnicityReportingKey = keyof typeof RaceEthnicityReportingKeys;\n\n/**\n * Key → positional code map for the `veteran_status` CVC domain (CVC-98; demographic reporting rung, 2026-10-30).\n *\n * Domain: `veteran_status` · Version: 1.0.0 · Entries: 6\n */\nexport const VeteranStatusKeys = {\n missingness_root: \"098-000-000-000-000-000-000\",\n unknown: \"098-000-000-000-000-000-001\",\n anonymous: \"098-000-000-000-000-000-002\",\n data_not_collected: \"098-000-000-000-000-000-003\",\n yes: \"098-001-000-000-000-000-000\",\n no: \"098-002-000-000-000-000-000\",\n} as const;\n\nexport type VeteranStatusKey = keyof typeof VeteranStatusKeys;\n\n/**\n * Key → positional code map for the `english_proficiency` CVC domain (CVC-99; demographic reporting rung, 2026-10-30).\n *\n * Domain: `english_proficiency` · Version: 1.0.0 · Entries: 9\n */\nexport const EnglishProficiencyKeys = {\n missingness_root: \"099-000-000-000-000-000-000\",\n unknown: \"099-000-000-000-000-000-001\",\n anon: \"099-000-000-000-000-000-002\",\n dnc: \"099-000-000-000-000-000-003\",\n none: \"099-001-000-000-000-000-000\",\n elementary: \"099-002-000-000-000-000-000\",\n limited_working: \"099-003-000-000-000-000-000\",\n professional: \"099-004-000-000-000-000-000\",\n native_fluent: \"099-005-000-000-000-000-000\",\n} as const;\n\nexport type EnglishProficiencyKey = keyof typeof EnglishProficiencyKeys;\n\n/**\n * Key → positional code map for the `general_disability` CVC domain (CVC-107; demographic reporting rung, 2026-10-30).\n *\n * Domain: `general_disability` · Version: 1.0.1 · Entries: 6\n */\nexport const GeneralDisabilityKeys = {\n missingness_root: \"107-000-000-000-000-000-000\",\n unknown: \"107-000-000-000-000-000-001\",\n anonymous: \"107-000-000-000-000-000-002\",\n data_not_collected: \"107-000-000-000-000-000-003\",\n yes: \"107-001-000-000-000-000-000\",\n no: \"107-002-000-000-000-000-000\",\n} as const;\n\nexport type GeneralDisabilityKey = keyof typeof GeneralDisabilityKeys;\n\n/**\n * Key → positional code map for the `gender_reporting` CVC domain (PROVISIONAL 994 — CVC-159 gender_reporting value rows (roll-up of CVC-17; 1.1.0 adds transgender_woman / transgender_man, 2026-11-10); demographic reporting rung, 2026-10-30).\n *\n * Domain: `gender_reporting` · Version: 1.1.0 · Entries: 9\n */\nexport const GenderReportingKeys = {\n missingness_root: \"994-000-000-000-000-000-000\",\n not_reported: \"994-000-000-000-000-000-001\",\n female: \"994-001-000-000-000-000-000\",\n male: \"994-002-000-000-000-000-000\",\n transgender: \"994-003-000-000-000-000-000\",\n non_binary: \"994-004-000-000-000-000-000\",\n other: \"994-005-000-000-000-000-000\",\n transgender_woman: \"994-006-000-000-000-000-000\",\n transgender_man: \"994-007-000-000-000-000-000\",\n} as const;\n\nexport type GenderReportingKey = keyof typeof GenderReportingKeys;\n\n/**\n * Key → positional code map for the `birth_country_reporting` CVC domain (PROVISIONAL 995 — CVC-159 birth_country_reporting value rows; demographic reporting rung, 2026-10-30).\n *\n * Domain: `birth_country_reporting` · Version: 1.0.0 · Entries: 6\n */\nexport const BirthCountryReportingKeys = {\n missingness_root: \"995-000-000-000-000-000-000\",\n unknown: \"995-000-000-000-000-000-001\",\n anonymous: \"995-000-000-000-000-000-002\",\n data_not_collected: \"995-000-000-000-000-000-003\",\n born_in_us: \"995-001-000-000-000-000-000\",\n born_outside_us: \"995-002-000-000-000-000-000\",\n} as const;\n\nexport type BirthCountryReportingKey = keyof typeof BirthCountryReportingKeys;\n\n/**\n * Key → positional code map for the `disability_reporting` CVC domain (PROVISIONAL 996 — CVC-159 disability_reporting value rows (the CVC-302 category roll-up); re-bound from CVC-107 by Crysta's ruling 2026-11-02).\n *\n * Domain: `disability_reporting` · Version: 1.0.0 · Entries: 11\n */\nexport const DisabilityReportingKeys = {\n missingness_root: \"996-000-000-000-000-000-000\",\n not_reported: \"996-000-000-000-000-000-001\",\n hearing: \"996-001-000-000-000-000-000\",\n vision: \"996-002-000-000-000-000-000\",\n speech: \"996-003-000-000-000-000-000\",\n cognitive_developmental: \"996-004-000-000-000-000-000\",\n physical: \"996-005-000-000-000-000-000\",\n mental: \"996-006-000-000-000-000-000\",\n other: \"996-007-000-000-000-000-000\",\n type_unknown: \"996-008-000-000-000-000-000\",\n no_disability: \"996-009-000-000-000-000-000\",\n} as const;\n\nexport type DisabilityReportingKey = keyof typeof DisabilityReportingKeys;\n\n/**\n * Key → positional code map for the `activity_type` CVC domain (activity type; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `activity_type` · Version: 1.0.0 · Entries: 14\n */\nexport const ActivityTypeKeys = {\n missingness_root: \"965-000-000-000-000-000-000\",\n unknown: \"965-000-000-000-000-000-001\",\n anonymous: \"965-000-000-000-000-000-002\",\n data_not_collected: \"965-000-000-000-000-000-003\",\n resided: \"965-001-000-000-000-000-000\",\n sheltered: \"965-002-000-000-000-000-000\",\n service_delivered: \"965-003-000-000-000-000-000\",\n met: \"965-004-000-000-000-000-000\",\n advertised: \"965-005-000-000-000-000-000\",\n arrested: \"965-006-000-000-000-000-000\",\n visited: \"965-007-000-000-000-000-000\",\n child_welfare_visit: \"965-008-000-000-000-000-000\",\n incident: \"965-009-000-000-000-000-000\",\n other: \"965-010-000-000-000-000-000\",\n} as const;\n\nexport type ActivityTypeKey = keyof typeof ActivityTypeKeys;\n\n/**\n * Key → positional code map for the `provenance_source_id` CVC domain (provenance source id; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `provenance_source_id` · Version: 1.0.0 · Entries: 13\n */\nexport const ProvenanceSourceIdKeys = {\n missingness_root: \"966-000-000-000-000-000-000\",\n unknown: \"966-000-000-000-000-000-001\",\n anonymous: \"966-000-000-000-000-000-002\",\n data_not_collected: \"966-000-000-000-000-000-003\",\n client_self_report: \"966-001-000-000-000-000-000\",\n system_derived_ads: \"966-002-000-000-000-000-000\",\n system_derived_geocoder: \"966-003-000-000-000-000-000\",\n staff_observation: \"966-004-000-000-000-000-000\",\n intake_form: \"966-005-000-000-000-000-000\",\n referral_partner: \"966-006-000-000-000-000-000\",\n law_enforcement: \"966-007-000-000-000-000-000\",\n id_document: \"966-008-000-000-000-000-000\",\n social_profile: \"966-009-000-000-000-000-000\",\n} as const;\n\nexport type ProvenanceSourceIdKey = keyof typeof ProvenanceSourceIdKeys;\n\n/**\n * Key → positional code map for the `radius_bucket` CVC domain (search radius bucket; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `radius_bucket` · Version: 1.0.0 · Entries: 9\n */\nexport const RadiusBucketKeys = {\n missingness_root: \"967-000-000-000-000-000-000\",\n unknown: \"967-000-000-000-000-000-001\",\n anonymous: \"967-000-000-000-000-000-002\",\n data_not_collected: \"967-000-000-000-000-000-003\",\n mi_10: \"967-001-000-000-000-000-000\",\n mi_50: \"967-002-000-000-000-000-000\",\n mi_100: \"967-003-000-000-000-000-000\",\n mi_250: \"967-004-000-000-000-000-000\",\n mi_500: \"967-005-000-000-000-000-000\",\n} as const;\n\nexport type RadiusBucketKey = keyof typeof RadiusBucketKeys;\n\n/**\n * Key → positional code map for the `contact_link_type` CVC domain (contact link type; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `contact_link_type` · Version: 1.0.0 · Entries: 8\n */\nexport const ContactLinkTypeKeys = {\n missingness_root: \"968-000-000-000-000-000-000\",\n unknown: \"968-000-000-000-000-000-001\",\n anonymous: \"968-000-000-000-000-000-002\",\n data_not_collected: \"968-000-000-000-000-000-003\",\n belongs: \"968-001-000-000-000-000-000\",\n associated: \"968-002-000-000-000-000-000\",\n advertises: \"968-003-000-000-000-000-000\",\n contacted: \"968-004-000-000-000-000-000\",\n} as const;\n\nexport type ContactLinkTypeKey = keyof typeof ContactLinkTypeKeys;\n\n/**\n * Key → positional code map for the `suggestion_source` CVC domain (goal suggestion source; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `suggestion_source` · Version: 1.0.0 · Entries: 6\n */\nexport const SuggestionSourceKeys = {\n missingness_root: \"969-000-000-000-000-000-000\",\n unknown: \"969-000-000-000-000-000-001\",\n anonymous: \"969-000-000-000-000-000-002\",\n data_not_collected: \"969-000-000-000-000-000-003\",\n lap: \"969-001-000-000-000-000-000\",\n ps_step_4: \"969-002-000-000-000-000-000\",\n} as const;\n\nexport type SuggestionSourceKey = keyof typeof SuggestionSourceKeys;\n\n/**\n * Key → positional code map for the `roi_method` CVC domain (ROI delivery method; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `roi_method` · Version: 1.0.0 · Entries: 10\n */\nexport const RoiMethodKeys = {\n missingness_root: \"970-000-000-000-000-000-000\",\n unknown: \"970-000-000-000-000-000-001\",\n anonymous: \"970-000-000-000-000-000-002\",\n data_not_collected: \"970-000-000-000-000-000-003\",\n thread_caseshare: \"970-001-000-000-000-000-000\",\n thread_magic_link: \"970-002-000-000-000-000-000\",\n email: \"970-003-000-000-000-000-000\",\n fax: \"970-004-000-000-000-000-000\",\n secure_portal: \"970-005-000-000-000-000-000\",\n in_person: \"970-006-000-000-000-000-000\",\n} as const;\n\nexport type RoiMethodKey = keyof typeof RoiMethodKeys;\n\n/**\n * Key → positional code map for the `session_note_visibility` CVC domain (session-note visibility; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `session_note_visibility` · Version: 1.0.0 · Entries: 7\n */\nexport const SessionNoteVisibilityKeys = {\n missingness_root: \"971-000-000-000-000-000-000\",\n unknown: \"971-000-000-000-000-000-001\",\n anonymous: \"971-000-000-000-000-000-002\",\n data_not_collected: \"971-000-000-000-000-000-003\",\n default: \"971-001-000-000-000-000-000\",\n account: \"971-002-000-000-000-000-000\",\n private: \"971-003-000-000-000-000-000\",\n} as const;\n\nexport type SessionNoteVisibilityKey = keyof typeof SessionNoteVisibilityKeys;\n\n/**\n * Key → positional code map for the `special_needs_disabilities` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `special_needs_disabilities` · Version: 1.0.0 · Entries: 14\n */\nexport const SpecialNeedsDisabilitiesKeys = {\n missingness_root: \"972-000-000-000-000-000-000\",\n unknown: \"972-000-000-000-000-000-001\",\n anonymous: \"972-000-000-000-000-000-002\",\n data_not_collected: \"972-000-000-000-000-000-003\",\n mental_illness: \"972-001-000-000-000-000-000\",\n cognitive_developmental: \"972-002-000-000-000-000-000\",\n physical_disability: \"972-003-000-000-000-000-000\",\n deaf_hard_of_hearing: \"972-004-000-000-000-000-000\",\n chronic_health_condition: \"972-005-000-000-000-000-000\",\n hiv_aids: \"972-006-000-000-000-000-000\",\n alcohol_abuse: \"972-007-000-000-000-000-000\",\n drug_use_abuse: \"972-008-000-000-000-000-000\",\n unknown_but_exists: \"972-009-000-000-000-000-000\",\n other: \"972-010-000-000-000-000-000\",\n} as const;\n\nexport type SpecialNeedsDisabilitiesKey = keyof typeof SpecialNeedsDisabilitiesKeys;\n\n/**\n * Key → positional code map for the `hiv_status` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `hiv_status` · Version: 1.0.0 · Entries: 6\n */\nexport const HivStatusKeys = {\n missingness_root: \"973-000-000-000-000-000-000\",\n unknown: \"973-000-000-000-000-000-001\",\n anonymous: \"973-000-000-000-000-000-002\",\n data_not_collected: \"973-000-000-000-000-000-003\",\n yes: \"973-001-000-000-000-000-000\",\n no: \"973-002-000-000-000-000-000\",\n} as const;\n\nexport type HivStatusKey = keyof typeof HivStatusKeys;\n\n/**\n * Key → positional code map for the `mental_health_status` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `mental_health_status` · Version: 1.0.0 · Entries: 6\n */\nexport const MentalHealthStatusKeys = {\n missingness_root: \"974-000-000-000-000-000-000\",\n unknown: \"974-000-000-000-000-000-001\",\n anonymous: \"974-000-000-000-000-000-002\",\n data_not_collected: \"974-000-000-000-000-000-003\",\n yes: \"974-001-000-000-000-000-000\",\n no: \"974-002-000-000-000-000-000\",\n} as const;\n\nexport type MentalHealthStatusKey = keyof typeof MentalHealthStatusKeys;\n\n/**\n * Key → positional code map for the `child_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `child_change_type` · Version: 1.0.0 · Entries: 15\n */\nexport const ChildChangeTypeKeys = {\n missingness_root: \"976-000-000-000-000-000-000\",\n unknown: \"976-000-000-000-000-000-001\",\n anonymous: \"976-000-000-000-000-000-002\",\n data_not_collected: \"976-000-000-000-000-000-003\",\n child_added: \"976-001-000-000-000-000-000\",\n child_updated: \"976-002-000-000-000-000-000\",\n child_archived: \"976-003-000-000-000-000-000\",\n child_restored: \"976-004-000-000-000-000-000\",\n child_education_updated: \"976-005-000-000-000-000-000\",\n child_health_updated: \"976-006-000-000-000-000-000\",\n child_custody_updated: \"976-007-000-000-000-000-000\",\n child_parental_rights_updated: \"976-008-000-000-000-000-000\",\n child_behavioral_concerns_updated: \"976-009-000-000-000-000-000\",\n child_household_linked: \"976-010-000-000-000-000-000\",\n child_household_unlinked: \"976-011-000-000-000-000-000\",\n} as const;\n\nexport type ChildChangeTypeKey = keyof typeof ChildChangeTypeKeys;\n\n/**\n * Key → positional code map for the `immigration_legal_status_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `immigration_legal_status_change_type` · Version: 1.0.0 · Entries: 14\n */\nexport const ImmigrationLegalStatusChangeTypeKeys = {\n missingness_root: \"977-000-000-000-000-000-000\",\n unknown: \"977-000-000-000-000-000-001\",\n anonymous: \"977-000-000-000-000-000-002\",\n data_not_collected: \"977-000-000-000-000-000-003\",\n immigration_legal_status_section_declined: \"977-001-000-000-000-000-000\",\n immigration_legal_status_section_recaptured: \"977-002-000-000-000-000-000\",\n immigration_visa_captured: \"977-003-000-000-000-000-000\",\n immigration_visa_updated: \"977-004-000-000-000-000-000\",\n identification_status_captured: \"977-005-000-000-000-000-000\",\n identification_status_updated: \"977-006-000-000-000-000-000\",\n le_report_status_captured: \"977-007-000-000-000-000-000\",\n le_report_status_updated: \"977-008-000-000-000-000-000\",\n trafficking_screening_captured: \"977-009-000-000-000-000-000\",\n trafficking_screening_updated: \"977-010-000-000-000-000-000\",\n} as const;\n\nexport type ImmigrationLegalStatusChangeTypeKey = keyof typeof ImmigrationLegalStatusChangeTypeKeys;\n\n/**\n * Key → positional code map for the `program_enrollment_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `program_enrollment_change_type` · Version: 1.0.0 · Entries: 13\n */\nexport const ProgramEnrollmentChangeTypeKeys = {\n missingness_root: \"978-000-000-000-000-000-000\",\n unknown: \"978-000-000-000-000-000-001\",\n anonymous: \"978-000-000-000-000-000-002\",\n data_not_collected: \"978-000-000-000-000-000-003\",\n program_enrollment_drafted: \"978-001-000-000-000-000-000\",\n program_enrollment_submitted: \"978-002-000-000-000-000-000\",\n program_enrollment_approved: \"978-003-000-000-000-000-000\",\n program_enrollment_activated: \"978-004-000-000-000-000-000\",\n program_enrollment_denied: \"978-005-000-000-000-000-000\",\n program_enrollment_closed: \"978-006-000-000-000-000-000\",\n program_enrollment_expired: \"978-007-000-000-000-000-000\",\n program_enrollment_restored: \"978-008-000-000-000-000-000\",\n program_prior_history_captured: \"978-009-000-000-000-000-000\",\n} as const;\n\nexport type ProgramEnrollmentChangeTypeKey = keyof typeof ProgramEnrollmentChangeTypeKeys;\n\n/**\n * Key → positional code map for the `romantic_relationship_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `romantic_relationship_change_type` · Version: 1.0.0 · Entries: 16\n */\nexport const RomanticRelationshipChangeTypeKeys = {\n missingness_root: \"979-000-000-000-000-000-000\",\n unknown: \"979-000-000-000-000-000-001\",\n anonymous: \"979-000-000-000-000-000-002\",\n data_not_collected: \"979-000-000-000-000-000-003\",\n romantic_partner_added: \"979-001-000-000-000-000-000\",\n romantic_partner_updated: \"979-002-000-000-000-000-000\",\n romantic_partner_archived: \"979-003-000-000-000-000-000\",\n romantic_partner_restored: \"979-004-000-000-000-000-000\",\n romantic_partner_ties_changed: \"979-005-000-000-000-000-000\",\n romantic_partner_dynamics_changed: \"979-006-000-000-000-000-000\",\n marital_status_set: \"979-007-000-000-000-000-000\",\n marital_status_changed: \"979-008-000-000-000-000-000\",\n marital_status_declined: \"979-009-000-000-000-000-000\",\n relationship_status_set: \"979-010-000-000-000-000-000\",\n relationship_status_changed: \"979-011-000-000-000-000-000\",\n relationship_status_declined: \"979-012-000-000-000-000-000\",\n} as const;\n\nexport type RomanticRelationshipChangeTypeKey = keyof typeof RomanticRelationshipChangeTypeKeys;\n\n/**\n * Key → positional code map for the `risk_category` CVC domain (DRAFT-TEMPORARY; names sourced from @hti/scoring weights/risk.weights.json, the declared risk-taxonomy SOT. Keys `cat_i`..`cat_ix` mirror PAVE's live `TraCategoryId` union, so this doubles as the canonical crosswalk. Weights/aggregation stay in @hti/scoring).\n *\n * Domain: `risk_category` · Version: 1.0.0 · Entries: 13\n */\nexport const RiskCategoryKeys = {\n missingness_root: \"980-000-000-000-000-000-000\",\n unknown: \"980-000-000-000-000-000-001\",\n anonymous: \"980-000-000-000-000-000-002\",\n data_not_collected: \"980-000-000-000-000-000-003\",\n cat_i: \"980-001-000-000-000-000-000\",\n cat_ii: \"980-002-000-000-000-000-000\",\n cat_iii: \"980-003-000-000-000-000-000\",\n cat_iv: \"980-004-000-000-000-000-000\",\n cat_v: \"980-005-000-000-000-000-000\",\n cat_vi: \"980-006-000-000-000-000-000\",\n cat_vii: \"980-007-000-000-000-000-000\",\n cat_viii: \"980-008-000-000-000-000-000\",\n cat_ix: \"980-009-000-000-000-000-000\",\n} as const;\n\nexport type RiskCategoryKey = keyof typeof RiskCategoryKeys;\n\n/**\n * Key → positional code map for the `core_functions` CVC domain (CANONICAL Notion CVC-133 `core - functions`, Active v2.0 — the Canonical Authorization Model function registry; SOT v1.3.0 is GENERATED from the prototype repo's data/cvcs/core_functions.yaml by scripts/gen-core-functions.py: 113 functions — the 78 published by 1.0.0/1.1.0 at their codes plus 35 appended at 133-079 … 133-113 — the roles → functions → gates/tiers graph is built over. NOT provisional numbering. Each entry carries canon's `v1` / `retired` flags as structured booleans (since 1.3.0, read by the shared authorization resolver); Platform Relevance, user/admin relevance and Category ride the definition suffix; bounds are not carried).\n *\n * Domain: `core_functions` · Version: 1.5.0 · Entries: 117\n */\nexport const CoreFunctionsKeys = {\n missingness_root: \"133-000-000-000-000-000-000\",\n unknown: \"133-000-000-000-000-000-001\",\n anonymous: \"133-000-000-000-000-000-002\",\n data_not_collected: \"133-000-000-000-000-000-003\",\n account_suspend: \"133-001-000-000-000-000-000\",\n aggregate_data_query_generate: \"133-002-000-000-000-000-000\",\n api_key_manage: \"133-003-000-000-000-000-000\",\n assessments_conduct: \"133-004-000-000-000-000-000\",\n audit_anomaly_review: \"133-005-000-000-000-000-000\",\n audit_log_view_member: \"133-006-000-000-000-000-000\",\n audit_log_view_team: \"133-007-000-000-000-000-000\",\n auth_model_manage_platform: \"133-008-000-000-000-000-000\",\n break_glass: \"133-009-000-000-000-000-000\",\n case_assign_reassign: \"133-010-000-000-000-000-000\",\n case_claim: \"133-011-000-000-000-000-000\",\n case_collaborator_add: \"133-012-000-000-000-000-000\",\n case_edit: \"133-013-000-000-000-000-000\",\n case_needs_action_flag_manage: \"133-014-000-000-000-000-000\",\n case_outcomes_edit: \"133-015-000-000-000-000-000\",\n case_purge: \"133-016-000-000-000-000-000\",\n case_reopen: \"133-017-000-000-000-000-000\",\n case_side_panel_use: \"133-018-000-000-000-000-000\",\n case_transfer_bulk: \"133-019-000-000-000-000-000\",\n case_view: \"133-020-000-000-000-000-000\",\n ci_periodic_review: \"133-021-000-000-000-000-000\",\n ci_record_purge_or_retire: \"133-022-000-000-000-000-000\",\n ci_record_validate: \"133-023-000-000-000-000-000\",\n ci_to_evidence_export_authorize: \"133-024-000-000-000-000-000\",\n dashboard_approve_shared: \"133-025-000-000-000-000-000\",\n data_qa_workflow_run: \"133-026-000-000-000-000-000\",\n deconfliction_alert_acknowledge: \"133-027-000-000-000-000-000\",\n determination_perform: \"133-028-000-000-000-000-000\",\n disclose_external: \"133-029-000-000-000-000-000\",\n disclose_external_request: \"133-030-000-000-000-000-000\",\n export_deidentified: \"133-031-000-000-000-000-000\",\n export_disclosure_log_review: \"133-032-000-000-000-000-000\",\n export_template_config_manage: \"133-033-000-000-000-000-000\",\n gov_data_quality_review: \"133-034-000-000-000-000-000\",\n idb_record_create: \"133-035-000-000-000-000-000\",\n incident_response_remediate: \"133-036-000-000-000-000-000\",\n investigation_create_claim: \"133-037-000-000-000-000-000\",\n investigative_database_search: \"133-038-000-000-000-000-000\",\n lead_create: \"133-039-000-000-000-000-000\",\n lead_publish: \"133-040-000-000-000-000-000\",\n magic_link_share_send: \"133-041-000-000-000-000-000\",\n member_account_report_generate: \"133-042-000-000-000-000-000\",\n member_onboarding_support: \"133-043-000-000-000-000-000\",\n open_source_search: \"133-044-000-000-000-000-000\",\n outbound_share_followup_review: \"133-045-000-000-000-000-000\",\n person_association_update: \"133-046-000-000-000-000-000\",\n platform_perm_modify: \"133-047-000-000-000-000-000\",\n platform_policy_enforcement_manage: \"133-048-000-000-000-000-000\",\n record_print: \"133-049-000-000-000-000-000\",\n referral_receive_external: \"133-050-000-000-000-000-000\",\n referral_receive_internal: \"133-051-000-000-000-000-000\",\n referral_send_external: \"133-052-000-000-000-000-000\",\n referral_send_internal: \"133-053-000-000-000-000-000\",\n reporting_dashboard_config_manage: \"133-054-000-000-000-000-000\",\n retention_compliance_review: \"133-055-000-000-000-000-000\",\n roi_submit_manage: \"133-056-000-000-000-000-000\",\n role_assign: \"133-057-000-000-000-000-000\",\n roles_accounts_toggle: \"133-058-000-000-000-000-000\",\n sandbox_environment_manage: \"133-059-000-000-000-000-000\",\n screening_conduct: \"133-060-000-000-000-000-000\",\n screening_view: \"133-061-000-000-000-000-000\",\n security_restrict_apply: \"133-062-000-000-000-000-000\",\n session_create: \"133-063-000-000-000-000-000\",\n share_approve: \"133-064-000-000-000-000-000\",\n share_config: \"133-065-000-000-000-000-000\",\n share_rule_approve_cross_agency: \"133-066-000-000-000-000-000\",\n share_vsp_to_le: \"133-067-000-000-000-000-000\",\n support_ticket_triage: \"133-068-000-000-000-000-000\",\n system_diagnostics_view: \"133-069-000-000-000-000-000\",\n team_config_manage: \"133-070-000-000-000-000-000\",\n team_membership_manage: \"133-071-000-000-000-000-000\",\n team_workflow_config_manage: \"133-072-000-000-000-000-000\",\n thread_share_accept: \"133-073-000-000-000-000-000\",\n thread_share_send: \"133-074-000-000-000-000-000\",\n training_content_upload: \"133-075-000-000-000-000-000\",\n training_gate_manage: \"133-076-000-000-000-000-000\",\n usr_manage: \"133-077-000-000-000-000-000\",\n note_open_departed_author: \"133-078-000-000-000-000-000\",\n agency_info_manage: \"133-079-000-000-000-000-000\",\n srl_manage: \"133-080-000-000-000-000-000\",\n mandatory_report_send: \"133-081-000-000-000-000-000\",\n indicator_manual_add: \"133-082-000-000-000-000-000\",\n message_send: \"133-083-000-000-000-000-000\",\n workgroup_manage: \"133-084-000-000-000-000-000\",\n message_moderate: \"133-085-000-000-000-000-000\",\n announcement_publish: \"133-086-000-000-000-000-000\",\n supervisee_thread_view: \"133-087-000-000-000-000-000\",\n case_status_manage: \"133-088-000-000-000-000-000\",\n enrollment_manage: \"133-089-000-000-000-000-000\",\n exit_discharge_conduct: \"133-090-000-000-000-000-000\",\n goals_plan_manage: \"133-091-000-000-000-000-000\",\n lead_triage_manage: \"133-092-000-000-000-000-000\",\n milestone_log: \"133-093-000-000-000-000-000\",\n needs_priorities_conduct: \"133-094-000-000-000-000-000\",\n profile_domain_edit: \"133-095-000-000-000-000-000\",\n record_activity_view: \"133-096-000-000-000-000-000\",\n service_log_manage: \"133-097-000-000-000-000-000\",\n case_close: \"133-098-000-000-000-000-000\",\n case_visibility_manage: \"133-099-000-000-000-000-000\",\n person_merge_manage: \"133-100-000-000-000-000-000\",\n investigation_session_run: \"133-101-000-000-000-000-000\",\n lead_route_assign: \"133-102-000-000-000-000-000\",\n onboarding_config_sign_off: \"133-103-000-000-000-000-000\",\n hmis_export_generate: \"133-104-000-000-000-000-000\",\n team_share_narrowing: \"133-105-000-000-000-000-000\",\n viewing_config_manage: \"133-106-000-000-000-000-000\",\n network_corpus_access: \"133-107-000-000-000-000-000\",\n viewing_level_1_search: \"133-108-000-000-000-000-000\",\n viewing_level_2_autocomplete: \"133-109-000-000-000-000-000\",\n viewing_level_3_components: \"133-110-000-000-000-000-000\",\n investigative_request_send: \"133-111-000-000-000-000-000\",\n deconfliction_unmask: \"133-112-000-000-000-000-000\",\n share_revoke: \"133-113-000-000-000-000-000\",\n} as const;\n\nexport type CoreFunctionsKey = keyof typeof CoreFunctionsKeys;\n\n/**\n * Key → positional code map for the `needs_assessment_change_type` CVC domain (DRAFT-TEMPORARY; the 9 fine-grained per-mutation Needs-Assessment CAR change types, sourced from PAVE `@pave/domain` NEEDS_ASSESSMENT_CHANGE_TYPES. CASING NORMALIZED: PAVE stores SCREAMING_SNAKE, CVC keys are lower_snake. DISTINCT from the coarse 3-verb section-boundary registry NEEDS_ASSESSMENT_VERB_REGISTRY).\n *\n * Domain: `needs_assessment_change_type` · Version: 1.0.0 · Entries: 13\n */\nexport const NeedsAssessmentChangeTypeKeys = {\n missingness_root: \"982-000-000-000-000-000-000\",\n unknown: \"982-000-000-000-000-000-001\",\n anonymous: \"982-000-000-000-000-000-002\",\n data_not_collected: \"982-000-000-000-000-000-003\",\n answer_recorded: \"982-001-000-000-000-000-000\",\n answer_changed: \"982-002-000-000-000-000-000\",\n answer_cleared: \"982-003-000-000-000-000-000\",\n section_declined: \"982-004-000-000-000-000-000\",\n section_undeclined: \"982-005-000-000-000-000-000\",\n section_submitted: \"982-006-000-000-000-000-000\",\n assessment_submitted: \"982-007-000-000-000-000-000\",\n service_instance_generated: \"982-008-000-000-000-000-000\",\n service_instance_linked: \"982-009-000-000-000-000-000\",\n} as const;\n\nexport type NeedsAssessmentChangeTypeKey = keyof typeof NeedsAssessmentChangeTypeKeys;\n\n/**\n * Key → positional code map for the `service_delivery_change_type` CVC domain (DRAFT-TEMPORARY, PROVISIONAL 997; codebook home owed — no Notion CVC page, no CVC number minted). The 37 kinds of change to a service record, one CAR verb each on the `service_delivery` casework domain: the prototype's `emitServiceInstanceCAR` codes (22 mapped + 15 stored as `svc_<verb>`, prefix removed). Each entry carries `title` (the shared label), `slot`, `allowedDetailKeys` (codes and ids only), `staging` (`session` | `at_act`), `selectable: true` (every entry is a valid value) and `pickable: false` (never offered in a picker). Not the four track-judgment codes that share the domain).\n *\n * Domain: `service_delivery_change_type` · Version: 1.1.0 · Entries: 37\n */\nexport const ServiceDeliveryChangeTypeKeys = {\n instance_added: \"997-001-000-000-000-000-000\",\n service_instance_auto_derived_from_template: \"997-002-000-000-000-000-000\",\n advocacy_auto_instance_created: \"997-003-000-000-000-000-000\",\n specialized_assessments_auto_instance_created: \"997-004-000-000-000-000-000\",\n lifecycle_stamped: \"997-005-000-000-000-000-000\",\n lifecycle_date_changed: \"997-006-000-000-000-000-000\",\n lifecycle_cleared: \"997-007-000-000-000-000-000\",\n instance_reopened: \"997-008-000-000-000-000-000\",\n instance_closed: \"997-009-000-000-000-000-000\",\n instance_removed: \"997-010-000-000-000-000-000\",\n instance_archived: \"997-011-000-000-000-000-000\",\n instance_restored: \"997-012-000-000-000-000-000\",\n instance_tracking_transferred: \"997-013-000-000-000-000-000\",\n instance_tracking_released: \"997-014-000-000-000-000-000\",\n mechanism_set: \"997-015-000-000-000-000-000\",\n mechanism_cleared: \"997-016-000-000-000-000-000\",\n channel_set: \"997-017-000-000-000-000-000\",\n channel_cleared: \"997-018-000-000-000-000-000\",\n source_set: \"997-019-000-000-000-000-000\",\n source_cleared: \"997-020-000-000-000-000-000\",\n source_provider_org_set: \"997-021-000-000-000-000-000\",\n source_provider_org_cleared: \"997-022-000-000-000-000-000\",\n location_override_set: \"997-023-000-000-000-000-000\",\n location_override_cleared: \"997-024-000-000-000-000-000\",\n attempt_reason_set: \"997-025-000-000-000-000-000\",\n attempt_reason_cleared: \"997-026-000-000-000-000-000\",\n referral_target_set: \"997-027-000-000-000-000-000\",\n referral_target_cleared: \"997-028-000-000-000-000-000\",\n referral_outcome_set: \"997-029-000-000-000-000-000\",\n referral_outcome_cleared: \"997-030-000-000-000-000-000\",\n referral_entity_category_set: \"997-031-000-000-000-000-000\",\n referral_entity_category_cleared: \"997-032-000-000-000-000-000\",\n recipients_changed: \"997-033-000-000-000-000-000\",\n audiences_changed: \"997-034-000-000-000-000-000\",\n lineage_drilled_down: \"997-035-000-000-000-000-000\",\n derived_from_question: \"997-036-000-000-000-000-000\",\n metadata_changed: \"997-037-000-000-000-000-000\",\n} as const;\n\nexport type ServiceDeliveryChangeTypeKey = keyof typeof ServiceDeliveryChangeTypeKeys;\n\n/**\n * Key → positional code map for the `core_information_scope` CVC domain (DRAFT-TEMPORARY; canonical CVC-236 v4 tree, SOT v2.1.0: 115 live rows + 27 RETIRED tombstones. Canon depth 0–3 — top layer (System metadata · Narrative notes · Primary client · Other named persons), then client category / person type, then sub-category / a person type's category, then instrument row / a person type's sub-category — read off parentCode / parentKey, NOT the code: every v1.1.0 code is unchanged and new rows append. A canon `.` is `__` in the key (`offenders__identifying`; canon spelling on `canonicalCode`). Every LIVE row but the 28 instrument rows and `identifying__other` is selectable (select-all at any level); detect a category by `rowType`, not `selectable`. Tombstones keep their codes so a stored value resolves, are `selectable: false` + `retired: true`, and name their SELECTION reading in `successors` (a restriction resolves via the `subtract` lines: `restrictionSuccessors`); the envelope `migrations` block is the v3 → v4 from-to table, applied at READ time (a v2-era or unstamped list goes through canon's v2 → v3 table first; `widens: true` marks readings wider than v3; on those lines `releaseReading` says whether a signed release or share keeps the code's v3 grain (`retain`: the tombstone's `v3Fields`, read-only) or reads its successor, and `policyReading: successor` that a policy or preset takes the successor with a dated version row). Distinct from the sibling `roi_scope` domain, the LEGACY flat item vocabulary: every one of its 27 substantive keys is an entry here, spelled identically)\n *\n * Domain: `core_information_scope` · Version: 2.1.0 · Entries: 146\n */\nexport const CoreInformationScopeKeys = {\n missingness_root: \"236-000-000-000-000-000-000\",\n unknown: \"236-000-000-000-000-000-001\",\n anonymous: \"236-000-000-000-000-000-002\",\n data_not_collected: \"236-000-000-000-000-000-003\",\n identifying: \"236-001-000-000-000-000-000\",\n names: \"236-001-001-000-000-000-000\",\n dob: \"236-001-002-000-000-000-000\",\n addresses: \"236-001-003-000-000-000-000\",\n additional_ids: \"236-001-004-000-000-000-000\",\n demographics: \"236-001-005-000-000-000-000\",\n identifying__other: \"236-001-006-000-000-000-000\",\n risk: \"236-002-000-000-000-000-000\",\n screen_indicators: \"236-002-001-000-000-000-000\",\n victimization: \"236-002-002-000-000-000-000\",\n ida_full: \"236-002-003-000-000-000-000\",\n ida_consid: \"236-002-004-000-000-000-000\",\n initial_screen: \"236-002-005-000-000-000-000\",\n tra: \"236-002-006-000-000-000-000\",\n lap: \"236-002-007-000-000-000-000\",\n danger_assessment: \"236-002-008-000-000-000-000\",\n injury_and_strangulation: \"236-002-009-000-000-000-000\",\n stalking_assessment: \"236-002-010-000-000-000-000\",\n ae_intake: \"236-002-011-000-000-000-000\",\n hope_scale: \"236-002-012-000-000-000-000\",\n assessment_records: \"236-002-013-000-000-000-000\",\n determinations: \"236-002-014-000-000-000-000\",\n offender_facilitator: \"236-002-015-000-000-000-000\",\n system_involvement: \"236-002-016-000-000-000-000\",\n derived_risk_signals: \"236-002-017-000-000-000-000\",\n contact: \"236-003-000-000-000-000-000\",\n contact_info: \"236-003-001-000-000-000-000\",\n safe_locations: \"236-003-002-000-000-000-000\",\n priorities_safety: \"236-003-003-000-000-000-000\",\n encounter_location: \"236-003-004-000-000-000-000\",\n services: \"236-004-000-000-000-000-000\",\n contact_history: \"236-004-001-000-000-000-000\",\n service_history: \"236-004-002-000-000-000-000\",\n plans_goals: \"236-004-003-000-000-000-000\",\n notes: \"236-005-000-000-000-000-000\",\n screen_notes: \"236-005-001-000-000-000-000\",\n case_notes: \"236-005-002-000-000-000-000\",\n background: \"236-005-003-000-000-000-000\",\n session_summary: \"236-005-004-000-000-000-000\",\n health_accommodation: \"236-006-000-000-000-000-000\",\n accommodation_needs: \"236-006-001-000-000-000-000\",\n disability_subtypes: \"236-006-002-000-000-000-000\",\n mental_health_status: \"236-006-003-000-000-000-000\",\n substance_use_status: \"236-006-004-000-000-000-000\",\n chronic_health_status: \"236-006-005-000-000-000-000\",\n hiv_status: \"236-006-006-000-000-000-000\",\n mental_health_screen: \"236-006-007-000-000-000-000\",\n trauma_and_coping_screen: \"236-006-008-000-000-000-000\",\n behavioral_health_intake: \"236-006-009-000-000-000-000\",\n health_status: \"236-006-010-000-000-000-000\",\n immigration_legal_status: \"236-007-000-000-000-000-000\",\n immigration_status: \"236-007-001-000-000-000-000\",\n uscis_alien_number: \"236-007-002-000-000-000-000\",\n federal_protection_applications: \"236-007-003-000-000-000-000\",\n tvap_enrollment: \"236-007-004-000-000-000-000\",\n le_report_status: \"236-007-005-000-000-000-000\",\n immigration_applications: \"236-007-006-000-000-000-000\",\n system: \"236-008-000-000-000-000-000\",\n system_info: \"236-008-001-000-000-000-000\",\n network_associations: \"236-009-000-000-000-000-000\",\n network_membership: \"236-009-001-000-000-000-000\",\n persona_links: \"236-009-002-000-000-000-000\",\n commercial_activity: \"236-010-000-000-000-000-000\",\n ad_content: \"236-010-001-000-000-000-000\",\n commercial_patterns: \"236-010-002-000-000-000-000\",\n investigative_work_product: \"236-011-000-000-000-000-000\",\n case_determinations: \"236-011-001-000-000-000-000\",\n case_lifecycle: \"236-011-002-000-000-000-000\",\n case_attachments: \"236-011-003-000-000-000-000\",\n object_identifiers: \"236-012-000-000-000-000-000\",\n phone_identifiers: \"236-012-001-000-000-000-000\",\n object_identity_attributes: \"236-012-002-000-000-000-000\",\n instruments: \"236-013-000-000-000-000-000\",\n instrument_summary: \"236-013-001-000-000-000-000\",\n summary_initial_screen: \"236-013-001-001-000-000-000\",\n summary_mental_health_screen: \"236-013-001-002-000-000-000\",\n summary_behavioral_health_intake: \"236-013-001-003-000-000-000\",\n summary_trauma_and_coping_screen: \"236-013-001-004-000-000-000\",\n summary_ae_intake: \"236-013-001-005-000-000-000\",\n summary_ida: \"236-013-001-006-000-000-000\",\n summary_lap: \"236-013-001-007-000-000-000\",\n summary_danger_assessment: \"236-013-001-008-000-000-000\",\n summary_stalking_assessment: \"236-013-001-009-000-000-000\",\n summary_injury_and_strangulation: \"236-013-001-010-000-000-000\",\n summary_hope_scale: \"236-013-001-011-000-000-000\",\n summary_needs_assessment: \"236-013-001-012-000-000-000\",\n summary_tra: \"236-013-001-013-000-000-000\",\n summary_findings: \"236-013-001-014-000-000-000\",\n instrument_full: \"236-013-002-000-000-000-000\",\n full_initial_screen: \"236-013-002-001-000-000-000\",\n full_mental_health_screen: \"236-013-002-002-000-000-000\",\n full_behavioral_health_intake: \"236-013-002-003-000-000-000\",\n full_trauma_and_coping_screen: \"236-013-002-004-000-000-000\",\n full_ae_intake: \"236-013-002-005-000-000-000\",\n full_ida: \"236-013-002-006-000-000-000\",\n full_lap: \"236-013-002-007-000-000-000\",\n full_danger_assessment: \"236-013-002-008-000-000-000\",\n full_stalking_assessment: \"236-013-002-009-000-000-000\",\n full_injury_and_strangulation: \"236-013-002-010-000-000-000\",\n full_hope_scale: \"236-013-002-011-000-000-000\",\n full_needs_assessment: \"236-013-002-012-000-000-000\",\n full_tra: \"236-013-002-013-000-000-000\",\n full_findings: \"236-013-002-014-000-000-000\",\n relationships_household: \"236-014-000-000-000-000-000\",\n primary_client: \"236-015-000-000-000-000-000\",\n other_named_persons: \"236-016-000-000-000-000-000\",\n offenders: \"236-016-001-000-000-000-000\",\n offenders__identifying: \"236-016-001-001-000-000-000\",\n offenders__risk: \"236-016-001-002-000-000-000\",\n offenders__contact: \"236-016-001-003-000-000-000\",\n offenders__safe_locations: \"236-016-001-003-002-000-000\",\n offenders__services: \"236-016-001-004-000-000-000\",\n offenders__health_accommodation: \"236-016-001-006-000-000-000\",\n offenders__immigration_legal_status: \"236-016-001-007-000-000-000\",\n offenders__instruments: \"236-016-001-013-000-000-000\",\n offenders__instrument_summary: \"236-016-001-013-001-000-000\",\n offenders__instrument_full: \"236-016-001-013-002-000-000\",\n offenders__relationships_household: \"236-016-001-014-000-000-000\",\n family: \"236-016-002-000-000-000-000\",\n family__identifying: \"236-016-002-001-000-000-000\",\n family__risk: \"236-016-002-002-000-000-000\",\n family__contact: \"236-016-002-003-000-000-000\",\n family__safe_locations: \"236-016-002-003-002-000-000\",\n family__services: \"236-016-002-004-000-000-000\",\n family__health_accommodation: \"236-016-002-006-000-000-000\",\n family__immigration_legal_status: \"236-016-002-007-000-000-000\",\n family__instruments: \"236-016-002-013-000-000-000\",\n family__instrument_summary: \"236-016-002-013-001-000-000\",\n family__instrument_full: \"236-016-002-013-002-000-000\",\n family__relationships_household: \"236-016-002-014-000-000-000\",\n others: \"236-016-003-000-000-000-000\",\n others__identifying: \"236-016-003-001-000-000-000\",\n others__risk: \"236-016-003-002-000-000-000\",\n others__contact: \"236-016-003-003-000-000-000\",\n others__safe_locations: \"236-016-003-003-002-000-000\",\n others__services: \"236-016-003-004-000-000-000\",\n others__health_accommodation: \"236-016-003-006-000-000-000\",\n others__immigration_legal_status: \"236-016-003-007-000-000-000\",\n others__instruments: \"236-016-003-013-000-000-000\",\n others__instrument_summary: \"236-016-003-013-001-000-000\",\n others__instrument_full: \"236-016-003-013-002-000-000\",\n others__relationships_household: \"236-016-003-014-000-000-000\",\n} as const;\n\nexport type CoreInformationScopeKey = keyof typeof CoreInformationScopeKeys;\n\n/**\n * Key → positional code map for the `roi_scope` CVC domain (DRAFT-TEMPORARY; LEGACY flat item vocabulary, superseded for new work by `core_information_scope` (CVC-236). 27 ROI scope ITEMS: 14 live + 13 RETIRED tombstones, each matching its CVC-236 twin (`screen_notes`, `background` retired 2026-10-05 and include nothing; 11 more retired by the CVC-236 v4 tree, each read through its twin's CVC-236 SOT v2.1.0 `migrations` line: a stored ROI is a signed release, so the 9 health / immigration twins keep the twin's v3 grain (`v3Fields`, read-only) while a policy or preset takes the successor; `ida_full` / `ida_consid` read as their twin's informational line). Tombstones keep their codes so a stored value resolves, but are `selectable: false` + `retired: true` — never offer them. The item axis only — named bundles over these items are ROI_SCOPE_PRESET_NAMES).\n *\n * Domain: `roi_scope` · Version: 1.4.0 · Entries: 31\n */\nexport const RoiScopeKeys = {\n missingness_root: \"983-000-000-000-000-000-000\",\n unknown: \"983-000-000-000-000-000-001\",\n anonymous: \"983-000-000-000-000-000-002\",\n data_not_collected: \"983-000-000-000-000-000-003\",\n names: \"983-001-000-000-000-000-000\",\n dob: \"983-002-000-000-000-000-000\",\n addresses: \"983-003-000-000-000-000-000\",\n additional_ids: \"983-004-000-000-000-000-000\",\n demographics: \"983-005-000-000-000-000-000\",\n screen_indicators: \"983-006-000-000-000-000-000\",\n victimization: \"983-007-000-000-000-000-000\",\n ida_full: \"983-008-000-000-000-000-000\",\n ida_consid: \"983-009-000-000-000-000-000\",\n contact_info: \"983-010-000-000-000-000-000\",\n service_history: \"983-011-000-000-000-000-000\",\n screen_notes: \"983-012-000-000-000-000-000\",\n case_notes: \"983-013-000-000-000-000-000\",\n background: \"983-014-000-000-000-000-000\",\n system_info: \"983-015-000-000-000-000-000\",\n contact_history: \"983-016-000-000-000-000-000\",\n accommodation_needs: \"983-017-000-000-000-000-000\",\n disability_subtypes: \"983-018-000-000-000-000-000\",\n mental_health_status: \"983-019-000-000-000-000-000\",\n substance_use_status: \"983-020-000-000-000-000-000\",\n chronic_health_status: \"983-021-000-000-000-000-000\",\n hiv_status: \"983-022-000-000-000-000-000\",\n immigration_status: \"983-023-000-000-000-000-000\",\n uscis_alien_number: \"983-024-000-000-000-000-000\",\n federal_protection_applications: \"983-025-000-000-000-000-000\",\n tvap_enrollment: \"983-026-000-000-000-000-000\",\n le_report_status: \"983-027-000-000-000-000-000\",\n} as const;\n\nexport type RoiScopeKey = keyof typeof RoiScopeKeys;\n\n/**\n * Key → positional code map for the `roi_status` CVC domain (DRAFT-TEMPORARY; the 5-state lifecycle of a STORED Release of Information, sourced from PAVE `@pave/domain` ROI_STATUSES. DISTINCT from ROI_SEED_STATUSES, the recipient-card badge triad valid/expired/none).\n *\n * Domain: `roi_status` · Version: 1.1.0 · Entries: 9\n */\nexport const RoiStatusKeys = {\n missingness_root: \"984-000-000-000-000-000-000\",\n unknown: \"984-000-000-000-000-000-001\",\n anonymous: \"984-000-000-000-000-000-002\",\n data_not_collected: \"984-000-000-000-000-000-003\",\n draft: \"984-001-000-000-000-000-000\",\n active: \"984-002-000-000-000-000-000\",\n expired: \"984-003-000-000-000-000-000\",\n revoked: \"984-005-000-000-000-000-000\",\n superseded: \"984-006-000-000-000-000-000\",\n} as const;\n\nexport type RoiStatusKey = keyof typeof RoiStatusKeys;\n\n/**\n * Key → positional code map for the `core_referral_outcome` CVC domain (DRAFT-TEMPORARY; the binary referral-outcome axis attained / not_attained, grounded in the HMIS FY2026 Data Standards “P2 Referrals Provided” element + IC-59. The REASON a referral was not attained is a separate axis and is deliberately not folded in).\n *\n * Domain: `core_referral_outcome` · Version: 1.0.0 · Entries: 6\n */\nexport const CoreReferralOutcomeKeys = {\n missingness_root: \"975-000-000-000-000-000-000\",\n unknown: \"975-000-000-000-000-000-001\",\n anonymous: \"975-000-000-000-000-000-002\",\n data_not_collected: \"975-000-000-000-000-000-003\",\n attained: \"975-001-000-000-000-000-000\",\n not_attained: \"975-002-000-000-000-000-000\",\n} as const;\n\nexport type CoreReferralOutcomeKey = keyof typeof CoreReferralOutcomeKeys;\n\n/**\n * Key → positional code map for the `dh_state` CVC domain (CVC-233, `core-DH_state`, ready_for_dev). Lifecycle state of a determination / Findings artifact: draft → prov → pend_iss → issued → super. INDEPENDENT axis from CVC-138 `determination_level` (suspected/reported/disclosed/verified), which lives on the assertion at every state. Per-determination, not per-subject. Authored in 0.8.13 once CVC-233 was freed by renumbering `housing_subsidy_types` 233 → 194 — the squat had MASKED this gap.\n *\n * Domain: `dh_state` · Version: 1.0.0 · Entries: 9\n */\nexport const DhStateKeys = {\n missingness_root: \"233-000-000-000-000-000-000\",\n unknown: \"233-000-000-000-000-000-001\",\n anonymous: \"233-000-000-000-000-000-002\",\n data_not_collected: \"233-000-000-000-000-000-003\",\n draft: \"233-001-000-000-000-000-000\",\n prov: \"233-002-000-000-000-000-000\",\n pend_iss: \"233-003-000-000-000-000-000\",\n issued: \"233-004-000-000-000-000-000\",\n super: \"233-005-000-000-000-000-000\",\n} as const;\n\nexport type DhStateKey = keyof typeof DhStateKeys;\n\n/**\n * Key → positional code map for the `core_indicators` CVC domain (CVC-136; 221 canonical indicator codes re-sourced from prototype `data/core_indicators.yaml` @ 40f57ad, reconciled against @hti/scoring `emits_by_code` @ 386f5f1; the 2 former scoring-ahead `_youth` codes are DEPRECATED read-only rows — `selectable: false`, `supersededBy` their canonical siblings — kept because PAVE 2.0 still writes them = 223 substantive; SOT v1.2.0). Entries carry `family` / `polarity` / `severity` / `isAlert` / `alertWhen`; the alert list is a DERIVED VIEW over `isAlert`, not a rival taxonomy.\n *\n * Domain: `core_indicators` · Version: 1.2.0 · Entries: 227\n */\nexport const CoreIndicatorKeys = {\n missingness_root: \"136-000-000-000-000-000-000\",\n unknown: \"136-000-000-000-000-000-001\",\n anonymous: \"136-000-000-000-000-000-002\",\n data_not_collected: \"136-000-000-000-000-000-003\",\n abuser_evading_legal_consequences: \"136-001-000-000-000-000-000\",\n abuser_has_weapon: \"136-002-000-000-000-000-000\",\n abuser_substance_use: \"136-003-000-000-000-000-000\",\n abuser_threatened_suicide: \"136-004-000-000-000-000-000\",\n abuser_unemployed: \"136-005-000-000-000-000-000\",\n access_to_vulnerable_individuals: \"136-006-000-000-000-000-000\",\n acknowledgement_or_report_of_human_trafficking: \"136-007-000-000-000-000-000\",\n ads_available_247: \"136-008-000-000-000-000-000\",\n ads_imply_multiple_workers: \"136-009-000-000-000-000-000\",\n ads_prost_slang: \"136-010-000-000-000-000-000\",\n adverse_childhood_household_challenges: \"136-011-000-000-000-000-000\",\n advertised_new_to_area: \"136-012-000-000-000-000-000\",\n appears_controlling_relationship: \"136-013-000-000-000-000-000\",\n appears_turned_out_or_trained_ad_patterns: \"136-014-000-000-000-000-000\",\n association_commercial_sex: \"136-015-000-000-000-000-000\",\n atypical_or_high_risk_payment_method: \"136-016-000-000-000-000-000\",\n autonomy_access_healthcare_without_fear: \"136-017-000-000-000-000-000\",\n autonomy_choice_in_clients: \"136-018-000-000-000-000-000\",\n autonomy_choice_in_services: \"136-019-000-000-000-000-000\",\n autonomy_controls_own_docs: \"136-020-000-000-000-000-000\",\n autonomy_controls_own_finances: \"136-021-000-000-000-000-000\",\n autonomy_organizes_own_travel: \"136-022-000-000-000-000-000\",\n autonomy_posts_own_ads: \"136-023-000-000-000-000-000\",\n autonomy_sets_own_schedule: \"136-024-000-000-000-000-000\",\n autonomy_sets_up_own_dates: \"136-025-000-000-000-000-000\",\n battered_while_pregnant_history: \"136-026-000-000-000-000-000\",\n branding_or_unusual_tattoos_tied_to_control: \"136-027-000-000-000-000-000\",\n cannot_stop_working_or_freely_leave: \"136-028-000-000-000-000-000\",\n child_not_abusers_in_household: \"136-029-000-000-000-000-000\",\n child_welfare_system_involvement: \"136-030-000-000-000-000-000\",\n coerced_to_misrepresent_identity_or_activity: \"136-031-000-000-000-000-000\",\n coercive_debt_pressure: \"136-032-000-000-000-000-000\",\n coercive_debt_pressure_youth: \"136-033-000-000-000-000-000\",\n coercive_migration_or_forced_travel: \"136-034-000-000-000-000-000\",\n cognitive_or_functional_impairment_affecting_consent: \"136-035-000-000-000-000-000\",\n commercial_sex_association_words_or_places: \"136-036-000-000-000-000-000\",\n concerning_mannerisms_anxious_fearful_depressed: \"136-037-000-000-000-000-000\",\n concerning_sexual_behavior_pattern: \"136-038-000-000-000-000-000\",\n constraints_due_to_legal_status: \"136-039-000-000-000-000-000\",\n control_quota_required: \"136-040-000-000-000-000-000\",\n cs_activity_criminal_org_connection: \"136-041-000-000-000-000-000\",\n cs_industry_related_criminal_history: \"136-042-000-000-000-000-000\",\n current_injuries_from_abuser: \"136-043-000-000-000-000-000\",\n current_mental_health_services: \"136-044-000-000-000-000-000\",\n currently_minor_in_commercial_sex: \"136-045-000-000-000-000-000\",\n dangerous_services_no_protection: \"136-046-000-000-000-000-000\",\n dangerous_services_requires_protection: \"136-047-000-000-000-000-000\",\n dangerous_services_willing_anything: \"136-048-000-000-000-000-000\",\n debt_terms_deceptive: \"136-049-000-000-000-000-000\",\n debt_terms_deceptive_youth: \"136-050-000-000-000-000-000\",\n denied_basic_needs: \"136-051-000-000-000-000-000\",\n depends_on_employer_for_immigration_status: \"136-052-000-000-000-000-000\",\n does_not_control_finances_or_earnings: \"136-053-000-000-000-000-000\",\n does_not_control_identity_documents: \"136-054-000-000-000-000-000\",\n elevated_lethality_risk_signal: \"136-055-000-000-000-000-000\",\n employer_keeps_pay_or_pays_less_than_expected: \"136-056-000-000-000-000-000\",\n engages_in_commercial_sex_act: \"136-057-000-000-000-000-000\",\n entered_commercial_sex_industry_as_minor: \"136-058-000-000-000-000-000\",\n entered_cs_due_to_survival_needs: \"136-059-000-000-000-000-000\",\n entered_into_network_of_sex_providers_early: \"136-060-000-000-000-000-000\",\n exploitative_pricing_tier_low: \"136-061-000-000-000-000-000\",\n exploitative_working_conditions: \"136-062-000-000-000-000-000\",\n fled_conflict_violence_or_persecution: \"136-063-000-000-000-000-000\",\n forced_to_commit_crimes: \"136-064-000-000-000-000-000\",\n forced_to_use_false_documents: \"136-065-000-000-000-000-000\",\n foreign_born_or_recently_arrived: \"136-066-000-000-000-000-000\",\n foreign_born_risk_factors: \"136-067-000-000-000-000-000\",\n frequent_changes_in_residence: \"136-068-000-000-000-000-000\",\n frequent_travel_or_location_changes: \"136-069-000-000-000-000-000\",\n frequently_at_hotels_or_many_hotel_keys: \"136-070-000-000-000-000-000\",\n harmful_coping_behaviors: \"136-071-000-000-000-000-000\",\n has_ads_on_commercial_sex_site: \"136-072-000-000-000-000-000\",\n has_facilitators_involved: \"136-073-000-000-000-000-000\",\n has_management_or_representation: \"136-074-000-000-000-000-000\",\n has_no_personal_items_or_possessions: \"136-075-000-000-000-000-000\",\n head_injury_history: \"136-076-000-000-000-000-000\",\n head_injury_loss_of_consciousness: \"136-077-000-000-000-000-000\",\n health_related_vulnerability: \"136-078-000-000-000-000-000\",\n hierarchical_management_structure_identified: \"136-079-000-000-000-000-000\",\n high_risk_sexual_behavior: \"136-080-000-000-000-000-000\",\n high_security_measures_at_work_or_living_location: \"136-081-000-000-000-000-000\",\n highly_irregular_school_attendance: \"136-082-000-000-000-000-000\",\n history_emotional_abuse: \"136-083-000-000-000-000-000\",\n history_of_head_injury: \"136-084-000-000-000-000-000\",\n history_of_mental_health_issues: \"136-085-000-000-000-000-000\",\n history_of_running_away_or_missing_from_care: \"136-086-000-000-000-000-000\",\n history_of_strangulation: \"136-087-000-000-000-000-000\",\n history_physical_or_sexual_abuse_or_dv: \"136-088-000-000-000-000-000\",\n homeless_or_unstably_housed: \"136-089-000-000-000-000-000\",\n immigration_related_exploitation_risk: \"136-090-000-000-000-000-000\",\n in_commercial_sex_industry_recorded: \"136-091-000-000-000-000-000\",\n inability_to_account_for_self: \"136-092-000-000-000-000-000\",\n intimate_partner_violence_reported_to_law_enforcement: \"136-093-000-000-000-000-000\",\n juvenile_justice_or_child_welfare_involvement: \"136-094-000-000-000-000-000\",\n juvenile_justice_system_involvement: \"136-095-000-000-000-000-000\",\n labor_services_activity_recorded: \"136-096-000-000-000-000-000\",\n lgbtq_individual: \"136-097-000-000-000-000-000\",\n limited_english_proficiency: \"136-098-000-000-000-000-000\",\n limited_independence: \"136-099-000-000-000-000-000\",\n lives_or_sleeps_at_place_of_work: \"136-100-000-000-000-000-000\",\n living_with_abuser: \"136-101-000-000-000-000-000\",\n macro_level_economic_duress_entry_exit: \"136-102-000-000-000-000-000\",\n meets_or_has_sex_with_internet_contacts: \"136-103-000-000-000-000-000\",\n monitored_or_isolated_by_controlling_party: \"136-104-000-000-000-000-000\",\n much_older_intimate_partner: \"136-105-000-000-000-000-000\",\n nervous_about_immigration_documentation: \"136-106-000-000-000-000-000\",\n network_aggregate_risk_score_high: \"136-107-000-000-000-000-000\",\n network_multiple_sex_providers_named: \"136-108-000-000-000-000-000\",\n network_stable_size_large: \"136-109-000-000-000-000-000\",\n network_trafficker_present: \"136-110-000-000-000-000-000\",\n network_violent_person_present: \"136-111-000-000-000-000-000\",\n new_to_commercial_sex_industry: \"136-112-000-000-000-000-000\",\n non_consensual_photography_or_recording: \"136-113-000-000-000-000-000\",\n not_in_control_of_immigration_documentation: \"136-114-000-000-000-000-000\",\n other_instability_or_vulnerability_factors: \"136-115-000-000-000-000-000\",\n owes_money_and_cannot_pay_off: \"136-116-000-000-000-000-000\",\n paid_or_owes_fee_to_arrange_travel_to_us: \"136-117-000-000-000-000-000\",\n paid_or_owes_recruitment_fee_to_employer: \"136-118-000-000-000-000-000\",\n parent_or_guardian_of_minor_subject_named: \"136-119-000-000-000-000-000\",\n past_phases_prior_trafficking_or_risk: \"136-120-000-000-000-000-000\",\n payment_routed_through_third_party: \"136-121-000-000-000-000-000\",\n pending_federal_protection: \"136-122-000-000-000-000-000\",\n performing_different_work_than_promised: \"136-123-000-000-000-000-000\",\n physical_violence_increasing: \"136-124-000-000-000-000-000\",\n poverty_or_severe_financial_strain: \"136-125-000-000-000-000-000\",\n precarious_immigration_status: \"136-126-000-000-000-000-000\",\n pressured_or_forced_sex_act: \"136-127-000-000-000-000-000\",\n prior_medical_attention_from_abuse: \"136-128-000-000-000-000-000\",\n prior_tvap_disconnection: \"136-129-000-000-000-000-000\",\n prior_victimization_or_abuse_history: \"136-130-000-000-000-000-000\",\n promise_of_work_different_than_current_work: \"136-131-000-000-000-000-000\",\n received_things_of_value_while_missing_from_care: \"136-132-000-000-000-000-000\",\n recent_le_engagement: \"136-133-000-000-000-000-000\",\n recruited_by_third_party_into_cs_industry: \"136-134-000-000-000-000-000\",\n regular_alcohol_use: \"136-135-000-000-000-000-000\",\n relies_on_temporary_resources_for_basic_needs: \"136-136-000-000-000-000-000\",\n reports_physical_harm_by_employer_or_partner: \"136-137-000-000-000-000-000\",\n reports_physical_harm_to_others_by_employer_or_partner: \"136-138-000-000-000-000-000\",\n restrictive_living_or_working_conditions: \"136-139-000-000-000-000-000\",\n restrictive_or_not_understood_contract: \"136-140-000-000-000-000-000\",\n risk_factors_commercial_sex: \"136-141-000-000-000-000-000\",\n serious_substance_use_or_introduced_to_drugs: \"136-142-000-000-000-000-000\",\n several_cell_phones_or_frequent_number_changes: \"136-143-000-000-000-000-000\",\n sex_acts_in_own_residence: \"136-144-000-000-000-000-000\",\n sexual_exploitation: \"136-145-000-000-000-000-000\",\n sexualized_content_performance_activity: \"136-146-000-000-000-000-000\",\n shared_contact_network: \"136-147-000-000-000-000-000\",\n signs_of_physical_abuse_confinement_or_neglect: \"136-148-000-000-000-000-000\",\n signs_of_physical_harm_or_abuse: \"136-149-000-000-000-000-000\",\n sleep_disturbance: \"136-150-000-000-000-000-000\",\n social_isolation_or_no_supportive_relationships: \"136-151-000-000-000-000-000\",\n stalking_property_intrusion: \"136-152-000-000-000-000-000\",\n stalking_surveillance: \"136-153-000-000-000-000-000\",\n stalking_unwanted_contact: \"136-154-000-000-000-000-000\",\n strangulation_acute_symptoms: \"136-155-000-000-000-000-000\",\n strangulation_choking_assault_detail: \"136-156-000-000-000-000-000\",\n strangulation_loss_of_consciousness: \"136-157-000-000-000-000-000\",\n strangulation_repeated: \"136-158-000-000-000-000-000\",\n subject_affiliated_org_trafficking_activity: \"136-159-000-000-000-000-000\",\n subject_arrested_dv_sv_cs: \"136-160-000-000-000-000-000\",\n subject_gang_org_affiliation: \"136-161-000-000-000-000-000\",\n subject_has_illegal_weapons: \"136-162-000-000-000-000-000\",\n subject_is_sex_offender: \"136-163-000-000-000-000-000\",\n subject_legally_barred_weapons: \"136-164-000-000-000-000-000\",\n subject_perpetrated_abuse_history: \"136-165-000-000-000-000-000\",\n subject_perpetrated_emotional_stalking_current: \"136-166-000-000-000-000-000\",\n subject_perpetrated_emotional_stalking_past: \"136-167-000-000-000-000-000\",\n subject_perpetrated_ipv_current: \"136-168-000-000-000-000-000\",\n subject_perpetrated_ipv_past: \"136-169-000-000-000-000-000\",\n subject_perpetrated_physical_abuse_current: \"136-170-000-000-000-000-000\",\n subject_perpetrated_physical_abuse_past: \"136-171-000-000-000-000-000\",\n subject_perpetrated_sexual_abuse_current: \"136-172-000-000-000-000-000\",\n subject_perpetrated_sexual_abuse_past: \"136-173-000-000-000-000-000\",\n subject_violent_felony: \"136-174-000-000-000-000-000\",\n substance_use_while_working: \"136-175-000-000-000-000-000\",\n suicidal_ideation_history: \"136-176-000-000-000-000-000\",\n suicidal_ideation_recent: \"136-177-000-000-000-000-000\",\n suicide_attempt_history: \"136-178-000-000-000-000-000\",\n third_party_advertises_or_posts_for_person: \"136-179-000-000-000-000-000\",\n third_party_arranged_commercial_sex_acts: \"136-180-000-000-000-000-000\",\n threats_by_employer_or_partner: \"136-181-000-000-000-000-000\",\n threats_of_harm: \"136-182-000-000-000-000-000\",\n threats_of_legal_trouble_or_deportation: \"136-183-000-000-000-000-000\",\n threats_related_to_migration_debt: \"136-184-000-000-000-000-000\",\n threats_to_family_friends_or_close_associates: \"136-185-000-000-000-000-000\",\n threats_to_kill_victim_or_children: \"136-186-000-000-000-000-000\",\n trafficking_experience_current: \"136-187-000-000-000-000-000\",\n trafficking_experience_past_10plusy: \"136-188-000-000-000-000-000\",\n trafficking_experience_past_3to10y: \"136-189-000-000-000-000-000\",\n trafficking_experience_past_lt3y: \"136-190-000-000-000-000-000\",\n travel_organized_by_third_party: \"136-191-000-000-000-000-000\",\n tricked_or_pressured_into_unwanted_acts: \"136-192-000-000-000-000-000\",\n under_18_advertised_age: \"136-193-000-000-000-000-000\",\n under_18_appears_underage: \"136-194-000-000-000-000-000\",\n under_18_known_age: \"136-195-000-000-000-000-000\",\n unexplained_frequent_travel_or_migration: \"136-196-000-000-000-000-000\",\n unsafe_working_conditions_long_hours_inadequate_breaks: \"136-197-000-000-000-000-000\",\n unusual_cash_or_unexplained_gifts: \"136-198-000-000-000-000-000\",\n unusual_work_circumstances: \"136-199-000-000-000-000-000\",\n urgent_medical_referral_needed: \"136-200-000-000-000-000-000\",\n victim_believes_abuser_capable_of_killing: \"136-201-000-000-000-000-000\",\n victimization_history_composite: \"136-202-000-000-000-000-000\",\n violence_or_threats_at_work_site: \"136-203-000-000-000-000-000\",\n weapon_used_or_threatened_against_victim: \"136-204-000-000-000-000-000\",\n work_frequency_high_volume: \"136-205-000-000-000-000-000\",\n working_while_pregnant: \"136-206-000-000-000-000-000\",\n workplace_emotional_climate_of_fear: \"136-207-000-000-000-000-000\",\n works_across_multiple_cities_or_locations: \"136-208-000-000-000-000-000\",\n works_for_little_or_no_pay: \"136-209-000-000-000-000-000\",\n youth_watched_filmed_or_photographed_sexually_explicit: \"136-210-000-000-000-000-000\",\n clients_unaware_of_third_party_coordination: \"136-211-000-000-000-000-000\",\n depends_on_spouse_or_family_for_immigration_status: \"136-212-000-000-000-000-000\",\n sexualized_content_in_person_performance_activity: \"136-213-000-000-000-000-000\",\n sexualized_content_online_performance_activity: \"136-214-000-000-000-000-000\",\n trauma_perpetrator_is_current_manager: \"136-215-000-000-000-000-000\",\n active_protective_order: \"136-216-000-000-000-000-000\",\n disclosed_fear_at_intake: \"136-217-000-000-000-000-000\",\n does_not_control_housing: \"136-218-000-000-000-000-000\",\n oppressive_home_life: \"136-219-000-000-000-000-000\",\n recent_separation: \"136-220-000-000-000-000-000\",\n survival_sex: \"136-221-000-000-000-000-000\",\n unable_to_speak_freely: \"136-222-000-000-000-000-000\",\n potential_trafficking_victim_recorded: \"136-223-000-000-000-000-000\",\n} as const;\n\nexport type CoreIndicatorKey = keyof typeof CoreIndicatorKeys;\n\n/**\n * Key → positional code map for the `risk_identification_milestone` CVC domain (CVC-267, ratified 2026-08-29). The identification-FUNNEL rung value set — the vocabulary `assertion_value_code` resolves against for the `identification_rung_reached` CAR. Four rungs store `assertion_domain` `signal_identification` (CVC-159 159-066); `determined` stores `investigative_legal` (159-067) and is documented under both (filed-under-both ruling 2026-08-29). Each entry carries its stored `assertionDomain` so a consumer can route a rung without a second table. Deliberately its OWN vocabulary, not Level-2 rows inside CVC-159: `AssertionDomainKeys` is the set of DOMAINS, and folding values in would make `on_radar` demand a domain classification downstream. The milestone-symmetry no-state row is absent: reaching no rung is the ABSENCE of rows.\n *\n * Domain: `risk_identification_milestone` · Version: 1.0.0 · Entries: 9\n */\nexport const RiskIdentificationMilestoneKeys = {\n missingness_root: \"267-000-000-000-000-000-000\",\n unknown: \"267-000-000-000-000-000-001\",\n anonymous: \"267-000-000-000-000-000-002\",\n data_not_collected: \"267-000-000-000-000-000-003\",\n on_radar: \"267-001-000-000-000-000-000\",\n screened: \"267-002-000-000-000-000-000\",\n at_risk: \"267-003-000-000-000-000-000\",\n assessed: \"267-004-000-000-000-000-000\",\n determined: \"267-005-000-000-000-000-000\",\n} as const;\n\nexport type RiskIdentificationMilestoneKey = keyof typeof RiskIdentificationMilestoneKeys;\n\n/**\n * Key → positional code map for the `risk_severity_band` CVC domain (CVC-238, VERIFIED). Replaces the withdrawn provisional `risk_band` (981). Carries the load-bearing `lowerBand` thresholds 0/20/40/60/80 that the milestone band-crossing trigger reads.\n *\n * Domain: `risk_severity_band` · Version: 1.0.0 · Entries: 9\n */\nexport const RiskSeverityBandKeys = {\n missingness_root: \"238-000-000-000-000-000-000\",\n unknown: \"238-000-000-000-000-000-001\",\n anonymous: \"238-000-000-000-000-000-002\",\n data_not_collected: \"238-000-000-000-000-000-003\",\n risk_1: \"238-001-000-000-000-000-000\",\n risk_2: \"238-002-000-000-000-000-000\",\n risk_3: \"238-003-000-000-000-000-000\",\n risk_4: \"238-004-000-000-000-000-000\",\n risk_5: \"238-005-000-000-000-000-000\",\n} as const;\n\nexport type RiskSeverityBandKey = keyof typeof RiskSeverityBandKeys;\n\n/**\n * Key → positional code map for the `admin_roles` CVC domain (CVC-134). Administrative / control-plane role axis of the canonical authorization model (IC-66; admin ≠ content visibility); distinct from CVC-135 `user_roles`. SOT v2.0.0 is GENERATED from the prototype repo's data/cvcs/core_admin_role.yaml by scripts/gen-admin-roles.py. Keys transliterate canon's hyphenated codes (`PLT-ADM` → `plt_adm`; canon spelling on `canonicalCode`). No missingness keys (the 1.0.0 quadruplet is withdrawn). Canon's legacy `ACCT-ADM` resolves to `mem_adm` through `adminRolesSot._supersedes.keyMap`, which is key-space (look up `acct_adm`: lowercase, `-` → `_`).\n *\n * Domain: `admin_roles` · Version: 2.0.0 · Entries: 10\n */\nexport const AdminRoleKeys = {\n plt_adm: \"134-001-000-000-000-000-000\",\n plt_sup: \"134-002-000-000-000-000-000\",\n mem_adm: \"134-003-000-000-000-000-000\",\n team_adm: \"134-004-000-000-000-000-000\",\n aud: \"134-005-000-000-000-000-000\",\n data_adm: \"134-006-000-000-000-000-000\",\n gov_aud: \"134-007-000-000-000-000-000\",\n ciro: \"134-008-000-000-000-000-000\",\n sup: \"134-009-000-000-000-000-000\",\n train_adm: \"134-010-000-000-000-000-000\",\n} as const;\n\nexport type AdminRoleKey = keyof typeof AdminRoleKeys;\n\n/**\n * Key → positional code map for the `user_roles` CVC domain (CVC-135). Operational / practitioner role axis of the canonical authorization model (IC-66); distinct from CVC-134 `admin_roles`. SOT v2.0.0 is GENERATED from the prototype repo's data/cvcs/core_user_role.yaml by scripts/gen-user-roles.py; canon re-keyed `hotline_op` to `crisis_response` at the same code (135-004). No missingness keys (the 1.0.0 quadruplet is withdrawn; a role is assigned, never observed). A stored `hotline_op`, or canon's legacy `case_advocate` / `leads_investigator`, resolves through `userRolesSot._supersedes.keyMap`.\n *\n * Domain: `user_roles` · Version: 2.0.0 · Entries: 15\n */\nexport const UserRoleKeys = {\n case_nav: \"135-001-000-000-000-000-000\",\n healthcare_provider_medical: \"135-002-000-000-000-000-000\",\n behavioral_health_provider: \"135-003-000-000-000-000-000\",\n crisis_response: \"135-004-000-000-000-000-000\",\n intel_analyst: \"135-005-000-000-000-000-000\",\n investigator: \"135-006-000-000-000-000-000\",\n le_liaison_vsp: \"135-007-000-000-000-000-000\",\n legal_advocate: \"135-008-000-000-000-000-000\",\n mandatory_reporter: \"135-009-000-000-000-000-000\",\n mdt_participant: \"135-010-000-000-000-000-000\",\n prosecutor_review: \"135-011-000-000-000-000-000\",\n public_reporter: \"135-012-000-000-000-000-000\",\n research_analytics: \"135-013-000-000-000-000-000\",\n screener: \"135-014-000-000-000-000-000\",\n volunteer: \"135-015-000-000-000-000-000\",\n} as const;\n\nexport type UserRoleKey = keyof typeof UserRoleKeys;\n\n/**\n * Key → positional code map for the `hmis_current_living_situation` CVC domain (CVC-193). The HUD-reporting crosswalk vocabulary (HMIS FY2026 4.12 numeric codes); a DISTINCT CVC from CVC-192 `living_situation` (the internal semantic vocabulary). Keys are `hmis_<code>`; the numeric code is in `hmisCode`.\n *\n * Domain: `hmis_current_living_situation` · Version: 1.0.0 · Entries: 33\n */\nexport const HmisCurrentLivingSituationKeys = {\n missingness_root: \"193-000-000-000-000-000-000\",\n unknown: \"193-000-000-000-000-000-001\",\n anonymous: \"193-000-000-000-000-000-002\",\n data_not_collected: \"193-000-000-000-000-000-003\",\n hmis_17: \"193-001-000-000-000-000-000\",\n hmis_24: \"193-002-000-000-000-000-000\",\n hmis_30: \"193-003-000-000-000-000-000\",\n hmis_37: \"193-004-000-000-000-000-000\",\n hmis_101: \"193-005-000-000-000-000-000\",\n hmis_116: \"193-006-000-000-000-000-000\",\n hmis_118: \"193-007-000-000-000-000-000\",\n hmis_204: \"193-008-000-000-000-000-000\",\n hmis_205: \"193-009-000-000-000-000-000\",\n hmis_206: \"193-010-000-000-000-000-000\",\n hmis_207: \"193-011-000-000-000-000-000\",\n hmis_215: \"193-012-000-000-000-000-000\",\n hmis_225: \"193-013-000-000-000-000-000\",\n hmis_302: \"193-014-000-000-000-000-000\",\n hmis_312: \"193-015-000-000-000-000-000\",\n hmis_313: \"193-016-000-000-000-000-000\",\n hmis_314: \"193-017-000-000-000-000-000\",\n hmis_327: \"193-018-000-000-000-000-000\",\n hmis_329: \"193-019-000-000-000-000-000\",\n hmis_332: \"193-020-000-000-000-000-000\",\n hmis_335: \"193-021-000-000-000-000-000\",\n hmis_336: \"193-022-000-000-000-000-000\",\n hmis_410: \"193-023-000-000-000-000-000\",\n hmis_411: \"193-024-000-000-000-000-000\",\n hmis_421: \"193-025-000-000-000-000-000\",\n hmis_422: \"193-026-000-000-000-000-000\",\n hmis_423: \"193-027-000-000-000-000-000\",\n hmis_426: \"193-028-000-000-000-000-000\",\n hmis_435: \"193-029-000-000-000-000-000\",\n} as const;\n\nexport type HmisCurrentLivingSituationKey = keyof typeof HmisCurrentLivingSituationKeys;\n\n/**\n * Key → positional code map for the `juvenile_justice_episode_type` CVC domain (CVC-197). Types the EPISODE; distinct from CVC-95 `juvenile_justice_involvement_status` (the point-in-time status).\n *\n * Domain: `juvenile_justice_episode_type` · Version: 1.0.0 · Entries: 9\n */\nexport const JuvenileJusticeEpisodeTypeKeys = {\n missingness_root: \"197-000-000-000-000-000-000\",\n unknown: \"197-000-000-000-000-000-001\",\n anonymous: \"197-000-000-000-000-000-002\",\n data_not_collected: \"197-000-000-000-000-000-003\",\n pending_adjudication: \"197-001-000-000-000-000-000\",\n diversion_program: \"197-002-000-000-000-000-000\",\n residential_jj_placement: \"197-003-000-000-000-000-000\",\n probation_supervision: \"197-004-000-000-000-000-000\",\n detention_stay: \"197-005-000-000-000-000-000\",\n} as const;\n\nexport type JuvenileJusticeEpisodeTypeKey = keyof typeof JuvenileJusticeEpisodeTypeKeys;\n\n/**\n * Key → positional code map for the `incarceration_episode_type` CVC domain (CVC-198).\n *\n * Domain: `incarceration_episode_type` · Version: 1.0.0 · Entries: 9\n */\nexport const IncarcerationEpisodeTypeKeys = {\n missingness_root: \"198-000-000-000-000-000-000\",\n unknown: \"198-000-000-000-000-000-001\",\n anonymous: \"198-000-000-000-000-000-002\",\n data_not_collected: \"198-000-000-000-000-000-003\",\n jail: \"198-001-000-000-000-000-000\",\n detention: \"198-002-000-000-000-000-000\",\n prison: \"198-003-000-000-000-000-000\",\n immigration_detention: \"198-004-000-000-000-000-000\",\n work_release_or_halfway_house_custody: \"198-005-000-000-000-000-000\",\n} as const;\n\nexport type IncarcerationEpisodeTypeKey = keyof typeof IncarcerationEpisodeTypeKeys;\n\n/**\n * Key → positional code map for the `exploitation_type` CVC domain (CVC-203). Domain-level determination codes for exploitation outcomes that are NOT trafficking determinations; distinct from CVC-72 `ht_type`.\n *\n * Domain: `exploitation_type` · Version: 1.0.0 · Entries: 9\n */\nexport const ExploitationTypeKeys = {\n missingness_root: \"203-000-000-000-000-000-000\",\n unknown: \"203-000-000-000-000-000-001\",\n anonymous: \"203-000-000-000-000-000-002\",\n data_not_collected: \"203-000-000-000-000-000-003\",\n no_exploitation_determined: \"203-001-000-000-000-000-000\",\n commercial_sexual_exploitation_of_minor_domain_determination: \"203-002-000-000-000-000-000\",\n labor_exploitation_non_trafficking: \"203-003-000-000-000-000-000\",\n sexual_exploitation_non_trafficking: \"203-004-000-000-000-000-000\",\n commercial_sexual_exploitation_domain_determination: \"203-005-000-000-000-000-000\",\n} as const;\n\nexport type ExploitationTypeKey = keyof typeof ExploitationTypeKeys;\n\n/**\n * Key → positional code map for the `source_system` CVC domain (CVC-201). Part of the assertion provenance contract with CVC-140 `source_category`, CVC-141 `source_subtype` and CVC-209 `source_instrument`.\n *\n * Domain: `source_system` · Version: 1.0.0 · Entries: 19\n */\nexport const SourceSystemKeys = {\n missingness_root: \"201-000-000-000-000-000-000\",\n unknown: \"201-000-000-000-000-000-001\",\n anonymous: \"201-000-000-000-000-000-002\",\n data_not_collected: \"201-000-000-000-000-000-003\",\n cityxguide: \"201-001-000-000-000-000-000\",\n sipsap: \"201-002-000-000-000-000-000\",\n adultsearch: \"201-003-000-000-000-000-000\",\n backpage: \"201-004-000-000-000-000-000\",\n listcrawler: \"201-005-000-000-000-000-000\",\n rubmaps: \"201-006-000-000-000-000-000\",\n skipthegames: \"201-007-000-000-000-000-000\",\n twilio: \"201-008-000-000-000-000-000\",\n facebook: \"201-009-000-000-000-000-000\",\n hti_platform_internal: \"201-010-000-000-000-000-000\",\n clear: \"201-011-000-000-000-000-000\",\n axon: \"201-012-000-000-000-000-000\",\n accurint: \"201-013-000-000-000-000-000\",\n the_erotic_review: \"201-014-000-000-000-000-000\",\n ncic: \"201-015-000-000-000-000-000\",\n} as const;\n\nexport type SourceSystemKey = keyof typeof SourceSystemKeys;\n\n/**\n * Key → positional code map for the `source_instrument` CVC domain (CVC-209). The instrument through which an assertion's value was captured; part of the assertion provenance contract.\n *\n * Domain: `source_instrument` · Version: 1.1.0 · Entries: 115\n */\nexport const SourceInstrumentKeys = {\n missingness_root: \"209-000-000-000-000-000-000\",\n unknown: \"209-000-000-000-000-000-001\",\n anonymous: \"209-000-000-000-000-000-002\",\n data_not_collected: \"209-000-000-000-000-000-003\",\n hti_leads_manual_entry: \"209-001-000-000-000-000-000\",\n hti_pave_ida: \"209-002-000-000-000-000-000\",\n hti_thread_intake_workflow: \"209-003-000-000-000-000-000\",\n hti_file_upload_csv_import: \"209-004-000-000-000-000-000\",\n hti_leads_edit_correction: \"209-005-000-000-000-000-000\",\n hti_rules_engine_derivation: \"209-006-000-000-000-000-000\",\n hti_screening_tool_other: \"209-007-000-000-000-000-000\",\n vendor_twilio_lookup: \"209-008-000-000-000-000-000\",\n hti_model_inference_output: \"209-009-000-000-000-000-000\",\n hti_api_import: \"209-010-000-000-000-000-000\",\n hti_osint_scraper_run: \"209-011-000-000-000-000-000\",\n hti_pave_is: \"209-012-000-000-000-000-000\",\n hti_danger_assessment: \"209-013-000-000-000-000-000\",\n hti_lethality_assessment: \"209-014-000-000-000-000-000\",\n hti_leads_tra: \"209-015-000-000-000-000-000\",\n hti_stalking_assessment: \"209-016-000-000-000-000-000\",\n hti_needs_assessment: \"209-017-000-000-000-000-000\",\n hti_bh_intake: \"209-018-000-000-000-000-000\",\n hti_mh_intake: \"209-019-000-000-000-000-000\",\n hti_strangulation_injury: \"209-020-000-000-000-000-000\",\n hti_sud_screen: \"209-021-000-000-000-000-000\",\n hti_ocat_hts: \"209-022-000-000-000-000-000\",\n hti_ae_intake: \"209-023-000-000-000-000-000\",\n hti_tcs_intake: \"209-024-000-000-000-000-000\",\n hti_pave_service_log: \"209-025-000-000-000-000-000\",\n thread_pave_service_log: \"209-026-000-000-000-000-000\",\n hti_leads_milestone_log: \"209-027-000-000-000-000-000\",\n hti_leads_triage_workflow: \"209-028-000-000-000-000-000\",\n hti_leads_findings: \"209-029-000-000-000-000-000\",\n hti_leads_deconfliction: \"209-030-000-000-000-000-000\",\n hti_leads_case_lifecycle: \"209-031-000-000-000-000-000\",\n hti_leads_entity_resolution: \"209-032-000-000-000-000-000\",\n hti_leads_network_mapping: \"209-033-000-000-000-000-000\",\n hti_leads_pattern_match: \"209-034-000-000-000-000-000\",\n hti_leads_search_hit: \"209-035-000-000-000-000-000\",\n hti_leads_intake_processing: \"209-036-000-000-000-000-000\",\n hti_leads_incarceration_episode: \"209-037-000-000-000-000-000\",\n hti_hope_scale: \"209-038-000-000-000-000-000\",\n hti_core_profile: \"209-039-000-000-000-000-000\",\n hti_pave_persons_network: \"209-040-000-000-000-000-000\",\n hti_pave_victimizations: \"209-041-000-000-000-000-000\",\n hti_pave_intake_workflow: \"209-042-000-000-000-000-000\",\n hti_pave_case_view: \"209-043-000-000-000-000-000\",\n hti_directory_entry: \"209-044-000-000-000-000-000\",\n hti_pave_milestone_derivation: \"209-045-000-000-000-000-000\",\n hti_track1_identification_derivation: \"209-046-000-000-000-000-000\",\n hti_investigative_outcomes_vetting: \"209-047-000-000-000-000-000\",\n hti_risk_band_crossing: \"209-048-000-000-000-000-000\",\n hti_leads_actionability: \"209-049-000-000-000-000-000\",\n hti_leads_ad_extraction: \"209-050-000-000-000-000-000\",\n hti_leads_ad_address: \"209-051-000-000-000-000-000\",\n hti_leads_ad_age: \"209-052-000-000-000-000-000\",\n hti_leads_ad_age_indicator: \"209-053-000-000-000-000-000\",\n hti_leads_ad_available_anytime: \"209-054-000-000-000-000-000\",\n hti_leads_available_anytime_indicator: \"209-055-000-000-000-000-000\",\n hti_leads_ad_client_pref: \"209-056-000-000-000-000-000\",\n hti_leads_ad_common_domain: \"209-057-000-000-000-000-000\",\n hti_leads_ad_content_classifier: \"209-058-000-000-000-000-000\",\n hti_leads_ad_spam_detection: \"209-059-000-000-000-000-000\",\n hti_leads_person_aggregation: \"209-060-000-000-000-000-000\",\n hti_leads_ad_cs_profile: \"209-061-000-000-000-000-000\",\n hti_leads_ad_email: \"209-062-000-000-000-000-000\",\n hti_leads_facilitation_likelihood: \"209-063-000-000-000-000-000\",\n hti_leads_ad_foreign_classifier: \"209-064-000-000-000-000-000\",\n hti_leads_ad_foreign_indicator: \"209-065-000-000-000-000-000\",\n hti_leads_ad_foreign_phone: \"209-066-000-000-000-000-000\",\n hti_leads_ad_gender: \"209-067-000-000-000-000-000\",\n hti_leads_ad_hispanic_latino: \"209-068-000-000-000-000-000\",\n hti_leads_ad_improbable_age: \"209-069-000-000-000-000-000\",\n hti_leads_ad_improbable_handle: \"209-070-000-000-000-000-000\",\n hti_leads_ad_location: \"209-071-000-000-000-000-000\",\n hti_leads_ad_main_race: \"209-072-000-000-000-000-000\",\n hti_leads_ad_min_age: \"209-073-000-000-000-000-000\",\n hti_leads_multi_city_indicator: \"209-074-000-000-000-000-000\",\n hti_leads_ad_multiple_persons: \"209-075-000-000-000-000-000\",\n hti_leads_multiple_workers_indicator: \"209-076-000-000-000-000-000\",\n hti_leads_ad_name: \"209-077-000-000-000-000-000\",\n hti_leads_ad_nation_region: \"209-078-000-000-000-000-000\",\n hti_leads_network_aggregation: \"209-079-000-000-000-000-000\",\n hti_leads_ad_new_phone: \"209-080-000-000-000-000-000\",\n hti_leads_ad_new_pics: \"209-081-000-000-000-000-000\",\n hti_leads_ad_new_to_area: \"209-082-000-000-000-000-000\",\n hti_leads_ad_new_to_industry: \"209-083-000-000-000-000-000\",\n hti_leads_no_protection_indicator: \"209-084-000-000-000-000-000\",\n hti_leads_ad_org_name: \"209-085-000-000-000-000-000\",\n hti_leads_ad_org_related: \"209-086-000-000-000-000-000\",\n hti_leads_ad_origin_country: \"209-087-000-000-000-000-000\",\n hti_leads_ad_payment_method: \"209-088-000-000-000-000-000\",\n hti_leads_ad_phone: \"209-089-000-000-000-000-000\",\n hti_leads_phone_rotation_indicator: \"209-090-000-000-000-000-000\",\n hti_leads_ad_pregnant: \"209-091-000-000-000-000-000\",\n hti_leads_ad_price: \"209-092-000-000-000-000-000\",\n hti_leads_ad_price_per_hr: \"209-093-000-000-000-000-000\",\n hti_leads_price_tier_pooled: \"209-094-000-000-000-000-000\",\n hti_leads_recommended_acts: \"209-095-000-000-000-000-000\",\n hti_leads_ad_remote_only: \"209-096-000-000-000-000-000\",\n hti_leads_trafficking_likelihood: \"209-097-000-000-000-000-000\",\n hti_leads_ad_screening: \"209-098-000-000-000-000-000\",\n hti_leads_ad_services: \"209-099-000-000-000-000-000\",\n hti_leads_severity: \"209-100-000-000-000-000-000\",\n hti_leads_ad_sm_profile: \"209-101-000-000-000-000-000\",\n hti_leads_evidence_strength: \"209-102-000-000-000-000-000\",\n hti_leads_ad_substance_use: \"209-103-000-000-000-000-000\",\n hti_leads_ad_survival_indicator: \"209-104-000-000-000-000-000\",\n hti_leads_threats_classifier: \"209-105-000-000-000-000-000\",\n hti_leads_ad_aggregation: \"209-106-000-000-000-000-000\",\n hti_leads_ad_url_type: \"209-107-000-000-000-000-000\",\n hti_leads_ad_valid_email: \"209-108-000-000-000-000-000\",\n hti_leads_ad_valid_phone: \"209-109-000-000-000-000-000\",\n hti_leads_ad_venue: \"209-110-000-000-000-000-000\",\n hti_leads_ad_website: \"209-111-000-000-000-000-000\",\n} as const;\n\nexport type SourceInstrumentKey = keyof typeof SourceInstrumentKeys;\n\n/**\n * Key → positional code map for the `po_petition_basis` CVC domain (CVC-213). Protection Orders (IC-62).\n *\n * Domain: `po_petition_basis` · Version: 1.0.0 · Entries: 8\n */\nexport const PoPetitionBasisKeys = {\n missingness_root: \"213-000-000-000-000-000-000\",\n unknown: \"213-000-000-000-000-000-001\",\n anonymous: \"213-000-000-000-000-000-002\",\n data_not_collected: \"213-000-000-000-000-000-003\",\n dv: \"213-001-000-000-000-000-000\",\n har: \"213-002-000-000-000-000-000\",\n sa: \"213-003-000-000-000-000-000\",\n other: \"213-004-000-000-000-000-000\",\n} as const;\n\nexport type PoPetitionBasisKey = keyof typeof PoPetitionBasisKeys;\n\n/**\n * Key → positional code map for the `po_status` CVC domain (CVC-214). Protection Orders (IC-62). The canonical lifecycle stage is carried per-entry in `lifecycleStage`; the vocabulary itself is flat.\n *\n * Domain: `po_status` · Version: 1.0.0 · Entries: 12\n */\nexport const PoStatusKeys = {\n missingness_root: \"214-000-000-000-000-000-000\",\n unknown: \"214-000-000-000-000-000-001\",\n anonymous: \"214-000-000-000-000-000-002\",\n data_not_collected: \"214-000-000-000-000-000-003\",\n filed: \"214-001-000-000-000-000-000\",\n ex_parte_granted: \"214-002-000-000-000-000-000\",\n hearing_pending: \"214-003-000-000-000-000-000\",\n denied_outright: \"214-004-000-000-000-000-000\",\n final_granted: \"214-005-000-000-000-000-000\",\n final_denied_or_dismissed: \"214-006-000-000-000-000-000\",\n expired: \"214-007-000-000-000-000-000\",\n emergency: \"214-008-000-000-000-000-000\",\n} as const;\n\nexport type PoStatusKey = keyof typeof PoStatusKeys;\n\n/**\n * Key → positional code map for the `po_violation_status` CVC domain (CVC-215). Protection Orders (IC-62).\n *\n * Domain: `po_violation_status` · Version: 1.0.0 · Entries: 6\n */\nexport const PoViolationStatusKeys = {\n missingness_root: \"215-000-000-000-000-000-000\",\n unknown: \"215-000-000-000-000-000-001\",\n anonymous: \"215-000-000-000-000-000-002\",\n data_not_collected: \"215-000-000-000-000-000-003\",\n violated: \"215-001-000-000-000-000-000\",\n notviolated: \"215-002-000-000-000-000-000\",\n} as const;\n\nexport type PoViolationStatusKey = keyof typeof PoViolationStatusKeys;\n\n/**\n * Key → positional code map for the `session_template` CVC domain (CVC-217). Canonical session templates across PAVE / Thread / LEADS; distinct from CVC-216 `session_state`.\n *\n * Domain: `session_template` · Version: 1.0.0 · Entries: 25\n */\nexport const SessionTemplateKeys = {\n missingness_root: \"217-000-000-000-000-000-000\",\n unknown: \"217-000-000-000-000-000-001\",\n anonymous: \"217-000-000-000-000-000-002\",\n data_not_collected: \"217-000-000-000-000-000-003\",\n cst_pave_other: \"217-001-000-000-000-000-000\",\n cst_pave_program_exit: \"217-002-000-000-000-000-000\",\n cst_pave_client_update: \"217-003-000-000-000-000-000\",\n cst_pave_program_intake_existing: \"217-004-000-000-000-000-000\",\n cst_pave_new_client: \"217-005-000-000-000-000-000\",\n cst_thread_other: \"217-006-000-000-000-000-000\",\n cst_thread_in_person_not_field: \"217-007-000-000-000-000-000\",\n cst_thread_misc_call: \"217-008-000-000-000-000-000\",\n cst_thread_text_email: \"217-009-000-000-000-000-000\",\n cst_thread_field_response: \"217-010-000-000-000-000-000\",\n cst_thread_lap_incident: \"217-011-000-000-000-000-000\",\n cst_thread_hotline_call: \"217-012-000-000-000-000-000\",\n cst_leads_other: \"217-013-000-000-000-000-000\",\n cst_leads_database_query: \"217-014-000-000-000-000-000\",\n cst_leads_case_update: \"217-015-000-000-000-000-000\",\n cst_leads_new_report: \"217-016-000-000-000-000-000\",\n cst_leads_new_case: \"217-017-000-000-000-000-000\",\n cst_leads_new_lead_tip: \"217-018-000-000-000-000-000\",\n cst_unk_other_virtual: \"217-019-000-000-000-000-000\",\n cst_pave_inbound_share: \"217-020-000-000-000-000-000\",\n cst_thread_inbound_share: \"217-021-000-000-000-000-000\",\n} as const;\n\nexport type SessionTemplateKey = keyof typeof SessionTemplateKeys;\n\n/**\n * Key → positional code map for the `service_delivery_channel` CVC domain (CVC-47, canonical). HOW a service was delivered; sibling axis to CVC-25 `service_mechanisms` and CVC-49 `service_states`. `GROUP_INPERSON` / `GROUP_REMOTE` are flagged local extensions.\n *\n * Domain: `service_delivery_channel` · Version: 1.0.0 · Entries: 11\n */\nexport const ServiceDeliveryChannelKeys = {\n missingness_root: \"047-000-000-000-000-000-000\",\n unknown: \"047-000-000-000-000-000-001\",\n anonymous: \"047-000-000-000-000-000-002\",\n data_not_collected: \"047-000-000-000-000-000-003\",\n phone: \"047-001-000-000-000-000-000\",\n in_person: \"047-002-000-000-000-000-000\",\n on_scene: \"047-003-000-000-000-000-000\",\n virtual: \"047-004-000-000-000-000-000\",\n email_text_chat: \"047-005-000-000-000-000-000\",\n group_inperson: \"047-006-000-000-000-000-000\",\n group_remote: \"047-007-000-000-000-000-000\",\n} as const;\n\nexport type ServiceDeliveryChannelKey = keyof typeof ServiceDeliveryChannelKeys;\n\n/**\n * Key → positional code map for the `citizenship` CVC domain (CVC-182, provisional-pending-notion-ratification). 249 countries + the canonical 3-value missingness set. Positional codes are MINTED platform-common-side: the upstream Notion codebook's Code column is blank on all 252 rows. The authoritative ISO 3166-1 alpha-2 code rides on each entry as `iso31661Alpha2`.\n *\n * Domain: `citizenship` · Version: 1.0.0 · Entries: 253\n */\nexport const CitizenshipKeys = {\n missingness_root: \"182-000-000-000-000-000-000\",\n unknown: \"182-000-000-000-000-000-001\",\n anonymous: \"182-000-000-000-000-000-002\",\n data_not_collected: \"182-000-000-000-000-000-003\",\n afghanistan: \"182-001-000-000-000-000-000\",\n aland_islands: \"182-002-000-000-000-000-000\",\n albania: \"182-003-000-000-000-000-000\",\n algeria: \"182-004-000-000-000-000-000\",\n american_samoa: \"182-005-000-000-000-000-000\",\n andorra: \"182-006-000-000-000-000-000\",\n angola: \"182-007-000-000-000-000-000\",\n anguilla: \"182-008-000-000-000-000-000\",\n antarctica: \"182-009-000-000-000-000-000\",\n antigua_and_barbuda: \"182-010-000-000-000-000-000\",\n argentina: \"182-011-000-000-000-000-000\",\n armenia: \"182-012-000-000-000-000-000\",\n aruba: \"182-013-000-000-000-000-000\",\n australia: \"182-014-000-000-000-000-000\",\n austria: \"182-015-000-000-000-000-000\",\n azerbaijan: \"182-016-000-000-000-000-000\",\n bahamas: \"182-017-000-000-000-000-000\",\n bahrain: \"182-018-000-000-000-000-000\",\n bangladesh: \"182-019-000-000-000-000-000\",\n barbados: \"182-020-000-000-000-000-000\",\n belarus: \"182-021-000-000-000-000-000\",\n belgium: \"182-022-000-000-000-000-000\",\n belize: \"182-023-000-000-000-000-000\",\n benin: \"182-024-000-000-000-000-000\",\n bermuda: \"182-025-000-000-000-000-000\",\n bhutan: \"182-026-000-000-000-000-000\",\n bolivia_plurinational_state_of: \"182-027-000-000-000-000-000\",\n bonaire_sint_eustatius_and_saba: \"182-028-000-000-000-000-000\",\n bosnia_and_herzegovina: \"182-029-000-000-000-000-000\",\n botswana: \"182-030-000-000-000-000-000\",\n bouvet_island: \"182-031-000-000-000-000-000\",\n brazil: \"182-032-000-000-000-000-000\",\n british_indian_ocean_territory: \"182-033-000-000-000-000-000\",\n brunei_darussalam: \"182-034-000-000-000-000-000\",\n bulgaria: \"182-035-000-000-000-000-000\",\n burkina_faso: \"182-036-000-000-000-000-000\",\n burundi: \"182-037-000-000-000-000-000\",\n cambodia: \"182-038-000-000-000-000-000\",\n cameroon: \"182-039-000-000-000-000-000\",\n canada: \"182-040-000-000-000-000-000\",\n cape_verde: \"182-041-000-000-000-000-000\",\n cayman_islands: \"182-042-000-000-000-000-000\",\n central_african_republic: \"182-043-000-000-000-000-000\",\n chad: \"182-044-000-000-000-000-000\",\n chile: \"182-045-000-000-000-000-000\",\n china: \"182-046-000-000-000-000-000\",\n christmas_island: \"182-047-000-000-000-000-000\",\n cocos_keeling_islands: \"182-048-000-000-000-000-000\",\n colombia: \"182-049-000-000-000-000-000\",\n comoros: \"182-050-000-000-000-000-000\",\n congo: \"182-051-000-000-000-000-000\",\n congo_the_democratic_republic_of_the: \"182-052-000-000-000-000-000\",\n cook_islands: \"182-053-000-000-000-000-000\",\n costa_rica: \"182-054-000-000-000-000-000\",\n cote_d_ivoire: \"182-055-000-000-000-000-000\",\n croatia: \"182-056-000-000-000-000-000\",\n cuba: \"182-057-000-000-000-000-000\",\n curacao: \"182-058-000-000-000-000-000\",\n cyprus: \"182-059-000-000-000-000-000\",\n czech_republic: \"182-060-000-000-000-000-000\",\n denmark: \"182-061-000-000-000-000-000\",\n djibouti: \"182-062-000-000-000-000-000\",\n dominica: \"182-063-000-000-000-000-000\",\n dominican_republic: \"182-064-000-000-000-000-000\",\n ecuador: \"182-065-000-000-000-000-000\",\n egypt: \"182-066-000-000-000-000-000\",\n el_salvador: \"182-067-000-000-000-000-000\",\n equatorial_guinea: \"182-068-000-000-000-000-000\",\n eritrea: \"182-069-000-000-000-000-000\",\n estonia: \"182-070-000-000-000-000-000\",\n ethiopia: \"182-071-000-000-000-000-000\",\n falkland_islands_malvinas: \"182-072-000-000-000-000-000\",\n faroe_islands: \"182-073-000-000-000-000-000\",\n fiji: \"182-074-000-000-000-000-000\",\n finland: \"182-075-000-000-000-000-000\",\n france: \"182-076-000-000-000-000-000\",\n french_guiana: \"182-077-000-000-000-000-000\",\n french_polynesia: \"182-078-000-000-000-000-000\",\n french_southern_territories: \"182-079-000-000-000-000-000\",\n gabon: \"182-080-000-000-000-000-000\",\n gambia: \"182-081-000-000-000-000-000\",\n georgia: \"182-082-000-000-000-000-000\",\n ghana: \"182-083-000-000-000-000-000\",\n germany: \"182-084-000-000-000-000-000\",\n gibraltar: \"182-085-000-000-000-000-000\",\n greece: \"182-086-000-000-000-000-000\",\n greenland: \"182-087-000-000-000-000-000\",\n grenada: \"182-088-000-000-000-000-000\",\n guadeloupe: \"182-089-000-000-000-000-000\",\n guam: \"182-090-000-000-000-000-000\",\n guatemala: \"182-091-000-000-000-000-000\",\n guernsey: \"182-092-000-000-000-000-000\",\n guinea: \"182-093-000-000-000-000-000\",\n guinea_bissau: \"182-094-000-000-000-000-000\",\n guyana: \"182-095-000-000-000-000-000\",\n haiti: \"182-096-000-000-000-000-000\",\n heard_island_and_mcdonald_islands: \"182-097-000-000-000-000-000\",\n holy_see_vatican_city_state: \"182-098-000-000-000-000-000\",\n honduras: \"182-099-000-000-000-000-000\",\n hong_kong: \"182-100-000-000-000-000-000\",\n hungary: \"182-101-000-000-000-000-000\",\n iceland: \"182-102-000-000-000-000-000\",\n india: \"182-103-000-000-000-000-000\",\n indonesia: \"182-104-000-000-000-000-000\",\n iran_islamic_republic_of: \"182-105-000-000-000-000-000\",\n iraq: \"182-106-000-000-000-000-000\",\n ireland: \"182-107-000-000-000-000-000\",\n isle_of_man: \"182-108-000-000-000-000-000\",\n israel: \"182-109-000-000-000-000-000\",\n italy: \"182-110-000-000-000-000-000\",\n jamaica: \"182-111-000-000-000-000-000\",\n jersey: \"182-112-000-000-000-000-000\",\n japan: \"182-113-000-000-000-000-000\",\n jordan: \"182-114-000-000-000-000-000\",\n kazakhstan: \"182-115-000-000-000-000-000\",\n kenya: \"182-116-000-000-000-000-000\",\n kiribati: \"182-117-000-000-000-000-000\",\n korea_democratic_people_s_republic_of: \"182-118-000-000-000-000-000\",\n korea_republic_of: \"182-119-000-000-000-000-000\",\n kuwait: \"182-120-000-000-000-000-000\",\n kyrgyzstan: \"182-121-000-000-000-000-000\",\n lao_people_s_democratic_republic: \"182-122-000-000-000-000-000\",\n latvia: \"182-123-000-000-000-000-000\",\n lebanon: \"182-124-000-000-000-000-000\",\n lesotho: \"182-125-000-000-000-000-000\",\n liberia: \"182-126-000-000-000-000-000\",\n libya: \"182-127-000-000-000-000-000\",\n liechtenstein: \"182-128-000-000-000-000-000\",\n lithuania: \"182-129-000-000-000-000-000\",\n luxembourg: \"182-130-000-000-000-000-000\",\n macao: \"182-131-000-000-000-000-000\",\n macedonia_the_former_yugoslav_republic_of: \"182-132-000-000-000-000-000\",\n madagascar: \"182-133-000-000-000-000-000\",\n malawi: \"182-134-000-000-000-000-000\",\n malaysia: \"182-135-000-000-000-000-000\",\n maldives: \"182-136-000-000-000-000-000\",\n mali: \"182-137-000-000-000-000-000\",\n malta: \"182-138-000-000-000-000-000\",\n marshall_islands: \"182-139-000-000-000-000-000\",\n martinique: \"182-140-000-000-000-000-000\",\n mauritania: \"182-141-000-000-000-000-000\",\n mauritius: \"182-142-000-000-000-000-000\",\n mayotte: \"182-143-000-000-000-000-000\",\n mexico: \"182-144-000-000-000-000-000\",\n micronesia_federated_states_of: \"182-145-000-000-000-000-000\",\n moldova_republic_of: \"182-146-000-000-000-000-000\",\n monaco: \"182-147-000-000-000-000-000\",\n mongolia: \"182-148-000-000-000-000-000\",\n montenegro: \"182-149-000-000-000-000-000\",\n montserrat: \"182-150-000-000-000-000-000\",\n morocco: \"182-151-000-000-000-000-000\",\n mozambique: \"182-152-000-000-000-000-000\",\n myanmar: \"182-153-000-000-000-000-000\",\n namibia: \"182-154-000-000-000-000-000\",\n nauru: \"182-155-000-000-000-000-000\",\n nepal: \"182-156-000-000-000-000-000\",\n netherlands: \"182-157-000-000-000-000-000\",\n new_caledonia: \"182-158-000-000-000-000-000\",\n new_zealand: \"182-159-000-000-000-000-000\",\n nicaragua: \"182-160-000-000-000-000-000\",\n niger: \"182-161-000-000-000-000-000\",\n nigeria: \"182-162-000-000-000-000-000\",\n niue: \"182-163-000-000-000-000-000\",\n norfolk_island: \"182-164-000-000-000-000-000\",\n northern_mariana_islands: \"182-165-000-000-000-000-000\",\n norway: \"182-166-000-000-000-000-000\",\n oman: \"182-167-000-000-000-000-000\",\n pakistan: \"182-168-000-000-000-000-000\",\n palau: \"182-169-000-000-000-000-000\",\n palestine_state_of: \"182-170-000-000-000-000-000\",\n panama: \"182-171-000-000-000-000-000\",\n papua_new_guinea: \"182-172-000-000-000-000-000\",\n paraguay: \"182-173-000-000-000-000-000\",\n peru: \"182-174-000-000-000-000-000\",\n philippines: \"182-175-000-000-000-000-000\",\n pitcairn: \"182-176-000-000-000-000-000\",\n poland: \"182-177-000-000-000-000-000\",\n portugal: \"182-178-000-000-000-000-000\",\n puerto_rico: \"182-179-000-000-000-000-000\",\n qatar: \"182-180-000-000-000-000-000\",\n reunion: \"182-181-000-000-000-000-000\",\n romania: \"182-182-000-000-000-000-000\",\n russian_federation: \"182-183-000-000-000-000-000\",\n rwanda: \"182-184-000-000-000-000-000\",\n saint_barthelemy: \"182-185-000-000-000-000-000\",\n saint_helena_ascension_and_tristan_da_cunha: \"182-186-000-000-000-000-000\",\n saint_kitts_and_nevis: \"182-187-000-000-000-000-000\",\n saint_lucia: \"182-188-000-000-000-000-000\",\n saint_martin_french_part: \"182-189-000-000-000-000-000\",\n saint_pierre_and_miquelon: \"182-190-000-000-000-000-000\",\n saint_vincent_and_the_grenadines: \"182-191-000-000-000-000-000\",\n samoa: \"182-192-000-000-000-000-000\",\n san_marino: \"182-193-000-000-000-000-000\",\n sao_tome_and_principe: \"182-194-000-000-000-000-000\",\n saudi_arabia: \"182-195-000-000-000-000-000\",\n senegal: \"182-196-000-000-000-000-000\",\n serbia: \"182-197-000-000-000-000-000\",\n sierra_leone: \"182-198-000-000-000-000-000\",\n seychelles: \"182-199-000-000-000-000-000\",\n singapore: \"182-200-000-000-000-000-000\",\n sint_maarten_dutch_part: \"182-201-000-000-000-000-000\",\n slovakia: \"182-202-000-000-000-000-000\",\n slovenia: \"182-203-000-000-000-000-000\",\n solomon_islands: \"182-204-000-000-000-000-000\",\n somalia: \"182-205-000-000-000-000-000\",\n south_africa: \"182-206-000-000-000-000-000\",\n south_georgia_and_the_south_sandwich_islands: \"182-207-000-000-000-000-000\",\n spain: \"182-208-000-000-000-000-000\",\n south_sudan: \"182-209-000-000-000-000-000\",\n sri_lanka: \"182-210-000-000-000-000-000\",\n sudan: \"182-211-000-000-000-000-000\",\n suriname: \"182-212-000-000-000-000-000\",\n svalbard_and_jan_mayen: \"182-213-000-000-000-000-000\",\n eswatini: \"182-214-000-000-000-000-000\",\n sweden: \"182-215-000-000-000-000-000\",\n switzerland: \"182-216-000-000-000-000-000\",\n syrian_arab_republic: \"182-217-000-000-000-000-000\",\n taiwan_province_of_china: \"182-218-000-000-000-000-000\",\n tajikistan: \"182-219-000-000-000-000-000\",\n thailand: \"182-220-000-000-000-000-000\",\n tanzania_united_republic_of: \"182-221-000-000-000-000-000\",\n timor_leste: \"182-222-000-000-000-000-000\",\n togo: \"182-223-000-000-000-000-000\",\n tokelau: \"182-224-000-000-000-000-000\",\n tonga: \"182-225-000-000-000-000-000\",\n trinidad_and_tobago: \"182-226-000-000-000-000-000\",\n tunisia: \"182-227-000-000-000-000-000\",\n turkey: \"182-228-000-000-000-000-000\",\n turkmenistan: \"182-229-000-000-000-000-000\",\n turks_and_caicos_islands: \"182-230-000-000-000-000-000\",\n tuvalu: \"182-231-000-000-000-000-000\",\n uganda: \"182-232-000-000-000-000-000\",\n ukraine: \"182-233-000-000-000-000-000\",\n united_arab_emirates: \"182-234-000-000-000-000-000\",\n united_kingdom: \"182-235-000-000-000-000-000\",\n united_states: \"182-236-000-000-000-000-000\",\n united_states_minor_outlying_islands: \"182-237-000-000-000-000-000\",\n uruguay: \"182-238-000-000-000-000-000\",\n uzbekistan: \"182-239-000-000-000-000-000\",\n vanuatu: \"182-240-000-000-000-000-000\",\n venezuela_bolivarian_republic_of: \"182-241-000-000-000-000-000\",\n viet_nam: \"182-242-000-000-000-000-000\",\n virgin_islands_british: \"182-243-000-000-000-000-000\",\n virgin_islands_u_s: \"182-244-000-000-000-000-000\",\n wallis_and_futuna: \"182-245-000-000-000-000-000\",\n western_sahara: \"182-246-000-000-000-000-000\",\n yemen: \"182-247-000-000-000-000-000\",\n zambia: \"182-248-000-000-000-000-000\",\n zimbabwe: \"182-249-000-000-000-000-000\",\n} as const;\n\nexport type CitizenshipKey = keyof typeof CitizenshipKeys;\n\n/**\n * Key → positional code map for the `countries` CVC domain (CVC-181, provisional-pending-notion-ratification). The neutral ISO 3166-1 country/territory list: 249 countries + the workspace-standard 3-value missingness set + `non_us_unspecified` (a flagged local extension). Positional codes are MINTED platform-common-side: the upstream Notion codebook's Code column is blank on all 249 rows. The authoritative ISO 3166-1 alpha-2 code rides on each entry as `iso31661Alpha2`. The 249 country KEYS are identical to CVC-182 `citizenship`; the positional ORDINALS are NOT (the two codebooks sort differently) — reconcile by key, never by rewriting segment 1.\n *\n * Domain: `countries` · Version: 1.0.0 · Entries: 254\n */\nexport const CountryKeys = {\n missingness_root: \"181-000-000-000-000-000-000\",\n unknown: \"181-000-000-000-000-000-001\",\n anonymous: \"181-000-000-000-000-000-002\",\n data_not_collected: \"181-000-000-000-000-000-003\",\n afghanistan: \"181-001-000-000-000-000-000\",\n aland_islands: \"181-002-000-000-000-000-000\",\n albania: \"181-003-000-000-000-000-000\",\n algeria: \"181-004-000-000-000-000-000\",\n american_samoa: \"181-005-000-000-000-000-000\",\n andorra: \"181-006-000-000-000-000-000\",\n angola: \"181-007-000-000-000-000-000\",\n anguilla: \"181-008-000-000-000-000-000\",\n antarctica: \"181-009-000-000-000-000-000\",\n antigua_and_barbuda: \"181-010-000-000-000-000-000\",\n argentina: \"181-011-000-000-000-000-000\",\n armenia: \"181-012-000-000-000-000-000\",\n aruba: \"181-013-000-000-000-000-000\",\n australia: \"181-014-000-000-000-000-000\",\n austria: \"181-015-000-000-000-000-000\",\n azerbaijan: \"181-016-000-000-000-000-000\",\n bahamas: \"181-017-000-000-000-000-000\",\n bahrain: \"181-018-000-000-000-000-000\",\n bangladesh: \"181-019-000-000-000-000-000\",\n barbados: \"181-020-000-000-000-000-000\",\n belarus: \"181-021-000-000-000-000-000\",\n belgium: \"181-022-000-000-000-000-000\",\n belize: \"181-023-000-000-000-000-000\",\n benin: \"181-024-000-000-000-000-000\",\n bermuda: \"181-025-000-000-000-000-000\",\n bhutan: \"181-026-000-000-000-000-000\",\n bolivia_plurinational_state_of: \"181-027-000-000-000-000-000\",\n bonaire_sint_eustatius_and_saba: \"181-028-000-000-000-000-000\",\n bosnia_and_herzegovina: \"181-029-000-000-000-000-000\",\n botswana: \"181-030-000-000-000-000-000\",\n bouvet_island: \"181-031-000-000-000-000-000\",\n brazil: \"181-032-000-000-000-000-000\",\n british_indian_ocean_territory: \"181-033-000-000-000-000-000\",\n brunei_darussalam: \"181-034-000-000-000-000-000\",\n bulgaria: \"181-035-000-000-000-000-000\",\n burkina_faso: \"181-036-000-000-000-000-000\",\n burundi: \"181-037-000-000-000-000-000\",\n cambodia: \"181-038-000-000-000-000-000\",\n cameroon: \"181-039-000-000-000-000-000\",\n canada: \"181-040-000-000-000-000-000\",\n cape_verde: \"181-041-000-000-000-000-000\",\n cayman_islands: \"181-042-000-000-000-000-000\",\n central_african_republic: \"181-043-000-000-000-000-000\",\n chad: \"181-044-000-000-000-000-000\",\n chile: \"181-045-000-000-000-000-000\",\n china: \"181-046-000-000-000-000-000\",\n christmas_island: \"181-047-000-000-000-000-000\",\n cocos_keeling_islands: \"181-048-000-000-000-000-000\",\n colombia: \"181-049-000-000-000-000-000\",\n comoros: \"181-050-000-000-000-000-000\",\n congo: \"181-051-000-000-000-000-000\",\n congo_the_democratic_republic_of_the: \"181-052-000-000-000-000-000\",\n cook_islands: \"181-053-000-000-000-000-000\",\n costa_rica: \"181-054-000-000-000-000-000\",\n cote_d_ivoire: \"181-055-000-000-000-000-000\",\n croatia: \"181-056-000-000-000-000-000\",\n cuba: \"181-057-000-000-000-000-000\",\n curacao: \"181-058-000-000-000-000-000\",\n cyprus: \"181-059-000-000-000-000-000\",\n czech_republic: \"181-060-000-000-000-000-000\",\n denmark: \"181-061-000-000-000-000-000\",\n djibouti: \"181-062-000-000-000-000-000\",\n dominica: \"181-063-000-000-000-000-000\",\n dominican_republic: \"181-064-000-000-000-000-000\",\n ecuador: \"181-065-000-000-000-000-000\",\n egypt: \"181-066-000-000-000-000-000\",\n el_salvador: \"181-067-000-000-000-000-000\",\n equatorial_guinea: \"181-068-000-000-000-000-000\",\n eritrea: \"181-069-000-000-000-000-000\",\n estonia: \"181-070-000-000-000-000-000\",\n ethiopia: \"181-071-000-000-000-000-000\",\n falkland_islands_malvinas: \"181-072-000-000-000-000-000\",\n faroe_islands: \"181-073-000-000-000-000-000\",\n fiji: \"181-074-000-000-000-000-000\",\n finland: \"181-075-000-000-000-000-000\",\n france: \"181-076-000-000-000-000-000\",\n french_guiana: \"181-077-000-000-000-000-000\",\n french_polynesia: \"181-078-000-000-000-000-000\",\n french_southern_territories: \"181-079-000-000-000-000-000\",\n gabon: \"181-080-000-000-000-000-000\",\n gambia: \"181-081-000-000-000-000-000\",\n georgia: \"181-082-000-000-000-000-000\",\n germany: \"181-083-000-000-000-000-000\",\n ghana: \"181-084-000-000-000-000-000\",\n gibraltar: \"181-085-000-000-000-000-000\",\n greece: \"181-086-000-000-000-000-000\",\n greenland: \"181-087-000-000-000-000-000\",\n grenada: \"181-088-000-000-000-000-000\",\n guadeloupe: \"181-089-000-000-000-000-000\",\n guam: \"181-090-000-000-000-000-000\",\n guatemala: \"181-091-000-000-000-000-000\",\n guernsey: \"181-092-000-000-000-000-000\",\n guinea: \"181-093-000-000-000-000-000\",\n guinea_bissau: \"181-094-000-000-000-000-000\",\n guyana: \"181-095-000-000-000-000-000\",\n haiti: \"181-096-000-000-000-000-000\",\n heard_island_and_mcdonald_islands: \"181-097-000-000-000-000-000\",\n holy_see_vatican_city_state: \"181-098-000-000-000-000-000\",\n honduras: \"181-099-000-000-000-000-000\",\n hong_kong: \"181-100-000-000-000-000-000\",\n hungary: \"181-101-000-000-000-000-000\",\n iceland: \"181-102-000-000-000-000-000\",\n india: \"181-103-000-000-000-000-000\",\n indonesia: \"181-104-000-000-000-000-000\",\n iran_islamic_republic_of: \"181-105-000-000-000-000-000\",\n iraq: \"181-106-000-000-000-000-000\",\n ireland: \"181-107-000-000-000-000-000\",\n israel: \"181-108-000-000-000-000-000\",\n isle_of_man: \"181-109-000-000-000-000-000\",\n italy: \"181-110-000-000-000-000-000\",\n jamaica: \"181-111-000-000-000-000-000\",\n japan: \"181-112-000-000-000-000-000\",\n jersey: \"181-113-000-000-000-000-000\",\n jordan: \"181-114-000-000-000-000-000\",\n kazakhstan: \"181-115-000-000-000-000-000\",\n kenya: \"181-116-000-000-000-000-000\",\n kiribati: \"181-117-000-000-000-000-000\",\n korea_democratic_people_s_republic_of: \"181-118-000-000-000-000-000\",\n korea_republic_of: \"181-119-000-000-000-000-000\",\n kuwait: \"181-120-000-000-000-000-000\",\n kyrgyzstan: \"181-121-000-000-000-000-000\",\n latvia: \"181-122-000-000-000-000-000\",\n lao_people_s_democratic_republic: \"181-123-000-000-000-000-000\",\n lebanon: \"181-124-000-000-000-000-000\",\n lesotho: \"181-125-000-000-000-000-000\",\n liberia: \"181-126-000-000-000-000-000\",\n libya: \"181-127-000-000-000-000-000\",\n liechtenstein: \"181-128-000-000-000-000-000\",\n lithuania: \"181-129-000-000-000-000-000\",\n luxembourg: \"181-130-000-000-000-000-000\",\n macao: \"181-131-000-000-000-000-000\",\n macedonia_the_former_yugoslav_republic_of: \"181-132-000-000-000-000-000\",\n madagascar: \"181-133-000-000-000-000-000\",\n malawi: \"181-134-000-000-000-000-000\",\n malaysia: \"181-135-000-000-000-000-000\",\n maldives: \"181-136-000-000-000-000-000\",\n mali: \"181-137-000-000-000-000-000\",\n malta: \"181-138-000-000-000-000-000\",\n marshall_islands: \"181-139-000-000-000-000-000\",\n martinique: \"181-140-000-000-000-000-000\",\n mauritania: \"181-141-000-000-000-000-000\",\n mauritius: \"181-142-000-000-000-000-000\",\n mayotte: \"181-143-000-000-000-000-000\",\n mexico: \"181-144-000-000-000-000-000\",\n micronesia_federated_states_of: \"181-145-000-000-000-000-000\",\n moldova_republic_of: \"181-146-000-000-000-000-000\",\n monaco: \"181-147-000-000-000-000-000\",\n mongolia: \"181-148-000-000-000-000-000\",\n montenegro: \"181-149-000-000-000-000-000\",\n montserrat: \"181-150-000-000-000-000-000\",\n morocco: \"181-151-000-000-000-000-000\",\n mozambique: \"181-152-000-000-000-000-000\",\n myanmar: \"181-153-000-000-000-000-000\",\n namibia: \"181-154-000-000-000-000-000\",\n nauru: \"181-155-000-000-000-000-000\",\n nepal: \"181-156-000-000-000-000-000\",\n netherlands: \"181-157-000-000-000-000-000\",\n new_caledonia: \"181-158-000-000-000-000-000\",\n new_zealand: \"181-159-000-000-000-000-000\",\n nicaragua: \"181-160-000-000-000-000-000\",\n niger: \"181-161-000-000-000-000-000\",\n nigeria: \"181-162-000-000-000-000-000\",\n niue: \"181-163-000-000-000-000-000\",\n norfolk_island: \"181-164-000-000-000-000-000\",\n northern_mariana_islands: \"181-165-000-000-000-000-000\",\n norway: \"181-166-000-000-000-000-000\",\n oman: \"181-167-000-000-000-000-000\",\n pakistan: \"181-168-000-000-000-000-000\",\n palau: \"181-169-000-000-000-000-000\",\n palestine_state_of: \"181-170-000-000-000-000-000\",\n panama: \"181-171-000-000-000-000-000\",\n papua_new_guinea: \"181-172-000-000-000-000-000\",\n paraguay: \"181-173-000-000-000-000-000\",\n peru: \"181-174-000-000-000-000-000\",\n philippines: \"181-175-000-000-000-000-000\",\n pitcairn: \"181-176-000-000-000-000-000\",\n poland: \"181-177-000-000-000-000-000\",\n portugal: \"181-178-000-000-000-000-000\",\n puerto_rico: \"181-179-000-000-000-000-000\",\n qatar: \"181-180-000-000-000-000-000\",\n reunion: \"181-181-000-000-000-000-000\",\n romania: \"181-182-000-000-000-000-000\",\n russian_federation: \"181-183-000-000-000-000-000\",\n saint_barthelemy: \"181-184-000-000-000-000-000\",\n rwanda: \"181-185-000-000-000-000-000\",\n saint_helena_ascension_and_tristan_da_cunha: \"181-186-000-000-000-000-000\",\n saint_kitts_and_nevis: \"181-187-000-000-000-000-000\",\n saint_lucia: \"181-188-000-000-000-000-000\",\n saint_martin_french_part: \"181-189-000-000-000-000-000\",\n saint_pierre_and_miquelon: \"181-190-000-000-000-000-000\",\n saint_vincent_and_the_grenadines: \"181-191-000-000-000-000-000\",\n samoa: \"181-192-000-000-000-000-000\",\n san_marino: \"181-193-000-000-000-000-000\",\n sao_tome_and_principe: \"181-194-000-000-000-000-000\",\n saudi_arabia: \"181-195-000-000-000-000-000\",\n senegal: \"181-196-000-000-000-000-000\",\n serbia: \"181-197-000-000-000-000-000\",\n seychelles: \"181-198-000-000-000-000-000\",\n sierra_leone: \"181-199-000-000-000-000-000\",\n singapore: \"181-200-000-000-000-000-000\",\n sint_maarten_dutch_part: \"181-201-000-000-000-000-000\",\n slovakia: \"181-202-000-000-000-000-000\",\n slovenia: \"181-203-000-000-000-000-000\",\n solomon_islands: \"181-204-000-000-000-000-000\",\n somalia: \"181-205-000-000-000-000-000\",\n south_africa: \"181-206-000-000-000-000-000\",\n south_georgia_and_the_south_sandwich_islands: \"181-207-000-000-000-000-000\",\n south_sudan: \"181-208-000-000-000-000-000\",\n spain: \"181-209-000-000-000-000-000\",\n sri_lanka: \"181-210-000-000-000-000-000\",\n sudan: \"181-211-000-000-000-000-000\",\n suriname: \"181-212-000-000-000-000-000\",\n svalbard_and_jan_mayen: \"181-213-000-000-000-000-000\",\n eswatini: \"181-214-000-000-000-000-000\",\n switzerland: \"181-215-000-000-000-000-000\",\n sweden: \"181-216-000-000-000-000-000\",\n syrian_arab_republic: \"181-217-000-000-000-000-000\",\n taiwan_province_of_china: \"181-218-000-000-000-000-000\",\n tajikistan: \"181-219-000-000-000-000-000\",\n tanzania_united_republic_of: \"181-220-000-000-000-000-000\",\n thailand: \"181-221-000-000-000-000-000\",\n timor_leste: \"181-222-000-000-000-000-000\",\n togo: \"181-223-000-000-000-000-000\",\n tokelau: \"181-224-000-000-000-000-000\",\n tonga: \"181-225-000-000-000-000-000\",\n trinidad_and_tobago: \"181-226-000-000-000-000-000\",\n tunisia: \"181-227-000-000-000-000-000\",\n turkey: \"181-228-000-000-000-000-000\",\n turkmenistan: \"181-229-000-000-000-000-000\",\n turks_and_caicos_islands: \"181-230-000-000-000-000-000\",\n uganda: \"181-231-000-000-000-000-000\",\n tuvalu: \"181-232-000-000-000-000-000\",\n ukraine: \"181-233-000-000-000-000-000\",\n united_arab_emirates: \"181-234-000-000-000-000-000\",\n united_kingdom: \"181-235-000-000-000-000-000\",\n united_states: \"181-236-000-000-000-000-000\",\n united_states_minor_outlying_islands: \"181-237-000-000-000-000-000\",\n uruguay: \"181-238-000-000-000-000-000\",\n uzbekistan: \"181-239-000-000-000-000-000\",\n vanuatu: \"181-240-000-000-000-000-000\",\n venezuela_bolivarian_republic_of: \"181-241-000-000-000-000-000\",\n viet_nam: \"181-242-000-000-000-000-000\",\n virgin_islands_british: \"181-243-000-000-000-000-000\",\n virgin_islands_u_s: \"181-244-000-000-000-000-000\",\n wallis_and_futuna: \"181-245-000-000-000-000-000\",\n western_sahara: \"181-246-000-000-000-000-000\",\n yemen: \"181-247-000-000-000-000-000\",\n zambia: \"181-248-000-000-000-000-000\",\n zimbabwe: \"181-249-000-000-000-000-000\",\n non_us_unspecified: \"181-250-000-000-000-000-000\",\n} as const;\n\nexport type CountryKey = keyof typeof CountryKeys;\n\n/**\n * Key → positional code map for the `determination_helper_categories` CVC domain (CVC-231, provisional-pending-notion-ratification). The four-section frame an advocate reasons through when assessing a trafficking determination — § I Subject and Scope (5) · § II Activity (20) · § III Means (24) · § IV Status (4) = 53 rows, all selectable, plus the authored 3-value missingness set. `coding_mode: multi_label` — one event may carry several category codes at once (canonical example: nude photos in an escort ad = `2.2.1` + `2.1.3`), so consumers MUST model this as a multi-select. Positional codes are DERIVED from the canonical DOTTED codes rather than minted: each dotted component becomes one 3-digit segment, left to right (`2.1.1` → `231-002-001-001-000-000-000`), and the dotted code also rides on every entry verbatim as `canonicalCode` — reconcile the canonical `feeds_dh_subdomain_crossref` on that field, not on the key.\n *\n * Domain: `determination_helper_categories` · Version: 1.0.0 · Entries: 57\n */\nexport const DeterminationHelperCategoryKeys = {\n missingness_root: \"231-000-000-000-000-000-000\",\n unknown: \"231-000-000-000-000-000-001\",\n anonymous: \"231-000-000-000-000-000-002\",\n data_not_collected: \"231-000-000-000-000-000-003\",\n subject_and_scope: \"231-001-000-000-000-000-000\",\n subjects: \"231-001-001-000-000-000-000\",\n roles: \"231-001-002-000-000-000-000\",\n time_scope: \"231-001-003-000-000-000-000\",\n age: \"231-001-004-000-000-000-000\",\n activity_action: \"231-002-000-000-000-000-000\",\n commercial_sex_activity: \"231-002-001-000-000-000-000\",\n commercial_sex_act_csa_linked_sex_act: \"231-002-001-001-000-000-000\",\n commercial_sex_solicitation_booking_or_arrangement: \"231-002-001-002-000-000-000\",\n commercial_sex_advertising_promotion: \"231-002-001-003-000-000-000\",\n other_commercial_sex_activity: \"231-002-001-004-000-000-000\",\n sexualized_content_sexual_performance_sexual_communications: \"231-002-002-000-000-000-000\",\n sexually_explicit_photo_video_image_activity: \"231-002-002-001-000-000-000\",\n online_sexual_performance_interactive_sexual_content: \"231-002-002-002-000-000-000\",\n in_person_sexualized_performance_appearance_based_activity: \"231-002-002-003-000-000-000\",\n sexual_or_romantic_communications_with_exploitation_relevance: \"231-002-002-004-000-000-000\",\n other_sexualized_content_performance_or_communication: \"231-002-002-005-000-000-000\",\n sexual_victimization_abuse: \"231-002-003-000-000-000-000\",\n labor_or_services: \"231-002-004-000-000-000-000\",\n debt_related_work_pledged_services_debt_repayment_arrangement: \"231-002-004-001-000-000-000\",\n adverse_work_labor_conditions: \"231-002-004-002-000-000-000\",\n criminalized_or_illicit_tasks: \"231-002-004-003-000-000-000\",\n recruitment_monitoring_or_control_of_others_as_assigned_activity: \"231-002-004-004-000-000-000\",\n other_labor_or_services_activity: \"231-002-004-005-000-000-000\",\n facilitation_operational_activities: \"231-002-005-000-000-000-000\",\n victim_vulnerabilities: \"231-003-000-000-000-000-000\",\n industry_novelty: \"231-003-001-000-000-000-000\",\n childhood_household_challenges: \"231-003-002-000-000-000-000\",\n experienced_traumas: \"231-003-003-000-000-000-000\",\n socioeconomic_circumstances: \"231-003-004-000-000-000-000\",\n behavioral_health_risks: \"231-003-005-000-000-000-000\",\n aggregated_prior_risk: \"231-003-006-000-000-000-000\",\n scheme_plan_pattern: \"231-004-000-000-000-000-000\",\n control: \"231-004-001-000-000-000-000\",\n deprivation: \"231-004-002-000-000-000-000\",\n resistance_reduction: \"231-004-003-000-000-000-000\",\n climate_of_fear: \"231-004-004-000-000-000-000\",\n threats: \"231-004-005-000-000-000-000\",\n harm_consequence_to_fear: \"231-005-000-000-000-000-000\",\n economic_housing: \"231-005-001-000-000-000-000\",\n family: \"231-005-002-000-000-000-000\",\n physical_sexual_emotional: \"231-005-003-000-000-000-000\",\n threat_of_harm: \"231-005-004-000-000-000-000\",\n legal_immigration: \"231-005-005-000-000-000-000\",\n fraud_financial_exploitation: \"231-006-000-000-000-000-000\",\n unusual_work_circumstances: \"231-006-001-000-000-000-000\",\n exploitative_working_conditions: \"231-006-002-000-000-000-000\",\n wage_earnings_exploitation: \"231-006-003-000-000-000-000\",\n deception_about_work: \"231-006-004-000-000-000-000\",\n victim_offender_status: \"231-007-000-000-000-000-000\",\n ht_determination_exploitation_type: \"231-007-001-000-000-000-000\",\n victim_status: \"231-007-002-000-000-000-000\",\n offender_status: \"231-007-003-000-000-000-000\",\n} as const;\n\nexport type DeterminationHelperCategoryKey = keyof typeof DeterminationHelperCategoryKeys;\n\n/**\n * Key → positional code map for the `trafficking_relevant_role` CVC domain (CVC-235, canonical). The 4 top-level supply/demand/enabling/adjacent roles: worker_provider, facilitator_controller, buyer_client_direct_beneficiary, other_associate. Asserting a role does NOT assert victim or offender status.\n *\n * Domain: `trafficking_relevant_role` · Version: 1.0.0 · Entries: 8\n */\nexport const TraffickingRelevantRoleKeys = {\n missingness_root: \"235-000-000-000-000-000-000\",\n unknown: \"235-000-000-000-000-000-001\",\n anonymous: \"235-000-000-000-000-000-002\",\n data_not_collected: \"235-000-000-000-000-000-003\",\n worker_provider: \"235-001-000-000-000-000-000\",\n facilitator_controller: \"235-002-000-000-000-000-000\",\n buyer_client_direct_beneficiary: \"235-003-000-000-000-000-000\",\n other_associate: \"235-004-000-000-000-000-000\",\n} as const;\n\nexport type TraffickingRelevantRoleKey = keyof typeof TraffickingRelevantRoleKeys;\n\n/**\n * Key → positional code map for the `why_nots` CVC domain (CVC-219, canonical; SOT v1.1.0 GENERATED from prototype canon `data/cvcs/core_why_nots.yaml` by scripts/gen-why-nots.py). WHY a needed referral/service was not arranged. Two levels: 7 selectable buckets (the stored `closed_why_not_code`, canon token on `canonicalCode`) + 20 selectable subtype leaves (the optional `closed_why_not_subcode`) + the Level-0 UNK / ANON / DNC triplet. Every entry carries `reportingAxis` (system_barrier · respected_choice · workflow · unknown) and the LEAF'S AXIS WINS OVER ITS BUCKET'S — classify with `whyNotReportingAxis()`. `unknc` (UNKNC) is deprecated: it reads as `unknown` (UNK).\n *\n * Domain: `why_nots` · Version: 1.1.0 · Entries: 32\n */\nexport const WhyNotKeys = {\n missingness_root: \"219-000-000-000-000-000-000\",\n unknown: \"219-000-000-000-000-000-001\",\n anonymous: \"219-000-000-000-000-000-002\",\n data_not_collected: \"219-000-000-000-000-000-003\",\n bkt_fit: \"219-001-000-000-000-000-000\",\n fit_mh: \"219-001-001-000-000-000-000\",\n fit_sud: \"219-001-002-000-000-000-000\",\n fit_other: \"219-001-003-000-000-000-000\",\n bkt_access: \"219-002-000-000-000-000-000\",\n access_lang: \"219-002-001-000-000-000-000\",\n access_cult: \"219-002-002-000-000-000-000\",\n access_dis: \"219-002-003-000-000-000-000\",\n access_deaf: \"219-002-004-000-000-000-000\",\n access_cc: \"219-002-005-000-000-000-000\",\n access_trans: \"219-002-006-000-000-000-000\",\n access_hours: \"219-002-007-000-000-000-000\",\n bkt_cap: \"219-003-000-000-000-000-000\",\n bkt_res: \"219-004-000-000-000-000-000\",\n bkt_elig: \"219-005-000-000-000-000-000\",\n bkt_choice: \"219-006-000-000-000-000-000\",\n decl: \"219-006-001-000-000-000-000\",\n rules: \"219-006-002-000-000-000-000\",\n selfres: \"219-006-003-000-000-000-000\",\n bkt_other: \"219-007-000-000-000-000-000\",\n int: \"219-007-001-000-000-000-000\",\n xfer: \"219-007-002-000-000-000-000\",\n def: \"219-007-003-000-000-000-000\",\n noresp: \"219-007-004-000-000-000-000\",\n safe: \"219-007-005-000-000-000-000\",\n coi: \"219-007-006-000-000-000-000\",\n other: \"219-007-007-000-000-000-000\",\n unknc: \"219-007-008-000-000-000-000\",\n} as const;\n\nexport type WhyNotKey = keyof typeof WhyNotKeys;\n\n/**\n * Key → positional code map for the `assertion_status` CVC domain (CVC-336 `core-assertion_status`, canonical). WHERE a claim (CAR) stands: draft · active · superseded · retracted · discarded. System-stamped, never picked; level-0 absent by ruling. isCommitted = status ∉ {draft, discarded}.\n *\n * Domain: `assertion_status` · Version: 2.0.0 · Entries: 5\n */\nexport const AssertionStatusKeys = {\n draft: \"336-001-000-000-000-000-000\",\n active: \"336-002-000-000-000-000-000\",\n superseded: \"336-003-000-000-000-000-000\",\n retracted: \"336-004-000-000-000-000-000\",\n discarded: \"336-005-000-000-000-000-000\",\n} as const;\n\nexport type AssertionStatusKey = keyof typeof AssertionStatusKeys;\n\n/**\n * Key → positional code map for the `car_correction_reason` CVC domain (CVC-337 `core-car_correction_reason`, canonical). WHY a CAR was retracted or superseded — entered_in_error · duplicate · superseded_externally · removed_by_recipient_curation · answer_withdrawn (2.1.0, 2026-10-17: the answer itself moved) — stamped on the retired row; required at the act, so level-0 is absent by ruling.\n *\n * Domain: `car_correction_reason` · Version: 2.1.0 · Entries: 5\n */\nexport const CarCorrectionReasonKeys = {\n entered_in_error: \"337-001-000-000-000-000-000\",\n duplicate: \"337-002-000-000-000-000-000\",\n superseded_externally: \"337-003-000-000-000-000-000\",\n removed_by_recipient_curation: \"337-004-000-000-000-000-000\",\n answer_withdrawn: \"337-005-000-000-000-000-000\",\n} as const;\n\nexport type CarCorrectionReasonKey = keyof typeof CarCorrectionReasonKeys;\n\n/**\n * Key → positional code map for the `created_by_system` CVC domain (GDR §10.1 `core - created_by_system`; creating actor class; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `created_by_system` · Version: 1.0.0 · Entries: 8\n */\nexport const CreatedBySystemKeys = {\n missingness_root: \"986-000-000-000-000-000-000\",\n unknown: \"986-000-000-000-000-000-001\",\n anonymous: \"986-000-000-000-000-000-002\",\n data_not_collected: \"986-000-000-000-000-000-003\",\n human: \"986-001-000-000-000-000-000\",\n integration: \"986-002-000-000-000-000-000\",\n rules_engine: \"986-003-000-000-000-000-000\",\n model: \"986-004-000-000-000-000-000\",\n} as const;\n\nexport type CreatedBySystemKey = keyof typeof CreatedBySystemKeys;\n\n/**\n * Key → positional code map for the `subject_type` CVC domain (GDR §10.1 `core - subject_type`; assertion subject type; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `subject_type` · Version: 1.0.0 · Entries: 7\n */\nexport const SubjectTypeKeys = {\n missingness_root: \"987-000-000-000-000-000-000\",\n unknown: \"987-000-000-000-000-000-001\",\n anonymous: \"987-000-000-000-000-000-002\",\n data_not_collected: \"987-000-000-000-000-000-003\",\n person: \"987-001-000-000-000-000-000\",\n relationship: \"987-002-000-000-000-000-000\",\n case: \"987-003-000-000-000-000-000\",\n} as const;\n\nexport type SubjectTypeKey = keyof typeof SubjectTypeKeys;\n\n/**\n * Key → positional code map for the `minor_adult_status` CVC domain (GDR §10.1 `core - minor_adult_status`; age band at event; PROVISIONAL at 988 — canonical CVC-61 exists in the index but its Notion codebook is empty, see ADR-CVC-0.8.13 NARRATIVE_ONLY; renumber 988→61 on Notion authoring).\n *\n * Domain: `minor_adult_status` · Version: 1.0.0 · Entries: 7\n */\nexport const MinorAdultStatusKeys = {\n missingness_root: \"988-000-000-000-000-000-000\",\n unknown: \"988-000-000-000-000-000-001\",\n anonymous: \"988-000-000-000-000-000-002\",\n data_not_collected: \"988-000-000-000-000-000-003\",\n minor: \"988-001-000-000-000-000-000\",\n adult: \"988-002-000-000-000-000-000\",\n indeterminate: \"988-003-000-000-000-000-000\",\n} as const;\n\nexport type MinorAdultStatusKey = keyof typeof MinorAdultStatusKeys;\n\n/**\n * Key → positional code map for the `criminal_org_category` CVC domain (WIKI 7-type taxonomy for the criminal-org registry; ported from prototype/data/cvcs/core_criminal_org_category.yaml; PROVISIONAL at 990 — net-new, PENDING canonical Notion authoring).\n *\n * Domain: `criminal_org_category` · Version: 1.0.0 · Entries: 11\n */\nexport const CriminalOrgCategoryKeys = {\n missingness_root: \"990-000-000-000-000-000-000\",\n unknown: \"990-000-000-000-000-000-001\",\n anonymous: \"990-000-000-000-000-000-002\",\n data_not_collected: \"990-000-000-000-000-000-003\",\n street_gang: \"990-001-000-000-000-000-000\",\n prison_gang: \"990-002-000-000-000-000-000\",\n outlaw_motorcycle_gang: \"990-003-000-000-000-000-000\",\n tco_cartel: \"990-004-000-000-000-000-000\",\n white_supremacist_extremist: \"990-005-000-000-000-000-000\",\n organized_crime_family: \"990-006-000-000-000-000-000\",\n familial_or_independent_trafficking_network: \"990-007-000-000-000-000-000\",\n} as const;\n\nexport type CriminalOrgCategoryKey = keyof typeof CriminalOrgCategoryKeys;\n","/**\n * @htilabs/platform-common-models — CVC-133 evaluable function keys\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.\n *\n * The keys of coreFunctions.v1.5.0.json whose canon flags are v1 && !retired\n * (canon @ d63c2a42): the only functions the shared authorization resolver\n * evaluates (rule 8). GATE I asserts this equals the SOT.\n */\n\nexport const CORE_FUNCTIONS_EVALUABLE_SOT_VERSION = \"1.5.0\";\n\nexport const CORE_FUNCTIONS_EVALUABLE_KEYS: readonly string[] = [\n \"agency_info_manage\",\n \"announcement_publish\",\n \"api_key_manage\",\n \"assessments_conduct\",\n \"auth_model_manage_platform\",\n \"case_assign_reassign\",\n \"case_claim\",\n \"case_close\",\n \"case_collaborator_add\",\n \"case_edit\",\n \"case_needs_action_flag_manage\",\n \"case_reopen\",\n \"case_side_panel_use\",\n \"case_status_manage\",\n \"case_transfer_bulk\",\n \"case_view\",\n \"case_visibility_manage\",\n \"ci_periodic_review\",\n \"ci_record_purge_or_retire\",\n \"ci_record_validate\",\n \"ci_to_evidence_export_authorize\",\n \"deconfliction_alert_acknowledge\",\n \"deconfliction_unmask\",\n \"determination_perform\",\n \"disclose_external_request\",\n \"enrollment_manage\",\n \"exit_discharge_conduct\",\n \"export_deidentified\",\n \"goals_plan_manage\",\n \"idb_record_create\",\n \"indicator_manual_add\",\n \"investigation_create_claim\",\n \"investigation_session_run\",\n \"investigative_database_search\",\n \"investigative_request_send\",\n \"lead_create\",\n \"lead_publish\",\n \"lead_route_assign\",\n \"lead_triage_manage\",\n \"magic_link_share_send\",\n \"mandatory_report_send\",\n \"member_account_report_generate\",\n \"member_onboarding_support\",\n \"message_moderate\",\n \"message_send\",\n \"milestone_log\",\n \"needs_priorities_conduct\",\n \"network_corpus_access\",\n \"note_open_departed_author\",\n \"onboarding_config_sign_off\",\n \"open_source_search\",\n \"person_association_update\",\n \"person_merge_manage\",\n \"platform_perm_modify\",\n \"profile_domain_edit\",\n \"record_activity_view\",\n \"record_print\",\n \"referral_receive_external\",\n \"referral_receive_internal\",\n \"referral_send_external\",\n \"referral_send_internal\",\n \"roi_submit_manage\",\n \"role_assign\",\n \"roles_accounts_toggle\",\n \"sandbox_environment_manage\",\n \"screening_conduct\",\n \"screening_view\",\n \"service_log_manage\",\n \"session_create\",\n \"share_config\",\n \"share_revoke\",\n \"share_rule_approve_cross_agency\",\n \"share_vsp_to_le\",\n \"srl_manage\",\n \"supervisee_thread_view\",\n \"support_ticket_triage\",\n \"system_diagnostics_view\",\n \"team_config_manage\",\n \"team_membership_manage\",\n \"team_share_narrowing\",\n \"team_workflow_config_manage\",\n \"training_gate_manage\",\n \"usr_manage\",\n \"viewing_config_manage\",\n \"viewing_level_1_search\",\n \"viewing_level_2_autocomplete\",\n \"viewing_level_3_components\",\n];\n","/**\n * Defensive reads of stored authz rows — INTERNAL to `./authz` (not exported\n * from the barrel). `resolveEffectiveFunctions` and `functionDoor` both read\n * `platformRoles` / `platformFunctions` rows through these, so the door's\n * \"is this role bound?\" and the resolver's Tier-1 read can never disagree.\n * Moved verbatim out of resolveEffectiveFunctions.ts (0.48.0); behaviour\n * unchanged.\n */\n\nimport {\n DEFAULT_BOUND_STATE,\n PERMISSION_STATE,\n type PermissionStateValue,\n} from \"../constants/platform-auth.js\";\n\nexport type StoredMap = Readonly<Record<string, unknown>>;\n\n/** A container read: not set, a usable plain object, or malformed. */\nexport type Container =\n | { readonly kind: \"absent\" }\n | { readonly kind: \"malformed\" }\n | {\n readonly kind: \"map\";\n readonly map: StoredMap;\n };\n\nexport const ABSENT: Container = { kind: \"absent\" };\nexport const MALFORMED: Container = { kind: \"malformed\" };\n\nexport function isPlainObject(v: unknown): v is StoredMap {\n if (v === null || typeof v !== \"object\") return false;\n const proto: unknown = Object.getPrototypeOf(v);\n return proto === Object.prototype || proto === null;\n}\n\nexport function readContainer(v: unknown): Container {\n if (v === undefined || v === null) return ABSENT;\n return isPlainObject(v) ? { kind: \"map\", map: v } : MALFORMED;\n}\n\n/** An own property of a plain-object map (never an inherited key). */\nexport function own(map: StoredMap, key: string): unknown {\n return Object.hasOwn(map, key) ? map[key] : undefined;\n}\n\nconst STATES: ReadonlySet<string> = new Set<string>(Object.values(PERMISSION_STATE));\n\n/**\n * One stored state: not set, a recognised state, or `\"malformed\"`. The\n * codebook's `NA` (\"Not relevant\") is a recognised value, not a malformed one\n * (a platform that seeds from CORE_FUNCTION_DEFAULT_BOUNDS stores it\n * verbatim), and it is read as NEVER: non-grantable at every tier.\n */\nexport function readState(\n map: StoredMap,\n code: string,\n): PermissionStateValue | \"malformed\" | undefined {\n const v = own(map, code);\n if (v === undefined || v === null) return undefined;\n if (v === DEFAULT_BOUND_STATE.NA) return PERMISSION_STATE.NEVER;\n return typeof v === \"string\" && STATES.has(v) ? (v as PermissionStateValue) : \"malformed\";\n}\n\n/**\n * The Tier-1 state one role row's `functions` container gives `code`:\n * `undefined` when UNBOUND (or the container is absent); a malformed stored\n * state reads NEVER and a stored NA reads NEVER (`readState`). A malformed\n * CONTAINER is the caller's check (the role grants nothing).\n */\nexport function tier1State(\n roleFunctions: Container,\n code: string,\n): PermissionStateValue | undefined {\n const listed = roleFunctions.kind === \"map\" ? readState(roleFunctions.map, code) : undefined;\n if (listed === undefined) return undefined;\n return listed === \"malformed\" ? PERMISSION_STATE.NEVER : listed;\n}\n\n/**\n * True when the role row's `functions` container stores the codebook's `NA`\n * (\"Not relevant\") for `code` — the raw value `tier1State` reads as NEVER.\n * Only `explainFunctionRefusal` asks: the grant is the same either way, but\n * the prototype tells a Not-relevant seat a different sentence than a Never one.\n */\nexport function tier1IsNotApplicable(roleFunctions: Container, code: string): boolean {\n return roleFunctions.kind === \"map\" && own(roleFunctions.map, code) === DEFAULT_BOUND_STATE.NA;\n}\n\n/**\n * The code a `platformFunctions` row keeps in the vocabulary, or `null`: the\n * row must be a plain object with a string `code`, and its `retired` must be\n * absent or exactly `false`. Canon narrowing (`isCanonEvaluableFunction`) is\n * the caller's.\n */\nexport function catalogRowCode(row: unknown): string | null {\n if (!isPlainObject(row)) return null;\n const code = own(row, \"code\");\n const retired = own(row, \"retired\");\n if (typeof code !== \"string\") return null;\n if (retired !== undefined && retired !== false) return null;\n return code;\n}\n","/**\n * @htilabs/platform-common-models — the shared CVC-133 authorization resolver\n *\n * ONE pure function that every app (Thread · PAVE 2.0 · platform) calls to turn\n * a seat's roles and the stored platform / agency / team policies into the set\n * of CVC-133 function codes the seat may perform. No I/O and no mongoose: each\n * app keeps only a loader that reads the platform-written collections and hands\n * the rows in. Browser-safe entry: `@htilabs/platform-common-models/authz`.\n *\n * Spec: records repo (`htilabstech/prototype`) `KICKOFF_SHARED_AUTHZ_RESOLVER_2026-10-12.md`\n * § 3 (the ruled model) and § 4.1 (this file). Line cites below are to the\n * platform prototype (`htilabstech/platform-prototype` @ af10119)\n * `src/agencyhub.jsx` `authzResolve` unless they name another file;\n * `policyResolver.js` / `proxy/route.ts` cites are to `htilabstech/platform`\n * develop @ ccf8da3.\n *\n * THE RULES (kickoff § 3 numbering)\n *\n * 1. Layers intersect and clamp downward: effective = platform ∩ agency ∩\n * team (CAM, Notion 27f1ef14abcd8016accaca50780b2906; the devs' \"3-Tier HTI\n * Platform Permission Model\", Notion 32c1ef14abcd80f0933ec66638bcc300:\n * \"The most restrictive applicable setting wins. Access is always clamped\n * downward, never expanded upward\"). Per role: the platform state (Tier 1)\n * is the base; the agency may move an unlocked state (Tier 2,\n * `agencyhub.jsx:601-624` — an account may switch a Default-Off function on\n * or require it, or switch a Default-On one off); the team may only take a\n * grant away (rule 4). The user-restriction, training, clearance, legal-basis\n * and purpose layers (`:629-693`) are not inputs here (CAM layers the dev\n * model has no data for yet, inventory resolvers.md D6).\n * 2. Roles union at the user level; NEVER is local to its role. A function is\n * granted when ANY assigned role's own cascade grants it; a role whose\n * cascade ends at NEVER / Default-Off simply contributes nothing — it never\n * vetoes another role's grant (`:566-589`, Crysta 2026-08-09 \"grants are\n * computed first\"; restated 2026-10-12 \"roles stack\").\n * UNBOUND IS INELIGIBLE (co-p1x, aligned to canon): a role whose Tier-1\n * row carries no state for a function is not eligible for it — the\n * prototype returns `role_ineligible` before any agency layer runs\n * (`:578-584`), so neither an agency override nor a team policy can turn\n * an unbound pair on. For that role it is NEVER, and like every NEVER it\n * is local to the role. (The dev resolvers' tool-overlap default — an\n * unlisted function reading PREF_NO when it shares one of the role's\n * tools, `policyResolver.js:33-40` — is not encoded: it let an agency\n * enable a pair the codebook never bound.) A stored `NA` (the codebook's\n * \"Not relevant\", `DEFAULT_BOUND_STATE.NA`) is read as NEVER at every\n * tier: non-grantable, and locked at Tier 1.\n * 3. Required is immune to the team gate: a state that is ALWAYS after\n * Tier 1 + Tier 2 (platform ALWAYS, or an agency that escalated the role to\n * ALWAYS) is not team-gated (dev model: \"locked\" states skip Tier 3,\n * `platform/lib/utils/policyResolver.js:58-72`; prototype `:625` \"agency\n * cannot disable\"). NEVER at Tier 1 / Tier 2 is immune to a team lift —\n * a Tier-1 ALWAYS / NEVER also ignores the agency layer\n * (`policyResolver.js:46-48`). The prototypes now behave the same way:\n * platform-prototype `authzResolve` since #492 (2026-11-03), and the\n * records monolith `shareFunctionAccess` plus the LEADS app\n * `resolveEffectiveAccess` since prototype #1050 (2026-11-09). Before\n * those ships the prototypes still ran the team check for `required`;\n * this resolver encoded the ruling first.\n * 4. The team layer is RESTRICT-ONLY (`:626-628` \"teams are workflow\n * containers, never authority\"; editor log lines `:1236` / `:4490` \"it never\n * grants\"; UDD Team object, Notion 3ec1ef14abcd814385e4c4e84e071178: \"If a\n * team enables a function, but a user's role does not permit that function,\n * the user does not gain access to it through team membership\"). A team\n * PREF_NO (or a NEVER, which the platform's own write path refuses from a\n * team, `app/api/admin/proxy/route.ts:900`, but which is honoured\n * fail-closed) takes the grant away; a team PREF_YES or ALWAYS is\n * ignored — it never lifts a Default-Off or an agency switch-off. The\n * policy's role-grain `roles[]` and flat `functions` maps are both team\n * restrictions: either one switching a function off is enough.\n * 5. One acting team per resolution: the seat's primary team (`team_id` =\n * `team_ids[0]`, `setUserTeams` `:3228`; `authzForCurrentUser` passes the\n * single `u.team_id`, `:734`), or a verified acting team the request\n * carries (pave-2.0 team-scope precedence ADR, Notion\n * 3921ef14abcd814ca839c1e7c3a57485). The caller resolves that ONE team's\n * policy and passes it as `teamPolicy` — see `selectActingTeamId`. No team,\n * or a team with no policy, is an explicit pass-through (ruling 3c, `:626`).\n * 8. Unknown / retired / not-v1 functions are denied (`:556` \"unknown function\n * — deny by default\", `:557` retired, `:558` not-v1) — decided by the canon\n * this package ships, not by the caller's rows. The prototype checks its\n * injected canon registry (`HTI_CORE_FUNCTIONS`, `:552-558`); here that is\n * the CVC-133 SOT (`coreFunctions.v1.5.0.json`, whose `v1` / `retired`\n * booleans are canon's own row flags), read through the slim generated key\n * set `CORE_FUNCTIONS_EVALUABLE_KEYS` (v1 && !retired; GATE I asserts it\n * equals the SOT) and intersected with `CoreFunctionsKeys`. No assigned\n * roles, or none that resolve to a role row, yields the empty set.\n *\n * FAIL-CLOSED ON MALFORMED STORED DATA (ruled 2026-10-13, co-zo3 review and\n * verification rounds). Every input is read defensively, so malformed data\n * makes `resolveEffectiveFunctions` deny, never throw:\n * - an `input` that is not an object, or a `roles` / `functions` /\n * `assignedRoleCodes` that is not an array (null, a number, a string —\n * never split into characters), resolves to `[]`;\n * - a present state that is not one of the four PERMISSION_STATE values (or\n * `NA`, read as NEVER) is NEVER at Tier 1, NEVER at Tier 2 (for that\n * role), and a restriction at Tier 3; `undefined` and `null` mean \"not\n * set\" — which at Tier 1 is unbound, i.e. ineligible;\n * - a state CONTAINER that is present but not a plain object (an array, a\n * string, a Map, …) fails closed for everything it could govern: a role's\n * `functions` → the role grants nothing; the agency's map, or one role's\n * entry in it → NEVER for every unlocked state it covers; the team policy,\n * its `functions`, or its `roles` list → every team-gated grant restricted;\n * one role's `overrides` → that role's team-gated grants restricted;\n * - a `teamPolicy.roles` entry that is not an object with a string `roleCode`\n * cannot be attributed to a role, so it restricts every role's team-gated\n * grants; duplicate entries for one role are unioned (any off wins);\n * - a catalog row's `retired` keeps the function only when it is absent or\n * exactly `false`;\n * - Required (rule 3) stays immune to every team-side restriction.\n *\n * Rules 6 (app access is not a function) and 7 (vocabulary vs policy state)\n * are about what the inputs are, not about this computation.\n */\n\nimport {\n PERMISSION_STATE,\n type DefaultBoundStateValue,\n type PermissionStateValue,\n} from \"../constants/platform-auth.js\";\nimport { CoreFunctionsKeys } from \"../generated/cvc-enums.js\";\nimport { CORE_FUNCTIONS_EVALUABLE_KEYS } from \"../generated/coreFunctionsEvaluable.js\";\nimport {\n ABSENT,\n catalogRowCode,\n isPlainObject,\n own,\n readContainer,\n readState,\n tier1IsNotApplicable,\n tier1State,\n type Container,\n type StoredMap,\n} from \"./storedReads.js\";\n\n// ─── Canon (rule 8) ─────────────────────────────────────────────────────────\n\nconst CANON_EVALUABLE: ReadonlySet<string> = new Set(\n CORE_FUNCTIONS_EVALUABLE_KEYS.filter((k) => Object.hasOwn(CoreFunctionsKeys, k)),\n);\n\n/** True when canon lets the resolver evaluate `code` at all (rule 8). */\nexport function isCanonEvaluableFunction(code: string): boolean {\n return CANON_EVALUABLE.has(code);\n}\n\n// ─── Input contract (kickoff § 4.1) ─────────────────────────────────────────\n\n/**\n * A Tier-2 (agency) or Tier-3 (team) map of function code → state, as the\n * platform stores it. Canon has no NA chip at these tiers, so the type is the\n * four PERMISSION_STATE values; a stored `NA` is still read as NEVER (fail\n * closed), never as a grant.\n */\nexport type AuthzStateMap = Readonly<Record<string, PermissionStateValue>>;\n\n/**\n * A Tier-1 (platform role) map of function code → state: a PERMISSION_STATE\n * value or the codebook's `NA` (\"Not relevant\", read as NEVER) — what a seed\n * from `CORE_FUNCTION_DEFAULT_BOUNDS` stores. An unlisted function is unbound.\n */\nexport type AuthzTier1StateMap = Readonly<Record<string, DefaultBoundStateValue>>;\n\n/**\n * One `platformRoles` row (Tier 1): the role's platform state per function.\n * A function the role does not list is UNBOUND for it: the role is ineligible\n * (NEVER for that role, locked — no agency or team layer can enable it), as\n * canon's `authzResolve` rules (`:578-584` `role_ineligible`).\n *\n * `tools` is NOT read by the resolver (since co-p1x, 0.24.0): it used to pick\n * the PREF_NO / NEVER default for an unlisted function. The field stays on the\n * contract because the platform still stores it on `platformRoles`.\n */\nexport interface AuthzRoleRow {\n readonly code: string;\n /**\n * @deprecated Ignored by the resolver since 0.24.0 (co-p1x): an unlisted\n * function is unbound, whatever tools the role and function share. Kept on\n * the contract because the platform still stores it.\n */\n readonly tools?: readonly string[];\n readonly functions?: AuthzTier1StateMap;\n}\n\n/**\n * One `platformFunctions` row: the deployment's function catalog. It can only\n * narrow canon, never widen it:\n * - a code canon does not carry, or carries as not-v1 / retired, is denied\n * even when it is listed here;\n * - `retired` other than absent / exactly `false` denies a function canon\n * still has (a deployment may stop offering one early);\n * - a canon function missing from this list is denied (it has no catalog row).\n * Any other stored field (e.g. `platformFunctions.status`) is not read: a stale\n * \"Future function (not v1)\" status never denies a function canon says is v1.\n */\nexport interface AuthzFunctionRow {\n readonly code: string;\n /**\n * @deprecated Ignored by the resolver since 0.24.0 (co-p1x). Kept on the\n * contract because the platform still stores it.\n */\n readonly tools?: readonly string[];\n readonly retired?: boolean;\n}\n\n/** One role-grain override entry, as stored in `teamAccessPolicies.roles[]`. */\nexport interface AuthzRoleOverrides {\n readonly roleCode: string;\n readonly overrides?: AuthzStateMap;\n}\n\n/**\n * The ONE acting team's `teamAccessPolicies` document (rule 5). `roles[]`\n * narrows one role; `functions` narrows every role. Both only restrict, so a\n * function is off for a role when any of them says so.\n */\nexport interface AuthzTeamPolicy {\n readonly roles?: readonly AuthzRoleOverrides[];\n readonly functions?: AuthzStateMap;\n}\n\nexport interface ResolveEffectiveFunctionsInput {\n /** Every `platformRoles` row the seat might hold (extra rows are ignored). */\n readonly roles: readonly AuthzRoleRow[];\n /** The deployment's function catalog (`platformFunctions`), narrowed by canon. */\n readonly functions: readonly AuthzFunctionRow[];\n /** The seat's assigned role codes. */\n readonly assignedRoleCodes: readonly string[];\n /** Tier 2 — the agency's overrides, `{ roleCode → { functionCode → state } }`. */\n readonly agencyOverrides?: Readonly<Record<string, AuthzStateMap>>;\n /** Tier 3 — the acting team's policy; absent / null = pass-through. */\n readonly teamPolicy?: AuthzTeamPolicy | null;\n /** Declared, not configurable: an unknown function is always denied (rule 8). */\n readonly unknownFunctionPolicy: \"deny\";\n}\n\n// ─── Defensive reads ────────────────────────────────────────────────────────\n// Shared with `functionDoor` (./storedReads.ts) so both read stored rows alike.\n\n/** Rule 4: anything but \"not set\", PREF_YES or ALWAYS restricts. */\nfunction teamValueRestricts(map: StoredMap, code: string): boolean {\n const gate = readState(map, code);\n return (\n gate !== undefined &&\n gate !== PERMISSION_STATE.PREF_YES &&\n gate !== PERMISSION_STATE.ALWAYS\n );\n}\n\n/** The acting team's policy, compiled once into restrict-only predicates. */\ninterface TeamGate {\n /** Every team-gated grant is restricted (malformed or unattributable data). */\n readonly restrictsAll: boolean;\n readonly flat: StoredMap | undefined;\n /** Every overrides map stored for a role (duplicates kept, then unioned). */\n readonly byRole: ReadonlyMap<string, readonly StoredMap[]>;\n /** Roles whose stored overrides container is malformed. */\n readonly malformedRoles: ReadonlySet<string>;\n}\n\nfunction compileTeamGate(teamPolicy: unknown): TeamGate {\n const byRole = new Map<string, StoredMap[]>();\n const malformedRoles = new Set<string>();\n const policy = readContainer(teamPolicy);\n if (policy.kind === \"absent\") {\n return { restrictsAll: false, flat: undefined, byRole, malformedRoles };\n }\n if (policy.kind === \"malformed\") {\n return { restrictsAll: true, flat: undefined, byRole, malformedRoles };\n }\n let restrictsAll = false;\n const functions = readContainer(own(policy.map, \"functions\"));\n if (functions.kind === \"malformed\") restrictsAll = true;\n const roles = own(policy.map, \"roles\");\n if (roles !== undefined && roles !== null) {\n if (!Array.isArray(roles)) restrictsAll = true;\n else {\n for (const entry of roles as unknown[]) {\n const roleCode = isPlainObject(entry) ? own(entry, \"roleCode\") : undefined;\n if (!isPlainObject(entry) || typeof roleCode !== \"string\") {\n restrictsAll = true; // cannot tell which role it narrows\n continue;\n }\n const overrides = readContainer(own(entry, \"overrides\"));\n if (overrides.kind === \"malformed\") malformedRoles.add(roleCode);\n else if (overrides.kind === \"map\") {\n const list = byRole.get(roleCode) ?? [];\n list.push(overrides.map);\n byRole.set(roleCode, list);\n }\n }\n }\n }\n return {\n restrictsAll,\n flat: functions.kind === \"map\" ? functions.map : undefined,\n byRole,\n malformedRoles,\n };\n}\n\nfunction teamRestricts(gate: TeamGate, roleCode: string, code: string): boolean {\n if (gate.restrictsAll || gate.malformedRoles.has(roleCode)) return true;\n if (gate.flat !== undefined && teamValueRestricts(gate.flat, code)) return true;\n return (gate.byRole.get(roleCode) ?? []).some((m) => teamValueRestricts(m, code));\n}\n\n// ─── Resolver ───────────────────────────────────────────────────────────────\n\n/**\n * Resolve the CVC-133 function codes a seat may perform.\n *\n * @returns sorted, de-duplicated function codes; `[]` when nothing resolves,\n * including when `input` is not an object or `roles`, `functions` or\n * `assignedRoleCodes` is not an array (never a throw; a string is\n * never iterated as characters).\n */\nexport function resolveEffectiveFunctions(\n input: ResolveEffectiveFunctionsInput,\n): string[] {\n const raw: unknown = input;\n if (!isPlainObject(raw)) return [];\n const roleRows = own(raw, \"roles\");\n const catalog = own(raw, \"functions\");\n const assigned = own(raw, \"assignedRoleCodes\");\n if (!Array.isArray(roleRows) || !Array.isArray(catalog) || !Array.isArray(assigned)) return [];\n\n const rolesByCode = new Map<string, StoredMap>();\n for (const r of roleRows as readonly unknown[]) {\n const code = isPlainObject(r) ? own(r, \"code\") : undefined;\n if (isPlainObject(r) && typeof code === \"string\") rolesByCode.set(code, r);\n }\n const heldCodes = [...new Set(assigned as readonly unknown[])].filter(\n (c): c is string => typeof c === \"string\" && rolesByCode.has(c),\n );\n if (heldCodes.length === 0) return [];\n\n // Rule 8: the catalog narrowed by canon, and by its own `retired` (only an\n // absent or exactly-false flag keeps a row).\n const vocabulary: string[] = [];\n for (const fn of catalog as readonly unknown[]) {\n const code = catalogRowCode(fn);\n if (code !== null && isCanonEvaluableFunction(code)) vocabulary.push(code);\n }\n\n const agencyAll = readContainer(input.agencyOverrides);\n const team = compileTeamGate(input.teamPolicy);\n\n const granted = new Set<string>();\n for (const roleCode of heldCodes) {\n const role = rolesByCode.get(roleCode)!;\n const roleFunctions = readContainer(own(role, \"functions\"));\n if (roleFunctions.kind === \"malformed\") continue; // Tier 1 unreadable: grants nothing\n const agency =\n agencyAll.kind === \"map\" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;\n\n for (const fn of vocabulary) {\n if (granted.has(fn)) continue; // rule 2: another role already grants it\n if (roleVerdict(roleFunctions, agency, team, roleCode, fn) === \"granted\") granted.add(fn);\n }\n }\n\n return [...granted].sort();\n}\n\n/**\n * Where ONE held role's cascade ends for ONE function (rules 1–4). The\n * resolver grants on `\"granted\"` only; `explainFunctionRefusal` reads the\n * other verdicts to say which layer refused. One cascade, so the two can\n * never disagree.\n */\ntype RoleVerdict =\n | \"granted\"\n | \"never\"\n | \"not_applicable\"\n | \"unbound\"\n | \"account_blocked\"\n | \"account_off\"\n | \"default_off\"\n | \"team_workflow\";\n\nfunction roleVerdict(\n roleFunctions: Container,\n agency: Container,\n team: TeamGate,\n roleCode: string,\n fn: string,\n): RoleVerdict {\n // Tier 1 — platform. UNBOUND (no stored state) is ineligible: the role\n // contributes nothing, before any agency or team layer (canon\n // `authzResolve` `role_ineligible`, `:578-584`). A malformed stored\n // state is NEVER; a stored NA reads NEVER (readState). Either way it is\n // local to this role (rule 2).\n const tier1 = tier1State(roleFunctions, fn);\n if (tier1 === undefined) return \"unbound\";\n if (tier1 === PERMISSION_STATE.NEVER) {\n return tier1IsNotApplicable(roleFunctions, fn) ? \"not_applicable\" : \"never\";\n }\n\n // Tier 2 — agency. Tier-1 ALWAYS / NEVER are locked (rule 3); a\n // malformed override (or container) is NEVER for this role. The stored\n // states are the account editor's four (platform `lib/utils/policyResolver.js`\n // header: Required / On / Off / Blocked = ALWAYS / PREF_YES / PREF_NO / NEVER).\n let state: PermissionStateValue = tier1;\n let override: PermissionStateValue | \"malformed\" | undefined;\n if (tier1 !== PERMISSION_STATE.ALWAYS) {\n override =\n agency.kind === \"malformed\"\n ? \"malformed\"\n : agency.kind === \"map\"\n ? readState(agency.map, fn)\n : undefined;\n if (override === \"malformed\") state = PERMISSION_STATE.NEVER;\n else if (override !== undefined) state = override;\n }\n\n if (state !== PERMISSION_STATE.ALWAYS && state !== PERMISSION_STATE.PREF_YES) {\n if (override === undefined) return \"default_off\"; // Tier-1 Default Off, no account word\n return state === PERMISSION_STATE.PREF_NO ? \"account_off\" : \"account_blocked\";\n }\n\n // Tier 3 — team, restrict-only (rule 4); Required is immune (rule 3).\n if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn)) {\n return \"team_workflow\";\n }\n\n return \"granted\";\n}\n\n// ─── Which layer refused (the door's register) ──────────────────────────────\n\n/**\n * Why `resolveEffectiveFunctions` does not grant one function to a seat, in\n * the prototype's register (records `htilabstech/prototype` @ 882e200,\n * `HTI-LEADS-PAVE-Thread-prototype.html` `shareFunctionAccess`, L339651-339719;\n * its decision order mirrors platform-prototype `authzResolve`):\n *\n * - `\"granted\"` — the resolver grants it (nothing refused).\n * - Level 1, platform bounds — no held role is bound Always / Default On /\n * Default Off: `\"never\"` (a held role is Never-bound) › `\"not_applicable\"`\n * (a held role is Not relevant) › `\"unbound\"` (no held role is bound).\n * - Level 2, the account — a held role is bound Default On / Default Off and\n * no role's account setting grants it: `\"account_blocked\"` (the account set\n * Blocked, NEVER) › `\"account_off\"` (the account set Off, PREF_NO) ›\n * `\"default_off\"` (Default Off and the account said nothing).\n * - Level 3, the team — the account layer grants it through a held role, and\n * the acting team's workflow takes it away: `\"team_workflow\"`. Required\n * (ALWAYS after Levels 1–2) is immune (rule 3), so it never lands here.\n * - `\"not_evaluable\"` — unknown / retired / not-v1 in canon, no kept catalog\n * row, or malformed input (the resolver grants nothing from it).\n * - `\"no_roles\"` — the seat carries no role code at all.\n *\n * When several held roles refuse at different layers, the furthest layer wins\n * (a role that reached the team outranks one the account stopped, which\n * outranks one the bounds stopped) — the prototype's order, since its Level 1\n * sentences only run when no held role is bound at all. A held code with no\n * role row, or whose `functions` container is malformed, is unbound.\n */\nexport type FunctionRefusal =\n | RoleVerdict\n | \"not_evaluable\"\n | \"no_roles\";\n\nconst REFUSAL_ORDER: readonly RoleVerdict[] = [\n \"granted\",\n \"team_workflow\",\n \"account_blocked\",\n \"account_off\",\n \"default_off\",\n \"never\",\n \"not_applicable\",\n \"unbound\",\n];\n\n/**\n * STATUS: DRAFT (0.50.0). Explain one function for one seat, over the SAME\n * input `resolveEffectiveFunctions` takes: `\"granted\"` exactly when the\n * resolver's answer contains `functionCode`, otherwise the layer that refused\n * (see `FunctionRefusal`). Pure; never throws; changes nothing the resolver\n * grants. A server that resolves the seat can ship this beside the effective\n * set, so the browser's door (`functionDoor`'s `refusal`) says the right\n * sentence without holding the policies.\n */\nexport function explainFunctionRefusal(\n input: ResolveEffectiveFunctionsInput,\n functionCode: string,\n): FunctionRefusal {\n const raw: unknown = input;\n if (!isPlainObject(raw)) return \"not_evaluable\";\n const roleRows = own(raw, \"roles\");\n const catalog = own(raw, \"functions\");\n const assigned = own(raw, \"assignedRoleCodes\");\n if (!Array.isArray(roleRows) || !Array.isArray(catalog) || !Array.isArray(assigned)) {\n return \"not_evaluable\";\n }\n if (typeof functionCode !== \"string\" || !isCanonEvaluableFunction(functionCode)) {\n return \"not_evaluable\";\n }\n if (!(catalog as readonly unknown[]).some((fn) => catalogRowCode(fn) === functionCode)) {\n return \"not_evaluable\";\n }\n\n const heldCodes = [...new Set(assigned as readonly unknown[])].filter(\n (c): c is string => typeof c === \"string\",\n );\n if (heldCodes.length === 0) return \"no_roles\";\n\n const rolesByCode = new Map<string, StoredMap>();\n for (const r of roleRows as readonly unknown[]) {\n const code = isPlainObject(r) ? own(r, \"code\") : undefined;\n if (isPlainObject(r) && typeof code === \"string\") rolesByCode.set(code, r);\n }\n const agencyAll = readContainer(input.agencyOverrides);\n const team = compileTeamGate(input.teamPolicy);\n\n let best = REFUSAL_ORDER.length - 1; // \"unbound\"\n for (const roleCode of heldCodes) {\n const role = rolesByCode.get(roleCode);\n const roleFunctions = role === undefined ? ABSENT : readContainer(own(role, \"functions\"));\n if (roleFunctions.kind === \"malformed\") continue; // grants nothing: unbound\n const agency =\n agencyAll.kind === \"map\" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;\n const verdict = roleVerdict(roleFunctions, agency, team, roleCode, functionCode);\n const at = REFUSAL_ORDER.indexOf(verdict);\n if (at < best) best = at;\n if (best === 0) break;\n }\n return REFUSAL_ORDER[best]!;\n}\n\n// ─── Acting team (rule 5) ───────────────────────────────────────────────────\n\n/**\n * Pick the ONE team whose policy feeds `teamPolicy`.\n *\n * - `verifiedActingTeamId` given → that team, as is. VERIFYING it is the\n * caller's job: each app has its own membership source (pave-2.0 checks\n * `teams.members[]` through its membership checker; `users.teams` is not kept\n * in step with it), so this helper does not second-guess the caller against\n * `seatTeamIds`. Pass only a team the caller has confirmed the seat sits on.\n * A caller that derives its own acting team (Thread's `resolveActingTeamId`\n * picks the first seat team whose apps include THREAD) MUST pass that answer\n * here — the primary-team fallback below knows nothing about apps.\n * - otherwise → the primary team, `seatTeamIds[0]`;\n * - no teams → `null` (pass-through).\n */\nexport function selectActingTeamId(\n seatTeamIds: readonly string[],\n verifiedActingTeamId?: string | null,\n): string | null {\n if (verifiedActingTeamId) return verifiedActingTeamId;\n return seatTeamIds[0] ?? null;\n}\n\n// ─── Internal viewing level (CVC-133 viewing_level_1/2/3) ───────────────────\n\n/** Level 0 is derived (no level function resolves), never a configurable rung. */\nexport type ViewingLevel = 0 | 1 | 2 | 3;\n\n/** The three Type-A viewing functions, highest first. */\nexport const VIEWING_LEVEL_FUNCTIONS = [\n [\"viewing_level_3_components\", 3],\n [\"viewing_level_2_autocomplete\", 2],\n [\"viewing_level_1_search\", 1],\n] as const satisfies ReadonlyArray<readonly [keyof typeof CoreFunctionsKeys, ViewingLevel]>;\n\n/**\n * The effective internal viewing level from an already-resolved function set.\n *\n * Canon (CVC-133 `viewing_level_3_components` logic_notes, records\n * `data/cvcs/core_functions.yaml` @ f4356aa4): \"Effective viewing level = the\n * highest of the three level functions the user's roles resolve to … clamped by\n * the team-set level — most restrictive wins; the team axis clamps down, never\n * up. … Absence of all three functions = Level 0 (not a configurable setting).\"\n *\n * `teamViewingLevel` is the level the account's viewing policy sets for the\n * acting team — the team's own row, else the account-wide rule (prototype\n * `src/screens.jsx:14671` `effLevel`, `:14819` \"a member's own role can only\n * narrow it further\"). Absent / null = no team-set level, so no clamp.\n *\n * Own / claimed cases are always fully visible; that is the caller's\n * record-level check, not this function's.\n */\nexport function viewingLevelFromFunctions(\n effectiveFunctions: Iterable<string>,\n teamViewingLevel?: ViewingLevel | null,\n): ViewingLevel {\n const held = new Set(effectiveFunctions);\n const roleLevel = VIEWING_LEVEL_FUNCTIONS.find(([code]) => held.has(code))?.[1] ?? 0;\n return teamViewingLevel == null\n ? roleLevel\n : (Math.min(roleLevel, teamViewingLevel) as ViewingLevel);\n}\n\n/**\n * Resolve the seat's functions (same input, same rules as\n * `resolveEffectiveFunctions`) and return its effective internal viewing level.\n */\nexport function resolveEffectiveViewingLevel(\n input: ResolveEffectiveFunctionsInput,\n teamViewingLevel?: ViewingLevel | null,\n): ViewingLevel {\n return viewingLevelFromFunctions(resolveEffectiveFunctions(input), teamViewingLevel);\n}\n","/**\n * @htilabs/platform-common-models — CVC-133 codebook default bounds\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.\n *\n * For each evaluable function of coreFunctions.v1.5.0.json (canon v1 && !retired,\n * canon @ d63c2a42): role code → the codebook's default bound — canon's\n * always / default_on / default_off / never / not_applicable_roles read\n * ALWAYS / PREF_YES / PREF_NO / NEVER / NA. Role codes are CVC-134 / CVC-135\n * `canonicalCode`s (adminRoles.v2.0.0.json · userRoles.v2.0.0.json); a role not listed is UNBOUND.\n * CODEBOOK DEFAULTS, not live policy: what platform seeds on insert and what\n * \"clear\" reverts to. GATE L asserts this equals the pinned canon.\n */\n\nimport type { DefaultBoundStateValue } from \"../constants/platform-auth.js\";\n\nexport const CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION = \"1.5.0\";\n\nexport const CORE_FUNCTION_DEFAULT_BOUNDS: Readonly<\n Record<string, Readonly<Record<string, DefaultBoundStateValue>>>\n> = {\n \"agency_info_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\" },\n \"announcement_publish\": { \"MEM-ADM\": \"PREF_NO\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"api_key_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"assessments_conduct\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"NEVER\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"auth_model_manage_platform\": { \"AUD\": \"NEVER\", \"CIRO\": \"NEVER\", \"DATA-ADM\": \"NEVER\", \"GOV-AUD\": \"NEVER\", \"MEM-ADM\": \"NEVER\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"NEVER\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"research_analytics\": \"NA\" },\n \"case_assign_reassign\": { \"AUD\": \"NA\", \"CIRO\": \"NA\", \"DATA-ADM\": \"NA\", \"GOV-AUD\": \"NA\", \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"NA\", \"SUP\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"behavioral_health_provider\": \"NA\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"NA\", \"healthcare_provider_medical\": \"NA\", \"intel_analyst\": \"NA\", \"investigator\": \"NA\", \"le_liaison_vsp\": \"NA\", \"legal_advocate\": \"NA\", \"mandatory_reporter\": \"NA\", \"mdt_participant\": \"NA\", \"prosecutor_review\": \"NA\", \"public_reporter\": \"NA\", \"research_analytics\": \"NA\", \"screener\": \"NA\", \"volunteer\": \"NA\" },\n \"case_claim\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mandatory_reporter\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"PREF_YES\", \"public_reporter\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"case_close\": { \"AUD\": \"NA\", \"CIRO\": \"NA\", \"DATA-ADM\": \"NA\", \"GOV-AUD\": \"NA\", \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"NA\", \"SUP\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"behavioral_health_provider\": \"NA\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"NA\", \"healthcare_provider_medical\": \"NA\", \"intel_analyst\": \"NA\", \"investigator\": \"NA\", \"le_liaison_vsp\": \"NA\", \"legal_advocate\": \"NA\", \"mandatory_reporter\": \"NA\", \"mdt_participant\": \"NA\", \"prosecutor_review\": \"NA\", \"public_reporter\": \"NA\", \"research_analytics\": \"NA\", \"screener\": \"NA\", \"volunteer\": \"NA\" },\n \"case_collaborator_add\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"case_edit\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"case_needs_action_flag_manage\": { \"SUP\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"case_reopen\": { \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"PREF_NO\" },\n \"case_side_panel_use\": { \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_NO\" },\n \"case_status_manage\": { \"SUP\": \"PREF_YES\", \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"case_transfer_bulk\": { \"MEM-ADM\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"PREF_NO\", \"research_analytics\": \"NA\" },\n \"case_view\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"NEVER\" },\n \"case_visibility_manage\": { \"MEM-ADM\": \"ALWAYS\", \"SUP\": \"ALWAYS\", \"case_nav\": \"NA\", \"intel_analyst\": \"PREF_NO\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"ci_periodic_review\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"ci_record_purge_or_retire\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"ci_record_validate\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"ci_to_evidence_export_authorize\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"deconfliction_alert_acknowledge\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"deconfliction_unmask\": { \"case_nav\": \"NA\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"determination_perform\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"NEVER\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"legal_advocate\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"disclose_external_request\": { \"CIRO\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\" },\n \"enrollment_manage\": { \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_NO\", \"volunteer\": \"PREF_NO\" },\n \"exit_discharge_conduct\": { \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"export_deidentified\": { \"DATA-ADM\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"PREF_YES\" },\n \"goals_plan_manage\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"volunteer\": \"PREF_NO\" },\n \"idb_record_create\": { \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"indicator_manual_add\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"investigation_create_claim\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"investigation_session_run\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"PREF_YES\", \"research_analytics\": \"NA\" },\n \"investigative_database_search\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"investigative_request_send\": { \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"lead_create\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"lead_publish\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"lead_route_assign\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"lead_triage_manage\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"magic_link_share_send\": { \"PLT-ADM\": \"NA\", \"SUP\": \"PREF_YES\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_NO\" },\n \"mandatory_report_send\": { \"MEM-ADM\": \"PREF_YES\", \"PLT-ADM\": \"NA\", \"SUP\": \"PREF_YES\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"mandatory_reporter\": \"ALWAYS\", \"public_reporter\": \"PREF_NO\", \"screener\": \"PREF_NO\", \"volunteer\": \"PREF_NO\" },\n \"member_account_report_generate\": { \"DATA-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"PREF_YES\" },\n \"member_onboarding_support\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"message_moderate\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\" },\n \"message_send\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"PREF_NO\", \"research_analytics\": \"ALWAYS\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_YES\" },\n \"milestone_log\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"needs_priorities_conduct\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_YES\" },\n \"network_corpus_access\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"note_open_departed_author\": { \"MEM-ADM\": \"PREF_NO\" },\n \"onboarding_config_sign_off\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\" },\n \"open_source_search\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\" },\n \"person_association_update\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\" },\n \"person_merge_manage\": { \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"NA\", \"crisis_response\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"PREF_YES\", \"mandatory_reporter\": \"NEVER\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"platform_perm_modify\": { \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"profile_domain_edit\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"record_activity_view\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_NO\" },\n \"record_print\": { \"CIRO\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"legal_advocate\": \"ALWAYS\", \"prosecutor_review\": \"ALWAYS\", \"research_analytics\": \"ALWAYS\", \"screener\": \"PREF_NO\", \"volunteer\": \"NEVER\" },\n \"referral_receive_external\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mandatory_reporter\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"referral_receive_internal\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"referral_send_external\": { \"PLT-ADM\": \"NA\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"referral_send_internal\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"ALWAYS\" },\n \"roi_submit_manage\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"ALWAYS\" },\n \"role_assign\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NA\", \"TEAM-ADM\": \"PREF_NO\", \"research_analytics\": \"NA\" },\n \"roles_accounts_toggle\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\" },\n \"sandbox_environment_manage\": { \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"screening_conduct\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"ALWAYS\", \"legal_advocate\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_YES\" },\n \"screening_view\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"prosecutor_review\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"NEVER\" },\n \"service_log_manage\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"session_create\": { \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"ALWAYS\" },\n \"share_config\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"PREF_YES\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"research_analytics\": \"NA\" },\n \"share_revoke\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_NO\", \"volunteer\": \"PREF_NO\" },\n \"share_rule_approve_cross_agency\": { \"GOV-AUD\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"share_vsp_to_le\": { \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"NA\", \"le_liaison_vsp\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"srl_manage\": { \"DATA-ADM\": \"PREF_YES\", \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\" },\n \"supervisee_thread_view\": { \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"case_nav\": \"NA\" },\n \"support_ticket_triage\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"system_diagnostics_view\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"team_config_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"research_analytics\": \"NA\" },\n \"team_membership_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NA\", \"TEAM-ADM\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"team_share_narrowing\": { \"MEM-ADM\": \"ALWAYS\", \"SUP\": \"PREF_NO\", \"TEAM-ADM\": \"PREF_YES\", \"research_analytics\": \"NA\" },\n \"team_workflow_config_manage\": { \"MEM-ADM\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"research_analytics\": \"NA\" },\n \"training_gate_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"PREF_YES\", \"SUP\": \"NA\", \"TEAM-ADM\": \"PREF_YES\", \"TRAIN-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"usr_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"PREF_NO\", \"research_analytics\": \"NA\" },\n \"viewing_config_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"PREF_YES\" },\n \"viewing_level_1_search\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mandatory_reporter\": \"PREF_NO\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"viewing_level_2_autocomplete\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_NO\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_NO\", \"mandatory_reporter\": \"NEVER\", \"mdt_participant\": \"PREF_NO\", \"prosecutor_review\": \"PREF_NO\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"NEVER\" },\n \"viewing_level_3_components\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_NO\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"PREF_NO\", \"healthcare_provider_medical\": \"PREF_NO\", \"intel_analyst\": \"PREF_NO\", \"investigator\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_NO\", \"legal_advocate\": \"PREF_NO\", \"mandatory_reporter\": \"NEVER\", \"mdt_participant\": \"PREF_NO\", \"prosecutor_review\": \"PREF_NO\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"NEVER\" },\n};\n","/**\n * @htilabs/platform-common-models — CVC-133 codebook default bounds (co-p1x)\n *\n * The codebook's default bound for every (evaluable function, role) pair:\n * canon's `bounds:` block (records repo `data/cvcs/core_functions.yaml`),\n * generated into `CORE_FUNCTION_DEFAULT_BOUNDS` by\n * `scripts/gen-core-functions.py` and held equal to the pinned canon by GATE L.\n *\n * WHAT THESE ARE — and are not. The kickoff\n * (`KICKOFF_SHARED_AUTHZ_RESOLVER_2026-10-12.md` § 3 rule 7) rules that the\n * live role × function bounds are platform POLICY STATE, edited only by\n * PLT-ADM on Platform Configuration. This module does not change that: it is\n * the CODEBOOK DEFAULT under the policy — what platform seeds into\n * `platformRoles.functions` when a role row is inserted, and what the bounds\n * editor's \"clear\" reverts to (platform-prototype @ a6f1f3a\n * `PLATFORM_BOUNDS.pristineStateFor`, `src/agencyhub.jsx:2024-2039`; the\n * five chip states always / default_on / default_off / never / na,\n * `src/screens.jsx:19151-19152`). The resolver never reads it: it reads the\n * stored policy rows it is handed (`resolveEffectiveFunctions`).\n *\n * UNBOUND IS INELIGIBLE — aligned to canon (co-p1x, 0.24.0). A role the\n * codebook does not name for a function has no default bound\n * (`codebookDefaultBound` → `null`), and a seeder writes nothing for it.\n * Canon's `authzResolve` returns `role_ineligible` for such a role before any\n * agency layer runs (`src/agencyhub.jsx:578-584`), and\n * `resolveEffectiveFunctions` now does the same: a role row with no stored\n * state for a function is NEVER for that role — no agency override and no\n * team policy can enable the pair — and, like every NEVER, it is local to its\n * role (another held role's grant stands). The dev resolvers' tool-overlap\n * default (unlisted → PREF_NO on a shared tool) is gone; the role and\n * function rows' `tools` are no longer read by the resolver.\n *\n * NA. A platform that seeds Tier 1 verbatim from this map stores `\"NA\"` for\n * the codebook's \"Not relevant\" pairs. The resolver reads a stored `NA` as\n * NEVER at every tier (a recognised codebook value, not malformed data): at\n * Tier 1 it is locked, at Tier 2 it denies that role, at Tier 3 it restricts\n * (Required stays immune). Malformed data would deny identically; reading it\n * as NEVER just keeps a legitimate seed out of the malformed class. Only the\n * Tier-1 type admits it (`AuthzTier1StateMap`, `PlatformRoleDef.functions`);\n * agency / team maps stay PermissionStateValue (canon has no NA chip there),\n * and a stored NA there still denies. GATE L's property tests check the\n * resolver, seeded from this map, against an oracle taken from canon\n * `authzResolve` (`:551-628`, with the Required-immunity ruling): every\n * function × role × agency × team value, and every role pair's union.\n */\n\nimport type { DefaultBoundStateValue } from \"../constants/platform-auth.js\";\nimport { CORE_FUNCTION_DEFAULT_BOUNDS } from \"../generated/coreFunctionDefaultBounds.js\";\n\nexport {\n CORE_FUNCTION_DEFAULT_BOUNDS,\n CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION,\n} from \"../generated/coreFunctionDefaultBounds.js\";\n\n/**\n * The codebook default bound of `roleCode` (a CVC-134 / CVC-135\n * `canonicalCode`, e.g. `MEM-ADM`, `case_nav`) for `functionCode`, or `null`\n * when the role is unbound for it — including when the function is not\n * evaluable (unknown, retired or not-v1). Own keys only, so an inherited name\n * such as `constructor` is never a function or a role.\n */\nexport function codebookDefaultBound(\n functionCode: string,\n roleCode: string,\n): DefaultBoundStateValue | null {\n if (!Object.hasOwn(CORE_FUNCTION_DEFAULT_BOUNDS, functionCode)) return null;\n const roles = CORE_FUNCTION_DEFAULT_BOUNDS[functionCode]!;\n return Object.hasOwn(roles, roleCode) ? roles[roleCode]! : null;\n}\n","/**\n * @htilabs/platform-common-models — the browser-safe authz tables\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `npm run gen:authz-tables` (drift gate: `gen:authz-tables:check`).\n *\n * From coreFunctions.v1.5.0.json (evaluable keys only), userRoles.v2.0.0.json and\n * adminRoles.v2.0.0.json: what `functionDoor` and `canonicalRoleCode` read, so the\n * `./authz` entry never inlines the SOT JSON. Not exported from the barrel.\n */\n\nexport const CORE_FUNCTION_TITLES_SOT_VERSION = \"1.5.0\";\n\n/** Evaluable CVC-133 function key → codebook title. */\nexport const CORE_FUNCTION_TITLES: Readonly<Record<string, string>> = {\n \"agency_info_manage\": \"Edit own agency's profile\",\n \"announcement_publish\": \"Publish announcements\",\n \"api_key_manage\": \"Manage API keys\",\n \"assessments_conduct\": \"Conduct Assessments\",\n \"auth_model_manage_platform\": \"Manage platform authorization model\",\n \"case_assign_reassign\": \"Assign / reassign case ownership\",\n \"case_claim\": \"Claim inbound share (PAVE)\",\n \"case_close\": \"Close case\",\n \"case_collaborator_add\": \"Share / Add Users to a case\",\n \"case_edit\": \"Edit Cases (add intake, case notes, goals, services)\",\n \"case_needs_action_flag_manage\": \"Manage case escalation / needs-action flags\",\n \"case_reopen\": \"Case Re-open\",\n \"case_side_panel_use\": \"Utilize side panel for comments/notes and uploads\",\n \"case_status_manage\": \"Change case status\",\n \"case_transfer_bulk\": \"Bulk transfer cases (turnover)\",\n \"case_view\": \"View (agency) Cases\",\n \"case_visibility_manage\": \"Go dark / restore case visibility\",\n \"ci_periodic_review\": \"Review criminal intelligence record (periodic)\",\n \"ci_record_purge_or_retire\": \"Retire or purge criminal intelligence record\",\n \"ci_record_validate\": \"Validate criminal intelligence record\",\n \"ci_to_evidence_export_authorize\": \"Authorize criminal intelligence → evidence export\",\n \"deconfliction_alert_acknowledge\": \"Accept a deconfliction alert\",\n \"deconfliction_unmask\": \"Unmask a deconfliction\",\n \"determination_perform\": \"Perform Determinations\",\n \"disclose_external_request\": \"Request External Disclosure\",\n \"enrollment_manage\": \"Manage program enrollments\",\n \"exit_discharge_conduct\": \"Conduct program exit / discharge\",\n \"export_deidentified\": \"Export de-identified reports/datasets\",\n \"goals_plan_manage\": \"Create and manage plans, goals, action steps\",\n \"idb_record_create\": \"Create IDB record\",\n \"indicator_manual_add\": \"Add a manual indicator\",\n \"investigation_create_claim\": \"Create Investigation + Claim a Tip / Lead\",\n \"investigation_session_run\": \"Run an investigation session\",\n \"investigative_database_search\": \"Search account IDB\",\n \"investigative_request_send\": \"Submit an investigative request (Ask HTI)\",\n \"lead_create\": \"Create a Tip / Lead\",\n \"lead_publish\": \"Publish a Tip / Lead\",\n \"lead_route_assign\": \"Route / assign a lead to an agency\",\n \"lead_triage_manage\": \"Triage leads\",\n \"magic_link_share_send\": \"Send Magic Link Shares\",\n \"mandatory_report_send\": \"Send mandatory report\",\n \"member_account_report_generate\": \"Member Account Report generation\",\n \"member_onboarding_support\": \"Assist member onboarding (support)\",\n \"message_moderate\": \"Moderate messages\",\n \"message_send\": \"Send platform messages\",\n \"milestone_log\": \"Log investigative milestones\",\n \"needs_priorities_conduct\": \"Conduct needs assessment and immediate priorities\",\n \"network_corpus_access\": \"Access raw/worked machine-network corpus\",\n \"note_open_departed_author\": \"Open a deactivated author's private notes\",\n \"onboarding_config_sign_off\": \"Approve the configuration summary (Phase III sign-off)\",\n \"open_source_search\": \"Search across all open source information\",\n \"person_association_update\": \"Assign or update person’s role, relationships, phone numbers or social media associations\",\n \"person_merge_manage\": \"Manage person identity merges\",\n \"platform_perm_modify\": \"Modify Platform Permissions\",\n \"profile_domain_edit\": \"Edit subject profile domains\",\n \"record_activity_view\": \"View a record's activity log\",\n \"record_print\": \"Export/Print\",\n \"referral_receive_external\": \"Receive External Referrals\",\n \"referral_receive_internal\": \"Receive Internal Referrals\",\n \"referral_send_external\": \"Refer External (Excluding VSP to LE)\",\n \"referral_send_internal\": \"Refer Internal\",\n \"roi_submit_manage\": \"Upload/Edit/Submit ROI\",\n \"role_assign\": \"Role Assignment\",\n \"roles_accounts_toggle\": \"Toggle Roles / Accounts\",\n \"sandbox_environment_manage\": \"Manage sandbox and testing environments\",\n \"screening_conduct\": \"Conduct Screenings\",\n \"screening_view\": \"View Victim/Abuse Screening Responses\",\n \"service_log_manage\": \"Log and manage service instances\",\n \"session_create\": \"Record creation (sessions, cases, etc.)\",\n \"share_config\": \"Sharing Configuration\",\n \"share_revoke\": \"Revoke an active share / ROI\",\n \"share_rule_approve_cross_agency\": \"Approve cross-agency sharing rules\",\n \"share_vsp_to_le\": \"VSP to LE Share\",\n \"srl_manage\": \"Manage the agency's Service Registry (SRL)\",\n \"supervisee_thread_view\": \"View supervisee threads\",\n \"support_ticket_triage\": \"Triage support tickets / bug reports\",\n \"system_diagnostics_view\": \"View system diagnostics and logs (support)\",\n \"team_config_manage\": \"Team structure & admin scoping (account-level)\",\n \"team_membership_manage\": \"Manage team membership\",\n \"team_share_narrowing\": \"Narrow a team's sharing\",\n \"team_workflow_config_manage\": \"Manage team workflow configuration\",\n \"training_gate_manage\": \"Manage training/certification gates (i.e. required modules for roles + teams)\",\n \"usr_manage\": \"User Management\",\n \"viewing_config_manage\": \"Configure internal viewing (Type A)\",\n \"viewing_level_1_search\": \"Non-owned case identity on search\",\n \"viewing_level_2_autocomplete\": \"Non-owned case identity in autocomplete\",\n \"viewing_level_3_components\": \"Non-owned case component access\",\n};\n\nexport const ROLE_CODES_SOT_VERSIONS = { userRoles: \"2.0.0\", adminRoles: \"2.0.0\" } as const;\n\n/** Every live CVC-135 user-role and CVC-134 admin-role `canonicalCode`. */\nexport const CANON_ROLE_CODE_LIST: readonly string[] = [\n \"case_nav\",\n \"healthcare_provider_medical\",\n \"behavioral_health_provider\",\n \"crisis_response\",\n \"intel_analyst\",\n \"investigator\",\n \"le_liaison_vsp\",\n \"legal_advocate\",\n \"mandatory_reporter\",\n \"mdt_participant\",\n \"prosecutor_review\",\n \"public_reporter\",\n \"research_analytics\",\n \"screener\",\n \"volunteer\",\n \"PLT-ADM\",\n \"PLT-SUP\",\n \"MEM-ADM\",\n \"TEAM-ADM\",\n \"AUD\",\n \"DATA-ADM\",\n \"GOV-AUD\",\n \"CIRO\",\n \"SUP\",\n \"TRAIN-ADM\",\n];\n\n/** Live CVC-134 / CVC-135 `canonicalCode` → its display words (`displayLabel`, else `title`). */\nexport const ROLE_DISPLAY_LABELS: Readonly<Record<string, string>> = {\n \"case_nav\": \"Case Navigator/Advocate\",\n \"healthcare_provider_medical\": \"Healthcare Provider\",\n \"behavioral_health_provider\": \"Behavioral Health Provider\",\n \"crisis_response\": \"Crisis Response\",\n \"intel_analyst\": \"Intelligence Analyst\",\n \"investigator\": \"Investigator\",\n \"le_liaison_vsp\": \"VSP LE Liaison\",\n \"legal_advocate\": \"Legal Advocate\",\n \"mandatory_reporter\": \"Mandatory Reporter User\",\n \"mdt_participant\": \"MDT Participant\",\n \"prosecutor_review\": \"Prosecutorial Reviewer\",\n \"public_reporter\": \"Public Reporter\",\n \"research_analytics\": \"Research/Analytics\",\n \"screener\": \"Screener (Initial Screen)\",\n \"volunteer\": \"Volunteer\",\n \"PLT-ADM\": \"Platform Admin\",\n \"PLT-SUP\": \"Support Admin\",\n \"MEM-ADM\": \"Account Admin\",\n \"TEAM-ADM\": \"Team Admin\",\n \"AUD\": \"Compliance / Auditor\",\n \"DATA-ADM\": \"Data & Reporting Admin\",\n \"GOV-AUD\": \"Governance Auditor\",\n \"CIRO\": \"Intel Review Officer\",\n \"SUP\": \"Supervisor\",\n \"TRAIN-ADM\": \"Training Admin\",\n};\n\n/** Exact stored source spelling → live canon code, or null (withdrawn, no successor). */\nexport const ROLE_CODE_RE_KEYS: Readonly<Record<string, string | null>> = {\n \"missingness_root\": null,\n \"unknown\": null,\n \"anonymous\": null,\n \"data_not_collected\": null,\n \"hotline_op\": \"crisis_response\",\n \"case_advocate\": \"case_nav\",\n \"leads_investigator\": \"investigator\",\n \"MISSINGNESS-ROOT\": null,\n \"UNKNOWN\": null,\n \"ANONYMOUS\": null,\n \"DATA-NOT-COLLECTED\": null,\n \"acct_adm\": \"MEM-ADM\",\n \"ACCT-ADM\": \"MEM-ADM\",\n};\n","/**\n * @htilabs/platform-common-models — stored role codes → live canon role codes\n *\n * STATUS: DRAFT (Tier B, 0.48.0). Ported verbatim in behaviour from the two\n * local copies the apps carry today — Thread\n * `packages/db/src/services/seatRoleCodes.ts` and platform\n * `lib/authz/roleCodes.ts` — so PAVE 2.0 (which has no copy) and every later\n * caller read one translation. The apps are not switched over in this\n * release; when they are, their local copies go.\n *\n * Canon re-keys roles IN PLACE and migrates ON READ: nothing stored is ever\n * rewritten (`userRolesSot._supersedes`, quoting canon\n * `data/cvcs/core_user_role.yaml` `legacy_codes`). A seat that still stores\n * `hotline_op` holds canon's `crisis_response` — the same role at the same\n * wire code 135-004. Every reader of a seat's role codes resolves them here\n * before it looks up a `platformRoles` row or a codebook bound, or a re-keyed\n * seat finds no row under its stored code and resolves to no functions.\n *\n * EXACT SPELLINGS ONLY. A code resolves when it is, character for character:\n * - a live canon code (an entry's `canonicalCode`: `crisis_response`, `MEM-ADM`);\n * - a re-key SOURCE in CVC-135 `userRolesSot._supersedes.keyMap`\n * (`hotline_op` → `crisis_response`, `case_advocate` → `case_nav`,\n * `leads_investigator` → `investigator`);\n * - a re-key SOURCE in CVC-134 `adminRolesSot._supersedes.keyMap`, in its key\n * spelling (`acct_adm`) or canon's own spelling of it (`ACCT-ADM`) → `MEM-ADM`.\n * Nothing is case- or separator-folded (`plt_adm`, `Plt-Adm` match no role —\n * fail closed). Identity keyMap lines are key-space bookkeeping, not stored\n * spellings, so they are not sources. A withdrawn code with no successor (the\n * 1.0.0 missingness keys) means no role.\n *\n * Browser-safe: reads a small generated table\n * (`src/generated/authzBrowserTables.ts`, held to the SOT files by\n * `gen:authz-tables:check`), never the SOT JSON itself. No I/O.\n */\n\nimport { CANON_ROLE_CODE_LIST, ROLE_CODE_RE_KEYS } from \"../generated/authzBrowserTables.js\";\n\n/** Every live canon role code (CVC-135 user roles + CVC-134 admin roles). */\nconst CANON_ROLE_CODES: ReadonlySet<string> = new Set(CANON_ROLE_CODE_LIST);\n\n/**\n * Exact source spelling → live canon code (or null: no role), generated from\n * the two SOTs' `_supersedes.keyMap` by `scripts/gen-authz-tables.ts` with the\n * apps' rule (identity lines skipped; an admin key also in canon's\n * upper-dash spelling; a spelling that is itself a live code never a source).\n */\nconst SOURCES: ReadonlyMap<string, string | null> = new Map(Object.entries(ROLE_CODE_RE_KEYS));\n\n/**\n * STATUS: DRAFT. The live canon role code a stored role code means, or `null`\n * when it means no role (a withdrawn code with no successor, or any spelling\n * that is neither a live code nor an exact re-key source). A non-string is no\n * role.\n */\nexport function canonicalRoleCode(code: unknown): string | null {\n if (typeof code !== \"string\") return null;\n if (CANON_ROLE_CODES.has(code)) return code;\n return SOURCES.has(code) ? (SOURCES.get(code) ?? null) : null;\n}\n","/**\n * @htilabs/platform-common-models — the function door (Kickoff 08b § 11)\n *\n * STATUS: DRAFT (Tier B; register aligned to the prototype in 0.50.0).\n *\n * The resolver half (`resolveEffectiveFunctions`) decides what a seat may do.\n * This is the other half: it carries that answer to the screen in the shape\n * the shared components take, so no shared piece decides anything (Crysta,\n * 2026-10-20: \"A shared piece never decides who may view, access, or edit it\n * … It receives those decisions and only shows them.\"). The host app runs\n * this over the seat's resolved answer and hands the result to the piece —\n * `{ allowed, reason }` is what `SharePurposeAccess` (`vspToLe`) and\n * `ShareRow`'s `revokeAccess` read; `offered: false` tells the host there is\n * nothing to draw (no refusal the prototype words); whether a refused control\n * is drawn is the surface's own rule (below).\n *\n * THE REGISTER — the prototype's, word for word. Source: records prototype\n * (`htilabstech/prototype` @ 882e200) `HTI-LEADS-PAVE-Thread-prototype.html`\n * `shareFunctionAccess`, L339651-339719 (Thread's canonical copy, re-baselined\n * from 94ee0702, carries the same block at L316784-316848). Its decision order\n * is platform-prototype `authzResolve`'s (`src/agencyhub.jsx` @ dd0aa94,\n * L592-680). `act` is the function's codebook title; `<roles>` is every role\n * the seat holds, in the order given, by its display words, joined \" + \".\n *\n * - granted → `{ offered: true, allowed: true, reason: null }`.\n * - Level 1, no held role bound Always / Default On / Default Off:\n * a held role Never-bound → \"<act> is never available to your seat (<roles>).\"\n * else one Not relevant → \"<act> does not apply to your seat (<roles>).\"\n * else (unbound) → \"<act> is not part of your roles (<roles>).\"\n * - Level 2, the account (no held role's account setting grants it):\n * Blocked → \"<act> is blocked for your seat (<roles>) by your account.\"\n * switched Off → \"<act> is switched off for your seat (<roles>) by your account — an account admin can turn it on.\"\n * Default Off, no setting → \"<act> is off by default for your seat (<roles>) — an account admin can turn it on for your account.\"\n * - Level 3, the team's workflow → \"<act> is not part of your team's workflow — a team admin can add it.\"\n *\n * A REFUSAL IS REPORTED DRAWN (`offered: true`), disabled with its reason —\n * the default the function doors in the prototypes use: the records\n * prototype's `shareFunctionAccess` consumers paint the control `disabled`\n * with the reason as its `title` (share-row / ROI Revoke L274289-274293,\n * L274394-274399, L347766-347775; the authority purpose pills\n * L348091-348120, Terry 2026-08-12 \"exclusions on this surface stay\n * visible\"; the magic-link method L349660-349667), and platform-prototype's\n * User Management does the same (`src/screens.jsx` @ dd0aa94 L26507,\n * L26537: `disabled={!authz.allowed}` + the refusal as `title`). So a\n * Never / Not relevant / unbound seat gets `{ offered: true, allowed: false,\n * reason }` too — 0.48.0–0.49.0 left those off (`offered: false`).\n *\n * THE HOST DECIDES PER SURFACE; the door only reports. Not every prototype\n * surface draws a refused control:\n * - platform-prototype hides some function-gated affordances when its\n * `canDirectEdit` (`agency_info_manage` / `srl_manage`) refuses — Add\n * Contact (`src/agencyhub.jsx` @ dd0aa94 L10536), Add services (L7247),\n * program retire (L8899). Such a host draws nothing when `allowed` is\n * false.\n * - the records prototype CONVERTS rather than disables the Mandatory\n * report pill when `mandatory_report_send` is refused: it becomes the\n * internal-escalation flag to the reporting team (L348093-348104,\n * Crysta-ruled 2026-08-23; \"a mandatory-report flag is never refused\").\n * A host must never paint that pill disabled from this door.\n * Build each surface to its prototype; `offered` / `allowed` / `reason` are\n * the facts, not the surface's rule.\n *\n * Still NOT offered (`{ offered: false, allowed: false, reason: null }`) —\n * cases the prototype has no refusal for, so the 0.49.0 answer stands:\n * - an unknown / retired / not-v1 function, or one with no kept catalog row\n * when `functions` is given (resolver rule 8; the prototype fails these\n * open, the platform denies them);\n * - a seat with no role code that resolves (the prototype fails it open).\n *\n * Required (ALWAYS after the platform and account layers) is immune to the\n * team (resolver rule 3), so it never gets the team sentence. The prototypes\n * match: platform-prototype `authzResolve` since #492 (2026-11-03), and the\n * records monolith `shareFunctionAccess` plus the LEADS app\n * `resolveEffectiveAccess` since prototype #1050 (2026-11-09).\n *\n * WHICH LAYER REFUSED. `explainFunctionRefusal` (the resolver's own cascade)\n * answers it, over:\n * - `roles` — the LIVE Tier-1 rows (`platformRoles`), when given; absent →\n * the codebook default bound (`codebookDefaultBound`) for each held role;\n * present but not an array → nothing bound (fail closed);\n * - `agencyOverrides` — the resolver's Tier-2 input. ABSENT (undefined or\n * null) IS UNKNOWN, not \"none\": the account may have Blocked, switched Off\n * or switched On (then met the team) what the bounds leave Default On /\n * Default Off, and the account editor stores only what it changed. So\n * without it the door names no layer past the bounds — a refusal that\n * reached the account or the team reads the fallback below. A host that\n * KNOWS the account has no overrides passes `{}`;\n * - `teamPolicy` — the resolver's Tier-3 input; absent → no team restriction\n * known. (Absence cannot name a wrong layer: the team only restricts and\n * runs last, so a missing team policy can only turn a team refusal into\n * the fallback, never into another layer's sentence.);\n * - or `refusal` — the answer a server already computed with\n * `explainFunctionRefusal` (it wins when it is a known value). THIS IS THE\n * SUPPORTED PATH for any host that resolves the seat server-side: ship\n * `explainFunctionRefusal(sameInput, fn)` beside the effective set, per\n * control.\n * Without `refusal` or the policies, the door names only Level 1 (the\n * bounds), and on the codebook path (no `roles`) those Level-1 sentences\n * assume the platform bounds are unedited — a Platform Admin can edit\n * `platformRoles`, so a host that holds the live rows passes them (or ships\n * `refusal`). When the inputs it has cannot say which layer refused (they\n * say \"granted\", or the refusal lies past an unknown account layer), the\n * reason is the prototype's own words for a refusal it cannot explain, \"Not\n * available under your role\" (its share-row fallback, L274292 / L274399) —\n * never a sentence that names the wrong layer.\n *\n * `allowed` follows the effective set alone — the resolved answer is the\n * decision. A function the effective set grants is always offered and\n * allowed; the door never refuses what the server grants.\n *\n * THE DOOR IS THE EARLY ANSWER ONLY. It keeps a seat from reaching a dead\n * end; it is not the gate. The server's `requireFunction` (each app's route\n * guard over the same resolver) stays the authority, and a request the door\n * would have allowed is still refused there when the server's answer differs.\n *\n * Pure, browser-safe, no I/O.\n */\n\nimport {\n CORE_FUNCTION_TITLES,\n ROLE_DISPLAY_LABELS,\n} from \"../generated/authzBrowserTables.js\";\nimport { codebookDefaultBound } from \"./defaultBounds.js\";\nimport {\n explainFunctionRefusal,\n isCanonEvaluableFunction,\n type AuthzFunctionRow,\n type AuthzRoleRow,\n type AuthzStateMap,\n type AuthzTeamPolicy,\n type AuthzTier1StateMap,\n type FunctionRefusal,\n} from \"./resolveEffectiveFunctions.js\";\nimport { canonicalRoleCode } from \"./roleCodes.js\";\nimport { catalogRowCode } from \"./storedReads.js\";\n\n/**\n * A door's state. Field names and types match the components' door shape\n * (`@htilabs/platform-common-components` 0.2.1 `ShareDoorState`\n * `{ allowed, reason, offered }`; since 0.3.0 the pieces read the\n * `{ allowed, reason }` half — `SharePurposeAccess`, `ShareRow.revokeAccess` —\n * and the host reads `offered` to decide whether to draw the control).\n */\nexport interface FunctionDoorState {\n allowed: boolean;\n reason: string | null;\n offered: boolean;\n}\n\n/** A label for a key: a lookup function or a key → label map. */\nexport type FunctionLabelLookup =\n ((functionKey: string) => string | null | undefined) | Readonly<Record<string, string>>;\n\nexport interface FunctionDoorInput {\n /** The seat's resolved answer: `resolveEffectiveFunctions(…)`'s function keys. */\n readonly effectiveFunctions: Iterable<string>;\n /**\n * The seat's role codes (CVC-134 / CVC-135). Each is run through\n * `canonicalRoleCode` first, so a stored re-keyed spelling (`hotline_op`)\n * reads as its live role; an unresolvable code is dropped. The refusal\n * names the roles in this order — pass the user roles first, then the\n * admin roles, as the prototype does.\n */\n readonly roleCodes: readonly string[];\n /** The CVC-133 function key the control performs (e.g. `share_revoke`). */\n readonly functionKey: string;\n /**\n * Optional: the words for the function in the refusal. Absent, or returning\n * nothing → the codebook row's title; no title → the key itself.\n */\n readonly label?: FunctionLabelLookup | undefined;\n /**\n * Optional: the words for a role (keyed by its canon code) in the refusal.\n * Absent, or returning nothing → the CVC-134 / CVC-135 `displayLabel`, else\n * its title; neither → the code.\n */\n readonly roleLabel?: FunctionLabelLookup | undefined;\n /**\n * Optional: the LIVE Tier-1 role rows — the same `roles` the host passes to\n * `resolveEffectiveFunctions`. Given → they decide each role's bound; absent\n * → the codebook default bound.\n */\n readonly roles?: readonly AuthzRoleRow[] | null | undefined;\n /**\n * Optional: the LIVE function catalog — the same `functions` the host passes\n * to `resolveEffectiveFunctions`. Given → a function with no kept row\n * (missing or retired) is not offered.\n */\n readonly functions?: readonly AuthzFunctionRow[] | null | undefined;\n /**\n * Optional: the resolver's Tier-2 input — picks the account sentence.\n * Absent (undefined / null) is UNKNOWN: a refusal past the bounds then\n * reads \"Not available under your role\". Pass `{}` when the account is\n * known to have no overrides.\n */\n readonly agencyOverrides?: Readonly<Record<string, AuthzStateMap>> | null | undefined;\n /**\n * Optional: the resolver's Tier-3 input — picks the team sentence. Absent →\n * no team restriction known.\n */\n readonly teamPolicy?: AuthzTeamPolicy | null | undefined;\n /**\n * Optional: `explainFunctionRefusal`'s answer, computed where the policies\n * are (e.g. the server, beside the effective set). A known value wins over\n * the door's own explanation.\n */\n readonly refusal?: FunctionRefusal | null | undefined;\n}\n\nconst NOT_OFFERED: FunctionDoorState = Object.freeze({\n offered: false,\n allowed: false,\n reason: null,\n}) as FunctionDoorState;\n\n/**\n * The prototype's words for a refusal it cannot explain (records prototype\n * share-row Revoke `_az.reason || \"Not available under your role\"`,\n * L274292 / L274399).\n */\nconst UNEXPLAINED = \"Not available under your role\";\n\nconst KNOWN_REFUSALS: ReadonlySet<string> = new Set<FunctionRefusal>([\n \"granted\",\n \"never\",\n \"not_applicable\",\n \"unbound\",\n \"account_blocked\",\n \"account_off\",\n \"default_off\",\n \"team_workflow\",\n \"not_evaluable\",\n \"no_roles\",\n]);\n\nfunction lookupLabel(key: string, lookup: FunctionLabelLookup | undefined): string | null {\n let label: string | null | undefined;\n if (typeof lookup === \"function\") label = lookup(key);\n else if (lookup && Object.hasOwn(lookup, key)) label = lookup[key];\n return typeof label === \"string\" && label.trim() ? label : null;\n}\n\nfunction labelFor(functionKey: string, lookup: FunctionLabelLookup | undefined): string {\n return (\n lookupLabel(functionKey, lookup) ??\n (Object.hasOwn(CORE_FUNCTION_TITLES, functionKey)\n ? CORE_FUNCTION_TITLES[functionKey]!\n : functionKey)\n );\n}\n\nfunction roleLabelFor(code: string, lookup: FunctionLabelLookup | undefined): string {\n return (\n lookupLabel(code, lookup) ??\n (Object.hasOwn(ROLE_DISPLAY_LABELS, code) ? ROLE_DISPLAY_LABELS[code]! : code)\n );\n}\n\n/** The prototype's sentence for a refusal layer (see the header). */\nfunction sentence(refusal: FunctionRefusal, act: string, roles: string): string {\n switch (refusal) {\n case \"never\":\n return `${act} is never available to your seat (${roles}).`;\n case \"not_applicable\":\n return `${act} does not apply to your seat (${roles}).`;\n case \"unbound\":\n return `${act} is not part of your roles (${roles}).`;\n case \"account_blocked\":\n return `${act} is blocked for your seat (${roles}) by your account.`;\n case \"account_off\":\n return `${act} is switched off for your seat (${roles}) by your account — an account admin can turn it on.`;\n case \"default_off\":\n return `${act} is off by default for your seat (${roles}) — an account admin can turn it on for your account.`;\n case \"team_workflow\":\n return `${act} is not part of your team's workflow — a team admin can add it.`;\n default:\n return UNEXPLAINED;\n }\n}\n\n/**\n * STATUS: DRAFT. The door for one function on one seat (the register above).\n * The UI's early answer only — the server's `requireFunction` is the authority.\n */\nexport function functionDoor(input: FunctionDoorInput): FunctionDoorState {\n const { functionKey } = input;\n if (typeof functionKey !== \"string\" || !isCanonEvaluableFunction(functionKey)) {\n return { ...NOT_OFFERED };\n }\n\n let granted = false;\n for (const fn of input.effectiveFunctions) {\n if (fn === functionKey) {\n granted = true;\n break;\n }\n }\n if (granted) return { offered: true, allowed: true, reason: null };\n\n const functions: unknown = input.functions;\n if (functions !== undefined && functions !== null) {\n const kept =\n Array.isArray(functions) &&\n (functions as readonly unknown[]).some((row) => catalogRowCode(row) === functionKey);\n if (!kept) return { ...NOT_OFFERED };\n }\n\n // The seat's roles: canon codes in the order given, once each (a stored\n // re-keyed spelling is kept beside its canon code so a live row stored\n // under the old spelling is still read, as 0.49.0 read it).\n const rawCodes: unknown = input.roleCodes;\n const seat: string[] = [];\n const assigned: string[] = [];\n const liveRows: unknown = input.roles;\n const live = liveRows !== undefined && liveRows !== null;\n for (const code of Array.isArray(rawCodes) ? (rawCodes as readonly unknown[]) : []) {\n const canon = canonicalRoleCode(code);\n if (canon === null) continue;\n if (!seat.includes(canon)) seat.push(canon);\n if (!assigned.includes(canon)) assigned.push(canon);\n if (live && typeof code === \"string\" && code !== canon && !assigned.includes(code)) {\n assigned.push(code);\n }\n }\n if (seat.length === 0) return { ...NOT_OFFERED };\n\n let refusal: FunctionRefusal;\n const given: unknown = input.refusal;\n if (typeof given === \"string\" && KNOWN_REFUSALS.has(given)) {\n refusal = given as FunctionRefusal;\n } else {\n let roles: readonly AuthzRoleRow[];\n if (live) roles = Array.isArray(liveRows) ? (liveRows as readonly AuthzRoleRow[]) : [];\n else {\n roles = seat.map((code) => {\n const bound = codebookDefaultBound(functionKey, code);\n const fns: AuthzTier1StateMap = bound === null ? {} : { [functionKey]: bound };\n return { code, functions: fns };\n });\n }\n const accountKnown = input.agencyOverrides !== undefined && input.agencyOverrides !== null;\n refusal = explainFunctionRefusal(\n {\n roles,\n functions: [{ code: functionKey }],\n assignedRoleCodes: assigned,\n agencyOverrides: accountKnown ? input.agencyOverrides! : undefined,\n teamPolicy: input.teamPolicy ?? null,\n unknownFunctionPolicy: \"deny\",\n },\n functionKey,\n );\n // Without the account layer, a cascade that got past the bounds cannot\n // say whether the account Blocked, switched Off or switched On (then the\n // team took it): name no layer (see the header).\n if (!accountKnown && (refusal === \"default_off\" || refusal === \"team_workflow\")) {\n refusal = \"granted\"; // → the unexplained fallback\n }\n }\n if (refusal === \"not_evaluable\" || refusal === \"no_roles\") return { ...NOT_OFFERED };\n\n const roleWords = seat.map((code) => roleLabelFor(code, input.roleLabel)).join(\" + \");\n return {\n offered: true,\n allowed: false,\n reason: sentence(refusal, labelFor(functionKey, input.label), roleWords),\n };\n}\n","/**\n * @htilabs/platform-common-models/authz — the account's Internal Viewing Policy\n * reader: which stored viewing rule governs one acting team.\n *\n * Contract of record: \"Contract — the account's Internal Viewing Policy: stored\n * shape and delivery to Thread and PAVE (Kickoff 13 § 5a)\", §§ 1–4. Lifted from\n * PAVE's `@pave/db` `readViewingPolicy` (pave-2.0 develop 41f5f916,\n * `packages/db/src/lookups/viewingPolicy.ts`) so Thread and PAVE run ONE reader\n * (GDR § 5.79, one resolver per runtime). The selection and validation rules are\n * PAVE's, unchanged; only the I/O is left to the app.\n *\n * ## Pure: each app does its own query\n *\n * No database access. The app reads the candidate rows itself — the account's\n * `registry_policies` documents (`species: \"viewing\"`, `account_id` = the acting\n * agency's Account; passing every policy of the account is fine, other species are\n * skipped here) — and hands them in with `{ accountId, teamId }`. A failed read is\n * passed as `docs: null` (or answered with {@link unavailableViewingPolicy}); it is\n * never an empty list, because an empty list means \"nothing on file\".\n *\n * ## Which row governs (Crysta 2026-10-06, ruling (a))\n *\n * The acting team's OWN active row governs that team IN PLACE OF the account-wide\n * rule — higher or lower; the two are never combined. With no team row, the\n * account-wide rule governs. With neither, nothing governs: `source: \"none\"`, and\n * the role level alone decides (Level 3 shows the full record; Crysta 2026-11-03,\n * \"Match the prototype\"). The role clamps afterwards:\n * `viewingLevelFromFunctions(effectiveFunctions, teamViewingLevelFromPolicy(result))`.\n * Prototype: `viewingPolicyFor`, platform-prototype `src/data.js` (aa2c63a).\n *\n * ## Fail closed, never throw (contract § 4)\n *\n * Anything that stops the policy being READ answers `source: \"unavailable\"`\n * (level 0 for that request) with a coded reason — never `\"none\"`: the account\n * cannot be resolved; the read failed; a live viewing row whose assignment is not\n * exactly one account-or-team entry (it might be this team's narrowing); a row in\n * this team's or the account's place whose `active` is neither `true` nor `false`;\n * two live rows in one place without distinct versions of one family; and, on the\n * governing row, a `level` that is not exactly 0–3, a `visibleGroups` that is\n * present but not a list of strings or names a code that is not live at its stamp,\n * a `scopeVocab` that is missing or not 3, 4 or 5. A malformed team row never falls\n * back to the account rule (that fallback could widen).\n *\n * A governing row with no `visibleGroups` reads as an EMPTY list (contract § 4;\n * PAVE `caseViewing.ts` `accessFromResolution`): only \"no row at all\" shows the\n * full record. System information is always shown — that is the Level 3 filter's\n * job ({@link caseViewingAccess}), not this reader's.\n */\n\nimport type {\n InformationScopeResolver,\n ScopeReading,\n} from \"../services/informationScopeResolver.js\";\nimport type { ViewingLevel } from \"./resolveEffectiveFunctions.js\";\n\n/** The stored `species` of an internal-viewing policy (UDD Policy.v1). */\nexport const VIEWING_POLICY_SPECIES = \"viewing\" as const;\n\n// ─── The vocabulary stamp (`scopeVocab`) ─────────────────────────────────────\n\n/** What one of the prototype's viewing-policy vocabulary stamps means to a reader. */\nexport interface ViewingPolicyVocabulary {\n /** The CVC-236 tree version the resolver reads the list at (3 through the v3 → v4 table, or 4). */\n readonly scopeVersion: 3 | 4;\n /** The prototype's ONE-HOME domain carry applies (`scopeVocab < 4`). */\n readonly oneHomeCarry: boolean;\n /** The prototype's v4 alias on `identifying` applies (`scopeVocab < 5`). */\n readonly identifyingAlias: boolean;\n}\n\n/**\n * The stamps a stored viewing policy's `scopeVocab` may carry and still be read.\n *\n * The stamp is the Internal Viewing tab's own counter, NOT the CVC-236 tree\n * version: the hub stamps every save `5` for the four-level v4 tree\n * (platform-prototype `src/screens.jsx` `setLevel` / `toggleGroup` /\n * `setAcctLevel`). Earlier saves stamped 4 (ONE-HOME) and 3 (the Instruments\n * catalog), both authored against the v3 tree. Stamps 1 and 2 and every future\n * stamp (6 and up) are not read: they fail closed. Lifted from PAVE\n * `@pave/domain` `VIEWING_POLICY_VOCABULARIES`.\n */\nexport const VIEWING_POLICY_VOCABULARIES: Readonly<\n Record<3 | 4 | 5, ViewingPolicyVocabulary>\n> = Object.freeze({\n 3: Object.freeze({ scopeVersion: 3, oneHomeCarry: true, identifyingAlias: true }),\n 4: Object.freeze({ scopeVersion: 3, oneHomeCarry: false, identifyingAlias: true }),\n 5: Object.freeze({ scopeVersion: 4, oneHomeCarry: false, identifyingAlias: false }),\n});\n\n/** A stamp this reader reads. */\nexport type ViewingPolicyScopeVocab = 3 | 4 | 5;\n\n/** The reading of a stored `scopeVocab`, or `null` when it cannot be read (fail closed). */\nexport function viewingPolicyVocabulary(scopeVocab: unknown): ViewingPolicyVocabulary | null {\n return scopeVocab === 3 || scopeVocab === 4 || scopeVocab === 5\n ? VIEWING_POLICY_VOCABULARIES[scopeVocab]\n : null;\n}\n\n// ─── Inputs and the result ───────────────────────────────────────────────────\n\n/**\n * The bound CVC-236 resolver the reader validates a whitelist with — the app's\n * own binding of `createInformationScopeResolver` to `coreInformationScopeSot`\n * (PAVE `INFORMATION_SCOPE_V4`, Thread `INFORMATION_SCOPE_RESOLVER`). Passed in\n * so the browser-safe `./authz` entry never inlines the SOT JSON.\n */\nexport type ViewingPolicyScopeResolver = Pick<InformationScopeResolver, \"row\" | \"readSelection\">;\n\n/** Who is asking. */\nexport interface ViewingPolicyQuery {\n /**\n * The Account that owns the policy — the acting agency's Account, which the\n * caller resolved. Empty / null = the account could not be resolved\n * (`unavailable`, `account_unresolved`).\n */\n accountId: string | null | undefined;\n /**\n * The ONE acting team, already bound by the caller to the acting agency\n * (Thread `resolveSeatActingTeamId`, PAVE `viewingTeamOfAgency`). `null` = no\n * acting team, so only the account-wide rule can govern. A 24-hex id is\n * compared case-insensitively.\n */\n teamId: string | null | undefined;\n}\n\n/** Why the policy could not be read. The first four are the app's I/O outcomes. */\nexport type ViewingPolicyUnavailableReason =\n | \"no_acting_agency\"\n | \"account_unresolved\"\n | \"policy_store_absent\"\n | \"read_error\"\n | \"unreadable_assignment\"\n | \"malformed_active\"\n | \"ambiguous_rows\"\n | \"malformed_level\"\n | \"malformed_visible_groups\"\n | \"unknown_visible_group\"\n | \"malformed_scope_vocab\"\n | \"unsupported_scope_vocab\";\n\n/** The governing row's identity (prototype `viewingPolicyFor` `policy`). */\nexport interface ViewingPolicyRef {\n /** The row's `entity_id`, else `id`, else `_id`. */\n readonly id: string;\n readonly familyId: string | null;\n /** A positive integer, or `null` when the row carries none (or a malformed one). */\n readonly version: number | null;\n}\n\n/** A team's own row, or the account-wide rule, governs. */\nexport interface ViewingPolicyGoverning {\n readonly source: \"team\" | \"account\";\n /** The level the policy grants (before the role clamp). */\n readonly level: ViewingLevel;\n /**\n * The categories still shown at Level 3, as stored (a copy), minus any\n * `category_rest` row. A row with no list reads `[]` (only the stub and system\n * information show). Every code is live at the tree version `scopeVocab` reads.\n */\n readonly visibleGroups: readonly string[];\n readonly scopeVocab: ViewingPolicyScopeVocab;\n readonly policy: ViewingPolicyRef;\n readonly accountId: string;\n /** A short, value-free trace of the decision, for logs (ids and versions only). */\n readonly rulePath: string;\n}\n\n/** No row governs: the account set nothing for this team. The role level alone decides. */\nexport interface ViewingPolicyNone {\n readonly source: \"none\";\n readonly level: null;\n /** `null`: no row, so Level 3 shows the full record. */\n readonly visibleGroups: null;\n readonly scopeVocab: null;\n readonly policy: null;\n readonly accountId: string;\n /** The account holds viewing rows and every one is retired (`active: false`): log it. */\n readonly retiredRowsOnly: boolean;\n readonly rulePath: string;\n}\n\n/** The policy could not be read: no view of other teams' cases for this request. */\nexport interface ViewingPolicyUnavailable {\n readonly source: \"unavailable\";\n readonly level: 0;\n readonly visibleGroups: readonly string[];\n readonly scopeVocab: null;\n readonly policy: null;\n readonly reason: ViewingPolicyUnavailableReason;\n /** The offending row's id, when one row caused it. */\n readonly policyId: string | null;\n readonly rulePath: string;\n}\n\nexport type GoverningViewingPolicy =\n | ViewingPolicyGoverning\n | ViewingPolicyNone\n | ViewingPolicyUnavailable;\n\n/** A stored viewing row, as raw as it is on disk (the platform owns the writer). */\ninterface RawViewingPolicyDoc {\n _id?: unknown;\n entity_id?: unknown;\n id?: unknown;\n familyId?: unknown;\n version?: unknown;\n active?: unknown;\n level?: unknown;\n visibleGroups?: unknown;\n scopeVocab?: unknown;\n assignments?: unknown;\n species?: unknown;\n account_id?: unknown;\n}\n\n/** Where one row applies: the whole account, one team, or unplaceable. */\ntype Placement =\n | { kind: \"account\" }\n | { kind: \"team\"; teamId: string }\n | { kind: \"unreadable\" };\n\n// ─── Helpers (PAVE's, verbatim in behaviour) ─────────────────────────────────\n\n/**\n * The policy could not be read — the shape every fail-closed answer takes. Apps\n * use it for their own I/O outcomes (`read_error`, `policy_store_absent`, …).\n */\nexport function unavailableViewingPolicy(\n reason: ViewingPolicyUnavailableReason,\n policyId?: string | null,\n): ViewingPolicyUnavailable {\n return {\n source: \"unavailable\",\n level: 0,\n visibleGroups: [],\n scopeVocab: null,\n policy: null,\n reason,\n policyId: policyId ?? null,\n rulePath:\n `viewing policy unavailable: ${reason}` +\n (policyId ? ` (${policyId})` : \"\") +\n \" — no view of other teams' cases\",\n };\n}\n\nconst HEX_OBJECT_ID = /^[0-9a-fA-F]{24}$/;\n\n/** The hex of an ObjectId-like value (duck-typed), lower-case; `null` for anything else. */\nfunction objectIdHex(v: unknown): string | null {\n if (typeof v === \"object\" && v !== null && \"toHexString\" in v) {\n const toHex: unknown = (v as { toHexString: unknown }).toHexString;\n if (typeof toHex === \"function\") {\n const hex: unknown = toHex.call(v);\n if (typeof hex === \"string\") return hex.toLowerCase();\n }\n }\n return null;\n}\n\n/** A stored id as text, or `null` when it is not an id. */\nfunction idText(v: unknown): string | null {\n if (typeof v === \"string\") return v === \"\" ? null : v;\n return objectIdHex(v);\n}\n\n/**\n * One spelling per id: a 24-hex ObjectId string is lower-cased (an ObjectId's own\n * rendering is lower-case; a hand-typed team id may not be); any other id is\n * compared exactly.\n */\nfunction normalizedId(id: string): string {\n return HEX_OBJECT_ID.test(id) ? id.toLowerCase() : id;\n}\n\nfunction policyIdOf(d: RawViewingPolicyDoc): string {\n return idText(d.entity_id) ?? idText(d.id) ?? idText(d._id) ?? \"(no id)\";\n}\n\n/**\n * A row's ONE assignment: the whole account or one team. Anything else — no\n * assignment, several, a mix, an unknown scope, a team entry with no team — is\n * UNREADABLE: the row might be this team's narrowing, and skipping it could widen.\n */\nfunction placementOf(d: RawViewingPolicyDoc): Placement {\n if (!Array.isArray(d.assignments) || d.assignments.length !== 1) {\n return { kind: \"unreadable\" };\n }\n const [a] = d.assignments as unknown[];\n if (typeof a !== \"object\" || a === null) return { kind: \"unreadable\" };\n const { scope, teamId } = a as { scope?: unknown; teamId?: unknown };\n if (scope === \"account\") return { kind: \"account\" };\n const team = idText(teamId);\n if (scope === \"team\" && team !== null) {\n return { kind: \"team\", teamId: normalizedId(team) };\n }\n return { kind: \"unreadable\" };\n}\n\n/** A positive integer, or `null` when absent; `undefined` when malformed. */\nfunction positiveIntOrNull(v: unknown): number | null | undefined {\n if (v === undefined || v === null) return null;\n return typeof v === \"number\" && Number.isInteger(v) && v >= 1 ? v : undefined;\n}\n\n/**\n * The ONE live row of a place. Several live rows are read in version order only\n * when they are one family with distinct versions (a prior version the writer has\n * not yet deactivated); otherwise the place is ambiguous.\n */\nfunction governingRowOf(\n rows: readonly RawViewingPolicyDoc[],\n): { row: RawViewingPolicyDoc } | ViewingPolicyUnavailable {\n const [only] = rows;\n if (rows.length === 1 && only !== undefined) return { row: only };\n const family = idText(rows[0]?.familyId);\n const versions = rows.map((r) => positiveIntOrNull(r.version));\n const ordered =\n family !== null &&\n rows.every((r) => idText(r.familyId) === family) &&\n versions.every((v): v is number => typeof v === \"number\") &&\n new Set(versions).size === versions.length;\n if (!ordered) {\n return unavailableViewingPolicy(\"ambiguous_rows\", policyIdOf(rows[0] ?? {}));\n }\n let best = rows[0] as RawViewingPolicyDoc;\n for (const r of rows) {\n if ((r.version as number) > (best.version as number)) best = r;\n }\n return { row: best };\n}\n\n/**\n * Every code must be a live CVC-236 code at the tree version the stamp reads at:\n * an unknown or retired code fails closed rather than being quietly dropped.\n */\nfunction whitelistProblem(\n visibleGroups: readonly string[],\n vocab: ViewingPolicyVocabulary,\n scope: ViewingPolicyScopeResolver,\n): ViewingPolicyUnavailableReason | null {\n const reading: ScopeReading = scope.readSelection(visibleGroups, vocab.scopeVersion, {\n subject: \"policy\",\n });\n if (reading.unsupportedVersion) return \"unsupported_scope_vocab\";\n if (reading.unknown.length > 0 || reading.retired.length > 0) {\n return \"unknown_visible_group\";\n }\n return null;\n}\n\n/**\n * The whitelist as viewing reads it: without a `category_rest` row\n * (`identifying.other`). Naming that row covers its whole category on the share\n * side; the prototype's viewing gate reads the category alone, so here it opens\n * nothing. Dropped, not refused (PAVE `withoutRestRows`).\n */\nfunction withoutRestRows(\n visibleGroups: readonly string[],\n scope: ViewingPolicyScopeResolver,\n): string[] {\n return visibleGroups.filter((code) => scope.row(code)?.rowType !== \"category_rest\");\n}\n\nfunction ruleText(source: \"team\" | \"account\", ref: ViewingPolicyRef): string {\n const v = ref.version === null ? \"\" : ` v${ref.version}`;\n return source === \"team\"\n ? `${ref.id}${v} (the team's own row — it governs this team in place of the account-wide rule)`\n : `${ref.id}${v} (the account-wide viewing rule — no row for this team)`;\n}\n\n/** Read the governing row's fields; any malformed field is unavailable. */\nfunction readRow(\n d: RawViewingPolicyDoc,\n source: \"team\" | \"account\",\n accountId: string,\n scope: ViewingPolicyScopeResolver,\n): GoverningViewingPolicy {\n const policyId = policyIdOf(d);\n const level = d.level;\n if (level !== 0 && level !== 1 && level !== 2 && level !== 3) {\n return unavailableViewingPolicy(\"malformed_level\", policyId);\n }\n let visibleGroups: string[] = [];\n if (d.visibleGroups !== undefined && d.visibleGroups !== null) {\n if (!Array.isArray(d.visibleGroups) || !d.visibleGroups.every((g) => typeof g === \"string\")) {\n return unavailableViewingPolicy(\"malformed_visible_groups\", policyId);\n }\n visibleGroups = [...(d.visibleGroups as string[])];\n }\n const scopeVocab = positiveIntOrNull(d.scopeVocab);\n if (scopeVocab === undefined) {\n return unavailableViewingPolicy(\"malformed_scope_vocab\", policyId);\n }\n // EVERY governing row must carry a stamp the reader reads (3, 4 or 5), at every\n // level and with or without a list: the hub stamps every save, so a row without\n // one was not written by it, and a Level 3 row read at all shows the client's\n // name and date of birth to other teams (PAVE `readRow`).\n const vocab = viewingPolicyVocabulary(scopeVocab);\n if (scopeVocab === null || vocab === null) {\n return unavailableViewingPolicy(\"unsupported_scope_vocab\", policyId);\n }\n const problem = whitelistProblem(visibleGroups, vocab, scope);\n if (problem !== null) return unavailableViewingPolicy(problem, policyId);\n const policy: ViewingPolicyRef = {\n id: policyId,\n familyId: idText(d.familyId),\n version: positiveIntOrNull(d.version) ?? null,\n };\n return {\n source,\n level,\n visibleGroups: withoutRestRows(visibleGroups, scope),\n scopeVocab: scopeVocab as ViewingPolicyScopeVocab,\n policy,\n accountId,\n rulePath: ruleText(source, policy),\n };\n}\n\n// ─── The reader ──────────────────────────────────────────────────────────────\n\n/**\n * The internal-viewing policy that governs `query.teamId` on `query.accountId`,\n * chosen from the candidate rows the app read. NEVER throws; see the module\n * header for every outcome.\n *\n * `docs`: the account's policy documents (`registry_policies`), or `null` /\n * `undefined` when the read failed (`read_error`). Rows of another species or\n * another account are skipped, as the app's own query would have left them out.\n * Mongo answers `[]` for a collection that does not exist, so on an empty answer\n * the app must check that the policy store exists and pass\n * `unavailableViewingPolicy(\"policy_store_absent\")` when it does not (PAVE's\n * reader checks with `listCollections`); an empty list from a store that exists\n * means \"none\".\n */\nexport function resolveViewingPolicy(\n docs: readonly unknown[] | null | undefined,\n query: ViewingPolicyQuery,\n scope: ViewingPolicyScopeResolver,\n): GoverningViewingPolicy {\n const accountRaw = typeof query.accountId === \"string\" ? query.accountId.trim() : \"\";\n if (accountRaw === \"\") return unavailableViewingPolicy(\"account_unresolved\");\n if (!Array.isArray(docs)) return unavailableViewingPolicy(\"read_error\");\n const accountId = normalizedId(accountRaw);\n const teamRaw = typeof query.teamId === \"string\" ? query.teamId.trim() : \"\";\n const actingTeamId = teamRaw !== \"\" ? normalizedId(teamRaw) : null;\n\n // The app's query: `species: \"viewing\"`, `account_id` = this Account (any stored\n // id form, hex in either case).\n const rows: RawViewingPolicyDoc[] = [];\n for (const raw of docs) {\n if (typeof raw !== \"object\" || raw === null) {\n return unavailableViewingPolicy(\"read_error\");\n }\n const d = raw as RawViewingPolicyDoc;\n if (d.species !== VIEWING_POLICY_SPECIES) continue;\n const owner = idText(d.account_id);\n if (owner === null || normalizedId(owner) !== accountId) continue;\n rows.push(d);\n }\n\n const teamRows: RawViewingPolicyDoc[] = [];\n const accountRows: RawViewingPolicyDoc[] = [];\n for (const d of rows) {\n // A retired version never governs (the writer deactivates the prior one).\n if (d.active === false) continue;\n const placement = placementOf(d);\n if (placement.kind === \"unreadable\") {\n return unavailableViewingPolicy(\"unreadable_assignment\", policyIdOf(d));\n }\n const governsHere =\n placement.kind === \"account\" ||\n (actingTeamId !== null && placement.teamId === actingTeamId);\n if (!governsHere) continue; // another team's row\n // Only `active: true` is live; an absent / null `active` is a row this reader\n // cannot classify.\n if (d.active !== true) {\n return unavailableViewingPolicy(\"malformed_active\", policyIdOf(d));\n }\n if (placement.kind === \"account\") accountRows.push(d);\n else teamRows.push(d);\n }\n\n // Ruling (a): the team's own row REPLACES the account-wide rule.\n const [source, candidates]: [\"team\" | \"account\", RawViewingPolicyDoc[]] =\n teamRows.length > 0 ? [\"team\", teamRows] : [\"account\", accountRows];\n if (candidates.length === 0) {\n const retiredRowsOnly = rows.length > 0 && rows.every((d) => d.active === false);\n return {\n source: \"none\",\n level: null,\n visibleGroups: null,\n scopeVocab: null,\n policy: null,\n accountId,\n retiredRowsOnly,\n rulePath: retiredRowsOnly\n ? \"no viewing policy on file (every viewing row is retired) — the role level alone decides\"\n : \"no viewing policy on file — the role level alone decides\",\n };\n }\n const governing = governingRowOf(candidates);\n if (!(\"row\" in governing)) return governing;\n return readRow(governing.row, source, accountId, scope);\n}\n\n/**\n * The `teamViewingLevel` argument of `viewingLevelFromFunctions` /\n * `resolveEffectiveViewingLevel` (contract § 3): the row's level when a row\n * governs; `null` when none does (the role level alone decides); `0` when the\n * policy could not be read (fail closed).\n */\nexport function teamViewingLevelFromPolicy(policy: GoverningViewingPolicy): ViewingLevel | null {\n switch (policy.source) {\n case \"team\":\n case \"account\":\n return policy.level;\n case \"none\":\n return null;\n default:\n return 0;\n }\n}\n","/**\n * @htilabs/platform-common-models/authz — the Level 3 category filter of internal\n * viewing: what of a case a viewer who does not own it may see, given the\n * effective level and the governing policy's `visibleGroups` / `scopeVocab`.\n *\n * Lifted from PAVE `@pave/domain` `viewingScope.ts` (pave-2.0 develop 41f5f916:\n * `caseViewingAccess`, `recordViewing`, `caseSurfacesOn`, `caseSurfacesAsStub`)\n * and `viewingProjection.ts` (`viewingComponentOpen`), unchanged in behaviour.\n * The only difference: PAVE reads its module-level resolver binding; here the\n * app passes its own binding of the CVC-236 v4 resolver (`scope`), so the\n * browser-safe `./authz` entry never inlines the SOT JSON. PAVE's wire\n * projections (`viewingProjection` field lists, route homes) and the stub\n * projection stay in the app.\n *\n * Pure and I/O-free: the caller resolves every fact about the viewer (effective\n * level, whether the case passes its agency / team row filter, ownership, the\n * governing policy) and this module only decides.\n *\n * Rules (contract § 2; Crysta 2026-11-03; prototype `recordOpenAccess`,\n * `carVisibleUnderAccess`, `applyViewingPolicy`):\n * - a case the viewer cannot see: nothing; an owned case: the full record;\n * - level 1: the stub in search; level 2: the stub in search and pickers;\n * neither opens the record; level 0: nothing;\n * - level 3 with NO policy on file (`whitelist: null`): the full record;\n * - level 3 with a policy: the client's stub rows and system information\n * always, plus whatever the whitelist COVERS on the record's kind-tree home\n * row (a category covers that category under every person on the record).\n * Unmapped or uncovered is hidden; an empty list hides everything else;\n * - the author always sees their own record on a case they can see.\n */\n\nimport type {\n InformationScopeResolver,\n ScopeReading,\n ScopeSubjectKind,\n} from \"../services/informationScopeResolver.js\";\nimport type { ViewingLevel } from \"./resolveEffectiveFunctions.js\";\nimport { type GoverningViewingPolicy, viewingPolicyVocabulary } from \"./viewingPolicy.js\";\n\n/**\n * The bound CVC-236 resolver the Level 3 filter reads (the app's binding of\n * `createInformationScopeResolver` to `coreInformationScopeSot`).\n */\nexport type ViewingScopeResolver = Pick<\n InformationScopeResolver,\n \"row\" | \"readSelection\" | \"isCovered\"\n>;\n\n/** Where a non-owned case can surface (prototype `applyViewingPolicy` context + record open). */\nexport type ViewingSurface = \"search\" | \"autocomplete\" | \"open\";\n\n/** A stored viewing whitelist (the admin-set by-category selection). */\nexport interface StoredViewingWhitelist {\n /** Flat list of scope codes (the policy's `visibleGroups`). */\n informationScope: readonly string[] | null | undefined;\n /**\n * The policy's vocabulary stamp as the hub wrote it (`scopeVocab`: 3, 4 or 5) —\n * never the CVC-236 tree version. Any other value reads nothing.\n */\n scopeVocab: number | null | undefined;\n}\n\n/** Everything the caller resolved about the viewer and the case. */\nexport interface ViewingContext {\n /** The case passes the caller's agency / team row filter. `false` ⇒ nothing on it. */\n canSeeCase: boolean;\n /** The case is owned / claimed by the viewer or their team: always fully visible. */\n ownedByViewer: boolean;\n /** The effective viewing level (`viewingLevelFromFunctions`). */\n level: ViewingLevel;\n /**\n * The governing policy's whitelist ({@link viewingWhitelistFromPolicy}). `null`\n * means exactly one thing: NO viewing policy is on file, so Level 3 renders every\n * component. A row with no list is an empty list, not `null`.\n */\n whitelist: StoredViewingWhitelist | null;\n}\n\n/** The decision for one case. */\nexport type CaseViewingAccess =\n | { readonly mode: \"full\"; readonly reason: \"owned\" | \"no_viewing_policy\" }\n | { readonly mode: \"none\"; readonly reason: \"cannot_see_case\" | \"level_0\" }\n | { readonly mode: \"stub\"; readonly level: 1 | 2 }\n | {\n readonly mode: \"whitelist\";\n /** The whitelist's v4 reading (`readSelection`, subject `policy`), untouched. */\n readonly reading: ScopeReading;\n /**\n * The list coverage is read on: the reading, plus `relationships_household`\n * when the prototype's v4 alias on `identifying` applies (a stamp below 5).\n */\n readonly visibleScope: readonly string[];\n /** The prototype's ONE-HOME domain carry applies (stamp 3). */\n readonly oneHomeCarry: boolean;\n /** The v4 alias carries `relationship_dynamics` at domain grain (stamp < 5 naming `identifying`). */\n readonly relationshipDynamicsCarry: boolean;\n };\n\n/** The vocabulary stamp a whitelist with no stored stamp of its own is read at. */\nconst CURRENT_VIEWING_POLICY_VOCAB = 5;\n\n/** The v4 category the prototype's alias opens for a pre-v4 `identifying`. */\nconst RELATIONSHIPS_HOUSEHOLD = \"relationships_household\";\n\n/** The assertion domain the prototype's v4 alias carries at domain grain. */\nconst RELATIONSHIP_DYNAMICS = \"relationship_dynamics\";\n\n/**\n * The whitelist {@link caseViewingAccess} reads for a governing-policy result:\n * `null` when nothing governs (the full record at Level 3); the row's list and\n * stamp when a row governs; an unreadable empty list when the policy is\n * unavailable (whose level 0 already shows nothing — never widens).\n */\nexport function viewingWhitelistFromPolicy(\n policy: GoverningViewingPolicy,\n): StoredViewingWhitelist | null {\n switch (policy.source) {\n case \"none\":\n return null;\n case \"team\":\n case \"account\":\n return { informationScope: [...policy.visibleGroups], scopeVocab: policy.scopeVocab };\n default:\n return { informationScope: [], scopeVocab: null };\n }\n}\n\n/** Resolve a viewer's access to one case. */\nexport function caseViewingAccess(\n ctx: ViewingContext,\n scope: ViewingScopeResolver,\n): CaseViewingAccess {\n // An exhaustive, strict ladder: every out-of-type input lands on the NARROWEST\n // branch, never falls through to a wider one.\n if (ctx.canSeeCase !== true) {\n return { mode: \"none\", reason: \"cannot_see_case\" };\n }\n if (ctx.ownedByViewer === true) return { mode: \"full\", reason: \"owned\" };\n if (ctx.level === 1 || ctx.level === 2) {\n return { mode: \"stub\", level: ctx.level };\n }\n if (ctx.level !== 3) return { mode: \"none\", reason: \"level_0\" };\n // Exactly `null`: no viewing policy on file. An ABSENT whitelist is out-of-type\n // input, not that fact, so it reads as an empty list and never widens.\n if (ctx.whitelist === null) {\n return { mode: \"full\", reason: \"no_viewing_policy\" };\n }\n const stored: StoredViewingWhitelist = ctx.whitelist ?? {\n informationScope: [],\n scopeVocab: CURRENT_VIEWING_POLICY_VOCAB,\n };\n const stamp = typeof stored.scopeVocab === \"number\" ? stored.scopeVocab : null;\n const vocab = viewingPolicyVocabulary(stamp);\n // A stamp this reader cannot read is handed to the resolver as stored (never 3\n // or 4, which are readable), so the resolver reads it unsupported and includes\n // nothing; an unstamped list is unsupported (fail closed).\n const reading = scope.readSelection(\n stored.informationScope,\n vocab !== null ? vocab.scopeVersion : stamp,\n { subject: \"policy\" },\n );\n // The alias reads the stored category itself, so a list naming only `names`\n // does not carry it.\n const identifyingAlias =\n vocab !== null && vocab.identifyingAlias && reading.informationScope.includes(\"identifying\");\n return {\n mode: \"whitelist\",\n reading,\n visibleScope: identifyingAlias\n ? [...reading.informationScope, RELATIONSHIPS_HOUSEHOLD]\n : reading.informationScope,\n oneHomeCarry: vocab !== null && vocab.oneHomeCarry,\n relationshipDynamicsCarry: identifyingAlias,\n };\n}\n\n/**\n * Does the case surface on `surface`? Level 1 — search only; level 2 — search and\n * autocomplete; neither opens the record. Level 3 and full open it.\n */\nexport function caseSurfacesOn(access: CaseViewingAccess, surface: ViewingSurface): boolean {\n switch (access.mode) {\n case \"none\":\n return false;\n case \"full\":\n case \"whitelist\":\n return true;\n case \"stub\":\n if (surface === \"search\") return true;\n if (surface === \"autocomplete\") return access.level === 2;\n return false;\n }\n}\n\n/** Does the case surface as the stub projection (levels 1 and 2 only)? */\nexport function caseSurfacesAsStub(access: CaseViewingAccess): boolean {\n return access.mode === \"stub\";\n}\n\n/** One record on a case, as the viewing decision reads it. */\nexport interface ViewingRecord {\n /** The v4 kind-tree row the record's field is homed on (never a per-kind code). */\n homeRow: string;\n /** Whose record it is: the client, or another named person's kind. */\n subjectKind: ScopeSubjectKind;\n /** The author's user id. The author always sees their own record. */\n authorUserId?: string | null | undefined;\n /** The record's assertion domain, read ONLY by the pre-v4 carries. */\n domain?: string | null | undefined;\n}\n\n/** Why a record is (not) visible. */\nexport type RecordViewingReason =\n | \"author\"\n | \"full\"\n | \"stub_row\"\n | \"covered\"\n | \"one_home_carry\"\n | \"identifying_alias_carry\"\n | \"cannot_see_case\"\n | \"level_0\"\n | \"not_opened\"\n | \"not_covered\"\n | \"unknown_row\";\n\nexport interface RecordViewingDecision {\n readonly visible: boolean;\n readonly reason: RecordViewingReason;\n}\n\n/**\n * The pre-v4 ONE-HOME carry: a stamp-3 whitelist that does NOT cover Screens &\n * assessments keeps showing the three domains it showed before the re-point.\n * Domain grain; the CATEGORY must be named.\n */\nconst ONE_HOME_CARRY: ReadonlyArray<{\n readonly homeRow: string;\n readonly domains: ReadonlySet<string>;\n readonly unlockedBy: string;\n}> = [\n { homeRow: \"summary_ida\", domains: new Set([\"ida_determination\"]), unlockedBy: \"risk\" },\n {\n homeRow: \"summary_needs_assessment\",\n domains: new Set([\"needs_assessment\", \"recommended_followup\"]),\n unlockedBy: \"services\",\n },\n];\n\nfunction isClientStubRow(scope: ViewingScopeResolver, code: string): boolean {\n const row = scope.row(code);\n return (\n row !== undefined &&\n row.levelFloor === 1 &&\n row.rowType !== \"branch\" &&\n (row.kindBranch === \"client\" || row.kindBranch === null)\n );\n}\n\n/**\n * May the viewer see this record on the case? A case the viewer cannot see:\n * nothing (checked first, even for the author); the author: their own record;\n * level 0: nothing; an owned case or no policy: all; level 1 / 2: the record never\n * opens; level 3: the client's stub rows always, otherwise the whitelist must\n * COVER the record's kind-tree home row.\n */\nexport function recordViewing(\n access: CaseViewingAccess,\n record: ViewingRecord,\n viewerUserId: string | null | undefined,\n scope: ViewingScopeResolver,\n): RecordViewingDecision {\n if (access.mode === \"none\" && access.reason === \"cannot_see_case\") {\n return { visible: false, reason: \"cannot_see_case\" };\n }\n const author = record.authorUserId;\n if (typeof author === \"string\" && author.trim().length > 0 && author === viewerUserId) {\n return { visible: true, reason: \"author\" };\n }\n switch (access.mode) {\n case \"none\":\n return { visible: false, reason: access.reason };\n case \"full\":\n return { visible: true, reason: \"full\" };\n case \"stub\":\n return { visible: false, reason: \"not_opened\" };\n case \"whitelist\":\n return whitelistDecision(access, record, scope);\n }\n}\n\nfunction whitelistDecision(\n access: Extract<CaseViewingAccess, { mode: \"whitelist\" }>,\n record: ViewingRecord,\n scope: ViewingScopeResolver,\n): RecordViewingDecision {\n const home = scope.row(record.homeRow);\n // Deny-by-default for a home the tree does not know, and for a per-kind code\n // passed as a home (a home is a kind-tree row).\n if (home === undefined || home.kindRow !== undefined) {\n return { visible: false, reason: \"unknown_row\" };\n }\n if (\n (record.subjectKind === \"client\" || home.kindBranch !== \"client\") &&\n isClientStubRow(scope, record.homeRow)\n ) {\n return { visible: true, reason: \"stub_row\" };\n }\n const list = access.visibleScope;\n if (scope.isCovered(list, record.homeRow)) {\n return { visible: true, reason: \"covered\" };\n }\n if (access.relationshipDynamicsCarry && record.domain === RELATIONSHIP_DYNAMICS) {\n return { visible: true, reason: \"identifying_alias_carry\" };\n }\n if (\n access.oneHomeCarry &&\n !scope.isCovered(list, \"instruments\") &&\n typeof record.domain === \"string\"\n ) {\n for (const carry of ONE_HOME_CARRY) {\n if (\n record.homeRow === carry.homeRow &&\n carry.domains.has(record.domain) &&\n scope.isCovered(list, carry.unlockedBy)\n ) {\n return { visible: true, reason: \"one_home_carry\" };\n }\n }\n }\n return { visible: false, reason: \"not_covered\" };\n}\n\n/** Is this kind-tree row visible under `access` (for the client)? */\nexport function viewingRowVisible(\n access: CaseViewingAccess,\n homeRow: string,\n scope: ViewingScopeResolver,\n): boolean {\n return recordViewing(access, { homeRow, subjectKind: \"client\" }, null, scope).visible;\n}\n\n/**\n * Is this home row OPEN as a whole component under `access`: does the whitelist\n * itself cover it? Stricter than {@link viewingRowVisible}: the stub (a name and a\n * date of birth) does not open a whole component such as the name history behind\n * it. System information is on every list, so it opens.\n */\nexport function viewingComponentOpen(\n access: CaseViewingAccess,\n homeRow: string,\n scope: ViewingScopeResolver,\n): boolean {\n if (access.mode === \"full\") return true;\n if (access.mode !== \"whitelist\") return false;\n const row = scope.row(homeRow);\n if (row === undefined || row.kindRow !== undefined) return false;\n if (row.status === \"retired\") return false;\n return scope.isCovered(access.visibleScope, homeRow);\n}\n"],"mappings":";AAYO,IAAM,mBAAmB;AAAA;AAAA,EAE9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MAAM,QAAQ,iBAAiB;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AACA,SAAO,EAAE,SAAS,OAAO,QAAQ,cAAc;AACjD;AAGO,SAAS,kBACd,QACA,SACA,OACS;AACT,SAAO,cAAc,QAAQ,EAAE,SAAS,aAAa,SAAS,GAAG,MAAM,KAAK,EAAE;AAChF;AAQO,SAAS,qBACd,QACA,SACA,OACS;AACT,MAAI,OAAO,SAAS,OAAQ,QAAO;AACnC,MAAI,OAAO,SAAS,YAAa,QAAO;AACxC,QAAM,MAAM,MAAM,IAAI,OAAO;AAC7B,MAAI,QAAQ,UAAa,IAAI,YAAY,OAAW,QAAO;AAC3D,MAAI,IAAI,WAAW,UAAW,QAAO;AACrC,SAAO,MAAM,UAAU,OAAO,cAAc,OAAO;AACrD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/constants/platform-auth.ts","../../src/generated/cvc-enums.ts","../../src/generated/coreFunctionsEvaluable.ts","../../src/authz/storedReads.ts","../../src/authz/resolveEffectiveFunctions.ts","../../src/generated/coreFunctionDefaultBounds.ts","../../src/authz/defaultBounds.ts","../../src/generated/coreFunctionNotes.ts","../../src/authz/functionNotes.ts","../../src/generated/authzBrowserTables.ts","../../src/authz/roleCodes.ts","../../src/authz/functionDoor.ts","../../src/authz/viewingPolicy.ts","../../src/authz/viewingScope.ts"],"sourcesContent":["/**\n * @htilabs/platform-common-models — Platform Authorization Constants\n *\n * Enums and labels for the platform role/function permission model.\n * Includes permission states, share view levels, tool codes, role levels,\n * and function implementation statuses.\n *\n * Source: PLATFORM_AUTH_SPEC.md Sections 5 + 6\n */\n\n// ─── Permission State (4-state role→function mapping) ──────────────\n\nexport const PERMISSION_STATE = {\n /** Role can always perform this function (mandatory, cannot disable). */\n ALWAYS: \"ALWAYS\",\n /** Default On — user can opt off. */\n PREF_YES: \"PREF_YES\",\n /** Default Off — user can opt in. */\n PREF_NO: \"PREF_NO\",\n /** Role is explicitly barred from this function. */\n NEVER: \"NEVER\",\n} as const;\n\nexport type PermissionStateValue =\n (typeof PERMISSION_STATE)[keyof typeof PERMISSION_STATE];\n\nexport const PERMISSION_STATE_VALUES = [\n PERMISSION_STATE.ALWAYS,\n PERMISSION_STATE.PREF_YES,\n PERMISSION_STATE.PREF_NO,\n PERMISSION_STATE.NEVER,\n] as const;\n\nexport const PERMISSION_STATE_LABELS: Record<PermissionStateValue, string> = {\n [PERMISSION_STATE.ALWAYS]: \"Always\",\n [PERMISSION_STATE.PREF_YES]: \"Default On\",\n [PERMISSION_STATE.PREF_NO]: \"Default Off\",\n [PERMISSION_STATE.NEVER]: \"Never\",\n};\n\n/** UI display metadata for permission states (colors, icons). */\nexport const PERMISSION_STATE_DISPLAY: Record<\n PermissionStateValue,\n { label: string; color: string; bgColor: string; icon: string }\n> = {\n [PERMISSION_STATE.ALWAYS]: {\n label: \"Always\",\n color: \"#2e7d32\",\n bgColor: \"#e8f5e9\",\n icon: \"\\u{1F512}\",\n },\n [PERMISSION_STATE.PREF_YES]: {\n label: \"Default On\",\n color: \"#1565c0\",\n bgColor: \"#e3f2fd\",\n icon: \"\\u{1F513}\",\n },\n [PERMISSION_STATE.PREF_NO]: {\n label: \"Default Off\",\n color: \"#e65100\",\n bgColor: \"#fff3e0\",\n icon: \"\\u{1F513}\",\n },\n [PERMISSION_STATE.NEVER]: {\n label: \"Never\",\n color: \"#c62828\",\n bgColor: \"#ffebee\",\n icon: \"\\u{1F512}\",\n },\n};\n\n// ─── Codebook default bound (CVC-133 `bounds:`, per role × function) ──\n\n/**\n * The state the CVC-133 codebook gives one role for one function: the four\n * PERMISSION_STATE values plus `NA` (\"Not relevant\": canon's\n * `not_applicable_roles`). Canon's `always` / `default_on` / `default_off` /\n * `never` read ALWAYS / PREF_YES / PREF_NO / NEVER. A role the codebook does\n * not name for a function has NO default bound (\"unbound\"), which is an absent\n * key, never a sixth value.\n *\n * `NA` is deliberately NOT a PERMISSION_STATE: it is codebook vocabulary, not\n * a grantable policy state. The shared resolver reads a stored `NA` as NEVER\n * at every tier (and any other value outside PERMISSION_STATE as malformed,\n * which also denies).\n */\nexport const DEFAULT_BOUND_STATE = {\n ...PERMISSION_STATE,\n /** Not relevant — canon's `not_applicable_roles` for this function. */\n NA: \"NA\",\n} as const;\n\nexport type DefaultBoundStateValue =\n (typeof DEFAULT_BOUND_STATE)[keyof typeof DEFAULT_BOUND_STATE];\n\nexport const DEFAULT_BOUND_STATE_VALUES = [\n ...PERMISSION_STATE_VALUES,\n DEFAULT_BOUND_STATE.NA,\n] as const;\n\n/**\n * Labels for a Tier-1 (platform role) state, which may be the codebook's `NA`\n * since 0.24.0. `PERMISSION_STATE_LABELS` / `PERMISSION_STATE_DISPLAY` keep\n * their four keys (agency and team states have no NA); index THESE with a\n * `PlatformRoleDef.functions` value, or a stored \"NA\" looks up `undefined`.\n * \"Not relevant\" is the codebook chip label (platform-prototype @ a6f1f3a\n * `src/screens.jsx:19151` `PB_STATE_SHORT.na`).\n */\nexport const DEFAULT_BOUND_STATE_LABELS: Record<DefaultBoundStateValue, string> = {\n ...PERMISSION_STATE_LABELS,\n [DEFAULT_BOUND_STATE.NA]: \"Not relevant\",\n};\n\n/**\n * `PERMISSION_STATE_DISPLAY` plus `NA`. Like the other four entries these are\n * package display defaults, not canon tokens (canon inks NA with\n * `--highlight-sandstone-gold`, `assets/app-styles.css:12318`).\n */\nexport const DEFAULT_BOUND_STATE_DISPLAY: Record<\n DefaultBoundStateValue,\n { label: string; color: string; bgColor: string; icon: string }\n> = {\n ...PERMISSION_STATE_DISPLAY,\n [DEFAULT_BOUND_STATE.NA]: {\n label: \"Not relevant\",\n color: \"#616161\",\n bgColor: \"#f5f5f5\",\n icon: \"\\u25CC\",\n },\n};\n\n// ─── Share View (data visibility for shared records) ───────────────\n\nexport const SHARE_VIEW = {\n /** System metadata only (partial access). */\n SYS_INFO: \"sys_info\",\n /** Full case/record content. */\n ALL: \"all\",\n /** No data access. */\n NONE: \"none\",\n} as const;\n\nexport type ShareViewValue = (typeof SHARE_VIEW)[keyof typeof SHARE_VIEW];\n\nexport const SHARE_VIEW_VALUES = [\n SHARE_VIEW.SYS_INFO,\n SHARE_VIEW.ALL,\n SHARE_VIEW.NONE,\n] as const;\n\nexport const SHARE_VIEW_LABELS: Record<ShareViewValue, string> = {\n [SHARE_VIEW.SYS_INFO]: \"System Info Only\",\n [SHARE_VIEW.ALL]: \"Full Content\",\n [SHARE_VIEW.NONE]: \"No Data Access\",\n};\n\n// ─── Platform Tool Codes ───────────────────────────────────────────\n\nexport const PLATFORM_TOOL = {\n PAVE: \"PAVE\",\n ECHO: \"ECHO\",\n LEADS: \"LEADS\",\n THREAD: \"THREAD\",\n TRAIL: \"TRAIL\",\n PLATFORM: \"PLATFORM\",\n} as const;\n\nexport type PlatformToolValue =\n (typeof PLATFORM_TOOL)[keyof typeof PLATFORM_TOOL];\n\nexport const PLATFORM_TOOL_VALUES = [\n PLATFORM_TOOL.PAVE,\n PLATFORM_TOOL.ECHO,\n PLATFORM_TOOL.LEADS,\n PLATFORM_TOOL.THREAD,\n PLATFORM_TOOL.TRAIL,\n PLATFORM_TOOL.PLATFORM,\n] as const;\n\nexport const PLATFORM_TOOL_LABELS: Record<PlatformToolValue, string> = {\n [PLATFORM_TOOL.PAVE]: \"PAVE\",\n [PLATFORM_TOOL.ECHO]: \"Echo\",\n [PLATFORM_TOOL.LEADS]: \"LEADS\",\n [PLATFORM_TOOL.THREAD]: \"Thread\",\n [PLATFORM_TOOL.TRAIL]: \"Trail\",\n [PLATFORM_TOOL.PLATFORM]: \"Platform\",\n};\n\n// ─── Role Level (hierarchy tiers) ──────────────────────────────────\n\nexport const ROLE_LEVEL = {\n /** User-facing roles (staff, volunteers, practitioners). */\n OPERATIONAL: \"operational\",\n /** Agency-level admin roles. */\n AGENCY: \"agency\",\n /** Team-level admin roles. */\n TEAM: \"team\",\n /** HTI-wide platform admin. */\n PLATFORM: \"platform\",\n /** External governance/oversight roles. */\n OVERSIGHT: \"oversight\",\n} as const;\n\nexport type RoleLevelValue = (typeof ROLE_LEVEL)[keyof typeof ROLE_LEVEL];\n\nexport const ROLE_LEVEL_VALUES = [\n ROLE_LEVEL.OPERATIONAL,\n ROLE_LEVEL.AGENCY,\n ROLE_LEVEL.TEAM,\n ROLE_LEVEL.PLATFORM,\n ROLE_LEVEL.OVERSIGHT,\n] as const;\n\nexport const ROLE_LEVEL_LABELS: Record<RoleLevelValue, string> = {\n [ROLE_LEVEL.OPERATIONAL]: \"Operational\",\n [ROLE_LEVEL.AGENCY]: \"Agency\",\n [ROLE_LEVEL.TEAM]: \"Team\",\n [ROLE_LEVEL.PLATFORM]: \"Platform\",\n [ROLE_LEVEL.OVERSIGHT]: \"Oversight\",\n};\n\n// ─── Function Implementation Status ────────────────────────────────\n\nexport const FUNCTION_STATUS = {\n NOT_STARTED: \"Not started\",\n DEFINED_NEW: \"Defined; new function\",\n DEFINED_EXISTING: \"Defined; existing PAVE function\",\n FUNCTIONAL: \"Functional on all apps\",\n FUTURE: \"Future function (not v1)\",\n} as const;\n\nexport type FunctionStatusValue =\n (typeof FUNCTION_STATUS)[keyof typeof FUNCTION_STATUS];\n\nexport const FUNCTION_STATUS_VALUES = [\n FUNCTION_STATUS.NOT_STARTED,\n FUNCTION_STATUS.DEFINED_NEW,\n FUNCTION_STATUS.DEFINED_EXISTING,\n FUNCTION_STATUS.FUNCTIONAL,\n FUNCTION_STATUS.FUTURE,\n] as const;\n\nexport const FUNCTION_STATUS_LABELS: Record<FunctionStatusValue, string> = {\n [FUNCTION_STATUS.NOT_STARTED]: \"Not Started\",\n [FUNCTION_STATUS.DEFINED_NEW]: \"Defined (New)\",\n [FUNCTION_STATUS.DEFINED_EXISTING]: \"Defined (Existing PAVE)\",\n [FUNCTION_STATUS.FUNCTIONAL]: \"Functional\",\n [FUNCTION_STATUS.FUTURE]: \"Future (Not v1)\",\n};\n","/**\n * @htilabs/platform-common-models — Generated CVC Key Enums\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `npm run codegen:cvc` (see scripts/codegen-cvc-enums.ts).\n *\n * Provides compile-time `key → code` maps for each CVC domain so TypeScript\n * consumers get autocompletion and type safety on CVC keys. The runtime\n * equivalent is `CvcRegistryService.getEntryByKey()`. Locked spec §9.4.\n */\n\n/**\n * Key → positional code map for the `service_categories` CVC domain (CVC-22, canonical; SOT v2.1.0 GENERATED from prototype canon `data/cvcs/core_service_categories.yaml` by scripts/gen-service-categories.py). Keys are stable across v1.2.0 → v2.0.0 → v2.1.0 (2.1.0 adds the LAP · INS · TRA rows, nothing moved); POSITIONAL CODES MOVED in v2.0.0 (a v1.2.0 code may name a different category — translate through the key, see `serviceCategoriesSot._supersedes.codeMoves`). Store the key. Every SOT entry also carries canon's rename/move-stable `vscatId` (a static-SOT field — the cvc_entities seeder does not persist it). Reseeding the shared registry to 2.0.0 is a coordinated cutover — see README § service_categories 2.0.0.\n *\n * Domain: `service_categories` · Version: 2.1.0 · Entries: 158\n */\nexport const ServiceCategoryKeys = {\n missingness_root: \"022-000-000-000-000-000-000\",\n unknown: \"022-000-000-000-000-000-001\",\n anonymous: \"022-000-000-000-000-000-002\",\n data_not_collected: \"022-000-000-000-000-000-003\",\n basic_needs: \"022-001-000-000-000-000-000\",\n immediate_safety_planning: \"022-001-001-000-000-000-000\",\n emergency_crisis_safety_support: \"022-001-001-001-000-000-000\",\n on_scene_crisis_response: \"022-001-001-001-001-000-000\",\n hotline_crisis_line: \"022-001-001-001-002-000-000\",\n crisis_intervention_in_person: \"022-001-001-001-003-000-000\",\n food: \"022-001-002-000-000-000-000\",\n clothing_shoes_accessories: \"022-001-003-000-000-000-000\",\n over_the_counter_medications: \"022-001-004-000-000-000-000\",\n hygiene_items_personal_care: \"022-001-005-000-000-000-000\",\n communications_connectivity: \"022-001-006-000-000-000-000\",\n interpreter_services: \"022-001-007-000-000-000-000\",\n elder_assistance: \"022-001-008-000-000-000-000\",\n housing_services: \"022-002-000-000-000-000-000\",\n emergency_shelter: \"022-002-001-000-000-000-000\",\n day_shelter_dropin: \"022-002-001-001-000-000-000\",\n host_homes_safe_homes: \"022-002-001-002-000-000-000\",\n congregate_shelter_bednight: \"022-002-001-003-000-000-000\",\n emergency_hotel_motel: \"022-002-001-004-000-000-000\",\n night_by_night_shelter: \"022-002-001-005-000-000-000\",\n transitional_housing: \"022-002-002-000-000-000-000\",\n housing_renovation_modification: \"022-002-003-000-000-000-000\",\n housing_navigation_placement: \"022-002-004-000-000-000-000\",\n housing_financial_assistance: \"022-002-004-001-000-000-000\",\n rental_payment_assistance: \"022-002-004-001-001-000-000\",\n security_deposit_allowance: \"022-002-004-001-001-001-000\",\n utility_assistance: \"022-002-004-001-001-002-000\",\n relocation_moving_assistance: \"022-002-004-002-000-000-000\",\n housing_stabilization_eviction_prevention: \"022-002-005-000-000-000-000\",\n tenant_based_scattered_site: \"022-002-006-000-000-000-000\",\n household_setup_goods: \"022-002-007-000-000-000-000\",\n social_support_community_engagement: \"022-003-000-000-000-000-000\",\n gift_holiday_resources: \"022-003-001-000-000-000-000\",\n peer_facilitated_supportive_group: \"022-003-002-000-000-000-000\",\n community_service_learning: \"022-003-003-000-000-000-000\",\n cultural_needs_support: \"022-003-004-000-000-000-000\",\n survivor_support_psychoeducation: \"022-003-005-000-000-000-000\",\n transportation: \"022-004-000-000-000-000-000\",\n transportation_assistance_direct: \"022-004-001-000-000-000-000\",\n transportation_direct_emergency: \"022-004-001-001-000-000-000\",\n taxi_rideshare_voucher: \"022-004-002-000-000-000-000\",\n taxi_rideshare_emergency: \"022-004-002-001-000-000-000\",\n bus_fare_pass: \"022-004-003-000-000-000-000\",\n bus_fare_pass_emergency: \"022-004-003-001-000-000-000\",\n gift_card_gas_card: \"022-004-004-000-000-000-000\",\n gift_card_gas_card_emergency: \"022-004-004-001-000-000-000\",\n airline_tickets: \"022-004-005-000-000-000-000\",\n airline_tickets_emergency: \"022-004-005-001-000-000-000\",\n legal_services: \"022-005-000-000-000-000-000\",\n immigration_relief: \"022-005-001-000-000-000-000\",\n repatriation: \"022-005-001-001-000-000-000\",\n family_law: \"022-005-002-000-000-000-000\",\n criminal_support: \"022-005-003-000-000-000-000\",\n victim_impact_statement: \"022-005-003-001-000-000-000\",\n perpetrator_accountability: \"022-005-003-002-000-000-000\",\n victim_compensation: \"022-005-003-003-000-000-000\",\n victims_rights_representation: \"022-005-003-004-000-000-000\",\n criminal_record_relief: \"022-005-003-005-000-000-000\",\n emergency_safety_assistance: \"022-005-004-000-000-000-000\",\n civil_support: \"022-005-005-000-000-000-000\",\n protection_restraining_orders: \"022-005-005-001-000-000-000\",\n public_benefits_law: \"022-005-005-002-000-000-000\",\n healthcare: \"022-006-000-000-000-000-000\",\n medical: \"022-006-001-000-000-000-000\",\n forensic_exam_interview: \"022-006-001-001-000-000-000\",\n specialized_assessments: \"022-006-001-001-001-000-000\",\n counseling_evaluation_assessment: \"022-006-001-001-001-001-000\",\n stalking_assessment: \"022-006-001-001-001-002-000\",\n danger_assessment: \"022-006-001-001-001-003-000\",\n indepth_assessment: \"022-006-001-001-001-004-000\",\n dv_exam: \"022-006-001-001-002-000-000\",\n sane_exam: \"022-006-001-001-003-000-000\",\n std_testing: \"022-006-001-001-004-000-000\",\n outpatient_medical: \"022-006-001-002-000-000-000\",\n vision: \"022-006-001-002-001-000-000\",\n dental: \"022-006-001-002-002-000-000\",\n pet_medical: \"022-006-001-002-003-000-000\",\n tattoo_removal: \"022-006-001-002-004-000-000\",\n emergency_medical_care: \"022-006-001-003-000-000-000\",\n pregnancy_care: \"022-006-001-004-000-000-000\",\n prenatal_care: \"022-006-001-004-001-000-000\",\n postnatal_care_client: \"022-006-001-004-002-000-000\",\n postnatal_care_newborn: \"022-006-001-004-003-000-000\",\n emotional_support_mental_health: \"022-006-002-000-000-000-000\",\n behavioral_occupational_support: \"022-006-002-001-000-000-000\",\n substance_abuse_treatment: \"022-006-002-001-001-000-000\",\n coping_strategy_support: \"022-006-002-001-002-000-000\",\n individual_counseling: \"022-006-002-002-000-000-000\",\n group_counseling: \"022-006-002-003-000-000-000\",\n other_therapy: \"022-006-002-004-000-000-000\",\n family_counseling: \"022-006-002-005-000-000-000\",\n counseling_treatment_planning: \"022-006-002-006-000-000-000\",\n counseling_treatment_plan_review: \"022-006-002-007-000-000-000\",\n financial_and_employment: \"022-007-000-000-000-000-000\",\n financial_support: \"022-007-001-000-000-000-000\",\n emergency_financial_assistance: \"022-007-001-001-000-000-000\",\n budgeting_financial_capability: \"022-007-001-002-000-000-000\",\n employment_support: \"022-007-002-000-000-000-000\",\n employment_assistance_job_search: \"022-007-002-001-000-000-000\",\n job_vocation_training: \"022-007-002-002-000-000-000\",\n supported_employment: \"022-007-002-003-000-000-000\",\n informal_education_life_skills: \"022-008-000-000-000-000-000\",\n basic_life_skills_self_care: \"022-008-001-000-000-000-000\",\n accessibility_disability_support: \"022-008-002-000-000-000-000\",\n parenting_education: \"022-008-003-000-000-000-000\",\n learning_language_classes: \"022-008-004-000-000-000-000\",\n formal_education_academic_support: \"022-008-005-000-000-000-000\",\n adult_school_ged: \"022-008-005-001-000-000-000\",\n child_school_enrollment: \"022-008-005-002-000-000-000\",\n dependents: \"022-009-000-000-000-000-000\",\n child_care: \"022-009-001-000-000-000-000\",\n childrens_activities: \"022-009-001-001-000-000-000\",\n children_youth_baby_supplies: \"022-009-001-002-000-000-000\",\n pet_care: \"022-009-002-000-000-000-000\",\n case_coordination: \"022-010-000-000-000-000-000\",\n intake: \"022-010-001-000-000-000-000\",\n screening: \"022-010-001-001-000-000-000\",\n needs_assessment: \"022-010-001-001-001-000-000\",\n initial_screen: \"022-010-001-001-002-000-000\",\n housing_eligibility_determination: \"022-010-001-001-003-000-000\",\n coordinated_entry: \"022-010-001-001-003-001-000\",\n behavioral_issues_screen: \"022-010-001-001-004-000-000\",\n tvap: \"022-010-001-001-005-000-000\",\n lethality_assessment: \"022-010-001-001-006-000-000\",\n injury_strangulation_screen: \"022-010-001-001-007-000-000\",\n trafficking_risk_assessment: \"022-010-001-001-008-000-000\",\n advocacy: \"022-010-002-000-000-000-000\",\n medical_advocacy: \"022-010-002-001-000-000-000\",\n advocacy_emergency_medical: \"022-010-002-001-001-000-000\",\n advocacy_forensic_exam: \"022-010-002-001-002-000-000\",\n court_advocacy: \"022-010-002-002-000-000-000\",\n family_reunification: \"022-010-002-002-001-000-000\",\n crime_scene_clean_up: \"022-010-002-002-002-000-000\",\n law_enforcement_interview_support: \"022-010-002-002-003-000-000\",\n prosecution_interview_advocacy: \"022-010-002-002-004-000-000\",\n immigration_advocacy_support: \"022-010-002-002-005-000-000\",\n documentation_records_retrieval: \"022-010-002-003-000-000-000\",\n obtaining_drivers_license: \"022-010-002-003-001-000-000\",\n obtaining_insurance: \"022-010-002-003-002-000-000\",\n drivers_car_insurance: \"022-010-002-003-002-001-000\",\n medical_insurance: \"022-010-002-003-002-002-000\",\n faith_resource: \"022-010-002-004-000-000-000\",\n income_benefits_navigation: \"022-010-002-005-000-000-000\",\n government_services_special_programs: \"022-010-002-005-001-000-000\",\n banking_notary: \"022-010-002-006-000-000-000\",\n intervention_employer_creditor_academic: \"022-010-002-007-000-000-000\",\n case_management_supportive_services: \"022-010-003-000-000-000-000\",\n intra_agency_provider_coordination: \"022-010-003-001-000-000-000\",\n inter_agency_consultation: \"022-010-003-002-000-000-000\",\n service_plan: \"022-010-003-003-000-000-000\",\n hope_scale_and_plan: \"022-010-003-003-001-000-000\",\n post_exit_plan: \"022-010-003-004-000-000-000\",\n advanced_directives: \"022-010-003-005-000-000-000\",\n other_services: \"022-011-000-000-000-000-000\",\n} as const;\n\nexport type ServiceCategoryKey = keyof typeof ServiceCategoryKeys;\n\n/**\n * Key → positional code map for the `service_states` CVC domain (CVC-49, canonical; SOT v1.2.0 GENERATED from prototype canon `data/cvcs/core_service_state.yaml` by scripts/gen-service-states.py). The stored lifecycle state of ONE service instance — the CVC-49 CODE at rest (Crysta ruling E, 2026-10-07); the app's stamp words are display. Eight keys are DEPRECATED read-only rows (`selectable: false`, `deprecated: true`): the four 'Unable due to …' sub-rows canon archived onto CVC-219 why-nots, the two provisional sub-rows, and `anonymous` / `data_not_collected` (level 0 is UNK alone). The stamp → code crosswalk is `serviceStatesSot.stampCrosswalk` and `SERVICE_STATE_STAMP_CROSSWALK`.\n *\n * Domain: `service_states` · Version: 1.2.0 · Entries: 17\n */\nexport const ServiceStateKeys = {\n missingness_root: \"049-000-000-000-000-000-000\",\n unknown: \"049-000-000-000-000-000-001\",\n anonymous: \"049-000-000-000-000-000-002\",\n data_not_collected: \"049-000-000-000-000-000-003\",\n need_identified: \"049-001-000-000-000-000-000\",\n offered: \"049-002-000-000-000-000-000\",\n scheduled_in_progress: \"049-003-000-000-000-000-000\",\n delivered: \"049-004-000-000-000-000-000\",\n completed: \"049-005-000-000-000-000-000\",\n declined_by_client: \"049-006-000-000-000-000-000\",\n unable_to_provide: \"049-007-000-000-000-000-000\",\n unable_to_provide_eligibility: \"049-007-001-000-000-000-000\",\n unable_to_provide_capacity: \"049-007-002-000-000-000-000\",\n unable_to_provide_resource: \"049-007-003-000-000-000-000\",\n unable_other_reason: \"049-007-004-000-000-000-000\",\n unable_to_provide_service_fit: \"049-007-005-000-000-000-000\",\n unable_to_provide_access_barrier: \"049-007-006-000-000-000-000\",\n} as const;\n\nexport type ServiceStateKey = keyof typeof ServiceStateKeys;\n\n/**\n * Key → positional code map for the `service_mechanisms` CVC domain (CVC-25, canonical; SOT v1.1.0 GENERATED from prototype canon `data/cvcs/core_service_mechanisms.yaml` by scripts/gen-service-mechanisms.py). HOW a service was delivered — ONE OR MORE per service instance (a list, CVC25-AUDIT R1); a `referred` stamp requires `support_via_referral` among them. Every substantive entry carries canon's minted token on `canonicalCode` (REFERRAL · INFORMATIONAL · DIRECT_STAFF · FINANCIAL_MATERIAL; UNK · ANON · DNC) — `SERVICE_MECHANISM_CANONICAL_CODE` is the key → token map, `serviceMechanismKeyForCanonicalCode` the inverse.\n *\n * Domain: `service_mechanisms` · Version: 1.1.0 · Entries: 8\n */\nexport const ServiceMechanismKeys = {\n missingness_root: \"025-000-000-000-000-000-000\",\n unknown: \"025-000-000-000-000-000-001\",\n anonymous: \"025-000-000-000-000-000-002\",\n data_not_collected: \"025-000-000-000-000-000-003\",\n support_via_referral: \"025-001-000-000-000-000-000\",\n informational_support: \"025-002-000-000-000-000-000\",\n direct_staff_contractor: \"025-003-000-000-000-000-000\",\n financial_material_assistance: \"025-004-000-000-000-000-000\",\n} as const;\n\nexport type ServiceMechanismKey = keyof typeof ServiceMechanismKeys;\n\n/**\n * Key → positional code map for the `incident_participation_roles` CVC domain.\n *\n * Domain: `incident_participation_roles` · Version: 1.1.0 · Entries: 31\n */\nexport const IncidentParticipationRoleKeys = {\n missingness_root: \"069-000-000-000-000-000-000\",\n unknown: \"069-000-000-000-000-000-001\",\n anonymous: \"069-000-000-000-000-000-002\",\n data_not_collected: \"069-000-000-000-000-000-003\",\n client_group: \"069-001-000-000-000-000-000\",\n client_subject: \"069-001-001-000-000-000-000\",\n caller_reporter_group: \"069-002-000-000-000-000-000\",\n caller_self: \"069-002-001-000-000-000-000\",\n caller_third_party: \"069-002-002-000-000-000-000\",\n reporter: \"069-002-003-000-000-000-000\",\n support_network_group: \"069-003-000-000-000-000-000\",\n family_member_or_guardian: \"069-003-001-000-000-000-000\",\n friend_or_peer: \"069-003-002-000-000-000-000\",\n system_professional_group: \"069-004-000-000-000-000-000\",\n service_provider_staff: \"069-004-001-000-000-000-000\",\n medical_provider_staff: \"069-004-002-000-000-000-000\",\n data_entry: \"069-004-003-000-000-000-000\",\n other_incident_responder: \"069-004-004-000-000-000-000\",\n responding_officer: \"069-004-005-000-000-000-000\",\n legal_professional: \"069-004-006-000-000-000-000\",\n prosecutor: \"069-004-006-001-000-000-000\",\n vsp_staff: \"069-004-007-000-000-000-000\",\n healthcare_provider_staff: \"069-004-008-000-000-000-000\",\n law_enforcement_personnel: \"069-004-009-000-000-000-000\",\n lead_investigator: \"069-004-009-001-000-000-000\",\n investigator: \"069-004-009-002-000-000-000\",\n analyst: \"069-004-009-003-000-000-000\",\n le_officer: \"069-004-009-004-000-000-000\",\n other_response_personnel: \"069-004-010-000-000-000-000\",\n data_entry_staff: \"069-004-011-000-000-000-000\",\n task_force: \"069-004-012-000-000-000-000\",\n} as const;\n\nexport type IncidentParticipationRoleKey = keyof typeof IncidentParticipationRoleKeys;\n\n/**\n * Key → positional code map for the `incident_involvement_roles` CVC domain.\n *\n * Domain: `incident_involvement_roles` · Version: 1.0.0 · Entries: 10\n */\nexport const IncidentInvolvementRoleKeys = {\n missingness_root: \"130-000-000-000-000-000-000\",\n unknown: \"130-000-000-000-000-000-001\",\n anonymous: \"130-000-000-000-000-000-002\",\n data_not_collected: \"130-000-000-000-000-000-003\",\n victim_primary: \"130-001-000-000-000-000-000\",\n victim_secondary: \"130-002-000-000-000-000-000\",\n victim_other: \"130-003-000-000-000-000-000\",\n offender: \"130-004-000-000-000-000-000\",\n witness: \"130-005-000-000-000-000-000\",\n dependent: \"130-006-000-000-000-000-000\",\n} as const;\n\nexport type IncidentInvolvementRoleKey = keyof typeof IncidentInvolvementRoleKeys;\n\n/**\n * Key → positional code map for the `race_ethnicity` CVC domain.\n *\n * Domain: `race_ethnicity` · Version: 1.1.0 · Entries: 14\n */\nexport const RaceEthnicityKeys = {\n missingness_root: \"076-000-000-000-000-000-000\",\n unknown: \"076-000-000-000-000-000-001\",\n anonymous: \"076-000-000-000-000-000-002\",\n data_not_collected: \"076-000-000-000-000-000-003\",\n prefer_not_to_answer: \"076-000-000-000-000-000-004\",\n american_indian_or_alaska_native: \"076-001-000-000-000-000-000\",\n asian: \"076-002-000-000-000-000-000\",\n black_or_african_american: \"076-003-000-000-000-000-000\",\n hispanic_or_latino: \"076-004-000-000-000-000-000\",\n middle_eastern_or_north_african: \"076-005-000-000-000-000-000\",\n multiple_races: \"076-006-000-000-000-000-000\",\n native_hawaiian_or_pacific_islander: \"076-007-000-000-000-000-000\",\n other_self_described: \"076-008-000-000-000-000-000\",\n white: \"076-009-000-000-000-000-000\",\n} as const;\n\nexport type RaceEthnicityKey = keyof typeof RaceEthnicityKeys;\n\n/**\n * Key → positional code map for the `primary_language` CVC domain.\n *\n * Domain: `primary_language` · Version: 1.0.0 · Entries: 191\n */\nexport const PrimaryLanguageKeys = {\n missingness_root: \"122-000-000-000-000-000-000\",\n unknown: \"122-000-000-000-000-000-001\",\n anonymous: \"122-000-000-000-000-000-002\",\n data_not_collected: \"122-000-000-000-000-000-003\",\n abkhazian: \"122-001-000-000-000-000-000\",\n afar: \"122-002-000-000-000-000-000\",\n afrikaans: \"122-003-000-000-000-000-000\",\n akan: \"122-004-000-000-000-000-000\",\n albanian: \"122-005-000-000-000-000-000\",\n american_sign_language: \"122-006-000-000-000-000-000\",\n amharic: \"122-007-000-000-000-000-000\",\n arabic: \"122-008-000-000-000-000-000\",\n aragonese: \"122-009-000-000-000-000-000\",\n armenian: \"122-010-000-000-000-000-000\",\n assamese: \"122-011-000-000-000-000-000\",\n avaric: \"122-012-000-000-000-000-000\",\n avestan: \"122-013-000-000-000-000-000\",\n aymara: \"122-014-000-000-000-000-000\",\n azerbaijani: \"122-015-000-000-000-000-000\",\n bambara: \"122-016-000-000-000-000-000\",\n bashkir: \"122-017-000-000-000-000-000\",\n basque: \"122-018-000-000-000-000-000\",\n belarusian: \"122-019-000-000-000-000-000\",\n bengali: \"122-020-000-000-000-000-000\",\n bislama: \"122-021-000-000-000-000-000\",\n bosnian: \"122-022-000-000-000-000-000\",\n breton: \"122-023-000-000-000-000-000\",\n bulgarian: \"122-024-000-000-000-000-000\",\n burmese: \"122-025-000-000-000-000-000\",\n catalan_valencian: \"122-026-000-000-000-000-000\",\n central_khmer: \"122-027-000-000-000-000-000\",\n chamorro: \"122-028-000-000-000-000-000\",\n chechen: \"122-029-000-000-000-000-000\",\n chichewa_chewa_nyanja: \"122-030-000-000-000-000-000\",\n chinese: \"122-031-000-000-000-000-000\",\n chinese_cantonese: \"122-032-000-000-000-000-000\",\n chinese_mandarin: \"122-033-000-000-000-000-000\",\n church_slavic_old_slavonic_church_slavonic_old_bulgarian_old_church_slavonic: \"122-034-000-000-000-000-000\",\n chuvash: \"122-035-000-000-000-000-000\",\n cornish: \"122-036-000-000-000-000-000\",\n corsican: \"122-037-000-000-000-000-000\",\n cree: \"122-038-000-000-000-000-000\",\n croatian: \"122-039-000-000-000-000-000\",\n czech: \"122-040-000-000-000-000-000\",\n danish: \"122-041-000-000-000-000-000\",\n divehi_dhivehi_maldivian: \"122-042-000-000-000-000-000\",\n dutch_flemish: \"122-043-000-000-000-000-000\",\n dzongkha: \"122-044-000-000-000-000-000\",\n english: \"122-045-000-000-000-000-000\",\n esperanto: \"122-046-000-000-000-000-000\",\n estonian: \"122-047-000-000-000-000-000\",\n ewe: \"122-048-000-000-000-000-000\",\n faroese: \"122-049-000-000-000-000-000\",\n fijian: \"122-050-000-000-000-000-000\",\n finnish: \"122-051-000-000-000-000-000\",\n french: \"122-052-000-000-000-000-000\",\n fulah: \"122-053-000-000-000-000-000\",\n gaelic_scottish_gaelic: \"122-054-000-000-000-000-000\",\n galician: \"122-055-000-000-000-000-000\",\n ganda: \"122-056-000-000-000-000-000\",\n georgian: \"122-057-000-000-000-000-000\",\n german: \"122-058-000-000-000-000-000\",\n guarani: \"122-059-000-000-000-000-000\",\n gujarati: \"122-060-000-000-000-000-000\",\n haitian_haitian_creole: \"122-061-000-000-000-000-000\",\n hausa: \"122-062-000-000-000-000-000\",\n hebrew: \"122-063-000-000-000-000-000\",\n herero: \"122-064-000-000-000-000-000\",\n hindi: \"122-065-000-000-000-000-000\",\n hiri_motu: \"122-066-000-000-000-000-000\",\n hungarian: \"122-067-000-000-000-000-000\",\n icelandic: \"122-068-000-000-000-000-000\",\n ido: \"122-069-000-000-000-000-000\",\n igbo: \"122-070-000-000-000-000-000\",\n indonesian: \"122-071-000-000-000-000-000\",\n interlingua: \"122-072-000-000-000-000-000\",\n interlingue_occidental: \"122-073-000-000-000-000-000\",\n inuktitut: \"122-074-000-000-000-000-000\",\n inupiaq: \"122-075-000-000-000-000-000\",\n irish: \"122-076-000-000-000-000-000\",\n italian: \"122-077-000-000-000-000-000\",\n japanese: \"122-078-000-000-000-000-000\",\n javanese: \"122-079-000-000-000-000-000\",\n kalaallisut_greenlandic: \"122-080-000-000-000-000-000\",\n kannada: \"122-081-000-000-000-000-000\",\n kanuri: \"122-082-000-000-000-000-000\",\n kashmiri: \"122-083-000-000-000-000-000\",\n kazakh: \"122-084-000-000-000-000-000\",\n kikuyu_gikuyu: \"122-085-000-000-000-000-000\",\n kinyarwanda: \"122-086-000-000-000-000-000\",\n kirghiz_kyrgyz: \"122-087-000-000-000-000-000\",\n komi: \"122-088-000-000-000-000-000\",\n kongo: \"122-089-000-000-000-000-000\",\n korean: \"122-090-000-000-000-000-000\",\n kuanyama_kwanyama: \"122-091-000-000-000-000-000\",\n kurdish: \"122-092-000-000-000-000-000\",\n lao: \"122-093-000-000-000-000-000\",\n latin: \"122-094-000-000-000-000-000\",\n latvian: \"122-095-000-000-000-000-000\",\n limburgan_limburger_limburgish: \"122-096-000-000-000-000-000\",\n lingala: \"122-097-000-000-000-000-000\",\n lithuanian: \"122-098-000-000-000-000-000\",\n luba_katanga: \"122-099-000-000-000-000-000\",\n luxembourgish_letzeburgesch: \"122-100-000-000-000-000-000\",\n macedonian: \"122-101-000-000-000-000-000\",\n malagasy: \"122-102-000-000-000-000-000\",\n malay: \"122-103-000-000-000-000-000\",\n malayalam: \"122-104-000-000-000-000-000\",\n maltese: \"122-105-000-000-000-000-000\",\n manx: \"122-106-000-000-000-000-000\",\n maori: \"122-107-000-000-000-000-000\",\n marathi: \"122-108-000-000-000-000-000\",\n marshallese: \"122-109-000-000-000-000-000\",\n modern_greek: \"122-110-000-000-000-000-000\",\n mongolian: \"122-111-000-000-000-000-000\",\n nauru: \"122-112-000-000-000-000-000\",\n navajo_navaho: \"122-113-000-000-000-000-000\",\n ndonga: \"122-114-000-000-000-000-000\",\n nepali: \"122-115-000-000-000-000-000\",\n north_ndebele: \"122-116-000-000-000-000-000\",\n northern_sami: \"122-117-000-000-000-000-000\",\n norwegian: \"122-118-000-000-000-000-000\",\n norwegian_bokmal: \"122-119-000-000-000-000-000\",\n norwegian_nynorsk: \"122-120-000-000-000-000-000\",\n occitan: \"122-121-000-000-000-000-000\",\n ojibwa: \"122-122-000-000-000-000-000\",\n oriya: \"122-123-000-000-000-000-000\",\n oromo: \"122-124-000-000-000-000-000\",\n ossetian_ossetic: \"122-125-000-000-000-000-000\",\n other_language: \"122-126-000-000-000-000-000\",\n pali: \"122-127-000-000-000-000-000\",\n panjabi_punjabi: \"122-128-000-000-000-000-000\",\n persian: \"122-129-000-000-000-000-000\",\n polish: \"122-130-000-000-000-000-000\",\n portuguese: \"122-131-000-000-000-000-000\",\n pushto_pashto: \"122-132-000-000-000-000-000\",\n quechua: \"122-133-000-000-000-000-000\",\n romanian_moldavian_moldovan: \"122-134-000-000-000-000-000\",\n romansh: \"122-135-000-000-000-000-000\",\n rundi: \"122-136-000-000-000-000-000\",\n russian: \"122-137-000-000-000-000-000\",\n samoan: \"122-138-000-000-000-000-000\",\n sango: \"122-139-000-000-000-000-000\",\n sanskrit: \"122-140-000-000-000-000-000\",\n sardinian: \"122-141-000-000-000-000-000\",\n serbian: \"122-142-000-000-000-000-000\",\n shona: \"122-143-000-000-000-000-000\",\n sichuan_yi_nuosu: \"122-144-000-000-000-000-000\",\n sindhi: \"122-145-000-000-000-000-000\",\n sinhala_sinhalese: \"122-146-000-000-000-000-000\",\n slovak: \"122-147-000-000-000-000-000\",\n slovenian: \"122-148-000-000-000-000-000\",\n somali: \"122-149-000-000-000-000-000\",\n sotho_southern: \"122-150-000-000-000-000-000\",\n south_ndebele: \"122-151-000-000-000-000-000\",\n spanish: \"122-152-000-000-000-000-000\",\n sundanese: \"122-153-000-000-000-000-000\",\n swahili: \"122-154-000-000-000-000-000\",\n swati: \"122-155-000-000-000-000-000\",\n swedish: \"122-156-000-000-000-000-000\",\n tagalog: \"122-157-000-000-000-000-000\",\n tahitian: \"122-158-000-000-000-000-000\",\n tajik: \"122-159-000-000-000-000-000\",\n tamil: \"122-160-000-000-000-000-000\",\n tatar: \"122-161-000-000-000-000-000\",\n telugu: \"122-162-000-000-000-000-000\",\n thai: \"122-163-000-000-000-000-000\",\n tibetan: \"122-164-000-000-000-000-000\",\n tigrinya: \"122-165-000-000-000-000-000\",\n tonga: \"122-166-000-000-000-000-000\",\n tsonga: \"122-167-000-000-000-000-000\",\n tswana: \"122-168-000-000-000-000-000\",\n turkish: \"122-169-000-000-000-000-000\",\n turkmen: \"122-170-000-000-000-000-000\",\n twi: \"122-171-000-000-000-000-000\",\n uighur_uyghur: \"122-172-000-000-000-000-000\",\n ukrainian: \"122-173-000-000-000-000-000\",\n urdu: \"122-174-000-000-000-000-000\",\n uzbek: \"122-175-000-000-000-000-000\",\n venda: \"122-176-000-000-000-000-000\",\n vietnamese: \"122-177-000-000-000-000-000\",\n volapuk: \"122-178-000-000-000-000-000\",\n walloon: \"122-179-000-000-000-000-000\",\n welsh: \"122-180-000-000-000-000-000\",\n western_frisian: \"122-181-000-000-000-000-000\",\n wolof: \"122-182-000-000-000-000-000\",\n xhosa: \"122-183-000-000-000-000-000\",\n yiddish: \"122-184-000-000-000-000-000\",\n yoruba: \"122-185-000-000-000-000-000\",\n zhuang_chuang: \"122-186-000-000-000-000-000\",\n zulu: \"122-187-000-000-000-000-000\",\n} as const;\n\nexport type PrimaryLanguageKey = keyof typeof PrimaryLanguageKeys;\n\n/**\n * Key → positional code map for the `orientation_identity` CVC domain.\n *\n * Domain: `orientation_identity` · Version: 1.0.0 · Entries: 9\n */\nexport const OrientationIdentityKeys = {\n missingness_root: \"016-000-000-000-000-000-000\",\n unknown: \"016-000-000-000-000-000-001\",\n anonymous: \"016-000-000-000-000-000-002\",\n data_not_collected: \"016-000-000-000-000-000-003\",\n prefer_not_to_answer: \"016-000-000-000-000-000-004\",\n bisexual: \"016-001-000-000-000-000-000\",\n gay_or_lesbian: \"016-002-000-000-000-000-000\",\n other_self_described: \"016-003-000-000-000-000-000\",\n straight: \"016-004-000-000-000-000-000\",\n} as const;\n\nexport type OrientationIdentityKey = keyof typeof OrientationIdentityKeys;\n\n/**\n * Key → positional code map for the `pronouns` CVC domain.\n *\n * Domain: `pronouns` · Version: 1.0.0 · Entries: 8\n */\nexport const PronounsKeys = {\n missingness_root: \"147-000-000-000-000-000-000\",\n unknown: \"147-000-000-000-000-000-001\",\n anonymous: \"147-000-000-000-000-000-002\",\n data_not_collected: \"147-000-000-000-000-000-003\",\n he_him: \"147-001-000-000-000-000-000\",\n she_her: \"147-002-000-000-000-000-000\",\n they_them: \"147-003-000-000-000-000-000\",\n other_self_described: \"147-004-000-000-000-000-000\",\n} as const;\n\nexport type PronounsKey = keyof typeof PronounsKeys;\n\n/**\n * Key → positional code map for the `gender_identity` CVC domain.\n *\n * Domain: `gender_identity` · Version: 1.0.0 · Entries: 12\n */\nexport const GenderIdentityKeys = {\n missingness_root: \"017-000-000-000-000-000-000\",\n unknown: \"017-000-000-000-000-000-001\",\n anonymous: \"017-000-000-000-000-000-002\",\n data_not_collected: \"017-000-000-000-000-000-003\",\n prefer_not_to_answer: \"017-000-000-000-000-000-004\",\n female: \"017-001-000-000-000-000-000\",\n male: \"017-002-000-000-000-000-000\",\n non_binary: \"017-003-000-000-000-000-000\",\n other: \"017-004-000-000-000-000-000\",\n transgender: \"017-005-000-000-000-000-000\",\n transgender_ftm: \"017-005-001-000-000-000-000\",\n transgender_mtf: \"017-005-002-000-000-000-000\",\n} as const;\n\nexport type GenderIdentityKey = keyof typeof GenderIdentityKeys;\n\n/**\n * Key → positional code map for the `tribes` CVC domain.\n *\n * Domain: `tribes` · Version: 1.0.0 · Entries: 53\n */\nexport const TribesKeys = {\n missingness_root: \"148-000-000-000-000-000-000\",\n unknown: \"148-000-000-000-000-000-001\",\n anonymous: \"148-000-000-000-000-000-002\",\n data_not_collected: \"148-000-000-000-000-000-003\",\n cherokee_nation: \"148-001-000-000-000-000-000\",\n muscogee_creek: \"148-002-000-000-000-000-000\",\n choctaw_nation: \"148-003-000-000-000-000-000\",\n chickasaw_nation: \"148-004-000-000-000-000-000\",\n seminole_nation: \"148-005-000-000-000-000-000\",\n osage_nation: \"148-006-000-000-000-000-000\",\n cheyenne_arapaho: \"148-007-000-000-000-000-000\",\n comanche_nation: \"148-008-000-000-000-000-000\",\n kiowa_tribe: \"148-009-000-000-000-000-000\",\n apache_tribe_ok: \"148-010-000-000-000-000-000\",\n caddo_nation: \"148-011-000-000-000-000-000\",\n wichita_affiliated: \"148-012-000-000-000-000-000\",\n delaware_nation: \"148-013-000-000-000-000-000\",\n delaware_tribe_indians: \"148-014-000-000-000-000-000\",\n pawnee_nation: \"148-015-000-000-000-000-000\",\n ponca_tribe_ok: \"148-016-000-000-000-000-000\",\n otoe_missouria: \"148-017-000-000-000-000-000\",\n kaw_nation: \"148-018-000-000-000-000-000\",\n tonkawa_tribe: \"148-019-000-000-000-000-000\",\n iowa_tribe_ok: \"148-020-000-000-000-000-000\",\n sac_fox_ok: \"148-021-000-000-000-000-000\",\n kickapoo_tribe_ok: \"148-022-000-000-000-000-000\",\n potawatomi_citizen: \"148-023-000-000-000-000-000\",\n absentee_shawnee: \"148-024-000-000-000-000-000\",\n eastern_shawnee: \"148-025-000-000-000-000-000\",\n shawnee_tribe: \"148-026-000-000-000-000-000\",\n quapaw_nation: \"148-027-000-000-000-000-000\",\n peoria_tribe: \"148-028-000-000-000-000-000\",\n miami_tribe: \"148-029-000-000-000-000-000\",\n modoc_nation: \"148-030-000-000-000-000-000\",\n ottawa_tribe: \"148-031-000-000-000-000-000\",\n seneca_cayuga: \"148-032-000-000-000-000-000\",\n wyandotte_nation: \"148-033-000-000-000-000-000\",\n united_keetoowah: \"148-034-000-000-000-000-000\",\n thlopthlocco: \"148-035-000-000-000-000-000\",\n alabama_quassarte: \"148-036-000-000-000-000-000\",\n kialegee: \"148-037-000-000-000-000-000\",\n fort_sill_apache: \"148-038-000-000-000-000-000\",\n ponca_ne: \"148-039-000-000-000-000-000\",\n omaha_tribe: \"148-040-000-000-000-000-000\",\n winnebago_ne: \"148-041-000-000-000-000-000\",\n santee_sioux: \"148-042-000-000-000-000-000\",\n sioux_specify: \"148-043-000-000-000-000-000\",\n apache_specify: \"148-044-000-000-000-000-000\",\n pueblo_specify: \"148-045-000-000-000-000-000\",\n navajo_specify: \"148-046-000-000-000-000-000\",\n ojibwe_chippewa_specify: \"148-047-000-000-000-000-000\",\n ute_specify: \"148-048-000-000-000-000-000\",\n other_self_described: \"148-049-000-000-000-000-000\",\n} as const;\n\nexport type TribesKey = keyof typeof TribesKeys;\n\n/**\n * Key → positional code map for the `name_type` CVC domain.\n *\n * Domain: `name_type` · Version: 1.0.0 · Entries: 12\n */\nexport const NameTypeKeys = {\n missingness_root: \"001-000-000-000-000-000-000\",\n unknown: \"001-000-000-000-000-000-001\",\n anonymous: \"001-000-000-000-000-000-002\",\n data_not_collected: \"001-000-000-000-000-000-003\",\n alias: \"001-001-000-000-000-000-000\",\n code_name: \"001-002-000-000-000-000-000\",\n handle_screenname: \"001-003-000-000-000-000-000\",\n legal: \"001-004-000-000-000-000-000\",\n maiden_former: \"001-005-000-000-000-000-000\",\n nickname: \"001-006-000-000-000-000-000\",\n street_name: \"001-007-000-000-000-000-000\",\n trade_name_stage_name: \"001-008-000-000-000-000-000\",\n} as const;\n\nexport type NameTypeKey = keyof typeof NameTypeKeys;\n\n/**\n * Key → positional code map for the `age_bin_reporting` CVC domain.\n *\n * Domain: `age_bin_reporting` · Version: 1.0.0 · Entries: 11\n */\nexport const AgeBinReportingKeys = {\n missingness_root: \"051-000-000-000-000-000-000\",\n unknown: \"051-000-000-000-000-000-001\",\n anonymous: \"051-000-000-000-000-000-002\",\n data_not_collected: \"051-000-000-000-000-000-003\",\n age_0_12: \"051-001-000-000-000-000-000\",\n age_13_17: \"051-002-000-000-000-000-000\",\n age_18_24: \"051-003-000-000-000-000-000\",\n age_25_59: \"051-004-000-000-000-000-000\",\n age_60_plus: \"051-005-000-000-000-000-000\",\n not_reported: \"051-006-000-000-000-000-000\",\n not_tracked: \"051-007-000-000-000-000-000\",\n} as const;\n\nexport type AgeBinReportingKey = keyof typeof AgeBinReportingKeys;\n\n/**\n * Key → positional code map for the `juvenile_justice_involvement_status` CVC domain.\n *\n * Domain: `juvenile_justice_involvement_status` · Version: 1.0.0 · Entries: 7\n */\nexport const JuvenileJusticeInvolvementStatusKeys = {\n missingness_root: \"095-000-000-000-000-000-000\",\n unknown: \"095-000-000-000-000-000-001\",\n prefer_not_to_answer: \"095-000-000-000-000-000-002\",\n data_not_collected: \"095-000-000-000-000-000-003\",\n current: \"095-001-000-000-000-000-000\",\n never: \"095-002-000-000-000-000-000\",\n previous: \"095-003-000-000-000-000-000\",\n} as const;\n\nexport type JuvenileJusticeInvolvementStatusKey = keyof typeof JuvenileJusticeInvolvementStatusKeys;\n\n/**\n * Key → positional code map for the `eye_color` CVC domain.\n *\n * Domain: `eye_color` · Version: 1.0.0 · Entries: 11\n */\nexport const EyeColorKeys = {\n missingness_root: \"150-000-000-000-000-000-000\",\n unknown: \"150-000-000-000-000-000-001\",\n anonymous: \"150-000-000-000-000-000-002\",\n data_not_collected: \"150-000-000-000-000-000-003\",\n black: \"150-001-000-000-000-000-000\",\n blue: \"150-002-000-000-000-000-000\",\n brown: \"150-003-000-000-000-000-000\",\n gray: \"150-004-000-000-000-000-000\",\n green: \"150-005-000-000-000-000-000\",\n hazel: \"150-006-000-000-000-000-000\",\n other: \"150-007-000-000-000-000-000\",\n} as const;\n\nexport type EyeColorKey = keyof typeof EyeColorKeys;\n\n/**\n * Key → positional code map for the `smt_type` CVC domain.\n *\n * Domain: `smt_type` · Version: 1.0.0 · Entries: 11\n */\nexport const SmtTypeKeys = {\n missingness_root: \"153-000-000-000-000-000-000\",\n unknown: \"153-000-000-000-000-000-001\",\n anonymous: \"153-000-000-000-000-000-002\",\n data_not_collected: \"153-000-000-000-000-000-003\",\n birthmark: \"153-001-000-000-000-000-000\",\n brand: \"153-002-000-000-000-000-000\",\n mark: \"153-003-000-000-000-000-000\",\n piercing: \"153-004-000-000-000-000-000\",\n scar: \"153-005-000-000-000-000-000\",\n tattoo: \"153-006-000-000-000-000-000\",\n other: \"153-007-000-000-000-000-000\",\n} as const;\n\nexport type SmtTypeKey = keyof typeof SmtTypeKeys;\n\n/**\n * Key → positional code map for the `offender_status` CVC domain.\n *\n * Domain: `offender_status` · Version: 1.0.0 · Entries: 9\n */\nexport const OffenderStatusKeys = {\n missingness_root: \"164-000-000-000-000-000-000\",\n unknown: \"164-000-000-000-000-000-001\",\n anonymous: \"164-000-000-000-000-000-002\",\n data_not_collected: \"164-000-000-000-000-000-003\",\n suspected_offender: \"164-001-000-000-000-000-000\",\n person_of_interest: \"164-002-000-000-000-000-000\",\n cleared_excluded: \"164-003-000-000-000-000-000\",\n charged: \"164-004-000-000-000-000-000\",\n convicted: \"164-005-000-000-000-000-000\",\n} as const;\n\nexport type OffenderStatusKey = keyof typeof OffenderStatusKeys;\n\n/**\n * Key → positional code map for the `offender_status_family` CVC domain.\n *\n * Domain: `offender_status_family` · Version: 1.0.0 · Entries: 8\n */\nexport const OffenderStatusFamilyKeys = {\n missingness_root: \"167-000-000-000-000-000-000\",\n unknown: \"167-000-000-000-000-000-001\",\n anonymous: \"167-000-000-000-000-000-002\",\n data_not_collected: \"167-000-000-000-000-000-003\",\n no_indication: \"167-001-000-000-000-000-000\",\n non_trafficking_exploitation_offender: \"167-002-000-000-000-000-000\",\n potential_trafficking_offender: \"167-003-000-000-000-000-000\",\n trafficking_offender: \"167-004-000-000-000-000-000\",\n} as const;\n\nexport type OffenderStatusFamilyKey = keyof typeof OffenderStatusFamilyKeys;\n\n/**\n * Key → positional code map for the `military_status` CVC domain.\n *\n * Domain: `military_status` · Version: 1.0.0 · Entries: 6\n */\nexport const MilitaryStatusKeys = {\n missingness_root: \"121-000-000-000-000-000-000\",\n unknown: \"121-000-000-000-000-000-001\",\n active_duty: \"121-001-000-000-000-000-000\",\n retired: \"121-002-000-000-000-000-000\",\n discharged: \"121-003-000-000-000-000-000\",\n reserve: \"121-004-000-000-000-000-000\",\n} as const;\n\nexport type MilitaryStatusKey = keyof typeof MilitaryStatusKeys;\n\n/**\n * Key → positional code map for the `military_branch` CVC domain.\n *\n * Domain: `military_branch` · Version: 1.0.0 · Entries: 8\n */\nexport const MilitaryBranchKeys = {\n missingness_root: \"120-000-000-000-000-000-000\",\n unknown: \"120-000-000-000-000-000-001\",\n army: \"120-001-000-000-000-000-000\",\n navy: \"120-002-000-000-000-000-000\",\n air_force: \"120-003-000-000-000-000-000\",\n marines: \"120-004-000-000-000-000-000\",\n coast_guard: \"120-005-000-000-000-000-000\",\n space_force: \"120-006-000-000-000-000-000\",\n} as const;\n\nexport type MilitaryBranchKey = keyof typeof MilitaryBranchKeys;\n\n/**\n * Key → positional code map for the `contact_info_types` CVC domain.\n *\n * Domain: `contact_info_types` · Version: 1.0.0 · Entries: 24\n */\nexport const ContactInfoTypeKeys = {\n missingness_root: \"149-000-000-000-000-000-000\",\n unknown: \"149-000-000-000-000-000-001\",\n anonymous: \"149-000-000-000-000-000-002\",\n data_not_collected: \"149-000-000-000-000-000-003\",\n phone: \"149-001-000-000-000-000-000\",\n email: \"149-002-000-000-000-000-000\",\n app: \"149-003-000-000-000-000-000\",\n app_whatsapp: \"149-003-001-000-000-000-000\",\n app_wechat: \"149-003-002-000-000-000-000\",\n app_kik: \"149-003-003-000-000-000-000\",\n app_paypal: \"149-003-004-000-000-000-000\",\n app_cash_app: \"149-003-005-000-000-000-000\",\n app_venmo: \"149-003-006-000-000-000-000\",\n app_other: \"149-003-007-000-000-000-000\",\n social_media: \"149-004-000-000-000-000-000\",\n social_media_facebook: \"149-004-001-000-000-000-000\",\n social_media_instagram: \"149-004-002-000-000-000-000\",\n social_media_x: \"149-004-003-000-000-000-000\",\n social_media_tiktok: \"149-004-004-000-000-000-000\",\n social_media_reddit: \"149-004-005-000-000-000-000\",\n social_media_youtube: \"149-004-006-000-000-000-000\",\n social_media_snapchat: \"149-004-007-000-000-000-000\",\n social_media_onlyfans: \"149-004-008-000-000-000-000\",\n social_media_other: \"149-004-009-000-000-000-000\",\n} as const;\n\nexport type ContactInfoTypeKey = keyof typeof ContactInfoTypeKeys;\n\n/**\n * Key → positional code map for the `contact_safety_status` CVC domain.\n *\n * Domain: `contact_safety_status` · Version: 1.0.0 · Entries: 6\n */\nexport const ContactSafetyStatusKeys = {\n missingness_root: \"155-000-000-000-000-000-000\",\n unknown: \"155-000-000-000-000-000-001\",\n anonymous: \"155-000-000-000-000-000-002\",\n data_not_collected: \"155-000-000-000-000-000-003\",\n safe: \"155-001-000-000-000-000-000\",\n not_safe: \"155-002-000-000-000-000-000\",\n} as const;\n\nexport type ContactSafetyStatusKey = keyof typeof ContactSafetyStatusKeys;\n\n/**\n * Key → positional code map for the `highest_education_level_completed` CVC domain.\n *\n * Domain: `highest_education_level_completed` · Version: 1.1.0 · Entries: 13\n */\nexport const HighestEducationLevelCompletedKeys = {\n missingness_root: \"180-000-000-000-000-000-000\",\n unknown: \"180-000-000-000-000-000-001\",\n anonymous: \"180-000-000-000-000-000-002\",\n data_not_collected: \"180-000-000-000-000-000-003\",\n prefer_not_to_answer: \"180-000-000-000-000-000-004\",\n less_than_high_school: \"180-001-000-000-000-000-000\",\n high_school_diploma: \"180-002-000-000-000-000-000\",\n ged: \"180-003-000-000-000-000-000\",\n some_college: \"180-004-000-000-000-000-000\",\n associates: \"180-005-000-000-000-000-000\",\n bachelors: \"180-006-000-000-000-000-000\",\n graduate_professional: \"180-007-000-000-000-000-000\",\n trade_vocational: \"180-008-000-000-000-000-000\",\n} as const;\n\nexport type HighestEducationLevelCompletedKey = keyof typeof HighestEducationLevelCompletedKeys;\n\n/**\n * Key → positional code map for the `preferred_contact_method` CVC domain.\n *\n * Domain: `preferred_contact_method` · Version: 1.0.0 · Entries: 4\n */\nexport const PreferredContactMethodKeys = {\n call: \"185-001-000-000-000-000-000\",\n text: \"185-002-000-000-000-000-000\",\n email: \"185-003-000-000-000-000-000\",\n messaging_app_dm: \"185-004-000-000-000-000-000\",\n} as const;\n\nexport type PreferredContactMethodKey = keyof typeof PreferredContactMethodKeys;\n\n/**\n * Key → positional code map for the `share_purpose` CVC domain.\n *\n * Domain: `share_purpose` · Version: 1.1.0 · Entries: 12\n */\nexport const SharePurposeKeys = {\n referral: \"084-001-000-000-000-000-000\",\n case_collaboration: \"084-002-000-000-000-000-000\",\n deconfliction: \"084-003-000-000-000-000-000\",\n mandatory_reporting: \"084-004-000-000-000-000-000\",\n authority_reporting: \"084-005-000-000-000-000-000\",\n automatic_account_share: \"084-006-000-000-000-000-000\",\n discretionary_share: \"084-007-000-000-000-000-000\",\n records_request: \"084-008-000-000-000-000-000\",\n investigation_support: \"084-009-000-000-000-000-000\",\n threat_prevention: \"084-010-000-000-000-000-000\",\n awareness_product: \"084-011-000-000-000-000-000\",\n prosecution_support: \"084-012-000-000-000-000-000\",\n} as const;\n\nexport type SharePurposeKey = keyof typeof SharePurposeKeys;\n\n/**\n * Key → positional code map for the `referral_origin` CVC domain.\n *\n * Domain: `referral_origin` · Version: 1.0.0 · Entries: 2\n */\nexport const ReferralOriginKeys = {\n internal: \"909-001-000-000-000-000-000\",\n external: \"909-002-000-000-000-000-000\",\n} as const;\n\nexport type ReferralOriginKey = keyof typeof ReferralOriginKeys;\n\n/**\n * Key → positional code map for the `case_share_state` CVC domain (canon CVC-304 `core-case_share_review_state`, re-mirrored from prototype origin/main canon by scripts/gen-case-share-state.py). The recipient-side review lifecycle of an inbound case share. `accepted_awaiting_review` = field-by-field review in flight (NOT a duplicate-person hold); it releases to `accepted` only when a case is linked and every blocking conflict is decided. Keys and 925-NNN codes are frozen since v1.0.0.\n *\n * Domain: `case_share_state` · Version: 1.2.0 · Entries: 6\n */\nexport const CaseShareStateKeys = {\n pending: \"925-001-000-000-000-000-000\",\n claimed: \"925-002-000-000-000-000-000\",\n accepted_awaiting_review: \"925-003-000-000-000-000-000\",\n accepted: \"925-004-000-000-000-000-000\",\n declined: \"925-005-000-000-000-000-000\",\n rejected: \"925-006-000-000-000-000-000\",\n} as const;\n\nexport type CaseShareStateKey = keyof typeof CaseShareStateKeys;\n\n/**\n * Key → positional code map for the `share_response_reason` CVC domain (CVC-306, canonical v1.1 `Active` after the 2026-09-14 SHARING-FAMILY-AUDIT; generated from prototype origin/main canon by scripts/gen-share-response-reason.py). The structured reasons a recipient gives when responding to an inbound case share. ONE codebook with per-CONTEXT selectability carried per entry as `contexts` (`field_review` · `decline_share` · `reject_share`) — build a context's picker by filtering on `contexts`, not on this key map. The single L0 sentinel (`unknown`, canonical UNK) is ingestion-only and never a picker chip; the codebook's archived DNC row is omitted.\n *\n * Domain: `share_response_reason` · Version: 1.0.0 · Entries: 12\n */\nexport const ShareResponseReasonKeys = {\n missingness_root: \"306-000-000-000-000-000-000\",\n unknown: \"306-000-000-000-000-000-001\",\n information_incorrect: \"306-001-000-000-000-000-000\",\n not_relevant_for_client: \"306-002-000-000-000-000-000\",\n duplicate_already_have: \"306-003-000-000-000-000-000\",\n client_declined_recording: \"306-004-000-000-000-000-000\",\n wrong_agency_service_area: \"306-005-000-000-000-000-000\",\n not_our_client: \"306-006-000-000-000-000-000\",\n sent_in_error: \"306-007-000-000-000-000-000\",\n no_capacity: \"306-008-000-000-000-000-000\",\n cannot_verify_conflicts: \"306-009-000-000-000-000-000\",\n wrong_person: \"306-010-000-000-000-000-000\",\n} as const;\n\nexport type ShareResponseReasonKey = keyof typeof ShareResponseReasonKeys;\n\n/**\n * Key → positional code map for the `record_removal_reason` CVC domain (CVC-282 `core-record_removal_reason`, ratified by Crysta 2026-07-04, Active / v1.1 after the 2026-09-28 CVC-BATCH-K audit; generated from prototype origin/main canon by scripts/gen-record-removal-reason.py). WHY a record was removed; each code routes to a ratified verb. Ordinals follow the mirror's ratified order and are frozen. The single L0 sentinel (`unknown`, canonical UNK) is ingestion-only and never a picker option; the codebook's retired ANON and archived DNC rows are omitted. @htilabs/platform-common-car maps each code to the CVC-337 correction reason a removed record's claims are retracted with.\n *\n * Domain: `record_removal_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const RecordRemovalReasonKeys = {\n missingness_root: \"282-000-000-000-000-000-000\",\n unknown: \"282-000-000-000-000-000-001\",\n created_in_error: \"282-001-000-000-000-000-000\",\n wrong_subject: \"282-002-000-000-000-000-000\",\n no_longer_relevant: \"282-003-000-000-000-000-000\",\n legal_mandate_expungement: \"282-004-000-000-000-000-000\",\n legal_mandate_confidentiality: \"282-005-000-000-000-000-000\",\n legal_mandate_court_order: \"282-006-000-000-000-000-000\",\n duplicate: \"282-007-000-000-000-000-000\",\n spam_bad_data: \"282-008-000-000-000-000-000\",\n} as const;\n\nexport type RecordRemovalReasonKey = keyof typeof RecordRemovalReasonKeys;\n\n/**\n * Key → positional code map for the `vehicle_color` CVC domain (CVC-257 `core-vehicle_color`, Active / v2 after the 2026-09-04 vehicle-family audit, Crysta rulings R1-R4; generated from prototype origin/main canon by scripts/gen-vehicle-vocabulary.py). One coded list for PAVE and LEADS (R1). Canon's three-letter code (BLK, SIL, … — R2, matching hair and eye colour) rides on each entry as `canonicalCode`; the key is the label slug. `other` (OTH) keeps the original wording in the companion field `color_other`. Values stored before 2026-09-04 resolve through the SOT's `legacyValueMap` on read. UNK is pickable; ANON comes only from the decline affordances; DNC is system-stamped only.\n *\n * Domain: `vehicle_color` · Version: 1.0.0 · Entries: 15\n */\nexport const VehicleColorKeys = {\n missingness_root: \"257-000-000-000-000-000-000\",\n unknown: \"257-000-000-000-000-000-001\",\n anonymous: \"257-000-000-000-000-000-002\",\n data_not_collected: \"257-000-000-000-000-000-003\",\n black: \"257-001-000-000-000-000-000\",\n white: \"257-002-000-000-000-000-000\",\n silver: \"257-003-000-000-000-000-000\",\n gray: \"257-004-000-000-000-000-000\",\n red: \"257-005-000-000-000-000-000\",\n blue: \"257-006-000-000-000-000-000\",\n green: \"257-007-000-000-000-000-000\",\n yellow: \"257-008-000-000-000-000-000\",\n brown: \"257-009-000-000-000-000-000\",\n tan: \"257-010-000-000-000-000-000\",\n other: \"257-011-000-000-000-000-000\",\n} as const;\n\nexport type VehicleColorKey = keyof typeof VehicleColorKeys;\n\n/**\n * Key → positional code map for the `vehicle_body_type` CVC domain (CVC-258 `core-vehicle_body_type`, Active / v2 after the 2026-09-04 vehicle-family audit; generated from prototype origin/main canon by scripts/gen-vehicle-vocabulary.py). Lowercase level-1 codes are the keys. Optional and never required: an absent value is the ordinary state, and a deliberate `unknown` (UNK) persists and reads differently from absent (R3). `glyph` is a rendering detail only. LEADS only — PAVE has no body-type field.\n *\n * Domain: `vehicle_body_type` · Version: 1.0.0 · Entries: 12\n */\nexport const VehicleBodyTypeKeys = {\n missingness_root: \"258-000-000-000-000-000-000\",\n unknown: \"258-000-000-000-000-000-001\",\n anonymous: \"258-000-000-000-000-000-002\",\n data_not_collected: \"258-000-000-000-000-000-003\",\n sedan: \"258-001-000-000-000-000-000\",\n suv: \"258-002-000-000-000-000-000\",\n pickup: \"258-003-000-000-000-000-000\",\n van: \"258-004-000-000-000-000-000\",\n coupe: \"258-005-000-000-000-000-000\",\n motorcycle: \"258-006-000-000-000-000-000\",\n commercial: \"258-007-000-000-000-000-000\",\n other: \"258-008-000-000-000-000-000\",\n} as const;\n\nexport type VehicleBodyTypeKey = keyof typeof VehicleBodyTypeKeys;\n\n/**\n * Key → positional code map for the `share_cadence` CVC domain (CVC-85 `core-share_cadence`, approved 2026-08-12, Active after the 2026-09-14 SHARING-FAMILY-AUDIT; generated from prototype canon by scripts/gen-share-cadence.py). The temporal shape of sharing: `point_in_time` (one-shot), `ongoing` (time-bounded channel), `automatic` (settings-determined). Cadence authorizes nothing. Configured on the partner relationship, DERIVED on the share record (never an end-user picker). No level-0 wing: an underivable cadence is absent, not a code.\n *\n * Domain: `share_cadence` · Version: 1.0.0 · Entries: 3\n */\nexport const ShareCadenceKeys = {\n point_in_time: \"085-001-000-000-000-000-000\",\n ongoing: \"085-002-000-000-000-000-000\",\n automatic: \"085-003-000-000-000-000-000\",\n} as const;\n\nexport type ShareCadenceKey = keyof typeof ShareCadenceKeys;\n\n/**\n * Key → positional code map for the `facilitator_entity_type` CVC domain.\n *\n * Domain: `facilitator_entity_type` · Version: 1.0.0 · Entries: 14\n */\nexport const FacilitatorEntityTypeKeys = {\n missingness_root: \"165-000-000-000-000-000-000\",\n unknown: \"165-000-000-000-000-000-001\",\n anonymous: \"165-000-000-000-000-000-002\",\n data_not_collected: \"165-000-000-000-000-000-003\",\n individual_person: \"165-001-000-000-000-000-000\",\n call_service: \"165-002-000-000-000-000-000\",\n escort_agency: \"165-003-000-000-000-000-000\",\n illicit_massage_business: \"165-004-000-000-000-000-000\",\n brothel_or_residence_operation: \"165-005-000-000-000-000-000\",\n strip_club_bar_casino_facilitator: \"165-006-000-000-000-000-000\",\n staffing_intermediary_or_labor_broker: \"165-007-000-000-000-000-000\",\n employer_or_worksite_operator: \"165-008-000-000-000-000-000\",\n multi_level_enterprise_or_organization: \"165-009-000-000-000-000-000\",\n other_business_or_establishment: \"165-010-000-000-000-000-000\",\n} as const;\n\nexport type FacilitatorEntityTypeKey = keyof typeof FacilitatorEntityTypeKeys;\n\n/**\n * Key → positional code map for the `facilitator_subrole` CVC domain.\n *\n * Domain: `facilitator_subrole` · Version: 1.0.0 · Entries: 37\n */\nexport const FacilitatorSubroleKeys = {\n missingness_root: \"162-000-000-000-000-000-000\",\n unknown: \"162-000-000-000-000-000-001\",\n anonymous: \"162-000-000-000-000-000-002\",\n data_not_collected: \"162-000-000-000-000-000-003\",\n recruiter: \"162-001-000-000-000-000-000\",\n operational_management: \"162-002-000-000-000-000-000\",\n mgr: \"162-002-001-000-000-000-000\",\n worksite_supervisor_foreman: \"162-002-002-000-000-000-000\",\n comms_advertising: \"162-003-000-000-000-000-000\",\n advertiser_webmaster: \"162-003-001-000-000-000-000\",\n content_creator: \"162-003-002-000-000-000-000\",\n comms_account_control: \"162-003-003-000-000-000-000\",\n dispatch_booking: \"162-004-000-000-000-000-000\",\n dispatcher_call_center: \"162-004-001-000-000-000-000\",\n enforcement_security: \"162-005-000-000-000-000-000\",\n enforcer_security: \"162-005-001-000-000-000-000\",\n lookout_spotter: \"162-005-002-000-000-000-000\",\n financial_control: \"162-006-000-000-000-000-000\",\n financial_facilitator: \"162-006-001-000-000-000-000\",\n debt_fee_collector: \"162-006-002-000-000-000-000\",\n money_launderer: \"162-006-003-000-000-000-000\",\n account_wallet_holder: \"162-006-004-000-000-000-000\",\n transportation_movement: \"162-007-000-000-000-000-000\",\n driver_transporter: \"162-007-001-000-000-000-000\",\n handling_supervision: \"162-008-000-000-000-000-000\",\n handler_minder: \"162-008-001-000-000-000-000\",\n document_identity_control: \"162-009-000-000-000-000-000\",\n document_identity_facilitator: \"162-009-001-000-000-000-000\",\n immigration_visa_controller: \"162-009-002-000-000-000-000\",\n labor_intermediation_worksite_control: \"162-010-000-000-000-000-000\",\n labor_broker_contractor: \"162-010-001-000-000-000-000\",\n housing_venue_harboring: \"162-011-000-000-000-000-000\",\n housing_room_provider: \"162-011-001-000-000-000-000\",\n ownership_enterprise: \"162-012-000-000-000-000-000\",\n owner_operator: \"162-012-001-000-000-000-000\",\n other: \"162-013-000-000-000-000-000\",\n other_unspec: \"162-013-001-000-000-000-000\",\n} as const;\n\nexport type FacilitatorSubroleKey = keyof typeof FacilitatorSubroleKeys;\n\n/**\n * Key → positional code map for the `marital_status_legal` CVC domain.\n *\n * Domain: `marital_status_legal` · Version: 1.0.0 · Entries: 9\n */\nexport const MaritalStatusLegalKeys = {\n missingness_root: \"156-000-000-000-000-000-000\",\n unknown: \"156-000-000-000-000-000-001\",\n anonymous: \"156-000-000-000-000-000-002\",\n data_not_collected: \"156-000-000-000-000-000-003\",\n married: \"156-001-000-000-000-000-000\",\n never_married: \"156-002-000-000-000-000-000\",\n divorced: \"156-003-000-000-000-000-000\",\n separated: \"156-004-000-000-000-000-000\",\n widowed: \"156-005-000-000-000-000-000\",\n} as const;\n\nexport type MaritalStatusLegalKey = keyof typeof MaritalStatusLegalKeys;\n\n/**\n * Key → positional code map for the `relationship_status_current` CVC domain.\n *\n * Domain: `relationship_status_current` · Version: 1.0.0 · Entries: 6\n */\nexport const RelationshipStatusCurrentKeys = {\n missingness_root: \"157-000-000-000-000-000-000\",\n unknown: \"157-000-000-000-000-000-001\",\n anonymous: \"157-000-000-000-000-000-002\",\n data_not_collected: \"157-000-000-000-000-000-003\",\n partnered: \"157-001-000-000-000-000-000\",\n not_partnered: \"157-002-000-000-000-000-000\",\n} as const;\n\nexport type RelationshipStatusCurrentKey = keyof typeof RelationshipStatusCurrentKeys;\n\n/**\n * Key → positional code map for the `has_tattoos` CVC domain.\n *\n * Domain: `has_tattoos` · Version: 1.0.0 · Entries: 6\n */\nexport const HasTattoosKeys = {\n missingness_root: \"152-000-000-000-000-000-000\",\n unknown: \"152-000-000-000-000-000-001\",\n anonymous: \"152-000-000-000-000-000-002\",\n data_not_collected: \"152-000-000-000-000-000-003\",\n yes: \"152-001-000-000-000-000-000\",\n no: \"152-002-000-000-000-000-000\",\n} as const;\n\nexport type HasTattoosKey = keyof typeof HasTattoosKeys;\n\n/**\n * Key → positional code map for the `facilitator_label_used_in_source` CVC domain.\n *\n * Domain: `facilitator_label_used_in_source` · Version: 1.0.0 · Entries: 16\n */\nexport const FacilitatorLabelUsedInSourceKeys = {\n missingness_root: \"166-000-000-000-000-000-000\",\n unknown: \"166-000-000-000-000-000-001\",\n anonymous: \"166-000-000-000-000-000-002\",\n data_not_collected: \"166-000-000-000-000-000-003\",\n boss: \"166-001-000-000-000-000-000\",\n bottom: \"166-002-000-000-000-000-000\",\n boyfriend_or_intimate_partner: \"166-003-000-000-000-000-000\",\n coyote: \"166-004-000-000-000-000-000\",\n fraudulent_job_recruiter: \"166-005-000-000-000-000-000\",\n madame: \"166-006-000-000-000-000-000\",\n neighbor: \"166-007-000-000-000-000-000\",\n parent_or_guardian: \"166-008-000-000-000-000-000\",\n peer_recruiter: \"166-009-000-000-000-000-000\",\n pimp: \"166-010-000-000-000-000-000\",\n romeo_recruiter: \"166-011-000-000-000-000-000\",\n other_source_term: \"166-012-000-000-000-000-000\",\n} as const;\n\nexport type FacilitatorLabelUsedInSourceKey = keyof typeof FacilitatorLabelUsedInSourceKeys;\n\n/**\n * Key → positional code map for the `homeless_status` CVC domain.\n *\n * Domain: `homeless_status` · Version: 1.0.0 · Entries: 9\n */\nexport const HomelessStatusKeys = {\n missingness_root: \"096-000-000-000-000-000-000\",\n unknown: \"096-000-000-000-000-000-001\",\n anonymous: \"096-000-000-000-000-000-002\",\n data_not_collected: \"096-000-000-000-000-000-003\",\n client_doesnt_know: \"096-000-000-000-000-000-004\",\n client_refused: \"096-000-000-000-000-000-005\",\n current: \"096-001-000-000-000-000-000\",\n former: \"096-002-000-000-000-000-000\",\n never: \"096-003-000-000-000-000-000\",\n} as const;\n\nexport type HomelessStatusKey = keyof typeof HomelessStatusKeys;\n\n/**\n * Key → positional code map for the `victim_status_family` CVC domain.\n *\n * Domain: `victim_status_family` · Version: 1.0.0 · Entries: 9\n */\nexport const VictimStatusFamilyKeys = {\n missingness_root: \"020-000-000-000-000-000-000\",\n unknown: \"020-000-000-000-000-000-001\",\n anonymous: \"020-000-000-000-000-000-002\",\n data_not_collected: \"020-000-000-000-000-000-003\",\n no_indication: \"020-001-000-000-000-000-000\",\n voluntary_industry_engagement: \"020-002-000-000-000-000-000\",\n non_trafficking_exploitation: \"020-003-000-000-000-000-000\",\n potential_trafficking_victim: \"020-004-000-000-000-000-000\",\n trafficking_victim: \"020-005-000-000-000-000-000\",\n} as const;\n\nexport type VictimStatusFamilyKey = keyof typeof VictimStatusFamilyKeys;\n\n/**\n * Key → positional code map for the `hair_color` CVC domain.\n *\n * Domain: `hair_color` · Version: 1.0.0 · Entries: 10\n */\nexport const HairColorKeys = {\n missingness_root: \"151-000-000-000-000-000-000\",\n unknown: \"151-000-000-000-000-000-001\",\n anonymous: \"151-000-000-000-000-000-002\",\n data_not_collected: \"151-000-000-000-000-000-003\",\n black: \"151-001-000-000-000-000-000\",\n blonde: \"151-002-000-000-000-000-000\",\n brown: \"151-003-000-000-000-000-000\",\n gray_white: \"151-004-000-000-000-000-000\",\n red: \"151-005-000-000-000-000-000\",\n other: \"151-006-000-000-000-000-000\",\n} as const;\n\nexport type HairColorKey = keyof typeof HairColorKeys;\n\n/**\n * Key → positional code map for the `sex_provider_subrole` CVC domain.\n *\n * Domain: `sex_provider_subrole` · Version: 1.0.0 · Entries: 7\n */\nexport const SexProviderSubroleKeys = {\n missingness_root: \"161-000-000-000-000-000-000\",\n unknown: \"161-000-000-000-000-000-001\",\n anonymous: \"161-000-000-000-000-000-002\",\n data_not_collected: \"161-000-000-000-000-000-003\",\n bottom: \"161-001-000-000-000-000-000\",\n escort: \"161-002-000-000-000-000-000\",\n stripper_exotic_dancer: \"161-003-000-000-000-000-000\",\n} as const;\n\nexport type SexProviderSubroleKey = keyof typeof SexProviderSubroleKeys;\n\n/**\n * Key → positional code map for the `relationship_ties` CVC domain.\n *\n * Domain: `relationship_ties` · Version: 1.0.0 · Entries: 28\n */\nexport const RelationshipTiesKeys = {\n missingness_root: \"158-000-000-000-000-000-000\",\n unknown: \"158-000-000-000-000-000-001\",\n anonymous: \"158-000-000-000-000-000-002\",\n data_not_collected: \"158-000-000-000-000-000-003\",\n household_living: \"158-001-000-000-000-000-000\",\n cohabitating: \"158-001-001-000-000-000-000\",\n shared_care_environment: \"158-001-002-000-000-000-000\",\n child_family: \"158-002-000-000-000-000-000\",\n has_children_together: \"158-002-001-000-000-000-000\",\n co_parenting: \"158-002-002-000-000-000-000\",\n family_care_obligation: \"158-002-003-000-000-000-000\",\n legal_formal: \"158-003-000-000-000-000-000\",\n legally_married: \"158-003-001-000-000-000-000\",\n legal_guardianship: \"158-003-002-000-000-000-000\",\n custody_or_visitation_link: \"158-003-003-000-000-000-000\",\n protective_order_link: \"158-003-004-000-000-000-000\",\n shared_legal_case_or_order: \"158-003-005-000-000-000-000\",\n financial_resource: \"158-004-000-000-000-000-000\",\n financial_dependence: \"158-004-001-000-000-000-000\",\n shared_finances: \"158-004-002-000-000-000-000\",\n shared_property_or_lease: \"158-004-003-000-000-000-000\",\n shared_employment_or_income_link: \"158-004-004-000-000-000-000\",\n access_logistics: \"158-005-000-000-000-000-000\",\n transportation_dependence: \"158-005-001-000-000-000-000\",\n communication_access_link: \"158-005-002-000-000-000-000\",\n document_or_id_link: \"158-005-003-000-000-000-000\",\n regular_unavoidable_contact: \"158-005-004-000-000-000-000\",\n other_fallback: \"158-006-000-000-000-000-000\",\n} as const;\n\nexport type RelationshipTiesKey = keyof typeof RelationshipTiesKeys;\n\n/**\n * Key → positional code map for the `person_relationships` CVC domain.\n *\n * Domain: `person_relationships` · Version: 1.0.0 · Entries: 94\n */\nexport const PersonRelationshipsKeys = {\n missingness_root: \"126-000-000-000-000-000-000\",\n anonymous: \"126-000-000-000-000-000-002\",\n data_not_collected: \"126-000-000-000-000-000-003\",\n familial: \"126-001-000-000-000-000-000\",\n grandparent_grandchild: \"126-001-001-000-000-000-000\",\n grandchild_of: \"126-001-001-001-000-000-000\",\n grandparent_of: \"126-001-001-002-000-000-000\",\n guardian_dependent: \"126-001-002-000-000-000-000\",\n dependent_of: \"126-001-002-001-000-000-000\",\n guardian_of: \"126-001-002-002-000-000-000\",\n in_law: \"126-001-003-000-000-000-000\",\n other_relative: \"126-001-004-000-000-000-000\",\n parent_child: \"126-001-005-000-000-000-000\",\n child_of: \"126-001-005-001-000-000-000\",\n parent_of: \"126-001-005-002-000-000-000\",\n sibling: \"126-001-006-000-000-000-000\",\n parental_figure_dependent: \"126-001-007-000-000-000-000\",\n dependent_of_parental_figure: \"126-001-007-001-000-000-000\",\n parental_figure_of: \"126-001-007-002-000-000-000\",\n romantic_partner: \"126-002-000-000-000-000-000\",\n dating_relationship: \"126-002-001-000-000-000-000\",\n spouse_partner: \"126-002-002-000-000-000-000\",\n intimate_romantic_partner: \"126-002-003-000-000-000-000\",\n intimate_partner_prior: \"126-002-004-000-000-000-000\",\n care_household: \"126-003-000-000-000-000-000\",\n caregiver_care_recipient: \"126-003-001-000-000-000-000\",\n care_recipient_of: \"126-003-001-001-000-000-000\",\n caregiver_of: \"126-003-001-002-000-000-000\",\n support_person: \"126-003-002-000-000-000-000\",\n support_person_of: \"126-003-002-001-000-000-000\",\n has_support_person: \"126-003-002-002-000-000-000\",\n household_member: \"126-003-003-000-000-000-000\",\n social: \"126-004-000-000-000-000-000\",\n acquaintance: \"126-004-001-000-000-000-000\",\n friend_peer: \"126-004-002-000-000-000-000\",\n known_associate: \"126-004-003-000-000-000-000\",\n social_media_connection: \"126-004-004-000-000-000-000\",\n work_economic: \"126-005-000-000-000-000-000\",\n coworker_colleague: \"126-005-001-000-000-000-000\",\n creditor_debtor: \"126-005-002-000-000-000-000\",\n creditor_of: \"126-005-002-001-000-000-000\",\n debtor_of: \"126-005-002-002-000-000-000\",\n employer_employee: \"126-005-003-000-000-000-000\",\n employee_of: \"126-005-003-001-000-000-000\",\n employer_of: \"126-005-003-002-000-000-000\",\n landlord_tenant: \"126-005-004-000-000-000-000\",\n landlord_of: \"126-005-004-001-000-000-000\",\n tenant_of: \"126-005-004-002-000-000-000\",\n supervisor_subordinate: \"126-005-005-000-000-000-000\",\n subordinate_of: \"126-005-005-001-000-000-000\",\n supervisor_of: \"126-005-005-002-000-000-000\",\n service_system: \"126-006-000-000-000-000-000\",\n advocate_client: \"126-006-001-000-000-000-000\",\n advocate_of: \"126-006-001-001-000-000-000\",\n client_of_advocate: \"126-006-001-002-000-000-000\",\n attorney_client: \"126-006-002-000-000-000-000\",\n attorney_of: \"126-006-002-001-000-000-000\",\n client_of_attorney: \"126-006-002-002-000-000-000\",\n caseworker_client: \"126-006-003-000-000-000-000\",\n caseworker_of: \"126-006-003-001-000-000-000\",\n client_of_caseworker: \"126-006-003-002-000-000-000\",\n officer_subject: \"126-006-004-000-000-000-000\",\n officer_of: \"126-006-004-001-000-000-000\",\n subject_of_officer: \"126-006-004-002-000-000-000\",\n provider_client: \"126-006-005-000-000-000-000\",\n client_of_provider: \"126-006-005-001-000-000-000\",\n provider_of: \"126-006-005-002-000-000-000\",\n teacher_student: \"126-006-006-000-000-000-000\",\n student_of: \"126-006-006-001-000-000-000\",\n teacher_of: \"126-006-006-002-000-000-000\",\n exploitation_trafficking: \"126-007-000-000-000-000-000\",\n buyer_target_person: \"126-007-001-000-000-000-000\",\n buyer_of: \"126-007-001-001-000-000-000\",\n target_of_buyer: \"126-007-001-002-000-000-000\",\n controller_target_person: \"126-007-002-000-000-000-000\",\n controller_of: \"126-007-002-001-000-000-000\",\n target_of_controller: \"126-007-002-002-000-000-000\",\n facilitator_target_person: \"126-007-003-000-000-000-000\",\n facilitator_of: \"126-007-003-001-000-000-000\",\n target_of_facilitator: \"126-007-003-002-000-000-000\",\n recruiter_recruited_person: \"126-007-004-000-000-000-000\",\n recruited_by: \"126-007-004-001-000-000-000\",\n recruiter_of: \"126-007-004-002-000-000-000\",\n trafficker_victim: \"126-007-005-000-000-000-000\",\n trafficker_of: \"126-007-005-001-000-000-000\",\n victim_of_trafficker: \"126-007-005-002-000-000-000\",\n other_unspecified: \"126-008-000-000-000-000-000\",\n other_person_relationship: \"126-008-001-000-000-000-000\",\n person_pet: \"126-008-002-000-000-000-000\",\n pet_caregiver_of: \"126-008-002-001-000-000-000\",\n pet_of: \"126-008-002-002-000-000-000\",\n pet_owner_of: \"126-008-002-003-000-000-000\",\n relationship_unknown: \"126-008-003-000-000-000-000\",\n stranger: \"126-008-004-000-000-000-000\",\n} as const;\n\nexport type PersonRelationshipsKey = keyof typeof PersonRelationshipsKeys;\n\n/**\n * Key → positional code map for the `employment_status` CVC domain.\n *\n * Domain: `employment_status` · Version: 1.0.0 · Entries: 29\n */\nexport const EmploymentStatusKeys = {\n missingness_root: \"179-000-000-000-000-000-000\",\n unknown: \"179-000-000-000-000-000-001\",\n anonymous: \"179-000-000-000-000-000-002\",\n data_not_collected: \"179-000-000-000-000-000-003\",\n client_doesnt_know: \"179-000-000-000-000-000-004\",\n client_refused: \"179-000-000-000-000-000-005\",\n employed: \"179-001-000-000-000-000-000\",\n full_time: \"179-001-001-000-000-000-000\",\n part_time: \"179-001-002-000-000-000-000\",\n seasonal_sporadic: \"179-001-003-000-000-000-000\",\n self_employed: \"179-001-004-000-000-000-000\",\n informal_cash_gig: \"179-001-005-000-000-000-000\",\n multiple_jobs: \"179-001-006-000-000-000-000\",\n unpaid_family_worker: \"179-001-007-000-000-000-000\",\n unemployed: \"179-002-000-000-000-000-000\",\n looking_for_work: \"179-002-001-000-000-000-000\",\n actively_seeking: \"179-002-002-000-000-000-000\",\n first_time_job_seeker: \"179-002-003-000-000-000-000\",\n recently_laid_off: \"179-002-004-000-000-000-000\",\n long_term_unemployed: \"179-002-005-000-000-000-000\",\n not_in_labor_force: \"179-003-000-000-000-000-000\",\n not_looking_for_work: \"179-003-001-000-000-000-000\",\n unable_to_work: \"179-003-002-000-000-000-000\",\n student: \"179-003-003-000-000-000-000\",\n caregiver: \"179-003-004-000-000-000-000\",\n disabled: \"179-003-005-000-000-000-000\",\n retired: \"179-003-006-000-000-000-000\",\n discouraged_worker: \"179-003-007-000-000-000-000\",\n other_reason: \"179-003-008-000-000-000-000\",\n} as const;\n\nexport type EmploymentStatusKey = keyof typeof EmploymentStatusKeys;\n\n/**\n * Key → positional code map for the `location_type` CVC domain (CVC-191). Each entry also carries canon's 2026-10-01 share-routing columns (`tier` · `anchors` · `anchorDefault` · `shareUnit` · `safetyDefault`, overlaid by scripts/gen-location-type.py): route a stored location by its reason's `shareUnit` (a `core_information_scope` key; null = never delivered), not by a hand-kept map.\n *\n * Domain: `location_type` · Version: 1.0.0 · Entries: 17\n */\nexport const LocationTypeKeys = {\n missingness_root: \"191-000-000-000-000-000-000\",\n unknown: \"191-000-000-000-000-000-001\",\n anonymous: \"191-000-000-000-000-000-002\",\n data_not_collected: \"191-000-000-000-000-000-003\",\n current_residence: \"191-001-000-000-000-000-000\",\n service_delivery_location: \"191-002-000-000-000-000-000\",\n current_client_location: \"191-003-000-000-000-000-000\",\n meet_contact_location: \"191-004-000-000-000-000-000\",\n prior_residence: \"191-005-000-000-000-000-000\",\n jurisdiction_routing_location: \"191-006-000-000-000-000-000\",\n ad_location_derived: \"191-007-000-000-000-000-000\",\n travel_stop_visit: \"191-008-000-000-000-000-000\",\n work_school_business: \"191-009-000-000-000-000-000\",\n ip_derived_location: \"191-010-000-000-000-000-000\",\n program_project_location: \"191-011-000-000-000-000-000\",\n other: \"191-012-000-000-000-000-000\",\n incident: \"191-013-000-000-000-000-000\",\n} as const;\n\nexport type LocationTypeKey = keyof typeof LocationTypeKeys;\n\n/**\n * Key → positional code map for the `referral_entity_category` CVC domain.\n *\n * Domain: `referral_entity_category` · Version: 1.2.0 · Entries: 47\n */\nexport const ReferralEntityCategoryKeys = {\n missingness_root: \"048-000-000-000-000-000-000\",\n unknown: \"048-000-000-000-000-000-001\",\n anonymous: \"048-000-000-000-000-000-002\",\n data_not_collected: \"048-000-000-000-000-000-003\",\n self_referred: \"048-001-000-000-000-000-000\",\n family_guardian_friend: \"048-002-000-000-000-000-000\",\n peer: \"048-003-000-000-000-000-000\",\n other_individual: \"048-004-000-000-000-000-000\",\n housing_shelter_continuum: \"048-005-000-000-000-000-000\",\n outreach_project: \"048-005-001-000-000-000-000\",\n temporary_shelter: \"048-005-002-000-000-000-000\",\n residential_project: \"048-005-003-000-000-000-000\",\n hotlines: \"048-006-000-000-000-000-000\",\n national_hotline: \"048-006-001-000-000-000-000\",\n local_other_hotline: \"048-006-002-000-000-000-000\",\n hotline: \"048-006-003-000-000-000-000\",\n justice_protective_systems: \"048-007-000-000-000-000-000\",\n child_welfare_cps: \"048-007-001-000-000-000-000\",\n juvenile_justice: \"048-007-002-000-000-000-000\",\n law_enforcement: \"048-007-003-000-000-000-000\",\n local_law_enforcement: \"048-007-003-001-000-000-000\",\n state_law_enforcement: \"048-007-003-002-000-000-000\",\n federal_law_enforcement: \"048-007-003-003-000-000-000\",\n tribal_law_enforcement: \"048-007-003-004-000-000-000\",\n other_law_enforcement: \"048-007-003-005-000-000-000\",\n courts_prosecution: \"048-007-004-000-000-000-000\",\n correction_probation: \"048-007-005-000-000-000-000\",\n adult_protective_services: \"048-007-006-000-000-000-000\",\n health_behavioral_health: \"048-008-000-000-000-000-000\",\n inpatient_psychiatric_facility: \"048-008-001-000-000-000-000\",\n healthcare_provider: \"048-008-002-000-000-000-000\",\n education: \"048-009-000-000-000-000-000\",\n school_academic_institution: \"048-009-001-000-000-000-000\",\n victim_community_service_providers: \"048-010-000-000-000-000-000\",\n child_advocacy_center: \"048-010-001-000-000-000-000\",\n victim_service_provider: \"048-010-002-000-000-000-000\",\n community_based_service_provider: \"048-010-003-000-000-000-000\",\n legal_services_provider: \"048-010-004-000-000-000-000\",\n coordination_governance: \"048-011-000-000-000-000-000\",\n mdt: \"048-011-001-000-000-000-000\",\n coalition: \"048-011-002-000-000-000-000\",\n internal: \"048-012-000-000-000-000-000\",\n own_agency_internal: \"048-012-001-000-000-000-000\",\n other_entity: \"048-013-000-000-000-000-000\",\n employer: \"048-013-001-000-000-000-000\",\n benefits_public_assistance_office: \"048-013-002-000-000-000-000\",\n other_organization: \"048-013-003-000-000-000-000\",\n} as const;\n\nexport type ReferralEntityCategoryKey = keyof typeof ReferralEntityCategoryKeys;\n\n/**\n * Key → positional code map for the `income_benefits_sources` CVC domain.\n *\n * Domain: `income_benefits_sources` · Version: 1.1.0 · Entries: 41\n */\nexport const IncomeBenefitsSourcesKeys = {\n missingness_root: \"171-000-000-000-000-000-000\",\n unknown: \"171-000-000-000-000-000-001\",\n anonymous: \"171-000-000-000-000-000-002\",\n data_not_collected: \"171-000-000-000-000-000-003\",\n prefer_not_to_answer: \"171-000-000-000-000-000-004\",\n earned_income: \"171-001-000-000-000-000-000\",\n employment: \"171-001-001-000-000-000-000\",\n informal_income: \"171-001-002-000-000-000-000\",\n cash_benefit: \"171-002-000-000-000-000-000\",\n unemployment_insurance: \"171-002-001-000-000-000-000\",\n supplemental_security_income: \"171-002-002-000-000-000-000\",\n social_security_disability_insurance: \"171-002-003-000-000-000-000\",\n va_service_connected_disability: \"171-002-004-000-000-000-000\",\n va_non_service_connected_pension: \"171-002-005-000-000-000-000\",\n private_disability_insurance: \"171-002-006-000-000-000-000\",\n workers_compensation: \"171-002-007-000-000-000-000\",\n tanf: \"171-002-008-000-000-000-000\",\n general_assistance: \"171-002-009-000-000-000-000\",\n social_security_retirement: \"171-002-010-000-000-000-000\",\n pension_or_retirement_from_former_job: \"171-002-011-000-000-000-000\",\n social_security_generic: \"171-002-012-000-000-000-000\",\n va_benefits_generic: \"171-002-013-000-000-000-000\",\n in_kind_benefit: \"171-003-000-000-000-000-000\",\n snap: \"171-003-001-000-000-000-000\",\n wic: \"171-003-002-000-000-000-000\",\n tanf_child_care: \"171-003-003-000-000-000-000\",\n tanf_transportation: \"171-003-004-000-000-000-000\",\n tanf_other_funded_services: \"171-003-005-000-000-000-000\",\n medicaid: \"171-003-006-000-000-000-000\",\n medicare: \"171-003-007-000-000-000-000\",\n housing_assistance: \"171-003-008-000-000-000-000\",\n childcare_subsidy: \"171-003-009-000-000-000-000\",\n transfer_support: \"171-004-000-000-000-000-000\",\n child_support: \"171-004-001-000-000-000-000\",\n alimony_spousal_support: \"171-004-002-000-000-000-000\",\n family_friend_support: \"171-004-003-000-000-000-000\",\n other_unspecified: \"171-005-000-000-000-000-000\",\n other_income: \"171-005-001-000-000-000-000\",\n other_benefit: \"171-005-002-000-000-000-000\",\n education_stipend: \"171-005-003-000-000-000-000\",\n victim_compensation: \"171-006-000-000-000-000-000\",\n} as const;\n\nexport type IncomeBenefitsSourcesKey = keyof typeof IncomeBenefitsSourcesKeys;\n\n/**\n * Key → positional code map for the `enrollment_application_status` CVC domain.\n *\n * Domain: `enrollment_application_status` · Version: 1.0.0 · Entries: 12\n */\nexport const EnrollmentApplicationStatusKeys = {\n missingness_root: \"175-000-000-000-000-000-000\",\n unknown: \"175-000-000-000-000-000-001\",\n anonymous: \"175-000-000-000-000-000-002\",\n data_not_collected: \"175-000-000-000-000-000-003\",\n approved: \"175-001-000-000-000-000-000\",\n applied: \"175-002-000-000-000-000-000\",\n not_applied: \"175-003-000-000-000-000-000\",\n pending: \"175-004-000-000-000-000-000\",\n active: \"175-005-000-000-000-000-000\",\n denied: \"175-006-000-000-000-000-000\",\n closed: \"175-007-000-000-000-000-000\",\n expired: \"175-008-000-000-000-000-000\",\n} as const;\n\nexport type EnrollmentApplicationStatusKey = keyof typeof EnrollmentApplicationStatusKeys;\n\n/**\n * Key → positional code map for the `administering_jurisdiction` CVC domain.\n *\n * Domain: `administering_jurisdiction` · Version: 1.0.0 · Entries: 10\n */\nexport const AdministeringJurisdictionKeys = {\n missingness_root: \"177-000-000-000-000-000-000\",\n unknown: \"177-000-000-000-000-000-001\",\n anonymous: \"177-000-000-000-000-000-002\",\n data_not_collected: \"177-000-000-000-000-000-003\",\n federal: \"177-001-000-000-000-000-000\",\n state: \"177-002-000-000-000-000-000\",\n county: \"177-003-000-000-000-000-000\",\n city: \"177-004-000-000-000-000-000\",\n tribal: \"177-005-000-000-000-000-000\",\n territory: \"177-006-000-000-000-000-000\",\n} as const;\n\nexport type AdministeringJurisdictionKey = keyof typeof AdministeringJurisdictionKeys;\n\n/**\n * Key → positional code map for the `frequency_cadence` CVC domain.\n *\n * Domain: `frequency_cadence` · Version: 1.0.0 · Entries: 11\n */\nexport const FrequencyCadenceKeys = {\n missingness_root: \"176-000-000-000-000-000-000\",\n unknown: \"176-000-000-000-000-000-001\",\n anonymous: \"176-000-000-000-000-000-002\",\n data_not_collected: \"176-000-000-000-000-000-003\",\n daily: \"176-001-000-000-000-000-000\",\n weekly: \"176-002-000-000-000-000-000\",\n biweekly: \"176-003-000-000-000-000-000\",\n monthly: \"176-004-000-000-000-000-000\",\n quarterly: \"176-005-000-000-000-000-000\",\n annual: \"176-006-000-000-000-000-000\",\n one_time: \"176-007-000-000-000-000-000\",\n} as const;\n\nexport type FrequencyCadenceKey = keyof typeof FrequencyCadenceKeys;\n\n/**\n * Key → positional code map for the `inference_type` CVC domain.\n *\n * Domain: `inference_type` · Version: 1.0.0 · Entries: 7\n */\nexport const InferenceTypeKeys = {\n missingness_root: \"142-000-000-000-000-000-000\",\n unknown: \"142-000-000-000-000-000-001\",\n anonymous: \"142-000-000-000-000-000-002\",\n data_not_collected: \"142-000-000-000-000-000-003\",\n manual: \"142-001-000-000-000-000-000\",\n rules: \"142-002-000-000-000-000-000\",\n model: \"142-003-000-000-000-000-000\",\n} as const;\n\nexport type InferenceTypeKey = keyof typeof InferenceTypeKeys;\n\n/**\n * Key → positional code map for the `source_category` CVC domain.\n *\n * Domain: `source_category` · Version: 1.1.0 · Entries: 9\n */\nexport const SourceCategoryKeys = {\n missingness_root: \"140-000-000-000-000-000-000\",\n unknown: \"140-000-000-000-000-000-001\",\n anonymous: \"140-000-000-000-000-000-002\",\n data_not_collected: \"140-000-000-000-000-000-003\",\n human: \"140-001-000-000-000-000-000\",\n institutional_record: \"140-002-000-000-000-000-000\",\n legal_evidentiary: \"140-003-000-000-000-000-000\",\n machine: \"140-004-000-000-000-000-000\",\n open_source: \"140-005-000-000-000-000-000\",\n} as const;\n\nexport type SourceCategoryKey = keyof typeof SourceCategoryKeys;\n\n/**\n * Key → positional code map for the `source_subtype` CVC domain.\n *\n * Domain: `source_subtype` · Version: 1.2.0 · Entries: 39\n */\nexport const SourceSubtypeKeys = {\n missingness_root: \"141-000-000-000-000-000-000\",\n unknown: \"141-000-000-000-000-000-001\",\n anonymous: \"141-000-000-000-000-000-002\",\n data_not_collected: \"141-000-000-000-000-000-003\",\n ads_profile_website: \"141-001-000-000-000-000-000\",\n aggregation_output: \"141-002-000-000-000-000-000\",\n benefits_record: \"141-003-000-000-000-000-000\",\n charge_document: \"141-004-000-000-000-000-000\",\n child_welfare_record: \"141-005-000-000-000-000-000\",\n conviction_record: \"141-006-000-000-000-000-000\",\n corrections_record: \"141-007-000-000-000-000-000\",\n court_record: \"141-008-000-000-000-000-000\",\n employment_hr_record: \"141-009-000-000-000-000-000\",\n forensic_medical_exam: \"141-010-000-000-000-000-000\",\n immigration_record: \"141-011-000-000-000-000-000\",\n law_enforcement_assessment: \"141-012-000-000-000-000-000\",\n medical_record: \"141-013-000-000-000-000-000\",\n model_output: \"141-014-000-000-000-000-000\",\n news_media: \"141-015-000-000-000-000-000\",\n official_id_document: \"141-016-000-000-000-000-000\",\n parser_extraction: \"141-017-000-000-000-000-000\",\n partner_agency_case_note: \"141-018-000-000-000-000-000\",\n public_registry: \"141-019-000-000-000-000-000\",\n reviews_forums_comments: \"141-020-000-000-000-000-000\",\n rules_engine: \"141-021-000-000-000-000-000\",\n school_record: \"141-022-000-000-000-000-000\",\n search_warrant_return: \"141-023-000-000-000-000-000\",\n service_provider_assessment: \"141-024-000-000-000-000-000\",\n service_provider_case_note: \"141-025-000-000-000-000-000\",\n shelter_program_record: \"141-026-000-000-000-000-000\",\n social_media: \"141-027-000-000-000-000-000\",\n staff_observation: \"141-028-000-000-000-000-000\",\n system_import: \"141-029-000-000-000-000-000\",\n third_party_report: \"141-030-000-000-000-000-000\",\n victim_disclosure: \"141-031-000-000-000-000-000\",\n advocate_capture: \"141-032-000-000-000-000-000\",\n advocate_assessment: \"141-033-000-000-000-000-000\",\n child_welfare_episode_edit: \"141-034-000-000-000-000-000\",\n juvenile_justice_episode_edit: \"141-035-000-000-000-000-000\",\n} as const;\n\nexport type SourceSubtypeKey = keyof typeof SourceSubtypeKeys;\n\n/**\n * Key → positional code map for the `support_strength` CVC domain.\n *\n * Domain: `support_strength` · Version: 1.0.0 · Entries: 11\n */\nexport const SupportStrengthKeys = {\n missingness_root: \"139-000-000-000-000-000-000\",\n unknown: \"139-000-000-000-000-000-001\",\n anonymous: \"139-000-000-000-000-000-002\",\n data_not_collected: \"139-000-000-000-000-000-003\",\n adjudicated: \"139-001-000-000-000-000-000\",\n allegation: \"139-002-000-000-000-000-000\",\n corroborated: \"139-003-000-000-000-000-000\",\n minimally_supported: \"139-004-000-000-000-000-000\",\n multi_source_corroborated: \"139-005-000-000-000-000-000\",\n official_record_supported: \"139-006-000-000-000-000-000\",\n strongly_supported: \"139-007-000-000-000-000-000\",\n} as const;\n\nexport type SupportStrengthKey = keyof typeof SupportStrengthKeys;\n\n/**\n * Key → positional code map for the `determination_level` CVC domain.\n *\n * Domain: `determination_level` · Version: 1.0.0 · Entries: 9\n */\nexport const DeterminationLevelKeys = {\n missingness_root: \"138-000-000-000-000-000-000\",\n unknown: \"138-000-000-000-000-000-001\",\n anonymous: \"138-000-000-000-000-000-002\",\n data_not_collected: \"138-000-000-000-000-000-003\",\n disclosed: \"138-001-000-000-000-000-000\",\n estimated: \"138-002-000-000-000-000-000\",\n reported: \"138-003-000-000-000-000-000\",\n suspected: \"138-004-000-000-000-000-000\",\n verified: \"138-005-000-000-000-000-000\",\n} as const;\n\nexport type DeterminationLevelKey = keyof typeof DeterminationLevelKeys;\n\n/**\n * Key → positional code map for the `role_context` CVC domain.\n *\n * Domain: `role_context` · Version: 1.0.0 · Entries: 7\n */\nexport const RoleContextKeys = {\n missingness_root: \"160-000-000-000-000-000-000\",\n unknown: \"160-000-000-000-000-000-001\",\n anonymous: \"160-000-000-000-000-000-002\",\n data_not_collected: \"160-000-000-000-000-000-003\",\n both: \"160-001-000-000-000-000-000\",\n offender: \"160-002-000-000-000-000-000\",\n victim: \"160-003-000-000-000-000-000\",\n} as const;\n\nexport type RoleContextKey = keyof typeof RoleContextKeys;\n\n/**\n * Key → positional code map for the `time_scope` CVC domain.\n *\n * Domain: `time_scope` · Version: 1.0.0 · Entries: 6\n */\nexport const TimeScopeKeys = {\n missingness_root: \"174-000-000-000-000-000-000\",\n unknown: \"174-000-000-000-000-000-001\",\n anonymous: \"174-000-000-000-000-000-002\",\n data_not_collected: \"174-000-000-000-000-000-003\",\n current: \"174-001-000-000-000-000-000\",\n prior: \"174-002-000-000-000-000-000\",\n} as const;\n\nexport type TimeScopeKey = keyof typeof TimeScopeKeys;\n\n/**\n * Key → positional code map for the `verification_method` CVC domain.\n *\n * Domain: `verification_method` · Version: 1.2.0 · Entries: 13\n */\nexport const VerificationMethodKeys = {\n missingness_root: \"143-000-000-000-000-000-000\",\n unknown: \"143-000-000-000-000-000-001\",\n anonymous: \"143-000-000-000-000-000-002\",\n data_not_collected: \"143-000-000-000-000-000-003\",\n court_record_confirmed: \"143-001-000-000-000-000-000\",\n evidence_threshold_met: \"143-002-000-000-000-000-000\",\n multi_source_corroboration: \"143-003-000-000-000-000-000\",\n qa_audit_passed: \"143-004-000-000-000-000-000\",\n supervisor_review: \"143-005-000-000-000-000-000\",\n rules: \"143-006-000-000-000-000-000\",\n still_reaches: \"143-007-000-000-000-000-000\",\n doc_signed: \"143-008-000-000-000-000-000\",\n findings_seal: \"143-009-000-000-000-000-000\",\n} as const;\n\nexport type VerificationMethodKey = keyof typeof VerificationMethodKeys;\n\n/**\n * Key → positional code map for the `verification_status` CVC domain.\n *\n * Domain: `verification_status` · Version: 1.0.0 · Entries: 7\n */\nexport const VerificationStatusKeys = {\n missingness_root: \"962-000-000-000-000-000-000\",\n unknown: \"962-000-000-000-000-000-001\",\n anonymous: \"962-000-000-000-000-000-002\",\n data_not_collected: \"962-000-000-000-000-000-003\",\n yes: \"962-001-000-000-000-000-000\",\n no: \"962-002-000-000-000-000-000\",\n i_can_get_it: \"962-003-000-000-000-000-000\",\n} as const;\n\nexport type VerificationStatusKey = keyof typeof VerificationStatusKeys;\n\n/**\n * Key → positional code map for the `visa_type` CVC domain.\n *\n * Domain: `visa_type` · Version: 1.0.0 · Entries: 40\n */\nexport const VisaTypeKeys = {\n missingness_root: \"963-000-000-000-000-000-000\",\n unknown: \"963-000-000-000-000-000-001\",\n anonymous: \"963-000-000-000-000-000-002\",\n data_not_collected: \"963-000-000-000-000-000-003\",\n us_citizen: \"963-001-000-000-000-000-000\",\n none_undocumented: \"963-002-000-000-000-000-000\",\n lpr: \"963-003-000-000-000-000-000\",\n b_1: \"963-004-000-000-000-000-000\",\n b_2: \"963-005-000-000-000-000-000\",\n f_1: \"963-006-000-000-000-000-000\",\n m_1: \"963-007-000-000-000-000-000\",\n j_1: \"963-008-000-000-000-000-000\",\n h_1b: \"963-009-000-000-000-000-000\",\n h_2a: \"963-010-000-000-000-000-000\",\n h_2b: \"963-011-000-000-000-000-000\",\n l_1: \"963-012-000-000-000-000-000\",\n o_1: \"963-013-000-000-000-000-000\",\n tn: \"963-014-000-000-000-000-000\",\n k_1: \"963-015-000-000-000-000-000\",\n k_3: \"963-016-000-000-000-000-000\",\n t_1: \"963-017-000-000-000-000-000\",\n t_2: \"963-018-000-000-000-000-000\",\n t_3: \"963-019-000-000-000-000-000\",\n t_4: \"963-020-000-000-000-000-000\",\n t_5: \"963-021-000-000-000-000-000\",\n t_6: \"963-022-000-000-000-000-000\",\n u_1: \"963-023-000-000-000-000-000\",\n u_2: \"963-024-000-000-000-000-000\",\n u_3: \"963-025-000-000-000-000-000\",\n u_4: \"963-026-000-000-000-000-000\",\n u_5: \"963-027-000-000-000-000-000\",\n vawa_self_petitioner: \"963-028-000-000-000-000-000\",\n asylum_pending: \"963-029-000-000-000-000-000\",\n asylum_granted: \"963-030-000-000-000-000-000\",\n refugee: \"963-031-000-000-000-000-000\",\n sij: \"963-032-000-000-000-000-000\",\n parole_humanitarian: \"963-033-000-000-000-000-000\",\n esta: \"963-034-000-000-000-000-000\",\n diplomatic: \"963-035-000-000-000-000-000\",\n other: \"963-036-000-000-000-000-000\",\n} as const;\n\nexport type VisaTypeKey = keyof typeof VisaTypeKeys;\n\n/**\n * Key → positional code map for the `quality_flags` CVC domain.\n *\n * Domain: `quality_flags` · Version: 1.0.0 · Entries: 9\n */\nexport const QualityFlagsKeys = {\n missingness_root: \"144-000-000-000-000-000-000\",\n unknown: \"144-000-000-000-000-000-001\",\n anonymous: \"144-000-000-000-000-000-002\",\n data_not_collected: \"144-000-000-000-000-000-003\",\n circular_model_label_risk: \"144-001-000-000-000-000-000\",\n data_redacted: \"144-002-000-000-000-000-000\",\n inconsistent: \"144-003-000-000-000-000-000\",\n self_report_only: \"144-004-000-000-000-000-000\",\n single_source: \"144-005-000-000-000-000-000\",\n} as const;\n\nexport type QualityFlagsKey = keyof typeof QualityFlagsKeys;\n\n/**\n * Key → positional code map for the `contact_info_use_type` CVC domain.\n *\n * Domain: `contact_info_use_type` · Version: 1.0.0 · Entries: 8\n */\nexport const ContactInfoUseTypeKeys = {\n missingness_root: \"154-000-000-000-000-000-000\",\n unknown: \"154-000-000-000-000-000-001\",\n anonymous: \"154-000-000-000-000-000-002\",\n data_not_collected: \"154-000-000-000-000-000-003\",\n business_commercial_sex: \"154-001-000-000-000-000-000\",\n business_non_cs: \"154-002-000-000-000-000-000\",\n mixed_use: \"154-003-000-000-000-000-000\",\n personal: \"154-004-000-000-000-000-000\",\n} as const;\n\nexport type ContactInfoUseTypeKey = keyof typeof ContactInfoUseTypeKeys;\n\n/**\n * Key → positional code map for the `session_state` CVC domain.\n *\n * Domain: `session_state` · Version: 1.0.0 · Entries: 9\n */\nexport const SessionStateKeys = {\n missingness_root: \"216-000-000-000-000-000-000\",\n unknown: \"216-000-000-000-000-000-001\",\n anonymous: \"216-000-000-000-000-000-002\",\n data_not_collected: \"216-000-000-000-000-000-003\",\n session_action_needed: \"216-001-000-000-000-000-000\",\n session_closed: \"216-002-000-000-000-000-000\",\n session_discarded: \"216-003-000-000-000-000-000\",\n session_in_progress: \"216-004-000-000-000-000-000\",\n session_initialized: \"216-005-000-000-000-000-000\",\n} as const;\n\nexport type SessionStateKey = keyof typeof SessionStateKeys;\n\n/**\n * Key → positional code map for the `relationship_dynamics` CVC domain.\n *\n * Domain: `relationship_dynamics` · Version: 1.0.0 · Entries: 42\n */\nexport const RelationshipDynamicsKeys = {\n missingness_root: \"145-000-000-000-000-000-000\",\n unknown: \"145-000-000-000-000-000-001\",\n anonymous: \"145-000-000-000-000-000-002\",\n data_not_collected: \"145-000-000-000-000-000-003\",\n coercion_threats: \"145-001-000-000-000-000-000\",\n threats_of_harm: \"145-001-001-000-000-000-000\",\n threatens_physical_harm_to_subject: \"145-001-001-001-000-000-000\",\n physically_harm_threatened_by_subject: \"145-001-001-002-000-000-000\",\n threats_to_family_friends: \"145-001-002-000-000-000-000\",\n threatens_family_friends_of_subject: \"145-001-002-001-000-000-000\",\n family_friends_threatened_by_subject: \"145-001-002-002-000-000-000\",\n threats_of_legal_trouble: \"145-001-003-000-000-000-000\",\n other_threats_to_subject: \"145-001-003-001-000-000-000\",\n other_threats_by_subject: \"145-001-003-002-000-000-000\",\n control_monitoring: \"145-002-000-000-000-000-000\",\n controlling_behavior: \"145-002-001-000-000-000-000\",\n appears_controlling_of_subject: \"145-002-001-001-000-000-000\",\n appears_controlled_by_subject: \"145-002-001-002-000-000-000\",\n abuse_dynamics: \"145-003-000-000-000-000-000\",\n emotional_verbal_abuse: \"145-003-001-000-000-000-000\",\n emotionally_verbally_abuses_subject: \"145-003-001-001-000-000-000\",\n emotionally_verbally_abused_by_subject: \"145-003-001-002-000-000-000\",\n physical_abuse: \"145-003-002-000-000-000-000\",\n physically_abuses_subject: \"145-003-002-001-000-000-000\",\n physically_abused_by_subject: \"145-003-002-002-000-000-000\",\n sexual_abuse: \"145-003-003-000-000-000-000\",\n sexually_abuses_subject: \"145-003-003-001-000-000-000\",\n sexually_abused_by_subject: \"145-003-003-002-000-000-000\",\n family_friends_physically_abused: \"145-003-004-000-000-000-000\",\n physically_abuses_family_friends_of_subject: \"145-003-004-001-000-000-000\",\n family_friends_physically_abused_by_subject: \"145-003-004-002-000-000-000\",\n resource_control: \"145-004-000-000-000-000-000\",\n controls_documentation: \"145-004-001-000-000-000-000\",\n controls_documentation_of_subject: \"145-004-001-001-000-000-000\",\n documentation_controlled_by_subject: \"145-004-001-002-000-000-000\",\n controls_finances: \"145-004-002-000-000-000-000\",\n controls_finances_of_subject: \"145-004-002-001-000-000-000\",\n finances_controlled_by_subject: \"145-004-002-002-000-000-000\",\n power_imbalance: \"145-005-000-000-000-000-000\",\n age_disparity: \"145-005-001-000-000-000-000\",\n is_much_older_than_subject: \"145-005-001-001-000-000-000\",\n is_much_younger_than_subject: \"145-005-001-002-000-000-000\",\n} as const;\n\nexport type RelationshipDynamicsKey = keyof typeof RelationshipDynamicsKeys;\n\n/**\n * Key → positional code map for the `collection_context` CVC domain.\n *\n * Domain: `collection_context` · Version: 1.0.0 · Entries: 8\n */\nexport const CollectionContextKeys = {\n missingness_root: \"195-000-000-000-000-000-000\",\n unknown: \"195-000-000-000-000-000-001\",\n anonymous: \"195-000-000-000-000-000-002\",\n data_not_collected: \"195-000-000-000-000-000-003\",\n contact: \"195-001-000-000-000-000-000\",\n enrollment_entry: \"195-002-000-000-000-000-000\",\n enrollment_exit: \"195-003-000-000-000-000-000\",\n post_exit: \"195-004-000-000-000-000-000\",\n} as const;\n\nexport type CollectionContextKey = keyof typeof CollectionContextKeys;\n\n/**\n * Key → positional code map for the `languages` CVC domain.\n *\n * Domain: `languages` · Version: 1.0.0 · Entries: 212\n */\nexport const LanguagesKeys = {\n missingness_root: \"223-000-000-000-000-000-000\",\n unknown: \"223-000-000-000-000-000-001\",\n anonymous: \"223-000-000-000-000-000-002\",\n data_not_collected: \"223-000-000-000-000-000-003\",\n english: \"223-001-000-000-000-000-000\",\n spanish: \"223-002-000-000-000-000-000\",\n vietnamese: \"223-003-000-000-000-000-000\",\n arabic_modern_standard: \"223-004-000-000-000-000-000\",\n chinese_mandarin: \"223-005-000-000-000-000-000\",\n cantonese: \"223-006-000-000-000-000-000\",\n korean: \"223-007-000-000-000-000-000\",\n hindi: \"223-008-000-000-000-000-000\",\n tagalog_filipino: \"223-009-000-000-000-000-000\",\n french: \"223-010-000-000-000-000-000\",\n portuguese: \"223-011-000-000-000-000-000\",\n american_sign_language_asl: \"223-012-000-000-000-000-000\",\n russian: \"223-013-000-000-000-000-000\",\n polish: \"223-014-000-000-000-000-000\",\n haitian_creole: \"223-015-000-000-000-000-000\",\n italian: \"223-016-000-000-000-000-000\",\n german: \"223-017-000-000-000-000-000\",\n punjabi: \"223-018-000-000-000-000-000\",\n urdu: \"223-019-000-000-000-000-000\",\n persian_farsi: \"223-020-000-000-000-000-000\",\n abkhazian: \"223-021-000-000-000-000-000\",\n afar: \"223-022-000-000-000-000-000\",\n afrikaans: \"223-023-000-000-000-000-000\",\n akan: \"223-024-000-000-000-000-000\",\n albanian: \"223-025-000-000-000-000-000\",\n amharic: \"223-026-000-000-000-000-000\",\n aragonese: \"223-027-000-000-000-000-000\",\n armenian: \"223-028-000-000-000-000-000\",\n assamese: \"223-029-000-000-000-000-000\",\n avaric: \"223-030-000-000-000-000-000\",\n avestan: \"223-031-000-000-000-000-000\",\n aymara: \"223-032-000-000-000-000-000\",\n azerbaijani: \"223-033-000-000-000-000-000\",\n bambara: \"223-034-000-000-000-000-000\",\n bashkir: \"223-035-000-000-000-000-000\",\n basque: \"223-036-000-000-000-000-000\",\n belarusian: \"223-037-000-000-000-000-000\",\n bengali_bangla: \"223-038-000-000-000-000-000\",\n bihari: \"223-039-000-000-000-000-000\",\n bislama: \"223-040-000-000-000-000-000\",\n bosnian: \"223-041-000-000-000-000-000\",\n breton: \"223-042-000-000-000-000-000\",\n bulgarian: \"223-043-000-000-000-000-000\",\n burmese: \"223-044-000-000-000-000-000\",\n catalan: \"223-045-000-000-000-000-000\",\n chamorro: \"223-046-000-000-000-000-000\",\n chechen: \"223-047-000-000-000-000-000\",\n chichewa: \"223-048-000-000-000-000-000\",\n chuvash: \"223-049-000-000-000-000-000\",\n cornish: \"223-050-000-000-000-000-000\",\n corsican: \"223-051-000-000-000-000-000\",\n cree: \"223-052-000-000-000-000-000\",\n croatian: \"223-053-000-000-000-000-000\",\n czech: \"223-054-000-000-000-000-000\",\n danish: \"223-055-000-000-000-000-000\",\n divehi_maldivian: \"223-056-000-000-000-000-000\",\n dutch: \"223-057-000-000-000-000-000\",\n dzongkha: \"223-058-000-000-000-000-000\",\n esperanto: \"223-059-000-000-000-000-000\",\n estonian: \"223-060-000-000-000-000-000\",\n ewe: \"223-061-000-000-000-000-000\",\n faroese: \"223-062-000-000-000-000-000\",\n fijian: \"223-063-000-000-000-000-000\",\n finnish: \"223-064-000-000-000-000-000\",\n fulah: \"223-065-000-000-000-000-000\",\n galician: \"223-066-000-000-000-000-000\",\n georgian: \"223-067-000-000-000-000-000\",\n greek: \"223-068-000-000-000-000-000\",\n guarani: \"223-069-000-000-000-000-000\",\n gujarati: \"223-070-000-000-000-000-000\",\n hausa: \"223-071-000-000-000-000-000\",\n hebrew: \"223-072-000-000-000-000-000\",\n herero: \"223-073-000-000-000-000-000\",\n hiri_motu: \"223-074-000-000-000-000-000\",\n hungarian: \"223-075-000-000-000-000-000\",\n interlingua: \"223-076-000-000-000-000-000\",\n indonesian: \"223-077-000-000-000-000-000\",\n interlingue: \"223-078-000-000-000-000-000\",\n irish: \"223-079-000-000-000-000-000\",\n igbo: \"223-080-000-000-000-000-000\",\n inupiaq: \"223-081-000-000-000-000-000\",\n ido: \"223-082-000-000-000-000-000\",\n icelandic: \"223-083-000-000-000-000-000\",\n inuktitut: \"223-084-000-000-000-000-000\",\n japanese: \"223-085-000-000-000-000-000\",\n javanese: \"223-086-000-000-000-000-000\",\n kalaallisut_greenlandic: \"223-087-000-000-000-000-000\",\n kannada: \"223-088-000-000-000-000-000\",\n kanuri: \"223-089-000-000-000-000-000\",\n kashmiri: \"223-090-000-000-000-000-000\",\n kazakh: \"223-091-000-000-000-000-000\",\n khmer: \"223-092-000-000-000-000-000\",\n kikuyu: \"223-093-000-000-000-000-000\",\n kinyarwanda: \"223-094-000-000-000-000-000\",\n kyrgyz: \"223-095-000-000-000-000-000\",\n komi: \"223-096-000-000-000-000-000\",\n kongo: \"223-097-000-000-000-000-000\",\n kurdish_general: \"223-098-000-000-000-000-000\",\n kuanyama: \"223-099-000-000-000-000-000\",\n latin: \"223-100-000-000-000-000-000\",\n luxembourgish: \"223-101-000-000-000-000-000\",\n luganda: \"223-102-000-000-000-000-000\",\n limburgish: \"223-103-000-000-000-000-000\",\n lingala: \"223-104-000-000-000-000-000\",\n lao: \"223-105-000-000-000-000-000\",\n lithuanian: \"223-106-000-000-000-000-000\",\n luba_katanga: \"223-107-000-000-000-000-000\",\n latvian: \"223-108-000-000-000-000-000\",\n manx: \"223-109-000-000-000-000-000\",\n macedonian: \"223-110-000-000-000-000-000\",\n malagasy: \"223-111-000-000-000-000-000\",\n malay: \"223-112-000-000-000-000-000\",\n malayalam: \"223-113-000-000-000-000-000\",\n maltese: \"223-114-000-000-000-000-000\",\n maori: \"223-115-000-000-000-000-000\",\n marathi: \"223-116-000-000-000-000-000\",\n marshallese: \"223-117-000-000-000-000-000\",\n mongolian: \"223-118-000-000-000-000-000\",\n nauru: \"223-119-000-000-000-000-000\",\n navajo: \"223-120-000-000-000-000-000\",\n norwegian_bokmal: \"223-121-000-000-000-000-000\",\n north_ndebele: \"223-122-000-000-000-000-000\",\n nepali: \"223-123-000-000-000-000-000\",\n ndonga: \"223-124-000-000-000-000-000\",\n norwegian_nynorsk: \"223-125-000-000-000-000-000\",\n norwegian: \"223-126-000-000-000-000-000\",\n sichuan_yi: \"223-127-000-000-000-000-000\",\n south_ndebele: \"223-128-000-000-000-000-000\",\n occitan: \"223-129-000-000-000-000-000\",\n ojibwe: \"223-130-000-000-000-000-000\",\n old_church_slavonic: \"223-131-000-000-000-000-000\",\n oromo: \"223-132-000-000-000-000-000\",\n odia_oriya: \"223-133-000-000-000-000-000\",\n ossetian: \"223-134-000-000-000-000-000\",\n pali: \"223-135-000-000-000-000-000\",\n pashto: \"223-136-000-000-000-000-000\",\n quechua: \"223-137-000-000-000-000-000\",\n romansh: \"223-138-000-000-000-000-000\",\n rundi: \"223-139-000-000-000-000-000\",\n romanian: \"223-140-000-000-000-000-000\",\n sanskrit: \"223-141-000-000-000-000-000\",\n sardinian: \"223-142-000-000-000-000-000\",\n sindhi: \"223-143-000-000-000-000-000\",\n northern_sami: \"223-144-000-000-000-000-000\",\n samoan: \"223-145-000-000-000-000-000\",\n sango: \"223-146-000-000-000-000-000\",\n serbian: \"223-147-000-000-000-000-000\",\n scottish_gaelic: \"223-148-000-000-000-000-000\",\n shona: \"223-149-000-000-000-000-000\",\n sinhala: \"223-150-000-000-000-000-000\",\n slovak: \"223-151-000-000-000-000-000\",\n slovenian: \"223-152-000-000-000-000-000\",\n somali: \"223-153-000-000-000-000-000\",\n southern_sotho: \"223-154-000-000-000-000-000\",\n sundanese: \"223-155-000-000-000-000-000\",\n swahili: \"223-156-000-000-000-000-000\",\n swati: \"223-157-000-000-000-000-000\",\n swedish: \"223-158-000-000-000-000-000\",\n tamil: \"223-159-000-000-000-000-000\",\n telugu: \"223-160-000-000-000-000-000\",\n tajik: \"223-161-000-000-000-000-000\",\n thai: \"223-162-000-000-000-000-000\",\n tigrinya: \"223-163-000-000-000-000-000\",\n tibetan: \"223-164-000-000-000-000-000\",\n turkmen: \"223-165-000-000-000-000-000\",\n tswana: \"223-166-000-000-000-000-000\",\n tongan: \"223-167-000-000-000-000-000\",\n turkish: \"223-168-000-000-000-000-000\",\n tsonga: \"223-169-000-000-000-000-000\",\n tatar: \"223-170-000-000-000-000-000\",\n twi: \"223-171-000-000-000-000-000\",\n tahitian: \"223-172-000-000-000-000-000\",\n uyghur: \"223-173-000-000-000-000-000\",\n ukrainian: \"223-174-000-000-000-000-000\",\n uzbek: \"223-175-000-000-000-000-000\",\n venda: \"223-176-000-000-000-000-000\",\n volapuk: \"223-177-000-000-000-000-000\",\n walloon: \"223-178-000-000-000-000-000\",\n welsh: \"223-179-000-000-000-000-000\",\n wolof: \"223-180-000-000-000-000-000\",\n western_frisian: \"223-181-000-000-000-000-000\",\n xhosa: \"223-182-000-000-000-000-000\",\n yiddish: \"223-183-000-000-000-000-000\",\n yoruba: \"223-184-000-000-000-000-000\",\n zhuang: \"223-185-000-000-000-000-000\",\n zulu: \"223-186-000-000-000-000-000\",\n hakka_chinese: \"223-187-000-000-000-000-000\",\n min_nan_chinese_hokkien_taiwanese: \"223-188-000-000-000-000-000\",\n wu_chinese_shanghainese: \"223-189-000-000-000-000-000\",\n egyptian_arabic: \"223-190-000-000-000-000-000\",\n iraqi_arabic_mesopotamian: \"223-191-000-000-000-000-000\",\n levantine_arabic: \"223-192-000-000-000-000-000\",\n dari_afghan_persian: \"223-193-000-000-000-000-000\",\n central_kurdish_sorani: \"223-194-000-000-000-000-000\",\n northern_kurdish_kurmanji: \"223-195-000-000-000-000-000\",\n filipino_national_variety: \"223-196-000-000-000-000-000\",\n hmong: \"223-197-000-000-000-000-000\",\n iu_mien: \"223-198-000-000-000-000-000\",\n karen: \"223-199-000-000-000-000-000\",\n chuukese: \"223-200-000-000-000-000-000\",\n pohnpeian: \"223-201-000-000-000-000-000\",\n yapese: \"223-202-000-000-000-000-000\",\n papiamento: \"223-203-000-000-000-000-000\",\n nigerian_pidgin: \"223-204-000-000-000-000-000\",\n british_sign_language_bsl: \"223-205-000-000-000-000-000\",\n french_sign_language_lsf: \"223-206-000-000-000-000-000\",\n mexican_sign_language_lsm: \"223-207-000-000-000-000-000\",\n brazilian_sign_language_libras: \"223-208-000-000-000-000-000\",\n} as const;\n\nexport type LanguagesKey = keyof typeof LanguagesKeys;\n\n/**\n * Key → positional code map for the `hmis_project_type` CVC domain.\n *\n * Domain: `hmis_project_type` · Version: 1.0.0 · Entries: 18\n */\nexport const HmisProjectTypeKeys = {\n missingness_root: \"225-000-000-000-000-000-000\",\n unknown: \"225-000-000-000-000-000-001\",\n anonymous: \"225-000-000-000-000-000-002\",\n data_not_collected: \"225-000-000-000-000-000-003\",\n street_outreach: \"225-001-000-000-000-000-000\",\n emergency_shelter_entry_exit: \"225-002-000-000-000-000-000\",\n emergency_shelter_night_by_night: \"225-003-000-000-000-000-000\",\n transitional_housing: \"225-004-000-000-000-000-000\",\n ph_permanent_supportive_housing: \"225-005-000-000-000-000-000\",\n services_only: \"225-006-000-000-000-000-000\",\n other: \"225-007-000-000-000-000-000\",\n safe_haven: \"225-008-000-000-000-000-000\",\n ph_housing_only: \"225-009-000-000-000-000-000\",\n ph_housing_with_services: \"225-010-000-000-000-000-000\",\n day_shelter: \"225-011-000-000-000-000-000\",\n homelessness_prevention: \"225-012-000-000-000-000-000\",\n ph_rapid_re_housing: \"225-013-000-000-000-000-000\",\n coordinated_entry: \"225-014-000-000-000-000-000\",\n} as const;\n\nexport type HmisProjectTypeKey = keyof typeof HmisProjectTypeKeys;\n\n/**\n * Key → positional code map for the `da_incident_severity` CVC domain.\n *\n * Domain: `da_incident_severity` · Version: 1.0.0 · Entries: 9\n */\nexport const DaIncidentSeverityKeys = {\n missingness_root: \"228-000-000-000-000-000-000\",\n unknown: \"228-000-000-000-000-000-001\",\n anonymous: \"228-000-000-000-000-000-002\",\n data_not_collected: \"228-000-000-000-000-000-003\",\n severity_1: \"228-001-000-000-000-000-000\",\n severity_2: \"228-002-000-000-000-000-000\",\n severity_3: \"228-003-000-000-000-000-000\",\n severity_4: \"228-004-000-000-000-000-000\",\n severity_5: \"228-005-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentSeverityKey = keyof typeof DaIncidentSeverityKeys;\n\n/**\n * Key → positional code map for the `exit_reasons` CVC domain.\n *\n * Domain: `exit_reasons` · Version: 1.0.0 · Entries: 23\n */\nexport const ExitReasonsKeys = {\n missingness_root: \"220-000-000-000-000-000-000\",\n unknown: \"220-000-000-000-000-000-001\",\n anonymous: \"220-000-000-000-000-000-002\",\n data_not_collected: \"220-000-000-000-000-000-003\",\n completed_program: \"220-001-000-000-000-000-000\",\n reached_maximum_allowed_stay: \"220-002-000-000-000-000-000\",\n transferred_to_another_program_internal: \"220-003-000-000-000-000-000\",\n transferred_to_another_program_external: \"220-004-000-000-000-000-000\",\n left_early_voluntarily: \"220-005-000-000-000-000-000\",\n exited_for_safety_survivor_initiated: \"220-006-000-000-000-000-000\",\n relocated_geographically: \"220-007-000-000-000-000-000\",\n exited_by_program_behavioral_violation: \"220-008-000-000-000-000-000\",\n exited_by_program_safety_to_others: \"220-009-000-000-000-000-000\",\n needs_beyond_program_scope: \"220-010-000-000-000-000-000\",\n health_related_exit: \"220-011-000-000-000-000-000\",\n placement_changed_by_authority: \"220-012-000-000-000-000-000\",\n deported: \"220-013-000-000-000-000-000\",\n recertification_lapsed: \"220-014-000-000-000-000-000\",\n program_ended: \"220-015-000-000-000-000-000\",\n lost_to_followup: \"220-016-000-000-000-000-000\",\n auto_exit_no_exit_interview: \"220-017-000-000-000-000-000\",\n deceased: \"220-018-000-000-000-000-000\",\n other: \"220-019-000-000-000-000-000\",\n} as const;\n\nexport type ExitReasonsKey = keyof typeof ExitReasonsKeys;\n\n/**\n * Key → positional code map for the `mid_stay_event_type` CVC domain.\n *\n * Domain: `mid_stay_event_type` · Version: 1.0.0 · Entries: 11\n */\nexport const MidStayEventTypeKeys = {\n missingness_root: \"221-000-000-000-000-000-000\",\n unknown: \"221-000-000-000-000-000-001\",\n anonymous: \"221-000-000-000-000-000-002\",\n data_not_collected: \"221-000-000-000-000-000-003\",\n room_transfer: \"221-001-000-000-000-000-000\",\n overnight_pass_approved: \"221-002-000-000-000-000-000\",\n bed_vacated_no_contact: \"221-003-000-000-000-000-000\",\n care_plan_review: \"221-004-000-000-000-000-000\",\n internal_referral: \"221-005-000-000-000-000-000\",\n safety_check_in: \"221-006-000-000-000-000-000\",\n other: \"221-007-000-000-000-000-000\",\n} as const;\n\nexport type MidStayEventTypeKey = keyof typeof MidStayEventTypeKeys;\n\n/**\n * Key → positional code map for the `pet_exit_reason` CVC domain.\n *\n * Domain: `pet_exit_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const PetExitReasonKeys = {\n missingness_root: \"222-000-000-000-000-000-000\",\n unknown: \"222-000-000-000-000-000-001\",\n anonymous: \"222-000-000-000-000-000-002\",\n data_not_collected: \"222-000-000-000-000-000-003\",\n permanent_placement: \"222-001-000-000-000-000-000\",\n survivor_exit: \"222-002-000-000-000-000-000\",\n alternative_care: \"222-003-000-000-000-000-000\",\n behavioral_incident: \"222-004-000-000-000-000-000\",\n health_issue: \"222-005-000-000-000-000-000\",\n other: \"222-006-000-000-000-000-000\",\n} as const;\n\nexport type PetExitReasonKey = keyof typeof PetExitReasonKeys;\n\n/**\n * Key → positional code map for the `funder` CVC domain.\n *\n * Domain: `funder` · Version: 1.0.0 · Entries: 12\n */\nexport const FunderKeys = {\n missingness_root: \"226-000-000-000-000-000-000\",\n unknown: \"226-000-000-000-000-000-001\",\n anonymous: \"226-000-000-000-000-000-002\",\n data_not_collected: \"226-000-000-000-000-000-003\",\n hud_coc: \"226-001-000-000-000-000-000\",\n hud_esg: \"226-002-000-000-000-000-000\",\n hhs_rhy: \"226-003-000-000-000-000-000\",\n hhs_path: \"226-004-000-000-000-000-000\",\n ovc_ecm: \"226-005-000-000-000-000-000\",\n voca: \"226-006-000-000-000-000-000\",\n fvpsa: \"226-007-000-000-000-000-000\",\n other: \"226-008-000-000-000-000-000\",\n} as const;\n\nexport type FunderKey = keyof typeof FunderKeys;\n\n/**\n * Key → positional code map for the `accommodation_type` CVC domain.\n *\n * Domain: `accommodation_type` · Version: 1.0.0 · Entries: 10\n */\nexport const AccommodationTypeKeys = {\n missingness_root: \"900-000-000-000-000-000-000\",\n unknown: \"900-000-000-000-000-000-001\",\n anonymous: \"900-000-000-000-000-000-002\",\n data_not_collected: \"900-000-000-000-000-000-003\",\n sensory: \"900-001-000-000-000-000-000\",\n mobility: \"900-002-000-000-000-000-000\",\n communication_cognitive: \"900-003-000-000-000-000-000\",\n medical_dietary: \"900-004-000-000-000-000-000\",\n service_animal: \"900-005-000-000-000-000-000\",\n other: \"900-006-000-000-000-000-000\",\n} as const;\n\nexport type AccommodationTypeKey = keyof typeof AccommodationTypeKeys;\n\n/**\n * Key → positional code map for the `action_step_completion_status` CVC domain.\n *\n * Domain: `action_step_completion_status` · Version: 1.0.0 · Entries: 8\n */\nexport const ActionStepCompletionStatusKeys = {\n missingness_root: \"901-000-000-000-000-000-000\",\n unknown: \"901-000-000-000-000-000-001\",\n anonymous: \"901-000-000-000-000-000-002\",\n data_not_collected: \"901-000-000-000-000-000-003\",\n yes: \"901-001-000-000-000-000-000\",\n no: \"901-002-000-000-000-000-000\",\n unknown_na: \"901-003-000-000-000-000-000\",\n unanswered: \"901-004-000-000-000-000-000\",\n} as const;\n\nexport type ActionStepCompletionStatusKey = keyof typeof ActionStepCompletionStatusKeys;\n\n/**\n * Key → positional code map for the `action_step_type` CVC domain.\n *\n * Domain: `action_step_type` · Version: 1.0.0 · Entries: 6\n */\nexport const ActionStepTypeKeys = {\n missingness_root: \"902-000-000-000-000-000-000\",\n unknown: \"902-000-000-000-000-000-001\",\n anonymous: \"902-000-000-000-000-000-002\",\n data_not_collected: \"902-000-000-000-000-000-003\",\n client_action: \"902-001-000-000-000-000-000\",\n advocate_action: \"902-002-000-000-000-000-000\",\n} as const;\n\nexport type ActionStepTypeKey = keyof typeof ActionStepTypeKeys;\n\n/**\n * Key → positional code map for the `announcement_audience_scope` CVC domain.\n *\n * Domain: `announcement_audience_scope` · Version: 1.0.0 · Entries: 7\n */\nexport const AnnouncementAudienceScopeKeys = {\n missingness_root: \"903-000-000-000-000-000-000\",\n unknown: \"903-000-000-000-000-000-001\",\n anonymous: \"903-000-000-000-000-000-002\",\n data_not_collected: \"903-000-000-000-000-000-003\",\n all: \"903-001-000-000-000-000-000\",\n role: \"903-002-000-000-000-000-000\",\n working_group: \"903-003-000-000-000-000-000\",\n} as const;\n\nexport type AnnouncementAudienceScopeKey = keyof typeof AnnouncementAudienceScopeKeys;\n\n/**\n * Key → positional code map for the `announcement_response_type` CVC domain.\n *\n * Domain: `announcement_response_type` · Version: 1.0.0 · Entries: 8\n */\nexport const AnnouncementResponseTypeKeys = {\n missingness_root: \"904-000-000-000-000-000-000\",\n unknown: \"904-000-000-000-000-000-001\",\n anonymous: \"904-000-000-000-000-000-002\",\n data_not_collected: \"904-000-000-000-000-000-003\",\n none: \"904-001-000-000-000-000-000\",\n acknowledge: \"904-002-000-000-000-000-000\",\n rsvp: \"904-003-000-000-000-000-000\",\n register: \"904-004-000-000-000-000-000\",\n} as const;\n\nexport type AnnouncementResponseTypeKey = keyof typeof AnnouncementResponseTypeKeys;\n\n/**\n * Key → positional code map for the `basis_quick_picks` CVC domain.\n *\n * Domain: `basis_quick_picks` · Version: 1.0.0 · Entries: 11\n */\nexport const BasisQuickPicksKeys = {\n missingness_root: \"905-000-000-000-000-000-000\",\n unknown: \"905-000-000-000-000-000-001\",\n anonymous: \"905-000-000-000-000-000-002\",\n data_not_collected: \"905-000-000-000-000-000-003\",\n client_disclosed_directly: \"905-001-000-000-000-000-000\",\n third_party_reported: \"905-002-000-000-000-000-000\",\n staff_observed: \"905-003-000-000-000-000-000\",\n provider_assessed: \"905-004-000-000-000-000-000\",\n record_document_reviewed: \"905-005-000-000-000-000-000\",\n public_source_online: \"905-006-000-000-000-000-000\",\n system_imported_machine_derived: \"905-007-000-000-000-000-000\",\n} as const;\n\nexport type BasisQuickPicksKey = keyof typeof BasisQuickPicksKeys;\n\n/**\n * Key → positional code map for the `check_in_activity` CVC domain.\n *\n * Domain: `check_in_activity` · Version: 1.0.0 · Entries: 24\n */\nexport const CheckInActivityKeys = {\n missingness_root: \"906-000-000-000-000-000-000\",\n unknown: \"906-000-000-000-000-000-001\",\n anonymous: \"906-000-000-000-000-000-002\",\n data_not_collected: \"906-000-000-000-000-000-003\",\n update_hope_plan: \"906-001-000-000-000-000-000\",\n review_update_safety_plan: \"906-002-000-000-000-000-000\",\n update_needs_assessment: \"906-003-000-000-000-000-000\",\n counseling_check_in: \"906-004-000-000-000-000-000\",\n prss_wellness_check_in: \"906-005-000-000-000-000-000\",\n medical_check_in: \"906-006-000-000-000-000-000\",\n housing_exit_plan_check_in: \"906-007-000-000-000-000-000\",\n offer_education_dv_sa_ht_stk: \"906-008-000-000-000-000-000\",\n schedule_next_meeting: \"906-009-000-000-000-000-000\",\n room_check: \"906-010-000-000-000-000-000\",\n pet_kennel_check: \"906-011-000-000-000-000-000\",\n boutique_essential_closet_visit: \"906-012-000-000-000-000-000\",\n transportation_request: \"906-013-000-000-000-000-000\",\n needs_financial_request: \"906-014-000-000-000-000-000\",\n review_confidentiality: \"906-015-000-000-000-000-000\",\n review_do_no_harm_agreement: \"906-016-000-000-000-000-000\",\n educate_guest_staff_rights: \"906-017-000-000-000-000-000\",\n complete_hope_scale: \"906-018-000-000-000-000-000\",\n set_soft_target_date: \"906-019-000-000-000-000-000\",\n other_activity: \"906-020-000-000-000-000-000\",\n} as const;\n\nexport type CheckInActivityKey = keyof typeof CheckInActivityKeys;\n\n/**\n * Key → positional code map for the `check_in_phase` CVC domain.\n *\n * Domain: `check_in_phase` · Version: 1.1.0 · Entries: 17\n */\nexport const CheckInPhaseKeys = {\n missingness_root: \"907-000-000-000-000-000-000\",\n unknown: \"907-000-000-000-000-000-001\",\n anonymous: \"907-000-000-000-000-000-002\",\n data_not_collected: \"907-000-000-000-000-000-003\",\n welcome_week: \"907-001-000-000-000-000-000\",\n phase_1_30d: \"907-002-000-000-000-000-000\",\n phase_2_60d: \"907-003-000-000-000-000-000\",\n phase_3_90d: \"907-004-000-000-000-000-000\",\n phase_4_120d_plus: \"907-005-000-000-000-000-000\",\n initial_intake: \"907-006-000-000-000-000-000\",\n routine_interval: \"907-007-000-000-000-000-000\",\n milestone_review: \"907-008-000-000-000-000-000\",\n crisis_response_followup: \"907-009-000-000-000-000-000\",\n pre_exit_review: \"907-010-000-000-000-000-000\",\n post_exit_followup: \"907-011-000-000-000-000-000\",\n phase_2_followup: \"907-012-000-000-000-000-000\",\n phase_3_followup: \"907-013-000-000-000-000-000\",\n} as const;\n\nexport type CheckInPhaseKey = keyof typeof CheckInPhaseKeys;\n\n/**\n * Key → positional code map for the `child_behavioral_concerns` CVC domain.\n *\n * Domain: `child_behavioral_concerns` · Version: 1.0.0 · Entries: 16\n */\nexport const ChildBehavioralConcernsKeys = {\n missingness_root: \"908-000-000-000-000-000-000\",\n unknown: \"908-000-000-000-000-000-001\",\n anonymous: \"908-000-000-000-000-000-002\",\n data_not_collected: \"908-000-000-000-000-000-003\",\n theft: \"908-001-000-000-000-000-000\",\n difficulty_making_friends: \"908-002-000-000-000-000-000\",\n withdrawn: \"908-003-000-000-000-000-000\",\n bed_wetting: \"908-004-000-000-000-000-000\",\n harming_animals: \"908-005-000-000-000-000-000\",\n fighting: \"908-006-000-000-000-000-000\",\n bullying_others: \"908-007-000-000-000-000-000\",\n being_bullied: \"908-008-000-000-000-000-000\",\n sexual_acting_out: \"908-009-000-000-000-000-000\",\n substance_use: \"908-010-000-000-000-000-000\",\n frequent_moves: \"908-011-000-000-000-000-000\",\n other: \"908-012-000-000-000-000-000\",\n} as const;\n\nexport type ChildBehavioralConcernsKey = keyof typeof ChildBehavioralConcernsKeys;\n\n/**\n * Key → positional code map for the `child_custody_arrangement` CVC domain.\n *\n * Domain: `child_custody_arrangement` · Version: 1.0.0 · Entries: 19\n */\nexport const ChildCustodyArrangementKeys = {\n missingness_root: \"910-000-000-000-000-000-000\",\n unknown: \"910-000-000-000-000-000-001\",\n anonymous: \"910-000-000-000-000-000-002\",\n data_not_collected: \"910-000-000-000-000-000-003\",\n court_ordered_sole_client: \"910-001-000-000-000-000-000\",\n court_ordered_sole_other: \"910-002-000-000-000-000-000\",\n court_ordered_shared: \"910-003-000-000-000-000-000\",\n voluntary_informal_client: \"910-004-000-000-000-000-000\",\n voluntary_informal_other: \"910-005-000-000-000-000-000\",\n shared_informal: \"910-006-000-000-000-000-000\",\n rights_surrendered_voluntary: \"910-007-000-000-000-000-000\",\n rights_terminated_court: \"910-008-000-000-000-000-000\",\n kinship_care: \"910-009-000-000-000-000-000\",\n foster_care: \"910-010-000-000-000-000-000\",\n adopted_out: \"910-011-000-000-000-000-000\",\n pending_legal_process: \"910-012-000-000-000-000-000\",\n unknown_status: \"910-013-000-000-000-000-000\",\n not_applicable: \"910-014-000-000-000-000-000\",\n other: \"910-015-000-000-000-000-000\",\n} as const;\n\nexport type ChildCustodyArrangementKey = keyof typeof ChildCustodyArrangementKeys;\n\n/**\n * Key → positional code map for the `da_incident_archive_reason` CVC domain.\n *\n * Domain: `da_incident_archive_reason` · Version: 1.0.0 · Entries: 8\n */\nexport const DaIncidentArchiveReasonKeys = {\n missingness_root: \"911-000-000-000-000-000-000\",\n unknown: \"911-000-000-000-000-000-001\",\n anonymous: \"911-000-000-000-000-000-002\",\n data_not_collected: \"911-000-000-000-000-000-003\",\n inaccurate: \"911-001-000-000-000-000-000\",\n duplicate: \"911-002-000-000-000-000-000\",\n captured_in_error: \"911-003-000-000-000-000-000\",\n survivor_retracted: \"911-004-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentArchiveReasonKey = keyof typeof DaIncidentArchiveReasonKeys;\n\n/**\n * Key → positional code map for the `da_incident_confidence` CVC domain.\n *\n * Domain: `da_incident_confidence` · Version: 1.0.0 · Entries: 7\n */\nexport const DaIncidentConfidenceKeys = {\n missingness_root: \"912-000-000-000-000-000-000\",\n unknown: \"912-000-000-000-000-000-001\",\n anonymous: \"912-000-000-000-000-000-002\",\n data_not_collected: \"912-000-000-000-000-000-003\",\n exact: \"912-001-000-000-000-000-000\",\n approximate: \"912-002-000-000-000-000-000\",\n uncertain: \"912-003-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentConfidenceKey = keyof typeof DaIncidentConfidenceKeys;\n\n/**\n * Key → positional code map for the `da_incident_day_approx` CVC domain.\n *\n * Domain: `da_incident_day_approx` · Version: 1.0.0 · Entries: 8\n */\nexport const DaIncidentDayApproxKeys = {\n missingness_root: \"913-000-000-000-000-000-000\",\n unknown: \"913-000-000-000-000-000-001\",\n anonymous: \"913-000-000-000-000-000-002\",\n data_not_collected: \"913-000-000-000-000-000-003\",\n early: \"913-001-000-000-000-000-000\",\n mid: \"913-002-000-000-000-000-000\",\n late: \"913-003-000-000-000-000-000\",\n unspecified: \"913-004-000-000-000-000-000\",\n} as const;\n\nexport type DaIncidentDayApproxKey = keyof typeof DaIncidentDayApproxKeys;\n\n/**\n * Key → positional code map for the `disability_subtype` CVC domain.\n *\n * Domain: `disability_subtype` · Version: 1.0.0 · Entries: 12\n */\nexport const DisabilitySubtypeKeys = {\n missingness_root: \"914-000-000-000-000-000-000\",\n unknown: \"914-000-000-000-000-000-001\",\n anonymous: \"914-000-000-000-000-000-002\",\n data_not_collected: \"914-000-000-000-000-000-003\",\n vision: \"914-001-000-000-000-000-000\",\n hearing: \"914-002-000-000-000-000-000\",\n speech: \"914-003-000-000-000-000-000\",\n cognitive_developmental: \"914-004-000-000-000-000-000\",\n physical: \"914-005-000-000-000-000-000\",\n mental: \"914-006-000-000-000-000-000\",\n other: \"914-007-000-000-000-000-000\",\n exists_but_type_unknown: \"914-008-000-000-000-000-000\",\n} as const;\n\nexport type DisabilitySubtypeKey = keyof typeof DisabilitySubtypeKeys;\n\n/**\n * Key → positional code map for the `discretion_level` CVC domain.\n *\n * Domain: `discretion_level` · Version: 1.0.0 · Entries: 8\n */\nexport const DiscretionLevelKeys = {\n missingness_root: \"915-000-000-000-000-000-000\",\n unknown: \"915-000-000-000-000-000-001\",\n anonymous: \"915-000-000-000-000-000-002\",\n data_not_collected: \"915-000-000-000-000-000-003\",\n full_disclosure: \"915-001-000-000-000-000-000\",\n discrete_message: \"915-002-000-000-000-000-000\",\n vsp_only_no_agency_name: \"915-003-000-000-000-000-000\",\n code_word_verification_required: \"915-004-000-000-000-000-000\",\n} as const;\n\nexport type DiscretionLevelKey = keyof typeof DiscretionLevelKeys;\n\n/**\n * Key → positional code map for the `emergency_contact_call_reason` CVC domain.\n *\n * Domain: `emergency_contact_call_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const EmergencyContactCallReasonKeys = {\n missingness_root: \"916-000-000-000-000-000-000\",\n unknown: \"916-000-000-000-000-000-001\",\n anonymous: \"916-000-000-000-000-000-002\",\n data_not_collected: \"916-000-000-000-000-000-003\",\n medical_incapacity: \"916-001-000-000-000-000-000\",\n safety_concern_survivor_missing: \"916-002-000-000-000-000-000\",\n child_emergency_client_unreachable: \"916-003-000-000-000-000-000\",\n logistics_children_pet_care_needed: \"916-004-000-000-000-000-000\",\n logistics_belongings_or_mail_pickup: \"916-005-000-000-000-000-000\",\n other: \"916-006-000-000-000-000-000\",\n} as const;\n\nexport type EmergencyContactCallReasonKey = keyof typeof EmergencyContactCallReasonKeys;\n\n/**\n * Key → positional code map for the `emergency_contact_permissions` CVC domain.\n *\n * Domain: `emergency_contact_permissions` · Version: 1.0.0 · Entries: 12\n */\nexport const EmergencyContactPermissionsKeys = {\n missingness_root: \"917-000-000-000-000-000-000\",\n unknown: \"917-000-000-000-000-000-001\",\n anonymous: \"917-000-000-000-000-000-002\",\n data_not_collected: \"917-000-000-000-000-000-003\",\n may_be_told_of_status: \"917-001-000-000-000-000-000\",\n may_receive_location: \"917-002-000-000-000-000-000\",\n may_pickup_children: \"917-003-000-000-000-000-000\",\n may_pickup_pets: \"917-004-000-000-000-000-000\",\n may_pickup_mail: \"917-005-000-000-000-000-000\",\n may_pickup_belongings: \"917-006-000-000-000-000-000\",\n may_act_on_clients_behalf_general: \"917-007-000-000-000-000-000\",\n may_make_medical_decisions: \"917-008-000-000-000-000-000\",\n} as const;\n\nexport type EmergencyContactPermissionsKey = keyof typeof EmergencyContactPermissionsKeys;\n\n/**\n * Key → positional code map for the `emergency_exit_cascade` CVC domain.\n *\n * Domain: `emergency_exit_cascade` · Version: 1.0.0 · Entries: 8\n */\nexport const EmergencyExitCascadeKeys = {\n missingness_root: \"918-000-000-000-000-000-000\",\n unknown: \"918-000-000-000-000-000-001\",\n anonymous: \"918-000-000-000-000-000-002\",\n data_not_collected: \"918-000-000-000-000-000-003\",\n safety_plan_updated: \"918-001-000-000-000-000-000\",\n emergency_contacts_notified: \"918-002-000-000-000-000-000\",\n destination_confidential: \"918-003-000-000-000-000-000\",\n risk_algo_reevaluated: \"918-004-000-000-000-000-000\",\n} as const;\n\nexport type EmergencyExitCascadeKey = keyof typeof EmergencyExitCascadeKeys;\n\n/**\n * Key → positional code map for the `exit_process_checklist_item` CVC domain.\n *\n * Domain: `exit_process_checklist_item` · Version: 1.0.0 · Entries: 15\n */\nexport const ExitProcessChecklistItemKeys = {\n missingness_root: \"919-000-000-000-000-000-000\",\n unknown: \"919-000-000-000-000-000-001\",\n anonymous: \"919-000-000-000-000-000-002\",\n data_not_collected: \"919-000-000-000-000-000-003\",\n discuss_exit_reasons: \"919-001-000-000-000-000-000\",\n locks_returned: \"919-002-000-000-000-000-000\",\n evaluation_form_sent: \"919-003-000-000-000-000-000\",\n forwarding_address_requested: \"919-004-000-000-000-000-000\",\n spiritual_care_offered: \"919-005-000-000-000-000-000\",\n schools_notified: \"919-006-000-000-000-000-000\",\n counselor_notified: \"919-007-000-000-000-000-000\",\n whiteboard_locker_erased: \"919-008-000-000-000-000-000\",\n team_discharge_informed: \"919-009-000-000-000-000-000\",\n room_turnover_form_completed: \"919-010-000-000-000-000-000\",\n other: \"919-011-000-000-000-000-000\",\n} as const;\n\nexport type ExitProcessChecklistItemKey = keyof typeof ExitProcessChecklistItemKeys;\n\n/**\n * Key → positional code map for the `facial_hair` CVC domain.\n *\n * Domain: `facial_hair` · Version: 1.0.0 · Entries: 6\n */\nexport const FacialHairKeys = {\n missingness_root: \"920-000-000-000-000-000-000\",\n unknown: \"920-000-000-000-000-000-001\",\n anonymous: \"920-000-000-000-000-000-002\",\n data_not_collected: \"920-000-000-000-000-000-003\",\n yes: \"920-001-000-000-000-000-000\",\n no: \"920-002-000-000-000-000-000\",\n} as const;\n\nexport type FacialHairKey = keyof typeof FacialHairKeys;\n\n/**\n * Key → positional code map for the `goal_category` CVC domain.\n *\n * Domain: `goal_category` · Version: 1.0.0 · Entries: 16\n */\nexport const GoalCategoryKeys = {\n missingness_root: \"921-000-000-000-000-000-000\",\n unknown: \"921-000-000-000-000-000-001\",\n anonymous: \"921-000-000-000-000-000-002\",\n data_not_collected: \"921-000-000-000-000-000-003\",\n basic_needs: \"921-001-000-000-000-000-000\",\n housing: \"921-002-000-000-000-000-000\",\n social_support_community_engagement: \"921-003-000-000-000-000-000\",\n transportation: \"921-004-000-000-000-000-000\",\n legal: \"921-005-000-000-000-000-000\",\n healthcare: \"921-006-000-000-000-000-000\",\n financial_and_employment: \"921-007-000-000-000-000-000\",\n informal_education_life_skills: \"921-008-000-000-000-000-000\",\n dependents: \"921-009-000-000-000-000-000\",\n case_coordination: \"921-010-000-000-000-000-000\",\n other_services: \"921-011-000-000-000-000-000\",\n safety: \"921-012-000-000-000-000-000\",\n} as const;\n\nexport type GoalCategoryKey = keyof typeof GoalCategoryKeys;\n\n/**\n * Key → positional code map for the `goal_priority` CVC domain.\n *\n * Domain: `goal_priority` · Version: 1.0.0 · Entries: 7\n */\nexport const GoalPriorityKeys = {\n missingness_root: \"922-000-000-000-000-000-000\",\n unknown: \"922-000-000-000-000-000-001\",\n anonymous: \"922-000-000-000-000-000-002\",\n data_not_collected: \"922-000-000-000-000-000-003\",\n high: \"922-001-000-000-000-000-000\",\n medium: \"922-002-000-000-000-000-000\",\n low: \"922-003-000-000-000-000-000\",\n} as const;\n\nexport type GoalPriorityKey = keyof typeof GoalPriorityKeys;\n\n/**\n * Key → positional code map for the `goal_status` CVC domain.\n *\n * Domain: `goal_status` · Version: 1.0.0 · Entries: 9\n */\nexport const GoalStatusKeys = {\n missingness_root: \"923-000-000-000-000-000-000\",\n unknown: \"923-000-000-000-000-000-001\",\n anonymous: \"923-000-000-000-000-000-002\",\n data_not_collected: \"923-000-000-000-000-000-003\",\n drafted: \"923-001-000-000-000-000-000\",\n in_progress: \"923-002-000-000-000-000-000\",\n on_hold: \"923-003-000-000-000-000-000\",\n completed: \"923-004-000-000-000-000-000\",\n withdrawn: \"923-005-000-000-000-000-000\",\n} as const;\n\nexport type GoalStatusKey = keyof typeof GoalStatusKeys;\n\n/**\n * Key → positional code map for the `goal_withdrawal_reason` CVC domain.\n *\n * Domain: `goal_withdrawal_reason` · Version: 1.0.0 · Entries: 11\n */\nexport const GoalWithdrawalReasonKeys = {\n missingness_root: \"924-000-000-000-000-000-000\",\n unknown: \"924-000-000-000-000-000-001\",\n anonymous: \"924-000-000-000-000-000-002\",\n data_not_collected: \"924-000-000-000-000-000-003\",\n client_changed_priorities: \"924-001-000-000-000-000-000\",\n no_longer_relevant: \"924-002-000-000-000-000-000\",\n external_barrier_insurmountable: \"924-003-000-000-000-000-000\",\n alternative_path_chosen: \"924-004-000-000-000-000-000\",\n insufficient_resources: \"924-005-000-000-000-000-000\",\n client_declined_to_specify: \"924-006-000-000-000-000-000\",\n other: \"924-007-000-000-000-000-000\",\n} as const;\n\nexport type GoalWithdrawalReasonKey = keyof typeof GoalWithdrawalReasonKeys;\n\n/**\n * Key → positional code map for the `hope_scale_capture_context` CVC domain.\n *\n * Domain: `hope_scale_capture_context` · Version: 1.0.0 · Entries: 11\n */\nexport const HopeScaleCaptureContextKeys = {\n missingness_root: \"926-000-000-000-000-000-000\",\n unknown: \"926-000-000-000-000-000-001\",\n anonymous: \"926-000-000-000-000-000-002\",\n data_not_collected: \"926-000-000-000-000-000-003\",\n welcome_week: \"926-001-000-000-000-000-000\",\n phase_1_checkin: \"926-002-000-000-000-000-000\",\n phase_2_checkin: \"926-003-000-000-000-000-000\",\n phase_3_checkin: \"926-004-000-000-000-000-000\",\n phase_4_checkin: \"926-005-000-000-000-000-000\",\n ad_hoc: \"926-006-000-000-000-000-000\",\n amendment: \"926-007-000-000-000-000-000\",\n} as const;\n\nexport type HopeScaleCaptureContextKey = keyof typeof HopeScaleCaptureContextKeys;\n\n/**\n * Key → positional code map for the `hope_scale_response_options` CVC domain.\n *\n * Domain: `hope_scale_response_options` · Version: 1.0.0 · Entries: 12\n */\nexport const HopeScaleResponseOptionsKeys = {\n missingness_root: \"927-000-000-000-000-000-000\",\n unknown: \"927-000-000-000-000-000-001\",\n anonymous: \"927-000-000-000-000-000-002\",\n data_not_collected: \"927-000-000-000-000-000-003\",\n definitely_false: \"927-001-000-000-000-000-000\",\n mostly_false: \"927-002-000-000-000-000-000\",\n somewhat_false: \"927-003-000-000-000-000-000\",\n slightly_false: \"927-004-000-000-000-000-000\",\n slightly_true: \"927-005-000-000-000-000-000\",\n somewhat_true: \"927-006-000-000-000-000-000\",\n mostly_true: \"927-007-000-000-000-000-000\",\n definitely_true: \"927-008-000-000-000-000-000\",\n} as const;\n\nexport type HopeScaleResponseOptionsKey = keyof typeof HopeScaleResponseOptionsKeys;\n\n/**\n * Key → positional code map for the `hope_scale_tier` CVC domain.\n *\n * Domain: `hope_scale_tier` · Version: 1.0.0 · Entries: 8\n */\nexport const HopeScaleTierKeys = {\n missingness_root: \"928-000-000-000-000-000-000\",\n unknown: \"928-000-000-000-000-000-001\",\n anonymous: \"928-000-000-000-000-000-002\",\n data_not_collected: \"928-000-000-000-000-000-003\",\n building: \"928-001-000-000-000-000-000\",\n hopeful: \"928-002-000-000-000-000-000\",\n moderately_hopeful: \"928-003-000-000-000-000-000\",\n high_hope: \"928-004-000-000-000-000-000\",\n} as const;\n\nexport type HopeScaleTierKey = keyof typeof HopeScaleTierKeys;\n\n/**\n * Key → positional code map for the `identification_status` CVC domain.\n *\n * Domain: `identification_status` · Version: 1.0.0 · Entries: 9\n */\nexport const IdentificationStatusKeys = {\n missingness_root: \"929-000-000-000-000-000-000\",\n unknown: \"929-000-000-000-000-000-001\",\n anonymous: \"929-000-000-000-000-000-002\",\n data_not_collected: \"929-000-000-000-000-000-003\",\n identified: \"929-001-000-000-000-000-000\",\n unidentified: \"929-002-000-000-000-000-000\",\n anonymous_posture: \"929-003-000-000-000-000-000\",\n estimated_persona: \"929-004-000-000-000-000-000\",\n confirmed: \"929-005-000-000-000-000-000\",\n} as const;\n\nexport type IdentificationStatusKey = keyof typeof IdentificationStatusKeys;\n\n/**\n * Key → positional code map for the `investigative_request_type` CVC domain.\n *\n * Domain: `investigative_request_type` · Version: 1.0.0 · Entries: 8\n */\nexport const InvestigativeRequestTypeKeys = {\n missingness_root: \"931-000-000-000-000-000-000\",\n unknown: \"931-000-000-000-000-000-001\",\n anonymous: \"931-000-000-000-000-000-002\",\n data_not_collected: \"931-000-000-000-000-000-003\",\n request_a_lead: \"931-001-000-000-000-000-000\",\n ask_about_a_network: \"931-002-000-000-000-000-000\",\n submit_case_info_for_buildout: \"931-003-000-000-000-000-000\",\n other: \"931-004-000-000-000-000-000\",\n} as const;\n\nexport type InvestigativeRequestTypeKey = keyof typeof InvestigativeRequestTypeKeys;\n\n/**\n * Key → positional code map for the `le_report_status` CVC domain.\n *\n * Domain: `le_report_status` · Version: 1.0.0 · Entries: 8\n */\nexport const LeReportStatusKeys = {\n missingness_root: \"932-000-000-000-000-000-000\",\n unknown: \"932-000-000-000-000-000-001\",\n anonymous: \"932-000-000-000-000-000-002\",\n data_not_collected: \"932-000-000-000-000-000-003\",\n yes_reported: \"932-001-000-000-000-000-000\",\n no_not_reported: \"932-002-000-000-000-000-000\",\n scheduled: \"932-003-000-000-000-000-000\",\n declined_to_report: \"932-004-000-000-000-000-000\",\n} as const;\n\nexport type LeReportStatusKey = keyof typeof LeReportStatusKeys;\n\n/**\n * Key → positional code map for the `legal_action_type` CVC domain.\n *\n * Domain: `legal_action_type` · Version: 1.0.0 · Entries: 11\n */\nexport const LegalActionTypeKeys = {\n missingness_root: \"933-000-000-000-000-000-000\",\n unknown: \"933-000-000-000-000-000-001\",\n anonymous: \"933-000-000-000-000-000-002\",\n data_not_collected: \"933-000-000-000-000-000-003\",\n continued_presence: \"933-001-000-000-000-000-000\",\n t_visa: \"933-002-000-000-000-000-000\",\n u_visa: \"933-003-000-000-000-000-000\",\n vawa_self_petition: \"933-004-000-000-000-000-000\",\n asylum: \"933-005-000-000-000-000-000\",\n sij: \"933-006-000-000-000-000-000\",\n other: \"933-007-000-000-000-000-000\",\n} as const;\n\nexport type LegalActionTypeKey = keyof typeof LegalActionTypeKeys;\n\n/**\n * Key → positional code map for the `message_report_reason` CVC domain.\n *\n * Domain: `message_report_reason` · Version: 1.0.0 · Entries: 10\n */\nexport const MessageReportReasonKeys = {\n missingness_root: \"935-000-000-000-000-000-000\",\n unknown: \"935-000-000-000-000-000-001\",\n anonymous: \"935-000-000-000-000-000-002\",\n data_not_collected: \"935-000-000-000-000-000-003\",\n inappropriate: \"935-001-000-000-000-000-000\",\n harassment: \"935-002-000-000-000-000-000\",\n safety_concern: \"935-003-000-000-000-000-000\",\n spam: \"935-004-000-000-000-000-000\",\n off_topic: \"935-005-000-000-000-000-000\",\n other: \"935-006-000-000-000-000-000\",\n} as const;\n\nexport type MessageReportReasonKey = keyof typeof MessageReportReasonKeys;\n\n/**\n * Key → positional code map for the `milestone_type` CVC domain.\n *\n * Domain: `milestone_type` · Version: 1.0.0 · Entries: 17\n */\nexport const MilestoneTypeKeys = {\n missingness_root: \"936-000-000-000-000-000-000\",\n unknown: \"936-000-000-000-000-000-001\",\n anonymous: \"936-000-000-000-000-000-002\",\n data_not_collected: \"936-000-000-000-000-000-003\",\n edu_grade_complete: \"936-001-000-000-000-000-000\",\n edu_ged_hs_diploma: \"936-002-000-000-000-000-000\",\n edu_higher_ed_degree: \"936-003-000-000-000-000-000\",\n edu_trade_school_degree: \"936-004-000-000-000-000-000\",\n obtained_employment: \"936-005-000-000-000-000-000\",\n received_housing_offer: \"936-006-000-000-000-000-000\",\n recovery_anniversary: \"936-007-000-000-000-000-000\",\n parenting_class_completed: \"936-008-000-000-000-000-000\",\n opened_bank_account: \"936-009-000-000-000-000-000\",\n baptism: \"936-010-000-000-000-000-000\",\n spiritual_decision: \"936-011-000-000-000-000-000\",\n baby_child_youth_dedication: \"936-012-000-000-000-000-000\",\n other: \"936-013-000-000-000-000-000\",\n} as const;\n\nexport type MilestoneTypeKey = keyof typeof MilestoneTypeKeys;\n\n/**\n * Key → positional code map for the `needs_residential_again` CVC domain.\n *\n * Domain: `needs_residential_again` · Version: 1.0.0 · Entries: 7\n */\nexport const NeedsResidentialAgainKeys = {\n missingness_root: \"937-000-000-000-000-000-000\",\n unknown: \"937-000-000-000-000-000-001\",\n anonymous: \"937-000-000-000-000-000-002\",\n data_not_collected: \"937-000-000-000-000-000-003\",\n yes: \"937-001-000-000-000-000-000\",\n no: \"937-002-000-000-000-000-000\",\n maybe: \"937-003-000-000-000-000-000\",\n} as const;\n\nexport type NeedsResidentialAgainKey = keyof typeof NeedsResidentialAgainKeys;\n\n/**\n * Key → positional code map for the `pet_relationship_basis` CVC domain.\n *\n * Domain: `pet_relationship_basis` · Version: 1.0.0 · Entries: 7\n */\nexport const PetRelationshipBasisKeys = {\n missingness_root: \"938-000-000-000-000-000-000\",\n unknown: \"938-000-000-000-000-000-001\",\n anonymous: \"938-000-000-000-000-000-002\",\n data_not_collected: \"938-000-000-000-000-000-003\",\n household_pet: \"938-001-000-000-000-000-000\",\n service_animal: \"938-002-000-000-000-000-000\",\n fostered: \"938-003-000-000-000-000-000\",\n} as const;\n\nexport type PetRelationshipBasisKey = keyof typeof PetRelationshipBasisKeys;\n\n/**\n * Key → positional code map for the `program_specific_code` CVC domain.\n *\n * Domain: `program_specific_code` · Version: 1.0.0 · Entries: 12\n */\nexport const ProgramSpecificCodeKeys = {\n missingness_root: \"940-000-000-000-000-000-000\",\n unknown: \"940-000-000-000-000-000-001\",\n anonymous: \"940-000-000-000-000-000-002\",\n data_not_collected: \"940-000-000-000-000-000-003\",\n tvap: \"940-001-000-000-000-000-000\",\n t_visa_legal_aid_program: \"940-002-000-000-000-000-000\",\n u_visa_legal_aid_program: \"940-003-000-000-000-000-000\",\n vawa_legal_aid_program: \"940-004-000-000-000-000-000\",\n asylum_legal_aid_program: \"940-005-000-000-000-000-000\",\n sij_legal_aid_program: \"940-006-000-000-000-000-000\",\n immigration_relief_program_other: \"940-007-000-000-000-000-000\",\n other: \"940-008-000-000-000-000-000\",\n} as const;\n\nexport type ProgramSpecificCodeKey = keyof typeof ProgramSpecificCodeKeys;\n\n/**\n * Key → positional code map for the `proof_of_id_type` CVC domain.\n *\n * Domain: `proof_of_id_type` · Version: 1.0.0 · Entries: 19\n */\nexport const ProofOfIdTypeKeys = {\n missingness_root: \"941-000-000-000-000-000-000\",\n unknown: \"941-000-000-000-000-000-001\",\n anonymous: \"941-000-000-000-000-000-002\",\n data_not_collected: \"941-000-000-000-000-000-003\",\n none: \"941-001-000-000-000-000-000\",\n passport_us: \"941-002-000-000-000-000-000\",\n drivers_license: \"941-003-000-000-000-000-000\",\n state_id: \"941-004-000-000-000-000-000\",\n military_id: \"941-005-000-000-000-000-000\",\n tribal_id: \"941-006-000-000-000-000-000\",\n uscis_document: \"941-007-000-000-000-000-000\",\n green_card: \"941-008-000-000-000-000-000\",\n foreign_passport: \"941-009-000-000-000-000-000\",\n foreign_national_id: \"941-010-000-000-000-000-000\",\n consular_id: \"941-011-000-000-000-000-000\",\n birth_certificate: \"941-012-000-000-000-000-000\",\n social_security_card: \"941-013-000-000-000-000-000\",\n school_id: \"941-014-000-000-000-000-000\",\n other: \"941-015-000-000-000-000-000\",\n} as const;\n\nexport type ProofOfIdTypeKey = keyof typeof ProofOfIdTypeKeys;\n\n/**\n * Key → positional code map for the `reference_link_type` CVC domain.\n *\n * Domain: `reference_link_type` · Version: 1.0.0 · Entries: 12\n */\nexport const ReferenceLinkTypeKeys = {\n missingness_root: \"942-000-000-000-000-000-000\",\n unknown: \"942-000-000-000-000-000-001\",\n anonymous: \"942-000-000-000-000-000-002\",\n data_not_collected: \"942-000-000-000-000-000-003\",\n case: \"942-001-000-000-000-000-000\",\n service: \"942-002-000-000-000-000-000\",\n working_group: \"942-003-000-000-000-000-000\",\n training: \"942-004-000-000-000-000-000\",\n agency: \"942-005-000-000-000-000-000\",\n share: \"942-006-000-000-000-000-000\",\n user: \"942-007-000-000-000-000-000\",\n thread: \"942-008-000-000-000-000-000\",\n} as const;\n\nexport type ReferenceLinkTypeKey = keyof typeof ReferenceLinkTypeKeys;\n\n/**\n * Key → positional code map for the `returned_to_abuser_status` CVC domain.\n *\n * Domain: `returned_to_abuser_status` · Version: 1.0.0 · Entries: 7\n */\nexport const ReturnedToAbuserStatusKeys = {\n missingness_root: \"944-000-000-000-000-000-000\",\n unknown: \"944-000-000-000-000-000-001\",\n anonymous: \"944-000-000-000-000-000-002\",\n data_not_collected: \"944-000-000-000-000-000-003\",\n yes: \"944-001-000-000-000-000-000\",\n no: \"944-002-000-000-000-000-000\",\n unanswered: \"944-003-000-000-000-000-000\",\n} as const;\n\nexport type ReturnedToAbuserStatusKey = keyof typeof ReturnedToAbuserStatusKeys;\n\n/**\n * Key → positional code map for the `rsvp_response` CVC domain.\n *\n * Domain: `rsvp_response` · Version: 1.0.0 · Entries: 7\n */\nexport const RsvpResponseKeys = {\n missingness_root: \"946-000-000-000-000-000-000\",\n unknown: \"946-000-000-000-000-000-001\",\n anonymous: \"946-000-000-000-000-000-002\",\n data_not_collected: \"946-000-000-000-000-000-003\",\n rsvp_yes: \"946-001-000-000-000-000-000\",\n rsvp_maybe: \"946-002-000-000-000-000-000\",\n rsvp_no: \"946-003-000-000-000-000-000\",\n} as const;\n\nexport type RsvpResponseKey = keyof typeof RsvpResponseKeys;\n\n/**\n * Key → positional code map for the `service_plan_closure_reason` CVC domain.\n *\n * Domain: `service_plan_closure_reason` · Version: 1.0.0 · Entries: 12\n */\nexport const ServicePlanClosureReasonKeys = {\n missingness_root: \"947-000-000-000-000-000-000\",\n unknown: \"947-000-000-000-000-000-001\",\n anonymous: \"947-000-000-000-000-000-002\",\n data_not_collected: \"947-000-000-000-000-000-003\",\n program_exit_goals_reached: \"947-001-000-000-000-000-000\",\n program_exit_incomplete: \"947-002-000-000-000-000-000\",\n transferred: \"947-003-000-000-000-000-000\",\n aged_out: \"947-004-000-000-000-000-000\",\n lost_contact: \"947-005-000-000-000-000-000\",\n survivor_withdrew: \"947-006-000-000-000-000-000\",\n agency_terminated: \"947-007-000-000-000-000-000\",\n other: \"947-008-000-000-000-000-000\",\n} as const;\n\nexport type ServicePlanClosureReasonKey = keyof typeof ServicePlanClosureReasonKeys;\n\n/**\n * Key → positional code map for the `service_plan_review_snooze_reason` CVC domain.\n *\n * Domain: `service_plan_review_snooze_reason` · Version: 1.0.0 · Entries: 11\n */\nexport const ServicePlanReviewSnoozeReasonKeys = {\n missingness_root: \"948-000-000-000-000-000-000\",\n unknown: \"948-000-000-000-000-000-001\",\n anonymous: \"948-000-000-000-000-000-002\",\n data_not_collected: \"948-000-000-000-000-000-003\",\n survivor_unreachable: \"948-001-000-000-000-000-000\",\n schedule_conflict: \"948-002-000-000-000-000-000\",\n survivor_traveling_or_out_of_contact: \"948-003-000-000-000-000-000\",\n advocate_caseload_spike: \"948-004-000-000-000-000-000\",\n safety_circumstance: \"948-005-000-000-000-000-000\",\n awaiting_information_from_external_party: \"948-006-000-000-000-000-000\",\n other: \"948-007-000-000-000-000-000\",\n} as const;\n\nexport type ServicePlanReviewSnoozeReasonKey = keyof typeof ServicePlanReviewSnoozeReasonKeys;\n\n/**\n * Key → positional code map for the `service_source` CVC domain.\n *\n * Domain: `service_source` · Version: 1.0.0 · Entries: 6\n */\nexport const ServiceSourceKeys = {\n missingness_root: \"949-000-000-000-000-000-000\",\n unknown: \"949-000-000-000-000-000-001\",\n anonymous: \"949-000-000-000-000-000-002\",\n data_not_collected: \"949-000-000-000-000-000-003\",\n your_program: \"949-001-000-000-000-000-000\",\n other_agency: \"949-002-000-000-000-000-000\",\n} as const;\n\nexport type ServiceSourceKey = keyof typeof ServiceSourceKeys;\n\n/**\n * Key → positional code map for the `severity_follow_up` CVC domain.\n *\n * Domain: `severity_follow_up` · Version: 1.0.0 · Entries: 8\n */\nexport const SeverityFollowUpKeys = {\n missingness_root: \"951-000-000-000-000-000-000\",\n unknown: \"951-000-000-000-000-000-001\",\n anonymous: \"951-000-000-000-000-000-002\",\n data_not_collected: \"951-000-000-000-000-000-003\",\n yes: \"951-001-000-000-000-000-000\",\n no: \"951-002-000-000-000-000-000\",\n client_doesnt_know: \"951-003-000-000-000-000-000\",\n prefer_not_to_answer: \"951-004-000-000-000-000-000\",\n} as const;\n\nexport type SeverityFollowUpKey = keyof typeof SeverityFollowUpKeys;\n\n/**\n * Key → positional code map for the `signature_method` CVC domain.\n *\n * Domain: `signature_method` · Version: 1.0.0 · Entries: 8\n */\nexport const SignatureMethodKeys = {\n missingness_root: \"952-000-000-000-000-000-000\",\n unknown: \"952-000-000-000-000-000-001\",\n anonymous: \"952-000-000-000-000-000-002\",\n data_not_collected: \"952-000-000-000-000-000-003\",\n digital_typed: \"952-001-000-000-000-000-000\",\n digital_drawn: \"952-002-000-000-000-000-000\",\n verbal_recorded: \"952-003-000-000-000-000-000\",\n written_scanned: \"952-004-000-000-000-000-000\",\n} as const;\n\nexport type SignatureMethodKey = keyof typeof SignatureMethodKeys;\n\n/**\n * Key → positional code map for the `signature_type` CVC domain.\n *\n * Domain: `signature_type` · Version: 1.0.0 · Entries: 8\n */\nexport const SignatureTypeKeys = {\n missingness_root: \"953-000-000-000-000-000-000\",\n unknown: \"953-000-000-000-000-000-001\",\n anonymous: \"953-000-000-000-000-000-002\",\n data_not_collected: \"953-000-000-000-000-000-003\",\n client_at_creation: \"953-001-000-000-000-000-000\",\n advocate_at_creation: \"953-002-000-000-000-000-000\",\n client_at_completion: \"953-003-000-000-000-000-000\",\n advocate_at_completion: \"953-004-000-000-000-000-000\",\n} as const;\n\nexport type SignatureTypeKey = keyof typeof SignatureTypeKeys;\n\n/**\n * Key → positional code map for the `smt_body_location` CVC domain.\n *\n * Domain: `smt_body_location` · Version: 1.0.0 · Entries: 33\n */\nexport const SmtBodyLocationKeys = {\n missingness_root: \"954-000-000-000-000-000-000\",\n unknown: \"954-000-000-000-000-000-001\",\n anonymous: \"954-000-000-000-000-000-002\",\n data_not_collected: \"954-000-000-000-000-000-003\",\n head: \"954-001-000-000-000-000-000\",\n face: \"954-002-000-000-000-000-000\",\n scalp: \"954-003-000-000-000-000-000\",\n neck: \"954-004-000-000-000-000-000\",\n ear_l: \"954-005-000-000-000-000-000\",\n ear_r: \"954-006-000-000-000-000-000\",\n chest: \"954-007-000-000-000-000-000\",\n back: \"954-008-000-000-000-000-000\",\n abdomen: \"954-009-000-000-000-000-000\",\n shoulder_l: \"954-010-000-000-000-000-000\",\n shoulder_r: \"954-011-000-000-000-000-000\",\n arm_l: \"954-012-000-000-000-000-000\",\n arm_r: \"954-013-000-000-000-000-000\",\n wrist_l: \"954-014-000-000-000-000-000\",\n wrist_r: \"954-015-000-000-000-000-000\",\n hand_l: \"954-016-000-000-000-000-000\",\n hand_r: \"954-017-000-000-000-000-000\",\n finger_l: \"954-018-000-000-000-000-000\",\n finger_r: \"954-019-000-000-000-000-000\",\n leg_l: \"954-020-000-000-000-000-000\",\n leg_r: \"954-021-000-000-000-000-000\",\n ankle_l: \"954-022-000-000-000-000-000\",\n ankle_r: \"954-023-000-000-000-000-000\",\n foot_l: \"954-024-000-000-000-000-000\",\n foot_r: \"954-025-000-000-000-000-000\",\n hip_l: \"954-026-000-000-000-000-000\",\n hip_r: \"954-027-000-000-000-000-000\",\n buttocks: \"954-028-000-000-000-000-000\",\n other: \"954-029-000-000-000-000-000\",\n} as const;\n\nexport type SmtBodyLocationKey = keyof typeof SmtBodyLocationKeys;\n\n/**\n * Key → positional code map for the `smt_name_relation` CVC domain.\n *\n * Domain: `smt_name_relation` · Version: 1.0.0 · Entries: 11\n */\nexport const SmtNameRelationKeys = {\n missingness_root: \"955-000-000-000-000-000-000\",\n unknown: \"955-000-000-000-000-000-001\",\n anonymous: \"955-000-000-000-000-000-002\",\n data_not_collected: \"955-000-000-000-000-000-003\",\n self: \"955-001-000-000-000-000-000\",\n child: \"955-002-000-000-000-000-000\",\n partner: \"955-003-000-000-000-000-000\",\n other_family: \"955-004-000-000-000-000-000\",\n trafficker: \"955-005-000-000-000-000-000\",\n deceased: \"955-006-000-000-000-000-000\",\n other_relation: \"955-007-000-000-000-000-000\",\n} as const;\n\nexport type SmtNameRelationKey = keyof typeof SmtNameRelationKeys;\n\n/**\n * Key → positional code map for the `smt_significance_flags` CVC domain.\n *\n * Domain: `smt_significance_flags` · Version: 1.0.0 · Entries: 11\n */\nexport const SmtSignificanceFlagsKeys = {\n missingness_root: \"956-000-000-000-000-000-000\",\n unknown: \"956-000-000-000-000-000-001\",\n anonymous: \"956-000-000-000-000-000-002\",\n data_not_collected: \"956-000-000-000-000-000-003\",\n gang: \"956-001-000-000-000-000-000\",\n trafficking: \"956-002-000-000-000-000-000\",\n name: \"956-003-000-000-000-000-000\",\n memorial: \"956-004-000-000-000-000-000\",\n religious_cultural: \"956-005-000-000-000-000-000\",\n other: \"956-006-000-000-000-000-000\",\n none_non_specific: \"956-007-000-000-000-000-000\",\n} as const;\n\nexport type SmtSignificanceFlagsKey = keyof typeof SmtSignificanceFlagsKeys;\n\n/**\n * Key → positional code map for the `substance_use_status` CVC domain.\n *\n * Domain: `substance_use_status` · Version: 1.0.0 · Entries: 8\n */\nexport const SubstanceUseStatusKeys = {\n missingness_root: \"958-000-000-000-000-000-000\",\n unknown: \"958-000-000-000-000-000-001\",\n anonymous: \"958-000-000-000-000-000-002\",\n data_not_collected: \"958-000-000-000-000-000-003\",\n no: \"958-001-000-000-000-000-000\",\n alcohol: \"958-002-000-000-000-000-000\",\n drug: \"958-003-000-000-000-000-000\",\n both: \"958-004-000-000-000-000-000\",\n} as const;\n\nexport type SubstanceUseStatusKey = keyof typeof SubstanceUseStatusKeys;\n\n/**\n * Key → positional code map for the `support_topic` CVC domain.\n *\n * Domain: `support_topic` · Version: 1.0.0 · Entries: 11\n */\nexport const SupportTopicKeys = {\n missingness_root: \"959-000-000-000-000-000-000\",\n unknown: \"959-000-000-000-000-000-001\",\n anonymous: \"959-000-000-000-000-000-002\",\n data_not_collected: \"959-000-000-000-000-000-003\",\n how_to_use_platform: \"959-001-000-000-000-000-000\",\n something_broken: \"959-002-000-000-000-000-000\",\n data_record_issue: \"959-003-000-000-000-000-000\",\n account_access: \"959-004-000-000-000-000-000\",\n request_training: \"959-005-000-000-000-000-000\",\n feature_request: \"959-006-000-000-000-000-000\",\n other: \"959-007-000-000-000-000-000\",\n} as const;\n\nexport type SupportTopicKey = keyof typeof SupportTopicKeys;\n\n/**\n * Key → positional code map for the `thread_status` CVC domain.\n *\n * Domain: `thread_status` · Version: 1.0.0 · Entries: 7\n */\nexport const ThreadStatusKeys = {\n missingness_root: \"960-000-000-000-000-000-000\",\n unknown: \"960-000-000-000-000-000-001\",\n anonymous: \"960-000-000-000-000-000-002\",\n data_not_collected: \"960-000-000-000-000-000-003\",\n open: \"960-001-000-000-000-000-000\",\n resolved: \"960-002-000-000-000-000-000\",\n archived: \"960-003-000-000-000-000-000\",\n} as const;\n\nexport type ThreadStatusKey = keyof typeof ThreadStatusKeys;\n\n/**\n * Key → positional code map for the `thread_type` CVC domain.\n *\n * Domain: `thread_type` · Version: 1.0.0 · Entries: 9\n */\nexport const ThreadTypeKeys = {\n missingness_root: \"961-000-000-000-000-000-000\",\n unknown: \"961-000-000-000-000-000-001\",\n anonymous: \"961-000-000-000-000-000-002\",\n data_not_collected: \"961-000-000-000-000-000-003\",\n support: \"961-001-000-000-000-000-000\",\n community_partner: \"961-002-000-000-000-000-000\",\n working_group: \"961-003-000-000-000-000-000\",\n announcement: \"961-004-000-000-000-000-000\",\n investigative_request: \"961-005-000-000-000-000-000\",\n} as const;\n\nexport type ThreadTypeKey = keyof typeof ThreadTypeKeys;\n\n/**\n * Key → positional code map for the `living_situation` CVC domain.\n *\n * Domain: `living_situation` · Version: 1.0.0 · Entries: 22\n */\nexport const LivingSituationKeys = {\n missingness_root: \"192-000-000-000-000-000-000\",\n unknown: \"192-000-000-000-000-000-001\",\n anonymous: \"192-000-000-000-000-000-002\",\n data_not_collected: \"192-000-000-000-000-000-003\",\n unsheltered: \"192-001-000-000-000-000-000\",\n emergency_shelter: \"192-002-000-000-000-000-000\",\n safe_haven: \"192-003-000-000-000-000-000\",\n dv_shelter_safe_house: \"192-004-000-000-000-000-000\",\n homeless_unspecified: \"192-005-000-000-000-000-000\",\n hospital_medical: \"192-006-000-000-000-000-000\",\n psychiatric_residential_facility: \"192-007-000-000-000-000-000\",\n substance_use_treatment_residential: \"192-008-000-000-000-000-000\",\n incarcerated: \"192-009-000-000-000-000-000\",\n cw_foster_care: \"192-010-000-000-000-000-000\",\n cw_kinship: \"192-011-000-000-000-000-000\",\n long_term_care: \"192-012-000-000-000-000-000\",\n transitional_housing_program: \"192-013-000-000-000-000-000\",\n temp_housing_program: \"192-014-000-000-000-000-000\",\n hotel_motel_non_shelter: \"192-015-000-000-000-000-000\",\n own_rent: \"192-016-000-000-000-000-000\",\n with_family_friends: \"192-017-000-000-000-000-000\",\n other: \"192-018-000-000-000-000-000\",\n} as const;\n\nexport type LivingSituationKey = keyof typeof LivingSituationKeys;\n\n/**\n * Key → positional code map for the `service_audience` CVC domain.\n *\n * Domain: `service_audience` · Version: 1.0.0 · Entries: 9\n */\nexport const ServiceAudienceKeys = {\n missingness_root: \"045-000-000-000-000-000-000\",\n unknown: \"045-000-000-000-000-000-001\",\n anonymous: \"045-000-000-000-000-000-002\",\n data_not_collected: \"045-000-000-000-000-000-003\",\n primary_victim: \"045-001-000-000-000-000-000\",\n eligible_family_member: \"045-002-000-000-000-000-000\",\n third_party: \"045-003-000-000-000-000-000\",\n offender: \"045-004-000-000-000-000-000\",\n personnel: \"045-005-000-000-000-000-000\",\n} as const;\n\nexport type ServiceAudienceKey = keyof typeof ServiceAudienceKeys;\n\n/**\n * Key → positional code map for the `hmis_relationship_to_hoh` CVC domain.\n *\n * Domain: `hmis_relationship_to_hoh` · Version: 1.0.0 · Entries: 9\n */\nexport const HmisRelationshipToHohKeys = {\n missingness_root: \"129-000-000-000-000-000-000\",\n unknown: \"129-000-000-000-000-000-001\",\n anonymous: \"129-000-000-000-000-000-002\",\n data_not_collected: \"129-000-000-000-000-000-003\",\n self_hoh: \"129-001-000-000-000-000-000\",\n child_of_hoh: \"129-002-000-000-000-000-000\",\n spouse_or_partner_of_hoh: \"129-003-000-000-000-000-000\",\n other_relative_of_hoh: \"129-004-000-000-000-000-000\",\n non_relation_member: \"129-005-000-000-000-000-000\",\n} as const;\n\nexport type HmisRelationshipToHohKey = keyof typeof HmisRelationshipToHohKeys;\n\n/**\n * Key → positional code map for the `victim_abuse_types` CVC domain.\n *\n * Domain: `victim_abuse_types` · Version: 1.1.0 · Entries: 30\n */\nexport const VictimAbuseTypesKeys = {\n arson: \"073-003-000-000-000-000-000\",\n bullying: \"073-004-000-000-000-000-000\",\n burglary: \"073-005-000-000-000-000-000\",\n child_pornography: \"073-007-000-000-000-000-000\",\n domestic_family_violence: \"073-009-000-000-000-000-000\",\n dui_dwi_incident: \"073-010-000-000-000-000-000\",\n elder_abuse_or_neglect: \"073-011-000-000-000-000-000\",\n gang_violence: \"073-012-000-000-000-000-000\",\n hate_crime: \"073-013-000-000-000-000-000\",\n homicide: \"073-014-000-000-000-000-000\",\n identity_theft_fraud_financial_crime: \"073-015-000-000-000-000-000\",\n kidnapping_custodial: \"073-016-000-000-000-000-000\",\n kidnapping_noncustodial: \"073-017-000-000-000-000-000\",\n mass_violence: \"073-018-000-000-000-000-000\",\n other_voca_ovc: \"073-019-000-000-000-000-000\",\n other_vehicular_victimization: \"073-020-000-000-000-000-000\",\n robbery: \"073-021-000-000-000-000-000\",\n stalking_harassment: \"073-022-000-000-000-000-000\",\n survivor_of_homicide_victim: \"073-023-000-000-000-000-000\",\n teen_dating_victimization: \"073-024-000-000-000-000-000\",\n terrorism: \"073-025-000-000-000-000-000\",\n sexual_abuse_assault: \"073-026-000-000-000-000-000\",\n physical_abuse_or_neglect: \"073-027-000-000-000-000-000\",\n physical_assault: \"073-028-000-000-000-000-000\",\n commercial_sexual_exploitation_minor: \"073-029-000-000-000-000-000\",\n sexual_exploitation: \"073-030-000-000-000-000-000\",\n labor_exploitation: \"073-031-000-000-000-000-000\",\n female_genital_mutilation_cutting: \"073-032-000-000-000-000-000\",\n forced_marriage: \"073-033-000-000-000-000-000\",\n cyber_crimes: \"073-034-000-000-000-000-000\",\n} as const;\n\nexport type VictimAbuseTypesKey = keyof typeof VictimAbuseTypesKeys;\n\n/**\n * Key → positional code map for the `ht_type` CVC domain.\n *\n * Domain: `ht_type` · Version: 1.0.0 · Entries: 8\n */\nexport const HtTypeKeys = {\n missingness_root: \"072-000-000-000-000-000-000\",\n unknown: \"072-000-000-000-000-000-001\",\n anonymous: \"072-000-000-000-000-000-002\",\n data_not_collected: \"072-000-000-000-000-000-003\",\n sex: \"072-001-000-000-000-000-000\",\n labor: \"072-002-000-000-000-000-000\",\n sex_and_labor: \"072-003-000-000-000-000-000\",\n none: \"072-004-000-000-000-000-000\",\n} as const;\n\nexport type HtTypeKey = keyof typeof HtTypeKeys;\n\n/**\n * Key → positional code map for the `relationship_concern` CVC domain (PROVISIONAL CVC-991 — pending codebook ratification; renumbered from provisional 231 on CVC-231's ratification to the Determination Helper categories, 2026-08-28).\n *\n * Domain: `relationship_concern` · Version: 1.1.0 · Entries: 11\n */\nexport const RelationshipConcernKeys = {\n missingness_root: \"991-000-000-000-000-000-000\",\n unknown: \"991-000-000-000-000-000-001\",\n anonymous: \"991-000-000-000-000-000-002\",\n data_not_collected: \"991-000-000-000-000-000-003\",\n appears_controlling: \"991-001-000-000-000-000-000\",\n is_much_older: \"991-002-000-000-000-000-000\",\n physically_abusive: \"991-003-000-000-000-000-000\",\n emotionally_abusive: \"991-004-000-000-000-000-000\",\n has_legal_involvement: \"991-005-000-000-000-000-000\",\n is_known_trafficker_or_suspect: \"991-006-000-000-000-000-000\",\n other_concern: \"991-007-000-000-000-000-000\",\n} as const;\n\nexport type RelationshipConcernKey = keyof typeof RelationshipConcernKeys;\n\n/**\n * Key → positional code map for the `recency_band` CVC domain (PROVISIONAL CVC-232 — pending codebook ratification).\n *\n * Domain: `recency_band` · Version: 1.0.0 · Entries: 12\n */\nexport const RecencyBandKeys = {\n missingness_root: \"137-000-000-000-000-000-000\",\n unknown: \"137-000-000-000-000-000-001\",\n anonymous: \"137-000-000-000-000-000-002\",\n data_not_collected: \"137-000-000-000-000-000-003\",\n w3m: \"137-001-000-000-000-000-000\",\n m3_6: \"137-002-000-000-000-000-000\",\n m6_12: \"137-003-000-000-000-000-000\",\n y1p: \"137-004-000-000-000-000-000\",\n y1_3: \"137-005-000-000-000-000-000\",\n y3_10: \"137-006-000-000-000-000-000\",\n y10p: \"137-007-000-000-000-000-000\",\n ylt3: \"137-008-000-000-000-000-000\",\n} as const;\n\nexport type RecencyBandKey = keyof typeof RecencyBandKeys;\n\n/**\n * Key → positional code map for the `housing_subsidy_types` CVC domain (CVC-194 `core - housing subsidy types`, IC-73; SOT v2.0.0 re-synced to the live Notion codebook, CVC194-AUDIT). HUD's dependent subsidy-type field (asked only when living situation / destination = 435): the eleven HUD FY2026 list 3.12.A responses + the HTI `other_housing_subsidy` (OTHER) extension + the UNK / ANON / DNC triplet. Each codebook row carries its Notion Code on `canonicalCode` and its 3.12.A value on `hmisCode`; `data_not_collected` is system-stamped only (`neverPickable`). `no_subsidy` is NOT a codebook row: kept live for the needs-assessment subsidy question pending Crysta's ruling (no `canonicalCode`, no HUD value). 2.0.0 REMOVED `project_based_rental_assistance` (194-003 retired, no successor; see `housingSubsidyTypesSot._supersedes`).\n *\n * Domain: `housing_subsidy_types` · Version: 2.0.0 · Entries: 17\n */\nexport const HousingSubsidyTypesKeys = {\n missingness_root: \"194-000-000-000-000-000-000\",\n unknown: \"194-000-000-000-000-000-001\",\n anonymous: \"194-000-000-000-000-000-002\",\n data_not_collected: \"194-000-000-000-000-000-003\",\n housing_choice_voucher: \"194-001-000-000-000-000-000\",\n public_housing: \"194-002-000-000-000-000-000\",\n permanent_supportive_housing: \"194-004-000-000-000-000-000\",\n rapid_rehousing_assistance: \"194-005-000-000-000-000-000\",\n other_housing_subsidy: \"194-006-000-000-000-000-000\",\n no_subsidy: \"194-007-000-000-000-000-000\",\n va_supportive_housing: \"194-008-000-000-000-000-000\",\n grant_per_diem_transition_in_place: \"194-009-000-000-000-000-000\",\n housing_stability_voucher: \"194-010-000-000-000-000-000\",\n family_unification_program: \"194-011-000-000-000-000-000\",\n foster_youth_to_independence: \"194-012-000-000-000-000-000\",\n other_rental_subsidy: \"194-013-000-000-000-000-000\",\n other_formerly_homeless: \"194-014-000-000-000-000-000\",\n} as const;\n\nexport type HousingSubsidyTypesKey = keyof typeof HousingSubsidyTypesKeys;\n\n/**\n * Key → positional code map for the `assertion_domain` CVC domain (CAR assertion domain; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `assertion_domain` · Version: 1.2.3 · Entries: 77\n */\nexport const AssertionDomainKeys = {\n missingness_root: \"159-000-000-000-000-000-000\",\n unknown: \"159-000-000-000-000-000-001\",\n anonymous: \"159-000-000-000-000-000-002\",\n data_not_collected: \"159-000-000-000-000-000-003\",\n indicator: \"159-001-000-000-000-000-000\",\n risk_signal: \"159-002-000-000-000-000-000\",\n victim_status: \"159-003-000-000-000-000-000\",\n offender_status: \"159-004-000-000-000-000-000\",\n domain_determination: \"159-005-000-000-000-000-000\",\n victimization_or_abuse_type: \"159-006-000-000-000-000-000\",\n assessment_scale: \"159-007-000-000-000-000-000\",\n recommended_followup: \"159-008-000-000-000-000-000\",\n relationship: \"159-009-000-000-000-000-000\",\n household_relationships: \"159-010-000-000-000-000-000\",\n relationship_tie: \"159-011-000-000-000-000-000\",\n relationship_dynamics: \"159-012-000-000-000-000-000\",\n relationship_status_current: \"159-013-000-000-000-000-000\",\n marital_status_legal: \"159-014-000-000-000-000-000\",\n core_profile: \"159-015-000-000-000-000-000\",\n person_tile: \"159-016-000-000-000-000-000\",\n person_relationship: \"159-017-000-000-000-000-000\",\n relevant_people: \"159-018-000-000-000-000-000\",\n name: \"159-019-000-000-000-000-000\",\n contact_info: \"159-020-000-000-000-000-000\",\n address: \"159-021-000-000-000-000-000\",\n vehicle: \"159-022-000-000-000-000-000\",\n income_history: \"159-023-000-000-000-000-000\",\n physical_description: \"159-024-000-000-000-000-000\",\n living_situation: \"159-025-000-000-000-000-000\",\n pet: \"159-026-000-000-000-000-000\",\n protection_order: \"159-027-000-000-000-000-000\",\n log_entry: \"159-028-000-000-000-000-000\",\n session_note: \"159-029-000-000-000-000-000\",\n referral_source: \"159-030-000-000-000-000-000\",\n org_directory: \"159-031-000-000-000-000-000\",\n person_directory: \"159-032-000-000-000-000-000\",\n service_delivery: \"159-033-000-000-000-000-000\",\n needs_assessment: \"159-034-000-000-000-000-000\",\n priorities_and_safety: \"159-035-000-000-000-000-000\",\n share: \"159-036-000-000-000-000-000\",\n roi: \"159-037-000-000-000-000-000\",\n external_recipient: \"159-038-000-000-000-000-000\",\n access_accommodations: \"159-039-000-000-000-000-000\",\n danger_assessment: \"159-040-000-000-000-000-000\",\n hope_scale: \"159-041-000-000-000-000-000\",\n injury_and_strangulation: \"159-042-000-000-000-000-000\",\n lethality_assessment_program: \"159-043-000-000-000-000-000\",\n occupational_background: \"159-044-000-000-000-000-000\",\n program_enrollment: \"159-046-000-000-000-000-000\",\n program_enrollment_exit_wizard: \"159-047-000-000-000-000-000\",\n goal: \"159-048-000-000-000-000-000\",\n action_step: \"159-049-000-000-000-000-000\",\n milestone: \"159-050-000-000-000-000-000\",\n check_in: \"159-051-000-000-000-000-000\",\n goal_signature: \"159-052-000-000-000-000-000\",\n subject_functional_role: \"159-053-000-000-000-000-000\",\n worker_subrole: \"159-054-000-000-000-000-000\",\n offender_status_family: \"159-055-000-000-000-000-000\",\n assessment_rating: \"159-056-000-000-000-000-000\",\n immigration_legal_status: \"159-057-000-000-000-000-000\",\n persons_network: \"159-058-000-000-000-000-000\",\n lifecycle_services: \"159-059-000-000-000-000-000\",\n juvenile_justice_involvement: \"159-060-000-000-000-000-000\",\n child_welfare_involvement: \"159-061-000-000-000-000-000\",\n facilitator_role: \"159-062-000-000-000-000-000\",\n facilitator_subrole: \"159-063-000-000-000-000-000\",\n facilitator_entity_type: \"159-064-000-000-000-000-000\",\n child_profile: \"159-065-000-000-000-000-000\",\n signal_identification: \"159-066-000-000-000-000-000\",\n investigative_legal: \"159-067-000-000-000-000-000\",\n age_reporting: \"159-068-000-000-000-000-000\",\n race_ethnicity_reporting: \"159-069-000-000-000-000-000\",\n gender_reporting: \"159-070-000-000-000-000-000\",\n disability_reporting: \"159-071-000-000-000-000-000\",\n veteran_status: \"159-072-000-000-000-000-000\",\n english_proficiency: \"159-073-000-000-000-000-000\",\n birth_country_reporting: \"159-074-000-000-000-000-000\",\n} as const;\n\nexport type AssertionDomainKey = keyof typeof AssertionDomainKeys;\n\n/**\n * Key → positional code map for the `race_ethnicity_reporting` CVC domain (CVC-37 VOCA/OVC race/ethnicity list and its CVC-76 crosswalk; since 2026-11-10 no longer the `race_ethnicity_reporting` claim’s vocabulary — the claim stores the CVC-76 Level-1 codes).\n *\n * Domain: `race_ethnicity_reporting` · Version: 1.0.1 · Entries: 10\n */\nexport const RaceEthnicityReportingKeys = {\n missingness_root: \"037-000-000-000-000-000-000\",\n not_reported: \"037-000-000-000-000-000-001\",\n american_indian_alaska_native: \"037-001-000-000-000-000-000\",\n asian: \"037-002-000-000-000-000-000\",\n black_african_american: \"037-003-000-000-000-000-000\",\n hispanic_latino: \"037-004-000-000-000-000-000\",\n native_hawaiian_pacific_islander: \"037-005-000-000-000-000-000\",\n white: \"037-006-000-000-000-000-000\",\n some_other_race: \"037-007-000-000-000-000-000\",\n multiple_races: \"037-008-000-000-000-000-000\",\n} as const;\n\nexport type RaceEthnicityReportingKey = keyof typeof RaceEthnicityReportingKeys;\n\n/**\n * Key → positional code map for the `veteran_status` CVC domain (CVC-98; demographic reporting rung, 2026-10-30).\n *\n * Domain: `veteran_status` · Version: 1.0.0 · Entries: 6\n */\nexport const VeteranStatusKeys = {\n missingness_root: \"098-000-000-000-000-000-000\",\n unknown: \"098-000-000-000-000-000-001\",\n anonymous: \"098-000-000-000-000-000-002\",\n data_not_collected: \"098-000-000-000-000-000-003\",\n yes: \"098-001-000-000-000-000-000\",\n no: \"098-002-000-000-000-000-000\",\n} as const;\n\nexport type VeteranStatusKey = keyof typeof VeteranStatusKeys;\n\n/**\n * Key → positional code map for the `english_proficiency` CVC domain (CVC-99; demographic reporting rung, 2026-10-30).\n *\n * Domain: `english_proficiency` · Version: 1.0.0 · Entries: 9\n */\nexport const EnglishProficiencyKeys = {\n missingness_root: \"099-000-000-000-000-000-000\",\n unknown: \"099-000-000-000-000-000-001\",\n anon: \"099-000-000-000-000-000-002\",\n dnc: \"099-000-000-000-000-000-003\",\n none: \"099-001-000-000-000-000-000\",\n elementary: \"099-002-000-000-000-000-000\",\n limited_working: \"099-003-000-000-000-000-000\",\n professional: \"099-004-000-000-000-000-000\",\n native_fluent: \"099-005-000-000-000-000-000\",\n} as const;\n\nexport type EnglishProficiencyKey = keyof typeof EnglishProficiencyKeys;\n\n/**\n * Key → positional code map for the `general_disability` CVC domain (CVC-107; demographic reporting rung, 2026-10-30).\n *\n * Domain: `general_disability` · Version: 1.0.1 · Entries: 6\n */\nexport const GeneralDisabilityKeys = {\n missingness_root: \"107-000-000-000-000-000-000\",\n unknown: \"107-000-000-000-000-000-001\",\n anonymous: \"107-000-000-000-000-000-002\",\n data_not_collected: \"107-000-000-000-000-000-003\",\n yes: \"107-001-000-000-000-000-000\",\n no: \"107-002-000-000-000-000-000\",\n} as const;\n\nexport type GeneralDisabilityKey = keyof typeof GeneralDisabilityKeys;\n\n/**\n * Key → positional code map for the `gender_reporting` CVC domain (PROVISIONAL 994 — CVC-159 gender_reporting value rows (roll-up of CVC-17; 1.1.0 adds transgender_woman / transgender_man, 2026-11-10); demographic reporting rung, 2026-10-30).\n *\n * Domain: `gender_reporting` · Version: 1.1.0 · Entries: 9\n */\nexport const GenderReportingKeys = {\n missingness_root: \"994-000-000-000-000-000-000\",\n not_reported: \"994-000-000-000-000-000-001\",\n female: \"994-001-000-000-000-000-000\",\n male: \"994-002-000-000-000-000-000\",\n transgender: \"994-003-000-000-000-000-000\",\n non_binary: \"994-004-000-000-000-000-000\",\n other: \"994-005-000-000-000-000-000\",\n transgender_woman: \"994-006-000-000-000-000-000\",\n transgender_man: \"994-007-000-000-000-000-000\",\n} as const;\n\nexport type GenderReportingKey = keyof typeof GenderReportingKeys;\n\n/**\n * Key → positional code map for the `birth_country_reporting` CVC domain (PROVISIONAL 995 — CVC-159 birth_country_reporting value rows; demographic reporting rung, 2026-10-30).\n *\n * Domain: `birth_country_reporting` · Version: 1.0.0 · Entries: 6\n */\nexport const BirthCountryReportingKeys = {\n missingness_root: \"995-000-000-000-000-000-000\",\n unknown: \"995-000-000-000-000-000-001\",\n anonymous: \"995-000-000-000-000-000-002\",\n data_not_collected: \"995-000-000-000-000-000-003\",\n born_in_us: \"995-001-000-000-000-000-000\",\n born_outside_us: \"995-002-000-000-000-000-000\",\n} as const;\n\nexport type BirthCountryReportingKey = keyof typeof BirthCountryReportingKeys;\n\n/**\n * Key → positional code map for the `disability_reporting` CVC domain (PROVISIONAL 996 — CVC-159 disability_reporting value rows (the CVC-302 category roll-up); re-bound from CVC-107 by Crysta's ruling 2026-11-02).\n *\n * Domain: `disability_reporting` · Version: 1.0.0 · Entries: 11\n */\nexport const DisabilityReportingKeys = {\n missingness_root: \"996-000-000-000-000-000-000\",\n not_reported: \"996-000-000-000-000-000-001\",\n hearing: \"996-001-000-000-000-000-000\",\n vision: \"996-002-000-000-000-000-000\",\n speech: \"996-003-000-000-000-000-000\",\n cognitive_developmental: \"996-004-000-000-000-000-000\",\n physical: \"996-005-000-000-000-000-000\",\n mental: \"996-006-000-000-000-000-000\",\n other: \"996-007-000-000-000-000-000\",\n type_unknown: \"996-008-000-000-000-000-000\",\n no_disability: \"996-009-000-000-000-000-000\",\n} as const;\n\nexport type DisabilityReportingKey = keyof typeof DisabilityReportingKeys;\n\n/**\n * Key → positional code map for the `activity_type` CVC domain (activity type; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `activity_type` · Version: 1.0.0 · Entries: 14\n */\nexport const ActivityTypeKeys = {\n missingness_root: \"965-000-000-000-000-000-000\",\n unknown: \"965-000-000-000-000-000-001\",\n anonymous: \"965-000-000-000-000-000-002\",\n data_not_collected: \"965-000-000-000-000-000-003\",\n resided: \"965-001-000-000-000-000-000\",\n sheltered: \"965-002-000-000-000-000-000\",\n service_delivered: \"965-003-000-000-000-000-000\",\n met: \"965-004-000-000-000-000-000\",\n advertised: \"965-005-000-000-000-000-000\",\n arrested: \"965-006-000-000-000-000-000\",\n visited: \"965-007-000-000-000-000-000\",\n child_welfare_visit: \"965-008-000-000-000-000-000\",\n incident: \"965-009-000-000-000-000-000\",\n other: \"965-010-000-000-000-000-000\",\n} as const;\n\nexport type ActivityTypeKey = keyof typeof ActivityTypeKeys;\n\n/**\n * Key → positional code map for the `provenance_source_id` CVC domain (provenance source id; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `provenance_source_id` · Version: 1.0.0 · Entries: 13\n */\nexport const ProvenanceSourceIdKeys = {\n missingness_root: \"966-000-000-000-000-000-000\",\n unknown: \"966-000-000-000-000-000-001\",\n anonymous: \"966-000-000-000-000-000-002\",\n data_not_collected: \"966-000-000-000-000-000-003\",\n client_self_report: \"966-001-000-000-000-000-000\",\n system_derived_ads: \"966-002-000-000-000-000-000\",\n system_derived_geocoder: \"966-003-000-000-000-000-000\",\n staff_observation: \"966-004-000-000-000-000-000\",\n intake_form: \"966-005-000-000-000-000-000\",\n referral_partner: \"966-006-000-000-000-000-000\",\n law_enforcement: \"966-007-000-000-000-000-000\",\n id_document: \"966-008-000-000-000-000-000\",\n social_profile: \"966-009-000-000-000-000-000\",\n} as const;\n\nexport type ProvenanceSourceIdKey = keyof typeof ProvenanceSourceIdKeys;\n\n/**\n * Key → positional code map for the `radius_bucket` CVC domain (search radius bucket; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `radius_bucket` · Version: 1.0.0 · Entries: 9\n */\nexport const RadiusBucketKeys = {\n missingness_root: \"967-000-000-000-000-000-000\",\n unknown: \"967-000-000-000-000-000-001\",\n anonymous: \"967-000-000-000-000-000-002\",\n data_not_collected: \"967-000-000-000-000-000-003\",\n mi_10: \"967-001-000-000-000-000-000\",\n mi_50: \"967-002-000-000-000-000-000\",\n mi_100: \"967-003-000-000-000-000-000\",\n mi_250: \"967-004-000-000-000-000-000\",\n mi_500: \"967-005-000-000-000-000-000\",\n} as const;\n\nexport type RadiusBucketKey = keyof typeof RadiusBucketKeys;\n\n/**\n * Key → positional code map for the `contact_link_type` CVC domain (contact link type; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `contact_link_type` · Version: 1.0.0 · Entries: 8\n */\nexport const ContactLinkTypeKeys = {\n missingness_root: \"968-000-000-000-000-000-000\",\n unknown: \"968-000-000-000-000-000-001\",\n anonymous: \"968-000-000-000-000-000-002\",\n data_not_collected: \"968-000-000-000-000-000-003\",\n belongs: \"968-001-000-000-000-000-000\",\n associated: \"968-002-000-000-000-000-000\",\n advertises: \"968-003-000-000-000-000-000\",\n contacted: \"968-004-000-000-000-000-000\",\n} as const;\n\nexport type ContactLinkTypeKey = keyof typeof ContactLinkTypeKeys;\n\n/**\n * Key → positional code map for the `suggestion_source` CVC domain (goal suggestion source; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `suggestion_source` · Version: 1.0.0 · Entries: 6\n */\nexport const SuggestionSourceKeys = {\n missingness_root: \"969-000-000-000-000-000-000\",\n unknown: \"969-000-000-000-000-000-001\",\n anonymous: \"969-000-000-000-000-000-002\",\n data_not_collected: \"969-000-000-000-000-000-003\",\n lap: \"969-001-000-000-000-000-000\",\n ps_step_4: \"969-002-000-000-000-000-000\",\n} as const;\n\nexport type SuggestionSourceKey = keyof typeof SuggestionSourceKeys;\n\n/**\n * Key → positional code map for the `roi_method` CVC domain (ROI delivery method; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `roi_method` · Version: 1.0.0 · Entries: 10\n */\nexport const RoiMethodKeys = {\n missingness_root: \"970-000-000-000-000-000-000\",\n unknown: \"970-000-000-000-000-000-001\",\n anonymous: \"970-000-000-000-000-000-002\",\n data_not_collected: \"970-000-000-000-000-000-003\",\n thread_caseshare: \"970-001-000-000-000-000-000\",\n thread_magic_link: \"970-002-000-000-000-000-000\",\n email: \"970-003-000-000-000-000-000\",\n fax: \"970-004-000-000-000-000-000\",\n secure_portal: \"970-005-000-000-000-000-000\",\n in_person: \"970-006-000-000-000-000-000\",\n} as const;\n\nexport type RoiMethodKey = keyof typeof RoiMethodKeys;\n\n/**\n * Key → positional code map for the `session_note_visibility` CVC domain (session-note visibility; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `session_note_visibility` · Version: 1.0.0 · Entries: 7\n */\nexport const SessionNoteVisibilityKeys = {\n missingness_root: \"971-000-000-000-000-000-000\",\n unknown: \"971-000-000-000-000-000-001\",\n anonymous: \"971-000-000-000-000-000-002\",\n data_not_collected: \"971-000-000-000-000-000-003\",\n default: \"971-001-000-000-000-000-000\",\n account: \"971-002-000-000-000-000-000\",\n private: \"971-003-000-000-000-000-000\",\n} as const;\n\nexport type SessionNoteVisibilityKey = keyof typeof SessionNoteVisibilityKeys;\n\n/**\n * Key → positional code map for the `special_needs_disabilities` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `special_needs_disabilities` · Version: 1.0.0 · Entries: 14\n */\nexport const SpecialNeedsDisabilitiesKeys = {\n missingness_root: \"972-000-000-000-000-000-000\",\n unknown: \"972-000-000-000-000-000-001\",\n anonymous: \"972-000-000-000-000-000-002\",\n data_not_collected: \"972-000-000-000-000-000-003\",\n mental_illness: \"972-001-000-000-000-000-000\",\n cognitive_developmental: \"972-002-000-000-000-000-000\",\n physical_disability: \"972-003-000-000-000-000-000\",\n deaf_hard_of_hearing: \"972-004-000-000-000-000-000\",\n chronic_health_condition: \"972-005-000-000-000-000-000\",\n hiv_aids: \"972-006-000-000-000-000-000\",\n alcohol_abuse: \"972-007-000-000-000-000-000\",\n drug_use_abuse: \"972-008-000-000-000-000-000\",\n unknown_but_exists: \"972-009-000-000-000-000-000\",\n other: \"972-010-000-000-000-000-000\",\n} as const;\n\nexport type SpecialNeedsDisabilitiesKey = keyof typeof SpecialNeedsDisabilitiesKeys;\n\n/**\n * Key → positional code map for the `hiv_status` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `hiv_status` · Version: 1.0.0 · Entries: 6\n */\nexport const HivStatusKeys = {\n missingness_root: \"973-000-000-000-000-000-000\",\n unknown: \"973-000-000-000-000-000-001\",\n anonymous: \"973-000-000-000-000-000-002\",\n data_not_collected: \"973-000-000-000-000-000-003\",\n yes: \"973-001-000-000-000-000-000\",\n no: \"973-002-000-000-000-000-000\",\n} as const;\n\nexport type HivStatusKey = keyof typeof HivStatusKeys;\n\n/**\n * Key → positional code map for the `mental_health_status` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `mental_health_status` · Version: 1.0.0 · Entries: 6\n */\nexport const MentalHealthStatusKeys = {\n missingness_root: \"974-000-000-000-000-000-000\",\n unknown: \"974-000-000-000-000-000-001\",\n anonymous: \"974-000-000-000-000-000-002\",\n data_not_collected: \"974-000-000-000-000-000-003\",\n yes: \"974-001-000-000-000-000-000\",\n no: \"974-002-000-000-000-000-000\",\n} as const;\n\nexport type MentalHealthStatusKey = keyof typeof MentalHealthStatusKeys;\n\n/**\n * Key → positional code map for the `child_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `child_change_type` · Version: 1.0.0 · Entries: 15\n */\nexport const ChildChangeTypeKeys = {\n missingness_root: \"976-000-000-000-000-000-000\",\n unknown: \"976-000-000-000-000-000-001\",\n anonymous: \"976-000-000-000-000-000-002\",\n data_not_collected: \"976-000-000-000-000-000-003\",\n child_added: \"976-001-000-000-000-000-000\",\n child_updated: \"976-002-000-000-000-000-000\",\n child_archived: \"976-003-000-000-000-000-000\",\n child_restored: \"976-004-000-000-000-000-000\",\n child_education_updated: \"976-005-000-000-000-000-000\",\n child_health_updated: \"976-006-000-000-000-000-000\",\n child_custody_updated: \"976-007-000-000-000-000-000\",\n child_parental_rights_updated: \"976-008-000-000-000-000-000\",\n child_behavioral_concerns_updated: \"976-009-000-000-000-000-000\",\n child_household_linked: \"976-010-000-000-000-000-000\",\n child_household_unlinked: \"976-011-000-000-000-000-000\",\n} as const;\n\nexport type ChildChangeTypeKey = keyof typeof ChildChangeTypeKeys;\n\n/**\n * Key → positional code map for the `immigration_legal_status_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `immigration_legal_status_change_type` · Version: 1.0.0 · Entries: 14\n */\nexport const ImmigrationLegalStatusChangeTypeKeys = {\n missingness_root: \"977-000-000-000-000-000-000\",\n unknown: \"977-000-000-000-000-000-001\",\n anonymous: \"977-000-000-000-000-000-002\",\n data_not_collected: \"977-000-000-000-000-000-003\",\n immigration_legal_status_section_declined: \"977-001-000-000-000-000-000\",\n immigration_legal_status_section_recaptured: \"977-002-000-000-000-000-000\",\n immigration_visa_captured: \"977-003-000-000-000-000-000\",\n immigration_visa_updated: \"977-004-000-000-000-000-000\",\n identification_status_captured: \"977-005-000-000-000-000-000\",\n identification_status_updated: \"977-006-000-000-000-000-000\",\n le_report_status_captured: \"977-007-000-000-000-000-000\",\n le_report_status_updated: \"977-008-000-000-000-000-000\",\n trafficking_screening_captured: \"977-009-000-000-000-000-000\",\n trafficking_screening_updated: \"977-010-000-000-000-000-000\",\n} as const;\n\nexport type ImmigrationLegalStatusChangeTypeKey = keyof typeof ImmigrationLegalStatusChangeTypeKeys;\n\n/**\n * Key → positional code map for the `program_enrollment_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `program_enrollment_change_type` · Version: 1.0.0 · Entries: 13\n */\nexport const ProgramEnrollmentChangeTypeKeys = {\n missingness_root: \"978-000-000-000-000-000-000\",\n unknown: \"978-000-000-000-000-000-001\",\n anonymous: \"978-000-000-000-000-000-002\",\n data_not_collected: \"978-000-000-000-000-000-003\",\n program_enrollment_drafted: \"978-001-000-000-000-000-000\",\n program_enrollment_submitted: \"978-002-000-000-000-000-000\",\n program_enrollment_approved: \"978-003-000-000-000-000-000\",\n program_enrollment_activated: \"978-004-000-000-000-000-000\",\n program_enrollment_denied: \"978-005-000-000-000-000-000\",\n program_enrollment_closed: \"978-006-000-000-000-000-000\",\n program_enrollment_expired: \"978-007-000-000-000-000-000\",\n program_enrollment_restored: \"978-008-000-000-000-000-000\",\n program_prior_history_captured: \"978-009-000-000-000-000-000\",\n} as const;\n\nexport type ProgramEnrollmentChangeTypeKey = keyof typeof ProgramEnrollmentChangeTypeKeys;\n\n/**\n * Key → positional code map for the `romantic_relationship_change_type` CVC domain (DRAFT-TEMPORARY direct import from prototype, pending Notion ratification).\n *\n * Domain: `romantic_relationship_change_type` · Version: 1.0.0 · Entries: 16\n */\nexport const RomanticRelationshipChangeTypeKeys = {\n missingness_root: \"979-000-000-000-000-000-000\",\n unknown: \"979-000-000-000-000-000-001\",\n anonymous: \"979-000-000-000-000-000-002\",\n data_not_collected: \"979-000-000-000-000-000-003\",\n romantic_partner_added: \"979-001-000-000-000-000-000\",\n romantic_partner_updated: \"979-002-000-000-000-000-000\",\n romantic_partner_archived: \"979-003-000-000-000-000-000\",\n romantic_partner_restored: \"979-004-000-000-000-000-000\",\n romantic_partner_ties_changed: \"979-005-000-000-000-000-000\",\n romantic_partner_dynamics_changed: \"979-006-000-000-000-000-000\",\n marital_status_set: \"979-007-000-000-000-000-000\",\n marital_status_changed: \"979-008-000-000-000-000-000\",\n marital_status_declined: \"979-009-000-000-000-000-000\",\n relationship_status_set: \"979-010-000-000-000-000-000\",\n relationship_status_changed: \"979-011-000-000-000-000-000\",\n relationship_status_declined: \"979-012-000-000-000-000-000\",\n} as const;\n\nexport type RomanticRelationshipChangeTypeKey = keyof typeof RomanticRelationshipChangeTypeKeys;\n\n/**\n * Key → positional code map for the `risk_category` CVC domain (DRAFT-TEMPORARY; names sourced from @hti/scoring weights/risk.weights.json, the declared risk-taxonomy SOT. Keys `cat_i`..`cat_ix` mirror PAVE's live `TraCategoryId` union, so this doubles as the canonical crosswalk. Weights/aggregation stay in @hti/scoring).\n *\n * Domain: `risk_category` · Version: 1.0.0 · Entries: 13\n */\nexport const RiskCategoryKeys = {\n missingness_root: \"980-000-000-000-000-000-000\",\n unknown: \"980-000-000-000-000-000-001\",\n anonymous: \"980-000-000-000-000-000-002\",\n data_not_collected: \"980-000-000-000-000-000-003\",\n cat_i: \"980-001-000-000-000-000-000\",\n cat_ii: \"980-002-000-000-000-000-000\",\n cat_iii: \"980-003-000-000-000-000-000\",\n cat_iv: \"980-004-000-000-000-000-000\",\n cat_v: \"980-005-000-000-000-000-000\",\n cat_vi: \"980-006-000-000-000-000-000\",\n cat_vii: \"980-007-000-000-000-000-000\",\n cat_viii: \"980-008-000-000-000-000-000\",\n cat_ix: \"980-009-000-000-000-000-000\",\n} as const;\n\nexport type RiskCategoryKey = keyof typeof RiskCategoryKeys;\n\n/**\n * Key → positional code map for the `core_functions` CVC domain (CANONICAL Notion CVC-133 `core - functions`, Active v2.0 — the Canonical Authorization Model function registry; SOT v1.3.0 is GENERATED from the prototype repo's data/cvcs/core_functions.yaml by scripts/gen-core-functions.py: 113 functions — the 78 published by 1.0.0/1.1.0 at their codes plus 35 appended at 133-079 … 133-113 — the roles → functions → gates/tiers graph is built over. NOT provisional numbering. Each entry carries canon's `v1` / `retired` flags as structured booleans (since 1.3.0, read by the shared authorization resolver); Platform Relevance, user/admin relevance and Category ride the definition suffix; bounds are not carried).\n *\n * Domain: `core_functions` · Version: 1.5.0 · Entries: 117\n */\nexport const CoreFunctionsKeys = {\n missingness_root: \"133-000-000-000-000-000-000\",\n unknown: \"133-000-000-000-000-000-001\",\n anonymous: \"133-000-000-000-000-000-002\",\n data_not_collected: \"133-000-000-000-000-000-003\",\n account_suspend: \"133-001-000-000-000-000-000\",\n aggregate_data_query_generate: \"133-002-000-000-000-000-000\",\n api_key_manage: \"133-003-000-000-000-000-000\",\n assessments_conduct: \"133-004-000-000-000-000-000\",\n audit_anomaly_review: \"133-005-000-000-000-000-000\",\n audit_log_view_member: \"133-006-000-000-000-000-000\",\n audit_log_view_team: \"133-007-000-000-000-000-000\",\n auth_model_manage_platform: \"133-008-000-000-000-000-000\",\n break_glass: \"133-009-000-000-000-000-000\",\n case_assign_reassign: \"133-010-000-000-000-000-000\",\n case_claim: \"133-011-000-000-000-000-000\",\n case_collaborator_add: \"133-012-000-000-000-000-000\",\n case_edit: \"133-013-000-000-000-000-000\",\n case_needs_action_flag_manage: \"133-014-000-000-000-000-000\",\n case_outcomes_edit: \"133-015-000-000-000-000-000\",\n case_purge: \"133-016-000-000-000-000-000\",\n case_reopen: \"133-017-000-000-000-000-000\",\n case_side_panel_use: \"133-018-000-000-000-000-000\",\n case_transfer_bulk: \"133-019-000-000-000-000-000\",\n case_view: \"133-020-000-000-000-000-000\",\n ci_periodic_review: \"133-021-000-000-000-000-000\",\n ci_record_purge_or_retire: \"133-022-000-000-000-000-000\",\n ci_record_validate: \"133-023-000-000-000-000-000\",\n ci_to_evidence_export_authorize: \"133-024-000-000-000-000-000\",\n dashboard_approve_shared: \"133-025-000-000-000-000-000\",\n data_qa_workflow_run: \"133-026-000-000-000-000-000\",\n deconfliction_alert_acknowledge: \"133-027-000-000-000-000-000\",\n determination_perform: \"133-028-000-000-000-000-000\",\n disclose_external: \"133-029-000-000-000-000-000\",\n disclose_external_request: \"133-030-000-000-000-000-000\",\n export_deidentified: \"133-031-000-000-000-000-000\",\n export_disclosure_log_review: \"133-032-000-000-000-000-000\",\n export_template_config_manage: \"133-033-000-000-000-000-000\",\n gov_data_quality_review: \"133-034-000-000-000-000-000\",\n idb_record_create: \"133-035-000-000-000-000-000\",\n incident_response_remediate: \"133-036-000-000-000-000-000\",\n investigation_create_claim: \"133-037-000-000-000-000-000\",\n investigative_database_search: \"133-038-000-000-000-000-000\",\n lead_create: \"133-039-000-000-000-000-000\",\n lead_publish: \"133-040-000-000-000-000-000\",\n magic_link_share_send: \"133-041-000-000-000-000-000\",\n member_account_report_generate: \"133-042-000-000-000-000-000\",\n member_onboarding_support: \"133-043-000-000-000-000-000\",\n open_source_search: \"133-044-000-000-000-000-000\",\n outbound_share_followup_review: \"133-045-000-000-000-000-000\",\n person_association_update: \"133-046-000-000-000-000-000\",\n platform_perm_modify: \"133-047-000-000-000-000-000\",\n platform_policy_enforcement_manage: \"133-048-000-000-000-000-000\",\n record_print: \"133-049-000-000-000-000-000\",\n referral_receive_external: \"133-050-000-000-000-000-000\",\n referral_receive_internal: \"133-051-000-000-000-000-000\",\n referral_send_external: \"133-052-000-000-000-000-000\",\n referral_send_internal: \"133-053-000-000-000-000-000\",\n reporting_dashboard_config_manage: \"133-054-000-000-000-000-000\",\n retention_compliance_review: \"133-055-000-000-000-000-000\",\n roi_submit_manage: \"133-056-000-000-000-000-000\",\n role_assign: \"133-057-000-000-000-000-000\",\n roles_accounts_toggle: \"133-058-000-000-000-000-000\",\n sandbox_environment_manage: \"133-059-000-000-000-000-000\",\n screening_conduct: \"133-060-000-000-000-000-000\",\n screening_view: \"133-061-000-000-000-000-000\",\n security_restrict_apply: \"133-062-000-000-000-000-000\",\n session_create: \"133-063-000-000-000-000-000\",\n share_approve: \"133-064-000-000-000-000-000\",\n share_config: \"133-065-000-000-000-000-000\",\n share_rule_approve_cross_agency: \"133-066-000-000-000-000-000\",\n share_vsp_to_le: \"133-067-000-000-000-000-000\",\n support_ticket_triage: \"133-068-000-000-000-000-000\",\n system_diagnostics_view: \"133-069-000-000-000-000-000\",\n team_config_manage: \"133-070-000-000-000-000-000\",\n team_membership_manage: \"133-071-000-000-000-000-000\",\n team_workflow_config_manage: \"133-072-000-000-000-000-000\",\n thread_share_accept: \"133-073-000-000-000-000-000\",\n thread_share_send: \"133-074-000-000-000-000-000\",\n training_content_upload: \"133-075-000-000-000-000-000\",\n training_gate_manage: \"133-076-000-000-000-000-000\",\n usr_manage: \"133-077-000-000-000-000-000\",\n note_open_departed_author: \"133-078-000-000-000-000-000\",\n agency_info_manage: \"133-079-000-000-000-000-000\",\n srl_manage: \"133-080-000-000-000-000-000\",\n mandatory_report_send: \"133-081-000-000-000-000-000\",\n indicator_manual_add: \"133-082-000-000-000-000-000\",\n message_send: \"133-083-000-000-000-000-000\",\n workgroup_manage: \"133-084-000-000-000-000-000\",\n message_moderate: \"133-085-000-000-000-000-000\",\n announcement_publish: \"133-086-000-000-000-000-000\",\n supervisee_thread_view: \"133-087-000-000-000-000-000\",\n case_status_manage: \"133-088-000-000-000-000-000\",\n enrollment_manage: \"133-089-000-000-000-000-000\",\n exit_discharge_conduct: \"133-090-000-000-000-000-000\",\n goals_plan_manage: \"133-091-000-000-000-000-000\",\n lead_triage_manage: \"133-092-000-000-000-000-000\",\n milestone_log: \"133-093-000-000-000-000-000\",\n needs_priorities_conduct: \"133-094-000-000-000-000-000\",\n profile_domain_edit: \"133-095-000-000-000-000-000\",\n record_activity_view: \"133-096-000-000-000-000-000\",\n service_log_manage: \"133-097-000-000-000-000-000\",\n case_close: \"133-098-000-000-000-000-000\",\n case_visibility_manage: \"133-099-000-000-000-000-000\",\n person_merge_manage: \"133-100-000-000-000-000-000\",\n investigation_session_run: \"133-101-000-000-000-000-000\",\n lead_route_assign: \"133-102-000-000-000-000-000\",\n onboarding_config_sign_off: \"133-103-000-000-000-000-000\",\n hmis_export_generate: \"133-104-000-000-000-000-000\",\n team_share_narrowing: \"133-105-000-000-000-000-000\",\n viewing_config_manage: \"133-106-000-000-000-000-000\",\n network_corpus_access: \"133-107-000-000-000-000-000\",\n viewing_level_1_search: \"133-108-000-000-000-000-000\",\n viewing_level_2_autocomplete: \"133-109-000-000-000-000-000\",\n viewing_level_3_components: \"133-110-000-000-000-000-000\",\n investigative_request_send: \"133-111-000-000-000-000-000\",\n deconfliction_unmask: \"133-112-000-000-000-000-000\",\n share_revoke: \"133-113-000-000-000-000-000\",\n} as const;\n\nexport type CoreFunctionsKey = keyof typeof CoreFunctionsKeys;\n\n/**\n * Key → positional code map for the `needs_assessment_change_type` CVC domain (DRAFT-TEMPORARY; the 9 fine-grained per-mutation Needs-Assessment CAR change types, sourced from PAVE `@pave/domain` NEEDS_ASSESSMENT_CHANGE_TYPES. CASING NORMALIZED: PAVE stores SCREAMING_SNAKE, CVC keys are lower_snake. DISTINCT from the coarse 3-verb section-boundary registry NEEDS_ASSESSMENT_VERB_REGISTRY).\n *\n * Domain: `needs_assessment_change_type` · Version: 1.0.0 · Entries: 13\n */\nexport const NeedsAssessmentChangeTypeKeys = {\n missingness_root: \"982-000-000-000-000-000-000\",\n unknown: \"982-000-000-000-000-000-001\",\n anonymous: \"982-000-000-000-000-000-002\",\n data_not_collected: \"982-000-000-000-000-000-003\",\n answer_recorded: \"982-001-000-000-000-000-000\",\n answer_changed: \"982-002-000-000-000-000-000\",\n answer_cleared: \"982-003-000-000-000-000-000\",\n section_declined: \"982-004-000-000-000-000-000\",\n section_undeclined: \"982-005-000-000-000-000-000\",\n section_submitted: \"982-006-000-000-000-000-000\",\n assessment_submitted: \"982-007-000-000-000-000-000\",\n service_instance_generated: \"982-008-000-000-000-000-000\",\n service_instance_linked: \"982-009-000-000-000-000-000\",\n} as const;\n\nexport type NeedsAssessmentChangeTypeKey = keyof typeof NeedsAssessmentChangeTypeKeys;\n\n/**\n * Key → positional code map for the `service_delivery_change_type` CVC domain (DRAFT-TEMPORARY, PROVISIONAL 997; codebook home owed — no Notion CVC page, no CVC number minted). The 37 kinds of change to a service record, one CAR verb each on the `service_delivery` casework domain: the prototype's `emitServiceInstanceCAR` codes (22 mapped + 15 stored as `svc_<verb>`, prefix removed). Each entry carries `title` (the shared label), `slot`, `allowedDetailKeys` (codes and ids only), `staging` (`session` | `at_act`), `selectable: true` (every entry is a valid value) and `pickable: false` (never offered in a picker). Not the four track-judgment codes that share the domain).\n *\n * Domain: `service_delivery_change_type` · Version: 1.1.0 · Entries: 37\n */\nexport const ServiceDeliveryChangeTypeKeys = {\n instance_added: \"997-001-000-000-000-000-000\",\n service_instance_auto_derived_from_template: \"997-002-000-000-000-000-000\",\n advocacy_auto_instance_created: \"997-003-000-000-000-000-000\",\n specialized_assessments_auto_instance_created: \"997-004-000-000-000-000-000\",\n lifecycle_stamped: \"997-005-000-000-000-000-000\",\n lifecycle_date_changed: \"997-006-000-000-000-000-000\",\n lifecycle_cleared: \"997-007-000-000-000-000-000\",\n instance_reopened: \"997-008-000-000-000-000-000\",\n instance_closed: \"997-009-000-000-000-000-000\",\n instance_removed: \"997-010-000-000-000-000-000\",\n instance_archived: \"997-011-000-000-000-000-000\",\n instance_restored: \"997-012-000-000-000-000-000\",\n instance_tracking_transferred: \"997-013-000-000-000-000-000\",\n instance_tracking_released: \"997-014-000-000-000-000-000\",\n mechanism_set: \"997-015-000-000-000-000-000\",\n mechanism_cleared: \"997-016-000-000-000-000-000\",\n channel_set: \"997-017-000-000-000-000-000\",\n channel_cleared: \"997-018-000-000-000-000-000\",\n source_set: \"997-019-000-000-000-000-000\",\n source_cleared: \"997-020-000-000-000-000-000\",\n source_provider_org_set: \"997-021-000-000-000-000-000\",\n source_provider_org_cleared: \"997-022-000-000-000-000-000\",\n location_override_set: \"997-023-000-000-000-000-000\",\n location_override_cleared: \"997-024-000-000-000-000-000\",\n attempt_reason_set: \"997-025-000-000-000-000-000\",\n attempt_reason_cleared: \"997-026-000-000-000-000-000\",\n referral_target_set: \"997-027-000-000-000-000-000\",\n referral_target_cleared: \"997-028-000-000-000-000-000\",\n referral_outcome_set: \"997-029-000-000-000-000-000\",\n referral_outcome_cleared: \"997-030-000-000-000-000-000\",\n referral_entity_category_set: \"997-031-000-000-000-000-000\",\n referral_entity_category_cleared: \"997-032-000-000-000-000-000\",\n recipients_changed: \"997-033-000-000-000-000-000\",\n audiences_changed: \"997-034-000-000-000-000-000\",\n lineage_drilled_down: \"997-035-000-000-000-000-000\",\n derived_from_question: \"997-036-000-000-000-000-000\",\n metadata_changed: \"997-037-000-000-000-000-000\",\n} as const;\n\nexport type ServiceDeliveryChangeTypeKey = keyof typeof ServiceDeliveryChangeTypeKeys;\n\n/**\n * Key → positional code map for the `core_information_scope` CVC domain (DRAFT-TEMPORARY; canonical CVC-236 v4 tree, SOT v2.1.0: 115 live rows + 27 RETIRED tombstones. Canon depth 0–3 — top layer (System metadata · Narrative notes · Primary client · Other named persons), then client category / person type, then sub-category / a person type's category, then instrument row / a person type's sub-category — read off parentCode / parentKey, NOT the code: every v1.1.0 code is unchanged and new rows append. A canon `.` is `__` in the key (`offenders__identifying`; canon spelling on `canonicalCode`). Every LIVE row but the 28 instrument rows and `identifying__other` is selectable (select-all at any level); detect a category by `rowType`, not `selectable`. Tombstones keep their codes so a stored value resolves, are `selectable: false` + `retired: true`, and name their SELECTION reading in `successors` (a restriction resolves via the `subtract` lines: `restrictionSuccessors`); the envelope `migrations` block is the v3 → v4 from-to table, applied at READ time (a v2-era or unstamped list goes through canon's v2 → v3 table first; `widens: true` marks readings wider than v3; on those lines `releaseReading` says whether a signed release or share keeps the code's v3 grain (`retain`: the tombstone's `v3Fields`, read-only) or reads its successor, and `policyReading: successor` that a policy or preset takes the successor with a dated version row). Distinct from the sibling `roi_scope` domain, the LEGACY flat item vocabulary: every one of its 27 substantive keys is an entry here, spelled identically)\n *\n * Domain: `core_information_scope` · Version: 2.1.0 · Entries: 146\n */\nexport const CoreInformationScopeKeys = {\n missingness_root: \"236-000-000-000-000-000-000\",\n unknown: \"236-000-000-000-000-000-001\",\n anonymous: \"236-000-000-000-000-000-002\",\n data_not_collected: \"236-000-000-000-000-000-003\",\n identifying: \"236-001-000-000-000-000-000\",\n names: \"236-001-001-000-000-000-000\",\n dob: \"236-001-002-000-000-000-000\",\n addresses: \"236-001-003-000-000-000-000\",\n additional_ids: \"236-001-004-000-000-000-000\",\n demographics: \"236-001-005-000-000-000-000\",\n identifying__other: \"236-001-006-000-000-000-000\",\n risk: \"236-002-000-000-000-000-000\",\n screen_indicators: \"236-002-001-000-000-000-000\",\n victimization: \"236-002-002-000-000-000-000\",\n ida_full: \"236-002-003-000-000-000-000\",\n ida_consid: \"236-002-004-000-000-000-000\",\n initial_screen: \"236-002-005-000-000-000-000\",\n tra: \"236-002-006-000-000-000-000\",\n lap: \"236-002-007-000-000-000-000\",\n danger_assessment: \"236-002-008-000-000-000-000\",\n injury_and_strangulation: \"236-002-009-000-000-000-000\",\n stalking_assessment: \"236-002-010-000-000-000-000\",\n ae_intake: \"236-002-011-000-000-000-000\",\n hope_scale: \"236-002-012-000-000-000-000\",\n assessment_records: \"236-002-013-000-000-000-000\",\n determinations: \"236-002-014-000-000-000-000\",\n offender_facilitator: \"236-002-015-000-000-000-000\",\n system_involvement: \"236-002-016-000-000-000-000\",\n derived_risk_signals: \"236-002-017-000-000-000-000\",\n contact: \"236-003-000-000-000-000-000\",\n contact_info: \"236-003-001-000-000-000-000\",\n safe_locations: \"236-003-002-000-000-000-000\",\n priorities_safety: \"236-003-003-000-000-000-000\",\n encounter_location: \"236-003-004-000-000-000-000\",\n services: \"236-004-000-000-000-000-000\",\n contact_history: \"236-004-001-000-000-000-000\",\n service_history: \"236-004-002-000-000-000-000\",\n plans_goals: \"236-004-003-000-000-000-000\",\n notes: \"236-005-000-000-000-000-000\",\n screen_notes: \"236-005-001-000-000-000-000\",\n case_notes: \"236-005-002-000-000-000-000\",\n background: \"236-005-003-000-000-000-000\",\n session_summary: \"236-005-004-000-000-000-000\",\n health_accommodation: \"236-006-000-000-000-000-000\",\n accommodation_needs: \"236-006-001-000-000-000-000\",\n disability_subtypes: \"236-006-002-000-000-000-000\",\n mental_health_status: \"236-006-003-000-000-000-000\",\n substance_use_status: \"236-006-004-000-000-000-000\",\n chronic_health_status: \"236-006-005-000-000-000-000\",\n hiv_status: \"236-006-006-000-000-000-000\",\n mental_health_screen: \"236-006-007-000-000-000-000\",\n trauma_and_coping_screen: \"236-006-008-000-000-000-000\",\n behavioral_health_intake: \"236-006-009-000-000-000-000\",\n health_status: \"236-006-010-000-000-000-000\",\n immigration_legal_status: \"236-007-000-000-000-000-000\",\n immigration_status: \"236-007-001-000-000-000-000\",\n uscis_alien_number: \"236-007-002-000-000-000-000\",\n federal_protection_applications: \"236-007-003-000-000-000-000\",\n tvap_enrollment: \"236-007-004-000-000-000-000\",\n le_report_status: \"236-007-005-000-000-000-000\",\n immigration_applications: \"236-007-006-000-000-000-000\",\n system: \"236-008-000-000-000-000-000\",\n system_info: \"236-008-001-000-000-000-000\",\n network_associations: \"236-009-000-000-000-000-000\",\n network_membership: \"236-009-001-000-000-000-000\",\n persona_links: \"236-009-002-000-000-000-000\",\n commercial_activity: \"236-010-000-000-000-000-000\",\n ad_content: \"236-010-001-000-000-000-000\",\n commercial_patterns: \"236-010-002-000-000-000-000\",\n investigative_work_product: \"236-011-000-000-000-000-000\",\n case_determinations: \"236-011-001-000-000-000-000\",\n case_lifecycle: \"236-011-002-000-000-000-000\",\n case_attachments: \"236-011-003-000-000-000-000\",\n object_identifiers: \"236-012-000-000-000-000-000\",\n phone_identifiers: \"236-012-001-000-000-000-000\",\n object_identity_attributes: \"236-012-002-000-000-000-000\",\n instruments: \"236-013-000-000-000-000-000\",\n instrument_summary: \"236-013-001-000-000-000-000\",\n summary_initial_screen: \"236-013-001-001-000-000-000\",\n summary_mental_health_screen: \"236-013-001-002-000-000-000\",\n summary_behavioral_health_intake: \"236-013-001-003-000-000-000\",\n summary_trauma_and_coping_screen: \"236-013-001-004-000-000-000\",\n summary_ae_intake: \"236-013-001-005-000-000-000\",\n summary_ida: \"236-013-001-006-000-000-000\",\n summary_lap: \"236-013-001-007-000-000-000\",\n summary_danger_assessment: \"236-013-001-008-000-000-000\",\n summary_stalking_assessment: \"236-013-001-009-000-000-000\",\n summary_injury_and_strangulation: \"236-013-001-010-000-000-000\",\n summary_hope_scale: \"236-013-001-011-000-000-000\",\n summary_needs_assessment: \"236-013-001-012-000-000-000\",\n summary_tra: \"236-013-001-013-000-000-000\",\n summary_findings: \"236-013-001-014-000-000-000\",\n instrument_full: \"236-013-002-000-000-000-000\",\n full_initial_screen: \"236-013-002-001-000-000-000\",\n full_mental_health_screen: \"236-013-002-002-000-000-000\",\n full_behavioral_health_intake: \"236-013-002-003-000-000-000\",\n full_trauma_and_coping_screen: \"236-013-002-004-000-000-000\",\n full_ae_intake: \"236-013-002-005-000-000-000\",\n full_ida: \"236-013-002-006-000-000-000\",\n full_lap: \"236-013-002-007-000-000-000\",\n full_danger_assessment: \"236-013-002-008-000-000-000\",\n full_stalking_assessment: \"236-013-002-009-000-000-000\",\n full_injury_and_strangulation: \"236-013-002-010-000-000-000\",\n full_hope_scale: \"236-013-002-011-000-000-000\",\n full_needs_assessment: \"236-013-002-012-000-000-000\",\n full_tra: \"236-013-002-013-000-000-000\",\n full_findings: \"236-013-002-014-000-000-000\",\n relationships_household: \"236-014-000-000-000-000-000\",\n primary_client: \"236-015-000-000-000-000-000\",\n other_named_persons: \"236-016-000-000-000-000-000\",\n offenders: \"236-016-001-000-000-000-000\",\n offenders__identifying: \"236-016-001-001-000-000-000\",\n offenders__risk: \"236-016-001-002-000-000-000\",\n offenders__contact: \"236-016-001-003-000-000-000\",\n offenders__safe_locations: \"236-016-001-003-002-000-000\",\n offenders__services: \"236-016-001-004-000-000-000\",\n offenders__health_accommodation: \"236-016-001-006-000-000-000\",\n offenders__immigration_legal_status: \"236-016-001-007-000-000-000\",\n offenders__instruments: \"236-016-001-013-000-000-000\",\n offenders__instrument_summary: \"236-016-001-013-001-000-000\",\n offenders__instrument_full: \"236-016-001-013-002-000-000\",\n offenders__relationships_household: \"236-016-001-014-000-000-000\",\n family: \"236-016-002-000-000-000-000\",\n family__identifying: \"236-016-002-001-000-000-000\",\n family__risk: \"236-016-002-002-000-000-000\",\n family__contact: \"236-016-002-003-000-000-000\",\n family__safe_locations: \"236-016-002-003-002-000-000\",\n family__services: \"236-016-002-004-000-000-000\",\n family__health_accommodation: \"236-016-002-006-000-000-000\",\n family__immigration_legal_status: \"236-016-002-007-000-000-000\",\n family__instruments: \"236-016-002-013-000-000-000\",\n family__instrument_summary: \"236-016-002-013-001-000-000\",\n family__instrument_full: \"236-016-002-013-002-000-000\",\n family__relationships_household: \"236-016-002-014-000-000-000\",\n others: \"236-016-003-000-000-000-000\",\n others__identifying: \"236-016-003-001-000-000-000\",\n others__risk: \"236-016-003-002-000-000-000\",\n others__contact: \"236-016-003-003-000-000-000\",\n others__safe_locations: \"236-016-003-003-002-000-000\",\n others__services: \"236-016-003-004-000-000-000\",\n others__health_accommodation: \"236-016-003-006-000-000-000\",\n others__immigration_legal_status: \"236-016-003-007-000-000-000\",\n others__instruments: \"236-016-003-013-000-000-000\",\n others__instrument_summary: \"236-016-003-013-001-000-000\",\n others__instrument_full: \"236-016-003-013-002-000-000\",\n others__relationships_household: \"236-016-003-014-000-000-000\",\n} as const;\n\nexport type CoreInformationScopeKey = keyof typeof CoreInformationScopeKeys;\n\n/**\n * Key → positional code map for the `roi_scope` CVC domain (DRAFT-TEMPORARY; LEGACY flat item vocabulary, superseded for new work by `core_information_scope` (CVC-236). 27 ROI scope ITEMS: 14 live + 13 RETIRED tombstones, each matching its CVC-236 twin (`screen_notes`, `background` retired 2026-10-05 and include nothing; 11 more retired by the CVC-236 v4 tree, each read through its twin's CVC-236 SOT v2.1.0 `migrations` line: a stored ROI is a signed release, so the 9 health / immigration twins keep the twin's v3 grain (`v3Fields`, read-only) while a policy or preset takes the successor; `ida_full` / `ida_consid` read as their twin's informational line). Tombstones keep their codes so a stored value resolves, but are `selectable: false` + `retired: true` — never offer them. The item axis only — named bundles over these items are ROI_SCOPE_PRESET_NAMES).\n *\n * Domain: `roi_scope` · Version: 1.4.0 · Entries: 31\n */\nexport const RoiScopeKeys = {\n missingness_root: \"983-000-000-000-000-000-000\",\n unknown: \"983-000-000-000-000-000-001\",\n anonymous: \"983-000-000-000-000-000-002\",\n data_not_collected: \"983-000-000-000-000-000-003\",\n names: \"983-001-000-000-000-000-000\",\n dob: \"983-002-000-000-000-000-000\",\n addresses: \"983-003-000-000-000-000-000\",\n additional_ids: \"983-004-000-000-000-000-000\",\n demographics: \"983-005-000-000-000-000-000\",\n screen_indicators: \"983-006-000-000-000-000-000\",\n victimization: \"983-007-000-000-000-000-000\",\n ida_full: \"983-008-000-000-000-000-000\",\n ida_consid: \"983-009-000-000-000-000-000\",\n contact_info: \"983-010-000-000-000-000-000\",\n service_history: \"983-011-000-000-000-000-000\",\n screen_notes: \"983-012-000-000-000-000-000\",\n case_notes: \"983-013-000-000-000-000-000\",\n background: \"983-014-000-000-000-000-000\",\n system_info: \"983-015-000-000-000-000-000\",\n contact_history: \"983-016-000-000-000-000-000\",\n accommodation_needs: \"983-017-000-000-000-000-000\",\n disability_subtypes: \"983-018-000-000-000-000-000\",\n mental_health_status: \"983-019-000-000-000-000-000\",\n substance_use_status: \"983-020-000-000-000-000-000\",\n chronic_health_status: \"983-021-000-000-000-000-000\",\n hiv_status: \"983-022-000-000-000-000-000\",\n immigration_status: \"983-023-000-000-000-000-000\",\n uscis_alien_number: \"983-024-000-000-000-000-000\",\n federal_protection_applications: \"983-025-000-000-000-000-000\",\n tvap_enrollment: \"983-026-000-000-000-000-000\",\n le_report_status: \"983-027-000-000-000-000-000\",\n} as const;\n\nexport type RoiScopeKey = keyof typeof RoiScopeKeys;\n\n/**\n * Key → positional code map for the `roi_status` CVC domain (DRAFT-TEMPORARY; the 5-state lifecycle of a STORED Release of Information, sourced from PAVE `@pave/domain` ROI_STATUSES. DISTINCT from ROI_SEED_STATUSES, the recipient-card badge triad valid/expired/none).\n *\n * Domain: `roi_status` · Version: 1.1.0 · Entries: 9\n */\nexport const RoiStatusKeys = {\n missingness_root: \"984-000-000-000-000-000-000\",\n unknown: \"984-000-000-000-000-000-001\",\n anonymous: \"984-000-000-000-000-000-002\",\n data_not_collected: \"984-000-000-000-000-000-003\",\n draft: \"984-001-000-000-000-000-000\",\n active: \"984-002-000-000-000-000-000\",\n expired: \"984-003-000-000-000-000-000\",\n revoked: \"984-005-000-000-000-000-000\",\n superseded: \"984-006-000-000-000-000-000\",\n} as const;\n\nexport type RoiStatusKey = keyof typeof RoiStatusKeys;\n\n/**\n * Key → positional code map for the `core_referral_outcome` CVC domain (DRAFT-TEMPORARY; the binary referral-outcome axis attained / not_attained, grounded in the HMIS FY2026 Data Standards “P2 Referrals Provided” element + IC-59. The REASON a referral was not attained is a separate axis and is deliberately not folded in).\n *\n * Domain: `core_referral_outcome` · Version: 1.0.0 · Entries: 6\n */\nexport const CoreReferralOutcomeKeys = {\n missingness_root: \"975-000-000-000-000-000-000\",\n unknown: \"975-000-000-000-000-000-001\",\n anonymous: \"975-000-000-000-000-000-002\",\n data_not_collected: \"975-000-000-000-000-000-003\",\n attained: \"975-001-000-000-000-000-000\",\n not_attained: \"975-002-000-000-000-000-000\",\n} as const;\n\nexport type CoreReferralOutcomeKey = keyof typeof CoreReferralOutcomeKeys;\n\n/**\n * Key → positional code map for the `dh_state` CVC domain (CVC-233, `core-DH_state`, ready_for_dev). Lifecycle state of a determination / Findings artifact: draft → prov → pend_iss → issued → super. INDEPENDENT axis from CVC-138 `determination_level` (suspected/reported/disclosed/verified), which lives on the assertion at every state. Per-determination, not per-subject. Authored in 0.8.13 once CVC-233 was freed by renumbering `housing_subsidy_types` 233 → 194 — the squat had MASKED this gap.\n *\n * Domain: `dh_state` · Version: 1.0.0 · Entries: 9\n */\nexport const DhStateKeys = {\n missingness_root: \"233-000-000-000-000-000-000\",\n unknown: \"233-000-000-000-000-000-001\",\n anonymous: \"233-000-000-000-000-000-002\",\n data_not_collected: \"233-000-000-000-000-000-003\",\n draft: \"233-001-000-000-000-000-000\",\n prov: \"233-002-000-000-000-000-000\",\n pend_iss: \"233-003-000-000-000-000-000\",\n issued: \"233-004-000-000-000-000-000\",\n super: \"233-005-000-000-000-000-000\",\n} as const;\n\nexport type DhStateKey = keyof typeof DhStateKeys;\n\n/**\n * Key → positional code map for the `core_indicators` CVC domain (CVC-136; 221 canonical indicator codes re-sourced from prototype `data/core_indicators.yaml` @ 40f57ad, reconciled against @hti/scoring `emits_by_code` @ 386f5f1; the 2 former scoring-ahead `_youth` codes are DEPRECATED read-only rows — `selectable: false`, `supersededBy` their canonical siblings — kept because PAVE 2.0 still writes them = 223 substantive; SOT v1.2.0). Entries carry `family` / `polarity` / `severity` / `isAlert` / `alertWhen`; the alert list is a DERIVED VIEW over `isAlert`, not a rival taxonomy.\n *\n * Domain: `core_indicators` · Version: 1.2.0 · Entries: 227\n */\nexport const CoreIndicatorKeys = {\n missingness_root: \"136-000-000-000-000-000-000\",\n unknown: \"136-000-000-000-000-000-001\",\n anonymous: \"136-000-000-000-000-000-002\",\n data_not_collected: \"136-000-000-000-000-000-003\",\n abuser_evading_legal_consequences: \"136-001-000-000-000-000-000\",\n abuser_has_weapon: \"136-002-000-000-000-000-000\",\n abuser_substance_use: \"136-003-000-000-000-000-000\",\n abuser_threatened_suicide: \"136-004-000-000-000-000-000\",\n abuser_unemployed: \"136-005-000-000-000-000-000\",\n access_to_vulnerable_individuals: \"136-006-000-000-000-000-000\",\n acknowledgement_or_report_of_human_trafficking: \"136-007-000-000-000-000-000\",\n ads_available_247: \"136-008-000-000-000-000-000\",\n ads_imply_multiple_workers: \"136-009-000-000-000-000-000\",\n ads_prost_slang: \"136-010-000-000-000-000-000\",\n adverse_childhood_household_challenges: \"136-011-000-000-000-000-000\",\n advertised_new_to_area: \"136-012-000-000-000-000-000\",\n appears_controlling_relationship: \"136-013-000-000-000-000-000\",\n appears_turned_out_or_trained_ad_patterns: \"136-014-000-000-000-000-000\",\n association_commercial_sex: \"136-015-000-000-000-000-000\",\n atypical_or_high_risk_payment_method: \"136-016-000-000-000-000-000\",\n autonomy_access_healthcare_without_fear: \"136-017-000-000-000-000-000\",\n autonomy_choice_in_clients: \"136-018-000-000-000-000-000\",\n autonomy_choice_in_services: \"136-019-000-000-000-000-000\",\n autonomy_controls_own_docs: \"136-020-000-000-000-000-000\",\n autonomy_controls_own_finances: \"136-021-000-000-000-000-000\",\n autonomy_organizes_own_travel: \"136-022-000-000-000-000-000\",\n autonomy_posts_own_ads: \"136-023-000-000-000-000-000\",\n autonomy_sets_own_schedule: \"136-024-000-000-000-000-000\",\n autonomy_sets_up_own_dates: \"136-025-000-000-000-000-000\",\n battered_while_pregnant_history: \"136-026-000-000-000-000-000\",\n branding_or_unusual_tattoos_tied_to_control: \"136-027-000-000-000-000-000\",\n cannot_stop_working_or_freely_leave: \"136-028-000-000-000-000-000\",\n child_not_abusers_in_household: \"136-029-000-000-000-000-000\",\n child_welfare_system_involvement: \"136-030-000-000-000-000-000\",\n coerced_to_misrepresent_identity_or_activity: \"136-031-000-000-000-000-000\",\n coercive_debt_pressure: \"136-032-000-000-000-000-000\",\n coercive_debt_pressure_youth: \"136-033-000-000-000-000-000\",\n coercive_migration_or_forced_travel: \"136-034-000-000-000-000-000\",\n cognitive_or_functional_impairment_affecting_consent: \"136-035-000-000-000-000-000\",\n commercial_sex_association_words_or_places: \"136-036-000-000-000-000-000\",\n concerning_mannerisms_anxious_fearful_depressed: \"136-037-000-000-000-000-000\",\n concerning_sexual_behavior_pattern: \"136-038-000-000-000-000-000\",\n constraints_due_to_legal_status: \"136-039-000-000-000-000-000\",\n control_quota_required: \"136-040-000-000-000-000-000\",\n cs_activity_criminal_org_connection: \"136-041-000-000-000-000-000\",\n cs_industry_related_criminal_history: \"136-042-000-000-000-000-000\",\n current_injuries_from_abuser: \"136-043-000-000-000-000-000\",\n current_mental_health_services: \"136-044-000-000-000-000-000\",\n currently_minor_in_commercial_sex: \"136-045-000-000-000-000-000\",\n dangerous_services_no_protection: \"136-046-000-000-000-000-000\",\n dangerous_services_requires_protection: \"136-047-000-000-000-000-000\",\n dangerous_services_willing_anything: \"136-048-000-000-000-000-000\",\n debt_terms_deceptive: \"136-049-000-000-000-000-000\",\n debt_terms_deceptive_youth: \"136-050-000-000-000-000-000\",\n denied_basic_needs: \"136-051-000-000-000-000-000\",\n depends_on_employer_for_immigration_status: \"136-052-000-000-000-000-000\",\n does_not_control_finances_or_earnings: \"136-053-000-000-000-000-000\",\n does_not_control_identity_documents: \"136-054-000-000-000-000-000\",\n elevated_lethality_risk_signal: \"136-055-000-000-000-000-000\",\n employer_keeps_pay_or_pays_less_than_expected: \"136-056-000-000-000-000-000\",\n engages_in_commercial_sex_act: \"136-057-000-000-000-000-000\",\n entered_commercial_sex_industry_as_minor: \"136-058-000-000-000-000-000\",\n entered_cs_due_to_survival_needs: \"136-059-000-000-000-000-000\",\n entered_into_network_of_sex_providers_early: \"136-060-000-000-000-000-000\",\n exploitative_pricing_tier_low: \"136-061-000-000-000-000-000\",\n exploitative_working_conditions: \"136-062-000-000-000-000-000\",\n fled_conflict_violence_or_persecution: \"136-063-000-000-000-000-000\",\n forced_to_commit_crimes: \"136-064-000-000-000-000-000\",\n forced_to_use_false_documents: \"136-065-000-000-000-000-000\",\n foreign_born_or_recently_arrived: \"136-066-000-000-000-000-000\",\n foreign_born_risk_factors: \"136-067-000-000-000-000-000\",\n frequent_changes_in_residence: \"136-068-000-000-000-000-000\",\n frequent_travel_or_location_changes: \"136-069-000-000-000-000-000\",\n frequently_at_hotels_or_many_hotel_keys: \"136-070-000-000-000-000-000\",\n harmful_coping_behaviors: \"136-071-000-000-000-000-000\",\n has_ads_on_commercial_sex_site: \"136-072-000-000-000-000-000\",\n has_facilitators_involved: \"136-073-000-000-000-000-000\",\n has_management_or_representation: \"136-074-000-000-000-000-000\",\n has_no_personal_items_or_possessions: \"136-075-000-000-000-000-000\",\n head_injury_history: \"136-076-000-000-000-000-000\",\n head_injury_loss_of_consciousness: \"136-077-000-000-000-000-000\",\n health_related_vulnerability: \"136-078-000-000-000-000-000\",\n hierarchical_management_structure_identified: \"136-079-000-000-000-000-000\",\n high_risk_sexual_behavior: \"136-080-000-000-000-000-000\",\n high_security_measures_at_work_or_living_location: \"136-081-000-000-000-000-000\",\n highly_irregular_school_attendance: \"136-082-000-000-000-000-000\",\n history_emotional_abuse: \"136-083-000-000-000-000-000\",\n history_of_head_injury: \"136-084-000-000-000-000-000\",\n history_of_mental_health_issues: \"136-085-000-000-000-000-000\",\n history_of_running_away_or_missing_from_care: \"136-086-000-000-000-000-000\",\n history_of_strangulation: \"136-087-000-000-000-000-000\",\n history_physical_or_sexual_abuse_or_dv: \"136-088-000-000-000-000-000\",\n homeless_or_unstably_housed: \"136-089-000-000-000-000-000\",\n immigration_related_exploitation_risk: \"136-090-000-000-000-000-000\",\n in_commercial_sex_industry_recorded: \"136-091-000-000-000-000-000\",\n inability_to_account_for_self: \"136-092-000-000-000-000-000\",\n intimate_partner_violence_reported_to_law_enforcement: \"136-093-000-000-000-000-000\",\n juvenile_justice_or_child_welfare_involvement: \"136-094-000-000-000-000-000\",\n juvenile_justice_system_involvement: \"136-095-000-000-000-000-000\",\n labor_services_activity_recorded: \"136-096-000-000-000-000-000\",\n lgbtq_individual: \"136-097-000-000-000-000-000\",\n limited_english_proficiency: \"136-098-000-000-000-000-000\",\n limited_independence: \"136-099-000-000-000-000-000\",\n lives_or_sleeps_at_place_of_work: \"136-100-000-000-000-000-000\",\n living_with_abuser: \"136-101-000-000-000-000-000\",\n macro_level_economic_duress_entry_exit: \"136-102-000-000-000-000-000\",\n meets_or_has_sex_with_internet_contacts: \"136-103-000-000-000-000-000\",\n monitored_or_isolated_by_controlling_party: \"136-104-000-000-000-000-000\",\n much_older_intimate_partner: \"136-105-000-000-000-000-000\",\n nervous_about_immigration_documentation: \"136-106-000-000-000-000-000\",\n network_aggregate_risk_score_high: \"136-107-000-000-000-000-000\",\n network_multiple_sex_providers_named: \"136-108-000-000-000-000-000\",\n network_stable_size_large: \"136-109-000-000-000-000-000\",\n network_trafficker_present: \"136-110-000-000-000-000-000\",\n network_violent_person_present: \"136-111-000-000-000-000-000\",\n new_to_commercial_sex_industry: \"136-112-000-000-000-000-000\",\n non_consensual_photography_or_recording: \"136-113-000-000-000-000-000\",\n not_in_control_of_immigration_documentation: \"136-114-000-000-000-000-000\",\n other_instability_or_vulnerability_factors: \"136-115-000-000-000-000-000\",\n owes_money_and_cannot_pay_off: \"136-116-000-000-000-000-000\",\n paid_or_owes_fee_to_arrange_travel_to_us: \"136-117-000-000-000-000-000\",\n paid_or_owes_recruitment_fee_to_employer: \"136-118-000-000-000-000-000\",\n parent_or_guardian_of_minor_subject_named: \"136-119-000-000-000-000-000\",\n past_phases_prior_trafficking_or_risk: \"136-120-000-000-000-000-000\",\n payment_routed_through_third_party: \"136-121-000-000-000-000-000\",\n pending_federal_protection: \"136-122-000-000-000-000-000\",\n performing_different_work_than_promised: \"136-123-000-000-000-000-000\",\n physical_violence_increasing: \"136-124-000-000-000-000-000\",\n poverty_or_severe_financial_strain: \"136-125-000-000-000-000-000\",\n precarious_immigration_status: \"136-126-000-000-000-000-000\",\n pressured_or_forced_sex_act: \"136-127-000-000-000-000-000\",\n prior_medical_attention_from_abuse: \"136-128-000-000-000-000-000\",\n prior_tvap_disconnection: \"136-129-000-000-000-000-000\",\n prior_victimization_or_abuse_history: \"136-130-000-000-000-000-000\",\n promise_of_work_different_than_current_work: \"136-131-000-000-000-000-000\",\n received_things_of_value_while_missing_from_care: \"136-132-000-000-000-000-000\",\n recent_le_engagement: \"136-133-000-000-000-000-000\",\n recruited_by_third_party_into_cs_industry: \"136-134-000-000-000-000-000\",\n regular_alcohol_use: \"136-135-000-000-000-000-000\",\n relies_on_temporary_resources_for_basic_needs: \"136-136-000-000-000-000-000\",\n reports_physical_harm_by_employer_or_partner: \"136-137-000-000-000-000-000\",\n reports_physical_harm_to_others_by_employer_or_partner: \"136-138-000-000-000-000-000\",\n restrictive_living_or_working_conditions: \"136-139-000-000-000-000-000\",\n restrictive_or_not_understood_contract: \"136-140-000-000-000-000-000\",\n risk_factors_commercial_sex: \"136-141-000-000-000-000-000\",\n serious_substance_use_or_introduced_to_drugs: \"136-142-000-000-000-000-000\",\n several_cell_phones_or_frequent_number_changes: \"136-143-000-000-000-000-000\",\n sex_acts_in_own_residence: \"136-144-000-000-000-000-000\",\n sexual_exploitation: \"136-145-000-000-000-000-000\",\n sexualized_content_performance_activity: \"136-146-000-000-000-000-000\",\n shared_contact_network: \"136-147-000-000-000-000-000\",\n signs_of_physical_abuse_confinement_or_neglect: \"136-148-000-000-000-000-000\",\n signs_of_physical_harm_or_abuse: \"136-149-000-000-000-000-000\",\n sleep_disturbance: \"136-150-000-000-000-000-000\",\n social_isolation_or_no_supportive_relationships: \"136-151-000-000-000-000-000\",\n stalking_property_intrusion: \"136-152-000-000-000-000-000\",\n stalking_surveillance: \"136-153-000-000-000-000-000\",\n stalking_unwanted_contact: \"136-154-000-000-000-000-000\",\n strangulation_acute_symptoms: \"136-155-000-000-000-000-000\",\n strangulation_choking_assault_detail: \"136-156-000-000-000-000-000\",\n strangulation_loss_of_consciousness: \"136-157-000-000-000-000-000\",\n strangulation_repeated: \"136-158-000-000-000-000-000\",\n subject_affiliated_org_trafficking_activity: \"136-159-000-000-000-000-000\",\n subject_arrested_dv_sv_cs: \"136-160-000-000-000-000-000\",\n subject_gang_org_affiliation: \"136-161-000-000-000-000-000\",\n subject_has_illegal_weapons: \"136-162-000-000-000-000-000\",\n subject_is_sex_offender: \"136-163-000-000-000-000-000\",\n subject_legally_barred_weapons: \"136-164-000-000-000-000-000\",\n subject_perpetrated_abuse_history: \"136-165-000-000-000-000-000\",\n subject_perpetrated_emotional_stalking_current: \"136-166-000-000-000-000-000\",\n subject_perpetrated_emotional_stalking_past: \"136-167-000-000-000-000-000\",\n subject_perpetrated_ipv_current: \"136-168-000-000-000-000-000\",\n subject_perpetrated_ipv_past: \"136-169-000-000-000-000-000\",\n subject_perpetrated_physical_abuse_current: \"136-170-000-000-000-000-000\",\n subject_perpetrated_physical_abuse_past: \"136-171-000-000-000-000-000\",\n subject_perpetrated_sexual_abuse_current: \"136-172-000-000-000-000-000\",\n subject_perpetrated_sexual_abuse_past: \"136-173-000-000-000-000-000\",\n subject_violent_felony: \"136-174-000-000-000-000-000\",\n substance_use_while_working: \"136-175-000-000-000-000-000\",\n suicidal_ideation_history: \"136-176-000-000-000-000-000\",\n suicidal_ideation_recent: \"136-177-000-000-000-000-000\",\n suicide_attempt_history: \"136-178-000-000-000-000-000\",\n third_party_advertises_or_posts_for_person: \"136-179-000-000-000-000-000\",\n third_party_arranged_commercial_sex_acts: \"136-180-000-000-000-000-000\",\n threats_by_employer_or_partner: \"136-181-000-000-000-000-000\",\n threats_of_harm: \"136-182-000-000-000-000-000\",\n threats_of_legal_trouble_or_deportation: \"136-183-000-000-000-000-000\",\n threats_related_to_migration_debt: \"136-184-000-000-000-000-000\",\n threats_to_family_friends_or_close_associates: \"136-185-000-000-000-000-000\",\n threats_to_kill_victim_or_children: \"136-186-000-000-000-000-000\",\n trafficking_experience_current: \"136-187-000-000-000-000-000\",\n trafficking_experience_past_10plusy: \"136-188-000-000-000-000-000\",\n trafficking_experience_past_3to10y: \"136-189-000-000-000-000-000\",\n trafficking_experience_past_lt3y: \"136-190-000-000-000-000-000\",\n travel_organized_by_third_party: \"136-191-000-000-000-000-000\",\n tricked_or_pressured_into_unwanted_acts: \"136-192-000-000-000-000-000\",\n under_18_advertised_age: \"136-193-000-000-000-000-000\",\n under_18_appears_underage: \"136-194-000-000-000-000-000\",\n under_18_known_age: \"136-195-000-000-000-000-000\",\n unexplained_frequent_travel_or_migration: \"136-196-000-000-000-000-000\",\n unsafe_working_conditions_long_hours_inadequate_breaks: \"136-197-000-000-000-000-000\",\n unusual_cash_or_unexplained_gifts: \"136-198-000-000-000-000-000\",\n unusual_work_circumstances: \"136-199-000-000-000-000-000\",\n urgent_medical_referral_needed: \"136-200-000-000-000-000-000\",\n victim_believes_abuser_capable_of_killing: \"136-201-000-000-000-000-000\",\n victimization_history_composite: \"136-202-000-000-000-000-000\",\n violence_or_threats_at_work_site: \"136-203-000-000-000-000-000\",\n weapon_used_or_threatened_against_victim: \"136-204-000-000-000-000-000\",\n work_frequency_high_volume: \"136-205-000-000-000-000-000\",\n working_while_pregnant: \"136-206-000-000-000-000-000\",\n workplace_emotional_climate_of_fear: \"136-207-000-000-000-000-000\",\n works_across_multiple_cities_or_locations: \"136-208-000-000-000-000-000\",\n works_for_little_or_no_pay: \"136-209-000-000-000-000-000\",\n youth_watched_filmed_or_photographed_sexually_explicit: \"136-210-000-000-000-000-000\",\n clients_unaware_of_third_party_coordination: \"136-211-000-000-000-000-000\",\n depends_on_spouse_or_family_for_immigration_status: \"136-212-000-000-000-000-000\",\n sexualized_content_in_person_performance_activity: \"136-213-000-000-000-000-000\",\n sexualized_content_online_performance_activity: \"136-214-000-000-000-000-000\",\n trauma_perpetrator_is_current_manager: \"136-215-000-000-000-000-000\",\n active_protective_order: \"136-216-000-000-000-000-000\",\n disclosed_fear_at_intake: \"136-217-000-000-000-000-000\",\n does_not_control_housing: \"136-218-000-000-000-000-000\",\n oppressive_home_life: \"136-219-000-000-000-000-000\",\n recent_separation: \"136-220-000-000-000-000-000\",\n survival_sex: \"136-221-000-000-000-000-000\",\n unable_to_speak_freely: \"136-222-000-000-000-000-000\",\n potential_trafficking_victim_recorded: \"136-223-000-000-000-000-000\",\n} as const;\n\nexport type CoreIndicatorKey = keyof typeof CoreIndicatorKeys;\n\n/**\n * Key → positional code map for the `risk_identification_milestone` CVC domain (CVC-267, ratified 2026-08-29). The identification-FUNNEL rung value set — the vocabulary `assertion_value_code` resolves against for the `identification_rung_reached` CAR. Four rungs store `assertion_domain` `signal_identification` (CVC-159 159-066); `determined` stores `investigative_legal` (159-067) and is documented under both (filed-under-both ruling 2026-08-29). Each entry carries its stored `assertionDomain` so a consumer can route a rung without a second table. Deliberately its OWN vocabulary, not Level-2 rows inside CVC-159: `AssertionDomainKeys` is the set of DOMAINS, and folding values in would make `on_radar` demand a domain classification downstream. The milestone-symmetry no-state row is absent: reaching no rung is the ABSENCE of rows.\n *\n * Domain: `risk_identification_milestone` · Version: 1.0.0 · Entries: 9\n */\nexport const RiskIdentificationMilestoneKeys = {\n missingness_root: \"267-000-000-000-000-000-000\",\n unknown: \"267-000-000-000-000-000-001\",\n anonymous: \"267-000-000-000-000-000-002\",\n data_not_collected: \"267-000-000-000-000-000-003\",\n on_radar: \"267-001-000-000-000-000-000\",\n screened: \"267-002-000-000-000-000-000\",\n at_risk: \"267-003-000-000-000-000-000\",\n assessed: \"267-004-000-000-000-000-000\",\n determined: \"267-005-000-000-000-000-000\",\n} as const;\n\nexport type RiskIdentificationMilestoneKey = keyof typeof RiskIdentificationMilestoneKeys;\n\n/**\n * Key → positional code map for the `risk_severity_band` CVC domain (CVC-238, VERIFIED). Replaces the withdrawn provisional `risk_band` (981). Carries the load-bearing `lowerBand` thresholds 0/20/40/60/80 that the milestone band-crossing trigger reads.\n *\n * Domain: `risk_severity_band` · Version: 1.0.0 · Entries: 9\n */\nexport const RiskSeverityBandKeys = {\n missingness_root: \"238-000-000-000-000-000-000\",\n unknown: \"238-000-000-000-000-000-001\",\n anonymous: \"238-000-000-000-000-000-002\",\n data_not_collected: \"238-000-000-000-000-000-003\",\n risk_1: \"238-001-000-000-000-000-000\",\n risk_2: \"238-002-000-000-000-000-000\",\n risk_3: \"238-003-000-000-000-000-000\",\n risk_4: \"238-004-000-000-000-000-000\",\n risk_5: \"238-005-000-000-000-000-000\",\n} as const;\n\nexport type RiskSeverityBandKey = keyof typeof RiskSeverityBandKeys;\n\n/**\n * Key → positional code map for the `admin_roles` CVC domain (CVC-134). Administrative / control-plane role axis of the canonical authorization model (IC-66; admin ≠ content visibility); distinct from CVC-135 `user_roles`. SOT v2.0.0 is GENERATED from the prototype repo's data/cvcs/core_admin_role.yaml by scripts/gen-admin-roles.py. Keys transliterate canon's hyphenated codes (`PLT-ADM` → `plt_adm`; canon spelling on `canonicalCode`). No missingness keys (the 1.0.0 quadruplet is withdrawn). Canon's legacy `ACCT-ADM` resolves to `mem_adm` through `adminRolesSot._supersedes.keyMap`, which is key-space (look up `acct_adm`: lowercase, `-` → `_`).\n *\n * Domain: `admin_roles` · Version: 2.0.0 · Entries: 10\n */\nexport const AdminRoleKeys = {\n plt_adm: \"134-001-000-000-000-000-000\",\n plt_sup: \"134-002-000-000-000-000-000\",\n mem_adm: \"134-003-000-000-000-000-000\",\n team_adm: \"134-004-000-000-000-000-000\",\n aud: \"134-005-000-000-000-000-000\",\n data_adm: \"134-006-000-000-000-000-000\",\n gov_aud: \"134-007-000-000-000-000-000\",\n ciro: \"134-008-000-000-000-000-000\",\n sup: \"134-009-000-000-000-000-000\",\n train_adm: \"134-010-000-000-000-000-000\",\n} as const;\n\nexport type AdminRoleKey = keyof typeof AdminRoleKeys;\n\n/**\n * Key → positional code map for the `user_roles` CVC domain (CVC-135). Operational / practitioner role axis of the canonical authorization model (IC-66); distinct from CVC-134 `admin_roles`. SOT v2.0.0 is GENERATED from the prototype repo's data/cvcs/core_user_role.yaml by scripts/gen-user-roles.py; canon re-keyed `hotline_op` to `crisis_response` at the same code (135-004). No missingness keys (the 1.0.0 quadruplet is withdrawn; a role is assigned, never observed). A stored `hotline_op`, or canon's legacy `case_advocate` / `leads_investigator`, resolves through `userRolesSot._supersedes.keyMap`.\n *\n * Domain: `user_roles` · Version: 2.0.0 · Entries: 15\n */\nexport const UserRoleKeys = {\n case_nav: \"135-001-000-000-000-000-000\",\n healthcare_provider_medical: \"135-002-000-000-000-000-000\",\n behavioral_health_provider: \"135-003-000-000-000-000-000\",\n crisis_response: \"135-004-000-000-000-000-000\",\n intel_analyst: \"135-005-000-000-000-000-000\",\n investigator: \"135-006-000-000-000-000-000\",\n le_liaison_vsp: \"135-007-000-000-000-000-000\",\n legal_advocate: \"135-008-000-000-000-000-000\",\n mandatory_reporter: \"135-009-000-000-000-000-000\",\n mdt_participant: \"135-010-000-000-000-000-000\",\n prosecutor_review: \"135-011-000-000-000-000-000\",\n public_reporter: \"135-012-000-000-000-000-000\",\n research_analytics: \"135-013-000-000-000-000-000\",\n screener: \"135-014-000-000-000-000-000\",\n volunteer: \"135-015-000-000-000-000-000\",\n} as const;\n\nexport type UserRoleKey = keyof typeof UserRoleKeys;\n\n/**\n * Key → positional code map for the `hmis_current_living_situation` CVC domain (CVC-193). The HUD-reporting crosswalk vocabulary (HMIS FY2026 4.12 numeric codes); a DISTINCT CVC from CVC-192 `living_situation` (the internal semantic vocabulary). Keys are `hmis_<code>`; the numeric code is in `hmisCode`.\n *\n * Domain: `hmis_current_living_situation` · Version: 1.0.0 · Entries: 33\n */\nexport const HmisCurrentLivingSituationKeys = {\n missingness_root: \"193-000-000-000-000-000-000\",\n unknown: \"193-000-000-000-000-000-001\",\n anonymous: \"193-000-000-000-000-000-002\",\n data_not_collected: \"193-000-000-000-000-000-003\",\n hmis_17: \"193-001-000-000-000-000-000\",\n hmis_24: \"193-002-000-000-000-000-000\",\n hmis_30: \"193-003-000-000-000-000-000\",\n hmis_37: \"193-004-000-000-000-000-000\",\n hmis_101: \"193-005-000-000-000-000-000\",\n hmis_116: \"193-006-000-000-000-000-000\",\n hmis_118: \"193-007-000-000-000-000-000\",\n hmis_204: \"193-008-000-000-000-000-000\",\n hmis_205: \"193-009-000-000-000-000-000\",\n hmis_206: \"193-010-000-000-000-000-000\",\n hmis_207: \"193-011-000-000-000-000-000\",\n hmis_215: \"193-012-000-000-000-000-000\",\n hmis_225: \"193-013-000-000-000-000-000\",\n hmis_302: \"193-014-000-000-000-000-000\",\n hmis_312: \"193-015-000-000-000-000-000\",\n hmis_313: \"193-016-000-000-000-000-000\",\n hmis_314: \"193-017-000-000-000-000-000\",\n hmis_327: \"193-018-000-000-000-000-000\",\n hmis_329: \"193-019-000-000-000-000-000\",\n hmis_332: \"193-020-000-000-000-000-000\",\n hmis_335: \"193-021-000-000-000-000-000\",\n hmis_336: \"193-022-000-000-000-000-000\",\n hmis_410: \"193-023-000-000-000-000-000\",\n hmis_411: \"193-024-000-000-000-000-000\",\n hmis_421: \"193-025-000-000-000-000-000\",\n hmis_422: \"193-026-000-000-000-000-000\",\n hmis_423: \"193-027-000-000-000-000-000\",\n hmis_426: \"193-028-000-000-000-000-000\",\n hmis_435: \"193-029-000-000-000-000-000\",\n} as const;\n\nexport type HmisCurrentLivingSituationKey = keyof typeof HmisCurrentLivingSituationKeys;\n\n/**\n * Key → positional code map for the `juvenile_justice_episode_type` CVC domain (CVC-197). Types the EPISODE; distinct from CVC-95 `juvenile_justice_involvement_status` (the point-in-time status).\n *\n * Domain: `juvenile_justice_episode_type` · Version: 1.0.0 · Entries: 9\n */\nexport const JuvenileJusticeEpisodeTypeKeys = {\n missingness_root: \"197-000-000-000-000-000-000\",\n unknown: \"197-000-000-000-000-000-001\",\n anonymous: \"197-000-000-000-000-000-002\",\n data_not_collected: \"197-000-000-000-000-000-003\",\n pending_adjudication: \"197-001-000-000-000-000-000\",\n diversion_program: \"197-002-000-000-000-000-000\",\n residential_jj_placement: \"197-003-000-000-000-000-000\",\n probation_supervision: \"197-004-000-000-000-000-000\",\n detention_stay: \"197-005-000-000-000-000-000\",\n} as const;\n\nexport type JuvenileJusticeEpisodeTypeKey = keyof typeof JuvenileJusticeEpisodeTypeKeys;\n\n/**\n * Key → positional code map for the `incarceration_episode_type` CVC domain (CVC-198).\n *\n * Domain: `incarceration_episode_type` · Version: 1.0.0 · Entries: 9\n */\nexport const IncarcerationEpisodeTypeKeys = {\n missingness_root: \"198-000-000-000-000-000-000\",\n unknown: \"198-000-000-000-000-000-001\",\n anonymous: \"198-000-000-000-000-000-002\",\n data_not_collected: \"198-000-000-000-000-000-003\",\n jail: \"198-001-000-000-000-000-000\",\n detention: \"198-002-000-000-000-000-000\",\n prison: \"198-003-000-000-000-000-000\",\n immigration_detention: \"198-004-000-000-000-000-000\",\n work_release_or_halfway_house_custody: \"198-005-000-000-000-000-000\",\n} as const;\n\nexport type IncarcerationEpisodeTypeKey = keyof typeof IncarcerationEpisodeTypeKeys;\n\n/**\n * Key → positional code map for the `exploitation_type` CVC domain (CVC-203). Domain-level determination codes for exploitation outcomes that are NOT trafficking determinations; distinct from CVC-72 `ht_type`.\n *\n * Domain: `exploitation_type` · Version: 1.0.0 · Entries: 9\n */\nexport const ExploitationTypeKeys = {\n missingness_root: \"203-000-000-000-000-000-000\",\n unknown: \"203-000-000-000-000-000-001\",\n anonymous: \"203-000-000-000-000-000-002\",\n data_not_collected: \"203-000-000-000-000-000-003\",\n no_exploitation_determined: \"203-001-000-000-000-000-000\",\n commercial_sexual_exploitation_of_minor_domain_determination: \"203-002-000-000-000-000-000\",\n labor_exploitation_non_trafficking: \"203-003-000-000-000-000-000\",\n sexual_exploitation_non_trafficking: \"203-004-000-000-000-000-000\",\n commercial_sexual_exploitation_domain_determination: \"203-005-000-000-000-000-000\",\n} as const;\n\nexport type ExploitationTypeKey = keyof typeof ExploitationTypeKeys;\n\n/**\n * Key → positional code map for the `source_system` CVC domain (CVC-201). Part of the assertion provenance contract with CVC-140 `source_category`, CVC-141 `source_subtype` and CVC-209 `source_instrument`.\n *\n * Domain: `source_system` · Version: 1.0.0 · Entries: 19\n */\nexport const SourceSystemKeys = {\n missingness_root: \"201-000-000-000-000-000-000\",\n unknown: \"201-000-000-000-000-000-001\",\n anonymous: \"201-000-000-000-000-000-002\",\n data_not_collected: \"201-000-000-000-000-000-003\",\n cityxguide: \"201-001-000-000-000-000-000\",\n sipsap: \"201-002-000-000-000-000-000\",\n adultsearch: \"201-003-000-000-000-000-000\",\n backpage: \"201-004-000-000-000-000-000\",\n listcrawler: \"201-005-000-000-000-000-000\",\n rubmaps: \"201-006-000-000-000-000-000\",\n skipthegames: \"201-007-000-000-000-000-000\",\n twilio: \"201-008-000-000-000-000-000\",\n facebook: \"201-009-000-000-000-000-000\",\n hti_platform_internal: \"201-010-000-000-000-000-000\",\n clear: \"201-011-000-000-000-000-000\",\n axon: \"201-012-000-000-000-000-000\",\n accurint: \"201-013-000-000-000-000-000\",\n the_erotic_review: \"201-014-000-000-000-000-000\",\n ncic: \"201-015-000-000-000-000-000\",\n} as const;\n\nexport type SourceSystemKey = keyof typeof SourceSystemKeys;\n\n/**\n * Key → positional code map for the `source_instrument` CVC domain (CVC-209). The instrument through which an assertion's value was captured; part of the assertion provenance contract.\n *\n * Domain: `source_instrument` · Version: 1.1.0 · Entries: 115\n */\nexport const SourceInstrumentKeys = {\n missingness_root: \"209-000-000-000-000-000-000\",\n unknown: \"209-000-000-000-000-000-001\",\n anonymous: \"209-000-000-000-000-000-002\",\n data_not_collected: \"209-000-000-000-000-000-003\",\n hti_leads_manual_entry: \"209-001-000-000-000-000-000\",\n hti_pave_ida: \"209-002-000-000-000-000-000\",\n hti_thread_intake_workflow: \"209-003-000-000-000-000-000\",\n hti_file_upload_csv_import: \"209-004-000-000-000-000-000\",\n hti_leads_edit_correction: \"209-005-000-000-000-000-000\",\n hti_rules_engine_derivation: \"209-006-000-000-000-000-000\",\n hti_screening_tool_other: \"209-007-000-000-000-000-000\",\n vendor_twilio_lookup: \"209-008-000-000-000-000-000\",\n hti_model_inference_output: \"209-009-000-000-000-000-000\",\n hti_api_import: \"209-010-000-000-000-000-000\",\n hti_osint_scraper_run: \"209-011-000-000-000-000-000\",\n hti_pave_is: \"209-012-000-000-000-000-000\",\n hti_danger_assessment: \"209-013-000-000-000-000-000\",\n hti_lethality_assessment: \"209-014-000-000-000-000-000\",\n hti_leads_tra: \"209-015-000-000-000-000-000\",\n hti_stalking_assessment: \"209-016-000-000-000-000-000\",\n hti_needs_assessment: \"209-017-000-000-000-000-000\",\n hti_bh_intake: \"209-018-000-000-000-000-000\",\n hti_mh_intake: \"209-019-000-000-000-000-000\",\n hti_strangulation_injury: \"209-020-000-000-000-000-000\",\n hti_sud_screen: \"209-021-000-000-000-000-000\",\n hti_ocat_hts: \"209-022-000-000-000-000-000\",\n hti_ae_intake: \"209-023-000-000-000-000-000\",\n hti_tcs_intake: \"209-024-000-000-000-000-000\",\n hti_pave_service_log: \"209-025-000-000-000-000-000\",\n thread_pave_service_log: \"209-026-000-000-000-000-000\",\n hti_leads_milestone_log: \"209-027-000-000-000-000-000\",\n hti_leads_triage_workflow: \"209-028-000-000-000-000-000\",\n hti_leads_findings: \"209-029-000-000-000-000-000\",\n hti_leads_deconfliction: \"209-030-000-000-000-000-000\",\n hti_leads_case_lifecycle: \"209-031-000-000-000-000-000\",\n hti_leads_entity_resolution: \"209-032-000-000-000-000-000\",\n hti_leads_network_mapping: \"209-033-000-000-000-000-000\",\n hti_leads_pattern_match: \"209-034-000-000-000-000-000\",\n hti_leads_search_hit: \"209-035-000-000-000-000-000\",\n hti_leads_intake_processing: \"209-036-000-000-000-000-000\",\n hti_leads_incarceration_episode: \"209-037-000-000-000-000-000\",\n hti_hope_scale: \"209-038-000-000-000-000-000\",\n hti_core_profile: \"209-039-000-000-000-000-000\",\n hti_pave_persons_network: \"209-040-000-000-000-000-000\",\n hti_pave_victimizations: \"209-041-000-000-000-000-000\",\n hti_pave_intake_workflow: \"209-042-000-000-000-000-000\",\n hti_pave_case_view: \"209-043-000-000-000-000-000\",\n hti_directory_entry: \"209-044-000-000-000-000-000\",\n hti_pave_milestone_derivation: \"209-045-000-000-000-000-000\",\n hti_track1_identification_derivation: \"209-046-000-000-000-000-000\",\n hti_investigative_outcomes_vetting: \"209-047-000-000-000-000-000\",\n hti_risk_band_crossing: \"209-048-000-000-000-000-000\",\n hti_leads_actionability: \"209-049-000-000-000-000-000\",\n hti_leads_ad_extraction: \"209-050-000-000-000-000-000\",\n hti_leads_ad_address: \"209-051-000-000-000-000-000\",\n hti_leads_ad_age: \"209-052-000-000-000-000-000\",\n hti_leads_ad_age_indicator: \"209-053-000-000-000-000-000\",\n hti_leads_ad_available_anytime: \"209-054-000-000-000-000-000\",\n hti_leads_available_anytime_indicator: \"209-055-000-000-000-000-000\",\n hti_leads_ad_client_pref: \"209-056-000-000-000-000-000\",\n hti_leads_ad_common_domain: \"209-057-000-000-000-000-000\",\n hti_leads_ad_content_classifier: \"209-058-000-000-000-000-000\",\n hti_leads_ad_spam_detection: \"209-059-000-000-000-000-000\",\n hti_leads_person_aggregation: \"209-060-000-000-000-000-000\",\n hti_leads_ad_cs_profile: \"209-061-000-000-000-000-000\",\n hti_leads_ad_email: \"209-062-000-000-000-000-000\",\n hti_leads_facilitation_likelihood: \"209-063-000-000-000-000-000\",\n hti_leads_ad_foreign_classifier: \"209-064-000-000-000-000-000\",\n hti_leads_ad_foreign_indicator: \"209-065-000-000-000-000-000\",\n hti_leads_ad_foreign_phone: \"209-066-000-000-000-000-000\",\n hti_leads_ad_gender: \"209-067-000-000-000-000-000\",\n hti_leads_ad_hispanic_latino: \"209-068-000-000-000-000-000\",\n hti_leads_ad_improbable_age: \"209-069-000-000-000-000-000\",\n hti_leads_ad_improbable_handle: \"209-070-000-000-000-000-000\",\n hti_leads_ad_location: \"209-071-000-000-000-000-000\",\n hti_leads_ad_main_race: \"209-072-000-000-000-000-000\",\n hti_leads_ad_min_age: \"209-073-000-000-000-000-000\",\n hti_leads_multi_city_indicator: \"209-074-000-000-000-000-000\",\n hti_leads_ad_multiple_persons: \"209-075-000-000-000-000-000\",\n hti_leads_multiple_workers_indicator: \"209-076-000-000-000-000-000\",\n hti_leads_ad_name: \"209-077-000-000-000-000-000\",\n hti_leads_ad_nation_region: \"209-078-000-000-000-000-000\",\n hti_leads_network_aggregation: \"209-079-000-000-000-000-000\",\n hti_leads_ad_new_phone: \"209-080-000-000-000-000-000\",\n hti_leads_ad_new_pics: \"209-081-000-000-000-000-000\",\n hti_leads_ad_new_to_area: \"209-082-000-000-000-000-000\",\n hti_leads_ad_new_to_industry: \"209-083-000-000-000-000-000\",\n hti_leads_no_protection_indicator: \"209-084-000-000-000-000-000\",\n hti_leads_ad_org_name: \"209-085-000-000-000-000-000\",\n hti_leads_ad_org_related: \"209-086-000-000-000-000-000\",\n hti_leads_ad_origin_country: \"209-087-000-000-000-000-000\",\n hti_leads_ad_payment_method: \"209-088-000-000-000-000-000\",\n hti_leads_ad_phone: \"209-089-000-000-000-000-000\",\n hti_leads_phone_rotation_indicator: \"209-090-000-000-000-000-000\",\n hti_leads_ad_pregnant: \"209-091-000-000-000-000-000\",\n hti_leads_ad_price: \"209-092-000-000-000-000-000\",\n hti_leads_ad_price_per_hr: \"209-093-000-000-000-000-000\",\n hti_leads_price_tier_pooled: \"209-094-000-000-000-000-000\",\n hti_leads_recommended_acts: \"209-095-000-000-000-000-000\",\n hti_leads_ad_remote_only: \"209-096-000-000-000-000-000\",\n hti_leads_trafficking_likelihood: \"209-097-000-000-000-000-000\",\n hti_leads_ad_screening: \"209-098-000-000-000-000-000\",\n hti_leads_ad_services: \"209-099-000-000-000-000-000\",\n hti_leads_severity: \"209-100-000-000-000-000-000\",\n hti_leads_ad_sm_profile: \"209-101-000-000-000-000-000\",\n hti_leads_evidence_strength: \"209-102-000-000-000-000-000\",\n hti_leads_ad_substance_use: \"209-103-000-000-000-000-000\",\n hti_leads_ad_survival_indicator: \"209-104-000-000-000-000-000\",\n hti_leads_threats_classifier: \"209-105-000-000-000-000-000\",\n hti_leads_ad_aggregation: \"209-106-000-000-000-000-000\",\n hti_leads_ad_url_type: \"209-107-000-000-000-000-000\",\n hti_leads_ad_valid_email: \"209-108-000-000-000-000-000\",\n hti_leads_ad_valid_phone: \"209-109-000-000-000-000-000\",\n hti_leads_ad_venue: \"209-110-000-000-000-000-000\",\n hti_leads_ad_website: \"209-111-000-000-000-000-000\",\n} as const;\n\nexport type SourceInstrumentKey = keyof typeof SourceInstrumentKeys;\n\n/**\n * Key → positional code map for the `po_petition_basis` CVC domain (CVC-213). Protection Orders (IC-62).\n *\n * Domain: `po_petition_basis` · Version: 1.0.0 · Entries: 8\n */\nexport const PoPetitionBasisKeys = {\n missingness_root: \"213-000-000-000-000-000-000\",\n unknown: \"213-000-000-000-000-000-001\",\n anonymous: \"213-000-000-000-000-000-002\",\n data_not_collected: \"213-000-000-000-000-000-003\",\n dv: \"213-001-000-000-000-000-000\",\n har: \"213-002-000-000-000-000-000\",\n sa: \"213-003-000-000-000-000-000\",\n other: \"213-004-000-000-000-000-000\",\n} as const;\n\nexport type PoPetitionBasisKey = keyof typeof PoPetitionBasisKeys;\n\n/**\n * Key → positional code map for the `po_status` CVC domain (CVC-214). Protection Orders (IC-62). The canonical lifecycle stage is carried per-entry in `lifecycleStage`; the vocabulary itself is flat.\n *\n * Domain: `po_status` · Version: 1.0.0 · Entries: 12\n */\nexport const PoStatusKeys = {\n missingness_root: \"214-000-000-000-000-000-000\",\n unknown: \"214-000-000-000-000-000-001\",\n anonymous: \"214-000-000-000-000-000-002\",\n data_not_collected: \"214-000-000-000-000-000-003\",\n filed: \"214-001-000-000-000-000-000\",\n ex_parte_granted: \"214-002-000-000-000-000-000\",\n hearing_pending: \"214-003-000-000-000-000-000\",\n denied_outright: \"214-004-000-000-000-000-000\",\n final_granted: \"214-005-000-000-000-000-000\",\n final_denied_or_dismissed: \"214-006-000-000-000-000-000\",\n expired: \"214-007-000-000-000-000-000\",\n emergency: \"214-008-000-000-000-000-000\",\n} as const;\n\nexport type PoStatusKey = keyof typeof PoStatusKeys;\n\n/**\n * Key → positional code map for the `po_violation_status` CVC domain (CVC-215). Protection Orders (IC-62).\n *\n * Domain: `po_violation_status` · Version: 1.0.0 · Entries: 6\n */\nexport const PoViolationStatusKeys = {\n missingness_root: \"215-000-000-000-000-000-000\",\n unknown: \"215-000-000-000-000-000-001\",\n anonymous: \"215-000-000-000-000-000-002\",\n data_not_collected: \"215-000-000-000-000-000-003\",\n violated: \"215-001-000-000-000-000-000\",\n notviolated: \"215-002-000-000-000-000-000\",\n} as const;\n\nexport type PoViolationStatusKey = keyof typeof PoViolationStatusKeys;\n\n/**\n * Key → positional code map for the `session_template` CVC domain (CVC-217). Canonical session templates across PAVE / Thread / LEADS; distinct from CVC-216 `session_state`.\n *\n * Domain: `session_template` · Version: 1.0.0 · Entries: 25\n */\nexport const SessionTemplateKeys = {\n missingness_root: \"217-000-000-000-000-000-000\",\n unknown: \"217-000-000-000-000-000-001\",\n anonymous: \"217-000-000-000-000-000-002\",\n data_not_collected: \"217-000-000-000-000-000-003\",\n cst_pave_other: \"217-001-000-000-000-000-000\",\n cst_pave_program_exit: \"217-002-000-000-000-000-000\",\n cst_pave_client_update: \"217-003-000-000-000-000-000\",\n cst_pave_program_intake_existing: \"217-004-000-000-000-000-000\",\n cst_pave_new_client: \"217-005-000-000-000-000-000\",\n cst_thread_other: \"217-006-000-000-000-000-000\",\n cst_thread_in_person_not_field: \"217-007-000-000-000-000-000\",\n cst_thread_misc_call: \"217-008-000-000-000-000-000\",\n cst_thread_text_email: \"217-009-000-000-000-000-000\",\n cst_thread_field_response: \"217-010-000-000-000-000-000\",\n cst_thread_lap_incident: \"217-011-000-000-000-000-000\",\n cst_thread_hotline_call: \"217-012-000-000-000-000-000\",\n cst_leads_other: \"217-013-000-000-000-000-000\",\n cst_leads_database_query: \"217-014-000-000-000-000-000\",\n cst_leads_case_update: \"217-015-000-000-000-000-000\",\n cst_leads_new_report: \"217-016-000-000-000-000-000\",\n cst_leads_new_case: \"217-017-000-000-000-000-000\",\n cst_leads_new_lead_tip: \"217-018-000-000-000-000-000\",\n cst_unk_other_virtual: \"217-019-000-000-000-000-000\",\n cst_pave_inbound_share: \"217-020-000-000-000-000-000\",\n cst_thread_inbound_share: \"217-021-000-000-000-000-000\",\n} as const;\n\nexport type SessionTemplateKey = keyof typeof SessionTemplateKeys;\n\n/**\n * Key → positional code map for the `service_delivery_channel` CVC domain (CVC-47, canonical). HOW a service was delivered; sibling axis to CVC-25 `service_mechanisms` and CVC-49 `service_states`. `GROUP_INPERSON` / `GROUP_REMOTE` are flagged local extensions.\n *\n * Domain: `service_delivery_channel` · Version: 1.0.0 · Entries: 11\n */\nexport const ServiceDeliveryChannelKeys = {\n missingness_root: \"047-000-000-000-000-000-000\",\n unknown: \"047-000-000-000-000-000-001\",\n anonymous: \"047-000-000-000-000-000-002\",\n data_not_collected: \"047-000-000-000-000-000-003\",\n phone: \"047-001-000-000-000-000-000\",\n in_person: \"047-002-000-000-000-000-000\",\n on_scene: \"047-003-000-000-000-000-000\",\n virtual: \"047-004-000-000-000-000-000\",\n email_text_chat: \"047-005-000-000-000-000-000\",\n group_inperson: \"047-006-000-000-000-000-000\",\n group_remote: \"047-007-000-000-000-000-000\",\n} as const;\n\nexport type ServiceDeliveryChannelKey = keyof typeof ServiceDeliveryChannelKeys;\n\n/**\n * Key → positional code map for the `citizenship` CVC domain (CVC-182, provisional-pending-notion-ratification). 249 countries + the canonical 3-value missingness set. Positional codes are MINTED platform-common-side: the upstream Notion codebook's Code column is blank on all 252 rows. The authoritative ISO 3166-1 alpha-2 code rides on each entry as `iso31661Alpha2`.\n *\n * Domain: `citizenship` · Version: 1.0.0 · Entries: 253\n */\nexport const CitizenshipKeys = {\n missingness_root: \"182-000-000-000-000-000-000\",\n unknown: \"182-000-000-000-000-000-001\",\n anonymous: \"182-000-000-000-000-000-002\",\n data_not_collected: \"182-000-000-000-000-000-003\",\n afghanistan: \"182-001-000-000-000-000-000\",\n aland_islands: \"182-002-000-000-000-000-000\",\n albania: \"182-003-000-000-000-000-000\",\n algeria: \"182-004-000-000-000-000-000\",\n american_samoa: \"182-005-000-000-000-000-000\",\n andorra: \"182-006-000-000-000-000-000\",\n angola: \"182-007-000-000-000-000-000\",\n anguilla: \"182-008-000-000-000-000-000\",\n antarctica: \"182-009-000-000-000-000-000\",\n antigua_and_barbuda: \"182-010-000-000-000-000-000\",\n argentina: \"182-011-000-000-000-000-000\",\n armenia: \"182-012-000-000-000-000-000\",\n aruba: \"182-013-000-000-000-000-000\",\n australia: \"182-014-000-000-000-000-000\",\n austria: \"182-015-000-000-000-000-000\",\n azerbaijan: \"182-016-000-000-000-000-000\",\n bahamas: \"182-017-000-000-000-000-000\",\n bahrain: \"182-018-000-000-000-000-000\",\n bangladesh: \"182-019-000-000-000-000-000\",\n barbados: \"182-020-000-000-000-000-000\",\n belarus: \"182-021-000-000-000-000-000\",\n belgium: \"182-022-000-000-000-000-000\",\n belize: \"182-023-000-000-000-000-000\",\n benin: \"182-024-000-000-000-000-000\",\n bermuda: \"182-025-000-000-000-000-000\",\n bhutan: \"182-026-000-000-000-000-000\",\n bolivia_plurinational_state_of: \"182-027-000-000-000-000-000\",\n bonaire_sint_eustatius_and_saba: \"182-028-000-000-000-000-000\",\n bosnia_and_herzegovina: \"182-029-000-000-000-000-000\",\n botswana: \"182-030-000-000-000-000-000\",\n bouvet_island: \"182-031-000-000-000-000-000\",\n brazil: \"182-032-000-000-000-000-000\",\n british_indian_ocean_territory: \"182-033-000-000-000-000-000\",\n brunei_darussalam: \"182-034-000-000-000-000-000\",\n bulgaria: \"182-035-000-000-000-000-000\",\n burkina_faso: \"182-036-000-000-000-000-000\",\n burundi: \"182-037-000-000-000-000-000\",\n cambodia: \"182-038-000-000-000-000-000\",\n cameroon: \"182-039-000-000-000-000-000\",\n canada: \"182-040-000-000-000-000-000\",\n cape_verde: \"182-041-000-000-000-000-000\",\n cayman_islands: \"182-042-000-000-000-000-000\",\n central_african_republic: \"182-043-000-000-000-000-000\",\n chad: \"182-044-000-000-000-000-000\",\n chile: \"182-045-000-000-000-000-000\",\n china: \"182-046-000-000-000-000-000\",\n christmas_island: \"182-047-000-000-000-000-000\",\n cocos_keeling_islands: \"182-048-000-000-000-000-000\",\n colombia: \"182-049-000-000-000-000-000\",\n comoros: \"182-050-000-000-000-000-000\",\n congo: \"182-051-000-000-000-000-000\",\n congo_the_democratic_republic_of_the: \"182-052-000-000-000-000-000\",\n cook_islands: \"182-053-000-000-000-000-000\",\n costa_rica: \"182-054-000-000-000-000-000\",\n cote_d_ivoire: \"182-055-000-000-000-000-000\",\n croatia: \"182-056-000-000-000-000-000\",\n cuba: \"182-057-000-000-000-000-000\",\n curacao: \"182-058-000-000-000-000-000\",\n cyprus: \"182-059-000-000-000-000-000\",\n czech_republic: \"182-060-000-000-000-000-000\",\n denmark: \"182-061-000-000-000-000-000\",\n djibouti: \"182-062-000-000-000-000-000\",\n dominica: \"182-063-000-000-000-000-000\",\n dominican_republic: \"182-064-000-000-000-000-000\",\n ecuador: \"182-065-000-000-000-000-000\",\n egypt: \"182-066-000-000-000-000-000\",\n el_salvador: \"182-067-000-000-000-000-000\",\n equatorial_guinea: \"182-068-000-000-000-000-000\",\n eritrea: \"182-069-000-000-000-000-000\",\n estonia: \"182-070-000-000-000-000-000\",\n ethiopia: \"182-071-000-000-000-000-000\",\n falkland_islands_malvinas: \"182-072-000-000-000-000-000\",\n faroe_islands: \"182-073-000-000-000-000-000\",\n fiji: \"182-074-000-000-000-000-000\",\n finland: \"182-075-000-000-000-000-000\",\n france: \"182-076-000-000-000-000-000\",\n french_guiana: \"182-077-000-000-000-000-000\",\n french_polynesia: \"182-078-000-000-000-000-000\",\n french_southern_territories: \"182-079-000-000-000-000-000\",\n gabon: \"182-080-000-000-000-000-000\",\n gambia: \"182-081-000-000-000-000-000\",\n georgia: \"182-082-000-000-000-000-000\",\n ghana: \"182-083-000-000-000-000-000\",\n germany: \"182-084-000-000-000-000-000\",\n gibraltar: \"182-085-000-000-000-000-000\",\n greece: \"182-086-000-000-000-000-000\",\n greenland: \"182-087-000-000-000-000-000\",\n grenada: \"182-088-000-000-000-000-000\",\n guadeloupe: \"182-089-000-000-000-000-000\",\n guam: \"182-090-000-000-000-000-000\",\n guatemala: \"182-091-000-000-000-000-000\",\n guernsey: \"182-092-000-000-000-000-000\",\n guinea: \"182-093-000-000-000-000-000\",\n guinea_bissau: \"182-094-000-000-000-000-000\",\n guyana: \"182-095-000-000-000-000-000\",\n haiti: \"182-096-000-000-000-000-000\",\n heard_island_and_mcdonald_islands: \"182-097-000-000-000-000-000\",\n holy_see_vatican_city_state: \"182-098-000-000-000-000-000\",\n honduras: \"182-099-000-000-000-000-000\",\n hong_kong: \"182-100-000-000-000-000-000\",\n hungary: \"182-101-000-000-000-000-000\",\n iceland: \"182-102-000-000-000-000-000\",\n india: \"182-103-000-000-000-000-000\",\n indonesia: \"182-104-000-000-000-000-000\",\n iran_islamic_republic_of: \"182-105-000-000-000-000-000\",\n iraq: \"182-106-000-000-000-000-000\",\n ireland: \"182-107-000-000-000-000-000\",\n isle_of_man: \"182-108-000-000-000-000-000\",\n israel: \"182-109-000-000-000-000-000\",\n italy: \"182-110-000-000-000-000-000\",\n jamaica: \"182-111-000-000-000-000-000\",\n jersey: \"182-112-000-000-000-000-000\",\n japan: \"182-113-000-000-000-000-000\",\n jordan: \"182-114-000-000-000-000-000\",\n kazakhstan: \"182-115-000-000-000-000-000\",\n kenya: \"182-116-000-000-000-000-000\",\n kiribati: \"182-117-000-000-000-000-000\",\n korea_democratic_people_s_republic_of: \"182-118-000-000-000-000-000\",\n korea_republic_of: \"182-119-000-000-000-000-000\",\n kuwait: \"182-120-000-000-000-000-000\",\n kyrgyzstan: \"182-121-000-000-000-000-000\",\n lao_people_s_democratic_republic: \"182-122-000-000-000-000-000\",\n latvia: \"182-123-000-000-000-000-000\",\n lebanon: \"182-124-000-000-000-000-000\",\n lesotho: \"182-125-000-000-000-000-000\",\n liberia: \"182-126-000-000-000-000-000\",\n libya: \"182-127-000-000-000-000-000\",\n liechtenstein: \"182-128-000-000-000-000-000\",\n lithuania: \"182-129-000-000-000-000-000\",\n luxembourg: \"182-130-000-000-000-000-000\",\n macao: \"182-131-000-000-000-000-000\",\n macedonia_the_former_yugoslav_republic_of: \"182-132-000-000-000-000-000\",\n madagascar: \"182-133-000-000-000-000-000\",\n malawi: \"182-134-000-000-000-000-000\",\n malaysia: \"182-135-000-000-000-000-000\",\n maldives: \"182-136-000-000-000-000-000\",\n mali: \"182-137-000-000-000-000-000\",\n malta: \"182-138-000-000-000-000-000\",\n marshall_islands: \"182-139-000-000-000-000-000\",\n martinique: \"182-140-000-000-000-000-000\",\n mauritania: \"182-141-000-000-000-000-000\",\n mauritius: \"182-142-000-000-000-000-000\",\n mayotte: \"182-143-000-000-000-000-000\",\n mexico: \"182-144-000-000-000-000-000\",\n micronesia_federated_states_of: \"182-145-000-000-000-000-000\",\n moldova_republic_of: \"182-146-000-000-000-000-000\",\n monaco: \"182-147-000-000-000-000-000\",\n mongolia: \"182-148-000-000-000-000-000\",\n montenegro: \"182-149-000-000-000-000-000\",\n montserrat: \"182-150-000-000-000-000-000\",\n morocco: \"182-151-000-000-000-000-000\",\n mozambique: \"182-152-000-000-000-000-000\",\n myanmar: \"182-153-000-000-000-000-000\",\n namibia: \"182-154-000-000-000-000-000\",\n nauru: \"182-155-000-000-000-000-000\",\n nepal: \"182-156-000-000-000-000-000\",\n netherlands: \"182-157-000-000-000-000-000\",\n new_caledonia: \"182-158-000-000-000-000-000\",\n new_zealand: \"182-159-000-000-000-000-000\",\n nicaragua: \"182-160-000-000-000-000-000\",\n niger: \"182-161-000-000-000-000-000\",\n nigeria: \"182-162-000-000-000-000-000\",\n niue: \"182-163-000-000-000-000-000\",\n norfolk_island: \"182-164-000-000-000-000-000\",\n northern_mariana_islands: \"182-165-000-000-000-000-000\",\n norway: \"182-166-000-000-000-000-000\",\n oman: \"182-167-000-000-000-000-000\",\n pakistan: \"182-168-000-000-000-000-000\",\n palau: \"182-169-000-000-000-000-000\",\n palestine_state_of: \"182-170-000-000-000-000-000\",\n panama: \"182-171-000-000-000-000-000\",\n papua_new_guinea: \"182-172-000-000-000-000-000\",\n paraguay: \"182-173-000-000-000-000-000\",\n peru: \"182-174-000-000-000-000-000\",\n philippines: \"182-175-000-000-000-000-000\",\n pitcairn: \"182-176-000-000-000-000-000\",\n poland: \"182-177-000-000-000-000-000\",\n portugal: \"182-178-000-000-000-000-000\",\n puerto_rico: \"182-179-000-000-000-000-000\",\n qatar: \"182-180-000-000-000-000-000\",\n reunion: \"182-181-000-000-000-000-000\",\n romania: \"182-182-000-000-000-000-000\",\n russian_federation: \"182-183-000-000-000-000-000\",\n rwanda: \"182-184-000-000-000-000-000\",\n saint_barthelemy: \"182-185-000-000-000-000-000\",\n saint_helena_ascension_and_tristan_da_cunha: \"182-186-000-000-000-000-000\",\n saint_kitts_and_nevis: \"182-187-000-000-000-000-000\",\n saint_lucia: \"182-188-000-000-000-000-000\",\n saint_martin_french_part: \"182-189-000-000-000-000-000\",\n saint_pierre_and_miquelon: \"182-190-000-000-000-000-000\",\n saint_vincent_and_the_grenadines: \"182-191-000-000-000-000-000\",\n samoa: \"182-192-000-000-000-000-000\",\n san_marino: \"182-193-000-000-000-000-000\",\n sao_tome_and_principe: \"182-194-000-000-000-000-000\",\n saudi_arabia: \"182-195-000-000-000-000-000\",\n senegal: \"182-196-000-000-000-000-000\",\n serbia: \"182-197-000-000-000-000-000\",\n sierra_leone: \"182-198-000-000-000-000-000\",\n seychelles: \"182-199-000-000-000-000-000\",\n singapore: \"182-200-000-000-000-000-000\",\n sint_maarten_dutch_part: \"182-201-000-000-000-000-000\",\n slovakia: \"182-202-000-000-000-000-000\",\n slovenia: \"182-203-000-000-000-000-000\",\n solomon_islands: \"182-204-000-000-000-000-000\",\n somalia: \"182-205-000-000-000-000-000\",\n south_africa: \"182-206-000-000-000-000-000\",\n south_georgia_and_the_south_sandwich_islands: \"182-207-000-000-000-000-000\",\n spain: \"182-208-000-000-000-000-000\",\n south_sudan: \"182-209-000-000-000-000-000\",\n sri_lanka: \"182-210-000-000-000-000-000\",\n sudan: \"182-211-000-000-000-000-000\",\n suriname: \"182-212-000-000-000-000-000\",\n svalbard_and_jan_mayen: \"182-213-000-000-000-000-000\",\n eswatini: \"182-214-000-000-000-000-000\",\n sweden: \"182-215-000-000-000-000-000\",\n switzerland: \"182-216-000-000-000-000-000\",\n syrian_arab_republic: \"182-217-000-000-000-000-000\",\n taiwan_province_of_china: \"182-218-000-000-000-000-000\",\n tajikistan: \"182-219-000-000-000-000-000\",\n thailand: \"182-220-000-000-000-000-000\",\n tanzania_united_republic_of: \"182-221-000-000-000-000-000\",\n timor_leste: \"182-222-000-000-000-000-000\",\n togo: \"182-223-000-000-000-000-000\",\n tokelau: \"182-224-000-000-000-000-000\",\n tonga: \"182-225-000-000-000-000-000\",\n trinidad_and_tobago: \"182-226-000-000-000-000-000\",\n tunisia: \"182-227-000-000-000-000-000\",\n turkey: \"182-228-000-000-000-000-000\",\n turkmenistan: \"182-229-000-000-000-000-000\",\n turks_and_caicos_islands: \"182-230-000-000-000-000-000\",\n tuvalu: \"182-231-000-000-000-000-000\",\n uganda: \"182-232-000-000-000-000-000\",\n ukraine: \"182-233-000-000-000-000-000\",\n united_arab_emirates: \"182-234-000-000-000-000-000\",\n united_kingdom: \"182-235-000-000-000-000-000\",\n united_states: \"182-236-000-000-000-000-000\",\n united_states_minor_outlying_islands: \"182-237-000-000-000-000-000\",\n uruguay: \"182-238-000-000-000-000-000\",\n uzbekistan: \"182-239-000-000-000-000-000\",\n vanuatu: \"182-240-000-000-000-000-000\",\n venezuela_bolivarian_republic_of: \"182-241-000-000-000-000-000\",\n viet_nam: \"182-242-000-000-000-000-000\",\n virgin_islands_british: \"182-243-000-000-000-000-000\",\n virgin_islands_u_s: \"182-244-000-000-000-000-000\",\n wallis_and_futuna: \"182-245-000-000-000-000-000\",\n western_sahara: \"182-246-000-000-000-000-000\",\n yemen: \"182-247-000-000-000-000-000\",\n zambia: \"182-248-000-000-000-000-000\",\n zimbabwe: \"182-249-000-000-000-000-000\",\n} as const;\n\nexport type CitizenshipKey = keyof typeof CitizenshipKeys;\n\n/**\n * Key → positional code map for the `countries` CVC domain (CVC-181, provisional-pending-notion-ratification). The neutral ISO 3166-1 country/territory list: 249 countries + the workspace-standard 3-value missingness set + `non_us_unspecified` (a flagged local extension). Positional codes are MINTED platform-common-side: the upstream Notion codebook's Code column is blank on all 249 rows. The authoritative ISO 3166-1 alpha-2 code rides on each entry as `iso31661Alpha2`. The 249 country KEYS are identical to CVC-182 `citizenship`; the positional ORDINALS are NOT (the two codebooks sort differently) — reconcile by key, never by rewriting segment 1.\n *\n * Domain: `countries` · Version: 1.0.0 · Entries: 254\n */\nexport const CountryKeys = {\n missingness_root: \"181-000-000-000-000-000-000\",\n unknown: \"181-000-000-000-000-000-001\",\n anonymous: \"181-000-000-000-000-000-002\",\n data_not_collected: \"181-000-000-000-000-000-003\",\n afghanistan: \"181-001-000-000-000-000-000\",\n aland_islands: \"181-002-000-000-000-000-000\",\n albania: \"181-003-000-000-000-000-000\",\n algeria: \"181-004-000-000-000-000-000\",\n american_samoa: \"181-005-000-000-000-000-000\",\n andorra: \"181-006-000-000-000-000-000\",\n angola: \"181-007-000-000-000-000-000\",\n anguilla: \"181-008-000-000-000-000-000\",\n antarctica: \"181-009-000-000-000-000-000\",\n antigua_and_barbuda: \"181-010-000-000-000-000-000\",\n argentina: \"181-011-000-000-000-000-000\",\n armenia: \"181-012-000-000-000-000-000\",\n aruba: \"181-013-000-000-000-000-000\",\n australia: \"181-014-000-000-000-000-000\",\n austria: \"181-015-000-000-000-000-000\",\n azerbaijan: \"181-016-000-000-000-000-000\",\n bahamas: \"181-017-000-000-000-000-000\",\n bahrain: \"181-018-000-000-000-000-000\",\n bangladesh: \"181-019-000-000-000-000-000\",\n barbados: \"181-020-000-000-000-000-000\",\n belarus: \"181-021-000-000-000-000-000\",\n belgium: \"181-022-000-000-000-000-000\",\n belize: \"181-023-000-000-000-000-000\",\n benin: \"181-024-000-000-000-000-000\",\n bermuda: \"181-025-000-000-000-000-000\",\n bhutan: \"181-026-000-000-000-000-000\",\n bolivia_plurinational_state_of: \"181-027-000-000-000-000-000\",\n bonaire_sint_eustatius_and_saba: \"181-028-000-000-000-000-000\",\n bosnia_and_herzegovina: \"181-029-000-000-000-000-000\",\n botswana: \"181-030-000-000-000-000-000\",\n bouvet_island: \"181-031-000-000-000-000-000\",\n brazil: \"181-032-000-000-000-000-000\",\n british_indian_ocean_territory: \"181-033-000-000-000-000-000\",\n brunei_darussalam: \"181-034-000-000-000-000-000\",\n bulgaria: \"181-035-000-000-000-000-000\",\n burkina_faso: \"181-036-000-000-000-000-000\",\n burundi: \"181-037-000-000-000-000-000\",\n cambodia: \"181-038-000-000-000-000-000\",\n cameroon: \"181-039-000-000-000-000-000\",\n canada: \"181-040-000-000-000-000-000\",\n cape_verde: \"181-041-000-000-000-000-000\",\n cayman_islands: \"181-042-000-000-000-000-000\",\n central_african_republic: \"181-043-000-000-000-000-000\",\n chad: \"181-044-000-000-000-000-000\",\n chile: \"181-045-000-000-000-000-000\",\n china: \"181-046-000-000-000-000-000\",\n christmas_island: \"181-047-000-000-000-000-000\",\n cocos_keeling_islands: \"181-048-000-000-000-000-000\",\n colombia: \"181-049-000-000-000-000-000\",\n comoros: \"181-050-000-000-000-000-000\",\n congo: \"181-051-000-000-000-000-000\",\n congo_the_democratic_republic_of_the: \"181-052-000-000-000-000-000\",\n cook_islands: \"181-053-000-000-000-000-000\",\n costa_rica: \"181-054-000-000-000-000-000\",\n cote_d_ivoire: \"181-055-000-000-000-000-000\",\n croatia: \"181-056-000-000-000-000-000\",\n cuba: \"181-057-000-000-000-000-000\",\n curacao: \"181-058-000-000-000-000-000\",\n cyprus: \"181-059-000-000-000-000-000\",\n czech_republic: \"181-060-000-000-000-000-000\",\n denmark: \"181-061-000-000-000-000-000\",\n djibouti: \"181-062-000-000-000-000-000\",\n dominica: \"181-063-000-000-000-000-000\",\n dominican_republic: \"181-064-000-000-000-000-000\",\n ecuador: \"181-065-000-000-000-000-000\",\n egypt: \"181-066-000-000-000-000-000\",\n el_salvador: \"181-067-000-000-000-000-000\",\n equatorial_guinea: \"181-068-000-000-000-000-000\",\n eritrea: \"181-069-000-000-000-000-000\",\n estonia: \"181-070-000-000-000-000-000\",\n ethiopia: \"181-071-000-000-000-000-000\",\n falkland_islands_malvinas: \"181-072-000-000-000-000-000\",\n faroe_islands: \"181-073-000-000-000-000-000\",\n fiji: \"181-074-000-000-000-000-000\",\n finland: \"181-075-000-000-000-000-000\",\n france: \"181-076-000-000-000-000-000\",\n french_guiana: \"181-077-000-000-000-000-000\",\n french_polynesia: \"181-078-000-000-000-000-000\",\n french_southern_territories: \"181-079-000-000-000-000-000\",\n gabon: \"181-080-000-000-000-000-000\",\n gambia: \"181-081-000-000-000-000-000\",\n georgia: \"181-082-000-000-000-000-000\",\n germany: \"181-083-000-000-000-000-000\",\n ghana: \"181-084-000-000-000-000-000\",\n gibraltar: \"181-085-000-000-000-000-000\",\n greece: \"181-086-000-000-000-000-000\",\n greenland: \"181-087-000-000-000-000-000\",\n grenada: \"181-088-000-000-000-000-000\",\n guadeloupe: \"181-089-000-000-000-000-000\",\n guam: \"181-090-000-000-000-000-000\",\n guatemala: \"181-091-000-000-000-000-000\",\n guernsey: \"181-092-000-000-000-000-000\",\n guinea: \"181-093-000-000-000-000-000\",\n guinea_bissau: \"181-094-000-000-000-000-000\",\n guyana: \"181-095-000-000-000-000-000\",\n haiti: \"181-096-000-000-000-000-000\",\n heard_island_and_mcdonald_islands: \"181-097-000-000-000-000-000\",\n holy_see_vatican_city_state: \"181-098-000-000-000-000-000\",\n honduras: \"181-099-000-000-000-000-000\",\n hong_kong: \"181-100-000-000-000-000-000\",\n hungary: \"181-101-000-000-000-000-000\",\n iceland: \"181-102-000-000-000-000-000\",\n india: \"181-103-000-000-000-000-000\",\n indonesia: \"181-104-000-000-000-000-000\",\n iran_islamic_republic_of: \"181-105-000-000-000-000-000\",\n iraq: \"181-106-000-000-000-000-000\",\n ireland: \"181-107-000-000-000-000-000\",\n israel: \"181-108-000-000-000-000-000\",\n isle_of_man: \"181-109-000-000-000-000-000\",\n italy: \"181-110-000-000-000-000-000\",\n jamaica: \"181-111-000-000-000-000-000\",\n japan: \"181-112-000-000-000-000-000\",\n jersey: \"181-113-000-000-000-000-000\",\n jordan: \"181-114-000-000-000-000-000\",\n kazakhstan: \"181-115-000-000-000-000-000\",\n kenya: \"181-116-000-000-000-000-000\",\n kiribati: \"181-117-000-000-000-000-000\",\n korea_democratic_people_s_republic_of: \"181-118-000-000-000-000-000\",\n korea_republic_of: \"181-119-000-000-000-000-000\",\n kuwait: \"181-120-000-000-000-000-000\",\n kyrgyzstan: \"181-121-000-000-000-000-000\",\n latvia: \"181-122-000-000-000-000-000\",\n lao_people_s_democratic_republic: \"181-123-000-000-000-000-000\",\n lebanon: \"181-124-000-000-000-000-000\",\n lesotho: \"181-125-000-000-000-000-000\",\n liberia: \"181-126-000-000-000-000-000\",\n libya: \"181-127-000-000-000-000-000\",\n liechtenstein: \"181-128-000-000-000-000-000\",\n lithuania: \"181-129-000-000-000-000-000\",\n luxembourg: \"181-130-000-000-000-000-000\",\n macao: \"181-131-000-000-000-000-000\",\n macedonia_the_former_yugoslav_republic_of: \"181-132-000-000-000-000-000\",\n madagascar: \"181-133-000-000-000-000-000\",\n malawi: \"181-134-000-000-000-000-000\",\n malaysia: \"181-135-000-000-000-000-000\",\n maldives: \"181-136-000-000-000-000-000\",\n mali: \"181-137-000-000-000-000-000\",\n malta: \"181-138-000-000-000-000-000\",\n marshall_islands: \"181-139-000-000-000-000-000\",\n martinique: \"181-140-000-000-000-000-000\",\n mauritania: \"181-141-000-000-000-000-000\",\n mauritius: \"181-142-000-000-000-000-000\",\n mayotte: \"181-143-000-000-000-000-000\",\n mexico: \"181-144-000-000-000-000-000\",\n micronesia_federated_states_of: \"181-145-000-000-000-000-000\",\n moldova_republic_of: \"181-146-000-000-000-000-000\",\n monaco: \"181-147-000-000-000-000-000\",\n mongolia: \"181-148-000-000-000-000-000\",\n montenegro: \"181-149-000-000-000-000-000\",\n montserrat: \"181-150-000-000-000-000-000\",\n morocco: \"181-151-000-000-000-000-000\",\n mozambique: \"181-152-000-000-000-000-000\",\n myanmar: \"181-153-000-000-000-000-000\",\n namibia: \"181-154-000-000-000-000-000\",\n nauru: \"181-155-000-000-000-000-000\",\n nepal: \"181-156-000-000-000-000-000\",\n netherlands: \"181-157-000-000-000-000-000\",\n new_caledonia: \"181-158-000-000-000-000-000\",\n new_zealand: \"181-159-000-000-000-000-000\",\n nicaragua: \"181-160-000-000-000-000-000\",\n niger: \"181-161-000-000-000-000-000\",\n nigeria: \"181-162-000-000-000-000-000\",\n niue: \"181-163-000-000-000-000-000\",\n norfolk_island: \"181-164-000-000-000-000-000\",\n northern_mariana_islands: \"181-165-000-000-000-000-000\",\n norway: \"181-166-000-000-000-000-000\",\n oman: \"181-167-000-000-000-000-000\",\n pakistan: \"181-168-000-000-000-000-000\",\n palau: \"181-169-000-000-000-000-000\",\n palestine_state_of: \"181-170-000-000-000-000-000\",\n panama: \"181-171-000-000-000-000-000\",\n papua_new_guinea: \"181-172-000-000-000-000-000\",\n paraguay: \"181-173-000-000-000-000-000\",\n peru: \"181-174-000-000-000-000-000\",\n philippines: \"181-175-000-000-000-000-000\",\n pitcairn: \"181-176-000-000-000-000-000\",\n poland: \"181-177-000-000-000-000-000\",\n portugal: \"181-178-000-000-000-000-000\",\n puerto_rico: \"181-179-000-000-000-000-000\",\n qatar: \"181-180-000-000-000-000-000\",\n reunion: \"181-181-000-000-000-000-000\",\n romania: \"181-182-000-000-000-000-000\",\n russian_federation: \"181-183-000-000-000-000-000\",\n saint_barthelemy: \"181-184-000-000-000-000-000\",\n rwanda: \"181-185-000-000-000-000-000\",\n saint_helena_ascension_and_tristan_da_cunha: \"181-186-000-000-000-000-000\",\n saint_kitts_and_nevis: \"181-187-000-000-000-000-000\",\n saint_lucia: \"181-188-000-000-000-000-000\",\n saint_martin_french_part: \"181-189-000-000-000-000-000\",\n saint_pierre_and_miquelon: \"181-190-000-000-000-000-000\",\n saint_vincent_and_the_grenadines: \"181-191-000-000-000-000-000\",\n samoa: \"181-192-000-000-000-000-000\",\n san_marino: \"181-193-000-000-000-000-000\",\n sao_tome_and_principe: \"181-194-000-000-000-000-000\",\n saudi_arabia: \"181-195-000-000-000-000-000\",\n senegal: \"181-196-000-000-000-000-000\",\n serbia: \"181-197-000-000-000-000-000\",\n seychelles: \"181-198-000-000-000-000-000\",\n sierra_leone: \"181-199-000-000-000-000-000\",\n singapore: \"181-200-000-000-000-000-000\",\n sint_maarten_dutch_part: \"181-201-000-000-000-000-000\",\n slovakia: \"181-202-000-000-000-000-000\",\n slovenia: \"181-203-000-000-000-000-000\",\n solomon_islands: \"181-204-000-000-000-000-000\",\n somalia: \"181-205-000-000-000-000-000\",\n south_africa: \"181-206-000-000-000-000-000\",\n south_georgia_and_the_south_sandwich_islands: \"181-207-000-000-000-000-000\",\n south_sudan: \"181-208-000-000-000-000-000\",\n spain: \"181-209-000-000-000-000-000\",\n sri_lanka: \"181-210-000-000-000-000-000\",\n sudan: \"181-211-000-000-000-000-000\",\n suriname: \"181-212-000-000-000-000-000\",\n svalbard_and_jan_mayen: \"181-213-000-000-000-000-000\",\n eswatini: \"181-214-000-000-000-000-000\",\n switzerland: \"181-215-000-000-000-000-000\",\n sweden: \"181-216-000-000-000-000-000\",\n syrian_arab_republic: \"181-217-000-000-000-000-000\",\n taiwan_province_of_china: \"181-218-000-000-000-000-000\",\n tajikistan: \"181-219-000-000-000-000-000\",\n tanzania_united_republic_of: \"181-220-000-000-000-000-000\",\n thailand: \"181-221-000-000-000-000-000\",\n timor_leste: \"181-222-000-000-000-000-000\",\n togo: \"181-223-000-000-000-000-000\",\n tokelau: \"181-224-000-000-000-000-000\",\n tonga: \"181-225-000-000-000-000-000\",\n trinidad_and_tobago: \"181-226-000-000-000-000-000\",\n tunisia: \"181-227-000-000-000-000-000\",\n turkey: \"181-228-000-000-000-000-000\",\n turkmenistan: \"181-229-000-000-000-000-000\",\n turks_and_caicos_islands: \"181-230-000-000-000-000-000\",\n uganda: \"181-231-000-000-000-000-000\",\n tuvalu: \"181-232-000-000-000-000-000\",\n ukraine: \"181-233-000-000-000-000-000\",\n united_arab_emirates: \"181-234-000-000-000-000-000\",\n united_kingdom: \"181-235-000-000-000-000-000\",\n united_states: \"181-236-000-000-000-000-000\",\n united_states_minor_outlying_islands: \"181-237-000-000-000-000-000\",\n uruguay: \"181-238-000-000-000-000-000\",\n uzbekistan: \"181-239-000-000-000-000-000\",\n vanuatu: \"181-240-000-000-000-000-000\",\n venezuela_bolivarian_republic_of: \"181-241-000-000-000-000-000\",\n viet_nam: \"181-242-000-000-000-000-000\",\n virgin_islands_british: \"181-243-000-000-000-000-000\",\n virgin_islands_u_s: \"181-244-000-000-000-000-000\",\n wallis_and_futuna: \"181-245-000-000-000-000-000\",\n western_sahara: \"181-246-000-000-000-000-000\",\n yemen: \"181-247-000-000-000-000-000\",\n zambia: \"181-248-000-000-000-000-000\",\n zimbabwe: \"181-249-000-000-000-000-000\",\n non_us_unspecified: \"181-250-000-000-000-000-000\",\n} as const;\n\nexport type CountryKey = keyof typeof CountryKeys;\n\n/**\n * Key → positional code map for the `determination_helper_categories` CVC domain (CVC-231, provisional-pending-notion-ratification). The four-section frame an advocate reasons through when assessing a trafficking determination — § I Subject and Scope (5) · § II Activity (20) · § III Means (24) · § IV Status (4) = 53 rows, all selectable, plus the authored 3-value missingness set. `coding_mode: multi_label` — one event may carry several category codes at once (canonical example: nude photos in an escort ad = `2.2.1` + `2.1.3`), so consumers MUST model this as a multi-select. Positional codes are DERIVED from the canonical DOTTED codes rather than minted: each dotted component becomes one 3-digit segment, left to right (`2.1.1` → `231-002-001-001-000-000-000`), and the dotted code also rides on every entry verbatim as `canonicalCode` — reconcile the canonical `feeds_dh_subdomain_crossref` on that field, not on the key.\n *\n * Domain: `determination_helper_categories` · Version: 1.0.0 · Entries: 57\n */\nexport const DeterminationHelperCategoryKeys = {\n missingness_root: \"231-000-000-000-000-000-000\",\n unknown: \"231-000-000-000-000-000-001\",\n anonymous: \"231-000-000-000-000-000-002\",\n data_not_collected: \"231-000-000-000-000-000-003\",\n subject_and_scope: \"231-001-000-000-000-000-000\",\n subjects: \"231-001-001-000-000-000-000\",\n roles: \"231-001-002-000-000-000-000\",\n time_scope: \"231-001-003-000-000-000-000\",\n age: \"231-001-004-000-000-000-000\",\n activity_action: \"231-002-000-000-000-000-000\",\n commercial_sex_activity: \"231-002-001-000-000-000-000\",\n commercial_sex_act_csa_linked_sex_act: \"231-002-001-001-000-000-000\",\n commercial_sex_solicitation_booking_or_arrangement: \"231-002-001-002-000-000-000\",\n commercial_sex_advertising_promotion: \"231-002-001-003-000-000-000\",\n other_commercial_sex_activity: \"231-002-001-004-000-000-000\",\n sexualized_content_sexual_performance_sexual_communications: \"231-002-002-000-000-000-000\",\n sexually_explicit_photo_video_image_activity: \"231-002-002-001-000-000-000\",\n online_sexual_performance_interactive_sexual_content: \"231-002-002-002-000-000-000\",\n in_person_sexualized_performance_appearance_based_activity: \"231-002-002-003-000-000-000\",\n sexual_or_romantic_communications_with_exploitation_relevance: \"231-002-002-004-000-000-000\",\n other_sexualized_content_performance_or_communication: \"231-002-002-005-000-000-000\",\n sexual_victimization_abuse: \"231-002-003-000-000-000-000\",\n labor_or_services: \"231-002-004-000-000-000-000\",\n debt_related_work_pledged_services_debt_repayment_arrangement: \"231-002-004-001-000-000-000\",\n adverse_work_labor_conditions: \"231-002-004-002-000-000-000\",\n criminalized_or_illicit_tasks: \"231-002-004-003-000-000-000\",\n recruitment_monitoring_or_control_of_others_as_assigned_activity: \"231-002-004-004-000-000-000\",\n other_labor_or_services_activity: \"231-002-004-005-000-000-000\",\n facilitation_operational_activities: \"231-002-005-000-000-000-000\",\n victim_vulnerabilities: \"231-003-000-000-000-000-000\",\n industry_novelty: \"231-003-001-000-000-000-000\",\n childhood_household_challenges: \"231-003-002-000-000-000-000\",\n experienced_traumas: \"231-003-003-000-000-000-000\",\n socioeconomic_circumstances: \"231-003-004-000-000-000-000\",\n behavioral_health_risks: \"231-003-005-000-000-000-000\",\n aggregated_prior_risk: \"231-003-006-000-000-000-000\",\n scheme_plan_pattern: \"231-004-000-000-000-000-000\",\n control: \"231-004-001-000-000-000-000\",\n deprivation: \"231-004-002-000-000-000-000\",\n resistance_reduction: \"231-004-003-000-000-000-000\",\n climate_of_fear: \"231-004-004-000-000-000-000\",\n threats: \"231-004-005-000-000-000-000\",\n harm_consequence_to_fear: \"231-005-000-000-000-000-000\",\n economic_housing: \"231-005-001-000-000-000-000\",\n family: \"231-005-002-000-000-000-000\",\n physical_sexual_emotional: \"231-005-003-000-000-000-000\",\n threat_of_harm: \"231-005-004-000-000-000-000\",\n legal_immigration: \"231-005-005-000-000-000-000\",\n fraud_financial_exploitation: \"231-006-000-000-000-000-000\",\n unusual_work_circumstances: \"231-006-001-000-000-000-000\",\n exploitative_working_conditions: \"231-006-002-000-000-000-000\",\n wage_earnings_exploitation: \"231-006-003-000-000-000-000\",\n deception_about_work: \"231-006-004-000-000-000-000\",\n victim_offender_status: \"231-007-000-000-000-000-000\",\n ht_determination_exploitation_type: \"231-007-001-000-000-000-000\",\n victim_status: \"231-007-002-000-000-000-000\",\n offender_status: \"231-007-003-000-000-000-000\",\n} as const;\n\nexport type DeterminationHelperCategoryKey = keyof typeof DeterminationHelperCategoryKeys;\n\n/**\n * Key → positional code map for the `trafficking_relevant_role` CVC domain (CVC-235, canonical). The 4 top-level supply/demand/enabling/adjacent roles: worker_provider, facilitator_controller, buyer_client_direct_beneficiary, other_associate. Asserting a role does NOT assert victim or offender status.\n *\n * Domain: `trafficking_relevant_role` · Version: 1.0.0 · Entries: 8\n */\nexport const TraffickingRelevantRoleKeys = {\n missingness_root: \"235-000-000-000-000-000-000\",\n unknown: \"235-000-000-000-000-000-001\",\n anonymous: \"235-000-000-000-000-000-002\",\n data_not_collected: \"235-000-000-000-000-000-003\",\n worker_provider: \"235-001-000-000-000-000-000\",\n facilitator_controller: \"235-002-000-000-000-000-000\",\n buyer_client_direct_beneficiary: \"235-003-000-000-000-000-000\",\n other_associate: \"235-004-000-000-000-000-000\",\n} as const;\n\nexport type TraffickingRelevantRoleKey = keyof typeof TraffickingRelevantRoleKeys;\n\n/**\n * Key → positional code map for the `why_nots` CVC domain (CVC-219, canonical; SOT v1.1.0 GENERATED from prototype canon `data/cvcs/core_why_nots.yaml` by scripts/gen-why-nots.py). WHY a needed referral/service was not arranged. Two levels: 7 selectable buckets (the stored `closed_why_not_code`, canon token on `canonicalCode`) + 20 selectable subtype leaves (the optional `closed_why_not_subcode`) + the Level-0 UNK / ANON / DNC triplet. Every entry carries `reportingAxis` (system_barrier · respected_choice · workflow · unknown) and the LEAF'S AXIS WINS OVER ITS BUCKET'S — classify with `whyNotReportingAxis()`. `unknc` (UNKNC) is deprecated: it reads as `unknown` (UNK).\n *\n * Domain: `why_nots` · Version: 1.1.0 · Entries: 32\n */\nexport const WhyNotKeys = {\n missingness_root: \"219-000-000-000-000-000-000\",\n unknown: \"219-000-000-000-000-000-001\",\n anonymous: \"219-000-000-000-000-000-002\",\n data_not_collected: \"219-000-000-000-000-000-003\",\n bkt_fit: \"219-001-000-000-000-000-000\",\n fit_mh: \"219-001-001-000-000-000-000\",\n fit_sud: \"219-001-002-000-000-000-000\",\n fit_other: \"219-001-003-000-000-000-000\",\n bkt_access: \"219-002-000-000-000-000-000\",\n access_lang: \"219-002-001-000-000-000-000\",\n access_cult: \"219-002-002-000-000-000-000\",\n access_dis: \"219-002-003-000-000-000-000\",\n access_deaf: \"219-002-004-000-000-000-000\",\n access_cc: \"219-002-005-000-000-000-000\",\n access_trans: \"219-002-006-000-000-000-000\",\n access_hours: \"219-002-007-000-000-000-000\",\n bkt_cap: \"219-003-000-000-000-000-000\",\n bkt_res: \"219-004-000-000-000-000-000\",\n bkt_elig: \"219-005-000-000-000-000-000\",\n bkt_choice: \"219-006-000-000-000-000-000\",\n decl: \"219-006-001-000-000-000-000\",\n rules: \"219-006-002-000-000-000-000\",\n selfres: \"219-006-003-000-000-000-000\",\n bkt_other: \"219-007-000-000-000-000-000\",\n int: \"219-007-001-000-000-000-000\",\n xfer: \"219-007-002-000-000-000-000\",\n def: \"219-007-003-000-000-000-000\",\n noresp: \"219-007-004-000-000-000-000\",\n safe: \"219-007-005-000-000-000-000\",\n coi: \"219-007-006-000-000-000-000\",\n other: \"219-007-007-000-000-000-000\",\n unknc: \"219-007-008-000-000-000-000\",\n} as const;\n\nexport type WhyNotKey = keyof typeof WhyNotKeys;\n\n/**\n * Key → positional code map for the `assertion_status` CVC domain (CVC-336 `core-assertion_status`, canonical). WHERE a claim (CAR) stands: draft · active · superseded · retracted · discarded. System-stamped, never picked; level-0 absent by ruling. isCommitted = status ∉ {draft, discarded}.\n *\n * Domain: `assertion_status` · Version: 2.0.0 · Entries: 5\n */\nexport const AssertionStatusKeys = {\n draft: \"336-001-000-000-000-000-000\",\n active: \"336-002-000-000-000-000-000\",\n superseded: \"336-003-000-000-000-000-000\",\n retracted: \"336-004-000-000-000-000-000\",\n discarded: \"336-005-000-000-000-000-000\",\n} as const;\n\nexport type AssertionStatusKey = keyof typeof AssertionStatusKeys;\n\n/**\n * Key → positional code map for the `car_correction_reason` CVC domain (CVC-337 `core-car_correction_reason`, canonical). WHY a CAR was retracted or superseded — entered_in_error · duplicate · superseded_externally · removed_by_recipient_curation · answer_withdrawn (2.1.0, 2026-10-17: the answer itself moved) — stamped on the retired row; required at the act, so level-0 is absent by ruling.\n *\n * Domain: `car_correction_reason` · Version: 2.1.0 · Entries: 5\n */\nexport const CarCorrectionReasonKeys = {\n entered_in_error: \"337-001-000-000-000-000-000\",\n duplicate: \"337-002-000-000-000-000-000\",\n superseded_externally: \"337-003-000-000-000-000-000\",\n removed_by_recipient_curation: \"337-004-000-000-000-000-000\",\n answer_withdrawn: \"337-005-000-000-000-000-000\",\n} as const;\n\nexport type CarCorrectionReasonKey = keyof typeof CarCorrectionReasonKeys;\n\n/**\n * Key → positional code map for the `created_by_system` CVC domain (GDR §10.1 `core - created_by_system`; creating actor class; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `created_by_system` · Version: 1.0.0 · Entries: 8\n */\nexport const CreatedBySystemKeys = {\n missingness_root: \"986-000-000-000-000-000-000\",\n unknown: \"986-000-000-000-000-000-001\",\n anonymous: \"986-000-000-000-000-000-002\",\n data_not_collected: \"986-000-000-000-000-000-003\",\n human: \"986-001-000-000-000-000-000\",\n integration: \"986-002-000-000-000-000-000\",\n rules_engine: \"986-003-000-000-000-000-000\",\n model: \"986-004-000-000-000-000-000\",\n} as const;\n\nexport type CreatedBySystemKey = keyof typeof CreatedBySystemKeys;\n\n/**\n * Key → positional code map for the `subject_type` CVC domain (GDR §10.1 `core - subject_type`; assertion subject type; PROVISIONAL, pending Notion ratification).\n *\n * Domain: `subject_type` · Version: 1.0.0 · Entries: 7\n */\nexport const SubjectTypeKeys = {\n missingness_root: \"987-000-000-000-000-000-000\",\n unknown: \"987-000-000-000-000-000-001\",\n anonymous: \"987-000-000-000-000-000-002\",\n data_not_collected: \"987-000-000-000-000-000-003\",\n person: \"987-001-000-000-000-000-000\",\n relationship: \"987-002-000-000-000-000-000\",\n case: \"987-003-000-000-000-000-000\",\n} as const;\n\nexport type SubjectTypeKey = keyof typeof SubjectTypeKeys;\n\n/**\n * Key → positional code map for the `minor_adult_status` CVC domain (GDR §10.1 `core - minor_adult_status`; age band at event; PROVISIONAL at 988 — canonical CVC-61 exists in the index but its Notion codebook is empty, see ADR-CVC-0.8.13 NARRATIVE_ONLY; renumber 988→61 on Notion authoring).\n *\n * Domain: `minor_adult_status` · Version: 1.0.0 · Entries: 7\n */\nexport const MinorAdultStatusKeys = {\n missingness_root: \"988-000-000-000-000-000-000\",\n unknown: \"988-000-000-000-000-000-001\",\n anonymous: \"988-000-000-000-000-000-002\",\n data_not_collected: \"988-000-000-000-000-000-003\",\n minor: \"988-001-000-000-000-000-000\",\n adult: \"988-002-000-000-000-000-000\",\n indeterminate: \"988-003-000-000-000-000-000\",\n} as const;\n\nexport type MinorAdultStatusKey = keyof typeof MinorAdultStatusKeys;\n\n/**\n * Key → positional code map for the `criminal_org_category` CVC domain (WIKI 7-type taxonomy for the criminal-org registry; ported from prototype/data/cvcs/core_criminal_org_category.yaml; PROVISIONAL at 990 — net-new, PENDING canonical Notion authoring).\n *\n * Domain: `criminal_org_category` · Version: 1.0.0 · Entries: 11\n */\nexport const CriminalOrgCategoryKeys = {\n missingness_root: \"990-000-000-000-000-000-000\",\n unknown: \"990-000-000-000-000-000-001\",\n anonymous: \"990-000-000-000-000-000-002\",\n data_not_collected: \"990-000-000-000-000-000-003\",\n street_gang: \"990-001-000-000-000-000-000\",\n prison_gang: \"990-002-000-000-000-000-000\",\n outlaw_motorcycle_gang: \"990-003-000-000-000-000-000\",\n tco_cartel: \"990-004-000-000-000-000-000\",\n white_supremacist_extremist: \"990-005-000-000-000-000-000\",\n organized_crime_family: \"990-006-000-000-000-000-000\",\n familial_or_independent_trafficking_network: \"990-007-000-000-000-000-000\",\n} as const;\n\nexport type CriminalOrgCategoryKey = keyof typeof CriminalOrgCategoryKeys;\n","/**\n * @htilabs/platform-common-models — CVC-133 evaluable function keys\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.\n *\n * The keys of coreFunctions.v1.5.0.json whose canon flags are v1 && !retired\n * (canon @ d63c2a42): the only functions the shared authorization resolver\n * evaluates (rule 8). GATE I asserts this equals the SOT.\n */\n\nexport const CORE_FUNCTIONS_EVALUABLE_SOT_VERSION = \"1.5.0\";\n\nexport const CORE_FUNCTIONS_EVALUABLE_KEYS: readonly string[] = [\n \"agency_info_manage\",\n \"announcement_publish\",\n \"api_key_manage\",\n \"assessments_conduct\",\n \"auth_model_manage_platform\",\n \"case_assign_reassign\",\n \"case_claim\",\n \"case_close\",\n \"case_collaborator_add\",\n \"case_edit\",\n \"case_needs_action_flag_manage\",\n \"case_reopen\",\n \"case_side_panel_use\",\n \"case_status_manage\",\n \"case_transfer_bulk\",\n \"case_view\",\n \"case_visibility_manage\",\n \"ci_periodic_review\",\n \"ci_record_purge_or_retire\",\n \"ci_record_validate\",\n \"ci_to_evidence_export_authorize\",\n \"deconfliction_alert_acknowledge\",\n \"deconfliction_unmask\",\n \"determination_perform\",\n \"disclose_external_request\",\n \"enrollment_manage\",\n \"exit_discharge_conduct\",\n \"export_deidentified\",\n \"goals_plan_manage\",\n \"idb_record_create\",\n \"indicator_manual_add\",\n \"investigation_create_claim\",\n \"investigation_session_run\",\n \"investigative_database_search\",\n \"investigative_request_send\",\n \"lead_create\",\n \"lead_publish\",\n \"lead_route_assign\",\n \"lead_triage_manage\",\n \"magic_link_share_send\",\n \"mandatory_report_send\",\n \"member_account_report_generate\",\n \"member_onboarding_support\",\n \"message_moderate\",\n \"message_send\",\n \"milestone_log\",\n \"needs_priorities_conduct\",\n \"network_corpus_access\",\n \"note_open_departed_author\",\n \"onboarding_config_sign_off\",\n \"open_source_search\",\n \"person_association_update\",\n \"person_merge_manage\",\n \"platform_perm_modify\",\n \"profile_domain_edit\",\n \"record_activity_view\",\n \"record_print\",\n \"referral_receive_external\",\n \"referral_receive_internal\",\n \"referral_send_external\",\n \"referral_send_internal\",\n \"roi_submit_manage\",\n \"role_assign\",\n \"roles_accounts_toggle\",\n \"sandbox_environment_manage\",\n \"screening_conduct\",\n \"screening_view\",\n \"service_log_manage\",\n \"session_create\",\n \"share_config\",\n \"share_revoke\",\n \"share_rule_approve_cross_agency\",\n \"share_vsp_to_le\",\n \"srl_manage\",\n \"supervisee_thread_view\",\n \"support_ticket_triage\",\n \"system_diagnostics_view\",\n \"team_config_manage\",\n \"team_membership_manage\",\n \"team_share_narrowing\",\n \"team_workflow_config_manage\",\n \"training_gate_manage\",\n \"usr_manage\",\n \"viewing_config_manage\",\n \"viewing_level_1_search\",\n \"viewing_level_2_autocomplete\",\n \"viewing_level_3_components\",\n];\n","/**\n * Defensive reads of stored authz rows — INTERNAL to `./authz` (not exported\n * from the barrel). `resolveEffectiveFunctions` and `functionDoor` both read\n * `platformRoles` / `platformFunctions` rows through these, so the door's\n * \"is this role bound?\" and the resolver's Tier-1 read can never disagree.\n * Moved verbatim out of resolveEffectiveFunctions.ts (0.48.0); behaviour\n * unchanged.\n */\n\nimport {\n DEFAULT_BOUND_STATE,\n PERMISSION_STATE,\n type PermissionStateValue,\n} from \"../constants/platform-auth.js\";\n\nexport type StoredMap = Readonly<Record<string, unknown>>;\n\n/** A container read: not set, a usable plain object, or malformed. */\nexport type Container =\n | { readonly kind: \"absent\" }\n | { readonly kind: \"malformed\" }\n | {\n readonly kind: \"map\";\n readonly map: StoredMap;\n };\n\nexport const ABSENT: Container = { kind: \"absent\" };\nexport const MALFORMED: Container = { kind: \"malformed\" };\n\nexport function isPlainObject(v: unknown): v is StoredMap {\n if (v === null || typeof v !== \"object\") return false;\n const proto: unknown = Object.getPrototypeOf(v);\n return proto === Object.prototype || proto === null;\n}\n\nexport function readContainer(v: unknown): Container {\n if (v === undefined || v === null) return ABSENT;\n return isPlainObject(v) ? { kind: \"map\", map: v } : MALFORMED;\n}\n\n/** An own property of a plain-object map (never an inherited key). */\nexport function own(map: StoredMap, key: string): unknown {\n return Object.hasOwn(map, key) ? map[key] : undefined;\n}\n\nconst STATES: ReadonlySet<string> = new Set<string>(Object.values(PERMISSION_STATE));\n\n/**\n * One stored state: not set, a recognised state, or `\"malformed\"`. The\n * codebook's `NA` (\"Not relevant\") is a recognised value, not a malformed one\n * (a platform that seeds from CORE_FUNCTION_DEFAULT_BOUNDS stores it\n * verbatim), and it is read as NEVER: non-grantable at every tier.\n */\nexport function readState(\n map: StoredMap,\n code: string,\n): PermissionStateValue | \"malformed\" | undefined {\n const v = own(map, code);\n if (v === undefined || v === null) return undefined;\n if (v === DEFAULT_BOUND_STATE.NA) return PERMISSION_STATE.NEVER;\n return typeof v === \"string\" && STATES.has(v) ? (v as PermissionStateValue) : \"malformed\";\n}\n\n/**\n * The Tier-1 state one role row's `functions` container gives `code`:\n * `undefined` when UNBOUND (or the container is absent); a malformed stored\n * state reads NEVER and a stored NA reads NEVER (`readState`). A malformed\n * CONTAINER is the caller's check (the role grants nothing).\n */\nexport function tier1State(\n roleFunctions: Container,\n code: string,\n): PermissionStateValue | undefined {\n const listed = roleFunctions.kind === \"map\" ? readState(roleFunctions.map, code) : undefined;\n if (listed === undefined) return undefined;\n return listed === \"malformed\" ? PERMISSION_STATE.NEVER : listed;\n}\n\n/**\n * True when the role row's `functions` container stores the codebook's `NA`\n * (\"Not relevant\") for `code` — the raw value `tier1State` reads as NEVER.\n * Only `explainFunctionRefusal` asks: the grant is the same either way, but\n * the prototype tells a Not-relevant seat a different sentence than a Never one.\n */\nexport function tier1IsNotApplicable(roleFunctions: Container, code: string): boolean {\n return roleFunctions.kind === \"map\" && own(roleFunctions.map, code) === DEFAULT_BOUND_STATE.NA;\n}\n\n/**\n * The code a `platformFunctions` row keeps in the vocabulary, or `null`: the\n * row must be a plain object with a string `code`, and its `retired` must be\n * absent or exactly `false`. Canon narrowing (`isCanonEvaluableFunction`) is\n * the caller's.\n */\nexport function catalogRowCode(row: unknown): string | null {\n if (!isPlainObject(row)) return null;\n const code = own(row, \"code\");\n const retired = own(row, \"retired\");\n if (typeof code !== \"string\") return null;\n if (retired !== undefined && retired !== false) return null;\n return code;\n}\n","/**\n * @htilabs/platform-common-models — the shared CVC-133 authorization resolver\n *\n * ONE pure function that every app (Thread · PAVE 2.0 · platform) calls to turn\n * a seat's roles and the stored platform / agency / team policies into the set\n * of CVC-133 function codes the seat may perform. No I/O and no mongoose: each\n * app keeps only a loader that reads the platform-written collections and hands\n * the rows in. Browser-safe entry: `@htilabs/platform-common-models/authz`.\n *\n * Spec: records repo (`htilabstech/prototype`) `KICKOFF_SHARED_AUTHZ_RESOLVER_2026-10-12.md`\n * § 3 (the ruled model) and § 4.1 (this file). Line cites below are to the\n * platform prototype (`htilabstech/platform-prototype` @ af10119)\n * `src/agencyhub.jsx` `authzResolve` unless they name another file;\n * `policyResolver.js` / `proxy/route.ts` cites are to `htilabstech/platform`\n * develop @ ccf8da3.\n *\n * THE RULES (kickoff § 3 numbering)\n *\n * 1. Layers intersect and clamp downward: effective = platform ∩ agency ∩\n * team (CAM, Notion 27f1ef14abcd8016accaca50780b2906; the devs' \"3-Tier HTI\n * Platform Permission Model\", Notion 32c1ef14abcd80f0933ec66638bcc300:\n * \"The most restrictive applicable setting wins. Access is always clamped\n * downward, never expanded upward\"). Per role: the platform state (Tier 1)\n * is the base; the agency may move an unlocked state (Tier 2,\n * `agencyhub.jsx:601-624` — an account may switch a Default-Off function on\n * or require it, or switch a Default-On one off); the team may only take a\n * grant away (rule 4). The user-restriction, training, clearance, legal-basis\n * and purpose layers (`:629-693`) are not inputs here (CAM layers the dev\n * model has no data for yet, inventory resolvers.md D6).\n * 2. Roles union at the user level; NEVER is local to its role. A function is\n * granted when ANY assigned role's own cascade grants it; a role whose\n * cascade ends at NEVER / Default-Off simply contributes nothing — it never\n * vetoes another role's grant (`:566-589`, Crysta 2026-08-09 \"grants are\n * computed first\"; restated 2026-10-12 \"roles stack\").\n * UNBOUND IS INELIGIBLE (co-p1x, aligned to canon): a role whose Tier-1\n * row carries no state for a function is not eligible for it — the\n * prototype returns `role_ineligible` before any agency layer runs\n * (`:578-584`), so neither an agency override nor a team policy can turn\n * an unbound pair on. For that role it is NEVER, and like every NEVER it\n * is local to the role. (The dev resolvers' tool-overlap default — an\n * unlisted function reading PREF_NO when it shares one of the role's\n * tools, `policyResolver.js:33-40` — is not encoded: it let an agency\n * enable a pair the codebook never bound.) A stored `NA` (the codebook's\n * \"Not relevant\", `DEFAULT_BOUND_STATE.NA`) is read as NEVER at every\n * tier: non-grantable, and locked at Tier 1.\n * 3. Required is immune to the team gate: a state that is ALWAYS after\n * Tier 1 + Tier 2 (platform ALWAYS, or an agency that escalated the role to\n * ALWAYS) is not team-gated (dev model: \"locked\" states skip Tier 3,\n * `platform/lib/utils/policyResolver.js:58-72`; prototype `:625` \"agency\n * cannot disable\"). NEVER at Tier 1 / Tier 2 is immune to a team lift —\n * a Tier-1 ALWAYS / NEVER also ignores the agency layer\n * (`policyResolver.js:46-48`). The prototypes now behave the same way:\n * platform-prototype `authzResolve` since #492 (2026-11-03), and the\n * records monolith `shareFunctionAccess` plus the LEADS app\n * `resolveEffectiveAccess` since prototype #1050 (2026-11-09). Before\n * those ships the prototypes still ran the team check for `required`;\n * this resolver encoded the ruling first.\n * 4. The team layer is RESTRICT-ONLY (`:626-628` \"teams are workflow\n * containers, never authority\"; editor log lines `:1236` / `:4490` \"it never\n * grants\"; UDD Team object, Notion 3ec1ef14abcd814385e4c4e84e071178: \"If a\n * team enables a function, but a user's role does not permit that function,\n * the user does not gain access to it through team membership\"). A team\n * PREF_NO (or a NEVER, which the platform's own write path refuses from a\n * team, `app/api/admin/proxy/route.ts:900`, but which is honoured\n * fail-closed) takes the grant away; a team PREF_YES or ALWAYS is\n * ignored — it never lifts a Default-Off or an agency switch-off. The\n * policy's role-grain `roles[]` and flat `functions` maps are both team\n * restrictions: either one switching a function off is enough.\n * 5. One acting team per resolution: the seat's primary team (`team_id` =\n * `team_ids[0]`, `setUserTeams` `:3228`; `authzForCurrentUser` passes the\n * single `u.team_id`, `:734`), or a verified acting team the request\n * carries (pave-2.0 team-scope precedence ADR, Notion\n * 3921ef14abcd814ca839c1e7c3a57485). The caller resolves that ONE team's\n * policy and passes it as `teamPolicy` — see `selectActingTeamId`. No team,\n * or a team with no policy, is an explicit pass-through (ruling 3c, `:626`).\n * 8. Unknown / retired / not-v1 functions are denied (`:556` \"unknown function\n * — deny by default\", `:557` retired, `:558` not-v1) — decided by the canon\n * this package ships, not by the caller's rows. The prototype checks its\n * injected canon registry (`HTI_CORE_FUNCTIONS`, `:552-558`); here that is\n * the CVC-133 SOT (`coreFunctions.v1.5.0.json`, whose `v1` / `retired`\n * booleans are canon's own row flags), read through the slim generated key\n * set `CORE_FUNCTIONS_EVALUABLE_KEYS` (v1 && !retired; GATE I asserts it\n * equals the SOT) and intersected with `CoreFunctionsKeys`. No assigned\n * roles, or none that resolve to a role row, yields the empty set.\n *\n * FAIL-CLOSED ON MALFORMED STORED DATA (ruled 2026-10-13, co-zo3 review and\n * verification rounds). Every input is read defensively, so malformed data\n * makes `resolveEffectiveFunctions` deny, never throw:\n * - an `input` that is not an object, or a `roles` / `functions` /\n * `assignedRoleCodes` that is not an array (null, a number, a string —\n * never split into characters), resolves to `[]`;\n * - a present state that is not one of the four PERMISSION_STATE values (or\n * `NA`, read as NEVER) is NEVER at Tier 1, NEVER at Tier 2 (for that\n * role), and a restriction at Tier 3; `undefined` and `null` mean \"not\n * set\" — which at Tier 1 is unbound, i.e. ineligible;\n * - a state CONTAINER that is present but not a plain object (an array, a\n * string, a Map, …) fails closed for everything it could govern: a role's\n * `functions` → the role grants nothing; the agency's map, or one role's\n * entry in it → NEVER for every unlocked state it covers; the team policy,\n * its `functions`, or its `roles` list → every team-gated grant restricted;\n * one role's `overrides` → that role's team-gated grants restricted;\n * - a `teamPolicy.roles` entry that is not an object with a string `roleCode`\n * cannot be attributed to a role, so it restricts every role's team-gated\n * grants; duplicate entries for one role are unioned (any off wins);\n * - a catalog row's `retired` keeps the function only when it is absent or\n * exactly `false`;\n * - Required (rule 3) stays immune to every team-side restriction.\n *\n * Rules 6 (app access is not a function) and 7 (vocabulary vs policy state)\n * are about what the inputs are, not about this computation.\n */\n\nimport {\n PERMISSION_STATE,\n type DefaultBoundStateValue,\n type PermissionStateValue,\n} from \"../constants/platform-auth.js\";\nimport { CoreFunctionsKeys } from \"../generated/cvc-enums.js\";\nimport { CORE_FUNCTIONS_EVALUABLE_KEYS } from \"../generated/coreFunctionsEvaluable.js\";\nimport {\n ABSENT,\n catalogRowCode,\n isPlainObject,\n own,\n readContainer,\n readState,\n tier1IsNotApplicable,\n tier1State,\n type Container,\n type StoredMap,\n} from \"./storedReads.js\";\n\n// ─── Canon (rule 8) ─────────────────────────────────────────────────────────\n\nconst CANON_EVALUABLE: ReadonlySet<string> = new Set(\n CORE_FUNCTIONS_EVALUABLE_KEYS.filter((k) => Object.hasOwn(CoreFunctionsKeys, k)),\n);\n\n/** True when canon lets the resolver evaluate `code` at all (rule 8). */\nexport function isCanonEvaluableFunction(code: string): boolean {\n return CANON_EVALUABLE.has(code);\n}\n\n// ─── Input contract (kickoff § 4.1) ─────────────────────────────────────────\n\n/**\n * A Tier-2 (agency) or Tier-3 (team) map of function code → state, as the\n * platform stores it. Canon has no NA chip at these tiers, so the type is the\n * four PERMISSION_STATE values; a stored `NA` is still read as NEVER (fail\n * closed), never as a grant.\n */\nexport type AuthzStateMap = Readonly<Record<string, PermissionStateValue>>;\n\n/**\n * A Tier-1 (platform role) map of function code → state: a PERMISSION_STATE\n * value or the codebook's `NA` (\"Not relevant\", read as NEVER) — what a seed\n * from `CORE_FUNCTION_DEFAULT_BOUNDS` stores. An unlisted function is unbound.\n */\nexport type AuthzTier1StateMap = Readonly<Record<string, DefaultBoundStateValue>>;\n\n/**\n * One `platformRoles` row (Tier 1): the role's platform state per function.\n * A function the role does not list is UNBOUND for it: the role is ineligible\n * (NEVER for that role, locked — no agency or team layer can enable it), as\n * canon's `authzResolve` rules (`:578-584` `role_ineligible`).\n *\n * `tools` is NOT read by the resolver (since co-p1x, 0.24.0): it used to pick\n * the PREF_NO / NEVER default for an unlisted function. The field stays on the\n * contract because the platform still stores it on `platformRoles`.\n */\nexport interface AuthzRoleRow {\n readonly code: string;\n /**\n * @deprecated Ignored by the resolver since 0.24.0 (co-p1x): an unlisted\n * function is unbound, whatever tools the role and function share. Kept on\n * the contract because the platform still stores it.\n */\n readonly tools?: readonly string[];\n readonly functions?: AuthzTier1StateMap;\n}\n\n/**\n * One `platformFunctions` row: the deployment's function catalog. It can only\n * narrow canon, never widen it:\n * - a code canon does not carry, or carries as not-v1 / retired, is denied\n * even when it is listed here;\n * - `retired` other than absent / exactly `false` denies a function canon\n * still has (a deployment may stop offering one early);\n * - a canon function missing from this list is denied (it has no catalog row).\n * Any other stored field (e.g. `platformFunctions.status`) is not read: a stale\n * \"Future function (not v1)\" status never denies a function canon says is v1.\n */\nexport interface AuthzFunctionRow {\n readonly code: string;\n /**\n * @deprecated Ignored by the resolver since 0.24.0 (co-p1x). Kept on the\n * contract because the platform still stores it.\n */\n readonly tools?: readonly string[];\n readonly retired?: boolean;\n}\n\n/** One role-grain override entry, as stored in `teamAccessPolicies.roles[]`. */\nexport interface AuthzRoleOverrides {\n readonly roleCode: string;\n readonly overrides?: AuthzStateMap;\n}\n\n/**\n * The ONE acting team's `teamAccessPolicies` document (rule 5). `roles[]`\n * narrows one role; `functions` narrows every role. Both only restrict, so a\n * function is off for a role when any of them says so.\n */\nexport interface AuthzTeamPolicy {\n readonly roles?: readonly AuthzRoleOverrides[];\n readonly functions?: AuthzStateMap;\n}\n\nexport interface ResolveEffectiveFunctionsInput {\n /** Every `platformRoles` row the seat might hold (extra rows are ignored). */\n readonly roles: readonly AuthzRoleRow[];\n /** The deployment's function catalog (`platformFunctions`), narrowed by canon. */\n readonly functions: readonly AuthzFunctionRow[];\n /** The seat's assigned role codes. */\n readonly assignedRoleCodes: readonly string[];\n /** Tier 2 — the agency's overrides, `{ roleCode → { functionCode → state } }`. */\n readonly agencyOverrides?: Readonly<Record<string, AuthzStateMap>>;\n /** Tier 3 — the acting team's policy; absent / null = pass-through. */\n readonly teamPolicy?: AuthzTeamPolicy | null;\n /** Declared, not configurable: an unknown function is always denied (rule 8). */\n readonly unknownFunctionPolicy: \"deny\";\n}\n\n// ─── Defensive reads ────────────────────────────────────────────────────────\n// Shared with `functionDoor` (./storedReads.ts) so both read stored rows alike.\n\n/** Rule 4: anything but \"not set\", PREF_YES or ALWAYS restricts. */\nfunction teamValueRestricts(map: StoredMap, code: string): boolean {\n const gate = readState(map, code);\n return (\n gate !== undefined &&\n gate !== PERMISSION_STATE.PREF_YES &&\n gate !== PERMISSION_STATE.ALWAYS\n );\n}\n\n/** The acting team's policy, compiled once into restrict-only predicates. */\ninterface TeamGate {\n /** Every team-gated grant is restricted (malformed or unattributable data). */\n readonly restrictsAll: boolean;\n readonly flat: StoredMap | undefined;\n /** Every overrides map stored for a role (duplicates kept, then unioned). */\n readonly byRole: ReadonlyMap<string, readonly StoredMap[]>;\n /** Roles whose stored overrides container is malformed. */\n readonly malformedRoles: ReadonlySet<string>;\n}\n\nfunction compileTeamGate(teamPolicy: unknown): TeamGate {\n const byRole = new Map<string, StoredMap[]>();\n const malformedRoles = new Set<string>();\n const policy = readContainer(teamPolicy);\n if (policy.kind === \"absent\") {\n return { restrictsAll: false, flat: undefined, byRole, malformedRoles };\n }\n if (policy.kind === \"malformed\") {\n return { restrictsAll: true, flat: undefined, byRole, malformedRoles };\n }\n let restrictsAll = false;\n const functions = readContainer(own(policy.map, \"functions\"));\n if (functions.kind === \"malformed\") restrictsAll = true;\n const roles = own(policy.map, \"roles\");\n if (roles !== undefined && roles !== null) {\n if (!Array.isArray(roles)) restrictsAll = true;\n else {\n for (const entry of roles as unknown[]) {\n const roleCode = isPlainObject(entry) ? own(entry, \"roleCode\") : undefined;\n if (!isPlainObject(entry) || typeof roleCode !== \"string\") {\n restrictsAll = true; // cannot tell which role it narrows\n continue;\n }\n const overrides = readContainer(own(entry, \"overrides\"));\n if (overrides.kind === \"malformed\") malformedRoles.add(roleCode);\n else if (overrides.kind === \"map\") {\n const list = byRole.get(roleCode) ?? [];\n list.push(overrides.map);\n byRole.set(roleCode, list);\n }\n }\n }\n }\n return {\n restrictsAll,\n flat: functions.kind === \"map\" ? functions.map : undefined,\n byRole,\n malformedRoles,\n };\n}\n\nfunction teamRestricts(gate: TeamGate, roleCode: string, code: string): boolean {\n if (gate.restrictsAll || gate.malformedRoles.has(roleCode)) return true;\n if (gate.flat !== undefined && teamValueRestricts(gate.flat, code)) return true;\n return (gate.byRole.get(roleCode) ?? []).some((m) => teamValueRestricts(m, code));\n}\n\n// ─── Resolver ───────────────────────────────────────────────────────────────\n\n/**\n * Resolve the CVC-133 function codes a seat may perform.\n *\n * @returns sorted, de-duplicated function codes; `[]` when nothing resolves,\n * including when `input` is not an object or `roles`, `functions` or\n * `assignedRoleCodes` is not an array (never a throw; a string is\n * never iterated as characters).\n */\nexport function resolveEffectiveFunctions(\n input: ResolveEffectiveFunctionsInput,\n): string[] {\n const raw: unknown = input;\n if (!isPlainObject(raw)) return [];\n const roleRows = own(raw, \"roles\");\n const catalog = own(raw, \"functions\");\n const assigned = own(raw, \"assignedRoleCodes\");\n if (!Array.isArray(roleRows) || !Array.isArray(catalog) || !Array.isArray(assigned)) return [];\n\n const rolesByCode = new Map<string, StoredMap>();\n for (const r of roleRows as readonly unknown[]) {\n const code = isPlainObject(r) ? own(r, \"code\") : undefined;\n if (isPlainObject(r) && typeof code === \"string\") rolesByCode.set(code, r);\n }\n const heldCodes = [...new Set(assigned as readonly unknown[])].filter(\n (c): c is string => typeof c === \"string\" && rolesByCode.has(c),\n );\n if (heldCodes.length === 0) return [];\n\n // Rule 8: the catalog narrowed by canon, and by its own `retired` (only an\n // absent or exactly-false flag keeps a row).\n const vocabulary: string[] = [];\n for (const fn of catalog as readonly unknown[]) {\n const code = catalogRowCode(fn);\n if (code !== null && isCanonEvaluableFunction(code)) vocabulary.push(code);\n }\n\n const agencyAll = readContainer(input.agencyOverrides);\n const team = compileTeamGate(input.teamPolicy);\n\n const granted = new Set<string>();\n for (const roleCode of heldCodes) {\n const role = rolesByCode.get(roleCode)!;\n const roleFunctions = readContainer(own(role, \"functions\"));\n if (roleFunctions.kind === \"malformed\") continue; // Tier 1 unreadable: grants nothing\n const agency =\n agencyAll.kind === \"map\" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;\n\n for (const fn of vocabulary) {\n if (granted.has(fn)) continue; // rule 2: another role already grants it\n if (roleVerdict(roleFunctions, agency, team, roleCode, fn) === \"granted\") granted.add(fn);\n }\n }\n\n return [...granted].sort();\n}\n\n/**\n * Where ONE held role's cascade ends for ONE function (rules 1–4). The\n * resolver grants on `\"granted\"` only; `explainFunctionRefusal` reads the\n * other verdicts to say which layer refused. One cascade, so the two can\n * never disagree.\n */\ntype RoleVerdict =\n | \"granted\"\n | \"never\"\n | \"not_applicable\"\n | \"unbound\"\n | \"account_blocked\"\n | \"account_off\"\n | \"default_off\"\n | \"team_workflow\";\n\nfunction roleVerdict(\n roleFunctions: Container,\n agency: Container,\n team: TeamGate,\n roleCode: string,\n fn: string,\n): RoleVerdict {\n // Tier 1 — platform. UNBOUND (no stored state) is ineligible: the role\n // contributes nothing, before any agency or team layer (canon\n // `authzResolve` `role_ineligible`, `:578-584`). A malformed stored\n // state is NEVER; a stored NA reads NEVER (readState). Either way it is\n // local to this role (rule 2).\n const tier1 = tier1State(roleFunctions, fn);\n if (tier1 === undefined) return \"unbound\";\n if (tier1 === PERMISSION_STATE.NEVER) {\n return tier1IsNotApplicable(roleFunctions, fn) ? \"not_applicable\" : \"never\";\n }\n\n // Tier 2 — agency. Tier-1 ALWAYS / NEVER are locked (rule 3); a\n // malformed override (or container) is NEVER for this role. The stored\n // states are the account editor's four (platform `lib/utils/policyResolver.js`\n // header: Required / On / Off / Blocked = ALWAYS / PREF_YES / PREF_NO / NEVER).\n let state: PermissionStateValue = tier1;\n let override: PermissionStateValue | \"malformed\" | undefined;\n if (tier1 !== PERMISSION_STATE.ALWAYS) {\n override =\n agency.kind === \"malformed\"\n ? \"malformed\"\n : agency.kind === \"map\"\n ? readState(agency.map, fn)\n : undefined;\n if (override === \"malformed\") state = PERMISSION_STATE.NEVER;\n else if (override !== undefined) state = override;\n }\n\n if (state !== PERMISSION_STATE.ALWAYS && state !== PERMISSION_STATE.PREF_YES) {\n if (override === undefined) return \"default_off\"; // Tier-1 Default Off, no account word\n return state === PERMISSION_STATE.PREF_NO ? \"account_off\" : \"account_blocked\";\n }\n\n // Tier 3 — team, restrict-only (rule 4); Required is immune (rule 3).\n if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn)) {\n return \"team_workflow\";\n }\n\n return \"granted\";\n}\n\n// ─── Which layer refused (the door's register) ──────────────────────────────\n\n/**\n * Why `resolveEffectiveFunctions` does not grant one function to a seat, in\n * the prototype's register (records `htilabstech/prototype` @ 882e200,\n * `HTI-LEADS-PAVE-Thread-prototype.html` `shareFunctionAccess`, L339651-339719;\n * its decision order mirrors platform-prototype `authzResolve`):\n *\n * - `\"granted\"` — the resolver grants it (nothing refused).\n * - Level 1, platform bounds — no held role is bound Always / Default On /\n * Default Off: `\"never\"` (a held role is Never-bound) › `\"not_applicable\"`\n * (a held role is Not relevant) › `\"unbound\"` (no held role is bound).\n * - Level 2, the account — a held role is bound Default On / Default Off and\n * no role's account setting grants it: `\"account_blocked\"` (the account set\n * Blocked, NEVER) › `\"account_off\"` (the account set Off, PREF_NO) ›\n * `\"default_off\"` (Default Off and the account said nothing).\n * - Level 3, the team — the account layer grants it through a held role, and\n * the acting team's workflow takes it away: `\"team_workflow\"`. Required\n * (ALWAYS after Levels 1–2) is immune (rule 3), so it never lands here.\n * - `\"not_evaluable\"` — unknown / retired / not-v1 in canon, no kept catalog\n * row, or malformed input (the resolver grants nothing from it).\n * - `\"no_roles\"` — the seat carries no role code at all.\n *\n * When several held roles refuse at different layers, the furthest layer wins\n * (a role that reached the team outranks one the account stopped, which\n * outranks one the bounds stopped) — the prototype's order, since its Level 1\n * sentences only run when no held role is bound at all. A held code with no\n * role row, or whose `functions` container is malformed, is unbound.\n */\nexport type FunctionRefusal =\n | RoleVerdict\n | \"not_evaluable\"\n | \"no_roles\";\n\nconst REFUSAL_ORDER: readonly RoleVerdict[] = [\n \"granted\",\n \"team_workflow\",\n \"account_blocked\",\n \"account_off\",\n \"default_off\",\n \"never\",\n \"not_applicable\",\n \"unbound\",\n];\n\n/**\n * STATUS: DRAFT (0.50.0). Explain one function for one seat, over the SAME\n * input `resolveEffectiveFunctions` takes: `\"granted\"` exactly when the\n * resolver's answer contains `functionCode`, otherwise the layer that refused\n * (see `FunctionRefusal`). Pure; never throws; changes nothing the resolver\n * grants. A server that resolves the seat can ship this beside the effective\n * set, so the browser's door (`functionDoor`'s `refusal`) says the right\n * sentence without holding the policies.\n */\nexport function explainFunctionRefusal(\n input: ResolveEffectiveFunctionsInput,\n functionCode: string,\n): FunctionRefusal {\n const raw: unknown = input;\n if (!isPlainObject(raw)) return \"not_evaluable\";\n const roleRows = own(raw, \"roles\");\n const catalog = own(raw, \"functions\");\n const assigned = own(raw, \"assignedRoleCodes\");\n if (!Array.isArray(roleRows) || !Array.isArray(catalog) || !Array.isArray(assigned)) {\n return \"not_evaluable\";\n }\n if (typeof functionCode !== \"string\" || !isCanonEvaluableFunction(functionCode)) {\n return \"not_evaluable\";\n }\n if (!(catalog as readonly unknown[]).some((fn) => catalogRowCode(fn) === functionCode)) {\n return \"not_evaluable\";\n }\n\n const heldCodes = [...new Set(assigned as readonly unknown[])].filter(\n (c): c is string => typeof c === \"string\",\n );\n if (heldCodes.length === 0) return \"no_roles\";\n\n const rolesByCode = new Map<string, StoredMap>();\n for (const r of roleRows as readonly unknown[]) {\n const code = isPlainObject(r) ? own(r, \"code\") : undefined;\n if (isPlainObject(r) && typeof code === \"string\") rolesByCode.set(code, r);\n }\n const agencyAll = readContainer(input.agencyOverrides);\n const team = compileTeamGate(input.teamPolicy);\n\n let best = REFUSAL_ORDER.length - 1; // \"unbound\"\n for (const roleCode of heldCodes) {\n const role = rolesByCode.get(roleCode);\n const roleFunctions = role === undefined ? ABSENT : readContainer(own(role, \"functions\"));\n if (roleFunctions.kind === \"malformed\") continue; // grants nothing: unbound\n const agency =\n agencyAll.kind === \"map\" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;\n const verdict = roleVerdict(roleFunctions, agency, team, roleCode, functionCode);\n const at = REFUSAL_ORDER.indexOf(verdict);\n if (at < best) best = at;\n if (best === 0) break;\n }\n return REFUSAL_ORDER[best]!;\n}\n\n// ─── Acting team (rule 5) ───────────────────────────────────────────────────\n\n/**\n * Pick the ONE team whose policy feeds `teamPolicy`.\n *\n * - `verifiedActingTeamId` given → that team, as is. VERIFYING it is the\n * caller's job: each app has its own membership source (pave-2.0 checks\n * `teams.members[]` through its membership checker; `users.teams` is not kept\n * in step with it), so this helper does not second-guess the caller against\n * `seatTeamIds`. Pass only a team the caller has confirmed the seat sits on.\n * A caller that derives its own acting team (Thread's `resolveActingTeamId`\n * picks the first seat team whose apps include THREAD) MUST pass that answer\n * here — the primary-team fallback below knows nothing about apps.\n * - otherwise → the primary team, `seatTeamIds[0]`;\n * - no teams → `null` (pass-through).\n */\nexport function selectActingTeamId(\n seatTeamIds: readonly string[],\n verifiedActingTeamId?: string | null,\n): string | null {\n if (verifiedActingTeamId) return verifiedActingTeamId;\n return seatTeamIds[0] ?? null;\n}\n\n// ─── Internal viewing level (CVC-133 viewing_level_1/2/3) ───────────────────\n\n/** Level 0 is derived (no level function resolves), never a configurable rung. */\nexport type ViewingLevel = 0 | 1 | 2 | 3;\n\n/** The three Type-A viewing functions, highest first. */\nexport const VIEWING_LEVEL_FUNCTIONS = [\n [\"viewing_level_3_components\", 3],\n [\"viewing_level_2_autocomplete\", 2],\n [\"viewing_level_1_search\", 1],\n] as const satisfies ReadonlyArray<readonly [keyof typeof CoreFunctionsKeys, ViewingLevel]>;\n\n/**\n * The effective internal viewing level from an already-resolved function set.\n *\n * Canon (CVC-133 `viewing_level_3_components` logic_notes, records\n * `data/cvcs/core_functions.yaml` @ f4356aa4): \"Effective viewing level = the\n * highest of the three level functions the user's roles resolve to … clamped by\n * the team-set level — most restrictive wins; the team axis clamps down, never\n * up. … Absence of all three functions = Level 0 (not a configurable setting).\"\n *\n * `teamViewingLevel` is the level the account's viewing policy sets for the\n * acting team — the team's own row, else the account-wide rule (prototype\n * `src/screens.jsx:14671` `effLevel`, `:14819` \"a member's own role can only\n * narrow it further\"). Absent / null = no team-set level, so no clamp.\n *\n * Own / claimed cases are always fully visible; that is the caller's\n * record-level check, not this function's.\n */\nexport function viewingLevelFromFunctions(\n effectiveFunctions: Iterable<string>,\n teamViewingLevel?: ViewingLevel | null,\n): ViewingLevel {\n const held = new Set(effectiveFunctions);\n const roleLevel = VIEWING_LEVEL_FUNCTIONS.find(([code]) => held.has(code))?.[1] ?? 0;\n return teamViewingLevel == null\n ? roleLevel\n : (Math.min(roleLevel, teamViewingLevel) as ViewingLevel);\n}\n\n/**\n * Resolve the seat's functions (same input, same rules as\n * `resolveEffectiveFunctions`) and return its effective internal viewing level.\n */\nexport function resolveEffectiveViewingLevel(\n input: ResolveEffectiveFunctionsInput,\n teamViewingLevel?: ViewingLevel | null,\n): ViewingLevel {\n return viewingLevelFromFunctions(resolveEffectiveFunctions(input), teamViewingLevel);\n}\n","/**\n * @htilabs/platform-common-models — CVC-133 codebook default bounds\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.\n *\n * For each evaluable function of coreFunctions.v1.5.0.json (canon v1 && !retired,\n * canon @ d63c2a42): role code → the codebook's default bound — canon's\n * always / default_on / default_off / never / not_applicable_roles read\n * ALWAYS / PREF_YES / PREF_NO / NEVER / NA. Role codes are CVC-134 / CVC-135\n * `canonicalCode`s (adminRoles.v2.0.0.json · userRoles.v2.0.0.json); a role not listed is UNBOUND.\n * CODEBOOK DEFAULTS, not live policy: what platform seeds on insert and what\n * \"clear\" reverts to. GATE L asserts this equals the pinned canon.\n */\n\nimport type { DefaultBoundStateValue } from \"../constants/platform-auth.js\";\n\nexport const CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION = \"1.5.0\";\n\nexport const CORE_FUNCTION_DEFAULT_BOUNDS: Readonly<\n Record<string, Readonly<Record<string, DefaultBoundStateValue>>>\n> = {\n \"agency_info_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\" },\n \"announcement_publish\": { \"MEM-ADM\": \"PREF_NO\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"api_key_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"assessments_conduct\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"NEVER\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"auth_model_manage_platform\": { \"AUD\": \"NEVER\", \"CIRO\": \"NEVER\", \"DATA-ADM\": \"NEVER\", \"GOV-AUD\": \"NEVER\", \"MEM-ADM\": \"NEVER\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"NEVER\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"research_analytics\": \"NA\" },\n \"case_assign_reassign\": { \"AUD\": \"NA\", \"CIRO\": \"NA\", \"DATA-ADM\": \"NA\", \"GOV-AUD\": \"NA\", \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"NA\", \"SUP\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"behavioral_health_provider\": \"NA\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"NA\", \"healthcare_provider_medical\": \"NA\", \"intel_analyst\": \"NA\", \"investigator\": \"NA\", \"le_liaison_vsp\": \"NA\", \"legal_advocate\": \"NA\", \"mandatory_reporter\": \"NA\", \"mdt_participant\": \"NA\", \"prosecutor_review\": \"NA\", \"public_reporter\": \"NA\", \"research_analytics\": \"NA\", \"screener\": \"NA\", \"volunteer\": \"NA\" },\n \"case_claim\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mandatory_reporter\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"PREF_YES\", \"public_reporter\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"case_close\": { \"AUD\": \"NA\", \"CIRO\": \"NA\", \"DATA-ADM\": \"NA\", \"GOV-AUD\": \"NA\", \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"NA\", \"SUP\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"behavioral_health_provider\": \"NA\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"NA\", \"healthcare_provider_medical\": \"NA\", \"intel_analyst\": \"NA\", \"investigator\": \"NA\", \"le_liaison_vsp\": \"NA\", \"legal_advocate\": \"NA\", \"mandatory_reporter\": \"NA\", \"mdt_participant\": \"NA\", \"prosecutor_review\": \"NA\", \"public_reporter\": \"NA\", \"research_analytics\": \"NA\", \"screener\": \"NA\", \"volunteer\": \"NA\" },\n \"case_collaborator_add\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"case_edit\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"case_needs_action_flag_manage\": { \"SUP\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"case_reopen\": { \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"PREF_NO\" },\n \"case_side_panel_use\": { \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_NO\" },\n \"case_status_manage\": { \"SUP\": \"PREF_YES\", \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"case_transfer_bulk\": { \"MEM-ADM\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"PREF_NO\", \"research_analytics\": \"NA\" },\n \"case_view\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"NEVER\" },\n \"case_visibility_manage\": { \"MEM-ADM\": \"ALWAYS\", \"SUP\": \"ALWAYS\", \"case_nav\": \"NA\", \"intel_analyst\": \"PREF_NO\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"ci_periodic_review\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"ci_record_purge_or_retire\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"ci_record_validate\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"ci_to_evidence_export_authorize\": { \"CIRO\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"deconfliction_alert_acknowledge\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"deconfliction_unmask\": { \"case_nav\": \"NA\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"determination_perform\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"NEVER\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"legal_advocate\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"disclose_external_request\": { \"CIRO\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\" },\n \"enrollment_manage\": { \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_NO\", \"volunteer\": \"PREF_NO\" },\n \"exit_discharge_conduct\": { \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"export_deidentified\": { \"DATA-ADM\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"PREF_YES\" },\n \"goals_plan_manage\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"volunteer\": \"PREF_NO\" },\n \"idb_record_create\": { \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"indicator_manual_add\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"investigation_create_claim\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"investigation_session_run\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"PREF_YES\", \"research_analytics\": \"NA\" },\n \"investigative_database_search\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"investigative_request_send\": { \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"lead_create\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"lead_publish\": { \"case_nav\": \"NA\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"lead_route_assign\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"lead_triage_manage\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"magic_link_share_send\": { \"PLT-ADM\": \"NA\", \"SUP\": \"PREF_YES\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_NO\" },\n \"mandatory_report_send\": { \"MEM-ADM\": \"PREF_YES\", \"PLT-ADM\": \"NA\", \"SUP\": \"PREF_YES\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"mandatory_reporter\": \"ALWAYS\", \"public_reporter\": \"PREF_NO\", \"screener\": \"PREF_NO\", \"volunteer\": \"PREF_NO\" },\n \"member_account_report_generate\": { \"DATA-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"PREF_YES\" },\n \"member_onboarding_support\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"message_moderate\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\" },\n \"message_send\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"PREF_NO\", \"research_analytics\": \"ALWAYS\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_YES\" },\n \"milestone_log\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"needs_priorities_conduct\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_YES\" },\n \"network_corpus_access\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"note_open_departed_author\": { \"MEM-ADM\": \"PREF_NO\" },\n \"onboarding_config_sign_off\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\" },\n \"open_source_search\": { \"case_nav\": \"NA\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\" },\n \"person_association_update\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\" },\n \"person_merge_manage\": { \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"NA\", \"crisis_response\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"PREF_YES\", \"mandatory_reporter\": \"NEVER\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"volunteer\": \"NEVER\" },\n \"platform_perm_modify\": { \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"profile_domain_edit\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"record_activity_view\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_NO\" },\n \"record_print\": { \"CIRO\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"legal_advocate\": \"ALWAYS\", \"prosecutor_review\": \"ALWAYS\", \"research_analytics\": \"ALWAYS\", \"screener\": \"PREF_NO\", \"volunteer\": \"NEVER\" },\n \"referral_receive_external\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mandatory_reporter\": \"PREF_YES\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"referral_receive_internal\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"referral_send_external\": { \"PLT-ADM\": \"NA\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"referral_send_internal\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"ALWAYS\" },\n \"roi_submit_manage\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"ALWAYS\" },\n \"role_assign\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NA\", \"TEAM-ADM\": \"PREF_NO\", \"research_analytics\": \"NA\" },\n \"roles_accounts_toggle\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\" },\n \"sandbox_environment_manage\": { \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"screening_conduct\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"ALWAYS\", \"legal_advocate\": \"PREF_YES\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_YES\" },\n \"screening_view\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_NO\", \"healthcare_provider_medical\": \"ALWAYS\", \"le_liaison_vsp\": \"NEVER\", \"prosecutor_review\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"NEVER\" },\n \"service_log_manage\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"PREF_YES\" },\n \"session_create\": { \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"ALWAYS\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"ALWAYS\", \"legal_advocate\": \"ALWAYS\", \"mandatory_reporter\": \"ALWAYS\", \"mdt_participant\": \"ALWAYS\", \"prosecutor_review\": \"ALWAYS\", \"public_reporter\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"ALWAYS\" },\n \"share_config\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"PREF_YES\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"research_analytics\": \"NA\" },\n \"share_revoke\": { \"PLT-ADM\": \"ALWAYS\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"ALWAYS\", \"mdt_participant\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_NO\", \"volunteer\": \"PREF_NO\" },\n \"share_rule_approve_cross_agency\": { \"GOV-AUD\": \"PREF_YES\", \"PLT-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"share_vsp_to_le\": { \"PLT-ADM\": \"ALWAYS\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"NA\", \"le_liaison_vsp\": \"ALWAYS\", \"research_analytics\": \"NA\", \"screener\": \"NEVER\", \"volunteer\": \"NEVER\" },\n \"srl_manage\": { \"DATA-ADM\": \"PREF_YES\", \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\" },\n \"supervisee_thread_view\": { \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"case_nav\": \"NA\" },\n \"support_ticket_triage\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"system_diagnostics_view\": { \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"case_nav\": \"NA\" },\n \"team_config_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"NEVER\", \"research_analytics\": \"NA\" },\n \"team_membership_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NA\", \"TEAM-ADM\": \"ALWAYS\", \"case_nav\": \"NA\", \"research_analytics\": \"NA\" },\n \"team_share_narrowing\": { \"MEM-ADM\": \"ALWAYS\", \"SUP\": \"PREF_NO\", \"TEAM-ADM\": \"PREF_YES\", \"research_analytics\": \"NA\" },\n \"team_workflow_config_manage\": { \"MEM-ADM\": \"ALWAYS\", \"TEAM-ADM\": \"PREF_YES\", \"research_analytics\": \"NA\" },\n \"training_gate_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"PLT-SUP\": \"PREF_YES\", \"SUP\": \"NA\", \"TEAM-ADM\": \"PREF_YES\", \"TRAIN-ADM\": \"ALWAYS\", \"research_analytics\": \"NA\" },\n \"usr_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"NEVER\", \"TEAM-ADM\": \"PREF_NO\", \"research_analytics\": \"NA\" },\n \"viewing_config_manage\": { \"MEM-ADM\": \"ALWAYS\", \"PLT-ADM\": \"ALWAYS\", \"SUP\": \"PREF_YES\" },\n \"viewing_level_1_search\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"ALWAYS\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"ALWAYS\", \"healthcare_provider_medical\": \"PREF_YES\", \"intel_analyst\": \"ALWAYS\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_YES\", \"mandatory_reporter\": \"PREF_NO\", \"mdt_participant\": \"PREF_YES\", \"prosecutor_review\": \"PREF_YES\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"PREF_NO\" },\n \"viewing_level_2_autocomplete\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_YES\", \"case_nav\": \"ALWAYS\", \"crisis_response\": \"PREF_YES\", \"healthcare_provider_medical\": \"PREF_NO\", \"intel_analyst\": \"PREF_YES\", \"investigator\": \"ALWAYS\", \"le_liaison_vsp\": \"PREF_YES\", \"legal_advocate\": \"PREF_NO\", \"mandatory_reporter\": \"NEVER\", \"mdt_participant\": \"PREF_NO\", \"prosecutor_review\": \"PREF_NO\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"ALWAYS\", \"volunteer\": \"NEVER\" },\n \"viewing_level_3_components\": { \"PLT-ADM\": \"NA\", \"behavioral_health_provider\": \"PREF_NO\", \"case_nav\": \"PREF_YES\", \"crisis_response\": \"PREF_NO\", \"healthcare_provider_medical\": \"PREF_NO\", \"intel_analyst\": \"PREF_NO\", \"investigator\": \"PREF_YES\", \"le_liaison_vsp\": \"PREF_NO\", \"legal_advocate\": \"PREF_NO\", \"mandatory_reporter\": \"NEVER\", \"mdt_participant\": \"PREF_NO\", \"prosecutor_review\": \"PREF_NO\", \"public_reporter\": \"NEVER\", \"research_analytics\": \"NA\", \"screener\": \"PREF_YES\", \"volunteer\": \"NEVER\" },\n};\n","/**\n * @htilabs/platform-common-models — CVC-133 codebook default bounds (co-p1x)\n *\n * The codebook's default bound for every (evaluable function, role) pair:\n * canon's `bounds:` block (records repo `data/cvcs/core_functions.yaml`),\n * generated into `CORE_FUNCTION_DEFAULT_BOUNDS` by\n * `scripts/gen-core-functions.py` and held equal to the pinned canon by GATE L.\n *\n * WHAT THESE ARE — and are not. The kickoff\n * (`KICKOFF_SHARED_AUTHZ_RESOLVER_2026-10-12.md` § 3 rule 7) rules that the\n * live role × function bounds are platform POLICY STATE, edited only by\n * PLT-ADM on Platform Configuration. This module does not change that: it is\n * the CODEBOOK DEFAULT under the policy — what platform seeds into\n * `platformRoles.functions` when a role row is inserted, and what the bounds\n * editor's \"clear\" reverts to (platform-prototype @ a6f1f3a\n * `PLATFORM_BOUNDS.pristineStateFor`, `src/agencyhub.jsx:2024-2039`; the\n * five chip states always / default_on / default_off / never / na,\n * `src/screens.jsx:19151-19152`). The resolver never reads it: it reads the\n * stored policy rows it is handed (`resolveEffectiveFunctions`).\n *\n * UNBOUND IS INELIGIBLE — aligned to canon (co-p1x, 0.24.0). A role the\n * codebook does not name for a function has no default bound\n * (`codebookDefaultBound` → `null`), and a seeder writes nothing for it.\n * Canon's `authzResolve` returns `role_ineligible` for such a role before any\n * agency layer runs (`src/agencyhub.jsx:578-584`), and\n * `resolveEffectiveFunctions` now does the same: a role row with no stored\n * state for a function is NEVER for that role — no agency override and no\n * team policy can enable the pair — and, like every NEVER, it is local to its\n * role (another held role's grant stands). The dev resolvers' tool-overlap\n * default (unlisted → PREF_NO on a shared tool) is gone; the role and\n * function rows' `tools` are no longer read by the resolver.\n *\n * NA. A platform that seeds Tier 1 verbatim from this map stores `\"NA\"` for\n * the codebook's \"Not relevant\" pairs. The resolver reads a stored `NA` as\n * NEVER at every tier (a recognised codebook value, not malformed data): at\n * Tier 1 it is locked, at Tier 2 it denies that role, at Tier 3 it restricts\n * (Required stays immune). Malformed data would deny identically; reading it\n * as NEVER just keeps a legitimate seed out of the malformed class. Only the\n * Tier-1 type admits it (`AuthzTier1StateMap`, `PlatformRoleDef.functions`);\n * agency / team maps stay PermissionStateValue (canon has no NA chip there),\n * and a stored NA there still denies. GATE L's property tests check the\n * resolver, seeded from this map, against an oracle taken from canon\n * `authzResolve` (`:551-628`, with the Required-immunity ruling): every\n * function × role × agency × team value, and every role pair's union.\n */\n\nimport type { DefaultBoundStateValue } from \"../constants/platform-auth.js\";\nimport { CORE_FUNCTION_DEFAULT_BOUNDS } from \"../generated/coreFunctionDefaultBounds.js\";\n\nexport {\n CORE_FUNCTION_DEFAULT_BOUNDS,\n CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION,\n} from \"../generated/coreFunctionDefaultBounds.js\";\n\n/**\n * The codebook default bound of `roleCode` (a CVC-134 / CVC-135\n * `canonicalCode`, e.g. `MEM-ADM`, `case_nav`) for `functionCode`, or `null`\n * when the role is unbound for it — including when the function is not\n * evaluable (unknown, retired or not-v1). Own keys only, so an inherited name\n * such as `constructor` is never a function or a role.\n */\nexport function codebookDefaultBound(\n functionCode: string,\n roleCode: string,\n): DefaultBoundStateValue | null {\n if (!Object.hasOwn(CORE_FUNCTION_DEFAULT_BOUNDS, functionCode)) return null;\n const roles = CORE_FUNCTION_DEFAULT_BOUNDS[functionCode]!;\n return Object.hasOwn(roles, roleCode) ? roles[roleCode]! : null;\n}\n","/**\n * @htilabs/platform-common-models — CVC-133 Guidance and Logic notes\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `python3 scripts/gen-core-functions.py <prototype root>`.\n *\n * For each evaluable function of coreFunctions.v1.5.0.json (canon @ d63c2a42): the codebook's\n * Guidance and Logic notes columns (canon `guidance` / `logic_notes`), verbatim; a blank cell is null.\n * Read-only vocabulary — the reading Platform Configuration's function window shows.\n */\n\nexport const CORE_FUNCTION_NOTES_SOT_VERSION = \"1.5.0\";\n\nexport interface CoreFunctionNotes {\n readonly guidance: string | null;\n readonly logicNotes: string | null;\n}\n\nexport const CORE_FUNCTION_NOTES: Readonly<Record<string, CoreFunctionNotes>> = {\n \"agency_info_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13. As-built canDirectEdit (agencyhub.jsx) passes ANY admin role at the own agency plus PLT-ADM/PLT-SUP; these bounds are the deliberate Phase-2 narrowing. The code's own header called the missing function a standing steward flag — this row closes it. | CLOSED 2026-08-14 (CORE-FUNCTIONS Phase 2, ruling R-B): canDirectEdit narrowed — same-agency seats must resolve agency_info_manage ∨ srl_manage; the PLT steward arm is unchanged. [CVC133-AUDIT 2026-09-10]\" },\n \"announcement_publish\": { guidance: null, logicNotes: \"Seeded 2026-08-13. As-built gates diverge: platform isHTIStaff (PLT-ADM/PLT-SUP) vs leads-app canPublishAnnouncements (internal_hti org membership). These bounds are the convergence target; Phase 2 re-points the leads-app gate. | CLOSED 2026-08-14 (Phase 2): leads-app canPublishAnnouncements converges on these bounds — the internal_hti org blanket is retired and the armed governance stand-in stays as the explicit demo arm; the /settings card renders disabled-with-reason. [CVC133-AUDIT 2026-09-10]\" },\n \"api_key_manage\": { guidance: \"Use for integration credential management and security hygiene.\", logicNotes: \"High-risk control-plane action. Always audited. Often restricted to MEM-ADM/PLT-ADM.\" },\n \"assessments_conduct\": { guidance: \"Use for the action of conducting an assessment, including answering and submitting the instrument. Distinct from viewing assessment responses. Screenings (including the Lethality Assessment and Injury & Strangulation Screening) follow screening_conduct; the Needs Assessment and the Adult Hope Scale follow needs_priorities_conduct.\", logicNotes: \"May require specific training/certification and may be limited by workflow state. Responses should be immutable after submission except via governed correction pathways. Ensure timestamping, author attribution, and linkage to the relevant case/session. | Re-scoped 2026-08-13 (Phase-0 overhaul): PAVE → PAVE/LEADS — the TRA is the LEADS instrument (per-answer CARs, freeze-on-submit; 'IDA' is the same flow's labor question set, not a separate runner). | Investigator + Intelligence Analyst added to Always 2026-10-01 (CAPTURE-AUTHZ-BOUNDS-GAPS — Crysta: 'those are gaps that need fixed'): the TRA is their instrument and the row bound neither, so both were refused it once the function was enforced. Level is the agent's derivation: Always, matching their binding on determination_perform — move it if she wants Default On. | ENFORCED 2026-10-01 (CAPTURE-AUTHZ-WAVE4): HTI_CAPTURE_AUTHZ.guard at the opener, the runner's open and its commit; regression net tools/smoke/flows/capture-authz-wave4.js. Which instruments this code governs (Crysta 2026-10-01): IDA, Stalking Assessment, Danger Assessment, TRA. The Lethality Assessment (LAP) and Injury & Strangulation Screening are 'specialized screens' and follow screening_conduct, though PAVE lists them with the assessments on the Exploitation page. The Needs Assessment and the Adult Hope Scale follow needs_priorities_conduct. Definition and Guidance reworded 2026-10-01 to say so (Crysta: 'Please address / reword').\" },\n \"auth_model_manage_platform\": { guidance: \"HTI Labs control-plane function. Enables platform-level definition of roles/functions and enforcement logic. Should not imply routine case content access.\", logicNotes: \"Changes must be auditable, versioned, and reviewed. Separate from member-level role assignment (MEM-ADM).\" },\n \"case_assign_reassign\": { guidance: \"Use for administrative case assignment and reassignment workflows (turnover, load balancing, supervisory action). Must honor viewing/sharing policy clamps; assignment should not automatically grant broader visibility beyond what policies allow.\", logicNotes: \"Audit all assignment changes (who changed, when, from/to). Consider requiring reason codes for transfers. Distinct from operational collaboration actions (adding collaborators) if those exist.\" },\n \"case_claim\": { guidance: \"Use for recipient-side intake of referrals.\", logicNotes: \"Claiming should set ownership, start SLA timers where applicable, and apply recipient-side policy constraints. Must ensure the recipient has sufficient permissions and that any required training/certifications are satisfied. Log acceptance and claim events. | Renamed 2026-08-13 (was 'Claim Share'): distinct from Thread's hotline lifecycle status 'Claimed' (Open→Claimed→Submitted→Closed), which is a record state, not a function. | 2026-09-10 (CVC133-AUDIT, Crysta ruling R2): Case Navigator/Advocate was listed in both Always and Default On — Always stands (what the resolvers already computed); the Default On duplicate is removed.\" },\n \"case_close\": { guidance: \"Holder-only: the acting user must be the case's primary advocate or a co-primary (a second primary added by an accepted case collaboration). Bound like case_assign_reassign (Account Admin + Supervisor always; Case Advocate/Navigator always; Team Admin default on). The approval leg is the supervisor-confirm leg of case_status_manage brought to PAVE: the approver must hold this function AND be an Account Admin of the case's account or a supervisor of the holder, and is never the requester. Approval is always required in PAVE — no per-agency switch (unlike LEADS's supervisor_signoff_close).\", logicNotes: \"Minted 2026-10-10 on Crysta's 2026-10-09 ruling (CASE-OWNERSHIP-ON-SHARE + CLOSE-APPROVAL — Case Data Object page § 4 / § 4a): \\\"close should be holder-only (which means we need to add it to our core-functions CVC and give it the same authority as case_assign_reassign). I'd want a user to be able to do the close process, but it's not real until an admin or supervisor approves it (which would mean a notification that goes to the admin or supervisor and the ability for them to approve or not approve).\\\" Holder-only: the acting user must be the case's primary advocate or a co-primary (2026-10-09). The close is a REQUEST until an Account Admin or the holder's team Supervisor approves it (the supervisor-confirm leg of case_status_manage, brought to PAVE); the requester cannot approve their own request. Program exits taken on the way stand immediately (their own confirmed acts); only the relationship close waits. The derived CASE_CLOSED milestone dates to the ruling. Notifications: caseCloseRequested (to the approvers) · caseCloseRuled (back to the requester), CVC-284. Enforced in the monolith: the lifecycle popover's \\\"Mark engagement closed →\\\" door + HTI_LIFECYCLES_API.requestClose / ruleClose (records repo, KICKOFF_CASE_OWNERSHIP_ON_SHARE_AND_CLOSE_APPROVAL_2026-10-09.md WI-3/WI-4). Distinct from case_status_manage (LEADS-only, the investigative case's four facets) and from exit_discharge_conduct (the program-exit walk inside the same modal).\" },\n \"case_collaborator_add\": { guidance: \"Use for collaboration membership changes on a case.\", logicNotes: \"Should enforce share purpose, counterparty rules, and viewing/sharing payload constraints where applicable. | Boundary note 2026-08-13: covers access-granting participant/collaborator adds (incl. co-claim). The Case Personnel panel's named-personnel entries are deliberately NON-access-granting and are not this function.\" },\n \"case_edit\": { guidance: \"Use for standard case updates in PAVE (notes, attributes, metadata). Do not use for referral sending/receiving, ROI workflows, or governance configuration.\", logicNotes: \"Edits should respect field-level permissions and workflow state. Record a full audit trail of changes. Enforce validation rules and required fields. Where applicable, restrict editing to assigned/claiming users or specific roles. | Narrowed + re-scoped 2026-08-13 (D13 split): PAVE → LEADS/PAVE/THREAD; six sibling capture codes carry the former scope; BLUF manual curation (blufCurationStore) rides HERE per the adversarial-review cut of a standalone bluf_curate.\" },\n \"case_needs_action_flag_manage\": { guidance: \"Supports admin/supervisor triage workflows described in the agency cases page concept. User ability to set vs clear can be governed separately via policy; default is that admins/supervisors can clear.\", logicNotes: \"Treat as workflow metadata; do not use as a substitute for legal/policy approvals. Audit flag changes.\" },\n \"case_reopen\": { guidance: \"Use when a user or system restores an inactive/closed case to an active state after new information, correction, or follow-up. Distinct from editing a closed case without changing status, duplicating/cloning a case, or creating a new case. Commonly used in PAVE when a prior screening/service record needs to resume.\", logicNotes: \"Re-open a closed case. This is a workflow state transition that must be:\\n- authorized in context (role/team/purpose/legal basis/clearance/consent as applicable)\\n- non-escalatory (does not expand visibility or sharing)\\n- fully auditable (who/when/why)\\n\\nAny additional workflow effects (notifications, queue updates, timers) are implementation details and must not bypass authorization clamps.\" },\n \"case_side_panel_use\": { guidance: \"Use for the in-workflow action of adding collaboration notes and supplemental artifacts via the side panel UI. Useful for adding context to why and when information within a case changed.\", logicNotes: \"Notes and attachments may have separate retention and visibility rules. Attachments must flow through the safe pipeline (scanning/quarantine). Comments should be auditable where required and may be restricted to team scope. | Re-scoped 2026-08-13 (Phase-0 overhaul): LEADS → LEADS/PAVE/THREAD — PAVE/Thread Session Notes (HTI_NOTES_API) is the same capability. User bounds seeded (row previously carried only N/A: Research/Analytics).\" },\n \"case_status_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Supervisor confirm is the approval leg of the same act (one code + note, D15/D19 pattern). Distinct from case_outcomes_edit (not v1): this transitions status; outcome-field content at closure is that row's scope. case_reopen remains its own row. | ENFORCED 2026-08-19 (CF-PHASE3-WAVE2): leads-app caseStore.ts caseActorMayGovern consults these bounds under the standing Case-Agent floor on every status transition and on the supervisor confirm leg (triageStore.ts too); walked FLOW-227. [CVC133-AUDIT 2026-09-10]\" },\n \"case_transfer_bulk\": { guidance: \"Use for turnover management and emergency redistribution. Should be heavily audited and may be restricted to MEM-ADM by policy.\", logicNotes: \"Bulk actions should require confirmation, audit trail, and optionally dual-approval depending on member policy.\" },\n \"case_view\": { guidance: \"Use for read-only access to case records in PAVE. This is distinct from searching, editing, printing/exporting, or sharing.\", logicNotes: \"Enforce row-level access (team/agency, assignment/ownership, policy purpose). Viewing should be auditable (who accessed what, when). Redact fields that are not permitted (minimum necessary). | Re-scoped 2026-08-13 (Phase-0 overhaul): PAVE → PAVE/LEADS/THREAD — LEADS carries the richest as-built view gating (access.ts six-gate pipeline); Thread queues share the same factory. Bounds add: Always += Investigator, Intelligence Analyst; Default On += MDT Participant, Prosecutorial Reviewer, Legal Advocate.\" },\n \"case_visibility_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13 (Phase-0 overhaul). As-built also requires Case-Agent-or-admin standing on a participant agency (caseStore.ts canSetCaseVisibility) — a policy clamp layered above these role bounds. | ENFORCED 2026-08-19 (CF-PHASE3-WAVE2): leads-app caseStore.ts caseActorMayGovern on darken/restore, composed with the Case-Agent-or-admin participant-agency clamp. [CVC133-AUDIT 2026-09-10]\" },\n \"ci_periodic_review\": { guidance: \"Use for the required periodic revalidation of active CI records (e.g., 28 CFR Part 23 review cycle), confirming continued relevance, accuracy, and compliance.\", logicNotes: \"Governance review workflow. Must enforce: (1) reviewer authorization + training, (2) evidence/reasonable suspicion basis still valid, (3) sourcing/provenance still sufficient, (4) disposition outcomes: revalidate, retire, purge-request, (5) set next review date, (6) full audit logging. This is not a content edit function; any substantive edits should be performed via the relevant record-edit function and then revalidated. | v1 2026-08-13 — BUILT (ciReviewQueue.ts + ciReviewsDue derivation); role enforcement lands Phase 2. | ENFORCED 2026-08-14 (Phase 2): outcome-grain store gate on revalidate (criminalIntelligence.ts ciActorMayGovern — CIRO bounds ∨ break-glass grant, refusal surfaced in CiReviewQueue); the any-admin stand-in arm was deleted 2026-08-19 once a real CIRO seat was seeded. [CVC133-AUDIT 2026-09-10]\" },\n \"ci_record_purge_or_retire\": { guidance: \"Use for governance retirement/purge of CI records when they expire, fail revalidation, or must be destroyed under retention rules or legal requirement. Distinct from soft-delete/archiving and from non-CI case record purge.\", logicNotes: \"Approval-gated destructive action. Must enforce: (1) retention policy + legal hold checks, (2) jurisdiction/SOP constraints, (3) required justification, (4) irreversible purge semantics when purging, (5) audit logging and supervisory approval, (6) preserve non-identifying audit metadata required for compliance. Prefer \\\"retire\\\" when the record should become inactive but retained; use \\\"purge\\\" only when destruction is permitted/required. | v1 2026-08-13 — BUILT (removeCriminalIntelligenceFlag, note-required); role enforcement lands Phase 2. | ENFORCED 2026-08-14 (Phase 2): outcome-grain store gate on purge (criminalIntelligence.ts ciActorMayGovern — CIRO bounds ∨ break-glass grant); the any-admin stand-in arm was deleted 2026-08-19 once a real CIRO seat was seeded. [CVC133-AUDIT 2026-09-10]\" },\n \"ci_record_validate\": { guidance: \"Use for designated-authority validation of an IDB (criminal intelligence) record so it can be treated as active CI for LEADS workflows. Distinct from creating/editing the record and from viewing CI.\", logicNotes: \"Approval-gated governance action. Must enforce: (1) required SOP/training prerequisite, (2) sourcing/provenance completeness, (3) classification + sensitivity tagging, (4) reasonable suspicion / 28 CFR Part 23 compliance where applicable, (5) audit logging (who/when/why), (6) set/refresh next required review date and retention timers. Validation must not expand who can view the record; visibility remains clamped by role + clearance + case/team context. | v1 2026-08-13 — BUILT (leads-app CI Review Queue, criminalIntelligence.ts reviewCriminalIntelligence); role enforcement lands Phase 2. | STATUS 2026-09-10 (CVC133-AUDIT): still config-only — no consumer resolves this code; the Review Queue's validate leg carries no role gate (the revalidate and purge legs do, since Phase 2). Tracked with the Phase-4 tail on RWT-NEW-core-functions-overhaul-2026-08-13.\" },\n \"ci_to_evidence_export_authorize\": { guidance: \"Use when a designated authority authorizes an export that packages CI for evidentiary use or external legal process. Distinct from routine reporting/printing and from internal investigative notes export.\", logicNotes: \"High-risk output authorization. Must enforce: (1) explicit purpose (e.g., charging, discovery, court order), (2) scope minimization, (3) redaction of protected victim info unless ROI/legal exception, (4) CI vs evidence separation and chain-of-custody expectations, (5) supervisory approval where required, (6) watermarking / export labeling, (7) immutable audit logging of payload metadata + recipient context. Export must be authorization-bounded: only data the principal is allowed to view can be exported unless an explicit break-glass scope covers it. | v1 2026-08-13 — BUILT (exportRegister.ts requestExport/decideExport/releaseExport with real SoD: decider ≠ requester, prosecution hard gate); as-built eligible deciders are ANY admin-role holder at the org (Crysta ruling in-code) — looser than the CIRO-only bound; convergence at Phase 2. | CLOSED 2026-08-19 (Phase-2 residue (iv)): the any-admin decider arm is deleted; a real CIRO seat is seeded and decideExport composes CIRO bounds ∨ break-glass grant with separation of duties intact. [CVC133-AUDIT 2026-09-10]\" },\n \"deconfliction_alert_acknowledge\": { guidance: \"Use for the user action that explicitly acknowledges a deconfliction alert.\", logicNotes: \"Alert acceptance may require the user to confirm awareness and may trigger follow-up actions such as linking records, notifying a team, or initiating a deconfliction workflow. Should be logged to audit.\" },\n \"deconfliction_unmask\": { guidance: null, logicNotes: \"Seeded 2026-08-13. As-built clamp is Case-Agent-only (deconflictionStore.ts); these bounds are the role-eligibility floor above it. Refuses when the owner case is dark.\" },\n \"determination_perform\": { guidance: \"Use for determination recording actions. The meaning of the determination is defined elsewhere in the information model.\", logicNotes: \"Often gated by training/certification state (e.g., certified assessor). | ENFORCED 2026-09-06 (CVC134-135-AUDIT, Crysta: 'it's not the seal that matters, it's the findings surface itself. make the permission model real'): every Findings-cockpit opener in the monolith routes through openCockpit, which resolves HTI_CAPTURE_AUTHZ.access('determination_perform') — refuses at the data layer and paints the opener disabled with the plain-language reason; walked across seven seats (BHP/investigator allowed via Always, case_nav via Default On, screener/crisis_response/volunteer refused by name, multi-role rule holding both ways). Screenings and assessments already carried training gates; this closed the concluding step. [CVC133-AUDIT 2026-09-10] | Legal Advocate added to Default On 2026-09-30 (LEGAL-ADVOCATE-BOUNDS — Crysta ruling: 'They should have these permissions'). Level is the agent's derivation: Default On, matching Case Navigator/Advocate, the nearest casework role — move it if she wants Always.\" },\n \"disclose_external_request\": { guidance: \"Use when an operational user initiates a disclosure workflow. Authorization is handled by a separate function (designated authority approval).\", logicNotes: \"Must capture purpose, legal basis, consent/ROI state, payload scope, counterparty, and time bounds. Must be auditable. Submission should not disclose data until approved. | BOUNDS 2026-09-10 (CVC133-AUDIT, Crysta ruling R3): the row was user-relevant with no user bound — a deny for every operational seat; Always now mirrors the four user roles the approval half (disclose_external) names: VSP LE Liaison, Investigator, Legal Advocate, Case Navigator/Advocate.\" },\n \"enrollment_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13 (Phase-0 overhaul, agent-seeded per approved D1; split from case_edit per D13). Sibling codes: exit_discharge_conduct, service_log_manage, goals_plan_manage, needs_priorities_conduct, profile_domain_edit. | ENFORCED 2026-08-20 (CF-PHASE3-WAVES-3A–3D): the monolith's captureFunctionAccess (window HTI_CAPTURE_AUTHZ) gates the enrollment commit paths and paints the openers disabled-with-reason; regression net tools/smoke/flows/capture-authz-wave3.js. [CVC133-AUDIT 2026-09-10]\" },\n \"exit_discharge_conduct\": { guidance: null, logicNotes: \"Seeded 2026-08-13 (D13 split). High-consequence leg deliberately split from enrollment_manage so agencies can enable enrollment without enabling discharge. | ENFORCED 2026-08-20 (CF-PHASE3-WAVES-3A–3D): the monolith's captureFunctionAccess (window HTI_CAPTURE_AUTHZ) gates the exit/discharge wizard incl. the involuntary-discharge cascade; regression net tools/smoke/flows/capture-authz-wave3.js. [CVC133-AUDIT 2026-09-10]\" },\n \"export_deidentified\": { guidance: \"Use for member-owned reporting exports (Echo). Outputs are derived from a single Member’s contributed data only. This function does not authorize cross-member aggregation, community datasets, or any platform-wide de-identified datasets. External disclosure/export approval policies may still apply depending on member settings.\", logicNotes: \"Treat export as sensitive even when de-identified. Require explicit purpose + logging for each export. Keep this distinct from any future HTI Labs–only system-wide aggregation or research-grade datasets.\" },\n \"goals_plan_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13 (D13 split). | ENFORCED 2026-08-20 (CF-PHASE3-WAVES-3A–3D): the monolith's captureFunctionAccess (window HTI_CAPTURE_AUTHZ) gates plan/goal/action-step commits; regression net tools/smoke/flows/capture-authz-wave3.js. [CVC133-AUDIT 2026-09-10]\" },\n \"idb_record_create\": { guidance: \"Use for intelligence record creation (not case creation).\", logicNotes: \"May require CI governance controls (validation/review/expiration).\" },\n \"indicator_manual_add\": { guidance: null, logicNotes: \"Seeded 2026-08-13. LEADS inclusion CONFIRMED 2026-08-14 by the Phase-2 runtime trace (G9): the Add Alert Indicator opener carries no app gate and the drawer opens live under data-app=\\\"leads\\\" (Chrome-driven gesture, CORE-FUNCTIONS Phase 2 session); platform_relevance PAVE·THREAD·LEADS stands. | Demoted from the default user-role config view 2026-08-19 (Crysta ruling, UDD+Core-Functions residue kickoff § 6 Q4, executing the Phase-0 worksheet § I item 5 flag; G9 demoted, not cut — bounds + resolver behavior unchanged). | ENFORCED 2026-10-01 (CAPTURE-AUTHZ-WAVE4): HTI_CAPTURE_AUTHZ.guard at the Add Indicator drawer's opener and its save; regression net tools/smoke/flows/capture-authz-wave4.js.\" },\n \"investigation_create_claim\": { guidance: \"Use for the combined ‘create investigation + claim’ operational action. If implementation separates these, split into two functions.\", logicNotes: \"Often requires team workflow eligibility and may trigger deconfliction checks.\" },\n \"investigation_session_run\": { guidance: null, logicNotes: \"Seeded 2026-08-13.\" },\n \"investigative_database_search\": { guidance: \"Use for in-product search across the investigative datastore (first-party). Distinct from open-source or external intelligence search.\", logicNotes: \"Search results must be filtered by ABAC, org scope, and sensitivity tier. Queries and access may be audited. Rate limiting and purpose restrictions may apply.\" },\n \"investigative_request_send\": { guidance: \"The LEADS-workforce door. Distinct from message_send (any platform message) and from investigative_database_search (searching the account's own IDB): this is the ask that leaves the agency for HTI Labs. Rides the Platform Help chooser and the leads-app support path. Never a claim-side act — 'Request a lead' is an investigative request TO HTI Labs.\", logicNotes: \"MINTED 2026-09-10 (CVC133-AUDIT, Crysta ruling R4). Until today the Platform Help chooser (HTI_hasLEADSAccess) resolved investigative_database_search as a proxy (2026-09-06, CVC134-135-AUDIT R1 'Ask the permissions model') because no function named the act while message_send's definition claimed it. Bounds mirror the proxy (Investigator + Intelligence Analyst Always) so nothing on screen changes; the door now resolves this code and message_send no longer claims the act.\" },\n \"lead_create\": { guidance: \"Operational creation of LEADS leads/tips. Subsequent publication/routing is separate.\", logicNotes: \"May be constrained by team workflow and viewing policy; does not imply broad browsing.\" },\n \"lead_publish\": { guidance: \"Use for making a lead actionable beyond its creator’s draft context.\", logicNotes: \"Publishing should apply policy constraints (purpose, counterparty if shared) and audit events. | 2026-08-13: reject/unpublish absorbed here (one approval act, both valences — leadLifecycleStore reject/unpublish); lead disposition/priority triage is lead_triage_manage.\" },\n \"lead_route_assign\": { guidance: null, logicNotes: \"Seeded 2026-08-13. HTI routing act, distinct from post-claim case_assign_reassign.\" },\n \"lead_triage_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Reject/unpublish are lead_publish's absorbed scope, not this. Personal save/follow deliberately excluded (non-function per the ratified ledger).\" },\n \"magic_link_share_send\": { guidance: \"Use for ad-hoc, controlled sharing via a secure link. Distinct from standard in-product sharing/referrals between authenticated users.\", logicNotes: \"Magic links must be time-bound, revocable, and bound to a specific recipient context when possible. Access via link should enforce ABAC, sensitivity tier, and consent/ROI restrictions. All access events must be logged. | As-built note 2026-08-13: magic link is one of six delivery methods inside the single Share composer; the composer is the act, the method is configuration. Coded separately because magic-link sends are separately configurable (they leave the platform). | ENFORCED 2026-08-19 (CF-PHASE3-WAVE1): the magic-link method option in the Share composer gates on these bounds (disabled-with-reason + a triggerSend data-layer backstop). [CVC133-AUDIT 2026-09-10] | Legal Advocate added to Default On 2026-09-30 (LEGAL-ADVOCATE-BOUNDS — Crysta ruling: 'They should have these permissions'). Level is the agent's derivation: Default On, matching Case Navigator/Advocate, VSP LE Liaison and Crisis Response on this row. | 2026-10-19 (Crysta ruling, Next Steps v2.1 walk): Screener (Initial Screen) moved Default Off → Default On ('let's change Screener to be default on — I can always change my mind down the road when the on-platform network is much more built out'); Supervisor (admin role) added as Default On ('supervisor should default on') — the row is admin-relevant from this date so the admin-role column binds; a seat whose only user role was Screener + Supervisor had been refused the method. Volunteer stays Default Off.\" },\n \"mandatory_report_send\": { guidance: \"Gates WHO may send a mandatory report; it never gates whether the duty can be met. A user without this function flags 'needs a mandatory report,' which routes as an internal authority report (the share flow, ROI question skipped) to the agency's designated internal reporting team, who send the legal report. Partner-level settings never block reporting purposes.\", logicNotes: \"RATIFIED Crysta 2026-08-23 (mandatory-report escalation design round: the function + these role defaults + the escalation notification kind ratified as one steward batch — 'I'm shocked we don't already have this function in our codebook'). Canon homes: GDR § 5.79 legal-reports amendment + § 5.44.1 INTERNAL-ROUTING-IS-A-SHARE (both 2026-08-23). TEAM RUNG (Crysta, same ruling): this function also rides team workflows — a team whose configured workflow includes it is recognized as the agency's reporting team (the internal-reporting-destination derivation consumes this). PLACED ON NOTION 2026-09-10 (CVC133-AUDIT; authored repo-side 2026-08-23 per the safe_locations provisional precedent). STEWARD OPEN closed the same day (Crysta ruling R1, CVC133-AUDIT): the certified provider roles (behavioral health, medical) are Default On as professional mandated reporters. User roles not listed in any bound resolve to a deny ('not part of your roles').\" },\n \"member_account_report_generate\": { guidance: \"Use for generating an internal-facing report about a member account. Distinct from platform-wide aggregate reporting and from client/case reporting.\", logicNotes: \"Scope must be constrained by org/team boundaries and least-privilege rules. Report generation should be auditable. Redact or exclude __ fields by default. | ENFORCED 2026-08-14 (Phase 2): Echo generateFinal (the grant-report freeze) gates on this code — a compact local bounds-layer gate, since Echo carries no full resolver. [CVC133-AUDIT 2026-09-10]\" },\n \"member_onboarding_support\": { guidance: \"Use for HTI Labs support staff assisting members through onboarding and adoption, while keeping governance actions with MEM-ADM and platform admins.\", logicNotes: \"May include read-only access to onboarding checklists and configuration status; should not include role assignment or API key management. | Scope note 2026-08-13: the Manage-Agencies management actions — request survey, request a document, review edit requests — ride this function (as-built: resolveEditRequest already gates on it; the request acts adopt it at Phase 2).\" },\n \"message_moderate\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Per-user block/report are personal-safety affordances riding message_send, not this function.\" },\n \"message_send\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Typed threads post through the one canonical HTI_MESSAGES_API channel; the leads-app store mirrors the platform composer verbatim — one act, one code. Per-user block/report are personal-safety affordances riding this function. | 2026-09-10 (CVC133-AUDIT, Crysta ruling R4): the investigative-request / Ask-HTI ask is its own function, investigative_request_send — this row no longer claims it. The earlier note that the LEADS chooser gate covered 'HTI staff + leads_investigator only' is superseded: since 2026-09-06 the door asks the permission model (investigative_request_send as of today).\" },\n \"milestone_log\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Independent of embedding sessions (logs from the case timeline and network page). | Demoted from the default user-role config view 2026-08-19 (Crysta ruling, UDD+Core-Functions residue kickoff § 6 Q4, executing the Phase-0 worksheet § I item 5 flag; F3 demoted, not cut — bounds + resolver behavior unchanged).\" },\n \"needs_priorities_conduct\": { guidance: null, logicNotes: \"Seeded 2026-08-13 (D13 split). ONE code deliberately: needs + priorities are a single shared panel as-built (same mapping_version needs_assessment_decline_v1, both apps wired by the same setupPrioritiesPanel calls). Split later only if agencies need to configure them apart. | ENFORCED 2026-08-20 (CF-PHASE3-WAVES-3A–3D): the monolith's captureFunctionAccess (window HTI_CAPTURE_AUTHZ) gates the shared panel's commits in both apps; regression net tools/smoke/flows/capture-authz-wave3.js. [CVC133-AUDIT 2026-09-10] | Legal Advocate added to Default On 2026-09-30 (LEGAL-ADVOCATE-BOUNDS — Crysta ruling: 'I agree, and want you to do it'): the 2026-08-13 seed omitted it here while binding it Default On on the sibling capture codes, so a Legal Advocate running an intake was refused at the Immediate Priorities step. | Adult Hope Scale placed under this code 2026-10-01 (Crysta: 'I agree'): it shares the Needs & Hope substep with the Needs Assessment (NEEDS_AND_HOPE recommendations 2026-05-14) and no function had named it, so the runner opened and committed it for any seat. Enforced by the instrument map in CAPTURE-AUTHZ-WAVE4 (HS → needs_priorities_conduct).\" },\n \"network_corpus_access\": { guidance: null, logicNotes: \"Seeded 2026-08-13. As-built: the ONE hard internal gate (access.ts isHtiInternal). No member bounds — unlisted member roles are out of scope by design.\" },\n \"note_open_departed_author\": { guidance: \"The one exception to the rule that only a note's author changes its visibility (Spec v2 - Narrative notes, rule 10, signed by Crysta 2026-10-05). Use only when the author's account has been deactivated. Each note opened this way shows \\\"Opened by [admin] on [date]\\\", and the act is recorded in the case history. It never applies to a note whose author is still active.\", logicNotes: \"Off until an account turns it on (Default Off for Account Admin; no other role holds it). PAVE and Thread notes only; LEADS is unchanged. One note at a time: Private to me -> Our account only, never to Can be shared. The words are not shown to the admin before the note is opened. Added 2026-10-05 by Claude while building the signed Narrative notes spec (kickoff KICKOFF_INFOSCOPE_NARRATIVE_NOTES_2026-10-02 WI-3), for Crysta's review.\" },\n \"onboarding_config_sign_off\": { guidance: null, logicNotes: \"Seeded 2026-08-13.\" },\n \"open_source_search\": { guidance: \"Use for searches that query external/open sources (not the internal investigative database). Keep tool/vendor details out of the function; integration-specific behavior lives elsewhere.\", logicNotes: \"May be implemented via integrated OSINT tools or external links. Should record minimal audit metadata when required (who searched, when, case context) without storing prohibited content. Respect terms of use and jurisdiction rules.\" },\n \"person_association_update\": { guidance: \"Use for editing person-entity associations (roles, relationships, contact points) rather than editing narrative content. Keep the function data-agnostic; policy governs which attributes can be edited in which contexts.\", logicNotes: \"Changes should be provenance-tracked (who/when/why). Some attributes may be restricted by sensitivity tier, role certification, or investigative authority. | Re-scoped 2026-08-13 (Phase-0 overhaul): LEADS → LEADS/PAVE/THREAD — PAVE Persons Network + Household relationship EDGES are fully built equivalents. Ownership ruling: this code owns person-network roles/relationship edges; subject-profile household composition + emergency contacts are profile_domain_edit.\" },\n \"person_merge_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Cross-org confirm is the approval leg of the same function (D15 pattern); split later only if agencies need to configure them apart. Ruling record — 2026-11-03 (Crysta): THREAD added — Thread's PAVE-to-Thread person-match review queue (confirm_merge / keep_separate / defer) is this act. Thread bounds: Crisis Response Default On; Volunteer, Public Reporter, Mandatory Reporter Never; the member admin is not bound (admin functions only, ruling 2026-11-02).\" },\n \"platform_perm_modify\": { guidance: \"HTI platform governance function. Defines the outer boundary of what is possible.\", logicNotes: \"Reserved for PLT-ADM. Should never be available to member accounts.\" },\n \"profile_domain_edit\": { guidance: null, logicNotes: \"Seeded 2026-08-13 (D13 split). Thread scope = the Signal-step subset (stripped household card + demographics); the full domain set is PAVE (Household & Relationships and Immigration & Legal Status carry pave-only gating as-built). Household composition + emergency contacts live HERE; person-network roles/relationship edges are person_association_update. | Re-scoped 2026-08-19/20 (Crysta ruling, wave-3d enforcement session): LEADS added to Platform Relevance — the leads-app Person-page demographics/nationality/physical edits are the same act on the same person record. Investigator + Intelligence Analyst added to Always (platform-required for investigators, analysts, and HTI analysts; HTI analysts are dual-roled intel_analyst + PLT-SUP seats, so the user-role grant covers them — no new role minted). | ENFORCED 2026-08-20 (CF-PHASE3-WAVES-3A–3D): the monolith's captureFunctionAccess (window HTI_CAPTURE_AUTHZ) gates the profile-domain commits and the leads-app demographicsStore.ts consults the same bounds; regression net tools/smoke/flows/capture-authz-wave3.js. [CVC133-AUDIT 2026-09-10] | Legal Advocate added to Always 2026-09-30 (LEGAL-ADVOCATE-BOUNDS — Crysta ruling on the partner-feedback card 'Admin account can edit juvenile justice': 'I agree, and want you to do it'). The 2026-08-13 seed omitted Legal Advocate here while binding it on session_create (Always) and on four sibling capture codes (Default On), so a Legal Advocate could start a session and not fill in its profile. The refused seat was Legal Advocate + Account Admin; the admin role stays unbound here (CAM invariant 5).\" },\n \"record_activity_view\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Case-grain everyday forensic view — distinct from the platform-grain audit_log_view_* codes (admin-framed, not v1).\" },\n \"record_print\": { guidance: \"Use for producing a printable/PDF representation of an on-screen record/report. Output is constrained to the caller’s effective access (role, training, clearance, legal basis, purpose, consent/ROI, etc.).\", logicNotes: \"Printing is an output action and should be separately grantable per role.\\n\\nRequirements:\\n- Apply the same row-level and field/component-level redaction rules as normal viewing.\\n- Do not expand scope beyond what the user can view.\\n- Treat print as an export-like event: watermark where required and log who/what/when/purpose.\\n- If the platform supports multiple print templates (assessment, report, case summary), template selection must not bypass access constraints.\" },\n \"referral_receive_external\": { guidance: \"Use for the system/user action of receiving an external referral. Distinct from accepting/claiming the case and from internal referrals.\", logicNotes: \"Validate sender identity and ensure an approved counterparty and legal basis/purpose are present. Apply minimum-necessary data rules and map inbound payloads to internal schema. Create audit events for receipt and ingestion. | 2026-09-10 (CVC133-AUDIT, Crysta ruling R2): Case Navigator/Advocate and Prosecutorial Reviewer were listed in both Always and Default On — Always stands (what the resolvers already computed); the Default On duplicates are removed.\" },\n \"referral_receive_internal\": { guidance: \"Use for inbound internal referrals (from other HTI apps or internal teams). Distinct from external counterparty referrals.\", logicNotes: \"Enforce internal routing rules and confidentiality constraints (team boundaries, staff/volunteer segregation where applicable). Ensure linkage back to the source record and preserve provenance. Log receipt events.\" },\n \"referral_send_external\": { guidance: \"Use for outbound transmission and revocation of referrals/shares. Distinct from recipient acceptance/claim and from internal collaboration notes.\", logicNotes: \"Sending must enforce minimum-necessary data, purpose, counterparty, and ROI/legal-basis rules. | Edited 2026-08-13 (Phase-0 overhaul): the legacy 'or revoke' definition clause moved to the new share_revoke code.\" },\n \"referral_send_internal\": { guidance: \"Use for outbound transmission and revocation of referrals/shares. Distinct from recipient acceptance/claim and from internal collaboration notes.\", logicNotes: \"Sending must enforce minimum-necessary data, purpose, counterparty, and ROI/legal-basis rules. | Edited 2026-08-13 (Phase-0 overhaul): the legacy 'or revoke' definition clause moved to the new share_revoke code. Re-scoped PAVE → THREAD/PAVE — the built send leg is Thread→PAVE (sendReferral); a PAVE-initiated internal referral is future.\" },\n \"roi_submit_manage\": { guidance: \"Use for managing consent/ROI artifacts that enable lawful information sharing. Distinct from the actual share/referral send action.\", logicNotes: \"ROI handling must capture signature, effective dates, scope of disclosure, counterparties, and revocation state. Changes should be versioned and auditable. Downstream sharing actions must reference an active ROI where required. | Scope note 2026-08-13: ROI activate/renew (the 4-mode wizard) and status supersession ride this function's manage verb; terminal revocation is the new share_revoke code.\" },\n \"role_assign\": { guidance: \"Use for role assignment and revocation. Role bundles determine function eligibility; policies determine data scope.\", logicNotes: \"Role assignment should be audited. Some assignments may be restricted by agency configuration and training prerequisites.\" },\n \"roles_accounts_toggle\": { guidance: null, logicNotes: \"Code + definition + admin-relevance drafted by Claude 2026-07-09 (Crysta-delegated edit — the row shipped in the codebook export with no Code; the seeded repo registry data/cvcs/core_functions.yaml carried code:null until this edit). Naming follows the codebook's dominant object_verb convention (account_suspend · api_key_manage). Admin-relevance set to Yes to match the Always (Admin Roles) bounds already on the row. Crysta to review. | RATIFIED 2026-09-10 (CVC133-AUDIT, Crysta non-veto): code + definition stand; wired live on the Platform User Management roster (screens.jsx) since Phase 1.\" },\n \"sandbox_environment_manage\": { guidance: \"HTI Labs-only. Supports safe testing without exposing live member data.\", logicNotes: \"Prefer synthetic or de-identified data. Any live-data mirroring must be explicitly governed and logged.\" },\n \"screening_conduct\": { guidance: \"Use for the action of conducting screenings (answering and submitting the screening instrument). Distinct from viewing screening responses.\", logicNotes: \"May require training/certification. Enforce required-question logic, skip patterns, and workflow state gating. Ensure responses are tied to the correct case/session and are auditable. | Legal Advocate added to Default On 2026-10-01 (CAPTURE-AUTHZ-BOUNDS-GAPS — Crysta: 'those are gaps that need fixed'): the row bound it nowhere, so a Legal Advocate running an intake was refused every screening — the same shape as LEGAL-ADVOCATE-BOUNDS 2026-09-30. Level is the agent's derivation: Default On, matching Case Navigator/Advocate. | ENFORCED 2026-10-01 (CAPTURE-AUTHZ-WAVE4): HTI_CAPTURE_AUTHZ.guard at the Initial Screen, the General Intake Screening sections (read-only for a refused seat) and the runner; regression net tools/smoke/flows/capture-authz-wave4.js. Instruments (Crysta 2026-10-01): Initial Screen, General Intake Screening, Lethality Assessment (LAP), Injury & Strangulation Screening, OCAT. | Platform Relevance PAVE → PAVE/THREAD 2026-10-01 (Crysta: 'Please address / reword'): Thread's Screen step and its Lethality Screen run through the same guard.\" },\n \"screening_view\": { guidance: \"Use for read-only access to completed screening instruments and outputs. Distinct from conducting screenings.\", logicNotes: \"Apply minimum-necessary redaction and role-based access controls. Log access for audit. Viewing should not imply the ability to edit responses. | As-built note 2026-08-13: currently emergent — anyone with case access sees committed screening responses. Becomes independently enforceable when Level-3 visibleGroups gating carries the screening domain group.\" },\n \"service_log_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13 (D13 split). The motivating differential: volunteers may log services (Default On here) while never discharging (exit_discharge_conduct). | ENFORCED 2026-08-20 (CF-PHASE3-WAVES-3A–3D): the monolith's captureFunctionAccess (window HTI_CAPTURE_AUTHZ) gates service add/close/why-not commits; regression net tools/smoke/flows/capture-authz-wave3.js. [CVC133-AUDIT 2026-09-10]\" },\n \"session_create\": { guidance: \"Use for creating a work session container that structures multi-step workflows (distinct from creating the submission record itself if those are separate concepts).\", logicNotes: \"Session creation may establish context such as org, role profile, channel/source, and timestamps. Often precedes intake submission creation and should be auditable for operational metrics (time-to-complete).\" },\n \"share_config\": { guidance: \"Unified sharing policy configuration function for PAVE + Trail. Use for configuring sharing relationships, allowable counterparties, purpose constraints, and consent/ROI requirements, with changes versioned and auditable. Does not perform sharing itself.\", logicNotes: \"Merged sharing_policies_configure into share_config to avoid duplicate policy-config functions. Changes should require designated authority and be auditable. Effective sharing still evaluates purpose, legal basis, consent/ROI, and payload rules at runtime. | Scope note 2026-08-13: scope includes the Inter-Agency Sharing tab write, the Share-Purposes tab write, and the leads-app per-agency claim-broadcast toggle (sharingSettingsStore) — one gap cited twice in the alignment strategy, owned HERE; as-built the code gates only the LEADS-Deconfliction tab, the other tabs wire at Phase 2. Type-A internal viewing config is viewing_config_manage, not this. | CLOSED 2026-08-14 (Phase 2): the Inter-Agency Sharing · Share Purposes · Share Partners · Information Scope tab writes all gate through share_config. Team-scoped NARROWING of attached policies is the separate team_share_narrowing (Ava 2026-09-01), bound Default On for Team Admin. [CVC133-AUDIT 2026-09-10]\" },\n \"share_revoke\": { guidance: null, logicNotes: \"Seeded 2026-08-13. As-built revokeShare carries ZERO gate — Phase 2 adds one. ROI activate/renew (the 4-mode wizard) and status supersession ride roi_submit_manage; only terminal revocation is this code. The legacy 'or revoke' clause in referral_send_internal/_external definitions is trimmed in the same pass. | ENFORCED 2026-08-19 (CF-PHASE3-WAVE1): the monolith's shareFunctionAccess guards revokeShare/revokeROI at the data layer and the Revoke button renders disabled-with-reason (GDR § 8.2); regression net tools/smoke/flows/share-authz-wave1.js. [CVC133-AUDIT 2026-09-10]\" },\n \"share_rule_approve_cross_agency\": { guidance: \"Use for governance approvals that establish or change sharing rules.\", logicNotes: \"Approval should be auditable and may require designated authority.\" },\n \"share_vsp_to_le\": { guidance: \"Use for outbound VSP → LE shares/referrals where the VSP actor is initiating transmission to law enforcement. Distinct from (1) internal referral/hand-off, (2) LE receiving/ingesting an inbound referral, and (3) generic “disclose_external” disclosures. Use policy constraints (counterparty allowlist, purpose, sensitivity tier, approvals) rather than encoding sensitivity in the function name.\", logicNotes: \"This function represents the user/system action that transmits data from a VSP workflow to an LE recipient.\\n\\nExpected enforcement:\\n- Verify the recipient is an approved LE counterparty and the destination channel is enabled by agency sharing configuration.\\n- Require a valid legal basis and share purpose; enforce any consent/ROI requirements.\\n- Enforce minimum-necessary data rules (field-level filtering/redaction based on sensitivity tier and role/clearance).\\n- Apply required governance gates (e.g., designated authority approval) when configured; otherwise block.\\n- Generate immutable audit events for preparation, approval (if any), and transmission; include what was shared (hashed/manifest), to whom, when, and under what purpose/legal basis.\\n- Support revocation/recall only as policy allows (generally not possible once transmitted); log any attempted revocations.\\n\\nAs-built note 2026-08-13: implemented in PAVE/Thread as mandatory_reporting / authority_reporting purpose codes + legal-override attestation inside the Share composer; in LEADS the share gate is generic (content/stage/sign-off). Role-shape enforcement lands at Phase 2 of the functions overhaul.\\n\\nENFORCED 2026-08-19 (CF-PHASE3-WAVE1): the authority purpose pills in the PAVE/Thread Share composer gate on these bounds via shareFunctionAccess (disabled-with-reason + data-layer backstop); LEADS keeps its generic share gate. No seeded external user carries le_liaison_vsp, so user-grain demo seats refuse the authority purposes — a product call, flagged not taken. [CVC133-AUDIT 2026-09-10]\" },\n \"srl_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13. As-built rides the same canDirectEdit gate inside the team blocks (roAddService/roRemoveService) — but the SRL is a distinct data entity feeding /services, and delegating SRL upkeep (e.g. to DATA-ADM) without full profile edit is a real config difference. Distinct-in-configuration => distinct code.\" },\n \"supervisee_thread_view\": { guidance: null, logicNotes: \"Seeded 2026-08-13. A real access grain: unions supervisee threads into the supervisor's inbox.\" },\n \"support_ticket_triage\": { guidance: \"Use for HTI Labs support operators. Does not grant case content access; focuses on operational support workflows.\", logicNotes: \"Should default to non-content metadata and diagnostics. Any content exposure requires explicit policy gating or member-provided artifacts. Ruling record — 2026-11-03 (Crysta): THREAD and PAVE added to Platform Relevance — Thread's Help-modal support reply (HTI Support replying to a member's ticket) is this act; bounds unchanged (PLT-SUP, PLT-ADM Always).\" },\n \"system_diagnostics_view\": { guidance: \"Use for HTI Labs support workflows (debugging, performance, incident triage) with strict redaction and data minimization.\", logicNotes: \"Prefer aggregated/metadata logs. Access to member audit logs or sensitive record payloads should be separately governed.\" },\n \"team_config_manage\": { guidance: \"Use for account-governance team structure and admin scoping. This is a MEM-ADM responsibility. TEAM-ADM should not use this function to change team structures or its own scope; TEAM-ADM should use team-level workflow configuration functions for changes within an already-assigned team scope.\", logicNotes: \"This function changes scope boundaries. Treat as governance-impacting and auditable. | Merge note 2026-08-13 (D7): team_workflow_config_manage RETIRED into this code — the built TeamWorkflowEditor/TeamAccessView already gate on team_config_manage; one code, definitions absorb both. | 2026-10-04: the D7 merge is reversed — team_workflow_config_manage is restored as the team-level function (workflow list, exit checklist, open/closed to direct shares). This code keeps team structure, admin scoping, the account's front door and the report-flag destination; its holders may also do the team-level acts.\" },\n \"team_membership_manage\": { guidance: \"Use for team-scoped admin actions that change which users participate in a workflow container (team).\", logicNotes: \"Team membership changes can affect workflow surfaces and collaboration; changes should be auditable.\" },\n \"team_share_narrowing\": { guidance: \"The narrow-only half of sharing configuration, split out so a Team Admin can tighten their own team without holding share_config (which opens the whole Policies surface). Scope = the teams the seat administers; the acts = withhold a field group or a partner from what the team's attached policies allow, and lift that narrowing again. Widening, attaching, retiring, or editing a policy stays share_config.\", logicNotes: \"RULED Ava 2026-09-01 (Policies UX rulings round, against the recommendation): 'Team Admins may narrow their own team's policies.' Implication recorded the same day: share_config is Always Account Admin / Never Team Admin, so opening it would grant the whole surface — the honest shape is a distinct narrow-only function bound Default On for Team Admin. Stored shape unchanged: the team-narrowing species rows (policies.sharingPolicies[].purposeScope / purposeScopeItems), authored in the policy room's 'Teams it narrows' section (POLICIES-SHIP-5) and on the team card's Sharing section. PLACED ON NOTION 2026-09-10 (CVC133-AUDIT; authored repo-side 2026-09-02 per the mandatory_report_send / safe_locations provisional precedent).\" },\n \"team_workflow_config_manage\": { guidance: \"Use for team-level workflow configuration under MEM-ADM governance. Intended for TEAM-ADM and delegated supervisors.\", logicNotes: \"Keep changes auditable; should not grant case-content visibility beyond what operational roles/policies allow. | History: taken out of v1 on 2026-08-13 by a merge into team_config_manage (D7), which is Never for Team Admin — so the role this function was written for lost it. | RESTORED 2026-10-04 (Crysta 2026-10-02: 'teams have profiles. Most of the info in those profiles should be governed by a function that can be enabled on the Team Admin role'; 2026-10-03: 'Please, just solve it'). v1 again. Account Admin Always; Team Admin Default On (an account may switch it off under Roles & Access). Scope = the teams the seat belongs to. Governs, on a team's profile: its workflow function list, its exit checklist, and whether the team can be named directly on a share. Creating/deleting teams, admin scoping, the account's front door and the report-flag destination stay team_config_manage; a holder of team_config_manage may also do these team-level acts.\" },\n \"training_gate_manage\": { guidance: \"Use for certification-linked access governance. Intended for member admins to ensure users only exercise functions once required training/certification is satisfied.\", logicNotes: \"This is a control-plane entitlement and should not grant content visibility. Changes should be auditable.\" },\n \"usr_manage\": { guidance: \"Use for identity lifecycle and account administration actions. Does not imply any case-content visibility.\", logicNotes: \"Typically requires an admin role (e.g., MEM-ADM, PLT-ADM). Evaluate in context of the authorization decision (agency, legal basis, break-glass if applicable). | Boundary note 2026-08-13: member deactivate/reactivate (agency-scoped, reversible) rides this function; account_suspend is account-grain, platform-only, and separate.\" },\n \"viewing_config_manage\": { guidance: null, logicNotes: \"Seeded 2026-08-13. Type A viewing config is not sharing config (share_config); the CAM's viewing-levels rulings govern what this configures.\" },\n \"viewing_level_1_search\": { guidance: \"One of the three Type-A internal-viewing level functions (levels 1–3 are functions specified in platform roles; level 0 is the derived absence of all three). Level 1 is the deconfliction-adjacent grain: a search hit tells the user a case exists without exposing content. Levels 1 and 2 carry no data-type dimension.\", logicNotes: \"Effective viewing level = the highest of the three level functions the user's roles resolve to (grant = Always / Default-On, or Default-Off where agency-enabled; multi-role union), clamped by the team-set level — most restrictive wins; the team axis clamps down, never up. Own/claimed cases are always fully visible. Deconfliction > Viewing. Absence of all three functions = Level 0 (not a configurable setting). Source rulings: CAM inline comments, Crysta Price 2026-03-17 (captured in Final CVCs/NOTION_DISCUSSIONS).\" },\n \"viewing_level_2_autocomplete\": { guidance: \"One of the three Type-A internal-viewing level functions. Level 2 is a step more exposing than level 1: the system volunteers case identity while the user types, unprompted. Levels 1 and 2 carry no data-type dimension.\", logicNotes: \"Effective viewing level = the highest of the three level functions the user's roles resolve to (grant = Always / Default-On, or Default-Off where agency-enabled; multi-role union), clamped by the team-set level — most restrictive wins; the team axis clamps down, never up. Own/claimed cases are always fully visible. Deconfliction > Viewing. Keep the ladder monotone per role: no role should hold level 2 more freely than level 1. Source rulings: CAM inline comments, Crysta Price 2026-03-17 (captured in Final CVCs/NOTION_DISCUSSIONS).\" },\n \"viewing_level_3_components\": { guidance: \"One of the three Type-A internal-viewing level functions. Level 3 is the only level that consults the by-data-type selection (Crysta 2026-03-17: \\\"Level 3 respects admin-set 'by-data-type' selection\\\"). The header identity floor (name / case ID / DOB) is the level-1 grant and is never suppressed.\", logicNotes: \"Effective viewing level = the highest of the three level functions the user's roles resolve to (grant = Always / Default-On, or Default-Off where agency-enabled; multi-role union), clamped by the team-set level — most restrictive wins; the team axis clamps down, never up. Own/claimed cases are always fully visible. Deconfliction > Viewing. Absence of all three functions = Level 0 (not a configurable setting). Source rulings: CAM inline comments, Crysta Price 2026-03-17 (captured in Final CVCs/NOTION_DISCUSSIONS).\" },\n};\n","/**\n * @htilabs/platform-common-models — CVC-133 Guidance and Logic notes (read-only)\n *\n * The codebook's two reading columns per evaluable function — Guidance and Logic notes (canon\n * `guidance` / `logic_notes` in the records repo's `data/cvcs/core_functions.yaml`) — generated into\n * `CORE_FUNCTION_NOTES` by `scripts/gen-core-functions.py`, verbatim. What Platform Configuration's\n * function window shows under the definition (\"Guidance:\" · \"How it behaves:\", platform-prototype\n * `function PBFunctionConfigModal(`). Vocabulary, never policy: nothing here grants or refuses.\n */\nimport { CORE_FUNCTION_NOTES } from \"../generated/coreFunctionNotes.js\";\nimport type { CoreFunctionNotes } from \"../generated/coreFunctionNotes.js\";\n\nexport { CORE_FUNCTION_NOTES, CORE_FUNCTION_NOTES_SOT_VERSION } from \"../generated/coreFunctionNotes.js\";\nexport type { CoreFunctionNotes } from \"../generated/coreFunctionNotes.js\";\n\n/** One function's notes, or null for a key the codebook does not carry as evaluable. */\nexport function coreFunctionNotes(functionCode: string): CoreFunctionNotes | null {\n if (!Object.hasOwn(CORE_FUNCTION_NOTES, functionCode)) return null;\n return CORE_FUNCTION_NOTES[functionCode];\n}\n","/**\n * @htilabs/platform-common-models — the browser-safe authz tables\n *\n * AUTO-GENERATED FILE — DO NOT EDIT BY HAND.\n * Regenerate with: `npm run gen:authz-tables` (drift gate: `gen:authz-tables:check`).\n *\n * From coreFunctions.v1.5.0.json (evaluable keys only), userRoles.v2.0.0.json and\n * adminRoles.v2.0.0.json: what `functionDoor` and `canonicalRoleCode` read, so the\n * `./authz` entry never inlines the SOT JSON. Not exported from the barrel.\n */\n\nexport const CORE_FUNCTION_TITLES_SOT_VERSION = \"1.5.0\";\n\n/** Evaluable CVC-133 function key → codebook title. */\nexport const CORE_FUNCTION_TITLES: Readonly<Record<string, string>> = {\n \"agency_info_manage\": \"Edit own agency's profile\",\n \"announcement_publish\": \"Publish announcements\",\n \"api_key_manage\": \"Manage API keys\",\n \"assessments_conduct\": \"Conduct Assessments\",\n \"auth_model_manage_platform\": \"Manage platform authorization model\",\n \"case_assign_reassign\": \"Assign / reassign case ownership\",\n \"case_claim\": \"Claim inbound share (PAVE)\",\n \"case_close\": \"Close case\",\n \"case_collaborator_add\": \"Share / Add Users to a case\",\n \"case_edit\": \"Edit Cases (add intake, case notes, goals, services)\",\n \"case_needs_action_flag_manage\": \"Manage case escalation / needs-action flags\",\n \"case_reopen\": \"Case Re-open\",\n \"case_side_panel_use\": \"Utilize side panel for comments/notes and uploads\",\n \"case_status_manage\": \"Change case status\",\n \"case_transfer_bulk\": \"Bulk transfer cases (turnover)\",\n \"case_view\": \"View (agency) Cases\",\n \"case_visibility_manage\": \"Go dark / restore case visibility\",\n \"ci_periodic_review\": \"Review criminal intelligence record (periodic)\",\n \"ci_record_purge_or_retire\": \"Retire or purge criminal intelligence record\",\n \"ci_record_validate\": \"Validate criminal intelligence record\",\n \"ci_to_evidence_export_authorize\": \"Authorize criminal intelligence → evidence export\",\n \"deconfliction_alert_acknowledge\": \"Accept a deconfliction alert\",\n \"deconfliction_unmask\": \"Unmask a deconfliction\",\n \"determination_perform\": \"Perform Determinations\",\n \"disclose_external_request\": \"Request External Disclosure\",\n \"enrollment_manage\": \"Manage program enrollments\",\n \"exit_discharge_conduct\": \"Conduct program exit / discharge\",\n \"export_deidentified\": \"Export de-identified reports/datasets\",\n \"goals_plan_manage\": \"Create and manage plans, goals, action steps\",\n \"idb_record_create\": \"Create IDB record\",\n \"indicator_manual_add\": \"Add a manual indicator\",\n \"investigation_create_claim\": \"Create Investigation + Claim a Tip / Lead\",\n \"investigation_session_run\": \"Run an investigation session\",\n \"investigative_database_search\": \"Search account IDB\",\n \"investigative_request_send\": \"Submit an investigative request (Ask HTI)\",\n \"lead_create\": \"Create a Tip / Lead\",\n \"lead_publish\": \"Publish a Tip / Lead\",\n \"lead_route_assign\": \"Route / assign a lead to an agency\",\n \"lead_triage_manage\": \"Triage leads\",\n \"magic_link_share_send\": \"Send Magic Link Shares\",\n \"mandatory_report_send\": \"Send mandatory report\",\n \"member_account_report_generate\": \"Member Account Report generation\",\n \"member_onboarding_support\": \"Assist member onboarding (support)\",\n \"message_moderate\": \"Moderate messages\",\n \"message_send\": \"Send platform messages\",\n \"milestone_log\": \"Log investigative milestones\",\n \"needs_priorities_conduct\": \"Conduct needs assessment and immediate priorities\",\n \"network_corpus_access\": \"Access raw/worked machine-network corpus\",\n \"note_open_departed_author\": \"Open a deactivated author's private notes\",\n \"onboarding_config_sign_off\": \"Approve the configuration summary (Phase III sign-off)\",\n \"open_source_search\": \"Search across all open source information\",\n \"person_association_update\": \"Assign or update person’s role, relationships, phone numbers or social media associations\",\n \"person_merge_manage\": \"Manage person identity merges\",\n \"platform_perm_modify\": \"Modify Platform Permissions\",\n \"profile_domain_edit\": \"Edit subject profile domains\",\n \"record_activity_view\": \"View a record's activity log\",\n \"record_print\": \"Export/Print\",\n \"referral_receive_external\": \"Receive External Referrals\",\n \"referral_receive_internal\": \"Receive Internal Referrals\",\n \"referral_send_external\": \"Refer External (Excluding VSP to LE)\",\n \"referral_send_internal\": \"Refer Internal\",\n \"roi_submit_manage\": \"Upload/Edit/Submit ROI\",\n \"role_assign\": \"Role Assignment\",\n \"roles_accounts_toggle\": \"Toggle Roles / Accounts\",\n \"sandbox_environment_manage\": \"Manage sandbox and testing environments\",\n \"screening_conduct\": \"Conduct Screenings\",\n \"screening_view\": \"View Victim/Abuse Screening Responses\",\n \"service_log_manage\": \"Log and manage service instances\",\n \"session_create\": \"Record creation (sessions, cases, etc.)\",\n \"share_config\": \"Sharing Configuration\",\n \"share_revoke\": \"Revoke an active share / ROI\",\n \"share_rule_approve_cross_agency\": \"Approve cross-agency sharing rules\",\n \"share_vsp_to_le\": \"VSP to LE Share\",\n \"srl_manage\": \"Manage the agency's Service Registry (SRL)\",\n \"supervisee_thread_view\": \"View supervisee threads\",\n \"support_ticket_triage\": \"Triage support tickets / bug reports\",\n \"system_diagnostics_view\": \"View system diagnostics and logs (support)\",\n \"team_config_manage\": \"Team structure & admin scoping (account-level)\",\n \"team_membership_manage\": \"Manage team membership\",\n \"team_share_narrowing\": \"Narrow a team's sharing\",\n \"team_workflow_config_manage\": \"Manage team workflow configuration\",\n \"training_gate_manage\": \"Manage training/certification gates (i.e. required modules for roles + teams)\",\n \"usr_manage\": \"User Management\",\n \"viewing_config_manage\": \"Configure internal viewing (Type A)\",\n \"viewing_level_1_search\": \"Non-owned case identity on search\",\n \"viewing_level_2_autocomplete\": \"Non-owned case identity in autocomplete\",\n \"viewing_level_3_components\": \"Non-owned case component access\",\n};\n\nexport const ROLE_CODES_SOT_VERSIONS = { userRoles: \"2.0.0\", adminRoles: \"2.0.0\" } as const;\n\n/** Every live CVC-135 user-role and CVC-134 admin-role `canonicalCode`. */\nexport const CANON_ROLE_CODE_LIST: readonly string[] = [\n \"case_nav\",\n \"healthcare_provider_medical\",\n \"behavioral_health_provider\",\n \"crisis_response\",\n \"intel_analyst\",\n \"investigator\",\n \"le_liaison_vsp\",\n \"legal_advocate\",\n \"mandatory_reporter\",\n \"mdt_participant\",\n \"prosecutor_review\",\n \"public_reporter\",\n \"research_analytics\",\n \"screener\",\n \"volunteer\",\n \"PLT-ADM\",\n \"PLT-SUP\",\n \"MEM-ADM\",\n \"TEAM-ADM\",\n \"AUD\",\n \"DATA-ADM\",\n \"GOV-AUD\",\n \"CIRO\",\n \"SUP\",\n \"TRAIN-ADM\",\n];\n\n/** Live CVC-134 / CVC-135 `canonicalCode` → its display words (`displayLabel`, else `title`). */\nexport const ROLE_DISPLAY_LABELS: Readonly<Record<string, string>> = {\n \"case_nav\": \"Case Navigator/Advocate\",\n \"healthcare_provider_medical\": \"Healthcare Provider\",\n \"behavioral_health_provider\": \"Behavioral Health Provider\",\n \"crisis_response\": \"Crisis Response\",\n \"intel_analyst\": \"Intelligence Analyst\",\n \"investigator\": \"Investigator\",\n \"le_liaison_vsp\": \"VSP LE Liaison\",\n \"legal_advocate\": \"Legal Advocate\",\n \"mandatory_reporter\": \"Mandatory Reporter User\",\n \"mdt_participant\": \"MDT Participant\",\n \"prosecutor_review\": \"Prosecutorial Reviewer\",\n \"public_reporter\": \"Public Reporter\",\n \"research_analytics\": \"Research/Analytics\",\n \"screener\": \"Screener (Initial Screen)\",\n \"volunteer\": \"Volunteer\",\n \"PLT-ADM\": \"Platform Admin\",\n \"PLT-SUP\": \"Support Admin\",\n \"MEM-ADM\": \"Account Admin\",\n \"TEAM-ADM\": \"Team Admin\",\n \"AUD\": \"Compliance / Auditor\",\n \"DATA-ADM\": \"Data & Reporting Admin\",\n \"GOV-AUD\": \"Governance Auditor\",\n \"CIRO\": \"Intel Review Officer\",\n \"SUP\": \"Supervisor\",\n \"TRAIN-ADM\": \"Training Admin\",\n};\n\n/** Exact stored source spelling → live canon code, or null (withdrawn, no successor). */\nexport const ROLE_CODE_RE_KEYS: Readonly<Record<string, string | null>> = {\n \"missingness_root\": null,\n \"unknown\": null,\n \"anonymous\": null,\n \"data_not_collected\": null,\n \"hotline_op\": \"crisis_response\",\n \"case_advocate\": \"case_nav\",\n \"leads_investigator\": \"investigator\",\n \"MISSINGNESS-ROOT\": null,\n \"UNKNOWN\": null,\n \"ANONYMOUS\": null,\n \"DATA-NOT-COLLECTED\": null,\n \"acct_adm\": \"MEM-ADM\",\n \"ACCT-ADM\": \"MEM-ADM\",\n};\n","/**\n * @htilabs/platform-common-models — stored role codes → live canon role codes\n *\n * STATUS: DRAFT (Tier B, 0.48.0). Ported verbatim in behaviour from the two\n * local copies the apps carry today — Thread\n * `packages/db/src/services/seatRoleCodes.ts` and platform\n * `lib/authz/roleCodes.ts` — so PAVE 2.0 (which has no copy) and every later\n * caller read one translation. The apps are not switched over in this\n * release; when they are, their local copies go.\n *\n * Canon re-keys roles IN PLACE and migrates ON READ: nothing stored is ever\n * rewritten (`userRolesSot._supersedes`, quoting canon\n * `data/cvcs/core_user_role.yaml` `legacy_codes`). A seat that still stores\n * `hotline_op` holds canon's `crisis_response` — the same role at the same\n * wire code 135-004. Every reader of a seat's role codes resolves them here\n * before it looks up a `platformRoles` row or a codebook bound, or a re-keyed\n * seat finds no row under its stored code and resolves to no functions.\n *\n * EXACT SPELLINGS ONLY. A code resolves when it is, character for character:\n * - a live canon code (an entry's `canonicalCode`: `crisis_response`, `MEM-ADM`);\n * - a re-key SOURCE in CVC-135 `userRolesSot._supersedes.keyMap`\n * (`hotline_op` → `crisis_response`, `case_advocate` → `case_nav`,\n * `leads_investigator` → `investigator`);\n * - a re-key SOURCE in CVC-134 `adminRolesSot._supersedes.keyMap`, in its key\n * spelling (`acct_adm`) or canon's own spelling of it (`ACCT-ADM`) → `MEM-ADM`.\n * Nothing is case- or separator-folded (`plt_adm`, `Plt-Adm` match no role —\n * fail closed). Identity keyMap lines are key-space bookkeeping, not stored\n * spellings, so they are not sources. A withdrawn code with no successor (the\n * 1.0.0 missingness keys) means no role.\n *\n * Browser-safe: reads a small generated table\n * (`src/generated/authzBrowserTables.ts`, held to the SOT files by\n * `gen:authz-tables:check`), never the SOT JSON itself. No I/O.\n */\n\nimport { CANON_ROLE_CODE_LIST, ROLE_CODE_RE_KEYS } from \"../generated/authzBrowserTables.js\";\n\n/** Every live canon role code (CVC-135 user roles + CVC-134 admin roles). */\nconst CANON_ROLE_CODES: ReadonlySet<string> = new Set(CANON_ROLE_CODE_LIST);\n\n/**\n * Exact source spelling → live canon code (or null: no role), generated from\n * the two SOTs' `_supersedes.keyMap` by `scripts/gen-authz-tables.ts` with the\n * apps' rule (identity lines skipped; an admin key also in canon's\n * upper-dash spelling; a spelling that is itself a live code never a source).\n */\nconst SOURCES: ReadonlyMap<string, string | null> = new Map(Object.entries(ROLE_CODE_RE_KEYS));\n\n/**\n * STATUS: DRAFT. The live canon role code a stored role code means, or `null`\n * when it means no role (a withdrawn code with no successor, or any spelling\n * that is neither a live code nor an exact re-key source). A non-string is no\n * role.\n */\nexport function canonicalRoleCode(code: unknown): string | null {\n if (typeof code !== \"string\") return null;\n if (CANON_ROLE_CODES.has(code)) return code;\n return SOURCES.has(code) ? (SOURCES.get(code) ?? null) : null;\n}\n","/**\n * @htilabs/platform-common-models — the function door (Kickoff 08b § 11)\n *\n * STATUS: DRAFT (Tier B; register aligned to the prototype in 0.50.0).\n *\n * The resolver half (`resolveEffectiveFunctions`) decides what a seat may do.\n * This is the other half: it carries that answer to the screen in the shape\n * the shared components take, so no shared piece decides anything (Crysta,\n * 2026-10-20: \"A shared piece never decides who may view, access, or edit it\n * … It receives those decisions and only shows them.\"). The host app runs\n * this over the seat's resolved answer and hands the result to the piece —\n * `{ allowed, reason }` is what `SharePurposeAccess` (`vspToLe`) and\n * `ShareRow`'s `revokeAccess` read; `offered: false` tells the host there is\n * nothing to draw (no refusal the prototype words); whether a refused control\n * is drawn is the surface's own rule (below).\n *\n * THE REGISTER — the prototype's, word for word. Source: records prototype\n * (`htilabstech/prototype` @ 882e200) `HTI-LEADS-PAVE-Thread-prototype.html`\n * `shareFunctionAccess`, L339651-339719 (Thread's canonical copy, re-baselined\n * from 94ee0702, carries the same block at L316784-316848). Its decision order\n * is platform-prototype `authzResolve`'s (`src/agencyhub.jsx` @ dd0aa94,\n * L592-680). `act` is the function's codebook title; `<roles>` is every role\n * the seat holds, in the order given, by its display words, joined \" + \".\n *\n * - granted → `{ offered: true, allowed: true, reason: null }`.\n * - Level 1, no held role bound Always / Default On / Default Off:\n * a held role Never-bound → \"<act> is never available to your seat (<roles>).\"\n * else one Not relevant → \"<act> does not apply to your seat (<roles>).\"\n * else (unbound) → \"<act> is not part of your roles (<roles>).\"\n * - Level 2, the account (no held role's account setting grants it):\n * Blocked → \"<act> is blocked for your seat (<roles>) by your account.\"\n * switched Off → \"<act> is switched off for your seat (<roles>) by your account — an account admin can turn it on.\"\n * Default Off, no setting → \"<act> is off by default for your seat (<roles>) — an account admin can turn it on for your account.\"\n * - Level 3, the team's workflow → \"<act> is not part of your team's workflow — a team admin can add it.\"\n *\n * A REFUSAL IS REPORTED DRAWN (`offered: true`), disabled with its reason —\n * the default the function doors in the prototypes use: the records\n * prototype's `shareFunctionAccess` consumers paint the control `disabled`\n * with the reason as its `title` (share-row / ROI Revoke L274289-274293,\n * L274394-274399, L347766-347775; the authority purpose pills\n * L348091-348120, Terry 2026-08-12 \"exclusions on this surface stay\n * visible\"; the magic-link method L349660-349667), and platform-prototype's\n * User Management does the same (`src/screens.jsx` @ dd0aa94 L26507,\n * L26537: `disabled={!authz.allowed}` + the refusal as `title`). So a\n * Never / Not relevant / unbound seat gets `{ offered: true, allowed: false,\n * reason }` too — 0.48.0–0.49.0 left those off (`offered: false`).\n *\n * THE HOST DECIDES PER SURFACE; the door only reports. Not every prototype\n * surface draws a refused control:\n * - platform-prototype hides some function-gated affordances when its\n * `canDirectEdit` (`agency_info_manage` / `srl_manage`) refuses — Add\n * Contact (`src/agencyhub.jsx` @ dd0aa94 L10536), Add services (L7247),\n * program retire (L8899). Such a host draws nothing when `allowed` is\n * false.\n * - the records prototype CONVERTS rather than disables the Mandatory\n * report pill when `mandatory_report_send` is refused: it becomes the\n * internal-escalation flag to the reporting team (L348093-348104,\n * Crysta-ruled 2026-08-23; \"a mandatory-report flag is never refused\").\n * A host must never paint that pill disabled from this door.\n * Build each surface to its prototype; `offered` / `allowed` / `reason` are\n * the facts, not the surface's rule.\n *\n * Still NOT offered (`{ offered: false, allowed: false, reason: null }`) —\n * cases the prototype has no refusal for, so the 0.49.0 answer stands:\n * - an unknown / retired / not-v1 function, or one with no kept catalog row\n * when `functions` is given (resolver rule 8; the prototype fails these\n * open, the platform denies them);\n * - a seat with no role code that resolves (the prototype fails it open).\n *\n * Required (ALWAYS after the platform and account layers) is immune to the\n * team (resolver rule 3), so it never gets the team sentence. The prototypes\n * match: platform-prototype `authzResolve` since #492 (2026-11-03), and the\n * records monolith `shareFunctionAccess` plus the LEADS app\n * `resolveEffectiveAccess` since prototype #1050 (2026-11-09).\n *\n * WHICH LAYER REFUSED. `explainFunctionRefusal` (the resolver's own cascade)\n * answers it, over:\n * - `roles` — the LIVE Tier-1 rows (`platformRoles`), when given; absent →\n * the codebook default bound (`codebookDefaultBound`) for each held role;\n * present but not an array → nothing bound (fail closed);\n * - `agencyOverrides` — the resolver's Tier-2 input. ABSENT (undefined or\n * null) IS UNKNOWN, not \"none\": the account may have Blocked, switched Off\n * or switched On (then met the team) what the bounds leave Default On /\n * Default Off, and the account editor stores only what it changed. So\n * without it the door names no layer past the bounds — a refusal that\n * reached the account or the team reads the fallback below. A host that\n * KNOWS the account has no overrides passes `{}`;\n * - `teamPolicy` — the resolver's Tier-3 input; absent → no team restriction\n * known. (Absence cannot name a wrong layer: the team only restricts and\n * runs last, so a missing team policy can only turn a team refusal into\n * the fallback, never into another layer's sentence.);\n * - or `refusal` — the answer a server already computed with\n * `explainFunctionRefusal` (it wins when it is a known value). THIS IS THE\n * SUPPORTED PATH for any host that resolves the seat server-side: ship\n * `explainFunctionRefusal(sameInput, fn)` beside the effective set, per\n * control.\n * Without `refusal` or the policies, the door names only Level 1 (the\n * bounds), and on the codebook path (no `roles`) those Level-1 sentences\n * assume the platform bounds are unedited — a Platform Admin can edit\n * `platformRoles`, so a host that holds the live rows passes them (or ships\n * `refusal`). When the inputs it has cannot say which layer refused (they\n * say \"granted\", or the refusal lies past an unknown account layer), the\n * reason is the prototype's own words for a refusal it cannot explain, \"Not\n * available under your role\" (its share-row fallback, L274292 / L274399) —\n * never a sentence that names the wrong layer.\n *\n * `allowed` follows the effective set alone — the resolved answer is the\n * decision. A function the effective set grants is always offered and\n * allowed; the door never refuses what the server grants.\n *\n * THE DOOR IS THE EARLY ANSWER ONLY. It keeps a seat from reaching a dead\n * end; it is not the gate. The server's `requireFunction` (each app's route\n * guard over the same resolver) stays the authority, and a request the door\n * would have allowed is still refused there when the server's answer differs.\n *\n * Pure, browser-safe, no I/O.\n */\n\nimport {\n CORE_FUNCTION_TITLES,\n ROLE_DISPLAY_LABELS,\n} from \"../generated/authzBrowserTables.js\";\nimport { codebookDefaultBound } from \"./defaultBounds.js\";\nimport {\n explainFunctionRefusal,\n isCanonEvaluableFunction,\n type AuthzFunctionRow,\n type AuthzRoleRow,\n type AuthzStateMap,\n type AuthzTeamPolicy,\n type AuthzTier1StateMap,\n type FunctionRefusal,\n} from \"./resolveEffectiveFunctions.js\";\nimport { canonicalRoleCode } from \"./roleCodes.js\";\nimport { catalogRowCode } from \"./storedReads.js\";\n\n/**\n * A door's state. Field names and types match the components' door shape\n * (`@htilabs/platform-common-components` 0.2.1 `ShareDoorState`\n * `{ allowed, reason, offered }`; since 0.3.0 the pieces read the\n * `{ allowed, reason }` half — `SharePurposeAccess`, `ShareRow.revokeAccess` —\n * and the host reads `offered` to decide whether to draw the control).\n */\nexport interface FunctionDoorState {\n allowed: boolean;\n reason: string | null;\n offered: boolean;\n}\n\n/** A label for a key: a lookup function or a key → label map. */\nexport type FunctionLabelLookup =\n ((functionKey: string) => string | null | undefined) | Readonly<Record<string, string>>;\n\nexport interface FunctionDoorInput {\n /** The seat's resolved answer: `resolveEffectiveFunctions(…)`'s function keys. */\n readonly effectiveFunctions: Iterable<string>;\n /**\n * The seat's role codes (CVC-134 / CVC-135). Each is run through\n * `canonicalRoleCode` first, so a stored re-keyed spelling (`hotline_op`)\n * reads as its live role; an unresolvable code is dropped. The refusal\n * names the roles in this order — pass the user roles first, then the\n * admin roles, as the prototype does.\n */\n readonly roleCodes: readonly string[];\n /** The CVC-133 function key the control performs (e.g. `share_revoke`). */\n readonly functionKey: string;\n /**\n * Optional: the words for the function in the refusal. Absent, or returning\n * nothing → the codebook row's title; no title → the key itself.\n */\n readonly label?: FunctionLabelLookup | undefined;\n /**\n * Optional: the words for a role (keyed by its canon code) in the refusal.\n * Absent, or returning nothing → the CVC-134 / CVC-135 `displayLabel`, else\n * its title; neither → the code.\n */\n readonly roleLabel?: FunctionLabelLookup | undefined;\n /**\n * Optional: the LIVE Tier-1 role rows — the same `roles` the host passes to\n * `resolveEffectiveFunctions`. Given → they decide each role's bound; absent\n * → the codebook default bound.\n */\n readonly roles?: readonly AuthzRoleRow[] | null | undefined;\n /**\n * Optional: the LIVE function catalog — the same `functions` the host passes\n * to `resolveEffectiveFunctions`. Given → a function with no kept row\n * (missing or retired) is not offered.\n */\n readonly functions?: readonly AuthzFunctionRow[] | null | undefined;\n /**\n * Optional: the resolver's Tier-2 input — picks the account sentence.\n * Absent (undefined / null) is UNKNOWN: a refusal past the bounds then\n * reads \"Not available under your role\". Pass `{}` when the account is\n * known to have no overrides.\n */\n readonly agencyOverrides?: Readonly<Record<string, AuthzStateMap>> | null | undefined;\n /**\n * Optional: the resolver's Tier-3 input — picks the team sentence. Absent →\n * no team restriction known.\n */\n readonly teamPolicy?: AuthzTeamPolicy | null | undefined;\n /**\n * Optional: `explainFunctionRefusal`'s answer, computed where the policies\n * are (e.g. the server, beside the effective set). A known value wins over\n * the door's own explanation.\n */\n readonly refusal?: FunctionRefusal | null | undefined;\n}\n\nconst NOT_OFFERED: FunctionDoorState = Object.freeze({\n offered: false,\n allowed: false,\n reason: null,\n}) as FunctionDoorState;\n\n/**\n * The prototype's words for a refusal it cannot explain (records prototype\n * share-row Revoke `_az.reason || \"Not available under your role\"`,\n * L274292 / L274399).\n */\nconst UNEXPLAINED = \"Not available under your role\";\n\nconst KNOWN_REFUSALS: ReadonlySet<string> = new Set<FunctionRefusal>([\n \"granted\",\n \"never\",\n \"not_applicable\",\n \"unbound\",\n \"account_blocked\",\n \"account_off\",\n \"default_off\",\n \"team_workflow\",\n \"not_evaluable\",\n \"no_roles\",\n]);\n\nfunction lookupLabel(key: string, lookup: FunctionLabelLookup | undefined): string | null {\n let label: string | null | undefined;\n if (typeof lookup === \"function\") label = lookup(key);\n else if (lookup && Object.hasOwn(lookup, key)) label = lookup[key];\n return typeof label === \"string\" && label.trim() ? label : null;\n}\n\nfunction labelFor(functionKey: string, lookup: FunctionLabelLookup | undefined): string {\n return (\n lookupLabel(functionKey, lookup) ??\n (Object.hasOwn(CORE_FUNCTION_TITLES, functionKey)\n ? CORE_FUNCTION_TITLES[functionKey]!\n : functionKey)\n );\n}\n\nfunction roleLabelFor(code: string, lookup: FunctionLabelLookup | undefined): string {\n return (\n lookupLabel(code, lookup) ??\n (Object.hasOwn(ROLE_DISPLAY_LABELS, code) ? ROLE_DISPLAY_LABELS[code]! : code)\n );\n}\n\n/** The prototype's sentence for a refusal layer (see the header). */\nfunction sentence(refusal: FunctionRefusal, act: string, roles: string): string {\n switch (refusal) {\n case \"never\":\n return `${act} is never available to your seat (${roles}).`;\n case \"not_applicable\":\n return `${act} does not apply to your seat (${roles}).`;\n case \"unbound\":\n return `${act} is not part of your roles (${roles}).`;\n case \"account_blocked\":\n return `${act} is blocked for your seat (${roles}) by your account.`;\n case \"account_off\":\n return `${act} is switched off for your seat (${roles}) by your account — an account admin can turn it on.`;\n case \"default_off\":\n return `${act} is off by default for your seat (${roles}) — an account admin can turn it on for your account.`;\n case \"team_workflow\":\n return `${act} is not part of your team's workflow — a team admin can add it.`;\n default:\n return UNEXPLAINED;\n }\n}\n\n/**\n * STATUS: DRAFT. The door for one function on one seat (the register above).\n * The UI's early answer only — the server's `requireFunction` is the authority.\n */\nexport function functionDoor(input: FunctionDoorInput): FunctionDoorState {\n const { functionKey } = input;\n if (typeof functionKey !== \"string\" || !isCanonEvaluableFunction(functionKey)) {\n return { ...NOT_OFFERED };\n }\n\n let granted = false;\n for (const fn of input.effectiveFunctions) {\n if (fn === functionKey) {\n granted = true;\n break;\n }\n }\n if (granted) return { offered: true, allowed: true, reason: null };\n\n const functions: unknown = input.functions;\n if (functions !== undefined && functions !== null) {\n const kept =\n Array.isArray(functions) &&\n (functions as readonly unknown[]).some((row) => catalogRowCode(row) === functionKey);\n if (!kept) return { ...NOT_OFFERED };\n }\n\n // The seat's roles: canon codes in the order given, once each (a stored\n // re-keyed spelling is kept beside its canon code so a live row stored\n // under the old spelling is still read, as 0.49.0 read it).\n const rawCodes: unknown = input.roleCodes;\n const seat: string[] = [];\n const assigned: string[] = [];\n const liveRows: unknown = input.roles;\n const live = liveRows !== undefined && liveRows !== null;\n for (const code of Array.isArray(rawCodes) ? (rawCodes as readonly unknown[]) : []) {\n const canon = canonicalRoleCode(code);\n if (canon === null) continue;\n if (!seat.includes(canon)) seat.push(canon);\n if (!assigned.includes(canon)) assigned.push(canon);\n if (live && typeof code === \"string\" && code !== canon && !assigned.includes(code)) {\n assigned.push(code);\n }\n }\n if (seat.length === 0) return { ...NOT_OFFERED };\n\n let refusal: FunctionRefusal;\n const given: unknown = input.refusal;\n if (typeof given === \"string\" && KNOWN_REFUSALS.has(given)) {\n refusal = given as FunctionRefusal;\n } else {\n let roles: readonly AuthzRoleRow[];\n if (live) roles = Array.isArray(liveRows) ? (liveRows as readonly AuthzRoleRow[]) : [];\n else {\n roles = seat.map((code) => {\n const bound = codebookDefaultBound(functionKey, code);\n const fns: AuthzTier1StateMap = bound === null ? {} : { [functionKey]: bound };\n return { code, functions: fns };\n });\n }\n const accountKnown = input.agencyOverrides !== undefined && input.agencyOverrides !== null;\n refusal = explainFunctionRefusal(\n {\n roles,\n functions: [{ code: functionKey }],\n assignedRoleCodes: assigned,\n agencyOverrides: accountKnown ? input.agencyOverrides! : undefined,\n teamPolicy: input.teamPolicy ?? null,\n unknownFunctionPolicy: \"deny\",\n },\n functionKey,\n );\n // Without the account layer, a cascade that got past the bounds cannot\n // say whether the account Blocked, switched Off or switched On (then the\n // team took it): name no layer (see the header).\n if (!accountKnown && (refusal === \"default_off\" || refusal === \"team_workflow\")) {\n refusal = \"granted\"; // → the unexplained fallback\n }\n }\n if (refusal === \"not_evaluable\" || refusal === \"no_roles\") return { ...NOT_OFFERED };\n\n const roleWords = seat.map((code) => roleLabelFor(code, input.roleLabel)).join(\" + \");\n return {\n offered: true,\n allowed: false,\n reason: sentence(refusal, labelFor(functionKey, input.label), roleWords),\n };\n}\n","/**\n * @htilabs/platform-common-models/authz — the account's Internal Viewing Policy\n * reader: which stored viewing rule governs one acting team.\n *\n * Contract of record: \"Contract — the account's Internal Viewing Policy: stored\n * shape and delivery to Thread and PAVE (Kickoff 13 § 5a)\", §§ 1–4. Lifted from\n * PAVE's `@pave/db` `readViewingPolicy` (pave-2.0 develop 41f5f916,\n * `packages/db/src/lookups/viewingPolicy.ts`) so Thread and PAVE run ONE reader\n * (GDR § 5.79, one resolver per runtime). The selection and validation rules are\n * PAVE's, unchanged; only the I/O is left to the app.\n *\n * ## Pure: each app does its own query\n *\n * No database access. The app reads the candidate rows itself — the account's\n * `registry_policies` documents (`species: \"viewing\"`, `account_id` = the acting\n * agency's Account; passing every policy of the account is fine, other species are\n * skipped here) — and hands them in with `{ accountId, teamId }`. A failed read is\n * passed as `docs: null` (or answered with {@link unavailableViewingPolicy}); it is\n * never an empty list, because an empty list means \"nothing on file\".\n *\n * ## Which row governs (Crysta 2026-10-06, ruling (a))\n *\n * The acting team's OWN active row governs that team IN PLACE OF the account-wide\n * rule — higher or lower; the two are never combined. With no team row, the\n * account-wide rule governs. With neither, nothing governs: `source: \"none\"`, and\n * the role level alone decides (Level 3 shows the full record; Crysta 2026-11-03,\n * \"Match the prototype\"). The role clamps afterwards:\n * `viewingLevelFromFunctions(effectiveFunctions, teamViewingLevelFromPolicy(result))`.\n * Prototype: `viewingPolicyFor`, platform-prototype `src/data.js` (aa2c63a).\n *\n * ## Fail closed, never throw (contract § 4)\n *\n * Anything that stops the policy being READ answers `source: \"unavailable\"`\n * (level 0 for that request) with a coded reason — never `\"none\"`: the account\n * cannot be resolved; the read failed; a live viewing row whose assignment is not\n * exactly one account-or-team entry (it might be this team's narrowing); a row in\n * this team's or the account's place whose `active` is neither `true` nor `false`;\n * two live rows in one place without distinct versions of one family; and, on the\n * governing row, a `level` that is not exactly 0–3, a `visibleGroups` that is\n * present but not a list of strings or names a code that is not live at its stamp,\n * a `scopeVocab` that is missing or not 3, 4 or 5. A malformed team row never falls\n * back to the account rule (that fallback could widen).\n *\n * A governing row with no `visibleGroups` reads as an EMPTY list (contract § 4;\n * PAVE `caseViewing.ts` `accessFromResolution`): only \"no row at all\" shows the\n * full record. System information is always shown — that is the Level 3 filter's\n * job ({@link caseViewingAccess}), not this reader's.\n */\n\nimport type {\n InformationScopeResolver,\n ScopeReading,\n} from \"../services/informationScopeResolver.js\";\nimport type { ViewingLevel } from \"./resolveEffectiveFunctions.js\";\n\n/** The stored `species` of an internal-viewing policy (UDD Policy.v1). */\nexport const VIEWING_POLICY_SPECIES = \"viewing\" as const;\n\n// ─── The vocabulary stamp (`scopeVocab`) ─────────────────────────────────────\n\n/** What one of the prototype's viewing-policy vocabulary stamps means to a reader. */\nexport interface ViewingPolicyVocabulary {\n /** The CVC-236 tree version the resolver reads the list at (3 through the v3 → v4 table, or 4). */\n readonly scopeVersion: 3 | 4;\n /** The prototype's ONE-HOME domain carry applies (`scopeVocab < 4`). */\n readonly oneHomeCarry: boolean;\n /** The prototype's v4 alias on `identifying` applies (`scopeVocab < 5`). */\n readonly identifyingAlias: boolean;\n}\n\n/**\n * The stamps a stored viewing policy's `scopeVocab` may carry and still be read.\n *\n * The stamp is the Internal Viewing tab's own counter, NOT the CVC-236 tree\n * version: the hub stamps every save `5` for the four-level v4 tree\n * (platform-prototype `src/screens.jsx` `setLevel` / `toggleGroup` /\n * `setAcctLevel`). Earlier saves stamped 4 (ONE-HOME) and 3 (the Instruments\n * catalog), both authored against the v3 tree. Stamps 1 and 2 and every future\n * stamp (6 and up) are not read: they fail closed. Lifted from PAVE\n * `@pave/domain` `VIEWING_POLICY_VOCABULARIES`.\n */\nexport const VIEWING_POLICY_VOCABULARIES: Readonly<\n Record<3 | 4 | 5, ViewingPolicyVocabulary>\n> = Object.freeze({\n 3: Object.freeze({ scopeVersion: 3, oneHomeCarry: true, identifyingAlias: true }),\n 4: Object.freeze({ scopeVersion: 3, oneHomeCarry: false, identifyingAlias: true }),\n 5: Object.freeze({ scopeVersion: 4, oneHomeCarry: false, identifyingAlias: false }),\n});\n\n/** A stamp this reader reads. */\nexport type ViewingPolicyScopeVocab = 3 | 4 | 5;\n\n/** The reading of a stored `scopeVocab`, or `null` when it cannot be read (fail closed). */\nexport function viewingPolicyVocabulary(scopeVocab: unknown): ViewingPolicyVocabulary | null {\n return scopeVocab === 3 || scopeVocab === 4 || scopeVocab === 5\n ? VIEWING_POLICY_VOCABULARIES[scopeVocab]\n : null;\n}\n\n// ─── Inputs and the result ───────────────────────────────────────────────────\n\n/**\n * The bound CVC-236 resolver the reader validates a whitelist with — the app's\n * own binding of `createInformationScopeResolver` to `coreInformationScopeSot`\n * (PAVE `INFORMATION_SCOPE_V4`, Thread `INFORMATION_SCOPE_RESOLVER`). Passed in\n * so the browser-safe `./authz` entry never inlines the SOT JSON.\n */\nexport type ViewingPolicyScopeResolver = Pick<InformationScopeResolver, \"row\" | \"readSelection\">;\n\n/** Who is asking. */\nexport interface ViewingPolicyQuery {\n /**\n * The Account that owns the policy — the acting agency's Account, which the\n * caller resolved. Empty / null = the account could not be resolved\n * (`unavailable`, `account_unresolved`).\n */\n accountId: string | null | undefined;\n /**\n * The ONE acting team, already bound by the caller to the acting agency\n * (Thread `resolveSeatActingTeamId`, PAVE `viewingTeamOfAgency`). `null` = no\n * acting team, so only the account-wide rule can govern. A 24-hex id is\n * compared case-insensitively.\n */\n teamId: string | null | undefined;\n}\n\n/** Why the policy could not be read. The first four are the app's I/O outcomes. */\nexport type ViewingPolicyUnavailableReason =\n | \"no_acting_agency\"\n | \"account_unresolved\"\n | \"policy_store_absent\"\n | \"read_error\"\n | \"unreadable_assignment\"\n | \"malformed_active\"\n | \"ambiguous_rows\"\n | \"malformed_level\"\n | \"malformed_visible_groups\"\n | \"unknown_visible_group\"\n | \"malformed_scope_vocab\"\n | \"unsupported_scope_vocab\";\n\n/** The governing row's identity (prototype `viewingPolicyFor` `policy`). */\nexport interface ViewingPolicyRef {\n /** The row's `entity_id`, else `id`, else `_id`. */\n readonly id: string;\n readonly familyId: string | null;\n /** A positive integer, or `null` when the row carries none (or a malformed one). */\n readonly version: number | null;\n}\n\n/** A team's own row, or the account-wide rule, governs. */\nexport interface ViewingPolicyGoverning {\n readonly source: \"team\" | \"account\";\n /** The level the policy grants (before the role clamp). */\n readonly level: ViewingLevel;\n /**\n * The categories still shown at Level 3, as stored (a copy), minus any\n * `category_rest` row. A row with no list reads `[]` (only the stub and system\n * information show). Every code is live at the tree version `scopeVocab` reads.\n */\n readonly visibleGroups: readonly string[];\n readonly scopeVocab: ViewingPolicyScopeVocab;\n readonly policy: ViewingPolicyRef;\n readonly accountId: string;\n /** A short, value-free trace of the decision, for logs (ids and versions only). */\n readonly rulePath: string;\n}\n\n/** No row governs: the account set nothing for this team. The role level alone decides. */\nexport interface ViewingPolicyNone {\n readonly source: \"none\";\n readonly level: null;\n /** `null`: no row, so Level 3 shows the full record. */\n readonly visibleGroups: null;\n readonly scopeVocab: null;\n readonly policy: null;\n readonly accountId: string;\n /** The account holds viewing rows and every one is retired (`active: false`): log it. */\n readonly retiredRowsOnly: boolean;\n readonly rulePath: string;\n}\n\n/** The policy could not be read: no view of other teams' cases for this request. */\nexport interface ViewingPolicyUnavailable {\n readonly source: \"unavailable\";\n readonly level: 0;\n readonly visibleGroups: readonly string[];\n readonly scopeVocab: null;\n readonly policy: null;\n readonly reason: ViewingPolicyUnavailableReason;\n /** The offending row's id, when one row caused it. */\n readonly policyId: string | null;\n readonly rulePath: string;\n}\n\nexport type GoverningViewingPolicy =\n | ViewingPolicyGoverning\n | ViewingPolicyNone\n | ViewingPolicyUnavailable;\n\n/** A stored viewing row, as raw as it is on disk (the platform owns the writer). */\ninterface RawViewingPolicyDoc {\n _id?: unknown;\n entity_id?: unknown;\n id?: unknown;\n familyId?: unknown;\n version?: unknown;\n active?: unknown;\n level?: unknown;\n visibleGroups?: unknown;\n scopeVocab?: unknown;\n assignments?: unknown;\n species?: unknown;\n account_id?: unknown;\n}\n\n/** Where one row applies: the whole account, one team, or unplaceable. */\ntype Placement =\n | { kind: \"account\" }\n | { kind: \"team\"; teamId: string }\n | { kind: \"unreadable\" };\n\n// ─── Helpers (PAVE's, verbatim in behaviour) ─────────────────────────────────\n\n/**\n * The policy could not be read — the shape every fail-closed answer takes. Apps\n * use it for their own I/O outcomes (`read_error`, `policy_store_absent`, …).\n */\nexport function unavailableViewingPolicy(\n reason: ViewingPolicyUnavailableReason,\n policyId?: string | null,\n): ViewingPolicyUnavailable {\n return {\n source: \"unavailable\",\n level: 0,\n visibleGroups: [],\n scopeVocab: null,\n policy: null,\n reason,\n policyId: policyId ?? null,\n rulePath:\n `viewing policy unavailable: ${reason}` +\n (policyId ? ` (${policyId})` : \"\") +\n \" — no view of other teams' cases\",\n };\n}\n\nconst HEX_OBJECT_ID = /^[0-9a-fA-F]{24}$/;\n\n/** The hex of an ObjectId-like value (duck-typed), lower-case; `null` for anything else. */\nfunction objectIdHex(v: unknown): string | null {\n if (typeof v === \"object\" && v !== null && \"toHexString\" in v) {\n const toHex: unknown = (v as { toHexString: unknown }).toHexString;\n if (typeof toHex === \"function\") {\n const hex: unknown = toHex.call(v);\n if (typeof hex === \"string\") return hex.toLowerCase();\n }\n }\n return null;\n}\n\n/** A stored id as text, or `null` when it is not an id. */\nfunction idText(v: unknown): string | null {\n if (typeof v === \"string\") return v === \"\" ? null : v;\n return objectIdHex(v);\n}\n\n/**\n * One spelling per id: a 24-hex ObjectId string is lower-cased (an ObjectId's own\n * rendering is lower-case; a hand-typed team id may not be); any other id is\n * compared exactly.\n */\nfunction normalizedId(id: string): string {\n return HEX_OBJECT_ID.test(id) ? id.toLowerCase() : id;\n}\n\nfunction policyIdOf(d: RawViewingPolicyDoc): string {\n return idText(d.entity_id) ?? idText(d.id) ?? idText(d._id) ?? \"(no id)\";\n}\n\n/**\n * A row's ONE assignment: the whole account or one team. Anything else — no\n * assignment, several, a mix, an unknown scope, a team entry with no team — is\n * UNREADABLE: the row might be this team's narrowing, and skipping it could widen.\n */\nfunction placementOf(d: RawViewingPolicyDoc): Placement {\n if (!Array.isArray(d.assignments) || d.assignments.length !== 1) {\n return { kind: \"unreadable\" };\n }\n const [a] = d.assignments as unknown[];\n if (typeof a !== \"object\" || a === null) return { kind: \"unreadable\" };\n const { scope, teamId } = a as { scope?: unknown; teamId?: unknown };\n if (scope === \"account\") return { kind: \"account\" };\n const team = idText(teamId);\n if (scope === \"team\" && team !== null) {\n return { kind: \"team\", teamId: normalizedId(team) };\n }\n return { kind: \"unreadable\" };\n}\n\n/** A positive integer, or `null` when absent; `undefined` when malformed. */\nfunction positiveIntOrNull(v: unknown): number | null | undefined {\n if (v === undefined || v === null) return null;\n return typeof v === \"number\" && Number.isInteger(v) && v >= 1 ? v : undefined;\n}\n\n/**\n * The ONE live row of a place. Several live rows are read in version order only\n * when they are one family with distinct versions (a prior version the writer has\n * not yet deactivated); otherwise the place is ambiguous.\n */\nfunction governingRowOf(\n rows: readonly RawViewingPolicyDoc[],\n): { row: RawViewingPolicyDoc } | ViewingPolicyUnavailable {\n const [only] = rows;\n if (rows.length === 1 && only !== undefined) return { row: only };\n const family = idText(rows[0]?.familyId);\n const versions = rows.map((r) => positiveIntOrNull(r.version));\n const ordered =\n family !== null &&\n rows.every((r) => idText(r.familyId) === family) &&\n versions.every((v): v is number => typeof v === \"number\") &&\n new Set(versions).size === versions.length;\n if (!ordered) {\n return unavailableViewingPolicy(\"ambiguous_rows\", policyIdOf(rows[0] ?? {}));\n }\n let best = rows[0] as RawViewingPolicyDoc;\n for (const r of rows) {\n if ((r.version as number) > (best.version as number)) best = r;\n }\n return { row: best };\n}\n\n/**\n * Every code must be a live CVC-236 code at the tree version the stamp reads at:\n * an unknown or retired code fails closed rather than being quietly dropped.\n */\nfunction whitelistProblem(\n visibleGroups: readonly string[],\n vocab: ViewingPolicyVocabulary,\n scope: ViewingPolicyScopeResolver,\n): ViewingPolicyUnavailableReason | null {\n const reading: ScopeReading = scope.readSelection(visibleGroups, vocab.scopeVersion, {\n subject: \"policy\",\n });\n if (reading.unsupportedVersion) return \"unsupported_scope_vocab\";\n if (reading.unknown.length > 0 || reading.retired.length > 0) {\n return \"unknown_visible_group\";\n }\n return null;\n}\n\n/**\n * The whitelist as viewing reads it: without a `category_rest` row\n * (`identifying.other`). Naming that row covers its whole category on the share\n * side; the prototype's viewing gate reads the category alone, so here it opens\n * nothing. Dropped, not refused (PAVE `withoutRestRows`).\n */\nfunction withoutRestRows(\n visibleGroups: readonly string[],\n scope: ViewingPolicyScopeResolver,\n): string[] {\n return visibleGroups.filter((code) => scope.row(code)?.rowType !== \"category_rest\");\n}\n\nfunction ruleText(source: \"team\" | \"account\", ref: ViewingPolicyRef): string {\n const v = ref.version === null ? \"\" : ` v${ref.version}`;\n return source === \"team\"\n ? `${ref.id}${v} (the team's own row — it governs this team in place of the account-wide rule)`\n : `${ref.id}${v} (the account-wide viewing rule — no row for this team)`;\n}\n\n/** Read the governing row's fields; any malformed field is unavailable. */\nfunction readRow(\n d: RawViewingPolicyDoc,\n source: \"team\" | \"account\",\n accountId: string,\n scope: ViewingPolicyScopeResolver,\n): GoverningViewingPolicy {\n const policyId = policyIdOf(d);\n const level = d.level;\n if (level !== 0 && level !== 1 && level !== 2 && level !== 3) {\n return unavailableViewingPolicy(\"malformed_level\", policyId);\n }\n let visibleGroups: string[] = [];\n if (d.visibleGroups !== undefined && d.visibleGroups !== null) {\n if (!Array.isArray(d.visibleGroups) || !d.visibleGroups.every((g) => typeof g === \"string\")) {\n return unavailableViewingPolicy(\"malformed_visible_groups\", policyId);\n }\n visibleGroups = [...(d.visibleGroups as string[])];\n }\n const scopeVocab = positiveIntOrNull(d.scopeVocab);\n if (scopeVocab === undefined) {\n return unavailableViewingPolicy(\"malformed_scope_vocab\", policyId);\n }\n // EVERY governing row must carry a stamp the reader reads (3, 4 or 5), at every\n // level and with or without a list: the hub stamps every save, so a row without\n // one was not written by it, and a Level 3 row read at all shows the client's\n // name and date of birth to other teams (PAVE `readRow`).\n const vocab = viewingPolicyVocabulary(scopeVocab);\n if (scopeVocab === null || vocab === null) {\n return unavailableViewingPolicy(\"unsupported_scope_vocab\", policyId);\n }\n const problem = whitelistProblem(visibleGroups, vocab, scope);\n if (problem !== null) return unavailableViewingPolicy(problem, policyId);\n const policy: ViewingPolicyRef = {\n id: policyId,\n familyId: idText(d.familyId),\n version: positiveIntOrNull(d.version) ?? null,\n };\n return {\n source,\n level,\n visibleGroups: withoutRestRows(visibleGroups, scope),\n scopeVocab: scopeVocab as ViewingPolicyScopeVocab,\n policy,\n accountId,\n rulePath: ruleText(source, policy),\n };\n}\n\n// ─── The reader ──────────────────────────────────────────────────────────────\n\n/**\n * The internal-viewing policy that governs `query.teamId` on `query.accountId`,\n * chosen from the candidate rows the app read. NEVER throws; see the module\n * header for every outcome.\n *\n * `docs`: the account's policy documents (`registry_policies`), or `null` /\n * `undefined` when the read failed (`read_error`). Rows of another species or\n * another account are skipped, as the app's own query would have left them out.\n * Mongo answers `[]` for a collection that does not exist, so on an empty answer\n * the app must check that the policy store exists and pass\n * `unavailableViewingPolicy(\"policy_store_absent\")` when it does not (PAVE's\n * reader checks with `listCollections`); an empty list from a store that exists\n * means \"none\".\n */\nexport function resolveViewingPolicy(\n docs: readonly unknown[] | null | undefined,\n query: ViewingPolicyQuery,\n scope: ViewingPolicyScopeResolver,\n): GoverningViewingPolicy {\n const accountRaw = typeof query.accountId === \"string\" ? query.accountId.trim() : \"\";\n if (accountRaw === \"\") return unavailableViewingPolicy(\"account_unresolved\");\n if (!Array.isArray(docs)) return unavailableViewingPolicy(\"read_error\");\n const accountId = normalizedId(accountRaw);\n const teamRaw = typeof query.teamId === \"string\" ? query.teamId.trim() : \"\";\n const actingTeamId = teamRaw !== \"\" ? normalizedId(teamRaw) : null;\n\n // The app's query: `species: \"viewing\"`, `account_id` = this Account (any stored\n // id form, hex in either case).\n const rows: RawViewingPolicyDoc[] = [];\n for (const raw of docs) {\n if (typeof raw !== \"object\" || raw === null) {\n return unavailableViewingPolicy(\"read_error\");\n }\n const d = raw as RawViewingPolicyDoc;\n if (d.species !== VIEWING_POLICY_SPECIES) continue;\n const owner = idText(d.account_id);\n if (owner === null || normalizedId(owner) !== accountId) continue;\n rows.push(d);\n }\n\n const teamRows: RawViewingPolicyDoc[] = [];\n const accountRows: RawViewingPolicyDoc[] = [];\n for (const d of rows) {\n // A retired version never governs (the writer deactivates the prior one).\n if (d.active === false) continue;\n const placement = placementOf(d);\n if (placement.kind === \"unreadable\") {\n return unavailableViewingPolicy(\"unreadable_assignment\", policyIdOf(d));\n }\n const governsHere =\n placement.kind === \"account\" ||\n (actingTeamId !== null && placement.teamId === actingTeamId);\n if (!governsHere) continue; // another team's row\n // Only `active: true` is live; an absent / null `active` is a row this reader\n // cannot classify.\n if (d.active !== true) {\n return unavailableViewingPolicy(\"malformed_active\", policyIdOf(d));\n }\n if (placement.kind === \"account\") accountRows.push(d);\n else teamRows.push(d);\n }\n\n // Ruling (a): the team's own row REPLACES the account-wide rule.\n const [source, candidates]: [\"team\" | \"account\", RawViewingPolicyDoc[]] =\n teamRows.length > 0 ? [\"team\", teamRows] : [\"account\", accountRows];\n if (candidates.length === 0) {\n const retiredRowsOnly = rows.length > 0 && rows.every((d) => d.active === false);\n return {\n source: \"none\",\n level: null,\n visibleGroups: null,\n scopeVocab: null,\n policy: null,\n accountId,\n retiredRowsOnly,\n rulePath: retiredRowsOnly\n ? \"no viewing policy on file (every viewing row is retired) — the role level alone decides\"\n : \"no viewing policy on file — the role level alone decides\",\n };\n }\n const governing = governingRowOf(candidates);\n if (!(\"row\" in governing)) return governing;\n return readRow(governing.row, source, accountId, scope);\n}\n\n/**\n * The `teamViewingLevel` argument of `viewingLevelFromFunctions` /\n * `resolveEffectiveViewingLevel` (contract § 3): the row's level when a row\n * governs; `null` when none does (the role level alone decides); `0` when the\n * policy could not be read (fail closed).\n */\nexport function teamViewingLevelFromPolicy(policy: GoverningViewingPolicy): ViewingLevel | null {\n switch (policy.source) {\n case \"team\":\n case \"account\":\n return policy.level;\n case \"none\":\n return null;\n default:\n return 0;\n }\n}\n","/**\n * @htilabs/platform-common-models/authz — the Level 3 category filter of internal\n * viewing: what of a case a viewer who does not own it may see, given the\n * effective level and the governing policy's `visibleGroups` / `scopeVocab`.\n *\n * Lifted from PAVE `@pave/domain` `viewingScope.ts` (pave-2.0 develop 41f5f916:\n * `caseViewingAccess`, `recordViewing`, `caseSurfacesOn`, `caseSurfacesAsStub`)\n * and `viewingProjection.ts` (`viewingComponentOpen`), unchanged in behaviour.\n * The only difference: PAVE reads its module-level resolver binding; here the\n * app passes its own binding of the CVC-236 v4 resolver (`scope`), so the\n * browser-safe `./authz` entry never inlines the SOT JSON. PAVE's wire\n * projections (`viewingProjection` field lists, route homes) and the stub\n * projection stay in the app.\n *\n * Pure and I/O-free: the caller resolves every fact about the viewer (effective\n * level, whether the case passes its agency / team row filter, ownership, the\n * governing policy) and this module only decides.\n *\n * Rules (contract § 2; Crysta 2026-11-03; prototype `recordOpenAccess`,\n * `carVisibleUnderAccess`, `applyViewingPolicy`):\n * - a case the viewer cannot see: nothing; an owned case: the full record;\n * - level 1: the stub in search; level 2: the stub in search and pickers;\n * neither opens the record; level 0: nothing;\n * - level 3 with NO policy on file (`whitelist: null`): the full record;\n * - level 3 with a policy: the client's stub rows and system information\n * always, plus whatever the whitelist COVERS on the record's kind-tree home\n * row (a category covers that category under every person on the record).\n * Unmapped or uncovered is hidden; an empty list hides everything else;\n * - the author always sees their own record on a case they can see.\n */\n\nimport type {\n InformationScopeResolver,\n ScopeReading,\n ScopeSubjectKind,\n} from \"../services/informationScopeResolver.js\";\nimport type { ViewingLevel } from \"./resolveEffectiveFunctions.js\";\nimport { type GoverningViewingPolicy, viewingPolicyVocabulary } from \"./viewingPolicy.js\";\n\n/**\n * The bound CVC-236 resolver the Level 3 filter reads (the app's binding of\n * `createInformationScopeResolver` to `coreInformationScopeSot`).\n */\nexport type ViewingScopeResolver = Pick<\n InformationScopeResolver,\n \"row\" | \"readSelection\" | \"isCovered\"\n>;\n\n/** Where a non-owned case can surface (prototype `applyViewingPolicy` context + record open). */\nexport type ViewingSurface = \"search\" | \"autocomplete\" | \"open\";\n\n/** A stored viewing whitelist (the admin-set by-category selection). */\nexport interface StoredViewingWhitelist {\n /** Flat list of scope codes (the policy's `visibleGroups`). */\n informationScope: readonly string[] | null | undefined;\n /**\n * The policy's vocabulary stamp as the hub wrote it (`scopeVocab`: 3, 4 or 5) —\n * never the CVC-236 tree version. Any other value reads nothing.\n */\n scopeVocab: number | null | undefined;\n}\n\n/** Everything the caller resolved about the viewer and the case. */\nexport interface ViewingContext {\n /** The case passes the caller's agency / team row filter. `false` ⇒ nothing on it. */\n canSeeCase: boolean;\n /** The case is owned / claimed by the viewer or their team: always fully visible. */\n ownedByViewer: boolean;\n /** The effective viewing level (`viewingLevelFromFunctions`). */\n level: ViewingLevel;\n /**\n * The governing policy's whitelist ({@link viewingWhitelistFromPolicy}). `null`\n * means exactly one thing: NO viewing policy is on file, so Level 3 renders every\n * component. A row with no list is an empty list, not `null`.\n */\n whitelist: StoredViewingWhitelist | null;\n}\n\n/** The decision for one case. */\nexport type CaseViewingAccess =\n | { readonly mode: \"full\"; readonly reason: \"owned\" | \"no_viewing_policy\" }\n | { readonly mode: \"none\"; readonly reason: \"cannot_see_case\" | \"level_0\" }\n | { readonly mode: \"stub\"; readonly level: 1 | 2 }\n | {\n readonly mode: \"whitelist\";\n /** The whitelist's v4 reading (`readSelection`, subject `policy`), untouched. */\n readonly reading: ScopeReading;\n /**\n * The list coverage is read on: the reading, plus `relationships_household`\n * when the prototype's v4 alias on `identifying` applies (a stamp below 5).\n */\n readonly visibleScope: readonly string[];\n /** The prototype's ONE-HOME domain carry applies (stamp 3). */\n readonly oneHomeCarry: boolean;\n /** The v4 alias carries `relationship_dynamics` at domain grain (stamp < 5 naming `identifying`). */\n readonly relationshipDynamicsCarry: boolean;\n };\n\n/** The vocabulary stamp a whitelist with no stored stamp of its own is read at. */\nconst CURRENT_VIEWING_POLICY_VOCAB = 5;\n\n/** The v4 category the prototype's alias opens for a pre-v4 `identifying`. */\nconst RELATIONSHIPS_HOUSEHOLD = \"relationships_household\";\n\n/** The assertion domain the prototype's v4 alias carries at domain grain. */\nconst RELATIONSHIP_DYNAMICS = \"relationship_dynamics\";\n\n/**\n * The whitelist {@link caseViewingAccess} reads for a governing-policy result:\n * `null` when nothing governs (the full record at Level 3); the row's list and\n * stamp when a row governs; an unreadable empty list when the policy is\n * unavailable (whose level 0 already shows nothing — never widens).\n */\nexport function viewingWhitelistFromPolicy(\n policy: GoverningViewingPolicy,\n): StoredViewingWhitelist | null {\n switch (policy.source) {\n case \"none\":\n return null;\n case \"team\":\n case \"account\":\n return { informationScope: [...policy.visibleGroups], scopeVocab: policy.scopeVocab };\n default:\n return { informationScope: [], scopeVocab: null };\n }\n}\n\n/** Resolve a viewer's access to one case. */\nexport function caseViewingAccess(\n ctx: ViewingContext,\n scope: ViewingScopeResolver,\n): CaseViewingAccess {\n // An exhaustive, strict ladder: every out-of-type input lands on the NARROWEST\n // branch, never falls through to a wider one.\n if (ctx.canSeeCase !== true) {\n return { mode: \"none\", reason: \"cannot_see_case\" };\n }\n if (ctx.ownedByViewer === true) return { mode: \"full\", reason: \"owned\" };\n if (ctx.level === 1 || ctx.level === 2) {\n return { mode: \"stub\", level: ctx.level };\n }\n if (ctx.level !== 3) return { mode: \"none\", reason: \"level_0\" };\n // Exactly `null`: no viewing policy on file. An ABSENT whitelist is out-of-type\n // input, not that fact, so it reads as an empty list and never widens.\n if (ctx.whitelist === null) {\n return { mode: \"full\", reason: \"no_viewing_policy\" };\n }\n const stored: StoredViewingWhitelist = ctx.whitelist ?? {\n informationScope: [],\n scopeVocab: CURRENT_VIEWING_POLICY_VOCAB,\n };\n const stamp = typeof stored.scopeVocab === \"number\" ? stored.scopeVocab : null;\n const vocab = viewingPolicyVocabulary(stamp);\n // A stamp this reader cannot read is handed to the resolver as stored (never 3\n // or 4, which are readable), so the resolver reads it unsupported and includes\n // nothing; an unstamped list is unsupported (fail closed).\n const reading = scope.readSelection(\n stored.informationScope,\n vocab !== null ? vocab.scopeVersion : stamp,\n { subject: \"policy\" },\n );\n // The alias reads the stored category itself, so a list naming only `names`\n // does not carry it.\n const identifyingAlias =\n vocab !== null && vocab.identifyingAlias && reading.informationScope.includes(\"identifying\");\n return {\n mode: \"whitelist\",\n reading,\n visibleScope: identifyingAlias\n ? [...reading.informationScope, RELATIONSHIPS_HOUSEHOLD]\n : reading.informationScope,\n oneHomeCarry: vocab !== null && vocab.oneHomeCarry,\n relationshipDynamicsCarry: identifyingAlias,\n };\n}\n\n/**\n * Does the case surface on `surface`? Level 1 — search only; level 2 — search and\n * autocomplete; neither opens the record. Level 3 and full open it.\n */\nexport function caseSurfacesOn(access: CaseViewingAccess, surface: ViewingSurface): boolean {\n switch (access.mode) {\n case \"none\":\n return false;\n case \"full\":\n case \"whitelist\":\n return true;\n case \"stub\":\n if (surface === \"search\") return true;\n if (surface === \"autocomplete\") return access.level === 2;\n return false;\n }\n}\n\n/** Does the case surface as the stub projection (levels 1 and 2 only)? */\nexport function caseSurfacesAsStub(access: CaseViewingAccess): boolean {\n return access.mode === \"stub\";\n}\n\n/** One record on a case, as the viewing decision reads it. */\nexport interface ViewingRecord {\n /** The v4 kind-tree row the record's field is homed on (never a per-kind code). */\n homeRow: string;\n /** Whose record it is: the client, or another named person's kind. */\n subjectKind: ScopeSubjectKind;\n /** The author's user id. The author always sees their own record. */\n authorUserId?: string | null | undefined;\n /** The record's assertion domain, read ONLY by the pre-v4 carries. */\n domain?: string | null | undefined;\n}\n\n/** Why a record is (not) visible. */\nexport type RecordViewingReason =\n | \"author\"\n | \"full\"\n | \"stub_row\"\n | \"covered\"\n | \"one_home_carry\"\n | \"identifying_alias_carry\"\n | \"cannot_see_case\"\n | \"level_0\"\n | \"not_opened\"\n | \"not_covered\"\n | \"unknown_row\";\n\nexport interface RecordViewingDecision {\n readonly visible: boolean;\n readonly reason: RecordViewingReason;\n}\n\n/**\n * The pre-v4 ONE-HOME carry: a stamp-3 whitelist that does NOT cover Screens &\n * assessments keeps showing the three domains it showed before the re-point.\n * Domain grain; the CATEGORY must be named.\n */\nconst ONE_HOME_CARRY: ReadonlyArray<{\n readonly homeRow: string;\n readonly domains: ReadonlySet<string>;\n readonly unlockedBy: string;\n}> = [\n { homeRow: \"summary_ida\", domains: new Set([\"ida_determination\"]), unlockedBy: \"risk\" },\n {\n homeRow: \"summary_needs_assessment\",\n domains: new Set([\"needs_assessment\", \"recommended_followup\"]),\n unlockedBy: \"services\",\n },\n];\n\nfunction isClientStubRow(scope: ViewingScopeResolver, code: string): boolean {\n const row = scope.row(code);\n return (\n row !== undefined &&\n row.levelFloor === 1 &&\n row.rowType !== \"branch\" &&\n (row.kindBranch === \"client\" || row.kindBranch === null)\n );\n}\n\n/**\n * May the viewer see this record on the case? A case the viewer cannot see:\n * nothing (checked first, even for the author); the author: their own record;\n * level 0: nothing; an owned case or no policy: all; level 1 / 2: the record never\n * opens; level 3: the client's stub rows always, otherwise the whitelist must\n * COVER the record's kind-tree home row.\n */\nexport function recordViewing(\n access: CaseViewingAccess,\n record: ViewingRecord,\n viewerUserId: string | null | undefined,\n scope: ViewingScopeResolver,\n): RecordViewingDecision {\n if (access.mode === \"none\" && access.reason === \"cannot_see_case\") {\n return { visible: false, reason: \"cannot_see_case\" };\n }\n const author = record.authorUserId;\n if (typeof author === \"string\" && author.trim().length > 0 && author === viewerUserId) {\n return { visible: true, reason: \"author\" };\n }\n switch (access.mode) {\n case \"none\":\n return { visible: false, reason: access.reason };\n case \"full\":\n return { visible: true, reason: \"full\" };\n case \"stub\":\n return { visible: false, reason: \"not_opened\" };\n case \"whitelist\":\n return whitelistDecision(access, record, scope);\n }\n}\n\nfunction whitelistDecision(\n access: Extract<CaseViewingAccess, { mode: \"whitelist\" }>,\n record: ViewingRecord,\n scope: ViewingScopeResolver,\n): RecordViewingDecision {\n const home = scope.row(record.homeRow);\n // Deny-by-default for a home the tree does not know, and for a per-kind code\n // passed as a home (a home is a kind-tree row).\n if (home === undefined || home.kindRow !== undefined) {\n return { visible: false, reason: \"unknown_row\" };\n }\n if (\n (record.subjectKind === \"client\" || home.kindBranch !== \"client\") &&\n isClientStubRow(scope, record.homeRow)\n ) {\n return { visible: true, reason: \"stub_row\" };\n }\n const list = access.visibleScope;\n if (scope.isCovered(list, record.homeRow)) {\n return { visible: true, reason: \"covered\" };\n }\n if (access.relationshipDynamicsCarry && record.domain === RELATIONSHIP_DYNAMICS) {\n return { visible: true, reason: \"identifying_alias_carry\" };\n }\n if (\n access.oneHomeCarry &&\n !scope.isCovered(list, \"instruments\") &&\n typeof record.domain === \"string\"\n ) {\n for (const carry of ONE_HOME_CARRY) {\n if (\n record.homeRow === carry.homeRow &&\n carry.domains.has(record.domain) &&\n scope.isCovered(list, carry.unlockedBy)\n ) {\n return { visible: true, reason: \"one_home_carry\" };\n }\n }\n }\n return { visible: false, reason: \"not_covered\" };\n}\n\n/** Is this kind-tree row visible under `access` (for the client)? */\nexport function viewingRowVisible(\n access: CaseViewingAccess,\n homeRow: string,\n scope: ViewingScopeResolver,\n): boolean {\n return recordViewing(access, { homeRow, subjectKind: \"client\" }, null, scope).visible;\n}\n\n/**\n * Is this home row OPEN as a whole component under `access`: does the whitelist\n * itself cover it? Stricter than {@link viewingRowVisible}: the stub (a name and a\n * date of birth) does not open a whole component such as the name history behind\n * it. System information is on every list, so it opens.\n */\nexport function viewingComponentOpen(\n access: CaseViewingAccess,\n homeRow: string,\n scope: ViewingScopeResolver,\n): boolean {\n if (access.mode === \"full\") return true;\n if (access.mode !== \"whitelist\") return false;\n const row = scope.row(homeRow);\n if (row === undefined || row.kindRow !== undefined) return false;\n if (row.status === \"retired\") return false;\n return scope.isCovered(access.visibleScope, homeRow);\n}\n"],"mappings":";AAYO,IAAM,mBAAmB;AAAA;AAAA,EAE9B,QAAQ;AAAA;AAAA,EAER,UAAU;AAAA;AAAA,EAEV,SAAS;AAAA;AAAA,EAET,OAAO;AACT;AAKO,IAAM,0BAA0B;AAAA,EACrC,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;AAEO,IAAM,0BAAgE;AAAA,EAC3E,CAAC,iBAAiB,MAAM,GAAG;AAAA,EAC3B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