feat: persistent CLI configuration with layered resolution#2
Merged
Conversation
Add TOML-based config system with two-layer design: - Layer 1: TOML config file (.arcan/config.toml) for pre-daemon settings - Layer 2: Lago SessionManifest for post-daemon agent context Resolution chain: hardcoded defaults → global config → project-local config → env vars → CLI flags. New CLI commands: - `arcan config init/set/get/list` — manage persistent configuration - `arcan status` — show provider, model, port, daemon status - `arcan stop` — graceful daemon shutdown via SIGTERM New global flags: --provider, --model (--port now Optional). Provider construction refactored to use from_resolved() constructors that accept config overrides while always reading API keys from env vars. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The arcan workspace has path dependencies to ../aiOS/ and ../lago/ which are sibling repos in the monorepo. CI was failing because these weren't available. Now each job clones them with --depth 1. Also fixes MSRV check from 1.80.0 to 1.85.0 (Rust 2024 edition). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix 3 pre-existing clippy lints caught by newer stable clippy: needless borrow in context.rs test, len comparison in context_compiler.rs test, unnecessary closure in runtime.rs test - Fix 2 clippy lints in config.rs tests (field_reassign_with_default) - Update deny.toml for cargo-deny v2 schema (remove deprecated keys) - Bump MSRV check to 1.88.0 (transitive deps require it) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate [advisories] and [licenses] to version 2 format. Remove deprecated keys (vulnerability, unlicensed) — these are now deny-by-default in v2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cargo-deny-action runs in a Docker container which can't see the sibling ../aiOS and ../lago directories. Switch to installing cargo-deny directly and running it on the host. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add license.workspace = true to arcan-tui Cargo.toml (was missing) - Ignore RUSTSEC-2024-0436 (paste unmaintained) — transitive dep from ratatui, no action until upstream migrates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arcan config init/set/get/list,arcan status,arcan stop--providerand--model;--portnow optional with config fallbackfrom_resolved()constructors that accept config overrides while always reading API keys from env vars (never from config file)Example Usage
Files Changed
crates/arcan/src/config.rsResolvedConfigcrates/arcan/src/main.rsmod config, global flags, Config/Status/Stop commands, refactored provider selectioncrates/arcan/src/daemon.rsstop_daemon()crates/arcan/src/cli_run.rscrates/arcan/Cargo.tomltoml,dirsdepsCargo.toml(workspace)toml,dirsto workspace depscrates/arcan-provider/src/anthropic.rsfrom_resolved()constructorcrates/arcan-provider/src/openai.rsopenai_from_resolved(),ollama_from_resolved()constructorsTest plan
cargo fmt && cargo clippy --workspace -- -D warningspassescargo test --workspace— 246 tests passing (+1 ignored)cargo build --workspacesucceedsarcan config init && arcan config set provider mock && arcan config listarcan statusshows resolved configarcan run "Hello" --provider mock(CLI override)arcan stopgraceful shutdown🤖 Generated with Claude Code