Production persistence

production persistence

Email queue

Emails do not expose the question and have a retry path.

The persistence layer turns OmenHall from polished halls into a service where purchase, scroll, email, archive, and deletion have a verifiable trail.

What is stored

Only what is needed for delivery, archive, support, accounting, and user control.

  • sealed record
  • consent
  • delivery status
  • artifact keys
  • audit event

What is not stored

Do not put everything into the database just because it looks useful in analytics.

  • raw secrets
  • keys
  • full public previews
  • medical/legal claims
  • unnecessary third-party data

Operator meaning

If a customer loses an email, Stripe sends a duplicate webhook, or a user requests deletion, the owner has an action route.

  • check event
  • find delivery job
  • do not reveal extra data
  • resend safely
  • record outcome

Tables

public.reading_records

Sealed readings

The primary record for question, sealed input, payment status, and result.

public.oracle_artifacts

Oracle artifacts

PDF, share-card, gift artifact, and print-view as separate deliverable entities.

public.delivery_jobs

Delivery jobs

Email, PDF, gift, receipt, Echo, and recovery are sent as tracked jobs.

public.omen_consents

Consent and privacy

A separate ledger for archive, email, Echo, Passport, public share, and gift consent.

public.echo_threads

Echo threads

Returns to scrolls without a new reading: cadence, prompts, next return, and archive tags.

Risk rules

Missing consent

Do not write to Passport, email, or public share without explicit consent.

Public/private leak

Share-card receives safe fields only; full question remains private.

Lost delivery

Delivery jobs have attempts, status, next_run_at, and support path.

Duplicate payment

Stripe event id and checkout session id have unique indexes.

Orphan artifact

artifact may reference reading_record, council_session, or gift key and must have status.

Unsafe retention

Echo and email do not pressure with fear or sell a repeat question as salvation.

No deletion path

There is data_deletion_requests with scope, verification, status, and retention note.

Related