Skip to content

fix(query): retain AutoDream ownership through execution - #397

Draft
BunsDev wants to merge 1 commit into
mainfrom
fix/autodream-execution-lifetime
Draft

BunsDev wants to merge 1 commit into
mainfrom
fix/autodream-execution-lifetime

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Hold AutoDream exclusion until its agent exits and worktree cleanup is attempted; only a successful complete turn records consolidation success.

Context

Changes

  • Use a persistent OS-locked file shared by execution and finalization owners. Never unlink its inode or steal ownership based on age; recheck scheduling state after acquisition.
  • Deliver typed execution acknowledgement independently of Monitor state. MaxTokens remains Completed in Monitor but is Partial for AutoDream.
  • Join the query worker and attempt cleanup even after query panic before publishing acknowledgement.
  • Cancel revoked work and await execution exit before releasing its lock. A dropped completion waiter cannot release a live worker's lease.
  • Retry failed state writes while retaining ownership; revocation or shutdown ends the retry owner without recording success. Final state writes remain within one poll so cancellation cannot detach a pending write from its lock.

Validation

Verified on signed head 0aa9388df476d26ca523f19e9d238f4397e1e0d9, rebased onto main 0f7ae71. All required local checks below pass on this head, and all eight exact-head hosted checks pass. The PR remains draft while its explicit v0.9.0 merge hold is pending.

All Cargo checks use CARGO_INCREMENTAL=0 and isolated Coven homes. The full successful test run also isolates the OS model cache as described below.

  • git diff --check — passed.
  • cargo fmt --all and cargo fmt --all -- --check — passed.
  • cargo check --workspace --locked — passed.
  • cargo clippy --workspace --all-targets --locked -- -D warnings — passed.
  • RUST_TEST_THREADS=1 cargo test --workspace --locked — passed in full under macOS sandbox-exec, denying reads only to the real user model-cache file. No tests skipped or deadlines changed.
  • Earlier default-concurrency gates failed: CLI goal-dispatch exceeded 45 seconds while repeatedly reading the real model cache; isolating that cache made the identical test pass in 2.26 seconds. The cache-isolated concurrent gate then timed out in the ACP large-response fixture; that identical case passed alone in 18.18 seconds. Diagnose ACP smoke startup timeouts and preserve failure diagnostics #379 retains the ACP failure evidence. The successful serial run does not establish default-concurrency reliability.
  • cargo test -p claurst-query --lib --locked — 227 passed, 2 isolated workers ignored and invoked by parent tests.
  • Original lock-acquisition regression failed before the ownership change; cross-process exclusion, delayed cleanup, actual waiter abort, panic, partial/successful completion, goal pause/clear/replacement, missing receipt, and persistence retry checks pass.
  • Independent full-source review — no blocking findings.
  • Native Windows lock execution — not run locally; hosted verification remains needed.
  • TUI/manual UI checks — N/A; no TUI/input changes.

PR Readiness

  • Rebased cleanly onto main 0f7ae71; exact-head verification passed.
  • Diff is limited to three query files; generated files are unchanged.
  • No user-facing help or serialized contract changes.
  • No credentials or unrelated logs included.
  • Remaining limits: completion covers the owned query and cleanup attempt, not all transitive detached hooks or guaranteed successful worktree removal. Advisory locking assumes cooperating current binaries; it does not protect against external lock-path deletion. Combined revocation-during-persistence-retry has source coverage but no dedicated regression.

Coven-Harness: codex / gpt-6

Fixes #374. Supersedes #366.

Coven-Harness: codex / gpt-6
@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 18, 2026 11:21am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 0aa9388d Deployed Oct 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix AutoDream completion and lock ownership before landing #366

1 participant