test(gui): pin the target banner to the process, not to the field - #68
Merged
donislawdev merged 1 commit intoJul 28, 2026
Merged
Conversation
The existing banner test only ever moves the EXPRESSION: the user types something that matches nothing, then something that does. The case a tester actually hits moves the other end - the field is left alone and the targeted program exits, or a harness restarts it onto a new pid. Nothing covered that, and a handoff note had concluded from reading the code that the verdict was taken only at session start. It is not: _refresh_target re-reads it on every tick, and only the APPLY half is gated on the expression having changed. That behaviour was correct and unguarded, which in this project is how a true sentence turns into a false one a few sessions later. - empties the socket table under a running session and asserts _applied_target did NOT move, so this cannot decay into the old test - then the banner rises, then it comes back DOWN when the process reappears under a NEW pid with the same name - the recovery measured 2026-07-28 against a real capture - three mutants, all caught; the first restores the assumed "only at session start" behaviour and goes red, which is the point of the guard Test-only, so CHANGELOG-INTERNAL only (convention 39). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Base automatically changed from
fix/cli-says-when-the-target-stops-matching
to
master
July 28, 2026 17:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Stacked on #67 (
--baseis the chunk-1 branch, so review that one first).test_a_gui_session_keeps_the_target_banner_honestonly ever moves the expression: the user types something that matches nothing, then something that does. The case a tester actually hits moves the other end - the field is left alone and the targeted program exits, or a harness restarts it onto a new pid.Nothing covered that, and the handoff note had concluded from reading the code that the verdict was taken only at session start. It is not:
App._refresh_targetre-readstargeting.matchedon every tick, and only the APPLY half is gated on the expression having changed. Correct behaviour, zero guards - which in this project is how a true sentence turns into a false one a few sessions later.The guard
Real engine, real resolver,
SyntheticDivert, injectedFakeTable. It empties the socket table under a running session and asserts_applied_targetdid not move (otherwise it decays into the old test), then that the banner rises, then that it comes back down when the process reappears under a new pid with the same name - the name-targeting recovery measured 2026-07-28 against a real capture.Mutants
Three, all caught, each on its intended assertion:
_refresh_targetreads the verdict only when the expression changed (the assumed behaviour)a target that died must raise the bannerProcessTargeting.matchedforced toTruea target that died must raise the bannerthe banner outlived the problemVerification
python -m pytest tests- 718 passed, 0 failed (elevated shell).python smoke_gui.py- OK.CHANGELOG-INTERNAL.mdonly (convention 39).🤖 Generated with Claude Code