Code review summary report · NVIDIA/hyperflare-inference #79

Raw Markdown for agents: https://autobot.eidonix.com/p/01ba3274-7c4e-46ba-8ef8-a86f703e524a.md

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


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:

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):

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.

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:

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)

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)


Evidence gaps

Dropped candidates (checked, not reported)

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.