← Articles

UCP Schema Validation CI: Automated Quality Gates for Agentic Commerce

UCP CI/CD DevOps March 1, 2026 · sakinaroufid

Three pull requests from sakinaroufid land today adding comprehensive CI infrastructure for UCP schema validation — automated checks that ensure the specification's JSON schemas stay in sync with the source of truth and that documentation builds don't break silently.

The Author

sakinaroufid

A contributor focused on UCP's build and CI infrastructure. Today's PRs represent a coordinated effort to add automated quality gates to the schema-driven development workflow.

GitHub: @sakinaroufid

The Pull Requests

#232 — chore(ci): update workflow path triggers and improve docs build
Open · Mar 1
#231 — chore(pre-commit): add local schema generation sync check
Open · Mar 1
#230 — chore(ci): add schema validation workflow
Open · Mar 1

Why Schema Validation Matters

UCP is a schema-driven protocol. The JSON schemas in the repository define the contract between AI agents and commerce providers. When those schemas drift from the canonical source (or from each other), bad things happen:

Today's PRs address all three failure modes.

What Changed

1. Schema Validation Workflow (PR #230)

A new GitHub Actions workflow that validates the JSON schemas on every push and PR:

name: Schema Validation

on:
  push:
    paths:
      - 'schema/**'
  pull_request:
    paths:
      - 'schema/**'

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Validate JSON Schemas
        run: npm run schema:validate

This catches malformed schemas before they merge — no more "the schema is valid JSON but not valid JSON Schema" bugs.

2. Pre-commit Schema Sync Check (PR #231)

A pre-commit hook that verifies generated schemas match the source:

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: schema-sync-check
        name: Check schema generation is in sync
        entry: npm run schema:check-sync
        language: system
        pass_filenames: false

How it works: The hook runs the schema generator, then diffs the output against committed files. If they don't match, the commit fails with a message explaining which schemas need regeneration.

This catches a common mistake: editing a source file that generates schemas, but forgetting to run the generator before committing.

3. Improved Workflow Path Triggers (PR #232)

Updates to the existing CI workflows to trigger on the right file paths:

Previously, some workflows ran on every commit regardless of what changed. The refined triggers reduce CI time and resource usage while ensuring the right checks run for each change type.

Technical Details

The Schema Generation Pipeline

UCP's schemas follow a generation pipeline:

  1. Source definitions — TypeScript or YAML files defining the protocol structures
  2. Schema generator — Transforms sources into JSON Schema files
  3. Validation — Ensures generated schemas are valid JSON Schema draft-07
  4. Client generation — Produces TypeScript types, Python dataclasses, etc.

The new CI infrastructure validates steps 2-3 automatically.

Error Handling Improvements

From the earlier commit (ba636a2 by Daniel Dittenhafer), error handling in the doc build was also improved:

// Before: silent failures
try {
  buildDocs();
} catch (e) {
  // ignored
}

// After: propagate errors
try {
  buildDocs();
} catch (e) {
  console.error('Doc build failed:', e);
  process.exit(1);
}

Combined with the new workflow triggers, this means documentation build failures are now visible in CI.

Why This Matters for UCP Adoption

As more organizations implement UCP, the quality of the specification becomes critical:

Google's investment in CI infrastructure signals that UCP is moving from "interesting proposal" to "production specification."

What's Next

Looking at the broader UCP repository, several related improvements are in flight:

For protocol designers and implementers, today's PRs represent best practices: automated validation, sync checks, and targeted CI triggers. These patterns apply to any schema-driven API.

For implementers: If you're building UCP clients, the improved CI gives you higher confidence that published schemas are correct. Consider pinning to specific schema versions and watching the repository for breaking change notifications.