From a131c880e2b67eb88ac076e6e343765bd0c96ae3 Mon Sep 17 00:00:00 2001 From: Levi Neuwirth Date: Wed, 29 Jul 2026 21:34:42 -0400 Subject: [PATCH] test(stage2a): make acceptance 53's attribution assertion bite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bite-verifying the round-1 pins caught one of them passing with the bug restored. `contains("only.txt")` was satisfied by the status message's own `deleted only.txt:` prefix — the deleted path's basename — so stripping the `buffer "…"` attribution changed nothing the assertion could see. Both halves now assert the buffer's OWN name, which for a path-backed buffer is the full path and which only the attribution can produce. Dropping either name — the refusal reason's or the kept-modified list's — now fails. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Lv428Fth9LRtffwJSsqH7T --- tests/resource_reconciliation_acceptance.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/resource_reconciliation_acceptance.rs b/tests/resource_reconciliation_acceptance.rs index 63870a0..c9beba4 100644 --- a/tests/resource_reconciliation_acceptance.rs +++ b/tests/resource_reconciliation_acceptance.rs @@ -916,11 +916,18 @@ fn acc53_the_last_buffer_refusal_keeps_the_buffer_and_the_rest_proceeds() { said.contains("could not be closed"), "the refusal must reach the status channel; status was {said:?}" ); + // Asserted as the buffer's OWN name, not as the basename. The + // message opens with `deleted only.txt:` — the *path* — so a + // `contains("only.txt")` check passes with the attribution stripped, + // which is exactly how this assertion was vacuous when first + // written. A path-backed buffer's name is the full path, and only + // the `buffer "…"` prefix can produce it. + let expect_named = format!("buffer {:?}", only.display().to_string()); assert!( - said.contains("only.txt"), - "and must name the buffer, because `cannot kill the last \ + said.contains(&expect_named), + "the refusal must name the buffer, because `cannot kill the last \ remaining buffer` alone does not say WHICH buffer is now bound \ - to a deleted path; status was {said:?}" + to a deleted path; wanted {expect_named:?} in {said:?}" ); // Half two: a directory of buffers where one refuses removal. The @@ -968,9 +975,12 @@ fn acc53_the_last_buffer_refusal_keeps_the_buffer_and_the_rest_proceeds() { "and the report must state the consequence — saving it puts the \ deleted file back; status was {said2:?}" ); + // Same discipline: the full path is the buffer's name, while the + // message's `deleted b.txt:` prefix is only the basename. assert!( - said2.contains("b.txt"), - "naming the buffer; status was {said2:?}" + said2.contains(&b.display().to_string()), + "the kept buffer must be named, and by its own name rather than \ + the deleted path's basename; status was {said2:?}" ); }