test(adapters): probe psmux workaround premises, not just our reaction - #517
test(adapters): probe psmux workaround premises, not just our reaction#517dracic wants to merge 1 commit into
Conversation
Every psmux workaround was pinned only by tests asserting how the backend reacts; nothing observed the upstream behavior each one exists because of, so a fixed divergence changed no test's colour. Four premises had already flipped on psmux main and nothing here noticed. Add eight premise probes to the Windows live gate. Each drives raw psmux argv against a throwaway session and asserts the observed upstream behavior, with a failure message naming the workaround that has become droppable. The failure semantics are inverted on purpose: a red probe is the signal, not a break. Every premise was observed on the installed 3.3.7 build before its assertion was written, and two turned out sharper than assumed. `set-option -w` does not merely lack per-window storage, it silently lands at session scope; and an unresolvable `kill-window` target exits 0 while destroying the ACTIVE window. The `=`-form kill divergence was traced to its cause and filed upstream as psmux/psmux#558. Also ablate the backend's negative assertions — delete the guard, run the test, confirm it fails, revert. Two did not bite: one was vacuous, because `last_fallback` defaults false and left the fallback leg unreachable regardless of the guard it claimed to cover; the other reached its assertion only via an IndexError from a fixture that ran dry. Zero-token contract unchanged, and the live gate stays a manual gate. Closes bmad-code-org#488
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
WalkthroughThe change adds isolated live probes for raw psmux behavior, documents the upstream version basis, and updates switch-client tests to exercise fallback handling without vacuous assertions. Changespsmux premise validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #488
What
Eight premise probes in the Windows live gate. Each drives raw
psmuxargv against a throwawaysession and asserts the observed upstream behavior that a workaround in
psmux_backendexistsbecause of — never the backend verb the workaround implements.
The failure semantics are inverted on purpose: a red probe is the intended signal, and its
message names the workaround that has become droppable. That is the manual step from #222's
admission checklist turned into an assertion.
Plus the ablation half: every negative assertion the issue listed was ablated for real — guard
deleted, test run, result recorded, guard restored.
Why it was needed, concretely
Four of the eight premises had already flipped on psmux
main(d56d777,6c76ff9,33ea109,8edd1cb/194fac0) and nothing in this repo changed colour.Every premise was observed before it was asserted
All eight were driven against the installed 3.3.7 build first. Two are sharper than the issue
described:
set-option -wdoes not merely lack per-window storage — it silently lands at session scope(
show-options -wqvreads empty while the same key at session scope reads the value back).kill-windowon an unresolvable target exits 0 and destroys the ACTIVE window. The probe pinsexactly that: the session survives and the vanished window is precisely the one that was active.
Upstream
Tracing the
=-form kill divergence to its cause produced psmux/psmux#558:parse_targetstrips the
=for routing butPSMUX_TARGET_FULLkeeps the raw argument, so the server'skill-sessionfallback compares"name" == "=name"and never kills. Verified identical atv3.3.7and
main.A second candidate (CLI value corruption for
'and non-ASCII whitespace) was traced anddeliberately not filed —
e41886falready fixed it onmainvia a Unicode-awarequote_arg_if_needed. Consequence worth flagging for the 3.3.8 admission: those two_transportablebranches become droppable, and the round-trip probe here will go red and say so.
Ablation results
:276,:404,:957==/raisesfires first:96,:114,:824,:1618:1625—last_fallbackdefaulted false, so the-lleg was unreachable regardless of the early-return guard it claimed to cover:1647— reached its assertion only viaIndexErrorfrom a fixture that ran dryThe issue's list also mislabels
:414: it is a positive assertion. The negative one in that testis
:404.Five further weakly-discriminating negatives outside the issue's scope (they ablate into a
TypeErrorrather than reaching their assertion) were recorded in the deferred-work ledger ratherthan pulled into this change.
Invariants held
pwsh -NoProfile -Command exit 0; no coding CLI is launched.verified teardown.
PSMUX_DATA_DIRisolation is applied only when the installed builddemonstrably honors it. Bare
switch-client -lis not probed at all — it has no target form, sounder
$TMUXit would move the developer's own client._LAST_UNSUPPORTEDbump. This builds the instrument; psmux 3.3.8: adopt as installed floor, re-verify the switch-client/select-window paths, and drop the psmux#497 and other workarounds #222 owns theadmission.
Verification
tests/test_psmux_live.py+tests/test_psmux_backend.py: 154 passed on Windows with psmux 3.3.7trunk check: no issuesas first written it was vacuous, since
available()applies the same regex and skips the teston the very failure the probe exists to catch
Summary by CodeRabbit
Bug Fixes
Tests
Documentation
psmuxbehavior and recorded the latest validation details in the changelog.