Skip to content

The design language that makes your AI harness better at design.

JavaScript

Cut dev and test debuginfo, and clean up worktree target dirs (#1150)

Paul Bakaus33003f1013a6
diff --git a/AGENTS.md b/AGENTS.md
index 6cf83df2e..d7a74ab02 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -47,7 +47,7 @@ For Rust, follow the surrounding crate's conventions and workspace formatting co
Tests use Bun's test runner plus Node's built-in `--test`. Name tests `*.test.js` or `*.test.mjs` and place new fixtures near the behavior they cover, usually under `tests/fixtures/`. Prefer targeted test runs while iterating, then finish with `bun run test`. If you change generated outputs or provider transforms, verify both source parsing and at least one affected provider path in `dist/`.
-For runtime changes under `crates/`, add a failing regression in the affected crate, run its focused tests (`cargo test -p <crate> <filter>`), then `bun run test:rust-changed`. The whole `cargo test --workspace` takes about 10 minutes on a 10-core laptop, almost all of it in the Chrome-driven `impeccable-browser` tests (about 5.5 min) and the `impeccable` CLI tests (about 2.3 min), against under 2 minutes to compile the workspace from cold; the script skips the crates a change cannot reach, and selects the whole workspace by itself when `Cargo.toml`, `Cargo.lock` or the toolchain moves. CI's `rust` jobs run the whole workspace on every PR that touches Rust. Run any cargo command that takes more than a minute as a background command and wait for its exit notification; do not poll with `sleep` loops or `pgrep -f` (it matches the polling shell's own command line and never exits). Rebuild with `cargo build --release -p impeccable` and run `IMPECCABLE_BIN="$PWD/target/release/impeccable" bun run test` so the oracle exercises the changed source, not an older downloaded release. Review intended oracle changes by hand; never overwrite goldens just to make a regression pass. `tests/oracle/vectors/calls/` contains frozen function-level vectors and must not be regenerated.
+For runtime changes under `crates/`, add a failing regression in the affected crate, run its focused tests (`cargo test -p <crate> <filter>`), then `bun run test:rust-changed`. The whole `cargo test --workspace` takes about 10 minutes on a 10-core laptop, almost all of it in the Chrome-driven `impeccable-browser` tests (about 5.5 min) and the `impeccable` CLI tests (about 2.3 min), against under 2 minutes to compile the workspace from cold; the script skips the crates a change cannot reach, and selects the whole workspace by itself when `Cargo.toml`, `Cargo.lock` or the toolchain moves. CI's `rust` jobs run the whole workspace on every PR that touches Rust. Run any cargo command that takes more than a minute as a background command and wait for its exit notification; do not poll with `sleep` loops or `pgrep -f` (it matches the polling shell's own command line and never exits). An agent that creates a worktree or its own `CARGO_TARGET_DIR` deletes that target dir when it finishes and `git worktree remove`s the worktree: a stale target dir holds 10 to 25 GB, and 330 of them once filled a 2 TB disk. Rebuild with `cargo build --release -p impeccable` and run `IMPECCABLE_BIN="$PWD/target/release/impeccable" bun run test` so the oracle exercises the changed source, not an older downloaded release. Review intended oracle changes by hand; never overwrite goldens just to make a regression pass. `tests/oracle/vectors/calls/` contains frozen function-level vectors and must not be regenerated.
For changes to the live-mode page JS (`skill/scripts/live-browser*.js`) or an `ENGINE_VERSION` bump, also run `bun run test:live-e2e` (kept out of the default suite because it does real `npm install` per fixture and boots framework dev servers). Scope to one fixture with `IMPECCABLE_E2E_ONLY=<fixture-name>` while iterating; pass `IMPECCABLE_E2E_DEBUG=1` for page-DOM and dev-server-log dumps on failure. Schema and authoring guide for new fixtures live in `tests/framework-fixtures/README.md`.
diff --git a/CLAUDE.md b/CLAUDE.md
index 25baed71e..25a8d1cbc 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -198,7 +198,7 @@ The default suite does not cover everything. When a change touches one of these
| `ENGINE_VERSION` bump | `bun run test:new-work-e2e` | Playwright, offline, no API cost |
| `plugin/`, `skill/agents/`, `scripts/build.js`, plugin manifest validator | `bun run test:plugin-e2e` | ~1 s; already in the default suite, needs the `claude` CLI |
-For verb-level behavior changes in `crates/`, run focused crate tests and `bun run test:rust-changed` (CI runs the whole workspace), then `cargo build --release -p impeccable`. Start long cargo runs as background commands and wait for the exit notification instead of polling with `sleep` or `pgrep`. Run `IMPECCABLE_BIN="$PWD/target/release/impeccable" bun run test` to exercise the changed source rather than an older downloaded release. Add a new oracle case when the contract grows and review golden changes by hand. See `docs/ENGINE.md` for browser-bundle checks and generated assets.
+For verb-level behavior changes in `crates/`, run focused crate tests and `bun run test:rust-changed` (CI runs the whole workspace), then `cargo build --release -p impeccable`. Start long cargo runs as background commands and wait for the exit notification instead of polling with `sleep` or `pgrep`. An agent that creates a worktree or its own `CARGO_TARGET_DIR` deletes that target dir when it finishes and `git worktree remove`s the worktree: a stale target dir holds 10 to 25 GB, and 330 of them once filled a 2 TB disk. Run `IMPECCABLE_BIN="$PWD/target/release/impeccable" bun run test` to exercise the changed source rather than an older downloaded release. Add a new oracle case when the contract grows and review golden changes by hand. See `docs/ENGINE.md` for browser-bundle checks and generated assets.
**Plugin loader E2E** (`tests/plugin-e2e.test.mjs`, in the default suite): installs the committed `./plugin` subtree into a real Claude Code, sandboxed via `CLAUDE_CONFIG_DIR` in a temp dir, and asserts the component inventory from `claude plugin details`: the skill parses, every `plugin/agents/*.md` is visible, hooks are discovered. This is the only check that catches loader-contract surprises the unit guards can't know about (PR #494 shipped an `agents` manifest key that silently loaded zero agents; `claude plugin validate` never flags plugin-manifest problems). Runs in about a second; skips cleanly when the `claude` CLI is not on PATH. The known contract itself (allowed manifest keys, no `agents` key, trailing-slash `skills` path, source agents shipped) is pinned deterministically by `scripts/lib/validate-plugin-manifest.js`, unit-tested in `tests/validate-plugin-manifest.test.js` and enforced as a `bun run build` gate. Never add a key to the generated plugin manifest without verifying it against a real install and extending `KNOWN_LOADER_KEYS`.
diff --git a/Cargo.toml b/Cargo.toml
index 0512ac23f..44b940c49 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,6 +30,14 @@ thiserror = "2"
regex = "1"
once_cell = "1"
+# Dev and test builds keep file:line backtraces and drop the rest of the
+# debuginfo, which is most of a target dir's size. Dependencies carry none.
+[profile.dev]
+debug = "line-tables-only"
+
+[profile.dev.package."*"]
+debug = false
+
[profile.release]
opt-level = 3
lto = "fat"