Skip to content

[FEATURE] Implement Commit Quality Analysis & Policy Enforcement Engine #57

Description

@vraj826

Is your feature request related to a problem? Please describe.

Gitbun currently generates commit messages solely from the current repository state and AI analysis, but it lacks any mechanism to detect or prevent low-quality, misleading, or policy-violating commit messages before they are committed.

This can lead to several issues:

  • AI-generated commits that do not accurately describe the actual code changes.
  • Generic commit messages such as "update code" or "fix stuff" passing through.
  • Missing Conventional Commit compliance in edge cases.
  • Sensitive information accidentally appearing in commit messages.
  • Reduced commit history quality and repository maintainability.

As Gitbun aims to automate commit creation, it should also validate commit quality before allowing the commit to proceed.


Describe the solution you'd like

Implement a Commit Quality Analysis & Policy Enforcement Engine that performs a final validation pass on generated commit messages before execution.

Key capabilities:

  • Conventional Commit compliance verification.
  • Semantic consistency checks between generated message and changed files.
  • Detection of vague or low-information commit messages.
  • Commit quality scoring system.
  • Configurable repository-specific commit policies.
  • Sensitive keyword detection (tokens, secrets, credentials, API keys).
  • Optional blocking mode for commits that fail validation.
  • Human-readable validation feedback in interactive mode.

Example:

Generated:
fix: update code

Validation:
❌ Commit quality score: 22/100
❌ Message too generic
❌ Does not describe affected module

Suggested:
fix(auth): resolve JWT validation failure during login

Describe alternatives you've considered

  • Relying solely on AI-generated output.
  • Adding more prompt engineering to improve commit quality.
  • Using only Conventional Commit linting.

However, these approaches do not verify whether the generated commit actually reflects the repository changes or meets quality standards. A dedicated validation engine provides significantly stronger guarantees.


Additional context

Potential implementation areas:

src/analyzer/
src/validators/
src/llm/
src/ui/
src/config/

Suggested architecture:

  • CommitQualityAnalyzer
  • PolicyEngine
  • ConventionalCommitValidator
  • SecretKeywordScanner
  • QualityScoringModule

Acceptance Criteria:

  • Commit quality score generated before commit execution
  • Generic/vague commit messages detected
  • Conventional Commit validation integrated
  • Repository policy configuration supported
  • Interactive feedback shown to users
  • Optional strict enforcement mode implemented
  • Unit tests added for scoring and validation logic
  • Documentation updated

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions