Documentation
¶
Index ¶
- Constants
- func ACPRawCommand(target string, overrides map[string]string) string
- func ACPTargetFor(name AgentName) (string, bool)
- func CountActionableFindings(findings Findings) int
- func CountFindingFingerprints(items []Finding) map[FindingIdentity]int
- func CountFindingOccurrences(items []Finding) map[string]int
- func FindingIDCorroborates(item, candidate Finding) bool
- func FindingMatches(item Finding, stableIDs map[string][]Finding, ...) bool
- func FindingOccurrenceCorroborates(item, candidate Finding) bool
- func HasActionableFindings(findings Findings) bool
- func HasAskUserFindings(findings Findings) bool
- func MarshalFindingsJSON(findings Findings) (string, error)
- func StableFindingIDs(items []Finding) map[string][]Finding
- type ACPAlias
- type AgentName
- type ApprovalAction
- type Finding
- type FindingEvidence
- type FindingIdentity
- type Findings
- func AutoFixableFindings(findings Findings) Findings
- func EnsureFindingOccurrenceTokens(findings Findings) (Findings, error)
- func ExcludeFindings(findings Findings, ids []string) Findings
- func FilterFindings(findings Findings, ids []string) Findings
- func MergeUserOverrides(findings Findings, instructions map[string]string, added []Finding) Findings
- func NormalizeFindings(findings Findings, prefix string, existing []Finding) (Findings, error)
- func NormalizeUserFindings(findings Findings, existing []Finding) (Findings, error)
- func ParseFindingsJSON(raw string) (Findings, error)
- type RunStatus
- type StepName
- type StepStatus
- type TestArtifact
Constants ¶
const ( ActionNoOp = "no-op" ActionAutoFix = "auto-fix" ActionAskUser = "ask-user" )
Finding action constants.
const ( FindingSourceAgent = "agent" FindingSourceUser = "user" )
Finding source constants. An empty Source is treated as agent-produced.
const ( FindingReviewScopeSource = "source" FindingReviewScopePipelineOwnedDelivery = "pipeline-owned-delivery" FindingReviewScopeExternalDelivery = "external-delivery" )
const ( FindingsRiskScopeSourceOrExternal = "source-or-external" FindingsRiskScopePipelineOwnedDelivery = "pipeline-owned-delivery" )
const ( FindingCategoryDocumentation = "documentation" FindingCategoryLint = "lint" )
Finding category constants for the combined document+lint housekeeping pass. An empty Category on a housekeeping finding is treated as documentation (the stricter gate).
const ( RunCancelReasonAbortedByUser = "cancelled: aborted by user" RunCancelReasonSuperseded = "cancelled: superseded by new push" )
Variables ¶
This section is empty.
Functions ¶
func ACPRawCommand ¶
ACPRawCommand resolves the raw command acpx runs for an ACP target: a registry override is trimmed and wins when non-blank, otherwise the alias default command is used. Empty means acpx dispatches the target through its own registry.
func ACPTargetFor ¶
ACPTargetFor resolves the ACP target an agent name drives: the alias target for a first-class alias, or the parsed target of an explicit acp:<target> name. Returns false for non-ACP agent names.
func CountActionableFindings ¶
CountActionableFindings returns how many findings warrant a fix or an explicit adjudication - every finding whose effective action is not "no-op".
func CountFindingFingerprints ¶
func CountFindingFingerprints(items []Finding) map[FindingIdentity]int
func CountFindingOccurrences ¶
func FindingIDCorroborates ¶
func FindingMatches ¶
func HasActionableFindings ¶
HasActionableFindings reports whether any finding warrants a fix - that is, any finding whose effective action is not "no-op". Findings that are purely informational ("no-op") are not actionable and need no fix, so a step whose findings are all no-op (or that has no findings) returns false. This is what yolo / auto-resolve uses to decide whether to fix a gate's findings or just accept the step as-is.
func HasAskUserFindings ¶
HasAskUserFindings returns true if any finding has an effective action of "ask-user". It uses ActionOrDefault so an empty/missing action (which now defaults to ask-user) parks for a human, keeping this in agreement with AutoFixableFindings: an unclassified finding is never auto-fixed and is always caught here as ask-user.
func MarshalFindingsJSON ¶
MarshalFindingsJSON encodes findings using the current wire shape.
func StableFindingIDs ¶
Types ¶
type ACPAlias ¶
ACPAlias describes a first-class agent name that resolves to an ACP target.
func ACPAliasFor ¶
ACPAliasFor returns the ACP alias metadata for a first-class agent name.
func ACPAliasForTarget ¶
ACPAliasForTarget returns the ACP alias metadata for a raw ACP target.
func (ACPAlias) DefaultCommandBinary ¶
DefaultCommandBinary returns the executable named by the alias default command.
type AgentName ¶
type AgentName string
AgentName identifies a supported agent backend. Explicit ACP targets use dynamic acp:<target> values; first-class ACP aliases have constants below.
type ApprovalAction ¶
type ApprovalAction string
ApprovalAction represents user responses at approval points.
const ( ActionApprove ApprovalAction = "approve" ActionFix ApprovalAction = "fix" ActionSkip ApprovalAction = "skip" ActionAbort ApprovalAction = "abort" )
type Finding ¶
type Finding struct {
ID string `json:"id,omitempty"`
IDGenerated bool `json:"id_generated,omitempty"`
ContinuityToken string `json:"continuity_token,omitempty"`
OccurrenceToken string `json:"occurrence_token,omitempty"`
PriorID string `json:"prior_id,omitempty"`
PriorContinuityToken string `json:"prior_continuity_token,omitempty"`
Severity string `json:"severity"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Description string `json:"description"`
Action string `json:"action"`
Source string `json:"source,omitempty"`
UserInstructions string `json:"user_instructions,omitempty"`
ReviewScope string `json:"review_scope,omitempty"`
Evidence *FindingEvidence `json:"evidence,omitempty"`
// Category separates the combined document+lint housekeeping pass's
// findings into their owning gates. Empty everywhere else.
Category string `json:"category,omitempty"`
}
Finding represents a single review, test, lint, or PR comment finding.
func (Finding) ActionOrDefault ¶
ActionOrDefault resolves a finding's effective action, defaulting an empty/missing action to ask-user (park), not auto-fix. This closes a fail-open hole: an unclassified finding on a non-schema path (a legacy requires_human_review omission, an IPC- or user-supplied finding) must route to a human rather than be silently auto-applied. It also matches the review prompt's own "When in doubt, default to ask-user" instruction. (MergeUserOverrides still stamps user-*added* findings auto-fix explicitly - a user who hand-adds a finding is asking for a fix.)
func (Finding) Fingerprint ¶
func (f Finding) Fingerprint() FindingIdentity
func (Finding) HasLineage ¶
func (Finding) HasOccurrence ¶
func (Finding) Identity ¶
func (f Finding) Identity() FindingIdentity
func (*Finding) UnmarshalJSON ¶
type FindingEvidence ¶
type FindingEvidence struct {
Tested []string `json:"tested,omitempty"`
TestingSummary string `json:"testing_summary,omitempty"`
Artifacts []TestArtifact `json:"artifacts,omitempty"`
}
type FindingIdentity ¶
type Findings ¶
type Findings struct {
Items []Finding `json:"findings"`
Summary string `json:"summary"`
Tested []string `json:"tested,omitempty"`
TestingSummary string `json:"testing_summary,omitempty"`
Artifacts []TestArtifact `json:"artifacts,omitempty"`
RiskLevel string `json:"risk_level"`
RiskRationale string `json:"risk_rationale"`
RiskScope string `json:"risk_scope,omitempty"`
}
Findings is the structured findings payload exchanged across pipeline, IPC, and TUI.
func AutoFixableFindings ¶
AutoFixableFindings returns a new Findings containing only items where Action is "auto-fix". These are safe for automatic fixing without user involvement.
func ExcludeFindings ¶
ExcludeFindings keeps only findings whose IDs are NOT in the excluded set.
func FilterFindings ¶
FilterFindings keeps only findings whose IDs are included in ids.
func MergeUserOverrides ¶
func MergeUserOverrides(findings Findings, instructions map[string]string, added []Finding) Findings
MergeUserOverrides applies per-finding user instructions to existing agent findings and appends user-added findings at the end. Added findings have Source stamped to FindingSourceUser and receive deterministic "user-N" IDs if they do not carry an ID. The original Findings is not mutated.
func NormalizeFindings ¶
NormalizeFindings replaces reviewer-local IDs with pipeline-owned lineage IDs.
func NormalizeUserFindings ¶
func ParseFindingsJSON ¶
ParseFindingsJSON decodes findings JSON, accepting current and legacy item keys plus legacy requires_human_review fields.
type StepName ¶
type StepName string
StepName identifies a pipeline step.
func (*StepName) UnmarshalJSON ¶
type StepStatus ¶
type StepStatus string
StepStatus represents the lifecycle state of a pipeline step.
const ( StepStatusPending StepStatus = "pending" StepStatusRunning StepStatus = "running" StepStatusAwaitingApproval StepStatus = "awaiting_approval" StepStatusFixing StepStatus = "fixing" StepStatusFixReview StepStatus = "fix_review" StepStatusCompleted StepStatus = "completed" StepStatusSkipped StepStatus = "skipped" StepStatusFailed StepStatus = "failed" )
type TestArtifact ¶
type TestArtifact struct {
Kind string `json:"kind,omitempty"`
Label string `json:"label"`
Path string `json:"path,omitempty"`
URL string `json:"url,omitempty"`
Content string `json:"content,omitempty"`
}
TestArtifact describes evidence produced by the test step for human review.