[GH-ISSUE #4477] [Bug] Omitted JSON request bodies are reported as complete body-shape coverage #1774

Closed
opened 2026-10-16 21:10:08 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @Adolanium on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4477

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Process capture or runtime observation

Observed behavior

With include_json_body_shapes, a JSON request whose body CDP did not deliver is reported as having complete body-shape coverage once its JSON response shape is captured.

For a Network.requestWillBeSent request with Content-Type: application/json, hasPostData: true, and no postData, followed by a JSON response, the request has body_shapes: { status: "included", request: null, response: {...} } and completeness.unavailable_sections is []. Comparing two such captures gives a network dimension of unchanged.

An unparseable JSON request body is also upgraded to included when its response shape arrives. That case does mark json_body_shapes unavailable.

Reproduction

  1. Build two passive captures with CdpCaptureEvents and include_json_body_shapes: true.
  2. In each, ingest a POST Network.requestWillBeSent with a JSON Content-Type, hasPostData: true, and no postData. This is what CDP sends when a request body is too long to inline.
  3. Ingest a JSON Network.responseReceived and a response body through ingestResponseBody.
  4. Compare the captures with compareWebCaptureEvidence after clearing attach-limited sections.
  5. The request is included and the network dimension is unchanged.

Expected behavior

docs/browser-observation.md says unavailable or truncated selected coverage makes equivalence unknown. A request whose JSON body shape was expected but not observed should leave json_body_shapes unavailable and should not be reported as included. The comparison should be unknown.

Requests with no body, such as an ordinary GET, should stay as they are.

Impact and scope

Comparisons of captures with long JSON request bodies can report unchanged while the request bodies were never examined. Response shapes and request bodies delivered inline are not affected.

REA version

6.5.0, revision 8ab502439

Runtime and platform

Node 24 on Windows 11. The behavior is platform-independent.

Target and artifact context

Passive CDP page capture with JSON body shapes selected. Synthetic CDP events only.

Interface

MCP

Earliest failure stage

Capture or observation

Relevant output or evidence

"body_shapes": { "status": "included", "request": null, "response": { "root_type": "array", ... } }

unavailable_sections: [], network dimension unchanged.

Typed outcome or recovery expected

body_shapes.status: "partial" for that request, json_body_shapes in completeness.unavailable_sections, and a comparison status of unknown.

Analysis or suspected cause

Source-derived. requestBodyShape in src/browser/CdpCaptureEventBodyShapes.ts returns status: "unavailable" when postData is absent and does not call state.completeness.unavailable("json_body_shapes"). updateResponseBodyShape sets status: "included" whenever a response shape is present, regardless of the request side. hasPostData is not read anywhere in src/. networkDimension in src/domain/webCaptureDiff.ts treats included records with a complete json_body_shapes section as full coverage.

Additional context

Fix is in https://github.com/morluto/rea/pull/4476.

Originally created by @Adolanium on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4477 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Process capture or runtime observation ### Observed behavior With `include_json_body_shapes`, a JSON request whose body CDP did not deliver is reported as having complete body-shape coverage once its JSON response shape is captured. For a `Network.requestWillBeSent` request with `Content-Type: application/json`, `hasPostData: true`, and no `postData`, followed by a JSON response, the request has `body_shapes: { status: "included", request: null, response: {...} }` and `completeness.unavailable_sections` is `[]`. Comparing two such captures gives a network dimension of `unchanged`. An unparseable JSON request body is also upgraded to `included` when its response shape arrives. That case does mark `json_body_shapes` unavailable. ### Reproduction 1. Build two passive captures with `CdpCaptureEvents` and `include_json_body_shapes: true`. 2. In each, ingest a POST `Network.requestWillBeSent` with a JSON `Content-Type`, `hasPostData: true`, and no `postData`. This is what CDP sends when a request body is too long to inline. 3. Ingest a JSON `Network.responseReceived` and a response body through `ingestResponseBody`. 4. Compare the captures with `compareWebCaptureEvidence` after clearing attach-limited sections. 5. The request is `included` and the network dimension is `unchanged`. ### Expected behavior `docs/browser-observation.md` says unavailable or truncated selected coverage makes equivalence unknown. A request whose JSON body shape was expected but not observed should leave `json_body_shapes` unavailable and should not be reported as `included`. The comparison should be `unknown`. Requests with no body, such as an ordinary GET, should stay as they are. ### Impact and scope Comparisons of captures with long JSON request bodies can report `unchanged` while the request bodies were never examined. Response shapes and request bodies delivered inline are not affected. ### REA version 6.5.0, revision `8ab502439` ### Runtime and platform Node 24 on Windows 11. The behavior is platform-independent. ### Target and artifact context Passive CDP page capture with JSON body shapes selected. Synthetic CDP events only. ### Interface MCP ### Earliest failure stage Capture or observation ### Relevant output or evidence `"body_shapes": { "status": "included", "request": null, "response": { "root_type": "array", ... } }` `unavailable_sections: []`, network dimension `unchanged`. ### Typed outcome or recovery expected `body_shapes.status: "partial"` for that request, `json_body_shapes` in `completeness.unavailable_sections`, and a comparison status of `unknown`. ### Analysis or suspected cause Source-derived. `requestBodyShape` in `src/browser/CdpCaptureEventBodyShapes.ts` returns `status: "unavailable"` when `postData` is absent and does not call `state.completeness.unavailable("json_body_shapes")`. `updateResponseBodyShape` sets `status: "included"` whenever a response shape is present, regardless of the request side. `hasPostData` is not read anywhere in `src/`. `networkDimension` in `src/domain/webCaptureDiff.ts` treats `included` records with a complete `json_body_shapes` section as full coverage. ### Additional context Fix is in https://github.com/morluto/rea/pull/4476.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1774
No description provided.