feat(runs): durable cursors and idempotent live control (#604) - #641
Conversation
Wire issue #604 on the lifecycle journal: opaque event cursors for `runs events`, closed control.* event types, and request-id idempotency for app-server steer/interrupt without storing steering text. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: escoffier-labs/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Post-merge grading review found one Critical and two Major defects in the control-journaling half of this PR - the cursor codec and runs events reader are sound and unaffected. Until #651 lands, treat live 'runs steer'/'interrupt' against journal-backed runs as unsafe: the control CLI is a second OS process appending to the lifecycle journal under a process-local lock, and a collision with the run owner forks the hash chain with no recovery path (details, file:line evidence, and the fix contract are in #651). If the cross-process lock cannot land promptly, revert the control-journaling half and keep the reader. |
Summary
brigade runs eventswith opaque durable cursors (--after,--follow, NDJSON).control.requested/control.observed/control.failedevent types (reference fields and digests only; no steering text).runs steer/runs interruptidempotent via--request-id, with replay, conflict, and indeterminate semantics on the journal.Closes #604.
Verify
Receipt ID:
20260801-032545-work-verify-0782e0Acceptance criteria → tests
test_events_follow_restart_with_cursor_emits_each_later_event_oncetest_events_completed_run_same_cursor_produces_same_suffixtest_events_cursor_failures_emit_no_unverified_suffixtest_idempotent_request_id_replays_without_second_transport_calltest_request_id_fingerprint_conflicttest_control_crash_pointstest_indeterminate_control_request_is_not_reissuedtest_control_payload_never_contains_steering_text,test_control_requested_rejects_*test_control_event_types_registered_with_closed_payload_keys,test_control_requested_rejects_unknown_payload_key_with_bounded_diagnosticruns watch, control without--request-id, legacy artifacts compatibletests/test_run_control.py+test_cli_explicit_request_id_on_legacy_run_fails/test_events_legacy_run_reports_legacy_no_journalrun_event_cursor.py,run_control_journal.pyNotes for reviewers
codex/issue-604-*worktrees;run_idtightened to the journal alphabet.append_eventundercheckpoint_event_pairand sync shadow afterward so authoritative runs do not tripjournal-ahead-of-evidence.Test plan
./scripts/verifyvia Brigade (receipt above)Made with Cursor