fix: improve commit message reliability#36
Merged
Conversation
…on and noisy version bumps Two root-cause fixes addressing issues found in real-world usage (see rust-osdev/acpi#306 for concrete examples of failing output): 1. Literal model-free path for small diffs (<=20 lines, <=2 files): Bypass the LLM entirely for tiny changes. The new literal_report() function generates commit messages directly from diff structure: counts additions/deletions, extracts symbol declarations from +/- lines, detects renames, and classifies as feat/refactor/fix/docs/test. Zero inference cost, zero hallucination risk. 2. Version bumps only when manifest is explicitly changed: Previously, touching any source file in a crate would trigger a version bump suggestion. Changed should_evaluate to require the manifest file itself (Cargo.toml, package.json, etc.) to be in the diff. This stops noisy version bump suggestions on every intermediate commit within PRs. Additional improvements: - Prompt rules explicitly ban style: for any change touching executable code - Analyze prompt warns when a chunk is <15 lines to discourage intent inference - Boilerplate risk notes ("no security risks", "no data loss") are filtered from commit output; risk section omitted entirely when level is low - --no-bump flag added as an explicit opt-out for version suggestions
SnowCheetos
force-pushed
the
fix/commit-message-reliability
branch
from
June 29, 2026 04:46
81b5cd4 to
869033d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves commit message reliability by introducing a model-free “literal” reporting path for very small diffs and by reducing noisy version bump recommendations unless a manifest file actually changes.
Changes:
- Add
literal_report()(and helpers) to synthesize commit metadata directly from diff structure for small diffs, bypassing the LLM. - Route DraftOnly + very small diffs through the literal path in
analyze.rs. - Tighten prompt guidance around type classification, small-diff behavior, and risk-note boilerplate; add
--no-bumpand filter boilerplate risk notes in commit output. - Only evaluate version bumps when the manifest file itself is present in the diff.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/core/src/pipeline/reduce.rs | Adds literal diff-to-report synthesis and tests; includes change classification and title/intent generation helpers. |
| crates/core/src/pipeline/analyze.rs | Routes very small DraftOnly diffs to the new literal report path; avoids moving key_symbols. |
| crates/core/src/llm/prompts.rs | Tightens prompt rules and injects a small-diff warning into analyze prompts. |
| crates/cli/src/cmd/version_bump.rs | Limits version bump evaluation to cases where the manifest file changed. |
| crates/cli/src/cmd/commit.rs | Adds --no-bump to skip bump logic and filters boilerplate risk notes / omits low-risk sections when empty. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+237
to
+242
| if path_lower.ends_with(".md") | ||
| || path_lower.ends_with("readme") | ||
| || path_lower.contains("doc") | ||
| { | ||
| return TypeTag::Docs; | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Cass Sheng <86272122+SnowCheetos@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Cass Sheng <86272122+SnowCheetos@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Cass Sheng <86272122+SnowCheetos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two root-cause fixes addressing issues found in real-world usage of
autocommiton PR rust-osdev/acpi#306, where the maintainer noted that commit messages were confusing, hallucinated, and individual commits were not useful for review.1. Literal model-free path for small diffs
Bypasses the LLM entirely for diffs under 20 lines across at most 2 files. The new
literal_report()function inreduce.rsgenerates commit messages directly from diff structure:2. Version bumps only when manifest is explicitly changed
Changed
should_evaluateinversion_bump.rsto require the manifest file itself (Cargo.toml, package.json, etc.) to be in the diff. Previously, touching any source file in a crate would trigger a version bump suggestion, causing noisy suggestions on every intermediate commit within a PR.Additional improvements
style:for any change touching executable code--no-bumpflag added as explicit opt-out for version suggestionsFiles changed
crates/core/src/pipeline/reduce.rs- literal_report() and helpers (add/delete counting, declaration extraction, classification)crates/core/src/pipeline/analyze.rs- route small diffs to literal pathcrates/core/src/llm/prompts.rs- better type classification rules, small-diff warningscrates/cli/src/cmd/version_bump.rs- only evaluate bumps when manifest changedcrates/cli/src/cmd/commit.rs- --no-bump flag, boilerplate risk note filtering