Dashboard › institutional-transition-lab › Distillation
373e5736-da96-44db-a1a3-509f1a380fca["lore_tm_v1__9XB1VQlzGwxm6jfcuZMKLDldaxHlCH9hq_HoqBzaiM","lore_tm_v1_Da-X4kflfhCwuB7ajyAF43KvDd6iLqQDfWDCy8_ooFc","lore_tm_v1_mX3HjEZIvBIv8fpytIHOgOWOfNyEM9uWZDAPTAdFtd8","lore_tm_v1_DwTfVDEbGigMyxNUbpQUMV3et2PruC-ldUroagI4ZnQ","lore_tm_v1_mvrh4HujXbem1I_0eGjcXtQFItMV1RkB-aGuLEy7kkM","lore_tm_v1__5Gavjychdf0jdz0b8NTNvD7WDTQeZ9MH_9HLSwv3HA","lore_tm_v1_gWAnMcmQR0LGIsulYXUSReKCnCFrbWj_eCQoJA605IE","lore_tm_v1_PmnCxRcUxvk0qygyGS8DKi0JhUxJhffx-x2TtduEn3g","lore_tm_v1_8GCP0voeoA9axNatsbMD7Yld9mDhf_hVyBzZiQnn9qY"]
Date: Sep 9, 2026
b'abc' 3 9 True 0.1 44 43 1792 True False; cases 2 through 9 each raised BadZipFile: Bad CRC-32 for file 'x'.1792, CRC 0x4151b4ac, and hex strings 4bca2fcd4b494dd1cdcc2b494d2fca2ca9d42d02d2a9c5c599f97949a372a372a372a372a372c3540e00 and 4bca2fcd4b494dd1cdcc2b494d2fca2ca9d42d02d2a9c5c599f97949a372a372a372a372a372c3540e./home/byk/Code/institutional-transition-lab/src/institution_lab/governance_adjudication.py are MAX_INPUT_BYTES = 16 * 1024 * 1024, MAX_ARTIFACT_BYTES = 32 * 1024 * 1024, MAX_ARCHIVE_MEMBERS = 128, MAX_ARCHIVE_MEMBER_BYTES = 16 * 1024 * 1024, and MAX_ARCHIVE_EXPANDED_BYTES = 64 * 1024 * 1024._read_regular_file() in /home/byk/Code/institutional-transition-lab/src/institution_lab/governance_adjudication.py:94-109 opens with os.O_RDONLY | os.O_NONBLOCK | getattr(os, "O_NOFOLLOW", 0), converts open failures to ValueError("cannot open input as a regular file: ..."), uses os.fstat() plus stat.S_ISREG() to reject non-regular inputs, checks metadata.st_size against max_bytes, reads max_bytes + 1, and performs a second length check before returning bytes./home/byk/Code/institutional-transition-lab/src/institution_lab/governance_adjudication.py uses _reject_duplicate_keys() to raise ValueError("duplicate JSON key: {key}"), _reject_non_finite_number() to raise ValueError("non-finite JSON number: {value}"), and _parse_json_object() with object_pairs_hook and parse_constant; malformed JSON and non-object roots are rejected with label-specific errors._validate_manifest_identity() requires the manifest to be a dict with exactly REQUIRED_INPUT_PINS; workflow_run_id and artifact_id must have exact type int and be at least 1; every field must equal its value in FROZEN_INPUT_PINS, otherwise it raises input manifest does not identify frozen issue #4 input: {field}._verify_input_payloads() computes byte-level hashes for artifact_sha256, documents_file_sha256, coding_package_file_sha256, protocol_sha256, coding_schema_sha256, and adjudication_schema_sha256, comparing them in insertion order and raising input manifest mismatch: {field} on the first mismatch._verify_input_payloads() rejects more than 128 members, duplicate member names, total declared expanded size above 64 * 1024 * 1024, missing required members, and required members above 16 * 1024 * 1024; it reads each required member with a MAX_ARCHIVE_MEMBER_BYTES + 1 ceiling and byte-compares documents.json to durable documents and v1.2-adjudication-package.json to durable coding_package.zipfile.BadZipFile arising anywhere within the archive-verification block is translated to ValueError("artifact is not a valid ZIP archive").test_input_manifest_rejects_self_consistent_substitute() is parametrized over all sorted fields in FROZEN_INPUT_PINS; it mutates integer pins by +1 and string pins to "f" * 64, then expects the field-specific frozen issue #4 input rejection before any paths named Path("unused") are read.test_frozen_input_identifiers_are_reverified() separately mutates workflow_run_id and artifact_id in an adjudication, expects input pin mismatch: {field}, and verifies canonicalization_gate == "closed".test_input_manifest_rejects_changed_file_bytes() creates six inputs, builds an artifact containing documents.json and v1.2-adjudication-package.json, pins their hashes, then rewrites documents.json to "changed" and expects a documents_file_sha256 mismatch.test_input_manifest_rejects_files_not_from_pinned_artifact() places b"different documents" in the artifact while the durable file contains "documents" and expects artifact member mismatch: documents.json.test_cli_validates_the_same_bytes_it_verifies() probes a file-swap/TOCTOU scenario: durable documents.json is first replaced with {"documents": [{"record_id": "forged"}]}, a monkeypatched verify_input_manifest swaps it back to {"documents": []} immediately before verification, and the CLI is expected to fail with input manifest mismatch: documents_file_sha256.test_cli_rejects_output_aliases_to_frozen_inputs() checks all 8 inputsβadjudication, input_manifest, documents, coding_package, artifact, protocol, coding_schema, and adjudication_schemaβagainst 3 alias forms (direct, symlink, hardlink), expects output path aliases an input, and verifies the aliased input bytes remain unchanged.test_cli_rejects_aliased_outputs() points summary_markdown at the same path as summary_json and expects output paths alias each other.test_cli_rejects_duplicate_manifest_keys() injects a forged duplicate artifact_sha256 key, expects duplicate JSON key: artifact_sha256, and verifies an existing summary.json is changed from an open gate to canonicalization_gate == "closed".test_input_manifest_rejects_non_object() passes [] and expects input manifest must be an object without reading the six Path("unused") inputs.test_input_manifest_rejects_duplicate_artifact_members() appends a second documents.json, updates artifact_sha256 and FROZEN_INPUT_PINS, then expects artifact member is not unique: documents.json.test_input_manifest_rejects_excessive_artifact_member_count() appends exactly 256 empty members named padding/0 through padding/255 to the fixture archive and expects artifact member count exceeds limit.test_regular_file_reader_rejects_fifo_without_blocking() creates input.fifo, invokes _read_regular_file() in a subprocess with a 1-second timeout, and requires a nonzero return code plus input path is not a regular file in stderr.test_canonical_sha256_rejects_non_finite_numbers() is parametrized with float("nan"), float("inf"), and float("-inf"); each must raise ValueError matching Out of range float values.test_committed_frozen_input_manifest_verifies() verifies committed inputs from cases/review/oss-governance-adjudication-v1, including 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, and asserts the returned pins exactly equal FROZEN_INPUT_PINS.test_committed_partial_fragment_validates_but_cannot_be_the_full_envelope() loads cases/review/oss-governance-adjudication-v1/fragments/opentofu-a2.json; validate_adjudication_fragment(...) must return [], while validate_against_schema(fragment, schema) must return errors because the fragment is not a complete envelope.