[quality] test: pin the poller-to-thrash-breaker wiring end to end (src/pkg/agent pollTmuxOutputForAgent → checkBlockedThrash) - #6330
Conversation
Add TestPollTmuxOutputForAgent_WiresThrashBreaker in src/pkg/agent: drive a burst of policy-blocked lines through pollTmuxOutputForAgent via a real tmux pane and assert the agent ends up paused with trigger "thrash-breaker". The breaker logic (checkBlockedThrash / recordBlockedAndCheck) was already unit-tested; the one-line call site in the poller that fires it in production was not — the exact #6147 shape. Mutation-checked: removing the call makes this test fail. The test creates a 220-column tmux session because capture-pane returns wrapped display lines and an 80-column pane splits the blocked-action marker mid-word, hiding it from the breaker's Contains match. Fixes #6297 Refs #6147 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: hive-quality <hive-quality@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Test Improvement
Adds
src/pkg/agent/thrash_poller_wiring_test.gowith one end-to-end case,TestPollTmuxOutputForAgent_WiresThrashBreaker:pollTmuxOutputForAgent, waits for the first capture so the diff baseline exists.git push blocked:lines past the thrash threshold (5 in 60s).thrash-breaker— the pause, not a log line.Why:
checkBlockedThrash/recordBlockedAndCheckare unit-tested, but the single call in the poller (manager_poll.go:244) that makes the breaker fire in production had no test — the exact #6147 shape (a correct breaker nothing invoked). A poller refactor could drop that line with every existing test still green.Verification:
-run 'Thrash|PollTmuxOutput' -count=3— all green (~6.6s per run for the new test).m.checkBlockedThrashcall in the poller makes exactly this test fail.Note: the test uses a 220-column tmux session —
capture-panereturns wrapped display lines, and at 80 columns the marker wraps mid-word ("git push bl / ocked:"), invisible to the breaker'sContainsmatch. That wrap-sensitivity of the marker match in production is recorded as a separate advisory bead.Claimed ground:
src/pkg/agent/thrash_poller_wiring_test.go(new file only); pinspollTmuxOutputForAgent→checkBlockedThrashwiring. Disjoint from open PRs #6328 (pkg/proxy), #6327 (pkg/hub), #6323 (docs), #6292 (claude write roots).Related Issue
Fixes #6297
Refs #6147
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5