- C++ 99.5%
- Python 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Jorijn: "there is no need to do a global cap anymore, the cap should be 128 per available account". `--concurrency` no longer defaults to 128: the limits are each OAuth account's 128 (and the local login's), every driver's counted, an API seat's own REVIEW_GATES_API_CONCURRENCY, and free memory. `--concurrency N` still caps the machine when given; a value below 1 is a usage error. The dump's args.concurrency is null then. The board's driver settings read `128 per account`, which every driver's `seats` shows as that driver's width, and the `seats` header says a width is that driver's cap. The Scheduler test runs 300 passes on two accounts: 256 at once, 128 each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
| .forgejo/workflows | ||
| implementations | ||
| interfaces | ||
| lib | ||
| packaging/flatpak | ||
| process | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| LICENSE | ||
| project.cpp | ||
| README.md | ||
Crafter Review
The pre-push review pipeline: adversarial lenses review a frozen commit range, one claude --print process per inventory unit, before the range is pushed. Four lenses in a fixed order: the approach, the range exercised in the running application through the Playwright MCP server, and side by side the static bug proof and the security review. The repository's config says which of them run and what each gets: the browser, the local Supabase database, both, or neither.
| Gate | Lens | Question |
|---|---|---|
| 1 | repo-better-solution (a whole pass gating code blocks) |
the right mechanism, layer and commit shape? compatible with what users have? |
| 2 | repo-functional (a whole pass gating code blocks; the browser or browser+supabase environment) |
in the running application, does the range do what its code and messages say, and does it leave the flows next to it working? |
| 3 | repo-bug-prover (code blocks, static; with the database a proof may also run there) |
a demonstrated defect in the range's code |
| 3 | repo-security (code blocks, static, beside the bug-prover) |
a demonstrated gap in a protection the repository promises |
| 4 | the owner | approves the exact frozen hash, then the push happens |
crafter-review's prompts, reuse keys, exit codes and shared files are pinned byte for byte by its goldens (tests/Goldens): a review one driver started, another resumes and reuses, and every driver on a machine sees the others' passes on its seat board.
Install
crafter-review ships as a Flatpak with its own git, Node (for the Playwright MCP server) and ripgrep, so every machine reviews with the same tools:
flatpak remote-add --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo
flatpak install catcrafts net.catcrafts.CrafterReview
alias crafter-review='flatpak run net.catcrafts.CrafterReview'
master builds are the beta branch (net.catcrafts.CrafterReview//beta). The alias is for people: the /prepush skill spells every command as flatpak run net.catcrafts.CrafterReview …, because Claude's Bash tool sees no aliases.
What the machine provides:
- The Claude Code CLI. It is proprietary and not bundled. crafter-review looks for it in this order:
CLAUDE_BINorREVIEW_GATES_CLAUDE_BIN, the PATH, the editor extensions' bundled binary (newest first), then~/.claude/localand~/.local/bin. It runs inside the sandbox, so every pass is measured and every pass's process tree can be killed. - Seats. The lens processes run on the seats in the repository's
.env(CLAUDE_CODE_OAUTH_TOKEN1..6,ANTHROPIC_API_KEY1..6), else this machine's own login.crafter-review seatsprobes and reports them. It never prints a token. An account whose 5-hour limit Anthropic has removed showsno limitin that column and is placed by its weekly window. Every account takes at most 128 passes at once, every driver's counted, and there is no machine-wide cap beyond that and free memory (run --concurrency Nsets one). - Chromium, for a lens with the browser. Run
crafter-review browser installonce. It installs the Chromium build the pinned@playwright/mcp@0.0.83drives into~/.cache/ms-playwright, where the MCP server looks. It runs Playwright's own installer, which also removes the browser builds no installed Playwright on the machine refers to. - A local Supabase stack, for a lens with the database (
supabase start, or the repository's own bring-up). Thesqlhelper speaks the Postgres protocol itself: nopsqland no driver to install. Every call is one transaction, rolled back. - gpg, if your commits are signed.
freezereads each commit's signature through gnupg's keyboxd socket, which is all the sandbox is given. The agent, which signs, stays out of reach.
Setting a repository up
From the repository's toplevel:
crafter-review init
crafter-review config # edit .review-gates/config.json until it prints no problem
init does four things:
- it writes
.review-gates/config.jsonfrom the template when there is none; - it adds
.review-gates/push/and.review-gates/trees/to.gitignore; - it writes the
/prepushskill to.claude/skills/prepush/SKILL.md, which a laterinitrefreshes (the line after its frontmatter marks it as init's); - it prints the next steps.
It writes nothing in a subdirectory, in your home directory (--force when that is the repository) or over a SKILL.md it did not write.
.review-gates/config.json is committed. It says what the pipeline must know about the repository:
- who may author its commits, and which branch a range is measured against;
- which lenses run and the environment each gets (
none,browser,supabaseorbrowser+supabase); - how its application is started and reached: one stack, or several side by side (
slots); - where its local database answers;
- which paths carry no runtime behaviour.
crafter-review doc config prints the template; crafter-review doc prepush prints the procedure, process/prepush.md.
Moving a repository off the review-gates submodule
- Re-freeze every review in flight with crafter-review. The Flatpak's git may be another version than the one that froze it, and a different git version gives a different hash. The old
run-line.txtalso points into the submodule. git submodule deinit -f review-gates && git rm review-gatescrafter-review init. If.claude/skills/prepushis the old link intoreview-gates/, it removes the link, never writing through it, and makes a real directory with the skill.
config.json keeps working unchanged. So do the reuse keys: a range reviewed before the move is reused, not bought again.
Running a review
crafter-review freeze --slug <branch> # Gate 0: checks, export, hash, run line
# start the application / the stack from the checkout at HEAD, when a lens has the browser / the database
crafter-review run --artifact .review-gates/push/<branch>/ --hash <sha256> \
--base <sha> --trees . --dispositions .review-gates/push/<branch>/gate-state/dispositions.json --date <date>
freeze prints the exact run line and writes it to run-line.txt; launch from there in a detached shell (setsid nohup … &). The exit codes:
- 0: SEND-READY (push-ready);
- 1: FIX FIRST;
- 2: INCOMPLETE, PARTIAL or CONFIRMING (run the same line again);
- 3: preflight.
The dump with every finding, note and coverage entry is gate-state/commits-<hash8>-run-<n>.json.
To stop a run, run crafter-review stop <its scratch dir>, or crafter-review stop --hash <hash8> for every live run of a hash. Its running passes are killed, no later gate starts and the dump is written. A run takes its passes with it however it ends, SIGKILL included: each pass runs under a supervisor that kills its whole tree, the MCP server and Chromium included. flatpak kill net.catcrafts.CrafterReview is the hard stop.
| Command | What it does |
|---|---|
freeze |
Gate 0: the checks, the export, the hash, the run line; --verify at push time |
run |
Gates 1–3: the lenses, the dump; --dry-run launches nothing |
slots |
how many stacks fit in free memory, and the commands for the missing ones |
config |
the merged config and its problems |
seats |
every seat probed: both windows, their resets, the drivers running |
init, doc, browser install, stop |
the setup, the shipped texts, the Chromium, a stop |
sql, totp, inventory |
the helpers a lens runs, and the partition of an export |
Inside the Flatpak
The sandbox gets the network, the whole host filesystem (--filesystem=host), the host's /tmp and gnupg's keyboxd socket. --filesystem=host is a convenience for a developer tool, not an isolation boundary: a lens's tool allowlist is what keeps a pass to its job, as it was outside the Flatpak.
The driver hands its children the host's XDG directories. git then reads ~/.config/git/config, Playwright finds ~/.cache/ms-playwright, and claude and npx behave as on the host. A pass's shell is bash. A few things do differ from a native run:
- a lens reading
/usrsees the Sdk's; - git hooks run with the Sdk's tools;
FLATPAK_IDreaches every child;- a runtime update can change git between
freezeand--verify, which the MISMATCH message then names.
Several drivers on one machine. Every driver registers its passes on one board, ~/.cache/review-gates/seat-board.json, and holds a lifetime lock beside it while it runs. A driver in the Flatpak publishes the host pid of its sandbox, so a driver outside it sees it alive exactly as long as it runs and sweeps it the moment it is gone.
Building from source
crafter-build --local test # the suite; --local takes ../Crafter.Network instead of the pinned commit
crafter-build --local lint
crafter-build run flatpak # the Flatpak on the stable Crafter.Build base (flatpak-builder or org.flatpak.Builder)
crafter-build run install # install that build as net.catcrafts.CrafterReview//local
run flatpak --base=<branch> builds on another branch of the base app, and --deps=local takes Crafter.Network and Crafter.Thread from the checkouts next to this one, for commits not yet on forgejo. AGENTS.md is the guide for changing the pipeline.
License
crafter-review is licensed under the GNU Affero General Public License v3.0 only (LICENSE). It vendors nlohmann/json 3.12.0 (lib/json.hpp, MIT License, © 2013-2025 Niels Lohmann).
Copyright
Copyright (C) 2026 Catcrafts®