Skip to content

chore(batch): preserve approved prod worker HPA 4/8 bounds - #24742

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/prod-batch-worker-hpa-4-8
Nov 6, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/prod-batch-worker-hpa-4-8

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Preserve David's D4 approval via coordinator ask bc18db: cl2-deploy patched prod-omi-batch-pipeline-worker at 2026-11-06 00:50Z from min 6 / max 12 to min 4 / max 8 after the transcription backlog drained. Set replicaCount and autoscaling.minReplicas to 4 together and autoscaling.maxReplicas to 8 so the next worker roll preserves that decision.

Update only the related prod-worker test and runbook pins. Rollback: restore baseline/min 6 and max 12 if GPU queue depth or ready_units climbs back past 50k. Borrow pools and all other values are unchanged.

Validation: make setup; four focused chart/HPA replay files (111 tests); make preflight; PR-body preflight; normal pre-push hooks. The historical Nov 1 replay exceeds the new eight-worker capacity ceiling for 51 minutes; its check now requires every shortfall to be above that ceiling, retaining the ready-signal dominance check. This is historical sensitivity evidence, not present-demand qualification. No live changes or GCP tier used for this PR.

View guided diff Turn on auto-fix

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 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-06T01:09:06.184212Z acdb2a3 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.

3 issues found across 7 files

Confidence score: 4/5

  • The 4/8 production contract in backend/docs/runbooks/batch-vendor-routing-capacity.md conflicts with the canonical capacity document and the chart and worker documentation that still describe 4/16. Update those references together, or mark them historical.
  • The rollback trigger in backend/docs/runbooks/batch-vendor-routing-capacity.md does not identify the exact fresh HPA value, so operators could use a per-priority or stale count. Name the HPA value explicitly.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/charts/batch-pipeline-worker/prod_omi_batch-pipeline-worker_values.yaml">

<violation number="1" location="backend/charts/batch-pipeline-worker/prod_omi_batch-pipeline-worker_values.yaml:21">
P3: The production ceiling is now 8, but the chart's own configuration comment and worker documentation still describe the current shape as 4/16. Update those references or explicitly mark them historical so operators do not use the stale ceiling.</violation>
</file>

<file name="backend/docs/runbooks/batch-vendor-routing-capacity.md">

<violation number="1" location="backend/docs/runbooks/batch-vendor-routing-capacity.md:27">
P2: These runbooks make 4/8 the current production contract, but the canonical worker capacity document still says production is min4/max16. Update the canonical capacity and rollback guidance in the same change.</violation>

<violation number="2" location="backend/docs/runbooks/batch-vendor-routing-capacity.md:30">
P2: This rollback trigger is ambiguous: `ready_units` is not the named HPA metric, and the adapter sums fresh per-priority maxima. Name the exact fresh HPA value so operators do not use a per-class or stale count.</violation>
</file>

Reply with feedback, questions, or to request a fix.

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

max 8.** cl2-deploy patched the live HPA at 00:50Z after the transcription
backlog drained. The chart preserves those bounds; Helm's existing lookup
preserves the live replica count on upgrades. Rollback: restore baseline/min 6
and max 12 if GPU queue depth or ready_units climbs back past 50k.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This rollback trigger is ambiguous: ready_units is not the named HPA metric, and the adapter sums fresh per-priority maxima. Name the exact fresh HPA value so operators do not use a per-class or stale count.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/docs/runbooks/batch-vendor-routing-capacity.md, line 30:

<comment>This rollback trigger is ambiguous: `ready_units` is not the named HPA metric, and the adapter sums fresh per-priority maxima. Name the exact fresh HPA value so operators do not use a per-class or stale count.</comment>

<file context>
@@ -23,27 +23,25 @@ config-train change, never a code change.
+max 8.** cl2-deploy patched the live HPA at 00:50Z after the transcription
+backlog drained. The chart preserves those bounds; Helm's existing lookup
+preserves the live replica count on upgrades. Rollback: restore baseline/min 6
+and max 12 if GPU queue depth or ready_units climbs back past 50k.
 
-These audited bounds are not full-volume capacity qualification. The historical
</file context>

Recheck Ready on-demand capacity before any later roll; do not scale down to
the earlier baseline as part of an observability rollback.
**Current bounds (2026-11-06, David D4 / coordinator ask bc18db): baseline/min 4,
max 8.** cl2-deploy patched the live HPA at 00:50Z after the transcription

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: These runbooks make 4/8 the current production contract, but the canonical worker capacity document still says production is min4/max16. Update the canonical capacity and rollback guidance in the same change.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/docs/runbooks/batch-vendor-routing-capacity.md, line 27:

<comment>These runbooks make 4/8 the current production contract, but the canonical worker capacity document still says production is min4/max16. Update the canonical capacity and rollback guidance in the same change.</comment>

<file context>
@@ -23,27 +23,25 @@ config-train change, never a code change.
-Recheck Ready on-demand capacity before any later roll; do not scale down to
-the earlier baseline as part of an observability rollback.
+**Current bounds (2026-11-06, David D4 / coordinator ask bc18db): baseline/min 4,
+max 8.** cl2-deploy patched the live HPA at 00:50Z after the transcription
+backlog drained. The chart preserves those bounds; Helm's existing lookup
+preserves the live replica count on upgrades. Rollback: restore baseline/min 6
</file context>

minReplicas: 6
maxReplicas: 12
minReplicas: 4
maxReplicas: 8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The production ceiling is now 8, but the chart's own configuration comment and worker documentation still describe the current shape as 4/16. Update those references or explicitly mark them historical so operators do not use the stale ceiling.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/charts/batch-pipeline-worker/prod_omi_batch-pipeline-worker_values.yaml, line 21:

<comment>The production ceiling is now 8, but the chart's own configuration comment and worker documentation still describe the current shape as 4/16. Update those references or explicitly mark them historical so operators do not use the stale ceiling.</comment>

<file context>
@@ -10,16 +10,15 @@ dataPlaneProject: based-hardware
-  minReplicas: 6
-  maxReplicas: 12
+  minReplicas: 4
+  maxReplicas: 8
   balancedPools:
     enabled: false
</file context>

@Git-on-my-level
Git-on-my-level merged commit 3f56e56 into main Nov 6, 2026
64 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/prod-batch-worker-hpa-4-8 branch November 6, 2026 12:32
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)
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