43 KiB
Fresh Workspace Handoff
What This Repo Is
EpiphanyAgent is a prototype workspace for upgrading AI coding harnesses so they stop confusing local motion with global understanding.
The working idea is simple enough:
- 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
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.
Current Repo State
Important consequence:
vendor/codexis now tracked directly in the parent repo as ordinary files- it is not a submodule anymore
epiphany-core/is now a sibling repo-owned crate that holds the bulk of the Epiphany prompt, rollout replay, and retrieval/indexing logic instead of leaving that whole organ smeared through vendored Codex
Recent anchor commits:
2042687e3035c5a86d7f6aa66306d87abcc10f2d- vendored Codex and landed the Phase 1 Epiphany core state slicec823815- persisted the Phase 2 implementation plan and refreshed the project handoff/stateefd1420- landed and pushed the Phase 2 prompt-integration slice640e063- documented the pre-compaction Epiphany workflow and synced the repo memory before compaction360dfea- landed and pushed the Phase 4 hybrid retrieval slice80c29e0- extracted Epiphany core organs intoepiphany-core, landed explicit Qdrant indexing, and added licensing guardrailsbb557d1- hardened verifier-backed promotion for map/churn replacement patchesfbd4dc2- added repo-local app-server test stack configuration after tracing Windows stack pressurecabad31- added experimentalthread/epiphany/stateUpdatednotifications after successful update/promote writes4c770e9- labeled Epiphany state update notifications with typedsourcevalues- latest slice - hardened
thread/epiphany/stateUpdatedwith event-levelrevisionand typedchangedFields - current slice - fixed accepted promotion notifications so
changedFieldsalways includesevidencewhen verifier evidence is appended, even if the accepted patch had no patch evidence - current slice - added response-level
revisionandchangedFieldsto successfulthread/epiphany/updateand acceptedthread/epiphany/promoteresponses - current slice - hardened the reusable Phase 5 smoke so rejected promotions explicitly prove
thread/epiphany/stateUpdatedstays silent - current slice - hardened direct
thread/epiphany/updateso malformed appended observations/evidence and structurally invalid replacement fields are rejected before mutation, and the reusable smoke proves invalid direct updates stay silent - current slice - aligned successful update/promote response and notification state payloads with the same client-visible live-state projection used by
thread/read, including retrieval-summary backfill
Do not trust this note for the exact current HEAD; use git log --oneline -1 if you need the live commit.
Canonical project state still lives in:
state/map.yamlstate/scratch.mdstate/evidence.jsonl
Imminent Compact-Rehydrate-Reorient Packet
If this thread compacts now, resume from this packet before doing implementation work.
Rehydrate:
- run
tools/epiphany_state.py status - read
state/map.yaml - read this handoff
- read
notes/epiphany-current-algorithmic-map.md - read
notes/epiphany-fork-implementation-plan.md - check
git status --short --branchandgit log --oneline -5 - read the tail of
state/evidence.jsonl
Reorient:
- current pushed HEAD before this packet was written:
10465e1 Persist imminent CRRC reentry packet - branch should be
main...origin/mainand clean unless a later slice changed it - current active lane has moved from indefinite post-Phase-5 hardening to the Phase 6 reflection boundary
- latest landed implementation slice: successful
thread/epiphany/updateand acceptedthread/epiphany/promoteresponses/notifications now publish the same client-visible live-state projection asthread/read, including retrieval-summary backfill - latest verification slice: richer Phase 5 smoke observed retrieval status
readyon update/promote responses and notifications, with rejected promotions and invalid direct updates still silent/non-mutating thread/epiphany/retrieve,thread/epiphany/distill, andthread/epiphany/proposeremain read-only- accepted durable Epiphany writes must still route through
thread/epiphany/updateor verifier-backedthread/epiphany/promote - automatic runtime Compact-Rehydrate-Reorient-Continue coordination is not implemented; CRRC is currently enforced by repo-local state, handoff, evidence, and operating discipline
Continue:
- do not restart Phase 5 just because the handoff says to be careful; the update/distill/propose/promote/read/notification seam is complete enough unless a concrete regression appears
- use
tools/epiphany_phase5_smoke.pyas the app-server seam guardrail before changing proposal/promotion/write/read behavior, not as a ritual for generating more tiny safety work - pick a meaningful Phase 6 reflection/scene-surface or job-state precursor that exposes the existing typed Epiphany machine without making GUI/client state authoritative
- avoid handoff notes that only say "next smallest hardening slice"; they can trap the next agent in furniture-rearrangement mode
- before natural-language algorithm-map edits, reread the exact source being described
- if a regression or benchmark fix attempt does not move the target, immediately revert that attempt before trying the next hypothesis
Licensing State
- the repo now has a top-level
LICENSEfile that acts as an operative repository license notice rather than a policy draft vendor/codex/**remains governed by its upstream Apache-2.0 and related third-party notices- Project-Authored Material outside
vendor/codex/**is publicly licensed under PolyForm Noncommercial 1.0.0, with separate commercial licensing intended by written agreement - external contributions require
CONTRIBUTOR_LICENSE_AGREEMENT.mdor a separate written agreement accepted by the Project Steward; contributors keep ownership but grant broad sublicensing/relicensing rights so future commercial licensing is not blocked by old contribution archaeology - do not describe the repository as a whole as OSI Open Source unless and until the project-authored material is also published under an OSI-approved license
Current implementation plan note:
notes/epiphany-fork-implementation-plan.md
Current architectural/spec notes:
notes/codex-repository-algorithmic-map.mdnotes/epiphany-current-algorithmic-map.mdnotes/epiphany-core-harness-surfaces.md
Current Landed Baseline
Phase 4 repo-local hybrid retrieval is now landed on main. The first retrieval anchor is 360dfea; 80c29e0 adds explicit Qdrant indexing, the epiphany-core extraction, and licensing guardrails. Later main also includes the typed update/distill/promote surfaces, promotion safety layer, and app-server stack-pressure fix. This is no longer a vague scaffold, a maybe, or a working-tree-only event.
Current verified baseline after that first retrieval anchor:
- explicit
thread/epiphany/index - manifest-backed Qdrant semantic persistence under
codex_home - local Ollama embeddings by default
- stale/fresh retrieval summaries
- read-only
thread/epiphany/retrievewith BM25 fallback still intact - repo-owned
epiphany-coreextraction for the heavy prompt/replay/retrieval organ, leaving vendored Codex with thin adapters plus the typed host seam
Current verified typed state/promotion layer:
- experimental loaded-thread-only
thread/epiphany/update - experimental loaded-thread-only
thread/epiphany/distill - experimental loaded-thread-only
thread/epiphany/promote - experimental loaded-thread-only
thread/epiphany/propose - experimental
thread/epiphany/stateUpdatednotifications after successful direct updates and accepted promotions, with typedsourcevalues ofupdateorpromote, event-levelrevision, and typedchangedFields - response-level
revisionandchangedFieldson successfulthread/epiphany/updateand acceptedthread/epiphany/promote - successful update/promote response and notification state payloads now include the same non-durable retrieval-summary backfill that live
thread/readexposes when durable Epiphany state lacks persisted retrieval metadata - typed patch shape for observations, evidence, objective, subgoals, invariants, graphs, graph frontier/checkpoint, scratch, churn, and mode
- direct
thread/epiphany/updatevalidation for appended observations/evidence and replacement fields: append records need nonempty identity fields, patch ids cannot duplicate or reuse durable ids, observations must cite existing or same-patch evidence ids, and graph/frontier/checkpoint/subgoal/churn replacement shapes must pass the sharedepiphany-corestructural validator before the durable writer mutates state - deterministic observation/evidence proposal generation in
epiphany-core - observation distillation now keeps noisy tool/command/shell/model output bounded by selecting salient output lines, prioritizing final result/failure/error/finished lines above generic warnings, and defaulting evidence kind to
tool-outputormodel-outputwhen the caller did not provide one - deterministic map/churn proposal generation in
epiphany-core, now with first-pass graph-node reuse by exact code-ref, same-path overlap, or deterministic path-node id before new candidate nodes are created, strict semantic reuse for unanchored architecture nodes, linked frontier focus through graph links and named incident edges, evidence-backed selected observations via acceptingrecent_evidence, selected-observation prioritization, automatic bounded observation selection when ids are omitted, and match-kind-aware churn pressure derived from exact-ref refinement, same-path broadening, deterministic-node reuse, semantic anchoring, or new candidate surfaces - verifier-backed promotion policy evaluation in
epiphany-core, now rejecting risky churn deltas unless they carry explicit warning rationale and strong verifier evidence kind; graph expansion is risky even if a patch understatesdiff_pressure, and strong verifier kinds are token-matched instead of substring-matched - core
CodexThread.epiphany_update_state(...)applies the patch to liveSessionState, bumps revision, persistsRolloutItem::EpiphanyState, and flushes rollout - app-server now returns response-level
revisionandchangedFieldsfrom successful direct update and accepted promotion calls, and emitsthread/epiphany/stateUpdatedafter the direct update path and after accepted promotion return an updated state; notifications identify theirsource, expose event-levelrevision, list typedchangedFields, publish the same retrieval-summary-backed client-visible state projection asthread/read, and the richer smoke now explicitly proves rejected promotions plus invalid direct append/replacement updates still do not mutate state or emit an update notification - replay helpers in both
codex-coreandepiphany-coreaccept an out-of-band Epiphany snapshot before the first real user turn so seed/update snapshots survive resume - retrieval remains read-only and indexing remains the only persistent semantic write path
Live smoke for that follow-up:
- rebuilt
codex-app-server.exe - initialized app-server stdio with
experimentalApi: true - started ephemeral loaded thread
019dbffc-c19a-75e0-bf35-c780bee59a68rooted atE:\Projects\EpiphanyAgent\epiphany-core - called
thread/epiphany/updatewithexpectedRevision: 0 - response revision was
1 thread/readreturnedepiphanyState.revision == 1, objectiveSmoke-test explicit Epiphany update persistence, observationobs-update-smoke, and evidenceev-update-smoke- smoke result lives at
.epiphany-smoke/update-smoke-result.json - wire-shape footgun: app-server envelope fields are camelCase, but nested reused Epiphany core DTOs currently serialize with their core snake_case field names
Live smoke for the distillation follow-up:
- rebuilt
codex-app-server.exe - initialized app-server stdio with
experimentalApi: true - started ephemeral loaded thread
019dc028-99ce-7b03-8f89-65b072cc2ccarooted atE:\Projects\EpiphanyAgent\epiphany-core - called
thread/epiphany/distillwithsourceKind: smoke,status: ok, subjectthread/epiphany/distill, text, and a code ref tosrc/distillation.rs - distill returned
expectedRevision: 0plus observationobs-c9bfcac23d66and evidenceev-c9bfcac23d66in a patch - passing that patch to
thread/epiphany/updateadvanced state to revision1 thread/readreturned the generated observation/evidence ids inepiphanyState- smoke result lives at
.epiphany-smoke/distill-smoke-result.json
Live smoke for the promotion follow-up:
- rebuilt
codex-app-server.exe - initialized app-server stdio with
experimentalApi: true - started ephemeral loaded thread
019dc087-6d3d-7323-9a2f-2487a591ef7arooted atE:\Projects\EpiphanyAgent\epiphany-core - distilled a promotion smoke patch
thread/epiphany/promoterejected failed verifier evidence withaccepted: false, a rejection reason, and noepiphanyStatethread/readafter rejection had no Epiphany state, proving rejection did not mutate statethread/epiphany/promoteaccepted verifier evidence with statusok, appended verifier evidence, and applied through the durable update paththread/readreturned revision1, observationobs-77248505f492, patch evidenceev-77248505f492, and verifier evidenceev-promote-smoke-verifier- smoke result lives at
.epiphany-smoke/promote-smoke-result.json
Live smoke after the pushed baseline:
- built
codex-app-server.exewithCARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex - used an isolated
CODEX_HOMEat.epiphany-smoke/codex-home - started an ephemeral loaded app-server thread rooted at
E:\Projects\EpiphanyAgent\epiphany-core - preflighted the bounded smoke corpus as 5 tracked files / 106,748 bytes
thread/epiphany/indexagainst real local Qdrant/Ollama returned ready state with 5 indexed files and 198 chunks- Qdrant collection
epiphany_workspace_fa24bab116f8d229was created thread/epiphany/retrievereturned persistent semantic chunks fromsrc/prompt.rs, proving the fresh Qdrant path works after explicit indexing- env/default backend config is good enough for the current slice; do not build a first-class config surface yet unless a real operator pain appears
- unrelated app-server startup noise showed up during the smoke: project trust warning, plugin sync 403, and unauthenticated OpenAI websocket warning
Current verified implementation spans:
epiphany-core/Cargo.tomlepiphany-core/src/prompt.rsepiphany-core/src/rollout.rsepiphany-core/src/retrieval.rsepiphany-core/src/lib.rsvendor/codex/codex-rs/protocol/src/protocol.rsvendor/codex/codex-rs/core/src/epiphany_retrieval.rsvendor/codex/codex-rs/core/src/epiphany_rollout.rsvendor/codex/codex-rs/core/src/context/epiphany_state_instructions.rsvendor/codex/codex-rs/core/src/codex_thread.rsvendor/codex/codex-rs/core/src/lib.rsvendor/codex/codex-rs/core/Cargo.tomlvendor/codex/codex-rs/core/src/session/rollout_reconstruction.rsvendor/codex/codex-rs/core/src/session/rollout_reconstruction_tests.rsvendor/codex/codex-rs/core/src/session/tests.rsvendor/codex/codex-rs/app-server-protocol/src/protocol/common.rsvendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rsvendor/codex/codex-rs/app-server-protocol/src/export.rsvendor/codex/codex-rs/app-server/src/codex_message_processor.rsvendor/codex/codex-rs/app-server/README.md- regenerated stable fixtures under
vendor/codex/codex-rs/app-server-protocol/schema/
What is wired right now:
EpiphanyThreadStatealready has retrieval metadata fields and types in protocol- repo-owned
epiphany-corenow owns:- the prompt-state renderer used by Phase 2 prompt injection
- the rollout replay helper used by Phase 3 stored-thread hydration and rollback/compaction-aware reads
- the heavy retrieval/indexing engine used by the current Phase 4 work
- the deterministic observation distiller used by
thread/epiphany/distill - the promotion policy evaluator used by
thread/epiphany/promote
- vendored
codex-corenow keeps thin adapters at:core/src/epiphany_retrieval.rscore/src/epiphany_rollout.rscore/src/epiphany_distillation.rscore/src/epiphany_promotion.rscore/src/context/epiphany_state_instructions.rs
- the retrieval machine is still hybrid:
- exact/path-ish lookup via
codex_file_search - semantic lookup via BM25 chunk search over a local gitignore-respecting corpus
- exact/path-ish lookup via
CodexThreadnow exposes:epiphany_retrieval_state()epiphany_retrieve(...)epiphany_index(...)epiphany_update_state(...)
- app-server protocol now declares experimental
thread/epiphany/retrieve - app-server protocol now also declares experimental
thread/epiphany/index - app-server protocol now also declares experimental
thread/epiphany/distill - app-server protocol now also declares experimental
thread/epiphany/propose - app-server protocol now also declares experimental
thread/epiphany/promote - app-server protocol now also declares experimental
thread/epiphany/update - app-server message handling now routes those methods through the core host seam
thread/epiphany/distillis the first read-only proposal surface; it returns anexpectedRevisionplus a patch and requires explicit promotion throughthread/epiphany/updatethread/epiphany/proposeis the first read-only map/churn proposal surface; it uses caller-supplied observation ids or auto-selects a bounded coherent path cluster from verified observations with acceptingrecent_evidenceand code refs, focuses existing architecture graph nodes when refs overlap, creates new candidate path nodes only for unmapped surfaces, follows graph links into related architecture/dataflow nodes, marks named incident graph edges active, derives churn pressure from the proposal shape, and returns replacement graphs/frontier/churn for explicit promotionthread/epiphany/promoteis the first explicit promotion gate; it rejects failed verifier evidence without mutation and applies accepted candidates through the update paththread/epiphany/promotenow has a first richer map/churn safety layer: state replacement patches must carry explicit observations and patch evidence, and subgoal/invariant/graph/frontier/checkpoint/churn structure is validated before the durable update path is calledthread/epiphany/updateis the first explicit durable Epiphany state write surface; it rejects empty patches, supports optional revision matching, validates appended observations/evidence and structural replacement fields, appends valid observations/evidence, replaces bounded typed fields, increments state revision, and persists immediatelythread/epiphany/stateUpdatedis the first live typed-state notification surface; it fires only after successfulthread/epiphany/updateand acceptedthread/epiphany/promote, carrying the full updated client-visibleepiphanyState, event-levelrevision, typedchangedFields, plussource: "update"orsource: "promote"; the direct update/promote responses also returnrevisionandchangedFields, and all successful write response/notification states now use the same retrieval-summary backfill asthread/read- live hydrated
thread.epiphanyStatereads now backfill a lightweight retrieval summary when the thread already has Epiphany state but no persisted retrieval summary yet - basic protocol/core/app-server unit tests were added for the new types and mapping layer
- the current pushed baseline additionally wires:
- Qdrant-backed semantic indexing behind an explicit write path instead of hidden retrieval mutation
- manifest-backed freshness checking under
codex_home - local Ollama embeddings by default, with support for adjacent VoidBot-style env names as fallbacks
- persistent semantic retrieval preference when the index is fresh, and BM25 fallback when it is stale, missing, or unavailable
- modified Codex alone is no longer the whole Epiphany organ; the heavier implementation now lives in the sibling crate and vendored Codex mostly hosts typed seams and adapters
Important recovery facts:
- existing exact/path lookup substrate already exists through
codex_file_search - app-server fuzzy search currently uses it in
vendor/codex/codex-rs/app-server/src/fuzzy_file_search.rs codex-corealready depends onbm25vendor/codex/codex-rs/core/src/tools/handlers/tool_search.rsalready shows how BM25 is used in-tree- tracked corpus preflight for
vendor/codex/codex-rsatvendor/codexHEADd45ab10is3642files /31.09 MB - raw working-tree size under
codex-rsis polluted by build artifacts and should not be used as the retrieval corpus estimate
Recovered bounded design decision:
- the first Phase 4 slice should be a query-time hybrid retriever
- reuse
codex_file_searchfor exact/path-ish lookup - use workspace-local BM25 chunk search as the initial semantic backend
- keep the first slice loaded-thread-only and read-only
- defer embeddings, vector stores, persistent indexing, and watcher-driven invalidation for later slices
Updated follow-up direction:
- the verified BM25 slice is still the right first landing zone
- the first persistent semantic store after that should target Qdrant rather than another blob-thrashing JSON/Postgres embedding store
- Qdrant should be the preferred persistent semantic backend later, not a hard requirement for basic Epiphany use
- exact/path lookup stays first-class
- BM25 should stay around as bootstrap/fallback/control for users who do not want Qdrant or when Qdrant is unavailable instead of turning the machine into vector-only confidence soup
What got verified:
cargo fmt --manifest-path E:\Projects\EpiphanyAgent\epiphany-core\Cargo.tomlpassedcargo test --manifest-path E:\Projects\EpiphanyAgent\epiphany-core\Cargo.tomlpassedcargo fmt --allpassedcargo test -p codex-core -p codex-app-server-protocol -p codex-app-server --lib --no-runpassed withCARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex- targeted Phase 4 tests passed:
cargo test -p codex-core --lib epiphanycargo test -p codex-app-server-protocol --lib thread_epiphany_cargo test -p codex-app-server --lib map_epiphany_
- full
cargo test -p codex-app-server-protocolpassed after regenerating stable schema fixtures
Notable verification fixes:
codex_message_processor.rsneeded the live-thread retrieval helper call to stop pretending&CodexThreadneeded.as_ref()core/src/session/tests.rsneededretrieval: Nonein the prompt fixture Epiphany state- the exact-hit retrieval test fixture needed a genuinely matchable file name (
session_checkpoint.rs) EpiphanyThreadStateneeded an explicit exemption in the protocol export test because sparse durable thread state intentionally uses optional fields
Important schema caveat:
cargo run -p codex-app-server-protocol --bin write_schema_fixtures -- --experimentalrewrites the same checked-in schema tree as stable generation- leaving the repo in that state makes stable protocol tests fail
- the safe checked-in state for this slice is the stable fixture generation output
- after inspection, do not bolt durable Epiphany-state writes onto
thread/epiphany/retrievejust because the retrieval summary exists:- current Epiphany snapshots are persisted on real user-turn boundaries
- out-of-band durable retrieval writes would need new rollout semantics and are a larger machine than this slice deserves
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)existsSessionStatestoresepiphany_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.rsvendor/codex/codex-rs/core/src/state/session.rsvendor/codex/codex-rs/core/src/session/mod.rsvendor/codex/codex-rs/core/src/session/rollout_reconstruction.rsvendor/codex/codex-rs/core/src/session/tests.rsvendor/codex/codex-rs/core/src/session/rollout_reconstruction_tests.rs- plus rollout/state/app-server compatibility readers
Phase 2 is done too.
The Phase 2 prompt-integration slice was originally implemented inside vendored Codex and now renders through the repo-owned prompt crate with a thin wrapper in codex-core:
EpiphanyStateInstructionsrenders a bounded developer fragment fromEpiphanyThreadState- the fragment is wrapped in
<epiphany_state> ... </epiphany_state> Session::build_initial_contextinjects it immediately after collaboration-mode instructions whenSessionState.epiphany_stateexists- resumed sessions now pull the restored Epiphany state back into the prompt path instead of leaving it inert in rollout
- prompt-facing inclusion, omission, resume, bounded-rendering, and snapshot tests were added
Main touched files for Phase 2:
epiphany-core/src/prompt.rsvendor/codex/codex-rs/core/src/context/mod.rsvendor/codex/codex-rs/core/src/context/epiphany_state_instructions.rsvendor/codex/codex-rs/core/src/session/mod.rsvendor/codex/codex-rs/core/src/session/tests.rsvendor/codex/codex-rs/core/src/session/snapshots/codex_core__session__build_initial_context_epiphany_state.snapvendor/codex/codex-rs/protocol/src/protocol.rs
Phase 3 is landed too, in a conservative read-surface form.
What landed:
- app-server protocol
Threadpayloads now expose optional typedepiphany_state - hydrated thread responses prefer live
CodexThreadstate when a thread is loaded - stored thread reads fall back to rollout reconstruction through a shared core helper that respects rollback and compaction semantics
- the minimal typed client surface is now real without making prompt text the GUI data source
- dedicated Epiphany-specific update RPCs and live state notifications are still deferred
Main touched files for Phase 3:
epiphany-core/src/rollout.rsvendor/codex/codex-rs/core/src/epiphany_rollout.rsvendor/codex/codex-rs/core/src/lib.rsvendor/codex/codex-rs/core/src/codex_thread.rsvendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rsvendor/codex/codex-rs/app-server-protocol/src/protocol/common.rsvendor/codex/codex-rs/app-server/src/codex_message_processor.rsvendor/codex/codex-rs/app-server/README.md- compatibility fixture/test updates in
analytics,exec, andtui
There is now also a dedicated Epiphany algorithmic map:
notes/epiphany-current-algorithmic-map.md
Use it when you need the answer to "what machine is current Epiphany, as a fork, actually running right now?" without rereading the whole Codex machine map plus the whole future-facing spec.
What Must Be Remembered Before Compaction
If a future session wakes up from compaction and starts bluffing, this is the part to staple to its forehead.
- Phase 1, Phase 2, and the minimal Phase 3 read surface are all landed and verified.
- The current pushed Phase 4/core-extraction anchor is
80c29e0:Extract Epiphany core and add licensing guardrails
- The earlier Phase 4 slice 1 anchor is still
360dfea:Land Epiphany Phase 4 hybrid retrieval slice
vendor/codexis ordinary tracked repo content, not a submodule.- Phase 2 means Codex now reads Epiphany state during turn construction:
SessionState.epiphany_stateis the internal activation signalSession::build_initial_contextinjects a bounded<epiphany_state>developer fragment- resumed sessions reuse the restored Epiphany snapshot in the prompt path
- Phase 3 means clients can now read typed Epiphany state directly from hydrated
Threadpayloads:thread/start,thread/resume,thread/fork,thread/read,thread/unarchive, and detached review-thread startup can carrythread.epiphanyStatewhen present- loaded threads use live state
- stored thread reads reconstruct from rollout with the same rollback/compaction semantics as core
- Phase 4 repo-local retrieval/indexing is landed:
- Epiphany now has a real typed repo retrieval subsystem instead of repeated file-by-file shell archaeology
- persistent semantic indexing now exists behind explicit
thread/epiphany/index
- Phase 5 semantic distillation/promotion is active:
- dedicated experimental
thread/epiphany/update,thread/epiphany/distill, andthread/epiphany/promoteexist and are live-smoked - experimental
thread/epiphany/stateUpdatednow exists and is live-smoked for both direct update and accepted promote paths, including source labels, event-level revision, typed changed fields, and retrieval-summary-backed state projection; successful update/promote responses now mirror revision, changed fields, and the same client-visible state projection too - structural map/churn promotion validation is landed in
epiphany-core - proposal selection now rejects observations without accepting
recent_evidence, and churn pressure now reflects match-kind-aware map-delta shape - proposal can now omit
observationIdsand letepiphany-corechoose a bounded coherent path cluster from existing verified, evidence-backed observations using source/evidence quality plus graph-frontier focus - proposal churn now distinguishes exact-ref refinements from same-path broadening, deterministic-node reuse, semantic unanchored-node reuse, and new candidate surfaces before setting graph freshness and diff pressure
- distillation now summarizes noisy tool/command/shell/model output into salient typed evidence rather than preserving raw output sludge as the summary, and final result/failure/error/finished lines outrank generic warnings unless warning is the only central signal
- promotion now rejects medium/high/expanded/broadening/semantic/update churn deltas that lack a warning, carry weak generic verifier evidence, or rely on substring verifier-kind accidents such as
contest - richer Phase 5 app-server smoke is now reproducible through
tools/epiphany_phase5_smoke.py; it verifiesshell-tooldistillation totool-output, read-only proposal, update notification source/revision/changed-fieldsupdate/1/observations,evidence, verifier-only accepted promotion notification source/revision/changed-fieldspromote/2/observations,evidence, invalid direct observation/evidence update rejection with unchanged revision and no state update notification, invalid direct replacement update rejection with unchanged revision and no state update notification, risky-churn rejection without warning, expanded-low-pressure rejection, substring verifier-kind rejection, weak verifier-kind rejection, accepted promotion only with warning plus strong verifier evidence, and graph/churn promote notification source/revision/changed-fieldspromote/3/graphs,graphFrontier,observations,evidence,churn - the Epiphany algorithmic map has been semantically audited flow-by-flow against the cited code; stale line anchors were fixed, and the current typed spine still describes a coherent machine
- the next bounded follow-up should use the richer smoke harness as a guardrail before the next source-grounded proposal/promotion hardening slice
- dedicated experimental
- There is now a first live
thread/epiphany/stateUpdatednotification seam for successful update/promote writes; it includes source, revision, and changed-field metadata, but there is still no broader watcher/job/specialist event stream. - The next phase is not GUI work.
- The current pushed baseline also extracted most Epiphany-owned implementation into
epiphany-core:- prompt rendering, rollout replay, and retrieval/indexing logic are now repo-owned
- vendored Codex keeps the typed protocol/thread/app-server seam plus thin adapters
- Phase 4 slice 1 is now landed on
mainand was verified before landing:- protocol/core/app-server wiring exists and passed targeted verification
- stable app-server protocol schema fixtures were regenerated
write_schema_fixtures --experimentalis a trap if it is left as the checked-in tree
- The recovered bounded implementation choice for the first slice is:
- exact/path lookup via existing
codex_file_search - semantic lookup via local BM25 chunk search
- query-time, read-only, loaded-thread-first behavior
- no embeddings or persistent vector store yet
- exact/path lookup via existing
- The recovered boundary choice for the current follow-up is:
- keep the protocol/thread/app-server seam inside vendored Codex
- move heavy Epiphany-owned implementation into the sibling crate when that can be done without giving up first-class typed integration
- Important Windows verification footgun still stands:
- use
CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codexforcodex-corework on this machine
- use
- App-server stack-pressure footgun from the richer promotion slice:
- without a larger test-thread stack, unrelated app-server tests can overflow after the expanded request/promotion machinery
vendor/codex/codex-rs/.cargo/config.tomlnow setsRUST_MIN_STACK=67108864- boxed-future request-dispatch experiments were tested and removed; the Cargo stack config is the minimal verified fix
- do not remove that and then act shocked when Windows eats the test harness again
- Snapshot hygiene note:
- the new Epiphany prompt snapshot normalizes temp skill-root paths in the test harness so it stays stable across runs
Opinionated Workflow Rule
Epiphany should be an opinionated software development agent, not a generic chat model wearing a hard hat.
That means this persistence workflow is not optional ceremony. It should be part of the harness:
- before compaction, phase boundaries, or handoff:
- sync the canonical map
- append evidence
- refresh the handoff note
- make the next action explicit
- if context pressure is climbing toward compaction:
- stop pretending there is plenty of room left
- narrow the current move to a bounded landing zone
- persist the checkpoint before the hard limit actually trips
- compaction should happen from a known checkpoint, not at some random point in the middle of an implementation trance
- resumed work should start from the persisted checkpoint and next action, not from vibes and transcript archaeology
If the harness cannot do that by default later, it is not opinionated enough yet.
Regression and benchmark discipline:
- if a change is made to fix a regression or move a benchmark and it does not fix that regression or move that benchmark, revert it immediately
- do not let failed hypotheses accumulate as maybe-useful scaffolding
- record the rejected path when the lesson matters, then try the next bounded hypothesis from a clean diff
- this is also rendered by
epiphany-core::render_epiphany_state(...)in hydrated Epiphany developer context, because runtime harness pressure beats wall art
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-protocolcodex-app-server-protocolcodex-rolloutcodex-state
- targeted new
codex-coreEpiphany persistence/replay tests passed - targeted
codex-coreepiphanytests passed after Phase 2 - broader
codex-corebuild_initial_context_*coverage passed after Phase 2 cargo fmt --allpassed again after Phase 3cargo test -p codex-core -p codex-app-server-protocol -p codex-app-server -p codex-analytics -p codex-exec -p codex-tui --lib --no-runpassed after the newThread.epiphanyStatefield fallout was patched- targeted Phase 3 tests passed:
cargo test -p codex-core --lib latest_epiphany_state_from_rollout_itemscargo test -p codex-app-server --lib load_epiphany_state_from_rollout_path_reads_latest_snapshotcargo test -p codex-app-server-protocol --lib serialize_client_response
cargo fmt --allpassed for the Phase 4 retrieval slicecargo test -p codex-core -p codex-app-server-protocol -p codex-app-server --lib --no-runpassed for the Phase 4 retrieval slice whenCARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex- targeted Phase 4 tests passed:
cargo test -p codex-core --lib retrieve_workspace_cargo test -p codex-app-server-protocol --lib thread_epiphany_retrievecargo test -p codex-app-server --lib map_epiphany_retrieve_response_preserves_summary_and_results
- full
cargo test -p codex-app-server-protocolpassed after restoring stable schema fixtures - after tracing the stack overflow from the richer promotion slice, full
cargo test -p codex-app-server --libnow passes 232/232 withCARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codexand repo-local Cargo config supplyingRUST_MIN_STACK=67108864; the temporary boxed-future request-dispatch experiments were removed after config-only verification passed
Important Windows footgun:
- the
v8crate blows up on cross-drive builds because it tries to create a Windows symlink during build setup - to test
codex-corereliably 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
Do not restart verification from superstition. Phase 4 retrieval/indexing/core-extraction is already verified, committed, and pushed. Phase 5 distill/propose/promote/update, the first structural promotion safety layer, graph-node reuse, linked frontier focus, evidence-backed proposal selection, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation selection, match-kind-aware map-delta churn pressure, source-output-aware distillation, risky-delta promotion policy, expansion-freshness promotion hardening, token-aware verifier-kind promotion hardening, and the reusable richer app-server smoke harness are also landed.
The durable state seam exists, the turn loop reads it, clients can load typed Epiphany state directly, successful writes now publish a live typed thread/epiphany/stateUpdated notification, the first retrieval slice is real, the explicit persistent-semantic indexing path is landed, the distill/propose/promote/update path is live-smoked, promotion now has a first structural map/churn safety layer and risky-delta policy with token-aware verifier-kind matching, distillation summarizes noisy source output into typed evidence, and proposal now reuses existing architecture nodes before creating new path nodes, expands frontier focus through linked graph context, rejects selected observations without accepting recent evidence, prioritizes stronger selected observations for proposal wording, can reuse unanchored architecture nodes through strict semantic overlap, can auto-select a bounded evidence-backed observation cluster when ids are omitted, and reports match-kind-aware churn pressure from the proposal shape. The richer Phase 5 chain has now been smoke-tested through app-server and captured as a reusable tool instead of a one-off ritual.
Phase transition rule:
- treat the live-smoked retrieval/indexing baseline as Phase 4 and the typed update/distill/propose/promote/read/notification control plane as the complete-enough Phase 5 baseline
- keep the current env/default Qdrant/Ollama config surface for now
- keep
thread/epiphany/retrieve,thread/epiphany/distill, andthread/epiphany/proposeread-only - run
tools/epiphany_phase5_smoke.pybefore changing proposal, promotion, update, read, or notification behavior - do not keep adding tiny Phase 5 hardening rules merely because the harness can; if there is no concrete bug or real-use gap, move outward
- start the next meaningful Phase 6 precursor: a typed reflection/scene surface or job-state/progress surface that lets clients inspect and steer existing Epiphany state without becoming the source of truth
What Not To Do Next
Not yet:
- watcher-driven semantic invalidation
- automatic observation promotion
- specialist-agent scheduling
- user-facing activation flows
Do not let caution write the roadmap by accident:
- no more generic "next smallest hardening slice" handoffs without naming the larger organ being advanced
- no more Phase 5 furniture rearrangement unless a concrete failing smoke, bug, or real-use gap demands it
- no GUI-as-source-of-truth work
- no broad watcher mutation or specialist-agent logic yet
- GUI/reflection work is allowed only as a thin view/control surface over already-authoritative typed state
Verification Commands
State sanity from the repo root:
& 'C:\Users\Meta\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe' '.\tools\epiphany_state.py' status
Get-Content -Tail 5 '.\state\evidence.jsonl'
git status --short
& 'C:\Users\Meta\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe' '.\tools\epiphany_phase5_smoke.py'
Targeted codex-core test pattern on this Windows machine:
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, Phase 2, the minimal Phase 3 typed read surface, Phase 4 retrieval/indexing/core-extraction, and the Phase 5 distill/propose/promote/update/read/notification control plane are landed and verified enough to move on. vendor/codex is first-class in the parent repo now, with the heavier Epiphany organs living in epiphany-core. Successful direct updates and accepted promotions now return response-level revision/changed-field metadata and emit experimental thread/epiphany/stateUpdated notifications carrying the updated client-visible typed state, source labels, event-level revision, and typed changed fields; accepted promotion responses/notifications include evidence whenever verifier evidence is appended, even when patch evidence was empty, and successful write response/notification states include the same retrieval-summary backfill exposed by live thread/read. Direct updates reject malformed appended observations/evidence and structurally invalid replacement fields before mutation. Read-only distillation summarizes noisy tool/model output into typed evidence, read-only proposal can auto-select a bounded evidence-backed observation cluster and report match-kind-aware map-delta pressure, and promotion rejects risky deltas without warning plus strong verifier evidence. The current Epiphany algorithmic map has been source-audited against the code flow it describes. The richer Phase 5 chain is live-smoked through app-server by tools/epiphany_phase5_smoke.py. The next clean move is no longer "one more tiny safety slice"; it is a meaningful Phase 6 reflection/scene-surface or job-state precursor over the existing typed machine. Pre-compaction persistence is now an explicit design rule, but persistence notes must name the next organ instead of trapping the agent in endless incremental hardening.