Skip to Content
Operate & Maintain

Removing subsystems

Remove an optional integration as a complete vertical slice.

This page classifies the current product surface so an agent starts from a real inventory rather than a feature name.

Disabling a key is not removal. A complete removal covers runtime, package, environment, persistence, public routes, deployment, generated buyers, documentation, and commercial claims.

Current classification

Capabilityv1 statusRemoval boundary
Historical Cloudflare workerremoved and reproducedno apps/worker, workspace/package/importer/env/deployment/runtime claim; Decision 0001 records re-entry criteria
Sentryoptional, not removal-rehearsedbrowser init/error boundaries, Vite plugin/source maps, API tunnel, typed environment, project allowlist, packages
Slack operational messagesoptional, not removal-rehearsedtyped environment, Slack client (apps/server/src/infra/slack/client.ts), marketing callers, docs/tests (no third-party Slack npm package)
Google OAuthoptional, not removal-rehearsedBetter Auth provider config, typed environment, login state/UI, callback deployment docs/tests
Object storage and file libraryoptional, not removal-rehearsedupload and files contracts/domains/migrations (PROFILE_PIC and USER_FILE), storage adapters, web upload/profile//files UI, seed:demo-objects, environment, docs/tests
PWA/offline installoptional, not removal-rehearsedVite PWA/Workbox packages and plugin, manifest/icons/offline page, service-worker tests/deployment behavior
Billingproduct-optional, high riskbilling package/domain/migration, adapters, plans/gates, settings UI, webhooks, email, provider environment, commercial claims
Mobile IAP (RevenueCat/Superwall)optional, mobile editionMOBILE_IAP_PROVIDER, REVENUECAT_*, apps/server/migrations/20261124000000_mobile_iap_revenuecat.sql, packages/billing/src/providers/revenuecat.ts, apps/mobile/lib/{purchases,paywall}.ts, apps/mobile/components/PaywallProvider.tsx, apps/mobile/app/settings/billing.tsx, react-native-purchases*, expo-superwall
Better Auth and email authcore supported pathremoving either replaces the authentication/product contract; it is not a small optional-integration task
Postgres/dbmate and contractscore architectureremoval is a new product architecture, not a supported subsystem-removal path

“Not removal-rehearsed” is deliberate wording. The generic runbook describes how to prove those removals; it does not claim every combination has already passed.

Narrowing authentication to social providers

Setting emailAndPassword.enabled: false in apps/server/src/lib/auth.ts does not remove email authentication. Better Auth 1.7 gates /auth/sign-in/email and /auth/sign-up/email on that flag, but gates two other endpoints on the presence of a callback instead:

EndpointActual gate
/auth/request-password-resetemailAndPassword.sendResetPassword is defined
/auth/send-verification-emailemailVerification.sendVerificationEmail is defined

Both callbacks ship defined, so both endpoints stay live after the flag is turned off:

  • /auth/request-password-reset still emails a reset link for any registered address, including an account that has only ever signed in through a social provider. Completing the link creates a credential account for that user and, because revokeSessionsOnPasswordReset is enabled, revokes their live sessions.
  • /auth/send-verification-email still sends for any account whose email_verified is false. The shipped emailVerification.autoSignInAfterVerification: true then makes /auth/verify-email set a session cookie, which is a complete email-link route to a session that never reaches the social provider.
  • The magic-link plugin is a third email route to a session. It is registered in plugins, so emailAndPassword.enabled never applies to it.

A complete narrowing removes the callbacks rather than only the flag:

  • delete emailAndPassword.sendResetPassword and emailAndPassword.onPasswordReset;
  • delete emailVerification.sendVerificationEmail, and decide explicitly whether autoSignInAfterVerification still has a purpose;
  • remove the magicLink plugin from plugins;
  • remove the matching login UI, email templates, sensitive-route rate limits, and typed environment;
  • add a negative integration test per removed endpoint proving it now fails closed.

The delivered foundation is not exposed by this: it ships email authentication enabled, and every listed endpoint is a supported flow.

Reproduced worker removal

The pre-release template previously contained a disconnected Cloudflare/Gemini document-processing worker. It was removed because it had no production Better Auth-to-executor authorization, durable job ownership, product data model, billing/abuse limits, or paid evidence.

The reproduced removal covered:

  • the entire apps/worker workspace and its direct packages;
  • workspace and root commands;
  • worker environment examples and deployment configuration;
  • generated-buyer output and current product claims;
  • a decision fixture that rejects re-adding provider/runtime code when a PRD has not earned the capability;
  • frozen install, static checks, tests, production builds, dependency audit, and a custom generated buyer.

Current contract tests assert that apps/worker is absent and that the no-worker decision remains documented. This is same-context maintainer evidence, not a cold independent-agent claim.

Inventory starting points

Use these terms only to build an inventory; classify every result before deleting:

CapabilitySearch terms
SentrySENTRY_, sentry, /tunnel
SlackSLACK_, slack, createSlackClient, sendWaitlistAlert, sendContactFormAlert
GoogleGOOGLE_CLIENT, google, socialProviders
Storage/uploadSTORAGE_, CLOUDFLARE_, GOOGLE_CLOUD_PROJECT, PROFILE_PIC, USER_FILE, PRIVATE_FILE_PREFIX, user-files/, upload, presign, object_key, seed:demo-objects
PWAVitePWA, workbox, site.webmanifest, offline, serviceWorker
BillingBILLING_PROVIDER, POLAR_, STRIPE_, DODO_PAYMENTS_, subscription, billing, plan, webhook_events
Mobile IAPMOBILE_IAP_PROVIDER, REVENUECAT_, EXPO_PUBLIC_REVENUECAT_, EXPO_PUBLIC_SUPERWALL_, react-native-purchases, expo-superwall

Search source, manifests, lockfile importers, migrations, environment schemas/examples, CI, deployment settings, tests, docs, generated output, and sales copy. Historical ADRs may retain classified evidence; current buyer claims may not.

Persistence and migration safety

Once a release tag ships, never edit a released migration to make a removal look clean. Add an explicit retirement migration, a data export/retention decision, and a safe rollback or forward-recovery plan. Deleting an external provider resource or stored customer data always requires explicit authority.

Product-contract consequences

  • Removing Sentry or Slack narrows observability/operations but need not change customer behavior.
  • Removing Google preserves password/magic-link auth only when those flows and account linking still pass.
  • Removing object storage requires removing profile upload UI, the /files module, and their persisted claims; do not leave a broken avatar or file action.
  • Removing PWA requires removing install/offline claims and generated service-worker artifacts.
  • Removing billing means the resulting application is not revenue-ready through the supported paid path. Remove gates, plans, portal, lifecycle email, webhook routes/state, and every pricing claim together.
  • Removing Better Auth, Postgres, the separate API, or typed contracts is a deliberate architecture fork outside normal support.

Required proof

bun install --frozen-lockfile
bun run check
vp run -r typecheck
bun run test
vp run -r build
bun run knip
bun audit --audit-level high
git diff --check

Also prove zero-key local startup, affected negative behavior, exact residue classification, migration reversal where persistence changed, and an untouched custom-scope/custom-brand generated buyer. Record remaining hits and their owners; an empty unscoped search is not trustworthy evidence.

On this page