Skip to content

feat: profiles.d/ per-machine profile overrides - #32

Merged
cptfinch merged 1 commit into
mainfrom
feat/profiles-d-overrides
Jul 22, 2026
Merged

cptfinch merged 1 commit into
mainfrom
feat/profiles-d-overrides

Conversation

@cptfinch

Copy link
Copy Markdown
Contributor

Closes #21.

Summary

  • ~/.config/llm-secrets/profiles.d/*.toml is now read (if present) and layered on top of profiles.toml
  • Any profile name defined in a profiles.d file fully replaces the same-named entry from profiles.toml, or adds a new machine-local profile if the name doesn't exist there
  • Unlike extends, this is a config-loading precedence question, not a security boundary — no narrowing constraint, the override simply wins
  • The same profile name defined in two different profiles.d files is rejected as ambiguous rather than silently resolved by sort order
  • profiles.toml is now optional if profiles.d/ alone defines at least one profile (previously required to exist even if empty)
  • No changes to Caveat, macaroon format, or extends behaviour

Test plan

  • cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test --all — all pass (31 unit + 28 CLI integration)
  • New scenarios in profile::tests::file_system_load_paths: full override of a base profile, new machine-local profile, duplicate-name-across-files rejected, profiles.d alone (no profiles.toml) works, neither present still errors clearly

Phase 2 of ADR 0008. Any *.toml file dropped in
~/.config/llm-secrets/profiles.d/ layers on top of profiles.toml: a
profile name defined there fully replaces the same-named entry (or
adds a new machine-local profile). Unlike extends, this is a
config-precedence question, not a security boundary, so there's no
narrowing constraint. The same name in two different profiles.d files
is rejected as ambiguous. profiles.toml is now optional if
profiles.d/ alone defines at least one profile.
@cptfinch
cptfinch merged commit 0f3a2d1 into main Jul 22, 2026
2 checks passed
@cptfinch
cptfinch deleted the feat/profiles-d-overrides branch July 22, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

profiles.d/ directory layout (per-machine overrides)

1 participant