Commit Graph
259 Commits
Author SHA1 Message Date
Afloat d4a39569e3 Report incomplete firmware archive member scans (R3.12) (#1607)
ZIP, tar and cpio readers can stop their member listings early, but firmware extraction ignored their truncation flags, so directory entries could use up the member limit and later files were left out while the result reported complete coverage. A cut-short member listing, in any region or nested archive, now marks the extraction truncated with a limitation saying what to raise or inspect.
2026-11-11 12:39:39 +07:00
Afloat 2fb99e2ba3 Keep nested ZIP members inside the outer firmware archive (R3.12) (#1606)
A ZIP stored inside a firmware ZIP member could supply the first plausible end record, so the scanner cut the outer archive short at the inner one: extraction left out outer members and wrote the inner contents at the wrong path. Each end record and central directory is now matched to the archive whose extent it describes, so a nested ZIP stays a member of the outer one and its siblings are all extracted.
2026-11-11 12:39:34 +07:00
Afloat a67ba2caa9 Bound firmware ZIP decoding by the remaining output budget (R3.12) (#1605)
Firmware extraction decoded ZIP members into a queue before charging their output bytes, so each member got the same remaining budget and a small compressed archive could hold many times the output limit; a member that hit the decode limit also left the truncation flag unset. Paths and the remaining file and byte limits are now checked before a member is decoded, each member is decoded only up to what's left, and a member stopped by the limit marks the extraction truncated.
2026-11-11 12:38:25 +07:00
Afloat 0028b7cbd8 Reuse recovered filesystem bytes during firmware extraction (R3.12) (#1604)
Filesystem recovery already owns each extracted file's bytes, but firmware extraction copied them into its output queue and kept the originals, so a large recovered file took two full copies in memory before it was written. The recovered buffers are now moved into the queue. Path checks, byte and file limits, nested scans and the report are unchanged.
2026-11-11 12:38:18 +07:00
Afloat f57fa23780 Disclose incomplete asset catalog tree reads (R3.12) (#1603)
A truncated asset catalog tree or node header could give no entries and no warning, and apple_assets_list then reported a complete empty listing; other interrupted tree walks kept what they read but called the result complete. Tree completeness is now tracked through the headers, child and leaf links, missing blocks and walk limits. Readable entries are kept, and an incomplete tree marks coverage partial, sets tree_incomplete and says so in the summary. Legal empty trees still read as complete.
2026-11-11 12:36:40 +07:00
Afloat 150fabc9c0 Apply keyed archive pagination before copying object rows (R3.12) (#1602)
apple_archive_decode built every object row before paging and copied a shared class name once per object while counting classes, so a 97 KB archive with 1,024 objects sharing one 64 KiB class name held 64 MiB of class text even when one row was asked for. Only the requested rows are built now, and class names are borrowed from their shared class object while the class counts are taken. Totals, order, offsets, limits and the output shape are unchanged.
2026-11-11 12:33:30 +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 e7c1980a19 Keep Unity bundle members within their uncompressed stream (R3.12) (#1574)
The UnityFS directory reader checked that compressed blocks fit the file but returned member offsets and sizes without checking the uncompressed stream they point into, so a member could lie past all data, overflow, or claim bytes in an empty stream. Block sizes are now summed with checked arithmetic, and a member whose range doesn't fit the stream is marked as unreadable. It keeps its directory entry, but its contents aren't read. Listings say how many such members there are, mark coverage partial and count objects as "at least", and the other members stay readable. An overflowing total of block sizes still makes the table unreadable.
2026-11-11 02:47:44 +07:00
Afloat 5120403cb8 Read requested ranges from stored Unity bundle blocks (R3.12) (#1576)
A small metadata or object read from a Unity bundle read and copied every block it touched in full, stored blocks included, so a valid stored block over the 512 MiB read limit made ordinary bundle and object listing fail even for a 496-byte member, and smaller stored blocks allocated bytes nobody asked for. For a stored block the reader now checks that its stored and uncompressed sizes agree and reads just the requested part from the file. Compressed blocks keep the existing decompress-and-cache path, and the 256 MiB per-request limit stays.
2026-11-11 02:32:09 +07:00
Afloat 893134c342 Bound expanded ASAR paths and say when an extraction is incomplete (#1558)
ASAR entry and depth limits didn't bound the combined size of expanded paths: a compact directory tree could repeat one long parent prefix across thousands of short names, and a valid 1.5 MB archive kept 145 MB of path text. Expanded entry paths and rejected names now share an 8 MiB budget, checked before each path is built; when it runs out, the entries read so far are kept and the listing is marked truncated. core_archive_extract used to ignore a truncated listing and call the extraction complete; for ASAR and ZIP it now extracts what was listed, adds a limitation that the listing was cut short, and marks coverage partial with no claimed total. The JavaScript app analysis carries the same flag.
2026-11-11 02:22:14 +07:00
Afloat 9e393e42f2 Disclose WebAssembly metadata limits in both tool views (R3.12) (#1557)
After the WebAssembly reader began leaving out derived metadata once its byte budget is spent, formats_wasm_module_show still said lists stop at 100,000 entries even when the byte budget ran out much earlier, and its summary view left out the reader's truncated flag. The limitation now says lists or derived metadata are incomplete and points to the warnings for which limit was reached, and the summary view includes truncated as the complete view already did.
2026-11-11 01:36:50 +07:00
Afloat 1ebdb78760 Bound retained DEX payload attachments (R3.12) (#1548)
DEX disassembly copied array and switch payloads into every instruction that referred to them, and the instruction cap didn't bound those copies: a 77 KB input with 2,048 references to one 64 KiB array ran out of memory under a 128 MiB limit. A shared payload budget (64 MiB by default, decode_with_payload_limit to choose one) now pays for each payload and each attached copy before it is made. A payload that doesn't fit is left off its instruction, whose offset, name and width stay, and the listing is marked incomplete. The payload lookup no longer clones payloads, and android_method_show says a listing can be partial because of instruction or payload limits.
2026-11-11 01:09:33 +07:00
FredApps 88ad1ad361 Drop the unreachable testId arm from the browser script name hints (#1481)
closest() in the browser script checker matches on the lowercased name, so its "testId" pattern could never match. It's removed; testId still maps to test_id through the lowercase "testid" arm, and a new test checks testid, testId, TestID, data-testid and data_testid.
2026-11-11 00:15:37 +07:00
Afloat db9dd54e47 Keep incomplete Android manifests partial in tool evidence (R3.12) (#1535)
The binary XML reader marks a recovered or capped manifest as truncated, but android_package_show dropped that flag and called its evidence complete, counted by the APK's ZIP entries, even when the manifest was missing or unreadable. android_components_list also reported complete coverage on the last page of a recovered manifest. Package evidence is now complete only when the manifest read in full, and component pages of a truncated manifest stay partial, with no claimed total and next_offset kept for paging.
2026-11-11 00:07:52 +07:00
Alex Joaquim Pereira f975b6b369 Don't hand a build a capture made in the other mode (R2.9) (#1520)
A project's capture/ can be left by a study in the other mode, and the run only checked that the folder existed, so a Clean room build could be handed a Deep capture, and a Deep run could skip its inside study by using a Clean room one. craft.json now records the mode the current capture was studied in (capture_deep, format version 5; a version-4 capture migrates as Deep, like a saved session), and a run studies again when its capture isn't from its mode. A study clears the record before it starts, so one that fails partway leaves nothing a later run trusts, and a Clean room study removes the files only a Deep study writes (how-it-works.md, page.html, runs/). The extractor's fresh-study decision and the run queue use the same check.
2026-11-10 23:36:41 +07:00
Afloat b40c56ef5c Validate JVM switch tables before allocating decoded pairs (R3.12) (#1503)
The JVM tableswitch and lookupswitch decoders reserved room for their declared entries before checking those entries were there, so a truncated 12-byte table could ask for 16 MiB; and a lookup table took duplicate or descending keys, though its signed keys must strictly increase. The whole table must now be present before anything is reserved, a dense table's count is converted without narrowing, and a lookup table with keys out of order isn't decoded (the instructions before it are kept and the coverage is reported incomplete).
2026-11-10 22:56:23 +07:00
김준호 0d80de615e Name the lists a saved result can page in its summary and browse errors (R5.7) (#1500)
In a live run, an agent asked core_evidence_browse for a list by a name that wasn't one and had to run the tool again to find the right one, as neither the result's summary nor the error named its lists. A result's summary now carries its lists and their lengths, by the names core_evidence_browse reaches them with, in a detail: summary answer, the MCP server's summary-first answer and browse's own summary; and browse's errors for a name that isn't a list say which lists there are.
2026-11-10 22:36:17 +07:00
Martinus 11d0042272 Recognise text files in target lists and triage (R3.11) (#1490)
A text file (notes, source code, settings) was a target of unknown kind, so the target list and triage called it a file we don't recognise yet. Text now has its own target kind, found by the same check the text reader uses (a byte-order mark, or valid UTF-8 with no zero bytes and few control characters near the start) after every other format, so lists and triage call it a text file and point to core_text_read. A binary file stays unknown.
2026-11-10 22:01:38 +07:00
FredApps 9a3eee4b95 Read the process list on FreeBSD: one ps -o per column (#1487)
POSIX makes everything after = in a ps -o argument the header, so FreeBSD's ps read pid=,ppid= as a single pid column headed ",ppid=". The process tree then had no parents, a runner's child window was never found there, and snapshot_finds_an_owned_child_on_this_host failed on every FreeBSD run since it was added.
2026-11-10 13:55:50 +01:00
김준호 c95d361218 Read a text source as text outside a build (R3.11) (#1480)
A text file outside a build (a script, Markdown, settings, a log) could only be searched byte by byte: the native tools refused it and build_file_read works only in a build. The new core_text_read (Deep mode) reads one as text, a page of lines at a time: UTF-8, or UTF-16 with a byte-order mark, invalid bytes shown as U+FFFD and counted, very long lines cut and named, and a file with zero bytes near its start refused as binary. Nothing is run.

Fixes #539
2026-11-10 18:13:09 +07:00
muraa-p c3e8c5185d Hash a signed Windows program the way Windows does (R3.11) (#1485)
native_publisher_show reported a signed program as changed after signing when its sections had a gap between them, because the file was hashed as one run of bytes up to the certificate table. The Authenticode hash now follows the PE/COFF specification: the headers (less the checksum and the security directory entry), then each section in the order its data sits in the file, then the data after them less the certificate table, so a gap between sections isn't hashed.
2026-11-10 18:09:04 +07:00
FuryNocturnTV (Tare Fernandez) 30e916536a Infer no Go launch for a command folder named with a backslash (#1446)
On Unix a folder's name may hold a backslash, and turning it into / named another package (cmd/foo\bar became ./cmd/foo/bar); Go reads a backslash as a separator, so keeping it wouldn't help either. The package is now written from the path's folders joined with /, the same on every system, and a command folder whose name holds a backslash gets no inferred launch.
2026-11-10 09:52:27 +07:00
FuryNocturnTV (Tare Fernandez) 90ea7a825b Name a Go command package with / on every system (#1442)
A Go project's command package was written with the system's separator, so on Windows the launch test expected ./cmd\viewer while the launch gave ./cmd/viewer (right for go run only by accident, from a mixed path). {package} now always writes the folder with /, as Go names packages, and the test expects ./cmd/viewer.
2026-11-10 09:15:52 +07:00
Alex Joaquim Pereira cf2a8ad0b0 Study again when a build's kept conversation is from the other mode (R2.9) (#1418)
A coding agent's saved session counted as the project's history whatever mode it ran in, so after switching between Clean room and Deep a run could skip its study and build from the other mode's capture. A saved session or transcript now counts only in its own mode (one saved before the mode was kept counts as Deep); one from the other mode makes the run study again and replace the capture before the builder is briefed, including an API follow-up whose transcript was rejected for its mode.
2026-11-10 01:28:05 +07:00
Louis Cerclé-Cheminel 1b4352cb0c Remember a Deep-mode decompile across requests, so the builder isn't told it hasn't decompiled after each one (R2.9) (#1403)
In Deep mode, a builder that hadn't decompiled anything was reminded to, but whether it had was kept only for one run, and each request from the person starts a new run. So a builder that had read the original's functions earlier was told "You haven't decompiled anything yet" after every request. It's now kept in the project's craft.json, so a decompile in any run counts.
2026-11-10 00:36:19 +07:00
Alex Joaquim Pereira d52d1a0531 Count a Claude Code question's own cost (R2.9) (#1404)
A question answered from a fork of the builder's Claude Code session reported the whole session's running total, so its cost was hidden. It's now what the total added since the builder's last turn, read before the question starts, and unknown when there's no kept total, never the session's total. The question's cost is added to the project's usage, and a build turn and a question saving their costs at the same time no longer overwrite each other.
2026-11-10 00:32:59 +07:00
Justin John c7606c4551 Stop a private browser and delete its profile when the app ends without closing it (R2.9, #810) (#1376)
A private browser or driven Electron app was stopped only when its process handle was dropped, which a crash, a kill, a force quit or an MCP server stopped by its client never does, so the browser was left running and its profile stayed in the temp folder. On Unix a small watcher now stops the browser's process group and deletes its `craft-*` profile once the app is gone, and ends by itself as soon as the browser does. Windows children are held by a Job Object; whether one outlives an abrupt exit is left as a roadmap line.

Refs #810
2026-11-09 22:51:21 +07:00
Afloat 234b5dc968 Extract Bun modules' stored source maps and bytecode (R3.11) (#1321)
A Bun program's modules can carry a stored source map and bytecode, which were only counted in a note. They're now listed and extracted as their own members, in a folder whose name doesn't clash with the program's own files.
2026-11-09 20:12:32 +08:00
Afloat a689a4e5d1 Show the size of copied pinned builds in Settings (R2.10) (#1320)
The pin list now reports how many bytes its copied pins take, and Settings shows that total next to the pinned builds.
2026-11-09 20:12:27 +08:00
Tanish Manku 5870bcebed Keep a check that worked while nothing it looks at changes, so an unchanged build isn't built and started again (R2.9) (#1296)
A check round in which every check worked is kept, and the next check reuses its results while nothing it looked at has changed: the app's files, the reference and capture files, the kind, stack and mode, the plugin checks and the project's folder. So a prompt that changes nothing in app/ no longer builds and starts the app again, and the check after the builder's turn doesn't repeat its own check. The feed says when results stand. A round with any failure is never kept, so Try again always looks again; the kept round is saved in the build progress.
2026-11-09 17:47:23 +08:00
Roman Serikoff e440907a93 Play Python packages and built Java jars (R2.7) (#1209)
Play, screenshots and self-tests start a Python project's one package with a __main__.py as python3 -m <name>, and a Maven or Gradle project's one runnable jar (its manifest names a Main-Class, read without loading the jar) with java -jar. Maven now builds with package, so the jar exists after our own build.
2026-11-09 03:03:45 +08:00
Alex Joaquim Pereira 0e7e43f418 Record a builder session's mode so Clean room never resumes a Deep one (R2.9) (#1202)
craft.json keeps the mode a builder's saved session ran in (version 4, with a migration that counts an older saved session as Deep). A build or question resumes a session only in the mode it was saved in, so Clean room never continues one that may have read inside the original, and a Deep session is kept for a later Deep run.
2026-11-09 02:11:26 +08:00
BFlatandAfloat cb0bb9d8fa Bound format readers and resolve launch paths (#1217)
Source-map data URLs ignore their fragment, ZIP directories are told by their attributes, rejected ASAR names count toward the limit, a HAR with a UTF-8 BOM parses, .NET bundle members stay before the manifest, Play starts a Python project's one installed console script, and Godot and Electron get an absolute project path.

Supersedes #1140, #1141, #1142, #1143, #1144, #1145 and #1146.

Co-authored-by: Afloat <ShuffleMonkey@163.com>
2026-11-09 01:55:01 +08:00
NetterSilver 247c262e4f Skip WASM tools with invalid ids instead of panicking on truncate (#1174)
A WASM tool whose id would pass 64 bytes is skipped as invalid, instead of being cut, which could panic inside a multi-byte name.
2026-11-09 01:18:38 +08:00
NetterSilver 12e573c900 Fix ellipsis added to short multibyte script check messages (#1199)
A script check message is cut by characters, not bytes, so short text in multi-byte characters keeps no stray ellipsis.
2026-11-09 01:18:26 +08:00
NetterSilver f672d50f01 Keep adb's clipped text within its byte limit on multi-byte text (#1095)
clip() now cuts at the last character boundary at or below the limit, so a character that straddles it is dropped instead of going over.
2026-11-07 18:14:27 +08:00
Afloat 464935ef96 Launch Go apps with a single command package (R2.7) (#1092)
A Go project with no root main.go and exactly one cmd/<name>/main.go starts with go run ./cmd/<name> for Play, screenshots and self-tests.
2026-11-07 17:24:51 +08:00
Afloat 2a5845c64b Export Unity floating-point textures as PNG (R3.9) (#1088)
RHalf, RGHalf, RGBAHalf, RFloat, RGFloat and RGBAFloat textures now decode: RGB is treated as linear light and clipped, and NaN stays dark.
2026-11-07 16:36:59 +08:00
Tomáš Doubek c7bb13bd1d Bound combined macOS UI observation output (R5.6) (#1087)
A tree and screenshot that would pass the helper's 16 MiB output cap now fit: the tree is cut to a prefix and reported as truncated, keeping the image, and an image that cannot fit alone becomes a screenshot limitation.
2026-11-07 16:32:52 +08:00
Tomáš Doubek 248b671ddd Capture requested macOS window screenshots (R5.6) (#945)
`runtime_ui_read` with `screenshot: true` returns one on-screen window of the pid as a PNG on macOS 14+, restricted by `window_id` when given. Missing permission, a missing window or a failed capture is a limitation with partial coverage, and no permission dialog opens.

Fixes #248
2026-11-07 16:12:35 +08:00
BFlat b700e1deb4 Start the snap a launcher script hands over to, with a snap's profile (#1055)
Ubuntu's /usr/bin/chromium-browser is a script that hands over to the snap; the snap is now started directly, with a profile it can use, so a website build gets past Study.

Closes #1054.
2026-11-07 10:04:12 +08:00
Tanish Manku 315bb12174 A builder's command of several kinds needs each one allowed (R2.9) (#1034)
* A command of several kinds needs each allowed, and an inbox path split by quotes is still the inbox

* A Windows inbox path split by quotes is still the inbox

* A relative path into the inbox, from the project folder or app/, is a system change

* An inbox path written as a PowerShell parameter or with Bash escapes is still the inbox
2026-11-06 15:15:38 -07:00
Tanish Manku 915fe6366b A builder's shell command is checked with its quotes joined, and naming the agent marker counts too (#1033)
The check for the project's records reads a command with quotes and escapes taken out, as the shell joins them, and any mention of `CRAFT_ANYTHING_AGENT` counts as a system change. docs/claude-code.md says these raise the bar and aren't a wall.
2026-11-07 05:01:03 +08:00
Tanish Manku 3122cd1e6d Each project chooses what the builder's approvals get, per kind of action (#1022)
A project can allow, ask about or refuse each kind of builder action (web, commands, outside files, publishing, deletes outside the project, system changes, other tools); a kind it hasn't chosen follows Auto mode as before. `project_approvals_set` sets them, and an agent can only make a kind stricter, including through our CLI from its own shell. "Always" on a push, delete or system card allows that whole kind, and pushes are read word by word in every shell form.
2026-11-07 04:36:10 +08:00
adamsardo 1a694a9d2d Say when macOS Screen Recording blocks a window picture, and stop picturing the wrong window (#1025)
Without Screen Recording the capture is refused before the program starts, with where to allow it. The name fallback matches whole words and never the system's own windows, and a window that's late gets up to 10 more seconds.
2026-11-07 04:23:35 +08:00
BFlat 4390e97e60 Stop Ghidra when the app closes, and skip the analysis of an Electron program's runtime (#1007)
Closing the app stops analyses and waits for them to end. A Deep build no longer waits on Ghidra for an Electron program, whose logic is in `app.asar`.

Closes #946.
Closes #947.
2026-11-07 01:46:35 +08:00
BFlat 17e4200479 Build and run new projects through their toolchains (#1002)
New Python, Go and .NET projects build and launch through one catalogue shared by the build check, the screenshot and Play; a window is found through the program's descendants, then by name.
2026-11-07 01:21:01 +08:00
BFlat 31f6ae6539 List an edited-in-place project's own files (#996)
`build_files_list` defaults to the project folder for a project edited in place and hides our records from that listing; a listing of one of our folders shows what is in it.
2026-11-07 01:18:47 +08:00
BFlat fb8f304417 Say where a build command ran, give API-key builds their asset keys, and respect the macOS accessibility flag (#999)
`build_command_run` says where it ran and warns on `app/app/`. Runs load the saved asset keys. `runtime_ui_read` honours `accessibility: false`. Closes #923. Closes #307.\n\nCo-authored-by: SoldierPePe <ahmed.m.alnajjar1@gmail.com>\nCo-authored-by: justinjohn0306 <justinjohn0306@gmail.com>\nCo-authored-by: Tomáš Doubek <doubektomas16@gmail.com>
2026-11-07 00:54:21 +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