You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: activate lefthook hooks and add fmt-all, mobile-fmt recipes (#751)
## Summary
- Activate lefthook pre-commit and pre-push hooks that have existed in `lefthook.yml` since the initial desktop app but were never wired up.
- Add `just hooks` recipe: sets `core.hooksPath = .hooks` and runs `lefthook install --force` to generate hook scripts.
- Wire hook installation into `scripts/dev-setup.sh` so hooks activate automatically on `just setup`.
- Enable `parallel: true` for pre-commit hooks (pre-push already had it) — all 5 format/lint checks run simultaneously.
- Add `just mobile-fmt` recipe (`dart format .`) and `just fmt-all` recipe (Rust root + Tauri Rust + Dart) as one-shot formatters.
- `.hooks/` is gitignored since lefthook generates machine-specific scripts.
- Update `AGENTS.md`: document pre-commit/pre-push hooks in Quality Gates, add `just fmt-all` and `just hooks` usage, upgrade worktree fmt gotcha from CI note to commit blocker, add `just mobile-fmt` to mobile commands; also backfill CLI-first updates (`SPROUT_AUTH_TAG`, complete exit codes, `--format compact` flag position, two new gotchas).
All hook commands delegate to `just` recipes as the single source of truth.
`--format compact` is a **global** flag — it goes before the subcommand:
149
+
`sprout --format compact channels list`, NOT `sprout channels list --format compact`.
150
+
151
+
See `crates/sprout-cli/TESTING.md` for the full live-testing runbook.
139
152
140
153
---
141
154
@@ -166,8 +179,10 @@ See [TESTING.md](TESTING.md) for the full multi-agent E2E guide.
166
179
167
180
1.**Kind `39000` for channel metadata, not `41`** — kind 41 is NIP-01 (unused). All kinds defined in `sprout-core/src/kind.rs`.
168
181
2.**Relay queries must specify `kinds`** — omitting `kinds` triggers the p-gate (403). Always include explicit kind filters.
169
-
3.**Worktrees: `cd` in the same command** — shell CWD doesn't persist between tool calls. Use `cd /path && cargo build` as one command.
170
-
4.**Desktop fmt check fails in worktrees** — run `just desktop-tauri-fmt-check` from the main checkout. CI is unaffected.
182
+
3.**`messages search` must include `--kinds`** — an open-ended search (no kinds) hits the relay p-gate and returns 403. Pass at least `--kinds 9,45001,45003` to scope the query.
183
+
4.**Worktrees: `cd` in the same command** — shell CWD doesn't persist between tool calls. Use `cd /path && cargo build` as one command.
184
+
5.**Desktop crate excluded from root workspace** — `cargo test` at repo root does NOT run desktop tests. Use `cargo test --manifest-path desktop/src-tauri/Cargo.toml` explicitly.
185
+
6.**Desktop fmt check fails in worktrees and blocks commits** — the pre-commit hook runs `just desktop-tauri-fmt-check`, which fails in git worktrees because `cargo fmt` resolves workspace paths relative to the worktree root. Run `just desktop-tauri-fmt` from the main checkout to apply the fix, then re-stage and commit. CI is unaffected.
171
186
172
187
---
173
188
@@ -248,7 +263,7 @@ flutter analyze
248
263
flutter test
249
264
```
250
265
251
-
Or from repo root: `just mobile-check`and `just mobile-test`.
266
+
Or from repo root: `just mobile-fmt` (auto-fix), `just mobile-check`(lint + fmt check), `just mobile-test` (tests).
252
267
253
268
### Testing Conventions
254
269
@@ -263,7 +278,7 @@ Or from repo root: `just mobile-check` and `just mobile-test`.
263
278
264
279
## See Also
265
280
266
-
-[CONTRIBUTING.md](CONTRIBUTING.md) — setup, code style, PR process, how to add event kinds / MCP tools / API endpoints
281
+
-[CONTRIBUTING.md](CONTRIBUTING.md) — setup, code style, PR process, how to add event kinds / CLI subcommands / API endpoints
267
282
-[TESTING.md](TESTING.md) — multi-agent E2E test guide
268
283
-[ARCHITECTURE.md](ARCHITECTURE.md) — system design and component relationships
269
284
-[README.md](README.md) — project overview and quick start
0 commit comments