diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 016e5dd3..5be0da4f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -26,6 +26,16 @@ and chose not to fix here belongs in this section too. What you added or changed. For a fix: revert the fix, keep the test, and say whether it goes red. A test that passes either way isn't testing the fix. +If the test matches source text rather than running the code, say what the +anchor is. Pinning a contract the compiler can't check — a Tauri command name, +an i18n key, a second copy of a fixed behaviour — is what those are for. +Pinning an internal call site pins today's spelling instead, so it goes red on +a rename that broke nothing and stays green on a change that broke something. + +Not every fix needs one. A defect that announces itself — a crash, a type +error, something the next person to open the app would see — is already caught +by `npm run check`, `cargo test` and a single manual run. + ## Verification The commands you ran and what they said — the ones CI runs are: diff --git a/AGENTS.md b/AGENTS.md index 17b0f39b..909c7234 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -155,7 +155,12 @@ All file operations go through Rust commands - never use Node.js fs APIs. ## Testing - **Rust**: `cargo test` in `src-tauri/` directory -- **Frontend**: `npm test` runs the behavior tests in `scripts/*.test.ts` (`node --test --import tsx`) +- **Frontend**: `npm test` runs `scripts/*.test.ts` (`node --test --import tsx`). Two kinds + live there: behavior tests, which import and run the real modules, and source-shape + assertions, which match the source text for a contract the compiler cannot check — a Tauri + command name, an i18n key, a second copy of a fixed behavior. A green run is not a claim + that every behavior is covered; a source-shape assertion passes as long as the line it + matches is still spelled that way. - **CI**: Runs `npm audit`, `npm run check`, `npm test` and `cargo test` on PRs ## Notes