Skip to content

Plan for changes to CDP monitor #216

Open
archandatta wants to merge 2 commits intomainfrom
archand/plan/cdp-monitor-refactor
Open

Plan for changes to CDP monitor #216
archandatta wants to merge 2 commits intomainfrom
archand/plan/cdp-monitor-refactor

Conversation

@archandatta
Copy link
Copy Markdown
Contributor

@archandatta archandatta commented Apr 14, 2026

Note

Low Risk
Documentation-only change that proposes a future refactor; no runtime behavior, APIs, or tests are modified in this PR.

Overview
Adds a new design doc (plans/cdp-decode.md) proposing a two-layer CDP decode approach: first decode wire events into PDL-faithful structs (retaining all fields, with complex sub-objects kept as json.RawMessage), then project those typed structs into monitor events.Event payloads.

The plan outlines intended file changes (new cdp_proto.go, handler signature shifts, centralized decode in dispatch) and a golden round-trip fixture test strategy to detect dropped/incorrect fields, but does not implement these code changes.

Reviewed by Cursor Bugbot for commit b92a406. Bugbot is set up for automated code reviews on this repo. Configure here.

@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: PR title and empty body suggest planning discussion rather than actual code changes to kernel API endpoints or Temporal workflows; please add deploy monitoring manually if this involves kernel API modifications.

To monitor this PR anyway, reply with @firetiger monitor this.


**Tests:**

- `cdp_proto_test.go` (NEW) — golden-fixture tests. For each Layer-1 struct, a captured real Chrome-emitted JSON frame in `testdata/`. Test decodes the frame, then re-marshals and asserts the round-trip preserves all top-level keys (catches dropped fields). This is the mechanical audit.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you want to compare normalized full JSON after decode/re-marshal and not just top level keys, to get a full structurual round trip check

you could also consider some light codegen around the json schema in json/js_protocol.json in the devtools repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants