Fleet state-location resolution
State: open/verified · Kind: module · Audience: system
Summary
Section titled “Summary”- Resolves where a product’s on-disk state lives across every product the company ships, on two axes — tier (vendor/suite/standalone, who shares the state) and home (durable/config/cache/logs/runtime, how durable it is) — over the per-OS directory table, plus an untiered scratch root.
- A byte-identical TypeScript twin of a Rust
fleetcrate, kept in sync through a shared parity fixture so the two arms of one capability never split their state.
Statement
Section titled “Statement”@sksizer/fleet answers “where does this state live?” for the whole product fleet. A caller builds a
Fleet from injected BaseDirs (or Fleet.fromSystem(), which reads the real environment) and
addresses a location by naming a tier — vendor() for state shared by every product line,
suite(key) for products that share user data, or standalone(tool) for a general tool shipped
outside the fleet — and a home, then optionally scopes or apps the path further. Nothing below
systemBaseDirs reads the environment directly; a Fleet resolves its roots once at construction,
which is what lets a nitro server (which cannot read import.meta.url) and a CLI share one seam by
injecting different roots.
It is not the Tauri per-product directory; this package takes no Tauri dependency and is consumed headlessly by the platform server, the Bun CLI fleet, and the ontological CLI.
What it provides
Section titled “What it provides”Fleet/FleetTier/FleetPathbuilder API for tier x home x scope x app addressingsystemBaseDirs/rootedBaseDirsfor real-environment and test-rooted base directoriesFleet.scratch()for the untiered platform temp directory- Segment validation (
assertSegment) rejecting empty/separator/..path pieces - A parity contract (
packages/fleet-parity/parity.json) asserting path-for-path equivalence with the Rustfleetcrate
Underlying implementation
Section titled “Underlying implementation”- packages/ts/fleet/fleet.ts
- packages/ts/fleet/base-dirs.ts
- packages/ts/fleet/vendor.ts
- packages/ts/fleet/tests/parity.test.ts
Locations
Section titled “Locations”packages/ts/fleet/packages/rust/fleet/