Retire the sign-up draft purge

Task 10413 · Running · Coder · created · updated

## Original requirement (verbatim, epic Task 10379 → 10399) Ask (operator, from Task 10379): the Trial plan's "Subscribers" count includes orgs the operator cannot find in Customers: unsubmitted sign-up drafts (`signup.drafts()`, hidden by `signup.not_a_draft()` in `apps/api/app/routes/customer_roster.py::_org_filters`) and email sign-ups with no org yet (the separate Sign-ups tab). Make every unfinished sign-up visible and actionable in the one Customers roster. Do not add new buttons; reuse existing patterns (roster row, row menu, the customer's edit-in-place page). Requirements: 4. An operator can archive an unfinished sign-up by editing the customer's data (the same soft-delete/archive as any customer), or delete it outright, from the existing row/detail menus. **This child realizes PRD decision D4 (operator: "Stop the purge")**: Retire the `signup-drafts` cron and `purge_drafts`. Drafts stay until an operator deletes them. Update the docs that describe the purge to describe the present. ## Why `depends_on` the roster child Not a data dependency: both children add an Alembic migration and only one migration may land per concurrency wave. Rebase onto develop after the roster child merges and set your migration's `down_revision` to its `billing_saved_at` migration so Alembic keeps one head. ## Approach (Architecture §2.6) - Delete `signup_draft.purge_drafts`, `PurgeReport` and its helpers (KEEP `signup_draft._detach_cards`: the free-plan submit path uses it), `DRAFT_TTL`, and the `signup-drafts` registration in `apps/api/app/cron_system_activities.py` (around lines 87, 691, 845). - A data migration deletes the seeded `signup-drafts` system-schedule row (seeded in `apps/api/migrations/versions/202610251700_baseline.py:1069`). Additive-safe while two releases overlap (`docs/standards/coding-standards.md`). - Keep the `signup_draft_purged` entry in `activity_kinds.py` so historical Audit rows still render; reword it to the past tense. - Rewrite to the present: the `signup_draft.py` docstring, `docs/integrations/stripe.md` §Sign-up card capture, and the "never purged" clause of the `signup.drafts` docstring. - Update tests that name the cron/purge: `apps/api/tests/test_signup_draft.py` (purge tests removed), `apps/api/tests/test_cron_system_activities.py` (registry expectations), `apps/api/test_tenancy_plane_sites.py` (`signup-drafts` entry). Add a test that a draft older than 24 h is still listed. Credentials & reach: API and unit tests, `./dc check quick` — the worktree only — verified. AC17 Jaah Deploy watch — `jaah-forge` (pre-authenticated for the task) — verified by the charter's forge contract. Out of scope: Do NOT change billing or Stripe pricing logic, plan push or hostings (Task 10379 owns them). Do NOT add cleanup of a deleted draft's Stripe Customer (deferred, PRD §7). Do NOT change the tenant-side sign-up flow's UI pages (`apps/web/src/pages/signup/*`). Do NOT add an Archive button, an "Advance stage" control, or any new toolbar button. Do NOT touch the roster, operator routes or terms gate (sibling children). No feature flag. Done means: - AC13 No purge. The `signup-drafts` cron and `purge_drafts` are gone. A draft older than 24 h is still listed. The docs (`signup_draft.py` docstring, `docs/integrations/stripe.md` §Sign-up card capture, `activity_kinds.py` entry) describe the present. → verify: `grep -rn "purge_drafts\|signup-drafts" apps docs` returns only migrations or history; `python3 tools/check_context.py` green. - Alembic has a single head after rebase (`alembic heads` shows one). - AC17 Gate. `./dc check quick` and the changed-area tests are green, and Jaah Deploy of the merged PR succeeds. → verify: gate output, then the deploy run on GitHub. - AC18 Available on dev. Everything above is on by default with no flag, reachable on `app.dev.jaah.ai`.

Activity

  • Draft
  • Ready
  • Runner started