Skip to content

feat: add cmux terminal backend slice#153

Open
mielyemitchell wants to merge 3 commits into
kunchenguid:mainfrom
mielyemitchell:fm/cmux-terminal-backend-spec
Open

feat: add cmux terminal backend slice#153
mielyemitchell wants to merge 3 commits into
kunchenguid:mainfrom
mielyemitchell:fm/cmux-terminal-backend-spec

Conversation

@mielyemitchell

Copy link
Copy Markdown

What changed

  • Added docs/cmux-terminal-backend/spec.md to capture the terminal-backend design.
  • Added bin/fm-terminal-lib.sh for backend-neutral terminal targeting.
  • Wired first-slice cmux support into spawn, send, peek, state, and teardown flows.
  • Added cmux routing tests and adjusted GOTMP teardown fixtures for the new sourced terminal library.
  • Fixed an existing fm-brief.sh parse failure caused by an apostrophe in generated no-mistakes guidance.

Why

This introduces the first vertical slice of a cmux-native worker backend while preserving the existing tmux path as the default/fallback. It lets a firstmate task run in a visible cmux pane, receive instructions, be read by firstmate, and be cleaned up safely through existing treehouse safety checks.

How to verify

Already run locally:

  • bash -n bin/fm-terminal-lib.sh bin/fm-send.sh bin/fm-peek.sh bin/fm-crew-state.sh bin/fm-teardown.sh bin/fm-spawn.sh tests/fm-terminal-cmux.test.sh
  • tests/fm-terminal-cmux.test.sh
  • env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-send-secondmate-marker.test.sh
  • env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-send-settle.test.sh
  • env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-spawn-batch.test.sh
  • env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-crew-state.test.sh
  • env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-teardown.test.sh
  • env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-secondmate-safety.test.sh
  • Full tests/*.test.sh suite in two passes with CMUX_WORKSPACE_ID/CMUX_SURFACE_ID unset.
  • Live cmux sandbox smoke: spawn/read/send/interrupt/teardown.

Files touched

  • docs/cmux-terminal-backend/spec.md
  • bin/fm-terminal-lib.sh
  • bin/fm-spawn.sh
  • bin/fm-send.sh
  • bin/fm-peek.sh
  • bin/fm-crew-state.sh
  • bin/fm-teardown.sh
  • bin/fm-brief.sh
  • tests/fm-terminal-cmux.test.sh
  • tests/fm-gotmp.test.sh

Reviewed cmux backend scope and captured first-slice constraints before implementation.\n\nVerification: docs-only change; inspected spec contents and scoped staged diff.
Remove the apostrophe from the no-mistakes guidance line so bash parses the generated here-doc reliably.\n\nVerification:\n- bash -n bin/fm-brief.sh\n- env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-secondmate-safety.test.sh
Add a backend-neutral terminal layer and wire cmux-aware spawn, send, peek, state, and teardown paths for first-slice ship/scout workers while keeping tmux as fallback.\n\nAlso adds cmux routing tests and updates the GOTMP teardown fixture to include the sourced terminal library.\n\nVerification:\n- bash -n bin/fm-terminal-lib.sh bin/fm-send.sh bin/fm-peek.sh bin/fm-crew-state.sh bin/fm-teardown.sh bin/fm-spawn.sh tests/fm-terminal-cmux.test.sh\n- tests/fm-terminal-cmux.test.sh\n- env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-send-secondmate-marker.test.sh\n- env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-send-settle.test.sh\n- env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-spawn-batch.test.sh\n- env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-crew-state.test.sh\n- env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID tests/fm-teardown.test.sh\n- env -u CMUX_WORKSPACE_ID -u CMUX_SURFACE_ID full tests/*.test.sh suite in two passes\n- live cmux sandbox smoke: spawn/read/send/interrupt/teardown
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.

1 participant