# Remote source command and reader consent The source-built Remote executable now registers a production command through the public Go SDK. This increment joins relay/role selection, reader-owned consent and the existing connection workflow. It provides **experimental speech** with the matching reader. Subsequent increments added keyboard control, clipboard text and Braille; version 0.1.0 packages these for live testing. See [installation and current requirements](README.md#install-and-test-010). The subsequent [speech coordinator increment](speech.md) now connects typed relay speech to presentation IPC and reader output events to relay writes. The matching reader now has limited observation of explicitly local ordinary accessibility/document speech after worker policy. Production software sessions now attach an incoming owner with original-lease checks, local output priority and isolated cancellation. Status now offers **Return to desktop and keep this connection** once the reader lease opens. The shortcut reopens status and Disconnect; forms capture local keys only while open. The UI retains experimental-speech wording until live acceptance is complete. Receiving speech with no reader owner closes the connection and lease. Hardware backends fail isolated acquisition and retire the lease; no hardware device is opened for incoming Remote speech. Base revisions checked against maintained upstreams on 2026-11-04: reader `testing` at `4cf3335`, Tentacles `master` at `0c74038`. No installed reader or active desktop session is changed by building or running the private tests. Explicit Return to desktop requires reader commit `b4896a2` or a descendant containing its terminal `remote_background` interaction support. ## Ownership and behavior `remote/cmd/remote` calls `remote.Serve` with owned SDK streams and a private settings directory. Its default is `$XDG_CONFIG_HOME/cthulhu-remote`, or `~/.config/cthulhu-remote` when unset. `--data-dir` selects an absolute directory; parents must already exist. Existing storage restrictions apply, including rejection of symlinked ancestors and unsafe permissions. Startup loads only ordinary relay/role/pin settings, with no networking or saved-key read. The `remote` command uses **Cthulhu+Ctrl+Shift+R** in both layouts. It opens relay host, port and controller/controlled role selection, initially on Cancel. Save relay and role writes only ordinary settings and never connects. Changing the endpoint drops the previous endpoint's pin. Review access returns a typed `Interaction.remote` request to the host, not a lease or permission decision. The host keeps its existing interaction slot and resolves the exact requesting process session. Install grants limit the requested role/grants. The reader's own local-only form starts on Cancel with every grant unchecked. The command requests `remote-present` for controller or `output-observe` for controlled, plus the keyboard, clipboard and Braille services explicitly selected for that connection. Install grants and the separate reader approval constrain each service. A shortcut, child request or fabricated command argument cannot approve access. On explicit nonempty approval the reader issues `remote.action` through the SDK event stream and gives the continuation a matching `Submission.remote`. The command waits for that exact SDK event before claiming the connection workflow. Cancel, denial, policy loss and missing events cannot advance to credentials. The pending action expires after 30 seconds; long certificate/key reviews can outlast it. In that case Connect fails and a fresh local access review is needed. Every Remote form uses the reader's sensitive XI2 input capture, including relay selection, secret editing, trust, saved keys and status. The coordinator owns the only SDK event consumer and heartbeats the lease before/during networking. All networking remains on its workers. The command never reconnects automatically. When an interaction ends normally, core revokes only its original approved epoch, including unused actions. Explicit Return to desktop instead returns a terminal `remote_background` result carrying the opened lease/epoch. Core verifies its live ownership before releasing the interaction without child cancellation. Heartbeats continue independently; this action neither renews consent nor starts another connection. Reopening status requires no second consent. Before lease open, Return to desktop asks the user to refresh status or disconnect. Stale cleanup cannot revoke replacement consent. On cancellation or an unfinished exit, a bounded cleanup invocation also retires child setup. This is needed before `remote.open`, when no lease-revocation event exists. Lock/handoff invalidates the interaction's original policy context; returning does not revive it. Process EOF joins workflow/inspection/relay/event workers before closing storage. Repeated shortcuts cannot replace a live workflow. ## Explicit saved trust Certificate review additionally offers **Trust and remember this certificate for this relay host and port**. It consumes that review once, saves the exact observed digest using the existing private atomic store, and returns to explicit Connect. Copy fingerprint and Trust once retain their previous meanings. The credentials form can forget the current endpoint's pin and return to normal CA/hostname validation. These actions neither open a lease nor join the relay. Write errors are reported; a sync failure after rename can leave stored trust changed, so a failed save is not described as a rollback. ## Private verification From the Tentacles checkout: ```sh make check GOPROXY=off GOCACHE=/tmp/cthulhu-cache GOPROXY=off go test -race ./remote/... -count=1 -timeout=90s go build -race -o /tmp/cthulhu-remote-next ./remote/cmd/remote ``` From the reader checkout, using that separately built executable: ```sh GOCACHE=/tmp/cthulhu-go-cache GOPROXY=off CTHULHU_REMOTE_BINARY=/tmp/cthulhu-remote-next go test -race ./internal/app -run '^TestRemoteConnectionCommand' -count=1 -timeout=90s -v ``` `make check` builds the source command, checks its initial interaction through the command host, and runs these real-process application integration cases. They cover both roles, unchecked core consent, denial/empty approval, fresh setup after lock/handoff cancellation, key-free inspection, explicit Trust once, fresh TLS join, explicit desktop return, repeated status reopening and background disconnect/lock/handoff/disable. A stalled-inspection case verifies cancellation before a lease exists. Unit/race tests additionally cover invalid requests, fabricated approval without an SDK event, endpoint trust isolation, explicit Remember/Forget pin, failed writes and stale/removed pins. Native form-model coverage verifies empty relay entries do not block Cancel. The complete Remote race suite, existing host/both-SDK conformance race suites, focused application race tests, vet, reader build and `make check` passed. The desktop-return change also passed ten repetitions of the source-command connection race cases and focused shared interaction/consent/observation checks. Earlier command increments passed the private Xorg remote-input and internal-form harnesses, retaining injected-approval rejection, secret/ordinary forms, learn mode and XTerm handoff behavior. Those native harnesses were not rerun for desktop return; physical capture release remains unverified. Fixtures use private loopback relays and synthetic local form submissions; they do not exercise physical keyboard input. ## Physical keyboard acceptance, still pending Use a disposable Xorg desktop with the newly built matching reader and command. Do not attach synthetic input to the active reader. A development launch list may contain the following, with absolute paths substituted: ```json [ { "ID": "remote", "Program": ["/absolute/cthulhu-tentacles/remote/bin/remote", "--data-dir", "/absolute/private-parent/remote-state"], "Presentation": true, "Interaction": true, "SessionEvents": true, "RemoteGrants": ["output-observe", "remote-present"] } ] ``` Pass that file with `--tentacles /absolute/launch.json` and a disposable `--config` when starting the matching reader in that test session. Building Remote alone does not update the reader's consent-interaction support. For each live test, first configure the disposable development session above. Quit its current Cthulhu with Cthulhu+Q. Press Ctrl+Escape, then press Shift+G to rebuild and launch through `~/devel/cthulhu-go.sh`; these are separate key presses. Use the matching development launch list when starting the reader in that test session. The standard launcher alone does not register Remote. Keep the active reader and personal configuration untouched while preparing the test session. 1. Use physical keys to open Remote, Tab/Shift+Tab through every control, select each role and cancel. Review access must focus Cancel, with no prechecked permissions. Approval with nothing checked must not reach credentials. 2. Approve the requested grant and verify masked typing/editing, denied copy/cut, explicit paste and empty fields after cancelling/reopening. Confirm audible output and physical Braille do not reveal the key. 3. Use a private relay. Inspect its certificate, verify/copy its fingerprint, test Cancel, Trust once, explicit Remember/Forget pin, and Remember/Forget key. Confirm none connects until Connect is chosen. Restart the test process and check stored trust without automatic connection or automatic key loading. 4. Cancel while inspection or TLS join stalls; lock/unlock and trigger XTerm handoff during consent, inspection and an established relay connection. Confirm cancellation, no resume, no stale approval and a fresh usable command. 5. After connecting, choose Return to desktop and keep this connection. Confirm the form disappears, ordinary typing reaches the local application, and application focus/reading and local Braille resume. Wait at least four seconds, then press Cthulhu+Ctrl+Shift+R: status must reopen without a new consent/key prompt. Disconnect must close the relay. Repeat Return to desktop followed by lock/unlock or XTerm handoff; the old connection must end and never resume. With a matching development reader using software speech, send harmless ordinary text, repeated-character spelling, a supported alternate language, significant whitespace and Say All from the peer. Confirm the intended speech is audible after desktop return, with no duplicate local export. While Remote is speaking, trigger local reading/key echo and status; local output must take priority and interrupted remote text must not resume. Peer cancel/pause must leave local announcements audible. Repeat disconnect, lock and handoff during active speech: old speech must stop, with no replay after reconnection. Record exact heard text/order and cancellation behavior; relay status alone does not establish speech acceptance. 6. For current-line export, use two matching development peers on a private relay. On the controlled computer approve output observation and choose Return to desktop; the controller must also return to desktop to receive speech. Using the controlled computer's physical keyboard, open a harmless browser document containing a line such as "A book" and enter browse mode. After focus speech settles, press Cthulhu+Shift+Up Arrow once. Both computers should speak the current line. Repeat the chord twice quickly (within 500 milliseconds between presses) for spelling, then three times quickly for phonetic spelling. Record the final spelling/phonetic result, including both repeated "o" characters, and any interruption or duplicate output. The application focus, native/virtual caret and local Braille should stay at their previous position; ordinary arrow navigation and typing should retain their usual behavior. Repeat after disconnect: local reporting should remain available and the peer should receive nothing. Reconnect explicitly, focus an ordinary GTK entry or text editor outside browse mode, put its caret in the middle of "A book", and repeat the single/double/triple chord: both computers should speak the same whole line, spelling and phonetics, with both "o" characters retained. Confirm focus, caret, ordinary typing and local Braille stay unchanged. Password sources or private/unknown/incomplete ancestry must produce no new exported current-line utterance; an ordinary report whose ancestry cannot be captured should still be readable locally. Ordinary focus/typing events are separate output paths. Repeat disconnect, lock/unlock and XTerm handoff; old reports must not replay and a new connection requires explicit consent. Record exact local/peer speech, focused control, caret/Braille position and keys that behaved differently from these results. 7. For object/flat-review export, keep the same two development peers connected and returned to desktop. On the controlled computer, open a harmless document or dialog with several ordinary labels. With the desktop layout and Num Lock off, use keypad 7/8/9 for previous/current/next line, 4/5/6 for previous/current/next word, and 1/2/3 for previous/current/next character. Both computers should speak the same ordinary report, including role announcements for object review. Repeat keypad 5 twice quickly for word spelling and three times for phonetics; repeated letters must remain. Use Cthulhu+Ctrl+Right/Left for sibling object review and Cthulhu+Ctrl+Down/Up for child/parent review. Application focus, native caret, normal typing and existing Braille behavior should stay unchanged by these speech export changes. Boundary/error announcements stay local. A password source or ancestor must produce no exported review report; if a flat line joins ordinary and private sources, the whole report stays local. Disconnect and repeat ordinary review: local speech must remain and the peer must receive nothing. Record exact local/peer text and order, focused control, caret/Braille position and any key whose behavior differs. 8. For document Where Am I export, keep both peers connected and returned to desktop. On the controlled computer, navigate to a harmless browser document position using a browse navigation command or document caret movement. With the desktop layout and Num Lock off, press keypad Enter. Both computers should speak the same location and role, preserving pronunciation and speech order. Application focus, caret and local Braille should stay in place. Repeat after disconnect: local speech should remain and the peer should receive nothing. Reconnect explicitly and repeat on a password source or a source with private ancestry: no Where Am I report should reach the peer. Missing-location messages stay local. A same-object native update or a document reset clears sharing classification; navigate again before testing another ordinary export. Record exact local/peer speech, focus, caret/Braille position and keys differing from these expectations. 9. For native Where Am I, keep both peers connected and returned to desktop. Focus a harmless entry or button in a native GTK application. After focus speech settles, press keypad Enter with Num Lock off. Both computers should speak the same item and role, preserving pronunciation and chunk order. Focus, caret, Braille and ordinary keyboard input should stay in place. Repeat after disconnect: local speech should remain and the peer must receive nothing. Reconnect explicitly and repeat on a password source or a source with private ancestry: no report should reach the peer. If native text changed since the cached focus report, local Where Am I stays available but export is withheld until fresh and cached reports match. Change focus or lock/handoff during a slow capture: its pending report must not speak afterward. Record exact local and peer speech, focused control, caret/Braille position and unexpected keys. 10. For context announcements, connect two matching development peers to a private relay and return both to desktop. On the controlled computer, use browse mode in a harmless document containing a named list or table, with the corresponding navigation and Say All context settings enabled. Navigate into and out of the container: both peers should speak the same entry label and "Leaving ..." label before the ordinary content, once per transition. Repeat with Say All and current-line spelling; labels should follow their existing settings and should not repeat for each spelled letter. Named articles retain their entry-only behavior. Focus, caret movement, ordinary application keys and local Braille should retain their existing behavior. Disconnect while inside the container, reconnect explicitly, and move outside before reading inside it again. The local exit label should still be spoken, but the new peer must receive only the new ordinary content, without adopting the old cached label. Repeat with a container first read while disconnected. Password/private/unknown ancestry must export neither an entry label nor a later cached exit label; local reading should remain available. Stop speech, lock/handoff and disconnect during Say All: old context must not replay after reconnection. Record exact local/peer label and content order, focused control, caret/Braille position and keys that differ from these expectations. 11. Recheck ordinary entries/menus, secret forms, learn mode, remapped shortcuts, application key delivery and Hello World/Wormhole/Battery Status. These share the changed host interaction path. Review the diff before any submission. Physical-source acceptance, audible speech/masking, real-server priority, physical Braille, remaining desktop services, actual NVDA/Orca interoperability and packaging remain separate open gates. ## Controlled keyboard live checks, pending Install the reader with `cthulhu-input-helper` beside it. On the controlled computer choose **Allow a helper to access this computer**, check the keyboard option and pick a key profile, then approve keyboard control in the reader's dialog using the physical keyboard. From the controller, type into a harmless text editor, use Shift+Tab, arrows and Control shortcuts, and confirm each key arrives once. Hold Shift or Control on the controller and disconnect, lock the controlled desktop, and trigger XTerm handoff; afterwards confirm no modifier is stuck (for example with `xinput query-state` or by typing). Repeat without the keyboard option and confirm keys are ignored. ## Controller keyboard live checks, pending On the controller choose **Control another computer** with keyboard control checked and approve it in the reader dialog. Once the peer joins, press Cthulhu+Ctrl+Shift+F: the reader should announce that the keyboard controls the remote computer. Type into a remote text editor, use Shift+Tab, Insert/Caps Lock reader commands and arrows, and confirm nothing reaches the local application. Press F11 and confirm the keyboard returns with an announcement; repeat with Cthulhu+Ctrl+Shift+R. Hold Shift on the controller, press F11, and confirm Shift is not stuck on either computer. Lock the controller and trigger XTerm handoff during remote focus; both must return the keyboard. On Windows peers, check whether a withdrawn Alt prefix opens a menu bar. ## Clipboard live checks, pending Connect with clipboard transfer checked on both computers. Copy harmless text on one and press Cthulhu+Ctrl+Shift+C; on the other press Cthulhu+Ctrl+Shift+V and paste into an editor. Confirm the clipboard did not change before the receive command, that a second receive reports nothing waiting, that copied files are refused, and that without the checkbox nothing transfers. ## Braille live checks, pending With Braille checked on both computers and a display on the controller, open a text document on the controlled computer. The controller's display should show it at its own width. Pan both ways past the page edges, route to a word and confirm the controlled caret moves. Test contracted and computer Braille, non-Latin text and a controlled computer with no display attached. Open a reader dialog and a flashed message on the controlled computer and confirm neither appears remotely. Disconnect and confirm the controller's local Braille returns. Unplug and replug the display during a session.