Dashboard › institutional-transition-lab › Distillation
e30f3b53-9a64-494a-b461-f868528c0fa5["lore_tm_v1_A9A5cvcUw7RuZ2MGBexEYrjUtT9VVyrR4nGT3ywIkDo","lore_tm_v1_dt5kqAkzNW4NqNJiGXzU5yWaPAaGl1XcTKqUJd9euOw","lore_tm_v1_PvRdb0urEC5oJvACHtfJOMZl4sSF8isJR0mRFf_AFSM","lore_tm_v1_EYSmiD6sK_FJnSNrvYx90Z4YdsJ9tMQ4EL6Up4ea76Y","lore_tm_v1_gCoiyBJTbdzpSX_7YpU1xLelCt3yWR_59ohJ_aWOIE4","lore_tm_v1_dRvKsBqTaZinCZ164iTIRiyAlzW8BihKq63D1PGPocI","lore_tm_v1_EIPHejcrw5LVe-7zfnUlroi0YNamIT_N3qBHd1JS6NI","lore_tm_v1_JulGuH1a6E0hQ8T3PLNjBS4VgAqwaiZO9lHfLzzJZQU","lore_tm_v1_SstIwjmORkAXRAczHugOaNskopCdEeisTeYTKgi9ng0","lore_tm_v1_keDbynI4e_9B5Cu453Jc-s_IEVC_0wFaAmVVsydVzaI","lore_tm_v1_JCs-M5_-BgnmaBYNhEHl0N8A0zidKPPlOOkNkWk8088","lore_tm_v1_KtpWCbbWWjHpFdpzRWCkBr4M3fnbseJafzjTR9f8-kQ","lore_tm_v1_TfdyPsk6KA3e3ZrRcItSNkSn96krTiQLQzXbYBFgHtg","lore_tm_v1_7fPYx9qMwhzKt9JKuESDBcMgJFzPU6hnk_JtBNTyQ_0"]
42 passed, 2 deselected in 0.14s./home/byk/Code/institutional-transition-lab/src/institution_lab/governance_adjudication.py.1 passed in 0.09s.tests/test_governance_adjudication.py defines fixtures _documents(), _source_audit(), _coding_package(), _adjudication(), _pins(), and _validate(). The sample record is example-1 at https://github.com/acme/example/issues/1; its body source says The council may approve releases.._adjudication() uses reviewer ID opencode-gpt-5.6-sol-primary, reviewer type llm, model openai/gpt-5.6-sol, role source_adjudicator, and assistance Primary source review and synthesis; its default record decision is accept from luna_a.workflow_run_id: 33063470968, artifact_id: 9642983578, and 64-character repeated-digit hashes for artifact_sha256 through adjudication_schema_sha256; _validate() computes the canonical document hash via canonical_sha256(documents) and updates the package, adjudication, and pins before calling validate_adjudication(..., verified_pins=pins)._duplicates([{"invalid":"record ID"}]) crashed with TypeError: unhashable type: 'dict' at src/institution_lab/governance_adjudication.py:123, where Counter(values) requires hashable values.{"invalid": "record ID"} produced two validation errors in one observed path: schema records.0.record_id: {'invalid': 'record ID'} is not of type 'string' and fragment record IDs must be a known subset in frozen document order._duplicates([r.get("record_id") for r in f["records"]]) with record ID {"invalid":"record ID"} reproduced the TypeError: unhashable type: 'dict'; the printed ID list was [{'invalid': 'record ID'}].{"bad": 1} likewise yielded the schema type error plus fragment record IDs must be a known subset in frozen document order.validate_adjudication_fragment() filtered fragment IDs to strings and checked len(fragment_ids) != len(fragment_rows), unlike the earlier read. Assistant treated the latest on-disk version as authoritative, planned to re-read every cited section before the verdict, and stated no audit edits had been made._duplicates(values: list[str]) -> set[str] at src/institution_lab/governance_adjudication.py:122-124 uses Counter(values) and returns values whose count exceeds 1; it remains unsafe if callers pass unhashable values despite its list[str] annotation._source_index() at src/institution_lab/governance_adjudication.py:127-140 indexes string source_id/text pairs and adds synthetic source record_metadata, serialized from record_id, source_url, published_on, publisher, and source_type._evidence_errors() at src/institution_lab/governance_adjudication.py:143-167 requires exact evidence-reference keys, validates claim fields against CLAIM_FIELDS, requires nonempty string source_id and quote, requires the source ID to exist, and grounds evidence by literal substring membership quote in sources[source_id]._validate_reviewer() at src/institution_lab/governance_adjudication.py:196-221 enforces exact reviewer keys and reviewer ontology, requires human reviewers to have model: null, requires non-human reviewers to name a model, and rejects any model string containing gemini case-insensitively with Gemini is restricted to event triage._validate_record() at src/institution_lab/governance_adjudication.py:224-389 validates frozen source_url, decision, unique known reviewer IDs, nonempty rationale, source-audit equality, bounded-evidence limitations, acceptance equality to the selected frozen response, required/null final coding by decision, unresolved-reason rules, institutional date/status consistency, claim grounding, and derived graph-edge revisions.source_text_truncated is true, files_listing_complete is false, patch_selection_truncated is true, or integer patch_unavailable_count > 0; in those cases a nonempty evidence_limitations string is required._validate_record() include: accept requires a valid accepted_from response and exact equality with final_coding; only accept may set accepted_from; accept, revise, and reject require dictionary final_coding; abstain requires null final_coding, a nonempty unresolved_reason, and null graph_edge_revision; resolved decisions require null unresolved_reason.effective_institutional_change requires effective_on; announced_institutional_change requires announced_on; announced_institutional_change and proposal_only must not set effective_on; permitted edge statuses are effective for effective changes, announced for announced changes, and proposed, rejected, or unclear for proposals.validate_adjudication() at src/institution_lab/governance_adjudication.py:392-536 performs manual validation independently of JSON Schema validation. It builds document_ids, coding_ids, and adjudication_ids directly from each dictionary rowβs record_id, then invokes _duplicates() and constructs dictionaries keyed by row["record_id"]; malformed unhashable IDs can therefore reach hash-based operations.source_adjudicator.validate_adjudication() summary fields are record_count, sorted decision_counts, sorted class_counts, unresolved_record_ids, record_decisions, graph_edge_revisions, reviewer_provenance, and canonicalization_gate; the gate is closed if validation errors or unresolved records exist, otherwise open.validate_adjudication_fragment() at src/institution_lab/governance_adjudication.py:539-647 creates a fragment-specific Draft 2020-12 schema requiring schema_version, design_status, reviewers, and records; it requires at least 1 reviewer and 1 record, then performs additional manual checks.fragment_ids to rows whose record_id is a string, checks duplicate fragment IDs, computes the expected subset in frozen document order, and rejects the fragment if len(fragment_ids) != len(fragment_rows) or IDs differ from that expected subset.document_ids and coding_ids without string filtering and calls _duplicates(coding_ids); it also constructs documents_by_id and coding_by_id using raw row["record_id"] keys.validate_against_schema() at src/institution_lab/governance_adjudication.py:650-656 uses Draft202012Validator(schema, format_checker=FormatChecker()), sorts errors by item.path, and renders them as schema <path>: <message>.render_markdown() at src/institution_lab/governance_adjudication.py:659-705 renders sections in this order: title OSS governance adjudication v1, canonicalization gate, Decisions, Final classes, Record decisions, Unresolved records, Frozen inputs, Reviewer provenance, and Graph-edge revisions.main() at src/institution_lab/governance_adjudication.py:708-753 requires --adjudication, --input-manifest, --documents, --coding-package, --artifact, --protocol, --coding-schema, --adjudication-schema, --summary-json, and --summary-markdown.verify_input_manifest(), computes schema_errors = validate_against_schema(...), and then unconditionally calls validate_adjudication(...) even if schema errors already exist. It combines both error lists, writes JSON and Markdown summaries, then raises ValueError("adjudication validation failed:\n" + ...) when errors exist.tests/test_governance_adjudication.py lines 17, 222, 352, 715, and 727, plus definitions/call at src/institution_lab/governance_adjudication.py lines 392, 539, and 736.