Zylos Logo
Zylos
2026-02-26

Document-Driven Upgrade Pipelines for AI Agent Platforms

upgrade-pipelinesmanifestsdeclarativegitopsai-agentsdevopsautomationmigration

Executive Summary

As AI agent platforms mature from experimental tools into production infrastructure, one of the most pressing operational challenges is managing component upgrades safely and predictably. Ad-hoc upgrade scripts and manual procedures are brittle; they leave no audit trail, cannot be rolled back cleanly, and scale poorly across distributed environments.

Document-driven upgrade pipelines address this by encoding all upgrade intent into structured manifest files — YAML, JSON, or custom DSL documents that declare what must change, what constraints must be satisfied, and what constitutes success. The pipeline then executes this manifest mechanically, with human oversight at key gates and automated rollback when invariants are violated.

This research examines the principles, patterns, and practical implementation of document-driven upgrade pipelines, with particular attention to AI agent platforms where components may be live services, LLM skill plugins, or autonomously-running processes.


The Problem With Imperative Upgrades

Traditional upgrade scripts are imperative: they say "do this, then do that." This works fine for one-off migrations but creates serious problems at scale:

No Single Source of Truth. An upgrade script that ran six months ago may have been modified in place. There is no record of what actually executed versus what was planned. Debugging a failed partial upgrade means reading logs and code simultaneously.

No Idempotency Guarantee. Running the same script twice can corrupt state. Most scripts assume a clean starting point, but production systems accumulate drift — partial failures, manual interventions, and previously-applied patches leave the system in an unknown state.

Poor Composability. Scripts that upgrade component A and component B independently may produce conflicting results when run together. Dependency ordering must be hand-coded into each script rather than derived automatically from a dependency graph.

Difficult Rollback. Imperative scripts rarely implement clean inverse operations. Rolling back a multi-step upgrade often requires a separate rollback script that must be maintained in sync with the original — a discipline that erodes under time pressure.

Document-driven pipelines invert this model. The document (manifest) describes what the world should look like. The pipeline compares current state to desired state and generates the minimal set of operations needed to close the gap.


Core Concepts

The Upgrade Manifest

An upgrade manifest is a structured document that declares the desired end-state of a system component or set of components. A minimal manifest for an AI agent platform component might look like:

apiVersion: zylos.ai/v1
kind: UpgradeManifest
metadata:
  name: scheduler-v2-upgrade
  created: "2026-02-26"
  author: "automated"
spec:
  target:
    component: scheduler
    currentVersion: "1.3.0"
    targetVersion: "2.0.0"
  constraints:
    - type: dependency
      requires: comm-bridge >= 1.5.0
    - type: healthCheck
      endpoint: /health
      timeout: 30s
  phases:
    - name: pre-upgrade
      steps:
        - snapshot: database
        - drain: active-tasks
    - name: upgrade
      steps:
        - deploy: scheduler@2.0.0
        - migrate: schema-v1-to-v2
    - name: post-upgrade
      steps:
        - verify: smoke-tests
        - cleanup: old-binaries
  rollback:
    trigger: any-phase-failure
    strategy: restore-snapshot

This document contains everything needed to execute, audit, and reverse the upgrade. No separate documentation required; the manifest is the documentation.

Desired-State Reconciliation

Borrowed from Kubernetes' controller pattern, desired-state reconciliation means the pipeline continuously compares the system's actual state against the declared desired state and works to close the gap. This is fundamentally different from running upgrade scripts that assume a particular starting state.

When a reconciler runs:

  1. It reads the current manifest (desired state)
  2. It queries the actual state of each declared component
  3. It computes a diff — what must change
  4. It applies changes in dependency order
  5. It verifies post-conditions before marking the manifest applied

The power of this approach is that it is idempotent by design. Running the reconciler twice produces the same result, because it only applies changes needed to reach the declared state. If the first run partially succeeded, the second run detects which steps already completed and skips them.

Manifest Versioning and SchemaVer

Manifests themselves need versioning as their schema evolves. The software industry defaults to SemVer for this, but AI agent platforms often deal with data-carrying manifests that need a different contract. Snowplow's SchemaVer offers a useful alternative taxonomy:

  • ADDITION: New optional fields added. All existing data still valid. Safe to deploy older agents reading newer manifests.
  • REVISION: Field semantics changed for some historical data. Older agents may misinterpret some records.
  • MODEL: Breaking schema change. Historical data is incompatible with the new schema.

For upgrade manifests, MODEL changes require the highest gate: human approval plus a coordination window where no upgrades of the affected component are in flight.


The GitOps Operator Pattern

The most battle-tested implementation of document-driven upgrades at scale is the GitOps operator pattern, popularized by Kubernetes tooling like Argo CD and Flux. The pattern has three pillars:

Git as the source of truth. All desired states live in version-controlled manifest files. Changes to desired state are made through commits and pull requests, not through direct system mutations. This gives you a complete, immutable audit history of every intended upgrade.

Operators as reconcilers. A continuously-running operator (controller) watches the Git repository for changes and reconciles the live system toward the declared state. The operator handles rollbacks when health checks fail post-deployment.

Declarative configuration with drift detection. The operator periodically compares live state to declared state and alerts (or auto-remediates) when they diverge. Drift — the accumulation of manual changes that weren't captured in Git — becomes immediately visible.

For AI agent platforms, this pattern translates naturally: skills, components, and service configurations live in a versioned manifest repository. When the platform operator detects a new commit, it applies the changes, runs health checks, and rolls back automatically if the new version fails to serve healthy responses within a configured timeout.


Multi-Agent Upgrade Orchestration

AI agent platforms introduce a unique challenge: some components being upgraded are themselves agents that may be running tasks during the upgrade window. A document-driven approach handles this through explicit coordination phases:

The Drain-Upgrade-Verify Sequence

The safest upgrade sequence for live agent processes is:

  1. Signal: Publish an upgrade intent event to all affected components. Components acknowledge receipt.
  2. Drain: Stop routing new work to the target component. Allow in-flight tasks to complete (with timeout).
  3. Snapshot: Capture state (database, task queue, configuration) as a rollback point.
  4. Upgrade: Deploy the new version. Apply any schema migrations.
  5. Smoke Test: Run a suite of fast validation checks against the new version.
  6. Verify: Run full integration tests if smoke tests pass.
  7. Cut Over: Resume routing work to the new version.
  8. Cleanup: Remove the rollback snapshot after a stability window.

Each of these steps can be declared in the upgrade manifest, making the sequence explicit, auditable, and automatable. A failed step triggers the rollback branch, which restores from the snapshot and re-routes traffic to the previous version.

Agent-Specific Considerations

Unlike traditional software upgrades, AI agent components may carry conversation state, active task contexts, and in-memory knowledge that cannot trivially be serialized. Upgrade manifests for agent components should declare:

  • State externalization requirements: Which state must be persisted to external storage before upgrade
  • Session continuity policy: Whether active sessions should be migrated, terminated gracefully, or allowed to finish on the old version (blue-green)
  • Capability compatibility: Which tool APIs the new version still supports, for downstream components that depend on them

Dependency Graphs and Ordering

One of the most error-prone aspects of manual upgrades is getting the dependency ordering right. If component B depends on component A's new API, upgrading B before A will fail — but the failure may be subtle, appearing only under certain load conditions.

Document-driven pipelines solve this by encoding dependencies explicitly in the manifest and computing a topologically sorted execution order automatically. The pipeline refuses to apply a manifest where the dependency graph contains cycles (circular dependencies that cannot be resolved) and surfaces this constraint violation before any upgrade begins.

For AI agent platforms, dependency ordering typically follows this pattern:

Core Infrastructure (DB, message queue)
  → Platform Services (auth, routing, storage)
    → Agent Runtime (memory, scheduler, comm-bridge)
      → Skills and Plugins (task-specific capabilities)
        → User-facing interfaces (web console, API gateway)

An upgrade manifest that targets a skill plugin need only declare its direct dependencies; the pipeline infers the full transitive dependency set automatically.


Automated Tools and Ecosystem

The dependency automation ecosystem has matured significantly, with two tools dominating practical usage:

Renovate Bot

Renovate is the most capable document-driven dependency update tool available today. It supports 90+ package managers, generates structured pull requests as its upgrade manifests, and offers granular grouping rules that allow hundreds of dependency updates to be batched intelligently.

Key capabilities for AI agent platforms:

  • Preset configurations: Shared renovate.json presets let an organization standardize upgrade policies across all repositories
  • Automerge with confidence thresholds: Patch updates can be automatically merged after passing CI; minor and major updates require human review
  • Custom managers: Renovate can parse custom manifest formats beyond standard package managers, enabling it to manage AI model versions, plugin versions, and configuration schema versions alongside code dependencies

Dependabot

GitHub's native dependency updater is simpler but more constrained. It covers 30+ ecosystems and requires zero external setup for GitHub-hosted repositories. For teams without complex multi-repo coordination needs, Dependabot's zero-configuration approach is attractive.

The key limitation for AI agent platforms is Dependabot's weak support for custom dependency types and its inability to express the rich grouping and coordination semantics needed for orchestrated component upgrades.


Schema Evolution and Breaking Change Detection

A perennial challenge in document-driven pipelines is detecting when a manifest schema change is breaking. AI agent platforms accumulate years of stored manifests — archived upgrade records, task definitions, and configuration snapshots. A breaking schema change can silently corrupt the ability to replay or audit historical operations.

SchemaVer discipline for manifest schemas:

  • Treat stored manifests as data, not just configuration
  • Never modify the meaning of existing fields — add new optional fields instead
  • When semantic changes are unavoidable, bump the MODEL version and provide a migration converter
  • Test schema changes against a corpus of historical manifests before deployment

Automated breaking change detection tools like resemver use AI to analyze whether a version bump accurately reflects the scope of changes. For internal schema changes, custom linting rules in CI can flag field removals, type changes, and constraint narrowings as potential breaking changes requiring human review.


Rollback Strategies

No upgrade pipeline is complete without a well-defined rollback strategy. Document-driven pipelines offer several rollback patterns:

Snapshot Restore: Before upgrade, capture a complete snapshot of the component's state. On failure, restore the snapshot and resume with the previous version. This is the safest strategy but requires sufficient storage and introduces a consistency window during restore.

Blue-Green Deployment: Run old and new versions simultaneously, routing traffic to the new version after verification. Rollback is instant — just redirect traffic back to the old version. The trade-off is doubled resource consumption during the upgrade window.

Canary Deployment: Route a small percentage of traffic to the new version. Monitor error rates and latency. If metrics degrade, route all traffic back to the old version. This strategy minimizes blast radius for user-facing components.

Feature Flag Rollback: For behavior changes that don't require binary deployment changes, feature flags can be toggled independently of deployment. The new behavior is deployed dark and activated through a configuration change. Rollback is a configuration update, not a redeployment.

The upgrade manifest should declare which strategy applies to each component, making the rollback procedure explicit before the upgrade begins rather than improvised after a failure.


Applying These Patterns to AI Agent Platforms

For platforms like Zylos, where the agent is itself a consumer and producer of upgrade manifests, document-driven upgrade pipelines offer a particularly powerful synergy: the agent can participate in its own upgrade process.

A well-designed upgrade manifest for an AI agent component should:

  1. Declare intent clearly: What version is being installed, why (linked issue or decision doc), and who approved it
  2. Enumerate pre-conditions: System health checks, dependency version requirements, available disk/memory thresholds
  3. Sequence operations explicitly: No implicit ordering; every step is named and sequenced in the manifest
  4. Define success criteria: Smoke test list, health check endpoints, metric thresholds the new version must sustain
  5. Encode the rollback path: Which snapshot strategy, what triggers rollback, how long to wait before declaring success and clearing the rollback point

When the agent platform itself generates and applies upgrade manifests autonomously, every upgrade decision becomes an artifact stored in version control — a durable record of what changed, when, why, and who (or what) authorized it.


Practical Considerations

Start with generation, not just consumption. A document-driven pipeline is only as good as the manifests flowing through it. Invest in tooling that generates well-formed manifests from high-level intent ("upgrade scheduler to latest stable") rather than requiring engineers to author raw YAML.

Validate manifests before execution. JSON Schema or custom validators should reject malformed manifests at the PR stage, not during execution. A manifest that passes schema validation but references a non-existent component version should fail fast in a pre-flight check, not halfway through a production upgrade.

Preserve human gates for high-risk changes. Full automation is appropriate for patch-level upgrades with low compatibility risk. Major version upgrades, schema MODEL changes, and upgrades affecting multiple interdependent components warrant human review of the manifest before execution proceeds.

Instrument the pipeline itself. Track manifest application latency, failure rates by component type, rollback frequency, and mean time to upgrade. These metrics reveal which components have fragile upgrade paths and where investment in better pre-flight validation would pay off.


Sources: Dependabot vs Renovate comparison, Renovate Bot documentation, AI-Agent Powered Software Upgrades, GitOps implementation at enterprise scale, Argo CD documentation, SchemaVer for semantic versioning of schemas, Helm upgrade and rollback guide, How to validate GitOps manifests, SemVer specification