跪拜 Guibai
← All articles
AI Coding · OpenAI · AIGC

Cow-Harness Chains OpenSpec and omx to Give AI Coding a Verifiable Change Pipeline

By Karl_wei ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most AI coding tools produce code but no durable record of why a change was made or what behavior it was supposed to preserve. This pipeline bakes a spec-and-verify loop into the project structure itself, which matters for any team that needs to hand off work, survive a context-window reset, or audit whether a model actually solved the right problem.

Summary

The integration layers three concerns: Harness provides the project profile and module boundaries; OpenSpec captures the motivation, behavioral delta specs, and task decomposition for each change; and omx handles the runtime execution of approved tasks, managing order, parallelism, and result reclamation. A new routing rule forces the agent to read the current change's instructions before deciding whether to execute directly or hand off to omx. The workflow produces a traceable artifact chain — project profiles in .ai-harness/, change specs in openspec/changes/, and runtime evidence in .ai-runtime-artifacts/ — so reviews can cross-check implementation against the original behavioral contract instead of staring at a diff in isolation. The repo itself is structured as a portable Git submodule that bootstraps domain initialization, merges OpenSpec schemas, and generates the context files a new project needs to adopt the same discipline.

Takeaways
Harness, OpenSpec, and omx are wired into a single routing chain: project profile → change spec → task decomposition → human confirmation → runtime execution → verification → archive.
OpenSpec requires at least one behavioral delta spec per change, which becomes the permanent record of what was agreed and how to verify it.
omx only runs tasks that have already been approved; it handles execution order, parallelization, and result collection but never decides scope.
The cow-harness repo ships as a Git submodule that runs domain-init to detect frontend, backend, client, and test rules, then writes them into the project's own .ai-harness/ directory.
Runtime artifacts (.ai-runtime-artifacts/) capture execution logs, independent decisions, and non-OpenSpec verification records without duplicating what the change spec already stores.
Task routing now selects the business sub-project first, then creates or continues an OpenSpec change inside it, preventing private workflows that bypass the spec.
The init call chain was refactored to form a project profile before running openspec init --tools none, merging schemas and generating openspec-context.md.
Conclusions

The architecture draws a hard line between 'what to do' and 'how to execute it,' which is the opposite of most AI coding tools that collapse planning and implementation into a single prompt-and-response cycle.

Requiring a delta spec before execution treats the spec as a contract rather than documentation; this flips the review process from diff-inspection to behavior-verification, a shift that matters more when the author is a model with no implicit product judgement.

Making cow-harness a Git submodule rather than a package or CLI plugin means the workflow rules version alongside the project, which avoids the drift that happens when a global tool updates and suddenly changes how every repo behaves.

The explicit fallback rule — 'no available runtime means the agent truthfully falls back, cannot pretend omx ran' — is a small design choice that prevents silent failures, a common failure mode in agent chains that paper over missing steps.

Concepts & terms
OpenSpec
A specification-driven change management system that captures the motivation, behavioral delta specs, task decomposition, and acceptance criteria for a single change. It enforces a pipeline of brainstorm → design → specs → tasks → human-review → apply → verify → archive.
omx (oh-my-codex)
A runtime orchestration tool that takes already-approved tasks and handles execution order, parallelization opportunities, and result reclamation, pulling execution back into the verification loop.
cow-harness
An open-source portable infrastructure that organizes full-stack project routing, domain initialization, project profiles, OpenSpec changes, and verification gates. It ships as a Git submodule so workflow rules version alongside the project.
delta spec
A behavioral specification that captures only what changed in a given requirement, isolating the change from the surrounding context so it survives conversation resets and can be audited later.
project profile
A set of files in .ai-harness/ that describe stable facts about a project: module boundaries, context maps, verification rules, and OpenSpec context. The AI reads these to understand which project it is working in before processing any change.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗