Skip to content

Plan for changes to CDP monitor #216

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

Plan for changes to CDP monitor #216
archandatta wants to merge 3 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; it does not modify runtime behavior or data handling in this PR.

Overview
Adds plans/cdp-decode.md, a design plan to refactor cdpmonitor into a two-layer CDP decode: protocol-faithful Layer-1 structs (retaining all PDL fields, with complex sub-objects as json.RawMessage) and a Layer-2 projection that maps typed inputs to monitor events.

The doc also outlines intended file/module changes and a proposed golden round-trip test strategy to ensure decoded JSON frames preserve all fields for handled CDP events.

Reviewed by Cursor Bugbot for commit 2d6311b. 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.

Comment thread plans/cdp-decode.md Outdated

**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