Skip to content

fix(qlog): mark records incomplete when a declaration hides the event name - #2859

Closed
Dragolone wants to merge 3 commits into
morluto:mainfrom
Dragolone:fix/qlog-hidden-event-name-incomplete
Closed

Dragolone wants to merge 3 commits into
morluto:mainfrom
Dragolone:fix/qlog-hidden-event-name-incomplete

Conversation

@Dragolone

Copy link
Copy Markdown
Contributor

Summary

When an explicit sensitive value hides a qlog event's name, the decoder drops that record's transport facts without listing it in incomplete_fact_records. The trace then reports streams: [] / loss_declarations: [] with an empty incomplete list, which reads as "nothing recorded".

collectTransportFacts picks loss or packet handling from the redacted visible.name. A declaration such as "sent" hides the value transport:packet_sent (and "name" hides the property itself). The function then returns early before any incomplete-record bookkeeping. A hidden frame_type, frames or STREAM field is already reported as incomplete; a hidden event name was not.

No issue is linked: I searched issues and PRs for "qlog", "incomplete_fact_records", "qlog sensitive" and "qlog incomplete" and found no report. No open PR touches QlogCapture.ts.

Problem and expected behavior

Smallest trigger: decodeQlogCapture(text, ["sent"]) on one transport:packet_sent STREAM event plus one recovery:packet_lost event.

Declaration Before After
"sent" streams 0, losses 1, incomplete [] streams 0, losses 1, incomplete [0]
"lost" streams 1, losses 0, incomplete [] streams 1, losses 0, incomplete [1]
"name" streams 0, losses 0, incomplete [] streams 0, losses 0, incomplete [0, 1]
"stream" (control: hides frame_type) incomplete [0] unchanged

Violated contract (docs/web-network-captures.md): facts "that cannot be safely shown are omitted with incomplete-record coordinates", and incomplete fact records are "ordinals with omitted/redacted interpretable frame metadata".

Change and scope

collectTransportFacts now receives the validated source event name. If the source event is a loss or packet event and the visible name differs (value redacted or property hidden), the record's ordinal is added to incomplete_fact_records and no facts are derived from it. Events whose source name is not interpretable (for example extension:custom) are not marked; the test covers this. Nothing is revealed: the hidden name is only compared, never projected.

Not included: other qlog behavior.

Contribution scope: an ordinary evidence/redaction correctness fix within existing boundaries; a maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: collectTransportFacts in src/browser/history/QlogCapture.ts.
  • Contribution scope fit and linked maintainer decision: in scope (evidence reporting); not applicable.
  • CLI and MCP/tool-catalog contract: no schema change; incomplete_fact_records now lists records whose interpretable event name was hidden.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: omitted facts become visible as incomplete records instead of silently absent.
  • 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 — "lists records whose event name a declaration of $hidden hides as incomplete", parameterized over sent, lost and name. It includes a non-interpretable extension event that must stay unmarked.
  • Base reproduction: on 94072364c all three cases fail; the incomplete list is [] in each.
  • User-visible CLI/MCP output: not captured separately. The change is confined to the decoder result asserted above, and the qlog acceptance suite (built CLI and stdio MCP parity) passes.
  • Remaining proof gaps: none known.

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 on the base — the three new cases fail.
  • npx vitest run src/browser/history/ with the fix — 5 files, 102 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: no hidden value is projected; the source name is only compared with the redacted one.

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no blocking issue was found.

Summary

The decoder now lists packet and loss records in incomplete_fact_records when a sensitive declaration hides their event name.

  • Hidden packet and loss event names mark their records incomplete.

Reviews (6) · Last reviewed commit: "Merge upstream main into fix/qlog-hidden..." · Reviewed by Greptile

@morluto
morluto force-pushed the fix/qlog-hidden-event-name-incomplete branch from e6baf2a to 1ba5c2d Compare October 13, 2026 18:27
… name

collectTransportFacts chose between loss and packet handling from the
redacted event name. When an explicit sensitive value hid the name value
(for example "sent" in transport:packet_sent) or the name property, the
record's STREAM ranges or loss declaration were dropped without listing
its ordinal in incomplete_fact_records, so empty facts read as nothing
recorded. Compare the validated source name with the visible one and
list the record as incomplete when a loss or packet event's name is hidden.
@morluto
morluto force-pushed the fix/qlog-hidden-event-name-incomplete branch from 1ba5c2d to 8bbbaba Compare October 13, 2026 18:52
@morluto morluto added area: domain Domain logic, errors, and pure functions bug Something isn't working labels Oct 14, 2026
morluto added a commit that referenced this pull request Oct 14, 2026
Own service-worker CDP registrations and retry failed teardown. Admit redaction and network metadata against remaining capture capacity, retain explicit omission reasons, and preserve source URL, redirect ancestry, caller-selected content, and historical capture values. Forward CLI cancellation through provider cleanup.

Reviewed fixes: #2263, #2637, #2767, #2845, #2859, #2863, #2872, #2874, #2876, #2879, #2955, #2957, #2961, #3033.

Validation: 25 current event/network source tests passed; earlier focused browser lanes passed 201 source tests and 176 boundary tests with two skips, plus 35 Python tests. Real browser/Windows lanes were not rerun. Playwright allocation before admission remains unbounded by these retention limits.
@Dragolone

Copy link
Copy Markdown
Contributor Author

This change landed on main in f690571 (listed under "Reviewed fixes"), so I'm closing this PR. Thanks for reviewing it!

@Dragolone Dragolone closed this Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks @Dragolone for catching that explicit redaction of a qlog event name could erase transport facts while leaving an apparently complete empty trace. Main now records those hidden facts as incomplete in src/browser/history/QlogCapture.ts (f6905719c) (main).

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

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants