Simplicity scratchpad · NVIDIA/hyperflare-inference #79

Raw Markdown for agents: https://autobot.eidonix.com/p/10ac8862-a05e-4bae-8729-a17f3529df52.md

#1 [high] should fix: EINVAL/ENOTSUP vs ENOSYS: two definitions of "no-replace unsupported"

archive.rs:477-480 (blob fallback) treats only EINVAL and ENOTSUP as "renameat2 unsupported": error.raw_os_error().is_some_and(|code| code == libc::EINVAL || code == libc::ENOTSUP). cache.rs:3685-3696 (new directory preflight) treats EINVAL, ENOTSUP and ENOSYS as unsupported (matches!(error.raw_os_error(), Some(libc::EINVAL | libc::ENOTSUP | libc::ENOSYS))).

Why it matters: the same filesystem property now has two independent definitions in the tree, and they disagree. On a host where renameat2 itself is unavailable (old kernel, or a seccomp profile that filters it, which is the very class of restriction issue #54 comes from — mergerfs returns EINVAL) the preflight reports "filesystem does not support atomic no-replace directory publication" while the blob install in the same export still returns a bare ENOSYS and aborts. Fix: one shared predicate, e.g. fn noreplace_unsupported(error: &io::Error) -> bool in helios core (next to rename_noreplace) used by both, and include ENOSYS in both. Smaller version of the diff: delete the duplicated == EINVAL || == ENOTSUP literal at archive.rs:479 and call the shared helper.

#3 [high] should fix: same preflight runs up to three times per export; python bootstrap + pyfunction deletable

Simplification: the preflight is now called from four places, three of them immediately after an existence check of the same destination, and one of those is inside a Python-level path that also probes.

Call sites added by the PR:

  1. helios/src/core/cache.rs:2358 export_entry — right after cache.rs:2351 if fs::symlink_metadata(destination).is_ok() { return Err("already exists") }.
  2. helios/src/core/cache.rs:3125 commit_standalone — right after cache.rs:3118 the same symlink_metadata check.
  3. helios/src/core/conversion.rs:245 unpack_selected — right after conversion.rs:289… actually before the if output.exists() check at conversion.rs:289-291; the preflight duplicates that check (cache.rs:3641-3650 does symlink_metadata again and returns its own "destination exists" error).
  4. heliopause/src/export/core.rs:708 publish_payload — after the two existing path.exists() checks at core.rs:686-700 (payload export destination already exists, checked twice already in that function).
  5. heliopause/src/export/binding.rs:34 export_capture — before capture, for the !request.sources path; publish_payload at binding.rs:64 does it again in the same call for the same request.path.
  6. ignition/preparation/model_core.py:41-42 export_preflight_directory — before capture; the export then reaches (5) and then (4).

So a single ignition export of a directory core runs the probe up to three times in sequence (Python preflight → export_capture → publish_payload), each one creating and removing a probe directory in the destination parent. That is the "parallel paths / redundant checks" pattern the contribution rules call out (AGENTS.md:170-175 "Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement"; and charter "Look for the smallest footprint in shared code, or a way to solve it without new code at all.").

Smaller version: keep the probe in exactly one place — the earliest point that the export reaches before capture. export_capture (binding.rs:34) already covers every non-sources capture, including the ignition path, because model_core.py always goes through export_model/RuntimeCore.write → export_capture. The Python bootstrap in model_core.py:41-42 and its 68-line test file (tests/preparation/test_directory_preflight.py) can then be deleted, as can the export_preflight_directory pyfunction and its registration (binding.rs:120-124, 128). For unpack_selected, the preflight also duplicates the output.exists() check at conversion.rs:289 and can be dropped, since rename_noreplace at conversion.rs:324 already returns AlreadyExists, mapped to destination exists at :325-327.

#8 [high] Research summary

Reviewed PR #79 through the simplicity lens (what can be deleted) against the charter, AGENTS.md and docs/design-review.md. Six findings recorded in the scratchpad; none are blocking, four should fix.

  1. should fix — heliopause/src/export/archive.rs:477-480 vs helios/src/core/cache.rs:3685-3696: the PR writes the "no-replace rename is unsupported" predicate twice and the two copies disagree — the blob fallback accepts only EINVAL/ENOTSUP, the new preflight also accepts ENOSYS. One shared predicate (next to rename_noreplace) deletes the duplicate and makes the blob path honour the same set.

  2. should fix — one ignition export of a directory core runs the probe three times: ignition/preparation/model_core.py:41-42 → heliopause/src/export/binding.rs:34 → heliopause/src/export/core.rs:708. Smallest footprint is one probe at export_capture; the Python bootstrap, the export_preflight_directory pyfunction and its registration, and the whole 68-line tests/preparation/test_directory_preflight.py then go away. The check added at helios/src/core/conversion.rs:245 also duplicates unpack_selected's own output.exists() guard at :289 and the AlreadyExists mapping at :324-327.

  3. should fix — helios/src/core/cache.rs:3653-3665: the probe reinvents unique naming with ring::SystemRandom and a retry loop, although token() (cache.rs:2991) is used by both neighbouring publication paths. ~12 lines and an untestable error arm deletable; the name needs no unpredictability.

  4. should fix — archive.rs:616-661: the 0o555 staging test does not prove its stated premise (as root, which the container builds use, the chmod is unenforced), and two other 20-line tests both only pass a single Err through an 8-line helper. One error test plus the existing destination/temporary assertions suffice.

  5. should fix — binding.rs:97-118: capture_with_owners is a 22-line generic helper extracted only to be testable, and its sole test (binding.rs:1046-1091) passes Cell/AtomicBool stubs, so helper and test only prove each other's control flow. The old inline OwnerLease shape would be ~4 lines.

  6. nit — inside the preflight: the destination existence check duplicates every caller's identical check with a different message, the Ok(())-replaced-target branch and its Unsupported arm are unreachable on any conforming filesystem, and the three-arm (result, cleanup) match reduces to result.and(cleanup). Also commit_standalone (cache.rs:3117-3126) moves synchronize(&self.directory) after the new checks with no test or stated reason.

I did not review rename-fallback atomicity/concurrency guarantees (that is the filesystem-correctness lens, where original-el8 has already commented), and I could not run the Rust tests.

#9 [high] Review scope, rule citations and caveats for the D-lens report

Scope of this review (lens D, simplicity): read all 7 changed files in context — heliopause/src/export/{archive,binding,core}.rs, helios/src/core/{cache,conversion}.rs, ignition/preparation/model_core.py, tests/preparation/test_directory_preflight.py — plus callers: heliopause/src/export/{blob,conversion,transfer}.rs, helios/src/core/export.rs:735-760, ignition/preparation/{core_file,core_snapshot,runtime_core,host_ranks}.py. Findings are in scratchpad entries 1-7.

Rule citations to use in the report:

Caveat to state honestly in the report:

#11 [high] head 41f1c76 re-verification: line numbers and strengthened findings

Re-read the diff at head 41f1c76 (merge of main). The PR's own hunks are unchanged; only line numbers moved. Verified locations:

  1. archive.rs fallback helper install_blob_after_rename_error at heliopause/src/export/archive.rs:299-313; predicate at :304-306 accepts only EINVAL|ENOTSUP. Called from install_blob :275-279. The preflight's predicate at helios/src/core/cache.rs:4240 accepts EINVAL|ENOTSUP|ENOSYS. Two encodings, divergent. (Prior finding #1 unchanged.)
  2. Probe (preflight_directory_publication): helios/src/core/cache.rs:4176-4184 (pub fn, non-Linux no-op), implementation :4187-4261. RNG+retry at :4206-4218 (ring::SystemRandom, hex loop); token() already exists at cache.rs:3537-3543 and is used by export_entry:2812 and commit_standalone:3686. NOTE CORRECTION: ring is already a dependency of helios (Cargo.toml:43, gated on runtime-core) and already used in cache.rs:38 (ring::digest), so the earlier "adds a dependency edge" wording must be dropped; the cost is the 12 lines + the untestable SystemRandom error arm only.
  3. Probe call sites: SIX (plus one Python). binding.rs:33-36 (sources=False capture), binding.rs:120-124 pyfunction export_preflight_directory registered at :128, core.rs:640-642 (publish_payload, non-cache_only directory), conversion.rs:316-317 (unpack_with), cache.rs:2804 (export_entry), cache.rs:3678 (commit_standalone). Python: ignition/preparation/model_core.py:41-42.
    • Dead in the product: export_core is called with path=None from ignition/cli/serve.py:330 (and host_ranks.export(None,...) from serve.py:229), so at model_core.py:27 cache_only=True and :41-42 never runs; only tests/preparation/test_model_core.py:68/82/136 pass a real path. => Python bootstrap + pyfunction (:120-124, :128) + the two Python-order tests exist only for tests.
    • Test-only: commit_standalone (cache.rs:3678) has no production caller (only cache.rs:5011/5017/5132).
    • Stacks: one cache-backed directory export probes the same destination twice inside publish_payload — core.rs:641, then (for !cache_only, form=="directory") core.rs:934 root.export_entry → cache.rs:2804. Whole payload assembly sits between them.
    • binding.rs:35 then core.rs:641 probes the same path twice in one export_capture call (capture_rank between them). probe tests: cache.rs:4518-4537 (cleans probe + existing destination), 4539-4567 (injected EINVAL/ENOTSUP/ENOSYS + EACCES), 4569-4587 (does not reserve destination). 3 tests for the probe, plus 3 in tests/preparation/test_directory_preflight.py.
  4. archive.rs tests: 439 (hard-link install), 459 (0o555 cleanup premise), 490 (does not replace), 513 (other errors preserved), 535 (hard-link errors). 5 tests for a 4-line helper. The 0o555 premise is unenforced as root; the test's only extra assertion over :439 is that remove_temporary still works afterwards. :513 and :535 both just pass one Err through ?.
  5. binding.rs:97-118 capture_with_owners + test at :1475-1519 (stub Owner/Cell/AtomicBool, stubbed preflight error); 22+45 lines for the 14 inline lines on main (removed lines in the diff).
  6. Nits: preflight repeats callers' destination check with a different message (cache.rs:4194-4203 vs cache.rs:2797-2803, 3671-3677, conversion.rs:364-366, core.rs:618-620/629-631); unreachable "no-replace rename replaced an existing directory" arm :4227-4232 + Unsupported arm :4239; (result, cleanup) three-arm match :4250-4260 reducible to result?; cleanup; #[cfg(not(target_os="linux"))] { let _ = destination; Ok(()) } :4179-4183 exists only because the Linux arm returns. conversion.rs:316 now sits before payload verification (:318-323) and before the established "destination exists: {output}" check (:364-366) and duplicates the AlreadyExists mapping at :436-442. Also: commit_standalone now runs preflight+existence check before synchronize(&self.directory) (cache.rs:3679), a reorder with no test/justification.

Merge resolved autobot's earlier "branch does not apply to main" blocker: unpack/unpack_selected are now thin wrappers (conversion.rs:295-302) and the probe lives inside unpack_with (:316).

#13 [high] Report 2026-11-27 run: consolidated findings at head 41f1c76

Head 41f1c76 report (run 567). Verdict unchanged from #10: should-fix only, no blocking.

Findings carried over, all re-verified with new line numbers:

  1. should fix — probe/mechanism sprawl: preflight_directory_publication has 6 Rust call sites (binding.rs:33-36, binding.rs:120-124 pyfunction registered :128, core.rs:640-642, conversion.rs:316-317, cache.rs:2804, cache.rs:3678) + 1 Python hook (model_core.py:41-42) + 3 Rust tests (cache.rs:4518-4587) + a 3-test Python file. Product paths: model_core.py:41-42 is dead in the product (serve.py:330 passes path=None => cache_only, so the branch never runs); cache.rs:3678 commit_standalone has no production caller; a cache-backed directory export probes twice (core.rs:641 then core.rs:934 export_entry -> cache.rs:2804) with the whole payload assembly in between; export_capture with sources=False probes twice (binding.rs:35 then core.rs:641).
  2. should fix — two disagreeing "no-replace unsupported" predicates: archive.rs:304-306 (EINVAL|ENOTSUP) vs cache.rs:4240 (EINVAL|ENOTSUP|ENOSYS); precedent selene/src/disk.rs:1309 (EOPNOTSUPP|ENOSYS). One helper beside rename_noreplace (cache.rs:4263).
  3. should fix — cache.rs:4206-4218 reinvents unique naming with ring::SystemRandom + retry loop while token() (cache.rs:3537) is used by export_entry:2812 and commit_standalone:3686. CORRECTION to prior wording: ring is already a helios dependency (Cargo.toml:43) and already used in cache.rs:38, so no new dependency edge — the cost is 12 lines + an untestable error arm.
  4. should fix — archive.rs tests: 439 (link install), 459 (0o555 premise; unenforced as root, adds only that remove_temporary works), 490 (no replace), 513 + 535 (two 20-line tests for one ? pass-through). Keep 439/490, merge 513+535; 459 adds nothing over 439 plus BlobStore::commit's own coverage.
  5. should fix — binding.rs:97-118 capture_with_owners (22 lines) + binding.rs:1474-1520 stub test (46 lines) replacing 14 inline lines; test uses Cell/AtomicBool/Owner stubs and a fabricated Err, never OwnerLease/capture_rank/drain_context.
  6. nit — preflight internals: duplicate destination check with a second message (cache.rs:4194-4203 vs 2797-2803/3671-3677/conversion.rs:364-366/core.rs:618-620+629-631); unreachable "replaced an existing directory" arm :4227-4232 and its Unsupported handling :4239; (result, cleanup) three-arm match :4250-4260 -> result?; cfg-non-linux let _ = destination :4179-4183. Plus conversion.rs:316 runs before payload verification (:318-323) and before the established "destination exists: {output}" error (:364-366), and duplicates the AlreadyExists mapping at :436-442. Plus executable-bit nit: tests/preparation/test_directory_preflight.py has no SPDX header while every other file in tests/preparation/ has one (verified: 90+ files, all present).
  7. nit — commit_standalone now probes/checks before synchronize(&self.directory) (cache.rs:3679), a reorder with no stated reason or test.

Prior blocker now resolved by the merge: autobot's "branch does not apply to main" is fixed — unpack/unpack_selected are thin wrappers (conversion.rs:295-302) and the probe sits inside unpack_with (:316). Still worth mentioning that the probe lands before verification.

Open question not resolved: export_capture now reports every error as PyRuntimeError (binding.rs:93) whereas the Python convention elsewhere is FileExistsError/ValueError (core_file.py:78, core_snapshot.py:62/75/86/98/118); would be settled by tests/preparation/test_runtime_core.py:44-77, which I read but which does not exercise the preflight.

#14 [high] Smaller versions (code sketches) for the report

Smaller versions to quote in the report (all verified at head 41f1c76):

A. Shared predicate (replaces archive.rs:304-306 and cache.rs:4239-4249):

pub(crate) fn noreplace_unsupported(error: &io::Error) -> bool {
    matches!(error.raw_os_error(), Some(libc::EINVAL | libc::ENOTSUP | libc::ENOSYS))
}

placed beside rename_noreplace (cache.rs:4263); archive.rs:304 becomes if noreplace_unsupported(&error).

B. Probe naming (replaces cache.rs:4206-4218, 13 lines -> 2):

let probe = parent.join(format!(".flare-rename-probe-{}", token())); // cache.rs:3537
fs::DirBuilder::new().mode(0o700).create(&probe)?;

token() is pid+counter (unique per process) and the probe is removed in the same call, so the EEXIST retry loop is unnecessary.

C. Drop commit_standalone's probe (cache.rs:3678): cache.rs:3675-3679 keeps its own existence check and rename_noreplace already refuses replacement; the function has no production caller (only cache.rs:5017/5132 tests).

D. Drop model_core.py:41-42 + binding.rs:120-124/128 (pyfunction + registration) + tests/preparation/test_directory_preflight.py: model_core.py:36 then goes straight to NativeExportStage; the destination is still probed inside the publication path (core.rs:641 / cache.rs:2804) with the same error surfaced through export_combine's PyValueError.

E. Inline owners again in binding.rs export_capture (replaces :33-118, ~86 lines -> ~20): let mut lease = OwnerLease(Some(owners)); before py.detach, then after the detach if drain.is_ok() { drop(lease.take_after_drain()); } ... i.e. main's original shape, which the diff deletes. Drops the 46-line stub test.

#16 [high] Research summary

Verdict: should-fix issues only (no blocking). Re-reviewed at head 41f1c76 (the upstream merge only moved line numbers; the PR's own hunks are unchanged). The blob fallback in archive.rs is small and correct; the deletable mass is the second mechanism the PR adds — a directory-publication preflight — written once and called from six Rust sites plus one Python hook, probing the same destination twice per export, reinventing a name generator, and covered by two stub tests and a chmod CI cannot enforce as root.

Should fix

  1. ignition/preparation/model_core.py:41-42, heliopause/src/export/binding.rs:120-124 (+registration :128), helios/src/core/cache.rs:3678, heliopause/src/export/core.rs:640-642 — the probe has 6 Rust call sites; the Python hook is dead in the product (serve.py:330 passes path=None, so cache_only), commit_standalone has no production caller, and a cache-backed directory export probes twice (core.rs:641, then :934 → cache.rs:2804) with the entire payload assembly between them. Keep one probe where the directory is published; the pyfunction and its 3-test Python file go with it.
  2. archive.rs:304-306 vs cache.rs:4240 — two disagreeing "no-replace unsupported" predicates (ENOSYS missing from the blob path). One helper beside rename_noreplace (cache.rs:4263), matching selene/src/disk.rs:1309.
  3. cache.rs:4206-4218 — ring::SystemRandom + retry loop where token() (:3537) is already used by both neighbouring publications; 12 lines and an untestable error arm deletable.
  4. archive.rs:459-488, :513-533, :535-555 — the 0o555 test proves nothing beyond :439 when run as root, and two 20-line tests each only pass one Err through a 4-line helper.
  5. binding.rs:97-118 + :1474-1520 — capture_with_owners exists only to host a stub test of itself (Cell/AtomicBool Owner, fabricated preflight Err); main's 14 inline lines were shorter and the 46-line test goes away with it.

Nits: duplicate destination check with a second message inside the probe (cache.rs:4194-4203); unreachable "rename replaced an existing directory" arm and its Unsupported handling (:4227-4232, :4239); three-arm (result, cleanup) match reducible to result? (:4250-4260); conversion.rs:316 runs before payload verification and before the established destination exists: error (:364-366), duplicating the AlreadyExists mapping at :436-442; missing SPDX header in tests/preparation/test_directory_preflight.py; commit_standalone's unexplained synchronize reorder (cache.rs:3679).

One prior blocker is now resolved: unpack/unpack_selected are thin wrappers (conversion.rs:295-302) and the probe sits inside unpack_with. No tests were run; full detail with line-numbered evidence, code sketches for each smaller version, rule citations and caveats is in scratchpad notes #13–#15 (and the previous full report at #10, with the ring-dependency wording corrected in #13).

#17 [high] Final report skeleton, verdict wording and finding order for PR #79

Final report framing for PR #79 (lens D, simplicity), head 41f1c76. Write the report from notes #13 (findings, corrected), #14 (code sketches), #15 (verification, citations, caveats), plus this skeleton.

Opening paragraph (use nearly verbatim): "Verdict: should-fix issues only (no blocking). The blob hard-link fallback in heliopause/src/export/archive.rs:299-313 is the right minimal fix for #54 and should be kept; the deletable mass is the second mechanism the PR adds — a directory-publication preflight — which is written once and called from six Rust sites plus one Python hook, probes the same destination twice per export, reinvents a name generator that already exists in the same module, and is covered by two stub tests and a chmod that CI running as root cannot enforce."

Order and severity of findings (severity first in each title, as required):

Closing paragraph: the prior "branch does not apply to main" blocker is resolved (unpack/unpack_selected are thin wrappers at conversion.rs:295-302; probe inside unpack_with at :316); no tests were run, so the one open behavioural question is whether export_capture's new PyRuntimeError (binding.rs:93) breaks Python callers that distinguished PyValueError; state that the fallback's atomicity/EEXIST/concurrency review is another lens's (original-el8 has commented) and was not assessed here.

Do not repeat autobot's non-simplicity blockers (preflight cannot run where #54 happens, undocumented filesystem requirement, description prose) except where they coincide with the deletable mass — the preflight's zero reach on the export path is finding 1's justification, one sentence.

#2 [medium] should fix: preflight probe uses ring RNG where token() already exists (12 lines deletable)

cache.rs:3638/3653-3665 (new preflight probe) draws a probe name from ring's SystemRandom with a random retry loop, while the same module already has a cheap unique-name helper used by both directory publications that sit right next to the probe:

Why it matters (simplicity lens): the probe name does not need to be unguessable — nothing security-relevant depends on it, it is created with create_new semantics (DirBuilder::create fails with EEXIST) and it lives in the same parent directory as the caller-named staging directory. Randomising it buys nothing over the existing pid+counter token, costs a ring::rand dependency edge and 12 lines of hex formatting, and adds an error path (could not generate publication probe name) that has no test and cannot practically occur. Fix: let probe = parent.join(format!(".flare-rename-probe-{}", token())); fs::DirBuilder::new().mode(0o700).create(&probe) and drop the loop/SystemRandom block. If the EEXIST retry matters for the token form, the surrounding TRANSACTION counter plus pid already makes collisions exclusive to a single process, so the retry can go too.

#4 [medium] should fix: archive.rs temporary-cleanup test relies on unenforced 0o555; two error tests overlap

archive.rs:616-661 test unsupported_noreplace_rename_leaves_temporary_cleanup_to_the_caller — this is the heaviest test in the PR (chmod 0o555 on the staging directory, restore, then assert the temporary still exists, then call remove_temporary). What it actually proves beyond unsupported_noreplace_rename_installs_blob_with_a_hard_link (archive.rs:612-633, which already asserts destination and temporary both exist and both read payload) is only that install_blob_after_rename_error does not call unlink — which is visible in the 4-line body, and which the 0o555 chmod does not test reliably: the test runs as root in most CI containers (the repository builds via containers, docs/container.md), where write permission on a directory is not enforced, so the chmod is a no-op and the test's stated premise ("unlinking also needs write permission... Publication must not unlink") is not exercised. That makes it a test that does not prove its behaviour, which AGENTS.md:176-181 rejects ("Tests must exercise the affected behavior or contract").

Also perf/lens: other_rename_errors_are_preserved_without_installing_the_blob (archive.rs:682-702) and unsupported_noreplace_rename_preserves_hard_link_errors (archive.rs:708-…) are both pure pass-through of a single Err, 20 lines each, for a 8-line function; one error-preservation test would carry both.

Fix: delete the 0o555 test (the caller's cleanup is already covered end-to-end by blob.rs:216-224 and by the first test's temporary-still-present assertion), and merge the two error-preservation tests into one.

#5 [medium] should fix: binding.rs capture_with_owners helper + its stub test test only themselves

binding.rs:97-118 — capture_with_owners is a new generic helper extracted from the old inline code, and capture at binding.rs:33-86 was converted from a closure passed to py.detach into a let capture = || { ... } closure ending in a bare result (note the leftover let result = ...; result at binding.rs:37/84-85 — the final result binding is now redundant; result was already the tail expression of the and_then chain, so lines 46-84 could end ... }) and drop the let result = name).

The helper exists only to be testable, and the only test (binding.rs:1046-1091, preflight_failure_drains_without_capturing_and_retains_owners_on_failed_drain) passes closures that are Cell/AtomicBool stubs — it does not exercise OwnerLease, capture_rank, drain_context, or any preflight. What the test proves is the control flow of capture_with_owners itself, i.e. the helper tests the helper. That is the "mocks that bypass the behavior cannot establish runtime correctness" case in AGENTS.md:176-181.

Also the preflight is placed inside capture, so its failure path runs the drain — meaning a preflight rejection still drains the CUDA context even though nothing was captured. That is a behaviour question for another lens, but from the simplicity lens it is worth noting that the old code shape (preflight in the closure) would have been 4 lines rather than a 22-line generic helper plus a 34-line test.

Smaller version: inline the preflight at binding.rs:33-36, keep the original let mut lease = OwnerLease(Some(owners)); / drop(lease.take_after_drain()) shape, and delete capture_with_owners plus its stub test (binding.rs:1046-1091). If the owner-retention-on-failed-drain invariant genuinely needs a test, it belongs against a real drain, not against closures.

Additionally: the extraction changes the error type for the drain failure from PyRuntimeError (raised at binding.rs:93 for every error now) — verify the Python callers that distinguished RuntimeError from ValueError still behave; test_runtime_core.py:76 tests export_capture errors.

#12 [medium] Probe placement in core.rs duplicates export_entry; consolidation proposal

Smallest defensible shape for the directory half of PR #79:

#15 [medium] Verification, citations and caveats for the final report

Verification notes for the report's honesty section:

#6 [low] nit: preflight duplicates callers' existence check and has two near-duplicate error arms

Nit-level redundancies inside the new preflight function (helios/src/core/cache.rs:3623-3708):

  1. cache.rs:3641-3650 re-checks symlink_metadata(destination) and returns AlreadyExists "destination exists" — but every one of its callers already performed the identical check immediately before the call: cache.rs:2351, cache.rs:3118, conversion.rs:289, heliopause/src/export/core.rs:686-700 (twice). The check is needed for the publish_payload reachability and for zero-cost safety, but note that callers' messages differ ("export destination {} already exists" vs "destination exists"), so two different errors now describe the same condition for the same caller — see the test at tests/preparation/test_directory_preflight.py:65 matching "destination exists" while cache.rs:2352 says "export destination ... already exists". Pick one message and delete it from the callers rather than duplicating it.
  2. cache.rs:3686-3688: error.kind() == io::ErrorKind::Unsupported || matches!(raw_os_error …). The Unsupported arm exists only for the Ok(()) branch at cache.rs:3674-3679 (rename silently replaced the target). If that self-check is kept it needs its own branch; otherwise the whole Unsupported arm and the Ok(())-replaced branch (5 lines, unreachable on any filesystem that honours RENAME_NOREPLACE) can go: a rename that succeeds is simply the success of the second probe at cache.rs:3682.
  3. cache.rs:3697-3707 the (result, cleanup) match: (Ok(()), cleanup) => cleanup is just result.and(cleanup); the three-arm match can be two lines. Similarly preflight_directory_publication (cache.rs:3623-3631) needs the #[cfg(not(target_os = "linux"))] { let _ = destination; Ok(()) } shape only because the body is return-based; #[cfg] on a statement expression would be shorter.
  4. Docs comment at cache.rs:3621-3622 is fine and short. archive.rs:482 // BlobStore::commit owns temporary cleanup after publication. is a useful cross-reference — keep.

#7 [low] nit: commit_standalone moves synchronize after the check for no stated reason

Nit: helios/src/core/cache.rs:3117-3126 commit_standalone — the PR moved synchronize(&self.directory) (previously the first statement, cache.rs old line 3117) to after the new existence check and preflight (new cache.rs:3126). Behaviour that changed: a destination that already exists no longer synchronises the staged tree first — harmless, arguably better. But the preflight is now performed on destination before synchronize(&self.directory), so the reordering's stated purpose is unclear from the diff and there is no test distinguishing the orders. If the reorder is not needed for the fallback, restoring the original first-line synchronize(&self.directory)?; keeps the diff at one added line. (cache.rs:3117-3151 in the head file.)

Also: commit_standalone and export_entry are near-duplicates (both: existence check, preflight, parent/name derivation, staging path from parent, rename_noreplace, cleanup, syncdir). Now that both carry the same 4-line preflight block, the pair is a natural single helper — but that is pre-existing duplication, not introduced here; mention as optional.