Skip to content

fix(batch): bound privacy-blocked projection drain retries - #24743

Merged
Git-on-my-level merged 4 commits into
mainfrom
lane/pipeline-privblock
Nov 6, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
lane/pipeline-privblock

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Problem

Privacy-blocked heads consume repeated zero-progress owner-drain turns. The recorded 2026-11-05 00:50–01:05Z window in workspace data/run-2026-11-05-omi-pipeline/pagetick-ramp.txt:7-9 shows 85% of drain turns stopped on privacy-blocked heads and drain throughput of 4.3 rows/s. For cl2-cost's tombstone-gap count, see cl2-cost ca4a4a.

Fix

Scheduling only, per lead2 ruling 2b59ad. A zero-progress blocked_privacy_* turn records its head result row and observed update_time from the walk's existing snapshot. The owner enters the existing capped delayed map. Incoming wakes before the TTL read that one result document: a changed row wakes the owner early; an unchanged row remains deferred until the existing deadline. TTL expiry always releases the version hold and runs a normal owner-drain turn, since privacy can change outside the head row. If that turn is blocked again, it is deferred for one new TTL. Read errors or unavailable version metadata fail open. The timer's default maximum interval is 180s, configured by PROJECTION_DRAIN_PRIVACY_BACKOFF_SECONDS and clamped to 30–900s. Incoming wakes do not postpone the timer deadline; checks use the existing bounded drain slots.

Productive turns retain existing FIFO behavior. Close cancels timers and clears bounded version state. The default-on PROJECTION_DRAIN_PRIVACY_BACKOFF switch is disabled only by off and is registered through config/policy, flag budget and generated registry. Serving GMP retains bounded privacy-stop reasons (tombstone/refusal_no_longer_applies/other), applied backoffs and early re-requests on row changes.

No changes to settle_refusals, hold(), resume(), check_unit_privacy or privacy/session code. The refusal-resume switch and metrics have been removed from this PR. No row is terminalized, deleted or written by the scheduling change.

Tests

944 tests passed across 26 files via BACKEND_UNIT_TEST_FILE_LIST and bash backend/test.sh under omi-heavy, including projection, owner-drain, privacy/session, policy and reason-label ratchets, flag-budget, GMP and sync-capture tests. All 4 PR metadata checks and all 41 repository preflight checks passed. Focused owner-drain tests cover deferral, changed-row early wakes, unchanged-row TTL retries, re-deferral after another blocked turn, expiry racing an early version check, productive turns, read-error fail-open, switch-off behavior, bounded state and shutdown.

Risk and rollback

A blocked owner waits at most one TTL before an ordinary drain turn retries privacy state, including changes outside the head result row. Incoming wakes can detect a row change sooner without postponing that deadline. Set PROJECTION_DRAIN_PRIVACY_BACKOFF=off to restore the previous scheduler behavior. Unit tests only; no production access, merge or deployment.

Failure-Class: FC-event-wakes-bypass-request-cadence

Line-Count-Exception: backend/utils/batch_pipeline/projection.py | 1704 -> 1710 | Carry the blocked head identity and update_time from the existing walk snapshot into the scheduler without extra blocked-turn reads or privacy/session changes; six lines of scheduling metadata.

Failure-Class: FC-retry-resume-behind-own-fence
@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-06T02:23:15.153498Z 2f56629 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: 9604827687

ℹ️ 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".


def projection_drain_privacy_backoff_enabled() -> bool:
"""Default on; only off disables zero-progress privacy turn backoff."""
from config.policy import kill_switch

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 Move the new kill-switch imports to module scope

Both new kill-switch helpers import kill_switch inside their function bodies, contrary to the explicit Import Rules in backend/AGENTS.md, which require all imports at module scope. Move the shared dependency to the module-level imports rather than extending the existing function-local import pattern.

AGENTS.md reference: backend/AGENTS.md:L166-L168

Useful? React with 👍 / 👎.

Comment on lines +54 to +59
if (
not ignore_hint
and str(blocked) == 'privacy refusal no longer applies'
and projection_privacy_refusal_resume_enabled()
):
continue

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 Add the required pipeline lifecycle change note

This changes conversation projection lifecycle behavior by resuming stale privacy refusals and delaying blocked owner retries, but the commit does not include the pipeline change note required by backend/AGENTS.md. I checked the commit's changed-file list and searched backend/docs/listen_pusher_pipeline* for both new switches; neither behavior is documented there. Add a dated note describing the fenced resume path, backoff defaults and bounds, and rollback switches so the lifecycle documentation reflects the new default-on behavior.

AGENTS.md reference: backend/AGENTS.md:L164-L164

Useful? React with 👍 / 👎.

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

2 issues found across 14 files

Confidence score: 5/5

  • config/feature-flags.yaml omits the timer default and bounds, plus the new omi_batch_projection_privacy_* metrics, so operators may miss the tuning value and signals to watch. Add them to the registry notes.
  • backend/docs/feature-flag-registry.md includes Nov 6 declarations but is still marked as-of Nov 5, which can make the snapshot and overdue calculations misleading. Regenerate it with the current as-of date.
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/docs/feature-flag-registry.md">

<violation number="1" location="backend/docs/feature-flag-registry.md:715">
P3: These Nov 6 declarations are included in a registry still marked as-of Nov 5. Regenerate the registry with the current as-of date so its snapshot and overdue calculations match its contents.</violation>
</file>

<file name="config/feature-flags.yaml">

<violation number="1" location="config/feature-flags.yaml:225">
P3: The registry notes omit the timer knob, its 180s default and 30–900s bounds, and the new `omi_batch_projection_privacy_*` metrics. Add them so operators can find the tuning value and the signals to watch.</violation>
</file>

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

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

Comment thread backend/docs/feature-flag-registry.md Outdated
| `PINNED_SPEAKER_PRIOR_ENABLED` | Turn near-misses on pinned people into suggestions and record voice candidates for the suggestion card (never loosens auto-labels) | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
| `PLAYBACK_MANIFEST_RECOVERY_ENABLED` | Default on; next-access recovery for merge_failed playback markers after 15 minutes, deduped by marker generation | backend | env | closed | — | — | — | — | keep | keep | — | dazheng |
| `PROJECTION_DRAIN_CLAIM_AWARE` | Default on; read-only fleet claim admission and jittered backoff for redundant claim-busy owner-drain requests | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
| `PROJECTION_DRAIN_PRIVACY_BACKOFF` | Default on; defer zero-progress privacy-blocked owner drains with a bounded timer | backend | env | open | — | — | — | — | keep | keep | — | dazheng |

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: These Nov 6 declarations are included in a registry still marked as-of Nov 5. Regenerate the registry with the current as-of date so its snapshot and overdue calculations match its contents.

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 715:

<comment>These Nov 6 declarations are included in a registry still marked as-of Nov 5. Regenerate the registry with the current as-of date so its snapshot and overdue calculations match its contents.</comment>

<file context>
@@ -712,6 +712,8 @@ and an explicit empty literal renders as `''`.
 | `PINNED_SPEAKER_PRIOR_ENABLED` | Turn near-misses on pinned people into suggestions and record voice candidates for the suggestion card (never loosens auto-labels) | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
 | `PLAYBACK_MANIFEST_RECOVERY_ENABLED` | Default on; next-access recovery for merge_failed playback markers after 15 minutes, deduped by marker generation | backend | env | closed | — | — | — | — | keep | keep | — | dazheng |
 | `PROJECTION_DRAIN_CLAIM_AWARE` | Default on; read-only fleet claim admission and jittered backoff for redundant claim-busy owner-drain requests | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
+| `PROJECTION_DRAIN_PRIVACY_BACKOFF` | Default on; defer zero-progress privacy-blocked owner drains with a bounded timer | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
+| `PROJECTION_PRIVACY_REFUSAL_RESUME` | Default on; settle stale privacy refusal hints through fenced resume or assignment | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
 | `PUBLIC_SHARED_CONVERSATION_CHAT_MODE` | Enable chat on public shared conversations | backend | env | closed | declared (gke/backend-listen); gateway (cloud_run/backend, cloud_run/backend-integration, cloud_run/backend-sync, cloud_run/backend-sync-backfill) | gateway (backend-listen (chart), cloud_run/backend, cloud_run/backend-integration, cloud_run/backend-sync, cloud_run/backend-sync-backfill, gke/backend-listen) | gateway (cloud_run/backend, cloud_run/backend-integration, cloud_run/backend-sync, cloud_run/backend-sync-backfill); off (backend-listen (chart), gke/backend-listen) | — | keep | keep | — | dazheng |
</file context>

Comment thread config/feature-flags.yaml Outdated
- {"key":"BATCH_PIPELINE_MAX_OWNER_DRAINS","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default 8; concurrent owner drains per process, clamped to 1-16 at import; malformed keeps 8","fail":"closed","owner":"lead2","created":"2026-11-05","terminal":"keep","decision":"keep","notes":"Code only; deployment shape pending David. Safe start: dedicated service only, N=4 instances, pages 1, tick 2 s, MAX_OWNER_DRAINS 8. Never enable the pump on backend-integration; the selector is service-wide. Lead2 owns rollout after the deployment-shape decision. Keep serving sweeps ON until owner_drain advanced >=20 rows/s for 30 min and a dedicated-service missing/stale omi_batch_projection_pump_last_tick_seconds alert is installed and verified. Alarm on Firestore read rate above +50% of pre-cutover; owner_drain rows/s must remain at least 70% of pre-cutover. Watch sweep elapsed time and executor saturation. Evaluate claim_busy share no higher than pre-cutover only after serving sweeps are switched off, not during dual-running. Rollback via env-only new revisions: serving sweeps ON on existing service first, pump false on dedicated service, owner drains 8."}
- {"key":"BATCH_PIPELINE_OWNER_DRAIN_ENABLED","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; a per-process owner drain walks each discovered owner's result log continuously (up to 8 owners at once, 120 s turns, FIFO re-queue) instead of the sweep-shared 30 s walk budget","fail":"open","owner":"dazheng","created":"2026-10-20","terminal":"keep","decision":"keep","notes":"False restores the sweep owner-chain walk with every pre-check; read-ahead (BATCH_PIPELINE_PROJECTION_PREFETCH=0) and the deferred index (BATCH_PIPELINE_PROJECTION_INDEX_DEFERRED_ENABLED=false) have their own switches, and all three off is the pre-drain behaviour. On: the sweep only discovers owners; each walk holds the advisory owner claim for its 15 s step and skips the predecessor/per-part pre-check transactions for rows it reached as the watermark's successor. The assignment transaction's predecessor, privacy and receipt fences stay authoritative; one owner never runs two chains. See backend/docs/batch-pipeline-serving.md."}
- {"key":"PROJECTION_DRAIN_CLAIM_AWARE","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; read-only fleet claim admission and jittered backoff for redundant claim-busy owner-drain requests","fail":"open","owner":"dazheng","created":"2026-11-05","terminal":"keep","decision":"keep","notes":"Only off disables this switch, including when CAPTURE_COVERAGE_MODE=serve; false, 0 and unknown values remain on. Initial admissions GET the existing Redis claim and fail open on any error. Backoff applies only to claim_busy turns re-requested through again; productive more=True continuations retain immediate FIFO progress without the peek. See backend/docs/listen_pusher_pipeline.mdx#batch-projection-drain-admission."}
- {"key":"PROJECTION_DRAIN_PRIVACY_BACKOFF","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; defer zero-progress privacy-blocked owner drains with a bounded timer","fail":"open","owner":"dazheng","created":"2026-11-06","terminal":"keep","decision":"keep","notes":"Only off disables this switch. Privacy guards, deletion and tombstone semantics remain unchanged."}

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 registry notes omit the timer knob, its 180s default and 30–900s bounds, and the new omi_batch_projection_privacy_* metrics. Add them so operators can find the tuning value and the signals to watch.

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 config/feature-flags.yaml, line 225:

<comment>The registry notes omit the timer knob, its 180s default and 30–900s bounds, and the new `omi_batch_projection_privacy_*` metrics. Add them so operators can find the tuning value and the signals to watch.</comment>

<file context>
@@ -222,6 +222,8 @@ flags:
   - {"key":"BATCH_PIPELINE_MAX_OWNER_DRAINS","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default 8; concurrent owner drains per process, clamped to 1-16 at import; malformed keeps 8","fail":"closed","owner":"lead2","created":"2026-11-05","terminal":"keep","decision":"keep","notes":"Code only; deployment shape pending David. Safe start: dedicated service only, N=4 instances, pages 1, tick 2 s, MAX_OWNER_DRAINS 8. Never enable the pump on backend-integration; the selector is service-wide. Lead2 owns rollout after the deployment-shape decision. Keep serving sweeps ON until owner_drain advanced >=20 rows/s for 30 min and a dedicated-service missing/stale omi_batch_projection_pump_last_tick_seconds alert is installed and verified. Alarm on Firestore read rate above +50% of pre-cutover; owner_drain rows/s must remain at least 70% of pre-cutover. Watch sweep elapsed time and executor saturation. Evaluate claim_busy share no higher than pre-cutover only after serving sweeps are switched off, not during dual-running. Rollback via env-only new revisions: serving sweeps ON on existing service first, pump false on dedicated service, owner drains 8."}
   - {"key":"BATCH_PIPELINE_OWNER_DRAIN_ENABLED","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; a per-process owner drain walks each discovered owner's result log continuously (up to 8 owners at once, 120 s turns, FIFO re-queue) instead of the sweep-shared 30 s walk budget","fail":"open","owner":"dazheng","created":"2026-10-20","terminal":"keep","decision":"keep","notes":"False restores the sweep owner-chain walk with every pre-check; read-ahead (BATCH_PIPELINE_PROJECTION_PREFETCH=0) and the deferred index (BATCH_PIPELINE_PROJECTION_INDEX_DEFERRED_ENABLED=false) have their own switches, and all three off is the pre-drain behaviour. On: the sweep only discovers owners; each walk holds the advisory owner claim for its 15 s step and skips the predecessor/per-part pre-check transactions for rows it reached as the watermark's successor. The assignment transaction's predecessor, privacy and receipt fences stay authoritative; one owner never runs two chains. See backend/docs/batch-pipeline-serving.md."}
   - {"key":"PROJECTION_DRAIN_CLAIM_AWARE","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; read-only fleet claim admission and jittered backoff for redundant claim-busy owner-drain requests","fail":"open","owner":"dazheng","created":"2026-11-05","terminal":"keep","decision":"keep","notes":"Only off disables this switch, including when CAPTURE_COVERAGE_MODE=serve; false, 0 and unknown values remain on. Initial admissions GET the existing Redis claim and fail open on any error. Backoff applies only to claim_busy turns re-requested through again; productive more=True continuations retain immediate FIFO progress without the peek. See backend/docs/listen_pusher_pipeline.mdx#batch-projection-drain-admission."}
+  - {"key":"PROJECTION_DRAIN_PRIVACY_BACKOFF","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; defer zero-progress privacy-blocked owner drains with a bounded timer","fail":"open","owner":"dazheng","created":"2026-11-06","terminal":"keep","decision":"keep","notes":"Only off disables this switch. Privacy guards, deletion and tombstone semantics remain unchanged."}
+  - {"key":"PROJECTION_PRIVACY_REFUSAL_RESUME","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; settle stale privacy refusal hints through fenced resume or assignment","fail":"open","owner":"dazheng","created":"2026-11-06","terminal":"keep","decision":"keep","notes":"Only off disables this switch. Privacy guards, deletion and tombstone semantics remain unchanged."}
   - {"key":"BATCH_PIPELINE_HELD_TERMINAL_STATUS_ENABLED","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; terminally held batch uploads retain phone custody as processing/batch_unit_held with a five-minute poll hint","fail":"open","owner":"dazheng","created":"2026-10-20","terminal":"keep","decision":"keep","ramp":{"cohorts":["all batch uploads at deploy (default on)"],"clean_metric":"Zero completed status responses for uploads with unresolved held units; projected siblings remain visible and held polls are paced at five minutes","expander":"dazheng (two-lane lead)","done_by":"2026-10-27"},"notes":"Read-only status projection; no ledger, job or retention write. Phones keep their independent WAL copy until actual completion; server artifact retention alone never permits acknowledgement. Open operator intents or in-flight siblings also remain processing. False restores failed/batch_worker_quarantined and still never acknowledges custody. See backend/docs/batch-pipeline-serving.md."}
</file context>
Suggested change
- {"key":"PROJECTION_DRAIN_PRIVACY_BACKOFF","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; defer zero-progress privacy-blocked owner drains with a bounded timer","fail":"open","owner":"dazheng","created":"2026-11-06","terminal":"keep","decision":"keep","notes":"Only off disables this switch. Privacy guards, deletion and tombstone semantics remain unchanged."}
- {"key":"PROJECTION_DRAIN_PRIVACY_BACKOFF","aliases":[],"kind":"env","lifecycle":"ops_kill","surfaces":["backend"],"summary":"Default on; defer zero-progress privacy-blocked owner drains with a bounded timer","fail":"open","owner":"dazheng","created":"2026-11-06","terminal":"keep","decision":"keep","notes":"Only off disables this switch. Timer PROJECTION_DRAIN_PRIVACY_BACKOFF_SECONDS defaults 180, clamped 30-900. Watch omi_batch_projection_privacy_backoffs_total and omi_batch_projection_privacy_blocked_stops_total. Privacy guards, deletion and tombstone semantics remain unchanged."}

Scope narrowed to scheduling only per lead2 ruling 2b59ad.

Failure-Class: FC-event-wakes-bypass-request-cadence
@Git-on-my-level Git-on-my-level changed the title fix(batch): stop privacy-blocked projection drain livelocks fix(batch): back off unchanged privacy-blocked projection heads Nov 6, 2026
Failure-Class: FC-event-wakes-bypass-request-cadence

@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: 28ab4c1116

ℹ️ 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".

Comment on lines +129 to +133
logger.info(
'event=batch_projection action=privacy_head_check outcome=read_error exception_type=%s',
type(error).__name__,
)
return False, False

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 Instrument the new privacy-backoff fail-open path

When the blocked-head Firestore read fails, this branch returns (False, False), causing admit_and_run() to clear the backoff and execute a full drain. It emits only an INFO log, so repeated read failures can bypass the scheduling optimization without appearing in the shared fallback telemetry. backend/AGENTS.md requires new fallback paths to call utils.observability.fallback.record_fallback; record this degraded fail-open outcome with bounded fields before returning.

AGENTS.md reference: backend/AGENTS.md:L322-L322

Useful? React with 👍 / 👎.

Failure-Class: FC-event-wakes-bypass-request-cadence
@Git-on-my-level Git-on-my-level changed the title fix(batch): back off unchanged privacy-blocked projection heads fix(batch): bound privacy-blocked projection drain retries Nov 6, 2026
@Git-on-my-level
Git-on-my-level merged commit f344ea4 into main Nov 6, 2026
69 of 70 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/pipeline-privblock branch November 6, 2026 02:32
Git-on-my-level added a commit that referenced this pull request Nov 6, 2026
## Problem

After #24747 served (train cl2d-1106c, 2026-11-06 05:13Z) the projection
owner drain collapsed: rows advanced 4.3/s -> 0.2/s (backend-integration
rev 01590-qzf, 05:16-05:26Z). Productive `end` turns fell 540 -> 11 per
window. The `refusal_no_longer_applies` stops were gone, replaced by
`privacy_blocked` (507 per 10 min). #24747's fall-through retries
assignment, and the assignment fence raises `BatchPrivacyBlocked`, so
the walk stops `privacy_blocked`. The #24743 backoff only matched
`blocked_privacy_*`, so those owners were re-picked every pass and
starved the drain. Prod-safety flagged exactly this as a #24747
follow-up. The trip (`PROJECTION_PRIVACY_REFUSAL_RESUME=off`) is
requested.

## Fix

- `is_privacy_stop()`: the drain backoff (and its stop bookkeeping)
covers `privacy_blocked` as well as `blocked_privacy_*`, for
zero-progress turns only. Productive turns are never delayed.
- The walk records `blocked_head` (result id + update_time) on
`BatchPrivacyBlocked` too, so the backoff can re-check that exact row
early, as it already does for `ProjectionBlocked` privacy stops.
- Scheduling only: no privacy semantics change, no writes; every path
still fails closed. Same kill switch `PROJECTION_DRAIN_PRIVACY_BACKOFF`.

Failure-Class: none

(A scheduling gap between two kill-switched features, found by the
post-train gate.)

## Tests

`PRIVACY_STOPS` now includes `privacy_blocked` (defers, then retries via
the TTL path); the fence stop is counted under `other` AND backed off; a
new walk test proves `blocked_head` is recorded for
`BatchPrivacyBlocked`. Via test.sh: test_batch_pipeline_owner_drain.py
112 passed; test_batch_pipeline_projection.py 64 passed.

## Risk / rollback

Scheduling only. Rollback: `PROJECTION_DRAIN_PRIVACY_BACKOFF=off` or
revert. Once this serves, `PROJECTION_PRIVACY_REFUSAL_RESUME` can be
re-enabled and measured again.

Evidence: omi-workspace
`data/run-2026-11-05-omi-pipeline/posttrain-gate-24747.txt`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24752?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/24752?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24752&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. -->
kriegcloud pushed a commit to kriegcloud/omi that referenced this pull request Nov 6, 2026
After BasedHardware#24747 served, its refusal fall-through re-fences assignment and the
fence raises BatchPrivacyBlocked, so the walk stops 'privacy_blocked'. The
BasedHardware#24743 backoff only matched 'blocked_privacy_*', so those owners were re-
picked every pass: owner drain fell from 4.3 to 0.2 rows/s (2026-11-06
05:16-05:26Z). Treat 'privacy_blocked' as a privacy stop and record its head
version. Scheduling only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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