feat(exec): add command handoff planning #7

Merged
KofTwentyTwo merged 1 commits from feature/GH-3-exec-handoff into develop 2026-05-26 20:27:24 +00:00
KofTwentyTwo commented 2026-05-26 20:26:39 +00:00 (Migrated from github.com)

Summary

Adds Milestone 3 command planning and process handoff plumbing for limen. The package builds local and remote tmux/SSH command vectors, validates new-session names, records advisory state before handoff, and wraps syscall.Exec behind an injectable boundary.

Scope

  • This PR matches a behavior described in docs/DESIGN.md.
  • If the PR changes intended behavior, the design doc is updated in this PR (or a preceding one).
  • If the PR adds a non-trivial dependency, the rationale is in the summary above.

Changes

  • Adds internal/exec command plans for local attach/new and remote attach/new.
  • Adds new-session name normalization and validation per the design.
  • Adds a testable Handoff path that updates state.json before invoking the injected syscall.Exec boundary.
  • Preserves advisory state semantics: state write failures do not block the final process handoff.
  • Adds unit coverage for command plans, validation, state update timing, exec env/argv, and exec failure output.

How to test

go test -race -count=1 ./...
go vet ./...
go build ./...
go test -cover -count=1 ./...
nix flake check

Screenshots / asciinema

Not applicable. This milestone intentionally has no TUI.

Checklist

  • Tests added or updated, where appropriate.
  • go vet ./... passes.
  • No new TODOs that aren't tracked in an issue.
  • Commit messages follow Conventional Commits (feat:, fix:, docs: ...).

Closes #3

# Summary Adds Milestone 3 command planning and process handoff plumbing for `limen`. The package builds local and remote tmux/SSH command vectors, validates new-session names, records advisory state before handoff, and wraps `syscall.Exec` behind an injectable boundary. ## Scope - [x] This PR matches a behavior described in [`docs/DESIGN.md`](../docs/DESIGN.md). - [x] If the PR changes intended behavior, the design doc is updated in this PR (or a preceding one). - [x] If the PR adds a non-trivial dependency, the rationale is in the summary above. ## Changes - Adds `internal/exec` command plans for local attach/new and remote attach/new. - Adds new-session name normalization and validation per the design. - Adds a testable `Handoff` path that updates `state.json` before invoking the injected `syscall.Exec` boundary. - Preserves advisory state semantics: state write failures do not block the final process handoff. - Adds unit coverage for command plans, validation, state update timing, exec env/argv, and exec failure output. ## How to test ```sh go test -race -count=1 ./... go vet ./... go build ./... go test -cover -count=1 ./... nix flake check ``` ## Screenshots / asciinema Not applicable. This milestone intentionally has no TUI. ## Checklist - [x] Tests added or updated, where appropriate. - [x] `go vet ./...` passes. - [x] No new TODOs that aren't tracked in an issue. - [x] Commit messages follow Conventional Commits (`feat:`, `fix:`, `docs:` ...). Closes #3
Sign in to join this conversation.