Documentation
¶
Overview ¶
Package v1alpha1 defines the patchy.bitwisemedia.uk/v1alpha1 API: the custom resources that carry finding state through the pipeline.
The kinds fall into three groups:
- Edge configuration: Integration (an external system — scanner ingestion and/or tracking projection, e.g. a GitHub App handling code-scanning alerts in and issue tracking out) and Forge (repository credentials for cloning, pushing, and pull requests, selected by host/org/repo filters).
- The pipeline: Finding is the authoritative state machine (phases and legal transitions live in transitions.go); Investigation and Remediation are one-per-attempt immutable children recording each agent run; Repository is the SHA-pinned clone artifact source-controller serves to agent jobs as a tarball.
- Statistics: FindingRollup objects — one per scope value (total, repository, harness, model) — accumulate all-time counters that survive the TTL deletion of completed Findings.
Structural-schema rules shape the types: no floats (confidence and cost are validated decimal strings; rollup sums are int64 micro-USD; durations are int64 milliseconds), bounded sizes everywhere (etcd caps objects at about 1.5MiB), and agent changesets never appear in any resource.
Index ¶
- Constants
- Variables
- func CanTransition(from, to Phase) bool
- func RetryRequested(f *Finding) bool
- func SetPhase(f *Finding, to Phase, now time.Time) error
- func Terminal(p Phase) bool
- type ActionRequest
- type ActiveRun
- type AgentParameters
- type Alert
- type Analysis
- type Approval
- type Artifact
- type AttemptCounts
- type Enrichment
- type Finding
- type FindingList
- type FindingRepository
- type FindingRollup
- type FindingRollupList
- type FindingRollupSpec
- type FindingRollupStatus
- type FindingSpec
- type FindingStatus
- type Forge
- type ForgeList
- type ForgeProvider
- type ForgeSpec
- type ForgeStatus
- type GitHubCodeScanningAlerts
- type GitHubIntegration
- type GitHubIssues
- type GitHubRedelivery
- type InstallationSummary
- type Integration
- type IntegrationList
- type IntegrationProvider
- type IntegrationSpec
- type IntegrationStatus
- type Investigation
- type InvestigationList
- type InvestigationSpec
- type InvestigationStatus
- type InvestigationSummary
- type JobReference
- type Level
- type LocalObjectReference
- type LocalSecretReference
- type Location
- type MonthlyBucket
- type ObjectReference
- type Phase
- type PhaseTime
- type PullRequestRef
- type PullRequestStatus
- type RateLimitStatus
- type Rating
- type Recommendation
- type RedeliveryStatus
- type RelatedFinding
- type RelationshipType
- type Remediation
- type RemediationList
- type RemediationSpec
- type RemediationStatus
- type RemediationSummary
- type Repository
- type RepositoryList
- type RepositoryRef
- type RepositorySpec
- type RepositoryStatus
- type RepositoryType
- type RollupBucket
- type RollupScope
- type RunKind
- type RunPhase
- type ScopeType
- type StageAggregate
- type StageResult
- type TrackingStatus
- type UsageSummary
Constants ¶
const ( // LabelKeyHash carries the hex-encoded accumulation-key hash on a Finding. LabelKeyHash = "patchy.bitwisemedia.uk/key-hash" // LabelSource carries the source handler ID (e.g. github-code-scanning). LabelSource = "patchy.bitwisemedia.uk/source" // LabelIntegration names the Integration that ingested a Finding. LabelIntegration = "patchy.bitwisemedia.uk/integration" // LabelRepoHash carries the hex-encoded repository-URL hash. LabelRepoHash = "patchy.bitwisemedia.uk/repo-hash" // LabelSeverity mirrors spec.severity for selectors. LabelSeverity = "patchy.bitwisemedia.uk/severity" // LabelFinding names the owning Finding on children and agent Jobs. LabelFinding = "patchy.bitwisemedia.uk/finding" // LabelAttempt carries the attempt ordinal on Investigation/Remediation. LabelAttempt = "patchy.bitwisemedia.uk/attempt" // LabelOwner names the owning Investigation or Remediation on agent Jobs. LabelOwner = "patchy.bitwisemedia.uk/owner" // LabelRunKind discriminates agent Jobs ("investigation"/"remediation") so // the two job controllers sharing one namespace never touch each other's // Jobs. LabelRunKind = "patchy.bitwisemedia.uk/kind" // LabelHarness names the agent harness a Job's pod runs ("claude"/"codex"), // the selector the per-harness egress network policies match on so each // runner reaches only its own model API. LabelHarness = "patchy.bitwisemedia.uk/harness" // LabelScope carries the rollup scope type on FindingRollup objects. LabelScope = "patchy.bitwisemedia.uk/scope" // AnnotationRepo carries the true "owner/name" on Investigation and // Remediation children (label values cannot hold it), so the rollup can // attribute spend to the repository even after the Finding is gone. AnnotationRepo = "patchy.bitwisemedia.uk/repo" )
Label, annotation, and finalizer keys shared by every controller. The truth behind hashed label values (repository URLs, accumulation keys) always lives in the owning object's spec — labels exist only for selectors.
const ( FinalizerJobs = "patchy.bitwisemedia.uk/jobs" FinalizerRollupTotal = "patchy.bitwisemedia.uk/rollup-total" FinalizerRollupRepository = "patchy.bitwisemedia.uk/rollup-repository" FinalizerRollupHarness = "patchy.bitwisemedia.uk/rollup-harness" FinalizerRollupModel = "patchy.bitwisemedia.uk/rollup-model" )
Finalizers. The rollup finalizers guarantee no object is deleted before its spend is aggregated into every scope (see FindingRollup); the jobs finalizer guarantees leftover Jobs/Secrets in the agents namespace are cleaned up.
const ( // ConditionReady is the summary condition on every kind. ConditionReady = "Ready" // ConditionStalled marks an object that cannot progress without operator // action (ambiguous forge match, oversized artifact, ambiguous tracking). ConditionStalled = "Stalled" // ConditionAccumulationComplete marks a Finding whose 1-hour accumulation // window has closed (accumulation is a condition, not a phase — alerts // fold in concurrently with enhancement). ConditionAccumulationComplete = "AccumulationComplete" // ConditionContextEnhanced marks a Finding whose enhancer chain ran. ConditionContextEnhanced = "ContextEnhanced" // ConditionInvestigated marks a Finding with a completed investigation; // the reason carries the recommendation. ConditionInvestigated = "Investigated" // ConditionApproved marks a Finding whose spec.approval was accepted. ConditionApproved = "Approved" // ConditionRetried marks a Finding whose spec.retry was consumed — a // human recovered it from Failed; the message carries the requester. ConditionRetried = "Retried" // ConditionForgeResolved reports whether the Finding's repository resolved // to exactly one Forge (False reasons: NoRepository, NoForgeMatch, // Ambiguous). Parked findings are re-queued when Forges change. ConditionForgeResolved = "ForgeResolved" // ConditionComplete marks a finished Investigation/Remediation; the // reason carries the stage outcome. ConditionComplete = "Complete" // Per-scope rollup markers. A scope's finalizer is removed only when its // condition is True and deletion is underway — remaining finalizers show // exactly which scopes still owe aggregation. ConditionRolledUpTotal = "RolledUpTotal" ConditionRolledUpRepository = "RolledUpRepository" ConditionRolledUpHarness = "RolledUpHarness" ConditionRolledUpModel = "RolledUpModel" )
Condition types. Every kind carries Ready; the rest are noted per kind.
const ( // ReasonNoRepository: the finding has no repository (e.g. a cloud // finding) — nothing to resolve a Forge against. ReasonNoRepository = "NoRepository" // ReasonNoForgeMatch: no Forge's filters matched the repository. ReasonNoForgeMatch = "NoForgeMatch" // ReasonAmbiguous: more than one Forge matched with equal specificity — // an operator configuration error. ReasonAmbiguous = "Ambiguous" )
Condition reasons.
const ConfidencePattern = `^(0(\.[0-9]{1,4})?|1(\.0{1,4})?)$`
ConfidencePattern validates a confidence decimal string in [0, 1] with up to four fractional digits.
Variables ¶
var ( // GroupVersion is the group and version used to register these objects. GroupVersion = schema.GroupVersion{Group: "patchy.bitwisemedia.uk", Version: "v1alpha1"} // SchemeBuilder collects the functions that register this group-version's // types into a scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
The api package deliberately depends only on apimachinery (no controller-runtime): it is imported by the e2e module and, eventually, the UI.
Functions ¶
func CanTransition ¶
CanTransition reports whether moving a Finding from phase `from` to `to` is legal. The empty phase means a new Finding. Self-transitions are always legal no-ops.
func RetryRequested ¶ added in v0.5.2
RetryRequested reports whether spec.retry is actionable: present and newer than the failure's completion. A retry consumed by a transition (which clears completedAt) can never re-fire — a later failure stamps a fresh completedAt that outdates it.
func SetPhase ¶
SetPhase moves the Finding to phase `to` at time `now`: it validates the transition, appends to status.phaseTimes, and maintains status.completedAt (set on terminal entry, cleared on revival — the TTL contract is completedAt + TTL). Callers running under conflict retry must call SetPhase again after every re-Get so the transition is re-validated against fresh state; an illegal transition returns an error and mutates nothing.
Types ¶
type ActionRequest ¶ added in v0.5.2
type ActionRequest struct {
// By is the requesting login.
By string `json:"by"`
// At is when the request was received.
At metav1.Time `json:"at"`
}
ActionRequest records who requested a human action (retry, expedite) and when. Freshness against status timestamps decides whether the request is still actionable — the consuming controller never clears spec.
func (*ActionRequest) DeepCopy ¶ added in v0.5.2
func (in *ActionRequest) DeepCopy() *ActionRequest
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionRequest.
func (*ActionRequest) DeepCopyInto ¶ added in v0.5.2
func (in *ActionRequest) DeepCopyInto(out *ActionRequest)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ActiveRun ¶
type ActiveRun struct {
// Kind of the active run.
Kind RunKind `json:"kind"`
// Name of the active child.
Name string `json:"name"`
}
ActiveRun points at the child currently holding the run lease (the lease itself is the deterministic child-CR create).
func (*ActiveRun) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActiveRun.
func (*ActiveRun) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AgentParameters ¶
type AgentParameters struct {
// Model the harness runs, as a canonical provider-qualified id
// (e.g. "anthropic/claude-sonnet-5").
// +optional
Model string `json:"model,omitempty"`
// Harness that runs Model, resolved from the model by the remediation
// spawner (the model's provider decides which agent-runner image and
// credential the Job uses). Empty until resolution.
// +optional
Harness string `json:"harness,omitempty"`
// MaxTurns caps agent turns.
// +optional
// +kubebuilder:validation:Minimum=0
MaxTurns int32 `json:"maxTurns,omitempty"`
// TokenBudget caps output tokens (the runner kill switch).
// +optional
// +kubebuilder:validation:Minimum=0
TokenBudget int64 `json:"tokenBudget,omitempty"`
}
AgentParameters bound one agent run: which model it uses and how much it may spend. Ceilings are clamped controller-side before they land here.
func (*AgentParameters) DeepCopy ¶
func (in *AgentParameters) DeepCopy() *AgentParameters
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentParameters.
func (*AgentParameters) DeepCopyInto ¶
func (in *AgentParameters) DeepCopyInto(out *AgentParameters)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Alert ¶
type Alert struct {
// ID of the alert in the source system.
// +kubebuilder:validation:MinLength=1
ID string `json:"id"`
// URL of the alert in the source system.
// +optional
URL string `json:"url,omitempty"`
// Locations the alert points at.
// +optional
// +kubebuilder:validation:MaxItems=8
Locations []Location `json:"locations,omitempty"`
}
Alert is one scanner alert folded into the finding during accumulation. IDs are strings — GHAS alert numbers render as decimal, other scanners use opaque identifiers.
func (*Alert) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Alert.
func (*Alert) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Analysis ¶
type Analysis struct {
// Rating of the dimension.
Rating Rating `json:"rating"`
// Summary is the agent's short justification.
// +optional
// +kubebuilder:validation:MaxLength=4096
Summary string `json:"summary,omitempty"`
}
Analysis is one investigation dimension: a rating plus a short justification. The full reasoning lives in the report markdown.
func (*Analysis) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Analysis.
func (*Analysis) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Approval ¶
type Approval struct {
// By is the approving login.
By string `json:"by"`
// At is when the approval was received.
At metav1.Time `json:"at"`
// Note is optional free text following the approve command.
// +optional
// +kubebuilder:validation:MaxLength=1024
Note string `json:"note,omitempty"`
}
Approval records a human /approve on the tracking item.
func (*Approval) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Approval.
func (*Approval) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Artifact ¶
type Artifact struct {
// URL the artifact is served at (cluster-internal; the path embeds an
// unguessable random id).
URL string `json:"url"`
// Digest is the sha256 of the tarball, verified by the fetching init
// container.
Digest string `json:"digest"`
// SizeBytes of the tarball.
// +optional
SizeBytes int64 `json:"sizeBytes,omitempty"`
// LastFetchedAt is when the clone was produced.
// +optional
LastFetchedAt *metav1.Time `json:"lastFetchedAt,omitempty"`
}
Artifact is the served clone tarball. The tarball contains the working tree plus its shallow .git directory (agents need git for committing and changeset packaging).
func (*Artifact) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Artifact.
func (*Artifact) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AttemptCounts ¶
type AttemptCounts struct {
// Investigation attempts so far.
// +optional
Investigation int32 `json:"investigation,omitempty"`
// Remediation attempts so far.
// +optional
Remediation int32 `json:"remediation,omitempty"`
}
AttemptCounts tallies agent runs per stage.
func (*AttemptCounts) DeepCopy ¶
func (in *AttemptCounts) DeepCopy() *AttemptCounts
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttemptCounts.
func (*AttemptCounts) DeepCopyInto ¶
func (in *AttemptCounts) DeepCopyInto(out *AttemptCounts)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Enrichment ¶
type Enrichment struct {
// Enhancer is the enhancer ID.
Enhancer string `json:"enhancer"`
// Owners are code-owner logins the enhancer identified, in preference
// order.
// +optional
Owners []string `json:"owners,omitempty"`
// Attributes are the enhancer's semi-structured facts (system,
// environment, tier), projected as tracking labels.
// +optional
Attributes map[string]string `json:"attributes,omitempty"`
// Markdown is arbitrary enhancer content, projected as a sticky tracking
// comment.
// +optional
// +kubebuilder:validation:MaxLength=16384
Markdown string `json:"markdown,omitempty"`
// AppliedAt is when the enrichment was recorded.
AppliedAt metav1.Time `json:"appliedAt"`
}
Enrichment is one enhancer's contribution, written by context-controller and projected as a tracking comment by integration-controller.
func (*Enrichment) DeepCopy ¶
func (in *Enrichment) DeepCopy() *Enrichment
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Enrichment.
func (*Enrichment) DeepCopyInto ¶
func (in *Enrichment) DeepCopyInto(out *Enrichment)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Finding ¶
type Finding struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec FindingSpec `json:"spec"`
// +optional
Status FindingStatus `json:"status,omitempty"`
}
Finding is the authoritative state machine for one security finding. The tracking item (e.g. a GitHub issue) is a one-way human-facing projection of this resource.
func (*Finding) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Finding.
func (*Finding) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Finding) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FindingList ¶
type FindingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Finding `json:"items"`
}
FindingList contains a list of Finding.
func (*FindingList) DeepCopy ¶
func (in *FindingList) DeepCopy() *FindingList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingList.
func (*FindingList) DeepCopyInto ¶
func (in *FindingList) DeepCopyInto(out *FindingList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FindingList) DeepCopyObject ¶
func (in *FindingList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FindingRepository ¶
type FindingRepository struct {
// Type of forge the repository lives on.
Type RepositoryType `json:"type"`
// URL is the normalized https URL of the repository.
// +kubebuilder:validation:MinLength=1
URL string `json:"url"`
// Name is the human form ("owner/repo"), for display.
// +optional
Name string `json:"name,omitempty"`
// DefaultBranch of the repository at ingest time.
// +optional
DefaultBranch string `json:"defaultBranch,omitempty"`
}
FindingRepository locates the repository a finding belongs to. It is nil on findings (e.g. cloud findings) whose repository could not be identified — those can never reach the Queued/Remediating phases.
func (*FindingRepository) DeepCopy ¶
func (in *FindingRepository) DeepCopy() *FindingRepository
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingRepository.
func (*FindingRepository) DeepCopyInto ¶
func (in *FindingRepository) DeepCopyInto(out *FindingRepository)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FindingRollup ¶
type FindingRollup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec FindingRollupSpec `json:"spec"`
// +optional
Status FindingRollupStatus `json:"status,omitempty"`
}
FindingRollup accumulates all-time statistics for one scope value (total, one repository, one harness, or one model). Rollups survive the TTL deletion of the findings they aggregate; they live only in etcd, so a cluster rebuild resets the stats epoch.
func (*FindingRollup) DeepCopy ¶
func (in *FindingRollup) DeepCopy() *FindingRollup
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingRollup.
func (*FindingRollup) DeepCopyInto ¶
func (in *FindingRollup) DeepCopyInto(out *FindingRollup)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FindingRollup) DeepCopyObject ¶
func (in *FindingRollup) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FindingRollupList ¶
type FindingRollupList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []FindingRollup `json:"items"`
}
FindingRollupList contains a list of FindingRollup.
func (*FindingRollupList) DeepCopy ¶
func (in *FindingRollupList) DeepCopy() *FindingRollupList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingRollupList.
func (*FindingRollupList) DeepCopyInto ¶
func (in *FindingRollupList) DeepCopyInto(out *FindingRollupList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FindingRollupList) DeepCopyObject ¶
func (in *FindingRollupList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FindingRollupSpec ¶
type FindingRollupSpec struct {
// Scope this rollup aggregates.
Scope RollupScope `json:"scope"`
}
FindingRollupSpec pins the scope; it is immutable. +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec.scope is immutable"
func (*FindingRollupSpec) DeepCopy ¶
func (in *FindingRollupSpec) DeepCopy() *FindingRollupSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingRollupSpec.
func (*FindingRollupSpec) DeepCopyInto ¶
func (in *FindingRollupSpec) DeepCopyInto(out *FindingRollupSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FindingRollupStatus ¶
type FindingRollupStatus struct {
// SchemaVersion of the bucket layout (starts at 1).
// +optional
SchemaVersion int32 `json:"schemaVersion,omitempty"`
// FirstProcessed is the stats epoch for this scope.
// +optional
FirstProcessed *metav1.Time `json:"firstProcessed,omitempty"`
// LastProcessed is the most recent aggregation.
// +optional
LastProcessed *metav1.Time `json:"lastProcessed,omitempty"`
// Bucket is the all-time aggregate.
// +optional
Bucket RollupBucket `json:"bucket,omitempty"`
// Monthly trend line keyed "2026-07" (total scope only).
// +optional
Monthly map[string]MonthlyBucket `json:"monthly,omitempty"`
// Recent is the exactly-once ledger: the last 512 applied delta keys
// ("i:<uid>", "r:<uid>", "f:<uid>:<seq>").
// +optional
// +kubebuilder:validation:MaxItems=512
Recent []string `json:"recent,omitempty"`
}
FindingRollupStatus is the accumulated statistics. All data lives in status; the ledger makes application exactly-once per contributing object.
func (*FindingRollupStatus) DeepCopy ¶
func (in *FindingRollupStatus) DeepCopy() *FindingRollupStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingRollupStatus.
func (*FindingRollupStatus) DeepCopyInto ¶
func (in *FindingRollupStatus) DeepCopyInto(out *FindingRollupStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FindingSpec ¶
type FindingSpec struct {
// IntegrationRef names the Integration that ingested this finding.
IntegrationRef LocalObjectReference `json:"integrationRef"`
// TrackingRef names the Integration that projects this finding to its
// tracking system, denormalized at creation (stable if the ingesting
// integration later retargets).
// +optional
TrackingRef *LocalObjectReference `json:"trackingRef,omitempty"`
// Source is the source handler ID (e.g. github-code-scanning).
// +kubebuilder:validation:MinLength=1
Source string `json:"source"`
// Repository the finding belongs to; nil when none could be identified.
// +optional
Repository *FindingRepository `json:"repository,omitempty"`
// Advisories identify the vulnerability, most authoritative first
// (GHSA > CVE > CWE); [0] is the accumulation key.
// +kubebuilder:validation:MinItems=1
Advisories []string `json:"advisories"`
// RuleID is the scanner rule that fired.
// +optional
RuleID string `json:"ruleID,omitempty"`
// Title is the human summary line.
// +optional
Title string `json:"title,omitempty"`
// Description is the scanner's full description, truncated at ingest.
// +optional
// +kubebuilder:validation:MaxLength=65536
Description string `json:"description,omitempty"`
// Severity assigned by the scanner.
// +optional
Severity Level `json:"severity,omitempty"`
// Alerts folded into this finding during accumulation.
// +optional
// +kubebuilder:validation:MaxItems=64
Alerts []Alert `json:"alerts,omitempty"`
// OverflowAlerts counts alerts dropped past the cap (total observed =
// len(alerts) + overflowAlerts).
// +optional
OverflowAlerts int32 `json:"overflowAlerts,omitempty"`
// Related is the finding's relationship edges.
// +optional
// +kubebuilder:validation:MaxItems=32
Related []RelatedFinding `json:"related,omitempty"`
// Suspend pauses pipeline progress for this finding (human-written).
// +optional
Suspend bool `json:"suspend,omitempty"`
// Approval is the recorded human /approve, written by
// integration-controller from the tracking system's comment webhook.
// +optional
Approval *Approval `json:"approval,omitempty"`
// Retry requests recovery of a Failed finding back to the state it
// failed from (human-written). Actionable while newer than
// status.completedAt; the phase-owning controller consumes it by
// performing the transition.
// +optional
Retry *ActionRequest `json:"retry,omitempty"`
// Expedite marks the finding urgent for its whole lifetime
// (human-written): the investigation gate skips the accumulation window
// and minimum age, and both schedulers rank the finding's runs ahead of
// all non-expedited work.
// +optional
Expedite *ActionRequest `json:"expedite,omitempty"`
}
FindingSpec is the finding to triage. integration-controller writes it at ingest and during accumulation; humans may set suspend and add related-to edges — nothing else has a second writer.
func (*FindingSpec) DeepCopy ¶
func (in *FindingSpec) DeepCopy() *FindingSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingSpec.
func (*FindingSpec) DeepCopyInto ¶
func (in *FindingSpec) DeepCopyInto(out *FindingSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FindingStatus ¶
type FindingStatus struct {
// Phase of the lifecycle (see transitions.go for edges and writers).
// +optional
Phase Phase `json:"phase,omitempty"`
// PhaseTimes is the append-only phase entry log.
// +optional
PhaseTimes []PhaseTime `json:"phaseTimes,omitempty"`
// Conditions of the finding.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// ObservedGeneration is the last spec generation acted on.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// FirstObservedAt is when the first alert arrived (integration).
// +optional
FirstObservedAt *metav1.Time `json:"firstObservedAt,omitempty"`
// AccumulateUntil closes the accumulation window (integration).
// +optional
AccumulateUntil *metav1.Time `json:"accumulateUntil,omitempty"`
// Tracking links the projected tracking item (integration).
// +optional
Tracking *TrackingStatus `json:"tracking,omitempty"`
// Owners are the humans responsible for the finding (context).
// +optional
Owners []string `json:"owners,omitempty"`
// Enrichments are the enhancer contributions (context).
// +optional
// +kubebuilder:validation:MaxItems=8
Enrichments []Enrichment `json:"enrichments,omitempty"`
// Priority is the scheduling priority derived from investigation results
// (investigation) — the remediation queue's sort dimension.
// +optional
Priority Level `json:"priority,omitempty"`
// Investigation summarizes the latest Investigation child (investigation).
// +optional
Investigation *InvestigationSummary `json:"investigation,omitempty"`
// Remediation summarizes the latest Remediation child (remediation).
// +optional
Remediation *RemediationSummary `json:"remediation,omitempty"`
// PullRequest is the remediation PR (remediation opens; integration owns
// state/mergedAt).
// +optional
PullRequest *PullRequestStatus `json:"pullRequest,omitempty"`
// Attempts tallies agent runs (respective controllers).
// +optional
Attempts AttemptCounts `json:"attempts,omitempty"`
// ActiveRun points at the child currently running (respective
// controllers).
// +optional
ActiveRun *ActiveRun `json:"activeRun,omitempty"`
// Forge names the resolved Forge, for observability.
// +optional
Forge *LocalObjectReference `json:"forge,omitempty"`
// LastFailureReason explains the most recent failed edge.
// +optional
// +kubebuilder:validation:MaxLength=4096
LastFailureReason string `json:"lastFailureReason,omitempty"`
// CompletedAt is set on terminal-phase entry and cleared on revival; the
// TTL contract is completedAt + TTL.
// +optional
CompletedAt *metav1.Time `json:"completedAt,omitempty"`
}
FindingStatus is the finding's observed state. Field writers are noted per field; every field has exactly one writer component.
func (*FindingStatus) DeepCopy ¶
func (in *FindingStatus) DeepCopy() *FindingStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FindingStatus.
func (*FindingStatus) DeepCopyInto ¶
func (in *FindingStatus) DeepCopyInto(out *FindingStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Forge ¶
type Forge struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ForgeSpec `json:"spec"`
// +optional
Status ForgeStatus `json:"status,omitempty"`
}
Forge holds repository credentials: source-controller resolves a Finding's repository to a Forge for read-only clone tokens; remediation-controller resolves the same Forge for scoped write tokens (branch push, pull request). Both go through the shared internal/forge package.
func (*Forge) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Forge.
func (*Forge) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Forge) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ForgeList ¶
type ForgeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Forge `json:"items"`
}
ForgeList contains a list of Forge.
func (*ForgeList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForgeList.
func (*ForgeList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ForgeList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ForgeProvider ¶
type ForgeProvider string
ForgeProvider identifies the forge family a Forge authenticates against. +kubebuilder:validation:Enum=github
const (
ForgeProviderGitHub ForgeProvider = "github"
)
Forge providers.
type ForgeSpec ¶
type ForgeSpec struct {
// Provider is the forge family.
Provider ForgeProvider `json:"provider"`
// BaseURL is the forge host; empty means the provider's public host
// (github.com).
// +optional
BaseURL string `json:"baseURL,omitempty"`
// SecretRef names the credential Secret: key "token" (PAT, dev) or keys
// "appID" + "privateKey" (GitHub App).
SecretRef LocalSecretReference `json:"secretRef"`
// Orgs restricts this forge to the listed organizations; empty means all.
// +optional
Orgs []string `json:"orgs,omitempty"`
// Repositories restricts this forge to repositories whose "owner/name"
// matches any of the listed RE2 regular expressions; empty means all.
// +optional
Repositories []string `json:"repositories,omitempty"`
// Interval between credential revalidations.
// +optional
// +kubebuilder:default="10m"
Interval metav1.Duration `json:"interval,omitempty"`
// Suspend pauses reconciliation of this forge.
// +optional
Suspend bool `json:"suspend,omitempty"`
}
ForgeSpec configures repository credentials for one forge, scoped by optional org and repository filters. Matching (in internal/forge): the repository URL's host must equal the forge host, then the org allowlist, then the repository regexes; when several Forges match, the more constrained spec wins (orgs set beats unset, then repositories set beats unset) and a remaining tie is a configuration error surfaced on the Finding.
func (*ForgeSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForgeSpec.
func (*ForgeSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ForgeStatus ¶
type ForgeStatus struct {
// Conditions of the forge (Ready: credential valid).
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// ObservedGeneration is the last spec generation acted on.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Installations summarizes the App installations (github App auth only).
// +optional
Installations []InstallationSummary `json:"installations,omitempty"`
}
ForgeStatus is the forge's observed state.
func (*ForgeStatus) DeepCopy ¶
func (in *ForgeStatus) DeepCopy() *ForgeStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForgeStatus.
func (*ForgeStatus) DeepCopyInto ¶
func (in *ForgeStatus) DeepCopyInto(out *ForgeStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GitHubCodeScanningAlerts ¶
type GitHubCodeScanningAlerts struct {
// Enabled turns the code-scanning capability on.
Enabled bool `json:"enabled"`
}
GitHubCodeScanningAlerts configures scanner ingestion from GitHub code scanning (GHAS/CodeQL) webhooks, including alert dismissal on an "ignore" verdict.
func (*GitHubCodeScanningAlerts) DeepCopy ¶
func (in *GitHubCodeScanningAlerts) DeepCopy() *GitHubCodeScanningAlerts
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubCodeScanningAlerts.
func (*GitHubCodeScanningAlerts) DeepCopyInto ¶
func (in *GitHubCodeScanningAlerts) DeepCopyInto(out *GitHubCodeScanningAlerts)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GitHubIntegration ¶
type GitHubIntegration struct {
// BaseURL points at a GitHub Enterprise Server host; empty means
// github.com.
// +optional
BaseURL string `json:"baseURL,omitempty"`
// Issues enables the tracking projection.
// +optional
Issues *GitHubIssues `json:"issues,omitempty"`
// CodeScanningAlerts enables scanner ingestion.
// +optional
CodeScanningAlerts *GitHubCodeScanningAlerts `json:"codeScanningAlerts,omitempty"`
// Redelivery enables the failed-delivery sweep.
// +optional
Redelivery *GitHubRedelivery `json:"redelivery,omitempty"`
}
GitHubIntegration is the github provider block: one GitHub App covering any combination of the capabilities.
func (*GitHubIntegration) DeepCopy ¶
func (in *GitHubIntegration) DeepCopy() *GitHubIntegration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubIntegration.
func (*GitHubIntegration) DeepCopyInto ¶
func (in *GitHubIntegration) DeepCopyInto(out *GitHubIntegration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GitHubIssues ¶
type GitHubIssues struct {
// Enabled turns the issues capability on.
Enabled bool `json:"enabled"`
// ApproveComment is the comment command that approves a held remediation.
// +optional
// +kubebuilder:default="/approve"
ApproveComment string `json:"approveComment,omitempty"`
}
GitHubIssues configures the tracking projection: findings are projected as GitHub issues, and the human signals on those issues (/approve comments, issue close/reopen, pull-request merge) flow back into Finding state.
func (*GitHubIssues) DeepCopy ¶
func (in *GitHubIssues) DeepCopy() *GitHubIssues
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubIssues.
func (*GitHubIssues) DeepCopyInto ¶
func (in *GitHubIssues) DeepCopyInto(out *GitHubIssues)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GitHubRedelivery ¶ added in v0.5.4
type GitHubRedelivery struct {
// Enabled turns the sweep on. Requires App credentials — the delivery
// log is App-scoped, so a PAT integration cannot sweep.
Enabled bool `json:"enabled"`
// Lookback bounds how far back each sweep scans the delivery log.
// GitHub retains deliveries for 30 days.
// +optional
// +kubebuilder:default="24h"
Lookback metav1.Duration `json:"lookback,omitempty"`
}
GitHubRedelivery configures the failed-delivery sweep: on every reconcile interval the controller lists the App webhook's recent deliveries and asks GitHub to redeliver those that never got a 2xx — deliveries missed while the receiver was down or its queue was full. GitHub does not retry failed deliveries on its own; without the sweep they sit in the 30-day delivery log until redelivered by hand.
func (*GitHubRedelivery) DeepCopy ¶ added in v0.5.4
func (in *GitHubRedelivery) DeepCopy() *GitHubRedelivery
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubRedelivery.
func (*GitHubRedelivery) DeepCopyInto ¶ added in v0.5.4
func (in *GitHubRedelivery) DeepCopyInto(out *GitHubRedelivery)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InstallationSummary ¶
type InstallationSummary struct {
// ID of the installation.
ID int64 `json:"id"`
// Account the App is installed on.
Account string `json:"account"`
// Repositories the installation covers.
// +optional
Repositories int32 `json:"repositories,omitempty"`
}
InstallationSummary counts one GitHub App installation — counts and accounts only, never a repository list (the estate is ~15K repositories).
func (*InstallationSummary) DeepCopy ¶
func (in *InstallationSummary) DeepCopy() *InstallationSummary
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallationSummary.
func (*InstallationSummary) DeepCopyInto ¶
func (in *InstallationSummary) DeepCopyInto(out *InstallationSummary)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Integration ¶
type Integration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec IntegrationSpec `json:"spec"`
// +optional
Status IntegrationStatus `json:"status,omitempty"`
}
Integration configures one external system patchy exchanges finding state with: scanners in (code-scanning alerts, wiz), tracking out (GitHub issues), and the human signals flowing back.
func (*Integration) DeepCopy ¶
func (in *Integration) DeepCopy() *Integration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Integration.
func (*Integration) DeepCopyInto ¶
func (in *Integration) DeepCopyInto(out *Integration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Integration) DeepCopyObject ¶
func (in *Integration) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type IntegrationList ¶
type IntegrationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Integration `json:"items"`
}
IntegrationList contains a list of Integration.
func (*IntegrationList) DeepCopy ¶
func (in *IntegrationList) DeepCopy() *IntegrationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationList.
func (*IntegrationList) DeepCopyInto ¶
func (in *IntegrationList) DeepCopyInto(out *IntegrationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*IntegrationList) DeepCopyObject ¶
func (in *IntegrationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type IntegrationProvider ¶
type IntegrationProvider string
IntegrationProvider identifies the external system an Integration talks to. +kubebuilder:validation:Enum=github
const (
IntegrationProviderGitHub IntegrationProvider = "github"
)
Integration providers.
type IntegrationSpec ¶
type IntegrationSpec struct {
// Provider is the external system type.
Provider IntegrationProvider `json:"provider"`
// SecretRef names the credential Secret. For github: either key "token"
// (PAT, dev) or keys "appID" + "privateKey" (GitHub App), plus
// "webhookSecret" for receiver HMAC validation.
SecretRef LocalSecretReference `json:"secretRef"`
// Interval between credential revalidations.
// +optional
// +kubebuilder:default="10m"
Interval metav1.Duration `json:"interval,omitempty"`
// Suspend pauses reconciliation of this integration.
// +optional
Suspend bool `json:"suspend,omitempty"`
// Replay requests one full redelivery of every webhook delivery in the
// lookback window, including deliveries that already succeeded (the
// receiver dedups; ingestion is idempotent). Freshness against
// status.redelivery.replayedAt decides whether the request is still
// actionable — the controller never clears spec.
// +optional
Replay *ActionRequest `json:"replay,omitempty"`
// Reset requests the demo reset (stamped by the status page): the
// controller permanently deletes every finding's tracking issue,
// reopens the dismissed findings' code-scanning alerts, deletes every
// pipeline resource, and drops the receiver's delivery dedup window so
// redeliveries of already-handled GUIDs are ingested again. Issue
// deletion requires admin-level repository permission on the
// credential. Freshness against status.resetAt decides whether the
// request is still actionable — the controller never clears spec.
// +optional
Reset *ActionRequest `json:"reset,omitempty"`
// GitHub is the github provider block.
// +optional
GitHub *GitHubIntegration `json:"github,omitempty"`
}
IntegrationSpec configures one external system. Exactly the provider block matching spec.provider must be set (CEL-enforced) — integrations are strongly typed, not generic. +kubebuilder:validation:XValidation:rule="(self.provider == 'github') == has(self.github)",message="exactly the provider block matching spec.provider must be set"
func (*IntegrationSpec) DeepCopy ¶
func (in *IntegrationSpec) DeepCopy() *IntegrationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationSpec.
func (*IntegrationSpec) DeepCopyInto ¶
func (in *IntegrationSpec) DeepCopyInto(out *IntegrationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IntegrationStatus ¶
type IntegrationStatus struct {
// Conditions of the integration (Ready: credential valid, system
// reachable).
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// ObservedGeneration is the last spec generation acted on.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// WebhookPath is the receiver path deliveries must target
// (e.g. /github/webhooks).
// +optional
WebhookPath string `json:"webhookPath,omitempty"`
// Installations summarizes the App installations.
// +optional
Installations []InstallationSummary `json:"installations,omitempty"`
// LastEventAt is when the receiver last accepted a delivery.
// +optional
LastEventAt *metav1.Time `json:"lastEventAt,omitempty"`
// RateLimit is the last observed API quota.
// +optional
RateLimit *RateLimitStatus `json:"rateLimit,omitempty"`
// Redelivery reports the last failed-delivery sweep.
// +optional
Redelivery *RedeliveryStatus `json:"redelivery,omitempty"`
// ResetAt echoes spec.reset.at once the receiver's dedup window has
// been dropped; a spec.reset newer than this triggers another drop.
// +optional
ResetAt *metav1.Time `json:"resetAt,omitempty"`
}
IntegrationStatus is the integration's observed state.
func (*IntegrationStatus) DeepCopy ¶
func (in *IntegrationStatus) DeepCopy() *IntegrationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IntegrationStatus.
func (*IntegrationStatus) DeepCopyInto ¶
func (in *IntegrationStatus) DeepCopyInto(out *IntegrationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Investigation ¶
type Investigation struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec InvestigationSpec `json:"spec"`
// +optional
Status InvestigationStatus `json:"status,omitempty"`
}
Investigation is one analysis attempt on a Finding: an agent job assessing exploitability, likelihood, and impact, and recommending remediate/ignore/manual. One immutable object per attempt, owned by the Finding.
func (*Investigation) DeepCopy ¶
func (in *Investigation) DeepCopy() *Investigation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Investigation.
func (*Investigation) DeepCopyInto ¶
func (in *Investigation) DeepCopyInto(out *Investigation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Investigation) DeepCopyObject ¶
func (in *Investigation) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type InvestigationList ¶
type InvestigationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Investigation `json:"items"`
}
InvestigationList contains a list of Investigation.
func (*InvestigationList) DeepCopy ¶
func (in *InvestigationList) DeepCopy() *InvestigationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InvestigationList.
func (*InvestigationList) DeepCopyInto ¶
func (in *InvestigationList) DeepCopyInto(out *InvestigationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*InvestigationList) DeepCopyObject ¶
func (in *InvestigationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type InvestigationSpec ¶
type InvestigationSpec struct {
// FindingRef is the owning Finding (UID-pinned).
FindingRef ObjectReference `json:"findingRef"`
// Attempt ordinal, 1-based.
// +kubebuilder:validation:Minimum=1
Attempt int32 `json:"attempt"`
// RepositoryRef names the Repository artifact the agent works from; nil
// for repository-less findings.
// +optional
RepositoryRef *LocalObjectReference `json:"repositoryRef,omitempty"`
// Parameters bound this run (clamped controller-side).
// +optional
Parameters AgentParameters `json:"parameters,omitempty"`
}
InvestigationSpec identifies one analysis attempt. It is immutable — a new attempt is a new Investigation (CEL-enforced). +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable; create a new Investigation for a new attempt"
func (*InvestigationSpec) DeepCopy ¶
func (in *InvestigationSpec) DeepCopy() *InvestigationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InvestigationSpec.
func (*InvestigationSpec) DeepCopyInto ¶
func (in *InvestigationSpec) DeepCopyInto(out *InvestigationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InvestigationStatus ¶
type InvestigationStatus struct {
// Phase of the run.
// +optional
Phase RunPhase `json:"phase,omitempty"`
// JobRef locates the agent Job in the agents namespace.
// +optional
JobRef *JobReference `json:"jobRef,omitempty"`
// Stage is the agent accounting for the run.
// +optional
Stage *StageResult `json:"stage,omitempty"`
// Exploitability analysis: can the vulnerability actually be exercised?
// +optional
Exploitability *Analysis `json:"exploitability,omitempty"`
// Likelihood analysis: how probable is exploitation in this deployment?
// +optional
Likelihood *Analysis `json:"likelihood,omitempty"`
// Impact analysis: what is the blast radius if exploited?
// +optional
Impact *Analysis `json:"impact,omitempty"`
// Recommendation is the verdict.
// +optional
Recommendation Recommendation `json:"recommendation,omitempty"`
// Confidence decimal string in [0, 1].
// +optional
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]{1,4})?|1(\.0{1,4})?)$`
Confidence string `json:"confidence,omitempty"`
// Severity as assessed by the agent (may differ from the scanner's).
// +optional
Severity Level `json:"severity,omitempty"`
// Priority as assessed by the agent (display; scheduling priority is
// computed controller-side).
// +optional
Priority Level `json:"priority,omitempty"`
// AwaitApproval marks the breaking-change hold: a better-but-breaking fix
// exists, so remediation waits for a human approval.
// +optional
AwaitApproval bool `json:"awaitApproval,omitempty"`
// RemediationParameters are the clamped stage-2 parameters the
// investigation suggested.
// +optional
RemediationParameters *AgentParameters `json:"remediationParameters,omitempty"`
// Report is the full analysis report markdown (single copy — the Finding
// mirrors ratings only).
// +optional
// +kubebuilder:validation:MaxLength=65536
Report string `json:"report,omitempty"`
// Conditions of the run (Complete, RolledUp*).
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// ObservedGeneration is the last spec generation acted on.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}
InvestigationStatus records the analysis results. Written only by investigation-controller.
func (*InvestigationStatus) DeepCopy ¶
func (in *InvestigationStatus) DeepCopy() *InvestigationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InvestigationStatus.
func (*InvestigationStatus) DeepCopyInto ¶
func (in *InvestigationStatus) DeepCopyInto(out *InvestigationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type InvestigationSummary ¶
type InvestigationSummary struct {
// Name of the Investigation child.
Name string `json:"name"`
// Attempt ordinal.
Attempt int32 `json:"attempt"`
// Outcome of the stage (envelope vocabulary).
// +optional
Outcome string `json:"outcome,omitempty"`
// Recommendation verdict.
// +optional
Recommendation Recommendation `json:"recommendation,omitempty"`
// Confidence decimal string in [0, 1].
// +optional
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]{1,4})?|1(\.0{1,4})?)$`
Confidence string `json:"confidence,omitempty"`
// Exploitability rating.
// +optional
Exploitability Rating `json:"exploitability,omitempty"`
// Likelihood rating.
// +optional
Likelihood Rating `json:"likelihood,omitempty"`
// Impact rating.
// +optional
Impact Rating `json:"impact,omitempty"`
// AwaitApproval marks the breaking-change hold.
// +optional
AwaitApproval bool `json:"awaitApproval,omitempty"`
// CompletedAt is when the investigation finished.
// +optional
CompletedAt *metav1.Time `json:"completedAt,omitempty"`
}
InvestigationSummary mirrors the latest Investigation child onto the Finding so the UI list view needs only a Finding watch. Reports and per-dimension summaries live on the child only.
func (*InvestigationSummary) DeepCopy ¶
func (in *InvestigationSummary) DeepCopy() *InvestigationSummary
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InvestigationSummary.
func (*InvestigationSummary) DeepCopyInto ¶
func (in *InvestigationSummary) DeepCopyInto(out *InvestigationSummary)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JobReference ¶
type JobReference struct {
// Namespace the Job runs in.
Namespace string `json:"namespace"`
// Name of the Job.
Name string `json:"name"`
// UID of the Job.
// +optional
UID types.UID `json:"uid,omitempty"`
}
JobReference locates an agent Job. Jobs live in the agents namespace, not the resource's own, so the namespace is explicit.
func (*JobReference) DeepCopy ¶
func (in *JobReference) DeepCopy() *JobReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobReference.
func (*JobReference) DeepCopyInto ¶
func (in *JobReference) DeepCopyInto(out *JobReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Level ¶
type Level string
Level grades severity and priority. +kubebuilder:validation:Enum=low;medium;high;critical
type LocalObjectReference ¶
type LocalObjectReference struct {
// Name of the referent.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
}
LocalObjectReference names an object of a known kind in the same namespace.
func (*LocalObjectReference) DeepCopy ¶
func (in *LocalObjectReference) DeepCopy() *LocalObjectReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectReference.
func (*LocalObjectReference) DeepCopyInto ¶
func (in *LocalObjectReference) DeepCopyInto(out *LocalObjectReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type LocalSecretReference ¶
type LocalSecretReference struct {
// Name of the Secret.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
}
LocalSecretReference names a Secret in the same namespace as the referring object.
func (*LocalSecretReference) DeepCopy ¶
func (in *LocalSecretReference) DeepCopy() *LocalSecretReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalSecretReference.
func (*LocalSecretReference) DeepCopyInto ¶
func (in *LocalSecretReference) DeepCopyInto(out *LocalSecretReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Location ¶
type Location struct {
// Path of the file, repo-relative.
Path string `json:"path"`
// StartLine of the flagged region (1-based).
// +optional
StartLine int32 `json:"startLine,omitempty"`
// EndLine of the flagged region.
// +optional
EndLine int32 `json:"endLine,omitempty"`
// Snippet is the flagged source excerpt.
// +optional
// +kubebuilder:validation:MaxLength=1024
Snippet string `json:"snippet,omitempty"`
}
Location is one source location an alert points at.
func (*Location) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Location.
func (*Location) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MonthlyBucket ¶
type MonthlyBucket struct {
// Findings completed in the month.
// +optional
Findings int64 `json:"findings,omitempty"`
// Runs executed in the month.
// +optional
Runs int64 `json:"runs,omitempty"`
// CostMicroUSD spent in the month.
// +optional
CostMicroUSD int64 `json:"costMicroUSD,omitempty"`
}
MonthlyBucket is the slim global trend line (total scope only; ~150 bytes per month). Deleted findings cannot be re-bucketed later, so this is written at rollup time.
func (*MonthlyBucket) DeepCopy ¶
func (in *MonthlyBucket) DeepCopy() *MonthlyBucket
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonthlyBucket.
func (*MonthlyBucket) DeepCopyInto ¶
func (in *MonthlyBucket) DeepCopyInto(out *MonthlyBucket)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ObjectReference ¶
type ObjectReference struct {
// Name of the referent.
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
// UID of the referent at the time the reference was written.
// +optional
UID types.UID `json:"uid,omitempty"`
}
ObjectReference names an object in the same namespace and pins its UID, so a reference never silently rebinds to a recreated namesake (Finding names are deterministic and reused across TTL cycles).
func (*ObjectReference) DeepCopy ¶
func (in *ObjectReference) DeepCopy() *ObjectReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectReference.
func (*ObjectReference) DeepCopyInto ¶
func (in *ObjectReference) DeepCopyInto(out *ObjectReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Phase ¶
type Phase string
Phase is the Finding lifecycle state. Queued is a real phase — remediation runs in priority order with bounded concurrency, so findings observably wait for a slot. +kubebuilder:validation:Enum=Opened;Enhanced;Investigating;Queued;AwaitingApproval;Remediating;InReview;Remediated;Failed;Dismissed;HandedOff
const ( PhaseOpened Phase = "Opened" PhaseEnhanced Phase = "Enhanced" PhaseInvestigating Phase = "Investigating" PhaseQueued Phase = "Queued" PhaseAwaitingApproval Phase = "AwaitingApproval" PhaseRemediating Phase = "Remediating" PhaseInReview Phase = "InReview" PhaseRemediated Phase = "Remediated" PhaseFailed Phase = "Failed" PhaseDismissed Phase = "Dismissed" PhaseHandedOff Phase = "HandedOff" )
Finding phases.
func RetryTarget ¶ added in v0.5.2
RetryTarget returns the phase a Failed finding recovers to when a human retries it — the recoverable state immediately before the failure — or "" when the finding is not Failed or its history holds no retryable phase. The failed stage is re-attempted by the normal machinery from there: the investigation gate opens a fresh attempt from Enhanced, the remediation spawner from Queued.
type PhaseTime ¶
type PhaseTime struct {
// Phase entered.
Phase Phase `json:"phase"`
// At is the entry time.
At metav1.Time `json:"at"`
}
PhaseTime records when the finding entered a phase (append-only).
func (*PhaseTime) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PhaseTime.
func (*PhaseTime) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PullRequestRef ¶
type PullRequestRef struct {
// Number of the pull request.
Number int64 `json:"number"`
// URL of the pull request.
// +optional
URL string `json:"url,omitempty"`
}
PullRequestRef is the opened pull request. Its lifecycle (merge/close) lives on the Finding — this object is immutable history after completion.
func (*PullRequestRef) DeepCopy ¶
func (in *PullRequestRef) DeepCopy() *PullRequestRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullRequestRef.
func (*PullRequestRef) DeepCopyInto ¶
func (in *PullRequestRef) DeepCopyInto(out *PullRequestRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PullRequestStatus ¶
type PullRequestStatus struct {
// Number of the pull request.
Number int64 `json:"number"`
// URL of the pull request.
// +optional
URL string `json:"url,omitempty"`
// State of the pull request.
// +optional
// +kubebuilder:validation:Enum=open;merged;closed
State string `json:"state,omitempty"`
// MergedAt is when the pull request merged.
// +optional
MergedAt *metav1.Time `json:"mergedAt,omitempty"`
}
PullRequestStatus is the lifecycle of the remediation pull request. remediation-controller writes number/url at open; integration-controller owns state/mergedAt from PR webhooks.
func (*PullRequestStatus) DeepCopy ¶
func (in *PullRequestStatus) DeepCopy() *PullRequestStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullRequestStatus.
func (*PullRequestStatus) DeepCopyInto ¶
func (in *PullRequestStatus) DeepCopyInto(out *PullRequestStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RateLimitStatus ¶
type RateLimitStatus struct {
// Remaining requests in the current window.
Remaining int32 `json:"remaining"`
// ResetAt is when the window resets.
// +optional
ResetAt *metav1.Time `json:"resetAt,omitempty"`
}
RateLimitStatus is an observability snapshot of the provider API quota.
func (*RateLimitStatus) DeepCopy ¶
func (in *RateLimitStatus) DeepCopy() *RateLimitStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitStatus.
func (*RateLimitStatus) DeepCopyInto ¶
func (in *RateLimitStatus) DeepCopyInto(out *RateLimitStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Rating ¶
type Rating string
Rating grades one investigation analysis dimension (exploitability, likelihood, impact). RatingNone is an assessed "not applicable / no risk"; the empty string means the dimension was not assessed. +kubebuilder:validation:Enum=none;low;medium;high;critical
type Recommendation ¶
type Recommendation string
Recommendation is the investigation verdict. +kubebuilder:validation:Enum=remediate;ignore;manual
const ( RecommendationRemediate Recommendation = "remediate" RecommendationIgnore Recommendation = "ignore" RecommendationManual Recommendation = "manual" )
Investigation verdicts.
type RedeliveryStatus ¶ added in v0.5.4
type RedeliveryStatus struct {
// LastSweepAt is when the last sweep ran.
// +optional
LastSweepAt *metav1.Time `json:"lastSweepAt,omitempty"`
// Scanned counts the delivery attempts the last sweep inspected.
// +optional
Scanned int32 `json:"scanned,omitempty"`
// Redelivered counts the redeliveries the last sweep requested.
// +optional
Redelivered int32 `json:"redelivered,omitempty"`
// Truncated marks a sweep that hit the page cap before reaching the
// lookback horizon; the oldest part of the window went unscanned.
// +optional
Truncated bool `json:"truncated,omitempty"`
// Error carries the last sweep failure; empty when the sweep succeeded.
// +optional
Error string `json:"error,omitempty"`
// ReplayedAt echoes spec.replay.at once that replay has run; a
// spec.replay newer than this triggers another full replay.
// +optional
ReplayedAt *metav1.Time `json:"replayedAt,omitempty"`
}
RedeliveryStatus reports the last failed-delivery sweep.
func (*RedeliveryStatus) DeepCopy ¶ added in v0.5.4
func (in *RedeliveryStatus) DeepCopy() *RedeliveryStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedeliveryStatus.
func (*RedeliveryStatus) DeepCopyInto ¶ added in v0.5.4
func (in *RedeliveryStatus) DeepCopyInto(out *RedeliveryStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RelatedFinding ¶
type RelatedFinding struct {
// From is the edge's source Finding name.
From string `json:"from"`
// To is the edge's target Finding name.
To string `json:"to"`
// Relationship classifies the edge.
Relationship RelationshipType `json:"relationship"`
}
RelatedFinding is a directed edge between two findings, stored identically on both endpoints (one of from/to is the holder's own name). Names may dangle after the other endpoint's TTL deletion — consumers tolerate that.
func (*RelatedFinding) DeepCopy ¶
func (in *RelatedFinding) DeepCopy() *RelatedFinding
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RelatedFinding.
func (*RelatedFinding) DeepCopyInto ¶
func (in *RelatedFinding) DeepCopyInto(out *RelatedFinding)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RelationshipType ¶
type RelationshipType string
RelationshipType classifies an edge between two findings. +kubebuilder:validation:Enum=duplicate-of;successor-of;related-to
const ( // RelationshipDuplicateOf: From was merged into To and deleted. RelationshipDuplicateOf RelationshipType = "duplicate-of" // RelationshipSuccessorOf: From is the next accumulation generation of To. RelationshipSuccessorOf RelationshipType = "successor-of" // RelationshipRelatedTo is a free-form association (human- or // machine-written). RelationshipRelatedTo RelationshipType = "related-to" )
Finding relationships.
type Remediation ¶
type Remediation struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RemediationSpec `json:"spec"`
// +optional
Status RemediationStatus `json:"status,omitempty"`
}
Remediation is one remediation attempt on a Finding: an agent job that implements the fix the referenced Investigation recommended, whose changeset is pushed as a branch and opened as a pull request. One immutable object per attempt, owned by the Finding; the changeset itself never appears here.
func (*Remediation) DeepCopy ¶
func (in *Remediation) DeepCopy() *Remediation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Remediation.
func (*Remediation) DeepCopyInto ¶
func (in *Remediation) DeepCopyInto(out *Remediation)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Remediation) DeepCopyObject ¶
func (in *Remediation) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RemediationList ¶
type RemediationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Remediation `json:"items"`
}
RemediationList contains a list of Remediation.
func (*RemediationList) DeepCopy ¶
func (in *RemediationList) DeepCopy() *RemediationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemediationList.
func (*RemediationList) DeepCopyInto ¶
func (in *RemediationList) DeepCopyInto(out *RemediationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RemediationList) DeepCopyObject ¶
func (in *RemediationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RemediationSpec ¶
type RemediationSpec struct {
// FindingRef is the owning Finding (UID-pinned).
FindingRef ObjectReference `json:"findingRef"`
// InvestigationRef is the analysis this run executes.
InvestigationRef ObjectReference `json:"investigationRef"`
// RepositoryRef names the Repository artifact the agent works from (the
// same SHA-pinned tree the investigation analysed).
RepositoryRef LocalObjectReference `json:"repositoryRef"`
// Attempt ordinal, 1-based.
// +kubebuilder:validation:Minimum=1
Attempt int32 `json:"attempt"`
// Priority is the scheduling priority (0–100) computed from the
// investigation results; the scheduler grants slots to the highest
// pending priority first.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=100
Priority int32 `json:"priority"`
// Parameters bound this run (clamped controller-side).
// +optional
Parameters AgentParameters `json:"parameters,omitempty"`
// ApprovedBy is the human whose approval caused this run, when it exists
// because of one.
// +optional
ApprovedBy string `json:"approvedBy,omitempty"`
// Revival marks a remediate-only run reviving a handed-off finding.
// +optional
Revival bool `json:"revival,omitempty"`
}
RemediationSpec identifies one remediation attempt. It is immutable — a new attempt is a new Remediation (CEL-enforced). +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable; create a new Remediation for a new attempt"
func (*RemediationSpec) DeepCopy ¶
func (in *RemediationSpec) DeepCopy() *RemediationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemediationSpec.
func (*RemediationSpec) DeepCopyInto ¶
func (in *RemediationSpec) DeepCopyInto(out *RemediationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RemediationStatus ¶
type RemediationStatus struct {
// Phase of the run. Pending runs wait in the priority queue; the
// scheduler's grant sets Running.
// +optional
Phase RunPhase `json:"phase,omitempty"`
// GrantedAt is when the scheduler granted the run its slot.
// +optional
GrantedAt *metav1.Time `json:"grantedAt,omitempty"`
// JobRef locates the agent Job in the agents namespace.
// +optional
JobRef *JobReference `json:"jobRef,omitempty"`
// Stage is the agent accounting for the run.
// +optional
Stage *StageResult `json:"stage,omitempty"`
// Success reports whether the agent produced a fix.
// +optional
Success bool `json:"success,omitempty"`
// Confidence decimal string in [0, 1].
// +optional
// +kubebuilder:validation:Pattern=`^(0(\.[0-9]{1,4})?|1(\.0{1,4})?)$`
Confidence string `json:"confidence,omitempty"`
// Branch carrying the pushed fix.
// +optional
Branch string `json:"branch,omitempty"`
// PushedCommit is the SHA of the pushed commit.
// +optional
PushedCommit string `json:"pushedCommit,omitempty"`
// PullRequest opened for the fix.
// +optional
PullRequest *PullRequestRef `json:"pullRequest,omitempty"`
// Report is the full remediation report markdown.
// +optional
// +kubebuilder:validation:MaxLength=65536
Report string `json:"report,omitempty"`
// Conditions of the run (Complete, RolledUp*).
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// ObservedGeneration is the last spec generation acted on.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}
RemediationStatus records the remediation results. Written only by remediation-controller.
func (*RemediationStatus) DeepCopy ¶
func (in *RemediationStatus) DeepCopy() *RemediationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemediationStatus.
func (*RemediationStatus) DeepCopyInto ¶
func (in *RemediationStatus) DeepCopyInto(out *RemediationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RemediationSummary ¶
type RemediationSummary struct {
// Name of the Remediation child.
Name string `json:"name"`
// Attempt ordinal.
Attempt int32 `json:"attempt"`
// Outcome of the stage (envelope vocabulary).
// +optional
Outcome string `json:"outcome,omitempty"`
// Success reports whether the agent produced a fix.
// +optional
Success bool `json:"success,omitempty"`
// Branch carrying the fix.
// +optional
Branch string `json:"branch,omitempty"`
// CompletedAt is when the remediation finished.
// +optional
CompletedAt *metav1.Time `json:"completedAt,omitempty"`
}
RemediationSummary mirrors the latest Remediation child onto the Finding.
func (*RemediationSummary) DeepCopy ¶
func (in *RemediationSummary) DeepCopy() *RemediationSummary
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemediationSummary.
func (*RemediationSummary) DeepCopyInto ¶
func (in *RemediationSummary) DeepCopyInto(out *RemediationSummary)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Repository ¶
type Repository struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RepositorySpec `json:"spec"`
// +optional
Status RepositoryStatus `json:"status,omitempty"`
}
Repository is a SHA-pinned clone artifact: source-controller clones the repository with Forge credentials and serves it as a tarball that agent jobs fetch credential-lessly. Owned by a Finding and garbage-collected with it.
func (*Repository) DeepCopy ¶
func (in *Repository) DeepCopy() *Repository
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Repository.
func (*Repository) DeepCopyInto ¶
func (in *Repository) DeepCopyInto(out *Repository)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Repository) DeepCopyObject ¶
func (in *Repository) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RepositoryList ¶
type RepositoryList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Repository `json:"items"`
}
RepositoryList contains a list of Repository.
func (*RepositoryList) DeepCopy ¶
func (in *RepositoryList) DeepCopy() *RepositoryList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositoryList.
func (*RepositoryList) DeepCopyInto ¶
func (in *RepositoryList) DeepCopyInto(out *RepositoryList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RepositoryList) DeepCopyObject ¶
func (in *RepositoryList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type RepositoryRef ¶
type RepositoryRef struct {
// Branch to resolve; source-controller resolves it to a SHA exactly once
// and pins status.resolvedSHA.
// +optional
Branch string `json:"branch,omitempty"`
}
RepositoryRef pins what to clone.
func (*RepositoryRef) DeepCopy ¶
func (in *RepositoryRef) DeepCopy() *RepositoryRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositoryRef.
func (*RepositoryRef) DeepCopyInto ¶
func (in *RepositoryRef) DeepCopyInto(out *RepositoryRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RepositorySpec ¶
type RepositorySpec struct {
// URL is the normalized https URL of the repository to clone.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec.url is immutable"
URL string `json:"url"`
// Ref selects what to clone.
// +optional
Ref RepositoryRef `json:"ref,omitempty"`
}
RepositorySpec asks source-controller to produce a SHA-pinned clone artifact of one repository.
func (*RepositorySpec) DeepCopy ¶
func (in *RepositorySpec) DeepCopy() *RepositorySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositorySpec.
func (*RepositorySpec) DeepCopyInto ¶
func (in *RepositorySpec) DeepCopyInto(out *RepositorySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RepositoryStatus ¶
type RepositoryStatus struct {
// Conditions of the repository (Ready: artifact available; Stalled:
// cannot clone or artifact over the size cap).
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
// ObservedGeneration is the last spec generation acted on.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// ResolvedSHA is the commit the artifact is pinned to; investigation and
// remediation both work this exact tree, and it is the push base.
// +optional
ResolvedSHA string `json:"resolvedSHA,omitempty"`
// Forge names the Forge whose credentials cloned the repository.
// +optional
Forge *LocalObjectReference `json:"forge,omitempty"`
// Artifact is the served tarball.
// +optional
Artifact *Artifact `json:"artifact,omitempty"`
}
RepositoryStatus is the repository artifact's observed state.
func (*RepositoryStatus) DeepCopy ¶
func (in *RepositoryStatus) DeepCopy() *RepositoryStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositoryStatus.
func (*RepositoryStatus) DeepCopyInto ¶
func (in *RepositoryStatus) DeepCopyInto(out *RepositoryStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RepositoryType ¶
type RepositoryType string
RepositoryType identifies the forge family a repository lives on. +kubebuilder:validation:Enum=github
const (
RepositoryTypeGitHub RepositoryType = "github"
)
Repository types.
type RollupBucket ¶
type RollupBucket struct {
// Findings counted (one per finding reaching a terminal phase, corrected
// on revival).
// +optional
Findings int64 `json:"findings,omitempty"`
// Phases histogram of terminal phases (remediated, failed, dismissed,
// handedOff, deleted).
// +optional
Phases map[string]int64 `json:"phases,omitempty"`
// Recommendations histogram of verdicts (remediate, ignore, manual).
// +optional
Recommendations map[string]int64 `json:"recommendations,omitempty"`
// Attempts summed across findings.
// +optional
Attempts int64 `json:"attempts,omitempty"`
// Stages aggregates per stage ("investigation", "remediation").
// +optional
Stages map[string]StageAggregate `json:"stages,omitempty"`
}
RollupBucket accumulates finding-level counters within a scope. Total and repository scopes carry everything; harness and model scopes carry only the stages aggregates (a finding has no single harness/model owner).
func (*RollupBucket) DeepCopy ¶
func (in *RollupBucket) DeepCopy() *RollupBucket
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollupBucket.
func (*RollupBucket) DeepCopyInto ¶
func (in *RollupBucket) DeepCopyInto(out *RollupBucket)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RollupScope ¶
type RollupScope struct {
// Type of the dimension.
Type ScopeType `json:"type"`
// Key is the dimension value ("" for total, "owner/repo", harness ID,
// model ID). The sanitized form appears in labels; this field is truth.
// +optional
Key string `json:"key,omitempty"`
}
RollupScope identifies one dimension value. Rollups are sharded — one small object per scope value — because a single object holding a per-repo map would exceed etcd's object cap at estate scale (~15K repositories).
func (*RollupScope) DeepCopy ¶
func (in *RollupScope) DeepCopy() *RollupScope
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollupScope.
func (*RollupScope) DeepCopyInto ¶
func (in *RollupScope) DeepCopyInto(out *RollupScope)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RunKind ¶
type RunKind string
RunKind discriminates the two agent run kinds. +kubebuilder:validation:Enum=investigation;remediation
type RunPhase ¶
type RunPhase string
RunPhase is the lifecycle of one agent run (an Investigation or Remediation child). +kubebuilder:validation:Enum=Pending;Running;Complete;Failed
type ScopeType ¶
type ScopeType string
ScopeType is a rollup dimension. +kubebuilder:validation:Enum=total;repository;harness;model
type StageAggregate ¶
type StageAggregate struct {
// Runs counted.
// +optional
Runs int64 `json:"runs,omitempty"`
// Succeeded runs (outcome ok; for remediation, success=true).
// +optional
Succeeded int64 `json:"succeeded,omitempty"`
// Outcomes histogram (envelope outcome vocabulary + "aborted").
// +optional
Outcomes map[string]int64 `json:"outcomes,omitempty"`
// InputTokens summed.
// +optional
InputTokens int64 `json:"inputTokens,omitempty"`
// OutputTokens summed.
// +optional
OutputTokens int64 `json:"outputTokens,omitempty"`
// CacheReadTokens summed.
// +optional
CacheReadTokens int64 `json:"cacheReadTokens,omitempty"`
// CacheCreationTokens summed.
// +optional
CacheCreationTokens int64 `json:"cacheCreationTokens,omitempty"`
// CostMicroUSD summed (micro-USD, exact integer arithmetic).
// +optional
CostMicroUSD int64 `json:"costMicroUSD,omitempty"`
// ElapsedMilliseconds summed.
// +optional
ElapsedMilliseconds int64 `json:"elapsedMilliseconds,omitempty"`
}
StageAggregate accumulates one stage's runs within a scope. Averages and rates are computed client-side from sum ÷ count — merge-idempotent and exact.
func (*StageAggregate) DeepCopy ¶
func (in *StageAggregate) DeepCopy() *StageAggregate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StageAggregate.
func (*StageAggregate) DeepCopyInto ¶
func (in *StageAggregate) DeepCopyInto(out *StageAggregate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StageResult ¶
type StageResult struct {
// Outcome is the envelope outcome vocabulary (ok, runtime_error, timeout,
// budget_exceeded, report_missing, report_invalid, commit_failed,
// changeset_too_large) plus "aborted" for a run killed with no envelope.
Outcome string `json:"outcome"`
// Harness that executed the stage.
// +optional
Harness string `json:"harness,omitempty"`
// Model the stage ran on.
// +optional
Model string `json:"model,omitempty"`
// SessionID of the harness session.
// +optional
SessionID string `json:"sessionID,omitempty"`
// NumTurns the agent took.
// +optional
NumTurns int32 `json:"numTurns,omitempty"`
// Usage accounting for the stage.
// +optional
Usage UsageSummary `json:"usage,omitempty"`
// StartedAt is when the stage began.
// +optional
StartedAt *metav1.Time `json:"startedAt,omitempty"`
// FinishedAt is when the stage ended.
// +optional
FinishedAt *metav1.Time `json:"finishedAt,omitempty"`
// ElapsedMilliseconds is the stage's wall-clock duration.
// +optional
ElapsedMilliseconds int64 `json:"elapsedMilliseconds,omitempty"`
// Detail explains a non-ok outcome for humans.
// +optional
// +kubebuilder:validation:MaxLength=4096
Detail string `json:"detail,omitempty"`
}
StageResult records how one agent stage ran, mirroring the agent envelope's stage block losslessly (sessionID is never truncated).
func (*StageResult) DeepCopy ¶
func (in *StageResult) DeepCopy() *StageResult
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StageResult.
func (*StageResult) DeepCopyInto ¶
func (in *StageResult) DeepCopyInto(out *StageResult)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TrackingStatus ¶
type TrackingStatus struct {
// Integration that owns the projection.
Integration string `json:"integration"`
// IssueNumber of the tracking item.
// +optional
IssueNumber int64 `json:"issueNumber,omitempty"`
// URL of the tracking item.
// +optional
URL string `json:"url,omitempty"`
// State of the tracking item (open/closed).
// +optional
State string `json:"state,omitempty"`
}
TrackingStatus links the finding to its projected tracking item.
func (*TrackingStatus) DeepCopy ¶
func (in *TrackingStatus) DeepCopy() *TrackingStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrackingStatus.
func (*TrackingStatus) DeepCopyInto ¶
func (in *TrackingStatus) DeepCopyInto(out *TrackingStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UsageSummary ¶
type UsageSummary struct {
// InputTokens consumed.
// +optional
InputTokens int64 `json:"inputTokens,omitempty"`
// OutputTokens produced.
// +optional
OutputTokens int64 `json:"outputTokens,omitempty"`
// CacheReadTokens read from prompt cache.
// +optional
CacheReadTokens int64 `json:"cacheReadTokens,omitempty"`
// CacheCreationTokens written to prompt cache.
// +optional
CacheCreationTokens int64 `json:"cacheCreationTokens,omitempty"`
// CostUSD is the harness-reported cost as a decimal string (structural
// schemas forbid floats).
// +optional
// +kubebuilder:validation:Pattern=`^[0-9]+(\.[0-9]{1,6})?$`
CostUSD string `json:"costUSD,omitempty"`
}
UsageSummary is one agent run's token and cost accounting. Zeroes mean the harness did not report the figure.
func (*UsageSummary) DeepCopy ¶
func (in *UsageSummary) DeepCopy() *UsageSummary
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UsageSummary.
func (*UsageSummary) DeepCopyInto ¶
func (in *UsageSummary) DeepCopyInto(out *UsageSummary)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.