* 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>
* 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>