Dashboard › institutional-transition-lab › Distillation
e03ce810-0cd2-40c5-8be2-e5ea4382a964["lore_tm_v1_DzVpmhyKHbEEuLyph7-w9YB5w9MRNfMGMvRkY6GZlNE","lore_tm_v1_EUozyeyHYDeqpBxTx9zA2ZFEx3mMc2JnmH-MwJ9whnU"]
/home/byk/Code/institutional-transition-lab/src/institution_lab/governance_coding.py:228-238 defines parse_response(text: str): trims whitespace, unwraps a leading fenced block only when it has at least 3 lines and ends with exactly ``` after stripping, parses with json.loads(), and raises ValueError("response must be an object") unless the parsed value is a dictionary; unterminated fences raise ValueError("unterminated JSON code fence").validate_response() in /home/byk/Code/institutional-transition-lab/src/institution_lab/governance_coding.py:241-315 requires the response key set to equal RESPONSE_KEYS; validates record_class against RECORD_CLASSES, non-null event_kind against EVENT_KINDS, title/affected_scope/ambiguity as non-empty strings or null, announced_on/effective_on as ISO dates or null, and body_patch_relation against BODY_PATCH_RELATIONS.validate_response() requires confidence to be a finite int | float from 0 through 1, explicitly rejecting booleans.validate_response() builds source_map from each document source’s source_id and text; requires power_changes to be an array; requires each change dictionary to have exactly POWER_KEYS; validates non-empty actor, target, and scope; validates right_kind, direction, and change_status against RIGHT_KINDS, DIRECTIONS, and CHANGE_STATUSES; and requires a non-empty evidence_refs list.validate_response() must be a dictionary with exactly REF_KEYS, point to a source containing string text, and contain a non-empty quote that occurs verbatim as a substring of that source text; otherwise it is reported as not grounded.validate_response() treats effective_institutional_change, announced_institutional_change, and proposal_only as institutional classes requiring power_changes; non-institutional records must have no power_changes; record_class == "abstain" requires non-null ambiguity._validate_run() in /home/byk/Code/institutional-transition-lab/src/institution_lab/governance_coding.py:318-374 requires a non-empty document list, valid unique raw record_id values, and exact equality between response IDs and coding-document IDs. Per record it validates coding_id, coding_schema_sha256, run_id, source_url, MODEL_INPUT_FIELDS, model configuration, and a non-boolean nonnegative integer elapsed_ms._validate_run() parses each response_text via parse_response(), records JSON/validation errors rather than immediately aborting per-record validation, and returns response, schema_valid, validation_errors, model, reasoning_effort, and elapsed_ms for each record._edge_signature() in /home/byk/Code/institutional-transition-lab/src/institution_lab/governance_coding.py:377-405 canonicalizes each power-change edge using stripped actor, right_kind, target, direction, change_status, and scope, plus sorted stripped (source_id, quote) evidence-reference pairs serialized with json.dumps(..., ensure_ascii=False, separators=(",", ":")); it returns the sorted tuple of edges, or () for a missing response.compare_codings() in /home/byk/Code/institutional-transition-lab/src/institution_lab/governance_coding.py:408-479 validates two independent runs as luna-a and luna-b, both configured with model="gpt-5.6-luna" and reasoning_effort="medium", and optionally accepts raw_terra; its docstring says it builds a non-canonical adjudication package.compare_codings() routes records for any of these exact reasons: invalid_response, class_disagreement, edge_disagreement, event_field_disagreement across event_kind/announced_on/effective_on, body_patch_relation_disagreement, abstention, low_confidence when the lower coder confidence is below 0.8, bounded_evidence when source text or patch selection is truncated, and missing_patch when patch_unavailable_count is nonzero. Reasons are deduplicated and sorted.record_id, source_url, luna_a, luna_b, route_reasons, provisional_core_agreement (true only when there are no route reasons), full_response_agreement (exact response equality), and canonical_ledger_eligible: False.documents, changes coding_id to f"{bundle['coding_id']}-terra-route", and includes only documents whose record IDs were routed./home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py; 2. /home/byk/Code/institutional-transition-lab/tests/test_governance_coding.py; 3. /home/byk/Code/institutional-transition-lab/src/institution_lab/governance_adjudication.py; 4. /home/byk/Code/institutional-transition-lab/src/institution_lab/governance_coding.py; 5. /home/byk/Code/institutional-transition-lab/scripts/copilot-code-governance.mjs; 6. /home/byk/Code/institutional-transition-lab/schema/governance-adjudication-v1.schema.json; 7. /home/byk/Code/institutional-transition-lab/schema/governance-coding-v1.schema.json; 8. /home/byk/Code/institutional-transition-lab/cases/review/oss-governance-adjudication-v1.inputs.json; 9. /home/byk/Code/institutional-transition-lab/research/oss-governance-retrieval-development-v2.md; 10. /home/byk/Code/institutional-transition-lab/research/oss-governance-retrieval-development-v1.md; 11. /home/byk/Code/institutional-transition-lab/research/oss-governance-enriched-audit-envelope-v1.md; 12. /home/byk/Code/institutional-transition-lab/research/oss-governance-coding-results-v1.2.md; 13. /home/byk/Code/institutional-transition-lab/research/oss-governance-coding-protocol-v1.md; 14. /home/byk/Code/institutional-transition-lab/research/oss-governance-coding-protocol-v1.2.md; 15. /home/byk/Code/institutional-transition-lab/research/oss-governance-coding-protocol-v1.1.md; 16. /home/byk/Code/institutional-transition-lab/cases/review/oss-governance-enriched-envelope-v1.json; 17. /home/byk/Code/institutional-transition-lab/cases/retrieval/oss-governance-development-v2.yaml; 18. /home/byk/Code/institutional-transition-lab/cases/retrieval/oss-governance-development-v1.yaml.