Goal

A high-level objective with acceptance criteria that defines the desired outcome.

Overview

Goals represent what you want to achieve. They define the desired outcome in human-readable terms, along with optional acceptance criteria that specify when the goal is considered complete. Goals are typically referenced by Plans, which describe how to achieve them.

Schema

yaml
apiVersion: planspec.io/v1alpha1
kind: Goal
metadata:
  name: string          # Required, unique identifier
  namespace: string     # Required, resource namespace
  labels: object        # Optional, key-value pairs for organization
  annotations: object   # Optional, arbitrary metadata
spec:
  description: string   # Required, human-readable description of the goal
  acceptanceCriteria:   # Optional, list of criteria objects
    - description: string  # Required, what must be true
      id: string           # Optional, unique identifier for reference
  constraints: object    # Optional, execution constraints
  planSelector: object   # Optional, criteria for selecting plans
  timeout: string        # Optional, time limit for achieving the goal
  priority: number       # Optional, goal priority level
  context: object[]      # Optional, contextual attachments
status:
  phase: string          # Goal lifecycle phase
  activePlanRef: object  # Reference to the currently active plan
  conditions: object[]   # Status conditions
  observedGeneration: number  # Last observed generation

Fields

Spec Fields

FieldTypeRequiredDescription
descriptionstringYesHuman-readable description of the desired outcome
acceptanceCriteriaobject[]NoArray of criteria that define success
acceptanceCriteria[].descriptionstringYesWhat must be true for this criterion
acceptanceCriteria[].idstringNoUnique identifier for referencing this criterion
constraintsobjectNoExecution constraints for the goal
planSelectorobjectNoCriteria for selecting plans to achieve this goal
timeoutstringNoTime limit for achieving the goal (e.g., "2h", "30m")
prioritynumberNoGoal priority level (higher = more important)
contextobject[]NoContextual attachments for plan generation

Metadata Fields

FieldTypeRequiredDescription
namestringYesUnique identifier for the goal
namespacestringYesResource namespace
labelsobjectNoKey-value pairs for filtering and organization
annotationsobjectNoArbitrary metadata

Status Fields

FieldTypeDescription
phasestringCurrent goal lifecycle phase
activePlanRefobjectReference to the plan currently being executed
conditionsobject[]Status conditions with type, status, reason, message
observedGenerationnumberLast observed spec generation

Goal Phases

PhaseDescription
PendingGoal created but no plan assigned
PlanningPlan is being generated for this goal
ReadyPlan assigned and ready for execution
ExecutingPlan is currently being executed
SucceededGoal achieved, acceptance criteria met
FailedGoal could not be achieved
CancelledGoal was cancelled before completion

Example

yaml
apiVersion: planspec.io/v1alpha1
kind: Goal
metadata:
  name: user-authentication
  namespace: default
  labels:
    component: auth
    priority: high
  annotations:
    planspec.io/created-by: "alice@example.com"
spec:
  description: Implement secure user authentication for the web application
  priority: 100
  timeout: "8h"
  acceptanceCriteria:
    - id: signup
      description: Users can sign up with email and password
    - id: password-security
      description: Passwords are hashed using bcrypt with cost factor 12
    - id: jwt-expiry
      description: JWT tokens expire after 24 hours
    - id: refresh-tokens
      description: Refresh tokens allow session extension without re-authentication

JSON Schema

The full JSON Schema is available at: Goal Schema

Next Steps