feat(truapi-server): host-side wire debug tap and debugger - #295
Open
decrypto21 wants to merge 1 commit into
Open
feat(truapi-server): host-side wire debug tap and debugger#295decrypto21 wants to merge 1 commit into
decrypto21 wants to merge 1 commit into
Conversation
decrypto21
force-pushed
the
nidish/debug-host-port
branch
from
July 25, 2026 06:30
f752ca3 to
70c230f
Compare
decrypto21
force-pushed
the
nidish/debug-host-port
branch
2 times, most recently
from
July 25, 2026 09:42
6869ac4 to
0ac06b0
Compare
decrypto21
marked this pull request as ready for review
July 25, 2026 09:43
Imod7
reviewed
Jul 27, 2026
decrypto21
force-pushed
the
nidish/debug-host-port
branch
from
July 28, 2026 09:03
0ac06b0 to
65ac1ff
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
decrypto21
force-pushed
the
nidish/debug-host-port
branch
2 times, most recently
from
July 28, 2026 19:55
2cb82cf to
9ef0a44
Compare
decrypto21
force-pushed
the
nidish/debug-host-port
branch
from
July 28, 2026 20:04
9ef0a44 to
6a6060f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the wire observability layer for TrUAPI: a payload-blind debug tap in the Rust host
(
truapi-server), correlated by the wirerequestId. The host streams every product↔host frame toa debugger app it dials out to. The tap carries the frame bytes opaquely — the core never decodes
them — so it leaks no application content or key material, and
@parity/truapi(the product package)is untouched. Dev-only: the tap is inert unless a host installs a sink. Design doc:
docs/design/wire-observability-debug-host.md(#315).What's in it
DebugSinktrait +DebugEventintruapi-server— the tap at the two frame choke points(
ProductRuntime::receive_frameinbound,FrameSink::emit_frame/SinkTransport::sendoutbound).Outbound forwards to the product before it emits; inbound emits before dispatch so a corrupt frame
is still observed;
emitis fire-and-forget and inert when no sink is installed (a lock-freehas_debugfast path). Direction on the wire is product-vantage (out= left the product), pinnedby a guard test;
DebugEventis#[non_exhaustive](room for non-frame events like SSO).@parity/truapi-debugger(private, in-repo) — the debugger.createWireDebuggergroups frames intoper-
requestIdWireTraces (LRU-capped);createMethodNameMapresolvesframeId → "account.getAccount"from the generated wire-table; a Bun WS server the host dials into serves apayload-blind trace view. Envelope:
{ channelId, dir, frame }.@parity/truapi-hostworker dial — a dev-gated outward WebSocket to the debugger, configured from alocalStoragedebugger URL the host reads. When set it installs the RustDebugSink; absent ⇒ nosink and the tap stays inert. The product is cross-origin and can't turn it on.
Verification
cargo test -p truapi-servergreen — the tap is covered in both directions with the product-vantagedirection convention pinned (
debug_sink_taps_frames_in_both_directions,frame_direction_wire_str_is_product_vantage).@parity/truapi-debuggerhas a live-serverbun test(a host dials in, streams a frame, the server decodes + groups it on
/traces), and a newts-debuggerCI job builds + tests it.@parity/truapiand@parity/truapi-hostare green(
tsc+bun test); the TrUAPI playground builds.Notes
Design decisions live in the design doc (#315).
Corrupt inbound frames are surfaced as a
malformedframe rather than the transport silently closing.Not in this PR (phase 2): the native outward-dial sinks (
ws_bridge),wss+ cert-trust, and a mockhost + browser harness.