From 4872154af5b8f56db2d6553cbb657081513a470e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 18 May 2026 00:58:26 +0100 Subject: [PATCH] Map repo fractal context cache --- notes/fresh-workspace-handoff.md | 1 + notes/repo-fractal-dataflow-cache-plan.md | 384 ++++++++++++++++++++++ state/ledgers.msgpack | Bin 128453 -> 128742 bytes state/map.yaml | 13 +- 4 files changed, 393 insertions(+), 5 deletions(-) create mode 100644 notes/repo-fractal-dataflow-cache-plan.md diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 3e16f104..e2453089 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -39,6 +39,7 @@ remembers doctrine; the branch remembers the blade. - `epiphany-openai-runtime` worker result ingress now parses assistant output directly into typed role/reorient ingress structs selected from the durable launch document, stores nested `statePatch` and `selfPatch` as typed MessagePack in `EpiphanyRuntimeRoleWorkerResult`, and no longer passes worker result data through generic `serde_json::Value`. JSON survives there only as the OpenAI text-output edge before typed deserialization. - Agent self-memory review/application now has typed `AgentSelfPatch` core APIs. JSON-value selfPatch functions are compatibility wrappers for CLI/artifact ingress; native callers should parse once at the edge and then call `review_agent_self_patch_document` / `apply_agent_self_patch_document`. Role-result self-persistence no longer exports a JSON-value reviewer; the live API is `review_role_self_patch_document`. - `epiphany-openai-codex-spine` no longer uses Codex's Responses client, model-provider layer, `codex-api`, `codex-model-provider`, `codex-model-provider-info`, or `codex-protocol` for outbound model requests. It reaches `codex-login` only through `epiphany-openai-auth-spine` so credential loading/refresh stays Codex-compatible while request/status/event/runtime surfaces stay typed Epiphany documents. +- `notes/repo-fractal-dataflow-cache-plan.md` is the current repo-model direction drawn from `Fractal Domains And The Cache That Bites`: the repo's semantic architecture/dataflow graph should be a typed CultCache document organ, with Qdrant storing rebuildable embeddings for nodes, edges, conservative summaries, and context cuts. Qdrant is a contribution cache, not truth. The coding lane should eventually receive typed repo context packets for orientation and use source reads mainly for exact patch verification. - Durable Epiphany state types now live in root crate `epiphany-state-model`. `codex-protocol` re-exports them only so old rollout/API callers keep compiling; do not add new durable `Epiphany*` state structs under `vendor/codex`. `epiphany-core` imports the native model directly and no longer depends on `codex-protocol`. Pressure derives from native `EpiphanyTokenUsageSnapshot`; Codex token telemetry is mapped at the bridge. Codex rollout/event reconstruction now lives in `codex-core::epiphany_rollout`, where the Codex `RolloutItem` / `EventMsg` types belong. Exact retrieval path matching is native to `epiphany-core`, so `epiphany-core` has no direct vendored Codex crate dependency. - State-update contract proof and job launch/interrupt DTO ownership now live in native `epiphany-core`. The old giant `codex_thread.rs` Epiphany state-update test fixture was cut, and `epiphany-codex-bridge` no longer imports Epiphany job launch request types from `codex_core`; vendored `CodexThread` may call the native mutation/launch law for compatibility, but it must not regain ownership of state-update semantics, heartbeat launch-plan policy, or Epiphany DTOs. - MCP remains JSON because MCP is a JSON protocol. The latest processor cut only moved MCP refresh/OAuth/status/resource/tool-call route handling into `codex_message_processor/mcp_routes.rs`, reducing the root processor to about 8,977 lines; it did not claim MCP payloads are CultNet or make MCP an Epiphany-owned runtime contract. diff --git a/notes/repo-fractal-dataflow-cache-plan.md b/notes/repo-fractal-dataflow-cache-plan.md new file mode 100644 index 00000000..99f45786 --- /dev/null +++ b/notes/repo-fractal-dataflow-cache-plan.md @@ -0,0 +1,384 @@ +# Repo Fractal Dataflow Cache Plan + +This note applies the lesson from +`E:\Projects\gamecult-site\GameCult\Blog\fractal-domains-cache-that-bites.md` +to Epiphany's repo-modeling architecture. + +The lesson is not "add embeddings." That is the cheap altar. The lesson is: + +```text +semantic intent +-> owned domain +-> graph grammar +-> conservative summaries +-> contribution cache +-> selected context packet +-> coding agent +``` + +The cache only deserves to exist after the domain owns the object. For +Epiphany, the object is not a file chunk. The object is the repo's live +architecture/dataflow graph. + +## Current Mechanism + +Epiphany currently has two separate organs: + +- `epiphany-core/src/retrieval.rs` indexes workspace text chunks, writes a + manifest, stores semantic chunk vectors in Qdrant, and falls back to + query-time BM25 when the persistent index is missing or stale. +- `epiphany-core/src/surfaces/graph_context.rs` reads accepted typed graph + state from `EpiphanyThreadState` and derives bounded node/edge/path/frontier + context. It does not search source, infer missing architecture, or update + embeddings. + +That split is conceptually sound but incomplete. Retrieval is fast text memory. +GraphQuery is accepted map memory. Neither is the resident repo model that can +answer, "what exact architectural neighborhood does this task touch?" + +So the coding agent still has to grep, read docs, and reconstruct project shape +when the accepted graph is sparse or stale. That is the xenos whale carcass in a +better coat. + +## Desired Mechanism + +Introduce an Epiphany-owned `RepoModel` organ: + +```text +repo files / docs / manifests / build metadata / git history +-> typed repo scanner +-> typed code/document domains +-> fractal architecture/dataflow graph documents +-> conservative node and edge summaries +-> Qdrant embeddings for nodes, edges, summaries, and candidate neighborhoods +-> query planner chooses a stable context cut +-> coding agent receives exact typed context packet +``` + +The durable truth is CultCache document state. Qdrant is the contribution cache. +It makes selection fast. It does not become the source of truth. + +## Core Inputs + +- Source files, docs, manifests, build config, generated schema files, and + tests from the workspace. +- Git history and current dirty state. +- Existing accepted Epiphany architecture/dataflow graph nodes, edges, links, + frontier, checkpoints, observations, and evidence. +- Optional IDE/editor bridge facts from Rider/Unity when they expose structure + the filesystem cannot see cleanly. +- User objective and active lane intent. + +## Durable State Stores + +Keep truth in typed CultCache documents: + +- `epiphany.repo_model.snapshot`: repo identity, scan revision, source hashes, + root domains, and model status. +- `epiphany.repo_model.node`: typed architecture/dataflow/code/domain nodes. +- `epiphany.repo_model.edge`: typed ownership, call, dataflow, config, + dependency, runtime, test, and evidence edges. +- `epiphany.repo_model.summary`: conservative summaries for subtree/domain + cuts, with freshness and confidence. +- `epiphany.repo_model.frontier`: active task neighborhood, dirty refs, open + questions, and selected context cuts. +- `epiphany.repo_model.embedding_manifest`: Qdrant collection names, model id, + vector dimensions, indexed document ids, source hashes, and stale regions. + +Qdrant stores vectors and retrieval payloads for fast selection: + +- node vectors +- edge vectors +- summary vectors +- code/document excerpt vectors +- task-context packet vectors +- optional historical probe/click/acceptance signals + +Qdrant payloads may carry keys, hashes, score metadata, and compact labels. They +must not be the only home of graph truth. + +## Core Transformations + +1. **Domain Mapping** + - Map the repo into explicit domains: crate, module, binary, test suite, + schema catalog, prompt template, runtime spine, bridge adapter, vendored + Codex organ, docs, and state store. + - Each domain owns the facts that give its children meaning. + +2. **Graph Grammar** + - Emit typed nodes and edges from parsers and bounded model-assisted + distillers. + - Nodes represent stable concepts: module authority, state document, + runtime contract, adapter, route, test seam, schema, prompt, or external + bridge. + - Edges represent real relationships: owns, reads, writes, derives, + adapts, persists, launches, verifies, renders, imports, exports, depends + on, invalidates, and tests. + +3. **Summary Construction** + - Every node/subtree/domain gets a conservative summary: purpose, owned + invariant, inputs, outputs, child count, confidence, dirty hash set, + public API refs, and blast radius. + - If a subtree cannot summarize its children with bounded honesty, it is not + eligible as a collapsed context packet. + +4. **Embedding Projection** + - Embed the durable node, edge, summary, and selected excerpt documents. + - Store vectors in Qdrant keyed by typed document id and source hash. + - Refresh only dirty regions when source hashes change. + +5. **Context Cut Planning** + - Given task intent, active frontier, dirty refs, and query text, select a + stable cut through the repo graph. + - Prefer high-confidence summaries for broad context and descend into exact + nodes/files/tests only where projected task relevance or uncertainty earns + it. + +6. **Context Packet Rendering** + - Emit a typed `EpiphanyRepoContextPacket` containing graph nodes, edges, + summaries, code refs, required exact reads, known stale regions, and test + seams. + - The coding agent consumes that packet before touching source. + +## Core Outputs + +- `EpiphanyRepoContextPacket`: the exact architecture neighborhood for the + current work. +- `EpiphanyRepoFreshness`: stale regions, dirty graph paths, embedding drift, + and required reindex/regather actions. +- `EpiphanyRepoModelStatus`: indexed domains, graph confidence, Qdrant + readiness, source hash coverage, and failed extraction receipts. +- `EpiphanyRepoModelPatchCandidate`: reviewable graph updates, never automatic + architecture truth. + +## Module Ownership + +Target module network: + +- `epiphany-state-model` + - owns typed document structs for repo model snapshots, nodes, edges, + summaries, embedding manifests, context packets, freshness, and receipts. + +- `epiphany-core::repo_model` + - owns domain mapping, graph grammar, summary construction, freshness, + context-cut planning, validation, and patch proposal policy. + +- `epiphany-core::retrieval` + - remains text/chunk retrieval and low-level Qdrant/Ollama backend adapter + until split. + - It should not own repo architecture semantics. + +- `epiphany-core::surfaces::graph_context` + - becomes a view over accepted graph/model state, not a substitute for the + repo modeler. + +- `epiphany-runtime-spine` + - advertises CultNet read/mutation contracts for repo-model status, context + query, indexing, and reviewable patch candidates. + +- `epiphany-codex-bridge` + - compatibility wrapper only. It may adapt old `thread/epiphany/retrieve` and + graphQuery calls to native contracts while consumers migrate. + +- Qdrant/Ollama + - vector cache and embedding service. Fast shrine. No throne. + +## Invariants + +- CultCache documents own repo shape. +- Qdrant is cache/index, not canonical truth. +- Every node has an owner domain, stable id, source hash/freshness identity, and + a reason to exist. +- Every edge names a real relationship and points to existing typed node ids. +- Every summary must be conservative enough to stand in for its children when + the context budget does not permit descent. +- Model-assisted graph extraction produces patch candidates, not accepted truth. +- Context packets may omit detail only when they carry a bounded summary and a + confidence/freshness signal. +- The coding agent may still perform exact reads for patch work, but ordinary + orientation should come from the repo model packet, not ad hoc grep. +- Tests must align to module ownership: parsers, graph grammar, summaries, + freshness, Qdrant adapter, and context planner each get their own mock seam. + +## Architectural Smells To Avoid + +### Qdrant As Truth + +Current temptation: put rich payloads into Qdrant and call that the graph. + +Real need: fast semantic selection. + +What breaks if deleted: latency and semantic recall quality, not truth. + +Verdict: if deleting Qdrant loses the architecture map, ownership is wrong. + +Simpler architecture: typed repo model in CultCache; Qdrant stores vectors keyed +to typed document ids. + +### Chunk Retrieval Pretending To Be Understanding + +Current mechanism: `retrieval.rs` indexes 24-line chunks and returns excerpts. + +Real need: source lookup and fallback context. + +What breaks if deleted: search convenience. + +Verdict: not enough for architecture. Chunks are leaves, not domains. + +Simpler architecture: repo domains and graph nodes summarize source; chunk +retrieval supports exact evidence and descent. + +### Accepted Graph Too Sparse To Orient Work + +Current mechanism: `EpiphanyThreadState.graphs` stores accepted nodes/edges and +`graphQuery` walks them. + +Real need: durable reviewed project understanding. + +What breaks if deleted: the accepted map and review-gated graph memory. + +Verdict: essential, but not sufficient. It needs a repo-model substrate that can +propose and refresh neighborhoods. + +Simpler architecture: accepted graph remains doctrine; repo modeler maintains +source-grounded candidate graph/summary documents with review gates. + +### Model Extraction Without Conservative Summaries + +Current temptation: ask a model to summarize files/modules and store the result. + +Real need: human-scale graph construction. + +What breaks if deleted: automation speed. + +Verdict: model extraction is useful only when bounded by source hashes, +evidence refs, confidence, and review. + +Simpler architecture: parser/scanner emits deterministic structure first; model +lanes propose semantic summaries; summaries must cite refs and pass validation. + +### Context Packets As Pretty Retrieval Results + +Current temptation: rank chunks and paste them into the prompt. + +Real need: give the coding agent enough shape to act without wandering. + +What breaks if deleted: prompt convenience. + +Verdict: a packet that lacks ownership, invariants, freshness, and test seams is +not architecture context. + +Simpler architecture: packets are typed graph cuts with summaries, exact refs, +staleness, open questions, and required verification hooks. + +## Ranked Teardown Plan + +### Keep + +- Existing typed `EpiphanyThreadState.graphs`, observations, evidence, + frontier, and checkpoints as reviewed durable project truth. +- Existing Qdrant/Ollama workspace retrieval as a backend capability. +- Existing `graphQuery` and context surfaces as read-only bounded graph views. +- Existing rule that `thread/epiphany/index` writes retrieval catalog, not + durable understanding. + +### Cut + +- Any future design where semantic retrieval results directly mutate accepted + graph state. +- Any Qdrant payload that becomes the only place a node, edge, or summary + exists. +- Prompt-time grep/source-dump orientation as the normal path once repo-model + packets exist. + +### Collapse + +- Retrieval freshness, graph freshness, and embedding manifest freshness should + collapse into one repo-model freshness surface once the repo model owns source + hash coverage. +- Separate "retrieve query" and "graph query" operator workflows should + collapse into "ask repo model for a context packet" for ordinary agent work, + while exact retrieve remains a leaf-level evidence tool. + +### Split + +- Split `epiphany-core/src/retrieval.rs` into: + - text corpus/chunking + - embedding backend + - Qdrant backend + - retrieval ranking + - manifest/freshness + - repo-model embedding cache adapter +- Split graph truth from graph candidate generation: + - accepted graph stays in durable Epiphany state + - repo modeler owns source-derived candidate graph documents and patch + proposals + +### Rebuild + +- Build `epiphany-core::repo_model` as the new architecture organ before adding + more retrieval features. +- Build typed repo-model CultNet contracts so Aquarium and coding lanes can ask + for context packets without Codex JSON-RPC. + +## First Slice + +Do not start by embedding everything. First prove the typed shape. + +1. Add typed repo-model document structs in `epiphany-state-model`: + - snapshot + - domain + - node + - edge + - summary + - embedding manifest + - context packet + - freshness +2. Add `epiphany-core::repo_model` with pure in-memory validation and context + cut planning over mocked documents. +3. Add unit tests: + - node ids are stable from domain/path/symbol + - edges cannot reference missing nodes + - dirty source hashes mark affected summaries stale + - context planner returns parent summary when child detail is unnecessary + - context planner descends when uncertainty or task relevance crosses the + threshold +4. Only then connect Qdrant as a cache keyed to typed document ids. + +## Mock Boundaries + +Interview-grade seams: + +- fake repo source scanner +- fake git dirty snapshot +- fake symbol extractor +- fake summary extractor +- fake embedding provider +- fake vector index +- fake clock +- fake evidence store +- fake context budget + +Tests should shame the ownership boundary: + +- repo model can build context packets without Qdrant +- Qdrant can disappear and leave slower but correct graph traversal +- stale source hashes force re-summarization before packet confidence is high +- model-assisted extraction cannot accept graph truth without evidence/review +- a packet names the exact tests or verification seams relevant to its graph cut + +## Success Criteria + +The target is not "faster search." The target is: + +- The coding agent starts with a typed context packet for the task. +- That packet names ownership, dataflow, invariants, exact refs, stale regions, + and test seams. +- The agent uses grep/source reads mainly for exact patch verification, not + basic orientation. +- Qdrant reduces latency but can be rebuilt from typed documents and source + hashes. +- Accepted architecture truth remains review-gated. + +The renderer from the article does not wake every branch of the fractal tree. +Epiphany should not wake the whole repo every time it wants to move one bolt. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index a2aad77004b61798c1399d5fd71ce1ea3179e77d..8203b41c5eb8d9efa5459658c577694e4e5310be 100644 GIT binary patch delta 291 zcmX|+u}TCn5Qd2$_W-`YfQXIjuB)fAR&q}uSc%PSGV2Di$&ySsuTrqG69jz;8$qzS z_8!8{%0{eCtj!%_JO4NH%|H7be0&Y=)>nR>o;MzZIKP>S*QpTm`D5`d)>emyRk3%U z-)>&Ly&o$@3Ow}=8jq6EfI`N`xG_kSEkSS4R=|@!aieH>w45$Bvd$?=ypypb%K_Zj zLZA*UYYFIOtC=K6Px=4N&|*(VaH4#oCZGdgve!`?g|#7|t|q0ly~w4r>~$SkJNx%a z<2*DN7#0~_awa1up-GYiZGm+uLhG!SsR#SW?e_IcS(N)(G0b)jPRreDS^n%7KFn-1 delta 49 zcmaF%mi_2!_6f>NU%NM|PGe+@Zr;PVeGen!=g(pdTZ{~h%ybP*bq&o!jEt>JEUb)- FqW}mt5xxKb diff --git a/state/map.yaml b/state/map.yaml index 1f789071..da2e45c6 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -75,6 +75,7 @@ active_subgoals: - The May 2026 teardown/rebuild migration in `notes/epiphany-ideal-architecture-rebuild-plan.md` is closed unless a concrete regression reopens it. Preserve the new foundation: Epiphany view/coordinator policy lives in `epiphany-core`, runtime-spine owns job/result lifecycle identity through `runtime_links`, duplicate acceptance is receipt-keyed, public findings stay typed/sealed, view expansion requires a core contract, and app-server remains routing/adaptation rather than a second policy throne. - Treat Phase 5 update/distill/propose/promote/read/notification as complete enough unless a concrete regression appears. - Preserve read-only boundaries for retrieve, distill, propose, freshness, context, graphQuery, roleResult, reorientResult, and the canonical view lenses for scene, jobs, roles, planning, pressure, reorient, crrc, and coordinator. + - Use `notes/repo-fractal-dataflow-cache-plan.md` as the source-grounded repo-model direction when replacing ad hoc grep/source orientation: typed CultCache repo graph documents own project shape; Qdrant stores semantic embeddings for nodes, edges, summaries, and context cuts as a rebuildable contribution cache, not as canonical truth. - Keep the landed Phase 6 coordinator, limited safe-boundary CRRC automation, and pre-compaction checkpoint intervention ready for the next bridge-equipped dogfood run. - Preserve the Ghostlight-derived heartbeat initiative seam: every lane, including coordinator/Self and Face, has a role dossier and competes for heartbeat slots through readiness/reaction timing; idle winners ruminate instead of inventing project work, and sleep windows distill the accumulated thought pressure into reviewed self-memory or doctrine. - Treat Ghostlight as reference lineage, not a sibling runtime to preserve. The useful organ is Epiphany-native character-loop protocol: any role can project its typed dossier plus visible stimulus into a local turn packet, with Face as the first public-surface actor. @@ -113,6 +114,7 @@ accepted_design: - `thread/epiphany/retrieve`, `thread/epiphany/distill`, `thread/epiphany/propose`, `thread/epiphany/freshness`, `thread/epiphany/context`, `thread/epiphany/graphQuery`, and `thread/epiphany/view` stay read-only. - `thread/epiphany/index` writes the retrieval catalog, not durable Epiphany understanding; catalog is auspex output, not doctrine. - Qdrant is the preferred persistent semantic backend; BM25 remains the bootstrap/fallback/control path. + - `notes/repo-fractal-dataflow-cache-plan.md` applies the mapped-fractal-domain/cache lesson to Epiphany: build a `RepoModel` organ where typed domain/node/edge/summary/context documents own repo architecture and dataflow, while Qdrant indexes embeddings for fast selection. If deleting Qdrant deletes understanding, the design is wrong; the fallback must be slower but still correct typed graph traversal. - `epiphany-core` owns prompt rendering, rollout replay helpers, retrieval/indexing, distillation, proposal, promotion policy, scene projection, freshness derivation, pressure derivation, job/progress view derivation, planning view derivation, reorientation resume/regather verdict policy, pure CRRC recommendation policy, fixed-lane coordinator decision policy, role-board projection policy, and role-result interpretation/self-persistence review policy where possible. - Vendored Codex keeps the thin typed host seam: protocol types, thread bridges, app-server protocol, request routing, watcher lifecycle, notifications, and rollout integration. Epiphany projection and coordinator policy should keep moving into `epiphany-core` / `epiphany-codex-bridge` instead of living in `codex_message_processor.rs`. - The current algorithmic map is the source-grounded description of live control flow. @@ -289,8 +291,9 @@ rejected_paths: current_status: summary: The Codex starvation pass has five typing receipts, fifty-six processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state, a source-grounded Codex auth spine inventory, the native `epiphany-openai-adapter` document boundary, a buildable Codex auth/model wrapper in `epiphany-openai-codex-spine`, the first native runtime caller in `epiphany-openai-runtime`, native heartbeat launch planning/job opening in `epiphany-core`, native state-update contract/validation/application in `epiphany-core`, native exact retrieval path matching in `epiphany-core`, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines the durable `Epiphany*` state structs; it re-exports the native model for legacy rollout/API compatibility while `epiphany-core` imports the native model directly. `epiphany-core` now has no direct vendored Codex dependency: pressure derivation accepts native `EpiphanyTokenUsageSnapshot`, Codex rollout replay moved to `codex-core::epiphany_rollout`, and exact retrieval search uses Epiphany-owned workspace walking/path scoring instead of `codex-file-search`. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing projection, result projection, runtime-spine result adaptation, launch/prompt doctrine, mutation document mechanics, mutation service update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application, live-state projection, pressure/pre-compaction rendering, freshness/reorientation projection, CRRC/coordinator/role-board projection, watcher invalidation adaptation, full `thread/epiphany/view` response construction, freshness/context/graph-query response construction, role/reorient result response construction, distill/propose patch-response construction, coordinator status/view construction, and acceptance/evidence signal helpers. Vendored app-server no longer retains root Epiphany modules; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, watcher registration/snapshotting calls, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry or owns the watcher invalidation manager. Codex product surfaces for apps, skills, plugins, marketplace, and external agent config import are cut from the live app-server/protocol path: list routes return empty lists only where compatibility shells still exist, mutation/detail routes report disabled where they survive, `externalAgentConfig/*` routes and import-completed notification are gone, helper/import modules and stale implementation-shape tests were deleted, runtime feature enablement no longer supports `apps` or `plugins`, config writes no longer emit plugin-toggle analytics, plugin/skill cache invalidation on config writes is gone, plugin startup warmups and app-list refreshes were removed, and app-server no longer directly depends on `codex-plugin`, `codex-chatgpt`, or `codex-core-plugins`. `Config::to_mcp_config` now keeps user-declared MCP servers but no longer accepts `PluginsManager`, folds plugin MCP servers into the runtime, enables Codex apps, enables skill MCP dependency install, or advertises plugin capability summaries; `TurnContext::apps_enabled()` now returns false so model turns cannot awaken Codex Apps through ChatGPT auth or feature flags; session startup and per-turn context no longer load skills, turns receive an empty `SkillLoadOutcome`, internal `Op::ListSkills` is gone from `codex-protocol` / `codex-core` / TUI command routing, the Codex skill watcher has been collapsed to a no-op marker with no file watcher, skill-root registration, cache-clear task, or `SkillsUpdateAvailable` session listener, model turns no longer run skill mention collection, skill env-var prompts, skill MCP dependency installation, skill instruction injection, or implicit skill invocation analytics from shell tools, and the turn prompt/router path no longer loads plugin/app capability summaries, injects available-skill/available-plugin/plugin instruction fragments, parses plugin/app mentions, records app/plugin invocation telemetry, or filters MCP tools through Codex app connectors. Skill mutation/list/notification is gone from the app-server edge too: `skills/list`, `skills/config/write`, `skills/changed`, `Op::ListSkills`, `EventMsg::ListSkillsResponse`, `EventMsg::SkillsUpdateAvailable`, the app-server handlers, TUI slash/startup/list/manage-skill surfaces, generated schema entries, core skill-list suite, and fake live-reload/developer-message tests were deleted. Skill mention plumbing is also gone from the live TUI/protocol edge: no `UserInput::Skill` variant, app-server schema branch, TUI skill popup, `skills_all` cache, composer `set_skill_mentions`, skill mention insertion, `skill://` / `SKILL.md` history decoding, or stale skill popup snapshot remains. The `codex-core-skills` crate, core `skills` re-export shim, no-op `skills_watcher`, session `SkillsManager` service, and per-turn `TurnSkillsContext` are deleted; core/protocol no longer keep legacy `` or `` prompt compatibility, memory usage classification, snapshot normalization, or cleanup paths. Remaining product-shaped skill residue is also cut from memory templates, app-server docs/tests/warnings, TUI tooltips/placeholders/warnings/comments, app-server v1 docs, agent-tool schema text, stale `UserInput::Skill` test arms, and obsolete feature flags/schema entries. App-instruction prompt compatibility is cut too: no `APPS_INSTRUCTIONS` protocol constants, no `` snapshot canonicalization, and MCP fixture tests now use neutral `demo_mcp` / `calendar_mcp` names instead of `codex_apps` / `/api/codex/apps` branding. The TUI app connector product path is also deleted: no `/apps` slash command, app-link view, connector AppEvent variants, app connector cache/popup/refresh loop, app mention insertion, `app://` mention codec support, stale app-popup tests, or TUI browser-opening shim remains. The `app/list` route and `app/list/updated` notification are gone from app-server protocol, generated schemas, app-server dispatch, test helpers, and docs; `AppInfo`/app-list metadata schema structs are deleted; the orphaned `codex-connectors` crate and `core::connectors` shim are deleted from the workspace; Codex app analytics no longer tracks `codex_app_mentioned` / `codex_app_used` facts, events, reducer arms, client APIs, or dedupe cache state; `[apps.*]`, `Feature::Apps`, `include_apps_instructions`, app config/read schemas, app managed requirements, app prompt tests, and app file-MCP tests are gone; `Feature::Plugins`, `Feature::RemotePlugin`, `plugin://` structured mentions, plugin instruction tags, and stale plugin popup snapshots are gone too; `[plugins]` / `[marketplaces]`, `PluginConfig`, `MarketplaceConfig`, marketplace edit helpers, stale plugin/external-agent README route claims, and generated schema entries are removed from config; and the bundled `codex-skills` sample-skill crate plus embedded imagegen/openai-docs/plugin-creator/skill-creator/skill-installer payloads are deleted from the workspace. The vendored `vendor/codex/sdk` subtree is deleted as non-spine app-server client/release scaffolding, including stale generated Python SDK route types for removed product surfaces; the root pnpm workspace no longer lists `sdk/typescript`. Live MCP tool approval is named `McpToolApproval`, not `AppToolApproval`, and remains under MCP server config; live structured user-input mentions are MCP-shaped only. `codex_message_processor.rs` is about 1,009 lines after route/lifecycle/projection/resume-helper/config-helper extraction; root `message_processor.rs` is about 1,292 lines after the external-agent/config-product cuts; `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 694 lines after route-load/notification helper cuts and product-surface starvation; the old vendored `epiphany_state_helpers.rs` rollout-state loader is deleted and its remaining function lives in `epiphany-codex-bridge::state`; and `codex_thread.rs` is about 1,425 lines after state-update law moved native. `epiphany-openai-adapter` defines CultCache `DatabaseEntry` request/event/receipt/auth-status documents with no Codex app-server or generic JSON dependency. `epiphany-openai-codex-spine` owns the native OpenAI model transport path: it exposes `default_codex_home` and `auth_manager`, projects `epiphany-openai-auth-spine` `AuthManager` / `CodexAuth` into typed `EpiphanyOpenAiAdapterStatus`, builds a local serializable OpenAI Responses request body instead of Codex protocol request/item/config types, opens HTTP Responses streams through `codex-client`, parses Responses SSE frames into typed stream events and receipts, and no longer directly or transitively depends on Codex's Responses client, model-provider stack, `codex-protocol`, `codex-api`, `codex-model-provider`, or `codex-model-provider-info`; it intentionally reaches retained vendored `codex-login` only through `epiphany-openai-auth-spine`. Auth identity, credential storage, and ChatGPT token refresh remain owned by the Codex-compatible auth organ; external bearer command auth and agent identity remain retained Codex auth capabilities to expose only if a typed Epiphany surface needs them. `epiphany-openai-runtime` no longer depends directly on `codex-login`; it writes OpenAI status/request/stream-event/receipt records plus runtime sessions/jobs/results/events into `epiphany-core::runtime_spine_cache`, can emit the assistant text artifact for legacy result consumers, is now the default executor for startup-only repo birth specialists, and now has `run-worker` to load a durable `EpiphanyRuntimeWorkerLaunchRequest`, call the typed OpenAI runtime through the spine, persist typed `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` documents, and complete the original heartbeat/specialist runtime job without Codex worker execution; `codex exec` survives only as explicit fallback in repo-birth startup. `epiphany-mvp-coordinator` now invokes `epiphany-openai-runtime run-worker` for launched runtime job ids and no longer creates a second coordinator-owned shadow runtime job/result as a compensator. `epiphany-core::plan_runtime_spine_heartbeat_launch` validates launch contracts/conflicts and projects durable job bindings/runtime links; `epiphany-core::open_runtime_spine_heartbeat_job` owns the initialize-runtime/ensure-session/create-job sequence and now persists `EpiphanyRuntimeWorkerLaunchRequest` CultCache records keyed by runtime job id, with indexed kind/contract fields plus MessagePack-encoded typed launch documents instead of discarding work intent after queue receipt creation; `roleResult` and `reorientResult` now require typed worker result documents; generic job summaries are lifecycle receipts, not reviewable findings; `epiphany-core::EpiphanyStateUpdate`, `epiphany_state_update_validation_errors`, and `apply_epiphany_state_update` own state-update document shape and mutation law while `codex-core` calls them for compatibility. Vendored `CodexThread::epiphany_launch_job` is now mostly revision check, persistence validation, launch request handoff, and rollout/session writeback for the compatibility route. Vendored `codex-core` no longer has `epiphany_distillation`, `epiphany_promotion`, `epiphany_proposal`, or `epiphany_retrieval` husk modules; it re-exports native surfaces from `epiphany-core` directly, and now owns only the real Codex rollout adapter because it is a host seam. `epiphany-runtime-spine` advertises OpenAI adapter status/model-request/stream-event/receipt CultNet schemas and mutation contracts, so the native caller now has a real storage route instead of only JSON-RPC. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. The current OpenAI request path no longer pulls `codex-api`; `codex-login` remains deliberately sealed behind `epiphany-openai-auth-spine`, and the next spine decision is another Epiphany-in-vendor evacuation surface unless a concrete typed auth-status/runtime need requires exposing external bearer or agent-identity auth. latest_cut: > - Heartbeat adaptive pacing was split into - `heartbeat_state/heartbeat_pacing.rs`, with module-local coverage for - running pending-turn counts. Focused heartbeat tests and `epiphany-core` - check pass. - next_action: Continue the Codex starvation campaign at the next Epiphany-in-vendor evacuation surface; keep vendored Codex code as host routing/lifecycle glue only, preserve retained `codex-login` auth ownership, and prefer cuts that expose testable ownership boundaries over line-count theater. + `notes/repo-fractal-dataflow-cache-plan.md` now captures the repo-model + architecture direction: typed CultCache documents own semantic repo + domains, graph nodes, graph edges, conservative summaries, freshness, and + context packets; Qdrant is only the rebuildable embedding/contribution + cache for fast context-cut selection. + next_action: Continue the Codex starvation campaign unless the user directs the next slice into repo modeling. If repo modeling starts, first add typed repo-model document structs and pure `epiphany-core::repo_model` validation/context-cut tests before connecting Qdrant.