Harness Testing and Validation - Drift Detection and CI Validation
About 5 minutes
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
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “References”- OpenAI, Codex documentation
- OpenAI, OpenAI API documentation