Stop Codex protocol from owning Epiphany state

This commit is contained in:
Meta Vens 2026-07-12 02:19:47 +01:00
commit f2b8763eb5
17 changed files with 113 additions and 127 deletions

View file

@ -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

View file

@ -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.

Binary file not shown.

View file

@ -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.

3
vendor/codex/codex-rs/Cargo.lock generated vendored
View file

@ -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",

View file

@ -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 }

View file

@ -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(&notification);

View file

@ -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;

View file

@ -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 }

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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<Epip
mod tests {
use super::*;
use codex_protocol::config_types::ModeKind;
use codex_protocol::protocol::EpiphanyStateItem;
use epiphany_state_model::EpiphanyStateItem;
use codex_protocol::protocol::ThreadRolledBackEvent;
use codex_protocol::protocol::TurnCompleteEvent;
use codex_protocol::protocol::TurnStartedEvent;

View file

@ -140,6 +140,7 @@ windows-sys = { version = "0.52", features = [
codex-shell-escalation = { workspace = true }
[dev-dependencies]
epiphany-state-model = { path = "../../../../epiphany-state-model" }
assert_cmd = { workspace = true }
assert_matches = { workspace = true }
codex-otel = { workspace = true }

View file

@ -6,8 +6,8 @@ use codex_protocol::ThreadId;
use codex_protocol::models::ContentItem;
use codex_protocol::models::ResponseItem;
use codex_protocol::protocol::CompactedItem;
use codex_protocol::protocol::EpiphanyStateItem;
use codex_protocol::protocol::EpiphanyThreadState;
use epiphany_state_model::EpiphanyStateItem;
use epiphany_state_model::EpiphanyThreadState;
use codex_protocol::protocol::InitialHistory;
use codex_protocol::protocol::InterAgentCommunication;
use codex_protocol::protocol::ResumedHistory;

View file

@ -75,24 +75,24 @@ use codex_protocol::protocol::AskForApproval;
use codex_protocol::protocol::CompactedItem;
use codex_protocol::protocol::ConversationAudioParams;
use codex_protocol::protocol::CreditsSnapshot;
use codex_protocol::protocol::EpiphanyChurnState;
use codex_protocol::protocol::EpiphanyCodeRef;
use codex_protocol::protocol::EpiphanyEvidenceRecord;
use codex_protocol::protocol::EpiphanyGraph;
use codex_protocol::protocol::EpiphanyGraphCheckpoint;
use codex_protocol::protocol::EpiphanyGraphEdge;
use codex_protocol::protocol::EpiphanyGraphFrontier;
use codex_protocol::protocol::EpiphanyGraphLink;
use codex_protocol::protocol::EpiphanyGraphNode;
use codex_protocol::protocol::EpiphanyGraphs;
use codex_protocol::protocol::EpiphanyInvariant;
use codex_protocol::protocol::EpiphanyModeKind;
use codex_protocol::protocol::EpiphanyModeState;
use codex_protocol::protocol::EpiphanyObservation;
use codex_protocol::protocol::EpiphanyScratchPad;
use codex_protocol::protocol::EpiphanyStateItem;
use codex_protocol::protocol::EpiphanySubgoal;
use codex_protocol::protocol::EpiphanyThreadState;
use epiphany_state_model::EpiphanyChurnState;
use epiphany_state_model::EpiphanyCodeRef;
use epiphany_state_model::EpiphanyEvidenceRecord;
use epiphany_state_model::EpiphanyGraph;
use epiphany_state_model::EpiphanyGraphCheckpoint;
use epiphany_state_model::EpiphanyGraphEdge;
use epiphany_state_model::EpiphanyGraphFrontier;
use epiphany_state_model::EpiphanyGraphLink;
use epiphany_state_model::EpiphanyGraphNode;
use epiphany_state_model::EpiphanyGraphs;
use epiphany_state_model::EpiphanyInvariant;
use epiphany_state_model::EpiphanyModeKind;
use epiphany_state_model::EpiphanyModeState;
use epiphany_state_model::EpiphanyObservation;
use epiphany_state_model::EpiphanyScratchPad;
use epiphany_state_model::EpiphanyStateItem;
use epiphany_state_model::EpiphanySubgoal;
use epiphany_state_model::EpiphanyThreadState;
use codex_protocol::protocol::GranularApprovalConfig;
use codex_protocol::protocol::InitialHistory;
use codex_protocol::protocol::InterAgentCommunication;
@ -153,6 +153,7 @@ fn codex_session_has_no_epiphany_state_custody() {
let session = include_str!("mod.rs");
let codex_thread = include_str!("../codex_thread.rs");
let core_lib = include_str!("../lib.rs");
let protocol = include_str!("../../../protocol/src/protocol.rs");
assert!(!session_state.contains("epiphany_state"));
assert!(!session.contains("set_epiphany_state"));
@ -160,6 +161,7 @@ fn codex_session_has_no_epiphany_state_custody() {
assert!(!codex_thread.contains("async fn epiphany_state"));
assert!(!codex_thread.contains("pub async fn epiphany_"));
assert!(!core_lib.contains("epiphany_rollout"));
assert!(!protocol.contains("pub use epiphany_state_model::"));
}
fn sample_epiphany_state_for_prompt() -> EpiphanyThreadState {

View file

@ -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,