Dashboard › institutional-transition-lab › Distillation
51afd94c-35ec-4a97-95fc-56bd51b48e47["lore_tm_v1_YOH6pUGm6k2iN5s6-dabfcg_y8wGmrS9FV2ojSqva6s","lore_tm_v1_tEmIwTQjMSkIPHYHVqzKsJ77Uiek8sSUXZGjyyHtc7k","lore_tm_v1_aQg0mtRRQUzlo3nt1Bdmsaf-aDGL0IO-CPxVQQCPxkM","lore_tm_v1_TA1JMdjz3t1mmu3CJSro7xuUu1wWM3hc_VU8537_wCE","lore_tm_v1_ffF-Gm88LdpnzA19Q-qt_rnQj0Lx_D6a3XeUK9upbPE","lore_tm_v1_HK8QiHgZY_Bj3Gf0IUWLDfHJStSblpyBV6U7dW4MLKw","lore_tm_v1_iScuOMqBWCuCG98URUkhASEzZfnhOEIJTrC6EQTyvy4","lore_tm_v1_aJPTnvBNT0L3JXrd4BcPus6DLv2abdto5CMaWw_YqSs","lore_tm_v1_D71DWr6Z6zJgjre-QpXH-LZSnhDbsqG3MKdmsiiQ8qw","lore_tm_v1_Gh1NUQ19fXQs3BU4nAFoqvHHWOp1vPIpGAT2ozTGqgg","lore_tm_v1_Htel6UqgUxdy1cPauz1TUj4ZVR_ZGo4nP7Euf1E4Oos","lore_tm_v1_wWijf1dbOlHhCFt24a8RcCrnH6QUvMvhskgcJGHBph4","lore_tm_v1_Yva8cQuK1qdAtQCG6FqnYoAt1koO81jIc6iyHfVL4V8","lore_tm_v1_HQCLPJ5pY9sIRfJREJ1-nu3T9NsI5Mr-LIwaF81cVV0","lore_tm_v1_bWC89z1W-hXciZlk0xGDJLl9lbXAElWfdLWxQ4jy4_M","lore_tm_v1_KGpsZN6FdVzNJVCGhjELUVCt0zlKUkRfxQRBlM1BCUA","lore_tm_v1_HbojkPIGGbLTIIMR_pZgAET4--YZmQzqJ0-LcosEJrY","lore_tm_v1_1Vk4AtKtogdTvs9tLHpMJTZj_Y4Mvw1KlzJnM-ymlFQ","lore_tm_v1_WPtFbJKaiVg7FXexMwTVcv7XsouL5GR9YacAeGD5BWo","lore_tm_v1_x-xAnf8kzQ7QHsuerYJsr6rGH2aefIm9loHidurZuNU"]
🔴 (04:03) User directed: never edit files and never inspect governance record bodies, coding decisions, outcomes, reports, dates, detector output, or source-adjudication scopes.
🔴 (04:03) User defined the audit as read-only against the current working copy of /home/byk/Code/institutional-transition-lab.
🟡 (04:03) [requested-review] User requested a fresh, substantive security audit of only the filesystem/archive half of issue #4 frozen-input verification, replacing a reviewer that returned empty twice and remaining disjoint from the JSON/pin/snapshot reviewer.
🟡 (04:03) User limited review scope to: regular-file descriptor opening and nonblocking rejection of symlinks, FIFOs, devices, and other special files; input byte limits/read behavior; ZIP entry-count and total/per-member resource limits; duplicate required members; normalized/path/case/backslash collisions; absolute/parent paths; symlink/encryption metadata; decompression; exact required-member byte comparisons; and narrowly corresponding tests/probes.
🟡 (04:03) User excluded strict JSON parsing, frozen pin identity/order, canonical hash semantics, and CLI output writing because other reviewers own those areas.
🟡 (04:03) User identified primary files as src/institution_lab/governance_adjudication.py and only relevant portions of tests/test_governance_adjudication.py.
🟡 (04:03) User required findings first, severity ordering, exact current file:line references, and PASS/CONCERN/MUST-FIX/BLOCKED labels; every defect must include a deterministic regression.
🟡 (04:03) User required that a defect-free audit explicitly state PASS, identify tests/probes and residual risks, provide substantive evidence rather than an empty response, and end exactly with MERGE or DO-NOT-MERGE.
🟡 (04:05) Inspected src/institution_lab/governance_adjudication.py lines 65-69: 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.
🟡 (04:05) Inspected _read_regular_file() in src/institution_lab/governance_adjudication.py:94-109: opens with os.O_RDONLY | os.O_NONBLOCK | getattr(os, "O_NOFOLLOW", 0), converts os.open() errors to ValueError, validates the opened descriptor with os.fstat() and stat.S_ISREG(), prechecks metadata.st_size, then reads max_bytes + 1 and rejects payloads exceeding max_bytes.
🟡 (04:05) Inspected file_sha256() at src/institution_lab/governance_adjudication.py:112-113: hashes bytes returned by _read_regular_file(path, max_bytes=MAX_ARTIFACT_BYTES).
🟡 (04:05) Inspected archive verification at src/institution_lab/governance_adjudication.py:179-208: creates zipfile.ZipFile(io.BytesIO(artifact)); rejects more than MAX_ARCHIVE_MEMBERS; detects duplicate entries only by exact info.filename using Counter; checks declared aggregate info.file_size against MAX_ARCHIVE_EXPANDED_BYTES; locates required members documents.json and v1.2-adjudication-package.json; enforces MAX_ARCHIVE_MEMBER_BYTES on their declared and actually read sizes; compares their decompressed bytes exactly with durable bytes; and maps zipfile.BadZipFile to ValueError.
🟡 (04:05) Inspected verify_input_manifest() at src/institution_lab/governance_adjudication.py:220-239: reads artifact with MAX_ARTIFACT_BYTES and documents, coding_package, protocol, coding_schema, and adjudication_schema with the default MAX_INPUT_BYTES before passing bytes to _verify_input_payloads().
🟡 (04:05) Existing relevant tests inspected in tests/test_governance_adjudication.py include: changed durable file-byte rejection at lines 683-726; artifact-vs-durable documents.json mismatch rejection at lines 729-773; exact duplicate documents.json rejection at lines 883-905; excessive archive-member count rejection at lines 908-928; and FIFO rejection without blocking via a subprocess timeout=1 at lines 931-951.
🟡 (04:06) Inspected pyproject.toml: project requires Python >=3.12; dev dependencies are pytest>=8.3,<9 and ruff>=0.11,<1; pytest testpaths is ["tests"]; Ruff target-version is py312.
🟡 (04:06) Initial attempt to invoke python failed with /usr/bin/bash: line 1: python: command not found.
🟡 (04:07) System python3 reported Python 3.12.3 but could not import pytest: ModuleNotFoundError.
🟡 (04:07) Located project virtual environment executables under /home/byk/Code/institutional-transition-lab/.venv/bin, including python, python3, python3.13, pytest, py.test, and ruff.
🟡 (04:09) Captured current working-copy hashes: src/institution_lab/governance_adjudication.py SHA-256 c686c4878409e68b958dd61850a59e9234416d817fc2fa3246fc728d51ebe0a5; tests/test_governance_adjudication.py SHA-256 abf64b5e78a616d53b703dee5291ce7bf23fa9156fe59263a702e01cb8667bc5.
🟡 (04:10) Narrow pytest run under Linux with Python 3.13.11, pytest 8.4.2, pluggy 1.6.0, and anyio 4.14.2 collected 78 tests, deselected 74, selected 4, and passed all 4 in 0.25s.
🟡 (04:12) Archive probes found baseline accepted.
🟡 (04:12) Archive probe found an artifact containing unsafe and colliding names was accepted.
🟡 (04:12) Archive probe found a required member carrying symlink mode metadata was accepted.
🟡 (04:12) Archive probe found an oversized unrequired member was accepted.
🟡 (04:12) Archive probe found an encrypted unrequired member was accepted.
🟡 (04:12) _read_regular_file() probe accepted an exact 4-byte limit payload b'1234'.
🟡 (04:12) _read_regular_file() probe rejected an over-limit file with ValueError: input file exceeds 4 bytes: /tmp/tmp2emgh4uf/oversized.
🟡 (04:12) _read_regular_file() probe rejected a direct symlink with ValueError: cannot open input as a regular file: /tmp/tmp2emgh4uf/direct-link.
🟡 (04:12) _read_regular_file() probe rejected a directory, but surfaced raw IsADirectoryError: [Errno 21] Is a directory: 5.
🟡 (04:12) _read_regular_file() probe rejected a FIFO with ValueError: input path is not a regular file: /tmp/tmp2emgh4uf/fifo.
🟡 (04:12) _read_regular_file() probe rejected a Unix socket with ValueError: cannot open input as a regular file: /tmp/tmp2emgh4uf/socket.
🟡 (04:12) _read_regular_file() probe rejected character device /dev/null with ValueError: input path is not a regular file: /dev/null.
🟡 (04:12) _read_regular_file() probe accepted a regular file reached through a symlinked parent directory, returning b'ok'.