Skip to content

feat: add deterministic tape playback and pointer-aware automation - #18

Open
arimxyer wants to merge 9 commits into
anomalyco:mainfrom
arimxyer:feat/persistent-sessions-mouse-input
Open

feat: add deterministic tape playback and pointer-aware automation#18
arimxyer wants to merge 9 commits into
anomalyco:mainfrom
arimxyer:feat/persistent-sessions-mouse-input

Conversation

@arimxyer

Copy link
Copy Markdown

Summary

  • keep named live PTY sessions available across CLI invocations
  • add structured click, right-click, move, and drag controls for direct sessions and workspace targets
  • add deterministic .tape playback with Setup, Launch, Cleanup, waits, receipts, bounded process groups, and stable JSON output
  • record and render optional pointer evidence, including persistent cursor overlays and tape movement
  • add scripting ergonomics for repeatable demos and automated TUI verification
  • validate live mouse targets atomically in the daemon against the current viewport before PTY mutation

Safety and compatibility

  • protocol v9 adds structured mouse mutations without changing legacy raw Send behavior
  • older daemons return an actionable restart-required diagnostic instead of silently falling back
  • default v1 recordings and pointer-enabled v2 recordings remain compatible
  • tape action output is drained fairly, bounded by deadlines, and cleaned up on setup or action failure
  • non-UTF-8 JSON receipt paths fail during preflight before lifecycle side effects
  • click and drag endpoints are validated for direct sessions, selected panes, stable pane IDs, and named-window active panes

Verification

Pinned clean-room environment:

  • Node 24.19.0
  • npm 11.17.0
  • Bun 1.3.14
  • Rust and Cargo 1.93.1
  • Zig 0.15.2

Commands completed successfully:

  • cargo fmt --all -- --check
  • cargo test --all-targets (211 passed, 1 manual benchmark ignored)
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --release
  • bun run test:npm
  • bun run build:npm
  • bun run validate:npm
  • cargo package --list
  • cargo package

Adversarial resize testing verifies that mouse mutations ordered after a resize to a 1x2 viewport are rejected before PTY input, with an empty PTY log. Protocol-v8 compatibility testing verifies the restart diagnostic for structured mouse while unchanged raw Send remains accepted.

Release

Includes a minor changeset describing deterministic playback, structured pointer behavior, bounded actions, and viewport-safe input.

@arimxyer

Copy link
Copy Markdown
Author

@kitlangton @jlongster Hey y'all just wanted to get your eyes on this. Or your bots' eyes on this.

@arimxyer

Copy link
Copy Markdown
Author

@kitlangton I saw the inclusion in the latest PR. Let me know if you want me to sync my fork.

@kitlangton

Copy link
Copy Markdown
Collaborator

Landed the background-daemon detachment fix and adapted regression intent in #26. Named sessions now survive launcher-group SIGHUP after both start and restart; explicit stop still shuts down the application. The real-PTY regressions and both Linux CI runs pass.

Thanks for including this fix. Tape playback and pointer automation remain separate in this PR; no removed workspace support was restored.

@kitlangton

Copy link
Copy Markdown
Collaborator

The background-session lifetime fix is now released in Terminal Control 1.1.1 on crates.io and npm. The public Cargo/Bun/Node installed CLIs each pass the start/restart launcher-hangup and explicit-stop regressions, including ownership-checked fixture cleanup.

Tape playback and pointer automation remain separate in this PR.

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.

2 participants