Skip to content

Eliminate duplicated sandbox demo allowlist between runtime and seed tooling #73

Open

Description

@diese-tech

Context

Follow-up from PR #72 (Private preview demo tenant: safer resets, seed-demo removal, first-launch tutorial). The safety work in that PR intentionally introduced the same sandbox tenant allowlist in two places:

  • src/lib/demo.ts for runtime reset protection (SANDBOX_DEMO_SLUGS)
  • scripts/lib/seedDemoGuard.mjs for seed/provisioning preflight protection

This duplication is currently safe, but it creates a maintenance drift risk. Adding or removing a sandbox tenant in only one place can cause runtime reset behavior and provisioning behavior to disagree.

Goal

Establish a single source of truth for sandbox demo slugs that can be consumed by both application TypeScript and plain Node .mjs tooling without weakening the preflight guard added in PR #72.

Scope

  • Replace the duplicated allowlist with one shared source that both src/lib/demo.ts and scripts/lib/seedDemoGuard.mjs can consume.
  • Preserve the current hard safety guarantees:
    • resetDemoTenant() must refuse non-sandbox companies.
    • scripts/seed-demo-tenant.mjs must refuse non-allowlisted slugs before any Supabase write.
    • Custom/private tenants must still require distinct credentials and a non-empty technician handle suffix.
  • Keep the solution lightweight. Do not introduce a new config service or database-backed registry just to solve this.
  • Add/adjust regression coverage so runtime and seed tooling cannot silently diverge again.

Acceptance criteria

  • Sandbox demo slugs are defined in one canonical place.
  • Runtime demo/reset helpers consume that source.
  • Seed/provisioning guard consumes that same source.
  • Existing PR Private preview demo tenant: safer resets, seed-demo removal, first-launch tutorial #72 safety behavior remains unchanged.
  • A regression test proves the two consumers cannot drift independently.
  • npx vitest run, npx tsc --noEmit, npm run lint, and npm run build remain green.

Priority

Maintenance follow-up, not a hotfix. Address before adding another sandbox/demo tenant so the duplicated list does not become operational debt.

Activity

  1. added a commit that references this issue on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions