Skip to content

feat(acq): add a neutral interactive-shell verb — acq shell NAME - #399

Merged
mogul merged 2 commits into
mainfrom
feat/acq-shell-verb
Aug 26, 2026
Merged

feat(acq): add a neutral interactive-shell verb — acq shell NAME#399
mogul merged 2 commits into
mainfrom
feat/acq-shell-verb

Conversation

@basiliskus

@basiliskus basiliskus commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #383.

acq run NAME always relaunches the recorded agent and acq exec is non-interactive, so an interactive human shell was the one daily-driver moment that still required the raw backend CLI (sbx exec -it <name> bash). This adds the neutral verb:

  • sbx: acq shell NAMEsbx exec -it NAME bash (sbx allocates the PTY).
  • msb: routes through a new _acq_msb_shell_exec helper extracted from the two identical shell launches _acq_msb_attach already carried — so the verb gets the agent user, PTY, workspace cwd, sane $SHELL, and SSH_AUTH_SOCK injection (when the host agent is forwarded) for free, and the attach path loses its duplication. A raw msb exec shell gets none of that.

Scope note: deliberately minimal per the issue — no attach-time heals on shell entry in v1 (acq run remains the heal point), and no -it on acq exec. Per-verb --help (per the repo's per-verb help convention) and the three how-to docs are updated; the sbx how-to's "stays raw" note now lists only sbx rm --all.

Verified: 4 new dispatch tests (red first), full offline suite green (354/354 serially), and a live E2E — a scripted PTY drove acq shell into a real sbx v0.39.0 sandbox and got SHELL-E2E-42 from agent computed guest-side.

AI-assisted (Claude Code [claude-fable-5]).

@basiliskus
basiliskus requested a review from a team as a code owner August 25, 2026 23:34

@mogul mogul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the neutral acq shell NAME surface. The implementation shape looks sound from static review, but I found a couple of issues that should be fixed before merge.

Findings:

  1. Low: durable code/test text uses bare tracker references. New comments and test names include bare #383 references, for example acq.backends/msb.sh:3696, acq.backends/msb.sh:3714, acq.backends/sbx.sh:495, and test/bats/30-dispatch-routing.bats:30, :35, :40, :47. Repo AGENTS.md requires durable code comments/docs to avoid bare issue/PR references and instead use self-contained prose or ADR references. Please remove/rephrase those bare tracker references.

  2. Low: docs/howto/msb.md:191 still documents the old/non-neutral interactive-shell path: acq run <name> and raw msb exec -it <name> -- bash. That conflicts with the new acq shell <name> verb and with the implementation, which uses an agent-user login shell with PTY, workspace cwd, sane $SHELL, and optional SSH_AUTH_SOCK. Please update the table to match the new neutral verb and the actual raw equivalent.

Verification run during review:

  • git diff origin/main...HEAD --check passed.
  • bash -n acq acq.backends/sbx.sh acq.backends/msb.sh passed.
  • shellcheck --severity=warning acq acq.backends/sbx.sh acq.backends/msb.sh passed.
  • ./scripts/test-acq-bats test/bats/30-dispatch-routing.bats passed: 29/29.
  • ./scripts/test-acq-bats passed: 354/354.

Earlier note: Bats initially could not run because vendored submodules were not initialized in this worktree. After initializing test/vendor/bats-core, test/vendor/bats-support, and test/vendor/bats-assert, the focused and full offline suites passed.

@basiliskus
basiliskus force-pushed the feat/acq-shell-verb branch from 4b26e3f to b476566 Compare August 26, 2026 14:16
`acq run NAME` always relaunches the recorded agent and `acq exec` is
non-interactive, so an interactive human shell was the one daily-driver
moment that still required the raw backend CLI (sbx exec -it <name>
bash) — backend-specific muscle memory that breaks the day a team
switches backends (#383).

- sbx: acq shell NAME -> `sbx exec -it NAME bash` (sbx allocates the
  PTY; exec hands it the terminal directly).
- msb: routes through _acq_msb_shell_exec, extracted from the two
  identical shell launches _acq_msb_attach already carried — agent
  user, PTY, workspace cwd, sane $SHELL, and SSH_AUTH_SOCK injection
  (when the host agent is forwarded) come free, and attach loses its
  duplication. A raw `msb exec` shell gets none of that.

Deliberately minimal per the issue: no attach-time heals on shell
entry (acq run remains the heal point), no -it on acq exec. Per-verb
--help added; the three how-to docs updated (the sbx "stays raw" note
now lists only `sbx rm --all`).

Verified: 4 new dispatch tests (red first), full offline suite 354/354,
and a live E2E — a scripted PTY drove `acq shell` into a real sbx
v0.39.0 sandbox and got a command result computed guest-side as the
agent user.

Fixes #383
- Strip bare issue references from the new code comments and test names
  per AGENTS.md "Durable References" (self-contained prose; tracker
  numbers stay in commit messages and PR descriptions only).
- docs/howto/msb.md: the Common Commands table's interactive-shell row
  now shows the neutral `acq shell <name>` (the sbx table and the
  attach example were updated in the feature commit; this row was
  missed).
@basiliskus
basiliskus force-pushed the feat/acq-shell-verb branch from b476566 to 04b1a07 Compare August 26, 2026 14:19
@basiliskus

Copy link
Copy Markdown
Contributor Author

Both fixed in 04b1a07: bare tracker references stripped from the new comments and test names per AGENTS.md "Durable References", and the msb Common Commands table's interactive-shell row now shows acq shell <name> (the sbx table and the attach example were updated in the feature commit; that row was missed). While re-reading AGENTS.md I also brought the branch into compliance with the sections adjacent to the one you cited: commit messages now use fully-qualified issue references (reworded, hence the force-push), and the PR description carries the recommended AI-assisted disclosure. The branch is also rebased onto current main. Dispatch file 29/29, shellcheck clean.

@basiliskus
basiliskus requested a review from mogul August 26, 2026 16:17
@mogul
mogul merged commit 1862b05 into main Aug 26, 2026
8 of 10 checks passed
@mogul
mogul deleted the feat/acq-shell-verb branch August 26, 2026 18:10
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.

Feature: a neutral interactive-shell verb (acq shell NAME) — the last daily-driver command that still requires the raw backend CLI

2 participants