Harness Testing and Validation - Drift Detection and CI Validation
Harness drift occurs when intended configuration and the state Codex actually loads diverge. Broken links, stale adapters, locale differences, and excessive permissions need dedicated checks.
Four validation layers
| Layer | Example |
|---|---|
| Syntax | TOML, JSON, and frontmatter parse correctly |
| References | AGENTS.md, Skills, and internal links resolve |
| Policy | Build approval, secret protection, and i18n rules hold |
| Behavior | Codex discovers the intended Skill or Hook |
Keep checks small enough to report a specific failure.
Repository checks
npm run harness:sync
npm run harness:check
node scripts/ensure-slugs.js
node scripts/verify-links.jsSynchronize adapters after changing shared/, then validate harness policy, slugs, and content links.
Add Checks to CI
Normal syntax and link checks should run in CI without secrets. For Codex-driven review or repeatable tasks, openai/codex-action@v1 can run codex exec with a prompt file, sandbox, and output file.
Specify the prompt, GitHub token permissions, sandbox, secret source, write boundary, and Codex CLI version. Start with contents: read and add only necessary permissions.
Completion Criteria
A harness change is complete when required synchronization, syntax, references, local behavior, and CI checks pass, with any unrun checks stated explicitly.
Finally, Plugin Marketplace publishing covers distribution of reusable harness assets.
See the references for the external specifications and background sources used on this page.[1][2]
References
- OpenAI, Codex documentation
- OpenAI, OpenAI API documentation
For the latest releases and updates, check the official website and official documentation.