Skip to content

feat(pusher): byte-budgeted storage admission (default off) - #24799

Merged
Git-on-my-level merged 20 commits into
mainfrom
lane/lcbyteb
Nov 6, 2026
Merged

Git-on-my-level merged 20 commits into
mainfrom
lane/lcbyteb

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

What changed and why

Add process-wide non-waiting admission for custody PCM queued/running on the existing storage executor. PR-A #24788 supplied the gauges and pressure alerts. This PR adds admission, bounded refusal/error counters, an agent-tier refusal alert, hermetic saturation tests and the runbook. The flag remains 0 everywhere.

A full budget returns before submission, without a receipt, commit callback or opcode-203 ACK. It never raises into receive supervision or selects a close code. Original PCM, exact checkpoints, owner and start remain charged to the socket's existing 20 MiB budget. The first live refusal immediately pauses intake in that same cancellable receive task; it probes every 50 ms until the window commits, before reading another frame. Refusals cannot accumulate windows toward socket byte exhaustion. There is no extra retry task or global waiter list. Enabled windows cap at 4096 checkpoints.

Live admission uses 75% of the total; shutdown tails may use the full limit and bypass the intake pause. A full tail returns without an ACK and retains its producer fence. Outer-handler cancellation interrupts a paused receive task but skips the cancellation-time tail commit entirely. Connected or disconnected, this path submits no storage, produces no receipt and sends no ACK; the held producer fence and client WAL replay own recovery. Cleanup cannot wait for a new PCM storage operation or its retries. Already-submitted storage still holds its reservation until actual settlement and cannot send a late ACK. The existing external-cancellation close classification is preserved. Record begin/fail/seal/abandon/markers and projection operations remain ungated; executor pools are unchanged. Known-deleted retained owners use the existing gone-owner disposition. Every unresolved owner stays fenced in finalization: A's receipt cannot certify B's uncommitted tail.

Acquire faults roll back partial mutation and fail open using flag-0 storage dispatch. Release faults retire exactly their own reservation and are swallowed. Acquire fail-open also calls the shared fallback helper for every fault; the caller owns the rate-limited warning. Both acquire/release errors use omi_pusher_storage_pcm_errors_total{reason} through the enum helper and logs limited to one per reason per minute. Late post-cancellation storage failures are counted/logged through the same bounded path. Enabled capacity remains held until actual storage settlement, including caller cancellation.

Flag 0 preserves successful PCM/checkpoint/receipt/opcode-203 bytes, storage dispatch/cancellation and observational gauge semantics. It does not promise identical failure finalization: the new finalizer can still hold unresolved fences and defer inline finish after genuine failures at flag 0. Genuine storage-error handling remains in effect.

Flag, ramp and rollback

PUSHER_STORAGE_PCM_BUDGET_MB=0 is off / kill switch in code, manifests and dev/prod charts. Enabled deployment values must be >=27 MiB: ceil(20 MiB x 4/3), so an idle live lane admits any legal socket window. Smaller/malformed unvalidated startup values select off. Proposed canary size: 512 MiB (384 MiB live / 128 MiB reserved).

Separate approved enablement train, owner uicleanup (omi-lifecycle): dev chart -> one canary pod for 15 minutes with socket kills <=15/15min and memory p99 <75% of 3.5 GiB; inspect refusals, accounting/GCS errors and capacity/abandon outcomes -> fleet within one day of a clean canary, or report the failed gate. Rollback: chart value 0 through ordinary rollout, without rebuilding or changing custody objects/tokens. No enablement, GCP access, PR merge or deploy in this task.

Product invariants affected

INV-MEM-4: the runtime manifest adds only the pusher admission setting; canonical memory admission/promotion authority is unchanged.

How it was verified

  • Test FIRST on base d478192: first run 2 passes / 1 strict xfail; expanded baseline 2 passes / 7 strict xfails. Unbounded submitted bytes and missing refusal retention were expected failures. Final tests have no xfail escape.
  • Real commit helper/executor with event-controlled GCS: 50 producers, 512 KiB windows, synthetic 8 MiB budget, <=6 MiB live submissions and 38 refusals. Thirty further refusal probes preserve exact input without increasing submissions; recovery commits all 50 once. Current/high-water RSS plateaus, Python allocations fall and byte accounting drains. The recorder retains digests, not PCM history. 50 x 4 KiB tails fit the reserve during live saturation.
  • Final focused delta: 38 saturation tests passed. The real receive loop is offered 30 full-minute windows while admission stays full for >=30 probes: only the first enters, its byte charge stays below half the socket limit, and there is no receipt/ACK/close. Recovery commits once; cancellation keeps the original window/checkpoints and fence for WAL replay without submitting a tail; a fully saturated normal tail keeps its fence. Acquire/release exceptions before and after mutation preserve another socket's reservation, still store/ACK, never close, increment bounded counters and produce rate-limited logs. Late post-cancellation failures are observed, counted and logged.
  • Final focused validation: 168 saturation/queue-wait/outbox tests passed (38 + 28 + 102). New disconnected-peer and event-stalled-storage cancellation cases complete cleanup within one second without a new storage call, receipt or ACK; original PCM/checkpoints and producer fences remain intact. Already-submitted storage keeps its byte reservation until actual completion and releases exactly once without a late ACK, on success or failure. Earlier validation passed 362 surrounding tests, including the closed-reason guard, executors, metrics, alert contracts, abandonment and record barriers. The earlier cancellation-flush behavior was removed after focused review: cancellation of an admission pause now leaves the unacknowledged window for WAL replay instead of starting storage during cleanup. The final shared-fallback accounting check also passed all 4 cases. Earlier broader implementation checks passed 456 offline pre-deploy tests and 55 make preflight checks.
  • Final normal pre-push passed on 2e94b0753d5c1951aa53a1c1110180d2a9dfbc63: all guards enabled, approved 900-second file budget, two-check scheduling, zero type errors, all 38 saturation cases and all 115 route-verifier cases rerun successfully, OpenAPI compatibility and formatting passed. Final metadata validation passed all 4 checks. CI checks track the exact published head.
  • Two parallel independent custody reviews, including Grok, were completed with regressions for their findings. The final Luna FIX-FIRST delta addresses both P1s (first-refusal pause and fail-open accounting), plus the GLM documentation/late-failure observations. No further review round requested; lead2 owns the focused delta review.

Not measured: listen re-offer cadence, projection-debt aggregate, GCS client buffering, real sockets/pod, 48 kHz prevalence or production tail distribution. The budget bounds submitted PCM, not total pod RSS; allocator pages need not immediately return to the OS. No deployed playback or installed-client WAL proof is claimed.

Tests

Primary regression: backend/tests/unit/test_pusher_storage_pcm_saturation.py; flag declarations: test_pusher_storage_pcm_config.py; exact rendered binding: test_verify_pusher_config_references.py. Heavy checks use bin/omi-heavy with cloud credential/project variables unset. The handoff-approved BACKEND_UNIT_FILE_BUDGET_SECONDS=900 is used for the Firestore guard, with no skipped guard.

UI evidence

UI-Evidence: none -- backend admission/configuration only.

Failure class (fixes)

Failure-Class: FC-cancel-path-unbounded-terminal-send

New guards

Saturation/retention tests protect the socket-kill class exposed by #24689: refusal cannot raise, close, trim PCM or falsely ACK. Long refusal, accounting-fault, disconnected-peer cancellation and stalled-storage cleanup regressions protect the review findings. Cancelling admission skips storage and ACK while retaining the producer fence for WAL replay.

Line-Count-Exception: backend/routers/pusher.py | 1872 -> 2032 | Keep first-refusal intake control, fault isolation and producer-close proof at the existing receive-loop custody seam; isolate transactional byte accounting without pool or ACK refactors.
Line-Count-Exception: backend/utils/metrics.py | 1715 -> 1736 | Add and zero-initialize bounded refusal and accounting-error counters alongside the PR-A gauges.

@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.

7 issues found across 23 files

Confidence score: 3/5

  • test_pusher_storage_pcm_saturation.py runs a stress/polling workload in the normal unit lane, which can slow or flake CI under the fast-test duration guard. Mark the module slow.
  • test_monitoring_alert_rule_contract.py can pass even if the agent-only alert is paused or routed incorrectly. Assert isPaused == false and the expected mute interval.
  • test_pusher_storage_pcm_saturation.py does not cover the begin-failure case named in the test title, so that fencing behavior could regress unnoticed. Inject a set_record_upload_pending failure and assert the conversation is fenced and the failure path runs.
  • metrics.py records three omi_reason_total events at import time, even when no PCM refusal occurred. Initialize the counter children with the enum value directly and reserve reason_label for actual events.
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/monitoring/alert-rules.json">

<violation number="1" location="backend/charts/monitoring/alert-rules.json:29356">
P3: Add spaces in the operator-facing annotations (`older than 120s`, `to 0`, and `for 30m`) so alert notifications and rollback guidance remain readable.</violation>
</file>

<file name="backend/tests/unit/test_monitoring_alert_rule_contract.py">

<violation number="1" location="backend/tests/unit/test_monitoring_alert_rule_contract.py:2229">
P2: This contract does not enforce that the agent-only alert remains enabled and muted. Add assertions for `isPaused == false` and `notification_settings.mute_time_intervals == ['omi-tier-silent']` so a routing or pause regression cannot silently pass.</violation>
</file>

<file name="backend/docs/feature-flag-registry.md">

<violation number="1" location="backend/docs/feature-flag-registry.md:886">
P3: This registry summary omits the 27 MiB minimum and invalid-value behavior. Operators consulting only the catalog cannot tell that positive values below 27 MiB are rejected or silently select the off state; document that constraint in the source summary before regenerating this file.</violation>
</file>

<file name="backend/tests/unit/test_pusher_storage_pcm_saturation.py">

<violation number="1" location="backend/tests/unit/test_pusher_storage_pcm_saturation.py:22">
P2: Mark this saturation module slow; otherwise the normal unit lane executes its stress/polling workload and applies the fast-test duration guard, making CI unnecessarily slow or flaky.</violation>

<violation number="2" location="backend/tests/unit/test_pusher_storage_pcm_saturation.py:416">
P2: This test does not exercise the begin-failure scenario named in its title. Inject a `set_record_upload_pending` failure (or capacity state) and assert that `begin_recording` fences the conversation and invokes the failure cleanup before testing close and abandon.</violation>
</file>

<file name="backend/docs/listen_pusher_pipeline/changes/2026-11-06-pusher-storage-pcm-budget.md">

<violation number="1" location="backend/docs/listen_pusher_pipeline/changes/2026-11-06-pusher-storage-pcm-budget.md:5">
P3: The deployment requirement is rendered as `requires0 or at least27 MiB`, which is ambiguous in the operational contract. Write `requires 0 or at least 27 MiB` so the accepted values are unambiguous.</violation>
</file>

<file name="backend/utils/metrics.py">

<violation number="1" location="backend/utils/metrics.py:103">
P3: Initializing these counter children through `reason_label` records three `omi_reason_total` events at import time, even when no PCM refusal occurred. Use the enum value directly for child initialization and reserve `reason_label` for actual runtime events.</violation>
</file>

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

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

for export_name, rules in _all_rule_exports().items():
rule = rules['omi-pusher-storage-pcm-refusals']
assert rule['for'] == '30m', export_name
assert rule['labels']['tier'] == 'agent' and rule['labels']['audience'] == 'agent'

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 contract does not enforce that the agent-only alert remains enabled and muted. Add assertions for isPaused == false and notification_settings.mute_time_intervals == ['omi-tier-silent'] so a routing or pause regression cannot silently pass.

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/tests/unit/test_monitoring_alert_rule_contract.py, line 2229:

<comment>This contract does not enforce that the agent-only alert remains enabled and muted. Add assertions for `isPaused == false` and `notification_settings.mute_time_intervals == ['omi-tier-silent']` so a routing or pause regression cannot silently pass.</comment>

<file context>
@@ -2220,3 +2220,18 @@ def test_pusher_storage_queue_and_memory_alerts_observe_fresh_current_state():
+    for export_name, rules in _all_rule_exports().items():
+        rule = rules['omi-pusher-storage-pcm-refusals']
+        assert rule['for'] == '30m', export_name
+        assert rule['labels']['tier'] == 'agent' and rule['labels']['audience'] == 'agent'
+        assert rule['labels']['owner'] == 'omi-lifecycle'
+        assert rule['noDataState'] == 'OK'
</file context>
Suggested change
assert rule['labels']['tier'] == 'agent' and rule['labels']['audience'] == 'agent'
assert rule['labels']['tier'] == 'agent' and rule['labels']['audience'] == 'agent'
assert rule['notification_settings']['mute_time_intervals'] == ['omi-tier-silent']
assert not rule['isPaused']



@pytest.mark.asyncio
async def test_real_barrier_begin_failure_close_and_abandon_during_pcm_saturation(inline_session, monkeypatch):

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 test does not exercise the begin-failure scenario named in its title. Inject a set_record_upload_pending failure (or capacity state) and assert that begin_recording fences the conversation and invokes the failure cleanup before testing close and abandon.

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/tests/unit/test_pusher_storage_pcm_saturation.py, line 416:

<comment>This test does not exercise the begin-failure scenario named in its title. Inject a `set_record_upload_pending` failure (or capacity state) and assert that `begin_recording` fences the conversation and invokes the failure cleanup before testing close and abandon.</comment>

<file context>
@@ -0,0 +1,683 @@
+
+
[email protected]
+async def test_real_barrier_begin_failure_close_and_abandon_during_pcm_saturation(inline_session, monkeypatch):
+    client, path, barrier, _ = inline_session
+    budget = configure(monkeypatch, LIMIT)
</file context>

from types import SimpleNamespace
from unittest.mock import AsyncMock, MagicMock

import pytest

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: Mark this saturation module slow; otherwise the normal unit lane executes its stress/polling workload and applies the fast-test duration guard, making CI unnecessarily slow or flaky.

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/tests/unit/test_pusher_storage_pcm_saturation.py, line 22:

<comment>Mark this saturation module slow; otherwise the normal unit lane executes its stress/polling workload and applies the fast-test duration guard, making CI unnecessarily slow or flaky.</comment>

<file context>
@@ -0,0 +1,683 @@
+from types import SimpleNamespace
+from unittest.mock import AsyncMock, MagicMock
+
+import pytest
+
+from routers import pusher
</file context>

"threshold": "Refusal rate >0 continuously for 30m.",
"summary": "Pusher custody storage admission remains saturated.",
"user_impact": "Refused PCM has no receipt or opcode-203 ACK. Client WAL stays retained for replay; live socket is not closed by refusal.",
"scope": "Production pusher byte-admission refusals only, by live/tail stage; stale samples older than120s are excluded. No signal proves playback or client replay cadence.",

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: Add spaces in the operator-facing annotations (older than 120s, to 0, and for 30m) so alert notifications and rollback guidance remain readable.

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/monitoring/alert-rules.json, line 29356:

<comment>Add spaces in the operator-facing annotations (`older than 120s`, `to 0`, and `for 30m`) so alert notifications and rollback guidance remain readable.</comment>

<file context>
@@ -29248,5 +29248,140 @@
+      "threshold": "Refusal rate >0 continuously for 30m.",
+      "summary": "Pusher custody storage admission remains saturated.",
+      "user_impact": "Refused PCM has no receipt or opcode-203 ACK. Client WAL stays retained for replay; live socket is not closed by refusal.",
+      "scope": "Production pusher byte-admission refusals only, by live/tail stage; stale samples older than120s are excluded. No signal proves playback or client replay cadence.",
+      "verification": "Compare the running release, configured budget limit, in-flight bytes, refusal stages, storage queued/active work and GCS errors. Confirm socket kills and pod memory separately.",
+      "safe_next_action": "Escalate to omi-lifecycle. Preserve source WALs and custody objects. Approved rollback sets PUSHER_STORAGE_PCM_BUDGET_MB chart value to0; do not clear producer fences or delete audio.",
</file context>

Comment thread backend/docs/listen_pusher_pipeline.mdx Resolved
| `PARAKEET_USE_V2` | Select Parakeet prerecorded v2 pipeline | backend | env | open | — | — | — | — | keep | keep | — | unowned |
| `PUSHER_MAX_ABANDON_RECORD_DRAINS` | Per-pod abandon coordinators; default and prod4, clamped0..16 | backend | env | closed | — | — | 4 (pusher (chart)); {value: '4', category: rollout} (gke/pusher) | — | keep | keep | — | two-lane lead |
| `PUSHER_MAX_CLOSED_RECORD_DRAINS` | Per-process retained closed-record drain count; default32, clamped8..128, prod64 | backend | env | closed | — | — | 64 (pusher (chart)); {value: '64', category: rollout} (gke/pusher) | — | keep | keep | — | two-lane lead |
| `PUSHER_STORAGE_PCM_BUDGET_MB` | Process-wide queued/running custody PCM byte admission; default0 off, MiB with 25 percent reserved for tails | backend | env | open | {value: '0', category: ops_kill} | 0 (pusher (chart)); {value: '0', category: ops_kill} (gke/pusher) | 0 (pusher (chart)); {value: '0', category: ops_kill} (gke/pusher) | — | keep | keep | — | uicleanup (omi-lifecycle) |

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: This registry summary omits the 27 MiB minimum and invalid-value behavior. Operators consulting only the catalog cannot tell that positive values below 27 MiB are rejected or silently select the off state; document that constraint in the source summary before regenerating this file.

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/feature-flag-registry.md, line 886:

<comment>This registry summary omits the 27 MiB minimum and invalid-value behavior. Operators consulting only the catalog cannot tell that positive values below 27 MiB are rejected or silently select the off state; document that constraint in the source summary before regenerating this file.</comment>

<file context>
@@ -883,6 +883,7 @@ and an explicit empty literal renders as `''`.
 | `PARAKEET_USE_V2` | Select Parakeet prerecorded v2 pipeline | backend | env | open | — | — | — | — | keep | keep | — | unowned |
 | `PUSHER_MAX_ABANDON_RECORD_DRAINS` | Per-pod abandon coordinators; default and prod4, clamped0..16 | backend | env | closed | — | — | 4 (pusher (chart)); {value: '4', category: rollout} (gke/pusher) | — | keep | keep | — | two-lane lead |
 | `PUSHER_MAX_CLOSED_RECORD_DRAINS` | Per-process retained closed-record drain count; default32, clamped8..128, prod64 | backend | env | closed | — | — | 64 (pusher (chart)); {value: '64', category: rollout} (gke/pusher) | — | keep | keep | — | two-lane lead |
+| `PUSHER_STORAGE_PCM_BUDGET_MB` | Process-wide queued/running custody PCM byte admission; default0 off, MiB with 25 percent reserved for tails | backend | env | open | {value: '0', category: ops_kill} | 0 (pusher (chart)); {value: '0', category: ops_kill} (gke/pusher) | 0 (pusher (chart)); {value: '0', category: ops_kill} (gke/pusher) | — | keep | keep | — | uicleanup (omi-lifecycle) |
 | `RECORDING_SESSION_MODE` | Select recording session migration mode | backend | env | closed | — | — | — | — | keep | keep | — | unowned |
 | `RECORD_SEAL_REPAIR_MODE` | plan or apply; default apply, plan performs canonical proofs without writes | backend | env | closed | — | — | — | — | keep | keep | — | two-lane lead |
</file context>


The [runtime contract](../../listen_pusher_pipeline.mdx) adds
`PUSHER_STORAGE_PCM_BUDGET_MB=0`: default off everywhere, with a proposed
512 MiB canary size. Deployment validation requires0 or at least27 MiB

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 deployment requirement is rendered as requires0 or at least27 MiB, which is ambiguous in the operational contract. Write requires 0 or at least 27 MiB so the accepted values are unambiguous.

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/listen_pusher_pipeline/changes/2026-11-06-pusher-storage-pcm-budget.md, line 5:

<comment>The deployment requirement is rendered as `requires0 or at least27 MiB`, which is ambiguous in the operational contract. Write `requires 0 or at least 27 MiB` so the accepted values are unambiguous.</comment>

<file context>
@@ -0,0 +1,51 @@
+
+The [runtime contract](../../listen_pusher_pipeline.mdx) adds
+`PUSHER_STORAGE_PCM_BUDGET_MB=0`: default off everywhere, with a proposed
+512 MiB canary size. Deployment validation requires0 or at least27 MiB
+(ceil of20 MiB x4/3), ensuring a largest legal socket window can progress when
+the live lane is idle; smaller/malformed unvalidated runtime values select off. The [runbook](../../runbooks/audio-durable-outbox.md#pusher-pcm-storage-byte-admission-default-off)
</file context>

Comment thread backend/utils/metrics.py
)

for _pcm_stage in PusherPcmStage:
PUSHER_STORAGE_PCM_REFUSALS_TOTAL.labels(stage=reason_label(ReasonFamily.PUSHER_PCM, _pcm_stage, PusherPcmStage))

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: Initializing these counter children through reason_label records three omi_reason_total events at import time, even when no PCM refusal occurred. Use the enum value directly for child initialization and reserve reason_label for actual runtime events.

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/utils/metrics.py, line 103:

<comment>Initializing these counter children through `reason_label` records three `omi_reason_total` events at import time, even when no PCM refusal occurred. Use the enum value directly for child initialization and reserve `reason_label` for actual runtime events.</comment>

<file context>
@@ -83,14 +83,25 @@
+)
+
+for _pcm_stage in PusherPcmStage:
+    PUSHER_STORAGE_PCM_REFUSALS_TOTAL.labels(stage=reason_label(ReasonFamily.PUSHER_PCM, _pcm_stage, PusherPcmStage))
+
 PUSHER_QUEUE_DROPS = Counter(
</file context>
Suggested change
PUSHER_STORAGE_PCM_REFUSALS_TOTAL.labels(stage=reason_label(ReasonFamily.PUSHER_PCM, _pcm_stage, PusherPcmStage))
PUSHER_STORAGE_PCM_REFUSALS_TOTAL.labels(stage=_pcm_stage.value)

@Git-on-my-level
Git-on-my-level merged commit 7268b46 into main Nov 6, 2026
60 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/lcbyteb branch November 6, 2026 22:11
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