[PR #4351] [MERGED] fix(captures): scope HAR HTTP interpretation to entries #6195

Closed
opened 2026-10-31 01:12:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4351
Author: @To3akaRin
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @morluto

Base: main ← Head: codex/rea-oct16-captures


📝 Commits (10+)

  • 12c6316 fix(captures): scope HAR HTTP interpretation to entries
  • d114dc9 Merge commit '974487f00f' into codex/rea-oct16-captures
  • 6f89888 test(snapshot): preserve Evidence-scoped native workflow unknowns
  • 058be4b Merge commit 'e8da7e1edd' into codex/rea-oct16-captures
  • b686ccc test(process): assert owned snapshot cancellation outcomes
  • 6c6e949 test(process): preserve snapshot race causes and owned cleanup
  • 1ff5013 test(cli): scope runtime cleanup provider injection
  • aa640ad test(artifacts): use valid ASAR bytes for signature control
  • ac46ab4 test(mcp): isolate snapshot filesystem fault injection
  • a62a070 Merge commit 'ba866a26ec' into codex/rea-oct16-captures

📊 Changes

5 files changed (+177 additions, -10 deletions)

View changed files

📝 docs/web-network-captures.md (+4 -0)
📝 src/browser/history/HarCapture.test.ts (+62 -1)
📝 src/browser/history/HarCapture.ts (+9 -8)
📝 tests/boundary/browser/historicalWebCapture.test.ts (+62 -1)
📝 tests/fixtures/historicalHar.ts (+40 -0)

📄 Description

Summary

Keep unknown HAR document fields opaque instead of applying entry-local HTTP interpretation to them.

Problem and expected behavior

A schema-admitted HAR document with a top-level response.content object containing encoding: "base64" and ordinary extension text was rejected as malformed HTTP content. Top-level request and response lookalikes could also lose header, cookie and URL text without an explicit sensitive-value declaration. The same objects nested under another extension key were preserved.

These fields belong to the document container, not log.entries. No matching issue was found after checking open and closed HAR/container/extension reports and related patches.

Change and scope

The existing HAR projection owner now selects an explicit validation, container or entry context. Only entry projection interprets authentication fields, transport URLs and base64 response content. Generic value/property exclusions and numeric sidecars retain their existing behavior in both evidence contexts. Document this ownership boundary.

Contract and boundary impact

  • Semantic owner and earliest changed stage: HarCapture.projectHar, before evidence projection.
  • Contribution scope fit and linked maintainer decision: ordinary offline evidence-correctness fix; no new provider or target authority. Separate scope decision not applicable.
  • CLI and MCP/tool-catalog contract: unchanged input/output schemas; previously rejected opaque fields are retained, and unrelated text is no longer removed.
  • Provider, bridge, target-format, or platform compatibility: existing HAR 1.2 profile and decoder lifecycle; no SAZ/qlog interpretation changes.
  • Evidence, artifact, provenance, or reconstruction contract: preserve original document fields and artifact identity; actual entry authentication exclusions and binary sidecars remain intact. Reinspect affected inputs to obtain corrected Evidence; historical Evidence is not rewritten.
  • Target selection, authority, upstream behavior, and cleanup details: existing selected-file read and bounded offline decoder process; no target requests or source-file mutation.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process. Existing isolated offline decoder only.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Base 42fc6c53: new source regression failed with HAR content declares base64 but its text is not valid canonical base64; the compiled CLI returned invalid_request at capture_path /response/content/text. Existing source/public tests passed in those runs.
  • Source controls distinguish container and entry handling of Authorization, cookies, URL userinfo and base64. Explicit sensitive text remains excluded in both contexts; an explicitly sensitive decoded body does not cause an opaque container string to be decoded or removed.
  • Compiled CLI and real stdio MCP produce identical Evidence for marked/unmarked inputs. The container retains its opaque text; actual entry credentials remain null and actual QUJD content retains its three-byte sidecar. Input bytes remain unchanged.
  • Synthetic HAR files exercise the real local decoder and public transports. No live-browser capture or exporter provenance is claimed.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Current branch validation

The branch was reconciled with current main while preserving this PR's feature-specific patch; unrelated shared CI repairs have been superseded by upstream and are no longer part of the current diff. See the reconciliation and local verification report.

Remote CI required passed on head 1dc55ffd. The PR readiness status also passed at the last readback. Earlier feature checks below remain historical evidence for their stated revisions.

Earlier feature validation

Node.js 24.18.0, npm 11.16.0, macOS arm64:

  • npm run test:focused -- src/browser/history/HarCapture.test.ts src/browser/history/QlogCapture.test.ts src/application/WebNetworkCaptureService.test.ts tests/boundary/browser/historicalWebCapture.test.ts tests/boundary/mcp/webNetworkCaptureMcp.test.ts — 5 files, 129 tests passed.
  • npm run test:local -- src/browser/history/HarCapture.test.ts after the additional decoded-literal control — 63 tests passed.
  • npm run check — passed, including typecheck, format, lint and architecture guards.
  • npm run docs:check — passed.
  • npm run verify:test-discovery — all 1,400 test files discovered exactly once.
  • npm run jscpd — passed; 3.23% duplicated lines against the checked-in 3.5% threshold.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; affected captures can be reinspected for corrected Evidence.
  • Real Hopper/Ghidra, browser, or OS coverage: offline HAR decoder and public CLI/stdio MCP on macOS; no live browser or external native engine.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: actual HAR entry authentication exclusion and explicit sensitive-value handling remain covered. No new execution, network or mutation authority. Existing traversal and resource budgets remain; no performance improvement claim or process-family memory measurement.

Author readiness

Human owner: @To3akaRin

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4351 **Author:** [@To3akaRin](https://github.com/To3akaRin) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/rea-oct16-captures` --- ### 📝 Commits (10+) - [`12c6316`](https://github.com/morluto/rea/commit/12c6316e091cdf2dcee1d735f73a96d268b093bc) fix(captures): scope HAR HTTP interpretation to entries - [`d114dc9`](https://github.com/morluto/rea/commit/d114dc946c6c3f9cb505f168d68e7fcb4e611642) Merge commit '974487f00f2d68912c7c2c9e033a2760a343a82e' into codex/rea-oct16-captures - [`6f89888`](https://github.com/morluto/rea/commit/6f8988823710d5888d2497e1d390e2d24f24ed62) test(snapshot): preserve Evidence-scoped native workflow unknowns - [`058be4b`](https://github.com/morluto/rea/commit/058be4b76513e7e89b77e0a0e29a34f902c1ce71) Merge commit 'e8da7e1edd075feec0e6beedec93d5645fed8125' into codex/rea-oct16-captures - [`b686ccc`](https://github.com/morluto/rea/commit/b686ccc93320b235d110476fb7d4f0d2edbe1038) test(process): assert owned snapshot cancellation outcomes - [`6c6e949`](https://github.com/morluto/rea/commit/6c6e94949a129d23a0feb01f47f490370590d280) test(process): preserve snapshot race causes and owned cleanup - [`1ff5013`](https://github.com/morluto/rea/commit/1ff50134db510a221a4f1543dd9c4bc98546264a) test(cli): scope runtime cleanup provider injection - [`aa640ad`](https://github.com/morluto/rea/commit/aa640ada742809c1e999befd7d1e9c3a65d603f1) test(artifacts): use valid ASAR bytes for signature control - [`ac46ab4`](https://github.com/morluto/rea/commit/ac46ab4d3e2af791150a12d75b05b99fdd891a74) test(mcp): isolate snapshot filesystem fault injection - [`a62a070`](https://github.com/morluto/rea/commit/a62a0704713a7dbc21f11abcd439efcd185c357e) Merge commit 'ba866a26ecbe179a717e746cbc0d1605ae616ad5' into codex/rea-oct16-captures ### 📊 Changes **5 files changed** (+177 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `docs/web-network-captures.md` (+4 -0) 📝 `src/browser/history/HarCapture.test.ts` (+62 -1) 📝 `src/browser/history/HarCapture.ts` (+9 -8) 📝 `tests/boundary/browser/historicalWebCapture.test.ts` (+62 -1) 📝 `tests/fixtures/historicalHar.ts` (+40 -0) </details> ### 📄 Description ## Summary Keep unknown HAR document fields opaque instead of applying entry-local HTTP interpretation to them. ## Problem and expected behavior A schema-admitted HAR document with a top-level `response.content` object containing `encoding: "base64"` and ordinary extension text was rejected as malformed HTTP content. Top-level `request` and `response` lookalikes could also lose header, cookie and URL text without an explicit sensitive-value declaration. The same objects nested under another extension key were preserved. These fields belong to the document container, not `log.entries`. No matching issue was found after checking open and closed HAR/container/extension reports and related patches. ## Change and scope The existing HAR projection owner now selects an explicit validation, container or entry context. Only entry projection interprets authentication fields, transport URLs and base64 response content. Generic value/property exclusions and numeric sidecars retain their existing behavior in both evidence contexts. Document this ownership boundary. ## Contract and boundary impact - Semantic owner and earliest changed stage: `HarCapture.projectHar`, before evidence projection. - Contribution scope fit and linked maintainer decision: ordinary offline evidence-correctness fix; no new provider or target authority. Separate scope decision not applicable. - CLI and MCP/tool-catalog contract: unchanged input/output schemas; previously rejected opaque fields are retained, and unrelated text is no longer removed. - Provider, bridge, target-format, or platform compatibility: existing HAR 1.2 profile and decoder lifecycle; no SAZ/qlog interpretation changes. - Evidence, artifact, provenance, or reconstruction contract: preserve original document fields and artifact identity; actual entry authentication exclusions and binary sidecars remain intact. Reinspect affected inputs to obtain corrected Evidence; historical Evidence is not rewritten. - Target selection, authority, upstream behavior, and cleanup details: existing selected-file read and bounded offline decoder process; no target requests or source-file mutation. - Generated metadata, package, or installation impact: none. Expected effects: - [x] Read existing files or captured data. - [x] Launch or attach to a process. Existing isolated offline decoder only. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Base `42fc6c53`: new source regression failed with `HAR content declares base64 but its text is not valid canonical base64`; the compiled CLI returned `invalid_request` at `capture_path /response/content/text`. Existing source/public tests passed in those runs. - Source controls distinguish container and entry handling of Authorization, cookies, URL userinfo and base64. Explicit sensitive text remains excluded in both contexts; an explicitly sensitive decoded body does not cause an opaque container string to be decoded or removed. - Compiled CLI and real stdio MCP produce identical Evidence for marked/unmarked inputs. The container retains its opaque text; actual entry credentials remain null and actual `QUJD` content retains its three-byte sidecar. Input bytes remain unchanged. - Synthetic HAR files exercise the real local decoder and public transports. No live-browser capture or exporter provenance is claimed. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Current branch validation The branch was reconciled with current main while preserving this PR's feature-specific patch; unrelated shared CI repairs have been superseded by upstream and are no longer part of the current diff. See the [reconciliation and local verification report](https://github.com/morluto/rea/pull/4351#issuecomment-6307225917). Remote [CI required](https://github.com/morluto/rea/actions/runs/39538189321/job/119023225834) passed on head `1dc55ffd`. The PR readiness status also passed at the last readback. Earlier feature checks below remain historical evidence for their stated revisions. ## Earlier feature validation Node.js 24.18.0, npm 11.16.0, macOS arm64: - `npm run test:focused -- src/browser/history/HarCapture.test.ts src/browser/history/QlogCapture.test.ts src/application/WebNetworkCaptureService.test.ts tests/boundary/browser/historicalWebCapture.test.ts tests/boundary/mcp/webNetworkCaptureMcp.test.ts` — 5 files, 129 tests passed. - `npm run test:local -- src/browser/history/HarCapture.test.ts` after the additional decoded-literal control — 63 tests passed. - `npm run check` — passed, including typecheck, format, lint and architecture guards. - `npm run docs:check` — passed. - `npm run verify:test-discovery` — all 1,400 test files discovered exactly once. - `npm run jscpd` — passed; 3.23% duplicated lines against the checked-in 3.5% threshold. ## Compatibility, safety, and release - Breaking changes or migration steps: none; affected captures can be reinspected for corrected Evidence. - Real Hopper/Ghidra, browser, or OS coverage: offline HAR decoder and public CLI/stdio MCP on macOS; no live browser or external native engine. - Package or release metadata impact: none. - Security, privacy, process, or containment review: actual HAR entry authentication exclusion and explicit sensitive-value handling remain covered. No new execution, network or mutation authority. Existing traversal and resource budgets remain; no performance improvement claim or process-family memory measurement. ## Author readiness Human owner: @To3akaRin - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:12:35 +00:00
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#6195
No description provided.