17 KiB
Typed speech transport and relay conversion
Remote now connects NVDA protocol-v2 speech conversion to the matching
experimental reader's typed speech IPC. Controller sessions call remote.present;
controlled sessions send matching remote.output events to the relay. The
matching reader now observes a limited set of explicitly local accessibility
speech attempts, document navigation and Say All through its existing speech worker. It excludes private origins,
passwords and local status, captures the original lease at queue admission and
rechecks authority at export. Production software sessions now attach an isolated
incoming renderer with
original-lease, focus and output-policy checks. Local output retires older remote
work; its client uses lower SSIP priority than local speech. Incoming text stays
out of history and observation. Backend failures retire their original lease;
remote or server cancellation discards its assembly without cancelling local
status. No installed or active reader was changed. Audible acceptance remains
pending; a private SSIP fixture does not prove actual server scheduling.
The incoming stream handles remote cancel, cancel-on-pause and limited NEXT/NOW ordering while retaining mailbox budgets through cleanup. Idle voices close with their original lease. Interrupted speech is discarded rather than resumed, and pause false accepts future speech only. See the production owner and local-priority contract. The source-command/private-relay checks now exercise the actual runtime owner with long literal multilingual text, spelling/language metadata and active cancellation on Disconnect, lock, handoff and disable. These use synthetic local form submissions and a private speech server, without audio or physical input.
The coordinator and assembly increments were based on Tentacles 703d440 (master) and reader
9e15f86 (testing), both confirmed current with git pull --ff-only on
2026-11-04. The assembly increment changes reader wire/host code and both SDKs
as well as the external coordinator. The later observation increment is based
on Tentacles c158321 and reader 9bc74db, confirmed current with
git pull --ff-only on 2026-11-04. The later incoming-owner increment starts
from reader ac67236 and Tentacles 3a403cb, synchronized on 2026-11-05.
The completed reader observation implementation is commit b60cf5d on testing;
use that revision or a descendant containing it for these source checks.
src/speech_bridge.go converts speech, cancel and pause messages. It preserves
text fragments and whitespace, resolved spelling/language state, end-utterance
boundaries and numeric priorities. Long text splits at UTF-8 boundaries into
frames within the reader's 6144-byte canonical JSON limit, including escaped
control characters. Each frame retains resolved character/language state.
Unknown NVDA speech commands remain counted by the existing decoder and are not
converted into reader effects. No peer-supplied path or backend command executes.
Outbound conversion emits NVDA command arrays, resets character/language state when necessary, and leaves origin IDs to the relay. It validates every payload through the same typed reader schema before serialization.
src/speech_stream.go owns per-attempt speech queues. The relay reader checks
membership, peer origin and direction before conversion. Incoming speech requires
the controller role and remote-present; observed output requires the controlled
role, output-observe, and the exact current lease/epoch. Events received while
waiting for a peer are discarded rather than replayed to a later helper. Received
speech never becomes an observed-output event in the Tentacle.
One worker serializes presentation and heartbeat calls using their shared monotonic operation sequence. It checks a due heartbeat before each presentation, including split frames; heartbeats also run during dial/join. A separate worker serializes relay output in SDK event order. The SDK event consumer never waits for relay writes or reader calls. Both workers recheck the current attempt, cancellation and peer readiness before handing off work. Core remains responsible for checking its lease and output/security policy at actual speech delivery.
Queues admit at most 64 items and 256 KiB of serialized speech across both directions, including work in flight. A split incoming utterance reserves all of its frames together or admits none. Overflow stops the connection; no cancel is selectively dropped. Revocation, replacement, disconnect, SDK EOF, membership failure and worker failure cancel the socket and clear pending speech. Teardown waits for both workers before the final sequenced close. An in-flight reader call retains its independent two-second deadline, so ordinary disconnect does not cancel a healthy SDK session. In-flight accepted work still needs the reader's delivery-time context check; closing a queue cannot undo delivered audio.
Split utterances now retain one utterance identifier across their reader
calls, equal to the first fragment's operation sequence; only the last sets
final: true. Heartbeats may occur between fragments. Core assembles the whole
utterance before admitting one owner delivery, with a single priority and the
original fragment/utterance boundaries. A failed or revoked assembly exposes no
prefix to the owner. Single-frame speech, cancel and pause keep their original
single-call representation. These fields belong only to reader IPC; NVDA relay
frames are unchanged.
The reader independently enforces 64 frames and 256 KiB across staged, queued
and in-flight speech. Its owner must call the delivery's idempotent Release
after delivery/discard; stale releases cannot affect replacement leases. Byte
or frame overflow revokes the lease and drops the assembly. The production software owner now supplies delivery-time policy, local priority
and separate cancellation ownership. Atomic assembly is not backend completion or audible delivery. No
audible pause/resume or priority fidelity is established.
The matching reader adds an explicitly attached incoming speech mailbox, typed
Go/Python validators and remote.output events. See
its precise contract. These SDK
additions are prerequisites for building this increment; use the matching reader
source, not an older release. Its limited output observer now provides explicit
origins, private/secret exclusion, speech-mode and generation checks, UTF-8
splitting and atomic outbound IPC reservation. Queue failures retire Remote's
process session without blocking local speech. Only the main accessibility
presenter and reviewed document producers opt into export. Document caret movement,
navigation and assembled lines inspect original sources and ancestors; a sensitive
or unclassified Say All line keeps the whole batch private. Each Say All chunk
exports its resolved text and utterance boundary under the original admission
lease. Reconnecting during reading cannot export later chunks under new consent.
Browse-mode current-line reporting, spelling and phonetic spelling now also
export after checking the captured ancestry and every joined fragment. Missing,
unknown, stale or password source metadata keeps the report private without
changing local reading. Repeated letters, character state and pronunciation
follow the existing worker under the original lease. Native current-line reports
now also export when a fresh, bounded capture includes the matching focused
source and every parent through its application. Failed, cyclic or truncated
capture keeps local text readable while denying export. Password, unknown/invalid
and defunct sources or ancestors stay private. Lock/handoff and the original
focus/epoch are checked before presentation; local caret, focus and Braille stay
unchanged.
Successful object-review destinations and flat-review lines, words and characters
now export with captured source ancestry. Joined flat lines check every spoken
zone, including ancestors outside menu/dialog capture scope. Password, unknown,
invalid, defunct and missing/stale sources keep the report local. Errors and
boundaries remain private. Role chunks, spelling, phonetic expansion, character
state and pronunciation retain the existing worker's order and admission lease.
Where Am I at document positions now exports with complete captured ancestry.
Use reader 103fbfd or a descendant containing this change.
The classification belongs to the current snapshot and original document
focus/epoch; every snapshot replacement clears it, including same-object native
updates. Password, unknown/invalid, defunct, missing/mismatched ancestry and
retired document focus/epochs keep the report local. With reader 8631c5a or a
descendant, native Where Am I now also
exports while an output observer is active, after fresh focused-snapshot and
complete-ancestry verification on the reader's review/GLib owners. The fresh
rendered text, formula, role and chunk boundaries must match the cached local
report. Failed, missing, private or truncated ancestry and changed reports keep
local speech private. Snapshot replacement, focus/epoch changes and lock/handoff
retire pending results. No native classification is cached for reuse; idle Remote
retains the existing immediate local path. Missing-location status stays private.
See the exact native verification contract.
Existing role chunks and pronunciation
use the speech worker's normal lease/generation admission. With reader 9ac3356
or a descendant, reading-context entry/exit announcements also export for eligible local requests after
checking every retained context and its ancestry. Existing navigation/Say All
settings, counts, panel deduplication, spelling and utterance order are retained.
Cached exit labels use their previous context's original observation ticket,
alongside current-request eligibility, so pre-consent/private labels or a retired
session cannot acquire replacement consent. Reset clears labels and their ticket;
unknown context grants no new authority. Local system voice and exact label text
are unchanged; this path does not apply pronunciation replacements.
Separate key-name echo and other producers still need source review. Priority and language use
defaults; no voice/backend state is sent.
A subsequent privacy review retains every visual-line fragment's original ancestry separately from presentation context, including after Say All flattens the text. The shared classifier also rejects explicit unknown/invalid roles and defunct objects in sources and ancestors for accessibility and document speech, matching review speech. A sensitive or unclassified neighbor now excludes the line from export, and a private Say All line excludes its entire batch. Failed ancestry lookup keeps local reading available while denying export. Source-tree, presentation/SDK and source-command/private-relay regressions cover these cases. Current-line regressions also cover recapture, stale ancestry with retained local text, repeated-letter spelling, phonetic expansion and blank lines. Private GTK checks verify native source ancestry, changed private ancestor roles, caret preservation and denial of export metadata for overlong ancestry. The actual source-command/private-relay fixture exports ordinary browse and native current-line reports while excluding a joined private neighbor and a native report with private ancestry. The same source-command fixture exports ordinary object/flat review and excludes private and stale-context reports. Owned-tree regressions retain every joined zone, outer menu ancestors and the original context across tree replacement. Context regressions compare local and exported entry/exit order, Say All and repeated-letter spelling; private, unknown, defunct and filtered ancestry remains excluded. Real SDK-process checks cover cached labels before consent, replacement leases and queued old/pre-consent context. The actual source-command/private-relay fixture exports ordinary context transitions and excludes private cached exits.
The source command now offers explicit Return to desktop after reader lease open, releasing its status form and interaction slots while heartbeats continue. The Remote shortcut reopens status/Disconnect. The reader checks the original process-owned lease; no consent or lifetime is extended. Private source-command tests cover both roles, repeated desktop return/reopening and background disconnect/lock/handoff/disable. Physical capture release and ordinary desktop speech still need acceptance. Incoming software speech now has separate cancellation ownership; UI warnings disclose its experimental status and unsupported desktop services.
The matching reader now also has a lazy isolated software-synthesis handle. It owns a separate SSIP speaking/control pair, so its cancel cannot target the local status or echo client. Private SSIP tests cover that ownership and settings retirement. A subsequent isolated renderer validates complete assemblies, coalesces matching state across IPC splits, preserves spaces/tabs and line boundaries, escapes SSIP data lines and renders resolved spelling/language state in plain-text mode. Effective default language/module/voice queries prevent state from leaking across assemblies; cancellation retires the handle and drops its suffix while preserving local status/echo. Priority is retained for a future owner, without being applied by this primitive. See the exact rendering contract and named-voice fallback. The production stream now connects this renderer to the mailbox with delivery-time lease/output policy, local priority and cancel/pause handling. Actual Speech Dispatcher scheduling and audible acceptance remain open.
Verification:
GOCACHE=/tmp/cthulhu-cache GOPROXY=off go test -race ./remote/src -count=1 -timeout=90s
make check GOPROXY=off
Both passed for the assembly increment. Reader wire/host/both-SDK race suites also passed with a 240-second timeout (the host suite took about 127 seconds), as did the focused real-host connection race tests and affected-package vet.
Conversion tests exercise spelling/language reset, cancel/pause, priorities,
unsupported commands, whitespace and long escaped multilingual text. Reader
tests send speech through real Go/Python SDK child processes and exercise stale
leases, replay, absent owners, origin restrictions and overflow cancellation.
Coordinator tests cover FIFO split/cancel/pause, shared heartbeat/present/close
sequences, lease/grant/role checks, pre-peer output, stale output, unavailable
owners, whole-utterance admission bounds and queue cleanup. A blocked reader
presentation and a blocked relay write establish that lifecycle cancellation
can stop the socket without waiting for either effect path. Both-role child
process fixtures exercise actual Go SDK framing, connection forms, storage and
private TLS relay speech together. The reader's real-host/private-relay fixture
now passes long escaped multilingual speech from the source-built command into
one complete test-owner delivery. Reader SDK-process tests also establish no
prefix before finalization, interleaving/priority/replay rejection, heartbeat
progress, assembly retirement, both budget limits and idempotent/stale release.
The repository check runs these reader Remote speech, observation and connection
tests. Observation tests cover both SDKs, stale tickets, policy retirement,
all-or-none frame/byte admission, pronunciation, characters, chunks/spelling,
private origins, speech modes and cancellation generations. The real source
command fixture now also carries transformed long speech-worker output through
actual SDK IPC to the private relay, followed by ordered cancel; password, form
and status requests produce no speech frames. All output uses a test backend.
Queue-level reader regressions hold delivery across reconnection and verify
that queued old-consent and pre-consent output cannot follow the new lease.
They also establish that observation overflow retires Remote while local speech
and subsequent reading continue. Ten repetitions of the observation race cases
passed during completion review, together with the full Remote and reader
host/wire/both-SDK race suites, focused application race checks, affected-package
vet, a separate reader build, the speech regression harness and make check.
Document-reading regressions now cover source/ancestor privacy, mixed lines,
private error status, sentence boundaries, pronunciation and replacement consent
between Say All chunks. The actual source-command/private-relay fixture also
checks two Say All sentences after returning to the desktop. A reader regression
reproduces and fixes close racing expiry/policy retirement: valid cleanup succeeds
without renewing the lease, preventing a false permanent coordinator failure.
Existing greeting, Wormhole, Battery Status and connection/consent checks remain
regressions. These checks produce no audible speech and establish no physical
keyboard, Braille or real NVDA/Orca interoperability acceptance.
For live incoming-owner acceptance, test ordinary reading, spelling, read-all, key echo, stop speech and local status in both roles. Then test lock, handoff, disconnect and peer loss for stale output and loops, using disposable desktops before testing installed releases. Those workflows remain unverified by private fixtures. Keep the experimental speech warning until live acceptance is established.