docs: freeze config discovery on ProjectDirs as it stands #149

Merged
natsukium merged 2 commits from docs/freeze-config-discovery-137 into main 2026-09-06 02:14:29 +09:00
Owner

Fixes #137.

Freezes felis's config discovery on ProjectDirs as it already behaves: the
reference and explanation docs now state the per-platform lookup path and the
reasoning behind keeping it, so the current behavior is a documented contract
rather than an accident of the dependency. The config suite's discovery and io
tests now also run on Windows, pinning the platform path the docs describe.

Doc cascade: docs/reference/config.md gains the resulting facts, and
docs/explanation/architecture/control-surfaces.md carries the decision record
(rationale, rejected alternatives, revisit trigger).

Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed
by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high

Deferred

  • The new Windows-only test and the un-gated relative-path test compile only
    under the mingw cross shell or CI's Windows runner — nix develop .#windows
    was out of bounds for this run and ConPTY/Windows behavior never runs on this
    host; the code is plain std path handling reviewed by hand, and CI's Windows
    job is the real check.
  • The Windows discovery test asserts the APPDATA env var as a proxy for the
    known-folder API that ProjectDirs actually queries — the test's own doc
    comment discloses this, and the reference prose describes the mechanism
    correctly as the known-folder API, so no doc states a falsehood. A tighter,
    non-env-var verification is hardening beyond #137's acceptance criteria.
Fixes #137. Freezes felis's config discovery on `ProjectDirs` as it already behaves: the reference and explanation docs now state the per-platform lookup path and the reasoning behind keeping it, so the current behavior is a documented contract rather than an accident of the dependency. The config suite's discovery and io tests now also run on Windows, pinning the platform path the docs describe. Doc cascade: `docs/reference/config.md` gains the resulting facts, and `docs/explanation/architecture/control-surfaces.md` carries the decision record (rationale, rejected alternatives, revisit trigger). Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high ## Deferred - The new Windows-only test and the un-gated relative-path test compile only under the mingw cross shell or CI's Windows runner — `nix develop .#windows` was out of bounds for this run and ConPTY/Windows behavior never runs on this host; the code is plain std path handling reviewed by hand, and CI's Windows job is the real check. - The Windows discovery test asserts the `APPDATA` env var as a proxy for the known-folder API that `ProjectDirs` actually queries — the test's own doc comment discloses this, and the reference prose describes the mechanism correctly as the known-folder API, so no doc states a falsehood. A tighter, non-env-var verification is hardening beyond #137's acceptance criteria.
The `config.toml` search paths become impossible to move once 1.0 ships,
so the choice between them had to be made now: felis keeps
`directories::ProjectDirs` as the sole resolver and overrides no
platform's answer.

Record the two rejected alternatives where a future reader will look for
them, because both read as obvious fixes to the table: flattening
`%APPDATA%\felis\config\config.toml` makes felis' config path the one
call in the tree that second-guesses the resolver the cache, runtime and
state slots still trust, and an XDG fallback on macOS buys a precedence
rule and a two-candidate `config path` for a platform v0.1.0 does not
gate, when `--config` already serves that user.

Refs #137
cli: run the config suite's discovery and io tests on Windows
All checks were successful
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 49s
bench / Criterion regression gate (pull_request) Successful in 2m1s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m2s
pr / nix flake check (pull_request) Successful in 26s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m43s
pr / wire schema is compatible with the base (pull_request) Successful in 10s
windows / cargo clippy (Windows cross) (pull_request) Successful in 17s
windows / frontend smoke (Windows) (pull_request) Successful in 2m6s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (push) Has been skipped
fuzz / cargo fuzz smoke (per target) (push) Successful in 1m3s
pr / nix flake check (push) Successful in 6s
pr / cargo build / clippy / test / deny (push) Successful in 1m40s
pr / wire schema is compatible with the base (push) Successful in 9s
pr / publish felis (x86_64-linux) (push) Successful in 10s
windows / cargo nextest (Windows) (push) Successful in 5m51s
windows / package felis (x86_64-pc-windows-msvc) (push) Successful in 2m18s
windows / cargo nextest (Windows) (pull_request) Successful in 5m31s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 1m13s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (push) Successful in 15s
pr / frontend smoke (x86_64-linux) (push) Successful in 6s
windows / cargo clippy (Windows cross) (push) Successful in 13s
windows / frontend smoke (Windows) (push) Successful in 1m55s
f98dd4a4cc
Three tests in the config suite were `cfg(unix)` for three unrelated
reasons, which left Windows without any check on the very paths the
reference table now freezes.

Discovery genuinely cannot be redirected on Windows, since the
known-folder API behind `%APPDATA%` reads no environment variable, so it
gains a twin that asserts the reported spelling of the frozen row and
never touches the file. The unreadable-file case drops `PermissionsExt`
for a directory at the selected path: that fails the read everywhere and
is not defeated by running as root, which the mode bits were. The
relative-selection case only needed `canonicalize` reduced to the
non-verbatim form a child's `current_dir` can echo back.

Refs #137
natsukium deleted branch docs/freeze-config-discovery-137 2026-09-06 02:14:29 +09:00
Sign in to join this conversation.
No description provided.