Audit Storage

Authoritative journal, encrypted evidence, checkpoints, and projections

Audit Storage and Integrity

KYA-OS separates preservation, evidence, transparency, and search. Combining them in one mutable JSON table makes independent verification and safe retention impossible.

Storage roles

StoreAuthorityRequired properties
Authoritative journalAccepted ledger historyExact canonical bytes, signed envelope, parsed event, atomic compare-and-append, unique logical event identity
Evidence storeSensitive payloadsCiphertext before append, digest and size verification, tenant-scoped key, retention class, legal hold, disposal evidence
Checkpoint storeMerkle commitmentsIdempotent checkpoint identity, previous checkpoint link, tree size, root, signature
Observation and anchor storeExternal viewsObserver continuity and supporting WORM, RFC 3161, or SCITT receipts
Projection storeSearch and UIRebuildable rows, projection version, source high-water, reconciliation status
Producer outboxDelivery durabilityFIFO source order, byte-stable retry, backoff, alarm recovery, dead-letter visibility

Atomic append

For each authenticated submission, the recorder:

  1. validates schema, producer authority, tenant authority, binding, and epoch;
  2. verifies encrypted evidence bytes against every referenced digest and size;
  3. resolves an identical retry or rejects divergent reuse of the event identity;
  4. reads the epoch head and builds the candidate entry;
  5. signs the canonical entry and receipt;
  6. compares and appends atomically, retrying bounded head conflicts;
  7. returns the complete signed entry only after durable commit.

One hundred concurrent appends must still produce a contiguous sequence and one predecessor per entry. No acknowledged append may disappear after process or database restart.

Evidence ordering

Evidence is encrypted by the producer or a trusted boundary before submission. The recorder stores and verifies ciphertext before committing an entry that references it. If evidence persistence fails, append fails. If append later fails, the recorder may dispose of uncommitted ciphertext only after confirming that no racing idempotent commit references it.

An EvidenceRef commits:

  • object identity;
  • ciphertext SHA-256 digest;
  • optional plaintext commitment;
  • media type and decimal-string byte size;
  • A256GCM key identifier, nonce, and associated-data digest.

Retention and disposal

Retention policy applies independently to journal entries, encrypted evidence, and disposable projections. Legal hold overrides ordinary disposal. When evidence is destroyed, emit evidence.disposed with the target reference and retain the ledger commitment so later verifiers can distinguish deliberate disposal from unexplained absence.

Recovery

Backups and replicas must preserve ledger ordering, canonical bytes, signatures, key policy, checkpoint state, evidence metadata, legal holds, and producer high-water state. Regularly rehearse:

  • restore into an isolated environment;
  • replay and verify every chain and checkpoint;
  • rebuild projections from the journal;
  • reconcile outbox and source high-water state;
  • prove that epoch and key transitions remain verifiable.

Never repair a damaged ledger by editing committed rows. Seal the affected epoch, document the incident, and start a successor epoch with an explicit transition.