Separate current claim from recovery evidence

This commit is contained in:
Meta Vens 2026-07-19 03:28:51 +01:00
commit 351355d3ba
6 changed files with 130 additions and 12 deletions

View file

@ -58,8 +58,8 @@ use epiphany_core::{
ProcessInstanceIdentity, ProcessInstanceObservation,
WORKSPACE_COVERAGE_PROCESS_LAUNCH_SCHEMA_VERSION, WorkspaceCoverageManagedProcessLaunchEntry,
WorkspaceCoverageProcessBootstrap, WorkspaceCoverageProcessLifecycleObservation,
authenticate_current_workspace_coverage_claim_sight,
authenticate_historical_workspace_coverage_managed_process_launch,
authenticate_recovery_workspace_coverage_claim_sight,
authenticate_workspace_coverage_managed_process_launch,
authenticate_workspace_coverage_provider_heartbeat,
authenticate_workspace_coverage_termination_with_envelope_digest, capture_process_instance,
@ -2439,7 +2439,7 @@ fn reconcile_workspace_coverage_projector(
)?;
return Ok(());
}
let target = match authenticate_current_workspace_coverage_claim_sight(
let target = match authenticate_recovery_workspace_coverage_claim_sight(
&args.store,
&runtime_store,
&args.runtime_id,
@ -2672,7 +2672,7 @@ fn reconcile_workspace_coverage_projector(
// Claim acquisition may race the first reconciliation observation. The
// terminal proof is the cut: authenticate Body sight again after it, and
// use only this post-terminal target for replacement/recovery authority.
let post_terminal_target = match authenticate_current_workspace_coverage_claim_sight(
let post_terminal_target = match authenticate_recovery_workspace_coverage_claim_sight(
&args.store,
&runtime_store,
&args.runtime_id,
@ -4417,7 +4417,7 @@ mod semantic_projector_authority_tests {
.unwrap();
let stale_rotation = body.find("if !current_policy_matches_latest").unwrap();
let claim_sight = body
.find("let target = match authenticate_current_workspace_coverage_claim_sight")
.find("let target = match authenticate_recovery_workspace_coverage_claim_sight")
.unwrap();
assert!(latest < stale_rotation && stale_rotation < claim_sight);
let observation = body
@ -4476,7 +4476,7 @@ mod semantic_projector_authority_tests {
.rfind("authenticate_workspace_coverage_termination_with_envelope_digest")
.unwrap();
let post_auth = body
.find("let post_terminal_target = match authenticate_current_workspace_coverage_claim_sight")
.find("let post_terminal_target = match authenticate_recovery_workspace_coverage_claim_sight")
.unwrap();
let replacement_selection = body.find("let existing_replacement =").unwrap();
let post_target = body

View file

@ -1242,6 +1242,7 @@ pub use workspace_coverage_process_documents::{
authenticate_current_workspace_coverage_claim_sight,
authenticate_current_workspace_coverage_terminal_sight,
authenticate_historical_workspace_coverage_managed_process_launch,
authenticate_recovery_workspace_coverage_claim_sight,
authenticate_workspace_coverage_managed_process_launch,
authenticate_workspace_coverage_process_termination_observation,
authenticate_workspace_coverage_provider_heartbeat,

View file

@ -1213,6 +1213,26 @@ pub(crate) fn authenticate_workspace_coverage_managed_process_launch_with_envelo
Ok((launch, envelope_digest(&envelope)))
}
pub(crate) fn authenticate_historical_workspace_coverage_managed_process_launch_with_envelope_digest(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
launch_id: &str,
host_identity: &HostIncarnationIdentityEntry,
) -> Result<(WorkspaceCoverageManagedProcessLaunchEntry, String)> {
let runtime_id = runtime_id.into();
let launch = authenticate_historical_workspace_coverage_managed_process_launch(
store_path.as_ref(),
runtime_id.clone(),
launch_id,
host_identity,
)?;
let envelope = open_epiphany_cultmesh_node(store_path, runtime_id)?
.cache()
.get_envelope::<WorkspaceCoverageManagedProcessLaunchEntry>(&launch_key(launch_id))?
.ok_or_else(|| anyhow!("historical workspace coverage launch envelope disappeared"))?;
Ok((launch, envelope_digest(&envelope)))
}
pub fn observe_workspace_coverage_managed_process(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
@ -2085,6 +2105,37 @@ pub fn authenticate_current_workspace_coverage_claim_sight(
runtime_store: impl AsRef<Path>,
runtime_id: &str,
trusted_host: &HostIncarnationIdentityEntry,
) -> Result<Option<WorkspaceCoverageClaimSightEntry>> {
authenticate_workspace_coverage_claim_sight(
local_verse_store,
runtime_store,
runtime_id,
trusted_host,
true,
)
}
pub fn authenticate_recovery_workspace_coverage_claim_sight(
local_verse_store: impl AsRef<Path>,
runtime_store: impl AsRef<Path>,
runtime_id: &str,
trusted_host: &HostIncarnationIdentityEntry,
) -> Result<Option<WorkspaceCoverageClaimSightEntry>> {
authenticate_workspace_coverage_claim_sight(
local_verse_store,
runtime_store,
runtime_id,
trusted_host,
false,
)
}
fn authenticate_workspace_coverage_claim_sight(
local_verse_store: impl AsRef<Path>,
runtime_store: impl AsRef<Path>,
runtime_id: &str,
trusted_host: &HostIncarnationIdentityEntry,
require_current_policy: bool,
) -> Result<Option<WorkspaceCoverageClaimSightEntry>> {
let runtime_store = runtime_store.as_ref();
let basis = crate::load_current_runtime_repository_body_basis(runtime_store)?;
@ -2114,13 +2165,28 @@ pub fn authenticate_current_workspace_coverage_claim_sight(
}
let entry: WorkspaceCoverageClaimSightEntry = rmp_serde::from_slice(&env.payload)?;
authenticate_workspace_coverage_claim_sight_entry(&entry)?;
let (launch, digest) =
let (launch, digest) = if require_current_policy {
authenticate_workspace_coverage_managed_process_launch_with_envelope_digest(
local_verse_store.as_ref(),
runtime_id,
&entry.launch_id,
trusted_host,
)?
} else {
let launch = authenticate_historical_workspace_coverage_managed_process_launch(
local_verse_store.as_ref(),
runtime_id,
&entry.launch_id,
trusted_host,
)?;
let envelope = node
.cache()
.get_envelope::<WorkspaceCoverageManagedProcessLaunchEntry>(&launch_key(
&entry.launch_id,
))?
.ok_or_else(|| anyhow!("historical claim launch envelope disappeared"))?;
(launch, envelope_digest(&envelope))
};
if entry.runtime_id != runtime_id
|| entry.launch_envelope_digest != digest
|| entry.provider_incarnation_id != launch.provider_incarnation_id
@ -2165,7 +2231,7 @@ pub fn write_workspace_coverage_recovery_directive(
) -> Result<WorkspaceCoverageRecoveryDirectiveEntry> {
let local_verse_store = local_verse_store.as_ref();
let runtime_store = runtime_store.as_ref();
let authenticated = authenticate_current_workspace_coverage_claim_sight(
let authenticated = authenticate_recovery_workspace_coverage_claim_sight(
local_verse_store,
runtime_store,
runtime_id,
@ -4260,6 +4326,35 @@ mod tests {
.is_some()
);
let mut rotated_policy = policy()?;
rotated_policy.updated_at_utc = "2026-07-17T00:00:01Z".into();
write_epiphany_cultmesh_workspace_coverage_projector_service_policy(
&verse,
"local",
rotated_policy,
)?;
assert!(
authenticate_current_workspace_coverage_claim_sight(
&verse,
&runtime,
"local",
host.entry(),
)
.expect_err("ordinary provider work must reject a stale-policy claim")
.to_string()
.contains("current managed policy")
);
assert!(
authenticate_recovery_workspace_coverage_claim_sight(
&verse,
&runtime,
"local",
host.entry(),
)?
.is_some(),
"recovery must preserve the old signed claim/body lineage"
);
let source = FakeObservation {
boot: Some(old_launch.boot_identity.clone()),
process: ProcessInstanceObservation::Missing,
@ -4435,7 +4530,7 @@ mod tests {
&verse,
&runtime,
"local",
&authenticate_current_workspace_coverage_claim_sight(
&authenticate_recovery_workspace_coverage_claim_sight(
&verse,
&runtime,
"local",
@ -4456,7 +4551,7 @@ mod tests {
)?
.is_some()
);
let mut conflicting_lineage = authenticate_current_workspace_coverage_claim_sight(
let mut conflicting_lineage = authenticate_recovery_workspace_coverage_claim_sight(
&verse,
&runtime,
"local",
@ -4499,7 +4594,7 @@ mod tests {
&verse,
&runtime,
"local",
&authenticate_current_workspace_coverage_claim_sight(
&authenticate_recovery_workspace_coverage_claim_sight(
&verse,
&runtime,
"local",

View file

@ -32,6 +32,7 @@ use crate::{
runtime_repository_body_store_binding, validate_workspace_coverage_head,
validate_workspace_coverage_projection_plan, workspace_coverage_execution_collection,
workspace_coverage_process_documents::{
authenticate_historical_workspace_coverage_managed_process_launch_with_envelope_digest,
authenticate_workspace_coverage_managed_process_launch_with_envelope_digest,
authenticate_workspace_coverage_provider_heartbeat_with_envelope_digest,
authenticate_workspace_coverage_termination_with_envelope_digest,
@ -2119,7 +2120,7 @@ pub(crate) fn recover_workspace_coverage_projection_with_authority(
}
let cultmesh_store = cultmesh_store.as_ref();
let (old_launch, _) =
authenticate_workspace_coverage_managed_process_launch_with_envelope_digest(
authenticate_historical_workspace_coverage_managed_process_launch_with_envelope_digest(
cultmesh_store,
runtime_id,
old_launch_id,

View file

@ -2860,3 +2860,23 @@ exists. Reconciliation now loads latest launch and completes stale-policy
rotation before current claim authentication. Provider claim state participates
only after a current-policy launch exists. Supervisor proof passes 24/24 and
full core remains 573/573 with one ignored.
Candidate `b8517d9d7905eb62314db675cc2f0688510aa5bd` then crossed the first two
rotation cuts: supervisor PID `1147968` launched replacement workspace
projector PID `1148157`, and the replacement published advancing ready
heartbeats under the new policy while the brake held. Recovery still stalled
because the old Body claim was readable only through current-claim
authentication, which correctly rejected its historical launch before the
mismatch branch could issue a recovery directive. The candidate was rolled
back and revoked; no deployment witness exists.
Claim sight now has separate current and recovery readers. Current
authentication remains mandatory for provider projection work and refuses a
stale launch. Recovery authentication proves only the old signed
claim/Body/route lineage. Supervisor recovery and directive writing use that
historical reader, while the replacement launch and ready heartbeat remain
bound to the current policy. The atomic lease-transfer path also authenticates
the old launch historically. The full causal test now performs real policy
rotation and proves current refusal, historical recovery, directive fencing,
lease transfer, successor current sight, exact replay, and tamper refusal. Full
core passes 573/573 with one ignored; all binaries compile.

View file

@ -793,4 +793,5 @@ current_status:
- Candidate `2d4c92d24c2007858914d352b5892f599e6a20e9` sealed immutable release `sha256-1dd1271405e82958df2c03133b0d89d2555a8a3c7013486e1c41465ec84f6b3c` with witness `sha256-e01803545e557488cf2a0a42c31bb65e17ff7ead21790d7c982216901d94e12b`. Generation-parent sealing and resident mixed-store ownership both held: all three services started, Heartbeat remained `braked-after-ack-reconciliation`, and resident Self remained stably `braked`. Deployment still failed honestly because the prior workspace-coverage launch was authenticated only against the newly written current policy. Release rotation therefore made signed historical launch evidence impossible to observe, terminalize, or replace. The transaction was rolled back, its Bifrost authority revoked, services stopped, active pointer removed, and no deployment witness exists.
- Workspace-coverage process authority now separates history from admission. A stored host-signed launch remains authentic historical identity after managed-policy rotation and may authorize only exact process observation and immutable termination evidence. Its termination binds the launch's signed policy id/digest and CAS-fences the exact launch/evidence head; it no longer pretends the current policy authored history. Reconciliation detects a stale-policy latest launch, terminates only its exact live process identity or records terminal sight, then launches a replacement bound to the exact current policy and historical termination. Current public observation still rejects stale launches, and only a current-policy launch can run. Full core proof passes 573/573 with one ignored; all binaries compile.
- Candidate `b5405beaa95cddc837f3b7a7ca268ac9b5ae4502` built and started all three services, proving the historical authenticator itself shipped, but still produced `workspace coverage launch disagrees with current managed policy`. The stale-policy branch was unreachable because reconciliation authenticated provider claim sight before loading supervisor-owned latest launch, and claim authentication correctly rejected the stale policy. The candidate was rolled back, authority revoked, active pointer removed, and no deployment witness exists. Reconciliation now orders supervisor latest-launch sight and stale-policy rotation before current provider claim authentication. Provider claim state cannot veto retirement of obsolete supervisor process lineage; it participates only after a current-policy launch exists. Supervisor tests pass 24/24 and full core remains 573/573 with one ignored.
next_action: "Commit and push the corrected reconciliation order, authorize the exact successor through Bifrost, and let Idunn redeploy under the engaged sleep brake. Require stale launch terminalization without evidence deletion, a replacement workspace projector bound to the new policy, immutable package inspection, app-owned release publication, three healthy local service owners, signed aggregate health, and the final deployment.env witness. Then run the Starfire-offline rehearsal before 2026-07-22: persistent Modeling map -> autonomous bounded Imagination proposal, with classified organization feedback through Persona as an additional pressure path; explicit Mind adoption -> Hands consequence -> Bifrost release -> Idunn deployment remain separate gates. Prove replay/tamper refusal and that conversation alone grants no Mind, Hands, Persona-speech, release, or deployment authority. No host reboot is authorized."
- Candidate `b8517d9d7905eb62314db675cc2f0688510aa5bd` proved stale launch terminalization and current-policy replacement launch: supervisor PID `1147968` launched replacement workspace projector PID `1148157`, whose authenticated ready heartbeat advanced while the engaged brake held. Recovery still stalled because the old Body claim could be read only through current-claim authentication, which correctly rejected its historical policy before the mismatch recovery branch. The candidate was rolled back and revoked; no deployment witness exists. Claim sight now has two explicit authorities: current authentication is required for provider projection work and rejects stale launches; recovery authentication proves the old signed claim/body/route lineage only. Supervisor recovery and directive writing use the recovery reader, while old launch authentication inside the atomic lease-transfer transaction is historical and the replacement launch/heartbeat remain current-policy evidence. The full causal test performs an actual policy rotation and proves current refusal, historical recovery, directive fencing, lease transfer, successor current sight, and replay/tamper boundaries. Full core passes 573/573 with one ignored; all binaries compile.
next_action: "Commit and push the current-claim/recovery-claim authority split, authorize the exact successor through Bifrost, and let Idunn redeploy under the engaged sleep brake. Require stale launch terminalization without evidence deletion, a ready replacement workspace projector bound to the new policy, a typed recovery directive and recovered current claim, immutable package inspection, app-owned release publication, three healthy local service owners, signed aggregate health, and the final deployment.env witness. Then run the Starfire-offline rehearsal before 2026-07-22: persistent Modeling map -> autonomous bounded Imagination proposal, with classified organization feedback through Persona as an additional pressure path; explicit Mind adoption -> Hands consequence -> Bifrost release -> Idunn deployment remain separate gates. Prove replay/tamper refusal and that conversation alone grants no Mind, Hands, Persona-speech, release, or deployment authority. No host reboot is authorized."