v0.1.0 · Apache 2.0

Search docs...

GitOps Artifacts

How Recif uses Git as the source of truth for agent configuration, with immutable versioned artifacts and full audit trail.

6 min read

Overview

Agent configuration in Recif is stored as immutable versioned artifacts in a dedicated Git repository called recif-state. Every configuration change is a Git commit, every version is diffable, and the entire deployment history is auditable. This design prepares for full ArgoCD integration.

recif-state Repository Structure

recif-state/
  agents/
    support-agent/
      current.yaml              # Active release (symlink-like)
      releases/
        v1.yaml                 # Initial deployment
        v2.yaml                 # Prompt update
        v3.yaml                 # Model change
        v4.yaml                 # Rejected (failed eval)
        v5.yaml                 # Current active release
    code-reviewer/
      current.yaml
      releases/
        v1.yaml
        v2.yaml
    deleted-agent/
      current.yaml              # Tombstone (status: deleted)
      releases/
        v1.yaml
        v2.yaml

Each agent has a directory named after its slug, containing:

  • current.yaml -- The currently active release artifact
  • releases/ -- Immutable versioned release artifacts (never modified after commit)

Artifact YAML Format

Every release artifact follows the AgentRelease schema:

apiVersion: agents.recif.dev/v1
kind: AgentRelease
metadata:
  name: support-agent
  version: 5
  previous: 4
  author: recif-api
  timestamp: "2026-04-03T10:00:00Z"
  changelog: "Updated system prompt for better greeting"
  checksum: "a1b2c3d4e5f6..."
  status: active
runtime:
  image: "corail:latest"
  channel: rest
  strategy: agent-react
  replicas: 2
  resources:
    requests:
      cpu: "100m"
      memory: "256Mi"
    limits:
      cpu: "500m"
      memory: "512Mi"
agent:
  model:
    provider: openai
    id: gpt-4
  system_prompt: |
    You are a helpful customer support agent.
    Always greet the user warmly.
  skills:
    - agui-render
  tools:
    - web-search
  knowledge_bases:
    - kb_products
  memory:
    backend: postgresql
governance:
  guards:
    - pii-detection
  risk_profile: standard
  policies:
    - default
  eval_dataset: golden-qa
  min_quality_score: 75
deployment:
  namespace: team-default
  environment: development

Field Reference

metadata:

FieldTypeDescription
namestringAgent slug (matches directory name)
versionintMonotonically increasing version number
previousintPrevious version number (0 for first release)
authorstringWho created the release (usually recif-api)
timestampstringISO 8601 timestamp of release creation
changelogstringHuman-readable description of what changed
checksumstringSHA-256 hash of the artifact (excluding checksum field)
statusstringRelease status: pending_eval, active, rejected, archived, deleted

runtime:

FieldTypeDescription
imagestringContainer image for the agent
channelstringCommunication channel (default: rest)
strategystringAgent strategy (default: agent-react)
replicasintNumber of pod replicas
resourcesobjectKubernetes resource requests/limits

agent:

FieldTypeDescription
model.providerstringLLM provider key
model.idstringModel identifier
system_promptstringThe agent's instruction set
skills[]stringAssigned skill IDs
tools[]stringAssigned tool names
knowledge_bases[]stringAttached knowledge base IDs
memory.backendstringMemory storage backend

governance:

FieldTypeDescription
guards[]stringActive guard names
risk_profilestringlow, standard, or high
policies[]stringApplied policy names
eval_datasetstringGolden dataset name for evaluations
min_quality_scoreintMinimum score (0-100) for eval gate

deployment:

FieldTypeDescription
namespacestringTarget Kubernetes namespace
environmentstringEnvironment label

Status Transitions

pending_eval --> active      (evaluation passed)
pending_eval --> rejected    (evaluation failed)
active       --> archived    (newer version activated)
any          --> deleted     (agent deleted from platform)
StatusMeaning
pending_evalRelease created, waiting for evaluation results
activeCurrently deployed to production (written to current.yaml)
rejectedFailed evaluation, not deployed. Changelog appended with [REJECTED: reason]
archivedPreviously active, superseded by a newer version
deletedAgent was deleted. Tombstone preserves metadata for audit

Tombstones

When an agent is deleted, its current.yaml is overwritten with a tombstone:

apiVersion: agents.recif.dev/v1
kind: AgentRelease
metadata:
  name: support-agent
  status: deleted
  deleted_at: "2026-04-03T10:00:00Z"
  changelog: "[DELETED] Updated system prompt for better greeting"

The release history files (v1.yaml, v2.yaml, ...) are preserved. This ensures a complete audit trail even for deleted agents.

How to Diff Versions

Compare any two releases via the API:

curl "http://localhost:8080/api/v1/agents/ag_01J.../releases/diff?from=3&to=5"

Response:

{
  "data": [
    { "path": "agent.model.provider", "from": "ollama", "to": "openai" },
    { "path": "agent.model.id", "from": "qwen3.5:35b", "to": "gpt-4" },
    { "path": "agent.system_prompt", "from": "You are helpful.", "to": "You are a helpful support agent." },
    { "path": "runtime.replicas", "from": 1, "to": 2 }
  ]
}

The diff excludes metadata fields that always change between versions (version, previous, timestamp, checksum, changelog).

Rollback to Any Version

Deploy any previous release to restore an older configuration:

curl -X POST http://localhost:8080/api/v1/agents/ag_01J.../releases/3/deploy

This:

  1. Reads the target release artifact (v3.yaml)
  2. Overwrites current.yaml with the target artifact
  3. Patches the Kubernetes CRD with the restored configuration
  4. Emits a ReleaseDeployed event

Checksum Verification

Every artifact includes a SHA-256 checksum computed from the YAML serialization (with the checksum field zeroed). This enables:

  • Integrity verification -- detect tampering or corruption
  • Duplicate detection -- skip creating a release if nothing changed
  • Audit compliance -- prove that the deployed config matches the committed artifact

ArgoCD Integration (Planned)

The recif-state repository is designed to work as an ArgoCD Application source:

  1. ArgoCD watches recif-state for changes to current.yaml files
  2. When a new release is approved, ArgoCD detects the commit
  3. ArgoCD applies the configuration to the Kubernetes cluster
  4. The Recif operator reconciles the Agent CRD

This enables a fully GitOps-native workflow where Git is the single source of truth and all changes flow through version-controlled commits.

Note

ArgoCD integration is planned for v0.2. Currently, the Recif API commits directly torecif-statevia the GitHub API, and the operator applies changes directly to K8s.

Tip

You can browse therecif-staterepository in any Git UI to see the complete history of every agent. Each commit message includes the agent slug, version, and changelog.