Documentation
¶
Overview ¶
Package summary provides types for summary-style evaluation reports with GO/WARN/NO-GO status per task. This is suited for deterministic checks like tests, linting, and vulnerability scans.
Index ¶
- type EmbeddedReports
- type Status
- type SummaryReport
- func (r *SummaryReport) AddTeam(team TeamSection)
- func (r *SummaryReport) ComputeOverallStatus() Status
- func (r *SummaryReport) EmbedClaimsReport(key string, report any) error
- func (r *SummaryReport) EmbedCustomReport(key string, report any) error
- func (r *SummaryReport) EmbedEvaluationReport(key string, report any) error
- func (r *SummaryReport) EnsureEmbeddedReports()
- func (r *SummaryReport) FinalMessage() string
- func (r *SummaryReport) GetEmbeddedClaims(key string, target any) error
- func (r *SummaryReport) GetEmbeddedCustom(key string, target any) error
- func (r *SummaryReport) GetEmbeddedEvaluation(key string, target any) error
- func (r *SummaryReport) HasEmbeddedReports() bool
- func (r *SummaryReport) IsGo() bool
- type TaskResult
- type TeamSection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbeddedReports ¶ added in v0.6.0
type EmbeddedReports struct {
// Evaluations contains embedded EvaluationReport(s).
// Key is a report identifier (e.g., "prd-review", "article-quality").
Evaluations map[string]json.RawMessage `json:"evaluations,omitempty"`
// Claims contains embedded ClaimsReport(s).
// Key is a report identifier (e.g., "source-validation").
Claims map[string]json.RawMessage `json:"claims,omitempty"`
// Custom contains any other embedded reports.
// Key is a report identifier, value is the full report JSON.
Custom map[string]json.RawMessage `json:"custom,omitempty"`
}
EmbeddedReports contains full-fidelity embedded reports. Reports are stored as json.RawMessage to avoid circular imports and allow flexible report types.
type Status ¶
type Status string
Status represents the pass/fail status for a task or team. Based on NASA Go/No-Go terminology.
func ComputeStatus ¶
ComputeStatus determines the overall status from multiple statuses. Priority: NO-GO > WARN > GO > SKIP
func ComputeStatusFromTasks ¶
func ComputeStatusFromTasks(tasks []TaskResult) Status
ComputeStatusFromTasks determines the overall status from task results.
func (Status) IsBlocking ¶
IsBlocking returns true if the status is NO-GO.
type SummaryReport ¶
type SummaryReport struct {
// Schema is the JSON Schema URL for validation.
Schema string `json:"$schema,omitempty"`
// Project identifies the project being evaluated.
Project string `json:"project"`
// Version is the version being evaluated.
Version string `json:"version,omitempty"`
// Target is a human-readable target description.
Target string `json:"target,omitempty"`
// Phase describes the evaluation phase (e.g., "RELEASE VALIDATION").
Phase string `json:"phase,omitempty"`
// Teams are the individual team/agent sections.
Teams []TeamSection `json:"teams"`
// Status is the computed overall status.
Status Status `json:"status"`
// GeneratedAt is when the report was created.
GeneratedAt time.Time `json:"generated_at"`
// GeneratedBy identifies what created this report.
GeneratedBy string `json:"generated_by,omitempty"`
// EmbeddedReports contains full-fidelity embedded reports.
// This allows the SummaryReport to serve as a container for
// detailed reports while providing a summary view.
EmbeddedReports *EmbeddedReports `json:"embeddedReports,omitempty"`
}
SummaryReport is the top-level report for summary-style evaluations. It aggregates results from multiple teams/agents and can embed full EvaluationReport and ClaimsReport for complete fidelity.
func NewSummaryReport ¶
func NewSummaryReport(project, version, phase string) *SummaryReport
NewSummaryReport creates a new summary report with defaults.
func (*SummaryReport) AddTeam ¶
func (r *SummaryReport) AddTeam(team TeamSection)
AddTeam adds a team section to the report.
func (*SummaryReport) ComputeOverallStatus ¶
func (r *SummaryReport) ComputeOverallStatus() Status
ComputeOverallStatus calculates the overall status from all teams.
func (*SummaryReport) EmbedClaimsReport ¶ added in v0.6.0
func (r *SummaryReport) EmbedClaimsReport(key string, report any) error
EmbedClaimsReport embeds a ClaimsReport with the given key. The report is marshaled to JSON for storage.
func (*SummaryReport) EmbedCustomReport ¶ added in v0.6.0
func (r *SummaryReport) EmbedCustomReport(key string, report any) error
EmbedCustomReport embeds a custom report with the given key. The report is marshaled to JSON for storage.
func (*SummaryReport) EmbedEvaluationReport ¶ added in v0.6.0
func (r *SummaryReport) EmbedEvaluationReport(key string, report any) error
EmbedEvaluationReport embeds an EvaluationReport with the given key. The report is marshaled to JSON for storage.
func (*SummaryReport) EnsureEmbeddedReports ¶ added in v0.6.0
func (r *SummaryReport) EnsureEmbeddedReports()
EnsureEmbeddedReports initializes the EmbeddedReports field if nil.
func (*SummaryReport) FinalMessage ¶
func (r *SummaryReport) FinalMessage() string
FinalMessage returns a formatted final status message.
func (*SummaryReport) GetEmbeddedClaims ¶ added in v0.6.0
func (r *SummaryReport) GetEmbeddedClaims(key string, target any) error
GetEmbeddedClaims retrieves and unmarshals an embedded ClaimsReport. Returns nil if not found. The target should be a pointer to the report struct.
func (*SummaryReport) GetEmbeddedCustom ¶ added in v0.6.0
func (r *SummaryReport) GetEmbeddedCustom(key string, target any) error
GetEmbeddedCustom retrieves and unmarshals an embedded custom report. Returns nil if not found. The target should be a pointer to the report struct.
func (*SummaryReport) GetEmbeddedEvaluation ¶ added in v0.6.0
func (r *SummaryReport) GetEmbeddedEvaluation(key string, target any) error
GetEmbeddedEvaluation retrieves and unmarshals an embedded EvaluationReport. Returns nil if not found. The target should be a pointer to the report struct.
func (*SummaryReport) HasEmbeddedReports ¶ added in v0.6.0
func (r *SummaryReport) HasEmbeddedReports() bool
HasEmbeddedReports returns true if any embedded reports exist.
func (*SummaryReport) IsGo ¶
func (r *SummaryReport) IsGo() bool
IsGo returns true if the overall status allows proceeding.
type TaskResult ¶
type TaskResult struct {
// ID is the unique identifier for this task.
ID string `json:"id"`
// Status is the task outcome (GO, WARN, NO-GO, SKIP).
Status Status `json:"status"`
// Detail provides a brief description of the result.
Detail string `json:"detail,omitempty"`
// DurationMs is the execution time in milliseconds.
DurationMs int64 `json:"duration_ms,omitempty"`
// Metadata contains additional task-specific data.
Metadata map[string]any `json:"metadata,omitempty"`
}
TaskResult represents the outcome of a single check or task.
type TeamSection ¶
type TeamSection struct {
// ID is the unique identifier (workflow step ID).
ID string `json:"id"`
// Name is the human-readable name.
Name string `json:"name"`
// AgentID is the agent that produced this section.
AgentID string `json:"agent_id,omitempty"`
// Model is the LLM model used (if applicable).
Model string `json:"model,omitempty"`
// DependsOn lists upstream team IDs (for DAG ordering).
DependsOn []string `json:"depends_on,omitempty"`
// Tasks are the individual check results.
Tasks []TaskResult `json:"tasks"`
// Status is the computed overall status for this section.
Status Status `json:"status"`
}
TeamSection represents results from a single agent or validation area.
func (*TeamSection) ComputeStatus ¶
func (t *TeamSection) ComputeStatus() Status
ComputeStatus calculates the status from tasks.