feat(code): add Codex conversion layer with coverage tests#97
feat(code): add Codex conversion layer with coverage tests#97aponamarev wants to merge 6 commits into
Conversation
Adds codex/ directory containing the Codex CLI ports of all six plugins produced by @disdjj/acplugin, plus a pytest suite that asserts every Claude agent/skill/command has a corresponding Codex artifact. Wires the suite into CI via `pytest plugins/ codex/`. Quotes argument-hint frontmatter values in four commands so YAML parsers in the conversion pipeline don't mis-tokenize the bracketed/angled syntax. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extends the codex/ test layer with content-fidelity assertions on top of the existing structural checks. Six families: output validity (TOML/JSON parse), agent name/description identity, acplugin transformation rules (sandbox_mode, model, model_reasoning_effort), agent body fidelity (word-count band + first heading), skill SKILL.md identity, and cross-reference resolution for `plugin:skill` declarations. Extracts the Plugin enum, frozen dataclasses, and discovery helpers from the structural test into a shared codex/tests/helpers.py so both suites share one SSOT for pair discovery and parsing. 432 passed, 6 skipped (doc-shaped files in agents/ with no frontmatter). Negative-tested by sabotaging a description and a skill ref — both families produced file-specific failure messages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| python-version: "3.13" | ||
| - run: uv sync --frozen --group dev | ||
| - run: uv run pytest plugins/ | ||
| - run: uv run pytest plugins/ codex/ |
There was a problem hiding this comment.
This will collect 5 test files from inside the converted artifacts (codex/code/.agents/skills/plan-validate/scripts/test_*.py and codex/judges/.agents/skills/run-judges/scripts/test_*.py). The judges tests compute REPO_ROOT as SCRIPT_DIR.parents[4], which resolves to codex/judges/ from that path depth, not the actual repo root. Those tests will fail trying to read plugins/judges/agents from the wrong base. You need a root-level conftest.py under codex/ with collect_ignore_glob to skip **/scripts/test_*.py, or add --ignore patterns to the pytest invocation.
|
|
||
|
|
||
| def claude_artifacts(plugin: Plugin) -> ClaudeArtifacts: | ||
| root = REPO_ROOT / "plugins" / plugin.value |
There was a problem hiding this comment.
claude_artifacts does a raw glob of plugins/<plugin>/agents/*.md, but the README says files whose path contains .hook- are excluded from Codex output. If someone adds a hook-agent later, this test will flag it as missing from Codex when it was intentionally excluded. Worth filtering those out here to match the actual conversion rules.
| --- | ||
| description: Plan Amend - Discuss and apply amendments to a plan.json implementation plan | ||
| argument-hint: --workdir [path] --message "<text>" [--state-file [path]] | ||
| argument-hint: '--workdir [path] --message "<text>" [--state-file [path]]' |
There was a problem hiding this comment.
This changes source files under plugins/code/ and plugins/self-learning/ but there are no version bumps in either plugin.json. CLAUDE.md rule: "Any change to a plugin's files MUST include a version bump in that plugin's plugin.json."
thadeusb
left a comment
There was a problem hiding this comment.
CI will break. uv run pytest codex/ collects 5 copied test files from the converted plugin artifacts, and at least the 3 judges tests will fail because their SCRIPT_DIR.parents[4] path math lands at codex/judges/ instead of the repo root. Also missing required version bumps for the code and self-learning plugins.
|
Superseded by #98, which uses the unified root plugins layout and slash-free branch required for Codex marketplace validation. |
Summary
codex/— Codex CLI ports of all six plugins, generated by @disdjj/acplugin, plus aREADME.mddocumenting the conversion rules and regeneration commands.codex/plugins/<plugin>so thecodex-marketplaceCLI can install them from a rootplugins/folder.codex/subtree via thecodex-marketplacebranch and documents the working install command:npx codex-marketplace add https://github.com/closedloop-ai/claude-plugins/tree/codex-marketplace/plugins --plugins --global.codex/tests/test_conversion_coverage.pyand semantic coverage helpers asserting every Claude agent/skill/command has a Codex counterpart and preserves expected content.pytest plugins/ codex/.argument-hintfrontmatter values in four commands so the conversion pipeline YAML parser does not mis-tokenize bracketed/angled syntax.Test plan
uv run pytest codex/— 432 passed, 6 skippeduv run ruff check codex/tests/— cleangit diff --check— cleannpx codex-marketplace add https://github.com/closedloop-ai/claude-plugins/tree/codex-marketplace/plugins --plugins --global— installed 6 pluginspytest plugins/ codex/