Add Remote relay library and secure settings storage

Add bounded NVDA-v2 framing, TLS transport, peer validation, speech and Braille decoding, and private transport fixtures. Store settings and explicitly remembered endpoint-bound keys using owner-only atomic files.

Include the implementation plan and status records. Remote remains a source library without an installable package or desktop integration.
This commit is contained in:
ak47 committed 2026-11-03 22:33:26 -05:00
1 parent bc305993b8
commit 63e84e9ac7
20 files changed
+3984

No files matched your search

+104
View File
@@ -0,0 +1,104 @@
# Remote implementation and remaining integration
The design plan is [`../remote.md`](../remote.md) in this repository. This
increment implements part of phases A and C. **Phase A is not complete**: actual
captured NVDA fixtures and complete Xorg/Braille feasibility evidence are missing.
It does not establish any of the release acceptance gates.
## Confirmed reader boundaries
Source inspection began at reader revision
`a47253d697c1aa44dea80646cad99a4fe163c7f1`; the table includes subsequent local
implementation increments recorded in the parent plan. Paths below
are relative to the adjacent `cthulhu` checkout.
| Area | Existing boundary to extend |
| --- | --- |
| Negotiation | Protocol 1.0 retains its strict prefix. Opt-in 1.1 validates explicit API/grant sets in `internal/tentaclewire/session.go`. |
| Host transport | Bounded bidirectional lifecycle calls/events now exist, retaining the 64 KiB frame bound. Desktop streaming services remain pending. |
| Go SDK | `ServeSession` and `SessionClient` provide 1.1 calls/events; legacy Serve remains unchanged. Real-process tests include blocked pipes and command concurrency. |
| Python SDK | `serve(session_client=...)` provides the same 1.1 lifecycle contract and conformance fixtures as Go, with a cancellable nonblocking pipe transport. |
| Installation | Installer, registry, discovery-to-package checks, local launch and command host now carry 1.1 install grants. Grants do not create session consent. |
| Updates/access | Install/update confirmations disclose grant direction and fresh local approval; disable/failure cancels leases. Updates revoke access before download, including failed preparation. Production consent, lock/handoff and desktop owner integration remain pending. |
| Secret controls | Transient entries now support `secret: true`, with masked editing/speech/Braille, copy/cut denial and no values on cancellation. Persistent preference pages reject secrets. Private Xorg/SDK tests cover this prerequisite; a Remote connection UI, audible speech and physical Braille acceptance remain pending. See [the contract](../../cthulhu/docs/tentacle-secret-entries.md). |
| Input | `internal/platform/xorg/listener.go` uses XRecord observation. That does not consume desktop keys. A private prototype now demonstrates exclusive capture and helper EOF/watchdog cleanup; production ownership, trusted origin and physical collisions remain unresolved. See [the feasibility record](../../cthulhu/docs/testing/remote-input-feasibility.md). |
| Braille | `internal/braille/client.go` writes text/overlay dots through a helper. Shared viewport/cell-mask feasibility tests now demonstrate translated virtual cells and independent routing without a physical display. Virtual table/cursor policy, helper IPC and raw receiving remain open. See [the evidence](../../cthulhu/docs/testing/remote-braille-feasibility.md). |
Do not relax the 1.0 validators piecemeal or add a manifest claiming these APIs
before the full reader/SDK/installer path exists. API availability and stored
grants must be separate from ephemeral consent; a child request or injected key
must never mint consent.
## Next implementation gates
1. Complete Xorg capture coexistence and physical/injected event provenance.
The private reader harness demonstrates grab-owner death and independent
helper cleanup on writer EOF/watchdog expiry, but does not establish a
production helper or physical-key collision safety. Shared Braille viewport
tests now operate without a physical target display; resolve virtual
table/cursor policy and implement isolated helper integration. These remaining
feasibility gates are not assumptions established by the relay library.
2. The [protocol 1.1 lifecycle foundation](../../cthulhu/docs/tentacle-sessions.md)
now exists through both SDKs and installation. Complete production local
consent, lock/handoff revocation and typed desktop operations; no child request
may create approval. The internal authorizer currently has only test callers.
3. Use the secret-entry support and [secure storage](storage.md) for host-issued
connection, certificate-review and explicit saved-key actions. Integrate the relay
coordinator so all transport/session failures revoke the current lease and
close the connection before any retry or local Resume action.
4. Add policy-resolved output observation and remote presentation with origin
ownership, secure-input/lock/handoff exclusion and local status priority.
5. Complete keyboard recovery, explicit clipboard transfer and virtual/raw
Braille workflows. Record physical keyboard, audible speech and physical
display results separately from private automated checks.
6. Add the manifest, catalog and package tooling only after required reader APIs
and acceptance gates exist. No commit, installation or publication is part
of this increment.
## Checks for this increment
The lifecycle increment passed reader wire/host/preferences race suites, focused
application Tentacle race tests and vet, and four private GTK workflows covering
install/update confirmations, settings and extension pages. The storage increment
adds real filesystem tests for atomic replacement, endpoint scoping, permissions,
links, FIFO rejection, locking, malformed/oversized files and secret-free errors.
Neither increment installs Remote or establishes live desktop acceptance.
The Braille feasibility increment passed both default and brlapi-tagged Braille
package suites with the race detector, tagged vet and a helper build. Eight new
tests exercise shared cell masks and real liblouis viewports without opening
BrlAPI. Physical display behavior remains pending; see the
[evidence and regression procedure](../../cthulhu/docs/testing/remote-braille-feasibility.md).
The subsequent Xorg feasibility increment adds
`python3 -B tests/native_remote_input.py` in the reader checkout. It exercises
private capture, key state, process death, heartbeat expiry, malformed input,
collision limitations and restoration of application input, then runs real
Xorg observer/internal-form/learn-mode tests with the race detector. See the
[reader evidence record](../../cthulhu/docs/testing/remote-input-feasibility.md)
for precise claims and pending production/physical-device gates.
The secret-entry prerequisite passed focused reader race tests for interaction,
wire validation, host/SDK conformance and internal forms; preferences unit tests;
the private Xorg internal-UI harness; and the Tentacles repository's `make check`.
The native harness includes existing ordinary entry, action menu, emoji picker
and clipboard regressions. It records speech requests, not audible output, and
does not establish physical Braille acceptance.
The Remote tests cover bounded/malformed frames; exact speech command shapes;
allowlisted gestures; one-peer roles and epochs; private CA and explicit-pin TLS;
no application data on certificate failure; cancellation during TLS/join/read/
write; read timeout; short/concurrent writes; and writer overflow cleanup.
They do not implement a production relay or establish interoperability with an
actual NVDA process. Fixture provenance is in [protocol.md](protocol.md).
`make check` also builds and invokes Hello World, Wormhole and Battery Status
through the existing command host. This checks existing SDK/registration behavior
without installing or replacing the active reader. Review the generated diff
before any later submission. Live desktop testing becomes meaningful only after
reader integration; the current source library provides no command to launch.
The first repository check exposed a pre-existing dependency metadata gap: the
adjacent SDK imports reader configuration, which depends on go-toml v2.4.3.
The Tentacles module now records that dependency (also directly used by Remote settings) and the same checksums
already present in the reader's `go.sum`; no dependency version was upgraded.