Skip to main content

trusty_code/
redundant_run.rs

1//! Redundant full-suite test re-run suppression (#2682).
2//!
3//! Why: (bake-off L1 diagnosis) The delegated engineer re-runs the full test
4//! suite 7-14x per run, typically framed as "one final run to confirm", even
5//! when NO code has changed since the last clean pass. Each redundant re-run
6//! burns a whole turn (and the suite's wall-clock cost), inflating tcode's
7//! turn count (~33-49) far above claude-code's (~15) on the same challenge.
8//! The sibling verify-before-finish gate (#2279) guarantees the suite runs at
9//! LEAST once; this module is its complement — it stops the suite running MORE
10//! than it needs to. Together they bracket the correct behaviour: exactly one
11//! clean full-suite pass after the last code change, no more and no less.
12//! What: [`is_redundant_test_rerun`] is a pure predicate over a loop's
13//! transcript. A proposed `bash` test invocation is redundant iff the most
14//! recent prior test invocation ran the BYTE-IDENTICAL command, already PASSED,
15//! and nothing that could have changed the tree (a `write_file`/`write_files`/
16//! `edit`, or any non-test `bash` command) has run since. Command identity is
17//! load-bearing (#2804 review): a narrow run passing (`cargo test -p a`) must
18//! never suppress a broader/different one (`cargo test --workspace`,
19//! `cargo test -p b`) that never actually ran, nor may a compile-only
20//! `cargo test --no-run` suppress the real subsequent run. The predicate reuses
21//! `verify_gate`'s `is_test_command` / `bash_command_from_call` so the two
22//! gates can never drift on what counts as a test invocation. `agent_loop::AgentLoop`'s
23//! dispatch loop consults it (when suppression is enabled via
24//! `AgentLoop::with_redundant_run_suppression`) and, on a match, short-circuits
25//! the dispatch with [`REDUNDANT_RERUN_MESSAGE`] instead of actually spawning
26//! the suite — saving the turn's wall-clock cost and nudging the model to
27//! proceed to finish. (#2857) That short-circuit is itself a decision that
28//! silently changes the run's outcome (a test invocation the model requested
29//! did NOT happen), so `agent_loop::AgentLoop::dispatch_all` logs it via
30//! `tracing::info!` at the call site — a suppressed run is still the
31//! expected, by-design outcome (not a failure), so `info` rather than `warn`.
32//! Test: `redundant_run::tests::*`, plus
33//! `agent_loop::tests::redundant_test_rerun_is_suppressed`,
34//! `agent_loop::tests::test_rerun_after_edit_is_not_suppressed`, and
35//! `agent_loop::tests::redundant_rerun_suppression_logs_info`.
36//!
37//! [`is_redundant_test_rerun`]: crate::redundant_run::is_redundant_test_rerun
38//! [`REDUNDANT_RERUN_MESSAGE`]: crate::redundant_run::REDUNDANT_RERUN_MESSAGE
39
40use crate::llm::{ChatMessage, ToolCall};
41use crate::tools::BASH_TOOL_NAME;
42use crate::verify_gate::{bash_command_from_call, is_test_command};
43
44/// The `ToolResult` text returned in place of a suppressed redundant re-run.
45///
46/// Why: The model must understand WHY its test command produced no fresh
47/// output, so it stops retrying and moves on — a silent no-op would just
48/// invite another confirmation run. Phrasing it as a normal (non-error)
49/// result keeps the loop calm: nothing failed, the prior pass still stands.
50/// What: A fixed, model-facing sentence explaining the suppression and the
51/// invariant it relies on — the SAME command already passed and no code has
52/// changed since. It is only ever emitted for a byte-identical re-run (see
53/// [`is_redundant_test_rerun`]), so "this exact command" is always accurate.
54/// Test: `redundant_run::tests::suppression_message_is_informative`.
55pub const REDUNDANT_RERUN_MESSAGE: &str = "skipped: this exact test command already passed \
56earlier in this session and no code has changed since (no write_file/edit and no other shell \
57command ran between that passing run and this one). Re-running the identical command would \
58produce the same result and cost a turn. The prior clean pass still stands — proceed to finish \
59the task, or run a DIFFERENT (e.g. broader) command if you need to verify something the passing \
60run did not cover.";
61
62/// Tool names that are pure read-only discovery and therefore CANNOT
63/// invalidate a passing test baseline.
64///
65/// Why: Between a clean test pass and a redundant re-run the model typically
66/// does nothing, or merely re-reads files — none of which changes the tree, so
67/// none of which makes a re-run non-redundant. Anything NOT on this allowlist
68/// (a write, an edit, an arbitrary shell command, a skill load, a delegation)
69/// is treated as potentially state-changing, which errs toward RUNNING the
70/// suite — the conservative, correctness-first default the acceptance criteria
71/// demand ("the single final run must still occur after the last code change").
72/// What: The read-only file/discovery tools registered in the engineer's tool
73/// set. `bash` is deliberately absent — a `bash` call is classified by its
74/// command (a test command preserves the baseline; any other command is
75/// treated as potentially mutating).
76/// Test: `redundant_run::tests::read_only_activity_keeps_run_redundant`,
77/// `redundant_run::tests::non_test_bash_between_runs_defeats_suppression`.
78const READ_ONLY_TOOLS: &[&str] = &[
79    "read_file",
80    "grep",
81    "glob",
82    "list_dir",
83    "search_code",
84    "recall_session",
85];
86
87/// Whether a `bash` tool-result's captured output indicates the command exited
88/// 0 (the suite PASSED).
89///
90/// Why: Only a PASSING prior run makes a re-run redundant — re-running a suite
91/// that last FAILED is legitimate (the model may have fixed something, or may
92/// be re-reading the failure), so the gate must never suppress it. The bash
93/// tool always appends a final `exit_code: N` line to its captured output
94/// (`tools::bash`), which is the one reliable pass/fail signal available from
95/// the transcript.
96/// What: `true` iff the result text, trimmed of trailing whitespace, ends with
97/// exactly `exit_code: 0`. `exit_code: 10` / `exit_code: 1` and the
98/// suppression sentinel (which carries no `exit_code:` line) all read as "not
99/// a pass".
100/// Test: `redundant_run::tests::exit_zero_reads_as_pass`,
101/// `redundant_run::tests::nonzero_and_missing_exit_read_as_not_pass`.
102fn test_result_passed(result_content: &str) -> bool {
103    result_content.trim_end().ends_with("exit_code: 0")
104}
105
106/// Whether the `tool`-role result answering `call_id` in `messages` reports a
107/// passing exit.
108///
109/// Why: A test invocation only establishes a passing baseline once its result
110/// has actually been recorded and shows exit 0; a call whose result is not yet
111/// present (e.g. the proposed re-run itself, mid-dispatch) must not count.
112/// What: Finds the first `tool` message whose `tool_call_id == call_id` and
113/// applies [`test_result_passed`] to its content; `false` when absent.
114/// Test: exercised via `is_redundant_test_rerun` in
115/// `redundant_run::tests::passing_prior_run_makes_rerun_redundant`,
116/// `redundant_run::tests::failing_prior_run_is_not_redundant`.
117fn call_result_passed(messages: &[ChatMessage], call_id: &str) -> bool {
118    messages
119        .iter()
120        .find(|m| m.role == "tool" && m.tool_call_id.as_deref() == Some(call_id))
121        .and_then(|m| m.content.as_deref())
122        .map(test_result_passed)
123        .unwrap_or(false)
124}
125
126/// Fold one completed tool `call` into the running baseline: the exact command
127/// string of the most recent test run that PASSED with nothing state-changing
128/// since, or `None`.
129///
130/// Why: Centralises the single rule that decides, per tool call, whether a
131/// prior clean test pass survives it — and, critically (#2804 review),
132/// remembers WHICH command passed so a later re-run is only suppressed when it
133/// is byte-identical. A bare `bool` would wrongly suppress a broader/different
134/// command (`cargo test --workspace`) just because a narrower one
135/// (`cargo test -- foo`) passed.
136/// What: A passing `bash` test command SETS the baseline to `Some(command)`; a
137/// FAILING test command CLEARS it (`None`); any other `bash` command CLEARS it
138/// (a shell command may have mutated the tree); a [`READ_ONLY_TOOLS`] call
139/// leaves it unchanged; every other tool CLEARS it (conservative — treat
140/// unknown effects as state-changing).
141/// Test: exercised via `is_redundant_test_rerun` across
142/// `redundant_run::tests::*`.
143fn fold_call(baseline: &mut Option<String>, call: &ToolCall, messages: &[ChatMessage]) {
144    if let Some(command) = bash_command_from_call(call) {
145        *baseline = (is_test_command(&command) && call_result_passed(messages, &call.id))
146            .then_some(command);
147        return;
148    }
149    if READ_ONLY_TOOLS.contains(&call.function.name.as_str()) {
150        return;
151    }
152    *baseline = None;
153}
154
155/// Whether two shell command strings are the "same" test invocation for
156/// suppression purposes.
157///
158/// Why: Suppression must require command IDENTITY (#2804 review): re-running a
159/// DIFFERENT command — a broader scope, a different package, a previously
160/// compile-only `--no-run` now actually executing — is a genuinely-needed run,
161/// never redundant. Defaulting to exact match (not a fuzzy/normalized one)
162/// keeps the gate conservative: a false "same" verdict would suppress a real
163/// run, so anything short of certainty must read as "different".
164/// What: Exact string equality after trimming leading/trailing whitespace only
165/// — the sole normalization, so a stray surrounding space cannot force an
166/// otherwise-identical re-run to execute. Internal differences (flags, paths,
167/// package selectors, `--no-run`) are all preserved and therefore all count as
168/// a different command.
169/// Test: `redundant_run::tests::different_test_command_after_pass_is_not_redundant`,
170/// `redundant_run::tests::passing_prior_run_makes_rerun_redundant`.
171fn same_test_command(baseline: &str, pending: &str) -> bool {
172    baseline.trim() == pending.trim()
173}
174
175/// Whether the pending `bash` test call `current_call_id` would be a redundant
176/// re-run: the SAME command already passed with nothing changed since.
177///
178/// Why: This is the gate `agent_loop::AgentLoop::dispatch_all` consults before
179/// spawning a test suite — the whole point of #2682. It must be conservative:
180/// a `true` result suppresses a real execution, so a false positive would hide
181/// a genuinely-needed run. The predicate therefore only returns `true` when a
182/// prior run demonstrably PASSED, every tool call since is demonstrably
183/// non-mutating, AND (#2804 review) the pending command is byte-identical to
184/// that passing command — a broader or otherwise-different command is never
185/// suppressed.
186/// What: Folds every assistant tool call in `messages`, in order, up to (but
187/// excluding) the call identified by `current_call_id` — the proposed re-run
188/// itself, and anything after it, is irrelevant — tracking the exact command
189/// of the most recent still-valid passing test run (or `None`). On reaching
190/// the pending call, extracts ITS command and returns `true` only when a
191/// baseline command exists and [`same_test_command`] holds. Because the
192/// proposed call's own (not-yet-recorded) result is never consulted, and any
193/// same-turn write/edit BEFORE it clears the baseline, the answer reflects tree
194/// state exactly as of just before the re-run.
195/// Test: `redundant_run::tests::passing_prior_run_makes_rerun_redundant`,
196/// `redundant_run::tests::different_test_command_after_pass_is_not_redundant`,
197/// `redundant_run::tests::failing_prior_run_is_not_redundant`,
198/// `redundant_run::tests::edit_between_runs_defeats_suppression`,
199/// `redundant_run::tests::no_prior_run_is_not_redundant`,
200/// `redundant_run::tests::same_turn_edit_before_rerun_defeats_suppression`.
201pub fn is_redundant_test_rerun(messages: &[ChatMessage], current_call_id: &str) -> bool {
202    let mut baseline: Option<String> = None;
203    for message in messages {
204        if message.role != "assistant" {
205            continue;
206        }
207        let Some(calls) = message.tool_calls.as_ref() else {
208            continue;
209        };
210        for call in calls {
211            if call.id == current_call_id {
212                return match (baseline.as_deref(), bash_command_from_call(call)) {
213                    (Some(passed), Some(pending)) => same_test_command(passed, &pending),
214                    _ => false,
215                };
216            }
217            fold_call(&mut baseline, call, messages);
218        }
219    }
220    // The pending call was not found in the transcript — fail safe (never
221    // suppress a call we cannot locate). In practice `dispatch_all` always
222    // passes a `call.id` present in the just-pushed assistant turn.
223    false
224}
225
226/// Whether `call` is a `bash` invocation of a test command — the cheap
227/// pre-filter `dispatch_all` applies before the fuller
228/// [`is_redundant_test_rerun`] transcript scan.
229///
230/// Why: Only a `bash` test call can ever be a redundant re-run, so the dispatch
231/// loop should not pay for the transcript scan on every other tool call.
232/// What: `true` iff `call` names [`BASH_TOOL_NAME`] and its extracted command
233/// [`is_test_command`].
234/// Test: `redundant_run::tests::is_test_bash_call_true_only_for_test_bash`.
235pub fn is_test_bash_call(call: &ToolCall) -> bool {
236    call.function.name == BASH_TOOL_NAME
237        && bash_command_from_call(call).is_some_and(|c| is_test_command(&c))
238}
239
240// ── Tests ─────────────────────────────────────────────────────────────────────
241
242#[cfg(test)]
243mod tests {
244    use super::*;
245    use crate::llm::FunctionCall;
246
247    /// Build a `bash` tool call with the given id and command.
248    fn bash_call(id: &str, command: &str) -> ToolCall {
249        ToolCall {
250            id: id.into(),
251            kind: "function".into(),
252            function: FunctionCall {
253                name: BASH_TOOL_NAME.into(),
254                arguments: serde_json::json!({ "command": command }).to_string(),
255            },
256        }
257    }
258
259    /// Build a non-`bash` tool call (e.g. `write_file`, `read_file`).
260    fn tool_call(id: &str, name: &str) -> ToolCall {
261        ToolCall {
262            id: id.into(),
263            kind: "function".into(),
264            function: FunctionCall {
265                name: name.into(),
266                arguments: "{}".into(),
267            },
268        }
269    }
270
271    /// An assistant turn carrying the given tool calls.
272    fn assistant(calls: Vec<ToolCall>) -> ChatMessage {
273        ChatMessage {
274            role: "assistant".into(),
275            content: None,
276            images: vec![],
277            tool_calls: Some(calls),
278            tool_call_id: None,
279            name: None,
280            cache_control: None,
281        }
282    }
283
284    /// A `tool`-role result answering `call_id` with a bash-shaped body ending
285    /// in `exit_code: {code}`.
286    fn bash_result(call_id: &str, code: i32) -> ChatMessage {
287        ChatMessage::tool_result(
288            call_id,
289            BASH_TOOL_NAME,
290            format!("stdout:\nok\nexit_code: {code}"),
291        )
292    }
293
294    /// [`test_result_passed`] treats a trailing `exit_code: 0` as a pass.
295    ///
296    /// Why: Exit 0 is the one pass signal the bash tool guarantees.
297    /// What: Assert on a realistic passing bash body.
298    /// Test: this test.
299    #[test]
300    fn exit_zero_reads_as_pass() {
301        assert!(test_result_passed("stdout:\n5 passed\nexit_code: 0"));
302        assert!(test_result_passed("exit_code: 0\n"));
303    }
304
305    /// [`test_result_passed`] rejects non-zero and missing exit codes.
306    ///
307    /// Why: A failing or unknown run must never establish a passing baseline —
308    /// and `exit_code: 10` must not be mistaken for `exit_code: 0`.
309    /// What: Non-zero exits, the suppression sentinel, and empty text.
310    /// Test: this test.
311    #[test]
312    fn nonzero_and_missing_exit_read_as_not_pass() {
313        assert!(!test_result_passed("stderr:\nFAILED\nexit_code: 1"));
314        assert!(!test_result_passed("exit_code: 10"));
315        assert!(!test_result_passed(REDUNDANT_RERUN_MESSAGE));
316        assert!(!test_result_passed(""));
317    }
318
319    /// A passing prior run with nothing since makes an identical re-run
320    /// redundant.
321    ///
322    /// Why: This is the core acceptance behaviour — the exact "one final run to
323    /// confirm" loop the ticket eliminates.
324    /// What: Turn 1 runs `cargo test` and it passes (exit 0); turn 2 proposes
325    /// `cargo test` again with nothing in between; assert redundant.
326    /// Test: this test.
327    #[test]
328    fn passing_prior_run_makes_rerun_redundant() {
329        let messages = vec![
330            assistant(vec![bash_call("t1", "cargo test -p trusty-code")]),
331            bash_result("t1", 0),
332            assistant(vec![bash_call("t2", "cargo test -p trusty-code")]),
333        ];
334        assert!(is_redundant_test_rerun(&messages, "t2"));
335    }
336
337    /// A DIFFERENT test command after a pass is NOT redundant — suppression
338    /// requires command IDENTITY (#2804 review).
339    ///
340    /// Why: A narrow run passing (`cargo test -p a`) must never suppress a
341    /// broader/different run (`cargo test -p b`, `cargo test --workspace`) that
342    /// was never actually executed — that would silently skip real coverage.
343    /// What: Turn 1 runs `cargo test -p a` and passes; turn 2 proposes
344    /// `cargo test -p b`; assert NOT redundant. The reverse (same command) is
345    /// covered by `passing_prior_run_makes_rerun_redundant`.
346    /// Test: this test.
347    #[test]
348    fn different_test_command_after_pass_is_not_redundant() {
349        let messages = vec![
350            assistant(vec![bash_call("t1", "cargo test -p a")]),
351            bash_result("t1", 0),
352            assistant(vec![bash_call("t2", "cargo test -p b")]),
353        ];
354        assert!(!is_redundant_test_rerun(&messages, "t2"));
355    }
356
357    /// A `--no-run` compile-only pass does NOT suppress a subsequent REAL run
358    /// of the same suite — because the real run's command string differs
359    /// (#2804 review, secondary concern).
360    ///
361    /// Why: `cargo test --no-run` compiles but executes zero tests, then exits
362    /// 0. Command-identity matching already prevents it suppressing a genuine
363    /// `cargo test` run: the two command strings are not equal, so the gate
364    /// treats them as different runs — no special-casing of `--no-run` needed.
365    /// What: Turn 1 runs `cargo test --no-run` (exit 0); turn 2 proposes the
366    /// real `cargo test`; assert NOT redundant.
367    /// Test: this test.
368    #[test]
369    fn compile_only_pass_does_not_suppress_real_run() {
370        let messages = vec![
371            assistant(vec![bash_call("t1", "cargo test --no-run")]),
372            bash_result("t1", 0),
373            assistant(vec![bash_call("t2", "cargo test")]),
374        ];
375        assert!(!is_redundant_test_rerun(&messages, "t2"));
376    }
377
378    /// Surrounding whitespace does not defeat identity — a re-run of the SAME
379    /// command with a stray leading/trailing space is still redundant.
380    ///
381    /// Why: `same_test_command` trims outer whitespace only, so a trivially
382    /// re-emitted command is still recognised while every internal difference
383    /// (flags, scope) is preserved.
384    /// What: Turn 1 `cargo test` passes; turn 2 proposes `  cargo test ` (outer
385    /// spaces); assert redundant.
386    /// Test: this test.
387    #[test]
388    fn outer_whitespace_does_not_defeat_identity() {
389        let messages = vec![
390            assistant(vec![bash_call("t1", "cargo test")]),
391            bash_result("t1", 0),
392            assistant(vec![bash_call("t2", "  cargo test ")]),
393        ];
394        assert!(is_redundant_test_rerun(&messages, "t2"));
395    }
396
397    /// A FAILING prior run makes a re-run NOT redundant.
398    ///
399    /// Why: The model may re-run a failing suite legitimately; suppressing it
400    /// would hide the failure and break the loop's self-correction.
401    /// What: Turn 1's `cargo test` exits 1; turn 2 proposes it again; assert
402    /// NOT redundant.
403    /// Test: this test.
404    #[test]
405    fn failing_prior_run_is_not_redundant() {
406        let messages = vec![
407            assistant(vec![bash_call("t1", "cargo test")]),
408            bash_result("t1", 1),
409            assistant(vec![bash_call("t2", "cargo test")]),
410        ];
411        assert!(!is_redundant_test_rerun(&messages, "t2"));
412    }
413
414    /// A `write_file`/`edit` between a passing run and a re-run defeats
415    /// suppression — the genuinely-needed post-change run still fires.
416    ///
417    /// Why: This is the correctness guarantee the acceptance criteria name:
418    /// "the single final run must still occur after the last code change".
419    /// What: pass → `edit` → propose re-run; assert NOT redundant.
420    /// Test: this test.
421    #[test]
422    fn edit_between_runs_defeats_suppression() {
423        let messages = vec![
424            assistant(vec![bash_call("t1", "cargo test")]),
425            bash_result("t1", 0),
426            assistant(vec![tool_call("e1", "edit")]),
427            ChatMessage::tool_result("e1", "edit", "edited"),
428            assistant(vec![bash_call("t2", "cargo test")]),
429        ];
430        assert!(!is_redundant_test_rerun(&messages, "t2"));
431    }
432
433    /// Read-only activity (read_file/grep/glob) between a passing run and a
434    /// re-run keeps the re-run redundant.
435    ///
436    /// Why: Re-reading files changes nothing on disk, so a re-run after only
437    /// reads is still a wasted confirmation.
438    /// What: pass → `read_file` + `grep` → propose re-run; assert redundant.
439    /// Test: this test.
440    #[test]
441    fn read_only_activity_keeps_run_redundant() {
442        let messages = vec![
443            assistant(vec![bash_call("t1", "pytest tests/ -v")]),
444            bash_result("t1", 0),
445            assistant(vec![tool_call("r1", "read_file"), tool_call("g1", "grep")]),
446            ChatMessage::tool_result("r1", "read_file", "..."),
447            ChatMessage::tool_result("g1", "grep", "..."),
448            assistant(vec![bash_call("t2", "pytest tests/ -v")]),
449        ];
450        assert!(is_redundant_test_rerun(&messages, "t2"));
451    }
452
453    /// A non-test `bash` command between runs defeats suppression.
454    ///
455    /// Why: An arbitrary shell command (`sed -i`, `git checkout`, a build) may
456    /// mutate the tree, so a subsequent test run is not provably redundant.
457    /// What: pass → `bash: git checkout .` → propose re-run; assert NOT
458    /// redundant.
459    /// Test: this test.
460    #[test]
461    fn non_test_bash_between_runs_defeats_suppression() {
462        let messages = vec![
463            assistant(vec![bash_call("t1", "cargo test")]),
464            bash_result("t1", 0),
465            assistant(vec![bash_call("b1", "git checkout .")]),
466            bash_result("b1", 0),
467            assistant(vec![bash_call("t2", "cargo test")]),
468        ];
469        assert!(!is_redundant_test_rerun(&messages, "t2"));
470    }
471
472    /// With no prior test run at all, the first run is never redundant.
473    ///
474    /// Why: The first execution is always genuinely needed — the gate must be
475    /// inert until a baseline exists.
476    /// What: A single proposed `cargo test` with empty history; assert NOT
477    /// redundant.
478    /// Test: this test.
479    #[test]
480    fn no_prior_run_is_not_redundant() {
481        let messages = vec![assistant(vec![bash_call("t1", "cargo test")])];
482        assert!(!is_redundant_test_rerun(&messages, "t1"));
483    }
484
485    /// A same-turn edit emitted BEFORE the re-run (batched) defeats
486    /// suppression.
487    ///
488    /// Why: The model can batch `edit` + `cargo test` in one turn; the edit
489    /// must invalidate the prior baseline even though it shares the proposed
490    /// run's turn.
491    /// What: pass → [turn: `edit` then `cargo test`]; propose the same-turn
492    /// `cargo test`; assert NOT redundant.
493    /// Test: this test.
494    #[test]
495    fn same_turn_edit_before_rerun_defeats_suppression() {
496        let messages = vec![
497            assistant(vec![bash_call("t1", "cargo test")]),
498            bash_result("t1", 0),
499            assistant(vec![tool_call("e1", "edit"), bash_call("t2", "cargo test")]),
500        ];
501        assert!(!is_redundant_test_rerun(&messages, "t2"));
502    }
503
504    /// [`is_test_bash_call`] is true only for a `bash` call whose command is a
505    /// test command.
506    ///
507    /// Why: The dispatch-loop pre-filter must not trip on a non-`bash` tool or
508    /// a non-test shell command.
509    /// What: A test bash call (true), a non-test bash call (false), a
510    /// `write_file` call (false).
511    /// Test: this test.
512    #[test]
513    fn is_test_bash_call_true_only_for_test_bash() {
514        assert!(is_test_bash_call(&bash_call("a", "cargo test")));
515        assert!(!is_test_bash_call(&bash_call("b", "git status")));
516        assert!(!is_test_bash_call(&tool_call("c", "write_file")));
517    }
518
519    /// The suppression message names the invariant it relies on so the model
520    /// can trust it.
521    ///
522    /// Why: A vague message would invite the very re-run it means to prevent.
523    /// What: Assert the sentinel mentions "already passed" and "proceed to
524    /// finish".
525    /// Test: this test.
526    #[test]
527    fn suppression_message_is_informative() {
528        assert!(REDUNDANT_RERUN_MESSAGE.contains("already passed"));
529        assert!(REDUNDANT_RERUN_MESSAGE.contains("proceed to finish"));
530    }
531}