Codex r1 on #380: iter(source) only mapped TypeError, so an __iter__
raising OSError, csv.Error or StopIteration (directly or as a PEP 479
RuntimeError) still leaked. Apply the same narrow provider-error and
cause-checked RuntimeError mapping at initialization; normal exhaustion
in next() is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups from the #379 review:
- A StopIteration raised inside the live discovery generator (for
example from distribution.metadata["Name"]) became a RuntimeError under
PEP 479 and escaped the contract mapping. Only the converted form is
mapped; unrelated RuntimeErrors still surface.
- OSError and other provider errors raised while iterating a caller
supplied distribution source now map to ContractError.
- An OSError from os.close in _regular_file_digest no longer escapes the
finally block raw; a failed close never reports a digest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
installed_package_set_digest() normalized csv/Key/Type/Unicode errors from a
distribution's metadata, version and METADATA/RECORD reads, but an unreadable
metadata file (OSError, e.g. PermissionError) or a provider whose lookup
exhausts an iterator (StopIteration) escaped the contract instead of
surfacing as LMS_DEPENDENCY_DRIFT. Catch both.
Tests: a provider raising PermissionError/OSError from METADATA/RECORD reads
and StopIteration from .version and .metadata maps to ContractError.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r2:
- The exempt checkout egg-info path was fully resolved, so a symlink to
another checkout's or a user-site egg-info resolved to that install and
exempted it. Canonicalize only the checkout root and append
obliteratus.egg-info unresolved; a symlinked egg-info, or one resolving
outside the checkout, raises ContractError.
- A RECORD field over csv.field_size_limit made distribution.files raise
csv.Error outside the normalization. Catch it wherever RECORDs are
parsed, so it maps to LMS_DEPENDENCY_DRIFT.
Tests: a symlinked checkout egg-info pointing at an external install that
is also visible (and one pointing back inside the checkout); an oversized
RECORD field for obliteratus and a third-party distribution, directly and
through both GPU candidate tiers; the site-containment guard on its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r1: the exemption dropped any obliteratus.egg-info outside the
prefix sites, so a user-site, system-site or other-checkout install could
hide behind an approved digest. Exempt only the canonical
<checkout>/obliteratus.egg-info of the source tree this module runs from
(model_identity.py parents[2]); from an installed wheel that path is
inside a site dir and nothing is exempt. Every other visible obliteratus
distribution fails closed again.
A malformed RECORD made distribution.files raise ValueError outside the
normalization; it is now ContractError, so model_session reports
LMS_DEPENDENCY_DRIFT.
Tests: conflicting external egg-info (dir and file, before and after the
wheel on sys.path), symlinked checkout paths, prefix egg-info from a wheel,
malformed RECORD -> LMS_DEPENDENCY_DRIFT on both GPU candidate tiers, and
PEP 660 / .egg-link editable layouts failing closed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A non-editable install from a checkout leaves an untracked, gitignored
obliteratus.egg-info in the source root. The llama-tp gate and its TP
workers run with the checkout on sys.path, so importlib.metadata also
discovered that egg-info. installed_package_set_digest() enumerates every
visible distribution, so the stale build artifact broke the live package
identity (LMS_DEPENDENCY_DRIFT) before any hardware evidence was written.
model_identity now locates exactly one .dist-info for obliteratus under
the active prefix's purelib/platlib, requires its RECORD to own the
package that PathFinder finds there, and fails closed otherwise (no
wheel, egg-only, duplicate or disagreeing installs, ownership mismatch).
A setuptools source-tree obliteratus.egg-info outside the site dirs is
excluded from the inventory only after that wheel is found. All other
metadata/RECORD and duplicate checks are unchanged; a clean install keeps
the same digest.
run_conditional_gate.py refuses llama-tp-local-gpu up front (not_run,
exit 2, actionable message) when the checkout root holds an
obliteratus.egg-info, before any probe or GPU time; --allow-missing does
not bypass it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rank 0 evidence-directory creation now feeds a collective vote so a
mkdir failure fails every rank promptly instead of leaving the peer
blocked in a barrier. The public API fingerprint helper accepts only the
reviewed critical-module allowlist. Declare the TP runner labels for
actionlint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4caf45b04a8faa55f191b22c069f58714236689b)
Ported for #244 (part 1/6). Internal-only content from the archived
commit was dropped: .aiwg records, internal runner-policy routing, and the
internal security-docs test. Marked experimental in user docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>