Follow-up to #2100. A page script written as a `data:` or `blob:` URL was read as a local path, so `data:text/javascript,0//../../boot.js` became a dependency on the app's own `boot.js`. Anything with a URL scheme is now left alone, while a local path whose query holds a URL stays local. A path written with a `./` in the middle reaches the same file as one without. A dependency's file under `node_modules/` no longer wins over the app's own file of the same name. These lookups now use one index built once per app, where each used to scan every file.
HTML refs lose interior tabs and newlines before the scheme check, file: is stripped case-insensitively, and a path ending in / resolves to no file in resolve_path or a modulepreload.
Spaced HTML refs are classified as a browser reads them, only a whole node_modules directory segment marks dependency code, and remote loadURL targets stay URL nodes.
data: HTML refs no longer resolve to local files, equivalent tail spellings reach the same file, node_modules listing entries never win a tail, and tails come from one index per analysis.
A result that starts to verify mid-build can no longer prove a row with no selected result, proven needs a selected verifier result, and tied verifiers report the same gap in either order.
The ledger of what a rebuilt JavaScript app must do names, for each entry, the place in the app's map it came from. For storage uses, requests with no method and native modules listed as files, that name didn't match any node in the map, so those entries led nowhere; they now use the map's own ids. The same entry could also be listed twice, and no longer is. And when one owner in the rebuild had several records for an entry, only the first was read: test cases in the later ones were lost, and a failed check after a passing one went unnoticed. All of an owner's records are now read together, and one failed check is enough to mark the entry disproved.
Follow-up to #2087. In a `.gitignore` pattern such as `a/**\/b.js`, the slash after `**` is written with a backslash, and `**` was then read as a single `*`, so `a/x/y/b.js` wasn't ignored. `**` followed by an escaped slash now crosses folders as git reads it, and still needs at least one folder in between.
In a TypeScript project that hasn't been built, `import "./util.js"` means the file `util.ts`: the import names what the file will be called after building. Mapping such a folder left those imports unresolved, so the app's modules looked unconnected. An import or preload path ending in `.js`, `.mjs`, `.cjs` or `.jsx` now falls back to the TypeScript file beside it when no file of that exact name exists, and `.mts`/`.cts` files and more kinds of `index` file are found. The declaration files `.d.mts` and `.d.cts` are no longer taken for code, as `.d.ts` already wasn't.
Reading a source folder with its `.gitignore` files applied differed from git in four ways. A pattern starting with a backslash to mean a literal `*`, `[` or `?` was read as a wildcard. A name ending in an escaped space lost the space. `**` inside a name (`a**b.js`) crossed folders, where git treats it as one `*`. And a file under an ignored folder could be brought back by a later `!` rule, which git doesn't allow. Each now matches what `git check-ignore` reports.
The live browser and Electron capture tools had their own copy of the code that hides declared secrets, and only that copy hid two secrets that overlap: in a network recording or a stand-in built from one, `Bearer abc` and `abc123456789` in `Bearer abc123456789` left `123456789` showing. All three now use one implementation, in the analysis crate, which hides overlapping matches as one.
Saving the scripts of a web capture planned two files for URLs that differed only in letter case; on Windows and on a default Mac disk those are one file, so the second script was skipped. Paths are now compared without regard to case. A script whose URL ends in `.JS`, `.MJS` or `.CJS` no longer gets a second `.js` added, and a script captured many times is numbered `.hash.2`, `.hash.3` and so on, where each copy used to add to the last one's name until it was too long to write.
- Update `analysis::web_har::replace_needles_with` to scan each UTF-8 character
boundary for the longest matching needle and merge overlapping matched byte
spans before replacing, closing the suffix leak on partially overlapping
declared secrets in HAR inspection and stand-in builds while keeping distinct
non-overlapping adjacent matches separate for stand-in deduplication budgets.
- Export `encode_query`, `contains_ascii_ci`, and `replace_needles_with` from
`analysis::web_har` and call them directly from `engine::tools::web_common`,
removing the duplicate implementations so all three redactors stay in sync.
An indexed source map (one made of sections) always reported 0 sources with embedded content, because only the top level was counted; the count now includes every inline section, nested ones too. A stand-alone map named like `app.map.map` also lost both suffixes when its script name was worked out; only the last `.map` is removed now.
Comparing two versions of a JavaScript app matched each old module against every rule before moving to the next, so an earlier module's weaker match (same structure, or same id) could take a new module that a later one matched exactly, and one new module could be reported twice. Modules are now matched one rule at a time across all of them, strongest first, and each new module is claimed once.
A value the person declared as hidden could still appear in a network capture view or a stand-in when it was written the way a form posts it (spaces as `+` with other characters percent-encoded), with mixed-case percent escapes, or as an encoded form field name. Those spellings are now matched, without regard to letter case, with the longest spelling replaced first.
The Deep website study from #1838 sent `web_walkthrough_record` a step shape it doesn't accept, so no recording was ever written. The step is now the tool's own (a test reads it as the tool's params), request bodies are kept so two operations to one endpoint are told apart, a body cut at its cap is left out rather than replayed incomplete, headers are read from the shape the browser keeps them in, and the file is written with private permissions.
A Deep website study now records the start page's requests and answers to `capture/original.har` (bodies within their cap, credential headers and declared secrets left out as in every capture; a failure is noted in how-it-works.md, not fatal). When that recording is there, the brief tells the builder that `web_standin_build` and `web_standin_start` can serve those answers to its own front end. Clean room is unchanged. Starting a stand-in automatically stays open (R3.11).
An application graph resolved only the first 2,000 imports of a module and dropped which per-file fact lists were cut, so later dependencies lost their edge and role and nothing said a list was cut. Every retained import is now resolved, the cut lists are named in a facts_truncated limitation, and js_app_map reports partial coverage for such a graph.
app_graphs_compare and js_exports_compare cut added, removed, bundle-module and vendor rows at 2,000 without saying so, and the app comparison's summary reported the cut lengths as totals. Each list now carries its complete total beside the capped rows, the summary uses those totals, and a cut comparison is marked rows_capped with a limitation and partial coverage.
core_archives_compare counted every added, removed, changed and moved file but cut each list at max_rows without saying so. It now marks a cut comparison rows_capped, with a limitation that the counts are complete and partial coverage; a comparison that fits keeps its evidence as before.
An application graph dropped edges past 4 x max_nodes without saying so, and js_app_map reported complete coverage even for a graph cut by its node or edge cap. The builder now counts edges the cap turns away and records an edge_cap limitation beside node_cap, and js_app_map marks coverage partial when either cap cut the graph, on every module page.
A source-to-bundle comparison with more scripts than max_rows reported the examined window's counts as if they covered the whole tree, and its count of bundle units without a source was the capped row count. It now says how many scripts were examined beside the total, counts every unclaimed unit while still listing at most max_rows, and marks a capped result with a rows_capped limitation and partial coverage.
An index-map section that points at an external map, which is never fetched, adds no sources, so an application graph treated the map's list as complete. Such sections are now counted (through nested index maps), the graph names them in a limitation, and comparing a reference source tree with the bundle reports an otherwise unmatched source as uncertain with partial coverage instead of absent.
A map with malformed mappings or section offsets was reported unreadable, although its sources list is usually whole, and the list is all an application graph keeps. A new sourcemap::parse_sources reads the sources, content, names and ignore list without decoding mappings or checking section offsets; the application graph re-reads a map parse refuses for those reasons this way, lists its sources with a source_map_mappings_unreadable limitation, and compares them as usual. A map whose decodable mappings name a source past the end of its list, or with a malformed section, is still unreadable.
A source map that was malformed, had an undecodable data URL or was listed but not loaded left its sources looking absent, so a source comparison reported them as confirmed missing. Such a map is now marked unreadable with a limitation, and the comparison reports otherwise unmatched sources as uncertain with partial coverage. A stand-alone .map beside an analysed script is read like a referenced one; other .map files stay listed and unread, so they can't make a comparison uncertain or match code that doesn't ship.
Follow-up to #1703. A sections array of non-objects could cost several times the old parser's memory, skipped values weren't checked as a full read checks them so some broken maps read as valid, entries a repeated key replaces still used the budget, and the analyzer read a map refused at a limit as one with no sources. Index-map sections now count against the entry budget and non-map sections stay small, skipped values get the same string, number and nesting checks, a replaced list is freed and gives its entries back, the default limit is 4,000,000 so a million sources with content fit, and a map refused at any of the parser's limits leaves its sources uncertain with a limitation, while a malformed map is read as before.
When a source map's inventory was cut by its limits, the source-to-bundle comparison searched only the retained names and reported an omitted source as confirmed unmatched. Sources with no observed match now go in a separate uncertain_sources list with the reason source_map_inventory_truncated, the result says the inventory was truncated, and the evidence carries a limitation and partial coverage; positive matches are unchanged.