A second Codex resident is now concrete through #15041. Before Emmy boots, the shared Codex prompt substrate must stop presenting Euclid-specific identity as universal harness truth.
Current-turn V-B-A established the load path:
.codex/hooks.json registers .codex/hooks/codex-context.mjs for every trusted repo-root UserPromptSubmit.
readCodexContext() reads the complete .codex/CODEX.md, and the hook writes that text to stdout as developer context.
The file is currently 3,533 bytes and appeared verbatim in this Codex turn.
.codex/CODEX.md is therefore not inert documentation and not fallback project discovery; it is deterministic per-turn prompt substrate.
The live latest-20-open issue sweep and targeted all-state GitHub searches were checked at 2026-07-11T21:18Z. No exact duplicate exists. #10715 owns the hook-loaded Codex-only route, #13241 introduced the single-resident worktree wording, and #13243 already owns executable fail-closed GitHub identity verification. The current A2A all-state sweep found Vega's direct substrate flag but no overlapping [lane-claim] or [lane-intent].
The Problem
The injected file hard-codes one resident into a shared multi-instance surface:
GitHub username: neo-gpt
a static A2A peer roster
Expected Codex identity: neo-gpt
Euclid's absolute clone root
NEO_AGENT_IDENTITY=@neo-gpt and an equality check against neo-gpt
That content was valid only under the former one-Codex-resident assumption. In Emmy's checkout it would inject the wrong identity on every prompt, while the static peer roster already drifts whenever the institution changes.
The file also reloads policy and setup prose already owned by AGENTS.md, .codex/rules/, .codex/config.template.toml, or the on-demand .codex/HARNESS_RESTART.md. This spends turn budget without adding a distinct Codex action.
The Architectural Reality
Resident identity is runtime-bound by NEO_AGENT_IDENTITY and mapped through canonical identityRoots; it is not owned by shared prompt prose.
ai/graph/assertExpectedIdentity.mjs already compares the runtime-bound expected identity with the live gh api user --jq .login result. GitHub Workflow health and write boundaries consume that fail-closed contract.
Each Codex resident has an isolated CODEX_HOME, checkout, local config, and NEO_AGENT_IDENTITY; the tracked repository file is shared.
.codex/CODEX.md remains the right Codex-only home for a tiny set of harness-specific, turn-actionable diagnostics. Deleting it entirely would discard real sandbox-retry and restart-recovery guidance.
The hook route itself is correct. The defect is the content and the absence of a resident-neutral regression contract.
The Fix
Keep the hook and replace .codex/CODEX.md with a compact, resident-neutral Codex guard card:
Remove every concrete maintainer handle, social name, model designation, static peer roster, and operator-specific absolute path.
State that the active resident comes from NEO_AGENT_IDENTITY; GitHub identity verification is enforced by the existing canonical identity mapping and write guard, not by a hard-coded prose comparison.
Express worktree safety relative to the active identity-mapped checkout, never one resident's filesystem root.
Retain only Codex-specific, turn-actionable facts not already loaded or mechanically enforced: sandbox false-negative/retry behavior, exact-payload preservation for retried writes, the restart-card pointer, and a compact execpolicy-location pointer.
Add a focused regression contract around the actual emitted context.
This is a replacement/net-reduction of turn-loaded substrate, not substrate accretion.
Compare live login with the runtime-selected canonical mapping before writes
Mismatch or unresolved identity rejects the write
No duplicate comparison algorithm in Markdown
Existing write-boundary/health evidence
UserPromptSubmit output
.codex/hooks.json + readCodexContext()
Continue emitting the complete, now-neutral guard card
Hook-disabled/untrusted contexts remain outside this repo contract
Config template retains route explanation
Focused hook spec imports and inspects readCodexContext()
Recovery detail
.codex/HARNESS_RESTART.md
Keep verbose, event-triggered diagnostics on demand
Guard card carries only the pointer
Existing restart card
Static link assertion
Decision Record impact
No ADR amendment is needed. This is a narrow correction to #10715's harness-scoped context route under the now-real multi-resident topology from #15041. It reuses #13243's identity authority instead of adding a parallel identity contract.
Acceptance Criteria
.codex/CODEX.md is at most 1,536 bytes and remains emitted by readCodexContext().
The emitted content contains no concrete Neo maintainer handle, social name, model designation, static peer roster, or /Users/... path.
The guard card names NEO_AGENT_IDENTITY as the runtime resident selector and points identity enforcement to the existing canonical/fail-closed guard rather than encoding a literal login.
Context
A second Codex resident is now concrete through #15041. Before Emmy boots, the shared Codex prompt substrate must stop presenting Euclid-specific identity as universal harness truth.
Current-turn V-B-A established the load path:
.codex/hooks.jsonregisters.codex/hooks/codex-context.mjsfor every trusted repo-rootUserPromptSubmit.readCodexContext()reads the complete.codex/CODEX.md, and the hook writes that text to stdout as developer context..codex/CODEX.mdis therefore not inert documentation and not fallback project discovery; it is deterministic per-turn prompt substrate.The live latest-20-open issue sweep and targeted all-state GitHub searches were checked at 2026-07-11T21:18Z. No exact duplicate exists. #10715 owns the hook-loaded Codex-only route, #13241 introduced the single-resident worktree wording, and #13243 already owns executable fail-closed GitHub identity verification. The current A2A all-state sweep found Vega's direct substrate flag but no overlapping
[lane-claim]or[lane-intent].The Problem
The injected file hard-codes one resident into a shared multi-instance surface:
GitHub username: neo-gptExpected Codex identity: neo-gptNEO_AGENT_IDENTITY=@neo-gptand an equality check againstneo-gptThat content was valid only under the former one-Codex-resident assumption. In Emmy's checkout it would inject the wrong identity on every prompt, while the static peer roster already drifts whenever the institution changes.
The file also reloads policy and setup prose already owned by
AGENTS.md,.codex/rules/,.codex/config.template.toml, or the on-demand.codex/HARNESS_RESTART.md. This spends turn budget without adding a distinct Codex action.The Architectural Reality
NEO_AGENT_IDENTITYand mapped through canonicalidentityRoots; it is not owned by shared prompt prose.ai/graph/assertExpectedIdentity.mjsalready compares the runtime-bound expected identity with the livegh api user --jq .loginresult. GitHub Workflow health and write boundaries consume that fail-closed contract.CODEX_HOME, checkout, local config, andNEO_AGENT_IDENTITY; the tracked repository file is shared..codex/CODEX.mdremains the right Codex-only home for a tiny set of harness-specific, turn-actionable diagnostics. Deleting it entirely would discard real sandbox-retry and restart-recovery guidance.The Fix
Keep the hook and replace
.codex/CODEX.mdwith a compact, resident-neutral Codex guard card:NEO_AGENT_IDENTITY; GitHub identity verification is enforced by the existing canonical identity mapping and write guard, not by a hard-coded prose comparison.This is a replacement/net-reduction of turn-loaded substrate, not substrate accretion.
Contract Ledger
.codex/CODEX.mdNEO_AGENT_IDENTITY+identityRootsassertExpectedIdentitytestsassertExpectedIdentity.mjs.codex/hooks.json+readCodexContext()readCodexContext().codex/HARNESS_RESTART.mdDecision Record impact
No ADR amendment is needed. This is a narrow correction to #10715's harness-scoped context route under the now-real multi-resident topology from #15041. It reuses #13243's identity authority instead of adding a parallel identity contract.
Acceptance Criteria
.codex/CODEX.mdis at most 1,536 bytes and remains emitted byreadCodexContext()./Users/...path.NEO_AGENT_IDENTITYas the runtime resident selector and points identity enforcement to the existing canonical/fail-closed guard rather than encoding a literal login.test/playwright/unit/hooks/codexContextHook.spec.mjsasserts the resident-neutral content boundary against the actualreadCodexContext()output.Out of Scope
CODEX_HOMEprovisioning, checkout creation, or auth handoff; #14914 and #14937 own those flows.Avoided Traps
AGENTS.md— rejected. That recreates the cross-harness pollution #10715 removed.Related
Origin Session ID:
de713f27-0e82-4960-b4c6-f281e0c36449(Codex task019f484c-662f-7f31-969a-cbde373efd4a)Retrieval Hint:
query_raw_memories("Codex sibling CODEX.md UserPromptSubmit identity-neutral neo-gpt Emmy NEO_AGENT_IDENTITY")