Dashboard › institutional-transition-lab › Distillation
832d7dbb-e8c8-4b70-9bcb-7cb5c2cfb789["lore_tm_v1_myLXiKo-W6th183w7m5v0jA49GT1O71JBmXwHzjDYuk","lore_tm_v1_hrgswzqjoIAM242WWUbOH7RduWgeyc0RZ7MhOBtXcn0"]
src/institution_lab/governance_adjudication.py defines DECISIONS = {"accept", "revise", "reject", "abstain"}, INSTITUTIONAL_CLASSES = {"effective_institutional_change", "announced_institutional_change", "proposal_only"}, REVIEWER_TYPES = {"human", "llm", "human_llm_assisted"}, REVIEWER_ROLES = {"source_adjudicator", "evidence_auditor", "synthesizer"}, and RESPONSE_SOURCES = {"luna_a", "luna_b", "terra_advisory"}.REQUIRED_INPUT_PINS contains exactly nine fields: workflow_run_id, artifact_id, artifact_sha256, documents_sha256, documents_file_sha256, coding_package_file_sha256, protocol_sha256, coding_schema_sha256, and adjudication_schema_sha256.FROZEN_INPUT_PINS identifies frozen issue #4 input with workflow_run_id: 33063470968, artifact_id: 9642983578, artifact_sha256: "1f6be91fcd98e43e99d82d5f274536f6c23616e7e6c711e26324a2cc4b06ef06", documents_sha256: "d70f7f795847968339a645b6dbd6d4428af6bd6044de44fa2602d4c4343b0ee9", documents_file_sha256: "2a62ab05687982c112a29f6126227c26c3ff8defc89ca64662753aaf85c3c0ce", coding_package_file_sha256: "14644759f53071adfe1173d4e25bb01931b8c1591fa8a48295dbd0556a754769", protocol_sha256: "06d4b3407677fe7fb23046f70164a366db06638e8a29af3daf7661f00d565933", coding_schema_sha256: "bfc735a7d8602d1f236a88c2d23b195f0600a8bae86fb8c8936afe7883a41b8e", and adjudication_schema_sha256: "6181f5cb60a0462f83be00be301763daa89f11581e68ee1c46a84e8bf4e5be31".CLAIM_FIELDS contains record_class, event_kind, title, announced_on, effective_on, affected_scope, and body_patch_relation.canonical_sha256(value) hashes UTF-8 JSON serialized with sort_keys=True and separators=(",", ":"); file_sha256(path) streams files in 1024 * 1024 byte blocks through SHA-256.verify_input_manifest() requires the manifest key set to equal REQUIRED_INPUT_PINS, requires positive integer workflow_run_id and artifact_id, and requires every field to equal FROZEN_INPUT_PINS; frozen-pin disagreement raises ValueError("input manifest does not identify frozen issue #4 input: {field}").verify_input_manifest() recomputes file hashes for artifact, documents, coding_package, protocol, coding_schema, and adjudication_schema; a disagreement raises ValueError("input manifest mismatch: {field}").verify_input_manifest() requires the ZIP artifact members documents.json and v1.2-adjudication-package.json to be byte-identical to the durable documents and coding_package paths, respectively; missing members raise artifact member missing: {member_name} and byte mismatches raise artifact member mismatch: {member_name}.verify_input_manifest() parses the durable documents JSON and requires its canonical hash to equal manifest documents_sha256, otherwise raising input manifest mismatch: documents_sha256; on success it returns dict(manifest)._source_index(document) indexes valid source objects by source_id to their text and adds synthetic source record_metadata, containing compact sorted JSON for record_id, source_url, published_on, publisher, and source_type._evidence_errors(reference, sources, path, claim=False) requires evidence references to contain exactly source_id and quote; claim references must additionally contain exactly field, whose value must be in CLAIM_FIELDS. It rejects empty or unknown source IDs, empty quotes, and quotes not appearing verbatim in the selected frozen source._response_for(record, source) returns a response only when the named coding result is a dictionary with schema_valid is True and a dictionary-valued response; otherwise it returns None.graph_edge_diff(baseline, final_coding) canonicalizes each power-change edge as sorted compact JSON, then returns deterministically key-sorted added and removed edge arrays; absent baseline or final coding is treated as having no edges._validate_reviewer() requires exactly reviewer_id, reviewer_type, model, role, and assistance; reviewer_id and assistance must be nonempty strings, and reviewer type and role must belong to their defined allowlists._validate_reviewer() requires model: null for a human reviewer and a nonempty model string for every non-human reviewer; any model string containing gemini case-insensitively is rejected with "Gemini is restricted to event triage"._validate_record() requires each adjudication recordβs source_url to equal the frozen document URL, its decision to belong to DECISIONS, its rationale to be nonempty, and its reviewer_ids to be a nonempty array of unique, nonempty, known reviewer IDs._validate_record() requires source_audit to be an object with inspected_before_codings is True, source_ids exactly matching the frozen documentβs source IDs in order, and evidence_bounds exactly matching the frozen document._validate_record() treats evidence as bounded when source_text_truncated is True, files_listing_complete is False, patch_selection_truncated is True, or integer patch_unavailable_count > 0; bounded evidence requires a nonempty evidence_limitations string.decision == "accept", _validate_record() requires accepted_from to be one of luna_a, luna_b, or terra_advisory, requires that source to hold a valid frozen response, and requires final_coding to equal that response exactly. Non-accept decisions must set accepted_from to null.accept, revise, and reject require dictionary-valued final_coding, which is checked by validate_response(final_coding, document); abstain instead requires null final_coding and a nonempty unresolved_reason.unresolved_reason and cannot use final record_class: "abstain"; reject cannot resolve to any class in INSTITUTIONAL_CLASSES.effective_institutional_change requires non-null effective_on; announced_institutional_change requires non-null announced_on; both announced_institutional_change and proposal_only must have null effective_on.power_changes[*].change_status values are class-dependent: effective_institutional_change permits only effective, announced_institutional_change permits only announced, and proposal_only permits proposed, rejected, or unclear._validate_record() requires claim_evidence_refs to be an array and validates every entry through _evidence_errors(..., claim=True); for an institutional class, every non-null field in CLAIM_FIELDS must have a claim reference naming that field.decision == "abstain" requires null graph_edge_revision; every resolved decision requires a revision object. Its basis must be one of luna_a, luna_b, terra_advisory, or null; for accept, the basis must equal accepted_from._validate_record() derives expected graph-edge changes with graph_edge_diff(_response_for(coding_record, basis), final_coding) and requires graph_edge_revision.added and .removed to equal the derived arrays exactly.validate_adjudication() requires transition_dates_excluded is True, outcome_data_used is False, and an object-valued inputs whose values for every sorted REQUIRED_INPUT_PINS field equal the corresponding verified pins.validate_adjudication() requires a nonempty reviewer array, validates each reviewer with _validate_reviewer(), and reports duplicate reviewer IDs as duplicate reviewer IDs: {sorted_duplicates}.render_markdown() renders reviewer provenance as reviewer ID, reviewer type, model (using "none" for null), role, and assistance; its graph-edge revisions section lists only records with nonzero changes as ``record_id: N added, M removed, otherwise emits - None.main() in src/institution_lab/governance_adjudication.py is described as "Validate frozen governance adjudication" and requires arguments --adjudication, --input-manifest, --documents, --coding-package, --artifact, --protocol, --coding-schema, --adjudication-schema, --summary-json, and --summary-markdown, all typed as Path.main() loads the adjudication, input manifest, documents, coding package, and adjudication schema as JSON; calls verify_input_manifest() with all frozen artifact and schema paths; combines validate_against_schema(adjudication, adjudication_schema) errors with validate_adjudication(..., verified_pins=pins) errors in that order.main() forces summary["canonicalization_gate"] = "closed"; it writes summary JSON as {"schema_version": 1, "validation_errors": errors, **summary} with indentation, sorted keys, and a trailing newline, writes Markdown via render_markdown(adjudication, summary), then raises ValueError("adjudication validation failed:\n" + "\n".join(errors)).