Repository navigation
Conversation
Ghostwright CLI and Vim recordings✅ Build + packaged CLI/Vim tests: success Download CLI MP4 Download all recording files — MP4, GIF, asciicast and JSON trace. Available for 14 days. These tests install the Ghostwright tarball built by this run and drive a real CLI and Vim/netrw through PTYs. No UI/TTY sibling checkouts are used. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ghostwright couples terminal emulation to Ghostty and routes native keyboard execution through its Promise facade. This change adds explicit backend and execution composition boundaries while preserving the existing terminal APIs.
A per-session backend factory,
(options: BackendOptions) => Operation<TerminalBackend>, owns emulator acquisition and release. Ghostty remains the default and sole shipped implementation. Synchronous writes/resizes return immutable snapshots plus ordered effects; sessions retain transport, revisions, OSC pairing, CSS locators, and assertions. Live sessions, local components, and replay use the factory, and replay validates backend identity.Keyboard execution now has a typed operation capability and an explicit driver/middleware factory. Middleware receives an argument tuple and a typed
nextcontinuation. Async and native keyboard APIs invoke the same composed operations once; native calls preserve caller context instead of crossing through the Promise facade. Session ordering, receipts, and shutdown guards remain in the driver.TerminalProgram<T> = (terminal: ExecutionOperations) => Operation<T>supports reusable programs throughterminal.run(program).captureProgram(options, body)wraps a continuation with the existing recording lifecycle. Capture-local middleware composes inside inherited middleware, nested scopes retain it, and cancellation awaits cleanup while preserving the parent session. The initial operation core covers keyboard input and capture; other APIs retain their existing adapters. No global port registry is introduced.A scope audit against Sweatpants foundation’s Effection characterization tests also adds an explicit native
withTerminallifetime boundary, invocation-local bridges for native Promise APIs, and cancellation of legacy assertion/locator/revision waits. Native session cleanup completes before returning to a still-live caller; halting child work removes its timers and subscriptions. Documentation recommendsensurefor yielding middleware cleanup and records Effection 4.2’s yielding-finally limitations.Lifecycle verification also exposed races fixed here: preserving exit/EOF received during spawn, preventing queued commands from starting after CLOSE, and draining sidecar stdout before reporting a missing acknowledgement. README examples document backend decorators, keyboard middleware, and capture programs.
Stacked on #13 (
spike/recording-ci).Validation
Full typecheck still reports five pre-existing Vim example errors, reproduced on the base commit. The default test discovery includes a standalone CI fixture whose
journey.mjsis supplied by the CI workflow; source suites were run with explicit./test ./examplespaths. An earlier run hit the settlement test's timing-sensitive assumption that output arrives before its 10ms baseline-settlement deadline; its focused rerun and the final full suite passed. The larger Vim replay test also exceeded its five-second timeout in earlier backend verification, reproduced on the base commit.