Files

279 lines
17 KiB
Markdown

# Remote 1.0 — experimental test release
Remote connects Cthulhu to an NVDA Remote protocol-v2 relay, as either a
controller or a controlled computer, with relay/role selection, reader-owned
consent, connection controls, speech, keyboard, clipboard text and Braille.
Version 1.0 forwards US punctuation keys by default, including comma, period
and their shifted forms `<` and `>`. It retains public-relay join handling,
distinct connection failure messages, Orca-style Shift handling, browser and media
keys, untrusted certificate fingerprint review, and remembered connections.
Use the matching reader with the speech reliability fixes described below.
It remains a release for live testing. Physical keyboard recovery, audible
speech/masking, physical Braille and NVDA/Orca interoperability
have not yet passed live acceptance. ARM64 is cross-built and has not been run
on ARM64 hardware.
## Install and test 1.0
Use the matching experimental Cthulhu reader from `testing` revision
`19b789e` or a compatible later revision. This reader revision fixes remote
speech remaining silent after pause and a race that lost speech-completion
events. Remote 1.0 requires these fixes; rebuilding or updating the Tentacle
alone cannot repair the older reader. See [speech reliability](speech.md#speech-stops-while-keyboard-control-remains-connected).
It must support Remote browser/media keys, optional grants and polling form transitions; see the
reader's `docs/testing/remote-ui.md`. Older readers cannot run this workflow.
Keyboard control requires its `cthulhu-input-helper`; Braille requires
`cthulhu-braille`. Keyboard capture/injection requires Xorg. Installing this
Tentacle does not update the reader or its helpers.
In global Cthulhu Preferences → Tentacles, add or refresh
`https://git.stormux.org/storm/cthulhu-tentacles`, select **Remote**, review its
version and requested access, and choose **Install and enable**. Packages for
Linux amd64 and arm64 and their SHA-256 checksums are on the
[1.0 release page](https://git.stormux.org/storm/cthulhu-tentacles/releases/tag/remote-v1.0).
Press **Cthulhu+Ctrl+Shift+R**. Choose Mode, enter Host and Key, then
choose Connect. Host accepts `relay.example:7000`; the default port is 6837.
The key is masked. With **Remember this host and key** checked (the default),
a successful join adds the host, mode, key and any remembered certificate to
**Recent connections** (up to ten, newest first). Press Enter on a recent
entry to fill Mode and Host; leave Key empty to use its saved key. The list
never shows or speaks a key. More options contains Forget recent connections,
explicit saved-key actions, certificate inspection and keyboard mapping.
Keyboard mapping includes US punctuation by default, including comma, period
and their shifted forms `<` and `>`. More options retains the limited
Letters, numbers and navigation mapping for sessions that need it. AltGr,
dead keys and other OEM layouts remain unsupported.
Uncheck Remember before connecting to keep a new key out of history. If saving
fails, Remote reports the failure and keeps the connection active.
The certificate is verified before the reader asks you to select access.
If it cannot be verified, Remote fetches the relay certificate on a separate
connection that sends no key and shows its SHA-256 fingerprint. Choose Trust
once or remember it for this host and port, and the connection continues to
the reader's access selection; Cancel returns to the options form.
Only installed permissions are offered; all start unchecked. Select speech,
keyboard, clipboard or Braille as needed and choose **Allow selected access and
connect**. The form closes automatically after joining the relay. Reopen Remote
for status and Disconnect; Close or Escape keeps a live connection.
Check the fingerprint with the relay operator before trusting it. A remembered
fingerprint travels with that host's recent connections. **Inspect relay
certificate** in the options form shows it on demand; trust chosen there does
not connect by itself.
| Keys | Action |
| --- | --- |
| Cthulhu+Ctrl+Shift+R | Connect, or open connection status |
| Cthulhu+Alt+Tab | Switch keyboard control; F11 also returns here |
| Cthulhu+Alt+Page Down | Disconnect |
| Cthulhu+Ctrl+Shift+Page Up | Report status |
| Cthulhu+Alt+M | Mute or unmute remote speech |
| Cthulhu+Ctrl+Shift+C | Send clipboard text |
| Cthulhu+Ctrl+Shift+V | Accept received clipboard text |
While the keyboard controls the other computer, any Remote shortcut first
returns it here. Press the shortcut again to run its action; the keyboard toggle
therefore returns in one press. Mute affects only remote speech. Clipboard text
never overwrites this computer's clipboard until explicitly accepted.
Follow [the physical keyboard, speech, clipboard and Braille checks](command.md)
on both desktops. Check public and embedded relay connections in both roles,
with either computer joining first; both should reach connected status when the
opposite-role peer arrives. Check disconnect/lock/handoff with modifiers held, local
typing after F11, password/key masking and ordinary reading. Recheck Hello
World, Wormhole and Battery Status because they share the host interaction path.
With an Orca-style controller, check uppercase typing and Shift+Tab, then media
and browser keys. Check comma, period, `<` and `>` with the default keyboard
mapping and the limited mapping under More options. Verify both Trust once and remembered trust, Cancel on a bad
certificate, reuse of a recent connection, and unchecked Remember followed by
Forget recent connections; see [command.md](command.md).
Record reader/peer versions, role, layout, actual speech/key/Braille results and
recovery behavior. Automated tests do not establish those results.
## Implementation
Implemented:
- Typed speech conversion, coordinator queues, atomic reader assembly and matching reader IPC
validators/mailbox, with both-role SDK-process/private-TLS coverage and
Go/Python host coverage. Limited production export now observes explicitly
local accessibility speech, document navigation and Say All after worker policy,
with private-origin exclusion and captured-lease/generation checks. Object
review and flat-review line/word/character reports now also check captured
ancestry, including every joined zone and outer menu ancestors. Incoming
software speech now has delivery-time lease/output policy, local priority and
separate cancellation ownership. Other reading producers and audible
acceptance remain pending. Automatic desktop return releases the connection
form while retaining the original approved lease; the shortcut reopens status
and Disconnect. Physical capture/release acceptance remains pending.
See [speech.md](speech.md).
- Native current-line reporting, spelling and phonetics export only with fresh,
complete focused-source ancestry through the application. Private, unknown,
defunct or incomplete sources stay local. Private GTK checks cover ancestry
capture and unchanged caret; audible/physical acceptance remains pending.
- Reading-context entry/exit announcements export only for eligible local
requests with nonprivate source ancestry. Cached exit labels retain their
original consent ticket; private/pre-consent labels and retired sessions
cannot acquire later consent. Local labels, context settings, Say All and
spelling behavior are preserved. See [speech.md](speech.md).
- Bounded newline JSON framing, duplicate-key and collection validation, and
typed speech, keyboard, membership, clipboard and Braille decoding.
- An isolated bidirectional VK/XKB keyboard mapper with explicit portable/US
profiles, modifier-side and keypad distinctions, and constant errors for
unsupported or ambiguous keys. An epoch-bound outgoing encoder retains the
original mapping through repeats/releases, bounds held keys and preserves
failed-write cleanup with sequence-checked acknowledgements. The mapper is
attached to production capture and injection; physical layout and AltGr
acceptance remain unverified. See [keyboard.md](keyboard.md).
- Braille, approved per session: a controlled computer exports its Braille at
the controller's display width; a controller shows it and sends pan and
routing keys. Physical display acceptance is pending. See
[the reader contract](../../cthulhu/docs/tentacle-remote-braille.md).
- Explicit clipboard text transfer, approved per session: send with
Cthulhu+Ctrl+Shift+C; received text waits until Cthulhu+Ctrl+Shift+V copies
it. Up to 8 KiB of text; no files, no automatic overwrite.
- Controller keyboard control: with keyboard control approved, the
`remote-focus` command (Cthulhu+Alt+Tab) switches this keyboard through the
reader's exclusive capture; F11 or any Remote shortcut returns it. Live
acceptance is pending. See [command.md](command.md).
- Controlled-role keyboard control: an explicit session-only option requests
`keyboard-inject`; relay keys reach the reader's production input helper
through `remote.key`. Live acceptance is pending.
- Typed reader `remote.key` IPC, Go/Python validation and a bounded incoming-key
mailbox now have real-process SDK checks. The external bridge converts every
supported canonical mapping to the public SDK representation. The production
input owner consumes approved controlled-role keys. See
[the reader contract](../../cthulhu/docs/tentacle-remote-keyboard.md).
- A quarantined reader destination ledger/backend now preserves native keycodes
through layout/Num Lock changes and retains failed cleanup for retry, with
private Xvfb race checks. A source-built independent helper now supplies
bounded private IPC, EOF/watchdog cleanup and explicit cleanup acknowledgements.
A quarantined reader-side launcher now sequences heartbeats, closes the
lifetime pipe on cancellation and blocks replacement until cleanup and
process exit are confirmed. The production reader launcher uses this
supervisor. Private tests cover helper death and repeat/lock policy; physical
collisions remain an acceptance gate.
See [the native prerequisite](../../cthulhu/docs/testing/remote-key-target.md).
- Private native crash tests now kill/stop the process running the real reader
SDK/host/mailbox worker and Supervisor. The separate helper releases held
modifiers on EOF/watchdog expiry; resuming the stopped owner leaves input
retired and replacement blocked after unconfirmed helper exit. These exercise
the shared worker without launching an installed reader or establishing
physical keyboard acceptance. See [the evidence and limits](../../cthulhu/docs/testing/remote-input-helper.md#mailbox-owner-process-failure).
- A quarantined reader repeat normalizer converts native key observations into
one down, repeated downs and one up for the outgoing encoder, with private
Xvfb evidence for held keys. A capture router balances modifiers around
local/escape chords. Both are attached to production capture. See
[keyboard.md](keyboard.md).
- TLS with normal certificate/hostname validation or an already-approved,
endpoint-bound SHA-256 certificate pin. Authentication sends no channel key
before verification. Channel keys can be generated with 256 bits of entropy.
- Cancellable dial, TLS, join, read and write operations; serialized, bounded
writes; transport closure on failure or overflow.
- Relay session validation for one opposite-role peer, origin checks, direction
checks, stale-generation rejection and suspension on membership changes.
- Validated settings and separate, explicit saved-key storage with endpoint-bound
pins, owner-only files, symlink/hardlink rejection and atomic replacement.
Storage does no network I/O; see [storage.md](storage.md).
- A coordinator using public Go SDK leases and lifecycle events for explicit
connection attempts, heartbeats, revocation and ordered failure cleanup.
It requires reader-issued approval, never retries and bridges typed speech
IPC to the production software speech owner; live acceptance remains pending.
See [lifecycle.md](lifecycle.md).
- Explicit certificate inspection with no application data, fingerprint review
with Copy/Trust once/Cancel, and masked Remember/Forget key form handlers.
A single library connection workflow now combines them with explicit saved-key
loading, Connect and status/Disconnect. Credentials and certificate checks precede approval. Setup cancellation follows the
local interaction lifetime; stale forms cannot disconnect a newer epoch. These have
private SDK-process coverage and source-command registration.
The reader authorization prerequisite is described below. See [security-ui.md](security-ui.md) and
[connection-ui.md](connection-ui.md).
The adjacent reader now also supports secret entries in transient Tentacle forms:
masked speech/Braille editing, copy/cut denial, explicit paste and cancellation
without returning values. Persistent preference pages reject secret entries.
This prerequisite is covered by both SDKs and a private Xorg form harness; it
does not by itself provide Remote's connection UI. Credential storage and
the combined connection workflow are supplied by the library described above.
A subsequent [private Xorg feasibility increment](../../cthulhu/docs/testing/remote-input-feasibility.md)
demonstrates exclusive capture and independent test-helper cleanup after writer
death or heartbeat expiry. It also records why connection closure and ordinary
input-event flags are insufficient for safe remote injection. Production capture
and helper integration now build on that evidence.
Physical-key collision and interoperability acceptance remain unverified.
The reader's [Braille feasibility increment](../../cthulhu/docs/testing/remote-braille-feasibility.md)
now reuses its existing liblouis viewport and physical writer's cell-mask logic
to export translated virtual cells without opening a display. Private tests
cover independent widths, contracted routing, attributes and cursor overlays.
Virtual table/cursor policy, helper IPC and raw receiving are implemented in
the production Braille bridge. Physical-display acceptance remains pending.
The reader now also implements opt-in protocol 1.1 lifecycle IPC, both SDK clients,
explicit install grants, and expiring core-issued leases. See
[the session contract](../../cthulhu/docs/tentacle-sessions.md). Private conformance
and GTK tests cover this foundation. The library coordinator now consumes these
leases through the public Go SDK, with private synthetic-host/TLS coverage.
A subsequent [reader authorization increment](../../cthulhu/docs/tentacle-remote-authorization.md)
adds core consent, lock/handoff cancellation and local-only sensitive forms.
Injected approval is rejected in private XI2 tests; physical-keyboard approval
remains unverified. The source command now requests core consent through typed
interaction requests. Core revokes the original epoch on ordinary interaction completion;
automatic desktop return retains only the verified already-open lease.
Bounded cancellation also stops pre-lease inspection on lock/handoff.
Keyboard, clipboard text and Braille desktop services use these approved leases.
Explicit Trust and remember/Forget pin actions now manage endpoint-bound saved
certificate trust. `make build` builds `remote/bin/remote`; `make check` also
checks initial command-host output and real-host/private-relay integration.
This implements relay data handling, storage, connection lifecycle and library
forms. Parsing a key, speech fragment or
Braille gesture does not execute it. Network readiness is not consent. The
reader must supply locally authorized leases and recheck them when effects are
delivered. See [protocol.md](protocol.md) for the wire contract and
[implementation.md](implementation.md) for the reader integration dependencies.
## Verification
From the `cthulhu-tentacles` repository:
```sh
GOCACHE=/tmp/cthulhu-cache GOPROXY=off go test -race ./remote/src -count=1 -timeout=60s
make check
```
Tests create private loopback TLS listeners and in-memory test certificates.
Security-form tests use synthetic submissions, not real keyboard input.
They do not connect to public relays, the active reader, an accessibility bus,
the desktop display or a clipboard. The coordinator also uses the actual Go SDK
over private pipes against a synthetic lifecycle host. A separate workflow test
process exercises actual SDK form/lease IPC, storage and private relay TLS together.
Fixtures are independently written examples
based on source review, **not captured NVDA sessions**. The [source-command
procedure](command.md) describes pending physical-input acceptance checks;
private fixtures do not establish them.
Remaining release evidence includes captured NVDA protocol fixtures, actual
NVDA/add-on/Orca interoperability, physical-source approval and keyboard recovery,
audible speech and masking, physical Braille, installer checks and ARM64 package
validation. The test release does not establish those live results. Unreviewed
speech producers remain deliberately local.
See [the current plan status](../remote.md) for scope and release gates. Older
increment documents describe the state at the time of each increment, not a
current implementation backlog.
## Relay trust
TLS protects the connection to the relay. NVDA Remote v2 is not end-to-end
encrypted: the relay can see the channel key and session contents. Relay origin
IDs do not authenticate human identities. Rejecting extra peers cannot undo data
the relay already sent to them. The reader's consent UI explains these properties
before issuing consent.
The code is an independent implementation licensed under GPL-3.0-or-later;
see [LICENSE](LICENSE). Reference implementations, revisions and fixture
provenance are recorded in [protocol.md](protocol.md).