Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bun run test:backend:coverage # Cargo test + llvm-cov, enforces 100% line covera
bun run test:all # Both Vitest and Cargo test

bun run validate-build # All gates: lint + format + typecheck + build
bun run validate-build:fast # Per-change tier: lint + format + typecheck + debug backend build (no bundle/sign)
```

## Testing
Expand All @@ -41,7 +42,7 @@ Tests use **Vitest** for the frontend (React/TypeScript with React Testing Libra

**100% code coverage is mandatory.** Any new or modified code — frontend or backend — must maintain 100% coverage across lines, functions, branches, and statements. PRs that drop below 100% coverage will not be merged.

**Always run `bun run test:all:coverage` (never the bare `bun run test` / `bun run test:all`).** This single command runs both Vitest with coverage and the cargo llvm-cov gate that CI enforces. If it does not exit cleanly, the task is not done. Functions excluded from coverage with `#[cfg_attr(coverage_nightly, coverage(off))]` must be thin wrappers (Tauri commands, filesystem I/O) whose logic is tested through the functions they delegate to.
**At milestone/PR time, always run `bun run test:all:coverage` (never the bare `bun run test` / `bun run test:all`).** This single command runs both Vitest with coverage and the cargo llvm-cov gate that CI enforces; see "Post-Change Validation" below for the full per-change vs per-milestone cadence. If it does not exit cleanly, the feature is not done. Functions excluded from coverage with `#[cfg_attr(coverage_nightly, coverage(off))]` must be thin wrappers (Tauri commands, filesystem I/O) whose logic is tested through the functions they delegate to.

## Since v0.15

Expand Down Expand Up @@ -166,12 +167,26 @@ Structure:

## Post-Change Validation

After making any code changes and before ending your response, you must:
Validation runs on two tiers: fast checks after every code change, full gates once per feature/PR. This is a change in cadence only, not a lowered bar: CI still runs the full gates on every PR, and the 100% coverage requirement at merge time is unchanged.

1. Run `bun run test:all:coverage` — frontend + backend tests must pass AND 100% coverage gate must hold
2. Run `bun run validate-build` — must complete with **zero warnings and zero errors**
### Per-change (every edit, fast)

Do not consider the task done if either step produces any warnings or errors. Fix all issues first.
After each code change and before ending your response, run the checks scoped to what you touched:

- Backend: `cd src-tauri && cargo test --lib <module>::` for the touched module(s), plus `cargo clippy -- -D warnings` and `cargo fmt --check`
- Frontend: `bunx eslint <touched files>` and `bun run typecheck` (`tsc --noEmit`)
- Or, as a single convenience command covering lint + format + typecheck + a debug backend build: `bun run validate-build:fast`

Do **not** run `test:all:coverage` or `validate-build` at this tier: no llvm-cov, no release build/bundle/sign. Fix anything this tier surfaces before moving on.

### Per-milestone (once per feature, PR, or session end)

Before declaring a FEATURE or PR done, run the full gates once and fix regressions in one batch:

1. `bun run test:all:coverage`, frontend + backend tests must pass AND the 100% coverage gate must hold
2. `bun run validate-build`, must complete with **zero warnings and zero errors**

Do not consider the feature done if either step produces any warnings or errors. This full pass is what "done" means; the per-change tier above only stops you from re-paying its cost on every intermediate edit.

## Superpowers Artifacts

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"test:backend:coverage": "cd src-tauri && cargo +nightly-2026-03-30 llvm-cov --ignore-filename-regex \"(lib|main)\\.rs\" --fail-under-lines 100",
"test:all": "vitest run && cd src-tauri && cargo test",
"test:all:coverage": "vitest run --coverage && cd src-tauri && cargo +nightly-2026-03-30 llvm-cov --ignore-filename-regex \"(lib|main)\\.rs\" --fail-under-lines 100",
"validate-build": "bun run lint && bun run format:check && bun run typecheck && bun run build:all"
"validate-build": "bun run lint && bun run format:check && bun run typecheck && bun run build:all",
"validate-build:fast": "bun run lint && bun run format:check && bun run typecheck && cd src-tauri && cargo build"
},
"dependencies": {
"@fontsource/nunito": "^5.2.7",
Expand Down