Repository navigation
chore(plan-catalog): D2 — delete the BASIC_TIER_* env overlays from every serving identity - #13285
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
527da25 to
03e3d3d
Compare
|
Monitor follow-up for the two unresolved Cubic threads on this PR (both addressed in 03e3d3d, threads resolved): 1. Backfill clone step re-set the retired overlays ( 2. Catalog-only check ran in no lane ( Verification: full file 15 passed; |
…very serving identity plan_catalog.json is now the only source of plan quotas. The legacy overlays outranked the catalog at runtime (utils/subscription.py _basic_transcription_overlay), which is how the prod API plane advertised 600 free minutes while the listen plane enforced 300. Remove them from both backend-listen charts and both pusher charts; declare them forbidden_env on the four Cloud Run conversation services so the deploy strips them (--remove-env-vars in deploy-backend-stack and sync-backfill-lifecycle) and the live check finds them absent. The _legacy_overlay bridge stays until the prod dispatch proves the deployed values gone. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The subscription-reload case is a per-test fresh module reload and belongs in the slow-guardrail lane; the two cases that drive the real workflow validator over the repository manifest and composite actions stay in the unit lane under a duration-allowlist entry with the reason. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…tep and run the catalog check in CI Cubic review follow-up on the D2 retirement: - The backfill-runtime clone step reads live backend-sync (which still carries the BASIC_TIER_* overlays) and strips vars via REMOVE_ENV_VARS; the four retired names were missing there, so the clone would re-set them on backend-sync-backfill in the same deploy that removes them, nullifying the removal. Add the four names to REMOVE_ENV_VARS and extend the static tripwire to cover REMOVE_ENV_VARS entries. - test_catalog_is_the_only_source_when_no_overlay_is_present is @pytest.mark.slow, but the slow-guardrail lane only runs files listed in tests/slow_guardrail_manifest.txt, so the check executed nowhere. List the file so the lane runs it. Verified: 15 passed (full file); slow lane selects 1/1, unit lane deselects it; black --check clean.
…uards; state the scope it actually covers Adversarial review follow-up (2026-09-09): - The chart scan and the deploy-action scan were not selected by the changes they guard. select_backend_unit_tests.py returns False for backend/charts/** except monitoring sources, so re-adding BASIC_TIER_MINUTES_LIMIT_PER_MONTH to a GKE chart passed CI, and the GKE plane has no forbidden_env backstop at deploy time either. Register tests/unit/test_plan_quota_env_retirement.py in workflow_contracts.json under backend_cloud_run_deploy and rendered_gke_deployment_identity, add .github/actions/sync-backfill-lifecycle as a source there, and add that path to backend-unit-tests.yml (it was not in the workflow's paths at all, so a PR touching only that action never started the backend unit job). Verified with the real selector: all four charts, both composite actions and runtime_env.yaml now select the suite; before, none did. - plan-source-of-truth.md claimed flatly that no serving identity carries an overlay. Cloud Run desktop-backend is a ninth serving identity, is not in the cloud_run.services manifest and has no forbidden_env support, so it is covered by evidence not by a gate. Read live (dev + prod, read-only bots): it carries none of the four names, and no desktop router reads a plan transcription limit. Doc now says that instead of the absolute. Tests: retirement suite 15 passed; retirement + runtime-env + rendered-contract + preflight neighbours 183 passed; test_workflow_contracts.py 26 passed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
06bdbbc to
b4e9326
Compare
|
Monitor follow-up (D2 plan-catalog):
|
…ier-env-overlays # Conflicts: # backend/charts/pusher/dev_omi_pusher_values.yaml
The main merge ran the Dart formatter on incoming app files and made this branch look like it touched INV-DATA-1 paths. Restore those files to origin/main so the PR stays quota-overlay-only. Failure-Class: none
Keep LLM_GATEWAY_ACCOUNTING_ENABLED from #13330 and the D2 BASIC_TIER overlay retirement, then compose the checked-in manifest. Failure-Class: none
D2 — delete the
BASIC_TIER_*env overlays;plan_catalog.jsonis the only source of plan quotasProgram: plan-source-of-truth ruling carried by NOW.md item 4; free-tier direction review (
omi-knowledge-base/projects/local-models-free-tier/evidence/2026-09-07-direction-review.md) §4 and §6 Move 3. Overnight rundata/run-2026-09-09-overnight-margins(free-tier lane). Ratified product number: P9 — basic = 300 transcription minutes/month (basic.allocations.transcription = finite 18000 sinbackend/config/plan_catalog.json).Premise, re-verified live 2026-09-09 (read-only bots; env names + numeric literals only)
backend:BASIC_TIER_MINUTES_LIMIT_PER_MONTH=600, words/insights/memories=0; prod GKEbackend-listenandpusher:300,0,0; devbackend/backend-listen/pusher:1000000,0,0. So B1 is still live: prodGET /v1/users/me/subscriptionadvertises 600 free minutes while the listen plane enforces 300 and the catalog says 300.utils/subscription.py:_basic_transcription_overlay,_catalog_or_legacy_basic_limit), which is exactly the bridge whose docstring names D2 as its deletion.backend/deploy/runtime_env.yamlnever declared them, anddeploy-cloudrunenv_varsmerges rather than replaces, so a legacy variable survives every deploy until it is named in--remove-env-vars. A fourth name,BASIC_TIER_MEMORIES_CREATED_LIMIT_PER_MONTH, is live on both Cloud Runbackendservices and read by no code; it is retired with the other three.What changed
backend/charts/backend-listen/{dev,prod}_omi_backend_listen_values.yaml,backend/charts/pusher/{dev,prod}_omi_pusher_values.yaml: the threeBASIC_TIER_*entries deleted.backend/deploy/runtime_env/_base.yaml(+dev.overlay.yaml, which redefinesforbidden_envfor three services; + regeneratedruntime_env.yaml): the four names declaredforbidden_envonbackend,backend-sync,backend-sync-backfill,backend-integrationin both environments. The existing runtime-env validator turns that into (a) a required--remove-env-varsentry in the deploying composite action at validation time and (b) an absence check against the live service state..github/actions/deploy-backend-stack/action.yml(3 deploy blocks) and.github/actions/sync-backfill-lifecycle/action.yml: the four names appended to--remove-env-vars..github/agent-docs/plan-source-of-truth.md: D2 paragraph._legacy_overlay/_basic_transcription_overlaystay until the prod dispatch has removed the deployed values and the live check has proved it; then the bridge and its tests go in one follow-up. Deleting code that still guards a deployed0would be the inversion the docstring warns about.Automatic-or-dead check
backend/tests/unit/test_plan_quota_env_retirement.py(15 cases):BASIC_TIER_*name to any of the four GKE charts fails the chart scan;forbidden_envfrom any of the four Cloud Run services in either environment fails the manifest pin;--remove-env-vars(or from the backfill clone step'sREMOVE_ENV_VARS) fails the real workflow validator (_validate_cloud_run_workflowsdriven over the repository's manifest and composite actions) — this is the behavioural check; the action-text scan next to it is a labelled static tripwire;utils.subscriptionresolves basic to 300 min / 18000 s and words/insights to catalog-unlimited (None), never to a finite zero.Two lanes had to be fixed for those to be automatic rather than aspirational (review round 2):
@pytest.mark.slow, and the slow lane runs only files listed inbackend/tests/slow_guardrail_manifest.txt— so the one behavioural assertion in the suite ran nowhere. The file is now listed.select_backend_unit_tests.pyreturnsFalseforbackend/charts/**, so an edit to a chart, to either composite deploy action, or toruntime_env.yamldid not select this suite; only the unmapped-path full-suite fallback ran it, incidentally. The suite is now registered inbackend/testing/workflow_contracts.jsonunderbackend_cloud_run_deployandrendered_gke_deployment_identity,.github/actions/sync-backfill-lifecycle/**is a source there, and that path is inbackend-unit-tests.yml(it was absent, so a PR touching only that action never started the backend unit job). Verified by running the real selector on all five paths: 5/5 now select it, 0/5 did before.Standing limit, stated rather than papered over: the GKE plane has no deploy-time backstop —
_validate_gkedoes not readforbidden_env— so for backend-listen and pusher the CI selection above is the only guard. The Cloud Run half is additionally enforced at deploy time (validate-backend-runtime-env.py --check-workflowsinsidedeploy-backend-stack, andpre-deploy-check.sh), which the reviewer confirmed by mutation in both environments.Proof
backend/.venv/bin/python -m pytest tests/unit/test_plan_quota_env_retirement.py -q— 15 passedvalidate-backend-runtime-env.py --env dev|prod --check-workflows— both pass (and fail when a name is dropped from an action list; that is how the dev overlay's list-replacement was found and fixed)verify_pusher_cohost_env_diff.py— OK (the names left both co-hosts together, so no allowlist entry was needed)check_runtime_env_compose.sh— up to dateWhat happens on deploy (state this out loud)
resolve_transcription_allowancereadstranscription_allowance_seconds, which is catalog-only (utils/subscription.py:1640-1651), and every socket/credit check routes through it (:1741-1757,routers/listen/runtime.py:563). Dev and prod already enforce 300. What the overlay still controlled was the advertised number (get_plan_limits→_effective_plan_limit,:979-988,:1314-1316) and the plan copy (:1362-1376).GET /v1/users/me/subscriptionfor a basic account reports 300 instead of 1,000,000; nothing else changes.gcp_backend.yml+ listen/pusher Helm): the API stops advertising 600 and reports the 300 the listen plane already enforced. This closes B1. Expectbackend/scripts/pre-deploy-check.sh --live(the prod hotfix runbook's pre-step) to fail once on the forbidden-env check until that dispatch has removed the live variables — that is the check working, not a regression.desktop-backend(added in round 2).desktop-backendruns the samebackend/tree and importsutils.subscription, but it is not in thecloud_run.servicesmanifest and its manifest section has noforbidden_envsupport, so it is covered by evidence, not by a gate: read live on 2026-09-09 in dev and prod, it carries none of the four names, and no desktop router reads a plan transcription limit. The six Cloud Run jobs were not read and declare noforbidden_envfor these names; if a job carries one it is inert (no reader).Cut list
_legacy_overlayand thePLUS_TIER_MINUTES_LIMIT_PER_MONTH/*_CHAT_QUESTIONS_PER_MONTHchat overlays (not deployed anywhere read this pass; separate follow-up with the bridge)is_overage_planremoval (P11) andwire_plan_for_client(Q6)plan_catalog.jsonvaluesAdversarial review (opus reviewer, 2026-09-09) — every finding fixed or rebutted
os.getenvreader of the four names survives (_legacy_overlayonly;reset_transcription_usage.pymentions one in a docstring, which goes stale after the prod dispatch — noted for the bridge-deletion follow-up).0→Nonewas already the legacy mapping;routers/users.py:1218,1312emit0either way;routers/users.py:1274recomputes limits per request, so no persisted 600 survives)._validate_cloud_run_workflowsfor the right service in both environments (sync-backfill-lifecycleis expanded via_load_local_composite_action).pre-deploy-check.sh --livefails once on prod until the dispatch.on_device, never an error;omi-release-probehas no transcription exemption before or after (unchanged).Product invariants affected
backend/deploy/runtime_env.yamlis touched only to declare four retiredBASIC_TIER_*plan-quota names asforbidden_env; no memory intake, promotion, or consolidation path changes.How it was verified
Unit suite, runtime-env validators (manifest + workflows) for both environments, cohost gate, compose check; live env names on eight serving identities read with the read-only bots.
Tests
backend/tests/unit/test_plan_quota_env_retirement.py— 15 passedAdversarial review round 2 (opus reviewer, 2026-09-09) — findings and resolutions
The reviewer's verdict was that the configuration change is correct and complete for the identities it names, and that the defects were in the automatic-or-dead layer: three of its four bullets described checks CI does not run on the change that would break them.
test_catalog_is_the_only_source_when_no_overlay_is_presentisslow-marked and the slow lane runs only manifest-listed files, so it executed in no lane. Listed.BASIC_TIER_MINUTES_LIMIT_PER_MONTHto a GKE chart passed CI and the deploy. Fixed viaworkflow_contracts.json+backend-unit-tests.yml; verified with the real selector (5/5 paths now select the suite, 0/5 before). See "Automatic-or-dead check".desktop-backendis a ninth serving identity that neither the enumeration norplan-source-of-truth.md's absolute sentence accounted for. Read live in both environments (clean) and the doc now states the covered scope instead of the absolute.test_deploy_action_remove_lists_name_every_overlayrequires every--remove-env-vars=occurrence in both action files to carry all four names, so an unrelated future Cloud Run deploy block will be forced to carry them. It is a labelled static tripwire; loosening it belongs with the bridge-deletion follow-up that removes the names entirely.reset_transcription_usage.py—app/test/unit/l10n_free_tier_minutes_test.dart:8-12says "the backend env remains the source of truth". The number (300) stays right; the attribution goes stale after the prod dispatch.forbidden_envreaches the generated manifest for all four Cloud Run services in both environments and the dev overlay's list-replacement re-listsHOSTED_PUSHER_API_URLcorrectly; deleting a name from either composite action fails_validate_cloud_run_workflowsfor the right service in both environments (mutation-tested); the complete reader set is_basic_transcription_overlayand_catalog_or_legacy_basic_limitand nothing else, so removing the env cannot flip finite-zero ↔ unlimited in either direction;resolve_transcription_allowanceis catalog-only and every socket/credit check routes through it, so enforcement does not move;routers/users.py:1274recomputes limits per request so no persisted 600 survives; no other service sets the four names and no Cloud Run job reads them; the pre-deploy validation is fed from the manifest, not from gcloud, so there is no deadlock before the dispatch; 226 checks inpre-deploy-check.sh, 142 in the plan/subscription neighbours and 200 in the deploy/runtime-env neighbours pass.Round-2 proof: retirement suite 15 passed; retirement + runtime-env + rendered-contract + preflight neighbours 183 passed;
test_workflow_contracts.py26 passed;desktop-backendlive env read in dev and prod (names only).Failure-Class: none
🤖 Generated with Claude Code