The hint for a tool Codex refused told the person to add a [mcp_servers.craft-anything.tools.<tool>] table, but setup writes tools as one inline table, and TOML refuses to extend an inline table that way, so Codex's config stopped parsing. The hint and docs/codex.md now say to add the tool inside tools, and a test checks that the old form fails and both valid forms parse. For #1867.
The lexer fallback, used for sources too large or too deep to parse, dropped side-effect imports such as import "./polyfill.js", which the syntax-tree path records. A string straight after the import keyword is now recorded as a static dependency with its location. Every fallback import goes through one helper that marks the list truncated past its cap and records a .node specifier as a native module, as the syntax-tree pass does.
A banner such as /*! @scope/pkg@1.2.3 */ was recorded as package pkg, losing its scope. A word that starts with @ now keeps its slash, so @scope/pkg@1.2.3 and @scope/pkg v1.2.3 keep the full name; every other word is still split on slashes, so a banner that names a package by its URL reads as before.
Recovering a webpack factory renames its parameters (e, t, n) to module, exports and __webpack_require__, but code inside a direct eval still used the old names, so the recovered factory threw a ReferenceError. A factory with a possible direct eval call now keeps its parameter names; indirect and optional eval calls, and mere mentions of eval, still allow the rename.
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.
Python 3.10's argparse reads -v=m "old task" as -v -m "old task", so a message saved that way in Aider's extra arguments still replaced the request in its file. An = after a single valueless short flag is now read before looking for m: the m and its message go and -v stays. Later Python versions refuse that form.
zip_has_entry scanned the whole file for central-directory signatures, so a ZIP holding backup.zip whose inner archive had an AndroidManifest.xml, or a comment shaped like a directory entry, was taken for an APK. It now searches the archive's own validated central directory with the existing parser, keeping only the matching entry and decompressing nothing.
The JSONC parser accepted carriage-return line endings, but its editor found lines by LF only, so adding a setting to a CR-only configuration brought in LF and lost the members' indentation, and removing a member left its line behind. CR now ends a line when the editor locates lines and when it removes a whole member's line, and a CR-only document keeps CR; LF and CRLF documents are unchanged.
pe_is_managed read the CLR directory past the optional header a PE file declares, so a native image with a short optional header and nonzero bytes where the directory usually sits could be taken for .NET. The optional header is now read through a slice bounded by SizeOfOptionalHeader, with the offset addition checked; PE32 and PE32+ keep their directory-count and nonzero RVA and size checks.
The MCP server sent progress notifications whenever a call carried a progressToken field, whatever it held. MCP's token is a string or a number, so a null, object, array or boolean now gets no progress notifications; a valid token still gets them, before the response.
The firmware carver read a PE's header size and certificate directory at fixed offsets without checking the optional header's declared size, so a short header could borrow bytes after it, inflate the region and carve into the next embedded object. Those fields are now read only inside the declared optional header, and a header too short for its fixed fields gives no PE region.
The hash of a signed Windows program is now checked against a second implementation: the test kit signs its fixtures with its own copy of the steps, covering gaps between sections, section order, data after the last section, sections that share bytes and 97 sections. A file that declares more sections than were read is refused instead of being hashed with some left out.
The .NET reader read the data-directory count and the CLI directory at fixed offsets without checking the optional header's declared size, so a file whose header ended earlier could be read as a .NET assembly from section-table bytes, or refused with a misleading section error. It now reads those fields only inside the declared optional header and refuses a short one as truncated.
A saved message in a short-option group was still passed to Aider: -vm "old task" means -v -m "old task", so the saved task replaced the request in its file. A group of Aider's valueless flags (-v, -h) followed by m now loses the m and its message and keeps the other flags. Any other short option is kept whole.
A new build is stopped before its first turn when its stack's program (Cargo, for Rust) isn't on this computer, but the check was skipped for any backend with an SSH host. An API builder over SSH still builds on this computer, so it found the missing program only after a whole turn. Only a coding agent over SSH, which builds on the other computer, skips the check now.
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.
A URL with no path has its first slash in the query or fragment, so https://auth.example.test?next=/graphql was read as a GraphQL endpoint; and a :// in a query made /api/graphql?next=https://x.test lose its path. A scheme now counts only before any /, ? or #, the host ends at the first of those, and run-time text in a partly literal URL ends neither.
Text read through constants joined both sides of every + as written, so '/v' + (1 + 2) read as /v12 and '/w' + 0x10 as /w0x10, both marked literal. Two numbers now add, a number literal reads as JavaScript turns it into text (0x10 is 16), and a + whose sides are neither known text nor two numbers is no longer reported as literal.
Aider handles a --message before it reads --message-file, so a --message saved in a backend's extra arguments ran instead of the person's request once the request went in a file. When the message is in a file, saved --message, --msg and -m arguments (and their joined forms) are now left out; other saved arguments are kept. With the message in argv nothing changes: it comes last and wins.
A push of [[ids], {one property}] was read as a webpack chunk whatever the object held, so ordinary code such as queue.push([[1], { callback }]) became a webpack module and marked the file as bundled. A one-property object now counts only when the property is a module factory and the file names webpack or uses its chunk-global push.
An export list marked functions exported by name among those seen so far: a list before the declaration marked nothing, and one after it marked every function of that name, nested ones included. Listed names are now resolved to bindings and matched to functions after the walk, whether the function was declared, initialised a variable or was assigned to one.
.cts and .mts got the same source type as .ts, where the parser decides between module and script from the syntax, so their reported source kind could be wrong. As in Node and TypeScript, .cts is now always CommonJS and .mts always an ES module.
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.
An API backend's requests per minute could only be set by editing config.toml. Settings → AI now has a field for it on each API backend, and the CLI has ai request-rate <name> [n]; zero removes the limit. Agent apps send their own requests, so they have no such setting. The save runs on a worker through the hub's usual save path.
Aider got its whole message, brief included, as one --message argument, and a builder's brief can pass Windows' 32,767-character command line, so the run failed before Aider started. A run on this computer now writes the message to a private file in the temp folder, passes it with --message-file and removes it when the run is over. Over SSH, or when the file can't be written, the message still goes in --message. Refs #402.
OpenCode's private server can answer the model check with a 503 ServiceUnavailableError while its plugins start, which stopped a question or build before it began. The check now asks once more after a two-second pause when that typed answer is what it got. Any other failure, a timeout or a stop isn't retried, and a second 503 is the error as before. For #1859.
When codex exec refused one of our tools, the feed always said to run setup --client codex, which changes nothing for a tool setup doesn't approve, such as build_command_run. For those tools the message now says how to approve the tool in Codex's own config.toml; the setup hint stays for the tools setup approves. Fixes the wrong hint in #1867.
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.
Codex started a fresh conversation on every turn. The adapter now continues the thread Codex reported (codex exec resume) on later turns and when a saved project is reopened, with the same model, sandbox and tool configuration and the prompt on stdin. A saved thread Codex no longer has is cleared and the next turn starts fresh. Codex's --ephemeral and --worktree options are refused before a run, since neither can continue a saved conversation.
Four shapes still estimated one or two levels and then overflowed the parser's stack: an else-if chain whose links end with ";", a class extends chain, a run of prefix ++, and brackets hidden in a false regex after an update operator or a member name. The estimate now counts each, and "/" after those tokens is read as division. A regex after yield is read only when it closes on the line; its brackets and operators are counted too, and a source where the regex and division readings can't be told apart takes the lexer fallback.
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:.
doctor compared the paths of craft-anything-cli on PATH as text, so a PATH folder that links to another (/bin -> /usr/bin) looked like a second installed copy. It now compares where the paths really lead and keeps the first spelling for the message. Helps with #1550.
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.
Concatenating a constant with itself doubled its text with each declaration, so a file under 1 KB could ask for gigabytes. Text built from several parts is now at most 4 KiB, and all constants in a file share a budget of the source's size plus 1 MiB; longer text reads as not literal. A redeclared name drops its earlier value once the new initializer has been read.
Calls, index reads and tagged templates that follow one another, and labels in a row, each nest the syntax tree one level, but the estimate stayed flat, so a source with millions of links was sent to the parser and overflowed its stack. The estimate now counts each link, keeps the count across a closed bracket the expression goes on after, and skips comments. The tokenizer also treats JavaScript's non-ASCII spaces and the vertical tab as whitespace.
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).
An OpenCode builder runs with `--auto`, so it once wrote its notes into `inbox/build-progress.json` and stopped the build. A build's OpenCode config now carries permission rules that deny its edit tool every record Craft Anything keeps in the project (`craft.json`, `feed.json`, `inbox/`, `investigation.cany/`, `reference/`…, from `workspace::OWN_NAMES`), except `checks/`, in either project layout. Chats and questions are unchanged. Its shell and folders outside the project aren't covered (roadmap R2.2).
The jump-table sweep found the next function with a `for` loop that always stopped on its first pass, which failed SonarCloud's reliability gate on main (java:S1751). It now takes the first function from the iterator, and the sweep still ends at the memory block's end when there's none. Behaviour is unchanged; the live Ghidra tests pass.
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 new build whose stack needs a program this computer doesn't have now stops before the builder's first turn, saying what's missing and how to get it, instead of failing at its first check. The stacks in stacks.toml name their program (Cargo for Bevy and the Rust stacks). A project already in app/ and a build over SSH aren't checked (part of #1837).
The Effort setting in Settings → AI appeared only for the Claude API and Claude Code. OpenAI, OpenRouter, Gemini and OpenAI-compatible AIs now offer OpenAI's levels (none to xhigh), starting at default, which sends nothing; once a level is picked, requests carry reasoning_effort (OpenRouter: reasoning.effort), and craft-anything-cli ai effort lists and sets the same levels. Claude no longer accepts none or minimal. Refs #1813.
A pitfall: the roadmap read on an old branch showed work main had already done as open. Read it from `origin/main`, and check the state of a PR a pending line names.
Just ask goes only to an agent that can be held to reading; with any other builder (Codex, OpenCode) the question was sent and only then refused. With Just ask on, the ask box now says beforehand that this builder isn't asked questions and to ask with Claude Code or an AI with an API key, and Send keeps such a question in the box with the same reason. Refs #1695.
A website build only needs a build script, since Craft Anything serves the built folder itself, so outside the app nothing said how to run one (#1590). A new website's brief now asks the builder for an app/README.md saying which commands build it and which folder to serve with any static server; a person's own project isn't asked for it.
A model turn on an API backend that stops after its fallbacks now writes a log to `logs/` in the config folder, as a failed agent CLI does: the backend, the server's message and code, and the fix. The error the person sees names the file.