feat(ward): integrate Phase 5 delayed-apply scheduler#430
Open
BunsDev wants to merge 7 commits into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add daemon-owned delayed proposal processing, durable decision claims, fail-closed evidence replay, transactional audit/baseline finalization, and concurrency-safe approved writes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Integrates Phase 5 delayed-apply scheduling and stricter authority replay into the coven-cli daemon/Ward boundary, including durable persistence and schema migration for audit/baseline state.
Changes:
- Adds a daemon-owned proposal envelope (
proposal_scheduler.rs) with strict JSON shape validation and replay-derived lifecycle fields. - Introduces conditional, fail-closed atomic commit for approved Ward applies, including rollback-on-mismatch semantics (
ward.rs). - Migrates/stamps the shared
ward_auditschema in the SQLite store and tightens baseline advancement to fail closed if surfaces changed (store.rs,threads_gate.rs).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/coven-cli/src/ward.rs | Adds approved-apply conditional atomic exchange/rollback path and platform support gating. |
| crates/coven-cli/src/threads_gate.rs | Exposes baseline/surface helpers for scheduler flows and adds post-apply baseline advancement guardrails. |
| crates/coven-cli/src/store.rs | Replaces unconditional ward audit schema init with migration/stamping logic and adds coverage tests. |
| crates/coven-cli/src/proposal_scheduler.rs | New strict scheduled-proposal envelope with replay validation and lifecycle derivation. |
| crates/coven-cli/src/main.rs | Registers the new proposal scheduler module. |
| crates/coven-cli/src/daemon.rs | Starts a background scheduler thread to process due threads proposals. |
| crates/coven-cli/Cargo.toml | Pins coven-threads-core to a specific Phase 5 revision. |
| Cargo.lock | Updates lockfile for the coven-threads-core revision/version bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+882
to
+885
| let mut prepared = Vec::with_capacity(edits.len()); | ||
| let mut preparation_error = None; | ||
| for (edit, decision) in edits.iter().zip(decisions) { | ||
| let result = (|| -> Result<PreparedConditionalWrite> { |
Comment on lines
+872
to
+875
| /// Existing targets are exchanged atomically with randomized sibling staging | ||
| /// files. The displaced inode is then compared with the approved before-image; | ||
| /// a mismatch swaps it back and rolls back every earlier edit in the batch. | ||
| /// Already-applied bytes are accepted so crash recovery remains idempotent. |
Expose a daemon-issued authority-envelope revision and canonical familiar UUID, then require manual Phase 5 decisions to carry the inspected revision through durable claim recovery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use recursively key-sorted compact JSON and SHA-256 so Cave can independently bind displayed staged contents to the daemon revision. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jul 20, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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
Validation
cargo fmt --all -- --checkCARGO_INCREMENTAL=0 cargo clippy -p coven-cli --all-targets --locked -- -D warningsCARGO_INCREMENTAL=0 cargo test -p coven-cli --locked(1,261 unit tests plus integration suites; expected ignored binary-only tests remain)Closes #429
Upstream: OpenCoven/coven-threads#15
Bead:
threads-uqx.6