feat(app): integrate Vault config source into startup flow (#299)#311
Open
feat(app): integrate Vault config source into startup flow (#299)#311
Conversation
Integrate rara-vault into rara-app startup and config sync paths. - add optional vault config to AppConfig and bootstrap merge logic\n- seed settings from bootstrapped config, plus add watcher and vault writeback\n- cover vault serde, merge, watcher, and config sync behavior with tests
- Consolidate VaultClient creation: build once in start_with_options, share via Arc across bootstrap, config_sync, and watcher (was 3 separate login calls) - Prevent vault watcher ↔ config_sync echo loop: shared AtomicU64 timestamp tracks last push, watcher skips apply within 5s grace window - Fix config_path resolution: prefer local ./config.yaml if exists, fall back to rara_paths::config_file() (was hardcoded to cwd) - Remove hardcoded defaults for VaultConfig.mount_path and fallback_to_local (must be explicit in YAML) - Replace filter_map that never filters with map in flatten_value - Refactor vault_bootstrap::pull_and_merge to accept &VaultClient instead of creating its own 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
Type of change
Closes
Closes #299
Test plan
Validated with:
🔧 Formatting Rust code...
🔧 Formatting TOML files...
🔧 Formatting YAML files...
🔧 Formatting with hawkeye...
2026-03-13T10:21:56.042412Z WARN hawkeye::cli: Processing unknown files: ["/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/crates/cmd/wix/main.wxs", "/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/crates/integrations/mcp/justfile", "/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/crates/common/yunara-store/justfile", "/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/justfile", "/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/env.local.example", "/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/.yamllint", "/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/execution/workers/rara-py-worker/justfile", "/Users/ryan/code/rararulab/rara/.worktrees/codex-vault-app-integration/execution/workers/rara-py-worker/.python-version"]
✅ All formatting complete!
running 18 tests
test tools::settings::tests::non_sensitive_keys_not_masked ... ok
test tools::mita_evolve_soul::tests::tool_has_required_params ... ok
test tools::settings::tests::mask_sensitive_keys ... ok
test vault_watcher::tests::versions_changed_detects_metadata_updates ... ok
test flatten::tests::unflatten_empty_map_returns_none ... ok
test vault_watcher::tests::build_settings_patches_updates_changed_values ... ok
test vault_bootstrap::tests::pull_and_merge_returns_false_when_no_vault_configured ... ok
test vault_bootstrap::tests::merge_vault_pairs_does_not_override_when_empty ... ok
test config_sync::tests::appconfig_without_vault_parses ... ok
test config_sync::tests::appconfig_with_vault_yaml_roundtrip ... ok
test vault_bootstrap::tests::merge_vault_pairs_overrides_llm ... ok
test flatten::tests::roundtrip_flatten_unflatten ... ok
test config_sync::tests::appconfig_yaml_roundtrip ... ok
test tests::app_config_loads_from_global_fallback_when_local_is_missing ... ok
test tests::app_config_prefers_local_override_over_global ... ok
test config_sync::tests::writeback_without_vault_still_works ... ok
test config_sync::tests::initial_sync_prefers_bootstrapped_config ... ok
test config_sync::tests::sync_from_file_populates_kv ... ok
test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
running 1 test
test anchor_checkout_roundtrip ... ignored, uses the real LLM provider — run with: cargo test -p rara-app --test anchor_checkout_e2e -- --ignored --nocapture
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
running 1 test
test real_model_soak_test_survives_long_tape_pressure ... ignored, uses the real LLM provider configured in config.yaml and runs a long soak
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Notes: