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
35 changes: 35 additions & 0 deletions internal/orchestrator/orchestrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,41 @@ func TestBuildImplementPrompt_ReleaseNotesIncludesRepoAwareGuidance(t *testing.T
}
}

func TestBuildPlanPrompt_CommitNormalizeIncludesSafetyGuidance(t *testing.T) {
o := New()

def, err := tasks.GetDefinition(tasks.TaskCommitNormalize)
if err != nil {
t.Fatalf("GetDefinition(commit-normalize): %v", err)
}

task := &tasks.Task{
ID: "commit-normalize:/tmp/nightshift",
Title: def.Name,
Description: def.Description,
Type: def.Type,
}

prompt := o.buildPlanPrompt(task)

expected := []string{
"Inspect recent commit history",
"dominant commit-subject style",
"Define a clear default for new commit subjects",
"allow sensible exceptions for merges, releases, and version bumps",
"preserve any required Nightshift trailers",
"updating commit guidance, templates, or lightweight enforcement",
"rather than rewriting published history",
"Do not rebase, force-push, or mass-edit existing commits",
}

for _, want := range expected {
if !strings.Contains(prompt, want) {
t.Errorf("commit-normalize plan prompt missing %q\nGot:\n%s", want, prompt)
}
}
}

func TestBuildPrompts_GenericTasksDoNotReceiveReleaseNotesGuidance(t *testing.T) {
o := New()

Expand Down
11 changes: 7 additions & 4 deletions internal/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,13 @@ Apply safe updates directly, and leave concise follow-ups for anything uncertain
DefaultInterval: 168 * time.Hour,
},
TaskCommitNormalize: {
Type: TaskCommitNormalize,
Category: CategoryPR,
Name: "Commit Message Normalizer",
Description: "Standardize commit message format",
Type: TaskCommitNormalize,
Category: CategoryPR,
Name: "Commit Message Normalizer",
Description: `Inspect recent commit history to infer the repository's dominant commit-subject style, then standardize future commit guidance around that convention.
Define a clear default for new commit subjects, allow sensible exceptions for merges, releases, and version bumps, and preserve any required Nightshift trailers on commits you create.
Keep the work forward-looking and repo-safe: prefer updating commit guidance, templates, or lightweight enforcement for future commits rather than rewriting published history.
Do not rebase, force-push, or mass-edit existing commits unless the repository already has an explicitly documented local-only workflow that makes that safe.`,
CostTier: CostLow,
RiskLevel: RiskLow,
DefaultInterval: 24 * time.Hour,
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 | Standardize future commit conventions without rewriting published history | Low | Low | 24h |
| `changelog-synth` | Changelog Synthesizer | Generate changelog from commits | Low | Low | 7d |
| `release-notes` | Release Note Drafter | Draft release-ready notes for the next version | Low | Low | 7d |
| `adr-draft` | ADR Drafter | Draft Architecture Decision Records | Medium | Low | 7d |
Expand Down