Resolve a relative paths.data against the project root, matching paths.runs and [nodes] pointers #254

Closed
opened 2026-07-13 15:22:49 +02:00 by claude · 0 comments
Collaborator

Env::data_path() hands paths.data to the data layer verbatim: it returns p.toml.paths.data.clone() as a String (crates/aura-cli/src/project.rs:187-192 at bd174d1), which flows into DataServer::new unchanged. The sibling path keys resolve against the project root: runs_root() is p.root.join(runs) (project.rs:167-175), and a [nodes].crates pointer is root.join(pointer) (project.rs:497, absolute pointers passing through).

Consequence: a relative data = "data" in Aura.toml resolves against the invoking process's cwd, not the project root — aura run from the project root and from a project subdirectory silently read different archive locations, while runs/ stays anchored correctly in both. An absolute paths.data is unaffected.

Found while wiring the per-test synthetic archive for #250 (the E2E helper works around it by always invoking with cwd = project root; see the note in crates/aura-cli/tests/common/mod.rs's write_project_files doc).

Claim (unverified): no current test or documented flow invokes aura from a project subdirectory with a relative paths.data, so the misresolution is latent rather than observed. A fix is one join at the single choke point: data_path() joining relative values onto p.root, mirroring runs_root().

`Env::data_path()` hands `paths.data` to the data layer verbatim: it returns `p.toml.paths.data.clone()` as a `String` (crates/aura-cli/src/project.rs:187-192 at `bd174d1`), which flows into `DataServer::new` unchanged. The sibling path keys resolve against the project root: `runs_root()` is `p.root.join(runs)` (project.rs:167-175), and a `[nodes].crates` pointer is `root.join(pointer)` (project.rs:497, absolute pointers passing through). Consequence: a **relative** `data = "data"` in `Aura.toml` resolves against the *invoking process's cwd*, not the project root — `aura run` from the project root and from a project subdirectory silently read different archive locations, while `runs/` stays anchored correctly in both. An absolute `paths.data` is unaffected. Found while wiring the per-test synthetic archive for #250 (the E2E helper works around it by always invoking with cwd = project root; see the note in `crates/aura-cli/tests/common/mod.rs`'s `write_project_files` doc). Claim (unverified): no current test or documented flow invokes `aura` from a project subdirectory with a relative `paths.data`, so the misresolution is latent rather than observed. A fix is one join at the single choke point: `data_path()` joining relative values onto `p.root`, mirroring `runs_root()`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Brummel/Aura#254