Commit Graph
1584 Commits
Author SHA1 Message Date
BFlat 8dec78492d Merge pull request #367 from oliver-mee/bugfix/policy-gates
The process and UI source-policy gates stopped at a file's first test attribute, so production code below an interleaved test module escaped them. They now read Rust paths through the whole file, follow import aliases, ignore comments and string examples, and exempt only items that can't exist outside tests. The lock gate uses the same scope, and module files named by a path attribute are checked wherever they live.
2026-11-16 18:04:55 +07:00
BFlat 3ef118107e Merge pull request #1940 from scks1/bugfix/r5.5-api-failure-log-service-text
A failed API-backend turn wrote the error's message to its log, and that message repeats what the service, or a proxy in front of it, answered, which can include the key or words from the request. The log now keeps our own code for the error, the HTTP status, the context window and request size, and the service's error code only when it is one of a known list. The error shown in the app and the CLI still has the service's message.
2026-11-16 17:59:57 +07:00
Oliver Mee 41397fa761 Include explicitly referenced production module files in policy checks 2026-11-16 18:44:09 +08:00
Oliver Mee 59941e75af Check hidden source and report unscannable directory links 2026-11-16 18:44:09 +08:00
Oliver Mee 40442a78d5 Limit policy exclusions to manifest crate boundaries 2026-11-16 18:44:09 +08:00
Oliver Mee 518b8be76b Keep production source directories in policy checks 2026-11-16 18:44:09 +08:00
Oliver Mee 3df6b38e40 Check complete Rust items in source policy gates (R0.5) 2026-11-16 18:44:09 +08:00
BFlat 7aebf09ae3 Merge pull request #1937 from Fadlalla-ai/test/r5.7-linux-window-and-rebuild
On a clean Ubuntu 24.04 under X11 the app stopped before its window because the package list left out the X11 half of xkbcommon. The package line in the README and its translations now includes libxkbcommon-x11-0. STATUS records the window opening on a clean container and the README's snake-game rebuild reaching Ready with Claude Code. A new roadmap line notes that the first build check didn't find the program when Cargo's target directory pointed elsewhere.
2026-11-16 17:38:43 +07:00
Simon Koch-Sultan 352848bfb6 Leave the service's words out of an API backend's failure log (R5.5)
write_failure_log wrote the error's message, which repeats what the
service or a proxy in front of it answered (up to 1,000 characters of an
HTTP error, all of a stream's error message), so a key or words from the
request repeated there were kept in logs/. The log now keeps Craft
Anything's code for the error, the HTTP status, the context window and
request size, and the service's error code only when it is one of
failure::KNOWN_PROVIDER_ERRORS, written from that list.
2026-11-16 05:26:42 -05:00
Simon Koch-Sultan 777ef76170 Claim leaving the service's words out of an API failure log (R5.5) 2026-11-16 05:23:08 -05:00
Fadlalla-ai 752ccd5e6f Keep the rest of the Linux quick start open on the roadmap (R5.7)
The ticked line covered only what ran: the window on a clean Ubuntu 24.04 and
the snake rebuild on a desktop. The website rebuild examples, a rebuild on a
clean machine, a real screen and Wayland get their own open line.
2026-11-16 14:16:21 +04:00
Fadlalla-ai 946f2522db Add libxkbcommon-x11-0 to the Linux quick start and record the window and rebuild checked (R5.7)
On a clean Ubuntu 24.04 under X11 the app stopped before its window:
"Library libxkbcommon-x11.so could not be loaded". With libxkbcommon-x11-0
installed it opened on its welcome screen. The README's snake-game rebuild
reached Ready with Claude Code. Also notes, as an open line, that the first
build check didn't find the program when Cargo's target-dir pointed elsewhere.
2026-11-16 14:01:18 +04:00
Fadlalla-ai a00aedbff1 Claim the rest of the Linux quick start live check (R5.7) 2026-11-16 13:53:30 +04:00
BFlat 090188d705 Merge pull request #1936 from Fadlalla-ai/test/r5.7-linux-quick-start
On a clean Debian or Ubuntu system the README's package list left out a C compiler, so the first build stopped with "linker cc not found". The package line in the README and its translations now starts with build-essential. STATUS records the install steps followed as written on clean Ubuntu 24.04 and Debian 13 containers; the window on a clean machine with a screen and the README's rebuild commands stay open in the roadmap.
2026-11-16 16:15:08 +07:00
Fadlalla-ai 11607a91b2 Keep the window and rebuild steps of the Linux quick start open, and say what wasn't run (R5.7) 2026-11-16 12:49:20 +04:00
Fadlalla-ai efe7d74f11 Add build-essential to the Linux quick start and record it checked on clean Ubuntu and Debian (R5.7) 2026-11-16 12:39:42 +04:00
Fadlalla-ai af627b5419 Claim the Linux quick start live check in the roadmap (R5.7) 2026-11-16 12:24:44 +04:00
Trần Quang Đãng 9460af211f Let Claude Code use the model its own settings name by default (#921)
* Let Claude Code use the model its own settings name by default

Claude Code runs are no longer passed a hardcoded --model: with no choice
saved, the agent uses whatever its own settings name (a custom model, an
alias, opusplan…), and `ai model --default` clears a saved override back
to that. The Settings → AI picker lists "Default (its own settings)" first
for Claude Code (saved as `claude-code` or `claude`), choosing it clears
the saved model, and the typed "Another model" field is gone since the
list carries the choice. effort_levels detects Claude Code by adapter id
so the `claude` agent id gets every effort level too.

* Translate "Default (its own settings)" in the remaining eight catalogs

The i18n gate requires every catalog to carry the same key set; the
first commit only added the new picker label to six of them.
2026-11-16 08:59:20 +01:00
BFlat 21ffa656ca Merge pull request #1914 from Plastic-time/bugfix/r3.12-js-line-index-1115
Line numbers in JavaScript facts counted only LF, so anything after a bare CR, U+2028 or U+2029 was reported on the previous line. The line index now counts every ECMAScript line terminator, and CRLF once.
2026-11-16 14:12:01 +07:00
RRFZ 7a452424e9 Merge main into bugfix/r3.12-js-line-index-1115 2026-11-16 01:48:57 -05:00
Justin John 5a3fba9286 Keep the plan-limit advice on the turn's closing error (R5.3) (#1933)
A turn refused by a used-up Claude plan limit ends with a closing result error, which is the one the run keeps, and it carried the generic advice, so "which limit, and when it resets" was lost. The closing error now carries the same plan-limit advice as the error before it. Follow-up to #1931.
2026-11-16 13:46:01 +07:00
Justin John 15972b4fbb Stop the build at a used-up Claude Code plan limit instead of retrying it (R5.3) (#1931)
When a Claude plan's 5-hour or weekly limit was used up, Claude Code's rate_limit error was read as a per-minute rate limit, so the build waited and tried again and failed the same way each time. Claude Code's stream reports each turn's plan limits; when that report says the turn was rejected, the failure is now a usage limit, which isn't retried, and the fix names which limit is used up and roughly when it resets. A rate limit on a turn the plan allowed is still waited for and retried. Fixes #1919.
2026-11-16 13:24:16 +07:00
FredApps 51b000e23a Merge pull request #1922 from storytold/refactor/shared-xml-plist
Use the shared XML property-list reader
2026-11-16 06:42:58 +01:00
Justin John d2d52137ea Use the Windows manual proxy for engine downloads when no proxy variable is set (R2.9) (#1930)
Engine downloads (Ghidra and its JDK, Godot, pinned installs) used only the proxy environment variables, so behind a VPN that sets only the Windows system proxy they went direct and timed out. When no proxy variable is set, they now use the person's manual proxy from Windows' settings, read from the registry once per download; this computer and Windows' own exceptions go direct, and a NO_PROXY the person set replaces those exceptions. Settings with credentials, SOCKS only or no port are ignored. AI clients are unchanged. Not run behind a real system proxy. Fixes #1827, #1787.
2026-11-16 12:37:41 +07:00
BFlat 0e32cd474c Merge pull request #1812 from htcom-code/bugfix/r3.13-body-outline-cap
A walkthrough asked to keep response bodies keeps them for the first 200 requests and said nothing about the rest, so a request without a body read as a response that had none. The result now counts how many requests kept a body, were past the cap, came after the deadline or couldn't be read, and the evidence carries a limitation when some were left out.
2026-11-16 08:29:11 +07:00
htjulia 2330f627b7 Say how many response bodies a walkthrough left out, and why (R3.13)
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>
2026-11-16 10:11:39 +09:00
htjulia a0c7c6c8dc Claim the web_page_show body outline cap fix (R3.13)
Co-Authored-By: htjulia <htjulia1@gmail.com>
2026-11-16 10:11:39 +09:00
BFlat 0d16837d60 Merge pull request #1928 from FuryNocturn/bugfix/r5.5-plugin-log-review
Follow-up to #1921. A credential in a plugin argument that no flag names, such as a token in a URL, is now hidden in the failure log's command. A local server that stops answering is stopped, and what it printed is added to the error and the log, which before had no output. A failed write to a server now waits a moment for its exit to be recorded, so the error gives the exit code and output instead of a broken pipe; that race was failing the test added in #1921.
2026-11-16 07:51:29 +07:00
FuryNocturn ab74a2730e Hide keys in a plugin's arguments in its log, and keep what a server that stopped answering printed (R5.5) 2026-11-16 01:30:50 +01:00
FuryNocturn 1c9a3627ed Claim R5.5: the review notes on #1921 2026-11-16 01:17:05 +01:00
RRFZ 72af4d7676 Correct JavaScript lines facts (R3.12) 2026-11-15 14:28:05 -05:00
RRFZ ebf3353fbc Claim JavaScript lines correctness (R3.12) 2026-11-15 14:27:53 -05:00
FuryNocturnTV (Tare Fernandez) febf096ea4 Keep a failure log when an MCP plugin doesn't start, and say what it printed (R5.5) (#1921)
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.
2026-11-16 01:15:53 +07:00
Dylan M. Taylor 5ff2ac9b1a Preserve the XML tokenizer admission budget 2026-11-15 13:03:13 -05:00
Dylan M. Taylor 5cd7341937 Use the shared XML property-list reader 2026-11-15 12:59:11 -05:00
Alex Joaquim Pereira 983a3013f3 Check Aider's setup on the SSH host (R2.2) (#1912)
Aider's setup check read this computer's environment and home folder even for a run on another computer over SSH, so a working remote setup could be refused and local keys could pass a remote run that would then wait at a sign-in page. The check now runs on the host: one bounded, stoppable ssh command looks at that account's environment and Aider's settings files and returns only an exit status. Only the two definite answers refuse the run (no model or key; an OpenRouter model without its key); a check that can't run lets the run start and logs why. Not run against a real SSH host.
2026-11-16 00:46:03 +07:00
Alex Joaquim Pereira 773ed61443 Fix Codex's approval guidance for the inline tools table (R2.2) (#1918)
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.
2026-11-16 00:38:07 +07:00
RRFZ ad9b1c74d1 Keep side-effect imports in JavaScript lexer fallback (R3.12) (#1915)
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.
2026-11-16 00:34:26 +07:00
RRFZ fd9832c7a6 Preserve scoped package names in JavaScript banners (R3.12) (#1916)
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.
2026-11-16 00:27:48 +07:00
gmrmad1 d965112708 Give xtask the workspace lints every member uses (#1917)
xtask was the one workspace member that didn't opt into the shared lints, so the repo-wide ban on unsafe code and the unwrap, expect and panic denials didn't cover the tooling. It now uses them like every other member, and a test checks that every member manifest does.
2026-11-16 00:09:14 +07:00
RRFZ bf50b9eb3a Preserve webpack factory parameters used by direct eval (R3.12) (#1913)
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.
2026-11-15 23:48:43 +07:00
gmrmad1 45e16b09b1 Write inbox requests and answers owner-only (#1911)
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.
2026-11-15 23:28:15 +07:00
Herwin bd405ceeb5 Study websites behind a login: save a sign-in you make in a browser window and reuse it (R2.9) (#1459)
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.
2026-11-15 17:28:04 +01:00
gmrmad1 8f3b775157 Say at startup when --allow-run removes the approval step (#1909)
The MCP server's --allow-run flag treats every tool call as approved, and a client configuration that adds it did so without a word. The server now writes one line to stderr at startup when the flag is set, saying what is turned off and how to restore the approval step. The consent behaviour itself is unchanged.
2026-11-15 22:49:35 +07:00
Scott Converse 573f2c4b93 Stop the lock watchdog freezing the whole app when it logs a problem (#1908)
The lock tracker logged a problem while holding its registry lock. The app's logger writes to a file behind one of the tracked locks, which locks the registry again, so the thread waited on itself and every other lock in the app waited behind it: the window froze for good about 30 minutes into a long tool call that other threads were waiting on. Problems are now recorded under the registry lock and logged after it is released. Fixes #1907.
2026-11-15 22:12:02 +07:00
PONK 88d1d9cac8 Add a Turkish README (#1902)
Adds README.tr.md, a Turkish translation of the README, and a Türkçe link in the language switcher of the English README and every existing translation. Code blocks, commands, file names and links are unchanged; only the comments inside code blocks are translated.
2026-11-15 19:04:31 +07:00
Justin John 5e809edfe8 Drop a saved -v=m from Aider's arguments too (R2.2) (#1900)
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.
2026-11-15 18:24:47 +07:00
RRFZ 1097195797 Detect ZIP members through the archive directory (R3.12) (#1822)
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.
2026-11-15 17:46:29 +07:00
RRFZ 3a4edea0a7 Preserve CR-only JSONC configuration formatting (R3.12) (#1823)
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.
2026-11-15 17:35:44 +07:00
RRFZ 4fd0742dbe Bound managed PE detection to the optional header (R3.12) (#1821)
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.
2026-11-15 17:35:38 +07:00