fix(review): work through the deferred TLS-only review minors #21
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/fleet-tls-review-minors-computer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fix(review): work through the deferred TLS-only review minors
The
computerhalf of the deferred review minors inHANDOVER.md§3.5 —the findings recorded during piece 3's per-task and whole-branch reviews and
triaged "ship, not blocking". This is the
computerpeer of esp32 PR #19(the trust-tool minors).
Nothing here changes the shipped behaviour of the TLS-only transport. It
closes the gaps the reviewers flagged: swallowed errors, untested guards, one
removed plaintext affordance, and two pieces of test hygiene.
What changes
The server's certificate-subject log learns its exceptions.
cert_subjectwrapped the private
ssl._ssl._test_decode_certin a bareexcept Exception.It now catches only the unreadable-file cases —
ssl.SSLError,OSError,ValueError— each of which was verified against a missing, garbage,directory, empty and truncated file (all raise
ssl.SSLError). A genuine bugnow surfaces instead of vanishing into
<unreadable>.The
python -Ohole is closed.s2s_pipeline.build_pipelineusedassert server_tls is not Nonein the websocket and realtime branches; under-Othat vanishes, and aNonewould flow intoWebSocketStreamer/RealtimeServer. Both now raise a namedRuntimeError, and a test forces thebranch with
Noneto prove the guard is real.Three startup guards are now pinned by tests:
RealtimeServer.__init__(empty pool; each missing/empty/partial cert+key combination — the one guard
piece 3 left untested), the
socket-mode TLS exemption(
build_pipeline(mode="socket")must not callrequire_server_tlsat all),and the
<empty>subject branch.One plaintext affordance removed.
listen_and_play_realtime.pyaccepted aplaintext
--websocket-base-url; it now rejects a non-wss://value exactly assynthetic_conversation_realtime_client.pyalready did.test_audio_path.py'stest_live(..., ca_bundle=None)also loses its optional default, which wouldhave silently fallen back to the system trust store.
Test hygiene.
test_client_capture_mode.pydrops its hard-codedcomputer-test-caPEM in favour of the session's throwawayself_signed_certfixture. The
resolve_trust_dirdefault-path test is no longer tautological: itderives the repo root from the test file rather than the module under test, and
asserts the default is a sibling of the repo, never nested inside it.
The static fence gets behavioural companions.
tests/test_tls_invariant.pynow drives both URL-accepting scripts' own CLIs and asserts a
ws://argumentis refused with exit 2. The grep fence stays as the CI-side complement; the
behaviour is now pinned directly.
Deliberate non-changes (with reasons)
__file__-derived default dev-trust path. The design says the default is../.dev-trustrelative to the consuming repo — a source-checkout notion.A non-editable install derives a wrong
site-packagespath, but nothing eversilently serves with it:
require_server_tlsfails loudly whenserver.pem/server.keyare absent and namesSTARFLEET_TRUST_DIRas theremedy. The docstring now says this outright.
STT/README.md/TTS/README.mdsnippet lists. Their invocations serve asocket and so need TLS material, but they are covered by the pointer sentence
in
computer/README.mdthat names both files and states the requirement. Thesnippets stay as-is rather than duplicating the flags into ~15 examples.
docs/plans/2026-09-10-ota-computer.mdis corrected in place and marked superseded, rather than left to mislead.
Review follow-up
Whole-branch review returned no Critical and no Important findings. The worthwhile
Minors were folded in as a second commit: the superseded pointer is qualified as
the root repo's spec, the websocket branch gets the mirror of the realtime
-Oguard test,
_load_scriptuses a private module name, the CLI guard tests assertthe
wssmessage (not just exit 2), andtest_audio_path.py --liveis driven asa CLI to pin item 10's behaviour rather than only its type signature.
Verification
Sandbox suite: 980 passed, 1 deselected (968 before; 12 tests added).
ruff check/ruff format --check/mypy src/clean. Public-repo hygienescan over the added lines clean.