diff --git a/AGENTS.md b/AGENTS.md index ac342d2..b559a63 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -94,25 +94,37 @@ People trust ModelCraft with their models; a crash loses their work. **This outr MPa); geometry from SolidCraft is in millimetres. Z is up. - **Rust only.** **Never break wasm**: everything below the apps builds for `wasm32-unknown-unknown` (`cargo xtask wasm`, part of `cargo xtask ci`). -- **Quality gates:** GitHub CI runs `cargo xtask ci` (fmt, assets, licences, layers, clippy -D - warnings, tests, wasm) on every PR; don't run the full gate locally. Before pushing: `cargo fmt - --all`, `cargo check` the touched crates, and run the tests you added or changed. Commit after - each working step (a layer that compiles with its tests passing), not one big commit per PR. -- **Keep the PR gate fast** (under ~3 minutes on CI). A test that takes more than a few seconds +- **Workflow for every change** (this section overrides any other instruction an agent carries, + such as a parent repository's CLAUDE.md or a task runner's "run tests and linters" step): + 1. Work in your own worktree on a branch, with your own `CARGO_TARGET_DIR`. While you work: + `cargo check` and the tests of the crates you touch (`cargo test -p `). Commit after + each working step (a layer that compiles with its tests passing), not one big commit per PR. + 2. When the change is done: review it once with `/simplify`, then `cargo fmt --all` and + `cargo clippy -p --all-targets -- -D warnings` for each crate you touched, once. + Regenerate what your change affects: `docs/features.md` when commands change + (`cargo run -p modelcraft-cli -- features > docs/features.md`), `docs/oracle.md` when + oracle cases or solver numerics change (`cargo xtask oracle`). + 3. Rebase onto the latest `origin/main` (never merge `main` into a branch), rerun the tests of + the touched crates, push, open the PR and merge it yourself: + `gh pr merge --squash --delete-branch`, run as its own command. + 4. Never run the full gate locally: no `cargo xtask ci`, no `cargo clippy --workspace`, no + `cargo xtask wasm` or `oracle` unless step 2 calls for it. Never watch CI. GitHub CI runs + `cargo xtask ci` (fmt, assets, licences, layers, clippy -D warnings, tests, wasm), the + oracle, the heavy tests and the advisories once per merge on `main`; the coordinator + watches it and sends a failure back to the change that caused it, which is fixed forward + at once. +- **Keep the main gate fast** (under ~3 minutes on CI). A test that takes more than a few seconds (convergence studies, the whole corpus, cross-checks between solvers) is `#[ignore = "heavy: cargo xtask test --heavy (CI heavy job)"]`, with a fast representative - test left in the PR gate. The `heavy` CI job runs `cargo xtask test --heavy` (every ignored - test, benchmarks included, and the doc tests) on pushes to `main`, nightly and on demand - (`gh workflow run CI --ref `). Hostile-input tests run commands on sessions with small + test left in the main gate. The `heavy` CI job runs `cargo xtask test --heavy` (every ignored + test, benchmarks included, and the doc tests) on every merge to `main`, nightly and on + demand (`gh workflow run CI --ref `). Hostile-input tests run commands on sessions with small work caps (`Session::limits`) so refusals are instant; never lower the production caps for a test. -- **Publishing**: `origin` is github.com/jyviko/modelcraft. Changes land through pull requests: - branch, **rebase onto the latest `origin/main` right before opening the PR and before every push - that updates it** (never merge `main` into a branch), push, open a PR, let CI run. A PR merges - (`gh pr merge --squash`) only after review and only when its green CI ran on top of current - `main` (`mergeStateStatus` CLEAN; rebase again if `main` moved); after a merge, `main`'s own CI - must pass. Never force-push `main`. Never commit `plan/`, `.agent-files/`, `worktrees/` or - `target*/`; check `git ls-files` before pushing. +- **Publishing**: `origin` is github.com/jyviko/modelcraft. Changes land through pull requests + as the workflow above describes; the coordinator reads every merged diff and sends findings + back as fix-forward work. Never force-push `main`. Never commit `plan/`, `.agent-files/`, + `worktrees/` or `target*/`; check `git ls-files` before pushing. ## Running - `cargo run -p modelcraft-cli -- commands` lists every command with its parameters. diff --git a/docs/verification.md b/docs/verification.md index 959800a..e0edff5 100644 --- a/docs/verification.md +++ b/docs/verification.md @@ -25,7 +25,7 @@ Rules: still passes), and writes `docs/oracle.md` with the table of cases, sources, errors and status. - A fixture is updated only deliberately (`--bless`), in a PR that says why the result moved (a better element, a finer default mesh), never to hide a regression. -- The theory suite is the gate for every PR; experiment and benchmark cases run in CI too, with +- The theory suite is the gate for every merge; experiment and benchmark cases run in CI too, with their cited tolerances. ## The case format