Commit Graph
39 Commits
Author SHA1 Message Date
RRFZ 7ad785b788 Keep the request content type in recorded HAR bodies (R3.13) 2026-11-16 22:07:09 -05:00
muraa-p 8374ad7154 Record the site's start page the way the walkthrough takes it (#1857)
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.
2026-11-14 17:42:46 +07:00
muraa-p 3394cad58f Record a website's traffic in Deep mode and tell the builder about the stand-in backend (#1838)
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).
2026-11-14 16:30:07 +07:00
Alex Joaquim Pereira 26ea91abd3 Resolve and disclose application graph import facts (R3.12) (#1795) (#1795)
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.
2026-11-13 00:47:39 +07:00
Alex Joaquim Pereira c64b74ec83 Report complete comparison row totals (R3.12) (#1792) (#1792)
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.
2026-11-13 00:07:18 +07:00
Alex Joaquim Pereira 1fb6cf697a Mark archive comparison rows capped (R3.11) (#1782) (#1782)
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.
2026-11-12 21:11:00 +07:00
Alex Joaquim Pereira 71dda0be00 Disclose application-graph edges dropped at the cap (R3.12) (#1780) (#1780)
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.
2026-11-12 20:34:52 +07:00
Alex Joaquim Pereira 664ce030d1 Keep source-bundle comparison totals honest under the row cap (R3.12) (#1778) (#1778)
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.
2026-11-12 19:46:46 +07:00
Alex Joaquim Pereira d56fa23860 Mark sources of unread external source-map sections uncertain (R3.12) (#1767) (#1767)
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.
2026-11-12 18:12:13 +07:00
Nicolas Bohn 12aad97757 Keep the sources of a source map refused for bad mappings or section offsets (R3.12) (#1717)
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.
2026-11-12 09:26:47 +07:00
Nicolas Bohn 438c80082a Report sources of unreadable source maps as uncertain, not missing (R3.12) (#1708)
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.
2026-11-12 08:50:04 +07:00
Nicolas Bohn ab79ec87a4 Count source-map sections, check skipped values and keep refused maps' sources uncertain (R3.12) (#1705)
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.
2026-11-12 02:43:59 +07:00
Afloat 3a9ad9c6c5 Report uncertain source comparisons after source-map truncation (R3.12) (#1694)
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.
2026-11-11 22:17:23 +07:00
Afloat 22c44d01d2 Bound expanded source-map source lists before building them (R3.12) (#1689)
A small source map could expand to gigabytes when its sourceRoot was copied into every source name, and the full list was built before the application analyzer kept 5,000 of them. Source lists are now built within an entry and byte budget shared across sections and an application's maps, checking each expanded path's length before allocating it; when only a prefix fits, the result says it was truncated and the analysis notes it as a limitation. A pitfalls entry records the rule.
2026-11-11 21:34:19 +07:00
Afloat 76c7ca6082 Keep worker modules in their own execution role (R3.12) (#1618)
The application graph recognizes a worker entry point but then follows its spawn edge while assigning the parent's role. Worker modules, their ordinary dependencies and their endpoint evidence consequently appear as `main`, `page` or `package`. The later worker-role pass cannot correct a role that was already assigned. Use the existing worker/service-worker/utility-process edge classification to stop parent-role traversal at execution-context boundaries. Worker roots still receive their own role and propagate it through ordinary imports. Spawn edges remain in the graph, and a module also directly imported by the parent retains the existing role precedence.
2026-11-11 13:53:07 +07:00
Afloat 439dae070e Keep module roles when dependency imports repeat (R3.12) (#1617)
A package with 52 reachable modules loses the final module's role when each hop repeats the same `require()` 2,000 times. The graph resolves those imports, but role propagation charges its 100,000-step limit for duplicate queue entries, eventually leaving reachable modules as `unknown`. Mark modules in the existing role map before enqueueing them. Repeated imports, cycles and shared dependencies then use one queue entry per newly discovered module. The limit remains 100,000 newly discovered modules per assignment, and the existing main/preload/renderer/page/worker precedence stays intact. Inline scripts continue to inherit their page's role.
2026-11-11 13:42:34 +07:00
Afloat 99ee49dd99 Match numeric bundle identifiers by their JavaScript value (R3.12) (#1615)
A module keyed by `0x10` and a loader call written as `16` produced different identities. Numeric separators and exponent notation caused the same problem, including dangling `requires` targets in the application graph. Different spellings of one numeric dependency could also occupy separate list entries. Use the existing syntax library's JavaScript number conversion for numeric module keys, loader arguments, browserify mappings and chunk IDs. Explicitly enable its already-present `to_js_string` feature. String identifiers retain their literal spelling, including strings such as `"0x10"` that identify a different property from numeric `0x10`.
2026-11-11 13:38:17 +07:00
Afloat 6a4dee893e Keep native function evidence from blocks before its entry (R3.11) (#1600)
A native function can branch to a body block placed before its entry address. The control-flow graph already included that block, but reference and string scans only looked from the entry onward, and parameter inference took the lowest-address block as the entry, so a register set by the real entry could become a false parameter while the real input disappeared. Reference scans now cover the address range of all of the function's body blocks, and parameters are read from the block at the function's actual entry.
2026-11-11 13:11:26 +07:00
Afloat d552493da2 Resolve webpack loaders by their parameter bindings (R3.12) (#1614)
A webpack wrapper can have a loader parameter named `r` while a nested function uses its own unrelated parameter with the same spelling. The dependency visitor treated both calls as module loads, adding false `requires` edges to the application graph. Resolve loader calls against the wrapper parameter's semantic binding. This retains closures that capture the real loader, distinguishes function/arrow parameters, block and catch bindings, and avoids treating the placeholder for a destructured parameter as an actual loader name. First-seen ordering and dependency deduplication stay intact.
2026-11-11 12:42:40 +07:00
김준호 4f61975f25 Pair Rust functions across toolchains by their names without the crate hash (R5.7) (#1589)
app_builds_line_up paired only 1,448 of about 36,000 functions across two Rust toolchains, because every v0 crate hash changed, so exact names rarely matched. A new name_without_hash stage, after exact names, pairs Rust names (legacy and v0) that are equal once demangled without the compiler's hashes, and keeps the instantiating crate so each crate's copy of a generic impl stays separate. Called names are compared the same way, so the structure fingerprint survives a toolchain change, and a pair whose names differ only by hash isn't counted as renamed. On the same two cargo builds this pairs 14,036 functions (13,356 by name), with masked-bytes pairs down from 888 to 233. The crate lookup reads only the end of a name, so a long crafted symbol can't make it slow.
2026-11-11 07:29:35 +07:00
Afloat 9a1dfd0d65 Count received HAR response bytes separately from decoded content (R3.13) (#1327)
A HAR summary added the larger of each response's received and decoded sizes into one total. It now reports the received bytes and the decoded content bytes separately, with how many responses didn't record each.
2026-11-09 20:16:11 +08:00
BFlat e0922f4ff4 Keep pasted picture names unique, create atomic-write temp files exclusively, and keep distinct replay samples (#995)
Pasted pictures get a counter in their name; atomic-write temp files are created exclusively and private from the start; stand-in replay samples keep differing response details.
2026-11-07 00:50:18 +08:00
Afloat cf414ff4b9 Apply replay body limits after redaction (R3.11) (#717)
A website stand-in charges its per-body and total byte limits on the text it actually keeps after redaction, and drops repeated samples before charging them, so polling no longer uses up the budget. A cached 304 whose body was left out stays unavailable (R3.11).
2026-11-04 20:32:58 +07:00
Afloat 5ac0e2b68d Preserve empty query pairs in older stand-in recordings (#673)
Older stand-in recordings keep their empty query pairs when current credential rules are reapplied, so replay matches the right page (follow-up to #648).
2026-11-03 23:16:53 +07:00
BFlatandAfloat ebed13d0fc Keep ARM32 conditional call values, esbuild dependencies and window labels right (#656)
Replays #640–#642. Conditional A32 calls keep the skipped path's value, esbuild dependencies survive unrelated calls, and window comparison labels stay distinct without renumbering occurrences.

Co-authored-by: Afloat <132809511+Afloat16@users.noreply.github.com>
2026-11-03 20:49:11 +07:00
BFlatandAfloat 82856a30b2 Redact HAR reports more thoroughly and count their bodies correctly (#648)
Replays #602–#605. HAR reports redact percent-encoded credential names and declared secrets in every kept field, count decoded body bytes, and template only real dates in API paths; the stand-in backend matches older recordings with the current query rules.

Co-authored-by: Afloat <132809511+Afloat16@users.noreply.github.com>
2026-11-03 20:25:48 +07:00
Ole Bohmbach 521947899d Copy only the scripts a web script export can write (#587)
web_scripts_save copies only the scripts that fit its max_scripts and max_bytes; scripts past them are listed by URL only, so a large or hostile capture costs no more than the export's own limits.
2026-11-03 20:19:03 +07:00
Ole Bohmbach a6920ff271 Cap the edges a native call graph lists (#582)
A native call graph lists at most 50,000 call edges and says when it stopped there, so one function with a huge number of call sites can't blow up the report.
2026-11-03 20:14:55 +07:00
GGWA 5cdcbb7503 The archive inventory says when nested archives were left unopened (#534)
Fixes #519. core_archive_show counts nested archives that a depth or size limit left unopened, reports a nested_not_opened limitation and marks coverage partial.
2026-11-03 14:58:51 +07:00
Afloat d5e07a8262 Report unavailable cached bodies in stand-in replay (#543)
A stand-in backend no longer replays a recorded 304 without its cached body: such samples are kept for diagnosis, skipped in replay, and a request with no usable answer gets cached_body_unavailable. Builds count them.
2026-11-03 14:50:01 +07:00
BFlat 531f546dc0 The same files in another archive order are the same content tree (#445)
An inventory's content id hashes its (path, sha256) pairs sorted, so the same files listed in another archive order are the same content tree and compare as identical. Fixes #281.
2026-11-02 23:50:01 +07:00
Afloat 66ffd738ed App comparisons keep every unassigned window (R3.10) (#440)
App version comparisons keep each unassigned window's preference changes instead of folding them into one. Fixes #237.
2026-11-02 23:48:06 +07:00
GGWA 0f580c7722 HAR request hosts no longer include query text when the URL has no path (#422)
A HAR URL's host ends at the first /, ? or #, so query or path text with an @ never reaches the host (same cause as #308, in the HAR reader).
2026-11-02 23:22:13 +07:00
phatloi0010 510b4111e3 Report actual matching function count beyond cap in feature_paths (#415)
feature_paths reports the real number of matches beyond its 200-entry cap and marks the result truncated. Fixes #351.
2026-11-02 23:13:37 +07:00
BFlat eaaa8d3f8f Comparing folders or archives moves each new file at most once (#343)
`core_archives_compare` matched moves by content through a map from hash to one new path. Two identical old files missing on the new side both "moved" to that one path, so a removal went unreported. With two renamed copies, one copy was reused and the other was reported as added.

Each new-only file is now a move destination at most once. Old files are paired with distinct new copies of the same content, and the rest are removed or added. Every file on each side is accounted for once.

**Verified:** a new test with the reporter's fixtures. Two old copies and one new copy give 1 move and 1 removal; two and two give 2 moves to different paths, with no additions or removals. The existing comparison test still passes. `cargo test -p craft-anything-analysis` (86), the engine's artifact tests, clippy and fmt pass.

Fixes #283
2026-11-02 15:33:05 +07:00
Oliver Mee 8b5826f9bd Selected macOS app folders and nested XPC services are recognised (#297)
Selecting a macOS app folder is recognised as an app bundle (its root-relative Contents/Info.plist), and nested XPC services appear as services and xpc-service graph nodes.

Fixes #282
2026-11-02 15:04:00 +07:00
BFlat 4ae6ce70d2 Comparing app maps notices an edited inline script (#269)
An inline `<script>` becomes a module of its own (`index.html#inline-0`). Its summary took its hash from the input file with the same path, and there is no such file, so the hash was always empty. Comparing two maps then read "both empty" as "the same", and an edited inline script counted as unchanged.

- **Inline scripts now get the hash of their own code.**
- **Maps saved before this have no hash for them.** Where either side lacks a hash, the comparison now checks the module's structure fingerprint, size and strings instead.

**Verified:** a new test with a page whose inline script changes from `console.log("A")` to `("B")`:
- the inline module and the page are reported changed, and a map compared with itself has two unchanged modules;
- the same holds for maps with the inline hashes blanked, as saved before this fix.

`cargo test -p craft-anything-analysis` (80), the engine's app tests (31), clippy and fmt pass.

Fixes #236
2026-11-02 14:02:23 +07:00
BFlat 1207715afd Pseudo-Java keeps the statements before a try (#242)
The pseudo-Java for a method with one try/catch rendered the protected region, the handler and what follows, but never the statements before the `try`. So `v0 = 7; try { v1 = 2; } catch (RuntimeException e) {} return v0;` came out without `v0 = 7;`.

- Those statements are now rendered first. A branch from them into the try region falls back to a labelled `goto`, as elsewhere, so the method is no longer marked fully structured.
- The single-handler wrap is now refused when anything sits between the try's closing `goto` and the handler. That code would have been dropped the same way; such methods now get the plain rendering with the "exception handler(s) in the table" note.

**Verified:** a test with the reporter's 152-byte class (it fails without the fix); `cargo test -p craft-anything-analysis` (79), the engine's Java tool tests (9), clippy, fmt.

**Not checked:** `cargo xtask wasm`. The change is pure logic inside an existing function.

Fixes #232
2026-11-02 13:26:28 +07:00
Brandon ThomasandClaude Opus 5.5 f64ae3bf3c Craft Anything
A native, pure-Rust app that shows anyone how a piece of software works, with
evidence-backed answers, then helps them rebuild it. It ships a desktop app, a
CLI and an MCP server, all driven by one engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 10:52:14 -04:00