Commit Graph
9 Commits
Author SHA1 Message Date
Joseph MaglyandClaude Opus 5.5 d242b3f725 Map iterator-initialization failures to ContractError
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>
2026-10-23 07:41:04 -04:00
Joseph MaglyandClaude Opus 5.5 83946b36dc Map source-iterator and descriptor-close failures to ContractError
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>
2026-10-23 07:36:14 -04:00
Joseph MaglyandClaude Opus 5.5 03da4985f9 Map OSError and StopIteration from distribution metadata to ContractError
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>
2026-10-22 22:35:36 -04:00
Joseph MaglyandClaude Opus 5.5 fa4aa5a905 Refuse a symlinked checkout egg-info; normalize csv.Error from RECORD
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>
2026-10-22 21:48:53 -04:00
Joseph MaglyandClaude Opus 5.5 6886d5596a Exempt only this checkout's egg-info; normalize malformed RECORD
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>
2026-10-22 21:37:55 -04:00
Joseph MaglyandClaude Opus 5.5 9129e765d1 Bind the package digest to the installed wheel, not source-tree egg-info
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>
2026-10-22 21:22:41 -04:00
Joseph MaglyandClaude Opus 5.5 bdd7abaeba test(distributed): cover model admission, manifest, evidence, session and identity contracts (#304)
Single-process CPU tests (no Gloo/NCCL/CUDA) for the distributed
model-loading boundary: Llama config admission, runtime/capability
binding, safetensors metadata admission against a tiny immutable BF16
checkpoint, bounded load deadline, caller mesh validation, loader
result handling, post-load hook/replica/manifest validation, closed
evidence records and private sinks, session ownership primitives,
binding derivation, consensus record parsing, error translation, and
supply-chain identity digests.

Release-lane missing lines: model.py 175->1, model_session.py 86->0,
model_evidence.py 75->2, model_manifest.py 60->2, model_identity.py 28->0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:03:03 -04:00
Joseph MaglyandClaude Opus 5.5 52c906b4a3 fix(distributed): fail evidence setup symmetrically and close API allowlist
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>
2026-10-07 11:57:56 -04:00
Joseph MaglyandClaude Opus 5.5 8066e59c73 feat(distributed): add exact Llama native TP loader
(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>
2026-10-07 11:23:27 -04:00