fix(init): require confirmation before overwriting ZEPH_DURABLE_KEY#5880
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 10, 2026 16:20
zeph init's durable-execution wizard step unconditionally overwrote ZEPH_DURABLE_KEY in the age vault on every re-run, silently and irrecoverably orphaning every previously-sealed durable_journal payload with no backup and no warning. The wizard now detects an existing key via vault_has_durable_key() before generating a new one. If a key already exists, it warns about permanent payload loss and requires typing the exact confirmation phrase "rotate" (checked via the new wants_rotation() pure function) before proceeding; any other input reuses the existing key untouched. Closes #5874
bug-ops
force-pushed
the
fix/5874-durable-key-overwrite
branch
from
July 10, 2026 16:28
ce5b850 to
77dda5b
Compare
7 tasks
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
zeph init's durable-execution wizard step unconditionally overwroteZEPH_DURABLE_KEYin the age vault on every re-run, with no check for a pre-existing key and no warning. Since this key seals every payload indurable_journal, silently rotating it permanently and irrecoverably orphaned all previously-sealed payloads (replay integrity check failed: sealed payload did not authenticate).vault_has_durable_key()helper before generating a new one. If a key already exists, it warns about permanent, irrecoverable payload loss and requires the user to type the exact confirmation phraserotate(validated by a newly-extracted purewants_rotation()function) before proceeding. Any other input reuses the existing key, leaving the vault untouched.src/init/durable.rsis the only production write site forZEPH_DURABLE_KEY— no other bypass path exists.Closes #5874
Test plan
cargo +nightly fmt --check— cleancargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings— cleancargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 12445 passedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"— cleanvault_has_durable_key(),store_durable_key()'s reuse/rotate/fresh-setup vault-mutation contract, andwants_rotation()'s exact/case-sensitive match semantics (21 tests total in thedurablefilter)