From f2b8763eb5000f606286b7090125a363b8a71c98 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 02:19:47 +0100 Subject: [PATCH] Stop Codex protocol from owning Epiphany state --- notes/fresh-workspace-handoff.md | 7 +- notes/native-coordinator-liberation-map.md | 7 ++ state/ledgers.msgpack | Bin 410206 -> 410599 bytes state/map.yaml | 2 +- vendor/codex/codex-rs/Cargo.lock | 3 + .../codex-rs/app-server-protocol/Cargo.toml | 1 + .../src/protocol/common.rs | 76 +++++++++--------- .../app-server-protocol/src/protocol/v2.rs | 46 +++++------ vendor/codex/codex-rs/app-server/Cargo.toml | 1 + .../epiphany_mutation_routes.rs | 4 +- .../epiphany_read_routes.rs | 2 +- .../epiphany_thread_host.rs | 2 +- .../legacy_epiphany_rollout.rs | 4 +- vendor/codex/codex-rs/core/Cargo.toml | 1 + .../session/rollout_reconstruction_tests.rs | 4 +- .../codex/codex-rs/core/src/session/tests.rs | 38 ++++----- .../codex/codex-rs/protocol/src/protocol.rs | 42 +--------- 17 files changed, 113 insertions(+), 127 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 867049fd..6e3757a0 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1907,7 +1907,12 @@ and reference context at the app-server boundary. That cut is complete: app-server derives runtime-spine paths from generic config snapshots and uses generic `reference_turn_id`; `CodexThread` exposes no `epiphany_*` async API. Next audit the broad Epiphany re-export slab in `codex-protocol` and make -compatibility code import native state contracts directly where possible. +compatibility code import native state contracts directly where possible. That +slab is deleted: app-server-protocol, app-server, and core legacy tests import +the native model directly; Codex protocol keeps only a private state-item import +for historical rollout decoding. Next make that legacy payload opaque in Codex +protocol and decode it only in the app-server quarantine, removing +`epiphany-state-model` from Codex protocol's production dependency graph. ## Immediate Re-entry Instruction diff --git a/notes/native-coordinator-liberation-map.md b/notes/native-coordinator-liberation-map.md index 75ec19f4..e385eb8d 100644 --- a/notes/native-coordinator-liberation-map.md +++ b/notes/native-coordinator-liberation-map.md @@ -305,3 +305,10 @@ Epiphany-named reference-turn and runtime-spine-path helpers are deleted; app-server derives the compatibility store path from the generic config snapshot and calls a generic `reference_turn_id` accessor. The core source guard rejects any `pub async fn epiphany_*` API on `CodexThread`. + +`codex-protocol` no longer republishes Epiphany's anatomy. App-server-protocol, +app-server compatibility code, and legacy-focused core tests import +`epiphany-state-model` directly. Protocol retains a private +`EpiphanyStateItem` import solely to decode the historical rollout variant; its +two round-trip tests and app-server's two migration tests pass. A source guard +forbids `pub use epiphany_state_model::*` from returning. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 4ee0e566e8abc0e515062192bb94cb7a9f42311e..d4f0ce505792a3a1d47dde2377879c5a87257a07 100644 GIT binary patch delta 398 zcmYLFy-EW?5O!lsA=m{m-GEq`jdxe5B!wtg+Jsb!;&L~})4knwcXP=#S}5cN4EGv> zh1iQ==M&ia8cqm_#mB(Rd_OZkPmSMk<7J(#h3znCNBgIrOSPkq*G+cE*!Sb4GM-cz zVOp07Rl>^Kq*D7js6W3)LA1+*Jsw8AV8$=QVYP8`*2PTcn1GNHj!kN=g(|>#;gM%L zK?xQ)j*Pb6!Ijk+#MB*eW3|_@mMu6mhC8%5T3%k>v-(35gi2`5B1r6uxB!oi*l9LZ z0VRBzP=neIPwhdMf zRKmSY&CIz8p5|ha6SA~#DTP+$#a3;jJnypA9WcVV4mdrqF+zVJY(l5sP$oxJ;gEjx H|BBWhDKd;@ delta 59 zcmaFfE_ts-a)THnuYr}Rp_Q>^)G-D&N9)bXjD?Jh=bNW8wNGVY1Y!`)48$xz%({Il I6Wd9904y&OBLDyZ diff --git a/state/map.yaml b/state/map.yaml index 49eb6cc8..83463030 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -659,4 +659,4 @@ current_status: - Service lifecycle receipt history is now event-only: `load_epiphany_cultmesh_daemon_service_lifecycle_receipts` filters out the `epiphany-local/daemon-service-lifecycle-receipt/latest` mirror, while `load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt` remains the latest-state reader. Focused unit test `service_lifecycle_receipt_history_excludes_latest_mirror` proves two per-receipt writes return exactly two history records and latest points at the second. Fresh smoke `verse-query-lifecycle-history-filter-smoke` and live overview/triage `local-20260618-145632-497-efac6f0d` / `local-20260618-145632-321-867947af` prove compact swarm sights still expose service lifecycle attention plus the present elevated runbook artifact without daemon pokes or service mutation. Do not use a broad unscoped cargo test filter for this check on Windows; it fans out across bin harnesses and hit a broken pipe during this pass. - `epiphany-verse-query seed-compact` is the compact seed receipt for wrappers and read-only rites. The older `seed` command still prints the full local Verse context for explicit debugging, but compact wrapper modes now avoid full `seed`/final `query` readback after the combined overview proof exposed Windows debug stack overflow from full-context serialization pressure. last_completed_repo_swarm_cut: Huginn live-fire has crossed the first real repo Body from Persona pressure to branch-local Hands commit and Soul/Mind closure, and now has repeatable closure and redacted-public-proof mouths. On `E:\Projects\Huginn` branch `epiphany/huginn/first-awakening`, `tools/epiphany_local_run.ps1 -Mode repo-persona-intake` accepted item `huginn-inspection-readback-livefire`, Weksa/Persona intake remained sealed, and `epiphany-work derive-plan` lowered it to model-authored safe family `repo.status_section` for `README.md` only. `tools/epiphany_local_run.ps1 -Mode repo-swarm-run` advanced four bounded pulses: run-from-plan, adopt-from-plan, execute-from-plan, and close-from-execute. Huginn commit `e9b07c38fceabbdc89ea35c2156326c80c0393a2` updated only `README.md`; closure receipt `.epiphany\work\work-close-huginn-inspection-readback-livefire.json` records status `closed`, Soul verdict `passed`, Mind state commit `repo-work-close-huginn-inspection-readback-livefire-mind-commit`, safe family `repo.status_section`, path scope `README.md`, Bifrost publication gate, and `privateStateExposed=false`. Verification also ran Huginn's TypeScript compiler through concrete Node path: `C:\Program Files\nodejs\node.exe E:\Projects\Huginn\node_modules\typescript\bin\tsc -p tsconfig.json` passed. Native verifier `epiphany-repo-livefire-closure-smoke --workspace E:\Projects\Huginn --item huginn-inspection-readback-livefire --expected-path README.md --expected-family repo.status_section --expected-gate awaiting-publication --expected-blocker bifrost-publication-missing` checks closure receipt, Mind map entry, overview gate/blocker, authority seals, and `git show` changed paths, returning `status=ok`, `soulVerdict=passed`, `publicationGate=Bifrost`, and `privateStateExposed=false`. Wrapper `tools/epiphany_local_run.ps1 -Mode repo-livefire-closure -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exposes the same read-only proof through the local operator mouth; artifact `local-20260621-190156-803-2f85ba15` printed commit, path, gate, blocker, Soul verdict, Mind commit receipt, and `privateStateExposed=False` without push, merge, publication, or target mutation. New wrapper `tools/epiphany_local_run.ps1 -Mode repo-work-public-proof -Workspace E:\Projects\Huginn -RepoWorkItem huginn-inspection-readback-livefire -SkipBuild` exports the redacted proof bundle and repo-local Verse index without publishing; artifact `local-20260621-190645-345-4555b1dc` wrote `.epiphany\public\proof-bundles\repo-work-public-proof-huginn-inspection-readback-livefire.json`, proof id `repo-work-public-proof-huginn-inspection-readback-livefire`, SHA-256 `857545b199f3e37eb06c2e757e5cfc201958e46667bb1f8403fd333a22620f63`, nine artifact rows, zero publication rows, and `privateStateExposed=False`. Gjallar readback `local-20260621-190701-140-b9519ec6` sees the `REPO-WORK-PUBLIC-PROOF` row and action row from Huginn's repo-local Verse with the same SHA-256 while Bifrost publication remains missing. Launcher compact modes are now named compact operator-context modes instead of read-only modes, and `bifrost-public-proof` summaries print item, target public Verse, room, proof SHA-256, review receipts, and credit receipts so publication receipts are auditable without claiming upstream sync. - next_action: Audit and minimize Epiphany types re-exported by `codex-protocol`. The live core now retains only inert matching for legacy `RolloutItem::EpiphanyState`; app-server protocol compatibility should import native state types directly wherever possible so Codex protocol does not masquerade as their owner. + next_action: Remove `epiphany-state-model` as a production dependency of `codex-protocol` by making the legacy `epiphany_state` rollout payload opaque at the Codex layer and decoding it into `EpiphanyStateItem` only inside app-server's migration quarantine. Preserve exact old-file readability and rollback semantics with focused fixtures before deleting the typed protocol variant. diff --git a/vendor/codex/codex-rs/Cargo.lock b/vendor/codex/codex-rs/Cargo.lock index c044139d..36507d9f 100644 --- a/vendor/codex/codex-rs/Cargo.lock +++ b/vendor/codex/codex-rs/Cargo.lock @@ -1913,6 +1913,7 @@ dependencies = [ "constant_time_eq 0.3.1", "core_test_support", "epiphany-codex-bridge", + "epiphany-state-model", "futures", "gethostname", "hmac 0.12.1", @@ -1979,6 +1980,7 @@ dependencies = [ "codex-shell-command", "codex-utils-absolute-path", "codex-utils-cargo-bin", + "epiphany-state-model", "inventory", "pretty_assertions", "rmcp", @@ -2392,6 +2394,7 @@ dependencies = [ "dirs", "dunce", "env-flags", + "epiphany-state-model", "eventsource-stream", "futures", "http 1.4.0", diff --git a/vendor/codex/codex-rs/app-server-protocol/Cargo.toml b/vendor/codex/codex-rs/app-server-protocol/Cargo.toml index 0cb50d85..22f85008 100644 --- a/vendor/codex/codex-rs/app-server-protocol/Cargo.toml +++ b/vendor/codex/codex-rs/app-server-protocol/Cargo.toml @@ -12,6 +12,7 @@ path = "src/lib.rs" workspace = true [dependencies] +epiphany-state-model = { path = "../../../../epiphany-state-model" } anyhow = { workspace = true } clap = { workspace = true, features = ["derive"] } codex-experimental-api-macros = { workspace = true } diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs index ae518f92..ed2a03dc 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs @@ -1670,11 +1670,11 @@ mod tests { role_id: v2::ThreadEpiphanyRoleId::Modeling, revision: 4, changed_fields: vec![v2::ThreadEpiphanyStateUpdatedField::JobBindings], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 4, - job_bindings: vec![codex_protocol::protocol::EpiphanyJobBinding { + job_bindings: vec![epiphany_state_model::EpiphanyJobBinding { id: "modeling-checkpoint-worker".to_string(), - kind: codex_protocol::protocol::EpiphanyJobKind::Specialist, + kind: epiphany_state_model::EpiphanyJobKind::Specialist, scope: "role-scoped modeling/checkpoint maintenance".to_string(), owner_role: "epiphany-modeler".to_string(), authority_scope: Some("epiphany.role.modeling".to_string()), @@ -1859,7 +1859,7 @@ mod tests { #[test] fn serialize_thread_epiphany_role_accept_response() -> Result<()> { let patch = v2::ThreadEpiphanyUpdatePatch { - graph_frontier: Some(codex_protocol::protocol::EpiphanyGraphFrontier { + graph_frontier: Some(epiphany_state_model::EpiphanyGraphFrontier { active_node_ids: vec!["state-spine".to_string()], ..Default::default() }), @@ -1897,7 +1897,7 @@ mod tests { v2::ThreadEpiphanyStateUpdatedField::Observations, v2::ThreadEpiphanyStateUpdatedField::Evidence, ], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 5, ..Default::default() }, @@ -2055,13 +2055,13 @@ mod tests { state_revision: Some(3), context: v2::ThreadEpiphanyContext { graph: v2::ThreadEpiphanyGraphContext { - architecture_nodes: vec![codex_protocol::protocol::EpiphanyGraphNode { + architecture_nodes: vec![epiphany_state_model::EpiphanyGraphNode { id: "state-spine".to_string(), title: "State spine".to_string(), purpose: "Keep understanding typed".to_string(), ..Default::default() }], - architecture_edges: vec![codex_protocol::protocol::EpiphanyGraphEdge { + architecture_edges: vec![epiphany_state_model::EpiphanyGraphEdge { id: Some("edge-state-read".to_string()), source_id: "state-spine".to_string(), target_id: "client-read".to_string(), @@ -2070,13 +2070,13 @@ mod tests { }], ..Default::default() }, - frontier: Some(codex_protocol::protocol::EpiphanyGraphFrontier { + frontier: Some(epiphany_state_model::EpiphanyGraphFrontier { active_node_ids: vec!["state-spine".to_string()], ..Default::default() }), checkpoint: None, investigation_checkpoint: Some( - codex_protocol::protocol::EpiphanyInvestigationCheckpoint { + epiphany_state_model::EpiphanyInvestigationCheckpoint { checkpoint_id: "ix-1".to_string(), kind: "source_gathering".to_string(), focus: "Audit the compaction seam.".to_string(), @@ -2086,7 +2086,7 @@ mod tests { ..Default::default() }, ), - observations: vec![codex_protocol::protocol::EpiphanyObservation { + observations: vec![epiphany_state_model::EpiphanyObservation { id: "obs-1".to_string(), summary: "Context shard is read-only.".to_string(), source_kind: "smoke".to_string(), @@ -2094,7 +2094,7 @@ mod tests { evidence_ids: vec!["ev-1".to_string()], ..Default::default() }], - evidence: vec![codex_protocol::protocol::EpiphanyEvidenceRecord { + evidence: vec![epiphany_state_model::EpiphanyEvidenceRecord { id: "ev-1".to_string(), kind: "test".to_string(), status: "ok".to_string(), @@ -2225,7 +2225,7 @@ mod tests { state_status: v2::ThreadEpiphanyContextStateStatus::Ready, state_revision: Some(2), graph: v2::ThreadEpiphanyGraphContext { - architecture_nodes: vec![codex_protocol::protocol::EpiphanyGraphNode { + architecture_nodes: vec![epiphany_state_model::EpiphanyGraphNode { id: "state-spine".to_string(), title: "State spine".to_string(), purpose: "Persist Epiphany state.".to_string(), @@ -2304,11 +2304,11 @@ mod tests { }, revision: 5, changed_fields: vec![v2::ThreadEpiphanyStateUpdatedField::JobBindings], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 5, - job_bindings: vec![codex_protocol::protocol::EpiphanyJobBinding { + job_bindings: vec![epiphany_state_model::EpiphanyJobBinding { id: "reorient-worker".to_string(), - kind: codex_protocol::protocol::EpiphanyJobKind::Specialist, + kind: epiphany_state_model::EpiphanyJobKind::Specialist, scope: "reorient-guided checkpoint regather".to_string(), owner_role: "epiphany-reorient".to_string(), authority_scope: Some("epiphany.reorient.regather".to_string()), @@ -2514,9 +2514,9 @@ mod tests { v2::ThreadEpiphanyStateUpdatedField::Evidence, v2::ThreadEpiphanyStateUpdatedField::Scratch, ], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 6, - observations: vec![codex_protocol::protocol::EpiphanyObservation { + observations: vec![epiphany_state_model::EpiphanyObservation { id: "obs-reorient-1".to_string(), summary: "Accepted resume reorientation result.".to_string(), source_kind: "reorient_result".to_string(), @@ -2524,7 +2524,7 @@ mod tests { evidence_ids: vec!["ev-reorient-1".to_string()], ..Default::default() }], - recent_evidence: vec![codex_protocol::protocol::EpiphanyEvidenceRecord { + recent_evidence: vec![epiphany_state_model::EpiphanyEvidenceRecord { id: "ev-reorient-1".to_string(), kind: "reorient_result".to_string(), status: "accepted".to_string(), @@ -2607,7 +2607,7 @@ mod tests { index_summary: v2::ThreadEpiphanyRetrieveIndexSummary { workspace_root: absolute_path("/workspace"), index_revision: Some("query-time-bm25-v1".to_string()), - status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + status: epiphany_state_model::EpiphanyRetrievalStatus::Ready, semantic_available: true, last_indexed_at_unix_seconds: Some(1_744_500_000), indexed_file_count: Some(12), @@ -2617,7 +2617,7 @@ mod tests { path_prefix: PathBuf::from("."), indexed_file_count: Some(12), indexed_chunk_count: Some(34), - status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + status: epiphany_state_model::EpiphanyRetrievalStatus::Ready, exact_available: true, semantic_available: true, }], @@ -2688,7 +2688,7 @@ mod tests { index_summary: v2::ThreadEpiphanyRetrieveIndexSummary { workspace_root: absolute_path("/workspace"), index_revision: Some("qdrant-ollama-v1:qwen3-embedding:0.6b".to_string()), - status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + status: epiphany_state_model::EpiphanyRetrievalStatus::Ready, semantic_available: true, last_indexed_at_unix_seconds: Some(1_744_500_100), indexed_file_count: Some(12), @@ -2698,7 +2698,7 @@ mod tests { path_prefix: PathBuf::from("."), indexed_file_count: Some(12), indexed_chunk_count: Some(34), - status: codex_protocol::protocol::EpiphanyRetrievalStatus::Ready, + status: epiphany_state_model::EpiphanyRetrievalStatus::Ready, exact_available: true, semantic_available: true, }], @@ -2749,7 +2749,7 @@ mod tests { response: v2::ThreadEpiphanyDistillResponse { expected_revision: 7, patch: v2::ThreadEpiphanyUpdatePatch { - observations: vec![codex_protocol::protocol::EpiphanyObservation { + observations: vec![epiphany_state_model::EpiphanyObservation { id: "obs-123".to_string(), summary: "Smoke passed".to_string(), source_kind: "smoke".to_string(), @@ -2757,7 +2757,7 @@ mod tests { code_refs: Vec::new(), evidence_ids: vec!["ev-123".to_string()], }], - evidence: vec![codex_protocol::protocol::EpiphanyEvidenceRecord { + evidence: vec![epiphany_state_model::EpiphanyEvidenceRecord { id: "ev-123".to_string(), kind: "verification".to_string(), status: "ok".to_string(), @@ -2810,7 +2810,7 @@ mod tests { response: v2::ThreadEpiphanyProposeResponse { expected_revision: 7, patch: v2::ThreadEpiphanyUpdatePatch { - churn: Some(codex_protocol::protocol::EpiphanyChurnState { + churn: Some(epiphany_state_model::EpiphanyChurnState { understanding_status: "proposal_ready".to_string(), diff_pressure: "low".to_string(), graph_freshness: Some("proposal".to_string()), @@ -2883,11 +2883,11 @@ mod tests { v2::ThreadEpiphanyStateUpdatedField::JobBindings, v2::ThreadEpiphanyStateUpdatedField::RuntimeLinks, ], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 3, - job_bindings: vec![codex_protocol::protocol::EpiphanyJobBinding { + job_bindings: vec![epiphany_state_model::EpiphanyJobBinding { id: "specialist-work".to_string(), - kind: codex_protocol::protocol::EpiphanyJobKind::Specialist, + kind: epiphany_state_model::EpiphanyJobKind::Specialist, scope: "role-scoped specialist work".to_string(), owner_role: "epiphany-harness".to_string(), authority_scope: Some("epiphany.specialist".to_string()), @@ -2895,7 +2895,7 @@ mod tests { linked_graph_node_ids: Vec::new(), blocking_reason: None, }], - runtime_links: vec![codex_protocol::protocol::EpiphanyRuntimeLink { + runtime_links: vec![epiphany_state_model::EpiphanyRuntimeLink { id: "runtime-link-specialist-work-job-123".to_string(), binding_id: "specialist-work".to_string(), surface: "jobLaunch".to_string(), @@ -2982,11 +2982,11 @@ mod tests { interrupted_thread_ids: vec!["worker-thread-1".to_string()], revision: 4, changed_fields: vec![v2::ThreadEpiphanyStateUpdatedField::JobBindings], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 4, - job_bindings: vec![codex_protocol::protocol::EpiphanyJobBinding { + job_bindings: vec![epiphany_state_model::EpiphanyJobBinding { id: "specialist-work".to_string(), - kind: codex_protocol::protocol::EpiphanyJobKind::Specialist, + kind: epiphany_state_model::EpiphanyJobKind::Specialist, scope: "role-scoped specialist work".to_string(), owner_role: "epiphany-harness".to_string(), authority_scope: Some("epiphany.specialist".to_string()), @@ -3066,7 +3066,7 @@ mod tests { response: v2::ThreadEpiphanyUpdateResponse { revision: 2, changed_fields: vec![v2::ThreadEpiphanyStateUpdatedField::Objective], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 2, objective: Some("Keep the map honest".to_string()), ..Default::default() @@ -3105,7 +3105,7 @@ mod tests { v2::ThreadEpiphanyStateUpdatedField::Objective, v2::ThreadEpiphanyStateUpdatedField::Evidence, ], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 7, objective: Some("Keep the map live".to_string()), ..Default::default() @@ -3139,7 +3139,7 @@ mod tests { source: v2::ThreadEpiphanyStateUpdatedSource::JobLaunch, revision: 8, changed_fields: vec![v2::ThreadEpiphanyStateUpdatedField::JobBindings], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState { + epiphany_state: epiphany_state_model::EpiphanyThreadState { revision: 8, ..Default::default() }, @@ -3883,7 +3883,7 @@ mod tests { objective: Some("Keep the map honest".to_string()), ..Default::default() }, - verifier_evidence: codex_protocol::protocol::EpiphanyEvidenceRecord { + verifier_evidence: epiphany_state_model::EpiphanyEvidenceRecord { id: "ev-verifier".to_string(), kind: "verification".to_string(), status: "ok".to_string(), @@ -3904,7 +3904,7 @@ mod tests { thread_id: "thr_123".to_string(), expected_revision: Some(2), binding_id: "specialist-work".to_string(), - kind: codex_protocol::protocol::EpiphanyJobKind::Specialist, + kind: epiphany_state_model::EpiphanyJobKind::Specialist, scope: "role-scoped specialist work".to_string(), owner_role: "epiphany-harness".to_string(), authority_scope: "epiphany.specialist".to_string(), @@ -3980,7 +3980,7 @@ mod tests { source: v2::ThreadEpiphanyStateUpdatedSource::Promote, revision: 0, changed_fields: vec![v2::ThreadEpiphanyStateUpdatedField::Churn], - epiphany_state: codex_protocol::protocol::EpiphanyThreadState::default(), + epiphany_state: epiphany_state_model::EpiphanyThreadState::default(), }, ); let reason = crate::experimental_api::ExperimentalApi::experimental_reason(¬ification); diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs index 7103ce6f..c09aa26c 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -57,29 +57,29 @@ use codex_protocol::protocol::AgentStatus as CoreAgentStatus; use codex_protocol::protocol::AskForApproval as CoreAskForApproval; use codex_protocol::protocol::CodexErrorInfo as CoreCodexErrorInfo; use codex_protocol::protocol::CreditsSnapshot as CoreCreditsSnapshot; -use codex_protocol::protocol::EpiphanyAcceptanceReceipt as CoreEpiphanyAcceptanceReceipt; -use codex_protocol::protocol::EpiphanyChurnState as CoreEpiphanyChurnState; -use codex_protocol::protocol::EpiphanyCodeRef as CoreEpiphanyCodeRef; -use codex_protocol::protocol::EpiphanyEvidenceRecord as CoreEpiphanyEvidenceRecord; -use codex_protocol::protocol::EpiphanyGraphCheckpoint as CoreEpiphanyGraphCheckpoint; -use codex_protocol::protocol::EpiphanyGraphEdge as CoreEpiphanyGraphEdge; -use codex_protocol::protocol::EpiphanyGraphFrontier as CoreEpiphanyGraphFrontier; -use codex_protocol::protocol::EpiphanyGraphLink as CoreEpiphanyGraphLink; -use codex_protocol::protocol::EpiphanyGraphNode as CoreEpiphanyGraphNode; -use codex_protocol::protocol::EpiphanyGraphs as CoreEpiphanyGraphs; -use codex_protocol::protocol::EpiphanyInvariant as CoreEpiphanyInvariant; -use codex_protocol::protocol::EpiphanyInvestigationCheckpoint as CoreEpiphanyInvestigationCheckpoint; -use codex_protocol::protocol::EpiphanyInvestigationDisposition as CoreEpiphanyInvestigationDisposition; -use codex_protocol::protocol::EpiphanyJobBinding as CoreEpiphanyJobBinding; -use codex_protocol::protocol::EpiphanyJobKind as CoreEpiphanyJobKind; -use codex_protocol::protocol::EpiphanyModeState as CoreEpiphanyModeState; -use codex_protocol::protocol::EpiphanyObservation as CoreEpiphanyObservation; -use codex_protocol::protocol::EpiphanyPlanningState as CoreEpiphanyPlanningState; -use codex_protocol::protocol::EpiphanyRetrievalStatus as CoreEpiphanyRetrievalStatus; -use codex_protocol::protocol::EpiphanyRuntimeLink as CoreEpiphanyRuntimeLink; -use codex_protocol::protocol::EpiphanyScratchPad as CoreEpiphanyScratchPad; -use codex_protocol::protocol::EpiphanySubgoal as CoreEpiphanySubgoal; -use codex_protocol::protocol::EpiphanyThreadState as CoreEpiphanyThreadState; +use epiphany_state_model::EpiphanyAcceptanceReceipt as CoreEpiphanyAcceptanceReceipt; +use epiphany_state_model::EpiphanyChurnState as CoreEpiphanyChurnState; +use epiphany_state_model::EpiphanyCodeRef as CoreEpiphanyCodeRef; +use epiphany_state_model::EpiphanyEvidenceRecord as CoreEpiphanyEvidenceRecord; +use epiphany_state_model::EpiphanyGraphCheckpoint as CoreEpiphanyGraphCheckpoint; +use epiphany_state_model::EpiphanyGraphEdge as CoreEpiphanyGraphEdge; +use epiphany_state_model::EpiphanyGraphFrontier as CoreEpiphanyGraphFrontier; +use epiphany_state_model::EpiphanyGraphLink as CoreEpiphanyGraphLink; +use epiphany_state_model::EpiphanyGraphNode as CoreEpiphanyGraphNode; +use epiphany_state_model::EpiphanyGraphs as CoreEpiphanyGraphs; +use epiphany_state_model::EpiphanyInvariant as CoreEpiphanyInvariant; +use epiphany_state_model::EpiphanyInvestigationCheckpoint as CoreEpiphanyInvestigationCheckpoint; +use epiphany_state_model::EpiphanyInvestigationDisposition as CoreEpiphanyInvestigationDisposition; +use epiphany_state_model::EpiphanyJobBinding as CoreEpiphanyJobBinding; +use epiphany_state_model::EpiphanyJobKind as CoreEpiphanyJobKind; +use epiphany_state_model::EpiphanyModeState as CoreEpiphanyModeState; +use epiphany_state_model::EpiphanyObservation as CoreEpiphanyObservation; +use epiphany_state_model::EpiphanyPlanningState as CoreEpiphanyPlanningState; +use epiphany_state_model::EpiphanyRetrievalStatus as CoreEpiphanyRetrievalStatus; +use epiphany_state_model::EpiphanyRuntimeLink as CoreEpiphanyRuntimeLink; +use epiphany_state_model::EpiphanyScratchPad as CoreEpiphanyScratchPad; +use epiphany_state_model::EpiphanySubgoal as CoreEpiphanySubgoal; +use epiphany_state_model::EpiphanyThreadState as CoreEpiphanyThreadState; use codex_protocol::protocol::ExecCommandSource as CoreExecCommandSource; use codex_protocol::protocol::ExecCommandStatus as CoreExecCommandStatus; use codex_protocol::protocol::GranularApprovalConfig as CoreGranularApprovalConfig; diff --git a/vendor/codex/codex-rs/app-server/Cargo.toml b/vendor/codex/codex-rs/app-server/Cargo.toml index 5d7b6021..1c08e7ef 100644 --- a/vendor/codex/codex-rs/app-server/Cargo.toml +++ b/vendor/codex/codex-rs/app-server/Cargo.toml @@ -61,6 +61,7 @@ codex-utils-json-to-toml = { workspace = true } codex-utils-rustls-provider = { workspace = true } chrono = { workspace = true } epiphany-codex-bridge = { path = "../../../../epiphany-codex-bridge" } +epiphany-state-model = { path = "../../../../epiphany-state-model" } clap = { workspace = true, features = ["derive"] } constant_time_eq = { workspace = true } futures = { workspace = true } diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_mutation_routes.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_mutation_routes.rs index e79285ad..b819d0f9 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_mutation_routes.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_mutation_routes.rs @@ -1,8 +1,8 @@ use codex_app_server_protocol::*; use codex_core::CodexThread; use codex_protocol::ThreadId; -use codex_protocol::protocol::EpiphanyRetrievalState; -use codex_protocol::protocol::EpiphanyThreadState; +use epiphany_state_model::EpiphanyRetrievalState; +use epiphany_state_model::EpiphanyThreadState; use epiphany_codex_bridge::cultnet::EpiphanyStateUpdatedField; use epiphany_codex_bridge::error::EpiphanyBridgeError; use epiphany_codex_bridge::invalidation::epiphany_freshness_watcher_snapshot; diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs index 5637a1ab..401747f7 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_read_routes.rs @@ -1,7 +1,7 @@ use codex_app_server_protocol::*; use codex_core::CodexThread; use codex_protocol::ThreadId; -use codex_protocol::protocol::EpiphanyRetrievalState; +use epiphany_state_model::EpiphanyRetrievalState; use super::epiphany_thread_host::load_authoritative_epiphany_state; use super::epiphany_thread_host::runtime_spine_store_path; use epiphany_codex_bridge::cultnet::EpiphanySurfaceSource; diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_thread_host.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_thread_host.rs index 27f4ad25..fb100dff 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_thread_host.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/epiphany_thread_host.rs @@ -3,7 +3,7 @@ use std::path::Path; use super::legacy_epiphany_rollout::latest_legacy_epiphany_state; use codex_core::CodexThread; use codex_core::RolloutRecorder; -use codex_protocol::protocol::EpiphanyThreadState; +use epiphany_state_model::EpiphanyThreadState; use codex_protocol::protocol::InitialHistory; use codex_protocol::protocol::TokenUsageInfo; use epiphany_codex_bridge::mutation_service::EpiphanyMutationHost; diff --git a/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs b/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs index c9864fa1..3000ffcd 100644 --- a/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs +++ b/vendor/codex/codex-rs/app-server/src/codex_message_processor/legacy_epiphany_rollout.rs @@ -1,5 +1,5 @@ use codex_protocol::models::ResponseItem; -use codex_protocol::protocol::EpiphanyThreadState; +use epiphany_state_model::EpiphanyThreadState; use codex_protocol::protocol::EventMsg; use codex_protocol::protocol::RolloutItem; @@ -103,7 +103,7 @@ pub(super) fn latest_legacy_epiphany_state(items: &[RolloutItem]) -> Option EpiphanyThreadState { diff --git a/vendor/codex/codex-rs/protocol/src/protocol.rs b/vendor/codex/codex-rs/protocol/src/protocol.rs index 72bb8f63..1bbfaf6d 100644 --- a/vendor/codex/codex-rs/protocol/src/protocol.rs +++ b/vendor/codex/codex-rs/protocol/src/protocol.rs @@ -50,6 +50,10 @@ use crate::request_permissions::RequestPermissionsEvent; use crate::request_permissions::RequestPermissionsResponse; use crate::request_user_input::RequestUserInputResponse; use crate::user_input::UserInput; +#[cfg(test)] +use epiphany_state_model::*; +#[cfg(not(test))] +use epiphany_state_model::EpiphanyStateItem; use codex_utils_absolute_path::AbsolutePathBuf; use schemars::JsonSchema; use serde::Deserialize; @@ -2947,44 +2951,6 @@ pub enum RolloutItem { EventMsg(EventMsg), } -pub use epiphany_state_model::EpiphanyAcceptanceReceipt; -pub use epiphany_state_model::EpiphanyBacklogItem; -pub use epiphany_state_model::EpiphanyChurnState; -pub use epiphany_state_model::EpiphanyCodeRef; -pub use epiphany_state_model::EpiphanyEvidenceRecord; -pub use epiphany_state_model::EpiphanyGraph; -pub use epiphany_state_model::EpiphanyGraphCheckpoint; -pub use epiphany_state_model::EpiphanyGraphEdge; -pub use epiphany_state_model::EpiphanyGraphFrontier; -pub use epiphany_state_model::EpiphanyGraphLink; -pub use epiphany_state_model::EpiphanyGraphNode; -pub use epiphany_state_model::EpiphanyGraphs; -pub use epiphany_state_model::EpiphanyInvariant; -pub use epiphany_state_model::EpiphanyInvestigationCheckpoint; -pub use epiphany_state_model::EpiphanyInvestigationDisposition; -pub use epiphany_state_model::EpiphanyJobBinding; -pub use epiphany_state_model::EpiphanyJobKind; -pub use epiphany_state_model::EpiphanyModeKind; -pub use epiphany_state_model::EpiphanyModeState; -pub use epiphany_state_model::EpiphanyObjectiveDraft; -pub use epiphany_state_model::EpiphanyObjectiveDraftLanePlan; -pub use epiphany_state_model::EpiphanyObjectiveDraftScope; -pub use epiphany_state_model::EpiphanyObservation; -pub use epiphany_state_model::EpiphanyPlanningCapture; -pub use epiphany_state_model::EpiphanyPlanningPriority; -pub use epiphany_state_model::EpiphanyPlanningSourceRef; -pub use epiphany_state_model::EpiphanyPlanningState; -pub use epiphany_state_model::EpiphanyRetrievalShardSummary; -pub use epiphany_state_model::EpiphanyRetrievalState; -pub use epiphany_state_model::EpiphanyRetrievalStatus; -pub use epiphany_state_model::EpiphanyRoadmapStream; -pub use epiphany_state_model::EpiphanyRuntimeLink; -pub use epiphany_state_model::EpiphanyScratchPad; -pub use epiphany_state_model::EpiphanyStateItem; -pub use epiphany_state_model::EpiphanySubgoal; -pub use epiphany_state_model::EpiphanyThreadState; -pub use epiphany_state_model::render_epiphany_state; - #[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, TS)] pub struct CompactedItem { pub message: String,