Skip to content

Schedule batch projection from committed result obligations - #25724

Merged
Git-on-my-level merged 10 commits into
mainfrom
lane/bos-projection-outbox
Nov 19, 2026
Merged

Git-on-my-level merged 10 commits into
mainfrom
lane/bos-projection-outbox

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Change

Ordered merge and source-alias fallback now stamp an idempotent projection obligation on the committed result in the same transaction. The segment key and owner log sequence identify the revision. Serving offers an immediate, bounded post-commit hint, and one strict lease holder per namespace scans lost wakes in kind, due time, and document ID order. A delivery claims the revision, runs the existing fenced projector, then settles from the canonical result state. Predecessor, sibling, timeout and error deferrals retain the obligation with a bounded clock and a disposition. Multipart receipts, content ledger completion, hourly usage, retained audio and privacy checks use the existing authority.

This removes downstream job/policy probes and projection attempts for covered rows from legacy assignment, finish and follow-up sweeps while the backstop has recently succeeded and is keeping up. Legacy pages retain their raw Firestore reads, cursor and overlap measurements. The existing finish classifier (#25314), follow-up due-clock marker, overlap measurement (#25596), refused-head recovery (#25623), and raw keyset conformance (#25555) retain their separate responsibilities.

Mixed versions and rollback

Older writers, including GPU image ef42ee8, leave unstamped rows eligible for every legacy path. Older readers may consume a stamped result through the existing receipt and accounting fences. Current GPU-side commits rely on the elected due scan because the GPU process has no projector. No cross-process wake transport or historical backfill is needed for coverage. Fenced held release and privacy resume rearm a result and invalidate its prior token. New writers with the switch off mark a reactivated row for legacy discovery while keeping its previous scheduling metadata. An expired or stalled backstop restores compatibility attempts, even for stamped rows.

Set BATCH_PROJECTION_OUTBOX=false on the participating readers and writers to restore the full legacy discovery paths and stop new obligations and claims. Existing result and receipt data stay available. Set it to true to resume after both stage-specific indexes are READY and the due query is confirmed. Release qualification compares matched completion, partial latency, oldest obligation, failures and read/write telemetry across the actual serving roster.

The outbox supervisor starts on projection-serving roles when its switch is on. A batch-serving process continues outbox discovery when the dedicated pump and legacy projection sweep are both off. The due-page loop has a 5-second interval, a MAX_PENDING initial 200-key bound, and a MAX_SCAN_LAG initial 60-second coverage limit. Both follow-up queues share the existing per-process slot budget. Its claim expires after 180 seconds. Existing serving and projection-pump cadence and page configuration are preserved. A missed wake, process loss or leader change returns unclaimed debt to discovery. A canonical hold parks it until an existing release or privacy resume. Persisted and ready receipts honor a future projection_followup_due_at. Unsuccessful finish then uses the configured follow-up backoff on the outbox clock, with a 60-second fallback if the setting is zero. Outbox delivery skips the legacy durable deferral write.

Expected saving

Inferred, unmeasured in serving. The design baseline measured overlapping 339.56M follow-up-origin and 222.08M serving-origin reads in the 24 hours ending 2026-11-18 13:16Z. Those totals include useful work. The avoided share is the expensive downstream attempts of covered rows, and the two baselines cannot be added. Embedding the metadata adds zero document writes at merge. One claim plus one settlement at the recorded 1.516M daily commits implies about 3.03M scheduling writes/day if every commit follows that path, before retries and lease writes. Index cost and net read savings need a matched serving measurement.

Panel and verification

Scope panel scope-20261118t145338-00de returned three answers. Accepted its writer audit, per-row revision witness, strict lease and post-page token check, due deferral, existing receipt/privacy fences, three-store parity, existing age gauge, rollback and cost measurement. Chose embedded result fields because they avoid a new merge write and preserve the existing purge and retention lifecycle. Deferred a physical Firestore legacy page cut, fleet backfill, additional election switch, and cross-process wake transport. A successful per-row witness keeps old and mixed-mode writers eligible without a fleet cutover. The scope command emitted a dossier without F-numbered findings, so its review-only triage CLI had no calls to record.

  • cd backend && .venv/bin/python -m pytest -q tests/unit/test_firestore_query_shapes.py --tb=short — 611 passed.

  • bash backend/scripts/check_runtime_env_compose.sh, python3 scripts/check_feature_flag_registry.py, and cd backend && .venv/bin/python scripts/generate_firestore_indexes.py — passed.

  • Focused backend pytest files for the outbox, serving, leader, discovery and follow-up desync — 201 passed.

  • OMI_REQUIRE_STORE_BACKENDS=all .venv/bin/python -m pytest -q tests/integration/test_store_conformance.py -k projection_outbox (loopback Firestore and an owned PostgreSQL 16 container) — 3 passed, one per store.
    The fixture pins scheduler elapsed time alongside its synthetic timestamps so local load cannot expire the setup claim.

  • .venv/bin/python -m pytest -q tests/integration/test_batch_pipeline_projection_followup_firestore.py (loopback Firestore) — 13 passed, including lost wake/ack, duplicate delivery, privacy, predecessor, and multipart restart.

  • .venv/bin/python -m pytest -q tests/unit/test_flag_budget.py — 26 passed. .venv/bin/python -m testing.pipeline_sim projection-drain --rows 300 --owners 12 — all three projection modes preserved ordering and completed assignment.

  • Dev and prod backend/scripts/validate-backend-runtime-env.py and deployment-setting classification — passed.

  • The normal pre-push PR preflight passed all 52 selected static, metadata and Firestore guard checks. The local hook used the approved 900-second per-file wall budget after a host-load timeout.

  • Whole-backend Pyright passed with zero errors in the normal push hook. The loopback Store conformance and 13 Firestore tests were repeated after the typed Store interface correction.

  • The outbox unit and background-task ratchet rerun passed 12 tests, including graceful worker shutdown. The runtime manifest validator passed 295 tests, and the async blocker gate reported zero selected findings.

  • cd backend && .venv/bin/python -m pytest -q tests/unit/test_batch_pipeline_projection_outbox.py — 6 passed after adding the mixed-switch reactivation assertion. The three-store conformance and 13-test Firestore replay rerun also passed with the fixed scheduler test clock.

Round 2 review and CI repairs

Review panel review-20261118t202810-030a (FIX-FIRST), CLI triage F1=accept F2=accept F3=accept.

  • F1 starts elected outbox discovery independently of the dedicated pump and legacy sweep on a batch-serving process. Projection and first-summary policy stamping stay on owning roles. The outbox hands off predecessor work and index flushes after the delivery claim scope.

  • F2 proves a stale oldest due row clears the coverage witness, successful scans renew it near expiry, and scans leave a fresh witness alone.

  • F3 enforces the follow-up due time and configured backoff on outbox delivery. The outbox is the sole durable retry-clock writer for those deliveries.

  • CI on d1195ac4cc7 found a stale ghost-hold assertion, a stale pump fixture and Store protocol expectations, and scheduler-only fields leaking into the characterization and provider-STT behavior goldens. The integration assertion now pins the ghost-hold outbox clock. The simulator trace excludes the internal kind and retry reason, with the outbox details checked directly by replay and conformance tests.

  • Hosted unit shard 7 on 0be3b03fd7e caught the shadow-store guard pointing at the public wrapper. It now asserts that the cached constructor wraps the only Firestore store. All 23 cases in test_jobstore_shadow_seams.py passed locally.

  • Hosted Sync Cloud Tasks batch-happy on 0be3b03fd7e exposed an admission process stamping projection policy when neither serving role was enabled. The startup gate now preserves projection-serving role ownership even while the outbox remains independent of legacy sweeps.

  • Round 5 incorporates #25778, which removed the paused jobstore retirement carrier. The migration runner requires contiguous numbers, so the unchanged outbox index SQL occupies 0010_projection_outbox_due.sql. Production Postgres target bindings remain absent and outbox projection stays on Firestore during the pause. The main branch’s staging isolation fence stays in place.

  • 08352903c14 also fences the delivery claim at canonical transaction read and before fair-use dispatch, preserves mixed-store discovery parity, and reserves queue space for lost wakes.

  • Ran each of nine focused unit files in its own pytest process from backend using .venv/bin/python -m pytest -q tests/unit/<file>.py --tb=short. All 559 cases passed across outbox, serving, pump, follow-up clock, job-store parity and migrations, provider STT, characterization, and the background-task ratchet.

  • The role-bound startup change passed the 178 focused serving, pump, and outbox cases. The local batch-happy gauntlet passed against Firestore and Redis with its original owning-role and effect assertions. The first local full-batch attempt stopped before scenarios at the serving startup deadline under host load. The focused rerun increased only the local startup wait.

  • Discovery, overlap, and dual-store focused unit files added 150 passes. The final typed parity adapter was exercised again with 156 protocol-parity and 78 dual-store passes.

  • make preflight passed all 52 selected manifest checks, including the index and collection guards, feature flags, and runtime composition. The normal push hook also passed whole-backend Pyright with zero errors and all 40 selected unit files.

  • Loopback Firestore pytest proofs passed 16 in test_batch_pipeline_projection_followup_firestore.py and 37 in test_batch_projection_ghost_holds_firestore.py. One ghost-hold throughput assertion was intentionally skipped because emulator speed depends on host load.

  • OMI_REQUIRE_STORE_BACKENDS=all .venv/bin/python -m pytest -q tests/integration/test_store_conformance.py -k projection_outbox passed all three backends. test_jobstore_migrations_postgres.py added three native PostgreSQL 16 passes. A supplemental full run was interrupted at 193 passes and two skips after a Docker connection stall reproduced by a standalone PostgreSQL connection. The targeted rerun used the native test fixture.

  • .venv/bin/python -m testing.pipeline_sim projection-drain --rows 300 --owners 12 preserved projection and chain ordering in all three modes.

Hosted verification at 6d2551733d9

The full Sync Cloud Tasks and Listen Pusher gauntlets, Backend Emulator Proofs, and unit shard 7 all passed. The backend unit suite remains red solely on two CPU-duration guard violations. Pytest reported 39 and 297 passing tests in the two files, respectively. Hermetic E2E, emulator proofs, backend unit suite.

  • test_monitoring_adapter_hpa_contract.py::test_hpa_and_adapter_changes_select_this_contract used 1.02 s of CPU against the 1.00 s limit. It used 0.65 s in the preceding hosted run and 0.59 s in the local rerun with the same guard. Hosted shard 2.
  • test_backend_runtime_env_validator.py::test_control_sync_routing_validates_deployed_values_without_changing_manifest[all] used 1.04 s against the same limit. It used 0.92 s in the preceding hosted run and 0.62 s in the local rerun. Hosted shard 5.
  • The two cases, their test selector, runtime manifest and validator are identical to the preceding PR head, which passed both hosted shards. The intervening diff restores projection-serving ownership and updates the store-construction guard. Previous unit run.

Product invariants affected

  • INV-MEM-4. The runtime manifest declares a projection scheduling switch. Canonical memory admission and the projection receipt, ledger and accounting authority stay on their existing paths.

Failure-Class: FC-unresolved-head-blocks-projection

Line-Count-Exception: backend/utils/batch_pipeline/projection.py | 1871 -> 1914 | Projection owns coverage-aware discovery and dispatches outbox snapshots through its existing fenced receipt methods.

View guided diff Turn on auto-fix

Implemented by a delegated agent for the batch owner-state program.

Git-on-my-level and others added 9 commits November 19, 2026 02:09
Failure-Class: FC-unresolved-head-blocks-projection
Failure-Class: FC-unresolved-head-blocks-projection
…utbox

# Conflicts:
#	backend/tests/unit/test_batch_pipeline_serving.py
Failure-Class: FC-unresolved-head-blocks-projection
Failure-Class: FC-unresolved-head-blocks-projection
…ting test

The [all] case reparsed the full runtime manifest on every validator call
and drifted past the 1.00 s CPU guard (0.92 -> 1.04 -> 1.10 s on hosted
runners). Same test-only change as #25722.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Exact-head closure 3b258f3

This is the source closure for the batch-custody owner on #25724. The exact head is clean and mergeable. Hosted Backend Unit Tests passed all eight shards and guardrails. Emulator proofs, both Hermetic E2E gauntlets, runtime image contracts and Firestore index reconciliation passed. Unit tests, emulator proofs, Hermetic E2E, index reconciliation.

Panel findings and exact-head confirmation

  • review-20261118t202810-030a reviewed d1195ac4cc7bd09542ccb3afba93f50518a16741 and returned FIX-FIRST. Luna and GLM Flash answered. DeepSeek timed out.
  • The earlier attempt review-20261118t201123-5f1b targeted the same full SHA. All three launches failed and the record has verdict NONE and zero findings. There were no dispositions to record.
  • The scope dossier scope-20261118t145338-00de ran against 784f90aff60f748054d75d3981390d52d2a88351. It returned three scope answers and had no numbered review findings.
Finding Disposition and reason Fix commit Test evidence confirmed in the exact tree
F1, outbox startup depends on legacy sweep or pump Accept. A projection-serving process needs the elected scan when both projection discovery modes are off, because the GPU worker has no consumer and a missed wake leaves durable debt. The startup gate also preserves the owning-role projection and first-summary policy boundary. 5f7af3da8656d0127daf710ae7bd3645e265dd5e, finalized by de07174ed589f0585aac78f0fdd72575f9bba226 test_serving_outbox_recovers_without_legacy_projection_discovery, test_non_serving_process_does_not_construct_store_or_task[on] and the hosted Sync Cloud Tasks batch-happy owning-role assertions. The lost-wake/lost-ack Firestore case also passes.
F2, coverage-witness health branches untested Accept. A stale positive witness can suppress recovery through legacy discovery. Writing on every tick adds cost. 5f7af3da8656d0127daf710ae7bd3645e265dd5e test_coverage_witness_refreshes_only_when_needed_and_clears_on_stale_debt pins near-expiry refresh, zero writes while fresh, stale-debt clearing, bounded follower cache and healthy recovery.
F3, outbox retries ignore the follow-up clock and can pay two deferral writes Accept. One durable clock should govern an outbox delivery. A future projection_followup_due_at defers the claim. Runnable finish retries use the configured backoff and skip the separate durable legacy settle. 5f7af3da8656d0127daf710ae7bd3645e265dd5e test_outbox_uses_followup_due_and_owns_retry_settlement checks the effective due time, no work at the premature wake, no legacy settle call and no retry at the old 60-second interval.

I verified the fixing commits are ancestors and reread the implementation and named tests from the final tree.

Raw triage command and stdout from the implementation session

omi-panel triage review-20261118t202810-030a F1=accept F2=accept F3=accept
{"recorded": ["F1", "F2", "F3"], "not_yet_triaged": [], "resolutions": []}

The panel and raw triage rows are in ~/.local/state/omi-panel/review-20261118t202810-030a/panel.json and ~/.local/state/omi-panel/ledger.jsonl on m5-mbp. The ledger records the accepted calls at 2026-11-19T04:14:02Z and 2026-11-19T04:24:09Z. The earlier attempted review and scope panel have their own panel.json files under that same state directory.

Delta review

I reread git diff d1195ac4cc7bd09542ccb3afba93f50518a16741..3b258f385d8d81407993a37c96b12a7053af5600 for the batch-custody boundaries and compared the merge with each parent. The first-parent commits are below. The second-parent history imported from main is listed afterward.

Commit Change Risk checked
08352903c14055bcc2df3e6a0e2029de801c4722 Carries the live result claim into canonical projection transactions and checks it again before Redis accounting. Preserves the public store paging contract, mirrors metadata patches, reserves scan queue space, restores predecessor replay, clears stale scheduling on rollback rearm and serializes serving construction. The extra claim check can defer stale work or add a result read. Receipt and accounting idempotency remain necessary for an external call already dispatched. Mirroring processes the committed primary state.
5f7af3da8656d0127daf710ae7bd3645e265dd5e Decouples the scanner from legacy discovery, starts the owed handoffs, adds witness tests and implements follow-up backoff ownership. Pins simulator output to observable state by excluding internal retry metadata. Longer backoff can delay incomplete work. This commit also admitted an outbox-only process with the wrong policy role. The final startup gate in de07174ed58 closes that path.
ff122fb36adc2d70b35cfaca1739865e4f2662aa Merges main at d5329c70597d640dca06bdb290ec3c93d75a6322. Keeps both serving test sets, fixes cache access and renumbers the proposed outbox index from 0010 to 0011 so main retains 0010_retirement_cursor.sql. Servicing and custody interactions include bounded copy retirement, cap-hold release, purge receipts and v3 projection admission. Checked those entry points below. SQL schema sequencing remains a deployment dependency.
de788192be9f0f1fd9c4a3fd9c1309bdd9fb0733 Gives the supervisor task label a specific variable name so the Firestore inventory scanner can distinguish it from collection-name variables. Naming only. The correction leaves the collection guard active.
0be3b03fd7ed59e9525a8a9c5a1d59f42c1392fe Types the parity observation as a list of DueObligation before canonical comparison. Type-only change at a counts-only observation seam. Runtime comparison still uses ordered keys, revisions and due times.
de07174ed589f0585aac78f0fdd72575f9bba226 Limits the supervisor to configured serving or pump roles while keeping it independent of the legacy projection sweep. A role with neither serving admission nor a pump stays out of projection. Hosted batch-happy checks that admission cannot stamp projection policy, and the serving regression covers both legacy discovery flags off.
6d2551733d9ec9ab840310d9452d35fdfc239134 Points the shadow-store guard to _serving_for_stage, where construction now occurs. Test-only. The guard still requires exactly one wrapped Firestore constructor and checks the active shadow hook.
3b258f385d8d81407993a37c96b12a7053af5600 Reuses the parsed fleet manifest inside test_control_sync_routing_validates_deployed_values_without_changing_manifest, with real loader fallback for other paths. Test-only. The wrong-route refusal, overlay acceptance, manifest immutability and wrong-service refusal assertions remain. The final hosted shards are green.
  • Privacy and deletion. The delivery token is checked at the result read inside the canonical transaction. Existing owner, ledger, privacy and deletion fences still govern publication. Claim, witness and settle carry scheduling metadata. A deleted result or a retained ordering tombstone cannot be reconstructed by settlement. The inherited purge changes retain a pending artifact receipt until erasure can be proved, on both coalesced and ordinary paths. The inherited Home repair rereads privacy and eligibility in its write transaction, and inherited v3 note drain excludes pending account deletion.
  • Custody, ordering and payment. The durable revision/token claim and canonical receipt are distinct. A lost wake is rediscovered under the strict lease. An expired or replaced delivery cannot publish through a stale session or settle another attempt. Existing Redis idempotency covers the gap after the final claim read. The exact tree carries test_projection_outbox_fences_a_claim_replaced_after_its_snapshot, test_projection_outbox_rechecks_the_claim_before_fair_use_dispatch, test_projection_outbox_lost_wake_and_lost_ack_keep_one_receipt_and_charge, test_projection_outbox_rechecks_privacy_before_apply, deletion rechecks and multipart restart coverage. The inherited cap-hold release still requires durable completion before erasure. Inherited retirement pages are bounded, use a fenced cursor and keep Firestore authoritative. The release overlay stages retirement off on production integration. Inherited Listen rotation retains its own off-by-default gate and successor-first archive handoff.
  • Mixed versions. GPU image ef42ee8 writes unstamped results. Those results remain eligible for legacy pages, which preserve raw order and cursors, and an unstamped predecessor can be replayed through the existing owner chain. Skipping requires both a live coverage witness and an eligible obligation on the row. Loss of the witness restores compatibility attempts. test_projection_outbox_skip_keeps_raw_page_cursor_and_observer, test_projection_outbox_replays_an_unstamped_predecessor and test_projection_outbox_merge_and_token_conformance pin the compatibility contracts. Progress for wholly unstamped work still depends on the legacy serving paths during the old-writer overlap.
  • Rollback. BATCH_PROJECTION_OUTBOX=false on participating readers and writers turns off claims and coverage filtering. Normal discovery stays available when its serving path is enabled. Rearming under the switch clears the stale token and due field, including for readers still on. Existing projection receipts, ledger state and result retention remain authoritative. This is a flag rollback with additive schema. Index readiness for both stages, reader and writer serving identity, and runtime acceptance remain Release evidence.
All 115 commits brought in by the main merge

These commits were already on the base branch. Their subjects identify the individual changes. The grouped risk notes describe their interactions with the outbox delta.

Merge commits

Their integration risk is reconciling overlapping edits from main. The retained tree and relevant custody boundaries were checked at the downstream lane merge.

  • dd5b1c871bc06a85388e9ee91213cd1fe3c4f4af Merge remote-tracking branch 'origin/main' into lane/jobstore-fast-path
  • ccc555c1c7ccc9a7f6f478010b799bf993189899 Merge branch 'main' of https://github.com/BasedHardware/omi into lane/home-health-worker
  • 7fdbbb122296f31087390358aec334a39def98ba Merge branch 'main' of https://github.com/BasedHardware/omi into lane/home-health-worker
  • c1ad007d3b7e55e444eda793e8ecb33d9189892b Merge remote-tracking branch 'origin/main' into lane/jobstore-fast-path
  • 8a46564e2723c01ed795a5b2c2e67bae32fc999d Merge remote-tracking branch 'origin/main' into lane/home-health-worker
  • 8560c02ed6e8bfa889d4d4f20dd0c1f40aba7c05 Merge remote-tracking branch 'origin/main' into lane/home-health-worker
  • f5a744940e8086a83a564acce22c26101b55d9da Merge remote-tracking branch 'origin/main' into lane/home-health-worker
  • ac05dbc531df35e694bc2c842fb8809350e7f8fa Merge commit '9c88e7f888b' into lane/home-health-worker
  • bcba1b459cd0afc5f19406a7930b4aa1a821f0a4 Merge remote-tracking branch 'origin/main' into lane/jobstore-fast-path
  • 86b03f3b93f78298d823d14c911f9c42cd085c76 Merge remote-tracking branch 'origin/main' into lane/jobstore-fast-path
  • 0ca167128155919a237cc6cf28d3bb2823c9d00f Merge origin/main: fold the v3_derived live rule into v3/live.py (fix(conversations-v3): the live read skips open rows idle past the window cap #25719)
  • b41451a5009158ac052dc047c24c0e4d4cc0002d Merge commit 'ffa1426a0f6' into lane/home-health-worker
  • 628912387885d6ea1477acb2f74448978a31c443 Merge origin/main: keep fix(home): show a held sync piece as Processing on legacy Home #25723 show_held through the shared page fill
  • 1db5b163f4555f4226960364ca50ea63314315ab Merge origin/main into fix/v3-recording-rotation
  • 9dd6e84a2ad837bf6ae9a2ea958a9680b53ba42b Merge commit 'b17161b674e' into lane/home-health-worker
  • b91192fbb988e0bbafe977c7bd3f1ace0941d38d Merge remote-tracking branch 'origin/main' into fix/v3-home-read-path
  • fa4cee63ed6f39669598edff0be494833ab37045 Merge remote-tracking branch 'origin/main' into lane/jobstore-fast-path

Job-store retirement and copy serving

The material risks are copy scope, schema ordering, byte-order cursor progress, and resource contention with critical maintenance. Retirement uses supervised leases, bounded pages and target-bound cursors, and the production integration overlay stages it off.

  • 734283b00ef9e707781bab718ab815602e5510cb feat(backend): host bounded jobstore retirement in serving maintenance
  • 902528401da2b430c26f77afcb782097dcb9b885 test(backend): retain the active recorder for retirement query shapes
  • 04909912e2d0fe71ebcde9d4b1c762a3e9e98075 test(backend): keep query runtime arguments out of shape metadata
  • 5b5c0168f9a18ece56b3ac5fe64ce4853b6fcee2 test(backend): explain listen-only jobstore erasure bindings
  • cfa885b70940d1e2026b379511499cef9969edf8 test(backend): expect retire_copies in strict maintenance call assertions
  • 67778da49c1de71fbcbc0b7840f44b2f357c2017 fix(backend): admit absent data-plane project, keep cursor SQL static, align tests
  • 5266d81e98c0c0d0a3d3dda851948a9028d2ac39 test(backend): load runtime_env with the C YAML loader in the retirement deploy test
  • cfd406ad70313e08252f34b3ce382a2bdb4d7701 fix(backend): primary retirement pages only while copies are written
  • 96aa1997cb952031e2390543c200223d80b06ea1 fix(backend): index retirement scans in byte order; document stuck cursor remediation
  • db8cdd0656446254775ae73b099eb601b5b15f11 test(jobstore): pin 0010's cursor tbl CHECK to MIRRORED_TABLES
  • f159cceccac0ec7785d46a1ef239eed5e1c18931 feat(backend): host bounded jobstore retirement in serving maintenance (feat(backend): host bounded jobstore retirement in serving maintenance #25630)
  • 2aee0a2c86f3fc09584fa75f686863c76c7feb69 deploy(jobstore): stage the feat(backend): host bounded jobstore retirement in serving maintenance #25630 roll with retirement off on backend-integration
  • 2f8ac7ecd04ed2bab42b69b4b9d02feaf926e9b1 deploy(jobstore): keep staging retirement on; mark the prod off as ops_kill
  • da8216316e58e6e3eb55c97e6c5a031631535fd3 test(jobstore): pin staged retirement off on backend-integration
  • d5329c70597d640dca06bdb290ec3c93d75a6322 deploy(jobstore): stage the feat(backend): host bounded jobstore retirement in serving maintenance #25630 roll with retirement off on backend-integration (deploy(jobstore): stage the #25630 roll with retirement off on backend-integration #25744)

Conversation deletion and purge audit

The material risks are premature erasure acknowledgment, unscoped artifact deletion and audit visibility. The inherited active purge retains pending receipts and the audit is read-only with scoped evidence.

  • e693a37748132d8cd10fd3f57212d9d36a001b4f Add a read-only conversation purge remainder audit
  • ca4505fe1fab3b223e0f8c9da89a94a95b7efea7 Exercise the audit after a coalesced purge in the emulator
  • 769679af68b17ad664b6b4bdb177f98455b3b9c9 Share result document addressing with the purge audit
  • 96e3e63786bf5d5cb16a5869a4c2a0533f657d1d Refresh query witnesses for post-commit purge logging
  • 1543d01f76653f015b712781cc06fa7ebce6b4fb Pin worker query witnesses with the backend Python version
  • 17b5baff5b0c4c7e517edb168e6af82f32518ee8 Keep storage environment reads at the purge and audit entry points
  • 8f531e2f8f2d5226a88caf5eb79a3b642c06f4ee Register the purge remainder audit Firestore index
  • 9162920befb876f693cea8c472c918c75c8dce67 Report purge audit coverage for every verdict
  • b17161b674edc8fe986f2eed14911796919ee941 Audit conversation purge remainders from tombstones (Audit conversation purge remainders from tombstones #25708)
  • 3b4f5580078d969d0619af0509ccf4b332f75348 Keep conversation purge open while artifact erasure is pending
  • 2d8d96c8fbfccf45235c3f8653ba5a14c95fed61 Refresh query coverage pins after purge handoff review
  • 78e2e7ad74c70dbc1e4b5d0759ec084fa45fa42d Cover coalesced receipt replay and repair transaction fences
  • 6346f33b0bbc859f8b4cdf727ceb55af24cbece6 Keep conversation purges open until pending artifact receipts are erased (Keep conversation purges open until pending artifact receipts are erased #25737)

Capture rotation and continuation

The material risks are losing audio or resuming the wrong recording across a boundary. The inherited path uses a successor-first handoff, ownership checks, a close barrier and bounded retries. Its rollout gate defaults off.

  • cf5bae297bb0fa81fb6aadf8c01fdb377b0f5b17 fix(conversations-v3): seal long v3 recordings at speech pauses so derived conversations appear during a long capture
  • 94ba341ab3e98c329f6ab784db01e524eff967e0 chore(listen): mark v3 rotation envs listen-only for the pusher co-host gate
  • 1bf7d3a50329209cc0cfc06fbca6d5ecd139cee5 fix(listen): v3 rotation supersedes the live continuation, retries refused seals and drains them at teardown
  • e76edbb976a882a50d77b8fdc6f1ed56147c72ce chore(listen): rotation counter module name; compact teardown drain
  • 1cd85653abb54a10ab9b9e94610752c78be7b904 fix(listen): supersede after the switch, re-raise ownership loss, reason-enum rotation counter
  • ae68d3176d80f7679cf7282a6fdfbe9594683914 fix(conversations-v3): rotate long v3 recordings at speech pauses (default off, cohort canary) (fix(conversations-v3): rotate long v3 recordings at speech pauses (default off, cohort canary) #25726)
  • cf1dc4d6ddddfbdfeebafcc611bace2ccb00c159 fix(listen): v3 rotation survives a failed pointer move, cleans a failed successor, counts producer skips
  • 98328b24ea30451e864c3eb448991e7c77986408 fix(listen): publish the close barrier before deleting a failed rotation successor; bound producer skips
  • 75cc45961770b9f0764dad4a43647030e3abe7aa fix(listen): harden v3 rotation failure paths before the canary (fix(listen): harden v3 rotation failure paths before the canary #25731)

Cap-hold accounting

The material risks are premature capacity release and removal of the held audio. The inherited handoff checks durable content completion before release and erase.

Home review and repair

The material risks are overbroad reads, small-cohort disclosure and writes against stale eligibility or privacy state. The inherited review constrains inputs and receipts and the repair rereads policy and authority in its write transaction.

  • ff1d17baeb71421cf764c806d21e77c5f24868b9 feat(backend): add privacy-safe Home health review and repair worker
  • 9be729aa6ad3d585cd207d279250f2234e37cc94 fix(backend): enforce privacy and execution bounds in Home review
  • 29e7ab0539a25a3248d52cbff163c539af1c1596 fix(backend): verify the serving sweep before Home repair
  • 34483d8d41af84708a30dd1990a3c84f455af197 Fix Home review protection ordering and summary eligibility
  • 3656e03ac099ee9b406eae7afa7a193d240c5bda Arm missing Home summaries for recordings with generated titles
  • e5293381db718c2ebe90078587d30532b48ee622 Tighten Home survey reads and explain reporting limits
  • 6b97a655609e2b80d3d4919e0904fbb6a1a80dbf Suppress small Home repair outcome counts
  • b65dba46e4aa97ee2511f3ad0874d3eab21e8541 Match held sync visibility in Home health review
  • ae01aeb8b359a15e1d0573de2971c332c7a729ab Keep Home review inputs and receipts privacy-safe
  • 8a4bad59cb278c037df0a2b362e884d7718c32cd Clarify Home repair receipt exit codes
  • ae84c3123cc685058022f74543f12781d8eec344 Add privacy-safe Home health review and repair worker (Add privacy-safe Home health review and repair worker #25666)

Home and live reads

The material risks are visibility drift, empty cursor loops and live-row misclassification. These inherited reader changes preserve owner scoping and add paging, visibility and open-window coverage.

  • 9a951c9113f5d85ecbec7c636a8765077ab20f43 fix(conversations): page Home past hidden runs; live tile is an open v3 window
  • 0f0b461fc5064f0e1574522927b7f2615dc52b01 refactor(conversations): move live-window and page-header helpers out of the router
  • ca3acb688248c4dbd689f58e37b2fe73d720edbc fix(conversations-v3): the live read skips open rows that have been idle past the window cap
  • 3cf01384174f8df1cde343bc3f03b19c546fef5f refactor(conversations-v3): keep the live-row rule in a v3 module so the router does not grow
  • 65b650acf30fce7e172ecdc38490a8d56e300a07 fix(home): show a held sync piece as Processing on legacy Home
  • faba7bd8531a60cb8b868c02ae1da7cefc18b136 fix(conversations-v3): the live read skips open rows idle past the window cap (fix(conversations-v3): the live read skips open rows idle past the window cap #25719)
  • 4f44dca34160607b45c0dced39f05cecc7752a6e fix(home): a summarized piece with a stale bridge reads ready, not writing notes
  • 0ec11764034036cddd1081ebf01e3187caa352dc fix(conversations): unbudgeted readers keep the 64-row hidden allowance; live scan has room past legacy rows
  • ffa1426a0f64551837f35cf261c4758c14b10b31 fix(home): show a held sync piece as Processing on legacy Home (fix(home): show a held sync piece as Processing on legacy Home #25723)
  • 067fab4008003f430d154648d7fbe02f3867f1c6 fix(conversations): live tile reads v3 windows through the index
  • ed7274dc2feed7bf9f14e044f78f8c957d0d546d chore(conversations): classify the v3 live-window reader
  • 22a15105c2f7fa712e8acd6e5c7af039ac5d9697 fix(conversations): live read pages through the whole idle window
  • 81396f15f11cb90c97a08670e342581a71ba7470 fix(conversations): live read in two bands under one cap; no has-more without progress
  • ab826e7d66b7736c120bfd415f6f5fea970e6c0d fix(conversations): no has-more on an empty discarded page; disjoint live bands
  • 8039875b41aac15b095e42af5fa2f71d5414dc3c fix(conversations): order the live window read explicitly
  • c1ee221b518d34890987df8773f2f08945631afb fix(conversations): Home pages past hidden runs; live tile is an open v3 window; day view hides what Home hides (fix(conversations): Home pages past hidden runs; live tile is an open v3 window; day view hides what Home hides #25721)

Conversations v3 projection and reconciliation

The material risks are projection/wake lag, oversized writes, colliding window identities and readback false conflicts. The inherited changes preserve transaction and owner fences, bound retry behavior and skip note draining for account deletion.

Mobile Finish and frame-queue behavior

The direct risks concern user-visible Finish reentry and bounded frame-queue progress. Those paths arrived from main and the outbox delta leaves their writes and policy placement unchanged.

  • 16a58d51834ee39ec6f585c657c45bf034fe81db fix: keep desktop frame requests draining at quota
  • 24d814d99d7b6286268616290a702de662f55cbb SCA-2671: Keep desktop frame requests draining at quota (SCA-2671: Keep desktop frame requests draining at quota #25712)
  • 88cc4ad9606a45730989ed034610238353d27b74 fix(app): Finish opens the conversation, with Processing until it is ready
  • 7e8c80edb0ff53e2602d535c612cb3a0535701e3 docs(app): simulator evidence for Finish opening the conversation
  • 0caf86df3aec3eea771067968a87858a8711d912 fix(app): one Finish at a time, nothing to process after a repeat, Processing page ends
  • f3d991ec13478f62d2a3d2fe7cec4f8047e67bae fix(app): Finish opens the conversation, with Processing until it is ready (fix(app): Finish opens the conversation, with Processing until it is ready #25733)
  • 1d5f3216bfe9f91e31b9aaa17118da7ded470ad7 fix(app): a Finish that failed offline can be retried
  • 7c7b491695d69ba932fe4bad2c8be84f7d00d1d7 fix(app): a Finish that failed offline can be retried (fix(app): a Finish that failed offline can be retried #25743)

Tests, formatting and workflow selectors

These entries affect test or validation coverage. No further batch-custody runtime change is introduced by the test wiring.

Scope-only baseline to the reviewed SHA

The scope baseline predates the PR. The main changes covered lookback documentation, stale canary configuration, per-owner v3 backfill and the sync upload allowance. The latter policy is enforced at upload. Custody of already-committed results remains with the existing result and receipt fences. The feature commit introduced the reviewed scheduling and lease path. F1–F3 and the replay fences above address its new scanner, witness and retry risks.

DELTA SHIP 3b258f3

…utbox

# Conflicts:
#	backend/tests/unit/test_batch_pipeline_serving.py
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Exact-head closure a80b924

Supersedes the closure on 3b258f385d8d81407993a37c96b12a7053af5600. That comment records the F1–F3 dispositions, fixing commits, tests and raw panel triage. The named F1–F3 regressions remain present at this head. Previous closure.

Delta since the prior closure

Verification

  • Local affected tests passed 839 cases across serving, pump, outbox, job-store seams and protocol, migration numbering, staging isolation, runtime manifests, listen/pusher configuration and cap-hold intake. Runtime env compose and the prod validator passed.
  • Local Firestore replay passed 16 cases. The outbox conformance case passed on all three backends (simulator, loopback Firestore and native PostgreSQL). The three PostgreSQL migration tests passed.
  • The normal pre-push gate passed, including full backend Pyright, manifest validation and the 40 selected unit files. The monitoring adapter contract passed all 39 tests locally after the hosted CPU guard failure.
  • Hosted CI is green on this exact SHA. ci-wait reported 75 checks, zero pending and zero failed. All eight backend unit shards, unit guardrails, Firestore emulator proofs, both Hermetic stack gauntlets and Firestore index reconciliation passed. The Sync Cloud Tasks gauntlet passed its one retry after the first runner failed to download Redis packages. Unit shard 2 passed its one retry after test_hpa_and_adapter_changes_select_this_contract used 1.04 seconds against the 1.00-second CPU guard on the first run, with all 39 tests in that file passing their assertions. Unit tests, attempt 2, emulator proofs, Hermetic E2E, attempt 2, index reconciliation.
All 80 commits inherited from main
  • 317cf26078e6b5d777959ed5afa43d1c0c8c0f9d Keep conversation purge coalescing on without daily readiness
  • cb2121434fdf8c0bc71878b9149ed654e1da9899 Clarify release floor and purge handback in operator contracts
  • 8f753dcc41dc1cdaf0ad14e6986112c52d4e5ce4 Enforce the purge-safe backend release floor on manual deploys
  • 3761e2dc165209f2a8caf13dfa196b7ea232cefc Check the purge floor before restoring manual deploy traffic
  • 7495e94b84dc8cd7fbdc09a8c2c7df919d0d51d9 Cover retained revision stamps in release floor tests
  • 0894be5b7b9b7481c3c038e9998ddf721bf94a63 Verify the manual rollback floor wiring in the canary fixture
  • 6b035cddeee85647f040bc5b1fd8fffb6b53cb23 Apply the floor to manual deploy preflight traffic repair
  • 69574f17ab2a45d1b96f4139488da746ff62af11 feat(conversations): historical-tier summary on open (T1+ open side, dark)
  • e4a03b7ea41c6cc7ce5cefe413c7ee48ee984339 test(conversations): register the historical-open relevance trigger
  • eba01762b8c9efb4d0e8076e29b3246e1e5177f6 fix(conversations): a historical open-time minimum never arms automatic summary debt
  • 8c5382b90c99b78f3115d5da70d5cf6250f26ca4 feat(batch): park proven monthly allowance refusals at intake
  • 3abf2454542c666084c7fff1a5732c891d082611 test(firestore): cover verified-only monthly usage reads
  • dfe375cf4aa149eed78f279c99d10c82854e3bd5 test(batch): bind intake fixtures to the privacy generation
  • 19d7138708afea2998468070af8027a64a815ffc test(deploy): carry intake parking in runtime fixtures
  • 08a9ee2326cff595e8dd0c791161adddbac0a530 test(config): track the intake switch in the flag budget
  • 2091d9da96ec42153f0b7909d30f9a8c34bf1f5c test(batch): bind intake suites to the emulator stage
  • 337eeaaef80621ea562109dd2cdb6bc7233e5d81 refactor(batch): evaluate the intake switch on the executor
  • 8e1cf6a8d3a59eac599138d1a826c2eb7e35d746 refactor(batch): isolate upload eligibility for the allowance probe
  • 9fc4581f690aef9ecfb770342316c5d677f3a1d5 fix(deploy): expose the intake parking switch reader to static checks
  • ce4ca0efa4935e60d38ff01dc0847fbaf08a8215 fix(deploy): render the default-on intake parking switch as true
  • a728464743ed7b21ecc8bc666a0d3b1535198f4e test(deploy): reuse safe manifest parsing and unchanged reader inventories
  • 6ff70f8446de420c7681485bf44a66b63c02e918 docs(batch): reflect the sync-upload backfill day-cap boundary
  • a546a0e5e7c2676bbf714b3757f927279b0170bc docs(conversations): classify the historical summary open reader
  • 5a8916b4c450d15e843559ac6937fe3fcd490717 fix(app): v3 Home pages on the server's has-more and cursor; live tile shows speech span and an End action
  • 96c659acae6487be914caec1457fcaafc02c47ef chore(app): changelog fragment for the additive historical-tier wire fields
  • b8b0faebc1876e70dbe15e62441cca7dd90ae0bb test(batch): load legacy seal fixtures before call-phase timing
  • 710bec54650568db3aaaf811ede064a997930666 fix(batch): bound cold imports to the upload allowance probe
  • 56c9d518c140cf5da6a159209dcaaf567872ad0a fix(batch): probe allowance for new GPU work in mixed uploads
  • d7e07f628d6cdb2b591652dc14626d80aa868e26 fix(app): live tile length through the duration authority; evidence regenerates from the test
  • 48f58039e61e0593c1dee8c4332de5906c2e91a4 fix(app): Home refresh advances by the storage count
  • 5946b96325559547d6d1e05ef217b7a0d65b8fd6 Merge remote-tracking branch 'origin/main' into fix/v3-home-live-tile
  • 39d7310d01c6a1df7abd300317b870a9d4d0a5e7 fix(app): End on the live detail bar, an in-progress summary state, one v3 live row
  • e406266bc04432c82499a5cf917549bb7c111065 fix(batch): scope intake parking to sync upload roles
  • ba4bfaca562321917cae4d93cb9a127c3244f603 Merge remote-tracking branch 'origin/main' into lane/t1plus-open
  • d6f5ba7bb7a5e4a7480bc10be46c6d04822405ea fix(app): align orphan audio recovery and reclaim with the 60-day sync lookback (fix(app): align orphan audio recovery and reclaim with the 60-day sync lookback #25687)
  • 7437adc424b9fd16cec7a9154907c370877e583c fix(backend-tests): test.sh runs the files it is given and bounds local workers (fix(backend-tests): test.sh runs the files it is given and bounds local workers #25717)
  • c9137890ebf76de9148a030f37ced90484f0c2e9 fix(deploy): preserve-live worker verify and rollback tolerate HPA replicas and CronJob history
  • 2e01b181144a0d8265f7421620e0816cf0eca639 fix(conversations-v3): load a heavy owner's closure by claims, bounded by size (v3_derived_budget)
  • d2df5c26d14f3657ca6ebce15c40998f1d6a2cf9 fix(deploy): scope replica exclusion to HPA Deployments; bind T4 replicas and mismatched owned Jobs
  • b089facfd86ef47a2f2c130311fdf24d9b83fdd7 fix(app): wire Open transcript, End on both tabs, v3-gated live bar
  • 75ac67756f2b98bb9c47f7de93ad225cbcfde7c3 Merge main and address purge coalescing panel findings
  • 3e1c757f03473321176f03afb6079ddc1e7122ef fix(deploy): prove HPA ownership, match whole CronJob runs, rebuild CAS from a fresh read
  • 2373ca1d8c17147b81ee6e4fddbd88d0bd61a565 fix(conversations-v3): bounded claimant reads, write-capped batches, env levers (panel)
  • a9e016993f42da6ed96e8b1b05079a523ba5459d Add bounded historical stranded artifact receipt sweep
  • 573b6378ba599092010b7bd681b2297a143cff81 Record the approved stranded sweep read budget
  • 34753c90b1100b93b9235c7e70bf151469ac8841 Use the public purge reference extractor
  • 4d44cd8491d90db55961c3a96930f808516a34fd fix(deploy): bind owned-Job selector and generated labels, HPA apiVersion; fresh read before dry-run
  • a1d240501ee035ea35a0d68b38b14ad04f454ab7 Merge remote-tracking branch 'origin/main' into lane/t1plus-open
  • 19b50343eba71abaedbe141b818c441e436bac93 fix(conversations-v3): check the closure budget per document; bound loaded sources (panel 2)
  • 7d0c757786331a9bfcf8aecfbd19a57e6017f4cf deploy: unshallow before the integration floor check
  • 619bd2bf650b882805b95701568578af23d0a653 Handle ambiguous owner IDs and test sweep apply fences
  • 7e02ce60cb287d6f8be26bc80926a8700861954d fix(conversations): close the T1+ open-side review findings
  • 375cdf005057293ae898724129147a9821ca185b fix(deploy): reject terminating HPAs, print the patch actually sent, chart tripwire
  • b87979c651a356e42c6fb0354bb15f87b2b10dd1 test(conversations): allowlist the merge-builder test's import-amortized first call
  • ad5795d6384c7eb36af936fa01ab63ba25b1fa76 refactor(conversations): keep the historical reprocess gate helpers out of the router
  • deef3b26fdba43b646571c14fc309d27231f7f5f Park allowance-exhausted batch jobs at sync intake (Park allowance-exhausted batch jobs at sync intake #25722)
  • d9f7636a517756b5619b174afa43417ac6f22b83 fix(conversations): drop the unused historical_summary re-exports
  • 17927bc35fa7e7d52e9f62521943527d54ea49ab fix(app): clean up the live conversation page; keep calls off the placeholder
  • 48faaa53cc90b7753f871617d4eee4aaf6436a0e fix(conversations-v3): bound source reads before reading; count re-derive deletes in the write cap (panel 3)
  • 44b38776b1c1442c42b5b63cac121e13353e2ef8 fix(deploy): preserve-live worker verify and rollback tolerate HPA replicas and CronJob history (fix(deploy): preserve-live worker verify and rollback tolerate HPA replicas and CronJob history #25752)
  • 407aa76e22ffd3f97402ae4ba286e5a1e296c1a3 fix(conversations): pin notes-8 for the schema-hidden historical_minimum provenance
  • e3cfebcfb32a4198071fb967729c88f508b71600 fix(conversations-v3): load a heavy owner's closure by claims, bounded by size (v3_derived_budget) (fix(conversations-v3): load a heavy owner's closure by claims, bounded by size (v3_derived_budget) #25753)
  • 2779f1adc044299cbcc7403832381ac89690dda3 Sweep historical stranded conversation artifact receipts (Sweep historical stranded conversation artifact receipts #25758)
  • e342bd9e24f268860cb1dba0f425dd74b51344b4 fix(app): End only on this phone's own capture; refresh coverage by created_at
  • d95d399a2b02004e4673ad93637dc86a3b280afe fix(conversations-v3): honor manual cuts and preserve exclusive audio claims
  • 66de4e1deeea975b697ace7e0820bf5013ae6a86 fix(app): End ends once; taps during the drain do not finalize again
  • c789feda1d15b4cca1fe952718b96752aa96b7ff fix(conversations-v3): address fragmentation review findings
  • 661d7d456dfd1f0b37c6d037857456f7e0573b23 fix(app): the live detail page, not its Summary tab, keeps the window current
  • 93d0e55efbce30975c684289de7ef776335578ef fix(app): page past a budget-cut page the server says has more; End works again after a failed drain
  • 6a38422af9fa59a6263a1a5113aa768248e4be4b fix(conversations-v3): honor manual cuts and preserve exclusive audio claims (fix(conversations-v3): honor manual cuts and preserve exclusive audio claims #25764)
  • 397ee1d5cbcdb141a10f8504d1b43516e82496fc feat(conversations): historical-tier summary on open (T1+ open side, dark) (feat(conversations): historical-tier summary on open (T1+ open side, dark) #25755)
  • 153c0bc5a12dd9d57c352a062ed758f3c8d89365 Keep conversation purge coalescing on without daily readiness (Keep conversation purge coalescing on without daily readiness #25692)
  • 24dbe878cadca00dc4fb84e0927fc407b575f5eb fix(app): freeze the plan cards while the checkout handoff is pending (fix(app): freeze the plan cards while the checkout handoff is pending #25769)
  • ee5ba4f31e4bfb5cc7f3cf86ed43831875a82084 Revert "deploy(jobstore): stage the feat(backend): host bounded jobstore retirement in serving maintenance #25630 roll with retirement off on backend-integration (deploy(jobstore): stage the #25630 roll with retirement off on backend-integration #25744)"
  • 637f7d543a4994c6e25a620413b385c78576f893 Revert "feat(backend): host bounded jobstore retirement in serving maintenance (feat(backend): host bounded jobstore retirement in serving maintenance #25630)"
  • 99aee0c42958aa3fb66dd2b6c01b0e7ee3d106da perf(metrics): collect production serving bulk metrics every 120s
  • 2839c396d671b7eb0c3acab61d79d857784df984 perf(metrics): collect production serving bulk metrics every 120s (perf(metrics): collect production serving bulk metrics every 120s #25777)
  • 214a8955ad9bd249730f3eb98f05db0dae3a8c5e keep the prod-jobs address in the staging isolation fence
  • 7a66d24164857eaf94ac9e6de412b435d843b55c fix(app): v3 Home pages on server has-more and cursor; live tile shows speech span and End (fix(app): v3 Home pages on server has-more and cursor; live tile shows speech span and End #25725)
  • c210c7816417a48ed3c2ba72d4147893440fa593 revert(jobstore): remove the paused retirement carrier (feat(backend): host bounded jobstore retirement in serving maintenance #25630, deploy(jobstore): stage the #25630 roll with retirement off on backend-integration #25744) so trains from main are clean (revert(jobstore): remove the paused retirement carrier (#25630, #25744) so trains from main are clean #25778)

DELTA SHIP a80b924

@Git-on-my-level
Git-on-my-level merged commit 61fa1cb into main Nov 19, 2026
89 of 93 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/bos-projection-outbox branch November 19, 2026 14:43
Git-on-my-level added a commit that referenced this pull request Nov 19, 2026
## What changes

The batch owner-state lane gets one PR with separate implementation
commits. The first adds a post-lease packing counterfactual for all nine
G/S pairs, a validated capture-gap histogram, observed due depth and
intake cohort labels through fenced completion. It supplies measurement
for the packing decision in place of estimates based only on upload
spacing. The second adds the GMP batch read-cost recording group and CI
coverage for recurring Firestore and PostgreSQL selectors. The existing
Firestore alerts keep their current definitions and thresholds.

The probe reads one metadata-only owner prefix with at most 17 rows, one
outstanding read per process, no RPC retries, and a one-second deadline.
No authority, scheduling or sweep decisions consume its results. The
background-task ratchet records why process loss can drop only an
optional sample. The shared identity helper has no runtime configuration
imports, so the GPU worker does not become a reader of the
upload-coalescing feature flag. The recorded cost ratio uses the
existing fenced completion seconds across metric labels and marks low
volume and missing telemetry explicitly. The selector guard runs the
existing builders in the query inventory and requires actionable
deadlines or owner-reviewed, bounded, expiring exceptions. A shared
selector primitive would change the compatibility queries it is meant to
audit. The check catches the state-only legacy projection discovery and
provider sweep documented by the owner-state R1/R5 inventory. This
follows the same replicated-read failure class as the coalescing scan
containment in #25330.

## Kill switches and mixed versions

`BATCH_PIPELINE_PACKING_SAMPLE_RATE` defaults to `0.001` and caps at
`0.01`. Set `0` across the intake and lease roles, including
`worker.packingSampleRate: '0'` for Helm, to stop observation reads,
intake stamps and cohort completion counters. Restore `0.001` to resume.
The metrics scope records `job:batch_packing_counterfactual` separately.
Release can withdraw the independent GMP `GlobalRules` resource.
Reverting the cost commit withdraws the CI guard without requiring any
persistent data migration.

Old images such as `ef42ee8` ignore the optional job metadata and keep
the existing worker payload and completion counter. New readers treat
missing clocks and ambiguous Stripe paid-versus-trial evidence as
unknown. Completion disposes of the stamp on its existing fenced write.
Old workers may retain it until the ordinary job retention or erasure
path. Samples describe the visible queue shortly after commit, with
explicit capped and unavailable coverage.

## Verification and expected cost

- On the original head `6c06588ec5`, the normal pre-push hook passed 54
repository preflight checks, full backend Pyright with zero errors, and
all 40 selected backend unit test files.
- The initial `BACKEND_UNIT_TEST_FILE_LIST=<focused list> bash
backend/test.sh` run passed 715 checks across packing, scheduler,
capture decode, intake, coalescing, chart, runtime env, flag budget,
census, simulator and cost alerts. Final focused reruns passed 20
packing tests, six background-task checks and two lifecycle guard cases
for the observation module. Later simulator reruns hit the local
300-second file wall. An earlier rerun printed all 12 simulator
assertions as passing before that wall ended the process.
- `pytest -q backend/tests/unit/test_batch_census_registry.py
backend/tests/unit/test_firestore_query_shapes.py -k 'selector or
no_errors or zero_serving_debt'` passed 571 focused checks.
- `backend/.venv/bin/python
backend/tests/promql/firestore_cost_budget.py --promtool <pinned
promtool 2.55.1>` passed the existing thresholds and the new missing,
low-volume, true-zero, raw counter reset and caller-group fixtures.
- The loopback Firestore, PostgreSQL and simulator pull conformance plus
upload coalescing emulator suites passed 109 tests. The separate legacy
intake rollback fixture returns a fallback before admission on this head
and on base `9c88e7f888b0`.
- `backend/.venv/bin/python backend/scripts/cross_service_contract.py`
reported zero new and zero stale violations. The background-task ratchet
passed all six tests.
- Direct savings inferred from this PR are zero. The probe adds one
bounded read per accepted sample. A PostgreSQL probe statement timeout
closes its warm pooled connection. A later store call can incur the cost
of opening and configuring a replacement. That cost is unmeasured. A
serving readout must measure its actual billed overhead and whether
compatible jobs can be combined. The recording group is a source
artifact awaiting Release-owned install and GMP comparison.

Line-Count-Exception: backend/database/firestore_index_registry.py |
2399 -> 2402 | Keep the two metadata-only field exemptions in the
existing index authority so high-volume telemetry adds no single-field
indexes.

## Product invariants affected

- INV-MEM-4. Probe metadata and metrics add no path for user content
disclosure or custody settlement.

## Scope panel

`scope-20261118t145605-e19d` returned Luna and GLM Flash. DeepSeek ended
without a terminal answer on that run. The retry
`scope-20261118t150457-45c4` returned DeepSeek and GLM Flash. The
panel's scoping dossier returns prose without F identifiers, so
`omi-panel triage` did not accept a numbered entry.

- Accepted both reviewers' bounded, post-commit, fail-open read,
source-only metrics, fixed labels, explicit missing or low telemetry,
settled metric window, per-process coverage limits and expiring reviewed
exceptions.
- Accepted separate probe attribution and cost breakout. The probe is
outside the cost total. The old alert query retains its exact caller
regex.
- Used the original coalescing compatibility key and intake clock
evidence. Rejected inferring missing session or funding proof from
`WorkItem`, guessing paid or trial on ambiguous legacy rows, and
projecting full job documents through `pending_page`.
- Used the existing intake and completion writes for the telemetry stamp
and no worker wire changes. An in-transaction query would add
contention. An in-memory handoff would lose attribution across service
boundaries.
- Used a GMP `GlobalRules` recording resource for the fleet-wide window.
The in-cluster PrometheusRule would see only its local series. This
source is outside the Grafana JSON consumer inventory and the alert
provisioning path. Release qualification remains separate from local
PromQL tests.
- Exercised executable query builders and their existing registry. A
cursor on one page cannot establish non-wrapping progress. The
default-on guard uses reviewed exception metadata and exact builder
digests.
- Kept one PR per the lane assignment. Deferred the packing algorithm
and all live, fleet-size and savings validation to the program owner.

## Round 2 review panel

`review-20261119t041052-488d` returned FIX-FIRST on `6c06588ec5`.
Recorded `F1=accept F2=accept F3=accept` with `omi-panel triage`.

- **F1 accepted.** Native read coverage now takes the fewest samples
across every observed series of each type, then applies the 58-sample
floor. A second QUERY series at 58 preserves coverage, and a second
QUERY series at 57 suppresses the ratio.
- **F2 accepted.** The cost section accounts for the warm connection
lost on a PostgreSQL statement timeout.
- **F3 accepted.** A missing or non-finite decoded duration yields
`unknown_duration`. An invalid anchor contributes zero, and an invalid
following row preserves the eligible prefix.

### Round 2 verification

- From `backend/`, `.venv/bin/python -m pytest -q
tests/unit/test_batch_packing_counterfactual.py
tests/unit/test_monitoring_cloud_monitoring_promql_shape.py` passed 29
tests.
- `backend/.venv/bin/python
backend/tests/promql/firestore_cost_budget.py --promtool <pinned
promtool 2.55.1>` passed both new multi-series fixtures and the existing
cost fixtures.
- `pytest -q tests/integration/test_partial_pull_conformance.py
tests/integration/test_pull_batch_parity.py` passed 66 simulator and
Firestore-emulator cases. A local PostgreSQL 16.2 rerun with `-k
postgres` passed the remaining 33 cases.

## Round 3 merge verification

Merge `b15cfb58a3b` incorporates `main` at `e3cfebcfb32`. Upload intake
now forwards main's allowance refusal and this PR's packing observations
to the same admission transaction. Both the observation and admission
use the timestamp taken after the allowance probe.

- `backend/test.sh` passed 342 tests across intake, admission, allowance
holds, staging, packing and future-capture parity.
- The allowance-hold integration matrix passed 75 cases across the
simulator, loopback Firestore and local PostgreSQL. Its 18 skips are
fixture-specific.
- The separate legacy Firestore rollback fixture
`test_accepted_upload_drains_after_rollback_with_encrypted_context_and_accounting`
returned `None` at the admission assertion on both the merge and its
exact main parent.

### GitHub CI on the Round 2 head

GitHub tested merge `3577371251` for the earlier head `1a2711956c5`. The
backend unit suite is red from two failures also observed on `main`
before this follow-up.

- Shard 7 failed
`test_listen_v3_rotation_custody.py::test_frames_during_a_failed_create_never_bind_to_its_successor`
because the producer missed the transient `session-2` label before the
test reached its custody assertions. The test and relevant listen code
match the CI merge's main parent `7437adc424b9`. The same assertion
failed on earlier main `2a8b05cd3e0d` and passed on `7437adc424b9`. [PR
failure](https://github.com/BasedHardware/omi/actions/runs/44465204778/job/135361476491)
· [Earlier main
failure](https://github.com/BasedHardware/omi/actions/runs/44445981915/job/135298343674)
· [Exact main parent
pass](https://github.com/BasedHardware/omi/actions/runs/44458558798/job/135339706957)
- Shard 2 failed the CPU duration guard for
`test_monitoring_adapter_hpa_contract.py::test_hpa_and_adapter_changes_select_this_contract`
at 1.03 seconds against the 1.00-second limit. All 39 assertions in the
file passed. The same test exceeded the guard at 1.06 seconds on earlier
main `ae68d3176d80`. The selector additions in this PR match census and
Firestore guard paths outside this test's HPA and adapter inputs. [PR
failure](https://github.com/BasedHardware/omi/actions/runs/44465204778/job/135361476516)
· [Earlier main
failure](https://github.com/BasedHardware/omi/actions/runs/44416485689/job/135198319558)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/25716?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/25716?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F25716&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. -->

Failure-Class: FC-sync-assignment-read-abort-escapes-retry

Implemented by a delegated agent for the batch owner-state program.


### Current head
The final head is `23d7a907b5f936b59db4f9674b4ca0bedee85d36`. Its
exact-head closure is comment 7016584048, which records the merge with
main after #25724 and the outbox commit-contention fix. lead2 gave the
batch-custody delta source ACK at this head (bus 0bd65c). CI is green.
Git-on-my-level added a commit that referenced this pull request Nov 19, 2026
## Design

DESIGN: Defer speculative native-record audio materialization until
projection assignment needs the authenticated intake context.
Owner-chain read-ahead continues to fetch immutable job bindings and
result artifacts. The existing assignment path requests the staging
artifact and source verification on the storage executor. The owner walk
waits only for its remaining step budget and can resume a pending read
on the next step without another fetch. One unconsumed prefetch avoids
one staging audio-artifact read and the corresponding source metadata
and payload GETs. An assigned unit still performs the required
verification. No storage or database writes are added.
`BATCH_PIPELINE_DEFER_NATIVE_PROJECTION_AUDIO_PREFETCH_ENABLED` is on by
default. Set it to `false` to restore read-ahead.

DESIGN: OK from David on Nov 19, with the fixed-outcome counter, custody
and rollback tests, and exact-head CI and full review gates.

## Batch custody

The native-record branch only defers work. It keeps authenticated
staging, source generation and digest checks, frame and range
validation, owner and conversation binding, authorization, and the live
privacy and deletion transaction checks for every assignment. It makes
no receipt, retention, or deletion decisions from the prefetched result.
Native and non-native legacy inputs continue through the same on-demand
loaders whenever assignment needs audio. The design adds no shared audio
cache and changes no mixed-version data contracts.

## Production readback

Compare complete UTC hours before and after serving. Match projection
completions and check owner-chain advancement and backlog age. In
`backend-integration`, compare
`increase(omi_private_sync_object_get_total{reader="batch_source",kind="payload"}[1h])`
against `storage_googleapis_com:api_request_count` and
`storage_googleapis_com:network_sent_bytes_count` on private-sync
`ReadObject`. Adjust for overlapping rollout changes. Track `sum by
(outcome)(increase(omi_batch_projection_native_audio_prefetch_total{service_name="backend-integration"}[1h]))`
in both modes. Its only label is `outcome`, with `started`, `consumed`,
and `abandoned`. Use abandoned candidates alongside the direct GET and
byte counters to size savings. A candidate may settle in a later scrape
window. Historical abandoned candidates and source reads per candidate
are unmeasured. The before/after test is fewer payload GETs and bytes
per comparable completed audio-hour with stable owner-chain progress.

Nov 2 to Nov 16, bucket-wide bytes per completed audio-hour rose from
1.016 to 2.338 GB, while completed hours rose 7.20×. Cloud Run
integration Google-network receive traffic per completed hour rose from
2.058 to 2.128 GB across the same days. Those numerators include other
activity. They cannot measure waste from a single path. Aggregate
production reads were through `ro-prod`.

INV-MEM-4. Authorization and actual source verification still run before
any assignment that consumes the recording. The focused tests exercise
real assignment through the encrypted staging and generation-pinned
source reader with fake object storage. They cover successful
assignment, staging tamper, source digest mismatch, privacy revocation
during source IO, eager rollback, and accounting for blocked and closed
work. 210 focused tests passed through `omi-heavy` on the updated
implementation, including a delayed read that yields at the step
boundary and resumes the same task. Five loopback Firestore emulator
tests passed against replay, privacy holds and deletion during multipart
projection. The branch also includes current main’s projection
obligation changes in #25724.

Panel `review-20261119t144713-f96b` found that an inline deferred read
could exceed the owner-drain budget. The storage-executor future now
follows the same turn across bounded step waits. The background-task
inventory records why interrupting that read-only work is safe. 6
inventory tests and the 8 focused native prefetch cases passed.

Panel `review-20261119t151207-4579` identified a missing exact metric in
the shared Cloud Run collector keep rule. The collector now retains that
name. A matched served collector revision is required for readback on
backend-integration. The scraper rule and eager-failure fallback tests
passed in the 126-test targeted run.

Final panel `review-20261119t154350-2f61` returned SHIP on head
`5856f1ad769d6b71cccb4d15cc39b8a3ca1cc558` with both reviewers.
Transient failures of the assignment-owned deferred read retain the
durable obligation for a later bounded retry. Eager rollback keeps its
original same-step fallback after a failed speculative load.

Line-Count-Exception: backend/utils/batch_pipeline/projection.py | 1914
-> 1933 | Bound deferred read waits and account for the lifecycle at the
assignment and owner-walk decision boundaries.

Failure-Class: FC-metric-dropped-by-scrape-allowlist

## Gauntlet contention follow-up

On `760390a1`, the local two-worker scenario timed out with the native
prefetch switch on and completed in 26.5 seconds with it off. Both arms
verified non-native bindings and recorded zero native prefetches. The
failing transaction was `mark_enrichment` on a non-native unit.
Firestore aborted its commit and the SDK exhausted five attempts. The
assignment context read is already outside that transaction.

The test-only change sets
`SYNC_ASSIGNMENT_CONTENTION_RETRY_ENABLED=true` in the gauntlet's
serving fixture, matching the serving backend-integration configuration
verified through `ro-prod`. The existing bounded wrapper retries
explicit contention with fresh transactions and jitter. With this
setting and native deferral on, the local batch gauntlet passed all ten
scenarios, including the two-worker case in 36.8 seconds. The fixture
keeps its original timeout, custody assertions, and worker concurrency.
Git-on-my-level added a commit that referenced this pull request Nov 23, 2026
)

## What changed

Add the PL-668 Store conformance guard for mixed-writer projection
discovery from #25724. A healthy elected scan can suppress a stamped row
from legacy discovery while unstamped and explicitly legacy rows stay
visible. A fully filtered page still advances the raw keyset cursor.
Overdue debt withdraws coverage, and a failed query cannot extend it.
Legacy discovery finds the stamped row again when coverage ends.

The test uses the production coordinator and discovery over the
simulator, Firestore emulator and replacement Postgres Store. Go batch
B21 needs equivalent behavior when its projector takes over discovery.

## Verification

- With `OMI_REQUIRE_STORE_BACKENDS=all`, the Store and recovery-custody
suites passed 293 cases with seven existing backend-specific skips.
PL-668 passed all six cases across three stores.
- The existing Emulator Proofs runner includes the same Store suite.
- `git diff --check` passed.

## Product invariants affected

none

## Failure class

Failure-Class: none

🤖 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/26073?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/26073?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26073&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. -->
Git-on-my-level added a commit that referenced this pull request Nov 27, 2026
…ormance (#25832)

## What changed and why

Extend the existing Store conformance suite with parity cases PL-665–667
for committed projection obligations from #25724. A lost wake must leave
durable work for discovery, due pages must stay bounded and stable, and
a stale delivery must be unable to settle a current claim.

The same cases exercise the Python Firestore Store, replacement Postgres
Store and in-memory simulator. The Go rewrite can use them as acceptance
cases under [batch contract
B21](https://github.com/BasedHardware/omi/blob/b301dc3d1f183770aeb041bc22d1a75cb6bedf35/backend-go/docs/contracts/batch.md).
Its batch projector remains a separate implementation and verification
step.

## Product invariants affected

none

## How it was verified

- Ran the Store and recovery-custody suites with
`OMI_REQUIRE_STORE_BACKENDS=all` under a private loopback Firestore
emulator and local Postgres. They passed with 326 passes and seven
existing backend-specific skips.
- Reran the final focused selectors across all three required stores.
All 18 cases passed, including 15 new cases, with zero skips or xfails.
All 11 existing projection-outbox unit cases passed.
- The existing Emulator Proofs runner requires the simulator and
Firestore legs in CI. Its Store proof heading now identifies the
committed projection debt sub-suite.

## Tests

- `test_pl665_projection_debt_commits_with_result` aborts after the real
merge has scheduled its writes, then verifies complete rollback and
wake-free discovery after restart.
- `test_pl666_projection_due_page_filters_before_limiting` checks kind
and time exclusion, the inclusive cutoff, ID ties and visibility of the
next key after a claim.
- `test_pl667_projection_settlement_checks_lease_and_canonical_state`
checks exact lease expiry, stale token and revision refusal, bounded
retry and canonical completed, erased and held dispositions.

Suite path is `backend/tests/integration/test_store_conformance.py`.

## UI evidence

UI-Evidence: none -- shared backend tests only

## Failure class

Failure-Class: FC-unresolved-head-blocks-projection



<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/25832?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/25832?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F25832&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. -->

🤖 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