forked from 1b-agent/fieldcraft-upstream
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:
2 files changed
+28
-16
No files matched your search
@@ -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 <crate>`). 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 <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
|
||||
`#[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 <branch>`). 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 <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
|
||||
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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user