Phase 4 status: complete.
This suite is the acceptance harness the implementation must satisfy. It is designed to be executable without relying on the pinned /private/tmp clone, and without invoking an LLM in the default path.
- Static and fixture checks are the default gate.
- Interactive Codex smoke tests are separate because they may require trust, auth, approvals, and model access.
- Do not depend on
.claude/**orCLAUDE.mdafter install, except in source/provenance docs. - Do not use PyYAML or other undeclared Python packages. Use Python 3.11+ standard library (
json,hashlib,tomllib) plus a minimal frontmatter parser for simplekey: valuemetadata. - Do not use
/private/tmpas an authoritative source. The implementation must commit a manifest derived from the pinned upstream commit. - Every check must produce machine-readable JSON plus concise human output.
These files are part of the future implementation plan, not Phase 4 edits:
| Target file | Purpose |
|---|---|
.codex/audit.sh |
Thin command dispatcher for all validation commands. |
.codex/lib/validate_manifest.py |
Inventory, coverage, target-count, and disposition checks. |
.codex/lib/validate_runtime.py |
Runtime reference scan, path-shape lint, metadata lint, TOML/JSON parse checks. |
.codex/lib/validate_hooks.py |
Hook config validation and hook stdin fixture runner. |
.codex/lib/validate_rules.py |
.codex/rules/settings.rules static lint plus command examples. |
.codex/lib/validate_install.py |
Install/uninstall/idempotence/coexistence fixtures. |
.codex/lib/validate_smoke.py |
Headless and interactive workflow smoke definitions. |
.codex/manifest/upstream-assets.json |
Committed upstream asset manifest for all 417 files. |
.codex/manifest/expected-targets.json |
Expected generated Codex paths and counts. |
.codex/tests/fixtures/** |
Static fixtures for collisions, hooks, invalid skills, invalid agents, and coexistence. |
| Command | Default gate | Purpose |
|---|---|---|
./.codex/audit.sh all --root "$PWD" |
yes | Run all static/headless checks. |
./.codex/audit.sh manifest --root "$PWD" |
yes | Verify upstream coverage and target mapping completeness. |
./.codex/audit.sh runtime --root "$PWD" |
yes | Scan for forbidden runtime references and path collisions. |
./.codex/audit.sh skills --root "$PWD" |
yes | Validate skill paths, names, metadata, rewrites, and counts. |
./.codex/audit.sh agents --root "$PWD" |
yes | Validate custom-agent TOML, names, models, and counts. |
./.codex/audit.sh config --root "$PWD" |
yes | Validate .codex/config.toml, hooks JSON, permission model, and command rules. |
./.codex/audit.sh hooks --root "$PWD" |
yes | Run hook schema and stdin fixture checks. |
./.codex/audit.sh coexistence --fixture .codex/tests/fixtures/coexistence |
yes | Install/uninstall with .claude/** and CLAUDE.md present. |
./.codex/audit.sh smoke-headless --root "$PWD" |
yes | Static workflow smoke without model calls. |
./.codex/audit.sh smoke-interactive --root "$PWD" |
no | Reports skipped when no live evidence is supplied. |
./.codex/audit.sh smoke-interactive --root "$PWD" --evidence /path/to/evidence.json |
no | Cross-checks raw parent, child, and hook JSONL for a recorded CLI or desktop activation; never launches a model in CI. |
codex --strict-config -C "$fixture" debug prompt-input "noop" |
optional | Confirm model-visible AGENTS.md layering in a trusted fixture. |
codex debug models > "$tmp/models.json" |
optional | Validate configured model slugs against the current local model catalog. |
Input manifests:
upstream-assets.json: one row per upstream file from commit984023ddac0d5e27624f2baacde6105e45de375f.expected-targets.json: one row per expected Codex runtime/doc target.
Required upstream-assets.json fields:
pathsha256categorydispositionparitytargetrationale
Checks:
- Exactly 417 upstream files are present.
- Category counts match the Phase 3 matrix: 49 agents, 73 skills, 12 hooks, 11 rules, 40 templates, 23
.claude/docsnon-template docs, 1 upstream explicit agent-memory file, 17 generated Codex memory contract targets, 127 testing-framework assets, 62 upstream root/shareddocs/**files, and remaining root/shared categories. - Every row has one of
ported,replaced,shared,not_applicable, orblocked. - Every
not_applicableandblockedrow has a concrete rationale. - Only one upstream testing-framework gap was inherited: missing
vertical-sliceskill spec. The Codex target distribution adds a clearly labeled spec for this skill. notify.shis marked as replaced by native Codex notification setup documentation, not missing.- Generated target counts match: 49 agents, 17 repo-local agent-memory files, 73 ported skills, 4 new Codex-native support skills (
studio-status,studio-next,handoff,resume-from-handoff), 11 ported hooks plus 1 new status hook if implemented, 15 root-routed path-rule documents, 40 templates, 127 upstream testing-framework assets plus 1 Codex-addedvertical-slicespec.
Acceptance:
audit manifestexits 0 only when there are no uncategorized upstream files and no unexpected generated targets.
Runtime paths to scan:
AGENTS.md- the framework-local
AGENTS.mdplus root-routed.codex/instructions/path-rules/** .agents/skills/**.codex/**docs/**except explicit provenance docs
Forbidden in runtime files:
.claude/CLAUDE.mdClaude Codewhen used as a runtime dependency rather than attribution- bare custom slash commands such as
/start,/brainstorm,/gate-check,/dev-story AskUserQuestionTaskas a Claude tool invocation- unsupported skill frontmatter fields used as enforcement:
allowed-tools,model,argument-hint,user-invocable,isolation prefix_rulesinside.codex/config.toml
Allowlist:
.codex/docs/MIGRATION.md.codex/docs/COEXISTENCE.mdATTRIBUTION.md- source/provenance comments in manifests
Acceptance:
- Runtime files have zero forbidden references outside the allowlist.
- Documentation can mention Claude only for provenance, migration, and coexistence explanation.
Path checks:
- Exactly 77 core skill directories exist under
.agents/skills/. - Exactly 73 directories match upstream skills as
.agents/skills/<upstream-name>/SKILL.md. - Exactly four new Codex-native support skills exist:
.agents/skills/studio-status/SKILL.md,.agents/skills/studio-next/SKILL.md,.agents/skills/handoff/SKILL.md, and.agents/skills/resume-from-handoff/SKILL.md. - No nested namespace layout exists under
.agents/skills/**; CCGS skill directories must be direct children.
Metadata checks:
- Each
SKILL.mdstarts with frontmatter. - Required fields:
name,description. nameequals the folder name, for examplestart.descriptionis nonempty and includes enough upstream alias context for discoverability.- Unsupported Claude metadata is not present in frontmatter. If preserved, it appears under a body section titled
Ported metadata.
Rewrite checks:
- No raw
AskUserQuestionremains. - No raw Claude
Taskinvocation remains. - No bare upstream slash-command handoff remains.
- All role references resolve to a generated upstream-named custom agent.
- All skill references use upstream skill names, such as
$start,start,prototype, andgate-check, not artificial prefixed names. - Skills with upstream worktree isolation (
prototype,vertical-slice) contain explicit worktree instructions or a helper-script reference. - Opus-tier skills (
architecture-review,gate-check,review-all-gdds) contain explicit high-reasoning guidance or delegation to high-tier agents.
Collision checks:
- Compare generated CCGS skill names against active or discoverable non-CCGS skills when the local Codex CLI exposes that data, for example through
codex debug prompt-input. - Static fallback scans common configured skill roots only as a best-effort warning, not as CI truth.
- A same-name active skill is reported with all competing paths. The installer must not silently rename the CCGS skill; it must either refuse or require explicit user acceptance of selector ambiguity.
Acceptance:
audit skillsexits 0 when all required core skills pass metadata and rewrite checks, with only explicitly allowed project-local extras.
Path checks:
- Exactly 49 files exist as
.codex/agents/<upstream-agent>.toml. - No nested namespace layout exists under
.codex/agents/**; CCGS agent TOML files must be direct children. - Exactly 17 repo-local memory contract files exist as
.codex/agent-memory/<agent>/MEMORY.mdfor every upstream agent withmemory: userormemory: project. .codex/agent-memory/lead-programmer/MEMORY.mdis rewritten from upstream.claude/agent-memory/lead-programmer/MEMORY.md; the other 16 memory files are generated memory contracts and must be labeled as generated Codex memory contracts.
TOML checks:
- Parse each file with Python
tomllib. - Required fields:
name,description,developer_instructions. nameequals the upstream hyphenated role name and the filename stem, for exampleproducer.descriptionincludes the upstream role name.developer_instructionsincludes role duties and any partial-mapping notes for tools, memory, pinned skills, or isolation.- For every upstream memory-scoped agent,
developer_instructionsincludesPorted Claude memory scope: userorPorted Claude memory scope: projectand instructs the agent to read.codex/agent-memory/<agent>/MEMORY.mdbefore role work. - Unsupported Claude fields are not top-level TOML fields:
tools,disallowedTools,maxTurns,memory,skills,isolation. - Generated agents and installer scripts never write to
~/.codex/memories; global Codex Memories are documented as optional user-controlled behavior only.
Collision checks:
- Current documented Codex built-ins are
default,worker, andexplorer. - Existing project/user custom agents with the same name are reported with paths. The installer must not silently prefix or rename CCGS agents; it must refuse or require explicit user acceptance.
Model checks:
- Three Opus-tier upstream agents map to high-tier model settings:
creative-director,producer,technical-director. - Two Haiku-tier upstream agents map to low-tier settings:
community-manager,devops-engineer. - Remaining 44 agents map to medium-tier settings.
- If
codex debug modelsis available, configured model slugs must appear in the current catalog.
Acceptance:
audit agentsexits 0 when all 49 TOML files parse, required fields exist, model-tier counts match, all 17 memory bindings resolve, and no global Codex memory write path exists.
Config checks:
.codex/config.tomlis absent, installer-owned, or safely merged. Existing unowned config must cause installer refusal by default.- If generated,
.codex/config.tomlparses as TOML. - It sets
default_permissions = "game_studios"and contains no project-localapproval_policy,sandbox_mode, orsandbox_workspace_writeoverride. - It does not contain command
prefix_rules. - It does not set project-local
notify. - It defines a complete
game_studiosprofile with exact Git/runtime writes,.env*denials, network enabled, and onlygithub.comallowed. - If it sets
[tui].status_line, every item is a supported Codex built-in footer item for the installed Codex version. - It does not write provider/auth secrets.
Codex CLI check:
- Optional fixture command:
codex --strict-config -C "$fixture" debug prompt-input "noop". - This is optional because trust and user config can affect behavior; static parser results remain authoritative in CI.
Rules checks:
.codex/rules/settings.rulesexists when command policy is installed.- Rules file includes documented allow/prompt/forbid examples.
- Destructive commands such as
rm -rf,git reset --hard,git clean -fdx, force push, and secret reads are denied or require prompt. - Safe read/test commands used by workflows are allowed or prompt according to the chosen permission posture.
- Rules are tested with positive and negative command examples stored beside the rules file.
Acceptance:
audit configexits 0 when TOML parse, complete-profile boundaries, approval/sandbox-override prohibition, rules-file, and command-example checks pass.
Config checks:
.codex/hooks.jsonparses as JSON.- Only supported events are present:
PreToolUse,PermissionRequest,PostToolUse,PreCompact,PostCompact,SessionStart,SubagentStart,SubagentStop,UserPromptSubmit,Stop. Notificationis absent.- Native notification behavior is documented in
.codex/docs/README.mdor.codex/docs/COEXISTENCE.md, including the project-local limitation fornotify. - Every referenced hook script exists and is executable.
- Hook script paths stay under
.codex/hooks/**.
Script checks:
- Scripts use neutral/shared paths or Codex-owned paths only.
- Scripts do not read or write
.claude/**. - Scripts handle missing optional project files gracefully.
- Scripts accept Codex stdin JSON fields such as
hook_event_name,tool_name,tool_input,agent_type,agent_id, andcwd.
Fixture checks:
SessionStart:session-start.sh,detect-gaps.sh,studio-status-on-start.sh.PreToolUse Bash:validate-commit.sh,validate-push.sh.PreToolUse apply_patch: preflight asset validation where feasible.PostToolUse apply_patch: advisory asset and skill validation.PreCompactandPostCompact: handoff file behavior.SubagentStartandSubagentStop: log file behavior.Stop: session stop summary/log behavior.
Acceptance:
audit hooksexits 0 when hooks JSON validates and every fixture returns the expected allow/deny/advisory shape.
Fixtures:
empty-game: no Claude or Codex files.claude-existing: contains.claude/**,CLAUDE.md, upstream shared state, and no Codex port.codex-collisions: contains existingAGENTS.md,.agents/skills/start,.codex/agents/reviewer.toml,.codex/config.toml,.codex/hooks.json.shared-state-dirty: contains preexistingproduction/**,design/**, anddocs/architecture/**artifacts.
Install checks:
- Installer never writes to
.claude/**. - Installer never modifies
CLAUDE.md. - Existing Markdown files are marker-block merged only.
- Existing unowned JSON/TOML files cause refusal by default.
--forcewrites timestamped backups before overwriting Codex-owned files, but still refuses.claude/**,CLAUDE.md, and shared neutral state deletion.- Install is idempotent.
Uninstall checks:
- Uninstaller removes only manifest-owned files or marker blocks.
- Uninstaller preserves
.claude/**,CLAUDE.md, shared neutral state, and unrelated Codex files. - Empty directories are removed only when Codex-owned and empty.
Acceptance:
audit coexistenceexits 0 when before/after hashes for.claude/**,CLAUDE.md, and shared neutral state match expected behavior.
Checks:
- All 40 upstream templates exist at
.codex/docs/templates/**. - All
.claude/docsnon-template docs are copied or rewritten under.codex/docs/**. - All upstream root/shared project docs are either shared at the same neutral
docs/**path or copied with rationale. .codex/docs/README.md,.codex/docs/MIGRATION.md,.codex/docs/COEXISTENCE.md, andATTRIBUTION.mdexist.- Documentation invocation examples use upstream skill names, such as
$startor "run thestartskill". CCGS Skill Testing Framework/**contains 127 upstream testing-framework assets plus the Codex-addedvertical-sliceskill spec.- The validation report preserves the missing upstream
vertical-slicespec as historical evidence and includes the Codex-added target spec.
Acceptance:
audit docsexits 0 when counts, paths, and rewrite scans pass.
Headless static smoke:
start: verifies first-run onboarding references shared state and asks bounded questions.project-stage-detect: verifies it reads neutral project state.gate-check: verifies gate verdict terms and strictest-verdict semantics.dev-story: verifies story implementation lifecycle reads story/context and delegates to correct roles.story-done: verifies review/test evidence gate.team-qa: verifies team orchestration role references resolve.skill-test: verifies it points to the Codex testing framework.studio-status: verifies it reads stage/review/session-state files.studio-next: verifies it reads handoff/session/sprint/stage/workflow state and remains read-only.- Statusline validation verifies
[tui].status_lineuses supported built-in item IDs and that the project-specific stage breadcrumb remains covered bystudio-status-on-start.shandstudio-status.
Interactive smoke, optional:
- Run Codex in a trusted fixture and invoke
start. - Trigger a subagent delegation from a team skill.
- Require hook or transcript evidence that the exact custom role profile loaded;
a task path plus
agent_type: defaultis a failed role-agent smoke. A task name, agent path, nickname, or child self-identification is not activation proof. - Record the client surface and point the evidence file at the raw parent rollout, child rollout, and SubagentStart log. The validator derives the runtime version, selected role, configured child model and effort, role instruction canary, and V2 fork mode from those sources plus the authoritative role TOML.
- Trigger a hook-protected git command in a fixture.
- Confirm prompt-input includes root
AGENTS.mdcontent with no Claude runtime dependency; separately verify the router names every shipped path rule.
Acceptance:
audit smoke-headlessmust pass in CI.audit smoke-interactivemust reportskipped, notpass, when no trusted model-running evidence was executed. CI may skip it with an explicit reason.audit smoke-interactive --evidence <json>must fail closed on default/null roles, generic instructions, model/effort mismatches, self-report-only evidence, and incompatible V2 full-history forks.
Role-activation evidence uses this shape:
{
"surface": "desktop",
"requested_role": "producer",
"task_name": "desktop_producer_activation_probe",
"parent_session_log": "/path/to/parent-rollout.jsonl",
"child_session_log": "/path/to/child-rollout.jsonl",
"hook_log": "/path/to/agents-start.jsonl"
}Relative evidence paths resolve from the evidence JSON location. A passing
record requires one matching raw spawn_agent call, parent start event,
SubagentStart hook payload, child session identity, role metadata, configured
model/effort, and developer-instruction canary. Summary booleans, task paths,
and child self-identification are not accepted as substitutes.
Every audit command should support:
--jsonfor machine-readable output.--root <path>for target project root.--fixture <path>for fixture checks.- Exit code
0for pass,1for validation failures,2for tool/environment setup errors.
Required report sections:
summarychecksfailureswarningsskippedenvironmentsource_commit
The implementation plan must include tasks to:
- Generate and commit
upstream-assets.jsonfor all 417 upstream files. - Generate
expected-targets.jsonfrom the corrected matrix. - Implement the audit dispatcher and validators before or alongside generated runtime assets.
- Add fixtures before running install/uninstall validation.
- Make
audit allthe final acceptance command for the port.