Documentation
¶
Overview ¶
Package reporting generates morning summary reports for nightshift runs. Reports are generated as markdown and can be saved to disk or sent via notifications.
Index ¶
- func DefaultReportsDir() string
- func DefaultRunReportPath(ts time.Time) string
- func DefaultRunResultsPath(ts time.Time) string
- func DefaultSummaryPath(date time.Time) string
- func RenderRunReport(results *RunResults, logPath string) (string, error)
- func SaveRunReport(results *RunResults, path string, logPath string) error
- func SaveRunResults(results *RunResults, path string) error
- type Generator
- type RunResults
- type Summary
- type TaskResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultReportsDir ¶
func DefaultReportsDir() string
DefaultReportsDir returns the default directory for run reports.
func DefaultRunReportPath ¶
DefaultRunReportPath returns the default path for a run report file.
func DefaultRunResultsPath ¶
DefaultRunResultsPath returns the default path for a run results JSON file.
func DefaultSummaryPath ¶
DefaultSummaryPath returns the default path for a summary file.
func RenderRunReport ¶
func RenderRunReport(results *RunResults, logPath string) (string, error)
RenderRunReport renders a markdown report for a single run.
func SaveRunReport ¶
func SaveRunReport(results *RunResults, path string, logPath string) error
SaveRunReport writes a run report to disk.
func SaveRunResults ¶
func SaveRunResults(results *RunResults, path string) error
SaveRunResults writes structured run results to disk as JSON.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator creates morning summary reports.
func NewGenerator ¶
NewGenerator creates a summary generator with the given configuration.
func (*Generator) Generate ¶
func (g *Generator) Generate(results *RunResults) (*Summary, error)
Generate creates a summary from run results.
func (*Generator) SendNotifications ¶
SendNotifications sends the summary via configured notification channels.
type RunResults ¶
type RunResults struct {
Date time.Time `json:"date"`
StartBudget int `json:"start_budget"`
UsedBudget int `json:"used_budget"`
RemainingBudget int `json:"remaining_budget"`
Tasks []TaskResult `json:"tasks"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
LogPath string `json:"log_path,omitempty"`
}
RunResults holds all results from a nightshift run.
func LoadRunResults ¶
func LoadRunResults(path string) (*RunResults, error)
LoadRunResults reads structured run results from disk.
type Summary ¶
type Summary struct {
Date time.Time
Content string
ProjectCounts map[string]int
CompletedTasks []TaskResult
SkippedTasks []TaskResult
FailedTasks []TaskResult
BudgetStart int
BudgetUsed int
BudgetRemaining int
}
Summary represents a generated morning summary.
type TaskResult ¶
type TaskResult struct {
Project string `json:"project"`
TaskType string `json:"task_type"`
Title string `json:"title"`
Status string `json:"status"` // completed, failed, skipped
OutputType string `json:"output_type,omitempty"` // PR, Report, Analysis, etc.
OutputRef string `json:"output_ref,omitempty"` // PR number, report path, etc.
TokensUsed int `json:"tokens_used"`
SkipReason string `json:"skip_reason,omitempty"` // e.g., "insufficient budget"
Duration time.Duration `json:"duration,omitempty"`
}
TaskResult represents a completed or skipped task in the run.