Dashboard › institutional-transition-lab › Distillation
f8909ffc-b21a-43b6-99c1-db64d9d5ba96["lore_tm_v1_orjit0ZIpABm_2f2xDWn0ZUhdokiriAO_nBcLggxWu4","lore_tm_v1_gQzlCXeEwuqK4OqEOvru-xa_bLSaCuZNf8KSUx8_VdE","lore_tm_v1__2pPQupRdsUGCaAs_tCDWkr-KoNo7jWG2XazDmriCG0","lore_tm_v1_W7gc4deZjHZTZfp3Mx4gvc6MP210oT403h8731ZOinE","lore_tm_v1_L4jQ46yrSTBe9rrxKEPP878xzhu95M7gt2jVs56fKz8","lore_tm_v1_nUXd9xjID23H-h8NN5CTlnvnpCiwwoLhxEIvGRVhZjQ"]
/home/byk/Code/institutional-transition-lab/tests/test_governance_adjudication.py has 1,024 lines; imports copy, json, os, subprocess, sys, zipfile, Path, pytest, institution_lab.governance_adjudication, adjudication constants/functions, and governance-coding ontology constants. It defines ROOT = Path(__file__).parents[1] and MAX_TEST_ARCHIVE_MEMBERS = 256._write_pinned_cli_inputs() in tests/test_governance_adjudication.py creates adjudication.json, inputs.json, documents.json, coding-package.json, artifact.zip, protocol.md, coding-schema.json, adjudication-schema.json, summary.json, and summary.md; the ZIP contains documents.json and v1.2-adjudication-package.json. It builds a manifest with workflow_run_id = 33063470968, artifact_id = 9642983578, calculated file/canonical hashes, writes it, and monkeypatches governance_adjudication.FROZEN_INPUT_PINS._run_cli() constructs sys.argv for institution-lab-governance-adjudication with all ten CLI path flags and calls governance_adjudication.main()._stub_cli_validation() replaces validate_against_schema with no errors, replaces validate_adjudication with ([], {"canonicalization_gate": "open"}), and replaces render_markdown with "gate: open\n".test_adjudication_schema_matches_validator_ontology() checks the committed adjudication schemaβs decision, reviewer_type, role, record_class, event_kind, body_patch_relation, right_kind, direction, and change_status enums against the validator constants; event_kind is expected to equal EVENT_KINDS | {None}.test_schema_enforces_uri_and_date_formats() parametrizes ("source_url", "not a URI") and ("announced_on", "2024-02-30"), requiring path-qualified schema errors under records.0.source_url or records.0.final_coding.tests/test_governance_adjudication.py include malformed reviewer_ids failing closed, every adjudication input pin being reverified, and frozen identifiers workflow_run_id and artifact_id being reverified.test_frozen_pins_include_the_versioned_adjudication_schema() requires set(FROZEN_INPUT_PINS) == REQUIRED_INPUT_PINS and exact adjudication_schema_sha256 = "6181f5cb60a0462f83be00be301763daa89f11581e68ee1c46a84e8bf4e5be31".test_input_manifest_rejects_self_consistent_substitute() parametrizes every field in sorted FROZEN_INPUT_PINS, mutates the selected integer by + 1 or string to "f" * 64, and expects ValueError matching frozen issue #4 input: {field}.test_input_manifest_rejects_changed_file_bytes() mutates documents.json after constructing its manifest and expects verify_input_manifest() to raise a documents_file_sha256 mismatch.test_input_manifest_rejects_files_not_from_pinned_artifact() puts b"different documents" in ZIP member documents.json while the durable file contains "documents" and expects ValueError("artifact member mismatch: documents.json").test_cli_validates_the_same_bytes_it_verifies() defines forged_documents = {"documents": [{"record_id": "forged"}]}, swaps the durable documents before verification, and expects ValueError("input manifest mismatch: documents_file_sha256").test_cli_rejects_output_aliases_to_frozen_inputs() covers all eight inputsβadjudication, input_manifest, documents, coding_package, artifact, protocol, coding_schema, and adjudication_schemaβagainst alias kinds direct, symlink, and hardlink; it expects output path aliases an input and verifies input bytes remain unchanged.test_cli_rejects_aliased_outputs() points summary_markdown at summary_json and expects ValueError("output paths alias each other").test_cli_rejects_duplicate_manifest_keys() injects a forged duplicate artifact_sha256 key, prewrites an open-gate summary, expects ValueError("duplicate JSON key: artifact_sha256"), and then requires the published JSON summaryβs canonicalization_gate to be "closed".test_input_manifest_rejects_non_object() passes [] to verify_input_manifest() and expects ValueError("input manifest must be an object").test_input_manifest_rejects_duplicate_artifact_members() appends a second documents.json, updates and freezes the new artifact hash, and expects ValueError("artifact member is not unique: documents.json").test_input_manifest_rejects_excessive_artifact_member_count() appends exactly MAX_TEST_ARCHIVE_MEMBERS = 256 empty padding/{index} members and expects ValueError("artifact member count exceeds limit").test_regular_file_reader_rejects_fifo_without_blocking() creates input.fifo, calls _read_regular_file() in a subprocess with timeout=1, and requires a nonzero return code plus input path is not a regular file in stderr.test_canonical_sha256_rejects_non_finite_numbers() parametrizes float("nan"), float("inf"), and float("-inf"), expecting ValueError("Out of range float values").test_committed_frozen_input_manifest_verifies() verifies cases/review/oss-governance-adjudication-v1.inputs.json 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, requiring the result to equal FROZEN_INPUT_PINS.test_committed_partial_fragment_validates_but_cannot_be_the_full_envelope() requires cases/review/oss-governance-adjudication-v1/fragments/opentofu-a2.json to have no fragment-validation errors but to fail full-envelope schema validation.test_malformed_fragment_record_id_fails_closed() replaces the first fragment record_id with {"invalid": "record ID"} and requires errors mentioning both record_id and known subset.test_resolved_valid_records_open_the_gate() requires zero errors, decision_counts == {"accept": 1}, class_counts == {"no_event": 1}, no unresolved IDs, one record_decisions item for example-1 with reviewer opencode-gpt-5.6-sol-primary, one empty luna_a graph-edge revision, reviewer provenance equal to the input reviewers, and canonicalization_gate == "open".cases/review/oss-governance-adjudication-v1/artifact-9642983578.zip is 423,046 bytes, has no ZIP comment, has a 1,236-byte central directory at offset 421,788, and contains exactly 19 entries.documents.json β 445,940 bytes; 2. luna-a.json β 56,076; 3. luna-b.json β 52,967; 4. adjudication-package.json β 149,490; 5. preliminary-package.json β 107,543; 6. preliminary-summary.json β 707; 7. preliminary-summary.md β 543; 8. summary.json β 703; 9. summary.md β 542; 10. terra-route.json β 391,727; 11. terra.json β 43,744; 12. v1.2-adjudication-package.json β 156,038; 13. v1.2-preliminary-package.json β 109,772; 14. v1.2-preliminary-summary.json β 788; 15. v1.2-preliminary-summary.md β 618; 16. v1.2-summary.json β 784; 17. v1.2-summary.md β 617; 18. v1.2-terra-route.json β 425,012; 19. v1.2-terra.json β 50,036.100644; entries 2β19 each report an extra 16 bytes preceding the file. Entries 1β11 and 13β15 have DOS timestamp 2026 Aug 27 10:32:44, while entries 12 and 16β19 have timestamp 2026 Aug 27 10:41:50.ses_f7a6e48bbffebIiOoCUGjBlkvy was running; its scope was not to be polled, duplicated, or overlapped.5odv7xg3 was scheduled for 15 minutes.5odv7xg3 as the single pending continuation.