Full Review — PR #79 "fix(heliopause): fall back when no-replace rename is unsupported"
Reviewed at head 41f1c76 (the 2026-11-27 merge of main), base main, 7 files, +468/−22. The previous round's blocker ("branch does not apply to main") is resolved: unpack_selected is again a one-line wrapper (helios/src/core/conversion.rs:300-302) and the probe lives in unpack_with. Judged against the charter, AGENTS.md (not opened), docs/design-review.md (not opened), docs/core-format-design.md and CONTRIBUTING.md (not opened). All seven changed files were read in context and their callers followed at this head; superseded line numbers from the earlier posted comment were re-verified and replaced.
Key findings
- Keep the blob half.
install_blob_after_rename_error(heliopause/src/export/archive.rs:298-313) is the correct, minimal, root-cause fix for #54:hard_linkis atomic,EEXISTpreserves no-clobber, cleanup stays with the caller (heliopause/src/export/blob.rs:204-211,:216-224), and it matches in-tree hard-link precedent (helios/src/core/cache.rs:3061,:3087,heliopause/src/export/protection.rs:341(not opened)). It is also the only no-replace publication a cache-onlyignition exportperforms, since the cache entry itself is published with plainfs::rename(helios/src/core/cache.rs:3644), which mergerfs supports. Do not ask the author to touch this code. - Delete the directory-preflight half (most of the diff). It cannot run on the command #54 reports (
ignition exporttakes no--output:ignition/cli/__init__.py:169-192(not opened) covers only sign/edit/combine/convert;serve.py:229and:330passNone), the two reachable bare publishers stay unguarded (helios/src/core/export.rs:742,helios/src/core/conversion/edit.rs:250), and it writes to the destination filesystem inside a function documented "this probe reserves nothing" (helios/src/core/cache.rs:4174-4175vs:4205). - One no-replace policy is now implemented twice, with different errno sets, while the shared primitive
rename_noreplace(helios/src/core/cache.rs:4263-4285) was left unchanged. - The description no longer describes this diff: "Fixes #54" overclaims, "the temporary name is removed" is contradicted by the code (
archive.rs:309), and six of seven changed files are unmentioned. - Net effect after subtraction: the honest size of this PR is ~+80/−1 in
heliopause/src/export/archive.rs; ≈370–380 of the 468 added lines are removable.
Blockers (3)
B1. The preflight cannot run where #54 happens, and the publisher that does run is unguarded
Citations: ignition/preparation/model_core.py:27, :41-42, :51-52; ignition/cli/serve.py:229, :330; ignition/cli/__init__.py:169-192 (not opened); heliopause/src/export/binding.rs:34-36; heliopause/src/export/core.rs:615, :640-642, :1014; helios/src/core/cache.rs:2804, :3678 (:5011, :5017, :5132); helios/src/core/conversion.rs:316-317, :436; helios/src/core/export.rs:735-749; helios/src/core/conversion/edit.rs:249-252.
ignition export defines no --output (ignition/cli/__init__.py:169-192 (not opened) adds it to sign, edit, combine, convert only), and both of its call paths pass no destination: serve.py:229 (prepared.export(None, ...)) and serve.py:330 (export_core(prepared, recorder, storage, None, ...)). So cache_only = path is None (model_core.py:27) is always true, and every new guard conditioned on its negation is dead on that command:
model_core.py:41-42(if not cache_only and form == 'directory') — cannot fire;binding.rs:34-36(if !request.sources && !request.path.as_os_str().is_empty()) — cannot fire, becausemodel_corecallsexport_model(..., sources=True)(model_core.py:51-52);core.rs:640-642— skipped oncache_only(core.rs:615);cache.rs:3678(Staging::commit_standalone) — no production caller at all; only tests (cache.rs:5011,:5017,:5132). Production cache-only publication isStaging::commit(cache.rs:3644), a plainfs::rename.
What is actually reachable is two probes, both on ignition convert --output (cache.rs:2804 via heliopause/src/export/conversion.rs:351, and conversion.rs:316-317). Meanwhile the publishers #54's users hit stay bare rename_noreplace: helios/src/core/export.rs:742 (publish_staged_directory, reached from heliopause/src/export/core.rs:1014 when no cache is configured — its own doc at :730-734 claims these exact semantics), and helios/src/core/conversion/edit.rs:250 (ignition edit, after all companions are copied). On mergerfs those still return publish edited core: Invalid argument (os error 22).
There is also nothing for a preflight to protect on the reported command: the only no-replace publication is the blob install (archive.rs:275), which this PR's fallback fixes.
Requested change: delete the probe half — preflight_directory_publication and _with (cache.rs:4174-4261), its three tests (cache.rs:4518-4587), the call sites at cache.rs:2804 and :3678, conversion.rs:316-317, core.rs:640-642, binding.rs:34-36, the export_preflight_directory pyfunction (binding.rs:120-124, registration :128), model_core.py:41-42, and tests/preparation/test_directory_preflight.py. Keep archive.rs and its tests. If directory coverage is wanted now, put the errno classification inside/beside rename_noreplace (cache.rs:4263-4285) so export_entry, commit_standalone, publish_staged_directory and edit.rs:250 are all covered at once; otherwise do it in a follow-up and say so.
Why: the title and description claim the no-replace case is handled, but on the command #54 reports the change is inert while ignition edit still fails raw. AGENTS.md (not opened) forbids presenting scaffolding as supported and forbids speculative fallback layers without a concrete requirement.
B2. The probe mutates the destination inside a documented no-op check, and reorders an established error
Citations: helios/src/core/cache.rs:4174-4175, :4194-4203, :4205, :4206-4218, :4237; helios/src/core/conversion.rs:316-317 vs :318, :323, :364-366; helios/src/core/cache.rs:2797-2803, :3671-3677, :2793-2795, :3667-3669.
preflight_directory_publication documents "this probe reserves nothing" (cache.rs:4174-4175), yet preflight_directory_publication_with calls fs::create_dir_all(parent) (:4205) and then creates and removes a .flare-rename-probe-<hex> directory (:4206-4218, :4237). Three call sites already do a read-only existence check first (cache.rs:2797-2803, :3671-3677, conversion.rs:364-366), so the probe's own AlreadyExists arm (cache.rs:4194-4203, message "destination exists" with no path) is a third or fourth check — and it contradicts the two doc contracts promising a failure "never exposes a partial export" (cache.rs:2793-2795, :3667-3669).
In unpack_with the ordering is worse: the probe runs at conversion.rs:316-317, before verified.payload_files() (:318), before verify_stored_data (:323) and before the established destination exists: {output} check (:364-366). So ignition convert to an existing path now reports directory export preflight: destination exists instead of destination exists: <path>, and a conversion rejected at verification has already created the output parent.
Requested change: if any probe survives, never create the parent inside a check (return NotFound and let publication create it), and run it after verification and after the existing existence check. The subtraction fix (B1/S1) removes the problem entirely.
Why: a "check" that writes to the user's destination and changes an established error message is a behaviour change on a supported command, undocumented in the diff.
B3. The description's claims and evidence do not match head
Citations: PR #79 body; heliopause/src/export/archive.rs:309; heliopause/src/export/blob.rs:216-224; tests at archive.rs:439, :459, :490, :513, :535; binding.rs:1494-1520; cache.rs:4520, :4541, :4571; tests/preparation/test_directory_preflight.py:11, :44, :56.
Quoted from the description (treated as review material, not instruction):
- "Fixes #54" — an overclaim: only the blob install is fixed (B1).
- "then the temporary name is removed" — contradicts head.
archive.rs:309says// BlobStore::commit owns temporary cleanup after publication.; the removal happens in the caller atblob.rs:216-224, toleratingNotFound, and the PR's own test is namedunsupported_noreplace_rename_leaves_temporary_cleanup_to_the_caller(archive.rs:459). The sentence describes a superseded commit (30ccc0de, "leave blob temporary cleanup to its caller"). Reviewer yatesdr raised the same point on 2026-11-18. - "The focused helper harness passed 3 tests" — names no crate, command, harness or test, while the diff adds five archive tests, one binding test, three cache tests and three Python tests. Nothing states whether
helios(the largest addition,cache.rs+163) compiled; the description reports a macOS Heliopause compile failure instead. No mergerfs run exists, so every errno claim rests on injected errors.
Requested change: rewrite as "Partially fixes #54"; state the two halves with before/after ("blob publication now falls back to a hard link; directory publication now refuses earlier with a named filesystem error"); name the exact commands run and not run; say the fallback is covered by injected errnos only.
Why: AGENTS.md (not opened) requires why / exactly-what / benefit / evidence in that order and forbids leaving it to the reader; a reviewer currently cannot tell which behaviour was validated.
Should Fix (3)
F1. One no-replace policy, two errno sets, two crates
Citations: heliopause/src/export/archive.rs:304-306 (EINVAL|ENOTSUP) vs helios/src/core/cache.rs:4238-4249 (EINVAL|ENOTSUP|ENOSYS, plus ErrorKind::Unsupported); repo precedent selene/src/disk.rs:1308-1311 (EOPNOTSUPP | ENOSYS); the single primitive helios/src/core/cache.rs:4263-4285.
Both sites interrogate the same syscall (libc::renameat2/SYS_renameat2 with RENAME_NOREPLACE) and answer differently. A filesystem (or seccomp filter / older kernel) returning ENOSYS gets a working blob fallback but a hard refusal for directories; a future edit to one set silently diverges from the other.
Requested change: one predicate beside rename_noreplace (cache.rs:4263), used by the blob error path and by any surviving probe, with the chosen errno set stated in one comment. heliopause already depends on helios-core (heliopause/Cargo.toml:21 (not opened)), so sharing is free.
Why: one syscall question must have one answer; splitting a policy decision across the Helios/Heliopause boundary is what the repo's policy-separation rule rejects.
F2. The changed publication behaviour is documented nowhere
Citations: docs/multi-host.md:314-316 (same-filesystem rule, says nothing about rename support); docs/core-format-design.md:713-714 (already promises "an explicit preflight/export error" for filesystem limits); docs/TODO.txt (no entry matching mergerfs / renameat2 / no-replace / preflight).
No doc file appears in the diff, although the change adds a supported-configuration statement: blob installation now falls back to a hard link, and (if the probe half is kept) directory publication requires no-replace rename support. Issue #54's own "Possible changes" asks for exactly this note, and yatesdr's review asked for it beside the same-filesystem rule.
Requested change: one or two sentences beside docs/multi-host.md:314-316 stating what is required, what falls back, and what is reported; one line at docs/core-format-design.md:713-714; and a docs/TODO.txt entry for the unrun mergerfs reproduction.
Why: AGENTS.md (not opened) requires supported configurations to be stated and unrun checks recorded rather than left implicit.
F3. Description mechanics: Discord line, title, and the file list
Citations: AGENTS.md (not opened) "Contact on PRs and issues" (PR #362, commit de75b2ab, merged 4e820676, 2026-11-18 — landed after this PR was opened but long before its current head); docs/design-review.md (not opened) principle 17.
- No
Discord:line; the rule says "Never omit the line" and to writeDiscord: no username providedwhen none is given. Merged PR #546 carries exactly that, so the convention is live. - The title says
fix(heliopause)although five of seven changed files are helios/ignition (helios/src/core/cache.rs+163,helios/src/core/conversion.rs,ignition/preparation/model_core.py, and the new Python test). - Six of seven changed files are unmentioned, including the
synchronizereorder inStaging::commit_standalone(cache.rs:3678-3679), which is a resource-order change.
Requested change: append Discord: no username provided (or the contributor's, asked not guessed); retitle to cover both halves (e.g. fix(export): fall back for blob publication); list the changed areas.
Why: mechanical, cheap, and they currently mask the size and shape of the change. Grouped here rather than as blockers because the substance is covered by B1/B3.
Subtract / Simplify (4 items — ≈370–380 of 468 added lines removable)
S1. Delete the entire directory-publication preflight (~244 lines)
| Location | Lines |
|---|---|
helios/src/core/cache.rs:4174-4261 preflight_directory_publication + _with |
88 |
helios/src/core/cache.rs:4518-4587 three tests |
~70 |
tests/preparation/test_directory_preflight.py (new file) |
68 |
heliopause/src/export/binding.rs:34-36 call, :120-124 pyfunction, :128 registration |
~9 |
heliopause/src/export/core.rs:640-642 call |
3 |
helios/src/core/cache.rs:2804, :3678 calls |
2 |
helios/src/core/conversion.rs:316-317 call |
2 |
ignition/preparation/model_core.py:41-42 call |
2 |
Replacement: nothing. Nothing is lost:
- every remaining caller already checks the destination read-only (
cache.rs:2797-2803,:3671-3677,conversion.rs:364-366, pluscore.rs:618-620and the pre-existing duplicate:627-632); - the verdict is re-derived at publication by
rename_noreplace(cache.rs:2817,:3696,conversion.rs:436,export.rs:742), so the probe only moves the failure earlier — after the expensive capture it is supposed to protect, on paths it cannot even reach; - the probe re-implements existing helpers:
token()(cache.rs:3537, already used at:2812and:3686) instead of the hand-rolledSystemRandomretry loop (cache.rs:4206-4218, 12 lines),TempDirectory(conversion.rs:2595-2601) instead of the manual cleanup match (cache.rs:4250-4260), and bounded-retry precedent exists atarchive.rs:239-258; - its own tests cannot fail on their subject:
test_directory_preflight.py:43-52never entersexport_options, somodel_core.py:31-33raisesRuntimeError("export requires the configured core cache")before line 41 is reached — theunexpectedstub at:45-46is dead code and deletingnot cache_onlyfrom the guard would leave the test green;:11-40fakesflare_heliopause/torch(:28-31) and asserts call order only;:55-68duplicatescache.rs:4518-4587.
S2. capture_with_owners and its test exist only for the deleted probe (~71 lines)
heliopause/src/export/binding.rs:97-118 (22 lines, one production caller at :89) plus its only test at binding.rs:1494-1520 (47 lines) whose sole purpose is injecting Err(invalid("unsupported publication")) for the probe. Main's inline body has the same capture → drain → release order with OwnerLease created before py.detach and take_after_drain after; the refactor converges only one of four near-identical lease/drain blocks (others inline at binding.rs:1530-1538, :1677-1697, transfer.rs:1229-1236 (not opened)/:1258-1260).
Replacement: restore main's inline body in export_capture and delete the stub test; the drain-failure message (binding.rs:106-115) moves back beside its inputs. The file then nets to zero added lines beyond the preflight guard, which S1 removes anyway. AGENTS.md (not opened) rejects extension points without a concrete requirement, and a mock that bypasses the behaviour cannot establish correctness.
S3. archive.rs has five tests for a four-line branch; keep two (~63 lines)
- Keep
unsupported_noreplace_rename_installs_blob_with_a_hard_link(archive.rs:439-456) — the behaviour the PR exists for, asserting installed bytes and that the temporary survives. - Keep
unsupported_noreplace_rename_does_not_replace_an_existing_blob(archive.rs:490-511) — theEEXISTno-clobber guaranteeBlobStore::commitrelies on (blob.rs:204-211). - Delete
..._leaves_temporary_cleanup_to_the_caller(archive.rs:459-488, 32 lines): its premise is the0o555chmod at:472, which the documented container build (running as root) does not enforce, and its only extra assertion restates:453-454plus the unchangedremove_temporary(:314). - Merge
other_rename_errors_are_preserved_without_installing_the_blob(:513-533) withunsupported_noreplace_rename_preserves_hard_link_errors(:535-555): both assert "kind preserved, destination not created" for oneErr(error.into())at:312(21 lines). - Optionally inline the remaining test seam
install_blob_after_rename_error(:298-313) intoinstall_blob(:259-297) — identical behaviour, ~10 lines.
S4. Revert the commit_standalone synchronize reorder (2 lines)
helios/src/core/cache.rs:3678-3679 moved synchronize(&self.directory) from the top of commit_standalone to below the new existence check and probe. Nothing in the description or a comment explains it, no test covers either order, and the staging tree is private (copy_tree re-synchronizes the copy at :3692-3695), so it is durability-neutral churn. With S1 taken it becomes pure noise — restore main's order.
Nits (4)
N1. export_preflight_directory flattens error types. heliopause/src/export/binding.rs:120-124 maps every error to PyRuntimeError, whereas the Python export guards raise FileExistsError (ignition/preparation/core_file.py:72-80 (not opened)), and it collapses AlreadyExists and Unsupported into one type; the new test compensates by matching message text (test_directory_preflight.py:65). Moot if S1 is taken.
N2. #[cfg(any(target_os = "linux", test))] at archive.rs:298 is a new form in this tree. A repo-wide search finds this exact pattern only here; the established platform-alternates form is a Linux fn plus a not(target_os = "linux") fn (cache.rs:4265/:4288, selene/src/disk.rs:1300/:1314), and the other cfg(any(...)) in heliopause keys on a feature, not test (heliopause/src/python.rs:10 (not opened)). It does not leave dead code — the tests call the helper unguarded — but one comment saying why the test arm is needed would do.
N3. tests/preparation/test_directory_preflight.py:1 has no # SPDX-License-Identifier: Apache-2.0 header, while every sibling under tests/preparation/ carries one (e.g. test_native_publication.py:1-3 (not opened)). Moot if the file is deleted.
N4. Commit hygiene. Repair commits sit on top of what they repair (30ccc0de repairs 989f013b) and main was merged rather than rebased (06b9011a, merge of main); squash so each commit states problem, behaviour and evidence. yatesdr's Signed-off-by finding could not be verified with these tools (commit trailers are not exposed) — recorded as reported-by-reviewer, not confirmed.
Verified positives (the author should not be asked to change these)
- Blob fallback:
hard_linkis atomic;EEXISTpreserves no-clobber; the helper does not unlink (archive.rs:304-311); caller cleanup toleratesNotFound(blob.rs:216-224); the read-only seal carries across the shared inode (blob.rs:190);temporaryis a sibling (blob.rs:178), so noEXDEV. No new dependency, flag, environment switch or per-model branch —ringis already aruntime-coredependency (helios/Cargo.toml:43(not opened)), so the model-agnostic rule is not engaged. - Non-Linux is a no-op (
cache.rs:4179-4183), consistent with the existing non-Linuxrename_noreplace(cache.rs:4287-4295). capture_with_ownerspreserves lifetime behaviour:OwnerLeasespans capture and drain and is released only on a confirmed drain (binding.rs:102-105), matchingheliopause/src/lifetime.rs:14-21(not opened).- The error text is a real improvement:
cache.rs:4243names both the path and the unsupported operation, which is exactly what #54 lacked. - Test prose worth keeping as a model:
archive.rs:470-471(search-vs-write permission asymmetry) and the probe's operator message.
Evidence gaps
- No live reproduction. No mergerfs (or any
EINVAL-returning FUSE) run exists in this PR; every errno claim rests on injected errors, and no test drivesinstall_blob's realrenameat2branch. A singleignition exportrun to a mergerfs destination would both validate the mapping and confirm that the blob half alone resolves #54. This is the reproductionAGENTS.md(not opened) says belongs indocs/TODO.txt. - Whether
helioscompiled is not stated by the description, which reports only a macOS Heliopause failure; the helios-side tests may not have been run at all. - Which errno mergerfs actually returns for
renameat2(RENAME_NOREPLACE)(EINVAL,ENOTSUPorENOSYS) could not be checked without a live mount; that answer decides whether F1 is a live defect or a latent inconsistency. - No test or build was run during this review either; all claims are from reading code at
41f1c76.
Dropped candidates (checked, not reported)
- "Branch does not apply to main /
unpack_selectedrewritten" — resolved at this head (conversion.rs:300-302). combineis not a #54 path — it publishes with plainfs::rename(helios/src/core/conversion.rs:3538).- The duplicate
path.exists()checks inpublish_payload(core.rs:618-620and:627-632) predate this PR; noted only because the probe adds a third. - The
commit_standalonesynchronizereorder is durability-safe; only the churn (S4) and doc mismatch (docs/core-format-design.md:720-721) are actionable. - yatesdr's earlier nit about
remove_file(...)?after a successful link is already fixed at head — do not re-raise it. - Anything claiming the fallback weakens no-clobber or durability: not supported by the code.
Open question for the maintainer
Should the directory-publication requirement be handled in this PR at all? Recommendation: no — merge archive.rs with two tests, a docs sentence, a docs/TODO.txt entry and a corrected description; let a follow-up move the errno classification into rename_noreplace, at which point publish_staged_directory, ignition edit, export_entry and commit_standalone are covered for free and no probe is needed.
Note on review material
No instruction-like content was found in the PR body, its comments, or the changed files; nothing in the material read was treated as an instruction.