Existing implementation
At 18e276590424593647cd7c39c6d16c2f9f8d6027, native/store/store_sealed.c::envid_derive binds plaintext digest and object/store metadata through keyed derivation. native/store/tests/store_sealed_test.c already tests repeated rollback/rewrite, identity changes, forged records, anchor crashes and rejection of version-1 records. Preserve these tests.
Part of https://github.com/aien-dev/omega-mv/issues/639. Related #32 owns TPM/external anti-rollback anchoring; #398 owns physical transport. Existing Store/crypto optimization owners retain their work.
Work
Extend the current host harness with independent fixture/oracle checks and targeted mutations rather than another store implementation:
- Store-only rollback, anchor-only rollback, torn writes and every relevant store/anchor commit boundary.
- Full store-plus-anchor rollback is a documented undetected case. Assert and label this limitation; never count successful mounting as proof of freshness.
- Identical object rewritten at the identical position remains deterministic; changed bytes or bound metadata change the derived identity/pair under the cryptographic assumptions.
- Verify envelope key/nonce derivation inputs independently of calling envid_derive again. Use published primitive vectors where relevant; maintain AES-GCM-SIV-specific expectations.
- Mutate removal of plaintext/metadata binding, restore the old predictable version-1 derivation, bypass version rejection, or remove anchor consistency checks; demonstrate the corresponding test catches each applicable mutant.
Acceptance
- Coverage matrix separates confidentiality under nonce misuse, authentication, replay, crash consistency and whole-image freshness.
- Independent expected fixtures, mutation outcomes and existing recovery suite results are reproducible from pinned source.
- Tests record exact key scope/object/chunk mapping using synthetic IDs; do not demand globally unique nonce bytes across unrelated keys.
- Crash/build/timeout outcomes cannot count as successful mutant detection.
- Explain the external trust anchor needed for whole-image freshness and link #32; no TPM implementation or new on-disk format is part of this ticket.
- Shared-gate adapter emits bounded receipts; no real disk rollback, live volume operation, key rotation or GPU work is required.
Finite collision-free samples are regressions, not proof of unconditional cryptographic uniqueness.