Skip to main content

reset_is_scoped_to_one_projection

Function reset_is_scoped_to_one_projection 

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

A reset moves exactly one (store, ProjectionId) pair.

PS-17, [FROZEN], and it is ADR-0007’s per-(store, ProjectionId) checkpoint applied to the operation that removes one. Kestrel Cold Chain’s one projection store holds van_stock, rebuilt several times a day across 138 devices, and fgas_ledger, a hash chain a regulator already holds (spec/E2E-CASES.md:482-497).

Rejects: TruncatingResetStore — a SqliteProjectionStore::reset() that truncates the checkpoint table. Cheap, obvious, and it destroys the append-only ledger sharing the file. SingleRowCheckpointStore fails it too, at the same assertion: one checkpoint row shared by every projection is the same disaster reached by a different route, and its registry row says so.

§Why the reset batch is empty, and why that is the sharp version

ProjectionProbe::probe_delete_all queues removal of every probe row — the whole read model, because the port has no idea which rows belong to which projection and PS-11’s seam deliberately does not teach it. A rule that reset one id with a probe_delete_all batch would therefore delete the sibling’s rows by the caller’s own instruction, and would fail the oracle for something PS-17 does not constrain.

Handing reset an empty batch is what makes the claim attributable: the caller asked for no deletes, so every row that disappears and every checkpoint other than this one that moves is the store’s own doing.

The assertion that the reset id’s checkpoint did return to NeverRun is this rule’s non-vacuity anchor — the same role the second row plays in dropped_batch_leaves_store_usable. Without it a reset that did nothing whatever would pass a rule about scoping.