Align Epiphany write state projection
This commit is contained in:
parent
81616b9151
commit
ed7c9160b0
7 changed files with 99 additions and 25 deletions
|
|
@ -21,7 +21,7 @@ The spine exists in eleven live paths:
|
|||
- explicit map/churn proposals: app-server routes read-only `thread/epiphany/propose` through a loaded-thread handler into `epiphany-core` so verified observations with code refs and accepting recent evidence can be selected explicitly or auto-selected as a bounded path cluster, prioritize the strongest selected observation, focus or extend architecture graph nodes, rescue unanchored graph nodes through strict semantic overlap, carry linked dataflow nodes and incident graph edges into the frontier, update churn candidates with match-kind-aware map-delta judgment and pressure, and still avoid mutation until promotion in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4244) and [proposal.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/proposal.rs:115).
|
||||
- explicit promotion gates: app-server routes `thread/epiphany/promote` through a loaded-thread handler into `epiphany-core` policy evaluation, rejects failed verifier evidence without mutation, applies accepted candidates through the same durable update path, and now treats medium/high/expanded/broadening/semantic churn deltas as needing explicit rationale plus stronger verifier evidence whose kind is token-matched rather than substring-matched in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4316) and [promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:33).
|
||||
- explicit state updates: app-server routes `thread/epiphany/update` through a loaded `CodexThread` update method that rejects malformed appended observation/evidence graph records and structurally invalid replacement fields, mutates live `SessionState` only after validation, bumps the revision, and persists an immediate `RolloutItem::EpiphanyState` snapshot in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4436), [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:374), [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:552), and [promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:44).
|
||||
- live state notifications and write responses: app-server declares experimental `thread/epiphany/stateUpdated` and emits it with the updated typed state, typed `source`, event-level `revision`, and typed `changedFields` after successful direct updates and accepted promotions, but not after rejected promotions; direct `thread/epiphany/update` and accepted `thread/epiphany/promote` responses now expose the same revision/change metadata, and accepted promotions always report `Evidence` because verifier evidence is appended even when the patch evidence list is empty, in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:1097), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:3992), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4058), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4069), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4379), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4464), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10509), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10552).
|
||||
- live state notifications and write responses: app-server declares experimental `thread/epiphany/stateUpdated` and emits it with the updated typed state, typed `source`, event-level `revision`, and typed `changedFields` after successful direct updates and accepted promotions, but not after rejected promotions; direct `thread/epiphany/update` and accepted `thread/epiphany/promote` responses expose the same revision/change metadata, accepted promotions always report `Evidence` because verifier evidence is appended even when the patch evidence list is empty, and successful write response/notification states now use the same client-visible live projection as `thread/read`, including retrieval-summary backfill when durable state has no persisted retrieval metadata, in [common.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs:1097), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:3992), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4058), [v2.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs:4069), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4381), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4415), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4470), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4502), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10430), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10440), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10526), and [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10569).
|
||||
- retrieval/indexing: app-server routes `thread/epiphany/retrieve` and `thread/epiphany/index` through loaded `CodexThread` host methods into `epiphany-core` in [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4046), [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4122), [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:438), and [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:456).
|
||||
|
||||
The thick Epiphany-owned implementation is mostly outside vendored Codex now:
|
||||
|
|
@ -80,8 +80,9 @@ flowchart TD
|
|||
ZA --> ZB["Apply typed patch and increment revision"]
|
||||
ZB --> B
|
||||
ZB --> ZC["Persist immediate RolloutItem::EpiphanyState"]
|
||||
ZB --> ZD["Emit thread/epiphany/stateUpdated notification with source, revision, changedFields"]
|
||||
ZD --> Q
|
||||
ZB --> ZD["Project client-visible live state (retrieval summary backfill if needed)"]
|
||||
ZD --> ZE["Return response and emit thread/epiphany/stateUpdated with source, revision, changedFields"]
|
||||
ZE --> Q
|
||||
ZC --> K
|
||||
T --> V["epiphany-core retrieve_workspace"]
|
||||
U --> W["epiphany-core index_workspace"]
|
||||
|
|
@ -98,6 +99,7 @@ What this means in plain English:
|
|||
- A loaded thread can ask a verifier-backed promotion gate to reject or apply that proposal.
|
||||
- A loaded thread can now accept explicit typed state patches and persist them immediately.
|
||||
- Successful direct updates and accepted promotions now return and notify clients that typed state changed, which revision landed, and which top-level state fields changed.
|
||||
- Those write response/notification states are now projected through the same live read helper as `thread/read`, so retrieval-summary backfill is consistent across client-visible state surfaces without becoming a durable write.
|
||||
- Retrieval and indexing are typed side paths hanging off loaded threads.
|
||||
- Retrieval remains read-only; state mutation has its own control-plane door.
|
||||
- Map/churn proposal is also read-only; accepted graph/churn edits still go through promotion and update.
|
||||
|
|
@ -129,7 +131,7 @@ This is the same flow in the language Epiphany is supposed to make the model car
|
|||
| Proposal | Verified observations with code refs and accepting recent evidence can produce a candidate graph frontier/churn patch without writing it. The caller can provide ids, or the proposal engine can choose a small ready path cluster, then reuse existing map nodes, focus linked context, and report pressure from the actual map delta. | The clerk overlays tracing paper on the old blueprint before drawing a new wall through the plumbing, choosing only the relevant marked pages before measuring how much load the sketch would put on the frame. |
|
||||
| Promotion | A verifier-backed gate can reject a proposal without mutation or send it through the durable update path. | The foreman stamps the pencil draft before the clerk reaches for the red pen. |
|
||||
| State updates | A loaded thread can accept explicit typed patches that append validated observations/evidence and replace bounded map/scratch/churn fields. Malformed appended evidence graph records and structurally broken replacement fields are rejected before mutation. | The clerk finally has the red pen, but the ledger refuses orphan receipts and impossible blueprint tabs before the ink touches paper. |
|
||||
| State responses and notifications | Successful direct updates and accepted promotions return the landed revision and changed-field labels to the caller, then publish the updated typed state to app-server clients with source, revision, and changed-field labels saying which control-plane door caused it and which ledger sections changed. | The clerk hands the filing receipt to the person at the counter, then rings the little bell for the room; both say which page number landed and which tabs were touched. |
|
||||
| State responses and notifications | Successful direct updates and accepted promotions return the landed revision and changed-field labels to the caller, then publish the updated typed state to app-server clients with source, revision, and changed-field labels saying which control-plane door caused it and which ledger sections changed. The state object is the same client-visible projection as `thread/read`, including retrieval-summary backfill when needed. | The clerk hands the filing receipt to the person at the counter, then rings the little bell for the room; both say which page number landed and which tabs were touched, with the card-catalog status clipped to the same page the dashboard would show. |
|
||||
|
||||
## Flow 1: State Shape
|
||||
|
||||
|
|
@ -571,10 +573,11 @@ The app-server handler:
|
|||
2. requires the thread to be loaded.
|
||||
3. maps the app-server patch DTO into `EpiphanyStateUpdate`.
|
||||
4. calls `CodexThread.epiphany_update_state`.
|
||||
5. returns the updated `EpiphanyThreadState` plus response-level `revision` and `changedFields`.
|
||||
6. computes `changedFields` from the accepted patch surface.
|
||||
7. emits `thread/epiphany/stateUpdated` with `source: "update"`, event-level `revision`, typed `changedFields`, and the same updated state.
|
||||
8. reports empty patches and revision mismatches as invalid requests before notification.
|
||||
5. computes `changedFields` from the accepted patch surface.
|
||||
6. projects the just-written state through `client_visible_live_thread_epiphany_state`, which reuses the `thread/read` live-state helper and backfills retrieval summary metadata when needed.
|
||||
7. returns the client-visible `EpiphanyThreadState` plus response-level `revision` and `changedFields`.
|
||||
8. emits `thread/epiphany/stateUpdated` with `source: "update"`, event-level `revision`, typed `changedFields`, and the same client-visible updated state.
|
||||
9. reports empty patches and revision mismatches as invalid requests before notification.
|
||||
|
||||
`CodexThread.epiphany_update_state`:
|
||||
|
||||
|
|
@ -595,8 +598,11 @@ The replay helpers now also accept an out-of-band Epiphany snapshot before the f
|
|||
|
||||
Code refs:
|
||||
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4436)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4507)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4439)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4502)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4512)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10430)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10440)
|
||||
- [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:100)
|
||||
- [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:374)
|
||||
- [codex_thread.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/core/src/codex_thread.rs:552)
|
||||
|
|
@ -608,7 +614,7 @@ Code refs:
|
|||
|
||||
### Output
|
||||
|
||||
The response contains the updated `epiphanyState`, response-level `revision`, and response-level `changedFields`. The durable side effect is a rollout `EpiphanyState` snapshot. The live side effect is a `thread/epiphany/stateUpdated` notification carrying `source: "update"`, event-level `revision`, typed `changedFields`, and the same updated state to app-server clients. Invalid append or replacement patches return an invalid-request error, leave revision unchanged, and emit no state update notification.
|
||||
The response contains the updated client-visible `epiphanyState`, response-level `revision`, and response-level `changedFields`. The durable side effect is a rollout `EpiphanyState` snapshot. The live side effect is a `thread/epiphany/stateUpdated` notification carrying `source: "update"`, event-level `revision`, typed `changedFields`, and the same client-visible updated state to app-server clients. That state uses the same retrieval-summary backfill as `thread/read`, but the backfill remains a view projection rather than a durable mutation. Invalid append or replacement patches return an invalid-request error, leave revision unchanged, and emit no state update notification.
|
||||
|
||||
### Invariant
|
||||
|
||||
|
|
@ -834,8 +840,9 @@ The app-server handler:
|
|||
5. appends verifier evidence to the patch evidence when policy accepts.
|
||||
6. maps the patch into `EpiphanyStateUpdate`.
|
||||
7. calls `CodexThread.epiphany_update_state`.
|
||||
8. returns the updated `EpiphanyThreadState` plus response-level `revision` and `changedFields`.
|
||||
9. emits `thread/epiphany/stateUpdated` with `source: "promote"`, event-level `revision`, and typed `changedFields` only for the accepted path; `Evidence` is included even if the accepted patch had no patch evidence because verifier evidence was appended to the durable state.
|
||||
8. projects the just-written state through `client_visible_live_thread_epiphany_state`, matching the `thread/read` live-state view and retrieval-summary backfill.
|
||||
9. returns the client-visible `EpiphanyThreadState` plus response-level `revision` and `changedFields`.
|
||||
10. emits `thread/epiphany/stateUpdated` with `source: "promote"`, event-level `revision`, and typed `changedFields` only for the accepted path; `Evidence` is included even if the accepted patch had no patch evidence because verifier evidence was appended to the durable state.
|
||||
|
||||
`evaluate_promotion` currently enforces a deliberately small but now delta-aware policy:
|
||||
|
||||
|
|
@ -854,8 +861,11 @@ Code refs:
|
|||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4316)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4349)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4363)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4393)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4417)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4399)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4415)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:4427)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10430)
|
||||
- [codex_message_processor.rs](E:/Projects/EpiphanyAgent/vendor/codex/codex-rs/app-server/src/codex_message_processor.rs:10440)
|
||||
- [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:33)
|
||||
- [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:126)
|
||||
- [epiphany-core/src/promotion.rs](E:/Projects/EpiphanyAgent/epiphany-core/src/promotion.rs:157)
|
||||
|
|
@ -863,7 +873,7 @@ Code refs:
|
|||
|
||||
### Output
|
||||
|
||||
Rejected promotions return reasons and no state. Accepted promotions return the updated `epiphanyState`, response-level `revision`, and response-level `changedFields` from the durable update path, then emit `thread/epiphany/stateUpdated` with `source: "promote"`, event-level `revision`, typed `changedFields`, plus that state. Because accepted promotion always appends verifier evidence, promotion responses and notifications report `Evidence` even when the submitted patch evidence array was empty.
|
||||
Rejected promotions return reasons and no state. Accepted promotions return the updated client-visible `epiphanyState`, response-level `revision`, and response-level `changedFields` from the durable update path, then emit `thread/epiphany/stateUpdated` with `source: "promote"`, event-level `revision`, typed `changedFields`, plus that same projected state. Because accepted promotion always appends verifier evidence, promotion responses and notifications report `Evidence` even when the submitted patch evidence array was empty. Because accepted promotion now uses the `thread/read` live-state projection, clients also see retrieval-summary backfill consistently without promotion becoming a retrieval writer.
|
||||
|
||||
### Invariant
|
||||
|
||||
|
|
@ -928,7 +938,7 @@ Current tests cover the landed flows at useful seams:
|
|||
- retrieval ranking, fallback, stale manifest detection, and mocked Qdrant/Ollama indexing in `epiphany-core`.
|
||||
- app-server protocol serde for `thread/epiphany/retrieve`, `thread/epiphany/index`, `thread/epiphany/distill`, `thread/epiphany/propose`, `thread/epiphany/promote`, `thread/epiphany/update`, and `thread/epiphany/stateUpdated`.
|
||||
- app-server mapping of core retrieval/index summaries into protocol responses.
|
||||
- reusable app-server smoke for the richer Phase 5 chain in `tools/epiphany_phase5_smoke.py`, including update/promote response metadata, `thread/epiphany/stateUpdated` notifications with source, revision, changed-field checks, the verifier-only promotion edge where `Evidence` changes because verifier evidence is appended, invalid direct observation/evidence and replacement update rejection without mutation or notification, and explicit zero-notification assertions for rejected promotions.
|
||||
- reusable app-server smoke for the richer Phase 5 chain in `tools/epiphany_phase5_smoke.py`, including update/promote response metadata, `thread/epiphany/stateUpdated` notifications with source, revision, changed-field checks, retrieval-summary presence in successful write response/notification states, the verifier-only promotion edge where `Evidence` changes because verifier evidence is appended, invalid direct observation/evidence and replacement update rejection without mutation or notification, and explicit zero-notification assertions for rejected promotions.
|
||||
|
||||
Useful commands:
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Status
|
||||
|
||||
Updated on 2026-04-25 after hardening the first live typed Epiphany state notification seam with event-level revision and typed changed-field metadata.
|
||||
Updated on 2026-04-25 after hardening successful update/promote responses and `thread/epiphany/stateUpdated` notifications to publish the same client-visible live Epiphany state projection as `thread/read`, including retrieval-summary backfill.
|
||||
|
||||
This note tracks Epiphany as a fork of Codex with an opinionated modeling architecture. The point is not to offer Codex another collaboration preset. The point is to make the harness force the model to carry explicit structure about the codebase, the active subgoal, the evidence trail, and the machine it is modifying.
|
||||
|
||||
|
|
@ -32,6 +32,7 @@ This note tracks Epiphany as a fork of Codex with an opinionated modeling archit
|
|||
- a direct write-response hardening slice: successful `thread/epiphany/update` and accepted `thread/epiphany/promote` responses now include response-level `revision` and `changedFields`, matching the notification metadata without forcing the initiating caller to wait for or diff the live event
|
||||
- a rejected-promotion silence smoke hardening slice: the reusable Phase 5 app-server smoke now asserts rejected `thread/epiphany/promote` calls do not emit `thread/epiphany/stateUpdated`, preserving the "no mutation, no bell" contract
|
||||
- a direct-update integrity hardening slice: `thread/epiphany/update` now validates appended observation/evidence graph records and structural replacement fields before mutation, rejects empty/duplicate/reused append ids, missing evidence references, and invalid graph/frontier/checkpoint/subgoal/churn replacement shapes, and the reusable smoke asserts invalid direct updates leave revision unchanged with no `thread/epiphany/stateUpdated` notification
|
||||
- a write/read surface consistency hardening slice: successful direct update and accepted promote responses plus their `thread/epiphany/stateUpdated` notifications now reuse the same live Epiphany state projection as `thread/read`, so clients get retrieval-summary backfill consistently instead of receiving a raw just-written state in one surface and a richer read state in another
|
||||
- current phase: post-Phase-5 live typed state/read-surface hardening
|
||||
|
||||
The next job is no longer to prove the retriever exists, sketch the persistent follow-up in prose, invent the first red-pen path, build the first observation proposal surface, make promotion notice broken map/churn replacements, ship the first read-only map/churn proposal surface, teach proposal to avoid duplicating already-mapped code surfaces, make proposal frontier focus follow existing graph links, make selected observations evidence-backed with non-haunted churn pressure, rescue unanchored graph nodes with strict semantic matching, let proposal choose a bounded ready observation set when ids are omitted, make proposal pressure understand match kinds, make the distiller summarize noisy source output, make source-output salience prefer final results over generic warnings, make promotion notice risky deltas, make expansion freshness resistant to low-pressure underreporting, prevent substring verifier-kind accidents, prove that richer chain over app-server by hand, add the first live state notification after successful writes, or make that notification say which revision and state sections changed. Those parts are landed or live-smoked. The next job is to use the reusable smoke harness as a guardrail before adding the next smallest source-grounded notification/read/proposal/promotion rule, and to keep `thread/epiphany/retrieve`, `thread/epiphany/distill`, and `thread/epiphany/propose` out of the durable-writer business.
|
||||
|
|
@ -246,11 +247,12 @@ Current bounded shape of that follow-up:
|
|||
- it carries `source: "promote"` after accepted `thread/epiphany/promote`
|
||||
- it carries event-level `revision` so clients can sequence updates without cracking open the full state first
|
||||
- it carries typed `changedFields` derived from the accepted patch surface so clients can react to top-level state-section changes without diffing the entire `epiphanyState`
|
||||
- successful update/promote responses and notifications publish the same client-visible live state projection as `thread/read`; if the durable state has no persisted retrieval metadata yet, the non-durable retrieval summary backfill is present in those response/notification states too
|
||||
- accepted promotion notifications include `evidence` even when the patch evidence list was empty, because verifier evidence is appended to durable state after policy acceptance
|
||||
- it does not fire for rejected promotions, because rejection still does not mutate state
|
||||
- successful `thread/epiphany/update` responses now also carry response-level `revision` and `changedFields`
|
||||
- accepted `thread/epiphany/promote` responses now also carry response-level `revision` and `changedFields`; rejected promotion responses omit revision/change metadata and still carry reasons plus no state
|
||||
- the richer app-server smoke now asserts direct update responses/notifications publish revision/changed-fields `1`/`observations,evidence`, verifier-only accepted promotion responses/notifications publish `2`/`observations,evidence`, and accepted graph/churn promotion responses/notifications publish `3`/`graphs,graphFrontier,observations,evidence,churn`
|
||||
- the richer app-server smoke now asserts direct update responses/notifications publish revision/changed-fields `1`/`observations,evidence`, verifier-only accepted promotion responses/notifications publish `2`/`observations,evidence`, accepted graph/churn promotion responses/notifications publish `3`/`graphs,graphFrontier,observations,evidence,churn`, and all successful write response/notification states include the same retrieval-summary backfill exposed by `thread/read`
|
||||
- the richer app-server smoke also asserts rejected promotion attempts leave `rejectedPromotionNotificationCount` at `0`
|
||||
- the richer app-server smoke now also asserts malformed direct `thread/epiphany/update` observation/evidence appends and structural replacement patches return invalid-request errors, leave revision at `2`, and leave `invalidDirectUpdateNotificationCount` / `invalidReplacementUpdateNotificationCount` at `0`
|
||||
|
||||
|
|
@ -304,7 +306,7 @@ Add tests for:
|
|||
|
||||
## Immediate Next Step
|
||||
|
||||
Treat the current retrieval baseline and explicit indexing follow-up as landed Phase 4. Treat the explicit update path, distillation proposal path, read-only map/churn proposal path, verifier-backed promotion gate, structural map/churn promotion validation, direct-update append/replacement integrity validation, graph-node reuse, linked frontier focus, evidence-backed selection, map-delta churn pressure, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation-set selection, match-kind-aware map-delta judgment, source-output-aware observation distillation, source-output salience ranking, risky-delta promotion policy, expansion-freshness promotion hardening, token-aware verifier-kind promotion hardening, reusable richer app-server smoke harness, and sourced/revisioned/changed-field `thread/epiphany/stateUpdated` notification seam as the active baseline. The next machine gap is no longer "can Epiphany retrieve code?", "can it propose one durable observation patch?", "can it draft one bounded map/churn candidate?", "can it avoid duplicating an existing graph node when an observation points at already-mapped code?", "can it focus linked graph context?", "can it reject selected observations that are not backed by accepting recent evidence?", "can it use graph language when no concrete refs exist yet?", "can it choose a proposal-ready observation set when ids are omitted?", "can it distinguish exact refinement from same-path broadening or semantic anchoring?", "can it summarize noisy tool/model output as typed evidence?", "can it rank final result/error/finished lines above generic warnings?", "can promotion policy reason over richer deltas without silently writing them?", "can direct update reject malformed append and replacement patches before writing?", "can expansion freshness resist low-pressure underreporting?", "can verifier kind matching avoid substring accidents?", "does the richer Phase 5 chain behave through the app-server seam?", or "can successful writes notify a client what changed state and why?" It can.
|
||||
Treat the current retrieval baseline and explicit indexing follow-up as landed Phase 4. Treat the explicit update path, distillation proposal path, read-only map/churn proposal path, verifier-backed promotion gate, structural map/churn promotion validation, direct-update append/replacement integrity validation, graph-node reuse, linked frontier focus, evidence-backed selection, map-delta churn pressure, selected-observation prioritization, strict unanchored-node semantic reuse, automatic bounded observation-set selection, match-kind-aware map-delta judgment, source-output-aware observation distillation, source-output salience ranking, risky-delta promotion policy, expansion-freshness promotion hardening, token-aware verifier-kind promotion hardening, reusable richer app-server smoke harness, and sourced/revisioned/changed-field `thread/epiphany/stateUpdated` notification seam with write/read retrieval-summary projection consistency as the active baseline. The next machine gap is no longer "can Epiphany retrieve code?", "can it propose one durable observation patch?", "can it draft one bounded map/churn candidate?", "can it avoid duplicating an existing graph node when an observation points at already-mapped code?", "can it focus linked graph context?", "can it reject selected observations that are not backed by accepting recent evidence?", "can it use graph language when no concrete refs exist yet?", "can it choose a proposal-ready observation set when ids are omitted?", "can it distinguish exact refinement from same-path broadening or semantic anchoring?", "can it summarize noisy tool/model output as typed evidence?", "can it rank final result/error/finished lines above generic warnings?", "can promotion policy reason over richer deltas without silently writing them?", "can direct update reject malformed append and replacement patches before writing?", "can expansion freshness resist low-pressure underreporting?", "can verifier kind matching avoid substring accidents?", "does the richer Phase 5 chain behave through the app-server seam?", "can successful writes notify a client what changed state and why?", or "do successful write responses/notifications expose the same retrieval-summary-backed state projection as `thread/read`?" It can.
|
||||
|
||||
1. treat the current verified-and-landed query-time hybrid retriever as the Phase 4 slice 1 baseline
|
||||
2. treat the verified and live-smoked `thread/epiphany/index` slice as the bounded persistent-semantic follow-up
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ Recent anchor commits:
|
|||
- current slice - added response-level `revision` and `changedFields` to successful `thread/epiphany/update` and accepted `thread/epiphany/promote` responses
|
||||
- current slice - hardened the reusable Phase 5 smoke so rejected promotions explicitly prove `thread/epiphany/stateUpdated` stays silent
|
||||
- current slice - hardened direct `thread/epiphany/update` so 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.
|
||||
|
||||
|
|
@ -94,6 +95,7 @@ Current verified typed state/promotion layer:
|
|||
- experimental loaded-thread-only `thread/epiphany/propose`
|
||||
- experimental `thread/epiphany/stateUpdated` notifications after successful direct updates and accepted promotions, with typed `source` values of `update` or `promote`, event-level `revision`, and typed `changedFields`
|
||||
- response-level `revision` and `changedFields` on successful `thread/epiphany/update` and accepted `thread/epiphany/promote`
|
||||
- successful update/promote response and notification state payloads now include the same non-durable retrieval-summary backfill that live `thread/read` exposes 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/update` validation 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 shared `epiphany-core` structural validator before the durable writer mutates state
|
||||
- deterministic observation/evidence proposal generation in `epiphany-core`
|
||||
|
|
@ -101,7 +103,7 @@ Current verified typed state/promotion layer:
|
|||
- 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 accepting `recent_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 understates `diff_pressure`, and strong verifier kinds are token-matched instead of substring-matched
|
||||
- core `CodexThread.epiphany_update_state(...)` applies the patch to live `SessionState`, bumps revision, persists `RolloutItem::EpiphanyState`, and flushes rollout
|
||||
- app-server now returns response-level `revision` and `changedFields` from successful direct update and accepted promotion calls, and emits `thread/epiphany/stateUpdated` after the direct update path and after accepted promotion return an updated state; notifications identify their `source`, expose event-level `revision`, list typed `changedFields`, 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
|
||||
- app-server now returns response-level `revision` and `changedFields` from successful direct update and accepted promotion calls, and emits `thread/epiphany/stateUpdated` after the direct update path and after accepted promotion return an updated state; notifications identify their `source`, expose event-level `revision`, list typed `changedFields`, publish the same retrieval-summary-backed client-visible state projection as `thread/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-core` and `epiphany-core` accept 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
|
||||
|
||||
|
|
@ -210,7 +212,7 @@ What is wired right now:
|
|||
- `thread/epiphany/promote` is the first explicit promotion gate; it rejects failed verifier evidence without mutation and applies accepted candidates through the update path
|
||||
- `thread/epiphany/promote` now 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 called
|
||||
- `thread/epiphany/update` is 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 immediately
|
||||
- `thread/epiphany/stateUpdated` is the first live typed-state notification surface; it fires only after successful `thread/epiphany/update` and accepted `thread/epiphany/promote`, carrying the full updated `epiphanyState`, event-level `revision`, typed `changedFields`, plus `source: "update"` or `source: "promote"`; the direct update/promote responses also return `revision` and `changedFields`
|
||||
- `thread/epiphany/stateUpdated` is the first live typed-state notification surface; it fires only after successful `thread/epiphany/update` and accepted `thread/epiphany/promote`, carrying the full updated client-visible `epiphanyState`, event-level `revision`, typed `changedFields`, plus `source: "update"` or `source: "promote"`; the direct update/promote responses also return `revision` and `changedFields`, and all successful write response/notification states now use the same retrieval-summary backfill as `thread/read`
|
||||
- live hydrated `thread.epiphanyState` reads 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:
|
||||
|
|
@ -367,7 +369,7 @@ If a future session wakes up from compaction and starts bluffing, this is the pa
|
|||
- 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`, and `thread/epiphany/promote` exist and are live-smoked
|
||||
- experimental `thread/epiphany/stateUpdated` now exists and is live-smoked for both direct update and accepted promote paths, including source labels, event-level revision, and typed changed fields; successful update/promote responses now mirror revision and changed fields too
|
||||
- experimental `thread/epiphany/stateUpdated` now 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 `observationIds` and let `epiphany-core` choose a bounded coherent path cluster from existing verified, evidence-backed observations using source/evidence quality plus graph-frontier focus
|
||||
|
|
@ -524,4 +526,4 @@ cmd /c "\"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxi
|
|||
|
||||
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 current Phase 5 distill/propose/promote/update baseline are landed and verified. `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 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. Direct updates now reject malformed appended observations/evidence and structurally invalid replacement fields before mutation, including missing evidence references, duplicate append ids, durable id reuse, and impossible graph frontier/checkpoint/subgoal/churn shapes. Read-only distillation now summarizes noisy tool/model output into typed evidence and ranks final result/error/finished lines above generic warnings, read-only proposal can auto-select a bounded evidence-backed observation cluster and report match-kind-aware map-delta pressure, promotion rejects risky deltas without warning plus strong verifier evidence, expansion freshness cannot bypass warning requirements by claiming low pressure, and verifier kinds are token-matched so `contest` does not pass as `test`. The current Epiphany algorithmic map has been source-audited against the code flow it describes. The richer Phase 5 chain is now live-smoked through app-server by `tools/epiphany_phase5_smoke.py`, including update response/notification revision/changed-fields `1`/`observations,evidence`, verifier-only accepted promotion response/notification changed-fields `2`/`observations,evidence`, invalid direct observation/evidence update rejection with `invalidDirectUpdateNotificationCount: 0` and unchanged revision `2`, invalid direct replacement update rejection with `invalidReplacementUpdateNotificationCount: 0` and unchanged revision `2`, expanded-low-pressure and substring-verifier rejection checks, explicit rejected-promotion notification silence with `rejectedPromotionNotificationCount: 0`, accepted graph/churn promotion, and promote response/notification revision/changed-fields `3`/`graphs,graphFrontier,observations,evidence,churn`. The next clean move is the next bounded live typed-state/read-surface hardening slice, with that smoke harness as a guardrail; not GUI paint, watcher magic, or re-proving retrieval. Pre-compaction persistence is now an explicit design rule, not a lucky habit.
|
||||
Phase 1, Phase 2, the minimal Phase 3 typed read surface, Phase 4 retrieval/indexing/core-extraction, and the current Phase 5 distill/propose/promote/update baseline are landed and verified. `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 now reject malformed appended observations/evidence and structurally invalid replacement fields before mutation, including missing evidence references, duplicate append ids, durable id reuse, and impossible graph frontier/checkpoint/subgoal/churn shapes. Read-only distillation now summarizes noisy tool/model output into typed evidence and ranks final result/error/finished lines above generic warnings, read-only proposal can auto-select a bounded evidence-backed observation cluster and report match-kind-aware map-delta pressure, promotion rejects risky deltas without warning plus strong verifier evidence, expansion freshness cannot bypass warning requirements by claiming low pressure, and verifier kinds are token-matched so `contest` does not pass as `test`. The current Epiphany algorithmic map has been source-audited against the code flow it describes. The richer Phase 5 chain is now live-smoked through app-server by `tools/epiphany_phase5_smoke.py`, including update response/notification revision/changed-fields `1`/`observations,evidence` with retrieval-summary presence, verifier-only accepted promotion response/notification changed-fields `2`/`observations,evidence` with retrieval-summary presence, invalid direct observation/evidence update rejection with `invalidDirectUpdateNotificationCount: 0` and unchanged revision `2`, invalid direct replacement update rejection with `invalidReplacementUpdateNotificationCount: 0` and unchanged revision `2`, expanded-low-pressure and substring-verifier rejection checks, explicit rejected-promotion notification silence with `rejectedPromotionNotificationCount: 0`, accepted graph/churn promotion, and promote response/notification revision/changed-fields `3`/`graphs,graphFrontier,observations,evidence,churn` with retrieval-summary presence. The next clean move is the next bounded live typed-state/read-surface hardening slice, with that smoke harness as a guardrail; not GUI paint, watcher magic, or re-proving retrieval. Pre-compaction persistence is now an explicit design rule, not a lucky habit.
|
||||
|
|
|
|||
|
|
@ -151,3 +151,5 @@
|
|||
{"ts": "2026-04-25T11:07:05+00:00", "type": "implementation", "status": "ok", "note": "Extended direct thread/epiphany/update validation to structural replacement fields by exposing epiphany-core validate_state_replacement_patch and calling it from codex-core before mutation; graph/frontier/checkpoint/subgoal/churn shape errors now reject like malformed append records."}
|
||||
{"ts": "2026-04-25T11:07:11+00:00", "type": "verification", "status": "ok", "note": "Verified direct-update structural replacement validation: py_compile tools/epiphany_phase5_smoke.py passed; cargo test epiphany-core promotion structural helper passed; cargo test -p codex-core --lib epiphany_update passed 5 tests; cargo build -p codex-app-server passed; tools/epiphany_phase5_smoke.py passed with invalidReplacementUpdateNotificationCount 0 and invalidReplacementUpdateRevisionAfterReject 2."}
|
||||
{"ts": "2026-04-25T13:38:13+00:00", "type": "verification", "status": "ok", "note": "Verified Compact-Rehydrate-Reorient-Continue continuity after direct-update append and structural validation slices. Branch main is clean/synced at e0f1a46 before this evidence checkpoint; state/map.yaml, fresh-workspace-handoff, Epiphany algorithmic map, implementation plan, git log, and evidence tail agree that CRRC is an explicit architecture primitive, while automatic runtime CRRC coordination remains a documented non-flow. Next action remains a bounded live typed-state/read-surface hardening slice, with retrieve/distill/propose read-only and accepted writes routed through update/promote."}
|
||||
{"ts": "2026-04-25T13:50:31+00:00", "type": "implementation", "status": "ok", "note": "Aligned successful thread/epiphany/update and accepted thread/epiphany/promote response/notification state payloads with the same client-visible live Epiphany projection used by thread/read, including retrieval-summary backfill; extended Phase 5 smoke to assert retrieval summaries on successful write responses and notifications."}
|
||||
{"ts": "2026-04-25T13:51:17+00:00", "type": "verification", "status": "ok", "note": "Verified write/read state projection consistency slice with py_compile tools/epiphany_phase5_smoke.py, cargo fmt -p codex-app-server, git diff --check, cargo test -p codex-app-server --lib map_epiphany_, cargo test -p codex-app-server --lib epiphany_promote_changed_fields_reports_appended_verifier_evidence, cargo build -p codex-app-server, and tools/epiphany_phase5_smoke.py. Smoke observed retrieval status ready on update/promote responses and notifications."}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ accepted_design:
|
|||
- harden direct write responses: successful `thread/epiphany/update` and accepted `thread/epiphany/promote` responses now include response-level `revision` and `changedFields`, matching the live notification metadata for initiating callers
|
||||
- harden rejected-promotion notification silence: the richer Phase 5 app-server smoke now asserts rejected `thread/epiphany/promote` calls do not emit `thread/epiphany/stateUpdated`
|
||||
- harden direct update integrity: `thread/epiphany/update` now rejects malformed appended observations/evidence and structurally invalid replacement fields before durable persistence, including empty append record fields, duplicate append ids, durable id reuse, observations that cite missing evidence ids, and graph/frontier/checkpoint/subgoal/churn replacement shape errors; invalid direct updates leave revision unchanged and emit no state update notification
|
||||
- harden write/read surface consistency: successful direct update and accepted promote responses plus `thread/epiphany/stateUpdated` notifications now publish the same client-visible live Epiphany state projection as `thread/read`, including the non-durable retrieval summary backfill when state exists without persisted retrieval metadata
|
||||
|
||||
rejected_paths:
|
||||
- name: pinned_map_only
|
||||
|
|
@ -129,5 +130,5 @@ rejected_paths:
|
|||
reason: audited candidates were either terminal-only, stale/aspirational, or incoherent wrappers; the comparison clones were removed from vendor to avoid building on untrusted drift
|
||||
|
||||
current_status:
|
||||
summary: Workspace initialized with protocol files, typed state, handoff notes, architecture maps, and a rolling implementation plan against vendored Codex. Phase 1 durable state, Phase 2 prompt integration, the minimal Phase 3 typed read surface, and Phase 4 retrieval/indexing/core-extraction are landed on `main`. Phase 5 semantic distillation/promotion/proposal is now active and chewed enough for the first live typed-state stream seam: the current baseline includes explicit Qdrant indexing with BM25 fallback, typed `thread/epiphany/update`, read-only `thread/epiphany/distill`, read-only `thread/epiphany/propose`, verifier-backed `thread/epiphany/promote`, response-level `revision` and `changedFields` on successful direct updates and accepted promotions, experimental `thread/epiphany/stateUpdated` notifications after successful direct updates and accepted promotions with typed `source` values of `update` or `promote`, event-level `revision`, typed `changedFields`, structural map/churn promotion validation, direct-update observation/evidence integrity validation, direct-update structural replacement validation, source-output-aware distillation with result/error/finished lines prioritized over generic warnings, 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, risky-delta promotion policy in `epiphany-core`, expansion-freshness promotion hardening so new map surfaces cannot bypass warning requirements by claiming low pressure, token-aware verifier-kind matching so substring accidents cannot satisfy strong verifier evidence, a reusable richer Phase 5 app-server smoke harness, and thin vendored Codex host seams. Promotion responses and notifications now include `evidence` in `changedFields` whenever accepted promotion appends verifier evidence, even if the patch evidence list was empty. The richer smoke now verifies source-output distillation, read-only proposal, update response/notification revision/changed-fields `1`/`observations,evidence`, verifier-only accepted promotion response/notification `2`/`observations,evidence`, invalid direct observation/evidence update rejection with `invalidDirectUpdateNotificationCount: 0` and unchanged revision `2`, invalid direct replacement update rejection with `invalidReplacementUpdateNotificationCount: 0` and unchanged revision `2`, risky-delta rejection, expanded-low-pressure rejection, weak-verifier rejection, substring-verifier rejection, rejected-promotion notification silence with `rejectedPromotionNotificationCount: 0`, accepted graph/churn promotion, and graph/churn promote response/notification revision/changed-fields `3`/`graphs,graphFrontier,observations,evidence,churn` through the app-server seam. The Windows app-server stack-pressure regression was narrowed to test-thread stack size; repo-local Cargo config sets `RUST_MIN_STACK=67108864`, and boxed-future request-dispatch experiments were removed after config-only verification passed. The repo also has source-available/commercial licensing plus a CLA gate for external contributions.
|
||||
summary: Workspace initialized with protocol files, typed state, handoff notes, architecture maps, and a rolling implementation plan against vendored Codex. Phase 1 durable state, Phase 2 prompt integration, the minimal Phase 3 typed read surface, and Phase 4 retrieval/indexing/core-extraction are landed on `main`. Phase 5 semantic distillation/promotion/proposal is now active and chewed enough for the first live typed-state stream seam: the current baseline includes explicit Qdrant indexing with BM25 fallback, typed `thread/epiphany/update`, read-only `thread/epiphany/distill`, read-only `thread/epiphany/propose`, verifier-backed `thread/epiphany/promote`, response-level `revision` and `changedFields` on successful direct updates and accepted promotions, experimental `thread/epiphany/stateUpdated` notifications after successful direct updates and accepted promotions with typed `source` values of `update` or `promote`, event-level `revision`, typed `changedFields`, client-visible write response/notification state projection aligned with `thread/read` retrieval-summary backfill, structural map/churn promotion validation, direct-update observation/evidence integrity validation, direct-update structural replacement validation, source-output-aware distillation with result/error/finished lines prioritized over generic warnings, 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, risky-delta promotion policy in `epiphany-core`, expansion-freshness promotion hardening so new map surfaces cannot bypass warning requirements by claiming low pressure, token-aware verifier-kind matching so substring accidents cannot satisfy strong verifier evidence, a reusable richer Phase 5 app-server smoke harness, and thin vendored Codex host seams. Promotion responses and notifications now include `evidence` in `changedFields` whenever accepted promotion appends verifier evidence, even if the patch evidence list was empty. The richer smoke now verifies source-output distillation, read-only proposal, update response/notification revision/changed-fields `1`/`observations,evidence`, update response/notification retrieval-summary presence, verifier-only accepted promotion response/notification `2`/`observations,evidence` with retrieval-summary presence, invalid direct observation/evidence update rejection with `invalidDirectUpdateNotificationCount: 0` and unchanged revision `2`, invalid direct replacement update rejection with `invalidReplacementUpdateNotificationCount: 0` and unchanged revision `2`, risky-delta rejection, expanded-low-pressure rejection, weak-verifier rejection, substring-verifier rejection, rejected-promotion notification silence with `rejectedPromotionNotificationCount: 0`, accepted graph/churn promotion, and graph/churn promote response/notification revision/changed-fields `3`/`graphs,graphFrontier,observations,evidence,churn` with retrieval-summary presence through the app-server seam. The Windows app-server stack-pressure regression was narrowed to test-thread stack size; repo-local Cargo config sets `RUST_MIN_STACK=67108864`, and boxed-future request-dispatch experiments were removed after config-only verification passed. The repo also has source-available/commercial licensing plus a CLA gate for external contributions.
|
||||
next_action: Continue the next bounded live typed-state/read-surface hardening slice from the now-notified update/promote seam; keep retrieval/distillation/proposal read-only, keep accepted writes routed through promotion/update, and avoid GUI, watcher, or specialist-agent machinery.
|
||||
|
|
|
|||
|
|
@ -243,6 +243,18 @@ def require(condition: bool, message: str) -> None:
|
|||
raise AssertionError(message)
|
||||
|
||||
|
||||
def require_retrieval_summary(state: dict[str, Any], label: str) -> dict[str, Any]:
|
||||
retrieval = state.get("retrieval")
|
||||
require(isinstance(retrieval, dict), f"{label} should include retrieval summary")
|
||||
workspace_root = str(retrieval.get("workspace_root", ""))
|
||||
require(
|
||||
workspace_root.endswith("epiphany-core"),
|
||||
f"{label} retrieval summary should describe the loaded workspace",
|
||||
)
|
||||
require("status" in retrieval, f"{label} retrieval summary should expose status")
|
||||
return retrieval
|
||||
|
||||
|
||||
def reset_smoke_paths(codex_home: Path, result_path: Path, transcript_path: Path, stderr_path: Path) -> None:
|
||||
smoke_root = ROOT / ".epiphany-smoke"
|
||||
resolved_home = codex_home.resolve()
|
||||
|
|
@ -345,6 +357,10 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
update["changedFields"] == ["observations", "evidence"],
|
||||
"update response should expose changed fields",
|
||||
)
|
||||
update_response_retrieval = require_retrieval_summary(
|
||||
update["epiphanyState"],
|
||||
"update response Epiphany state",
|
||||
)
|
||||
update_notification = client.wait_for_notification(
|
||||
"thread/epiphany/stateUpdated",
|
||||
start_index=update_notification_start,
|
||||
|
|
@ -369,6 +385,10 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
update_notification["params"]["changedFields"] == ["observations", "evidence"],
|
||||
"update notification should identify appended observation/evidence fields",
|
||||
)
|
||||
update_notification_retrieval = require_retrieval_summary(
|
||||
update_notification["params"]["epiphanyState"],
|
||||
"update notification Epiphany state",
|
||||
)
|
||||
|
||||
verifier_only_notification_start = len(client.notifications)
|
||||
verifier_only_promote = client.send(
|
||||
|
|
@ -412,6 +432,10 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
verifier_only_promote["changedFields"] == ["observations", "evidence"],
|
||||
"verifier-only promote response should expose changed fields",
|
||||
)
|
||||
verifier_only_response_retrieval = require_retrieval_summary(
|
||||
verifier_only_promote["epiphanyState"],
|
||||
"verifier-only promote response Epiphany state",
|
||||
)
|
||||
verifier_only_notification = client.wait_for_notification(
|
||||
"thread/epiphany/stateUpdated",
|
||||
start_index=verifier_only_notification_start,
|
||||
|
|
@ -425,6 +449,10 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
== ["observations", "evidence"],
|
||||
"verifier-only promote notification should include appended verifier evidence",
|
||||
)
|
||||
verifier_only_notification_retrieval = require_retrieval_summary(
|
||||
verifier_only_notification["params"]["epiphanyState"],
|
||||
"verifier-only promote notification Epiphany state",
|
||||
)
|
||||
|
||||
invalid_direct_update_notification_start = len(client.notifications)
|
||||
invalid_direct_update_error = client.send_expect_error(
|
||||
|
|
@ -698,6 +726,10 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
== ["graphs", "graphFrontier", "observations", "evidence", "churn"],
|
||||
"accepted promote response should expose changed fields",
|
||||
)
|
||||
promote_response_retrieval = require_retrieval_summary(
|
||||
accepted["epiphanyState"],
|
||||
"accepted promote response Epiphany state",
|
||||
)
|
||||
promote_notification = client.wait_for_notification(
|
||||
"thread/epiphany/stateUpdated",
|
||||
start_index=promote_notification_start,
|
||||
|
|
@ -723,6 +755,10 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
== ["graphs", "graphFrontier", "observations", "evidence", "churn"],
|
||||
"promote notification should identify promoted graph/evidence/churn fields",
|
||||
)
|
||||
promote_notification_retrieval = require_retrieval_summary(
|
||||
promote_notification["params"]["epiphanyState"],
|
||||
"accepted promote notification Epiphany state",
|
||||
)
|
||||
require(
|
||||
final_state["churn"]["diff_pressure"] == "medium",
|
||||
"accepted state should preserve risky churn pressure",
|
||||
|
|
@ -748,12 +784,20 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
"updateResponseChangedFields": update["changedFields"],
|
||||
"updateNotificationRevision": update_notification["params"]["revision"],
|
||||
"updateNotificationChangedFields": update_notification["params"]["changedFields"],
|
||||
"updateResponseRetrievalStatus": update_response_retrieval["status"],
|
||||
"updateNotificationRetrievalStatus": update_notification_retrieval["status"],
|
||||
"verifierOnlyPromoteResponseRevision": verifier_only_promote["revision"],
|
||||
"verifierOnlyPromoteResponseChangedFields": verifier_only_promote["changedFields"],
|
||||
"verifierOnlyPromoteRevision": verifier_only_notification["params"]["revision"],
|
||||
"verifierOnlyPromoteChangedFields": verifier_only_notification["params"][
|
||||
"changedFields"
|
||||
],
|
||||
"verifierOnlyPromoteResponseRetrievalStatus": verifier_only_response_retrieval[
|
||||
"status"
|
||||
],
|
||||
"verifierOnlyPromoteNotificationRetrievalStatus": verifier_only_notification_retrieval[
|
||||
"status"
|
||||
],
|
||||
"invalidDirectUpdateMessage": invalid_direct_update_message,
|
||||
"invalidDirectUpdateNotificationCount": invalid_direct_update_notification_count,
|
||||
"invalidDirectUpdateRevisionAfterReject": read_after_invalid_direct_update["thread"]
|
||||
|
|
@ -788,6 +832,8 @@ def run_smoke(args: argparse.Namespace) -> dict[str, Any]:
|
|||
"promoteNotificationChangedFields": promote_notification["params"][
|
||||
"changedFields"
|
||||
],
|
||||
"promoteResponseRetrievalStatus": promote_response_retrieval["status"],
|
||||
"promoteNotificationRetrievalStatus": promote_notification_retrieval["status"],
|
||||
"finalChurn": final_state["churn"],
|
||||
"graphNodeCount": len(
|
||||
final_state.get("graphs", {}).get("architecture", {}).get("nodes", [])
|
||||
|
|
|
|||
|
|
@ -4411,6 +4411,8 @@ impl CodexMessageProcessor {
|
|||
return;
|
||||
}
|
||||
};
|
||||
let epiphany_state =
|
||||
client_visible_live_thread_epiphany_state(thread.as_ref(), epiphany_state).await;
|
||||
let response = ThreadEpiphanyPromoteResponse {
|
||||
accepted: true,
|
||||
reasons: Vec::new(),
|
||||
|
|
@ -4496,6 +4498,8 @@ impl CodexMessageProcessor {
|
|||
return;
|
||||
}
|
||||
};
|
||||
let epiphany_state =
|
||||
client_visible_live_thread_epiphany_state(thread.as_ref(), epiphany_state).await;
|
||||
let response = ThreadEpiphanyUpdateResponse {
|
||||
revision: epiphany_state.revision,
|
||||
changed_fields: changed_fields.clone(),
|
||||
|
|
@ -10433,6 +10437,13 @@ async fn live_thread_epiphany_state(thread: &CodexThread) -> Option<EpiphanyThre
|
|||
epiphany_state
|
||||
}
|
||||
|
||||
async fn client_visible_live_thread_epiphany_state(
|
||||
thread: &CodexThread,
|
||||
fallback: EpiphanyThreadState,
|
||||
) -> EpiphanyThreadState {
|
||||
live_thread_epiphany_state(thread).await.unwrap_or(fallback)
|
||||
}
|
||||
|
||||
fn thread_epiphany_patch_has_state_replacements(patch: &ThreadEpiphanyUpdatePatch) -> bool {
|
||||
patch.objective.is_some()
|
||||
|| patch.active_subgoal_id.is_some()
|
||||
|
|
|
|||
Reference in a new issue