config: make skills_dir and agent_auth_path implicit under the state root #93

Closed
weiwen wants to merge 4 commits from fm/skills-auth-implicit into main
Owner

pi.skills_dir and pi.agent_auth_path were configurable paths that every real deployment pointed back into the state root anyway. They are now derived - <state_dir>/skills and <state_dir>/auth.json - via Config::skills_dir()/Config::agent_auth_path(), like homes_dir and sessions_dir, so they can no longer disagree with state_dir.

Also adds $HOME/.evie to the state-root fallback chain ahead of the hardcoded /var/lib/evie, so a developer running the daemon by hand without systemd and without $XDG_STATE_HOME lands somewhere writable:

explicit -> $STATE_DIRECTORY -> $XDG_STATE_HOME/evie -> $HOME/.evie -> /var/lib/evie

Deploy-affecting: the provider credential is read at <state_dir>/auth.json now, so deploy/docker/docker-compose.yaml moves its bind target from /var/lib/evie/agent-auth.json to /var/lib/evie/auth.json (host-side secrets/agent-auth.json filename unchanged). An existing deployment that set agent_auth_path must rename the file in its state volume; a stale agent_auth_path/skills_dir left in config.toml is now an unknown key.

cargo check and cargo test (487 passed) both clean.

`pi.skills_dir` and `pi.agent_auth_path` were configurable paths that every real deployment pointed back into the state root anyway. They are now derived - `<state_dir>/skills` and `<state_dir>/auth.json` - via `Config::skills_dir()`/`Config::agent_auth_path()`, like `homes_dir` and `sessions_dir`, so they can no longer disagree with `state_dir`. Also adds `$HOME/.evie` to the state-root fallback chain ahead of the hardcoded `/var/lib/evie`, so a developer running the daemon by hand without systemd and without $XDG_STATE_HOME lands somewhere writable: `explicit -> $STATE_DIRECTORY -> $XDG_STATE_HOME/evie -> $HOME/.evie -> /var/lib/evie` **Deploy-affecting:** the provider credential is read at `<state_dir>/auth.json` now, so `deploy/docker/docker-compose.yaml` moves its bind target from `/var/lib/evie/agent-auth.json` to `/var/lib/evie/auth.json` (host-side `secrets/agent-auth.json` filename unchanged). An existing deployment that set `agent_auth_path` must rename the file in its state volume; a stale `agent_auth_path`/`skills_dir` left in config.toml is now an unknown key. `cargo check` and `cargo test` (487 passed) both clean.
Replace the full-rebuild rustPlatform.buildRustPackage with crane's
two-stage approach: buildDepsOnly caches crate dependencies by
Cargo.lock hash, buildPackage reuses them and only recompiles
changed source files. A source-only change now rebuilds as fast as
cargo build inside a dev shell.

- Add crane input (github:ipetkov/crane)
- Swap rustPlatform for craneLib = (crane.mkLib pkgs).overrideToolchain
- commonArgs shared between buildDepsOnly and buildPackage
- cargoArtifacts (deps only, doCheck=false)
- evie (full build with postInstall wrapper + skills)
- Source filter preserves .md files (needed by include_str! for SYSTEM_PROMPT.md)
- Verified: first build 2m15s deps+evie, incremental build 33s (only evie crate)
- All 487 tests pass
Both were configurable paths that every real deployment pointed back into the
state root anyway, so they are now derived like homes/ and sessions/ rather
than being two more knobs that can disagree with state_dir.

Also add $HOME/.evie to the state-root fallback chain, ahead of the hardcoded
/var/lib/evie, so a developer running the daemon by hand without systemd and
without $XDG_STATE_HOME lands somewhere writable.
docs+deploy: document skills and provider credential as state-root-derived
Some checks failed
CI / check (pull_request) Failing after 2m10s
CI / publish (pull_request) Has been skipped
PR Triage — label changes-requested reviews / triage-review (pull_request) Successful in 1s
74cc564eb2
The docker compose bind target moves with the code: the credential is read at
<state_dir>/auth.json now, so the sample deploy would otherwise mount it at a
path nothing reads. The host-side secrets/agent-auth.json filename is
unchanged.
weiwen closed this pull request 2026-08-12 23:33:54 +08:00
Author
Owner

Superceded by #94

Superceded by #94
Some checks failed
CI / check (pull_request) Failing after 2m10s
CI / publish (pull_request) Has been skipped
PR Triage — label changes-requested reviews / triage-review (pull_request) Successful in 1s

Pull request closed

Sign in to join this conversation.
No reviewers
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
weiwen/evie!93
No description provided.