Add: tabId + frameId on debug-trace records (JSONL + CDP)#225
Merged
Conversation
Each JSONL line now wraps the entry with the recording context so a single file (or a concatenation of files across tabs) keeps per-frame attribution. Matches the shape `window.__abs_dumpTrace()` already returns. `addedAt` is omitted — the entry's own `timestamp` is what callers correlate against. Schema-conformance test reads `extension/data/debug-trace.schema.json` directly and validates every exported line with @cfworker/json-schema, so adding a field to a `DebugTraceEntry` variant without bumping the schema fails CI. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Previous revision wrapped each exported record as `{tabId, frameId, entry}`.
Flatten to `entry + tabId + frameId` so the public shape has no envelope.
Applies to both the popup JSONL export and the `__abs_dumpTrace()` CDP path
so they continue to share a single schema.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Summary
tabIdandframeIdto every record in the popup's JSONL export and thewindow.__abs_dumpTrace()CDP response. Today the JSONL drops both (tabIdonly appears in the filename,frameIdis lost entirely); the CDP path returned them via an envelope. The two surfaces now share one flat shape:DebugTraceEntry + tabId + frameId.addedAtis internal IDB bookkeeping and is not exposed (each entry carries its owntimestampstamped at content-script emit time).extension/data/debug-trace.schema.jsonto puttabId/frameIdon each entry variant (segment / rule-application / navigation) so the public schema covers both surfaces with no envelope.lib/debug-trace-export.tsexportstoExportedRecord+buildJsonl. The popup hook and the background's CDP handler both call into it so the wire shape lives in one place.lib/__tests__/debug-trace-export.test.ts) reads the actual schema file from disk and runs each emitted line through@cfworker/json-schema. Adding a field to aDebugTraceEntryvariant without bumping the schema fails the test (additionalProperties: false+ a negative-control case that dropstabId).docs/src/content/docs/debug-trace.md) updated: the prose that previously said "the three top-level entry types are" now describes records astype-discriminated withtabId/frameIdon every record.Test plan
bun run check(biome + eslint) — cleanbun run typecheck— cleanbun run test— 1910 tests pass (4 new indebug-trace-export.test.ts)bun run knip— cleanpre-commit runon changed files — passes mdformat, biome, eslint, copyright headerstype,tabId,frameId.await window.__abs_dumpTrace()and confirm each element is the flat shape (noentry/addedAtenvelope).🤖 Generated with Claude Code