docs(adapters): pin new_window command contract as shlex-joined argv#60
Conversation
The seam's `command` parameter had unspecified semantics: the POSIX backend hands it to a shell while a re-splitting backend treats operators as literal argv. State the contract in the ABC docstring (shlex-joined argv, operator behavior backend-defined) and pin the POSIX leaf passing the string to tmux verbatim. Closes bmad-code-org#59
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
🤖 Augment PR SummarySummary: Pins What changed:
🤖 Was this summary useful? React with 👍 or 👎 |
pbean
left a comment
There was a problem hiding this comment.
Validated — approving. This is a clean, minimal, docs-only contract pin (+ one pinning test) with no runtime behavior change, and it does not risk the core or the other-OS backend path.
Verification performed:
- Docstring is accurate.
tmux_base.pynew_windowpassescommandverbatim as the single trailing arg totmux new-window(run via a shell → operators would be interpreted); the eventual re-splitting backend treats them as literal argv. The docstring describes both correctly. - Existing callers already comply with the documented contract — both build
commandas a shlex-quoted join, so no raw shell line ever reaches the seam:generic.pybuild_command→" ".join(shlex.quote(a) …)probe.py_ProbeLauncher.start→" ".join(shlex.quote(a) …)
The PR pins the de-facto contract; nothing is retrofitted or broken.
- New test is correct — empirically confirmed. Reproduced its logic against the real
tmux_base.py: the asserted argv is byte-identical tonew_window's actual output, and the operator-bearing shlex-joined command reaches tmux verbatim as one trailing argument. Symmetric with the existingtest_new_window_posix_argv_byte_identical. - No core / other-OS risk. Additive documentation on an abstract method plus a passing test. It reduces future risk by pinning the contract before the Windows/psmux backend lands — exactly the cross-backend divergence #59 flags.
Nice defensive close on #59. LGTM. 👍
Summary
Multiplexer.new_window'scommand: strparameter had unspecified semantics: the POSIX/tmux backend hands it to a shell (operators like&&would be interpreted) while a backend that re-splits the string treats operators as literal argv. Both existing callers build the command withshlex.quote-joins, so nothing is broken today — but a future caller passing a real shell line would break platform-specifically.Docs-only contract pin, no behavior change:
multiplexer.py— thenew_windowdocstring now states the contract:commandis a POSIX shlex-joined argv string, not a shell line; shell-operator behavior is backend-defined and callers must not rely on it.test_multiplexer.py— one new test pins the POSIX leaf's side of the contract: an operator-bearing shlex-joined command reaches tmux verbatim as the single trailing argument (full argv asserted, symmetric with the existing byte-identity tests).Testing
ruff check+ruff format --checkcleanpytest tests/test_multiplexer.py— 12 passedCloses #59