From 7e5b698c1c3c8f1995e1c81c72c927bd9d4c8b84 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 20 Nov 2026 15:51:12 -0700 Subject: [PATCH] test(mcp): say what the running-call test proves; name the phase watcher's type The running-call test passes even with a cut that marks every request inside (mutation check): the call runs in the session's task, past the handler's own check for a cut, so what it proves is that the close waits for the call and does not kill it. The line of the cut (a body read to its end is never cut) is proved at its seat by local::tests::a_body_read_to_its_end_is_never_cut_and_one_not_yet_is, which fails when a later poll can cut a whole body. Also a type alias for clippy's type_complexity. Co-Authored-By: Claude Sonnet 5.5 --- crates/ledger-cli/tests/book_open_close.rs | 7 ++++++- crates/ledger-store/src/backup.rs | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/ledger-cli/tests/book_open_close.rs b/crates/ledger-cli/tests/book_open_close.rs index 933d73fc..b04db0b9 100644 --- a/crates/ledger-cli/tests/book_open_close.rs +++ b/crates/ledger-cli/tests/book_open_close.rs @@ -1459,7 +1459,12 @@ fn a_slow_upload_that_finishes_within_the_grace_is_not_cut() { /// A call whose body is whole and that is running when the grace runs out /// is not cut: it ends, is answered and recorded as having run, and only -/// then is the close answered. +/// then is the close answered. What this proves is that the close waits for +/// the call and does not kill it; that a body read to its end is never cut +/// (the line of INVARIANT 15) is proved at its seat, by +/// `local::tests::a_body_read_to_its_end_is_never_cut_and_one_not_yet_is`: +/// this test passes even with a cut that marks every request inside (the +/// call runs in the session's task, past the handler's own check for a cut). #[cfg(unix)] #[test] fn a_running_call_is_never_cut_when_the_grace_runs_out() { diff --git a/crates/ledger-store/src/backup.rs b/crates/ledger-store/src/backup.rs index e994ab3b..6fafa93b 100644 --- a/crates/ledger-store/src/backup.rs +++ b/crates/ledger-store/src/backup.rs @@ -189,12 +189,15 @@ pub struct LockNote { pub why: &'static str, } +/// A watcher of a verification's phases ([`Git::with_phase_watch`]). +pub type PhaseWatch = std::sync::Arc; + /// What a caller may watch of a git's work, and look at after it (tests, /// and the server's record of a backup). #[derive(Clone, Default)] struct Watch { /// Told the name of each phase of a verification as it begins. - phase: Option>, + phase: Option, /// The lock files dealt with since the caller last took them. notes: std::sync::Arc>>, } @@ -285,7 +288,7 @@ impl Git { /// that makes a drill slow: `watch` may wait, but must give up when /// the cancel flag is set). #[must_use] - pub fn with_phase_watch(mut self, watch: std::sync::Arc) -> Self { + pub fn with_phase_watch(mut self, watch: PhaseWatch) -> Self { self.watch.phase = Some(watch); self }