Dashboard › institutional-transition-lab › Distillation
6ab46578-8116-4ffd-b1b7-712a258bfd8f["lore_tm_v1_LPvB0JQAWOIgxAcr9KSrHVAUa3DnTQyl76_dxTeY1B0","lore_tm_v1_CvE9VOx_E_rNbS4D1QCyjiaWXrJS9qyMR-Mpyw_wz2g"]
/home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py lines 180β619, covering fixture helpers and validator tests._source_audit() at /home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py lines 205β215 returns inspected_before_codings: True, source_ids: ["body"], and evidence bounds with source_text_truncated: False, files_listing_complete: None, patch_selection_truncated: False, and patch_unavailable_count: 0._coding_package() at lines 218β232 creates one example-1 record for https://github.com/acme/example/issues/1; both luna_a and luna_b contain the same _coding() response with schema_valid: True, route_reasons is empty, and summary.documents_sha256 begins as "filled-by-test"._adjudication() at lines 235β282 uses adjudication_id: "oss-governance-adjudication-v1" and one reviewer: reviewer_id: "opencode-gpt-5.6-sol-primary", reviewer_type: "llm", model: "openai/gpt-5.6-sol", role: "source_adjudicator", and assistance: "Primary source review and synthesis"._adjudication() input pins use workflow_run_id: 33063470968, artifact_id: 9642983578, and SHA-256 placeholders "0" * 64 through "5" * 64 for artifact_sha256, documents_sha256, documents_file_sha256, coding_package_file_sha256, protocol_sha256, coding_schema_sha256, and adjudication_schema_sha256._adjudication() record is example-1, decision accept, accepted_from: "luna_a", reviewer IDs ["opencode-gpt-5.6-sol-primary"], rationale "The source contains no institutional transition.", null evidence_limitations and unresolved_reason, empty claim_evidence_refs, _coding() as final_coding, and graph-edge revision basis luna_a with empty added and removed._pins() at lines 285β296 mirrors the fixtureβs workflow/artifact IDs and SHA-256 placeholders. _validate() at lines 299β309 computes canonical_sha256(documents), writes it into package["summary"]["documents_sha256"], adjudication["inputs"]["documents_sha256"], and pins["documents_sha256"], then calls validate_adjudication(adjudication, documents, package, verified_pins=pins).test_one_abstention_keeps_canonicalization_gate_closed() changes the sole record to decision abstain, clears accepted_from, sets unresolved_reason to "Required source evidence is incomplete.", and nulls final_coding and graph_edge_revision; expected outcome is no errors, record_count == 1, unresolved_record_ids == ["example-1"], and canonicalization_gate == "closed".test_record_ids_must_match_frozen_documents_exactly_once() tests both duplicate and missing record mutations; each must produce an error containing "record IDs must match frozen documents exactly once" and close the canonicalization gate.test_accept_must_equal_the_named_frozen_response() changes accepted final_coding.confidence to 0.5; expected error contains "accepted coding does not equal luna_a" and the canonicalization gate is closed.test_resolved_decision_cannot_leave_final_coding_abstained() uses decision revise, null accepted_from, an abstain final coding with ambiguity "The available source cannot resolve the event.", and an empty graph revision with null basis; expected error contains "resolved decision cannot use abstain final class" and closes the gate.test_source_audit_must_match_complete_frozen_document() independently mutates inspected_before_codings to False, source_ids to [], or evidence_bounds to {"source_text_truncated": True}; each case must emit a source_audit error and close the gate.test_institutional_class_and_dates_must_agree() covers 4 invalid combinations in order: 1. effective_institutional_change with announced_on: "2024-04-01" and effective_on: None β "requires effective_on"; 2. announced_institutional_change with both dates null β "requires announced_on"; 3. announced_institutional_change with announced_on: "2024-04-01" and effective_on: "2024-05-01" β "must not set effective_on"; 4. proposal_only with those same two dates β "must not set effective_on". Every case must close the gate.test_bounded_source_requires_explicit_evidence_limitation() marks frozen-document source_text_truncated as True, copies those bounds into the recordβs source audit, recomputes all document hash pins, and expects an error containing "bounded evidence requires evidence_limitations" with a closed gate.test_accept_edge_revision_uses_the_accepted_response() changes graph-edge revision basis from accepted source luna_a to luna_b; expected error contains "accept revision basis must equal accepted_from" and closes the gate.test_institutional_claims_require_grounded_claim_and_edge_evidence() inserts quote "invented" into both a record_class claim evidence reference and the final power changeβs evidence reference, then sets graph revision basis luna_a with empty edge changes; expected error contains "not grounded" and closes the gate._institutional_adjudication(record_class) maps effective_institutional_change β effective, announced_institutional_change β announced, and proposal_only β proposed, then constructs a revise decision with no accepted source and claim evidence for the 7 fields record_class, event_kind, title, announced_on, effective_on, affected_scope, and body_patch_relation, each grounded by source body quote "council"._institutional_adjudication() sets event_kind: "control_rights", title "Council gains release approval", announced_on: "2024-04-01", effective_on: "2024-04-01" only for effective_institutional_change, affected_scope: "releases", and body_patch_relation: "body_only"._institutional_adjudication() creates one power change with actor "The council", right_kind: "approve", target "releases", direction "added", class-derived change_status, scope "project releases", and source body quote "The council may approve releases."; graph revision has null basis, a deep copy of that power change in added, and no removals.test_institutional_class_and_edge_status_must_agree() checks 3 invalid class/status pairs in order: 1. effective_institutional_change with proposed; 2. announced_institutional_change with effective; 3. proposal_only with effective. Each must produce an error containing "does not permit edge status" and close the gate.test_gemini_cannot_adjudicate_or_assist() changes the reviewer model to google/gemini-3.7-flash; expected error contains "Gemini is restricted to event triage" and closes the gate.test_each_record_requires_a_source_adjudicator() changes the only reviewerβs role to synthesizer; expected error contains "requires a source_adjudicator" and closes the gate.test_record_reviewer_ids_must_be_unique() duplicates the first value in the recordβs reviewer_ids; the displayed excerpt ends immediately after invoking _validate(adjudication), before its assertions.