A Java folder set for Ghidra in Settings → Engines was used only to run Ghidra, so with no system Java, Vineflower said Java wasn't installed and JADX could not start. The Java runtime lookup now returns that folder's bin/java when no path is set for Java itself, so Vineflower, JADX, the engine list and doctor all find it. A path set for Java itself still wins, and a folder with no bin/java is ignored.
When a folder set in Settings → Engines didn't hold the program, these tools said the program wasn't installed. They now use the shared lookup and wording that the Java and disassembler tools already use: the folder set for it has no such program, or the path set for it isn't there, with how to correct it. Optional engines keep their "not installed, that's fine" note when no path is set.
Process capture was refused on FreeBSD, where a terminal loses a short program's output when it exits, so two console tests have failed in the nightly FreeBSD job. FreeBSD now uses the pipe capture Windows already uses, with the program's process group ended with it; scripted input, resizes, signals and watched files are still refused there. Linux, macOS and Windows are unchanged.
no_display_error refuses a sign-in window without DISPLAY or
WAYLAND_DISPLAY on every Unix but macOS, but its test expected that only
on Linux, so it failed on FreeBSD once the console capture tests stopped
ending the run first.
A page that opens an alert while loading waits for someone to close it, and nothing did, so opening the site always ran into its deadline and a rebuild could not study it (#2010). The session's page client now answers dialogs as they open: an alert or a leave-page question is accepted so the page can go on, and a confirm or prompt is dismissed so nothing is agreed to for the person. The result lists the dialogs the page opened and how each was answered.
A page that opened an alert while loading waited for someone to close
it, and nothing did, so the open always ran into its deadline. Alerts
and beforeunload are accepted so the page can go on; confirm and
prompt are dismissed so nothing is agreed to for the person. The
result says which dialogs the page opened and how each was answered.
Fixes#2010
Co-Authored-By: htjulia <htjulia1@gmail.com>
On FreeBSD process capture was a stub that returned "only available on
Linux and macOS", so a console study kept no runs and a console run check
never ran the build. The nightly FreeBSD job has failed on the two tests
that cover them since they landed (#1679, #1702).
FreeBSD now captures the way Windows does: the program runs through
platform::process (its process group is ended with it) and its output is
read through pipes, which keep what a short program wrote after it exits;
a terminal on FreeBSD loses it. Scripted input, resizes, signals and
watched files still need the terminal capture and are refused there.
The pipe capture now has a Unix test, and capture_and_compare_echo runs on
every Unix rather than only Linux and macOS.
A pin estimate that finished after the person cancelled or opened another project's dialog wrote its size into the open draft; an estimate error could also fall through to a toast. The estimate result and every project_pin_create error now name the project (estimate errors also say estimate), and the dialog fills only when the Pin dialog is open for the same normalized project. Estimate errors the open dialog rejects are swallowed; a failed pin creation still tells the person.
Regressions: a late estimate and a late estimate error for another project, an estimate after the dialog closed, and a failed creation that still toasts. Engine tests check the estimate result and both error details, including an open-project failure.
build_file_read used std::fs::read, so a builder could point it at a multi-GB generated file under app/ or target/ and allocate the whole file before the 256 KiB page was produced; MAX_READ only capped the returned page.
It now reads through platform::fs::read_file_capped with a 16 MiB cap. A file over the cap returns OverLimit with a plain message and a remediation; files at or under the cap page as before. The helper also rejects non-regular files before reading.
Regression: a 16 MiB + 1 text file is refused and a file exactly at 16 MiB still returns its first page; the over-cap assertion failed before the fix, where the tool read it and returned a page. A follow-up roadmap line records build_file_edit, which still reads the whole file.
A build folder shared by several projects holds every project's programs, and a same-named one there was taken for this project's: Play started it and a new pin copied it. A program outside the project now counts only when Cargo's dep-info file beside it lists sources inside the project, and the newest of the project's own builds is started. A pin made before programs were recorded looks only inside its own copy.
A session that opened one project and then another kept the first project's evidence and open questions in its ledger, so the second project's report and evidence tools mixed both. Opening a different project now clears the ledger, its order, the open questions and the unloaded count before loading the new project's store; reopening the same project still refreshes it in place. Records are saved to their project as they are made, so nothing is lost by clearing.
A path set in Settings → Engines counted as found whenever it existed, so a JDK's folder set for the Java runtime was listed as installed and then run as a program ("permission denied"). A folder is now looked in the way an install folder is, newest version first with digit runs compared as numbers; a folder without the program isn't found, and the message names the folder.
A session that opened project A and then B kept A's ledger and open questions: open_project loaded B's records into the same ledger. The desktop app has one engine for its lifetime, and each rebuild opens its project's investigation, so B's report and evidence tools mixed both projects.
Opening a different project now clears the session ledger, its order, open questions and unloaded count before loading the new project's store. Reopening the same project still refreshes it in place, and a failed unknowns read leaves the current project untouched. unloaded_evidence is recomputed on every open.
Regression: two projects with stored evidence and an open question; switching shows only the new project's records, reopening the same project keeps its ledger, and reopening the first restores its records. A follow-up roadmap line records the open targets and annotations that still survive a switch.
* Take target file signatures from the shared craft-sniff table
* Pin craft-sniff to the craft-libs #1841 merge and record the cutover
The shared table is on main at 070005125f0af1a5ae4a59002270e5849505bfc0.
* Keep named-but-unsupported formats as Unknown
A CPIO file starting 070701 was identified by craft-sniff, then fell
through to the unsigned path and was called text. Identified kinds this
app does not inspect stay Unknown; the unsigned fallback is only for
files with no signature.
A pin from before programs were recorded starts what its copy holds again (file
lookup), not where Cargo builds the project now. Cargo prints real paths, so its
target folder for a project opened through a link is put back under the path
the project was given as, and a pin doesn't take the project's own build for an
outside one.
The file lookup from #1941 stays for frequent reads (the Project screen). Where a
program is about to start or be checked (Play, pins, the build's run and
screenshot checks), launch_now also runs cargo metadata from the project and
looks in its target_directory first, which covers what the files don't:
$CARGO_HOME/config.toml, CARGO_BUILD_TARGET_DIR and a parent workspace's
target/. Outside the project, only a program the manifests name is taken.
A shared or ancestor target directory outside app now supplies only a program the manifests name. Without a name, only target directories inside app are searched, so another project's executable isn't started. built_program_in(app, env) makes the tests independent of the process's CARGO_TARGET_DIR.
The ancestor walk starts from a normalized absolute app, so a relative app reaches a config above the working directory; normalized paths also keep .. out of selected programs. Cargo's legacy config wins over config.toml when it exists, and a config without the key or with invalid TOML doesn't fall through.
A pin copies a program built outside app into pin-program/ and records that relative path; other executables in a shared folder are not copied, and the frozen pin keeps working when the external build is removed.
A project whose Cargo settings move the build output (build.target-dir in .cargo/config.toml, or CARGO_TARGET_DIR) built, but Play and the screenshot/self-test checks only looked in app/target, so they could not start the program. built_program now looks under CARGO_TARGET_DIR, then the closest project or ancestor .cargo setting, then the default target/ as a fallback, and starts the first target directory that has the named program.
The new AI regression uses a project with target-dir = "out" and fails before the fix; engine tests cover the environment path (relative and absolute), a project setting, an ancestor setting, the environment coming first, and the default fallback.
A walkthrough with keep_bodies.response_body kept bodies for the first
200 requests and said nothing about the rest, so a request without a
response_body read as one that had no body (#1811; web_page_show's
outlines were fixed in #1845). The network result now counts the kept
bodies, and a response_bodies_partial limitation says how many were
left out: past the cap, after the run's deadline, or unreadable.
Co-Authored-By: htjulia <htjulia1@gmail.com>
A local MCP plugin that exited before answering only said "The X plugin exited." It now gives its exit code and the last lines it printed, and a write to a server that has already gone gives the same error. When a local plugin can't be started, exits, or doesn't answer in time, a failure log is written to logs/ in the config folder and named in the error. The plugin's environment is left out of the log, and a remote plugin or a stop writes none. The failure-log writer moves to the engine crate so plugins and agent runs share it.
A project's inbox request and answer files were written with the default mode, usually readable by every local account, though a request can carry the person's own words and an answer a typed reply or an approval. Both are now written owner-only (0600 on Unix). Whether an answer could be forged by another local process is a separate question and is not changed here.
Addresses #1178 (which also consolidates #1277).
## The problem
The website study a build starts with opens a fresh private browser, so a web app behind a login is studied as its sign-in or landing page, and the builder then builds a sign-in page.
## What this adds
- **`web_site_sign_in { url }`** opens a visible browser window on the site. The person signs in there themselves and closes the window. The browser's profile is then saved in Craft Anything's own folder, keyed by the site's host and port. Craft Anything never sees or stores a password and still never reads cookie or storage values.
- **`web_site_open`** uses a saved sign-in for that exact host and port when there is one, by copying it into the usual temporary profile (headless as before, deleted afterwards). `signed_in: false` forces the private profile; `signed_in: true` with nothing saved is a clear error naming the sign-in tool. Nothing else about the private path changes.
- **`web_site_sign_out { url }`** forgets a saved sign-in.
- **A check right after saving.** The sign-in tool reopens the site headless exactly as a later study will, and reports whether it still looks like a sign-in page, plus a screenshot kept in the site's owner-only folder (path, hash and size are returned, not the picture, so the person's account screen is not sent to an agent).
- **Typed facts through to the builder.** `signed_in`, `signed_in_site` and `sign_in_page` are in the open result, the capture result and `capture.json`. The website briefs tell the builder the capture is the signed-in view only when it is signed in and does not look like a sign-in page. A not-signed-in capture with a password field says how to sign in; a signed-in one says the sign-in may have ended.
- The check phase opens the built site with `signed_in: false`.
Because a study already starts with `web_site_open`, a normal build of that site is signed in after one `web_site_sign_in`, with no new build option.
## Decisions for maintainers
These are policy calls I made so the change is usable; each is small to reverse.
1. **Clean room allows the two tools** (two lines in `clean_room.rs`). Reasoning: the person signing in as themselves and looking at pages is watching from outside, as a user would; `visitor_view()` strips exactly what it did before.
2. **A saved sign-in is used by default** for later opens of that site, until `web_site_sign_out`. Saving it is treated as the consent, and the tool text and evidence say so. The alternative is opt-in per study, which needs an option in the Make screen and `rebuild`.
3. **Restricted MCP mode refuses both tools even with `--allow-web`**, since sign-in opens a window on the person's desktop.
4. The saved profile sits on disk (owner-only on Unix; on Windows it relies on the per-user config folder). On Linux it is launched with the basic password store so the visible and headless launches can read the same cookies. The tool text says that anyone who can open the person's files could use the sign-in.
## Trade-offs and limits
- Needs a desktop: on a computer with no display the tool refuses at once with what to do instead.
- Sites that tie a sign-in to the browser, or expire it quickly, will capture signed out; the check after saving and the `sign_in_page` field say so.
- Session-only cookies are kept by setting the profile to continue where it left off; restored tabs are not copied.
- The saved profile can also hold single sign-on providers' sign-ins made in that window. It is used only when that exact host and port is opened.
- Screenshots and page text of a signed-in study contain the person's own account data; the evidence says so. Result URLs drop the query and fragment when a sign-in is used.
- Not in this PR (roadmap lines added under R2.9): a Make-screen button, showing the person the study's first screenshots to confirm before the builder starts, attaching to the person's running browser, refreshing a saved sign-in from a capture, and a live run on a real site and with the Snap browser.
## What was verified
Run locally on Linux (x86-64), on the branch before its final rebase onto `main` (the rebase was clean; after it: `cargo fmt --all --check`, `cargo xtask layers`, `locks`, `secrets`, `tools --check`, `i18n-coverage` pass):
- `cargo test -p craft-anything-engine` (583 passed, 12 ignored), `-p craft-anything-mcp` (22), `-p craft-anything-ai` (580, 3 ignored).
- `cargo clippy -p <crate> --all-targets -- -D warnings` for engine, mcp and ai.
- **Live, with Chromium 157 under a virtual display against a local test site** (the new `#[ignore]` tests in `site_sign_in/tests.rs`; a helper plays the person over the browser's own debugging port and closes the window):
- a sign-in made in the visible window is seen by a later headless open and capture, including an HttpOnly cookie and a session-only cookie (removing the continue-where-you-left-off setting makes that assertion fail, so the setting is what keeps it);
- `signed_in: false` and a signed-out site show the signed-out page with the private-profile limitation;
- a site that forgets the cookie is reported as still a sign-in page by the check after saving;
- two overlapping signed-in opens both work and leave the saved sign-in byte-identical;
- the timeout path stops the browser, keeps what was saved and leaves no process behind;
- with no display the tool refuses immediately.
- The two existing live website tests still pass.
**Not verified:** a real third-party site; a confined Snap or Flatpak browser (reasoned from the existing profile-location code, not run); Windows and macOS behaviour, including the browser-exit signal (the profile lock going away) and cookie decryption there; the workspace-wide `cargo xtask ci` steps and `--features wasm-plugins` (not enough disk locally, so CI is the first run of those); how the egui app shows the new tools.
An independent review pass was done before opening; its findings (copying only after the browser has exited, not treating one slow probe as a closed window, a whole-or-nothing replacement of the saved profile, reserved Windows names in site keys, owner-only permissions) are fixed in the later commits.
In Deep mode a build starts Ghidra's one-time analysis on its own thread, and it kept running after its project was deleted, using a core and about 12 GB of memory until the app closed. The analysis now also stops once the project's record is known to be gone, checked on its existing polls. Pausing is unchanged, and a record that can't be read for a moment doesn't stop it. Fixes#948.
When Auto mode or a project's approval setting refuses an action, the build feed now names the kind and how to be asked next time, for example /approvals publish ask for a refused push. The refusal itself is unchanged. Repeated refusals of one kind share one notice, and the next build clears old notices.
game_unity_asset_export now takes AudioClips (Unity 5 and later). The sound is read from the .resource file beside the serialized file or inside the bundle, 256 MiB at most. A single 16-bit PCM sample in mono or stereo is saved as a WAV; anything else (Vorbis, ADPCM, a bank that isn't read) is saved as the FMOD bank it's stored in, with a limitation saying so. The output's extension is set to .wav or .fsb to match.
* engine: contain agent reads and stop auto-running generated programs
* engine: format the read-containment changes
* engine: expect deep mode reads to stay inside the workspace
* mcp: use an always-allowed action in approval-shape tests
* settings: call the private-folder helper through its module
* journal: format the redaction helper
* Secure the config directory before replacing settings
app_graphs_compare and js_exports_compare dropped the analysis limitations of the graphs they compared (a malformed source map, a truncated inventory, dynamic IPC names), so a comparison read as complete when one side was partial. Each side's limitations, from a path or from saved js_app_map evidence, now go into the comparison's evidence labelled left: or right:.
native_strings_find listed at most 32 references per matching string with no count or flag. Each match now carries its complete reference_count and a references_capped flag, and a search with a cut list adds a references_capped limitation.
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 light pin hard-links dependencies and media from the project and copies a file it can't link (a drive without hard links, a file at its link limit). That fallback was silent, so the pin just looked bigger. Pins now record `copied_shared_bytes`, and the app says how much was copied instead of shared. Older pins read it as zero.
`project_builder_set` chooses the AI that builds a project's later changes by an enabled backend's name, `default` gives it back to the app's own choice, and with no name it says which is chosen and which builds now. A name that is off or unknown is refused before anything is saved. It runs in Clean room, since it never looks at the target. The project page's own control is still open (R2.9).
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).
`web_page_show` read bodies for the first 200 requests of any kind, so a page that loads its data after a few hundred scripts, styles and telemetry calls got no JSON outline at all, and nothing said why. The cap now counts JSON responses, the network result counts them, and when some got no outline the evidence says how many and why: past the cap, after the window's deadline, or a body that couldn't be read as JSON (part of #1811).
Agents over ACP report context use, not a turn's tokens, so their turns now say the token count is unknown instead of 0, in the CLI, the build's activity and the app. Project and session totals keep what was reported: "Unknown" when nothing was, and a lower bound such as "1.9M+" when some turns had no count. usage.json gains `tokens_incomplete`; older files read as before.
An opt-in macOS test compiles a small program, runs `apple_calls_observe` on it under LLDB, checks that both function hits are recorded in order, and that a file LLDB can't debug is an error with a fix. Run on arm64 macOS with Apple LLDB.
The test of a browser that exits before it's ready checked a 20 s stopwatch over the whole call, which also timed process startup and cleanup and failed under load. It now checks the error code and the exit diagnostic, which already tell the exit apart from the deadline.
A builder that kept its own notes in inbox/build-progress.json stopped every later run with an unexplained parse error. The run still stops on a progress record it can't read, but now says the file is Craft Anything's record of the build, that something else changed it, and to rename or delete it to go on; a record from a newer version still says to update. Every brief now names craft.json, feed.json and inbox/ as Craft Anything's own records.
A config.toml that another program or a virus scan held for a moment at startup left the whole session on defaults that refuse every save (#1735). Startup now reads it again after short waits, 2 s in all, before falling back, but not for a missing file or a folder in its place; edits deferred at the last exit are merged only once the file could be read, so they aren't lost while it stays unreadable.
core_report_write lists at most 30 distinct limitations; past that, its Markdown and HTML reports now end the list with how many more were omitted, instead of dropping the rest without a word. A report with 30 or fewer is unchanged.
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.