Skip to content

Commit a14e82b

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 ca87ddf commit a14e82b

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
@@ -519,7 +519,7 @@ mod tests {
519519

520520
use super::*;
521521
use crate::services::mutation_trace::store::encode_revision;
522-
use crate::services::mutation_trace::types::{Attribution, FailureKind, ScopeStatus};
522+
use crate::services::mutation_trace::types::{Attribution, EventKey, FailureKind, ScopeStatus};
523523

524524
static NEXT_TEST_DB_ID: AtomicU64 = AtomicU64::new(0);
525525

@@ -2066,11 +2066,17 @@ mod tests {
20662066
);
20672067
std::fs::write(repo_root.join("work.txt"), b"b").expect("the A -> B edit should write");
20682068

2069+
let advance_event = EventId("evt-advance".to_string());
2070+
let event_key = EventKey {
2071+
scope_id: scope.clone(),
2072+
event_id: advance_event.clone(),
2073+
};
2074+
20692075
let error = coordinate_inner(
20702076
&repo_root,
20712077
&RuntimeBoundary::Advance {
20722078
scope: scope.clone(),
2073-
event: EventId("evt-advance".to_string()),
2079+
event: advance_event.clone(),
20742080
actor_kind: ActorKind::ClaudeCode,
20752081
},
20762082
ok_db,
@@ -2092,7 +2098,7 @@ mod tests {
20922098
let store_db = ok_db().expect("reopening the DB for assertions should succeed");
20932099
let store = MutationTraceStore::new(&store_db);
20942100
let after_fail = store
2095-
.load_worktree(&worktree_id, Some(&scope), None)
2101+
.load_worktree(&worktree_id, Some(&scope), Some(&event_key))
20962102
.expect("loading the worktree row should succeed")
20972103
.expect("the worktree row should exist");
20982104
assert!(
@@ -2118,7 +2124,7 @@ mod tests {
21182124
"the live scope was abandoned by the durable recovery"
21192125
);
21202126
assert!(
2121-
after_fail.processed_events.is_empty(),
2127+
!after_fail.processed_events.contains(&event_key),
21222128
"the triggering Advance must never have been processed"
21232129
);
21242130
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)