Dashboard › institutional-transition-lab › Distillation
7216c5de-a7b9-42b2-a240-67f818797064["lore_tm_v1_EaHjrPjdlO8VOWQDs_h-E5WRaED3uRWGc6Tob_QSHw0","lore_tm_v1_tby05nbs58uyLxAfoRSDZElKak4maWBADRrgSQJ_X3E","lore_tm_v1_dpsDHz4Brf3cjrvyFHreLeaGiv_NX9_zoLBXPVGwKgk","lore_tm_v1_6rCIJle8gxu7FOyENT7OSlknQ1jTnHaLiaWOI2i2TQk","lore_tm_v1_HDWthj6BHrENVv43dGX1KZpEVDc-27ywFSLHJpPS_LQ"]
/home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py lines 613-631 contain regressions ensuring duplicate per-record reviewer_ids emit reviewer_ids must be unique, while malformed IDs such as {"invalid": "reviewer"} do not crash manual validation and instead emit reviewer_ids must contain non-empty strings; both cases close canonicalization_gate.inputs pin to be reverified; changing artifact_sha256, workflow_run_id, or artifact_id produces input pin mismatch: {field} and closes canonicalization_gate.FROZEN_INPUT_PINS must have exactly the keys in REQUIRED_INPUT_PINS; frozen adjudication_schema_sha256 is 6181f5cb60a0462f83be00be301763daa89f11581e68ee1c46a84e8bf4e5be31.test_input_manifest_rejects_self_consistent_substitute parametrizes every field in sorted FROZEN_INPUT_PINS; even a self-consistent substituted value must make verify_input_manifest() raise ValueError matching frozen issue #4 input: {field}.test_input_manifest_rejects_changed_file_bytes builds a ZIP containing documents.json and v1.2-adjudication-package.json, freezes a monkeypatched manifest, then changes documents.json; verify_input_manifest() must raise on documents_file_sha256.test_input_manifest_rejects_files_not_from_pinned_artifact verifies extracted inputs match the corresponding archive members; external documents.json differing from archived documents.json must raise artifact member mismatch: documents.json.test_cli_validates_the_same_bytes_it_verifies simulates a TOCTOU swap by replacing forged documents with {"documents": []} immediately before verification; _run_cli() must raise input manifest mismatch: documents_file_sha256, ensuring validation cannot proceed on bytes different from those verified.adjudication, input_manifest, documents, coding_package, artifact, protocol, coding_schema, and adjudication_schema—under 3 alias forms: direct, symlink, and hardlink. Each must raise output path aliases an input and preserve the aliased input’s original bytes.summary_json and summary_markdown resolve to the same output path, the CLI must raise output paths alias each other.artifact_sha256 key must raise duplicate JSON key: artifact_sha256; a preexisting summary_json claiming "canonicalization_gate":"open" must end with the gate "closed".verify_input_manifest() rejects a non-object manifest such as [] with input manifest must be an object.documents.json archive member must raise artifact member is not unique: documents.json.MAX_TEST_ARCHIVE_MEMBERS entries named padding/{index}; verification must raise artifact member count exceeds limit._read_regular_file() is tested in a subprocess against FIFO input.fifo with a 1-second timeout; it must fail without blocking, return nonzero, and emit input path is not a regular file on stderr.canonical_sha256() must reject each non-finite float—float("nan"), float("inf"), and float("-inf")—with ValueError matching Out of range float values.cases/review/oss-governance-adjudication-v1.inputs.json is verified against 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; expected result is exactly FROZEN_INPUT_PINS.cases/review/oss-governance-adjudication-v1/fragments/opentofu-a2.json must pass both validate_adjudication_fragment(fragment, documents, coding_package, schema) == [] and validate_against_schema(fragment, schema), while remaining unsuitable as the full envelope.record_id set to {"invalid": "record ID"} must fail closed without crashing; validate_adjudication_fragment() errors must mention both record_id and known subset.decision_counts={"accept": 1}, class_counts={"no_event": 1}, no unresolved IDs, and canonicalization_gate="open".record_decisions entry is record_id="example-1", decision="accept", final_class="no_event", reviewer_ids=["opencode-gpt-5.6-sol-primary"], and evidence_limitations=None; its sole graph revision is {"record_id":"example-1","basis":"luna_a","added":[],"removed":[]}, and reviewer_provenance exactly equals the adjudication’s reviewers./home/byk/Code/institutional-transition-lab/schema/governance-adjudication-v1.schema.json is JSON Schema draft 2020-12 with $id=https://institutional-transition-lab.local/schema/governance-adjudication-v1.schema.json, title Performance-blinded governance adjudication v1, a closed top-level object, schema_version=1, and design_status="performance_blinded_llm_assisted_source_adjudication".records (minItems=40, maxItems=40) and at least 1 reviewer.inputs is a closed object requiring 9 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; IDs are positive integers and each SHA-256 value must match ^[0-9a-f]{64}$.human, llm, human_llm_assisted; reviewer roles are ordered source_adjudicator, evidence_auditor, synthesizer; model is a nonempty string or null.claim_evidence_ref.field permits exactly: record_class, event_kind, title, announced_on, effective_on, affected_scope, and body_patch_relation.power_change.right_kind permits, in order: appoint, remove, elect, vote, delegate, override, approve, merge, write, release, veto, own, license, steward, fund, set_budget, set_strategy, set_policy, set_membership, set_terms, inform; direction permits added, removed, modified; change_status permits effective, announced, proposed, rejected, unclear.power_change requires nonempty actor, target, and scope, plus right_kind, direction, change_status, and at least 1 evidence_ref; both power changes and evidence references disallow additional properties.record_class, event_kind, title, announced_on, effective_on, affected_scope, body_patch_relation, power_changes, confidence, and ambiguity; confidence is numeric from 0 through 1.record_class values are effective_institutional_change, announced_institutional_change, proposal_only, control_event, no_event, and abstain; event_kind values are leadership, board_or_steering, control_rights, reorganization, foundation_transfer, license, fork, reunification, strategy, product, external, and null.body_patch_relation values are consistent, patch_supersedes_body, body_only, patch_only, conflict, not_applicable, and unclear.edge_revision is a closed object requiring basis, added, and removed; basis is one of luna_a, luna_b, terra_advisory, or null, and both edge arrays contain schema-valid power_change objects.evidence_bounds requires source_text_truncated boolean, files_listing_complete boolean or null, patch_selection_truncated boolean, and nonnegative integer patch_unavailable_count.source_audit.source_ids must contain at least 1 unique nonempty string; inspected_before_codings is fixed to true.record_id, source_url, decision, accepted_from, reviewer_ids, source_audit, rationale, evidence_limitations, unresolved_reason, claim_evidence_refs, final_coding, and graph_edge_revision.source_url must be a URI matching ^https://github\\.com/[^\\s]+$; reviewer_ids requires at least 1 unique nonempty string; final_coding and graph_edge_revision each accept their object definition or null./home/byk/Code/institutional-transition-lab/src/institution_lab/governance_coding.py validates confidence by rejecting booleans, non-numeric values, non-finite numbers, and values outside inclusive range 0–1, emitting confidence must be between zero and one.governance_coding.py constructs source_map from each dict source’s source_id to text; non-list power_changes emits power_changes must be an array and is treated as an empty list for continued validation.power_changes[{index}] must be a dict with exactly POWER_KEYS; otherwise validation emits {prefix} has missing or unexpected keys and skips remaining checks for that edge.actor, target, and scope must be nonempty; right_kind, direction, and change_status must belong to RIGHT_KINDS, DIRECTIONS, and CHANGE_STATUSES, respectively.evidence_refs must be a nonempty list. Each reference must be a dict with exactly REF_KEYS; malformed references emit power_changes[{index}].evidence_refs[{ref_index}] is malformed, while a missing/non-string source text, empty quote, or quote absent from the source emits ... is not grounded.governance_coding.py, institutional classes are effective_institutional_change, announced_institutional_change, and proposal_only; they require nonempty power_changes, while every non-institutional class must contain no power changes.record_class="abstain" requires non-null ambiguity; otherwise validation emits abstain requires ambiguity._validate_run(bundle, raw_responses, run_id, *, model, reasoning_effort) requires bundle["documents"] to be a nonempty list or raises ValueError("coding bundle requires documents"); it initially indexes documents by str(document.get("record_id")).