Dashboard › institutional-transition-lab › Session 11YuDps79BLE
11YuDps79BLEHtwTlRead only src/institution_lab/governance_adjudication.py and tests/test_governance_adjudication.py. Do not edit files. Design the smallest robust defensive ZIP validation implementation that addresses the completed audit findings: raw central-directory member identity; NUL and Unicode-extra-field ambiguity; unsafe/colliding paths; non-regular/special metadata; encryption and unsupported compression; malformed EOCD/central/local structure; declared-size underreporting; true decompressed-byte resource limits for stored/deflate/bzip2/lzma without trusting ZipExtFile clipping; truncated streams whose decoded payload/CRC still match; normalized decompressor exceptions. It must accept the current pinned 19-member artifact (Unix regular mode 100644, DEFLATE, data descriptors). Explain concrete helper signatures, parsing fields/offsets, safe codec strategy, limits, and focused fail-first tests. Tabs in proposed Python. Return concise implementation guidance only.
<path>/home/byk/Code/institutional-transition-lab/src/institution_lab/governance_adjudication.py</path>
<type>file</type>
<content>
1: from __future__ import annotations
2:
3: import argparse
4: import hashlib
5: import io
6: import json
7: import os
8: import stat
9: import tempfile
10: import zipfile
11: from collections import Counter
12: from contextlib import suppress
13: from dataclasses import dataclass
14: from pathlib import Path
15: from typing import Any
16:
17: from jsonschema import Draft202012Validator, FormatChecker
18:
19: from institution_lab.governance_coding import validate_response
20:
21: DECISIONS = {"accept", "revise", "reject", "abstain"}
22: INSTITUTIONAL_CLASSES = {
23: "effective_institutional_change",
24: "announced_institutional_change",
25: "proposal_only",
26: }
27: REVIEWER_TYPES = {"human", "llm", "human_llm_assisted"}
28: REVIEWER_ROLES = {"source_adjudicator", "evidence_auditor", "synthesizer"}
29: RESPONSE_SOURCES = {"luna_a", "luna_b", ...
Date: Sep 9, 2026 * 🔴 [requested-review] (09:48) User requested a read-only review limited to `src/institution_lab/governance_adjudication.py` and `tests/test_governance_adjudication.py`; explicitly instructed not to edit files. * 🟡 (09:48) User asked for the smallest robust defensive ZIP-validation design addressing completed audit findings: raw central-directory member identity; NUL and Unico…