Let the client's data home ride the cascade #66

Merged
PerishFire merged 1 commit from cli-cascade into main 2026-08-02 09:09:49 +00:00
Owner

Plumb's home-and-state law wants one data home resolved as an ordinary cascade field,
and says plainly that a tool reading $HOME itself has bypassed the cascade exactly as
an invented key does. config.rs was doing precisely that — a hand-rolled ladder over
ENSIGN_HOME, XDG_CONFIG_HOME and HOME, read straight from the environment.

It is now a Cascade struct, so the layers arrive in the order the law names: the
default layer carries the platform seat from plumb::config::data, the typed
environment follows, and a flag layer is one argument away if a caller ever needs one.
The derive takes its prefix from the package name, so ENSIGN_URL and ENSIGN_HOME
keep answering exactly as before
— the acts drive both and stay green.

One behaviour does change: the platform default moves from ~/.config/ensign to
~/.ensign, which is what plumb::config::data resolves for a unix tool. Anyone
holding a credential from before re-runs login; the record itself relocated to
state/pat.json in the previous change, so that step was already required.

This closes the fourth and last of the home-and-state debts. The other three landed as
state/pat.json: under state, schema-versioned, and written beside then renamed.

Every guard step was run by hand on the committed state and is clean, including all
acts — act 6 sets ENSIGN_HOME per pilot and reads the record off disk, which is what
proves the environment layer still drives the seat.

Plumb's home-and-state law wants one data home resolved as an ordinary cascade field, and says plainly that a tool reading `$HOME` itself has bypassed the cascade exactly as an invented key does. `config.rs` was doing precisely that — a hand-rolled ladder over `ENSIGN_HOME`, `XDG_CONFIG_HOME` and `HOME`, read straight from the environment. It is now a `Cascade` struct, so the layers arrive in the order the law names: the default layer carries the platform seat from `plumb::config::data`, the typed environment follows, and a flag layer is one argument away if a caller ever needs one. The derive takes its prefix from the package name, so **`ENSIGN_URL` and `ENSIGN_HOME` keep answering exactly as before** — the acts drive both and stay green. One behaviour does change: the platform default moves from `~/.config/ensign` to `~/.ensign`, which is what `plumb::config::data` resolves for a unix tool. Anyone holding a credential from before re-runs `login`; the record itself relocated to `state/pat.json` in the previous change, so that step was already required. This closes the fourth and last of the home-and-state debts. The other three landed as `state/pat.json`: under `state`, schema-versioned, and written beside then renamed. Every guard step was run by hand on the committed state and is clean, including all acts — act 6 sets `ENSIGN_HOME` per pilot and reads the record off disk, which is what proves the environment layer still drives the seat.
Let the client's data home ride the cascade
All checks were successful
guard / guard (pull_request) Successful in 3m30s
guard / guard (push) Successful in 3m35s
d81ee31737
Plumb's home-and-state law wants one data home resolved as an ordinary
cascade field, and says plainly that a tool reading $HOME itself has bypassed
the cascade exactly as an invented key does. config.rs was doing precisely
that: a hand-rolled ladder over ENSIGN_HOME, XDG_CONFIG_HOME and HOME, read
straight from the environment.

It is now a Cascade struct, so the layers arrive in the order the law names:
the default layer carries the platform seat from plumb::config::data, the
typed environment follows, and a flag layer is one argument away if a caller
ever needs one. The derive takes its prefix from the package name, so
ENSIGN_URL and ENSIGN_HOME keep answering exactly as before.

The platform default moves from ~/.config/ensign to ~/.ensign, which is what
plumb::config::data resolves for a unix tool. Anyone holding a credential from
before re-runs login — the record itself relocated to state/pat.json in the
previous change, so that step was already required.

This closes the fourth and last of the home-and-state debts. The other three
landed as state/pat.json: under state, schema-versioned, and written beside
then renamed.
PerishFire deleted branch cli-cascade 2026-08-02 09:09:49 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PerishLab/ensign!66
No description provided.