From c823815811312e179fe8a06817c4960dd3df4e91 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 23 Apr 2026 23:28:10 +0100 Subject: [PATCH] Plan Phase 2 prompt integration --- notes/codex-epiphany-mode-plan.md | 254 +++++++++++++++++------------- notes/fresh-workspace-handoff.md | 164 ++++++++++++------- state/evidence.jsonl | 1 + state/map.yaml | 7 +- 4 files changed, 262 insertions(+), 164 deletions(-) diff --git a/notes/codex-epiphany-mode-plan.md b/notes/codex-epiphany-mode-plan.md index 0b60e1c1..b709edcc 100644 --- a/notes/codex-epiphany-mode-plan.md +++ b/notes/codex-epiphany-mode-plan.md @@ -1,173 +1,215 @@ -# Codex Epiphany Phase 1 Implementation Plan +# Codex Epiphany Phase 2 Implementation Plan -This is the actionable implementation note for the first Epiphany patch slice against the real `openai/codex` tree vendored under `vendor/codex`. +This is the actionable implementation note for the second Epiphany patch slice against the real `openai/codex` tree now vendored directly under `vendor/codex`. -Phase 1 is deliberately **internal/dev-usable**, not user-facing. The goal is to give Codex a real durable Epiphany state seam in core, keep the app usable, and prove replay/persistence before touching prompts, presets, protocol notifications, or GUI reflection. +Phase 1 landed in parent commit `2042687e3035c5a86d7f6aa66306d87abcc10f2d`. The durable state seam exists. Codex can now persist and replay structured Epiphany thread state. The next job is to make that state actually matter to the turn loop without pretending we already have GUI, retrieval, or operator ergonomics solved. ## Summary -Land Phase 1 as an **additive core slice** that persists and rehydrates structured Epiphany thread state without changing normal Codex behavior. +Land Phase 2 as a **prompt-integration slice** that derives a compact Epiphany summary from `SessionState.epiphany_state` and injects it into the developer-context path during turn construction. After this slice: -- non-Epiphany sessions still behave exactly as they do now -- the app remains usable because existing clients ignore the new metadata -- Epiphany state can be exercised and validated through automated core/rollout/resume tests +- Epiphany state affects model behavior instead of just sitting in rollout +- resumed Epiphany sessions carry their structured understanding back into the prompt path +- normal non-Epiphany sessions still behave exactly as they do now -This slice does **not** include: +This slice still does **not** include: -- prompt integration -- app-server notifications - GUI surfaces -- collaboration-mode presets -- mutation gates +- app-server notifications or typed read/update RPCs - retrieval indexing -- specialist-agent orchestration +- watcher-driven semantic invalidation +- observation promotion heuristics +- specialist-agent scheduling +- public operator UX + +## Phase 2 Principle + +The activation rule for Phase 2 should stay brutally simple: + +- if `SessionState.epiphany_state` is `Some`, the session is Epiphany-active +- if it is `None`, nothing new is injected + +That is enough for internal/dev use. Do not invent a new public toggle, preset, or protocol field in this slice. ## Key Changes -### 1. Add minimal durable Epiphany protocol types +### 1. Add a dedicated Epiphany prompt fragment renderer Touch: -- `vendor/codex/codex-rs/protocol/src/protocol.rs` +- `vendor/codex/codex-rs/core/src/context/mod.rs` +- `vendor/codex/codex-rs/core/src/context/epiphany_state_instructions.rs` (new) -Add: +Add a new contextual fragment, tentatively: -- `EpiphanyThreadState` -- `EpiphanyStateItem { turn_id: Option, state: EpiphanyThreadState }` -- `RolloutItem::EpiphanyState(EpiphanyStateItem)` +- `EpiphanyStateInstructions` -Phase 1 schema should stay minimal but sufficient: +Pattern it after other developer-scoped context fragments such as collaboration-mode and permissions instructions. + +Responsibilities: + +- render a compact, deterministic textual summary from `EpiphanyThreadState` +- wrap it in its own clear developer marker block such as ` ... ` +- include light instruction text that tells the model how to treat the state: + - use it as the current structured thread understanding + - do not silently redefine it + - surface mismatches or gaps before broad edits + +Do **not** dump raw JSON into the prompt. + +### 2. Keep the summary bounded and intentionally selective + +The renderer should include only the parts that help the model stay oriented during a turn. + +Include: - `revision` - `objective` - `active_subgoal_id` -- `subgoals` -- `invariants` -- `graphs` +- a bounded list of nearby `subgoals` +- a bounded list of `invariants` +- a compact `graphs` summary centered on the frontier - `graph_frontier` - `graph_checkpoint` -- `scratch` -- `observations` -- `recent_evidence` +- recent `observations` +- recent `recent_evidence` - `churn` - `mode` - `last_updated_turn_id` -Defer these to later phases: +Default Phase 2 shaping rules: -- `agents` -- `jobs` -- `retrieval` -- separate append-only evidence/checkpoint rollout items -- separate turn intent rollout item -- any new `EventMsg` variants +- prefer frontier and checkpoint over whole-graph dumping +- prefer active and recent records over exhaustive history +- cap list lengths aggressively +- keep code refs line-anchored when rendered, but do not spam them everywhere +- omit empty sections entirely -All new protocol types should derive the same serialization/schema traits as neighboring rollout types. +Phase 2 should **not** naively dump full scratch content. Scratch is volatile and can turn the prompt back into sludge. If scratch is rendered at all, keep it to a tiny active-summary form. -### 2. Store Epiphany state in `SessionState` +### 3. Inject the Epiphany summary during initial context construction Touch: -- `vendor/codex/codex-rs/core/src/state/session.rs` - `vendor/codex/codex-rs/core/src/session/mod.rs` +The integration point is: + +- `Session::build_initial_context` + Add: -- `epiphany_state: Option` to `SessionState` -- simple getter/setter helpers on session state +- a read of `self.epiphany_state().await` +- conditional rendering of `EpiphanyStateInstructions` when the state exists +- insertion into `developer_sections` -Persistence rule: +Recommended placement: -- persist one `RolloutItem::EpiphanyState(...)` per real user turn -- write it immediately after the `TurnContextItem` baseline is persisted -- skip the write when `epiphany_state` is `None` +- after collaboration-mode instructions +- before realtime/personality/apps/skills/plugin additions -Do not change prompt assembly or tool behavior in this slice. +That keeps the Epiphany state near the top-level task discipline instead of burying it behind auxiliary capability chatter. -### 3. Rehydrate Epiphany state on resume and fork +Do **not** change: + +- `TurnContext` +- rollout protocol +- tool routing +- token accounting rules + +unless a small mechanical adjustment becomes unavoidable during implementation. + +### 4. Treat prompt integration as read-only in this slice + +Phase 2 is about **consuming** Epiphany state during turns, not teaching the model to rewrite canon by itself. + +So in this slice: + +- the model reads Epiphany state +- the existing persistence seam remains the storage mechanism +- no automatic state mutation from assistant output happens yet + +If state updates are needed during testing, use the internal/dev hooks that already exist from Phase 1. + +### 5. Add prompt-facing tests, not just persistence tests Touch: -- `vendor/codex/codex-rs/core/src/session/rollout_reconstruction.rs` -- the session-start/resume path that consumes `RolloutReconstruction` +- `vendor/codex/codex-rs/core/src/session/tests.rs` +- `vendor/codex/codex-rs/core/src/session/snapshots/` (if a new snapshot is needed) +- optionally `vendor/codex/codex-rs/core/src/context/epiphany_state_instructions.rs` local tests -Extend reconstruction to carry: +Add at least: -- `epiphany_state: Option` +1. `build_initial_context_includes_epiphany_state_block_when_present` + - seed `SessionState.epiphany_state` + - call `build_initial_context` + - verify the developer bundle includes the Epiphany block -Replay rule: +2. `build_initial_context_omits_epiphany_state_block_when_absent` + - verify normal sessions stay unchanged -- the newest surviving `EpiphanyStateItem` wins -- rollback must discard Epiphany snapshots from rolled-back turns -- compaction must not erase the latest surviving snapshot +3. one bounded-rendering test + - prove the renderer prefers frontier/recent items and omits empty sections -Treat `EpiphanyStateItem` as turn-scoped metadata in the same reverse scan that already respects rollback and compaction boundaries. +4. one snapshot-style request/context test + - similar in spirit to the existing fork/context snapshot coverage + - confirm Epiphany state appears where expected in the built prompt -### 4. Update rollout readers to tolerate the new variant +If practical, add one resume-oriented assertion: -Adding a `RolloutItem` variant will create exhaustiveness fallout across the repo. Update those sites explicitly instead of letting it turn into whack-a-mole. +- reconstruct a session from rollout with Epiphany state +- build initial context +- verify the injected Epiphany block survives replay and resume -At minimum touch: +## Public Interfaces -- `vendor/codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs` -- `vendor/codex/codex-rs/rollout/src/policy.rs` -- `vendor/codex/codex-rs/rollout/src/metadata.rs` -- `vendor/codex/codex-rs/rollout/src/list.rs` -- `vendor/codex/codex-rs/rollout/src/recorder.rs` -- any additional exhaustive `RolloutItem` matches in `core`, `tui`, `exec`, and `protocol` +Phase 2 should still avoid public surface churn. -Phase 1 behavior at those call sites: +No new: -- thread-history/UI builders should ignore `EpiphanyState` -- rollout metadata/listing code should treat it as non-rendered metadata -- existing user-visible thread rendering must stay unchanged +- protocol events +- app-server notifications +- GUI methods +- public activation controls -## Test Plan - -### Protocol and schema - -- serde round-trip for `EpiphanyThreadState` -- serde round-trip for `EpiphanyStateItem` -- any protocol/schema snapshots updated for the new `RolloutItem` variant - -### Core persistence - -- a session with populated Epiphany state writes `RolloutItem::EpiphanyState` -- a session with `None` Epiphany state writes nothing extra -- the Epiphany rollout item appears after the turn-context baseline for the turn - -### Replay correctness - -- resume restores the newest surviving Epiphany snapshot -- rollback drops snapshots from discarded turns -- compaction keeps the latest surviving Epiphany snapshot available after reconstruction - -### Compatibility - -- `app-server-protocol` thread reconstruction still builds the same visible turn history -- rollout list/metadata readers still work with mixed old/new rollout files -- untouched user flows remain unchanged in tests - -### Compile-fallout coverage - -- build/test the touched crates so all exhaustive `RolloutItem` matches are updated in one pass +This is still an internal/dev-usable slice. ## Assumptions -- Phase 1 is **internal/dev-usable**, not operator-usable or GUI-visible. -- "Testable after Phase 1" means persistence/replay behavior is verifiable through automated tests and internal session wiring, not that users can activate Epiphany from the UI yet. -- Phase 1 keeps evidence and checkpoint data embedded inside the baseline Epiphany snapshot instead of splitting them into separate rollout item variants. -- Prompt integration, app-server typed updates, GUI scene loading, retrieval, jobs, and specialist-agent scheduling are later slices. +- The existence of `SessionState.epiphany_state` is sufficient as the Phase 2 activation signal. +- The Epiphany prompt block belongs in the developer-context path, not as a user message. +- Prompt integration should remain compact and deterministic; this slice is not permission to stuff the entire map back into one giant haunted string. +- Phase 2 is still safe to ship without GUI changes because non-Epiphany sessions remain untouched. + +## Test Plan + +### Core behavior + +- Epiphany-active sessions inject a developer-scoped Epiphany summary +- non-Epiphany sessions do not +- resumed sessions with persisted Epiphany state inject the latest surviving summary + +### Rendering discipline + +- empty fields do not create empty sections +- bounded sections truncate deterministically +- frontier/gap/evidence ordering is stable + +### Compatibility + +- existing prompt/context tests continue to pass for non-Epiphany paths +- no new rollout compatibility fallout should appear because Phase 2 consumes existing state only ## Immediate Next Step After This Plan -Implement the protocol/core/replay slice only: +Implement the smallest useful prompt path only: -1. add the minimal protocol types -2. wire `SessionState` -3. persist one snapshot per real user turn -4. restore it through rollout reconstruction -5. patch exhaustive `RolloutItem` matches -6. add replay/persistence tests before moving on +1. add `EpiphanyStateInstructions` +2. inject it from `Session::build_initial_context` when `epiphany_state` exists +3. add omission/inclusion tests +4. add one snapshot proving the prompt shape + +Do not start with GUI. Do not start with retrieval. Do not start teaching the model to rewrite canon from its own prose. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 56bbfb5e..252e58ec 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -2,85 +2,129 @@ ## What This Repo Is -`EpiphanyAgent` is a prototype workspace for testing whether AI coding agents behave better when their mental model is externalized into typed state: +`EpiphanyAgent` is a prototype workspace for upgrading AI coding harnesses so they stop confusing local motion with global understanding. -- `map`: canonical project/system understanding -- `scratch`: temporary local reasoning -- `evidence`: verification, acceptance, and rejection trail +The working idea is simple enough: -The project grew from a concrete failure mode: an agent can keep making plausible local changes while the global design quietly collapses. The intended fix is not "more prompting" in the abstract, but explicit state channels and a controller discipline around when to model, think, verify, edit, revert, and speak. +- keep canonical understanding in typed state +- keep scratch bounded and disposable +- keep evidence durable +- make the harness consult that state instead of pretending the transcript is a brain -## Current State +The project target is now the vendored Codex core harness itself, not a sidecar wrapper first and not some random GitHub “OpenCodex” contraption held together with hope and string. -The workspace has: +## Current Repo State -- a root git repo -- a vendored clone of `openai/codex` at `vendor/codex` -- a small state CLI at `tools/epiphany_state.py` -- typed state files under `state/` -- controller action rules in `protocol/controller-actions.md` -- an eval sketch in `eval-plan.md` -- architecture rationale in `notes/architecture-rationale.md` -- a Codex patch plan in `notes/codex-epiphany-mode-plan.md` +Latest pushed parent commit: -The latest canonical status is in `state/map.yaml`. +- `2042687e3035c5a86d7f6aa66306d87abcc10f2d` -## Key Conclusion From Codex Repo Research +Important consequence: -The best insertion point for Epiphany mode is Codex's existing collaboration-mode preset system. +- `vendor/codex` is now tracked directly in the parent repo as ordinary files +- it is **not** a submodule anymore -Relevant files: +Canonical project state still lives in: -- `vendor/codex/codex-rs/protocol/src/config_types.rs` -- `vendor/codex/codex-rs/models-manager/src/collaboration_mode_presets.rs` -- `vendor/codex/codex-rs/collaboration-mode-templates/src/lib.rs` -- `vendor/codex/codex-rs/core/src/context/collaboration_mode_instructions.rs` -- `vendor/codex/codex-rs/app-server/src/codex_message_processor.rs` -- `vendor/codex/codex-rs/tui/src/collaboration_modes.rs` -- `vendor/codex/codex-rs/tui/src/chatwidget.rs` -- `vendor/codex/codex-rs/tui/src/bottom_pane/footer.rs` +- `state/map.yaml` +- `state/scratch.md` +- `state/evidence.jsonl` + +Current implementation plan note: + +- `notes/codex-epiphany-mode-plan.md` + +Current architectural/spec notes: + +- `notes/codex-repository-algorithmic-map.md` +- `notes/epiphany-core-harness-surfaces.md` + +## What Already Landed + +Phase 1 is done. + +The Phase 1 internal/dev-usable Epiphany core state slice was implemented inside vendored Codex: + +- `RolloutItem::EpiphanyState(EpiphanyStateItem)` exists +- `SessionState` stores `epiphany_state` +- one Epiphany snapshot is persisted per real user turn +- rollout reconstruction restores the latest surviving snapshot across resume, rollback, and compaction +- rollout/state/app-server readers tolerate the new variant +- core persistence/replay tests were added + +Main touched files: + +- `vendor/codex/codex-rs/protocol/src/protocol.rs` +- `vendor/codex/codex-rs/core/src/state/session.rs` +- `vendor/codex/codex-rs/core/src/session/mod.rs` +- `vendor/codex/codex-rs/core/src/session/rollout_reconstruction.rs` +- `vendor/codex/codex-rs/core/src/session/tests.rs` +- `vendor/codex/codex-rs/core/src/session/rollout_reconstruction_tests.rs` +- plus rollout/state/app-server compatibility readers + +## Verification That Already Happened + +Rust and VS Build Tools were installed specifically so this would stop being interpretive dance. + +Verified: + +- `cargo fmt --all` +- full lib test suites passed for: + - `codex-protocol` + - `codex-app-server-protocol` + - `codex-rollout` + - `codex-state` +- targeted new `codex-core` Epiphany persistence/replay tests passed + +Important Windows footgun: + +- the `v8` crate blows up on cross-drive builds because it tries to create a Windows symlink during build setup +- to test `codex-core` reliably here, set: + - `CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex` + +Without that, you get to learn about `symlink_dir failed: ... A required privilege is not held by the client`, which is not the kind of enlightenment we were after. ## Recommended Next Implementation -Build Phase 1, not the full enum-backed mode: +Do **Phase 2 prompt integration** next. -1. Add `codex-rs/collaboration-mode-templates/templates/epiphany.md`. -2. Export it as `EPIPHANY` from `codex-rs/collaboration-mode-templates/src/lib.rs`. -3. Add an `Epiphany` preset in `codex-rs/models-manager/src/collaboration_mode_presets.rs`. -4. Keep the preset backed by `ModeKind::Default` initially. -5. Patch the TUI to display the preset name so Epiphany is visible even though it uses Default semantics. -6. Test manually before adding a real `ModeKind::Epiphany`. +The durable state seam exists. Now Codex needs to actually read it during turns. -Why: +Planned slice: -- avoids protocol/schema churn -- avoids SDK regeneration churn -- keeps tool gating predictable -- tests the real behavioral hypothesis first +1. add a dedicated `EpiphanyStateInstructions` developer-context fragment +2. render a compact, bounded summary from `EpiphanyThreadState` +3. inject it from `Session::build_initial_context` +4. activate it only when `SessionState.epiphany_state` is present +5. add prompt-facing tests and one snapshot -## What Not To Do First +Main files for the next slice: -Do not immediately add `ModeKind::Epiphany` unless the user explicitly asks for the full protocol-level mode. That path touches more of the stack: protocol types, analytics, UI indicators, tool gating, generated schemas, SDK types, and snapshots. +- `vendor/codex/codex-rs/core/src/context/mod.rs` +- `vendor/codex/codex-rs/core/src/context/epiphany_state_instructions.rs` (new) +- `vendor/codex/codex-rs/core/src/session/mod.rs` +- `vendor/codex/codex-rs/core/src/session/tests.rs` +- `vendor/codex/codex-rs/core/src/session/snapshots/` -Do not build a large state-management subsystem before testing whether the instruction/preset path helps. A tiny helper tool may be useful later, but the first value test is the mode discipline itself. +## What Not To Do Next -## Prototype Philosophy +Not yet: -The useful behavior is: +- GUI work +- protocol event expansion +- retrieval indexing +- automatic observation promotion +- specialist-agent scheduling +- user-facing activation flows -- keep a canonical map for nontrivial work -- use scratch for one bounded subgoal -- explain the current mechanism before broad edits -- prefer one hypothesis per iteration -- verify against real goals and map coherence -- revert churn that does not move the needle -- stop coding when understanding degrades +The next slice should be small and mean: -The mode should not pretend the model has native typed channels. It should use explicit external files and write rules until a real architecture exists. +- make the state matter to prompts +- keep the rest dark -## Useful Verification +## Verification Commands -From the repo root: +State sanity from the repo root: ```powershell & 'C:\Users\Meta\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe' '.\tools\epiphany_state.py' status @@ -88,4 +132,14 @@ Get-Content -Tail 5 '.\state\evidence.jsonl' git status --short ``` -The vendored Codex repo is its own clone under `vendor/codex`. Treat it as source material for now unless the user asks to patch it. +Targeted `codex-core` test pattern on this Windows machine: + +```powershell +cmd /c "\"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat\" >nul 2>&1 && set CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex && cd /d E:\Projects\EpiphanyAgent\vendor\codex\codex-rs && %USERPROFILE%\.cargo\bin\cargo.exe test -p codex-core --lib epiphany -- --list" +``` + +## Short Version + +The repo is in a good state. + +Phase 1 is landed, verified, committed, and pushed. `vendor/codex` is first-class in the parent repo now. The next clean move is Phase 2 prompt integration, not GUI paint and not another architectural detour. diff --git a/state/evidence.jsonl b/state/evidence.jsonl index d8906203..3914db03 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -29,3 +29,4 @@ {"ts": "2026-04-23T23:12:00+01:00", "type": "implementation", "status": "ok", "note": "Implemented the Phase 1 internal/dev-usable Epiphany core state slice in vendored Codex. Added EpiphanyThreadState and EpiphanyStateItem to the rollout protocol, persisted Epiphany snapshots in SessionState and per-turn rollout metadata after TurnContext, restored the latest surviving snapshot through rollout reconstruction across resume/rollback/compaction, and patched rollout/state/app-server readers plus fork filtering to tolerate the new RolloutItem::EpiphanyState variant."} {"ts": "2026-04-23T23:12:00+01:00", "type": "verification", "status": "ok", "note": "Installed Rust and Visual Studio Build Tools to verify the Phase 1 slice in a real toolchain. cargo fmt completed; codex-protocol, codex-app-server-protocol, codex-rollout, and codex-state lib test suites passed; and the new codex-core tests for Epiphany persistence and reconstruction passed when CARGO_TARGET_DIR was moved to C: to avoid the v8 crate's Windows cross-drive symlink privilege failure."} {"ts": "2026-04-23T23:19:29+01:00", "type": "decision", "status": "ok", "note": "Flattened vendor/codex into the parent repository by removing the gitlink/submodule wiring and nested .git metadata so the Codex Phase 1 Epiphany harness changes can be reviewed and committed as ordinary tracked files alongside the project state."} +{"ts": "2026-04-23T23:25:52+01:00", "type": "decision", "status": "ok", "note": "Replaced the stale Phase 1 plan and stale workspace handoff with current persisted guidance. The new notes pin the next slice as Phase 2 prompt integration: render a bounded Epiphany developer-context summary from SessionState.epiphany_state, inject it during Session::build_initial_context, keep activation internal-only via state presence, and verify it with prompt-facing tests and a snapshot before touching GUI or retrieval."} diff --git a/state/map.yaml b/state/map.yaml index f36139c9..f05a7682 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -45,7 +45,7 @@ data_flow: - commit or backtrack active_subgoals: - - Start planning the next post-Phase-1 slice now that vendored Codex is part of the parent repo. + - Implement the Phase 2 prompt-integration slice in vendored Codex: render a compact Epiphany summary from SessionState and inject it into build_initial_context when epiphany_state is present. - Use the tiny CLI and typed state files on a small real task. - Decide whether the next executable artifact should be a patch runner or a verifier helper. - Run the protocol on a small real task. @@ -72,6 +72,7 @@ accepted_design: - keep a durable repository-level algorithmic map of vendored Codex so GUI and Epiphany changes hook into the existing app-server/core boundary instead of reimplementing the turn loop - keep the Codex algorithmic map honest about auxiliary side channels and limitations: file watching, unified diffs, compaction, subagent messaging, and memory summarization are real substrate, but they do not by themselves amount to semantic repo understanding - vendor Codex directly into the parent repo instead of keeping it as a gitlink/submodule so Epiphany harness changes can be reviewed and committed atomically with the surrounding project state + - for Phase 2, treat the presence of SessionState.epiphany_state as the internal activation signal and inject a bounded Epiphany summary into the developer-context path during build_initial_context rather than inventing a public operator surface early rejected_paths: - name: pinned_map_only @@ -88,5 +89,5 @@ rejected_paths: reason: audited candidates were either terminal-only, stale/aspirational, or incoherent wrappers; the comparison clones were removed from vendor to avoid building on untrusted drift current_status: - summary: Workspace initialized with protocol files, typed state, a tiny CLI, a git repo, fresh-workspace handoff notes, architecture rationale, a Codex algorithmic map note, an Epiphany core-harness surface spec, and an actionable Phase 1 implementation plan against vendored Codex. The Phase 1 internal/dev-usable Epiphany core state slice is implemented and verified with a real Rust/MSVC toolchain, and vendored Codex has been flattened into the parent repo as ordinary tracked files instead of a gitlink/submodule. - next_action: Decide the next post-Phase-1 slice now that vendored Codex is first-class in the parent repo: either expose a minimal operator path for the internal state seam or keep it dark and continue with the next structural slice before touching prompts, presets, or GUI surfaces. + summary: Workspace initialized with protocol files, typed state, a tiny CLI, a git repo, fresh-workspace handoff notes, architecture rationale, a Codex algorithmic map note, an Epiphany core-harness surface spec, and an actionable prompt-integration plan against vendored Codex. The Phase 1 internal/dev-usable Epiphany core state slice is implemented and verified with a real Rust/MSVC toolchain, vendored Codex is tracked directly in the parent repo, and the next slice is now pinned down as Phase 2 prompt integration rather than more architectural wandering. + next_action: Implement Phase 2 in vendored Codex: add a dedicated EpiphanyStateInstructions renderer, inject its bounded summary from Session::build_initial_context when epiphany_state exists, and add prompt-facing omission/inclusion coverage plus one snapshot before touching GUI, retrieval, or public operator surfaces.