Commit Graph
403 Commits
Author SHA1 Message Date
23970fc63f feat(web): deduplicate bundle findings across scripts by value and mechanism (#11354)
* feat(web): deduplicate bundle findings across scripts by value and mechanism

Per-script findings were deduplicated only within one script, so the same
endpoint or route observed in N scripts appeared N times in the merged
bundle, inflating the finding list and overstating the inventory.

Merge now deduplicates routes and endpoints across scripts by
(value, mechanism). The first occurrence keeps its location and order;
later occurrences fold into optional occurrences/script_keys on the
retained entry, so no script is silently dropped and single-script
findings keep their original shape. The key uses the existing compositeKey
helper (JSON) instead of a NUL join. bundleLimitations gains a line
describing the cross-script merge.

* fix(web): address Greptile review on cross-script bundle dedup

- Accept merged endpoint occurrences/script_keys in the web-bundle
  view row schema so unfiltered pages no longer throw.
- Match endpoint script_keys filters against retained script_keys,
  falling back to location.script_key for older records.
- Generate distinct finding keys in the wide-result capacity fixtures
  so routes/endpoints still exercise a 130,000-entry merged result.
- Append later script keys in place instead of rebuilding the list.
- Compare the dedup limitation against its owning constant instead
  of freezing the explanatory sentence in the test.
- Update the route-inventory guide for merged endpoints.

* test(web): expect the cross-script endpoint merge in the semantic budget case

Main added a regression where two budget-limited scripts both report
/health. With findings merged across scripts, it is one entry whose
occurrences and script_keys name both scripts, which keeps the case's
per-script attribution.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-22 16:33:22 +08:00
Abhishek SharmaandClaude Sonnet 5.5 3c7ea1ce85 feat(browser): count credential-named members in HAR capture inspection (#8708)
* feat(browser): count credential-named members in HAR capture inspection

inspect_web_network_capture now runs the credential-name scan that
environment-build already applies over the selected HAR records and
reports matches as limitations by pointer, never by value, together with
the bodies the scan could not read. Values the decoder already excluded
are not counted, and nothing is excluded on a name.

Refs #8207

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(browser): bound the listed credential-name pointers

The limitation lists the pointers that fit within 1 KiB of text and says
how many counted names are not listed, so one long body member name
cannot inflate the limitation that summaries and record pages repeat.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(environment): bound the credential scan's values before parsing a body

A body under the scan's 4 MiB text limit could still expand into millions
of JSON values or form fields when parsed in the application process, and
the inspection now runs the scan on every HAR capture. The scan counts the
characters that can start a value (`[`, `{`, `,` for JSON, `&` for forms)
before parsing and skips a body that could hold more than 524288, reporting
it like a body over the text limit. Both consumers' messages and docs name
the bound.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(web): charge every body and name/value list to one credential-scan budget

The credential-name scan bounded each body's values on its own, so a
capture of many compact bodies still expanded millions of values in the
application process, and HAR header, query and form-parameter lists were
copied twice without any bound. One 524288-value budget now covers the
whole scan: a body's values are bounded from its text before it is parsed
and a list is charged by its length before it is read in place, so what
would pass the budget is reported as not scanned instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(web): read credential names in place and charge nothing for empty text

The credential-name scan split each member, header and query name with
two regex replacements, a lowercase copy and a split into a segment
array before matching. A near-4 MiB alternating-case member name
(`x-aAaA…`) therefore expanded into about two million segments: more
than 192 MiB of heap in the application process after the decoder's
containment had ended. `credentialNamed` now reads the name once in
place with the same segmentation (case changes, digits, separators, and
`toLowerCase`'s KELVIN SIGN and dotted capital I), keeping at most two
segments no longer than the longest credential word, so a name of any
length allocates no copies.

`valueBound` started every text at one value, so an empty query, a bare
`?`, an empty form and whitespace-only JSON were each charged a value
they do not hold; once earlier content spent the budget, they were
reported as unscanned in `credential-scan-incomplete`. JSON now holds its
first value only after a non-whitespace character, and a form holds one
field per non-empty `&`-separated piece after an optional leading `?`,
as `URLSearchParams` and the query reader split it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(browser): point the environment build link at the physical guide

The guide lives at docs/agent-environments.md, so the relative link from
docs/guides/web must climb two levels. The Documentation job failed on the
dead link; vitepress build now completes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test: drop the hard-coded timeout from the heap-bound name test

The test finishes in about half a second, so the shared test deadline is
enough, and a literal 60_000 bypasses the CI and coverage deadline scaling.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(web-network-capture): name an unavailable response source in the scan limitation

The credential-name scan counts a response body whose retained source is
unavailable as not scanned, and WebNetworkCaptureService reuses that scan. Its
limitation text still listed only a cut body, text over 4 MiB, or past the value
budget, so CLI and MCP reports gave none of those reasons for such a body.

Name the unavailable source in the text, matching the environment-build warning,
and cover it with a test that fails on the old wording.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-22 15:42:13 +08:00
morluto a7b195d0e1 fix(browser): refuse partial HTTP source-map responses (#13236) 2026-11-21 23:31:49 +00:00
morluto 1f3703f6f1 test(browser): consolidate source-map coordinates and wire deadlines (#13235) 2026-11-21 18:22:38 -05:00
morluto 190395eade fix(browser): retire detached WebMCP frame descendants (#13233) 2026-11-21 23:12:06 +00:00
morluto 04d399d675 fix(electron): preserve inspection frame identity and diagnostics (#13232) 2026-11-21 23:04:46 +00:00
morluto eba41afd6c fix(browser): retain passive coverage and failure identity (#13231) 2026-11-21 23:03:00 +00:00
morluto cfa04985c2 test(browser): consolidate runtime window and request contracts (#13230)
* test(browser): consolidate runtime window and request contracts

* test(browser): distinguish reused request producer fields
2026-11-21 22:55:15 +00:00
morluto 39ccb1d3b8 fix(browser): preserve terminal verifier startup outcomes (#13228) 2026-11-21 22:45:18 +00:00
morluto 6e300622e9 test(browser): consolidate bundle admission and retained facts (#13227) 2026-11-21 22:32:34 +00:00
morluto 7b3fb897c0 test(browser): consolidate source-map and deadline contracts (#13220) 2026-11-21 16:57:36 -05:00
morluto d41af199f0 fix(browser): preserve malformed request-body coverage (#13219) 2026-11-21 21:57:26 +00:00
morluto 9528005707 test(capture): consolidate historical runtime retry coverage (#13217) 2026-11-21 21:44:09 +00:00
morluto e5850aff15 test(capture): consolidate historical worker lifecycle checks (#13216)
* test(capture): consolidate historical worker lifecycle checks

* test(capture): keep pre-launch cancellation classification
2026-11-21 21:31:19 +00:00
morluto ff3919f3eb fix(capture): distinguish corrupt SAZ metadata bytes (#13204) 2026-11-21 20:51:33 +00:00
morluto a2faf4cc34 test(capture): prove retained summaries survive source deletion (#13206) 2026-11-21 20:48:19 +00:00
morluto 088bc68b1c fix(capture): surface unsupported decoder requirements (#13203) 2026-11-21 20:38:10 +00:00
morluto 33d1c6ee44 test(web): control CDP teardown timing and consolidate cleanup proof (#13199) 2026-11-21 20:00:35 +00:00
morluto 9230f698b3 fix(web): retain Chromium navigation kind in session evidence (#13194)
* fix(web): retain Chromium navigation kind in session evidence

* test(web): use native reload event shape in the shared timeline fixture
2026-11-21 19:47:52 +00:00
morluto 905090c0ca test(web): control authorization retries and consolidate session termination (#13196) 2026-11-21 19:41:41 +00:00
morluto 3130adbb1b perf(web): stop repeated accessibility reads after method refusal (#13191) 2026-11-21 19:26:23 +00:00
morluto 5c390198f7 fix(web): retain CDP scope and request identity during session preparation (#13188) 2026-11-21 19:05:13 +00:00
morluto c0963732a7 fix(web): keep unreadable cookie partitions incomplete (#13187) 2026-11-21 19:00:00 +00:00
morluto 4807b31749 fix(web): require root identity in CDP session and runtime captures (#13186) 2026-11-21 18:55:15 +00:00
morluto ce61cca68a test(web): consolidate CDP document selection cases (#13183) 2026-11-21 18:44:43 +00:00
morluto 8691cfa96b test(web): acknowledge CDP socket timeout phases before advancing time (#13181) 2026-11-21 18:35:00 +00:00
morluto faab3d98d1 test(web): consolidate warm CDP peer cleanup checks (#13179)
* test(web): consolidate warm CDP peer cleanup checks

* test(web): verify provider close before CDP fixture teardown
2026-11-21 18:34:07 +00:00
morluto 4f9ce44908 test(web): consolidate CDP browser socket identity checks (#13180) 2026-11-21 13:31:08 -05:00
morluto 10e1a5ab25 test(web): consolidate CDP handshake and transport cleanup checks (#13177)
* test(web): consolidate cold CDP handshake cleanup checks

* test(web): wait for physical CDP socket close confirmation
2026-11-21 18:18:02 +00:00
morluto ae2c2142a3 test(web): consolidate CDP wire reply and event checks (#13175) 2026-11-21 18:13:37 +00:00
morluto 48a2ad5e0b test(web): consolidate CDP frame and session identity checks (#13174) 2026-11-21 18:09:48 +00:00
morluto b95bd814a7 test(web): consolidate CDP discovery and HTTP response contracts (#13173) 2026-11-21 13:05:05 -05:00
morluto 03795d55b3 test(web): consolidate wide scenario reference admission (#13163) 2026-11-21 17:33:20 +00:00
morluto 80b980e5f4 test(web): consolidate CDP command settlement checks (#13110) 2026-11-21 14:16:03 +00:00
morluto 5521bff467 test(web): make CDP discovery deadline checks deterministic (#13109) 2026-11-21 14:10:15 +00:00
morluto 383709ca7e test(web): consolidate screenshot document and reply checks (#13107) 2026-11-21 14:00:51 +00:00
morluto 4ad0e3ea78 test(web): consolidate DOM snapshot position and SVG proofs (#13104) 2026-11-21 08:53:31 -05:00
morluto 3ef94f1f33 test(web): consolidate CDP resource metadata proofs (#13103) 2026-11-21 13:42:02 +00:00
morluto 97f10e8957 test(web): consolidate passive CDP response header proofs (#13099) 2026-11-21 13:33:44 +00:00
morluto e6df39bbba test(web): consolidate Browser worker inventory proofs (#13098) 2026-11-21 08:25:28 -05:00
morluto 15855137b7 test(web): consolidate CDP binary body proofs (#13097)
* test(web): consolidate CDP UTF-8 response proofs

* test(web): consolidate cache byte fingerprint proofs

* test(web): check cache digests by entry identity
2026-11-21 13:22:15 +00:00
morluto 9a16142fad test(web): consolidate CDP request identity and redirect proofs (#13096) 2026-11-21 08:02:26 -05:00
morluto e76b521461 test(web): consolidate CDP response body lifecycle proofs (#13094)
* test(web): consolidate CDP response body lifecycle proofs

* test(web): assert response diagnostic provenance
2026-11-21 07:53:59 -05:00
morluto 68f13d06d2 test(web): consolidate CDP response status proofs (#13095) 2026-11-21 12:51:22 +00:00
morluto 750120a4ce test(web): consolidate passive CDP admission proofs (#13092)
* test(web): consolidate passive CDP frame claim proofs

* test(web): consolidate passive CDP event budget proofs
2026-11-21 12:37:56 +00:00
morluto 6878e24cc7 test(web): consolidate script metadata admission and projection proofs (#13091) 2026-11-21 12:29:47 +00:00
morluto 2d9c208817 test(web): consolidate capture completeness proofs (#13089) 2026-11-21 07:15:46 -05:00
morluto e94475bdcc test(web): consolidate passive script map matching proofs (#13088) 2026-11-21 12:08:12 +00:00
morluto e1442859dc test(web): consolidate passive HTTP metadata proofs (#13087) 2026-11-21 07:05:24 -05:00
morluto ccfdd61572 test(web): consolidate WebSocket payload comparison proofs (#13086) 2026-11-21 06:59:46 -05:00