fix(framework): send-message.sh fail-loud submission verdict + regression tests (Patch 6)
Some checks failed
ci/woodpecker/pr/ci Pipeline failed

Invert the delivery verdict from negative to positive evidence. Previously,
success was declared by the ABSENCE of a draft snippet on a prompt line: if
the `❯|^>|│ >` glyph matched nothing (busy-receiver draft on an unmatched
line, or wrong-pane drift), an UNSUBMITTED message read as "✓ delivered"
exit 0 — a silent worker->lead relay stall (filed by UC-LEAD, PR #3046:
three review verdicts reported delivered but never surfaced for ~50 min).

Fix: success now requires POSITIVE evidence — either the queued banner, or
the REPL input box located AND clear of the message tail. If the input box
cannot be located, status is `unconfirmed` -> exit 2 + stderr ("could not
confirm submission ... may be UNDELIVERED"). The near-dead `*)` indeterminate
default also flips from silently returning 0 to exit 2. Bracketed-paste and
double-Enter delivery mechanics are unchanged; queued/draft/delivered
semantics are preserved, only the failure-mode default direction changes.

Adds `test-send-message-verdict.sh`: 3 real tmux-pane fixtures (delivered /
unconfirmed-glyphless / draft) locking the fail-loud verdict logic, and
upgrades `test-send-message-socket.sh` fixtures from a glyphless bash prompt
to `❯`-prompt REPLs so the patched binary can read delivery positively.

Reproduce-first evidence (baseline vs patched, glyphless-pane fixture):
  baseline: rc=0, stdout "✓ delivered to =noglyph" (silent false positive)
  patched:  rc=2, stderr "could not confirm submission ... may be UNDELIVERED"

Test results after port:
  test-send-message-verdict.sh -> PASS=3 FAIL=0
  test-send-message-socket.sh  -> ok

Firewall: grep -niE 'jason|woltje|jarvis' on changed files = 0 hits;
tools/quality/scripts/verify-sanitized.sh -> sanitization gate passed.
shellcheck: 1 pre-existing SC2034 finding (unused loop var `attempt`,
present identically in baseline) carried through; 0 new findings.

Part of #891
This commit is contained in:
mosaic-coder
2026-07-25 16:08:38 -05:00
parent 2698ddb7b5
commit 0f0fa7f1ea
3 changed files with 104 additions and 12 deletions

View File

@@ -29,8 +29,8 @@ capture_default() {
require_tmux
tmux -L "$SOCKET" new-session -d -s "$TARGET" -c "$TMPDIR" 'bash --noprofile --norc -i'
tmux new-session -d -s "$DEFAULT_TARGET" -c "$TMPDIR" 'bash --noprofile --norc -i'
tmux -L "$SOCKET" new-session -d -s "$TARGET" -c "$TMPDIR" 'PS1=" " exec bash --noprofile --norc -i'
tmux new-session -d -s "$DEFAULT_TARGET" -c "$TMPDIR" 'PS1=" " exec bash --noprofile --norc -i'
"$SEND_MESSAGE" -L "$SOCKET" -t "=$TARGET" -m "named socket hello" >/tmp/send-message-named.out
sleep 0.2
@@ -52,7 +52,7 @@ fi
# load overwrote load, -d deleted underneath — messages swapped between panes).
CONC_N=5
for i in $(seq 1 "$CONC_N"); do
tmux -L "$SOCKET" new-session -d -s "conc-$i" -c "$TMPDIR" 'bash --noprofile --norc -i'
tmux -L "$SOCKET" new-session -d -s "conc-$i" -c "$TMPDIR" 'PS1=" " exec bash --noprofile --norc -i'
done
pids=()
for i in $(seq 1 "$CONC_N"); do