Remove Epiphany state tests from Codex protocol
This commit is contained in:
parent
3e55aadb9c
commit
03357cd3dd
8 changed files with 28 additions and 195 deletions
|
|
@ -1917,7 +1917,11 @@ cut is complete: the rollout variant carries opaque JSON, app-server alone
|
|||
performs typed validation, malformed payloads fail closed, and production
|
||||
Codex protocol has no native-state dependency. Next delete its obsolete
|
||||
native-state test fixture and dev-dependency, leaving only an opaque historical
|
||||
envelope preservation test.
|
||||
envelope preservation test. That cleanup is complete: Codex protocol has no
|
||||
native-state dependency in any dependency class, its giant state fixture is
|
||||
gone, and a minimal opaque historical-envelope test remains. Next rename the
|
||||
variant `LegacyEpiphanyState` while preserving serde tag `epiphany_state`, then
|
||||
judge whether generic unknown-rollout cargo can remove its final named trace.
|
||||
|
||||
## Immediate Re-entry Instruction
|
||||
|
||||
|
|
|
|||
|
|
@ -320,3 +320,9 @@ after validation, and rejects malformed payloads. The old tagged JSON shape,
|
|||
latest-surviving selection, and rollback semantics remain covered. Codex
|
||||
protocol no longer has a production dependency on `epiphany-state-model`; a
|
||||
source guard proves both the opaque variant and dependency boundary.
|
||||
|
||||
Codex protocol's obsolete native-state test authority is deleted too. The
|
||||
giant `EpiphanyThreadState` fixture and native round-trip tests are replaced by
|
||||
one minimal opaque-envelope preservation test. `codex-protocol` has no
|
||||
`epiphany-state-model` dependency in production or dev configuration; native
|
||||
state serialization is tested by its actual owner.
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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: Remove `epiphany-state-model` from `codex-protocol` dev-dependencies too. Replace the obsolete native-state round-trip fixture and giant sample builder with a minimal opaque legacy-envelope fixture; native state serialization belongs to `epiphany-state-model`, while Codex protocol should prove only preservation of historical payload bytes/shape.
|
||||
next_action: Rename the opaque protocol variant to `LegacyEpiphanyState` with `#[serde(rename = "epiphany_state")]` so every remaining core match states its quarantine status while preserving old JSON exactly. Then audit whether a generic unknown-rollout compatibility carrier can delete even that named core knowledge without weakening old-file recovery.
|
||||
|
|
|
|||
1
vendor/codex/codex-rs/Cargo.lock
generated
vendored
1
vendor/codex/codex-rs/Cargo.lock
generated
vendored
|
|
@ -3009,7 +3009,6 @@ dependencies = [
|
|||
"codex-utils-string",
|
||||
"codex-utils-template",
|
||||
"encoding_rs",
|
||||
"epiphany-state-model",
|
||||
"globset",
|
||||
"http 1.4.0",
|
||||
"icu_decimal",
|
||||
|
|
|
|||
|
|
@ -170,11 +170,7 @@ fn codex_session_has_no_epiphany_state_custody() {
|
|||
assert!(!core_lib.contains("epiphany_rollout"));
|
||||
assert!(!protocol.contains("pub use epiphany_state_model::"));
|
||||
assert!(protocol.contains("EpiphanyState(serde_json::Value)"));
|
||||
let production_dependencies = protocol_manifest
|
||||
.split("[dev-dependencies]")
|
||||
.next()
|
||||
.expect("protocol manifest should declare dependencies");
|
||||
assert!(!production_dependencies.contains("epiphany-state-model"));
|
||||
assert!(!protocol_manifest.contains("epiphany-state-model"));
|
||||
}
|
||||
|
||||
fn sample_epiphany_state_for_prompt() -> EpiphanyThreadState {
|
||||
|
|
|
|||
1
vendor/codex/codex-rs/protocol/Cargo.toml
vendored
1
vendor/codex/codex-rs/protocol/Cargo.toml
vendored
|
|
@ -51,7 +51,6 @@ seccompiler = { workspace = true }
|
|||
|
||||
[dev-dependencies]
|
||||
anyhow = { workspace = true }
|
||||
epiphany-state-model = { path = "../../../../epiphany-state-model" }
|
||||
http = { workspace = true }
|
||||
pretty_assertions = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
|
|
|
|||
201
vendor/codex/codex-rs/protocol/src/protocol.rs
vendored
201
vendor/codex/codex-rs/protocol/src/protocol.rs
vendored
|
|
@ -50,8 +50,6 @@ 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::*;
|
||||
use codex_utils_absolute_path::AbsolutePathBuf;
|
||||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
|
|
@ -5104,196 +5102,27 @@ mod tests {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn sample_epiphany_thread_state() -> EpiphanyThreadState {
|
||||
EpiphanyThreadState {
|
||||
revision: 7,
|
||||
objective: Some("Map the rollout seam before touching prompts".to_string()),
|
||||
active_subgoal_id: Some("phase1".to_string()),
|
||||
subgoals: vec![EpiphanySubgoal {
|
||||
id: "phase1".to_string(),
|
||||
title: "Persist baseline".to_string(),
|
||||
status: "active".to_string(),
|
||||
summary: Some("Wire a durable rollout snapshot into core".to_string()),
|
||||
}],
|
||||
invariants: vec![EpiphanyInvariant {
|
||||
id: "durable-state".to_string(),
|
||||
description: "Resume must rebuild the latest surviving Epiphany baseline"
|
||||
.to_string(),
|
||||
status: "enforced".to_string(),
|
||||
rationale: Some("Otherwise compaction turns the machine into soup".to_string()),
|
||||
}],
|
||||
graphs: EpiphanyGraphs {
|
||||
architecture: EpiphanyGraph {
|
||||
nodes: vec![EpiphanyGraphNode {
|
||||
id: "session".to_string(),
|
||||
title: "Session".to_string(),
|
||||
purpose: "Owns the mutable thread state".to_string(),
|
||||
mechanism: Some("Reads and writes rollout-backed baselines".to_string()),
|
||||
metaphor: Some(
|
||||
"The machine room where the levers actually live".to_string(),
|
||||
),
|
||||
status: Some("verified".to_string()),
|
||||
code_refs: vec![EpiphanyCodeRef {
|
||||
path: test_path_buf("/repo/core/src/session/mod.rs"),
|
||||
start_line: Some(2600),
|
||||
end_line: Some(2690),
|
||||
symbol: Some(
|
||||
"record_context_updates_and_set_reference_context_item".to_string(),
|
||||
),
|
||||
note: Some("Per-turn baseline persistence".to_string()),
|
||||
}],
|
||||
}],
|
||||
edges: vec![],
|
||||
},
|
||||
dataflow: EpiphanyGraph {
|
||||
nodes: vec![EpiphanyGraphNode {
|
||||
id: "turn-context".to_string(),
|
||||
title: "Turn Context".to_string(),
|
||||
purpose: "Captures the durable per-turn baseline".to_string(),
|
||||
mechanism: Some("Persists after each real user turn".to_string()),
|
||||
metaphor: Some("The breadcrumb the replay engine follows home".to_string()),
|
||||
status: Some("verified".to_string()),
|
||||
code_refs: vec![],
|
||||
}],
|
||||
edges: vec![EpiphanyGraphEdge {
|
||||
source_id: "turn-context".to_string(),
|
||||
target_id: "session".to_string(),
|
||||
kind: "persists_to".to_string(),
|
||||
id: Some("edge-1".to_string()),
|
||||
label: Some("baseline write".to_string()),
|
||||
mechanism: Some("TurnContext snapshots seed replay metadata".to_string()),
|
||||
code_refs: vec![],
|
||||
}],
|
||||
},
|
||||
links: vec![EpiphanyGraphLink {
|
||||
dataflow_node_id: "turn-context".to_string(),
|
||||
architecture_node_id: "session".to_string(),
|
||||
relationship: Some("implemented_by".to_string()),
|
||||
code_refs: vec![],
|
||||
}],
|
||||
},
|
||||
graph_frontier: Some(EpiphanyGraphFrontier {
|
||||
active_node_ids: vec!["turn-context".to_string()],
|
||||
active_edge_ids: vec!["edge-1".to_string()],
|
||||
open_question_ids: vec!["q1".to_string()],
|
||||
open_gap_ids: vec!["g1".to_string()],
|
||||
dirty_paths: vec![test_path_buf("/repo/core/src/session/mod.rs")],
|
||||
}),
|
||||
graph_checkpoint: Some(EpiphanyGraphCheckpoint {
|
||||
checkpoint_id: "chk-1".to_string(),
|
||||
graph_revision: 7,
|
||||
summary: Some("Latest replay seam checkpoint".to_string()),
|
||||
frontier_node_ids: vec!["turn-context".to_string()],
|
||||
open_question_ids: vec!["q1".to_string()],
|
||||
open_gap_ids: vec!["g1".to_string()],
|
||||
}),
|
||||
investigation_checkpoint: Some(EpiphanyInvestigationCheckpoint {
|
||||
checkpoint_id: "ix-1".to_string(),
|
||||
kind: "source_gathering".to_string(),
|
||||
disposition: EpiphanyInvestigationDisposition::ResumeReady,
|
||||
focus: "Resume the prompt-facing replay seam.".to_string(),
|
||||
summary: Some("The checkpoint keeps the active source seam warm.".to_string()),
|
||||
next_action: Some("Re-open the rollout path before broad edits.".to_string()),
|
||||
captured_at_turn_id: Some("turn-123".to_string()),
|
||||
open_questions: vec!["Does compaction still preserve the seam?".to_string()],
|
||||
code_refs: vec![EpiphanyCodeRef {
|
||||
path: test_path_buf("/repo/core/src/session/mod.rs"),
|
||||
start_line: Some(2600),
|
||||
end_line: Some(2690),
|
||||
symbol: Some(
|
||||
"record_context_updates_and_set_reference_context_item".to_string(),
|
||||
),
|
||||
note: Some("Investigation checkpoint anchor".to_string()),
|
||||
}],
|
||||
evidence_ids: vec!["ev-1".to_string()],
|
||||
}),
|
||||
retrieval: Some(EpiphanyRetrievalState {
|
||||
workspace_root: test_path_buf("/repo"),
|
||||
index_revision: Some("bm25-v1".to_string()),
|
||||
status: EpiphanyRetrievalStatus::Ready,
|
||||
semantic_available: true,
|
||||
last_indexed_at_unix_seconds: Some(1_744_500_000),
|
||||
indexed_file_count: Some(12),
|
||||
indexed_chunk_count: Some(34),
|
||||
shards: vec![EpiphanyRetrievalShardSummary {
|
||||
shard_id: "workspace".to_string(),
|
||||
path_prefix: PathBuf::from("."),
|
||||
indexed_file_count: Some(12),
|
||||
indexed_chunk_count: Some(34),
|
||||
status: EpiphanyRetrievalStatus::Ready,
|
||||
exact_available: true,
|
||||
semantic_available: true,
|
||||
}],
|
||||
dirty_paths: vec![test_path_buf("/repo/core/src/session/mod.rs")],
|
||||
}),
|
||||
scratch: Some(EpiphanyScratchPad {
|
||||
summary: Some("Persist first, get fancy later".to_string()),
|
||||
hypothesis: Some("One extra rollout item is enough for Phase 1".to_string()),
|
||||
next_probe: Some("Replay after rollback and compaction".to_string()),
|
||||
notes: vec!["Do not touch prompts yet".to_string()],
|
||||
}),
|
||||
job_bindings: Vec::new(),
|
||||
acceptance_receipts: Vec::new(),
|
||||
runtime_links: Vec::new(),
|
||||
observations: vec![EpiphanyObservation {
|
||||
id: "obs-1".to_string(),
|
||||
summary: "TurnContext already gives us the persistence seam".to_string(),
|
||||
source_kind: "tool_output".to_string(),
|
||||
status: "promoted".to_string(),
|
||||
code_refs: vec![],
|
||||
evidence_ids: vec!["ev-1".to_string()],
|
||||
}],
|
||||
recent_evidence: vec![EpiphanyEvidenceRecord {
|
||||
id: "ev-1".to_string(),
|
||||
kind: "research".to_string(),
|
||||
status: "ok".to_string(),
|
||||
summary: "Reconstruction already respects rollback and compaction boundaries"
|
||||
.to_string(),
|
||||
code_refs: vec![],
|
||||
}],
|
||||
churn: Some(EpiphanyChurnState {
|
||||
understanding_status: "clear".to_string(),
|
||||
diff_pressure: "low".to_string(),
|
||||
graph_freshness: Some("fresh".to_string()),
|
||||
warning: None,
|
||||
unexplained_writes: Some(0),
|
||||
}),
|
||||
mode: Some(EpiphanyModeState {
|
||||
name: "epiphany".to_string(),
|
||||
kind: Some(EpiphanyModeKind::Default),
|
||||
}),
|
||||
planning: EpiphanyPlanningState::default(),
|
||||
last_updated_turn_id: Some("turn-123".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn epiphany_thread_state_round_trips() -> Result<()> {
|
||||
let original = sample_epiphany_thread_state();
|
||||
let value = serde_json::to_value(&original)?;
|
||||
let reparsed: EpiphanyThreadState = serde_json::from_value(value)?;
|
||||
assert_eq!(reparsed, original);
|
||||
Ok(())
|
||||
}
|
||||
fn legacy_epiphany_state_envelope_preserves_opaque_payload() -> Result<()> {
|
||||
let payload = json!({
|
||||
"turn_id": "turn-123",
|
||||
"state": {
|
||||
"revision": 7,
|
||||
"objective": "historical compatibility only"
|
||||
}
|
||||
});
|
||||
let item = RolloutItem::EpiphanyState(payload.clone());
|
||||
let encoded = serde_json::to_value(&item)?;
|
||||
assert_eq!(encoded["type"], "epiphany_state");
|
||||
assert_eq!(encoded["payload"], payload);
|
||||
|
||||
#[test]
|
||||
fn epiphany_state_item_round_trips() -> Result<()> {
|
||||
let original = EpiphanyStateItem {
|
||||
turn_id: Some("turn-123".to_string()),
|
||||
state: sample_epiphany_thread_state(),
|
||||
};
|
||||
let rollout_item = RolloutItem::EpiphanyState(serde_json::to_value(&original)?);
|
||||
let value = serde_json::to_value(&rollout_item)?;
|
||||
assert_eq!(value["type"], "epiphany_state");
|
||||
let reparsed: RolloutItem = serde_json::from_value(value)?;
|
||||
let RolloutItem::EpiphanyState(payload) = reparsed else {
|
||||
let reparsed: RolloutItem = serde_json::from_value(encoded)?;
|
||||
let RolloutItem::EpiphanyState(reparsed_payload) = reparsed else {
|
||||
panic!("expected opaque legacy Epiphany rollout payload");
|
||||
};
|
||||
let reparsed: EpiphanyStateItem = serde_json::from_value(payload)?;
|
||||
assert_eq!(reparsed, original);
|
||||
assert_eq!(reparsed_payload, payload);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Serialize Event to verify that its JSON representation has the expected
|
||||
/// amount of nesting.
|
||||
#[test]
|
||||
|
|
|
|||
Reference in a new issue