Persist Epiphany rebuild blueprint

This commit is contained in:
Meta Vens 2026-05-12 01:32:09 +01:00
commit 4b612c33f3
5 changed files with 583 additions and 29 deletions

View file

@ -95,9 +95,10 @@ The landed machine now has:
The current phase is Phase 6: reflection boundary and observable harness state.
The immediate next phase is foundation cleanup, recorded in
`notes/epiphany-architectural-teardown.md`. The May 2026 suspicion pass found
that the app-server Epiphany control plane has become architectural Jenga:
policy, projection, lifecycle glue, prompt packet assembly, coordinator
`notes/epiphany-architectural-teardown.md`, and the replacement blueprint is
`notes/epiphany-ideal-architecture-rebuild-plan.md`. The May 2026 suspicion
pass found that the app-server Epiphany control plane has become architectural
Jenga: policy, projection, lifecycle glue, prompt packet assembly, coordinator
sequencing, and tests are concentrated in the Codex host seam. Native-spine
extraction remains the direction, but the first duty is to rebuild/extract the
control plane so Codex app-server becomes an adapter again instead of the
@ -170,10 +171,10 @@ The plan should get shorter after a phase completes, not longer by default.
The next unknown is not whether Epiphany can preserve, read, propose, promote,
and notify typed state. It can.
The active priority is now the teardown plan in
`notes/epiphany-architectural-teardown.md`. Do not add outward feature surfaces
until there is a source-grounded cleanup slice for the control-plane ownership
problem.
The active priority is now the teardown/rebuild pair:
`notes/epiphany-architectural-teardown.md` and
`notes/epiphany-ideal-architecture-rebuild-plan.md`. Do not add outward feature
surfaces until the control-plane rebuild is underway.
The next unknowns are:
@ -188,6 +189,9 @@ The next unknowns are:
mutation intents without hiding authority from Aquarium or the operator
- how to remove public `raw_result` leakage from normal role/reorient findings
while preserving explicit forensic debugging
- how to land the first reversible rebuild slice: `epiphany-core/src/surfaces/`
plus pressure view derivation moved into core behind the existing
`thread/epiphany/pressure` wrapper
- what bridge surface is sufficient for the next Aetheria run: named Unity operations, Aetheria-side editor probes, GUI environment status, Rider context capture, and a Rider plugin MVP
- how much controlled runtime/editor access the richer Unity bridge gives implementation and verification lanes before deeper engine probes need another slice
- how the landed watcher-backed invalidation telemetry should be consumed without turning freshness into a secret worker
@ -326,18 +330,21 @@ Phase 6 must stop growing observable harness state outward until the control
plane is purified. The live surfaces are guardrails and evidence, not
permission to keep stacking protocols on the host seam.
Cleanup candidates:
Cleanup candidates, in the intended migration order:
1. Move Epiphany surface derivation and fixed-lane coordinator policy out of
1. Add `epiphany-core/src/surfaces/` and move pressure view derivation into
core while keeping the current app-server endpoint as a wrapper.
2. Move CRRC and fixed-lane coordinator policy out of
`codex_message_processor.rs` and into `epiphany-core`.
2. Make runtime-spine the single lifecycle authority for launched jobs and
3. Add typed acceptance receipts keyed by runtime result id; then switch
already-accepted checks to receipts and delete summary-string matching.
4. Make runtime-spine the single lifecycle authority for launched jobs and
results; thread state may link to jobs but must not mirror the job table.
3. Replace accepted-result summary matching with typed acceptance receipts.
4. Reduce the scene/jobs/roles/freshness/context/planning/pressure/reorient/
5. Reduce the scene/jobs/roles/freshness/context/planning/pressure/reorient/
CRRC/coordinator sprawl into fewer deliberate lenses and mutation intents.
5. Remove normal public raw-result exposure from role/reorient finding
6. Remove normal public raw-result exposure from role/reorient finding
contracts; keep forensic raw payloads explicit and sealed.
6. Split stable heartbeat scheduling from experimental cognition receipt blobs.
7. Split stable heartbeat scheduling from experimental cognition receipt blobs.
Do not spend Phase 6 adding another convenience surface because the current ones
work. Passing smokes prove behavior, not architecture. The Perfect Machine gets

View file

@ -0,0 +1,542 @@
# Epiphany Ideal Architecture Rebuild Plan
This is the smallest coherent Epiphany architecture that can satisfy the
product goals without preserving current abstractions merely because they
already have names. It complements `notes/epiphany-architectural-teardown.md`:
the teardown names the rot; this note names the replacement machine.
The intent is explicit: rebuild the control-plane foundation. Do not pile
feature adapters on top of the current app-server growth. Epiphany is the core
everything else will stand on, so the correct first move is structural
purification, not more decorated scaffolding.
## Product Goals To Preserve
Epiphany must still provide:
- durable typed project/thread state that survives turns, resume, rollback, and
compaction
- explicit maps, frontiers, scratch, evidence, and checkpoints
- bounded retrieval and indexing over a workspace
- review-gated distillation, proposal, promotion, and worker result acceptance
- observable role separation for implementation, modeling/checkpoint,
verification/review, planning/Imagination, and reorientation
- explicit CRRC behavior based on pressure, freshness, checkpoints, and runtime
evidence
- native runtime job/result receipts
- operator-safe Aquarium views and actions
- sealed forensic access to raw worker internals only when explicitly requested
- no GUI, worker, or app-server surface becoming a second source of truth
Anything beyond that is optional until the foundation is clean.
## Smallest Coherent Architecture
### Durable State Model
There is one durable project/thread mind: `EpiphanyState`.
It contains only facts or decisions that should survive rehydration:
- `revision`: monotonic state revision for optimistic writes
- `objective`: the active explicit mission, plus selected active subgoal
- `working_map`: architecture/dataflow graph nodes, edges, links, and code refs
- `frontier`: current active slice, dirty refs, open questions, and evidence
gaps
- `scratch`: disposable current hypothesis, next probe, and bounded notes
- `evidence`: accepted observations, verifier receipts, implementation audits,
rejected paths, and durable scars
- `checkpoint`: compaction/reorientation resume packet
- `planning`: captures, backlog items, roadmap streams, and Objective Drafts;
drafts are not active authority
- `runtime_links`: stable ids linking the durable project state to active or
recent runtime jobs/results when the association matters
- `acceptance_receipts`: typed records saying result `X` was reviewed and
accepted/refused/applied, with the patch/evidence ids it affected
It does not contain:
- job lifecycle state
- backend-specific runtime metadata
- copied runtime status
- raw worker output
- acceptance identity derived from summaries
- experimental cognition blobs
### Runtime State Model
There is one native runtime spine: `RuntimeState`.
It owns:
- runtime identity
- sessions
- jobs
- job results
- events
- cancellation/interruption status
- artifact refs
Runtime state is machinery telemetry. It is not project truth. Durable state may
link to runtime records, but must not mirror their lifecycle fields.
### Agent Memory And Heartbeat State
Role memory is separate from project truth:
- role dossier
- stable traits, goals, values, memories
- reviewed `selfPatch` mutations
Heartbeat state is the scheduler physiology:
- participants
- pending turns
- readiness/cooldown
- stable timing and selection fields
Void/Ghostlight-derived cognition output is not stable project state until it
has a typed contract. Sleep cycle, thought lanes, appraisals, bridge judgments,
and similar thought-weather should be receipts/artifacts or explicitly
quarantined experimental documents.
## Authoritative Boundaries
### `epiphany-core`
Owns domain truth and policy:
- durable state schema and validation
- state patch application
- view/lens derivation
- coordinator policy
- CRRC policy
- role result interpretation
- acceptance policy
- distillation, proposal, promotion
- retrieval/indexing domain behavior where practical
If a rule decides what Epiphany believes, recommends, accepts, rejects, or
considers safe, it belongs here.
### Native Runtime Spine
Owns execution lifecycle:
- job creation
- job status
- job result records
- runtime events
- cancellation/interruption
- artifact references
Runtime-spine is the job table. Thread state is not.
### Codex App-Server
Owns transport and host adaptation:
- parse JSON-RPC params
- load Codex thread/session/runtime inputs
- call `epiphany-core`
- serialize protocol responses
- emit host notifications
The app-server must not own Epiphany domain policy. It is a bridge, not the
brain. No more extra thrones in the vestibule.
### Aquarium
Owns operator presentation and explicit actions:
- render state/views/artifacts
- request bounded actions
- display reviewable findings
- surface sealed forensic artifacts only when explicitly requested
Aquarium owns no canonical understanding.
### Prompt Rendering
Owns projection into model context:
- render bounded durable state
- render role/control prompts
Prompt rendering does not mutate state and does not repair state by implication.
## Boundary Messages And API Surfaces
The ideal control plane has fewer surfaces.
### `epiphany/state/read`
Reads authoritative durable state.
### `epiphany/state/update`
Revision-gated durable state patch. No runtime lifecycle mutation except stable
links/receipts that are project truth.
### `epiphany/view`
Reads selected lenses from durable state plus runtime telemetry. It is
read-only. The request specifies lenses such as:
- `scene`
- `jobs`
- `roles`
- `freshness`
- `context`
- `graph`
- `planning`
- `pressure`
- `reorient`
- `coordinator`
These are derived outputs. They do not deserve separate protocol kingdoms
unless a lens becomes an independent product contract with its own authority
boundary.
### `epiphany/runtime/launch`
Creates a runtime-spine job and returns typed runtime ids. It may also add a
minimal durable runtime link if the project state needs the association.
### `epiphany/runtime/read`
Reads runtime session/job/result/event state from runtime-spine.
### `epiphany/runtime/interrupt`
Requests cancellation/interruption through runtime-spine.
### `epiphany/result/accept`
Accepts or refuses a typed runtime result by result id. It writes an
`acceptance_receipt`, optional durable patch, and optional evidence records.
Acceptance identity is the receipt/result id, not a summary string wearing a
fake moustache.
### `epiphany/retrieve/index`
Writes retrieval catalog/index state only.
### `epiphany/retrieve/query`
Reads retrieval catalog/search results only.
## Derived Instead Of Stored
Derive:
- scene summaries
- job view
- role lane status
- coordinator recommendation
- CRRC recommendation
- freshness status
- graph query neighborhoods
- pressure
- available actions
- whether a result has already been accepted
- role readiness
Store:
- durable project truth
- runtime lifecycle
- acceptance receipts
- evidence
- checkpoints
- role memory
- stable scheduler state
## Delete Or Collapse
Delete because it compensates for bad ownership:
- `jobBindings` as a lifecycle mirror
- one-backend `BackendKind::Heartbeat`
- `specialist-work` placeholder job
- summary-string accepted-result detection
- public `raw_result` in normal findings
- app-server-owned coordinator/CRRC policy
- app-server-owned role result interpretation
- tests that canonize mapper internals as architecture
Collapse:
- many `thread/epiphany/*` view endpoints into `epiphany/view` lenses
- job binding lifecycle fields into runtime-spine jobs/results
- public findings into typed projections plus sealed forensic artifacts
Split:
- app-server routing from Epiphany policy
- stable heartbeat scheduling from experimental cognition receipts
- public operator API from forensic/debug payload access
- protocol contracts from local mapper convenience
## Impossible By Construction
The rebuilt architecture should make these impossible:
- accepting the same runtime result twice without an existing typed receipt
- inferring acceptance from a summary string
- exposing raw worker output through normal operator APIs
- mutating durable state from a view/read endpoint
- app-server policy diverging from `epiphany-core` policy
- Aquarium becoming source of truth
- launching a job whose lifecycle is not owned by runtime-spine
- storing experimental cognition blobs as stable doctrine
- adding another operator lens by copying an app-server mapper pile
- treating GitHub, Unity, Rider, Discord, or any bridge as internal project
truth instead of external evidence/adapters
## Current Epiphany Compared To Ideal
### Sound Foundations
- durable typed `EpiphanyThreadState`
- prompt projection from durable state
- revision-gated update/promote/accept writes
- retrieval, distillation, proposal, and promotion work in `epiphany-core`
- native runtime-spine exists
- explicit review gates exist
- Aquarium is intended as reflector/control surface, not source of truth
### Rotten Or Unstable Foundations
- app-server owns too much policy
- protocol surface has exploded into many endpoint-shaped conveniences
- job lifecycle is split between durable thread state and runtime-spine
- acceptance identity is stringly
- raw worker payloads leak into normal public finding contracts
- heartbeat cognition is blob-heavy
- tests freeze accidental app-server implementation shape
Direct diagnosis: stop feature work and rebuild the control-plane foundation.
The current machine is capable, but the capable part is growing in the wrong
organ.
## Migration Plan
The migration must cut toward the ideal in small reversible commits. Prefer
deleting unstable foundations early over building adapters around them.
### 1. Freeze New Surfaces
Add a guardrail that no new `thread/epiphany/*` endpoint lands until extraction
has begun.
Commit shape:
- doc/test comment or compile-visible checklist near protocol additions
- no behavior change
Purpose: stop fresh surface sprawl while the foundation is being rebuilt.
### 2. Introduce Core View Types
Add `epiphany-core/src/surfaces/` with domain-level view input/output structs:
- `EpiphanyViewInput`
- `EpiphanyViewLens`
- `EpiphanyViewOutput`
- shared source snapshots for durable state, runtime state, retrieval summary,
watcher snapshot, and token pressure
Do not move behavior yet.
Purpose: create the destination organ before transplanting nerves.
### 3. Extract One Pure Read Lens
Move `pressure` or `freshness` derivation from app-server into `epiphany-core`.
Commit shape:
- app-server endpoint still exists
- app-server loads inputs and calls core
- existing smoke still passes
Preferred first lens: `pressure`, because it is pure and low-risk.
Purpose: prove the new ownership path with one small cut.
### 4. Extract CRRC And Coordinator Policy
Move CRRC recommendation and fixed-lane coordinator decision logic into
`epiphany-core`.
Commit shape:
- protocol response shape unchanged
- policy tests move to `epiphany-core`
- app-server tests narrow to routing/adapter fidelity
Purpose: remove the largest policy tumor early.
### 5. Add Typed Acceptance Receipts
Add durable `acceptance_receipts` keyed by runtime result id.
Commit shape:
- accepting a role/reorient result writes both old evidence and new receipt
- no old behavior deleted yet
- validation prevents malformed receipt ids
Purpose: build the replacement for summary-string identity.
### 6. Switch Acceptance Checks To Receipts
Use typed receipts for already-accepted role/reorient detection.
Commit shape:
- receipt path authoritative
- optional compatibility fallback for old state emits a warning/note
- tests prove duplicate acceptance is blocked by result id
Purpose: make acceptance identity real.
### 7. Delete Summary-Matching Acceptance Fallback
Remove summary-string detection once receipts are used by all live accept paths.
Purpose: delete the cursed machine. No retirement party.
### 8. Introduce Runtime Links
Add durable `runtime_links` that contain only stable association fields:
- role/scope
- runtime job id
- runtime result id when known
- related subgoal/graph ids when needed
Do not copy lifecycle status.
Commit shape:
- writes both old `jobBindings` and new `runtime_links`
- runtime-spine remains source of lifecycle truth
Purpose: prepare to demote `jobBindings`.
### 9. Switch Result Read-Back To Runtime Links
Use runtime-spine plus `runtime_links` to read role/reorient results.
Commit shape:
- `jobBindings` no longer needed for result lookup
- job view derives lifecycle from runtime-spine
Purpose: make runtime-spine the job table in practice.
### 10. Delete Or Shrink `jobBindings`
Remove lifecycle/backend fields from `jobBindings` or delete `jobBindings`
entirely if `runtime_links` covers the live need.
Purpose: stop mirroring runtime state in durable project truth.
### 11. Remove Public `raw_result`
Replace normal finding `raw_result` with typed fields plus artifact refs.
Commit shape:
- normal role/reorient result responses no longer expose raw payloads
- explicit forensic/debug path may read sealed artifact refs
- Aquarium/status surfaces consume typed projection only
Purpose: restore the operator-safe boundary.
### 12. Collapse View Endpoints Behind `epiphany/view`
Add `epiphany/view` with selectable lenses. Keep old endpoints as wrappers that
call the same core view.
Commit shape:
- no client break at first
- new view endpoint is canonical for new consumers
Purpose: stop protocol sprawl without a flag-day break.
### 13. Migrate Consumers To `epiphany/view`
Move MVP status/Aquarium/status bridge consumers lens by lens.
Commit shape:
- old endpoint wrappers remain
- each consumer move is independently reversible
Purpose: reduce dependency on the exploded API.
### 14. Delete Old View Endpoint Wrappers In Batches
Once consumers are off wrappers, remove obsolete endpoints in small groups:
- scene/context/graph/planning
- jobs/roles
- pressure/freshness/reorient/CRRC/coordinator
Purpose: actually reduce the surface area instead of preserving a compatibility
museum forever.
### 15. Split Heartbeat Stable And Experimental State
Keep typed scheduler fields in stable heartbeat state. Move cognition
thought-weather into typed receipts or artifact projections unless a field
directly drives scheduling policy.
Purpose: stop storing experimental blobs as stable doctrine.
### 16. Move Tests To Contract Level
For every extracted policy, move assertions into `epiphany-core`.
App-server tests should prove:
- params parse
- errors map correctly
- app-server passes the right inputs to core
- responses serialize
Purpose: tests should guard architecture, not embalm the old host-seam tumor.
## First Concrete Slice
The smallest coherent first implementation slice is:
1. add `epiphany-core/src/surfaces/`
2. move pressure derivation into core
3. leave `thread/epiphany/pressure` protocol unchanged as a wrapper
4. move pressure policy tests into core
5. run the existing pressure smoke
The first ruthless slice immediately after that is typed acceptance receipts.
Summary-string identity is not quaint. It is a small bureaucratic demon made of
string comparison, and it should be removed before more worker/result surfaces
depend on it.
## Success Criteria
The rebuild is working when:
- app-server Epiphany code is mostly routing/adaptation
- coordinator/CRRC policy lives in `epiphany-core`
- runtime-spine owns job lifecycle without durable mirror fields
- duplicate acceptance is prevented by typed receipts
- normal public findings contain no raw worker payload
- Aquarium can read one coherent view surface instead of a private verb zoo
- heartbeat scheduler state is typed and cognition experiments are quarantined
- adding a new view lens requires a core contract, not copying a mapper cluster
That is the smallest machine that still deserves the name Epiphany.

View file

@ -19,6 +19,7 @@ Get-Content '.\state\map.yaml'
Get-Content '.\notes\fresh-workspace-handoff.md'
Get-Content '.\notes\epiphany-current-algorithmic-map.md'
Get-Content '.\notes\epiphany-architectural-teardown.md'
Get-Content '.\notes\epiphany-ideal-architecture-rebuild-plan.md'
Get-Content '.\notes\epiphany-fork-implementation-plan.md'
git status --short --branch
git log --oneline -5
@ -32,6 +33,7 @@ remembers doctrine; the branch remembers the blade.
- Do not copy exact branch or HEAD from this note. Run `git status --short --branch` and `git log --oneline -5`.
- Top priority is now foundation cleanup, not outward feature work. Read `notes/epiphany-architectural-teardown.md` before touching Epiphany control-plane code. The May 2026 suspicion pass found that the app-server Epiphany control plane has become architectural Jenga: too much policy, projection, lifecycle glue, prompt packet assembly, coordinator sequencing, and test authority lives in `vendor/codex/codex-rs/app-server/src/codex_message_processor.rs`.
- Read `notes/epiphany-ideal-architecture-rebuild-plan.md` immediately after the teardown. It defines the smallest coherent replacement architecture: durable `EpiphanyState`, runtime-spine-owned `RuntimeState`, separate role memory/heartbeat state, `epiphany-core` as policy owner, app-server as adapter, Aquarium as reflector, typed acceptance receipts, and derived view lenses instead of a protocol verb zoo.
- Do not continue Aquarium UI, bridge, Face, or dogfood expansion until the teardown has a source-grounded cleanup slice plan. Epiphany is the foundation; patches on patches are not a purification rite, they are how the altar becomes load-bearing garbage.
- Phase 1 through Phase 5 are complete enough.
- Phase 6 has read-only `thread/epiphany/scene`, `thread/epiphany/jobs`, `thread/epiphany/roles`, `thread/epiphany/freshness`, `thread/epiphany/context`, `thread/epiphany/graphQuery`, `thread/epiphany/planning`, `thread/epiphany/pressure`, `thread/epiphany/reorient`, `thread/epiphany/crrc`, `thread/epiphany/coordinator`, `thread/epiphany/reorientResult`, and `thread/epiphany/roleResult`; durable `jobBindings` now act as a thin Epiphany-owned launcher seam with launcher id, authority scope, and heartbeat backend/job id. New `thread/epiphany/jobLaunch`, `thread/epiphany/jobInterrupt`, `thread/epiphany/roleLaunch`, and `thread/epiphany/reorientLaunch` writes open typed runtime-spine job receipts under `state/runtime-spine.msgpack` and do not require the Codex SQLite state runtime. Freshness carries watcher-backed invalidation inputs, graphQuery traverses authoritative typed graph neighborhoods and path/symbol matches without mutation, planning projects typed captures/backlog/roadmap/objective drafts without adopting work, roles project implementation/imagination/modeling/verification/reorientation ownership from existing signals without becoming a scheduler, `roleResult` and `reorientResult` read heartbeat-backed typed runtime-spine job results when present, `roleAccept` and `reorientAccept` accept completed heartbeat findings from typed runtime-spine results while remaining explicit review gates, `thread/epiphany/crrc` recommends the next explicit CRRC action without launching, accepting, compacting, scheduling, or mutating, and `thread/epiphany/coordinator` composes those signals into a fixed-lane MVP action recommendation without becoming a writer.
@ -351,6 +353,7 @@ Rules now in force:
- this handoff is a compact re-entry packet.
- `notes/epiphany-fork-implementation-plan.md` is the distilled forward plan.
- `notes/epiphany-architectural-teardown.md` is the active foundation-cleanup directive until the app-server control-plane ownership problems are resolved.
- `notes/epiphany-ideal-architecture-rebuild-plan.md` is the active rebuild blueprint and migration plan.
- `notes/epiphany-rider-unity-integration-plan.md` is the detailed Rider-as-IDE and Unity-as-editor/runtime integration plan.
- The stable live surface contract now lives in `state/map.yaml` plus `notes/epiphany-current-algorithmic-map.md`; the stale harness-surface duplicate was cut.
- `notes/epiphany-current-algorithmic-map.md` is the source-grounded control-flow map.
@ -368,15 +371,15 @@ that change what the next agent should believe.
Do not continue implementation automatically from a rehydrate-only request.
The next real move is foundation cleanup. Start from
`notes/epiphany-architectural-teardown.md`, not from the older outward Phase 6
bridge/UI trail. The first cleanup slice should be source-grounded and should
target the control-plane ownership problem: extract Epiphany view/coordinator
policy from the vendored app-server host seam into `epiphany-core`, make
runtime-spine the sole job/result lifecycle authority, replace summary-string
acceptance matching with typed receipts, collapse endpoint proliferation into
intentional lenses/mutation intents, remove normal public `raw_result` leakage,
and split stable heartbeat scheduling from experimental cognition receipts.
No Agile confetti. No new balcony on the swaying tower.
`notes/epiphany-architectural-teardown.md` and
`notes/epiphany-ideal-architecture-rebuild-plan.md`, not from the older outward
Phase 6 bridge/UI trail. The first reversible rebuild slice is to add
`epiphany-core/src/surfaces/`, move pressure view derivation into core while
leaving `thread/epiphany/pressure` as an app-server wrapper, and move pressure
policy tests into core. The next cuts are typed acceptance receipts,
runtime-spine lifecycle ownership, endpoint collapse into view lenses, removal
of normal public `raw_result`, and heartbeat cognition quarantine. No Agile
confetti. No new balcony on the swaying tower.
The Phase 6 freshness slice is landed. It exposes read-only
`thread/epiphany/freshness` from live retrieval summaries plus graph

Binary file not shown.

View file

@ -16,9 +16,10 @@ objective:
machine.
current: >
Stop outward feature work until the architectural teardown in
`notes/epiphany-architectural-teardown.md` is acted on. Epiphany is the
foundation for everything else; the current app-server control plane has
absorbed too much policy, projection, lifecycle glue, and coordinator
`notes/epiphany-architectural-teardown.md` and the rebuild blueprint in
`notes/epiphany-ideal-architecture-rebuild-plan.md` are acted on. Epiphany
is the foundation for everything else; the current app-server control plane
has absorbed too much policy, projection, lifecycle glue, and coordinator
sequencing. The next work is foundation cleanup, not another bridge,
Aquarium pane, Face surface, or convenience layer.
@ -65,7 +66,7 @@ data_flow:
- move historical proof to git, commits, smoke artifacts, or distilled evidence rather than plan prose
active_subgoals:
- Top priority: execute the teardown plan in `notes/epiphany-architectural-teardown.md`; rebuild/extract the Epiphany app-server control plane before adding outward features. Move Epiphany view/coordinator policy into `epiphany-core`, make runtime-spine the sole job/result lifecycle authority, replace summary-string acceptance identity with typed receipts, reduce API surface proliferation, remove normal public raw-result leakage, and type or quarantine heartbeat cognition blobs.
- Top priority: execute the teardown/rebuild plan in `notes/epiphany-architectural-teardown.md` and `notes/epiphany-ideal-architecture-rebuild-plan.md`; rebuild/extract the Epiphany app-server control plane before adding outward features. Move Epiphany view/coordinator policy into `epiphany-core`, make runtime-spine the sole job/result lifecycle authority, replace summary-string acceptance identity with typed receipts, reduce API surface proliferation into a lens-based view surface, remove normal public raw-result leakage, and type or quarantine heartbeat cognition blobs.
- 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, scene, jobs, roles, roleResult, freshness, context, graphQuery, planning, pressure, reorient, crrc, coordinator, and reorientResult.
- Keep the landed Phase 6 coordinator, limited safe-boundary CRRC automation, and pre-compaction checkpoint intervention ready for the next bridge-equipped dogfood run.
@ -88,6 +89,7 @@ active_subgoals:
accepted_design:
- `notes/epiphany-architectural-teardown.md` is the current foundation-cleanup directive. Its suspicion pass supersedes outward Phase 6 expansion as the active priority until the control-plane ownership problems are resolved.
- `notes/epiphany-ideal-architecture-rebuild-plan.md` is the replacement blueprint: the smallest coherent architecture is durable `EpiphanyState`, runtime-spine-owned `RuntimeState`, separate role memory/heartbeat state, `epiphany-core` as policy owner, app-server as adapter, Aquarium as reflector, typed result acceptance receipts, and derived view lenses instead of a protocol verb zoo.
- Epiphany is a fork-level modeling architecture, not merely a Codex collaboration mode.
- Authoritative Epiphany state lives in Codex protocol/core session and rollout state.
- The prompt reads typed state through a bounded `<epiphany_state>` developer fragment.
@ -268,5 +270,5 @@ rejected_paths:
reason: persistent state that accumulates every local truth becomes memory cruft and weakens rehydration
current_status:
summary: Phase 1 durable state through Phase 6 coordinator/specialist/CRRC/backend organs are landed, but the May 2026 architectural teardown found that the app-server Epiphany control plane has become architectural Jenga: policy, projection, lifecycle glue, prompt packet assembly, coordinator sequencing, and tests are concentrated in the host seam. The foundations are conceptually sound, but the control plane must be extracted/rebuilt before outward feature work resumes.
next_action: Treat `notes/epiphany-architectural-teardown.md` as the active top-priority cleanup directive. Start with the control-plane rebuild: extract Epiphany view/coordinator policy from `vendor/codex/codex-rs/app-server/src/codex_message_processor.rs` into `epiphany-core`, make runtime-spine the sole job/result lifecycle authority, replace summary-string acceptance detection with typed acceptance receipts, collapse endpoint proliferation into intentional view lenses/mutation intents, remove normal public `raw_result` leakage, and split stable heartbeat scheduling from experimental cognition receipts. Do not continue Aquarium UI, bridge, Face, or dogfood expansion until this foundation cleanup has a source-grounded slice plan.
summary: Phase 1 durable state through Phase 6 coordinator/specialist/CRRC/backend organs are landed, but the May 2026 architectural teardown found that the app-server Epiphany control plane has become architectural Jenga: policy, projection, lifecycle glue, prompt packet assembly, coordinator sequencing, and tests are concentrated in the host seam. The foundations are conceptually sound, and `notes/epiphany-ideal-architecture-rebuild-plan.md` now defines the smallest coherent replacement architecture.
next_action: Treat `notes/epiphany-architectural-teardown.md` and `notes/epiphany-ideal-architecture-rebuild-plan.md` as the active top-priority cleanup directive. Start with the first reversible rebuild slice: add `epiphany-core/src/surfaces/`, move pressure view derivation into core while leaving `thread/epiphany/pressure` as an app-server wrapper, and move pressure policy tests into core. Then pursue typed acceptance receipts, runtime-spine lifecycle ownership, endpoint collapse into view lenses, removal of public `raw_result`, and heartbeat cognition quarantine. Do not continue Aquarium UI, bridge, Face, or dogfood expansion until this foundation cleanup is underway.