ARADR-002: unify Nix and standalone configuration #5

Open
lost-rob0t wants to merge 12 commits from rage/4-unified-config into main
lost-rob0t commented 2026-08-29 12:27:13 +00:00 (Migrated from github.com)

Closes #4

Auto-ARADR

Canonical design: research/LLM-LOG-RESEARCH-002-unified-configuration.org

Decision: one runtime configuration model with two frontends:

  • Home Manager/Nix remains declarative through services.llm-log.* and services.llm-log.enable = true owns the systemd user service.
  • standalone users get TOML configuration plus CLI overrides.
  • the reusable default mutable state/corpus root is ~/.llm-proxy.
  • personal corpus locations are consumer configuration only; dotfiles may set services.llm-log.dataDir = "${config.home.homeDirectory}/Documents/AI/proxy" without changing llm-log defaults.

RED first

Initial config contract: 7cc8e5b test: define red unified configuration contract

Storage-default correction RED contract: 1eacad43a5d2303daf790eeec08c416f56975ed9

The corrected contract requires default_data_dir() to resolve to $HOME/.llm-proxy even when XDG_DATA_HOME is set, while explicit TOML/CLI/Home Manager overrides remain higher precedence.

Implementation

  • llm_log/config.py: standard-library tomllib config loader + validation
  • default config: $XDG_CONFIG_HOME/llm-log/config.toml, fallback ~/.config/llm-log/config.toml
  • default mutable state/corpus: ~/.llm-proxy
  • storage-default implementation: dd493e34c9a1702395cfa5c7776b045745ac2696
  • canonical Org decision update: 64713e26eb32cc376d86de3764e4188a1194f403
  • missing implicit/default config is allowed; missing explicit --config errors
  • schema version + unknown-key/type validation
  • runtime defaults < TOML < CLI
  • --prolog-classifier / --no-prolog-classifier
  • --upstream NAME=URL overrides individual providers while preserving others
  • flake apps.default / apps.llm-log for nix run ... -- serve
  • Home Manager service/module retained and documented

Validation

The earlier focused local config contract was 6/6 passing against the preceding configuration implementation. The new ~/.llm-proxy correction has RED-first test and implementation commits, but no new local execution is claimed from this environment.

The repository still intentionally has no GitHub Actions development loop. Full local Python/Nix verification is required before merge.

Security

No credential storage was added. Nix config contains runtime/upstream routing only; client auth continues to be forwarded and capture persistence continues to redact secret headers.

Closes #4 ## Auto-ARADR Canonical design: `research/LLM-LOG-RESEARCH-002-unified-configuration.org` Decision: one runtime configuration model with two frontends: - Home Manager/Nix remains declarative through `services.llm-log.*` and `services.llm-log.enable = true` owns the systemd user service. - standalone users get TOML configuration plus CLI overrides. - the reusable default mutable state/corpus root is `~/.llm-proxy`. - personal corpus locations are consumer configuration only; dotfiles may set `services.llm-log.dataDir = "${config.home.homeDirectory}/Documents/AI/proxy"` without changing llm-log defaults. ## RED first Initial config contract: `7cc8e5b test: define red unified configuration contract` Storage-default correction RED contract: `1eacad43a5d2303daf790eeec08c416f56975ed9` The corrected contract requires `default_data_dir()` to resolve to `$HOME/.llm-proxy` even when `XDG_DATA_HOME` is set, while explicit TOML/CLI/Home Manager overrides remain higher precedence. ## Implementation - `llm_log/config.py`: standard-library `tomllib` config loader + validation - default config: `$XDG_CONFIG_HOME/llm-log/config.toml`, fallback `~/.config/llm-log/config.toml` - default mutable state/corpus: `~/.llm-proxy` - storage-default implementation: `dd493e34c9a1702395cfa5c7776b045745ac2696` - canonical Org decision update: `64713e26eb32cc376d86de3764e4188a1194f403` - missing implicit/default config is allowed; missing explicit `--config` errors - schema version + unknown-key/type validation - runtime defaults < TOML < CLI - `--prolog-classifier` / `--no-prolog-classifier` - `--upstream NAME=URL` overrides individual providers while preserving others - flake `apps.default` / `apps.llm-log` for `nix run ... -- serve` - Home Manager service/module retained and documented ## Validation The earlier focused local config contract was 6/6 passing against the preceding configuration implementation. The new `~/.llm-proxy` correction has RED-first test and implementation commits, but no new local execution is claimed from this environment. The repository still intentionally has no GitHub Actions development loop. Full local Python/Nix verification is required before merge. ## Security No credential storage was added. Nix config contains runtime/upstream routing only; client auth continues to be forwarded and capture persistence continues to redact secret headers.
This pull request has changes conflicting with the target branch.
  • README.md
  • llm_log/cli.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin rage/4-unified-config:rage/4-unified-config
git switch rage/4-unified-config

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff rage/4-unified-config
git switch rage/4-unified-config
git rebase main
git switch main
git merge --ff-only rage/4-unified-config
git switch rage/4-unified-config
git rebase main
git switch main
git merge --no-ff rage/4-unified-config
git switch main
git merge --squash rage/4-unified-config
git switch main
git merge --ff-only rage/4-unified-config
git switch main
git merge rage/4-unified-config
git push origin main
Sign in to join this conversation.
No description provided.