Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ All agent-facing guidance for this repository. Read this file first.
## What this project is

A Kubernetes controller for managing AI agent workloads. Defines CRDs
(Agent, AgentRun, AgentPlaybook, SkillCard, SkillCollection,
LLMProvider) and controllers for composing and executing agent
(Agent, AgentRun, AgentWorkflow, AgentWorkflowRun, SkillCard,
SkillCollection, LLMProvider) and controllers for composing and executing agent
workloads via Agent Sandbox.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

## Key documents
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ CI pipeline) resolves application metadata before creating the CR.
| **LLMProvider** | LLM service endpoint, credentials, and available models. |
| **Agent** | Template declaring available skills, providers, container image, prompt, and typed parameters. |
| **AgentRun** | Execute a single Agent with specific values. Creates an Agent Sandbox. |
| **AgentPlaybook** | Ordered sequence of stages, each referencing an Agent. |
| **AgentPlaybookRun** | Execute a playbook. Creates AgentRuns sequentially per stage. |
| **AgentWorkflow** | Ordered sequence of stages, each referencing an Agent. |
| **AgentWorkflowRun** | Execute a workflow. Creates AgentRuns sequentially per stage. |

### Key design decisions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// AgentPlaybookStage defines one stage in a playbook.
// AgentWorkflowStage defines one stage in a workflow.
// Each stage references an Agent and carries instructions.
type AgentPlaybookStage struct {
// Name is the stage name, unique within the playbook.
type AgentWorkflowStage struct {
// Name is the stage name, unique within the workflow.
// Must be a valid Kubernetes label value (lowercase alphanumeric,
// hyphens, dots, max 63 chars) since it is used in labels on
// child AgentRun resources.
Expand All @@ -42,8 +42,8 @@ type AgentPlaybookStage struct {
Instructions string `json:"instructions,omitempty"`
}

// AgentPlaybookSpec defines the desired state of an AgentPlaybook.
type AgentPlaybookSpec struct {
// AgentWorkflowSpec defines the desired state of an AgentWorkflow.
type AgentWorkflowSpec struct {
// Guide is a high-level guide providing ambient context for all stages.
// Written as a context file in the workspace so each agent understands
// where its work fits in the bigger picture.
Expand All @@ -57,17 +57,17 @@ type AgentPlaybookSpec struct {
// +kubebuilder:validation:MinItems=1
// +listType=map
// +listMapKey=name
Stages []AgentPlaybookStage `json:"stages"`
Stages []AgentWorkflowStage `json:"stages"`
}

// AgentPlaybookStatus defines the observed state of an AgentPlaybook.
type AgentPlaybookStatus struct {
// AgentWorkflowStatus defines the observed state of an AgentWorkflow.
type AgentWorkflowStatus struct {
// ObservedGeneration is the most recent generation observed by the controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// Conditions represent the latest available observations of the
// AgentPlaybook's state.
// AgentWorkflow's state.
// +optional
// +listType=map
// +listMapKey=type
Expand All @@ -76,27 +76,27 @@ type AgentPlaybookStatus struct {

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=ap
// +kubebuilder:resource:shortName=aw
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// AgentPlaybook is a reusable playbook combining a high-level guide with an
// AgentWorkflow is a reusable workflow combining a high-level guide with an
// ordered sequence of stages. Each stage references an Agent and carries
// instructions. An AgentPlaybook is a template — creating one does not
// instructions. An AgentWorkflow is a template — creating one does not
// execute anything.
type AgentPlaybook struct {
type AgentWorkflow struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec AgentPlaybookSpec `json:"spec,omitempty"`
Status AgentPlaybookStatus `json:"status,omitempty"`
Spec AgentWorkflowSpec `json:"spec,omitempty"`
Status AgentWorkflowStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// AgentPlaybookList contains a list of AgentPlaybook.
type AgentPlaybookList struct {
// AgentWorkflowList contains a list of AgentWorkflow.
type AgentWorkflowList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AgentPlaybook `json:"items"`
Items []AgentWorkflow `json:"items"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// AgentPlaybookRunStageStatus tracks the status of a single stage within
// a playbook run.
type AgentPlaybookRunStageStatus struct {
// Name is the stage name, matching a stage in the AgentPlaybook.
// AgentWorkflowRunStageStatus tracks the status of a single stage within
// a workflow run.
type AgentWorkflowRunStageStatus struct {
// Name is the stage name, matching a stage in the AgentWorkflow.
Name string `json:"name"`

// Phase is the current phase of this stage.
Expand All @@ -35,13 +35,13 @@ type AgentPlaybookRunStageStatus struct {
AgentRunName string `json:"agentRunName,omitempty"`
}

// AgentPlaybookRunSpec defines the desired state of an AgentPlaybookRun.
// AgentWorkflowRunSpec defines the desired state of an AgentWorkflowRun.
// The spec is immutable once created — delete and recreate to change values.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable"
type AgentPlaybookRunSpec struct {
// PlaybookRef is the name of the AgentPlaybook CR to execute.
type AgentWorkflowRunSpec struct {
// WorkflowRef is the name of the AgentWorkflow CR to execute.
// +kubebuilder:validation:MinLength=1
PlaybookRef string `json:"playbookRef"`
WorkflowRef string `json:"workflowRef"`

// Models selects specific provider/model combinations for all stages.
// Individual stages may override these selections in the future.
Expand All @@ -67,9 +67,9 @@ type AgentPlaybookRunSpec struct {
EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`
}

// AgentPlaybookRunStatus defines the observed state of an AgentPlaybookRun.
type AgentPlaybookRunStatus struct {
// Phase is the current phase of the overall playbook run.
// AgentWorkflowRunStatus defines the observed state of an AgentWorkflowRun.
type AgentWorkflowRunStatus struct {
// Phase is the current phase of the overall workflow run.
// +kubebuilder:default=Pending
// +optional
Phase AgentRunPhase `json:"phase,omitempty"`
Expand All @@ -86,18 +86,18 @@ type AgentPlaybookRunStatus struct {
// +optional
// +listType=map
// +listMapKey=name
Stages []AgentPlaybookRunStageStatus `json:"stages,omitempty"`
Stages []AgentWorkflowRunStageStatus `json:"stages,omitempty"`

// StartTime is the time the playbook run started.
// StartTime is the time the workflow run started.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`

// CompletionTime is the time the playbook run finished.
// CompletionTime is the time the workflow run finished.
// +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty"`

// Conditions represent the latest available observations of the
// AgentPlaybookRun's state.
// AgentWorkflowRun's state.
// +optional
// +listType=map
// +listMapKey=type
Expand All @@ -106,29 +106,29 @@ type AgentPlaybookRunStatus struct {

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=apr
// +kubebuilder:printcolumn:name="Playbook",type=string,JSONPath=`.spec.playbookRef`
// +kubebuilder:resource:shortName=awr
// +kubebuilder:printcolumn:name="Workflow",type=string,JSONPath=`.spec.workflowRef`
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Current Stage",type=string,JSONPath=`.status.currentStage`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// AgentPlaybookRun is a request to execute an AgentPlaybook. It references
// an AgentPlaybook and carries generic parameters. The controller orchestrates
// AgentWorkflowRun is a request to execute an AgentWorkflow. It references
// an AgentWorkflow and carries generic parameters. The controller orchestrates
// execution: creates an AgentRun per stage, manages cross-stage handoff via
// committed files on a shared target branch.
type AgentPlaybookRun struct {
type AgentWorkflowRun struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec AgentPlaybookRunSpec `json:"spec,omitempty"`
Status AgentPlaybookRunStatus `json:"status,omitempty"`
Spec AgentWorkflowRunSpec `json:"spec,omitempty"`
Status AgentWorkflowRunStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// AgentPlaybookRunList contains a list of AgentPlaybookRun.
type AgentPlaybookRunList struct {
// AgentWorkflowRunList contains a list of AgentWorkflowRun.
type AgentWorkflowRunList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AgentPlaybookRun `json:"items"`
Items []AgentWorkflowRun `json:"items"`
}
8 changes: 4 additions & 4 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion,
&Agent{},
&AgentList{},
&AgentPlaybook{},
&AgentPlaybookList{},
&AgentPlaybookRun{},
&AgentPlaybookRunList{},
&AgentWorkflow{},
&AgentWorkflowList{},
&AgentWorkflowRun{},
&AgentWorkflowRunList{},
&AgentRun{},
&AgentRunList{},
&LLMProvider{},
Expand Down
Loading
Loading