Skip to content

Commit 40183cc

Browse files
committed
docs: add AST overhaul architecture notes and gotchas to CLAUDE.md
1 parent a45b1b7 commit 40183cc

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ cargo build --release
3434
7. **Simplified user prompt** - Concise format optimized for <4B parameter models
3535
8. **Commit splitting** - Detects multi-concern changes, suggests splitting into separate commits
3636
9. **Body line wrapping** - Sanitizer wraps body text at 72 characters
37+
10. **Signature extraction** - Two-strategy: `child_by_field_name("body")` primary, `BODY_NODE_KINDS` fallback, first-line final fallback. 200-char cap with `floor_char_boundary`. No `.scm` query changes needed.
38+
11. **Semantic change classification** - Modified symbols classified via character-stream comparison (not bag-of-lines). `build()` restructured: classify → infer_commit_type → format.
39+
12. **Cross-file connections** - `detect_connections` scans added diff lines for `sym_name(` patterns. Min 4-char name filter, capped at 5, sort+dedup.
3740

3841
## Commands
3942

@@ -118,7 +121,7 @@ src/
118121
│ ├── mod.rs
119122
│ ├── change.rs # FileChange, StagedChanges, ChangeStatus
120123
│ ├── symbol.rs # CodeSymbol, SymbolKind, SymbolChangeType
121-
│ ├── context.rs # PromptContext
124+
│ ├── context.rs # PromptContext (includes connections, evidence flags)
122125
│ └── commit.rs # CommitType
123126
└── services/
124127
├── mod.rs
@@ -243,6 +246,9 @@ git add some-file.rs
243246

244247
# Auto-commit
245248
./target/release/commitbee --yes
249+
250+
# Test commit message generation with debug logging (shows validation retries)
251+
COMMITBEE_LOG=debug ./target/release/commitbee --dry-run
246252
```
247253

248254
### Dependency Management
@@ -288,6 +294,10 @@ Common mistake: calling a new safeguard/check `fix` — if there was no bug, it'
288294
- 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
289295
- `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
290296
- `#[cfg(feature = "secure-storage")]` gates both the error variant and CLI commands for keyring
297+
- Subagents dispatched without Bash permission can't commit — commit in the main session after verifying their changes
298+
- Parallel subagents touching the same file will conflict — only parallelize when files don't overlap
299+
- `SymbolKey` uses `(kind, name, file)` — do NOT add `line` (lines shift between HEAD/staged, breaks modified-symbol matching)
300+
- `classify_span_change` uses new-file line range — old-file lines may differ when code shifts; known limitation (deferred #9)
291301

292302
### Known Issues
293303

0 commit comments

Comments
 (0)