Dashboard › institutional-transition-lab › Distillation
02fd75d2-db61-49ac-9f83-d2b64d4e4380["lore_tm_v1_XnyFB5EAlBzw6lCHdjx6MoYk6URejKCExH8fTWce9RM"]
/home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py helper _documents() creates one frozen document: record_id="example-1", source_url="https://github.com/acme/example/issues/1", and source body with text The council may approve releases. Its evidence bounds are source_text_truncated=False, files_listing_complete=None, patch_selection_truncated=False, and patch_unavailable_count=0._source_audit() reports inspected_before_codings=True, source_ids=["body"], and the same complete/unbounded evidence values as _documents()._coding_package() creates one example-1 record whose luna_a and luna_b entries share the same _coding() response and have schema_valid=True; route_reasons=[], while summary.documents_sha256 initially equals "filled-by-test"._adjudication() uses adjudication_id="oss-governance-adjudication-v1", design_status="performance_blinded_llm_assisted_source_adjudication", transition_dates_excluded=True, and outcome_data_used=False; its input pins include workflow_run_id=33063470968, artifact_id=9642983578, and placeholder SHA-256 strings formed from repeated digits 0 through 5._adjudication() defines reviewer opencode-gpt-5.6-sol-primary as an llm using model openai/gpt-5.6-sol, role source_adjudicator, and assistance Primary source review and synthesis._adjudication() record accepts luna_a for example-1, identifies reviewer opencode-gpt-5.6-sol-primary, uses rationale The source contains no institutional transition., leaves evidence_limitations and unresolved_reason null, has no claim_evidence_refs, uses _coding() as final_coding, and sets graph_edge_revision to basis luna_a with empty added and removed lists._pins() reproduces the adjudication’s workflow/artifact IDs and placeholder hashes. _validate(adjudication) computes canonical_sha256(_documents()), writes it into the coding package summary, adjudication input pins, and verified pins, then calls validate_adjudication(adjudication, documents, package, verified_pins=pins).test_one_abstention_keeps_canonicalization_gate_closed() changes the sole record to decision="abstain", accepted_from=None, unresolved_reason="Required source evidence is incomplete.", final_coding=None, and graph_edge_revision=None; expected results are no errors, record_count == 1, unresolved_record_ids == ["example-1"], and canonicalization_gate == "closed".test_record_ids_must_match_frozen_documents_exactly_once() checks both duplicate (append a deep copy of the sole adjudication record) and missing (clear all records); 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; validation must report accepted coding does not equal luna_a and close the canonicalization gate.test_resolved_decision_cannot_leave_final_coding_abstained() creates a revise decision with accepted_from=None, an abstaining final coding whose ambiguity is The available source cannot resolve the event., and edge revision {basis: None, added: [], removed: []}; validation must report resolved decision cannot use abstain final class and close the canonicalization gate.test_source_audit_must_match_complete_frozen_document() tests three invalid source-audit mutations: 1. inspected_before_codings=False; 2. source_ids=[]; 3. evidence_bounds={"source_text_truncated": True}. Each must produce an error mentioning source_audit and close the canonicalization gate.test_institutional_class_and_dates_must_agree() checks: 1. effective_institutional_change with announced_on="2024-04-01" and effective_on=None must report requires effective_on; 2. announced_institutional_change with both dates null must report requires announced_on; 3. announced_institutional_change with announced_on="2024-04-01" and effective_on="2024-05-01" must report must not set effective_on; 4. proposal_only with those same two dates must report must not set effective_on. Every case must close the canonicalization gate.test_bounded_source_requires_explicit_evidence_limitation() changes the frozen document’s source_text_truncated bound to True, copies that bound into the adjudication’s source audit, recomputes and propagates the canonical documents hash, and validates without adding an evidence limitation; expected error contains bounded evidence requires evidence_limitations, with the canonicalization gate closed.test_accept_edge_revision_uses_the_accepted_response() changes the accepted record’s graph-edge basis from luna_a to luna_b; validation must report accept revision basis must equal accepted_from and close the canonicalization gate.test_institutional_claims_require_grounded_claim_and_edge_evidence() supplies the quote invented for both a record_class claim reference and a final power-change evidence reference, while setting graph revision to basis luna_a with no added or removed edges; validation must report not grounded and close the canonicalization gate._institutional_adjudication(record_class) maps effective_institutional_change → effective, announced_institutional_change → announced, and proposal_only → proposed; it converts the record to decision="revise" with accepted_from=None._institutional_adjudication(record_class) creates claim evidence for fields, in order: record_class, event_kind, title, announced_on, effective_on, affected_scope, and body_patch_relation; every reference uses source_id="body" and quote council._institutional_adjudication(record_class) constructs final coding with event_kind="control_rights", title Council gains release approval, announced_on="2024-04-01", effective_on="2024-04-01" only for effective_institutional_change and otherwise null, affected_scope="releases", and body_patch_relation="body_only".The council, right_kind="approve", target releases, direction added, class-derived change_status, scope project releases, and evidence quote The council may approve releases. from source body; graph-edge revision has basis=None, a deep copy of this power change in added, and an empty removed list.test_institutional_class_and_edge_status_must_agree() tests mismatches: 1. effective_institutional_change with status proposed; 2. announced_institutional_change with status effective; 3. proposal_only with status effective. Each test constructs a revised institutional coding and matching added edge, then requires an error containing does not permit edge status and a closed canonicalization gate.test_gemini_cannot_adjudicate_or_assist() begins by changing the default reviewer model to google/gemini-3.7-flash before calling _validate(adjudication); the displayed file excerpt ends before its assertions.