Skip to content

fix(batch): roll seal repair back to 16 workers - #24733

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/pipeline-sealworkers-rollback
Nov 5, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/pipeline-sealworkers-rollback

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Problem

#24729 raised prod seal-repair workers 16 -> 48. The first 48-worker pass (Job 29898605, 2026-11-05 22:05-22:31Z, image 6db2d43d) made throughput worse: all sampled row lines were budget_exhausted (the 270 s per-row cap). Per-row time went from ~150 s to >270 s, so ~0 rows sealed vs ~134 in the prior 16-worker pass. Pod resources were fine (CPU 1.8 of 4, memory 3.7 of 8 GiB, no throttling), so a shared per-row I/O path saturates at 48 concurrent rows. This meets the prod-safety rollback condition from #24729's review.

Fix

Prod recordSealRepair.workers back to 16 (values only). The code and chart cap stays at 64, so a later, measured step can use it once the per-row I/O bottleneck is profiled.

Failure-Class: none

(Rollback of a capacity step, not a defect class.)

Tests

test_record_seal_cluster_repair_deploy.py (prod renders 16): 10 passed.

Risk / rollback

Restores the pre-#24729 prod setting. An already-running Job keeps 48 until it ends (<=1500 s).

Evidence: omi-workspace data/run-2026-11-05-omi-pipeline/sealroll-24729-watch.txt.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

48 workers pushed every row past the 270 s per-row cap (budget_exhausted,
~0 sealed vs ~134 at 16) in the first pass, 2026-11-05 22:05-22:31Z. The
pod had headroom, so per-row I/O saturates. Code cap stays 64.

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

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T22:44:04.778707Z 7943630 PR opened
ℹ️ 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.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Turn on auto-fix | Re-trigger cubic

@Git-on-my-level
Git-on-my-level merged commit 628549b into main Nov 5, 2026
64 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/pipeline-sealworkers-rollback branch November 5, 2026 22:52
Git-on-my-level added a commit that referenced this pull request Nov 6, 2026
GPU batch holds had no bounded terminal disposition or automatic
re-attempt. This adds a seven-day `held_deadline_at`, retained
`dead(held_expired)` rows, a private-OIDC CAS requeue, a nightly UTC
re-drive on the existing serving maintenance leader, and an agent-tier
volume alert. No CronJob is added.

Initial quarantine and failed-held recovery writers stamp a full window.
Legacy rows receive seven days at their first eligible sweep.
Expiry/requeue recheck content ownership, privacy generation, dormant
held state, no result or result receipt, no worker token and an expired
finite lease. Active paid/operator intents block the transition. Durable
document-key cursors bound each pass to 32 rows per five-minute tick;
crashes replay idempotently and malformed rows cannot pin the page.
Nightly re-drive rechecks its previous-day cutoff inside the transaction
before normal GPU admission.

`BATCH_HELD_DEAD_LETTER_ENABLED` / `batch_held_dead_letter_enabled()`
defaults **ON**. It is registered in kill switches, flag budget, feature
registry, deployment classification, common runtime declarations and
worker overlays. **Rollback:** false on serving/workers stops new stamps
and automatic maintenance; the private requeue endpoint remains usable.
Expiry atomically sets `merge_pending=true`, so after reverting the new
code an operator can still use the unchanged `POST
/v2/batch-pipeline/redrive-dead` route. No pre-revert drain or data
rewrite is required for rows written by this implementation. The
rolled-back service requires an operator re-drive rather than the new
nightly helper. See `backend/docs/runbooks/batch-held-dead-letter.md`.

**Custody:** nothing is deleted. Every new dead letter has reason
`held_expired`, retains its deadline, encrypted audio references and
attempt/intent history, and has a sanctioned requeue path. No TTL,
conversation-status writer or custody/privacy fence is changed. Status
and partial-accounting readers retain the held answer, so age does not
acknowledge phone custody or hide healthy siblings. Projection expiry
(4b), BYOK/finalization tools (4c), and `privacy_blocked` remain outside
this change. Provider-STT holds remain fenced from the GPU queue; the
state-table deadline gap remains explicitly strict-xfailed.

The volume alert is **agent tier**, with `omi-tier-silent` routing so it
never pages humans. It checks fresh retained stock >100 or >10
expirations in 30 minutes for five minutes. Each stock sample must be
younger than 15 minutes before aggregation; unrelated legacy dead
reasons do not count. Notification timing follows the warning contract.
Split/combined rules, metric inventories, the sync GMP scrape allowlist
and all four dev/prod main/sync exporter prefix lists include the three
emitted metric families. Thresholds are initial operator defaults, not
production-calibrated. Backend and metrics-egress/alert rollout must use
the checked-in declarations; this PR performs none of those rollouts.

Validation (offline/synthetic; suites overlap):
- Final held-recovery, alert, notification, inventory and transport
contracts: 319 passed.
- Real loopback Firestore integration: 3 passed, including expiry → flag
off → unchanged legacy dead re-drive → normal completion/merge,
contention and duplicate delivery.
- Main-sync serving/flag/held/worker contracts: 135 passed.
- State-table/writer/policy validation retained 75 strict expected gaps;
no unrelated xfails were removed. The shared emulator regressions are
also registered in the lifecycle harness.
- `make preflight` and `scripts/pr-preflight`: 52 checks passed. Both
published fix and merge heads passed the normal pre-push hook, including
backend tests, type checks, OpenAPI and Firestore guard; no bypass, cap
override, force or timeout retry.
- Required Grok review completed with NO BLOCKERS (receipts
`exec-heavy-system-squeeze-major-install-point`,
`exec-breeze-portion-boy-castle-gauge-marine`,
`exec-blur-source-live-meadow-inject-damp`). The last Luna P1 rollback
finding is fixed inline with the atomic legacy marker and explicit
rollback regressions; no further review round was requested.
- [Exact-head GitHub
checks](https://github.com/BasedHardware/omi/pull/24736/checks?sha=30b59b4c95631168a4a5fac9d7807cadd747327c)
for `30b59b4c95631168a4a5fac9d7807cadd747327c`.

Main is merged through `d6112658e5fa`, retaining #24735's cadence
controls and #24733's 16-worker seal-repair rollback. The lane base
already includes #24712/#24716. No `.github` edits; unrelated Flutter
work is preserved.

Not measured: production stock/dwell, vendor spend, live nightly
execution, live exporter/alert delivery, deployed revision or
user-visible recovery. No GCP tier, production access, merge to main or
deployment was used.

Product invariant: INV-MEM-4; canonical memory intake/promotion
authority is unchanged.
Failure-Class: FC-batch-fault-domain-head-of-line-poison
Git-on-my-level added a commit that referenced this pull request Nov 8, 2026
…4943)

<!-- claude-projects-attribution: {"github_login":"Git-on-my-level"} -->
_Requested by **David**_

## What changes

Retro P6 adds `batch-pipeline-tuning-disclosure` to the shared manifest
in both local and CI lanes. Numeric capacity assignments and concurrency
environment defaults in the batch config, pipeline source, worker/pusher
charts, and `backend/utils/pusher_*.py` require numeric disclosures in
one PR-body section naming a matched knob: before/after, from/to, or a
nearby numeric arrow (`6 -> 4` or `6 → 4`). A knob with no removed
numeric assignment may instead use `new: <num>` or `initial <num>`.
Newly added literals directly assigned or compared to state-like names,
or passed as state/status/phase/disposition/outcome/reason kwargs, must
name an exit, terminal, dead-letter, re-entry, clear, or recovery path;
literals already anywhere in the merge-base tree are exempt.
`Numbers-waived: <reason>` and `State-exit-waived: <reason>` waive their
respective requirement and echo the reason.

HTML comments, fenced code blocks and inline code are stripped before
validating disclosures, state exits or waivers. Logging arguments and
literals merely near state-related words do not count as new states.

The same single manifest entry runs hermetic regression tests before
checking the body. Only changed lines trigger detection; flags,
comment-only lines, and unchanged context do not count. The detector
deliberately misses indirect/formula tuning: this is a disclosure
ratchet.

David approved this exact manifest and script/test change on
**2026-11-08 at 16:13Z**. No workflow file changed. The change is
limited to `.github/checks-manifest.yaml` and the two P6 files under
`.github/scripts/`.

## Why this check

The retro's #24481 HPA retune is the design precedent; the sweep below
exercises HPA bounds changes such as #24742. Its from/to wording is
supported, but its knob names are only in inline code, which the
requested prose-only rule excludes. Existing product-invariant and
failure-class checks validate different author declarations; neither
detects capacity knobs or new lifecycle literals. This check reuses the
manifest's existing diff/metadata plumbing without changing workflow
wiring or inventing another PR orchestration layer.

## Product invariants affected

none

Failure-Class: none

## Merged-PR false-positive sweep (2026-11-08T20:01:42.025036+00:00)

**200 merged PRs screened; 69 trigger-touching diffs checked; 16 would
fail and 53 would pass.** 14 failing PRs require numeric disclosures; 2
require state declarations (3 state literals total). The prior sweep
reported 18 failures; the refreshed capped corpus also advances its
merge cutoff.

Method: `gh pr list --repo BasedHardware/omi --state merged --search
'merged:>=2026-10-09' --limit 200 --json
number,title,body,mergeCommit,mergedAt,files`, followed by `gh pr diff
<number> --repo BasedHardware/omi` for matching paths. Full paginated
file lists were checked whenever the initial listing reached 100 files.
Each diff was checked against its PR body and reconstructed PR
merge-base: merge-parent merge-base for normal merges;
PR-head/merge-parent merge-base cross-checked with the recorded PR base
for one-parent merges. State candidates use a whole-tree lookup at that
merge-base.

The capped corpus spans **2026-11-04T12:58:21Z through
2026-11-08T19:20:24Z**: a sample within the requested 30-day window, not
full-month coverage. No production reads or GCP tier were used.

The stricter state association passes #24743 (the prior proximity-only
candidate). #24733 and #24729 now pass the expanded numeric wording. The
required inline-code stripping means #24742 still fails: its from/to
numbers are supported, but its matched knob names appear only in inline
code. #24884 and #24725 also fail when their state names are excluded as
inline code. These are explicit effects of the requested prose-only
policy, not claims that those historical PRs omitted all semantic
explanation.

Sample of would-fail PRs:

| PR | Detected change | Missing disclosure |
| --- | --- | --- |
| [#24889](#24889) | Tuning:
`max_count` | Initial/new numeric value naming a matched knob in prose,
before/after disclosure, or Numbers-waived |
| [#24884](#24884) | New state:
`record_barrier_aged` | State literal and exit declaration in prose, or
State-exit-waived (inline code is excluded) |
| [#24799](#24799) | Tuning:
`MIN_STORAGE_PCM_BUDGET_MB` | Initial/new numeric value naming a matched
knob in prose, before/after disclosure, or Numbers-waived |
| [#24742](#24742) | Tuning:
`maxReplicas`, `minReplicas` | Matched knob name in prose alongside the
existing from/to numbers |
| [#24736](#24736) | Tuning:
`PAGE_SIZE` | Initial/new numeric value naming a matched knob in prose,
before/after disclosure, or Numbers-waived |
| [#24725](#24725) | New state:
`marker_retry_overflow`, `marker_write_failed` | State literal and exit
declaration in prose, or State-exit-waived (inline code is excluded) |
| [#24716](#24716) | Tuning:
`limit` | Initial/new numeric value naming a matched knob in prose,
before/after disclosure, or Numbers-waived |
| [#24712](#24712) | Tuning:
`MAX_OWNER_DRAINS` | Numeric before/after, from/to or arrow disclosure
naming a matched knob in prose, or Numbers-waived |
| [#24710](#24710) | Tuning:
`MAX_DELAYED_OWNERS` | Initial/new numeric value naming a matched knob
in prose, before/after disclosure, or Numbers-waived |
| [#24707](#24707) | Tuning:
`MAX_HEAD_REQUEUES` | Numeric before/after, from/to or arrow disclosure
naming a matched knob in prose, or Numbers-waived |

All would-fail PRs: #24889, #24884, #24799, #24742, #24736, #24725,
#24716, #24712, #24710, #24707, #24703, #24697, #24689, #24680, #24643,
#24601.

## Validation

- **26 focused regression tests passed** on head
`1788dd10315e7a709dcaf6150838907638386ad0`, covering fenced/inline
examples, direct state association (including the logging regression),
from/to and arrows, and first-time versus changed numeric values.
- **`make preflight` passed all 14 selected local checks**, including 26
P6 tests and 78 manifest-contract tests, with `OMI_PR_BODY_FILE` and
`BACKEND_UNIT_FILE_BUDGET_SECONDS=900`. The normal bounded pre-push gate
also passed all 14 checks using the final body and the same budget, with
`GOOGLE_APPLICATION_CREDENTIALS` and every `CLOUDSDK_*` variable
removed.
- `scripts/pr-preflight --suggest` required no invariant citations;
`Failure-Class: none` is declared above.
- No workflow file changed; only the manifest and two P6 scripts differ
from the merge base.
- No production reads or GCP tier used. Full-month coverage beyond the
200-PR cap, indirect/formula tuning and product/runtime behavior are not
established by this check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Git-on-my-level added a commit that referenced this pull request Nov 9, 2026
## Change

Raise only production `recordSealRepair.workers` from 16 to 24 and
update the rendered-chart contract. Repair workers increase from 16 to
24. Resources, images, scheduling, and policy flags stay unchanged.

Pre-approved by lead2 ruling **f1ffa1**, 2026-11-08 18:37Z: GO,
values-only, $0 incremental node cost, rollback 16.

## Evidence and reason

The cl2-fixnow aggregate evidence record
`omi-workspace:data/run-2026-11-08-retro-fixnow/out-seal-levers.md`
measured 7,653 sealed+cleared rows across 53 runs, about **319
seals/hour** and **144.4 sealed/run**, during
**2026-11-07T18:00Z–2026-11-08T18:04Z** at 16 workers. The row-stage
sample (2026-11-08 15:00–18:04Z, 1,253 rows) measured sealed-row p50
**111.7 s**, including about **95 s** fixed startup/client construction
overhead. Normal terminal probes measured **6–8 Firestore reads per
attempted row**.

48 workers saturated the fixed stages on Nov 5 (#24729, reverted by
#24733). 24 is one measured concurrency rung to overlap overhead without
changing requests (2 CPU/4 Gi) or limits (4 CPU/8 Gi). Throughput
improvement is an expectation to validate, not a measured result at 24;
this change alone is not expected to clear the tail.

## Rollout gate and rollback

Deploy owner: **cl2-deploy**, through the **batch-pipeline-worker Helm
roll**. No production deployment is performed by this PR author. Do not
merge as part of this task.

Evaluate each of the **first 3 runs after the roll** using aggregate run
summaries, row-stage events, and terminal Firestore probes. Every run
must meet all four conditions:

- sealed-row elapsed **p50 < 200 s**;
- **sealed/run >= 190** (sealed + sealed_registered +
upload_failed_cleared, matching baseline);
- **budget_exhausted <= 40/run**;
- **Firestore reads/attempted row 6–8**.

**Any miss: revert `recordSealRepair.workers` to 16 via a values revert
and batch-pipeline-worker Helm roll.** Keep resources unchanged.
cl2-deploy owns the three-run evaluation and rollback.

## Validation

Offline chart/values tests run through `omi-workspace/bin/omi-heavy`:
`test_record_seal_cluster_repair_deploy.py`,
`test_record_seal_sweeper_deploy.py`,
`test_record_seal_worker_deploy.py`, and `test_batch_pipeline_chart.py`.
**122 tests passed in 14.45 s** on merge head
`23a48466fe4e628233b085372380eeb57e4abc56` (recorded
**2026-11-09T01:38:21Z**). Local tests establish rendered configuration,
not production performance.

## Product invariants affected

none

Failure-Class: none

Capacity failure addressed: seal repair drain below arrivals. This
bounded values tuning does not introduce a new registry definition or
claim class-wide prevention.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24962?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/24962?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24962&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
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