#1 [high] PR #79 overview and governing rules
PR #79 "fix(heliopause): fall back when no-replace rename is unsupported", head 06b9011, base main. 7 files, +468/-22: heliopause/src/export/{archive.rs,binding.rs,core.rs}, helios/src/core/{cache.rs,conversion.rs}, ignition/preparation/model_core.py, tests/preparation/test_directory_preflight.py (new). Label bug, area:caching, area:packaging. Review state: changes requested by yatesdr; earlier comment by original-el8 said the blob fallback alone does not fix #54 because the directory export reaches a second no-replace rename (helios/src/package/cache.rs:2377/3559/3145, package/export.rs:743, package/conversion.rs:312 — those paths do not exist at this head; the equivalent code now lives in helios/src/core/cache.rs and helios/src/core/conversion.rs). This head answers that with a directory preflight.
Charter/AGENTS rules that bear on it: "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)" (charter, How We Work, bring real evidence); AGENTS.md "Reject weakened guarantees … Do not remove validation, suppress errors, silently substitute execution paths"; AGENTS.md requires validation that exercises the affected behavior, not mocks; design-review principle 6 (explicit lifetimes) and 12 (validate the real path and report evidence honestly); docs/design-review.md principle 16 (PR description order).
Charter/AGENTS: no rule about fallback layers — "Reject unsupported abstractions and churn … Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement" (AGENTS.md contribution criteria). A fallback for a demonstrated defect (issue #54) has a concrete requirement, so the fallback itself is in scope.
#3 [high] Blocking?: preflight cannot run on the export path #54 hits; still-dead call sites
Head 41f1c76. ignition export always calls export_core(prepared, recorder, storage, None, ...) (ignition/cli/serve.py:330) and prepared.export(None, ...) for multi-host (serve.py:229) → path=None → cache_only=True.
Consequences at head:
- ignition/preparation/model_core.py:41-42 (
not cache_only and form=='directory') never fires. - heliopause/src/export/binding.rs:34-36 (
!request.sources and !path.empty) never fires on the export path: every Python rank capture passessources=True(model_core.py:51-52, rank_group.py:111, host_ranks.py:471, host_ranks.py:687). - heliopause/src/export/core.rs:640-642 (
!cache_only) never fires on that path. - helios/src/core/cache.rs:3678 (
Staging::commit_standalone) has no production caller — only tests cache.rs:5011/5017/5132; production cache-only publication isStaging::commit(cache.rs:3644, plainfs::rename). Reached in production: cache.rs:2804Root::export_entry(via heliopause/src/export/core.rs:921/934 and heliopause/src/export/conversion.rs:351) and conversion.rs:316unpack_with. Uncovered: helios/src/core/conversion/edit.rs:250 (edit, reachable from heliopause/src/export/conversion.rs:206 viaignition edit), and helios/src/core/export.rs:742publish_staged_directory(reached from core.rs:1014 only whenpathnon-empty and no cache – no Python caller found). So the PR's own claim that directory publication is preflighted does not hold for the paths production uses, and the five added call sites are mostly unreachable.
#4 [high] Should fix: edit.rs:250 still an uncovered no-replace rename
helios/src/core/conversion/edit.rs:195-252: edit builds staging, syncs it (249) then calls crate::core::cache::rename_noreplace(&staging, request.output) at :250-251 with no preflight_directory_publication and no hard-link fallback. Its only exists-check is the early if request.output.exists() at :27-32 (checked before the costly file copy). Reachable from ignition edit → heliopause/src/export/conversion.rs:191-217 → conversion::edit. On a mergerfs destination this still ends with publish edited core: Invalid argument (os error 22) after copying every companion, exactly the #54 symptom. This is the one remaining reachable instance the PR was meant to close.
#5 [high] Should fix: test_directory_preflight.py:43-52 cannot fail on its subject
tests/preparation/test_directory_preflight.py:43-52: test_cache_only_and_packed_exports_do_not_probe_directory_publication calls model_core.export_core(None, None, None, destination, options={}, publisher=object(), form=form) with no export_options(...) context, so core_snapshot._OPTIONS.get() is None and model_core.py:31-33 raises RuntimeError("export requires the configured core cache") before line 41. The test's pytest.raises(RuntimeError, match="configured core cache") therefore matches that early error: the unexpected probe at :45-46 can never run, and the test passes whether or not model_core.py:41-42 guards. It cannot detect the regression it names. Fix: enter export_options(tmp_path/'cache') as the first test does (test at :11-40 does this and is the one that actually exercises line 41-42), and let only the guard decide. Also note the first test fakes flare_heliopause/torch (:28-31), so it asserts call order only.
#6 [high] Should fix: conversion.rs:316-317 preflight precedes verification and destination check
helios/src/core/conversion.rs:316-317 places preflight_directory_publication(output) in unpack_with right after the directory-form check (:313-315) and before payloads.verify() via verify_stored_data (called :323) and before the established check if output.exists() { "destination exists: {path}" } at :364-366.
Two behaviour changes on error paths:
(a) unpacking onto an existing output now fails with directory export preflight: destination exists (message from cache.rs:4196-4199) instead of destination exists: <path> at :365; helios/src/core/conversion.rs:4254/4263 tests assert only contains("destination exists"), so they still pass, but the message users see changed and is now produced twice for one condition.
(b) preflight_directory_publication calls fs::create_dir_all(parent) (cache.rs:4205) although the doc comment at cache.rs:4174-4175 says "this probe reserves nothing"; so a corrupt or unreadable source core now creates the output parent directory before it is rejected, while the failure path at conversion.rs:447-449 only removes staging. Also note the check at :216-218 in pack has the same ordering: preflight-free, but output.exists() there precedes work.
Fix: run the probe after verify_stored_data, and put the output.exists() check before the probe (or make the probe tolerate a missing parent with NotFound).
#9 [high] Research summary
Reviewed PR #79 at head 41f1c76 through the correctness lens: all 7 changed files read in surrounding code, every caller traced (ignition export → model_core/host_ranks/rank_group → heliopause capture/publish → helios cache/conversion/export), findings verified in the code and recorded in scratchpad entries #3-#8 (the full report is #2 plus these).
Verdict: the blob hard-link fallback is correct and complete; the new directory-publication preflight is not. Four should-fix findings:
- The preflight largely cannot run on the path issue #54 hits, while the one reachable publisher it left aside (core
edit) is still unguarded:ignition exportpassespath=None, somodel_core.py:41-42,binding.rs:34-36andcore.rs:640-642never fire andcache.rs:3678(commit_standalone) has no production caller;conversion/edit.rs:250still fails bare withEINVALon mergerfs after copying every companion. tests/preparation/test_directory_preflight.py:43-52passes for the wrong reason: withoutexport_options,model_core.py:31-33raises first and the test matches that message.helios/src/core/conversion.rs:316-317runs the probe beforeverify_stored_dataand before the establisheddestination exists: <path>check, so the user-visible error for an existing destination changed, and the probe'screate_dir_all(parent)creates the output parent before a bad source is rejected.- Two errno policies for one syscall (EINVAL|ENOTSUP in archive.rs vs +ENOSYS in cache.rs), against the repo precedent in selene/src/disk.rs.
Also verified correct: atomic hard-link semantics, EEXIST preservation, same-directory EXDEV safety, blob.rs caller cleanup, and the capture_with_owners/OwnerLease guarantee. No live mergerfs reproduction exists, so the EINVAL mapping rests on injected-errno tests.
#10 [high] Verdict for head 41f1c76 (current run): should-fix issues only
Review of PR #79 "fix(heliopause): fall back when no-replace rename is unsupported", head 41f1c76 (merge of main), base main, 7 files +468/−22. Lens: correctness (callers, platforms, error paths, state, resources). Governing rules cited: charter "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)" and the four-part PR description rule; AGENTS.md "Reject weakened guarantees … validation must exercise the affected behavior, not mocks"; docs/design-review.md principle 12 (validate the real path, report evidence honestly) and 16 (description order). Issue #54 is the concrete requirement, so the fallback itself is in scope of the "no fallback layers" rule.
VERDICT: should-fix issues only. No blockers.
BLOCKING: none.
SHOULD FIX (each verified in code; details in notes #3-#6):
- helios/src/core/conversion/edit.rs:250 —
editpublishes with a barerename_noreplace, no preflight, no fallback; reachable fromignition edit(heliopause/src/export/conversion.rs:191-217). Still fails on mergerfs exactly as #54 after copying every companion; the message ispublish edited core: Invalid argument (os error 22)at edit.rs:250-251. - ignition/preparation/model_core.py:41-42 + heliopause/src/export/binding.rs:34-36 + heliopause/src/export/core.rs:640-642 + helios/src/core/cache.rs:3678 — the added probes are unreachable from
ignition export, which passespath=None(ignition/cli/serve.py:330 and :229), andcommit_standalonehas no production caller (tests only: cache.rs:5011/5017/5132). Reached in production: cache.rs:2804 (Root::export_entry, from export/core.rs:921/934 and export/conversion.rs:351) and conversion.rs:316 (unpack_with). Uncovered: export.rs:742publish_staged_directory— reached only from export/core.rs:1014 whenpathis non-empty and no cache is configured, which no Python caller produces. - tests/preparation/test_directory_preflight.py:43-52 — test cannot fail on its subject (no
export_optionscontext → model_core.py:31-33 raises "configured core cache" first, which is what the test matches). - helios/src/core/conversion.rs:316-317 — probe runs before
verify_stored_data(:323) and before thedestination exists: {output}check (:364-366), so an existing output now reportsdirectory export preflight: destination exists(cache.rs:4196-4199) instead ofdestination exists: <path>, andfs::create_dir_all(parent)(cache.rs:4205) creates the output parent before a corrupt source is rejected, despite the "reserves nothing" doc comment (cache.rs:4174-4175). - Two errno policies for one syscall: archive.rs:304-307 accepts EINVAL|ENOTSUP; cache.rs:4238-4249 also accepts ENOSYS; repo precedent selene/src/disk.rs:1308-1311 (EOPNOTSUPP|ENOSYS). One predicate beside
rename_noreplace(cache.rs:4265) should serve both.
NITS (see note #7): ring SystemRandom + unbounded retry loop for the probe name (cache.rs:4206-4218) instead of token() (cache.rs:3537); probe tree can be orphaned on kill; preflight_directory_publication returning Ok on non-Linux (cache.rs:4179-4183) is indistinguishable from success at call sites; the pyfunction wraps failures as PyRuntimeError (binding.rs:121-124) where core_snapshot.py:61-62/74-75 uses FileExistsError; #[cfg(any(target_os="linux", test))] on the new helper (archive.rs:298); docs/multi-host.md:314-315 still documents only the same-filesystem requirement (no no-replace rename requirement, no docs/TODO entry for the unrun mergerfs reproduction); PR description omits tests/preparation + ignition/preparation and claims "Fixes #54".
VERIFIED CORRECT (note #7): the blob fallback (archive.rs:298-313) links only on the two unsupported errnos, preserves other errnos, is atomic and EEXIST-preserving, and same-directory (blob.rs:177-178) so no EXDEV; the caller (blob.rs:194-224) maps AlreadyExists to reuse, owns temporary cleanup and tolerates NotFound, so not unlinking is right; capture_with_owners (binding.rs:97-118) keeps OwnerLease until a confirmed drain and lifetime.rs:14-21 still forgets an unconfirmed lease.
SUPERSEDES entry #2 (report of 2026-11-25 at head 06b9011):
- Finding "edit.rs:249-252 uncovered" still stands (now #1).
- The Python-test finding still stands, with the corrected line range :43-52 (entry #2 said :53-63).
- conversion.rs placement finding stands, with the corrected line numbers :316-317 / :364-366 and the added
create_dir_alldetail. - Entry #2's open question about
conversion::combine: SETTLED — combine publishes with plainfs::rename(helios/src/core/conversion.rs:3538), not a no-replace rename, so it is not another #54 path. - Entry #2's "preflight is skipped on cache_only so #54 path has zero probes" was the prior verdict; this run confirms it and adds that binding.rs is skipped because every Python capture passes
sources=True. - Entry #2's nit about two
.flare-rename-probe-*trees per export is dropped: on the production path neither binding.rs nor core.rs probes, so the duplication is not observable.
EVIDENCE STATUS: no live mergerfs reproduction; the EINVAL/ENOTSUP mapping rests on injected-errno tests (archive.rs tests at +437-458; cache.rs:4539-4567) and on the raw-errno comparison in code. The PR reports rustfmt --check and 3 focused helper tests; whether helios compiled is not stated.
#7 [medium] Verified-correct items and nits for PR #79
Verified correct in code (so the report can say so):
- heliopause/src/export/archive.rs:259-313
install_blob: on Linux the renameat2(RENAME_NOREPLACE) failure is handed toinstall_blob_after_rename_error(:298-313), which links only for EINVAL/ENOTSUP (:304-311) and returns every other errno unchanged (:312).hard_linkis atomic, refuses an existing destination with EEXIST, and temporary/destination are in the same directory (blob.rs:177-178self.root.join(&name)and archive::temporary(&self.root,"blob") at blob.rs:178/archive.rs:240-258), so no EXDEV. - Caller compatible: blob.rs:194-213 maps AlreadyExists to
verify_pinned(reuse) and returns other errors; blob.rs:216-224 removes the temporary and tolerates NotFound, so the helper correctly does not unlink (:309 comment) — the earlier review nit is fixed. - Test at archive.rs (0o555 staging) pins that publication does not unlink; existing-destination and preserved-error tests match the code.
- heliopause/src/export/binding.rs:97-118
capture_with_ownerskeeps OwnerLease across capture and drain and releases only on confirmed drain (:104-105); heliopause/src/lifetime.rs:14-21 still mem::forget's an unconfirmed lease, so resources used by native work are not released. Drain still runs after a failed capture (test at binding.rs:1473-1521), which matches prior behaviour (pre-PRdrainalso ran after capture failure). - Probes on Linux use the real syscall and map EINVAL/ENOTSUP/ENOSYS to Unsupported with the parent path in the message (cache.rs:4238-4249) and detect a "rename replaced target" surprise (:4227-4232); non-Linux returns Ok (cache.rs:4179-4183), so macOS/Windows paths are unchanged.
rename_noreplaceitself is unchanged (cache.rs:4265-4285); the #54 errno policy difference remains: archive.rs:304-307 accepts only EINVAL|ENOTSUP, cache.rs:4240 also accepts ENOSYS, and the repo precedent is selene/src/disk.rs:1308-1311 (EOPNOTSUPP|ENOSYS). Two predicates for one syscall. Nits: probe name uses ring SystemRandom plus an unbounded retry loop (cache.rs:4206-4218) whiletoken()exists (cache.rs:3537); probe directory 0o700 can be left behind on kill;preflight_directory_publicationreturning Ok on non-Linux is indistinguishable from success at the call sites (binding.rs:121-124 exposes it to Python with PyRuntimeError rather than FileExistsError, unlike core_snapshot.py:61-62/74-75 convention);#[cfg(any(target_os="linux", test))]oninstall_blob_after_rename_error(archive.rs:298) means the new helper's tests never sit beside the Windows path; docs/multi-host.md:314-315 still states only the same-filesystem requirement with no no-replace rename requirement; PR description omits tests/preparation and ignition/preparation and claims "Fixes #54".
#8 [medium] Coverage: files read, callers traced, unsettled items
Files read in context at head 41f1c76 for this lens (correctness): heliopause/src/export/archive.rs (240-320 diff + whole install_blob), binding.rs (20-115, diff), core.rs (200-260, 597-665, 900-1030, 4160-4230, 4470-4520), helios/src/core/cache.rs (2770-2830, 2980-3010, 3110-3165, 3540-3730, 4165-4310, 4490-4600), conversion.rs (190-222, 300-451, 2600-2660, 2700-2770, 2887-2960, 3490-3570, 4230-4280, 2759-2890), conversion/edit.rs (1-70, 120-253), export.rs (700-775), selene/src/disk.rs (1290-1325), heliopause/src/lifetime.rs, ignition/preparation/{model_core.py, runtime_core.py, core_snapshot.py, core_file.py, host_ranks.py, rank_group.py}, ignition/cli/{serve.py, publishing.py}, tests/preparation/test_directory_preflight.py, plus the diff of all 7 files.
Callers traced: ignition export → serve.py:330 export_core(..., None, ...) / serve.py:229 prepared.export(None,...); host_ranks.py:439-500; rank_group.py:97-140; core_file.combine → heliopause export_combine → core.rs publish_payload; core_snapshot payload_convert/combine/edit/promote → heliopause conversion.rs.
Not settled by code (test/settling action): whether the mergerfs EINVAL mapping holds against the real FUSE filesystem — no live reproduction exists; the two injected-errno tests (archive.rs:437-458, cache.rs:4539-4567) are the only evidence. combine publishes with plain fs::rename (conversion.rs:3538), so it is not another uncovered no-replace rename — a grep for its publish call settled the open question from the previous run.