Expand description
Where disposable runner attempts are placed, and whether a configured location can actually hold them.
02-target-architecture.md separates three path concepts that used to share
one directory. crate::paths::AppPaths owns the first — config, SQLite,
logs, diagnostics and the verified package cache — and nothing here moves
it. This module owns the other two: the host runner root under which
ephemeral attempts are created, and the operational check every
repository persistent root must also pass.
§Two layers, and why the split is load-bearing
LocalAbsolutePath is the pure layer: it decides whether a string is a
shape the product will persist, with no syscall and no ambient state, so
opening the database never depends on a drive being mounted today. This
module is the operational layer named in “Path validation”: it runs before
a mutation is committed and before the daemon accepts new allocation, and it
is the only one of the two allowed to ask the filesystem anything.
LocalAbsolutePath absolute? non-root? native? no UNC, device or `..`?
RootPreflight local volume? writable? a real directory? contained?§What this module will not do
It never creates, deletes, or re-permissions anything. Both writability
probes are pure queries — access(2) on Unix, and on Windows a directory
handle opened for FILE_ADD_SUBDIRECTORY, which runs the real access check
against the real DACL and produces no file. That is deliberate: “validation
performs no deletion or permission mutation” is then a property of the code
rather than a convention, and a preflight that probed by writing a marker
would be a preflight that can leave litter in an operator’s directory.
Creating the validated leaf and applying the narrow default-root ACL are
explicit steps their callers take after this returns Ok, in b2 and
c1.
§The Windows default
D1 is %SystemDrive%\rman, “normally C:\rman”. The drive letter is read
from GetSystemDirectoryW, not from %SystemDrive%: an environment
variable is writable by whatever launched the process, and this value
decides where a recursive cleanup will later run. Nothing here assumes C:
— default_runner_root_from takes the system directory as an argument, so
the Linux and macOS CI legs test the Windows rule too.
Structs§
- Filesystem
Identity - The filesystem an existing directory sits on.
- Host
Filesystem - The real operating system.
- Preflighted
Root - A root that passed the operational preflight.
- Root
Preflight - The operational check a configured or default runner root must pass.
Enums§
- Locality
- What the host can prove about where a directory lives.
- Overlap
- How two paths sit relative to one another.
- Platform
Default - Where a platform default comes from.
- Root
Owner - Which setting a root came from.
- Runner
Root Error - Why a runner root cannot be resolved, or cannot be used.
Constants§
- WINDOWS_
RUNNER_ ROOT_ NAME - The directory appended to the Windows system drive to form the default host runner root.
Traits§
- Filesystem
Probe - The two questions the preflight asks the operating system.
Functions§
- default_
runner_ root - The platform default host runner root for this machine.
- default_
runner_ root_ from - Resolves a platform default from an explicit source.
- derive_
child - The path of one attempt directory or persistent slot below
root. - is_
on_ privacy_ gated_ volume - Whether
pathsits on a volume macOS withholds from a background service. - verify_
containment - Proves that
childis belowroot, lexically and after resolution.