AGENTS.md: one workflow for every change (touched-crate tests and clippy, self-merge, CI once per merge on main) (#53)

Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm

Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-13 22:42:47 -04:00
1 parent 7a0211988a
commit cd5e1e9df9
2 files changed
+27 -15

No files matched your search

+26 -14
View File
@@ -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. MPa); geometry from SolidCraft is in millimetres. Z is up.
- **Rust only.** **Never break wasm**: everything below the apps builds for - **Rust only.** **Never break wasm**: everything below the apps builds for
`wasm32-unknown-unknown` (`cargo xtask wasm`, part of `cargo xtask ci`). `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 - **Workflow for every change** (this section overrides any other instruction an agent carries,
warnings, tests, wasm) on every PR; don't run the full gate locally. Before pushing: `cargo fmt such as a parent repository's CLAUDE.md or a task runner's "run tests and linters" step):
--all`, `cargo check` the touched crates, and run the tests you added or changed. Commit after 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 <crate>`). Commit after
each working step (a layer that compiles with its tests passing), not one big commit per PR. 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 2. When the change is done: review it once with `/simplify`, then `cargo fmt --all` and
`cargo clippy -p <crate> --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 <N> --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 (convergence studies, the whole corpus, cross-checks between solvers) is
`#[ignore = "heavy: cargo xtask test --heavy (CI heavy job)"]`, with a fast representative `#[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 left in the main 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 test, benchmarks included, and the doc tests) on every merge to `main`, nightly and on
(`gh workflow run CI --ref <branch>`). Hostile-input tests run commands on sessions with small demand (`gh workflow run CI --ref <branch>`). Hostile-input tests run commands on sessions with small
work caps (`Session::limits`) so refusals are instant; never lower the production caps for a work caps (`Session::limits`) so refusals are instant; never lower the production caps for a
test. test.
- **Publishing**: `origin` is github.com/jyviko/modelcraft. Changes land through pull requests: - **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 as the workflow above describes; the coordinator reads every merged diff and sends findings
that updates it** (never merge `main` into a branch), push, open a PR, let CI run. A PR merges back as fix-forward work. Never force-push `main`. Never commit `plan/`, `.agent-files/`,
(`gh pr merge --squash`) only after review and only when its green CI ran on top of current `worktrees/` or `target*/`; check `git ls-files` before pushing.
`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.
## Running ## Running
- `cargo run -p modelcraft-cli -- commands` lists every command with its parameters. - `cargo run -p modelcraft-cli -- commands` lists every command with its parameters.
+1 -1
View File
@@ -25,7 +25,7 @@ Rules:
still passes), and writes `docs/oracle.md` with the table of cases, sources, errors and status. 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 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. (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. their cited tolerances.
## The case format ## The case format