Skip to content

Commit f6e92cf

Browse files
committed
docs: extract changelog to CHANGELOG.md and document v0.5.0 features
Move version history from README.md to dedicated CHANGELOG.md. Add v0.5.0 entry covering signature extraction, semantic change classification, cross-file connections, and formatting detection. Update README, DOCS, PRD with AST overhaul feature descriptions and test count (340).
1 parent a8b8dba commit f6e92cf

5 files changed

Lines changed: 88 additions & 63 deletions

File tree

CHANGELOG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2026 Sephyi <me@sephy.io>
3+
4+
SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
5+
-->
6+
7+
# Changelog
8+
9+
All notable changes to CommitBee are documented here.
10+
11+
## `v0.5.0` — Understand Everything (current)
12+
13+
- **Full signature extraction** — The LLM sees `pub fn connect(host: &str, timeout: Duration) -> Result<Connection>`, not just "Function connect." Extracted from tree-sitter AST nodes using a two-strategy approach: `child_by_field_name("body")` primary, body-node-kind scan fallback. Works across all 10 languages.
14+
- **Signature diffs for modified symbols** — When a function signature changes, the prompt shows `[~] old_sig → new_sig` so the LLM understands exactly what was modified.
15+
- **Cross-file connection detection** — Detects when a changed file calls a symbol defined in another changed file. Shown as `CONNECTIONS: validator calls parse() — both changed` in the prompt.
16+
- **Semantic change classification** — Modified symbols are classified as whitespace-only or semantic via character-stream comparison. Formatting-only changes (cargo fmt, prettier) auto-detected as `style` type when all modified symbols are whitespace-only.
17+
- **Dual old/new line tracking**`classify_span_change` correctly tracks old-file and new-file line numbers independently, handling cases where symbols shift positions due to added/removed lines above them.
18+
- **Token budget rebalance** — Symbol section gets 30% of budget (up from 20%) when signatures are present, since richer symbols reduce the LLM's dependency on raw diff.
19+
- **BODY_NODE_KINDS coverage** — Signature extraction verified across all 10 languages with dedicated tests for Java, C, C++, Ruby, and C#.
20+
- **Connection reliability** — Short symbol names (<4 chars) filtered to prevent false positives, short-circuit after 5 connections, sort+dedup for correctness.
21+
- **Fixed false positive in breaking change detection** — Modified public symbols were incorrectly counted as "removed APIs", causing spurious `breaking_change` validator violations and retry exhaustion.
22+
23+
## `v0.4.0` — See Everything
24+
25+
- **10-language tree-sitter support** — Added Java, C, C++, Ruby, and C# to the existing Rust, TypeScript, JavaScript, Python, and Go. All languages are individually feature-gated and enabled by default. Disable any with `--no-default-features` + selective `--features lang-rust,lang-go,...`.
26+
- **Custom prompt templates** — User-defined templates with `{{diff}}`, `{{symbols}}`, `{{files}}`, `{{type}}`, `{{scope}}` variables via `template_path` config.
27+
- **Multi-language commit messages** — Generate messages in any language with `--locale` flag or `locale` config (e.g., `--locale de` for German).
28+
- **Commit history style learning** — Learns from recent commit history to match your project's style (`learn_from_history`, `history_sample_size` config).
29+
- **Rename detection** — Detects file renames with similarity percentage via `git diff --find-renames`, displayed as `old → new (N% similar)` in prompts and split suggestions. Configurable threshold (default 70%, set to 0 to disable).
30+
- **Expanded secret scanning** — 25 built-in patterns across 13 categories (cloud providers, AI/ML, source control, communication, payment, database, cryptographic, generic). Pluggable engine: add custom regex patterns or disable built-ins by name via config.
31+
- **Progress indicators** — Contextual `indicatif` spinners during pipeline phases (analyzing, scanning, generating). Auto-suppressed in non-TTY environments (git hooks, pipes).
32+
- **Evaluation harness**`cargo test --features eval` for structured LLM output quality benchmarking.
33+
- **Fuzz testing**`cargo-fuzz` targets for sanitizer and diff parser robustness.
34+
- **Exclude files**`--exclude <GLOB>` flag (repeatable) and `exclude_patterns` config option. Glob patterns filter files from analysis (e.g., `*.lock`, `**/*.generated.*`, `vendor/**`). CLI patterns additive with config.
35+
- **Copy to clipboard**`--clipboard` flag copies the generated message to the system clipboard and prints to stdout, skipping commit confirmation.
36+
37+
## `v0.3.1` — Trust, but Verify
38+
39+
- **Multi-pass corrective retry** — Validator checks LLM output against 7 rules and retries up to 3 times with targeted correction instructions
40+
- **Subject length enforcement** — Rejects subjects exceeding 72-char first line with a clear error instead of silent truncation
41+
- **Stronger prompt budget** — Character limit embedded directly in JSON template, "HARD LIMIT" phrasing for better small-model compliance
42+
- **Default model: `qwen3.5:4b`** — Smaller (3.4GB), no thinking overhead, clean JSON output out of the box
43+
- **Configurable thinking mode**`think` config option for Ollama models that support reasoning separation
44+
45+
## `v0.3.0` — Read Between the Lines
46+
47+
- **Diff-shape fingerprinting + Jaccard clustering** — Splitter groups files by change shape and content vocabulary, not just directory
48+
- **Evidence-based type inference** — Constraint rules from code analysis drive commit type selection (bug evidence → fix, mechanical → style, dependency-only → chore)
49+
- **Robust LLM output parsing** — Sanitizer handles `<think>`/`<thought>` blocks, conversational preambles, noisy JSON extraction
50+
- **Metadata-aware breaking change detection** — Detects MSRV bumps, engines.node, requires-python changes
51+
- **Symbol tri-state tracking** — Added/removed/modified-signature differentiation in tree-sitter analysis
52+
- **Primary change detection** — Identifies the single most significant change for subject anchoring
53+
- **Post-generation validation** — Subject specificity validator ensures concrete entity naming
54+
- **NUL-delimited git parsing** — Safe handling of paths with special characters
55+
- **Parallel tree-sitter parsing** — rayon for CPU-bound parsing, tokio JoinSet for concurrent git fetching
56+
- **Anti-hallucination prompt engineering** — EVIDENCE/CONSTRAINTS sections, negative examples, anti-copy rules
57+
58+
## `v0.2.0` — Commit, Don't Think
59+
60+
- **Cloud providers** — OpenAI-compatible and Anthropic streaming support
61+
- **Commit splitting** — Automatic detection and splitting of multi-concern staged changes
62+
- **Git hook integration**`commitbee hook install/uninstall/status`
63+
- **Shell completions** — bash, zsh, fish, powershell via `clap_complete`
64+
- **Rich error diagnostics**`miette` for actionable error messages
65+
- **Multiple message generation**`--generate N` with interactive candidate selection
66+
- **Hierarchical config**`figment`-based layering (CLI > Env > File > Defaults)
67+
- **Structured logging**`tracing` with `COMMITBEE_LOG` env filter
68+
- **Doctor command**`commitbee doctor` for connectivity and config checks
69+
- **Secure key storage** — OS keychain via `keyring` (optional feature)
70+
- **Body line wrapping** — Commit body text wrapped at 72 characters

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ src/
192192
### Running Tests
193193

194194
```bash
195-
cargo test # All tests (339 tests)
195+
cargo test # All tests (340 tests)
196196
cargo test --test sanitizer # CommitSanitizer tests
197197
cargo test --test safety # Safety module tests
198198
cargo test --test context # ContextBuilder tests

DOCS.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ Here's what each step actually does:
8686

8787
**1. Git Service** reads your staged changes using `gix` for repo discovery and the git CLI for diffs. Paths are parsed with NUL-delimited output (`-z` flag) so filenames with spaces or special characters work correctly.
8888

89-
**2. Tree-sitter Analyzer** parses both the staged version and the HEAD version of every changed file — in parallel, using `rayon` across CPU cores. It maps diff hunks to symbol spans, so instead of just knowing "lines 42-58 changed", CommitBee knows "the `validate()` function in `sanitizer.rs` was modified". Symbols are tracked in three states: added, removed, or modified-signature.
89+
**2. Tree-sitter Analyzer** parses both the staged version and the HEAD version of every changed file — in parallel, using `rayon` across CPU cores. It extracts **full signatures** (e.g., `pub fn connect(host: &str, timeout: Duration) -> Result<Connection>`) by taking the definition node text before the body child. Modified symbols show old → new signature diffs. Cross-file connections are detected (caller+callee both changed). Symbols are tracked in three states: added, removed, or modified-signature.
9090

9191
**3. Commit Splitter** looks at your staged changes and decides whether they contain logically independent work. It uses diff-shape fingerprinting (what kind of changes — additions, deletions, modifications) combined with Jaccard similarity on content vocabulary to group files. If it finds multiple concerns, it offers to split them into separate commits.
9292

93-
**4. Context Builder** assembles a budget-aware prompt. It computes evidence flags from the code analysis (is this a mechanical change? are public APIs removed? is there bug-fix evidence?), calculates the character budget for the subject line, and packs as much useful context as possible within the token limit (~6K tokens by default).
93+
**4. Context Builder** assembles a budget-aware prompt. It classifies modified symbols as whitespace-only or semantic (via character-stream comparison), computes evidence flags (mechanical change? public APIs removed? bug-fix evidence?), detects cross-file connections, calculates the character budget for the subject line, and packs context within the token limit (~6K tokens, 30/70 symbol/diff split when signatures present).
9494

9595
**5. LLM Provider** streams the prompt to your chosen model (Ollama, OpenAI, or Anthropic) and collects the response token by token.
9696

@@ -105,7 +105,9 @@ CommitBee doesn't just send a diff. The prompt includes:
105105
- **File summary** with per-file line counts (`+additions -deletions`)
106106
- **Suggested commit type** inferred from code analysis (not guessed)
107107
- **Evidence flags** telling the LLM deterministic facts about the change
108-
- **Symbol changes** — which functions, structs, and methods were added, removed, or modified
108+
- **Symbol changes with full signatures**`[+] pub fn connect(host: &str) -> Result<()>`, not just "Function connect"
109+
- **Signature diffs**`[~] old_sig → new_sig` for modified symbols
110+
- **Cross-file connections**`validator calls parse() — both changed`
109111
- **Primary change detection** — which file has the most significant changes
110112
- **Constraints** — rules the LLM must follow based on evidence (e.g., "no bug-fix comments found, prefer refactor over fix")
111113
- **Character budget** — exact number of chars available for the subject line
@@ -692,7 +694,7 @@ No panics in user-facing code paths. The sanitizer and validator are tested with
692694

693695
### Testing Strategy
694696

695-
CommitBee has 334 tests across multiple strategies:
697+
CommitBee has 340 tests across multiple strategies:
696698

697699
| Strategy | What It Covers |
698700
| --- | --- |
@@ -705,7 +707,7 @@ CommitBee has 334 tests across multiple strategies:
705707
Run them:
706708

707709
```bash
708-
cargo test # All 334 tests
710+
cargo test # All 340 tests
709711
cargo test --test sanitizer # Just sanitizer tests
710712
cargo test --test integration # LLM provider mocks
711713
COMMITBEE_LOG=debug cargo test -- --nocapture # With logging

PRD.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
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. |
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. 340 tests. |
2222
| 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. |
2323
| 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. |
2424
| 3.2 | 2026-03-13 | FR-035 (Rename Detection), FR-037 (Expanded Secret Scanning), FR-038 (Progress Indicators). 202 tests. |
@@ -91,7 +91,7 @@ CommitBee is a Rust-native CLI tool that uses tree-sitter semantic analysis and
9191
| Multiple message generation (pick from N) | Common (aicommits, aicommit2) | ✅ v0.2.0 |
9292
| Commit splitting (multi-concern detection) | No competitor has this | ✅ v0.2.0 |
9393
| Custom prompt/instruction files | Growing (Copilot, aicommit2) | ✅ v0.4.0 |
94-
| Unit/integration tests | Non-negotiable for quality |334 tests |
94+
| Unit/integration tests | Non-negotiable for quality |340 tests |
9595

9696
## 3. Architecture
9797

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

812812
## 12. Success Metrics

0 commit comments

Comments
 (0)