Repository navigation
feat(jobstore): dark mirror census, erasure and serving parity (C) (SCA-2288) - #25323
Merged
Git-on-my-level merged 15 commits intoNov 15, 2026
Merged
Git-on-my-level merged 15 commits into
Git-on-my-level merged 15 commits into
Conversation
Merges origin/main (27abe5b) into the package C branch of PR BasedHardware#25147. Three textual conflicts, each resolved by keeping both sides: - dual_store.py MIRRORED_TABLES: main added allowance_holds (BasedHardware#25281); this branch added pull_claims and merge_holds. - test_store_conformance.py and test_jobstore_protocol_parity.py: both sides appended tests at the same place. The merged tree fails test_every_serving_read_is_in_the_executable_parity_census: main added Store reads after this branch was cut. The next commit covers them. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…parity and erasure Main gained Store reads and one mirrored table after package C was cut (BasedHardware#25281 allowance parking, the fresh gate, ready-owner discovery, the finish backfill marker). The executable parity census must name every serving read, and erasure of the Postgres copy must reach every mirrored table. - serving_parity: add ready_owners, allowance_owners, allowance_page and projection_finish_backfill_complete to the Store census, and fresh_first_pending and fresh_first_ready_pending to the transaction census. Frozen emulator and Postgres cases compare each one, empty and populated, including an allowance-parked row and its owner hold. - dual_store.owner_rows: erase the owner's allowance_holds row by key, as merge_holds already is. The row was found only when the document named its owner; the erasure test now uses a hold document that does not. Verified on this head with a loopback Firestore emulator and a throwaway Postgres, OMI_REQUIRE_STORE_BACKENDS=all: test_jobstore_purge_postgres, test_dual_store_firestore_postgres, test_dual_store_postgres, test_store_conformance and test_recovery_custody_conformance: 423 passed, 7 skipped (cases not applicable to a backend). Unit: test_jobstore_dual_store and test_jobstore_protocol_parity, 177 passed. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…rged mirror Review of 09eb5ea (gpt-6-luna, read-only) returned FIX with three findings. - Erasure of a copy nothing refreshes kept GPU reservations. Purge leaves a physical GPU reservation in Firestore until release, and the reservation names the leased segment. Owner erasure re-copied every GPU row, so a copy with mirror writes stopped kept the reservation of an erased segment and never saw its release. Such a copy now has its GPU rows deleted during erasure (read_current_without_reservations). A live mirror is unchanged: it copies the release. The cold-copy erasure test fails without this. - The projection-finish backfill (added on main after this branch was cut) stamps results rows and its control marker in a Firestore transaction outside Store.run and did not refresh the mirror, so Postgres kept the old clocks and marker. It now calls mirror_refresh for the marker and the page. - The frozen parity fixtures could not catch a marker read that always answers False, or a broken page after a cursor: they seeded no completed marker, one ready owner and one parked row. They now seed a completed marker, a second ready owner and a second parked row, with cursor cases. Verified on this head, loopback Firestore emulator plus a throwaway Postgres, OMI_REQUIRE_STORE_BACKENDS=all, the same five integration files: 427 passed, 7 skipped. Unit (finish backfill, dual store, protocol parity, shadow seams): 214 passed. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ent id Review round 2 of 21f3a4f (gpt-6-luna) closed the backfill and fixture findings and kept the GPU one open for a live mirror: purge re-copies the primary's active reservation, and if the copy of its later release is dropped (the mirror queue is bounded and best effort), Postgres keeps the erased segment's id. Reading the scheduler shows the release keeps segment_id as well, so the id lives in the reservation row until the GPU is leased again. Rather than special-case when to delete the row, the copy no longer holds the field at all: UNMIRRORED_TABLE_FIELDS drops gpus.segment_id on every copy, and comparisons (mirror read parity, convergence, backfill census, the serving-parity get) compare what the copy is meant to hold. Nothing reads a reservation's segment from Postgres while Firestore is the authority. A copy written before this change reads as stale and is re-copied without the field. The cold-copy special case added in 21f3a4f is removed, since there is nothing left for erasure to miss. Verified on this head, loopback Firestore emulator plus a throwaway Postgres, OMI_REQUIRE_STORE_BACKENDS=all, the same five integration files: passed with 7 skipped (see the PR body for the count on the final head). Unit (finish backfill, dual store, protocol parity, shadow seams, postgres locking): 225 passed. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
6e0f28c passes the table to compare() inside backfill_table, which changes its pinned body digest. The skip was re-reviewed: the function still issues no Firestore query of its own (it consumes _pages), so the skip reason stands and only the digest moves. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ing fields query_value returns a list for most reads and a document only for get. The field stripping added in 6e0f28c applies to documents; say so in the type so the backend type check passes. No behaviour change: get returns a document or an empty one. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…rimary side only Review round 3 of 6e0f28c (gpt-6-luna) closed the GPU reservation finding and found that the serving-parity get comparison stripped gpus.segment_id from both sides, so a Postgres row copied before the field became Firestore-only would read as a match. It now strips the primary side only, as dual_store.compare does, so such a row is a mismatch. A frozen emulator and Postgres case proves it. Verified on this head, loopback Firestore emulator plus a throwaway Postgres, OMI_REQUIRE_STORE_BACKENDS=all, the five integration files: 432 passed, 7 skipped. Unit, including the Firestore query-shape guard: 767 passed. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
CI on 73b4c97 failed Backend unit shard 7/8 in tests/unit/test_reason_label_enums.py: compare_serving_query passed a plain string as the outcome label of omi_jobstore_serving_parity_total. Metric outcome labels must be members of a closed enum passed through reason_label(). ServingParityOutcome names the four outcomes the function already produced (unknown, match, mismatch, error); the values are unchanged. The other seven unit shards and the emulator proofs passed on 73b4c97. Verified locally: test_reason_label_enums, the Firestore query-shape guard and the jobstore unit files, 809 passed. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
This was referenced Nov 14, 2026
…ection Review of ad8c13c on SCA-2288 found that observing projection_finish_backfill_complete (added to the parity census in 09eb5ea) fell through to PostgresStore.run(): its own pool connection and a FOR UPDATE lock on the control marker, outside the observer's warm-connection and deadline path. The observer now reads the marker on its bounded connection with a plain read. A unit test fails if the observation opens a serving transaction, asks for a new connection or issues FOR UPDATE. Verified on this head: unit and guard files (dual store, protocol parity, label enums, query shapes, shadow seams, finish backfill) 824 passed; the five integration files against a loopback Firestore emulator and a throwaway Postgres, all backends required, 432 passed, 7 skipped. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Nov 14, 2026
## What changed and why The original four backend unit files spent call-phase CPU re-parsing or re-serializing large deploy documents once per test. Three more guard failures were then reported on PR #25304 and #25268: `test_batch_upload_coalescing.py::test_supervisor_drains_existing_holds_while_producer_off[true]`, `test_home_transcribing_hold.py::test_stamped_capture_remains_completed_for_batch_replacement`, and `test_monthly_switch.py::test_switch_charges_monthly_first_then_voids_the_unpaid_yearly_invoice`. Those three were not covered by the original #25312 diff or summary table. Their measured calls paid for cold imports of helpers/modules used by only one test. The imports now happen at module collection time, outside per-test call-phase accounting. Each YAML-heavy file parses once per process with the C loader and deep-copies only where a test mutates. Assertions remain intact. The three follow-up changes only move imports; no production code changed. | File | Cost removed | | --- | --- | | `tests/unit/test_conversation_erasure_queue_deploy.py` | 280 KB `deploy/runtime_env.yaml` + 82 KB `deploy-backend-stack/action.yml` parsed in every test | | `tests/unit/test_backend_runtime_env_validator.py` | 280 KB manifest re-serialized through `yaml.safe_dump` before each validation | | `tests/unit/test_pipeline_ledger_routes.py` | 160 KB `route_policy_manifest.yaml` parsed with the pure-Python loader | | `tests/unit/test_listen_helm_env_overrides.py` | 40 KB listen helm workflow re-parsed for every `_step()` lookup | | `tests/unit/test_batch_upload_coalescing.py` | Load the supervisor modules at collection instead of importing them inside the measured test call | | `tests/unit/test_home_transcribing_hold.py` | Load the recording/projection helpers at collection instead of importing them inside the measured test call | | `tests/unit/test_monthly_switch.py` | Preload `billing_recovery`, which `switch()` lazily imports, before the measured test call | ## Product invariants affected None. No production code, guard limits, allow-list entries, markers, skips, retries, or assertions changed. ## How it was verified The guard reports call-phase CPU (`time.process_time`), warns above 0.10 s, and fails above 1.00 s. It prints numeric per-test values only above the warning floor; `<0.10 s` is the reportable upper bound for nodes with no warning row. Before values below are from five recent main guard runs: [43613611072](https://github.com/BasedHardware/omi/actions/runs/43613611072), [43609042294](https://github.com/BasedHardware/omi/actions/runs/43609042294), [43608838125](https://github.com/BasedHardware/omi/actions/runs/43608838125), [43600956507](https://github.com/BasedHardware/omi/actions/runs/43600956507), and [43607443879](https://github.com/BasedHardware/omi/actions/runs/43607443879), except where a stronger PR failure is cited. The original four-file fix was measured on PR run [43623704701](https://github.com/BasedHardware/omi/actions/runs/43623704701). The follow-up import changes are at head `6ccb6d91` and were measured on PR run [43627834886](https://github.com/BasedHardware/omi/actions/runs/43627834886): all eight backend unit shards and backend guardrails passed. The guard emitted no warning row for the three added test nodes, so each was below 0.10 s in that report. Runtime-validator rows explicitly report both original run `43623704701` and final run `43627834886`, in that order. Values without a warning row use the guard’s `<0.10 s` reporting bound. | Changed test node | Before (CI call CPU) | After (CI call CPU) | | --- | ---: | ---: | | `tests/unit/test_conversation_erasure_queue_deploy.py::test_every_prod_dispatcher_names_the_queue_and_wipes_keep_theirs` | 1.10 s on [#25304](#25304); 1.13 s and 1.04 s on [#25323](#25323) | <0.10 s on #25312 | | `tests/unit/test_conversation_erasure_queue_deploy.py::test_prod_contract_rejects_erasure_units_on_the_wipe_queue` | 0.93 s on main; 0.95 s on [#25304](#25304) | <0.10 s on #25312 | | `tests/unit/test_backend_runtime_env_validator.py::test_runtime_manifest_lake_writes_allow_dev_but_require_c4_for_prod[false-1-dev]` | 0.57 s | 0.26 s (original); 0.22 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_runtime_manifest_lake_writes_allow_dev_but_require_c4_for_prod[false-1-prod]` | 0.55 s | 0.23 s (original); 0.22 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_runtime_manifest_lake_writes_allow_dev_but_require_c4_for_prod[true-0-dev]` | 0.56 s | 0.24 s (original); 0.22 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_runtime_manifest_lake_writes_allow_dev_but_require_c4_for_prod[true-0-prod]` | 0.57 s | 0.25 s (original); 0.23 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_runtime_manifest_lake_writes_allow_dev_but_require_c4_for_prod[true-100-dev]` | 0.52 s | 0.21 s (original); 0.21 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_runtime_manifest_lake_writes_allow_dev_but_require_c4_for_prod[true-100-prod]` | 0.57 s | 0.22 s (original); 0.22 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_dev_lake_writes_require_real_bindings[BUCKET_OBJECT_LAKE]` | 0.53 s | 0.21 s (original); 0.21 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_dev_lake_writes_require_real_bindings[OBJECT_LAKE_KMS_KEY]` | 0.56 s | 0.22 s (original); 0.21 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_memory_job_retirement_rejects_captured_after_window` | 0.54 s | 0.22 s (original); 0.22 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_memory_job_retirement_rejects_reintroduced_job` | 0.52 s | 0.22 s (original); 0.22 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_memory_job_retirement_rejects_retired_cron_env_on_request_path` | 0.56 s | 0.27 s (original); 0.22 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_memory_job_retirement_rejects_retired_maintenance_controls_on_request_path[MEMORY_CANONICAL_CONSOLIDATION_ENABLED]` | 0.50 s | 0.21 s (original); 0.20 s (final) | | `tests/unit/test_backend_runtime_env_validator.py::test_memory_job_retirement_rejects_retired_maintenance_controls_on_request_path[MEMORY_CANONICAL_MAINTENANCE_FLEX]` | 0.52 s | 0.22 s (original); 0.21 s (final) | | `tests/unit/test_pipeline_ledger_routes.py::test_route_policy_manifest_declares_both_routes` | 0.71 s peak on main | <0.10 s on #25312 | | `tests/unit/test_listen_helm_env_overrides.py::test_materialize_step_installs_dependencies_before_the_secret_touches_disk` | 0.69 s peak on main | <0.10 s (both runs) | | `tests/unit/test_batch_upload_coalescing.py::test_supervisor_drains_existing_holds_while_producer_off[true]` | 0.93 s peak on main; 1.04 s and 1.09 s on [#25304](#25304) | <0.10 s on head `6ccb6d91` | | `tests/unit/test_home_transcribing_hold.py::test_stamped_capture_remains_completed_for_batch_replacement` | 0.76 s peak on main; 1.10 s on both [#25304](#25304) runs | <0.10 s on head `6ccb6d91` | | `tests/unit/test_monthly_switch.py::test_switch_charges_monthly_first_then_voids_the_unpaid_yearly_invoice` | 0.60 s on main; 1.10 s on [#25268](#25268) | <0.10 s on head `6ccb6d91` | The three new follow-up nodes ran in Backend unit shards 4/8, 6/8, and 8/8 respectively; each shard passed. Local backend unit check passed (`1792 passed in 21.08s`). The pre-push bounded gate passed; `scripts/pr-preflight` and static guardrail checks also passed. ## Tests No assertions were added, removed, skipped, or weakened. Existing tests continue to run with the imports paid once during module collection. ## UI evidence UI-Evidence: none -- backend test-only change. ## Failure class Failure-Class: none ## Full census of main CPU-guard warnings at or above 0.7 s The changed nodes above are the addressed subset. The following exact node IDs are the remaining non-allowlisted tests observed at or above 0.7 s in the five main runs `43613611072`, `43609042294`, `43608838125`, `43600956507`, and `43607443879`: - `tests/unit/test_backlog_release_gate.py::test_held_audio_takes_normal_priority_only_when_granted_and_never_the_vendor_table` - `tests/unit/test_batch_held_dead_letter.py::test_private_requeue_rpc_is_stage_bound_authenticated_and_idempotent` - `tests/unit/test_batch_pipeline_custody_property.py::test_phone_hears_completed_only_when_every_unit_is_terminal[false]` - `tests/unit/test_batch_pipeline_custody_property.py::test_phone_hears_completed_only_when_every_unit_is_terminal[true]` - `tests/unit/test_batch_pipeline_left_context.py::test_kill_switch_and_onset_start_take_no_context` - `tests/unit/test_batch_pipeline_pull_multi_lease.py::test_batch_transaction_cuts_transactions_and_round_trips_per_lease[False]` - `tests/unit/test_batch_pipeline_pull_multi_lease.py::test_batch_transaction_cuts_transactions_and_round_trips_per_lease[True]` - `tests/unit/test_batch_pipeline_pull_multi_lease.py::test_one_shard_leases_in_the_same_order_as_one_lease_per_transaction[True]` - `tests/unit/test_batch_pipeline_pull_multi_lease.py::test_write_stop_before_any_lease_commits_progress_without_parking_the_shard[False]` - `tests/unit/test_batch_pipeline_pull_multi_lease.py::test_write_stop_before_any_lease_commits_progress_without_parking_the_shard[True]` - `tests/unit/test_check_cloud_run_env_drift.py::test_gke_envfrom_configmap_keys_are_compared` - `tests/unit/test_check_cloud_run_env_drift.py::test_gke_helm_render_accepts_deployed_override_args` - `tests/unit/test_conversation_delete_accept.py::test_53_same_second_deletes_all_return_204_fast_and_all_end_erased` - `tests/unit/test_conversation_transcript_offload.py::test_live_in_progress_transcript_crosses_document_limit[enhanced-True]` - `tests/unit/test_conversation_transcript_offload.py::test_live_in_progress_transcript_crosses_document_limit[standard-True]` - `tests/unit/test_daily_summary_job_resilience.py::test_cursor_age_metric_retains_abandonment_signature_then_resets_on_fresh_tick` - `tests/unit/test_daily_summary_job_resilience.py::test_due_local_hours_include_half_and_quarter_hour_zones` - `tests/unit/test_enrichment_route.py::test_legacy_sync_handler_delegates_to_the_consumer_when_routed` - `tests/unit/test_episode_f_join_gate_metrics.py::test_refusal_counts_only_first_reason_and_keeps_join_without_extra_reads[owner-change0-snapshot]` - `tests/unit/test_lifecycle_invariants.py::test_latch_clause[batch:leased/entry_deadline]` - `tests/unit/test_live_stt_restart_burst_sim.py::test_sim_soniox_promotes_within_twenty_minutes_of_the_escape` - `tests/unit/test_memories_delete_batch_chunk.py::test_unlock_helpers_fence_deletion_visible_after_memory_page[None-conversations]` - `tests/unit/test_memory_replace_policy.py::test_canonical_dense_capture_is_bounded_before_atomic_replacement` - `tests/unit/test_monitoring_adapter_hpa_contract.py::test_hpa_and_adapter_changes_select_this_contract` - `tests/unit/test_pinecone_partition_migration.py::test_qualify_counts_every_split_upsert_in_generation_and_can_commit` - `tests/unit/test_pinecone_partition_migration.py::test_wide_page_splits_by_complete_serialized_payload_without_losing_records` - `tests/unit/test_pipeline_sim_vendor_drills.py::test_holds_never_outlive_the_outage_by_more_than_one_redrive[3600.0]` - `tests/unit/test_prerecorded_vendor_fail_fast.py::test_detect_failure_outcomes[post0-quota]` - `tests/unit/test_prerecorded_vendor_fail_fast.py::test_detect_outcome_accepted` - `tests/unit/test_record_gap_fill.py::test_empty_retained_set_needs_a_valid_start[nan]` - `tests/unit/test_record_gap_fill.py::test_empty_retained_set_needs_a_valid_start[None]` - `tests/unit/test_record_gap_fill.py::test_empty_retained_set_needs_a_valid_start[not-a-time]` - `tests/unit/test_record_seal_cluster_repair.py::test_jobs_kill_switch_restores_exact_old_hash_scan[off]` - `tests/unit/test_replay_harness_capture.py::test_bucket_names_come_from_backend_config_and_runtime_overrides` - `tests/unit/test_soniox_batch_async.py::test_poll_wait_releases_http_permit_and_never_repeats_submission` - `tests/unit/test_text_window_abstention.py::test_mixed_invalid_text_applies_owner_without_labeling_bad_segment[window0-first]` - `tests/unit/test_verify_backend_release_vector.py::test_deploy_script_argparse_percent_escapes[backend/scripts-*.py]` - `tests/unit/test_voice_message_syncing_cleanup.py::test_cleanup_leaves_other_users_and_other_folders_alone` - `tests/unit/test_voice_message_syncing_cleanup.py::test_voice_question_wav_in_syncing_dir_is_deleted_after_the_stream` - `tests/routers/test_import_transcripts_route.py::test_route_policy_records_the_byok_check_its_auth_runs` Already allowlisted with written reasons (not changed; the `[1]` parameterized row appeared in the main census and is covered by this base-node allow-list entry): - `tests/unit/test_speaker_learning_round2.py::test_legacy_admission_bounds_candidates` - `tests/unit/test_sync_input_limits.py::test_opus_disk_full_mid_file_raises_capacity_pressure_and_keeps_no_prefix` - `tests/unit/test_batch_live_preview.py::test_all_three_cohorts_share_batch_bucket_and_summary_survives_admission_rollback` - `tests/unit/test_batch_pipeline_pull_multi_lease.py::test_long_heads_never_push_one_transaction_past_the_write_budget[None]` - `tests/unit/test_batch_pipeline_pull_multi_lease.py::test_long_heads_never_push_one_transaction_past_the_write_budget[1000000]` The remaining nodes are workload/structural costs or runner-sensitive isolated imports, not repeated parsing of the large deploy documents fixed here. The HPA selector test walks 27 chart sources; the batch transaction, custody, partition, lifecycle and outage drill nodes exercise the volume or state space named in their assertions. No guard exception was added for any of them. ## Still open Merge and the post-merge “next three main runs” check belong to the merge/verify stages. After merge, report those run links and per-test results on the issue; then post the merge SHA so the lifecycle owner can sync.
…match The second look on SCA-2288 (Kimi, exact head b067fc0) found that the serving-parity get comparison ran the primary document through mirrored(), which removes repair_lineage as well as the GPU reservation's segment id. An intake with lineage in Firestore therefore compared equal to a copy without it, contradicting docs/jobstore-dark-parity.md: that omission is a serving mismatch and an activation gate. The regression came in with 6e0f28c. The checker now takes off only the table's own exception (UNMIRRORED_TABLE_FIELDS, the GPU segment id), from the primary side only. A frozen emulator and Postgres case proves an intake with lineage is a mismatch while the same intake without it matches. Verified on this head: unit and guard files 824 passed; the five integration files against a loopback Firestore emulator and a throwaway Postgres, all backends required, 433 passed, 7 skipped. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
Git-on-my-level
added a commit
to Git-on-my-level/omi
that referenced
this pull request
Nov 15, 2026
Brings in BasedHardware#25302 and BasedHardware#25323 (jobstore serving parity census). Conflict: tests/unit/test_jobstore_protocol_parity.py (two tests added at the same place; kept both). BasedHardware#25323 requires every public serving read of the store to be in the parity census, so the bounded ready_pending read this branch adds (used only by the staged-off sibling guard, and already implemented on the Postgres store) is registered in STORE_QUERIES. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Nov 15, 2026
…#25360) Complete the Firestore-authoritative discovery index and its production copy lifecycle. In explicit index mode, only due leased/retry/result_ready reads use Postgres hints; Firestore retains every transaction, claim and privacy decision. Warm SQL/socket deadlines, first/periodic primary scans and live read/write kills preserve fallback. Production copying now resolves a canonical owner at every current-document reread, applies a deterministic owner cohort and omits shared control/GPU/pull-claim documents. Excluded, malformed, absent or newly removed owners retire their copy. Captured reads and convergence use the same policy. State-specific sampled due parity checks selected primary-prefix coverage and validates every returned hint against the current primary; it does not claim complete backlog coverage. A bounded operator page fills historical copies or rotates through retained copies after primary TTL deletion, including a dropped expiry refresh. It never invents a TTL or deletes Firestore state. Explicit read/statement/row/deadline budgets, warm transport deadlines, atomic private target-bound checkpoints and a nonblocking single-writer lock keep retries resumable. Copy retirement and synchronous privacy erasure remain reachable with mirror mode/admission/write kills off. ## Product invariants affected none ## Validation - New cohort/admission unit suite: 256 passed. - New bounded reconciliation suite: 26 passed; operator/checkpoint suite: 55 passed. - Production copy, existing mirror, index selection and seam unit suites: 148 passed. - Combined real loopback Firestore and Postgres run: 48 passed, none skipped, covering production copy/cohort/retirement and sampled parity, existing index deadlines/stale hints, and account/conversation copy erasure. - An initial integration run reproduced a tuple-key encoding defect in sampled parity; converting the bounded observation to ordered key/document pairs fixes it. The same real backend cases pass afterward. - Independent source review found and reproduced mode-off queued upserts and absent-row parity pollution. Both are fixed with regressions; 210 focused cohort/copy tests and the 48 real backend cases pass afterward. - Full GitHub CI completed green on 6b1e2bd, including eight unit shards, guardrails, emulator proofs and hermetic/stack suites. Current main 5b21b67 is integrated at 06b4621; all 43 local manifest checks and 496 focused isolated tests pass, with one existing deselection, and independent exact-head review is SHIP. Full substantive GitHub CI completed green on this exact combined head, including all eight unit shards, guardrails, emulator proofs and hermetic/stack suites; no failed/cancelled/pending checks in the readiness snapshot. All 43 prior local manifest checks and normal push gates passed at 6b1e2bd. Independent exact-head integration verdict on d433ea5: SHIP; jobstore code, hooks, tests and fences remain unchanged afterward. The only subsequent delta is the locally reviewed retention-test import relocation below. Four affected isolated files pass 185 tests with the timing guard active; the complete clock ratchet passes 11 tests (overlapping prior sets). - Repeated CI shard 4 CPU overruns were traced to the retention test importing shared provider/model helpers inside its measured call. Move that existing import to collection, preserving every assertion and the unchanged 1-second guard. The two affected files pass 345 tests through the CI-style isolated runner; the diagnostic profiled call drops from 1.405s to 0.0021s locally. - The CI-style isolated 14-file unit runner passed 1205 tests; latest interface, reconciliation, index and cohort checks passed 324 tests. These overlap the other sets and are not additive. - The new operator-only document-id page sites are registered with reviewed body digests, and their read envelope is declared at the exact collection site. All prior collection budget values are unchanged; the 1M/day envelope is planning-bound and requires supervisor accounting before activation. - Strict changed-file pyright reports zero errors; public bounded helper contracts replace private cross-module access without suppressions. The normal full pre-push checks passed on the activation source and are repeated on the final integration head. - Third-party image closure passes with the module-specific codec import, avoiding an unintended package-barrel edge into unrelated outbox/enrichment dependencies. Worker dependency locks and gate allowances are unchanged. ## Rollout and rollback The mirror foundation #25323 is merged. The source does not activate production. A separately reviewed stdlib operator supervisor enforces a canonical single-carrier installation, shared target daily reservations and bounded child-process cleanup; all 45 local packet tests pass. It is delivered on SCA-2288, with installation and production execution still pending. The release executor must pin actual writer/deletion revisions and targets, supervise a bounded rotation outside sweepable worktrees, set and measure its accepted retirement lag/read/write/connection budgets, verify backup retention and mode-off erasure, then admit an initial deterministic cohort in shadow mode. Index ramp is leased, retry, then result_ready, expanded only with state-specific traffic/parity, action correctness, sweep freshness, rollback and net-read evidence. Expansion belongs to the SCA-2288 integration owner with the existing release executor; the next evidence review and absolute budgets must be recorded before each activation. No arbitrary soak interval is required. Rollback discovery with JOBSTORE_INDEX_READS=off or shadow/firestore mode; JOBSTORE_SHADOW_WRITES=off also disables index reads. Disable new production copies with JOBSTORE_PRODUCTION_MIRROR=off. Keep the retained target and deletion executor access, and continue copy retirement, until all retained obligations retire. Source merge, runtime acceptance and settled billing savings remain separate. #25215 stays frozen. Runbooks: backend/docs/jobstore-discovery-index.md and backend/docs/jobstore-production-mirror.md. Existing SCA-2288/SCA-2222 retain coordination; no second rollout owner or production authority is introduced. ## Failure class Failure-Class: none This is a new explicitly selected discovery/copy lifecycle on the merged mirror foundation. Unreviewed discovery methods, including ready_pending and hold/completion/capacity queries, retain primary semantics. No workflow, flag-budget policy or baseline allowances change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current merge candidate and disposition — 2026-11-15
Current head:
6a0fe352db1220059456488b2ac752420ebd1c44.The m5 author remains the sole branch writer. This CI-refresh commit has the same complete source tree (
1ff77c8991d37e33879fd78b14717b85b2993155) as lineage-fix commite9eb225342c66f01cded3c61e4d52372c1955c8e. The fix normalizes only table-specific primary-side exceptions and preserves omitted intakerepair_lineageas a serving mismatch; its regression covers matching without lineage and mismatching with it.SCA-2339's RULING on SCA-2288 at 2026-11-15 00:37:42Z is fix exactly this and ship without another review. It supersedes the older review requests recorded below; it is not a claim of a new reviewer SHIP at this head. Local results reported by the author: 824 unit/guard passes; 433 integration passes, 7 skipped. Terminal candidate CI at 04:47Z passed all eight backend unit shards, the Backend unit suite, emulator proofs, Hygiene and the configured required checks. Synthetic candidate
e822681f9bda222a806e926d6d5104b764d354feincludes repaired main.This is a dark-mirror source handoff through normal release-owner merge/train controls. Production admission and activation remain separate. Copy-TTL retirement and owner-resolved cohort wiring remain production-readiness requirements; no production namespace is admitted by this handoff. No live evidence or savings is claimed. All older commit/test/review receipts below are historical and do not identify the current candidate.
What changed and why
SCA-1807 package C extends the dark Firestore-to-Postgres mirror census to pull claims and merge holds, adds executable comparisons through the actual serving read methods, and makes cold-copy erasure independent of mirror mode and namespace admission. Explicit namespace admission defaults empty; the existing staging fence still refuses production. Firestore remains the only claimant/writer; no D reverse copier or serving writer is added.
Query observation is separately opt-in, uses a bounded queue, and emits counts only. Frozen emulator/PG fixtures cover every serving read, empty results, ties, null/missing values, cursors, owner-serialized phantoms and deliberate drift. Capture repair_lineage retains its existing Firestore-only retention boundary; this is explicitly a full-field serving gate, not normalized away by the new checker.
Product invariants affected
none
How it was verified
make preflight: all 41 checks passed; the normal push hook also enforces final-head checks and backend typing.No live shadow evidence, activation, deployment, migration, privacy serialization proof or savings is claimed. Source savings: $0. SCA-1697 retains D ownership; staging sizing/RC2, production admission, repair lineage retention, cross-store privacy, full-field live parity and settled billing remain gates. Details: backend/docs/jobstore-dark-parity.md.
Update 2026-11-14: main merged in, new owner (SCA-2288)
This PR now belongs to SCA-2288 (Postgres as a discovery index beside Firestore; David's ruling of 2026-11-14 is on SCA-1959 and SCA-2288). SCA-1807 was folded away; the original author no longer pushes here.
Historical integration: two commits on top of previously reviewed commit
43ddb2ee26a9:117b10be02b1merges origin/main (27abe5bbf8f6). Three textual conflicts, each resolved by keeping both sides:MIRRORED_TABLES(main addedallowance_holdsin SCA-2195: park allowance-held recordings outside active sweeps #25281; this branch addedpull_claimsandmerge_holds) and two test files where both sides appended tests.09eb5eab3071covers what main added after this branch was cut. The executable parity census gainsready_owners,allowance_owners,allowance_page,projection_finish_backfill_complete,fresh_first_pendingandfresh_first_ready_pending, each with frozen emulator and Postgres cases. Erasure of the Postgres copy now removes the owner'sallowance_holdsrow by key; before this it was found only when the hold document named its owner, and the erasure test now uses a hold document that does not.Verified on
09eb5eab3071, loopback Firestore emulator plus a throwaway Postgres,OMI_REQUIRE_STORE_BACKENDS=all:test_jobstore_purge_postgres,test_dual_store_firestore_postgres,test_dual_store_postgres,test_store_conformance,test_recovery_custody_conformance: 423 passed, 7 skipped (cases not applicable to a backend). Unittest_jobstore_dual_store,test_jobstore_protocol_parity: 177 passed. The earlier verification section above describes historical commit43ddb2ee26a9and its base, not the current candidate; the full nine-file design matrix was not re-run on this head.Independent review of
09eb5eab3071(gpt-6-luna, read-only) returned FIX with three findings, all fixed in21f3a4f3080d:Store.runand did not refresh the mirror; it now does.Verified on
21f3a4f3080d, same setup and the same five integration files: 427 passed, 7 skipped. Unit (finish backfill, dual store, protocol parity, shadow seams): 214 passed.Review round 2 of
21f3a4f3080dclosed the backfill and fixture findings and kept the GPU one open for a live mirror (a dropped copy of the release would leave the erased segment's id in Postgres).6e0f28ce8783fixes it at the root: the copy never holdsgpus.segment_id(UNMIRRORED_TABLE_FIELDS), comparisons compare what the copy is meant to hold, and the cold-copy special case from21f3a4f3080dis removed.22d3e4e792c4re-pins the reviewed body digest ofbackfill_table(the pre-push Firestore index guard caught the changed body; the function still issues no query of its own).2754ac3b8dd3narrows a type in the serving-parity comparison so the backend type check passes; no behaviour change. Verified for6e0f28ce8783: the five integration files, 429 passed, 7 skipped, run before one more fixture case (getof a GPU row) was added; the two files changed after that (test_dual_store_firestore_postgres,test_jobstore_purge_postgres) were re-run on the final tree, 108 passed. Unit (finish backfill, dual store, protocol parity, shadow seams, postgres locking): 225 passed.Review round 3 closed the GPU finding and found that the serving-parity
getcomparison stripped the field from both sides, so a stale Postgres row would read as a match.73b4c9799a58strips the primary side only, with a frozen case that proves a stale row is a mismatch.Historical validation on commit
73b4c9799a58: the five integration files, 432 passed, 7 skipped. Unit, including the Firestore query-shape guard: 767 passed.CI on
73b4c9799a58failed one unit shard intest_reason_label_enums.py: the serving-parity counter took a plain string as its outcome label.ad8c13c81d2cdeclares the four existing outcomes as an enum passed throughreason_label(); values are unchanged. The other seven unit shards and the emulator proofs passed on73b4c9799a58.The board review on SCA-2288 of
ad8c13c81d2cfound that observingprojection_finish_backfill_completewent throughPostgresStore.run()(its own connection and aFOR UPDATEon the control marker).b067fc016e8freads the marker on the observer's bounded connection with a plain read, with a unit test that fails on a serving transaction, a new connection orFOR UPDATE. Verified onb067fc016e8f: unit and guard files 824 passed; the five integration files 432 passed, 7 skipped.The second look on SCA-2288 (Kimi, historical review commit
b067fc016e8f) found that the serving-paritygetcomparison also removedrepair_lineagefrom the primary side, so an intake with lineage compared equal to a copy without it.e9eb225342c6takes off only the GPU reservation's segment id; a frozen case proves the lineage omission stays a mismatch. Verified one9eb225342c6: unit and guard files 824 passed; the five integration files 433 passed, 7 skipped.Still dark: no namespace is admitted by default,
JOBSTORE_SHADOW_QUERY_PARITYis off, and nothing here serves a read from Postgres. Historical review scope (superseded by the SCA-2339 ruling below): the merge delta and the commits after it (09eb5eab3071,21f3a4f3080d,6e0f28ce8783,22d3e4e792c4,2754ac3b8dd3,73b4c9799a58,ad8c13c81d2c).Tests
Regression and frozen-query cases extend test_dual_store_firestore_postgres.py, test_jobstore_purge_postgres.py and test_store_conformance.py. Golden harness claim forwarding now exercises the same mirror seam as production. No authoritative behavior or golden outputs change.
UI evidence
UI-Evidence: none -- backend source only
Failure class
Failure-Class: none