From a3bca1c7fab4293c3721859e55da7071cf060dbc Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 19 May 2026 15:40:06 +0100 Subject: [PATCH] Record bridge protocol starvation --- notes/fresh-workspace-handoff.md | 1 + state/ledgers.msgpack | Bin 132443 -> 132969 bytes state/map.yaml | 12 ++++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 8f152742..9cf92d6f 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -46,6 +46,7 @@ remembers doctrine; the branch remembers the blade. - Durable Epiphany state types now live in root crate `epiphany-state-model`. `codex-protocol` re-exports them only so old rollout/API callers keep compiling; do not add new durable `Epiphany*` state structs under `vendor/codex`. The deterministic `` prompt renderer also lives beside that typed model now, with prompt text under `epiphany-state-model/src/prompts/`; `epiphany-core` only re-exports it for compatibility. `epiphany-core` imports the native model directly and no longer depends on `codex-protocol`. Pressure derives from native `EpiphanyTokenUsageSnapshot`; Codex token telemetry is mapped at the bridge. Codex rollout/event reconstruction now lives in `codex-core::epiphany_rollout`, where the Codex `RolloutItem` / `EventMsg` types belong. Exact retrieval path matching is native to `epiphany-core`, so `epiphany-core` has no direct vendored Codex crate dependency. - State-update contract proof and job launch/interrupt DTO ownership now live in native `epiphany-core`. The old giant `codex_thread.rs` Epiphany state-update test fixture was cut, and `epiphany-codex-bridge` no longer imports Epiphany job launch request types from `codex_core`; vendored `CodexThread` may call the native mutation/launch law for compatibility, but it must not regain ownership of state-update semantics, heartbeat launch-plan policy, or Epiphany DTOs. - `epiphany-codex-bridge` no longer depends on vendored `codex-core` at all. Retrieval takes workspace/Codex-home paths, invalidation owns a native `notify` watcher, runtime-result acceptance takes typed state plus runtime-store path, live rollout/thread reads moved into app-server `epiphany_thread_host`, and mutation policy depends on the small `EpiphanyMutationHost` trait implemented by app-server's `EpiphanyCodexThreadHost` wrapper. The bridge owns Epiphany law; vendored app-server owns CodexThread access. +- `epiphany-codex-bridge` also no longer depends on `codex-protocol`. Bridge durable-state imports point at `epiphany-state-model`, token pressure takes native `EpiphanyTokenUsageSnapshot`, app-server maps Codex token telemetry at the host wall, Codex token usage rollout replay lives in `codex_message_processor/token_usage_replay.rs`, and bridge errors are `EpiphanyBridgeError`. The only remaining vendored bridge dependencies are app-server protocol DTOs and absolute path validation. - MCP remains JSON because MCP is a JSON protocol. The latest processor cut only moved MCP refresh/OAuth/status/resource/tool-call route handling into `codex_message_processor/mcp_routes.rs`, reducing the root processor to about 8,977 lines; it did not claim MCP payloads are CultNet or make MCP an Epiphany-owned runtime contract. - Codex account auth route handling remains in vendored Codex but now lives in `codex_message_processor/auth_routes.rs`: API-key login, ChatGPT browser/device-code/external-token login, logout, auth status, account, rate limits, and add-credits nudge handling. This preserves Codex ownership of subscription auth while cutting the root processor to about 8,094 lines. - One-off command execution and command stream write/resize/terminate route handling now live in `codex_message_processor/command_routes.rs`; `CommandExecManager` remains the lifecycle owner, while the root processor is about 7,800 lines. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 5c86a937b19d98a88ce035c1ca10bb48d7f9e9c3..26d57179d6caad94ed5e99068badbbe20c8f4371 100644 GIT binary patch delta 542 zcmZuuyG|QX5Y<8vegGk*8YxQW1)Dq++=Z8viUOyh8~YB~6?gC4%$>Da8VU-e6bOk( z{){M6B$RK7L{G^dWY&%?id1(VXU;h~_s_Sr$D6g=S1T{Je!l*iWfxb|?0TAI_tR|U z$Ljj`-`m~o_j&hS-rE`U-uB<@^m`xfo(3;39}a8Lf&>DJ@PrSX{{7lMM5!UVnV zgHXj|+t#5@_8dhDA3rT{LUbNkG<6_y8Pov(7+ftl^pqz>B`B*I3Q&P!84C=T&3u(t z?8rkIk`g-LQyAIcJdeW4Blf1hl$aaYYxkghMgi)C=2qByuGOH?V*^7Rof)ArV2pVp z8IyFNvc~K!uB-N3$x}rtjnTou+*mVcnLoG0#{pw1SXMhngZ5tx)( zEO~ZkQQDYgbNbZJHYD%_99e)a0S6dc!LqowiErSP<(X?(rm#OaN;6R$Cib;O8qu`I Q=u3xMa@hR!pN~HI3uLv#GXMYp delta 52 zcmaFa$8o!hV}ddhtKvr0LPo~Q=IM;>(-|4JPiJIW&n&vd$iT=<*T7WQ&@#l(*viz> I%Gf9h0Jq!@-2eap diff --git a/state/map.yaml b/state/map.yaml index 8eec13dd..4fb7bce6 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -297,7 +297,11 @@ current_status: retrieval accepts workspace/Codex-home paths, invalidation uses Epiphany's own notify watcher, live rollout/thread reads moved into vendored app-server `epiphany_thread_host`, and mutation policy now depends on the - small `EpiphanyMutationHost` capability trait. `epiphany-codex-bridge` - source and manifest no longer name `codex-core` / `codex_core` / - `CodexThread`. - next_action: Continue Codex starvation and CultNet liberation from the new host wall. Audit remaining `epiphany-codex-bridge` dependencies on vendored protocol/app-server-protocol/OpenAI spine, then classify route-facing JSON-RPC response shaping, OpenAI/MCP protocol edges, and role-result/raw ingress compatibility. Keep JSON only at true wire/hostile-ingress/forensic boundaries; move Epiphany-owned runtime data into typed CultCache documents and CultNet contracts. + small `EpiphanyMutationHost` capability trait. Unused OpenAI bridge + reexports were cut; bridge durable-state imports now point at + `epiphany-state-model`; Codex token usage rollout replay moved back into + app-server; token telemetry crosses the wall as + `EpiphanyTokenUsageSnapshot`; and `CodexErr` was replaced with + `EpiphanyBridgeError`. `epiphany-codex-bridge` now depends on vendored + Codex only for app-server protocol DTOs and absolute path validation. + next_action: Continue Codex starvation and CultNet liberation from the new host wall. Audit whether `codex-app-server-protocol` DTO coupling should remain the legacy JSON-RPC edge or collapse into native CultNet/app-server boundary types; then classify OpenAI/MCP protocol edges and role-result/raw ingress compatibility. Keep JSON only at true wire/hostile-ingress/forensic boundaries; move Epiphany-owned runtime data into typed CultCache documents and CultNet contracts.