Stop letting terminal history and a missing brake refuse startup
validate_durable_authority read the deployment-brake operator anchor unconditionally and then re-proved every transaction in the store. Two consequences, both live until now: An absent brake artifact refused startup against an empty store. That is a deployment brake gating Idunn itself, which F:\Projects\CLAUDE.md forbids in as many words -- a target brake "may never gate Idunn itself or unrelated service lifecycle". The anchor is now read on demand, when a record actually carries an authorization to verify. Terminal transactions were re-proved on every boot. They describe what already happened and authorize nothing further, so the only thing that re-proving them can do is invent new ways for history to refuse a boot -- a rotated signer on a record from last week making the daemon unstartable. They are skipped. On yggdrasil that is 259 of 260 records, and this is what R4 meant by terminal history not being live authority. Live records keep every check unchanged. Known gap, deliberately not closed here: a live record whose signed evidence no longer verifies still refuses startup. The right answer is to abort that transaction rather than refuse the boot, which needs the post-fencing abort path and is its own cut. cargo test --locked -> test result: ok. 110 passed; 0 failed; 2 ignored Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
5b6a650482
commit
64cc78d748
1 changed files with 43 additions and 4 deletions
|
|
@ -2479,17 +2479,39 @@ impl Engine {
|
|||
}
|
||||
}
|
||||
|
||||
/// Re-prove the evidence that still gates a decision.
|
||||
///
|
||||
/// Terminal transactions are skipped: they describe what already happened
|
||||
/// and authorize nothing further, so re-proving them only creates ways for
|
||||
/// history to refuse a boot. On yggdrasil that is 259 of 260 records.
|
||||
///
|
||||
/// The operator anchor is read on demand rather than up front. Reading it
|
||||
/// unconditionally meant an absent brake artifact refused startup against
|
||||
/// an *empty* store -- a deployment brake gating Idunn itself, which
|
||||
/// `F:\Projects\CLAUDE.md` forbids outright: a target brake "may never gate
|
||||
/// Idunn itself or unrelated service lifecycle".
|
||||
fn validate_durable_authority(&self, snapshot: &ControlSnapshot) -> Result<()> {
|
||||
let operator_anchor = read_trust_anchor::<IdunnDeploymentBrakeOperatorIdentity>(
|
||||
&self.options.deployment_brake_operator_anchor,
|
||||
)?;
|
||||
let mut operator_anchor = None;
|
||||
for stored in &snapshot.transactions {
|
||||
let transaction = &stored.value;
|
||||
if transaction.is_terminal() {
|
||||
continue;
|
||||
}
|
||||
if let Some(authorization) = &transaction.deployment_authorization {
|
||||
authorization.validate_shape()?;
|
||||
let record: IdunnDeploymentBrakeRecord =
|
||||
rmp_serde::from_slice(&authorization.canonical_brake_bytes)?;
|
||||
verify_idunn_deployment_brake_authorization(&record, &operator_anchor)?;
|
||||
if operator_anchor.is_none() {
|
||||
operator_anchor = Some(read_trust_anchor::<
|
||||
IdunnDeploymentBrakeOperatorIdentity,
|
||||
>(
|
||||
&self.options.deployment_brake_operator_anchor
|
||||
)?);
|
||||
}
|
||||
verify_idunn_deployment_brake_authorization(
|
||||
&record,
|
||||
operator_anchor.as_ref().expect("read directly above"),
|
||||
)?;
|
||||
let expected = required(&transaction.expected, "authorized Expected projection")?;
|
||||
ensure!(
|
||||
record.authorized_release_id.as_deref()
|
||||
|
|
@ -6056,6 +6078,23 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_absent_brake_anchor_does_not_gate_an_empty_store() -> Result<()> {
|
||||
// `F:\Projects\CLAUDE.md`: a target brake "may never gate Idunn itself
|
||||
// or unrelated service lifecycle". Reading the operator anchor up front
|
||||
// meant a missing brake artifact refused startup against a store with
|
||||
// nothing in it -- the deployment authority held hostage by an artifact
|
||||
// describing one target's consent.
|
||||
let world = EngineFixture::new()?;
|
||||
assert!(
|
||||
!world.engine.options.deployment_brake_operator_anchor.exists(),
|
||||
"fixture must not have written a brake anchor"
|
||||
);
|
||||
let snapshot = ControlSnapshot::read(&world.state_store)?;
|
||||
world.engine.validate_durable_authority(&snapshot)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn one_unreadable_record_faults_its_tick_without_touching_the_store() -> Result<()> {
|
||||
let world = EngineFixture::new()?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue