Skip to content

fix(batch): resume stale projection privacy refusals - #24747

Merged
Git-on-my-level merged 3 commits into
mainfrom
lane/pipeline-refusal-resume
Nov 6, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
lane/pipeline-refusal-resume

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

A stale projection privacy hint reaches hold() before a stored refusal can replay. When the transactional guard reports privacy refusal no longer applies, that exception strands the head instead of retrying ordinary work. The privscout investigation, lines 10–24 identifies the path; the 00:50–01:05Z measurement, lines 7–9 recorded 683 of 1,662 drain turns with this stop on 2026-11-05.

The decorator now handles only that exact hold error. It uses the existing fenced transactional resume for stored refusals, then retries the wrapped method once; otherwise it falls through once. Hinted jobs reload/pin their real projection policy first, so temporary settlement defaults cannot authorize assignment. Applicable refusals retain existing holds and idempotence. Guards, check_unit_privacy, deletion/tombstone dispositions, and the backoff scheduler are unchanged.

PROJECTION_PRIVACY_REFUSAL_RESUME defaults on; only off restores the previous exception behavior. Registered in policy/config, flag budget and registry. Four counters (attempted/succeeded resumes, fall-throughs, still-refused) have no variable labels and are retained by the serving GMP profile.

Validation:

  • omi-heavy run -- ... BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh: 991 passed across 30 isolated files, covering projection privacy/hold/source deletion, projection/session, owner drain, raw-env ratchet, flag budget, bounded metrics and GMP sidecar retention.
  • Focused refusal-resume tests execute real strict Firestore session/replay/assignment transactions; flag off preserves the original raise, applicable holds make no further writes, and replay counters distinguish attempts from successes.
  • One parallel review round: correctness SHIP, production safety SHIP, no code defects found. Parent independently verified the final 19-case refusal-resume run, including real-guard disagreement and persistent-policy-refusal cases. Automated follow-ups were addressed by loading the real policy before fenced replay (preserving configured contention retries) and keeping the new kill-switch import at module scope.
  • OMI_PR_BODY_FILE=... omi-heavy run -- make preflight: 41 checks passed on the frozen tree; PR metadata preflight: 4 passed.

Risk: recovery retries can race a new refusal; both replay and assignment repeat their existing transactional fences. A persistent independent policy refusal remains blocked rather than assigning under synthetic defaults. Current main also fences job outputs in the session and rejects job/binding generation mismatch before the hold check. The real-guard disagreement regression exercises a policy-side job-output refusal followed by a concurrent job update before the session reads its id set, then proves replay/assignment advances the head without modifying the private output. A separate injected persistent policy refusal proves synthetic defaults cannot bypass the policy fence.

Rollback: set PROJECTION_PRIVACY_REFUSAL_RESUME=off. No deployment, production data access, deletion or terminalization is part of this PR.

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-06T03:49:47.091824Z 49143d4 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.

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

All reported issues were addressed across 13 files

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

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

@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: 15cf1c3bd3

ℹ️ 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 thread backend/config/batch_pipeline.py Outdated

def projection_privacy_refusal_resume_enabled() -> bool:
"""Default on; only off disables recovery from a stale privacy refusal."""
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 import to module scope

The new function-local import violates the explicit import rule in backend/AGENTS.md, which requires all imports at module scope and prohibits imports inside functions. Move kill_switch to the module-level imports; calling it inside the helper will still read the switch at runtime.

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

Useful? React with 👍 / 👎.

Failure-Class: FC-retry-resume-behind-own-fence
@Git-on-my-level
Git-on-my-level merged commit 50cea72 into main Nov 6, 2026
58 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/pipeline-refusal-resume branch November 6, 2026 04:10
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]>
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