Provider grid contract step: drop the retired

Task 9969 · Done · Coder · created · updated

Contract half of epic 9912's expand/contract migration (Architecture §1.6 / §3, deferred F1), filed by its Finish (9928). PRECONDITION (check first, do not skip): `docs/standards/coding-standards.md` §"Migrations must be additive while two releases overlap" — a drop may ship only once NO serving release still reads the column. Prod (`app.jaah.ai`) promotes from master on a human gate. Verify that prod already runs a release containing develop commit 9656d6ffa (PR #6887) — compare prod's served version (console footer / health endpoint, `tools/version.sh` for the mapping) with the tag of that commit. If prod does not yet run it, the drop is NOT legal yet: do not open the PR; ASK the operator (header `External`) whether to wait or proceed, and settle per the charter. Reproduction of the residue: `apps/api/migrations/versions/202610251500_provider_grid.py` and `202610251600_provider_grid_agents.py` add `billing_plans.providers` / `orgs.providers_override` and leave the old sources in place; on develop no ORM mapping or reader remains for them (`rg -n "non_claude_engines|provider_auth_override|provider_auth_defaults|agents_enabled|acp_registry_allowed" apps/api/app apps/web/src` → no live reader, only `apps/jaahd/main.py` `worktree_agents_enabled`, unrelated). Fix: one Alembic revision `YYYYMMDDHHMM_provider_grid_contract` (with `SET lock_timeout = '3s'`, frozen: no `app.*` import) that drops `orgs.provider_auth_override`, the `non_claude_engines_allowed`, `agents_enabled` and `acp_registry_allowed` columns on `billing_plans` and `orgs` (only those that exist — check the models history), the `system_state` rows `provider_auth_defaults` and `provider_grid_m2`, with the `# additive-check: exempt — <reason>` marker naming the precondition evidence. Downgrade re-adds the columns nullable (data is not restorable; say so in the docstring). Add a migration test in the repo's pattern. Out of scope: any resolver, door, UI or jaahd change (follow-up 9928-provider-grid-residue owns jaahd `plan_gate`); other plan switches' columns; rewriting M1/M2. Done means: | # | Criterion | Verify | |---|---|---| | 1 | Precondition proven | PR body cites prod's version and the release tag containing 9656d6ffa | | 2 | Columns and rows gone | migration test: upgrade drops them, downgrade re-adds nullable, re-upgrade is a no-op | | 3 | Nothing still reads them | `rg -n "non_claude_engines_allowed|provider_auth_override|provider_auth_defaults|acp_registry_allowed|\bagents_enabled" apps/ --glob '!**/migrations/**' --glob '!**/test_migration_*'` → no live reader | | 4 | Dev still works | after deploy: Products › plan › Providers and Customers › org › Overrides › Providers load on dev; Accounts › Add as a tenant offers the same providers as before | | 5 | Gates | `./dc check quick`; merge lane `./dc check full`; `python3 tools/check_context.py` pass |

Outcome

Revision 202610251700 drops the 7 retired provider columns and 2 system_state rows, with a migration test. PR #6896 merged as 1e30588ea; quick gate and the review lane passed; dev deploy green. Prod precondition unmet (master lacks v1.2.4250); operator chose proceed, so master needs a two-step promotion. Dev browser check unverified: dev unreachable from this node. Memory: used mem-6424; proposed 0.

Pull request

Artifacts

Activity

  • Ready
  • Runner started
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Runner ended (done)