Skip to content

feat(staging): lane 4 archive mirror reads only chunks/<owner>/, spread selection - #22475

Merged
Git-on-my-level merged 8 commits into
integration/legacy-retirefrom
lr/04-archive
Oct 19, 2026
Merged

Git-on-my-level merged 8 commits into
integration/legacy-retirefrom
lr/04-archive

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Swarm lane 4, M1 rows 1b/2 input. This covers David's archive mirror, approved 10-19. agent-prod-operator holds objectViewer on omi-private-cloud-sync, conditioned to chunks/<David uid>/ only (binding title david-archive-prefix-only).

  • mirror_owner_recordings.py: the private-cloud-sync source now lists and reads only chunks/<owner>/. It no longer touches raw-sync/ or raw-mobile-batch/.
  • New options pick parity conversations evenly across his capture history instead of only the newest:
    • --family chunk|upload
    • --spread
    • --max-group-mb
  • test_staging_mirror.py:
    • adds tests for the prefix restriction and the spread selection;
    • replaces one pytest.approx that 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's chunks/ prefix only. It listed 74,242 objects across 16,350 conversations (2026-04-16..10-19) and read 772 objects, 746 MB. It read ENCRYPTION_SECRET once, under the 10-17 batch-operator exception, to decrypt in memory.
  • dev-operator: 772 sealed objects written to gs://based-hardware-dev-staging-mirror/mirror/v1/owner-a-archive/. That is 200 conversations spread across Apr–Oct, 8.1 audio-hours, 0 failures.
  • Manifest: manifests/owner-a-archive/20261019T101304Z.json.
  • Replay plan plans/m1archive.jsonl sends 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 against origin/main includes fix: commits already on integration: lane 4's 28bed4fd (mirror run-record crash, declared in #22453) and lane 1's db45689b (expected-retry key).

Product invariants affected

  • INV-DATA-1

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 on integration/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

Git-on-my-level and others added 8 commits October 19, 2026 14:24
…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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-10-19T10:37:08.227132Z 4bd3252 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.

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

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 Badge 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,

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 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 5d98924 into integration/legacy-retire Oct 19, 2026
25 checks passed
@Git-on-my-level
Git-on-my-level deleted the lr/04-archive branch October 19, 2026 10:57
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