Skip to main content

condition_over_removed_history_does_not_reject

Function condition_over_removed_history_does_not_reject 

pub async fn condition_over_removed_history_does_not_reject<F: Fixture>(
    open: impl AsyncFn() -> F,
) -> RuleOutcome
Expand description

ES-40 (ADR-0028, decision 2): a condition whose only matching event was removed outside the port admits the append, and a condition over an event the store still holds still refuses it.

§Why admission, and not ES-40’s MAY

The MAY is the caller’s reading: a caller must not rely on a refusal over history the store may have lost. On the store’s side, a refusal there names an event its own read does not yield and its own contains_event_id denies, which contradicts ES-38’s “every clause of this section with respect to the events it still holds” and is half a removal, the guard’s membership argument again. ADR-0028 rejects the fail-closed outcome for 1.x. So the rule asserts the vacuous pass as specified behaviour, and it has two readers: an adapter author reads it as what the store must do, and an ingest author reads it as the hazard E2E-47 describes, a condition that says nothing about events the log no longer has.

§The arrangement

Three registrations, and the interior one is removed, so survivors sit on both sides of the hole. That reaches both of CF-27’s evaluation paths, at or below the highest withheld position and above it, and a SQL store’s index range on either side of a gap. Before the removal the probe must be refused, so the pass after it is not vacuous by accident. The survivors are compared by content: positions are ES-38’s business, so a store that renumbered passes here and fails there.

The wrong implementations, each in tests/mutation_coverage/removed_history.rs:

  • RememberingConditionFixture is a soft delete whose condition path still sees what was removed: WithholdingStore without its condition rewrite.
  • FailClosedFixture refuses every condition once it knows it has been pruned, which is E2E-47’s third outcome spelled as ConditionViolated.
  • ConditionBlindFixture stops evaluating conditions once it has lost history, and admits an append over a survivor.

It stands on removal_outside_the_port_removes_exactly_the_named_events: a store the removal did not leave with exactly the survivors is refused, not judged.