PR #667: Harden Orbit payload integrity, multi-deployment TP seams, GB10 page-cache release, Unix flock drop, and multi-host peer exports

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/28ea8f79-5ce3-485b-a197-542488ead0a6

Opened by a workflow run, Dec 1, 2026 5:51 PM EST. decide malicious: all_clear (100%): No malicious content found

explore

Author: lukealonso (COLLABORATOR; charter-named priority contributor and de-facto owner of every area touched; Discord lukealonso) Motivation: Cached cores were being resolved by directory name and file length alone, so two different single-host checkpoints with identical filenames and sizes could silently serve stale weights, and multi-deployment (TP) payload cores broke four Orbit paths. Alongside that, page-cache residue was still collapsing GB10 unified-memory KV capacity (#630), Unix flock guards survived fork() because they never called LOCK_UN, and multi-host peers wrote huge unusable weight caches while --no-weights failed on cold peers. Scale: +1588 / −352 lines in 25 files Proposal:

Full report · Notes

Value Proposition

Value Proposition — PR #667

Charter alignment: yes, in scope. The charter explicitly lists "Support single-host and cross-node serving, with Orbit handling placement and supervising serving ranks," plus host-memory/peer cache sharing. #667 adds no model alias, per-model branch, new user-facing flag, hardware target, or dependency change; the non-goals (broad hardware coverage, cluster orchestration, disaggregation) are untouched. The author is a charter-named priority contributor and de-facto owner of every touched area (36 merged PRs/180 days, 0 closed), so it cannot be closed as "low value" (#229).

Novelty & status: genuinely additive — not obsolete, not superseded. Nothing in the dossier supersedes or reverses it; it continues #646 (Orbit rank-cache unification) and #650 (persistent spawn thread). #630 stays open — pfn confirmed on 2026-12-01 that #646 did not fix that path — and #667 addresses only ask 1 of three, so it must not be read as closing #630. Open #668 is a same-author textual conflict on host_ranks.py:685-689, not a canonical replacement; there is no competing PR.

Value vs maintenance cost. The best evidence covers defects 1, 2 and 4: the new tests are genuinely adversarial — two same-architecture cores with assert_eq!(files_a, files_b) colliding on model-<len>, VerifiedCore::open(..., None) asserted to really fail, try_clone()-inherited-descriptor flock tests — and CI passed on head. Defect 4's window was created hours earlier by the author's own #650. Weighing against: five unrelated fixes in one 25-file, +1588/−352 squashed commit (the objection #646's review already raised); four of five defects with no issue trail; a single-host payload cache rename that invalidates every existing entry, unmigrated per docs/orbit.md:518-520; zero doc updates despite changed peer/--no-weights semantics (docs/multi-host.md:306, :319); an integrity binding that is opt-out by omission (all-zero envelope_digest); and an unexplained removal of the intra-node check_space guard (controller.rs:2031). The GB10 KV benefit is explicitly unmeasured; the "40–100+ GiB orphan" figure is argued from tempdir lifetime, not observed.

Worth it with changes. Required before merge: measure or de-scope the #630 claim and leave #630 open; restore or justify the intra-node check_space guard; update docs/orbit.md and docs/multi-host.md; answer the TP1 open_tensor_parallel and --verify-weights questions; disclose the cache-migration and rolling-upgrade cost; rebase over #668/#394.

Verdict: Worth it with changes.

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Classify intake

Selected: triage:review, priority:P2, bug, performance, area:caching, area:orbit, area:preparation

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +priority:P2, +bug, +performance, +area:caching, +area:orbit, +area:preparation

Subtraction and simplicity

Subtraction/Simplicity/Conventions review of PR #667. The diff is mostly lean — flare::file_lock is real subtraction (−200 lines) and the page-cache call sites are one-liners — but six removable items remain.

  1. HIGH: --tensor-parallel now lives in both Grant.core.tensor_parallel and Grant.serving, forcing two independent strip/parse loops: cli.rs:1167-1177 emits it, controller.rs:1959-1988 + :697-707 dedupe it, agent.rs:2229-2252 strips it again. Delete the rank_options emission and both parsers; keep the two-line emit from grant.core.tensor_parallel.
  2. HIGH: three copies of the same flock-on-Drop guard — file_lock.rs:19-27 (shared in flare), cache.rs:4246-4259, conversion.rs:2692-2702. flare depends on flare_helios, so host the guard in eos (already extended by this PR) and have both wrap it.
  3. MEDIUM-HIGH: Verifier returns Result<Option<VerifiedCoreMeta>> but production never returns None (agent.rs:529); that Option alone keeps the fallback identity branch at agent.rs:901-919, the real_core flag and the if real_core gate at :950. Make it Result<VerifiedCoreMeta, Failure>; ~25 lines go.
  4. MEDIUM: verify_envelope_on_run (agent.rs:608-609, set at :775, cleared at :804, used at :2177-2194) is a test-only switch in the production struct duplicating agent.rs:520-526.
  5. MEDIUM: ignition/preparation/host_ranks.py:27 import contextlib is dead (only use removed by this PR); :685-690 also silently drops the old core_cache is None branch.
  6. LOW: controller.rs:1433-1434 re-implements Core::expected_envelope() (grant.rs:96-99, used at :1467); agent.rs:5279 let _ = primary_b;; distribution.rs:1132-1139 re-implements PayloadSource::unique_files.

Open: is serving's TP needed by any consumer that lacks grant.core.tensor_parallel? Is an unconditional peer cache intentional? No AGENTS.md (not opened) exists, so no convention violations.

Full report · Notes

Correctness and contracts

Correctness/contracts/system-level review of PR #667 (head 7908ac3). Seven verified findings, 4 Major-ish and 3 Minor; the core integrity work looks sound, but three defects are re-introduced or newly hidden.

Top findings:

  1. controller.rs:2031 — the whole HAVE/check_space/progress block is now guarded by if source.public_key != node.public_key, silently dropping the free-space admission check and byte estimate for every same-node transfer (that metric's span shrank from "all core transfers" to "cross-node only"); the description never mentions it.
  2. controller.rs:2448-2452 — the envelope-digest suffix is appended unconditionally, and with the fail-closed agent.rs:1586-1588 staging rule every pre-existing single-host payload cache entry becomes a HAVE miss (full re-transfer), while old <export>-<len> dirs are left unreachable (docs/orbit.md:518-520). The Compatibility claim covers cores/grants only.
  3. launch.rs:145-149 — core.identity().ok() re-introduces the exact .ok() swallow this PR deletes from publish_orbit_entry, so a --hosts launch of a multi-deployment core can still start rank 0 with no --tensor-parallel.
  4. grant.rs:86-98 + agent.rs:1548-1556 — an all-zero envelope_digest silently disables the entire integrity binding with no warning (charter "no magic defaults").
  5. agent.rs:2177-2194 — production Agent::new re-opens and re-verifies the sealed core per rank launch; with_fakes sets the flag false, so no shipped-path test covers it, and its rank>0 Some(rank)-on-complete-file branch is untested.
  6. distribution.rs:1130-1139 and agent.rs:2045-2047 — page-cache eviction is applied globally (all ranks, all hashes, all fetches) on an explicitly unmeasured hypothesis, working against the warm-restart re-hash cost of #93.
  7. host_ranks.py:685-689 + transfer.rs:881-886 — peers lose their warm rank cache and --no-weights still fails when the coordinator cache is cold; "zero orphan blobs" is unmeasured and no Python test covers remote_cache=True.

Open: whether open_tensor_parallel with Some(n) behaves identically to open for TP1; whether --verify-weights still fails on multi-deployment cores; whether the intra-node check_space removal was intentional.

Full report · Notes

Final review

Recommendation: Changes Requested

The core engineering across all five fixes in PR #667 is solid: Orbit envelope binding closes the single-host cache collision, multi-deployment Payload cores route cleanly through open_tensor_parallel and persist --tensor-parallel, Unix flock(LOCK_UN) drops are open-file-description-scoped with matching Windows LockFileEx parity, core_cache page-cache releases run after sync_all(), and peer export capture cleanly avoids orphan blobs. Several upstream candidate alarms proved false on verification (including the alleged intra-node check_space drop, the alleged verify_envelope_on_run test gap, and the suggestion to strip --tensor-parallel from rank_options). Before merging, please fix the remaining .ok() identity swallow in launch.rs, remove the dead contextlib import and add a small Python test for the remote_cache plumbing, update the now-stale peer-cache docs in docs/multi-host.md, and clarify the single-host cache-miss upgrade impact and unmeasured #630 status.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. Propagate core.identity() errors in --hosts grant construction instead of swallowing with .ok() (flare-cli/src/launch.rs:145-149).
    • controller.rs:2421-2423 properly propagates authorized.identity().map_err(|e| e.to_string())?, whereas Peers::start writes core.identity().ok().map(|id| id.tensor_parallel).filter(|&tp| tp > 0). If identity() fails on a --hosts launch where --tensor-parallel was inferred from args.hosts.len() + 1 (flare-cli/src/trust.rs:41-43) rather than passed explicitly, grant.core.tensor_parallel silently becomes None and peers receive no --tensor-parallel flag.
    • Fix: Propagate the error (let tp = core.identity().map_err(|e| e.to_string())?.tensor_parallel; tensor_parallel: (tp > 0).then_some(tp)).
  2. Update stale multi-host peer-cache documentation and disclose single-host cache invalidation (docs/multi-host.md:306,319, PR Compatibility note).
    • docs/multi-host.md:306 still states that the peer host "Prepares and retains its rank's payload blobs locally", and :319 still states "--no-weights requires matching cached payloads" without distinguishing coordinator cache vs. peers. Both are now inaccurate after host_ranks.py:685-698 and transfer.rs:880-886.
    • Additionally, because single-host describe() now unconditionally suffixes {stem} with -{hex(&envelope_digest[..8])} (controller.rs:2448-2452) and have() rejects unverified staging hits when bound (agent.rs:1584-1588), every existing single-host Payload cache entry (orbit:model-<len>) becomes a one-time miss/re-transfer on upgrade and leaves the old managed entry for flare models remove/gc. Document this in the PR's Compatibility section (and note it in docs/orbit.md if appropriate).
  3. Remove dead import contextlib and add a Python unit test for remote_cache plumbing (ignition/preparation/host_ranks.py:27, ignition/preparation/core_snapshot.py:26, ignition/preparation/runtime_core.py:331).
    • import contextlib at host_ranks.py:27 is now completely unused after removing contextlib.nullcontext().
    • None of the Python tests assert that export_options(..., remote_cache=True) propagates through runtime_core._cache_options or that serve_peer captures into native_stage.path / "peer-cache". Delete line 27 and add a focused CPU test in tests/preparation/ covering export_options(..., remote_cache=True) -> _cache_options(...)["remote_cache"] is True.
  4. Keep #630 explicitly open and note the discrete-GPU page-cache trade-off (flare-cli/src/distribution.rs:627,1136,1218, flare-cli/src/core_cache.rs:455,560, flare-cli/src/orbit/agent.rs:2046, helios/src/runtime_core/protection.rs:1706,2386).
    • Unlike helios/src/runtime_core/model.rs:807-809 (which gates post-load_payload eviction on rank.integrated), the new page-cache releases across hashing, transfers, and verification run unconditionally on all Linux hosts, including discrete-GPU workstations with abundant host RAM where evicting pages can make subsequent warm re-hashes/restarts (#93) colder. Because the GB10 KV benefit for #630 is unmeasured on hardware (per docs/design-review.md Principle 12) and asks 2–3 of #630 are untouched, either gate non-integrated paths if warm re-reads matter or explicitly document the trade-off and ensure #630 stays open until measured on GB10.

Subtract / Simplify

  1. Collapse Verifier's Option<VerifiedCoreMeta> into VerifiedCoreMeta (flare-cli/src/orbit/agent.rs:449-459, :513-535, :887-958).
    • Production verify_core always returns Ok(Some(VerifiedCoreMeta { ... })); only the test fake at agent.rs:2916-2927 returns Ok(None). Changing Verifier to return Result<VerifiedCoreMeta, Failure> (and having test fakes return a synthetic VerifiedCoreMeta) lets you delete the fallback else branch (agent.rs:901-919) and the real_core boolean gate (:950).
  2. Consolidate the three Unix flock(LOCK_UN) Drop guards into eos (flare/src/file_lock.rs:19-27, helios/src/core/cache.rs:4246-4259, helios/src/core/conversion.rs:2692-2702).
    • eos already depends on libc and windows-sys (eos/Cargo.toml:13-17) and is already depended on by helios (helios/Cargo.toml:34) and transitively flare. Hosting the RAII FileLock (or unlock-on-drop guard) in eos gives all three crates one implementation of the fork()/O_CLOEXEC unlock invariant (and also lets flare/src/windows.rs:102-142 lock/try_lock — now unused in-repo — be retired if not part of external API).
  3. Reuse grant.core.expected_envelope() instead of re-implementing the zero check (flare-cli/src/orbit/controller.rs:1433-1434, :1467).
    • grant is already constructed at controller.rs:1363-1379, so let expected_envelope = grant.core.expected_envelope(); from line 1467 can simply be hoisted above line 1420 and reused at line 1437.

Nits

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (85%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.