I3303 — Codex's hooks draw its episodes and refuse an edit no claim covers, as Claude Code's do
Write the Codex adapter share/providers.yaml calls `unadapted`: session events to capture session and, where Codex offers a pre-tool event, that event to guard hook --provider codex, generated like the Claude shims, with its offers evidence verified against the installed Codex.
READY wave 1 · p2 · implementation profile · parallel safe
Ready. Every dependency is done, so majordomus plan start I3303 will be accepted.
Objective
Write the Codex adapter share/providers.yaml calls `unadapted`: session events to capture session and, where Codex offers a pre-tool event, that event to guard hook --provider codex, generated like the Claude shims, with its offers evidence verified against the installed Codex.
Why
Codex sessions work this repository daily (board p1-p3) and today join only by MCP connection (ADR 0103), so they draw no episode boundary of their own and no edit of theirs meets the claim guard. guard.rs reads only Claude Code's tool_input.file_path and notebook_path, so a Codex apply_patch would be let through as a tool that writes no file, and the recorded Codex evidence names no pre-tool event. If no such event exists, #codex-parity is narrowed to episodes. Proposed in ADR 0214 (A provider's native extension points carry the contract as generated projections; Majordomus neither embeds nor patches the worker's runtime) (proposed; it carries no authority until the owner accepts it). Sources: chatgpt-majordomus:c109#3.
Current state
share/providers.yaml codex: 'Codex shipped a hook system, and this distribution has no adapter for it'.
Desired state
codex lifecycle declared; case proves an unclaimed Codex edit is refused.
Scope
- lib/capture.sh
- share/providers.yaml
- .ai/repo/providers
- apps/majordomus-cli/src/guard.rs
- apps/majordomus-cli/src/capability/builtin/guard.rs
Out of scope
- A Gemini adapter: deferred to a later intent until this adapter settles the shape; the verified Gemini evidence and its SessionEnd/PreCompress caveats in share/providers.yaml stay
Dependencies
What waits on this
Acceptance criteria
- A Codex session start and end produce episode events
- Where a Codex pre-tool hook is evidenced, a Codex edit outside every claim is refused with the guard's message
- providers.yaml codex lifecycle cites verified evidence
- Before building, share/providers.yaml records dated vendor evidence of a Codex pre-tool hook and its payload shape, or records that none exists and the issue delivers episodes only
- If a pre-tool hook exists, guard.rs parses the Codex payload and judges every path an apply_patch names, refusing the whole patch when any path is unclaimed, with a unit test on a multi-path patch
- Proof is split into a CI-runnable structural case and an opt-in end-to-end case against a dated Codex version, each with an allocated case number
Validation
- cargo test --manifest-path apps/majordomus-cli/Cargo.toml --test guard_hook
- majordomus product validate
- bash test/run.sh 170_provider_lifecycle_declared
Evidence required
- case_codex_hooks_carry_the_contract
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
Timeline
- started
- —
- verified
- —
- completed
- —
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I3303.yaml. Read it back with majordomus plan show I3303.