feat(truapi-debugger): wire trace, decode, and render engine - #536
Draft
decrypto21 wants to merge 2 commits into
Draft
feat(truapi-debugger): wire trace, decode, and render engine#536decrypto21 wants to merge 2 commits into
decrypto21 wants to merge 2 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
decrypto21
force-pushed
the
nidish/debugger-2-engine
branch
from
August 28, 2026 06:53
eebee61 to
e8d9625
Compare
decrypto21
force-pushed
the
nidish/debug-host-port
branch
3 times, most recently
from
August 31, 2026 10:25
715bfec to
af7b25a
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.
Stacked on #295. Design doc: #315.
The debugger package's engine: raw frames in, per-operation traces out. No I/O and no mount — it renders HTML and ships the stylesheets, but nothing attaches it to a DOM or a socket. Both mounts (the standalone inspector, the in-app panel) are PRs above this one and both drive this single engine, so no surface can show a grouping, badge or latency the other would not.
What
ingest.ts) — one envelope to oneObservedFrame. Resolves the lifecycle role as a pure function of the frame id against the wire table, at ingest, so it is true for every consumer rather than for one view adapter. Length-clamps retained ids.wire-debugger.ts) — traces keyed on(channelId, requestId), neverrequestIdalone: each host mints its ownp:1, so two hosts would collide. Generation rotation for recycled ids. Bounded on three axes (traces, frames per trace, bytes per trace), and every bound surfaces rather than misreports.decode.ts) — gated on the frame's own producer having attested a matching wire schema, and on the channel's standing verdict. Both gates apply; neither replaces the other.trace-view.ts,trace-render.ts) — one projection and one renderer, shared by both mounts.retry-storm.ts) — a burst of like operations is invisible to a single-trace view, so the engine groups by(channelId, opener frameId).Two invariants worth reviewing closely
frames[0]is only the opener if the opener was the first frame observed, and every tap attaches mid-session — so the first frame seen for an id is often a closer for an operation that predates the tap. Retention spares the opener by role; keying on index 0 evicts the frame pairing and storm detection depend on.Verification
tsc -bclean,typecheck:testsclean (this PR adds that script and its CI step —tsconfig.jsonexcludes test files andbun testdoes not typecheck, so nothing checked them), 115 tests.