Dashboard › institutional-transition-lab › Distillation
30c80cfd-05d0-4e3c-84be-d88e6321ea09["lore_tm_v1_M4kJsx4j9-53eJm_w9mGU-VJV9Krp07yNWeZWRpmM28","lore_tm_v1_h1lci41ww7oUpcnOYbvoS3NlA_DoAf2LocqvpT1W1l4"]
Date: Sep 8, 2026
tests/test_governance_adjudication.py is a 727-line pytest suite importing 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, plus coding ontology constants from institution_lab.governance_coding (lines 1-27).test_adjudication_schema_matches_validator_ontology() checks schema enums against validator constants for decisions, reviewer types/roles, record classes, event kinds, body/patch relations, right kinds, directions, and change statuses, but does not test schema/manual parity for conditional reviewer model rules or Gemini restrictions (lines 32-47).test_schema_enforces_uri_and_date_formats() tests two format failures: source_url="not a URI" and announced_on="2024-02-30" (lines 50-67)._coding() returns a no_event coding by default with null event metadata, body_patch_relation="not_applicable", empty power_changes, confidence=1.0, and null ambiguity (lines 70-82)._documents() contains one document, record_id="example-1", URL https://github.com/acme/example/issues/1, and source body with text "The council may approve releases."; all truncation/unavailability evidence bounds are clear (lines 85-114)._source_audit() records inspected_before_codings=true, source_ids=["body"], and complete evidence bounds matching _documents() (lines 117-127)._coding_package() gives example-1 identical schema-valid luna_a and luna_b responses and no route reasons; its summary documents hash is populated by tests (lines 130-144)._adjudication() uses reviewer opencode-gpt-5.6-sol-primary, type llm, model openai/gpt-5.6-sol, role source_adjudicator, and assistance "Primary source review and synthesis"; its sole record accepts luna_a, concludes no_event, has no claim evidence, and reports an empty luna_a-based graph revision (lines 147-194)._pins() and _validate() use synthetic hashes, replace documents_sha256 with canonical_sha256(documents), synchronize the coding-package summary and verified pins, and invoke validate_adjudication() directly rather than exercising CLI main() (lines 197-221).abstain final class; mismatched/incomplete source_audit; institutional class/date inconsistencies; bounded evidence without evidence_limitations; and an accept revision whose basis differs from accepted_from (lines 224-369).test_institutional_claims_require_grounded_claim_and_edge_evidence() uses invalid quote "invented" for both a record_class claim reference and a power-change evidence reference, then checks only that some error contains "not grounded"; it does not specifically test whether an ungrounded claim reference still satisfies the required-field presence check (lines 372-386)._institutional_adjudication() constructs revised institutional records with claim references for 7 fields in this order: record_class, event_kind, title, announced_on, effective_on, affected_scope, body_patch_relation; every reference quotes "council" from source body (lines 389-440)._institutional_adjudication() creates one power edge: actor "The council", right_kind="approve", target "releases", direction="added", scope "project releases", exact evidence quote "The council may approve releases.", and status selected as effective, announced, or proposed according to institutional class; graph revision uses basis=None, adds that edge, and removes none (lines 389-440).test_institutional_class_and_edge_status_must_agree() rejects 3 class/status combinations: effective_institutional_change with proposed, announced_institutional_change with effective, and proposal_only with effective (lines 443-502).google/gemini-3.7-flash, require a referenced reviewer with role source_adjudicator, reject duplicate record reviewer_ids, and verify malformed reviewer_ids=[{"invalid":"reviewer"}] returns an error rather than crashing (lines 505-543).artifact_sha256 mismatch closes the gate; assert FROZEN_INPUT_PINS exactly matches REQUIRED_INPUT_PINS; assert frozen adjudication_schema_sha256=6181f5cb60a0462f83be00be301763daa89f11581e68ee1c46a84e8bf4e5be31; mutate every frozen manifest field to test rejection of self-consistent substitutes; and separately mutate workflow_run_id and artifact_id in adjudication inputs (lines 546-592).test_input_manifest_rejects_changed_file_bytes() builds temporary artifact/documents/coding-package/protocol/schema files, monkeypatches FROZEN_INPUT_PINS to their computed hashes, changes documents.json, and expects verify_input_manifest() to reject documents_file_sha256 (lines 595-638).test_input_manifest_rejects_files_not_from_pinned_artifact() places bytes b"different documents" in artifact member documents.json while separately pinning the durable documents file, then expects "artifact member mismatch: documents.json" (lines 641-685).test_committed_frozen_input_manifest_verifies() reads cases/review/oss-governance-adjudication-v1.inputs.json and verifies cases/review/oss-governance-adjudication-v1/artifact-9642983578.zip, documents.json, 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, asserting the result equals FROZEN_INPUT_PINS (lines 688-704).test_resolved_valid_records_open_the_gate() expects one accepted no_event record, no unresolved IDs, an empty luna_a graph-edge revision, reviewer provenance copied from the adjudication, and canonicalization_gate="open" (lines 707-727).main() test for malformed JSON, schema-valid/manual-invalid composition, whether manual validation exceptions prevent merged audit output, Markdown rendering accuracy, or CLI output files when validation fails.pyproject.toml defines project institutional-transition-lab version 0.1.0, requires Python >=3.12, and has one base dependency: jsonschema>=4.23,<5 (lines 5-13).pyproject.toml registers CLI institution-lab-governance-adjudication = "institution_lab.governance_adjudication:main" alongside six other scripts: institution-lab-oss, institution-lab-llm-eval, institution-lab-llm-triage, institution-lab-retrieve-oss-sources, institution-lab-enrich-oss-sources, and institution-lab-governance-coding (lines 15-22).analysis dependencies are duckdb>=1.3,<2, httpx>=0.28,<1, numpy>=2.2,<3, pandas>=2.2,<3, pyarrow>=19,<22, pydantic>=2.11,<3, pyyaml>=6,<7, ruptures>=1.1.9,<2, and scipy>=1.15,<2; optional lab dependencies are jupyterlab>=4.4,<5 and jupytext>=1.17,<2 (lines 24-39).pytest>=8.3,<9 and ruff>=0.11,<1; pytest uses testpaths=["tests"]; Ruff uses line length 100, target py312, and lint selectors E, F, I, UP, B, and SIM (lines 41-58).