Close state ledger document shape
This commit is contained in:
parent
f19e99c7fe
commit
4cc7e2858d
6 changed files with 2 additions and 16 deletions
|
|
@ -6,7 +6,6 @@ use epiphany_core::add_state_branch;
|
|||
use epiphany_core::append_state_evidence;
|
||||
use epiphany_core::close_state_branch;
|
||||
use epiphany_core::state_ledger_status;
|
||||
use std::collections::BTreeMap;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
|
@ -29,7 +28,6 @@ fn main() -> Result<()> {
|
|||
status: require_string_arg(&mut args, "--status")?,
|
||||
note: require_string_arg(&mut args, "--note")?,
|
||||
branch: optional_string_arg(&mut args, "--branch")?,
|
||||
extra: BTreeMap::new(),
|
||||
};
|
||||
print_json(&append_state_evidence(store, record)?)?;
|
||||
}
|
||||
|
|
@ -44,7 +42,6 @@ fn main() -> Result<()> {
|
|||
status: "active".to_string(),
|
||||
artifacts,
|
||||
notes: note.unwrap_or_default(),
|
||||
extra: BTreeMap::new(),
|
||||
};
|
||||
print_json(&add_state_branch(store, branch)?)?;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use epiphany_core::add_state_branch;
|
|||
use epiphany_core::append_state_evidence;
|
||||
use epiphany_core::close_state_branch;
|
||||
use epiphany_core::load_state_ledger;
|
||||
use std::collections::BTreeMap;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
|
@ -55,7 +54,6 @@ fn main() -> Result<()> {
|
|||
status: status.context("missing --status")?,
|
||||
note: note.context("missing --note")?,
|
||||
branch,
|
||||
extra: BTreeMap::new(),
|
||||
},
|
||||
)?;
|
||||
println!("Appended evidence record.");
|
||||
|
|
@ -93,7 +91,6 @@ fn main() -> Result<()> {
|
|||
status: "active".to_string(),
|
||||
artifacts,
|
||||
notes: note.unwrap_or_default(),
|
||||
extra: BTreeMap::new(),
|
||||
},
|
||||
)?;
|
||||
println!("Added branch '{id}'.");
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use cultcache_rs::SingleFileMessagePackBackingStore;
|
|||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use serde_json::Value;
|
||||
use std::collections::BTreeMap;
|
||||
use std::path::Path;
|
||||
|
||||
pub const STATE_LEDGER_STORE_TYPE: &str = "epiphany.state_ledger";
|
||||
|
|
@ -22,8 +21,6 @@ pub struct EpiphanyStateLedgerEntry {
|
|||
pub branches: Vec<EpiphanyBranchRecord>,
|
||||
#[cultcache(key = 2)]
|
||||
pub evidence: Vec<EpiphanyLedgerEvidenceRecord>,
|
||||
#[cultcache(key = 3, default)]
|
||||
pub extra: BTreeMap<String, Value>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
||||
|
|
@ -33,8 +30,6 @@ pub struct EpiphanyBranchRecord {
|
|||
pub status: String,
|
||||
pub artifacts: Vec<String>,
|
||||
pub notes: String,
|
||||
#[serde(flatten)]
|
||||
pub extra: BTreeMap<String, Value>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
||||
|
|
@ -46,8 +41,6 @@ pub struct EpiphanyLedgerEvidenceRecord {
|
|||
pub note: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub branch: Option<String>,
|
||||
#[serde(flatten)]
|
||||
pub extra: BTreeMap<String, Value>,
|
||||
}
|
||||
|
||||
pub fn state_ledger_status(store_path: impl AsRef<Path>) -> Result<Value> {
|
||||
|
|
@ -178,7 +171,6 @@ fn default_state_ledger() -> EpiphanyStateLedgerEntry {
|
|||
schema_version: STATE_LEDGER_SCHEMA_VERSION.to_string(),
|
||||
branches: Vec::new(),
|
||||
evidence: Vec::new(),
|
||||
extra: BTreeMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -228,7 +220,6 @@ mod tests {
|
|||
status: "active".to_string(),
|
||||
artifacts: vec!["state/map.yaml".to_string()],
|
||||
notes: "test".to_string(),
|
||||
extra: BTreeMap::new(),
|
||||
},
|
||||
)?;
|
||||
let entry = load_state_ledger(&store)?;
|
||||
|
|
@ -242,7 +233,6 @@ mod tests {
|
|||
status: "ok".to_string(),
|
||||
note: "Native evidence append works.".to_string(),
|
||||
branch: Some("main".to_string()),
|
||||
extra: BTreeMap::new(),
|
||||
},
|
||||
)?;
|
||||
assert_eq!(load_state_ledger(&store)?.evidence.len(), 1);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ remembers doctrine; the branch remembers the blade.
|
|||
- `epiphany-openai-runtime` worker result ingress now parses assistant output directly into typed role/reorient ingress structs selected from the durable launch document, stores nested `statePatch` and `selfPatch` as typed MessagePack in `EpiphanyRuntimeRoleWorkerResult`, and no longer passes worker result data through generic `serde_json::Value`. JSON survives there only as the OpenAI text-output edge before typed deserialization.
|
||||
- Agent self-memory review/application now has typed `AgentSelfPatch` core APIs. JSON-value selfPatch functions are compatibility wrappers for CLI/artifact ingress; native callers should parse once at the edge and then call `review_agent_self_patch_document` / `apply_agent_self_patch_document`. Role-result self-persistence no longer exports a JSON-value reviewer; the live API is `review_role_self_patch_document`.
|
||||
- Durable Ghostlight role dossiers now store typed relationship, event, scene, and perceived-overlay documents instead of `Vec<serde_json::Value>`, and the durable dossier structs no longer preserve flattened unknown `extra` maps. `AgentSelfPatch.extra` remains deliberately, but only as an ingress rejection ledger for unexpected patch fields.
|
||||
- The native state ledger is closed typed state now: branch and evidence records no longer preserve flattened `extra` maps. Evidence entries are explicit `ts` / `type` / `status` / `note` / optional branch records.
|
||||
- `epiphany-openai-codex-spine` no longer uses Codex's Responses client, model-provider layer, `codex-api`, `codex-model-provider`, `codex-model-provider-info`, or `codex-protocol` for outbound model requests. It reaches `codex-login` only through `epiphany-openai-auth-spine` so credential loading/refresh stays Codex-compatible while request/status/event/runtime surfaces stay typed Epiphany documents.
|
||||
- `notes/epiphany-memory-graph-unified-plan.md` is the current memory architecture direction drawn from `Fractal Domains And The Cache That Bites` plus the VoidBot memory scar tissue. The repo semantic architecture/dataflow graph and agent memory are one `EpiphanyMemoryGraph` substrate with repo, role, short-term, incubation, agency, candidate-intervention, and evidence profiles. The first native skeleton is landed: `epiphany-state-model` owns shared graph document types, `epiphany-core::memory_graph` owns stable ids, validation, freshness, context cuts, and CultCache persistence, and `epiphany-memory-graph` can status/validate/context/smoke the store without Qdrant. Qdrant is a contribution cache for typed graph documents, not truth. `notes/repo-fractal-dataflow-cache-plan.md` and `notes/agent-memory-fractal-cache-plan.md` are profile plans, not rival organs.
|
||||
- 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 `<epiphany_state>` 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.
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -100,6 +100,7 @@ accepted_design:
|
|||
- `epiphany-openai-runtime` worker result ingress now parses assistant output directly into launch-kind-specific typed documents and stores typed nested `statePatch` / `selfPatch` payloads as MessagePack inside `EpiphanyRuntimeRoleWorkerResult`; generic `serde_json::Value` no longer mediates role/reorient worker results in that crate. JSON still exists at the OpenAI text edge because the model's output is text, but the runtime boundary after parsing is typed.
|
||||
- Agent self-memory review/application now has typed `AgentSelfPatch` core APIs. The old JSON-value selfPatch functions remain only as edge compatibility wrappers for CLI/artifact ingress; `epiphany-agent-memory-store`, heartbeat rumination application, and repo initialization selfPatch processing parse once at the edge and then operate on typed documents. Role-result self-persistence no longer exports a JSON-value reviewer; native review uses `review_role_self_patch_document`.
|
||||
- Durable Ghostlight role dossiers are typed through their relationship/event/scene/perceived-overlay surfaces now. `EpiphanyAgentMemoryEntry` no longer stores those arrays as `serde_json::Value`, and durable Ghostlight structs no longer carry flattened unknown `extra` bags. `AgentSelfPatch.extra` remains only as an ingress guard so unknown patch keys can be rejected with reasons.
|
||||
- The state ledger CultCache document is now a closed typed ledger shape. Branch and evidence records no longer carry flattened `extra` maps; evidence additions remain explicit records with `ts`, `type`, `status`, `note`, and optional branch.
|
||||
- Heartbeat durable document/schema types live in `epiphany-core/src/heartbeat_state/heartbeat_documents.rs`; role/default construction lives in `epiphany-core/src/heartbeat_state/heartbeat_roles.rs`; heartbeat persistence/validation lives in `epiphany-core/src/heartbeat_state/heartbeat_store.rs`; heartbeat status/artifact JSON projection lives in `epiphany-core/src/heartbeat_state/heartbeat_projection.rs`; the root heartbeat module remains the scheduling/cognition orchestration surface until those responsibilities are split into their own tested seams. Heartbeat timing authority is now typed state: adaptive pacing, scene protocol, participant personality/mood timing, initiative heat projection, birth personality seed receipts, and pending-turn freeze/multiplier facts are named fields rather than `extra` maps. The only remaining heartbeat `extra` bag is the sealed legacy combined-state reader for old `voidRoutine` migration.
|
||||
- Heartbeat role/default and store seams are pinned by module-local unit tests for fixed lane catalog, Ghostlight scene role projection, and typed state/cognition CultCache round-trip.
|
||||
- Heartbeat adaptive pacing lives in `epiphany-core/src/heartbeat_state/heartbeat_pacing.rs`; it owns pressure/concurrency derivation, running-turn count, initiative heat projection, and effective cooldown multipliers for scheduler/projection callers.
|
||||
|
|
|
|||
Reference in a new issue