Repository navigation
feat(staging): lane 4 archive mirror reads only chunks/<owner>/, spread selection - #22475
Conversation
…riant (lane 4) Contract (d), plan F F1, cross-plan L5. First merges after the stubs. - testing/fakes/cloud_tasks_queue.py: virtual-clock Cloud Tasks queue (token bucket, concurrency, retry backoff/max attempts, named-task dedupe) with an AIMD system throttle on 429/503 or a high fast-5xx share; a config PATCH caps but never resets it. Scenarios enrichment_fast_500_throttle (10-18 18:14Z sync-jobs) and sync_backfill_0452 (10-19 04:52Z sync-backfill) drive the REAL routers.batch_pipeline.enrichment_response for an expected first-summary wait. At 733a74a^ (pre-#22371, 500) the 1h run strands 10,002 direct jobs at 0.1/s (prod 10-18: 10,399 at 0.1/s) and 2,322 backfill jobs (prod 04:52Z: 3,552); at 733a74a (409) both keep the configured rate and drain. - scripts/cross_service_checks/task_targets.py: check_task_target_retry_semantics(ctx), registered by #22420. AST scan of each TaskEdge handler and the router helpers it calls: 429/503 anywhere, 500 outside an except-Exception fallback, ExpectedRetry not answered by retry_response. Keys carry no line numbers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lane 4, contract (d)) Lane 1 ruling: F1 carries its own known-gap entries. Keys are the contract (d) violator table plus the audit-only finalization and account-deletion targets; new keys still fail. Co-Authored-By: Claude Opus 5.5 <[email protected]>
dataclasses.asdict deep-copies a threading.Lock and raised after the copy finished, so the first live run wrote objects and the manifest but no workspace record. Idempotent rerun fills it in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ad across history David's 10-19 grant is conditioned to chunks/<uid>/ in omi-private-cloud-sync; the mirror no longer lists raw-sync/ or raw-mobile-batch/ there. --family, --spread and --max-group-mb pick parity conversations evenly across his capture history (rows 1b/2) instead of only the newest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lr/04-archive # Conflicts: # backend/tests/unit/test_staging_mirror.py
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bd3252782
ℹ️ 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".
| return groups[:max_groups] | ||
| if not spread or len(groups) <= max_groups: | ||
| return groups[:max_groups] | ||
| step = len(groups) / max_groups |
There was a problem hiding this comment.
Reject zero group counts before spread division
When a caller combines --spread with --max-conversations 0, the CLI accepts the integer and a nonempty inventory reaches this division with max_groups == 0, raising ZeroDivisionError after the production inventory has already been read and before a run record is written. Either validate that the count is positive or return an empty selection for zero.
Useful? React with 👍 / 👎.
| since=since, | ||
| families=tuple(args.family), | ||
| spread=args.spread, | ||
| max_group_bytes=int(args.max_group_mb * 1024 * 1024) if args.max_group_mb else None, |
There was a problem hiding this comment.
Preserve an explicit zero size limit
For --max-group-mb 0, argparse supplies 0.0, but this truthiness check converts it to None, silently disabling the new size bound. An operator using zero to select no positive-sized recordings can therefore copy the normal maximum number of conversations instead; test against is not None or reject nonpositive values explicitly.
Useful? React with 👍 / 👎.
Summary
Swarm lane 4, M1 rows 1b/2 input. This covers David's archive mirror, approved 10-19. agent-prod-operator holds
objectVieweronomi-private-cloud-sync, conditioned tochunks/<David uid>/only (binding titledavid-archive-prefix-only).mirror_owner_recordings.py: theprivate-cloud-syncsource now lists and reads onlychunks/<owner>/. It no longer touchesraw-sync/orraw-mobile-batch/.--family chunk|upload--spread--max-group-mbtest_staging_mirror.py:pytest.approxthat imported numpy inside the timed call (fast-unit CPU guard).Deploy class: none.
Run (already executed with this code; receipts in the workspace lane04 folder)
prod-operator, David'schunks/prefix only. It listed 74,242 objects across 16,350 conversations (2026-04-16..10-19) and read 772 objects, 746 MB. It readENCRYPTION_SECRETonce, under the 10-17 batch-operator exception, to decrypt in memory.dev-operator: 772 sealed objects written togs://based-hardware-dev-staging-mirror/mirror/v1/owner-a-archive/. That is 200 conversations spread across Apr–Oct, 8.1 audio-hours, 0 failures.manifests/owner-a-archive/20261019T101304Z.json.plans/m1archive.jsonlsends each of the 200 conversations exactly once, as 20 pseudo-owners × 10.Lane / contract
Lane 04, contracts (i) and (j); owner sign-offs for edits to other lanes' files: none.
Rollback
Revert this PR. Mirrored objects are staging-only, and the staging mirror bucket has a 14-day lifecycle. Removing the 10-19 conditional grant (lead) stops further archive reads.
Failure class (fixes)
Failure-Class: none
This PR's own commits contain no
fix:. The gate's range againstorigin/mainincludesfix:commits already on integration: lane 4's28bed4fd(mirror run-record crash, declared in #22453) and lane 1'sdb45689b(expected-retry key).Product invariants affected
Cited only because the pre-push gate diffs this branch against
origin/main. That range carries lane 7's prod-train concurrency-group lines in.github/workflows/gcp_*.yml, which are already onintegration/legacy-retire. This PR's own diff against integration is two lane-4 files: the staging mirror script and its test. It routes nothing and changes no project or authority.Test plan
BACKEND_UNIT_TEST_FILE_LIST=tests/unit/test_staging_mirror.py bash test.sh→ 19 passed, no CPU-guard warnings.🤖 Generated with Claude Code