#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:
- helios/src/core/cache.rs:2358
export_entry— right after cache.rs:2351if fs::symlink_metadata(destination).is_ok() { return Err("already exists") }. - helios/src/core/cache.rs:3125
commit_standalone— right after cache.rs:3118 the same symlink_metadata check. - helios/src/core/conversion.rs:245
unpack_selected— right after conversion.rs:289… actually before theif 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). - heliopause/src/export/core.rs:708
publish_payload— after the two existingpath.exists()checks at core.rs:686-700 (payload export destination already exists, checked twice already in that function). - heliopause/src/export/binding.rs:34
export_capture— before capture, for the!request.sourcespath;publish_payloadat binding.rs:64 does it again in the same call for the samerequest.path. - 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.
-
should fix —
heliopause/src/export/archive.rs:477-480vshelios/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 onlyEINVAL/ENOTSUP, the new preflight also acceptsENOSYS. One shared predicate (next torename_noreplace) deletes the duplicate and makes the blob path honour the same set. -
should fix — one
ignition exportof 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 atexport_capture; the Python bootstrap, theexport_preflight_directorypyfunction and its registration, and the whole 68-linetests/preparation/test_directory_preflight.pythen go away. The check added athelios/src/core/conversion.rs:245also duplicatesunpack_selected's ownoutput.exists()guard at :289 and theAlreadyExistsmapping at :324-327. -
should fix —
helios/src/core/cache.rs:3653-3665: the probe reinvents unique naming withring::SystemRandomand a retry loop, althoughtoken()(cache.rs:2991) is used by both neighbouring publication paths. ~12 lines and an untestable error arm deletable; the name needs no unpredictability. -
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 singleErrthrough an 8-line helper. One error test plus the existing destination/temporary assertions suffice. -
should fix —
binding.rs:97-118:capture_with_ownersis a 22-line generic helper extracted only to be testable, and its sole test (binding.rs:1046-1091) passesCell/AtomicBoolstubs, so helper and test only prove each other's control flow. The old inlineOwnerLeaseshape would be ~4 lines. -
nit — inside the preflight: the destination existence check duplicates every caller's identical check with a different message, the
Ok(())-replaced-target branch and itsUnsupportedarm are unreachable on any conforming filesystem, and the three-arm(result, cleanup)match reduces toresult.and(cleanup). Alsocommit_standalone(cache.rs:3117-3126) movessynchronize(&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:
- Charter, "How We Work": "Look for the smallest footprint in shared code, or a way to solve it without new code at all." → finding 3 (triple probe).
- AGENTS.md:170-175 "Reject unsupported abstractions and churn … Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement" → findings 2 (third probe path + pyfunction) and 5 (generic helper).
- AGENTS.md:176-181 "Require focused, meaningful validation. Tests must exercise the affected behavior or contract; source-text checks and mocks that bypass the behavior cannot establish runtime correctness." → findings 4 and 5.
- docs/design-review.md principle 15 (Reject scope expansion and weakened constraints) points back at the same AGENTS.md rejection criteria.
- docs/design-review.md principle 16 and AGENTS.md:67-135 (four-part PR description) — the description discloses only the heliopause blob fix + "focused helper harness passed 3 tests", but the diff also adds a Helios preflight, a Python pyfunction, an ignition bootstrap step and a new Python test file ("Not mentioned in the description: tests/preparation, ignition/preparation" per the orientation packet). That is an evidence/description gap worth one sentence in the report, though it belongs mainly to the prose lens; the simplicity consequence is that the PR is now two mechanisms (link fallback + directory preflight) where one was scoped.
Caveat to state honestly in the report:
- Finding 4's premise that chmod 0o555 is unenforced depends on the test running as root (true in the documented container build, docs/container.md, but not verified here). If the test suite runs as an unprivileged user, the 0o555 does exercise "publication must not unlink" — the finding then degrades to "two overlapping error tests should be merged". Stated either way, the test is redundant with the first test's assertion that the temporary still exists.
- No tests were run (no tool for it in this review); every claim above is from reading the code at head 06b9011. The renamed-error-type question in note 5 (
PyRuntimeErrornow raised for all export_capture errors, previously only for the drain path) is unverified against Python callers and would be settled by running tests/preparation/test_runtime_core.py. - I deliberately did not assess the fallback's atomicity, EEXIST semantics or concurrency (original-el8's review comment on the PR already covers those); that is another lens.
#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:
- archive.rs fallback helper
install_blob_after_rename_errorat 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.) - 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. - Probe call sites: SIX (plus one Python). binding.rs:33-36 (sources=False capture), binding.rs:120-124 pyfunction
export_preflight_directoryregistered 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_coreis called with path=None from ignition/cli/serve.py:330 (and host_ranks.export(None,...) from serve.py:229), so at model_core.py:27cache_only=Trueand :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.
- Dead in the product:
- 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
?. - 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).
- 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 toresult?; 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 beforesynchronize(&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:
- 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).
- 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).
- 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.
- 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. - 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.
- 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-linuxlet _ = 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). - 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
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:330passespath=None, socache_only),commit_standalonehas 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.archive.rs:304-306vscache.rs:4240— two disagreeing "no-replace unsupported" predicates (ENOSYSmissing from the blob path). One helper besiderename_noreplace(cache.rs:4263), matchingselene/src/disk.rs:1309.cache.rs:4206-4218—ring::SystemRandom+ retry loop wheretoken()(:3537) is already used by both neighbouring publications; 12 lines and an untestable error arm deletable.archive.rs:459-488,:513-533,:535-555— the 0o555 test proves nothing beyond:439when run as root, and two 20-line tests each only pass oneErrthrough a 4-line helper.binding.rs:97-118+:1474-1520—capture_with_ownersexists only to host a stub test of itself (Cell/AtomicBoolOwner, fabricated preflightErr); 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):
- should fix 1. Probe sprawl / dead and test-only call sites: model_core.py:41-42, binding.rs:120-124+128, cache.rs:3678, core.rs:640-642. Sub-point: cache-backed directory export probes twice (core.rs:641 then :934 -> cache.rs:2804); export_capture(sources=False) probes twice (binding.rs:35 then core.rs:641).
- should fix 2. Two disagreeing "no-replace unsupported" predicates: archive.rs:304-306 (EINVAL|ENOTSUP) vs cache.rs:4239-4240 (adds ENOSYS); precedent selene/src/disk.rs:1309. Fix: one helper beside rename_noreplace at cache.rs:4263.
- should fix 3. Probe reinvents unique naming: cache.rs:4206-4218 vs token() at cache.rs:3537 (already used at :2812 and :3686). Ring is already a helios dependency (Cargo.toml:43) and already used at cache.rs:38 — so state the cost as 12 lines plus an untestable error arm, NOT a new dependency edge.
- should fix 4. archive.rs tests: :459-488 (0o555 premise unenforced as root; adds only that remove_temporary works) and :513-533 + :535-555 (two 20-line tests through a 4-line helper). Keep :439-456 and :490-511.
- should fix 5. binding.rs:97-118 capture_with_owners + binding.rs:1474-1520 stub test; main's 14 inline lines were shorter.
- nit 6. Probe 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 with :4239; (result, cleanup) three-arm match :4250-4260 ->
result?; cfg-non-linuxlet _ = destination:4179-4183; conversion.rs:316 runs before verification (:318-323) and before the established "destination exists: {output}" error (:364-366), duplicating the AlreadyExists mapping at :436-442; missing SPDX header in tests/preparation/test_directory_preflight.py while all ~90 other files in tests/preparation/ have one. - nit 7. commit_standalone probes/checks before
synchronize(&self.directory)(cache.rs:3679) with no test or stated reason.
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:
- cache.rs:2991
fn token() -> String { format!("{}-{:x}", std::process::id(), TRANSACTION.fetch_add(1, Ordering::Relaxed)) } - cache.rs:2366
. {name}.flare-{token()}(export_entry), cache.rs:3133 (commit_standalone)
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:
- Keep the blob fallback as written (archive.rs:299-313) - it is 12 lines and matches the scope in the title.
- Keep exactly one probe per publication operation. The publication sites that already refuse a replacement are helios/src/core/cache.rs:2804 (export_entry, reached from core.rs:934 and heliopause/src/export/conversion.rs:351), helios/src/core/export.rs:742 (publish_staged_directory) and helios/src/core/conversion/edit.rs:250. Of these, export_entry and unpack_with (conversion.rs:316) are the two that build a tree first, so they need the fail-fast probe.
- Delete: ignition/preparation/model_core.py:41-42, heliopause/src/export/binding.rs:120-124 and its registration at :128 (plus tests/preparation/test_directory_preflight.py, whose first two tests only assert the call order of the deleted hook), cache.rs:3678 (commit_standalone has no production caller), and core.rs:640-642 (its cache-backed directory branch reaches cache.rs:2804 ~microseconds later, at the cost of doing the assembly first; the cache-only branch skips it and never publishes a user path).
- If the early abort before GPU capture is wanted, keep binding.rs:33-36 and delete the rest; either way one of {binding.rs:35, core.rs:641} is redundant with the probe the publication itself performs. Shared predicate: one helper beside rename_noreplace (cache.rs:4263), accepting EINVAL|ENOTSUP|ENOSYS, used by archive.rs:304 and cache.rs:4240 - removes the divergence where the blob install still aborts on ENOSYS while the probe calls it "unsupported". Rule citations: charter "How We Work" ("Look for the smallest footprint in shared code, or a way to solve it without new code at all"); AGENTS.md:188-193 (no new fallback layers/extension points without a concrete requirement; refactoring must support the requested behaviour); AGENTS.md:194-199 (tests must exercise the affected behaviour, mocks that bypass it cannot establish runtime correctness).
#15 [medium] Verification, citations and caveats for the final report
Verification notes for the report's honesty section:
- Read at head 41f1c76: pr_files (7 files), full diff of all 7, pr_comments (original-el8 + autobot review), and in context: helios/src/core/{cache.rs,conversion.rs,export.rs,conversion/edit.rs}, heliopause/src/export/{archive.rs,binding.rs,core.rs,conversion.rs,blob.rs}, ignition/preparation/{model_core.py,runtime_core.py,core_file.py,core_snapshot.py,host_ranks.py,rank_group.py}, ignition/cli/{serve.py,publishing.py}, tests/preparation/{test_directory_preflight.py,test_model_core.py,test_runtime_core.py}, Cargo.toml of helios and heliopause, AGENTS.md:180-207, charter, selene/src/disk.rs:1300-1312.
- Ran no Rust or Python tests; no tool available. All claims are from reading code. The one behavioural premise I could not execute is whether export_capture's new PyRuntimeError (binding.rs:93) breaks Python callers that previously received PyValueError for validation failures (binding.rs:24/29 unchanged for the early paths, so only post-detach failures changed type).
- Rule citations used: charter "How We Work" (smallest footprint / solve without new code; bug fixes address root cause); AGENTS.md:188-193 (reject unsupported abstractions: no new fallback layers/extension points without a concrete requirement; refactoring must support the requested behaviour); AGENTS.md:194-199 (focused, meaningful validation: mocks that bypass behaviour cannot establish runtime correctness; keep each PR focused on one coherent outcome); docs/design-review.md principle 15 (reject scope expansion) and principle 16 (prose).
- Prior run's #10 report remains accurate apart from the ring-dependency correction (entry 13) and the now-resolved "doesn't apply to main" blocker.
#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):
- cache.rs:3641-3650 re-checks
symlink_metadata(destination)and returnsAlreadyExists "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 thepublish_payloadreachability 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. - cache.rs:3686-3688:
error.kind() == io::ErrorKind::Unsupported || matches!(raw_os_error …). TheUnsupportedarm exists only for theOk(())branch at cache.rs:3674-3679 (rename silently replaced the target). If that self-check is kept it needs its own branch; otherwise the wholeUnsupportedarm and theOk(())-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. - cache.rs:3697-3707 the
(result, cleanup)match:(Ok(()), cleanup) => cleanupis justresult.and(cleanup); the three-arm match can be two lines. Similarlypreflight_directory_publication(cache.rs:3623-3631) needs the#[cfg(not(target_os = "linux"))] { let _ = destination; Ok(()) }shape only because the body isreturn-based;#[cfg]on a statement expression would be shorter. - 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.