Skip to content

Commit 2b7df35

Browse files
runtime+context: Tighten recovery boundary event assertion
Identify the triggering Advance by its scope and event key, then verify that recovery does not mark that boundary event as processed after a failed invocation. Record the tightened AC8 validation in the mutation-cursor-external-taint plan. Co-authored-by: SCE <sce@crocoder.dev>
1 parent 685cc12 commit 2b7df35

2 files changed

Lines changed: 71 additions & 15 deletions

File tree

cli/src/services/mutation_trace/runtime/coordinator.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ mod tests {
523523

524524
use super::*;
525525
use crate::services::mutation_trace::store::encode_revision;
526-
use crate::services::mutation_trace::types::{Attribution, FailureKind, ScopeStatus};
526+
use crate::services::mutation_trace::types::{Attribution, EventKey, FailureKind, ScopeStatus};
527527

528528
static NEXT_TEST_DB_ID: AtomicU64 = AtomicU64::new(0);
529529

@@ -2070,11 +2070,17 @@ mod tests {
20702070
);
20712071
std::fs::write(repo_root.join("work.txt"), b"b").expect("the A -> B edit should write");
20722072

2073+
let advance_event = EventId("evt-advance".to_string());
2074+
let event_key = EventKey {
2075+
scope_id: scope.clone(),
2076+
event_id: advance_event.clone(),
2077+
};
2078+
20732079
let error = coordinate_inner(
20742080
&repo_root,
20752081
&RuntimeBoundary::Advance {
20762082
scope: scope.clone(),
2077-
event: EventId("evt-advance".to_string()),
2083+
event: advance_event.clone(),
20782084
actor_kind: ActorKind::ClaudeCode,
20792085
},
20802086
ok_db,
@@ -2096,7 +2102,7 @@ mod tests {
20962102
let store_db = ok_db().expect("reopening the DB for assertions should succeed");
20972103
let store = MutationTraceStore::new(&store_db);
20982104
let after_fail = store
2099-
.load_worktree(&worktree_id, Some(&scope), None)
2105+
.load_worktree(&worktree_id, Some(&scope), Some(&event_key))
21002106
.expect("loading the worktree row should succeed")
21012107
.expect("the worktree row should exist");
21022108
assert!(
@@ -2122,7 +2128,7 @@ mod tests {
21222128
"the live scope was abandoned by the durable recovery"
21232129
);
21242130
assert!(
2125-
after_fail.processed_events.is_empty(),
2131+
!after_fail.processed_events.contains(&event_key),
21262132
"the triggering Advance must never have been processed"
21272133
);
21282134
assert!(

context/plans/mutation-cursor-external-taint.md

Lines changed: 61 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)