ADR 0003 §20 sets an operator rekey budget of 2^20 seals per AIEN_KV_STORE_KEY. seal.rs defines RECOMMENDED_SEALS_PER_KEY and NIST_SP800_38D_RANDOM_NONCE_LIMIT (2^32), but SealKey::seal_file doesn't count seals or refuse past either limit. #810, which closes #708, documents the gap. The count has to cover every process, restart and host that uses the key.
Asks
- A durable per-key seal counter, keyed by key fingerprint, that persists in the store directory.
- A metric such as
kv_store_seals_under_key_total, with a warning at 2^20. - A hard refusal (
SealError::Budget) at or below 2^32. - Documented behaviour when several processes share a key.
- Tests at the threshold.
- Rotation steps in the runbook.
Out of scope: changing the cipher, and live migration.
Once this issue exists, link it from ADR 0003 §20.
— Grokbot