Repository navigation
feat(sync): legacy_dark reads the (f) stub statically (lane 10, slice 2a) - #22449
Conversation
…s (contract h) Behaviour-neutral at on: nothing calls the module yet. Adds the legacy_sync mode read (fails to on), the ledger-row fence for content legacy already owns, the dark-entry census verdict, the drain census script, the queue capture/recreate script and the runbook. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…module lands Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd the dark sweep Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lr/10-legacy-dark
…ed reader serves on quietly Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…n (David 10-19) Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f46dc43b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | 1d | | `sum(increase(omi_legacy_dark_ack_total{reason=~"legacy_active_in_dark\|admission_refused"}[30m]))` | `0` | | ||
| | 2 | **Outcome SLOs held** | `fleet_gate.sh <T_dark> 20 30 100` (the workspace gate at 100%) | exit 0 (`GATE_PASS`) | | ||
| | 2b | | first-summary dispatch: outbox `first_pending_at` → dispatch, the gate's `first_summary_*` tokens | 0 dispatches over 121s | | ||
| | 2c | | task targets: `sum(increase(omi_task_unexpected_total[30m]))` plus Cloud Run 5xx/429/503 on `/v2/enrichment/run`, `/v2/batch-pipeline/*` and `/v2/audio-merge-jobs/run` | `0` | |
There was a problem hiding this comment.
Query the emitted task-error counters
This PromQL selects a metric that no producer defines: a repository-wide search finds omi_task_unexpected_total only in this runbook, while CPU consumers emit omi_consumer_unexpected_total{kind=...} and batch enrichment records unexpected retries in batch_enrichment_sync_reprocess_retries_total. Every soak read will therefore return no data, so this mandatory auto-proceed check either permanently holds the retirement or is mistakenly treated as zero without checking task failures; query the actual counters and labels instead.
Useful? React with 👍 / 👎.
| | 4b | | BYOK and non-Parakeet uploads: `provider_stt` completions versus admissions (or a census of zero traffic) | all completed or in flight under 1h | | ||
| | 4c | | cap-hold redrives served by batch (or S12: cap enforcement still at its pre-dark cohort with `stt_cap_holds` = 0 new) | true | | ||
| | 4d | | the last `parity_gate.py --surface prod-shadow` (rows 3–6) from the 100% hold | PASS | | ||
| | 5 | **Cost on track** | `backend-sync-backfill` and `backend-sync` legacy-worker billable instance time (`run.googleapis.com/container/billable_instance_time`), last 6h against the 6h before `draining` | ≤ 10% of the pre-draining 6h | |
There was a problem hiding this comment.
Exclude the still-serving backend-sync workload
The Cloud Run billable_instance_time metric is attributable to a service/revision, not to a "legacy-worker" route within that container, while backend-sync remains active for fresh sync, audio-merge, account-deletion, and conversation-finalization traffic after legacy retirement. Its continuing billable time therefore makes the combined ≤10% comparison unable to measure the claimed legacy reduction and can block the pre-authorized deletion even when legacy work is zero; scope this check to the removable backfill service or use route-specific request evidence for the legacy portion.
AGENTS.md reference: backend/AGENTS.md:L115-L120
Useful? React with 👍 / 👎.
| | 1 | **Zero legacy traffic** | `sum(increase(omi_legacy_sync_admissions_total[30m]))` | `0` | | ||
| | 1b | | `drain_census --env prod` (it gates on pending, sequencer owners, redrive, cap holds and the four queue depths) | verdict `ZERO` | | ||
| | 1c | | `sum(omi_legacy_sync_mode{mode="dark"}) == count(omi_legacy_sync_mode{mode="dark"})` and `sum(increase(omi_legacy_sync_mode_read_total{source=~"error\|malformed"}[30m]))` | every process serves `dark`; `0` fallbacks | | ||
| | 1d | | `sum(increase(omi_legacy_dark_ack_total{reason=~"legacy_active_in_dark\|admission_refused"}[30m]))` | `0` | |
There was a problem hiding this comment.
Treat absent zero-event counter series as zero
In the desired dark state these labeled counters may never have had a child instantiated: admissions, read errors, and fenced acknowledgements call .labels(...).inc() only when the corresponding event occurs. Prometheus then returns an empty vector—not numeric zero—for each sum(increase(...)), and the runbook explicitly treats unavailable reads as a hold, so a perfectly clean new revision cannot satisfy these auto-proceed rows. After separately proving deployment with the mode gauge, coalesce absent counter results to zero (or initialize every bounded label at startup).
Useful? React with 👍 / 👎.
| | 2b | | first-summary dispatch: outbox `first_pending_at` → dispatch, the gate's `first_summary_*` tokens | 0 dispatches over 121s | | ||
| | 2c | | task targets: `sum(increase(omi_task_unexpected_total[30m]))` plus Cloud Run 5xx/429/503 on `/v2/enrichment/run`, `/v2/batch-pipeline/*` and `/v2/audio-merge-jobs/run` | `0` | | ||
| | 2d | | upload 2xx rate per `app_build` on `/v2/sync-local-files` (Cloud Run request logs, `ro-prod` aggregates) against the 24h before `draining` | every build with ≥ 50 uploads within 1 pp | | ||
| | 2e | | `max(omi:reason_unknown_ratio:rate30m)` | < 0.02 | |
There was a problem hiding this comment.
Define or replace the missing reason-ratio recording rule
No recording or producer for omi:reason_unknown_ratio:rate30m exists in the repository; its only non-test references are this row and soak_check.py. Consequently the live collector returns an empty mapping, check_reason_unknown marks every read PENDING, and the newly pre-authorized deletion can never proceed. Add the recording rule to the deployed monitoring configuration or query the actual per-family reason counters directly.
Useful? React with 👍 / 👎.
Lane 10, slice 2a. Targets
integration/legacy-retire.Now that the (f) stub has landed (#22420),
legacy_dark.current_mode()importsutils.rollout.runtime_percentstatically. Until lane 6 implements the reader, the stub raisesNotImplementedError. That case now serveson, counted asomi_legacy_sync_mode_read_total{source="absent"}, with no error log. Without this, every upload would log an error once the call sites are wired.Behaviour is neutral: no call site uses the module yet. The routers/sync.py wiring and the
/v1/sync-local-files410 follow as slice 2b, once #21932 and #20662 merge.Verification:
pytest tests/unit/test_legacy_dark.py, 41 passed (unit).Failure-Class: none
🤖 Generated with Claude Code