Dashboard › institutional-transition-lab › Distillation
2af35a6a-ef1b-47a5-81fd-4ccf1c546808["lore_tm_v1_G44NCw8BQemOzF6zTytt5Veq4Sa6dK6b-GTzFZyGdA4"]
Date: Sep 8, 2026
/home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py, a 727-line pytest suite for institution_lab.governance_adjudication.tests/test_governance_adjudication.py imports DECISIONS, FROZEN_INPUT_PINS, REQUIRED_INPUT_PINS, REVIEWER_ROLES, REVIEWER_TYPES, validate_adjudication, validate_against_schema, and verify_input_manifest from institution_lab.governance_adjudication; it imports BODY_PATCH_RELATIONS, CHANGE_STATUSES, DIRECTIONS, EVENT_KINDS, RECORD_CLASSES, and RIGHT_KINDS from institution_lab.governance_coding.test_adjudication_schema_matches_validator_ontology() checks that enums in schema/governance-adjudication-v1.schema.json exactly match validator ontology constants for decisions, reviewer types and roles, record classes, event kinds plus None, body/patch relations, right kinds, directions, and change statuses.test_schema_enforces_uri_and_date_formats() verifies schema rejection of source_url: "not a URI" and invalid announced_on: "2024-02-30" through validate_against_schema()._coding() defaults to record_class: "no_event", event_kind: None, null title and dates, null affected scope, body_patch_relation: "not_applicable", no power changes, confidence: 1.0, and null ambiguity._documents() creates coding package input oss-governance-enriched-coding-v1 with design status performance_blinded_model_informed_development, record example-1, URL https://github.com/acme/example/issues/1, and source body containing the exact text The council may approve releases.; its evidence is unbounded, with source_text_truncated: False, files_listing_complete: None, patch_selection_truncated: False, and patch_unavailable_count: 0._coding_package() supplies schema-valid identical luna_a and luna_b responses for example-1, a summary.documents_sha256 placeholder filled-by-test, and no route reasons._adjudication() uses adjudication_id: "oss-governance-adjudication-v1", workflow run ID 33063470968, artifact ID 9642983578, and reviewer opencode-gpt-5.6-sol-primary with type llm, model openai/gpt-5.6-sol, role source_adjudicator, and assistance Primary source review and synthesis._adjudication() defaults record example-1 to decision accept from luna_a, rationale The source contains no institutional transition., no evidence limitations or unresolved reason, final class no_event, and a graph_edge_revision based on luna_a with empty added and removed arrays._validate() computes canonical_sha256(documents), inserts it into the coding package summary, adjudication inputs, and verified pins, then calls validate_adjudication(adjudication, documents, package, verified_pins=pins).test_one_abstention_keeps_canonicalization_gate_closed() verifies that an abstain decision with accepted_from, final_coding, and graph_edge_revision set to None, plus unresolved reason Required source evidence is incomplete., is valid but yields record count 1, unresolved ID example-1, and a closed canonicalization gate.test_record_ids_must_match_frozen_documents_exactly_once() tests both duplicate and missing adjudication records; either must emit 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 from 1.0 to 0.5; validation must report accepted coding does not equal luna_a and close the gate.test_resolved_decision_cannot_leave_final_coding_abstained() verifies that decision revise cannot produce final class abstain, expecting resolved decision cannot use abstain final class and a closed gate.test_source_audit_must_match_complete_frozen_document() separately tests inspected_before_codings: False, empty source_ids, and incomplete evidence_bounds: {"source_text_truncated": True}; each must produce a source_audit validation error and close the gate.test_institutional_class_and_dates_must_agree() covers four invalid combinations: 1. effective_institutional_change with announced date 2024-04-01 but no effective date must report requires effective_on; 2. announced_institutional_change with neither date must report requires announced_on; 3. announced_institutional_change with announced date 2024-04-01 and effective date 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 closes the gate.test_bounded_source_requires_explicit_evidence_limitation() marks source_text_truncated: True in both frozen documents and source audit but leaves the record without an evidence limitation; validation must report bounded evidence requires evidence_limitations and close the gate.test_accept_edge_revision_uses_the_accepted_response() changes an accepted luna_a record’s edge-revision basis to luna_b; validation must report accept revision basis must equal accepted_from and close the gate._institutional_adjudication(record_class) creates a revised control_rights coding titled Council gains release approval, announced on 2024-04-01, scoped to releases, with body_patch_relation: "body_only" and a power change where The council gains (direction: "added") the right to approve releases within project releases._institutional_adjudication() maps record classes to power-change statuses as follows: effective_institutional_change → effective, announced_institutional_change → announced, and proposal_only → proposed; only the effective class receives effective_on: "2024-04-01"._institutional_adjudication() supplies claim evidence for fields record_class, event_kind, title, announced_on, effective_on, affected_scope, and body_patch_relation, each referencing source body with quote council; the power-change evidence uses the exact quote The council may approve releases..test_institutional_claims_require_grounded_claim_and_edge_evidence() replaces claim and edge quotes with invented; validation must report not grounded and close the gate.test_institutional_class_and_edge_status_must_agree() checks three prohibited class/status pairs: 1. effective_institutional_change with proposed; 2. announced_institutional_change with effective; 3. proposal_only with effective. Each must report 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; validation must report Gemini is restricted to event triage and close the canonicalization gate.test_each_record_requires_a_source_adjudicator() changes the only reviewer’s role to synthesizer; validation must report requires a source_adjudicator and close the gate.test_record_reviewer_ids_must_be_unique() duplicates opencode-gpt-5.6-sol-primary in the record; validation must report reviewer_ids must be unique and close the gate.test_malformed_reviewer_id_does_not_crash_manual_validation() supplies reviewer_ids: [{"invalid": "reviewer"}]; validation must report reviewer_ids must contain non-empty strings rather than crash, and the gate must remain closed.test_every_input_pin_is_reverified() changes artifact_sha256 to wrong; validation must include the exact error input pin mismatch: artifact_sha256 and close the gate.test_frozen_pins_include_the_versioned_adjudication_schema() asserts that set(FROZEN_INPUT_PINS) == REQUIRED_INPUT_PINS and that frozen adjudication_schema_sha256 equals 6181f5cb60a0462f83be00be301763daa89f11581e68ee1c46a84e8bf4e5be31.test_input_manifest_rejects_self_consistent_substitute() mutates every field in sorted FROZEN_INPUT_PINS individually—even when the substitute manifest is internally consistent—and requires verify_input_manifest() to raise ValueError matching frozen issue #4 input: {field}.test_frozen_input_identifiers_are_reverified() increments each of workflow_run_id and artifact_id; validation must include input pin mismatch: {field} and close the gate.test_input_manifest_rejects_changed_file_bytes() creates temporary artifact.zip, documents.json, coding-package.json, protocol.md, coding-schema.json, and adjudication-schema.json, writes documents.json and v1.2-adjudication-package.json into the archive, computes file hashes, then changes documents.json; verify_input_manifest() must raise ValueError matching documents_file_sha256.test_input_manifest_rejects_files_not_from_pinned_artifact() creates an artifact whose documents.json member contains different documents while the standalone pinned file contains documents; verify_input_manifest() must raise ValueError matching artifact member mismatch: documents.json.test_committed_frozen_input_manifest_verifies() loads cases/review/oss-governance-adjudication-v1.inputs.json and verifies it against cases/review/oss-governance-adjudication-v1/artifact-9642983578.zip, cases/review/oss-governance-adjudication-v1/documents.json, cases/review/oss-governance-adjudication-v1/v1.2-coding-package.json, research/oss-governance-coding-protocol-v1.2.md, schema/governance-coding-v1.schema.json, and schema/governance-adjudication-v1.schema.json; the verified result must equal FROZEN_INPUT_PINS.test_resolved_valid_records_open_the_gate() expects zero errors, decision_counts: {"accept": 1}, class_counts: {"no_event": 1}, no unresolved record IDs, and canonicalization_gate: "open".record_decisions entry for example-1 with decision accept, final class no_event, reviewer IDs ["opencode-gpt-5.6-sol-primary"], and no evidence limitations; one graph-edge revision based on luna_a with no added or removed edges; and reviewer provenance exactly equal to the adjudication’s reviewer list.