Skip to content

fix(tui-tests): fail closed when a polling capture fails - #208

Merged
BunsDev merged 1 commit into
mainfrom
fix/tui-polling-boundaries
Oct 15, 2026
Merged

BunsDev merged 1 commit into
mainfrom
fix/tui-polling-boundaries

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 15, 2026

Copy link
Copy Markdown
Member

Summary

The offline tmux TUI harness no longer reports "absent" when a pane capture fails, and no longer misses strings in large captures.

Context

  • Related request: Coven Code surface-reduction goal, unit 8 ("Fail closed at TUI polling capture boundaries" in the surface inventory ledger).
  • Scope: scripts/tui-tests/lib.sh polling helpers, a new harness test, and one step in .github/workflows/tui-tests.yml.
  • Non-goals: the fixed 400 ms timeout accounting, callers that ignore polling status, and unchecked direct captures are separate follow-ups.

Changes

  • tui_capture | grep -qF contradicted the helper's documented here-string convention. Under pipefail, grep exiting early could SIGPIPE the capture, and a failed capture satisfied the negated pipeline in wait_absent.
  • Capture output is stored only after its status is checked. A capture failure returns 2 with a contextual diagnostic, and successful output is matched with a here-string. One dead local (waited) is removed.
  • New scripts/tui-tests/test_polling.py: five tests covering a failed capture, a partial failed capture, a large successful capture, literal matching, and timeout. The TUI workflow runs them before the Rust build.

Surface: the helper grows 7 net lines. The benefit is fewer false passes, not fewer lines.

Validation

  • RED: three of the new cases failed on the unchanged helper (failed capture read as absence, partial failed capture without an error result, large capture missing a present string).
  • python3 scripts/tui-tests/test_polling.py: 5 tests OK.
  • bash -n scripts/tui-tests/lib.sh, actionlint .github/workflows/tui-tests.yml, git diff --check: pass.
  • Source worktree: on a dedicated temporary tmux socket, absence succeeded for a live pane and returned 2 after the pane was killed.
  • ShellCheck: no new warning. The three existing cross-file globals (RUN_OUT, RUN_RC, SUITE_RC) remain.
  • Full interactive TUI suite: this PR's Interactive terminal suite check.
  • Cargo gates: N/A, no Rust change.

PR Readiness

  • Diff is limited to the intended files.
  • Generated files were not edited by hand.
  • User-facing docs: not needed.
  • No secrets, credentials, local paths, or unrelated logs are included.
  • Remaining risks: polling timeouts still assume a fixed 400 ms per iteration; some callers ignore the polling status.

wait_for/wait_absent piped tui_capture into grep -q. Under pipefail an
early grep exit could SIGPIPE the capture and miss a present string in a
large pane, and a failed capture passed the negated absence check. Store
capture output only after checking its status, return 2 with a
contextual diagnostic on capture failure, and match with a here-string.
Remove one dead local.

Add scripts/tui-tests/test_polling.py (five cases, three failed before)
and run it in the TUI workflow before the Rust build.

Coven-Harness: Claude Code / claude-opus-5-5
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 15, 2026 7:13am UTC

Request Review

@BunsDev
BunsDev merged commit b147615 into main Oct 15, 2026
2 checks passed
@BunsDev
BunsDev deleted the fix/tui-polling-boundaries branch October 18, 2026 07:49

This branch was successfully deployed

1 active deployment
Preview — 51b1d2fa Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant