Capture immutable CLI startup defaults#1017
Merged
TheGreenCedar merged 1 commit intoJul 12, 2026
Merged
Conversation
81d04cc to
0619c78
Compare
0619c78 to
8d86375
Compare
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.
Context
PR #984 made endpoint/model/retrieval settings immutable per project, but
multi-project stdio still re-read the user home, project-network opt-in, stdio
cache root, and default cache root while switching projects. A changed process
environment could therefore move one request's SQLite or sidecar state and make
the two roots disagree.
The first CI run exposed the remaining split-root case: Linux stdio contracts
timed out when
CODESTORY_STDIO_CACHE_ROOT=Aand the project's explicit cacheroot was
B. The retained repair monitor wrote terminal state in A whilestatus, reconciliation, and broker reads reconstructed B and waited forever.
Closes #1015
Refs #912
Refs #884
Refs #897
Refs #899
What Changed
CliStartupConfigsnapshot for user home,project-network trust, stdio/default cache roots, and sidecar runtime defaults.
selection.
sidecar layout use the captured sidecar base independently of an explicit
project database cache override.
abandoned cleanup, stale-live detection, broker construction and persistence,
GPU identity, and status-cache fingerprints.
environment/cache reads.
trusted endpoints; retained the A/B/A endpoint/vector proof and added explicit
A/B repair-state non-leakage and abandoned-cleanup coverage.
flowchart LR S["Process startup snapshot"] --> D["Project database cache"] S --> R["Retained stdio sidecar cache"] R --> O["Repair status, locks, results, broker"]How To Review
CliStartupConfigincrates/codestory-cli/src/config.rs.RuntimeContext::new_with_startupinto the explicit in-cache sidecarconstructor.
stdio_agent_sidecar_for_runtimethrough reconciliation, brokersnapshots, repair monitoring, and status cache fingerprinting.
Verification
cargo test -p codestory-cli runtime::tests::explicit_startup_snapshots_isolate_concurrent_runtime_paths_and_endpoints -- --exact --nocapture— passedcargo test -p codestory-cli --test stdio_protocol_contracts multi_project_stdio_startup_snapshot_keeps_embedding_endpoints_isolated_across_a_b_a -- --exact --nocapture— passedcargo test -p codestory-cli readiness_broker::tests::reconcile_before_enqueue_for_sidecar_keeps_abandoned_cleanup_in_retained_root -- --nocapture— passedcontracts — 4 passed
cargo test -p codestory-cli --test stdio_protocol_contracts -- --nocapture— 51 passed, 0 failed, 9 ignored
cargo test -p codestory-cli --test architecture_contracts— 12 passedcargo check -p codestory-cli— passedcargo clippy -p codestory-cli --all-targets -- -D warnings— passedcargo build --release -p codestory-cli— passedchecks — passed
case was blocked by missing
CODESTORY_REAL_REPO_DRILL_CASES, and the releasestats case was blocked by missing
bge-base-en-v1.5.Q8_0.gguf/CODESTORY_EMBED_MODEL_DIR. The stats log was not changed.Risk
The change affects CLI cache and repair-state selection when
CODESTORY_STDIO_CACHE_ROOTis set. Project database overrides remain separate;all stdio sidecar coordination now intentionally follows the one retained
sidecar base. The first Linux CI run timed out on the split-root bug described
above; the amended head requires fresh Windows, Linux, and macOS proof. No UI
changed.