Skip to content

0007. Core invariants

  • Status: Accepted
  • Date: 2026-11-07

Customer.lite sends email and webhooks on behalf of many projects from shared infrastructure, driven by events that can arrive duplicated, late, or out of order, and by workflows that wait for days. The original product plan in the README, refined in the first agent rules, listed implementation considerations that every feature must respect. This ADR records them as invariants so that rules, skills, and tests can link to one place.

  1. Tenant isolation. Project boundaries are enforced consistently across APIs, data access, jobs, workflow runs, inbound and provider webhooks, and tracking.
  2. Idempotency. Duplicate events, duplicate webhooks, and job retries do not cause duplicate sends, duplicate outbound webhooks, or duplicate usage charges.
  3. Unknown send outcomes. When a provider may have accepted an email but the response was lost, the system does not resend unconditionally. It uses provider idempotency keys or status lookup where available.
  4. Versioned workflow definitions. Editing a workflow does not change runs that already started.
  5. Pre-send recheck. Unsubscribe and suppression status are rechecked immediately before sending, including for jobs that have been waiting.
  6. Secrets. Provider credentials and other secrets never appear in logs or MCP (or API) responses.
  • Each invariant needs a test that would catch its violation (ADR 0006).
  • The check-tenant-safety skill reviews changes against these invariants.
  • Mechanisms that implement them (idempotency key derivation, run identity, deploy safety, the provider webhook exception to project scoping) are proposed in docs/architecture.md.