Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Apply safe updates directly, and leave concise follow-ups for anything uncertain
Type: TaskCommitNormalize,
Category: CategoryPR,
Name: "Commit Message Normalizer",
Description: "Standardize commit message format",
Description: "Infer the repository's existing commit convention, then document or enforce it with lightweight repo-local configuration when appropriate. Avoid rewriting published history; only normalize recent local commit messages when it is safe.",
CostTier: CostLow,
RiskLevel: RiskLow,
DefaultInterval: 24 * time.Hour,
Expand Down
37 changes: 37 additions & 0 deletions internal/tasks/tasks_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tasks

import (
"strings"
"testing"
"time"
)
Expand Down Expand Up @@ -243,6 +244,42 @@ func TestTaskDefinitionEstimatedTokens(t *testing.T) {
}
}

func TestCommitNormalizeDefinition(t *testing.T) {
def, err := GetDefinition(TaskCommitNormalize)
if err != nil {
t.Fatalf("GetDefinition(TaskCommitNormalize) error: %v", err)
}

if def.Type != TaskCommitNormalize {
t.Errorf("Type = %q, want %q", def.Type, TaskCommitNormalize)
}
if def.Category != CategoryPR {
t.Errorf("Category = %d, want %d", def.Category, CategoryPR)
}
if def.CostTier != CostLow {
t.Errorf("CostTier = %d, want %d", def.CostTier, CostLow)
}
if def.RiskLevel != RiskLow {
t.Errorf("RiskLevel = %d, want %d", def.RiskLevel, RiskLow)
}
if def.DefaultInterval != 24*time.Hour {
t.Errorf("DefaultInterval = %v, want 24h", def.DefaultInterval)
}

requiredText := []string{
"existing commit convention",
"document or enforce",
"lightweight repo-local configuration",
"Avoid rewriting published history",
"only normalize recent local commit messages when it is safe",
}
for _, text := range requiredText {
if !strings.Contains(def.Description, text) {
t.Errorf("Description missing %q: %q", text, def.Description)
}
}
}

func TestRegistryCompleteness(t *testing.T) {
// All task type constants should be in registry
taskTypes := []TaskType{
Expand Down
2 changes: 1 addition & 1 deletion website/docs/task-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Fully formed, review-ready artifacts. These tasks create branches and open pull
| `backward-compat` | Backward-Compatibility Checks | Check and ensure backward compatibility | Medium | Low | 7d |
| `build-optimize` | Build Time Optimization | Optimize build configuration for faster builds | High | Medium | 7d |
| `docs-backfill` | Documentation Backfiller | Generate missing documentation | Low | Low | 7d |
| `commit-normalize` | Commit Message Normalizer | Standardize commit message format | Low | Low | 24h |
| `commit-normalize` | Commit Message Normalizer | Infer the repo's commit convention, document or lightly enforce it, and avoid unsafe history rewrites | Low | Low | 24h |
| `changelog-synth` | Changelog Synthesizer | Generate changelog from commits | Low | Low | 7d |
| `release-notes` | Release Note Drafter | Draft release notes from changes | Low | Low | 7d |
| `adr-draft` | ADR Drafter | Draft Architecture Decision Records | Medium | Low | 7d |
Expand Down