Home / Skills / indexable-inc/blaze

build-and-test

How blaze is built, checked, tested and measured, and how a lane runs: blaze builds blaze (never cargo), its own pinned nightly, the Mac or an ix VM (never AWS), subagents that only write code while the main agent runs one `blaze check` and `blaze test`, one worktree per lane, cleaning up and measuring the exact tree. How tests are written (Hegel property tests, deterministic simulation, testing a

skillLicense: Apache-2.0 Source: indexable-inc/blaze

Install

Copy this folder into your Claude Code project (needs Node.js):

npx degit indexable-inc/blaze/.agents/skills/build-and-test .claude/skills/build-and-test

Or install it for every project:

npx degit indexable-inc/blaze/.agents/skills/build-and-test ~/.claude/skills/build-and-test

File content

Made by its original authors and shared under Apache-2.0. We show it unchanged, with credit and a link to the source. Source ↗

---
name: build-and-test
description: "How blaze is built, checked, tested and measured, and how a lane runs: blaze builds blaze (never cargo), its own pinned nightly, the Mac or an ix VM (never AWS), subagents that only write code while the main agent runs one `blaze check` and `blaze test`, one worktree per lane, cleaning up and measuring the exact tree. How tests are written (Hegel property tests, deterministic simulation, testing a causal claim) is the `testing` skill. Load before any build, check, test run, benchmark, bisect or measurement, before splitting work across subagents, and when starting or ending a lane."
---

# Building, testing and measuring blaze

<!-- Generated by `bun tools/agents/rules.ts --write` from tools/agents/rules.ts, down to the end marker; edit the rules there. AGENTS.md carries each rule as one line. -->

## blaze-builds-blaze (rule 2)

Build, check and test blaze with blaze (`blaze build`, `blaze check`, `blaze test`), never `cargo`,
`rustc` or sccache, in any place: an agent's loop, a harness, a CI workflow, a benchmark, the
release build or a doc's instructions. Stage 0 is a blaze binary (the release
`.github/blaze-version` names, or a blaze built earlier), never cargo, until the wasm seed replaces
it (docs/future/bootstrap.md). Stage 0 is never overwritten: a build of the tree (stage 1) becomes
stage 0 only after it rebuilds the tree (stage 2) byte for byte and the tests pass, and moving
`.github/blaze-version` forward is that promotion. When stage 0 can't build the tree, that is a
named error: write the source around it for one release or pin an older release, never cargo. Every
build, check, test and verdict comes from blaze. When blaze fails on blaze (a compile error, a link
error, a panic, a hang, a wrong result, too slow, too much memory), that failure is the work: fix
blaze, never route around it through cargo. A crate blaze can't check or test yet is a ranked, owned
blocker, not a reason to keep using cargo for it.

See [docs/contributing.md](../../../docs/contributing.md).

## verify-on-real-projects (rule 7)

A verdict on blaze comes from real projects built by blaze: blaze itself, then large open-source
workspaces (ripgrep, nushell, bevy, wasmtime, tokio, ...), each built with `blaze build` and its own
tests run with `blaze test`. A project whose tests pass under blaze is correct for what they cover;
a failing test is a blaze bug to fix. Never build a project with rustc or cargo to diff against: no
reference build, no output comparison with rustc's, no harness that runs cargo for an oracle. A
test's expectation states what is right, not what rustc printed.

See [docs/harness.md](../../../docs/harness.md).

## own-nightly (rule 8)

blaze is its own toolchain: it builds every project with its pinned nightly (`harness/toolchain`,
bumped daily), ignoring rust-toolchain files, rustup, `RUSTUP_TOOLCHAIN` and `RUSTC`. Projects pin
the blaze version, not Rust's.

See [docs/toolchain.md](../../../docs/toolchain.md).

## measure-the-exact-tree (rule 22)

A measurement, bisect or checkpoint names the exact tree it ran on (a content digest of the sources
and the blaze binary's hash) and keeps that tree; never re-sync or rebuild between measuring and
committing. A result you can't tie to a tree is not evidence.

## work-in-ix-vms (rule 34)

Builds, tests, benchmarks and experiments run on the Mac or in an ix VM (`ix new`, `ix shell`, `ix
rm`), never on AWS. Where neither can do it, stop and say what is missing.

See [docs/contributing.md#working-in-parallel](../../../docs/contributing.md#working-in-parallel).

## fan-out-write-only (rule 35)

Fan out code, not builds. Subagents only read and write code, including the tests for it. They never
run a build, check, test, clippy, benchmark or any other expensive step, and never start a daemon or
a VM. The main agent waits until every subagent has finished writing, applies all their changes to
one tree, and then runs it once: `blaze check` and `blaze test` (the central loop), with keep-going.
It hands each failure back to a fresh subagent for the code that broke, with the exact tree, the
command and the error, and runs again. Checks that need a variant tree, such as reverting a fix to
show its test fails (test-the-cause), are also run by the main agent, as patches.

## worktree-per-lane (rule 36)

One uniquely named worktree per lane; its build directory is its own under blaze's root, never in
the checkout, so it needs no `CARGO_TARGET_DIR`; never `git stash`.

## clean-up-lane (rule 39)

When a lane is done, delete its build directory (`blaze clean`), worktree, ix VM and merged branch.

<!-- End of the generated rules. Hand-written notes follow. -->

## How a lane runs

From [docs/contributing.md#working-in-parallel](../../../docs/contributing.md#working-in-parallel):

- Worktree: `git worktree add -b <branch> ../blaze-<lane>-<date> origin/main`. Commit work in
  progress to the lane's branch instead of stashing.
- VM: `ix new --name <lane> --no-shell` (`--cpus`, `--memory`, `--memory-commit` for a build,
  `--arch x86_64|arm64`, `--ttl 8h`); run with `ix shell <lane> -- <command>`; send a checkout with
  `git bundle create - <branch> | ix shell <lane> -- bash -c 'cat > src.bundle && git clone -b <branch> src.bundle src'`.
  The VM has no GitHub or AWS credentials. A benchmark gets its own VM pinned to a host CPU class
  (`--cpu epyc-5`, `xeon-6` or `graviton-5`) with `--memory-commit`.
- The central loop, run once by the main agent on the combined tree: `blaze check` then
  `blaze test`, keep-going (the default), every failure handed back with the tree, command and error.
- Run harnesses with `RUST_BACKTRACE=0`.
- Done: `blaze clean` in the worktree, `git worktree remove <dir>`, `ix rm <lane>`,
  `git branch -D <branch>` once merged.