[PR #2860] [MERGED] fix(qlog): list a hidden stream's records without spreading call arguments #5445

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2860
Author: @Dragolone
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/qlog-incomplete-stream-spread


📝 Commits (6)

  • 626282c fix(qlog): list a hidden stream's records without spreading call arguments
  • 2b169be fix(comparison): recheck historical calls-only changes (#2223)
  • 9b9a582 fix(ci): isolate Linux Hopper process fixture inventory
  • 7702282 fix(android): make DEX descriptor pattern portable
  • 0408021 Merge upstream main into fix/qlog-incomplete-stream-spread
  • bc764d2 Merge branch 'main' into fix/qlog-incomplete-stream-spread

📊 Changes

2 files changed (+18 additions, -3 deletions)

View changed files

📝 src/browser/history/QlogCapture.test.ts (+15 -0)
📝 src/browser/history/QlogCapture.ts (+3 -3)

📄 Description

Summary

When an explicit sensitive value matches a qlog stream's derived total, the decoder omits the stream and lists its contributing records as incomplete. It did this with incomplete_fact_records.push(...stream.contributions.map(...)). A stream with more contributions than the engine's call-argument limit (about 125k on Node 24) makes that spread throw RangeError: Maximum call stack size exceeded. A valid capture within the input budget then fails instead of being reported with incomplete records.

This is the same class as #1538/#1539. No issue is linked: I searched issues and PRs for "qlog", "Maximum call stack" and "RangeError" and found no qlog report.

Problem and expected behavior

Smallest trigger: 130,000 one-byte STREAM frames on stream 0, packed 1,000 per transport:packet_sent event (130 events), decoded with the sensitive value "130000", which matches the stream's derived unique_bytes / frame_length_sum.

  • Before: RangeError: Maximum call stack size exceeded. In the CLI/MCP path, the decoder process reports this as an unexpected decoder failure.
  • Expected and after: streams: [] and incomplete_fact_records = ordinals 0–129.

Reaching this needs several STREAM frames per event. aioquic usually logs one frame per packet, and in that layout the decoder heap limit is reached first, which is the documented resource constraint. So this is uncommon producer output, but it is accepted by the profile and stays within the input budget.

Change and scope

The ordinals are pushed in a for … of loop instead of a spread call. Nothing else changes; the existing de-duplication of incomplete_fact_records is untouched.

Contribution scope: an ordinary decoder robustness fix within existing boundaries; a maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: stream summarization in decodeQlogCapture, src/browser/history/QlogCapture.ts.
  • Contribution scope fit and linked maintainer decision: in scope; not applicable.
  • CLI and MCP/tool-catalog contract: none; a capture that crashed now returns its documented result.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none beyond the above.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • 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

  • Tests added or updated: src/browser/history/QlogCapture.test.ts — "omits a hidden derived total for a stream with more contributions than call arguments allow" (about 0.7 s).
  • Base reproduction: on 94072364c the new test fails with RangeError: Maximum call stack size exceeded.
  • User-visible CLI/MCP output: not separately captured; the qlog acceptance suite (built CLI and stdio MCP) passes.
  • Remaining proof gaps: I did not rerun the case under the decoder's production heap flags in this PR's validation.

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.

Validation performed

macOS (Apple silicon), Node 24.19.0.

  • npx vitest run src/browser/history/QlogCapture.test.ts -t "call arguments" on the base — fails with the RangeError above.
  • npx vitest run src/browser/history/ with the fix — 5 files, 100 tests passed.
  • npm run build:cached && npx vitest run tests/acceptance/tools/qlogCapture.test.ts — 4 passed, 1 skipped.
  • npm run typecheck — passed.
  • npx oxfmt --check and npx oxlint on both changed files — passed, no errors.
  • npm run verify:module-boundaries — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; no hidden value is projected.

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/2860 **Author:** [@Dragolone](https://github.com/Dragolone) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/qlog-incomplete-stream-spread` --- ### 📝 Commits (6) - [`626282c`](https://github.com/morluto/rea/commit/626282c01fd5a556475304bfec6a744cbebbca88) fix(qlog): list a hidden stream's records without spreading call arguments - [`2b169be`](https://github.com/morluto/rea/commit/2b169beb641450b43b12eee35170caf718736b32) fix(comparison): recheck historical calls-only changes (#2223) - [`9b9a582`](https://github.com/morluto/rea/commit/9b9a5825fa4e367640aab3897989327bb999268a) fix(ci): isolate Linux Hopper process fixture inventory - [`7702282`](https://github.com/morluto/rea/commit/7702282d5658d1a4bb9972811e0e6c81f6546b48) fix(android): make DEX descriptor pattern portable - [`0408021`](https://github.com/morluto/rea/commit/040802159c49478cd0f55a768dcf5ebeed92b68d) Merge upstream main into fix/qlog-incomplete-stream-spread - [`bc764d2`](https://github.com/morluto/rea/commit/bc764d2d617db37abcbc637bc7385c59341dd200) Merge branch 'main' into fix/qlog-incomplete-stream-spread ### 📊 Changes **2 files changed** (+18 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/history/QlogCapture.test.ts` (+15 -0) 📝 `src/browser/history/QlogCapture.ts` (+3 -3) </details> ### 📄 Description ## Summary When an explicit sensitive value matches a qlog stream's derived total, the decoder omits the stream and lists its contributing records as incomplete. It did this with `incomplete_fact_records.push(...stream.contributions.map(...))`. A stream with more contributions than the engine's call-argument limit (about 125k on Node 24) makes that spread throw `RangeError: Maximum call stack size exceeded`. A valid capture within the input budget then fails instead of being reported with incomplete records. This is the same class as #1538/#1539. No issue is linked: I searched issues and PRs for "qlog", "Maximum call stack" and "RangeError" and found no qlog report. ## Problem and expected behavior Smallest trigger: 130,000 one-byte STREAM frames on stream 0, packed 1,000 per `transport:packet_sent` event (130 events), decoded with the sensitive value `"130000"`, which matches the stream's derived `unique_bytes` / `frame_length_sum`. - Before: `RangeError: Maximum call stack size exceeded`. In the CLI/MCP path, the decoder process reports this as an unexpected decoder failure. - Expected and after: `streams: []` and `incomplete_fact_records` = ordinals 0–129. Reaching this needs several STREAM frames per event. aioquic usually logs one frame per packet, and in that layout the decoder heap limit is reached first, which is the documented resource constraint. So this is uncommon producer output, but it is accepted by the profile and stays within the input budget. ## Change and scope The ordinals are pushed in a `for … of` loop instead of a spread call. Nothing else changes; the existing de-duplication of `incomplete_fact_records` is untouched. Contribution scope: an ordinary decoder robustness fix within existing boundaries; a maintainer scope decision is not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: stream summarization in `decodeQlogCapture`, `src/browser/history/QlogCapture.ts`. - Contribution scope fit and linked maintainer decision: in scope; not applicable. - CLI and MCP/tool-catalog contract: none; a capture that crashed now returns its documented result. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none beyond the above. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] 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 - Tests added or updated: `src/browser/history/QlogCapture.test.ts` — "omits a hidden derived total for a stream with more contributions than call arguments allow" (about 0.7 s). - Base reproduction: on `94072364c` the new test fails with `RangeError: Maximum call stack size exceeded`. - User-visible CLI/MCP output: not separately captured; the qlog acceptance suite (built CLI and stdio MCP) passes. - Remaining proof gaps: I did not rerun the case under the decoder's production heap flags in this PR's validation. 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. ## Validation performed macOS (Apple silicon), Node 24.19.0. - `npx vitest run src/browser/history/QlogCapture.test.ts -t "call arguments"` on the base — fails with the RangeError above. - `npx vitest run src/browser/history/` with the fix — 5 files, 100 tests passed. - `npm run build:cached && npx vitest run tests/acceptance/tools/qlogCapture.test.ts` — 4 passed, 1 skipped. - `npm run typecheck` — passed. - `npx oxfmt --check` and `npx oxlint` on both changed files — passed, no errors. - `npm run verify:module-boundaries` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none; no hidden value is projected. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] 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:06:41 +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#5445
No description provided.