Commit Graph
761 Commits
Author SHA1 Message Date
morlutoandCursor Agent 6ff972da99 perf(browser): fetch source maps with bounded lookahead and in-order admission (#14115)
* perf(browser): fetch source maps with bounded lookahead and in-order admission

fetchWebSourceMaps awaited each map's full fetch-decode cycle before starting the next, so bundles with dozens of external maps paid serial round trips. Responses now start with a lookahead of 4 (approved origins only, never past the operation deadline), while every budget (URL bytes, retained bytes, decoded records), deadline check and decode still happens strictly in request order inside fetchOne, so item order, inclusion under output limits and limitations are unchanged. A started prefetch that is never admitted is cancelled in teardown, and abort/deadline paths route through fetchOne so retained-cleanup ownership (SourceMapPendingFetch) is preserved.

Closes #14109. Verified: WebSourceMapFetcher tests 31 passed (30 existing unchanged plus a new out-of-order-completion proof asserting overlap >1 and request-order admission), check:fast.

* fix(browser): abort and bind cleanup for unadmitted source-map prefetches

Teardown now aborts the operation controller before removing deadline/caller controls, and every started-but-unadmitted prefetch is settled and bound to the returned result: pending-fetch cleanup becomes the retained failure (or a secondary failure on an existing error), and unread prefetched responses are cancelled with cleanup failures tracked. The lookahead test now gates six requests to prove the four-fetch cap.

* fix(browser): pipeline source-map fetches without speculative or reordered requests

Start each request's fetch after its budget reservation and deadline checks pass, and start the next fetch only when the current body is read and the next failure reservation still fits. Redirect chains and host-observable request order stay sequential; the next fetch overlaps only the current decode. Sibling binding now ignores teardown-abort artifacts and binds only genuinely incomplete cleanup. Boundary suites (49 tests) and unit suite (31) pass unchanged in their budget and redirect assertions.

* fix(browser): retain sibling source-map cleanup on teardown

Cancellation that stops admission at the first map left later lookahead
fetches owning unread responses. Teardown skipped stored failures and
recorded the rest only as secondary notes, so the returned error could
report cleanup complete while those resources were still owned.

Await every started prefetch and merge its live cleanup through the
existing cleanup-composition helpers, preserving remaining resources.

* fix(browser): keep caller cancellation through source-map cleanup

Unused-prefetch teardown chose success before its cleanup wait and after
the caller abort listener was removed. Recheck the caller signal after
that wait so a cancel during a successful release stays a cancellation,
while an existing failure keeps its cleanup owners.

Cover unused-prefetch release, mixed redirect and prefetch cleanup, and
cancellation during release with structured cleanup facts.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-23 18:06:51 +00:00
morluto 4bbaf17512 refactor: centralize owned finalization and configuration failures (#14071)
* refactor(config): propagate typed configuration failures

* refactor(lifecycle): centralize completion and cancellation

* fix(config): preserve Hermes YAML edit refusal guidance
2026-11-23 13:40:10 +00:00
hhangandhhang a6847ae362 perf(har): reuse normalized Base64 for retained response bodies (#13847)
Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
2026-11-22 21:22:10 -05:00
cyanseek 6ecb70c79c fix(browser): preserve peer observations after a rejected page attachment (#13841) 2026-11-23 02:01:18 +00:00
RRFZ c1cef729c9 perf(parsers): replace quadratic trailing-quantifier regexes with linear edge scans (#13757)
* perf(parsers): replace quadratic trailing-quantifier regexes with linear edge scans

* test(har): assert response.bodySize in zero negative-exponent lexeme test
2026-11-23 01:11:05 +00:00
morluto cf979613a3 perf(workers/browser/cli): buffer JSON writes, wake on signal, optimize queues (#13698)
* perf(workers/browser/cli): buffer JSON writes, wake on signal, optimize queues

* fix(workers): wake on owned memory refusal and bound CLI JSON counting
2026-11-23 00:09:11 +00:00
morluto c5efbffc95 perf(sourcemaps/browser/uefi): event-driven wait, pre-sorted redaction, O(1) queue (#13707)
* perf(sourcemaps/browser/uefi): event-driven wait, pre-sorted redaction, O(1) queue

* refactor(uefi): share LZMA frame byte queue
2026-11-22 23:47:13 +00:00
RRFZ 87503ad3bd fix(browser): split mixed CRLF and LF headers in SAZ HTTP decoding (#13691) 2026-11-22 23:07:20 +00:00
morluto d5f35cd162 perf(parsers): optimize UEFI uniformity, FIT reader, and HAR validation (#13657)
* perf(parsers): unroll UEFI uniformity, reuse FIT BinaryReader, and skip HAR validation pointers

* refactor(har): remove the obsolete redaction mode
2026-11-22 17:21:50 -05:00
morluto 36997555d2 perf(parsers): index PE RVA lookups and remove per-item parser allocations (#13602)
* perf(parsers): index PE RVA lookups and remove per-item parser allocations

* fix(pe): bound RVA queries across nested sections
2026-11-22 16:06:36 -05:00
morluto e8d8803898 perf(parsers): single-pass XML plist Base64 table, cached TextDecoders, and fused KeyedArchive/Protobuf/JNI/P-Invoke hot paths (#13594)
* perf(parsers): single-pass XML plist Base64 table, cached TextDecoders, and fused KeyedArchive/Protobuf/JNI/P-Invoke hot paths

* fix(plist): release unused XML data buffer capacity
2026-11-22 21:02:26 +00:00
morluto d328e2852d perf(artifacts/browser/contracts): binary-search Deno owned ranges, fuse ManagedMemberInspector checks, drop redundant Playwright step re-parse, and use Set in schema projection (#13587)
* perf(artifacts/browser/contracts): binary-search Deno owned ranges, fuse ManagedMemberInspector checks, drop redundant Playwright step re-parse, and use Set in schema projection

* perf(deno): retain bounded Intel trailer membership checks
2026-11-22 15:45:15 -05:00
morluto afad95fc91 perf(artifacts/contracts): replace O(N^2) scans with hash joins/sweep-line and hoist expandToolAvailability group maps (#13585)
* perf(artifacts/contracts): replace O(N^2) scans with hash joins/sweep-line and hoist expandToolAvailability group maps

* perf(dotnet): retain bounded bundle configuration scans
2026-11-22 20:42:16 +00:00
morluto b6276368ee perf(browser): avoid owned-payload deep-clones and memoize CDP execution context validation (#13583)
* perf(browser): avoid owned-payload deep-clones and memoize CDP execution context validation

* fix(browser): key context validation by declaration
2026-11-22 20:40:47 +00:00
morluto 550289154e perf(browser): eliminate duplicate CaptureRedaction scans, per-event Buffer allocs, and QLOG flatMap churn (#13581)
* perf(browser): eliminate duplicate CaptureRedaction scans, per-event Buffer allocs, and QLOG flatMap churn

* fix(browser): preserve own __proto__ property in QlogCapture object projection

* fix(browser): preserve capture extension and redaction semantics
2026-11-22 15:38:35 -05:00
morluto 593020442d perf(js/browser/uefi): index export shape coverage and AST writes, eliminate CdpRuntimeRequests re-parse and UefiLzmaWorker JSON round-trip (#13535)
* perf(js/browser/uefi): index export shape coverage and AST writes, eliminate CdpRuntimeRequests re-parse and UefiLzmaWorker JSON round-trip (#13530)

* fix(browser): detach published runtime initiator facts
2026-11-22 13:26:41 -05:00
morluto 8880382f21 perf(browser/artifacts/js): fuse Playwright TraceInventory passes and index ReleaseExposure and Wakaru lookups (#13518)
perf(browser/artifacts/js): fuse Playwright TraceInventory passes and index ReleaseExposure and Wakaru lookups (#13514)
2026-11-22 12:56:47 -05:00
morluto e807ccdc48 perf(schemas): use discriminatedUnion and ownedJsonValueSchema for O(1) dispatch and zero-clone parsing (#13311)
Refs #13302
2026-11-22 08:54:27 -05:00
morluto 275b5740f6 perf(browser): single-pass CaptureJson parser and zero-allocation Playwright trace skipping (#13427)
Addresses #13300.
2026-11-22 08:50:50 -05:00
morluto 26465e8ae6 perf(adapters): eliminate hot-path overhead across WASM, EVM, Frida, web modules, and HAR (#13356)
* perf(adapters): eliminate hot-path overhead across WASM, EVM, Frida, web modules, and HAR

* fix(wasm): scan only WAT form heads before budget checks and drop unbounded formParts retention
2026-11-22 08:04:05 -05:00
4f43d7422f feat(browser): accept mitmproxy 12.3.1 for native capture decode (#8088)
* feat(browser): accept mitmproxy 12.3.1 for native capture decode

Bump the offline adapter profile, provider identity, Linux verification archive, and docs so callers can use mitmproxy 12.3.1 instead of the 12.2.3 pin that blocks patched Brotli/cryptography. Keep SaveHar null postData admission for both producer versions.

Fixes #8078

* test(web): regenerate published HAR example identities

The HAR limitation now names both admitted mitmproxy profiles, which
changes the decoded capture's Evidence ID and both views' parent and
view digests. Update the published API surface and environment manifest
examples to the identities reproduced from their fixture bytes.

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 09:26:35 +00:00
morluto 2afc34ec6e perf(browser): precompile redaction markers, eliminate quadratic secret scans, and scope HAR validation (#13267)
* perf(browser): precompile redaction markers, eliminate quadratic secret scans, and skip unescaped HAR JSON.parse

* fix(browser): remove single-use markerById map in BrowserScenarioSecrets

* fix(browser): detach CaptureJson literal strings from parent buffer
2026-11-22 03:14:39 -05: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 60e099848d perf(browser): wake the bundle worker on observed events (#13225) 2026-11-21 22:35:15 +00:00
morluto 6e300622e9 test(browser): consolidate bundle admission and retained facts (#13227) 2026-11-21 22:32:34 +00:00
morluto de0418c1f4 test(browser): consolidate native module lifecycle checks (#13224)
* test(browser): consolidate native module lifecycle checks

* test(browser): join resolver cleanup before restoring timers
2026-11-21 22:17:21 +00:00
morluto d41af199f0 fix(browser): preserve malformed request-body coverage (#13219) 2026-11-21 21:57:26 +00:00
morluto 0ee5f8461e test(capture): consolidate redirect and URL admission checks (#13218) 2026-11-21 21:47:27 +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 587cca5c5c fix(capture): keep credential checks independent of body filters (#13215) 2026-11-21 21:27:18 +00:00
morluto 1e89bcc216 test(capture): consolidate Protobuf descriptor identity checks (#13214) 2026-11-21 16:24:24 -05:00
morluto 6152c02f3f fix(capture): retain credential checks across MIME conflicts (#13209) 2026-11-21 21:12:50 +00:00
morluto 62d836a630 test(capture): retain independent Playwright trace coverage checks (#13208) 2026-11-21 21:09:37 +00:00
morluto 339f0ace57 test(capture): consolidate Playwright trace contracts (#13207) 2026-11-21 20:55:20 +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 1c982b82fe test(har): consolidate producer and evidence coverage (#13202) 2026-11-21 20:20:49 +00:00
XiaoBinGan 1aa394d62d fix(browser): report only grammatical CORP and X-Content-Type-Options values
One regex served both headers — `^[a-z][a-z0-9_.\x2d]*$` after lowercasing — so any token counted as a
declared policy. Measured through `safeResponseMetadata`:

| `Cross-Origin-Resource-Policy` | published | Fetch 3.7 |
| --- | --- | --- |
| `same-origin` | `same-origin` | `same-origin` |
| `SAME-ORIGIN` | `same-origin` | none |
| `Same-Site` | `same-site` | none |
| `same-origin-ish` | `same-origin-ish` | none |
| `same_origin` | `same_origin` | none |
| `unsafe-none` | `unsafe-none` | none |

The value ABNF is `%s"same-origin" / %s"same-site" / %s"cross-origin"`, and `%s` is case-sensitive,
so the internal check nulls every other spelling. Case folding made `SAME-ORIGIN` worse than a bad
echo: it turned a value browsers ignore into the enforced spelling, so an observation claimed
embedding isolation the page did not have.

`X-Content-Type-Options` declares exactly one case-insensitive `nosniff`, and "determine nosniff"
tests `values[0]` of the combined header. The strict whole-value match also dropped valid
declarations — `nosniff` sent on two lines, or `nosniff, sniff`, both published nothing. The reader
takes the first list member now.

| `X-Content-Type-Options` | before | after |
| --- | --- | --- |
| `nosniff` | `nosniff` | `nosniff` |
| `NOSNIFF` | `nosniff` | `nosniff` |
| `nosniff\nnosniff` | none | `nosniff` |
| `nosniff, sniff` | none | `nosniff` |
| `sniff, nosniff` | none | none |
| `nosniff-ish` | `nosniff-ish` | none |

Each header has its own grammar now, and `policyToken` is gone.

`src/browser/CdpSafeMetadata.test.ts` — 133 passing, 17 new cases. Reverting either reader fails
them.
2026-11-21 21:10:02 +01: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 3130adbb1b perf(web): stop repeated accessibility reads after method refusal (#13191) 2026-11-21 19:26:23 +00:00
Adolanium 947fa8f14d fix(browser): separate the decoder CPU budget from an inherited ceiling
A SIGXCPU at the requested budget is the decoder's own ceiling. Raising RLIMIT_CPU does not extend it. A lower recorded ceiling remains an inherited limit. A failed close of the CPU record stays on the decoder scope and does not skip that classification.
2026-11-21 20:08:53 +01:00
Adolanium d6a5b32ed0 fix(browser): share the capture resource-constraint constructor
Static checks reject a second AnalysisResourceConstraintError in CaptureFailures.ts. SIGXCPU still reports the recorded ceiling and tells the caller to raise RLIMIT_CPU. The CPU record is read through the stable artifact owner, so a failed close stays on the decoder scope.
2026-11-21 20:08:53 +01:00
Adolanium 39ade5694b fix(browser): name the CPU ceiling when mitmproxy dies with SIGXCPU
A tighter inherited RLIMIT_CPU is kept, and that death had no reply. The decoder records the installed ceiling, and SIGXCPU becomes a CPU resource constraint that names it.
2026-11-21 20:08:53 +01:00
morluto 5c390198f7 fix(web): retain CDP scope and request identity during session preparation (#13188) 2026-11-21 19:05:13 +00:00