Skip to content

feat(sync): legacy_dark reads the (f) stub statically (lane 10, slice 2a) - #22449

Merged
Git-on-my-level merged 6 commits into
integration/legacy-retirefrom
lr/10-legacy-dark
Oct 19, 2026
Merged

Git-on-my-level merged 6 commits into
integration/legacy-retirefrom
lr/10-legacy-dark

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Lane 10, slice 2a. Targets integration/legacy-retire.

Now that the (f) stub has landed (#22420), legacy_dark.current_mode() imports utils.rollout.runtime_percent statically. Until lane 6 implements the reader, the stub raises NotImplementedError. That case now serves on, counted as omi_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-files 410 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

View guided diff Turn on auto-fix

Git-on-my-level and others added 5 commits October 19, 2026 13:22
…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]>
…ed reader serves on quietly

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T08:35:37.527504Z 6f46dc4 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +69 to +72
| 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` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit f423c53 into integration/legacy-retire Oct 19, 2026
23 checks passed
@Git-on-my-level
Git-on-my-level deleted the lr/10-legacy-dark branch October 19, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant