Delete aggregate acceptance repair authority
This commit is contained in:
parent
bd5034cd66
commit
a786273d77
7 changed files with 38 additions and 231 deletions
|
|
@ -90,8 +90,8 @@ name = "epiphany-memory-semantic-projector"
|
|||
path = "src/bin/epiphany-memory-semantic-projector.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "epiphany-mind-repair"
|
||||
path = "src/bin/epiphany-mind-repair.rs"
|
||||
name = "epiphany-frontier-execution"
|
||||
path = "src/bin/epiphany-frontier-execution.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "epiphany-mvp-coordinator-smoke"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use anyhow::{Result, anyhow};
|
||||
use epiphany_core::{
|
||||
RepoFrontierExecutionAmendment, RepoFrontierRoute, amend_repo_frontier_execution,
|
||||
apply_supervisor_modeling_acceptance_correction, read_coordinator_state,
|
||||
runtime_repo_frontier_plan_decision, runtime_repo_model_admission_receipt,
|
||||
runtime_repo_model_admission_review, runtime_spine_cache,
|
||||
};
|
||||
|
|
@ -12,11 +11,7 @@ fn main() -> Result<()> {
|
|||
let mut values = BTreeMap::new();
|
||||
let mut args = env::args().skip(1);
|
||||
let command = args.next().ok_or_else(|| anyhow!(usage()))?;
|
||||
if command != "amend-frontier-execution"
|
||||
&& command != "inspect-frontier-execution"
|
||||
&& command != "inspect-thread-acceptances"
|
||||
&& command != "supersede-modeling-acceptance"
|
||||
{
|
||||
if command != "amend-frontier-execution" && command != "inspect-frontier-execution" {
|
||||
return Err(anyhow!("unknown command {command}\n{}", usage()));
|
||||
}
|
||||
while let Some(flag) = args.next() {
|
||||
|
|
@ -34,35 +29,6 @@ fn main() -> Result<()> {
|
|||
.ok_or_else(|| anyhow!("missing {name}"))
|
||||
};
|
||||
let store = PathBuf::from(take("--store")?);
|
||||
if command == "inspect-thread-acceptances" {
|
||||
let thread_id = take("--thread-id")?;
|
||||
let state = read_coordinator_state(&store)?
|
||||
.ok_or_else(|| anyhow!("coordinator state is absent"))?;
|
||||
println!(
|
||||
"{}",
|
||||
serde_json::to_string_pretty(&serde_json::json!({
|
||||
"threadId": thread_id,
|
||||
"revision": state.revision,
|
||||
"lastUpdatedTurnId": state.last_updated_turn_id,
|
||||
"acceptanceReceipts": state.acceptance_receipts,
|
||||
}))?
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
if command == "supersede-modeling-acceptance" {
|
||||
let receipt = apply_supervisor_modeling_acceptance_correction(
|
||||
&store,
|
||||
&take("--thread-id")?,
|
||||
take("--expected-revision")?.parse()?,
|
||||
&take("--receipt-id")?,
|
||||
&take("--result-id")?,
|
||||
&take("--source-actor-id")?,
|
||||
&take("--reason")?,
|
||||
&take("--corrected-at")?,
|
||||
)?;
|
||||
println!("{}", serde_json::to_string_pretty(&receipt)?);
|
||||
return Ok(());
|
||||
}
|
||||
let route_id = take("--route-id")?;
|
||||
if command == "inspect-frontier-execution" {
|
||||
let mut cache = runtime_spine_cache(&store)?;
|
||||
|
|
@ -155,5 +121,5 @@ fn main() -> Result<()> {
|
|||
}
|
||||
|
||||
fn usage() -> &'static str {
|
||||
"usage: epiphany-mind-repair inspect-thread-acceptances --store PATH --thread-id ID\n epiphany-mind-repair inspect-frontier-execution --store PATH --route-id ID\n epiphany-mind-repair amend-frontier-execution --store PATH --route-id ID --source-actor-id ID --command-id ID --admission-id ID --packet-sha256 SHA256 --previous-action TEXT --previous-command TEXT --action TEXT --replacement-command TEXT --rationale TEXT --amended-at RFC3339\n epiphany-mind-repair supersede-modeling-acceptance --store PATH --thread-id ID --expected-revision N --receipt-id ID --result-id ID --source-actor-id ID --reason missing-typed-future-frontier --corrected-at RFC3339"
|
||||
"usage: epiphany-frontier-execution inspect-frontier-execution --store PATH --route-id ID\n epiphany-frontier-execution amend-frontier-execution --store PATH --route-id ID --source-actor-id ID --command-id ID --admission-id ID --packet-sha256 SHA256 --previous-action TEXT --previous-command TEXT --action TEXT --replacement-command TEXT --rationale TEXT --amended-at RFC3339"
|
||||
}
|
||||
|
|
@ -7,9 +7,7 @@ use crate::epiphany_state_update_validation_errors;
|
|||
use crate::read_accepted_coordinator_state;
|
||||
use anyhow::Result;
|
||||
use anyhow::anyhow;
|
||||
use epiphany_state_model::{EpiphanyEvidenceRecord, EpiphanyThreadState};
|
||||
use serde::Serialize;
|
||||
use sha2::{Digest, Sha256};
|
||||
use epiphany_state_model::EpiphanyThreadState;
|
||||
use std::path::Path;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
|
@ -19,124 +17,6 @@ pub struct EpiphanyCoordinatorStateApplied {
|
|||
pub state: EpiphanyThreadState,
|
||||
}
|
||||
|
||||
pub const SUPERVISOR_MODELING_ACCEPTANCE_CORRECTION_REASON: &str =
|
||||
"missing-typed-future-frontier";
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct EpiphanySupervisorAcceptanceCorrectionReceipt {
|
||||
pub correction_id: String,
|
||||
pub thread_id: String,
|
||||
pub source_actor_id: String,
|
||||
pub prior_receipt_id: String,
|
||||
pub prior_receipt_sha256: String,
|
||||
pub result_id: String,
|
||||
pub job_id: String,
|
||||
pub binding_id: String,
|
||||
pub role_id: String,
|
||||
pub reason: String,
|
||||
pub corrected_at: String,
|
||||
pub prior_revision: u64,
|
||||
pub corrected_revision: u64,
|
||||
}
|
||||
|
||||
pub fn apply_supervisor_modeling_acceptance_correction(
|
||||
store: &Path,
|
||||
thread_id: &str,
|
||||
expected_revision: u64,
|
||||
prior_receipt_id: &str,
|
||||
result_id: &str,
|
||||
source_actor_id: &str,
|
||||
reason: &str,
|
||||
corrected_at: &str,
|
||||
) -> Result<EpiphanySupervisorAcceptanceCorrectionReceipt> {
|
||||
for (name, value) in [
|
||||
("thread_id", thread_id),
|
||||
("prior_receipt_id", prior_receipt_id),
|
||||
("result_id", result_id),
|
||||
("source_actor_id", source_actor_id),
|
||||
] {
|
||||
if value.trim().is_empty() {
|
||||
return Err(anyhow!("supervisor acceptance correction requires {name}"));
|
||||
}
|
||||
}
|
||||
if reason != SUPERVISOR_MODELING_ACCEPTANCE_CORRECTION_REASON {
|
||||
return Err(anyhow!(
|
||||
"unsupported supervisor Modeling acceptance correction reason"
|
||||
));
|
||||
}
|
||||
chrono::DateTime::parse_from_rfc3339(corrected_at)
|
||||
.map_err(|_| anyhow!("supervisor acceptance correction timestamp must be RFC3339"))?;
|
||||
|
||||
let current = read_coordinator_state(store)?
|
||||
.ok_or_else(|| anyhow!("supervisor acceptance correction requires coordinator state"))?;
|
||||
if current.revision != expected_revision {
|
||||
return Err(anyhow!(
|
||||
"supervisor acceptance correction revision mismatch: expected {expected_revision}, found {}",
|
||||
current.revision
|
||||
));
|
||||
}
|
||||
let receipt_index = current
|
||||
.acceptance_receipts
|
||||
.iter()
|
||||
.position(|receipt| receipt.id == prior_receipt_id)
|
||||
.ok_or_else(|| anyhow!("supervisor acceptance correction receipt is absent"))?;
|
||||
let prior = current.acceptance_receipts[receipt_index].clone();
|
||||
if prior.result_id != result_id
|
||||
|| prior.role_id != "modeling"
|
||||
|| prior.surface != "roleAccept"
|
||||
|| prior.status != "accepted"
|
||||
{
|
||||
return Err(anyhow!(
|
||||
"supervisor acceptance correction requires the exact accepted Modeling receipt"
|
||||
));
|
||||
}
|
||||
let prior_receipt_sha256 = format!(
|
||||
"{:x}",
|
||||
Sha256::digest(rmp_serde::to_vec_named(&prior)?)
|
||||
);
|
||||
let semantic = format!(
|
||||
"{thread_id}\0{source_actor_id}\0{prior_receipt_id}\0{prior_receipt_sha256}\0{result_id}\0{reason}\0{corrected_at}\0{expected_revision}"
|
||||
);
|
||||
let correction_id = format!(
|
||||
"supervisor-acceptance-correction-{:x}",
|
||||
Sha256::digest(semantic.as_bytes())
|
||||
);
|
||||
let mut next = current.clone();
|
||||
next.acceptance_receipts.remove(receipt_index);
|
||||
next.recent_evidence.insert(
|
||||
0,
|
||||
EpiphanyEvidenceRecord {
|
||||
id: correction_id.clone(),
|
||||
kind: "supervisor-runtime-repair".into(),
|
||||
status: "ok".into(),
|
||||
summary: format!(
|
||||
"Superseded routing effect of accepted Modeling receipt {prior_receipt_id} ({prior_receipt_sha256}) for result {result_id}; reason={reason}. Immutable result and admitted RepoModel remain evidence."
|
||||
),
|
||||
code_refs: Vec::new(),
|
||||
},
|
||||
);
|
||||
next.revision = next.revision.saturating_add(1);
|
||||
next.last_updated_turn_id = Some(correction_id.clone());
|
||||
let mut transaction = open_coordinator_state_transaction(store, ¤t)?;
|
||||
commit_coordinator_state_transaction(&mut transaction, thread_id, &next, Vec::new(), Vec::new())?;
|
||||
Ok(EpiphanySupervisorAcceptanceCorrectionReceipt {
|
||||
correction_id,
|
||||
thread_id: thread_id.to_string(),
|
||||
source_actor_id: source_actor_id.to_string(),
|
||||
prior_receipt_id: prior_receipt_id.to_string(),
|
||||
prior_receipt_sha256,
|
||||
result_id: result_id.to_string(),
|
||||
job_id: prior.job_id,
|
||||
binding_id: prior.binding_id,
|
||||
role_id: prior.role_id,
|
||||
reason: reason.to_string(),
|
||||
corrected_at: corrected_at.to_string(),
|
||||
prior_revision: current.revision,
|
||||
corrected_revision: next.revision,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn read_coordinator_state(store: &Path) -> Result<Option<EpiphanyThreadState>> {
|
||||
read_accepted_coordinator_state(store)
|
||||
}
|
||||
|
|
@ -317,70 +197,4 @@ mod tests {
|
|||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn supervisor_correction_removes_only_legacy_modeling_routing_authority() -> Result<()> {
|
||||
let temp = tempfile::tempdir()?;
|
||||
let store = temp.path().join("supervisor-correction.cc");
|
||||
let accepted = epiphany_state_model::EpiphanyAcceptanceReceipt {
|
||||
id: "accept-modeling-legacy".into(),
|
||||
result_id: "result-modeling-legacy".into(),
|
||||
job_id: "job-modeling-legacy".into(),
|
||||
binding_id: "epiphany-role-modeling".into(),
|
||||
surface: "roleAccept".into(),
|
||||
role_id: "modeling".into(),
|
||||
status: "accepted".into(),
|
||||
accepted_at: "2026-08-08T15:00:00Z".into(),
|
||||
summary: Some("Legacy result omitted its now-required frontier.".into()),
|
||||
..Default::default()
|
||||
};
|
||||
let seeded = apply_coordinator_state_update(
|
||||
&store,
|
||||
"thread-repair",
|
||||
EpiphanyStateUpdate {
|
||||
expected_revision: Some(0),
|
||||
objective: Some("Preserve the admitted Body map.".into()),
|
||||
acceptance_receipts: vec![accepted.clone()],
|
||||
..Default::default()
|
||||
},
|
||||
None,
|
||||
)?;
|
||||
let before_hostile = std::fs::read(&store)?;
|
||||
assert!(
|
||||
apply_supervisor_modeling_acceptance_correction(
|
||||
&store,
|
||||
"thread-repair",
|
||||
seeded.revision,
|
||||
&accepted.id,
|
||||
&accepted.result_id,
|
||||
"operator-enginseer",
|
||||
"invent-a-frontier",
|
||||
"2026-08-08T15:01:00Z",
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
assert_eq!(std::fs::read(&store)?, before_hostile);
|
||||
|
||||
let correction = apply_supervisor_modeling_acceptance_correction(
|
||||
&store,
|
||||
"thread-repair",
|
||||
seeded.revision,
|
||||
&accepted.id,
|
||||
&accepted.result_id,
|
||||
"operator-enginseer",
|
||||
SUPERVISOR_MODELING_ACCEPTANCE_CORRECTION_REASON,
|
||||
"2026-08-08T15:01:00Z",
|
||||
)?;
|
||||
let repaired = read_coordinator_state(&store)?.expect("repaired state");
|
||||
assert_eq!(correction.corrected_revision, seeded.revision + 1);
|
||||
assert!(repaired.acceptance_receipts.is_empty());
|
||||
assert_eq!(repaired.objective.as_deref(), seeded.state.objective.as_deref());
|
||||
assert_eq!(repaired.recent_evidence[0].id, correction.correction_id);
|
||||
assert!(
|
||||
repaired.recent_evidence[0]
|
||||
.summary
|
||||
.contains(&correction.prior_receipt_sha256)
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,12 +249,9 @@ pub use coordinator_results::read_runtime_reorient_result;
|
|||
pub use coordinator_results::read_runtime_role_result;
|
||||
pub use coordinator_service::EpiphanyCoordinatorService;
|
||||
pub use coordinator_state::EpiphanyCoordinatorStateApplied;
|
||||
pub use coordinator_state::EpiphanySupervisorAcceptanceCorrectionReceipt;
|
||||
pub use coordinator_state::SUPERVISOR_MODELING_ACCEPTANCE_CORRECTION_REASON;
|
||||
pub use coordinator_state::apply_coordinator_state_update;
|
||||
pub use coordinator_state::apply_coordinator_state_update_from_state;
|
||||
pub use coordinator_state::apply_coordinator_state_update_to_state;
|
||||
pub use coordinator_state::apply_supervisor_modeling_acceptance_correction;
|
||||
pub use coordinator_state::read_coordinator_state;
|
||||
pub use cultcache_rs::CacheBackingStore;
|
||||
pub use cultcache_rs::CultCache;
|
||||
|
|
|
|||
|
|
@ -4579,3 +4579,24 @@ transaction are still live production authorities. The new view does not read,
|
|||
translate, mirror, or migrate that aggregate. Concrete admission owners must
|
||||
move to keyed mutations, after which the aggregate schema and writer are
|
||||
deleted and old writable stores are refused.
|
||||
|
||||
### First live cut: operator objective
|
||||
|
||||
Exact `bd5034cd` makes `Self.user_objective_intake` the first migrated owner.
|
||||
Its inputs are one typed operator intake and the initialized Mind epoch. Its
|
||||
outputs are the semantic objective document, immutable intake, and Mind commit
|
||||
receipt written in one exact-envelope CAS. Receipt authority is a closed choice
|
||||
between a model decision context and typed operator provenance; operator action
|
||||
cannot impersonate model reasoning.
|
||||
|
||||
`thread_id` is no longer an objective owner; it remains intake provenance.
|
||||
Global revision and `EpiphanyThreadStateEntry` are absent from this path, and
|
||||
the operator-facing event reports the Mind projection digest and commit receipt.
|
||||
Exact replay recovers the same receipt. Objective replacement and split
|
||||
intake/objective state refuse without mutation.
|
||||
|
||||
The aggregate-only supervisor Modeling-acceptance correction is deleted rather
|
||||
than translated. It existed to repair receipt-shaped routing authority;
|
||||
unresolved typed state must own routing instead. Its commands and exported
|
||||
writer are gone. The remaining frontier execution inspector/amendment tool is
|
||||
named `epiphany-frontier-execution`, matching its actual authority.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ Updated: 2026-08-14
|
|||
|
||||
The five-day shakedown remains paused for architectural consolidation. The
|
||||
latest behavior cut is clean and pushed on `codex/epiphany-shakedown-live`
|
||||
through exact `71505941`.
|
||||
through exact `bd5034cd`.
|
||||
|
||||
The active campaign is now the hard Decision-Auditable Concurrent Mind
|
||||
migration. Its first foundation is implemented locally: typed content-addressed
|
||||
|
|
@ -32,6 +32,15 @@ runtime/Mind epoch identity, and a mutation gate that rejects non-Mind envelopes
|
|||
or semantic key drift. The old aggregate Mind owner and keyed RepoModel remain
|
||||
to be cut; the keyed view does not read or translate the aggregate.
|
||||
|
||||
Exact `bd5034cd` is the first live authority cut. Operator objective intake now
|
||||
atomically writes one semantic objective document, its immutable typed operator
|
||||
provenance, and one Mind commit receipt. It writes no thread-state aggregate;
|
||||
thread identity is provenance, and replacement refuses without changing store
|
||||
bytes. The commit authority is explicitly model context or operator provenance,
|
||||
so operator decisions do not counterfeit model reasoning. The aggregate-only
|
||||
Modeling acceptance repair writer and commands are deleted; frontier execution
|
||||
inspection/amendment remains under a truthfully named binary.
|
||||
|
||||
Operational correction: the original c011 resident and Heartbeat containers
|
||||
are not alive; both exited 255 on 2026-08-11. Their named volumes are quiescent
|
||||
and remain untouched. Historical c011 zero-zombie and organ-circuit evidence is
|
||||
|
|
@ -145,7 +154,7 @@ unchanged; the lifecycle authorities above remain separate.
|
|||
|
||||
## Immediate next action
|
||||
|
||||
Migrate concrete objective, focus/mode, subgoal/invariant, evidence/observation,
|
||||
Migrate concrete focus/mode, subgoal/invariant, evidence/observation,
|
||||
checkpoint, and planning admission owners from `EpiphanyThreadStateEntry` to
|
||||
their keyed documents. Delete the aggregate transaction, reader, and schema
|
||||
before enabling old writable-store refusal; do not translate or dual-read it.
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ current_status:
|
|||
yggdrasil_epiphany_service_contract: repaired_in_gamecult_ops_812b427_not_installed
|
||||
resident_physiology: historical_c011_exact_465af24d_zero_zombie_proof_accepted_current_containers_exited_255
|
||||
unresolved_authority: Coordinator receipt, Heartbeat pulse-artifact, genuine-idle and active resource plateaus, exact-grant terminality, restart-persistent cooldown refusal, schedule/action issuance cardinality, runtime-owned typed fulfillment, all three packaged fulfilled-before-receipt lanes, genuine packaged Imagination option generation, narrow model-generation retention, published model-turn JSON ingress, semantic logical/physical retention, Persona conversation retention, stable Starfire firewall ownership, completed model-adapter session archival, normal coordinator lifecycle opening/error closure/legacy repair/archival, co-resident resident lifecycle retention, authenticated outer-worker attempt retention, deployed supervisor/projector journald ownership, Docker named-volume atomic snapshot visibility, deterministic incremental release construction, and canonical-brake refusal of direct daemon lifecycle actuation are accepted. Starfire's Docker Desktop F: bind is rejected for mutable authority after an exact packaged lockless reader observed an empty published snapshot during writer interruption. Historical migrated semantic attempts without recorded physical namespace remain durable and non-retirable. One completed Discord consequence remains blocked by the absent Yggdrasil credential. Exact aa841873 also makes legacy coordinator repair one full-snapshot transaction so a later hostile family cannot leave an earlier partial repair.
|
||||
next_action: Complete the hard Decision-Auditable Concurrent Mind cut. Exact ee3d82c0 closes provider-error and timeout failures against the exact in-process request that reached provider admission without a persisted latest-request head. Exact 71505941 adds the keyed Mind schema family, deterministic EpiphanyMindView, atomic runtime/Mind epoch identity, semantic key validation, and a Mind mutation gate that accepts only canonical Mind envelopes; 690 core tests pass with one ignored helper and all 42 OpenAI runtime targets pass. The old EpiphanyThreadStateEntry and coordinator aggregate transaction remain live and are not a compatibility source for the new view. Next migrate concrete objective/focus/mode and collection admission owners to keyed writes, then delete the aggregate writer/reader before enabling old-store refusal. RepoModel split follows the same hard-cut discipline. No migrator or dual-read path; historical stores remain read-only.
|
||||
next_action: Complete the hard Decision-Auditable Concurrent Mind cut. Exact bd5034cd moves first operator objective intake onto one keyed Mind objective plus an immutable typed operator-provenance commit receipt; thread identity is provenance, the path writes no EpiphanyThreadStateEntry, and hostile replacement is byte-identical refusal. Model and operator commits share the exact-envelope CAS primitive without operator actions impersonating model reasoning. The aggregate transaction remains live for launch, acceptance, interrupt, and legacy generic updates. The aggregate-only Modeling acceptance repair command and writer are deleted; its remaining frontier execution functions are named by their actual authority. Next migrate focus/mode and collection admission owners, then launch and acceptance, before deleting the aggregate reader/writer and enabling old-store refusal. RepoModel split follows. No migrator or dual-read path; historical stores remain read-only.
|
||||
|
||||
active_subgoals:
|
||||
- Prove Persona, Self, Eyes, Modeling, Imagination, Hands, Soul, Mind, Continuity, and nervous-system behavior individually.
|
||||
|
|
|
|||
Reference in a new issue