You've already forked agentic-coding-workflow
54 lines
1.5 KiB
Go
54 lines
1.5 KiB
Go
// Package docs generates commit / PR markdown summaries on commit. A background
|
|
// job (SummaryRunner) gathers the diffstat + log for a commit, prompts an LLM to
|
|
// produce markdown, and upserts a commit_summaries row. Enqueued post-commit via
|
|
// EnqueueCommitSummary (injected as a callback into gitops to avoid import cycles).
|
|
package docs
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
|
|
"github.com/yan1h/agent-coding-workflow/internal/jobs"
|
|
)
|
|
|
|
// JobTypeCommitSummary is the jobs.JobType for an event-driven commit summary.
|
|
const JobTypeCommitSummary jobs.JobType = "docs.commit_summary"
|
|
|
|
// Summary kind values mirror the commit_summaries.kind CHECK constraint.
|
|
const (
|
|
KindCommit = "commit"
|
|
KindPR = "pr"
|
|
)
|
|
|
|
// Status values mirror the commit_summaries.status CHECK constraint.
|
|
const (
|
|
StatusPending = "pending"
|
|
StatusCompleted = "completed"
|
|
StatusFailed = "failed"
|
|
)
|
|
|
|
// Summary mirrors a commit_summaries row.
|
|
type Summary struct {
|
|
ID uuid.UUID
|
|
WorkspaceID uuid.UUID
|
|
WorktreeID *uuid.UUID
|
|
Branch string
|
|
CommitSHA string
|
|
Kind string
|
|
Title *string
|
|
BodyMD string
|
|
Model *string
|
|
Status string
|
|
Error *string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
// summaryPayload is the jobs payload for JobTypeCommitSummary.
|
|
type summaryPayload struct {
|
|
WorkspaceID uuid.UUID `json:"workspace_id"`
|
|
WorktreeID *uuid.UUID `json:"worktree_id,omitempty"`
|
|
Branch string `json:"branch"`
|
|
CommitSHA string `json:"commit_sha"`
|
|
}
|