Dashboard › institutional-transition-lab › Distillation
1de4b012-c0e4-4476-98d3-d362a5e01585["lore_tm_v1_JKoYFztuVuzI_gY-j-D8HeXEMxU7iU7_QVR3c3yv_Rc","lore_tm_v1_iYSRHPnt3wYOsgARFK7V79fTmDc2PSj6y4moT4UfDFY","lore_tm_v1_rPf9ZXNTKzzKHjbQ5FkYHjBUD72_nzVmPD8eD_uYBlM","lore_tm_v1_IqFaMwJgAq6FgJ3Ooot6850epqVZb4-fq8ymrtmgRdQ","lore_tm_v1_j2YTFaBAbty3-kyOjSQSCjCT8zcS9fLwLVf0l0-S4WM","lore_tm_v1_DiEFAUA4XyXrJVRxB_Et4dYrjeU1BtYT3e4qxnUrbsM","lore_tm_v1_30tgPs5FIMHgxO4TzmAcGWP7AavsMx6OGKjKHFze8NI","lore_tm_v1_O9r0Fmkk88bQcIkX0-iBVBr4IpgT32j2zQKvFuBaPEM","lore_tm_v1_ubPHdHwP82l825bt_2cuuVBxQVadvv1OIBIt8QvpmLg","lore_tm_v1_H5vpUAZl-M2jBwrkB11jsd5K-ePmwfUoD94BvqjrsaQ","lore_tm_v1_tetGw4hHCG24wmOLakk1CNK_NIUQm6YEnc3kkozCZG0","lore_tm_v1__B52XNeIyXuFdHJar7ygAldaUCR-li-VFs7ECP4Vyfo","lore_tm_v1_bp4IQ6_YGJIKyymwKTSc1aI01OISnjln8VqjSP_aoNw","lore_tm_v1_qXTZWqlNI_W10ut1risDx4Ebl-fXafqIv5lxR2n7QVE","lore_tm_v1_lUzl5TdPALaFEdmXxIMUwipTbutn8lXXdSET4F8Hgy4","lore_tm_v1_G6UWXdnLPp-P_za-KuFd8ejadWHwQaqSFoXpN3-G5Uw","lore_tm_v1_gcy8rAugEMTat0dpatDk-hfjWDywqqdjJQOn74CPfEQ","lore_tm_v1_lCnrJAtm6YmS2KJ7Mu8-ucgswY-J3FnvEIWs8efbyeg","lore_tm_v1_3zLbzpqDM6me0FI9ggq4zKdqPnwk97BYxqdIjAFlXDo","lore_tm_v1_IV5cOaJEUlTHhOyast1dMQz01AiqTb1rZfKSSHDAf-s","lore_tm_v1_HhFC06If-p-U7nVRlAK2ZPFeovl5fTx7IyZBNwSeKpw","lore_tm_v1_8xH--Q_MzT2vOZfA0MRJE3u4JDxHeGj7QcGvrSlbfxs","lore_tm_v1_cOMRMqSrdcraJqK_nYtHzKH3cFfH5E6YhcNaMweYZI0","lore_tm_v1_Sx7t7BDvsPWre5WMiYhP2dJN0TgzVq44pMG-5gTwziw"]
Date: September 9, 2026
/home/byk/Code/institutional-transition-lab concerns actual decompressed-byte enforcement, is disjoint from declared-size arithmetic, and replaces a resource-accounting review that returned empty twice./home/byk/Code/institutional-transition-lab.src/institution_lab/governance_adjudication.py, narrow tests, and small read-only probes.file:line references, PASS/CONCERN/MUST-FIX/BLOCKED labels, substantive evidence rather than an empty response, and a final line of exactly MERGE or DO-NOT-MERGE.src/institution_lab/governance_adjudication.py: MAX_INPUT_BYTES = 16 * 1024 * 1024 at line 65, MAX_ARTIFACT_BYTES = 32 * 1024 * 1024 at line 66, MAX_ARCHIVE_MEMBER_BYTES = 16 * 1024 * 1024 at line 68, and MAX_ARCHIVE_EXPANDED_BYTES = 64 * 1024 * 1024 at line 69.src/institution_lab/governance_adjudication.py: archive opened via zipfile.ZipFile(io.BytesIO(artifact)) at line 180; declared aggregate check sum(info.file_size for info in infos) > MAX_ARCHIVE_EXPANDED_BYTES at lines 188-189; required-member iteration at lines 190-194; declared per-member check at lines 199-200; member stream opened at line 201; one-shot source.read(MAX_ARCHIVE_MEMBER_BYTES + 1) at line 202; returned-buffer length check at lines 203-204; content comparison at lines 205-206; zipfile.BadZipFile mapped to ValueError("artifact is not a valid ZIP archive") at lines 207-208.tests/test_governance_adjudication.py include ZIP construction at lines 65-67, 703-705, 743-745; duplicate-member handling around lines 883-892; excessive-member-count handling around lines 908-919; and test_committed_partial_fragment_validates_but_cannot_be_the_full_envelope() at line 979.ZipExtFile.read(n) was observed to loop through _read1(n) until the requested return amount or EOF, while _read1() can decompress input and then clip output with data = data[:self._left]; this means bytes produced internally by the decoder can exceed bytes returned to the caller.ZipExtFile._read2(n) was observed to cap each compressed-source request by _compress_left, call self._fileobj.read(n), decrement _compress_left by the partial amount actually read, and raise EOFError on an empty read.self._decomp.decompress(data) without a maximum-output argument, then expose only its EOF state; this supports the concern that a supplied compressed chunk may expand fully before ZipExtFile clips returned bytes.ModuleNotFoundError: No module named 'institution_lab'; later read-only probes ran successfully.more-than-declared encoded_expansion=16777217 declared=1 returned=1 next_read=0 peak_traced=47587880.fewer-than-declared encoded_expansion=1 declared=8 returned=1 next_read=0.partial-compressed-reads returned=32768 underlying_partial_reads=46.read-error OSError source_closed=True archive_closed=True.MUST-FIX finding: returned length does not bound actual decompression. Although MAX_ARCHIVE_MEMBER_BYTES and MAX_ARCHIVE_EXPANDED_BYTES are defined at src/institution_lab/governance_adjudication.py:68-69, the stream code only calls source.read(MAX_ARCHIVE_MEMBER_BYTES + 1) at lines 201-202, checks the returned buffer at lines 203-204, and maintains no actual aggregate decompressed-byte counter across the member loop at lines 194 and 201-204.ZipExtFile clipping returned data to the member’s declared size after its BZIP2 and LZMA paths may have decompressed an entire supplied compressed chunk. Consequently, len(member_bytes) measures returned bytes rather than actual decoder output.16777217 bytes—one byte beyond the 16 MiB member limit—while line 203 observed only one returned byte; peak traced memory was 47587880 bytes. The same behavior leaves aggregate actual decompression unbounded and permits compression-bomb CPU/memory exhaustion before either returned-length check runs.returned=1 next_read=0), so current stream handling does not explicitly reject underproduction relative to the declaration.monkeypatch; construct BZIP2 and LZMA streams whose expansion is member_limit + 1 but whose declared length matches a short valid prefix, and require rejection based on actual expansion. 2. Construct two streams individually below the member limit but collectively above a lowered aggregate limit, and require rejection while reading the second stream. 3. Construct a stream shorter than its declared length, and require an explicit stream-length error. 4. Keep fixtures small and compressible so the tests fail safely on the current implementation without substantial memory consumption.PASS for partial compressed reads: for the concrete ZipExtFile opened at src/institution_lab/governance_adjudication.py:201, the one-shot call at line 202 internally loops until the requested amount or EOF. A source limited to one byte per underlying read returned all 32768 bytes after 46 partial reads. Assistant noted this does not mitigate the decompressor-output bypass.PASS for ordinary read-error cleanup and fail-closed behavior: nested context managers at src/institution_lab/governance_adjudication.py:180 and line 201 closed both the archive and member source when reading raised OSError; the exception propagated rather than being swallowed. Compression-bomb process exhaustion remained part of the MUST-FIX finding.DO-NOT-MERGE.