Repository navigation
Conversation
The diagnostics facet sliced stderr by raw UTF-16 code units, so a page could end on half of a non-BMP character and an offset inside one was accepted. Use the shared analysisTextPage owner, as the Android, native, WASM and EVM text views do: pages back off to a whole character and a splitting offset is rejected as invalid view input.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
* fix(comparison): preserve incomplete function call evidence Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty. Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls. * fix(comparison): recheck historical calls-only changes --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
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.
|
This change landed on main in f690571 (listed under "Reviewed fixes"), so I'm closing this PR. Thanks for reviewing it! |
|
@Dragolone, thank you for finding the Unicode edge case in paged capture diagnostics. The paging regression now protects surrogate-pair boundaries while checking that complete pages still reconstruct the retained text (main). |
Summary
The retained pcap view's
diagnosticsfacet pages tshark/capinfos stderr with a rawvalue.slice(offset, offset + limit). A page can therefore end on the high half of a non-BMP character, and the next page starts with the orphaned low half. An offset inside a surrogate pair is also accepted. Every other retained text view (Android manifest, native pseudocode, WASM, EVM) uses the sharedanalysisTextPageowner, which backs off to a whole character and rejects a splitting offset.No issue is linked: I searched issues and PRs for "pcap diagnostics", "pcap surrogate", "surrogate pair", "diagnostics page" and "pcap view" and found no report.
pcapCaptureView.tshas only its introducing commit (9581e06), and no open PR touches it.Problem and expected behavior
Smallest trigger: retained
tshark_stderr = "warn 😀 done", view{kind:"pcap", facet:"diagnostics", stream:"tshark", offset:0, limit:6}, then the returnednext_offset."warn \ud83d"(examined: 6, next_offset: 6), page 2"\ude00 done"."warn "(examined: 5, next_offset: 5), page 2 starts with the whole emoji.offset: 6is rejected as invalid view input ("Diagnostics offset splits a UTF-16 surrogate pair."), as the other text views do.The view already declares that diagnostic page totals count "UTF-16 diagnostic code units"; this keeps that unit while never emitting half a character.
Change and scope
The diagnostics branch calls
analysisTextPage(value ?? "", view.offset, view.limit, "Diagnostics")and returns its error or its text and coverage.status(retained/unknown) and the missing-diagnostics unknown are unchanged. For offsets past the end and for absent diagnostics, the coverage is identical to before (pageViewCoveragedoes not depend on the offset once exhausted).Not included: other pcap facets, which page rows, not text.
Contribution scope: an ordinary retained-view correctness fix reusing the existing owner; a maintainer scope decision is not applicable.
Contract and boundary impact
src/domain/analysisView/pcapCaptureView.ts.AnalysisInputErrorinstead of a half character.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.
Evidence and regression coverage
src/domain/analysisView/pcapCaptureView.test.ts— "pages diagnostics without splitting a surrogate pair". It covers three cases: a splitting offset is rejected, a page whose limit would split the pair backs off ("ab",next_offset: 2), and followingnext_offsetwith limit 3 reassembles"ab😀cd"exactly. The parent is built withcreateEvidence, like the web-capture view tests.204a6f3f2the test fails at the first assertion (the splitting offset returnsok: true).For evidence-bearing changes:
Validation performed
macOS (Apple silicon), Node 24.19.0.
npx vitest run src/domain/analysisView/pcapCaptureView.test.tsagainst the base view — fails.npx vitest run src/domain/analysisView/with the fix — 6 files, 53 tests passed.npm run build:cached && npx vitest run src/pcap tests/boundary/pcap tests/boundary/cli/pcapCli.test.ts tests/boundary/mcp/pcapMcp.test.ts— 34 passed, 21 skipped (Linux-only).npm run verify:test-discovery— all test files discovered exactly once.npm run typecheck— passed.npx oxfmt --checkandnpx oxlinton both changed files — passed, no errors.npm run verify:module-boundaries— passed.Compatibility, safety, and release
next_offsetnever does that.Before merge
type(scope): outcome.