Skip to content

Commit 6037797

Browse files
committed
docs(prd): bump to v4.1 for AST context overhaul
1 parent 0a6d996 commit 6037797

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

PRD.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
66

77
# CommitBee — Product Requirements Document
88

9-
**Version**: 4.0
10-
**Date**: 2026-03-13
9+
**Version**: 4.1
10+
**Date**: 2026-03-22
1111
**Status**: Active
1212
**Author**: [Sephyi](https://github.com/Sephyi) + [Claude Opus 4.6](https://www.anthropic.com/news/claude-opus-4-6)
1313

1414
## Changelog
1515

1616
<details>
17-
<summary>Revision history (v3.3 → v4.0)</summary>
17+
<summary>Revision history (v3.3 → v4.1)</summary>
1818

1919
| Version | Date | Summary |
2020
|---------|------------|---------|
21+
| 4.1 | 2026-03-22 | AST context overhaul (v0.5.0): full signature extraction from tree-sitter nodes, semantic change classification (whitespace vs body vs signature), old→new signature diffs, cross-file connection detection, formatting auto-detection via symbols. 334 tests. |
2122
| 4.0 | 2026-03-13 | PRD normalization: aligned phases with shipped versions (v0.2.0/v0.3.x/v0.4.0), collapsed revision history, unified status markers, resolved stale critical issues, canonicalized test count to 308, removed dead cross-references. FR-031 (Exclude Files) and FR-033 (Copy to Clipboard) shipped. |
2223
| 3.3 | 2026-03-13 | v0.4.0 full feature completion — FR-030 (Custom Prompt Templates), FR-032 (Multi-Language), FR-036 (Tree-sitter Query Patterns), FR-057 (Additional Languages), FR-058 (History Learning), TR-006 (Eval Harness), TR-007 (Fuzzing). 308 tests. |
2324
| 3.2 | 2026-03-13 | FR-035 (Rename Detection), FR-037 (Expanded Secret Scanning), FR-038 (Progress Indicators). 202 tests. |
@@ -90,7 +91,7 @@ CommitBee is a Rust-native CLI tool that uses tree-sitter semantic analysis and
9091
| Multiple message generation (pick from N) | Common (aicommits, aicommit2) | ✅ v0.2.0 |
9192
| Commit splitting (multi-concern detection) | No competitor has this | ✅ v0.2.0 |
9293
| Custom prompt/instruction files | Growing (Copilot, aicommit2) | ✅ v0.4.0 |
93-
| Unit/integration tests | Non-negotiable for quality |308 tests |
94+
| Unit/integration tests | Non-negotiable for quality |334 tests |
9495

9596
## 3. Architecture
9697

@@ -149,7 +150,7 @@ commitbee
149150
│ ├── app.rs # Orchestrator (decomposed into small methods)
150151
│ ├── domain/
151152
│ │ ├── change.rs # FileChange, StagedChanges
152-
│ │ ├── symbol.rs # CodeSymbol, SymbolKind
153+
│ │ ├── symbol.rs # CodeSymbol, SymbolKind, SymbolChangeType
153154
│ │ ├── context.rs # PromptContext (includes symbols in prompt)
154155
│ │ └── commit.rs # CommitType (single source of truth for types)
155156
│ ├── queries/ # Tree-sitter .scm query files per language
@@ -451,7 +452,21 @@ Config: `learn_from_history` (default `false`), `history_sample_size` (default 5
451452

452453
`--clipboard` flag copies generated message to system clipboard and prints to stdout. Skips commit confirmation prompt. Uses platform-specific commands: `pbcopy` (macOS), `clip` (Windows), `xclip -selection clipboard` (Linux). Descriptive error if clipboard command unavailable. 3 CLI parsing tests.
453454

454-
### 4.5 Future — v0.5.0+ (Market Leadership)
455+
### 4.5 Shipped — v0.5.0 (AST Context Overhaul)
456+
457+
#### FR-059: Full Signature Extraction ✅
458+
459+
Tree-sitter AST nodes now yield complete function/struct/trait signatures (e.g., `pub fn connect(host: &str, timeout: Duration) -> Result<Connection>`) instead of bare names. Two-strategy body detection: `child_by_field_name("body")` primary, `BODY_NODE_KINDS` constant fallback (12 node kinds across 10 languages), first-line final fallback. Multi-line signatures collapsed to single line, capped at 200 chars with UTF-8-safe truncation (`floor_char_boundary`). Token budget rebalanced to 30/70 symbol/diff when signatures present. 7 unit tests + 6 per-language integration tests.
460+
461+
#### FR-060: Semantic Change Classification ✅
462+
463+
Modified symbols (same name+kind+file in both HEAD and staged) are classified as whitespace-only or semantic via character-stream comparison of non-whitespace content within symbol spans. Dual old-file/new-file line tracking for correct span attribution. Old → new signature diffs displayed in prompt (`[~] old_sig → new_sig`). Whitespace-only symbols filtered from modified display. Formatting-only changes auto-detected as `CommitType::Style` when all modified symbols are whitespace-only. `build()` restructured to classify before `infer_commit_type`. 3 tests.
464+
465+
#### FR-061: Cross-File Connection Detection ✅
466+
467+
Scans added diff lines for `symbol_name(` call patterns referencing symbols defined in other changed files. Connections displayed in new `CONNECTIONS:` prompt section (e.g., `validator calls parse() — both changed`). Capped at 5 connections to prevent prompt bloat. SYSTEM_PROMPT updated with connection-aware guidance. 1 test + 1 splitter integration test.
468+
469+
### 4.6 Future — v0.6.0+ (Market Leadership)
455470

456471
#### FR-050: MCP Server Mode
457472

@@ -791,7 +806,8 @@ Invalid JSON → retry once with repair prompt. Second failure → heuristic ext
791806
| 2 | v0.3.x | ✅ Shipped | Differentiation — heuristics, validation, spec compliance |
792807
| 3 | v0.4.0 | ✅ Shipped | Feature completion — templates, languages, rename, history, eval, fuzzing |
793808
| 4 | v0.4.x | ✅ Shipped | Remaining polish — exclude files (FR-031), clipboard (FR-033) |
794-
| 5 | v0.5.0+ | 📋 Planned | Market leadership — MCP server, changelog, monorepo, version bumping, GitHub Action |
809+
| 5 | v0.5.0 | ✅ Shipped | AST context overhaul — full signatures, semantic change classification, cross-file connections. 334 tests. |
810+
| 6 | v0.6.0+ | 📋 Planned | Market leadership — MCP server, changelog, monorepo, version bumping, GitHub Action |
795811

796812
## 12. Success Metrics
797813

0 commit comments

Comments
 (0)