Consume recovery before current claim work

This commit is contained in:
Meta Vens 2026-07-19 04:21:20 +01:00
commit 9e1fa0f527
3 changed files with 40 additions and 14 deletions

View file

@ -1,7 +1,6 @@
use crate::repository_body_observer::RepositoryBodyReadSession;
use crate::semantic_backend::{OllamaConfig, OllamaEmbedder, QdrantBackend, QdrantConfig};
use crate::workspace_coverage_process_documents::{
authenticate_current_workspace_coverage_claim_sight,
authenticate_workspace_coverage_recovery_directive, publish_workspace_coverage_claim_sight,
publish_workspace_coverage_terminal_sight,
};
@ -221,23 +220,13 @@ impl WorkspaceCoverageProjectorServiceBody {
let authority = self.execution_authority.as_ref().ok_or_else(|| {
anyhow!("workspace coverage projector has no installed execution authority")
})?;
let has_successor_sight = authenticate_current_workspace_coverage_claim_sight(
if let Some(directive) = authenticate_workspace_coverage_recovery_directive(
&authority.local_verse_store,
&self.runtime_store,
&authority.runtime_id,
&self.managed_process_launch_id,
&authority.trusted_host,
)?
.is_some_and(|sight| {
sight.launch_id == self.managed_process_launch_id && sight.recovery_receipt_id.is_some()
});
if !has_successor_sight
&& let Some(directive) = authenticate_workspace_coverage_recovery_directive(
&authority.local_verse_store,
&self.runtime_store,
&authority.runtime_id,
&self.managed_process_launch_id,
&authority.trusted_host,
)?
{
let basis = load_current_runtime_repository_body_basis(&self.runtime_store)?;
if directive.workspace_id != basis.workspace_id
@ -426,6 +415,25 @@ mod tests {
assert!(value.validate().is_err());
}
#[test]
fn recovery_directive_is_consumed_before_normal_projection_work() {
let source = include_str!("workspace_coverage_projector_service.rs");
let start = source.find("fn pulse_inner(&mut self)").unwrap();
let tail = &source[start..];
let body = &tail[..tail.find("\n#[cfg(test)]").unwrap()];
let directive = body
.find("authenticate_workspace_coverage_recovery_directive")
.unwrap();
let recovery = body
.find("recover_workspace_coverage_projection_with_authority")
.unwrap();
let normal = body
.find("retire_workspace_coverage_collections")
.unwrap();
assert!(directive < recovery && recovery < normal);
assert!(!body.contains("authenticate_current_workspace_coverage_claim_sight"));
}
#[test]
fn constructor_requires_lifecycle_identity_before_touching_runtime() {
assert!(

View file

@ -2901,3 +2901,20 @@ the actual lineage error instead of collapsing it into a generic mismatch.
The causal test now includes an intermediate failed-deployment generation and
passes the complete recovery transaction. Full library passes 573/573 with one
ignored; supervisor authority tests pass 24/24.
Candidate `a70fe275195740ecefc2984b32ebd8ae93658c18` crossed the lineage gate and
supervisor published recovery directive `06165fb6-97bd-4c27-97e3-38af03dec72d`
from historical claim `c6df4335-7080-4d5f-80fc-4fa18a9d16ce` to current launch
`9414c32f-f53c-450c-bc19-a69f5ba04a29`. The projector still refused every
pulse because it authenticated current successor claim sight before consuming
the directive that creates that successor. Supervisor replayed the exact
directive safely, revealing a circular ordering fault rather than missing
evidence. The candidate was rolled back and revoked; no deployment witness
exists.
Projector pulse now authenticates and consumes a replacement-addressed recovery
directive before retirement or ordinary projection work. The atomic recovery
transaction is already exact-replay idempotent, so no speculative current-claim
query is needed in front of it. Current claim sight is recovery output, not
recovery input. A source-order test makes the authority ordering explicit. Full
library passes 574/574 with one ignored; supervisor authority tests pass 24/24.

View file

@ -795,4 +795,5 @@ current_status:
- 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.
- 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.
- Candidate `351355d3baee2d475f84168136380d2f50197ef8` authenticated the historical claim and started all three owners under the brake, but recovery refused because the claim named an older launch than the current replacement's direct parent. Repeated failed candidate deployments had formed a valid signed replacement chain, while recovery still assumed one direct old-to-new edge. The exact Idunn process group was terminated, all services stopped, active pointer and witness removed, and Bifrost authority revoked. No deployment witness exists. Recovery now authenticates the complete immutable chain from the claim's historical launch to the live current-policy descendant: every intermediate launch is host-signed, every parent termination id and envelope digest is exact, chronology is ordered, cycles and broken edges refuse, and the selected endpoint must be current. Directive writing, receipt verification, atomic lease transfer, and supervisor resume share this proof. Typed refusal now exposes the exact lineage fault instead of swallowing it. The causal recovery test contains a real intermediate generation and still proves the full fenced transaction. Full library passes 573/573 with one ignored; supervisor authority tests pass 24/24.
next_action: "Commit and push authenticated multi-generation workspace recovery, authorize the exact successor through Bifrost, and let Idunn redeploy under the engaged sleep brake. Require the historical claim to transfer across every signed replacement edge to the current ready projector, followed by advancing authoritative coverage, 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 `a70fe275195740ecefc2984b32ebd8ae93658c18` proved the full signed multi-generation chain and emitted recovery directive `06165fb6-97bd-4c27-97e3-38af03dec72d` from historical claim `c6df4335-7080-4d5f-80fc-4fa18a9d16ce` to current launch `9414c32f-f53c-450c-bc19-a69f5ba04a29`. The replacement projector nevertheless kept refusing stale-policy claim sight because its pulse authenticated the not-yet-created current successor claim before looking for the recovery directive. Supervisor replayed the same directive without mutating Body, exposing a circular ordering fault. The exact Idunn process group was terminated, services stopped, pointer and witness removed, and Bifrost authority revoked; no deployment witness exists. Projector recovery directive consumption now precedes all ordinary projection work and invokes the already idempotent atomic transfer directly. Current claim sight is an output of recovery, never a prerequisite for it. Full library now passes 574/574 with one ignored; supervisor authority tests pass 24/24.
next_action: "Commit and push projector-first directive consumption, authorize the exact successor through Bifrost, and let Idunn redeploy under the engaged sleep brake. Require directive consumption to mint the exact current successor claim and recovery receipt, followed by advancing authoritative coverage, 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."