(c680e24) Write a warning through a second stream on the sink, and bump to 0.33.2

check_blockers reported a blocker the board does not hold with eprintln!,
the one print site fa5662a left behind: a helper had no sink to reach, and
what it wrote was stderr rather than stdout. Harmless while main was the
only caller, and since 53ffb94 the command prompt runs the same handlers,
where stderr is the alternate screen with the columns on it. ratatui does
not repaint a cell it believes is unchanged, so the fragment stayed until
something else redrew them.

Sink carries two writers instead of one, because the CLI's two streams are
two: Sink::std hands the answer to stdout and an aside to stderr, so a
shell reads the same line on the same stream, and the integration test now
asserts that stderr whole rather than searching it. Sink::buffer holds its
warnings instead, and Board::run reads them back with Sink::warnings and
puts them above the answer on both outcomes -- a mv that warns about a
dangling blocker and is then refused by a real one wrote the aside first,
and it says why the refusal names one blocker and the ticket records two.

check_blockers and check_dependents both take the sink now, so their
refusals take the colour from it as well, rather than asking the process
about a stdout the board is not writing to.

no_handler_or_helper_reaches_a_print_macro walks src for the next print
site, each file cut at its own test module, since the rule is about every
future site rather than the one that broke.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ansho Rei
2026-09-10 11:53:10 +02:00
co-authored by Claude Opus 5
parent ead3c4340d
commit a017f9002e
8 changed files with 393 additions and 31 deletions
+14 -3
View File
@@ -906,6 +906,11 @@ fn mv_does_not_check_the_blockers_on_a_no_op() {
/// A dangling target is a bookkeeping fault, not a dependency. Refusing there would
/// wedge the ticket with no way out but `--force`.
///
/// The stderr is asserted whole rather than searched, and that is the point of the
/// assertion: c680e24 moved this warning off `eprintln!` and onto the sink's second
/// stream so the board could collect it, and a shell has to go on reading the line it
/// always read, on the stream it always read it from.
#[test]
fn mv_warns_and_allows_when_a_blocker_is_not_on_the_board() {
let temp = TempDir::new().unwrap();
@@ -920,10 +925,16 @@ fn mv_warns_and_allows_when_a_blocker_is_not_on_the_board() {
let out = move_ticket(&temp, "aaaa1111", "committed", false);
assert!(out.status.success(), "{}", String::from_utf8_lossy(&out.stderr));
assert_eq!(
String::from_utf8_lossy(&out.stderr),
"Warning: ticket 'Gated Task' is blocked by bbbb222, which is not on the board.\n",
"the warning is not the line it was, on the stream it was on"
);
// And it stays off stdout, which is what a caller reads the answer from.
assert!(
String::from_utf8_lossy(&out.stderr).contains("not on the board"),
"{}",
String::from_utf8_lossy(&out.stderr)
!String::from_utf8_lossy(&out.stdout).contains("not on the board"),
"the warning landed in the answer: {}",
String::from_utf8_lossy(&out.stdout)
);
assert!(worklane.join("committed").join(&filename).exists());
}