I3962 — The codex advisor's final message is held to the answer schema and read from its file alone
Pass the answer's JSON Schema to codex exec with --output-schema, built in contract.mjs from the stances and confidences normalise accepts, and treat an exit 0 that wrote no -o file as empty instead of parsing stdout.
READY wave 0 · p2 · implementation profile · parallel safe
Ready. Every dependency is done, so majordomus plan start I3962 will be accepted.
Objective
Pass the answer's JSON Schema to codex exec with --output-schema, built in contract.mjs from the stances and confidences normalise accepts, and treat an exit 0 that wrote no -o file as empty instead of parsing stdout.
Why
The codex-exec adapter asked for the answer shape only in the prompt, and when -o wrote nothing it parsed stdout, which carries Codex's progress and events, by cutting from its first { to its last }. Codex 0.163 supports --output-schema. Found by the native-acceleration pack's P03 discovery in session 54f32bb3; no paid call was made.
Current state
scripts/lib/advisors/codex-exec.mjs runs codex exec without --output-schema and falls back to run.stdout when the -o file is absent.
Desired state
codex exec is handed the answer's schema; only the -o file is an answer; a missing file is empty, a refusal is malformed by normalise, and a client too old for --output-schema fails as an error that names it.
Scope
- scripts/lib/advisors/codex-exec.mjs
- scripts/lib/advisors/contract.mjs
- scripts/lib/advisors/process.mjs
- scripts/lib/advisors/contract.test.mjs
Out of scope
- The gemini-cli adapter, whose JSON envelope does not enforce a schema on the response
- A live model call, which needs an authorised budget
Dependencies
None. This issue is a root of the graph.
Acceptance criteria
- codex exec is invoked with --output-schema naming a file whose content is ANSWER_SCHEMA: every property required, none added, the enums those normalise accepts
- An exit 0 that wrote no -o file is empty, even when stdout holds an answer-shaped JSON object
- A final message that is not the answer is judged by normalise and is malformed
- A client that refuses --output-schema is an error whose diagnostic names it: a failed run's diagnostic is the client's own error: line, not the usage and try '--help' lines an argument parser ends with (stderr captured from codex-cli 0.163.0)
Validation
- node --test scripts/lib/advisors/contract.test.mjs
- bash test/run.sh 731_advisor_transport_contract
- bin/majordomus plan validate
Evidence required
- advisor_transport_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/I3962.yaml. Read it back with majordomus plan show I3962.