Skip to content

feat(buzz-acp): turn WIP checkpoints + four-way empty outcomes (WO #691) - #12

Merged
Theremoteaidoc merged 6 commits into
mainfrom
agent/cursor/wo691-turn-checkpointing
Aug 26, 2026
Merged

Theremoteaidoc merged 6 commits into
mainfrom
agent/cursor/wo691-turn-checkpointing

Conversation

@Theremoteaidoc

@Theremoteaidoc Theremoteaidoc commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Tracks seascope WO: https://github.com/Theremoteaidoc/remote-aid-medical/issues/691
(Buzz issues disabled — closing keyword cannot auto-close the WO; Orchestrator closes block#691 on merge.)

Closes block#691 (seascope WO; hand-close on merge)

SPEC-08 turn checkpointing (crates/buzz-acp):

  • wip_checkpoint.rs: OUTBOX/wip/<ts>.bundle drops every 5 min + on termination; latest_wip_bundle picks newest by mtime; split_empty_outcome classifies empty turns.
  • HeartbeatState replaces collapsed ReturnedEmpty with KilledTurnCap / KilledIdle / Crashed / Empty.
  • pool.rs: sidecar WIP ticker during run_prompt_task; force-drop on cancel/timeout/exit; resume path prepends resume_wip_hint when a WIP bundle exists.
  • Negative tripwire: test_wip_outbox_path_outside_branch_watcher_glob — wip/ path cannot match branch-watcher glob (OUTBOX/branch/request.go only).
  • Clippy 1.95 -D warnings cleared in touched buzz-acp files (dead_code allow on test-only extend_in_flight_deadline, is_multiple_of, ?, Error::other).

Branch-watcher unchanged (already persona-scoped to OUTBOX/branch/).

files-touched:

  • crates/buzz-acp/src/wip_checkpoint.rs
  • crates/buzz-acp/src/pool.rs
  • crates/buzz-acp/src/lib.rs
  • crates/buzz-acp/src/agent_heartbeat.rs
  • crates/buzz-acp/src/acp.rs (rustfmt)
  • crates/buzz-acp/src/liveness_watcher.rs (rustfmt + clippy)
  • crates/buzz-acp/src/queue.rs (rustfmt + clippy allow)
  • crates/buzz-acp/tests/initial_heartbeat.rs
  • crates/buzz-acp/tests/liveness_watcher.rs

Evidence

=== cargo test -p buzz-acp --lib wip_checkpoint ===
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.32s
     Running unittests src/lib.rs (target/debug/deps/buzz_acp-cffac62f1d39cfb8)

running 12 tests
test wip_checkpoint::tests::test_latest_wip_bundle_none_when_directory_empty ... ok
test wip_checkpoint::tests::test_maybe_drop_wip_does_not_fire_before_five_minutes ... ok
test wip_checkpoint::tests::test_maybe_drop_wip_fires_at_five_minutes ... ok
test wip_checkpoint::tests::test_split_empty_outcome_agent_exited_is_crashed ... ok
test wip_checkpoint::tests::test_maybe_drop_wip_fires_on_termination_signal_regardless_of_elapsed ... ok
test wip_checkpoint::tests::test_split_empty_outcome_hard_timeout_is_killed_turn_cap ... ok
test wip_checkpoint::tests::test_split_empty_outcome_idle_timeout_is_killed_idle ... ok
test wip_checkpoint::tests::test_split_empty_outcome_ok_no_output_is_empty ... ok
test wip_checkpoint::tests::test_split_empty_outcome_ok_with_message_is_none ... ok
test wip_checkpoint::tests::test_wip_outbox_path_outside_branch_watcher_glob ... ok
test wip_checkpoint::tests::test_latest_wip_bundle_picks_newest_not_alphabetical_first ... ok
test wip_checkpoint::tests::test_kill_at_25_minutes_resumes_from_bundle_within_5_minutes ... ok

test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 714 filtered out; finished in 0.02s


=== cargo test -p buzz-acp --lib empty_outcome_timeout_labels ===
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.32s
     Running unittests src/lib.rs (target/debug/deps/buzz_acp-cffac62f1d39cfb8)

running 1 test
test error_outcome_emission_tests::empty_outcome_timeout_labels_are_killed_not_returned_empty ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 725 filtered out; finished in 0.00s


=== cargo test -p buzz-acp --lib timeout_outcome_labels_differ ===
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.30s
     Running unittests src/lib.rs (target/debug/deps/buzz_acp-cffac62f1d39cfb8)

running 1 test
test error_outcome_emission_tests::timeout_outcome_labels_differ ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 725 filtered out; finished in 0.01s


=== cargo test -p buzz-acp --lib test_heartbeat_state_as_str ===
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.31s
     Running unittests src/lib.rs (target/debug/deps/buzz_acp-cffac62f1d39cfb8)

running 1 test
test agent_heartbeat::tests::test_heartbeat_state_as_str_covers_all_four_empty_kinds ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 725 filtered out; finished in 0.00s


=== git diff --stat origin/main...HEAD ===
 crates/buzz-acp/src/acp.rs                 |  30 +--
 crates/buzz-acp/src/agent_heartbeat.rs     | 152 ++++++-----
 crates/buzz-acp/src/lib.rs                 | 253 ++++++++++++-----
 crates/buzz-acp/src/liveness_watcher.rs    |  45 ++--
 crates/buzz-acp/src/pool.rs                |  68 ++++-
 crates/buzz-acp/src/queue.rs               |   7 +-
 crates/buzz-acp/src/wip_checkpoint.rs      | 417 +++++++++++++++++++++++++++++
 crates/buzz-acp/tests/initial_heartbeat.rs |   9 +-
 crates/buzz-acp/tests/liveness_watcher.rs  |  26 +-
 9 files changed, 809 insertions(+), 198 deletions(-)

Codex and others added 2 commits August 25, 2026 17:46
…ock#691)

SPEC-08: drop OUTBOX/wip bundles every 5 min and on termination; resume from
newest WIP; split returned_empty into killed_turn_cap / killed_idle / crashed / empty.
Cursor added 4 commits August 25, 2026 22:43
Use WIP_OUTBOX_REL / BRANCH_WATCHER_REQUEST_SUFFIX outside cfg(test),
drop needless as_deref_mut on the crashed-error arm, and rustfmt the
lint-failing heartbeat watcher tests.
Allow unused extend_in_flight_deadline (test-only call sites), use
is_multiple_of / ? / Error::other where clippy 1.95 requires them.
@Theremoteaidoc
Theremoteaidoc merged commit 76effaa into main Aug 26, 2026
25 of 30 checks passed
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.

1 participant