From 1a906403cbac779fd6cdb75f82fd08e7e55c8152 Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Thu, 30 Apr 2026 15:31:30 +0200 Subject: [PATCH] =?UTF-8?q?MR-771:=20address=20cubic=20comment=20=E2=80=94?= =?UTF-8?q?=20drop=20vacuous=20=5F=5Frun=5F=5F=20check=20in=20cancel=20tes?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cubic correctly flagged that the assertion `!branches_after.iter().any(|b| b.starts_with("__run__"))` is vacuous because `branch_list()` already filters `__run__*` via `is_internal_system_branch`. The real structural property (no `__run__` branches can ever be created) is enforced by MR-771's deletion of `begin_run` etc. — that's a build-time invariant, not a runtime one. Drop the vacuous assertion; document why. The remaining checks (public branch list unchanged + `_graph_runs.lance` never reappears) cover the actual cancel-safety properties. Co-Authored-By: Claude Opus 4.7 --- crates/omnigraph/tests/runs.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/crates/omnigraph/tests/runs.rs b/crates/omnigraph/tests/runs.rs index 4581264..c83d914 100644 --- a/crates/omnigraph/tests/runs.rs +++ b/crates/omnigraph/tests/runs.rs @@ -369,19 +369,20 @@ async fn cancelled_mutation_future_leaves_no_state() { let branches_after = db.branch_list().await.unwrap(); // Cancel-safety property: no graph-level run/staging state remains. - // (1) No `__run__*` staging branches are created either way. - assert!( - !branches_after.iter().any(|b| b.starts_with("__run__")), - "cancelled mutation must not leave a __run__* branch behind", - ); - // (2) The branch list is otherwise unchanged: cancellation/completion - // cannot synthesize new public branches. + // + // Note: `branch_list()` already filters `__run__*` via + // `is_internal_system_branch`, so a runtime "no `__run__` branches" check + // would be vacuous. The structural property that no `__run__` branches + // can ever be created is enforced by deletion of `begin_run` etc. in + // MR-771 (verified by the build itself — those symbols no longer exist). + // + // (1) The branch list is unchanged: cancellation/completion cannot + // synthesize new public branches. assert_eq!( - branches_after.iter().filter(|b| !b.starts_with("__run__")).count(), - branches_before.iter().filter(|b| !b.starts_with("__run__")).count(), + branches_after, branches_before, "cancelled mutation must not synthesize new public branches", ); - // (3) The legacy run-state machine table never reappears. + // (2) The legacy run-state machine table never reappears on disk. assert!( !std::path::Path::new(&format!("{}/_graph_runs.lance", uri)).exists(), "no _graph_runs.lance after cancel — state machine is gone",