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
- Dev deps: `tempfile`, `assert_cmd`, `predicates`, `wiremock`, `insta`, `proptest`
151
+
- Dev deps: `tempfile`, `assert_cmd`, `predicates`, `wiremock`, `insta`, `proptest`, `toml`
126
152
127
153
### REUSE / SPDX Headers
128
154
@@ -134,7 +160,7 @@ src/
134
160
### Running Tests
135
161
136
162
```bash
137
-
cargo test# All tests (133 tests)
163
+
cargo test# All tests (169 tests)
138
164
cargo test --test sanitizer # CommitSanitizer tests
139
165
cargo test --test safety # Safety module tests
140
166
cargo test --test context # ContextBuilder tests
@@ -145,6 +171,15 @@ cargo test -- --nocapture # Show println output
145
171
146
172
**Important:**`cargo test sanitizer` matches test *names* across all binaries. Use `cargo test --test <name>` to select a specific integration test file.
147
173
174
+
### Test Conventions
175
+
176
+
- Async tests: `#[tokio::test]` (not `#[test]` with `.block_on()`)
177
+
- Snapshots: after changing output, run `cargo insta review` to accept/reject
178
+
- Snapshot env: `UPDATE_EXPECT=1 cargo test` for bulk snapshot update
179
+
- Wiremock: NDJSON streaming mocks use `respond_with(ResponseTemplate::new(200).set_body_raw(...))` with `\n`-delimited JSON
180
+
- Git fixtures: `tempfile::TempDir` + `git init` via `std::process::Command`, not real repos
181
+
- Proptest: `PROPTEST_CASES=1000` for thorough local runs before push
182
+
148
183
### Building
149
184
150
185
```bash
@@ -181,6 +216,15 @@ git add some-file.rs
181
216
./target/release/commitbee --yes
182
217
```
183
218
219
+
### Dependency Management
220
+
221
+
When adding or updating crates:
222
+
1. Verify latest stable version via `cargo search <crate> --limit 1` before adding to `Cargo.toml`
223
+
2. If a pre-release version is detected or would be added: **STOP and ask the user** — report the pre-release version found, the latest stable version (if any exists), and whether no stable release is available yet. Do not add a pre-release version without explicit user approval.
224
+
3. Prefer `x.y` (minor-compatible) over `=x.y.z` (exact pin) unless a bug requires it
225
+
4. Run `cargo audit` before and after adding new dependencies
226
+
5. Use `cargo-dep-auditor` agent for full pre-release dependency review
227
+
184
228
### Gotchas
185
229
186
230
-`gix` API: use `repo.workdir()` not `repo.work_dir()` (deprecated)
- Secret pattern `sk-[a-zA-Z0-9]{48}` requires exactly 48 chars after `sk-` in test data
191
235
-`tokio::process::Command` output needs explicit `std::process::Output` type annotation when using `.ok()?`
192
-
- Tree-sitter is CPU-bound/sync — pre-fetch file content into HashMaps async, then pass as sync closures
236
+
- Tree-sitter is CPU-bound/sync — pre-fetch file content into HashMaps async, then pass `&HashMap<PathBuf, String>` to `extract_symbols()` which uses rayon for parallel parsing
237
+
-`rayon::par_iter()` requires data to be `Sync`; `tree_sitter::Parser` is neither `Send` nor `Sync` — create a new `Parser` per file inside the rayon closure
193
238
-`#[cfg(feature = "secure-storage")]` gates both the error variant and CLI commands for keyring
194
239
195
240
### Known Issues
@@ -199,14 +244,5 @@ git add some-file.rs
199
244
200
245
### Post-Implementation Documentation TODOs
201
246
202
-
After `PLAN_CONVENTIONAL_COMMITS_SPEC` is implemented, update:
203
-
204
-
-**PRD.md PE-001**: Change "Includes 2-3 few-shot examples" → the new system prompt uses a schema template (no shot examples). Update the PE-001 description accordingly.
205
-
-**PRD.md Phase 2 roadmap**: Add "Conventional Commits 1.0.0 spec anchoring (`!` suffix, `BREAKING CHANGE:` footer, spec-compliant type list sync)" to the v0.3.0 feature list.
206
247
-**README.md roadmap**: Pre-existing version mismatch — README shows v0.3.0 as "Polish & Providers ✅ Complete" but PRD says v0.2.0 shipped both Phase 1 and Phase 2, and v0.3.0 is the upcoming Differentiation release. Reconcile before the v0.3.0 release.
0 commit comments