Repository navigation
feat(batch): per-route, per-language delivered share with a baseline alarm (SCA-2117) - #25262
Merged
Git-on-my-level merged 10 commits intoNov 14, 2026
Merged
Conversation
…alarm (SCA-2117) The 2026-11-13 Japanese provider-STT miss went unseen for about a week because every batch delivery signal was fleet-wide or counted from the commit side. A provider unit that never leaves vendor_held has no result row, so a commit-based ratio cannot see it. - ProjectionStore.acknowledge stamps jobs.delivered_at and jobs.delivered_in_target in the transaction that sets projection_state=completed. The job row is already read by the session; the stamp is sticky on replay. - database/batch_pipeline_delivered_share walks one bounded job-metadata page (census states minus record_pending, admitted 20 to 5 minutes ago, capped at 5,000 rows) and utils/batch_pipeline/delivered_share publishes the per-cell ratio, admitted and delivered counts, truncation and sample age on the maintenance leader every 300 s. - Core Features gains the 'Did the user get a transcript?' row; Grafana rule omi-batch-delivered-share-language fires when a cell falls below 70% of its own 7-day peak with at least 20 admitted units. - scripts/batch_pipeline_delivered_share_report backfills a past window from retained results and runs a hermetic drill that shows the Japanese dip and fires the alarm. Measurement only: no admission, merge, projection order, retention or privacy behaviour changes. BATCH_PIPELINE_DELIVERED_SHARE_ENABLED=off stops the page.
…CA-2117) Review finding 1: the cohort page streamed full job documents, which carry owner_id, owner_key, conversation_id, projection_binding ids and result.audio_uri, while the change note claimed no user id is read. The query now projects segment_id, enqueued_at, state, stt_route, policy.stt_route, projection_binding.language, delivered_in_target and delivered_at, so the claim is true and the page payload shrinks. Also drops the unused ROUTES and BASELINE_SECONDS constants (the rule's 7-day range is pinned by the contract test) and states the 20-unit/15-minute volume floor in the runbook.
Bind baseline arguments to the fields consumed by the report, reject partial baselines before reads, and restrict result reads to receipt fields. Exercise the actual CLI with and without baseline windows. Failure-Class: none Co-authored-by: multica-agent <[email protected]>
…-studio-opencode-deepseek-v4/627328b52b9a
Git-on-my-level
deleted the
agent/m1-studio-opencode-deepseek-v4/627328b52b9a
branch
November 14, 2026 16:04
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.
The 2026-11-13 Japanese provider-STT miss went unseen for about a week because every batch delivery signal was fleet-wide or counted from the commit side. A provider unit that never leaves
vendor_heldhas no result row, so a commit-based ratio cannot see it. This adds the missing signal: of recordings admitted, the share whose transcript reached the user within the 5-minute target, split by STT route and language, with a per-language baseline alarm.Contract
Done-true
python -m scripts.batch_pipeline_delivered_share_report --project based-hardware --from 2026-11-13T00:00Z --to 2026-11-14T00:00Z --step 900 --baseline-from 2026-11-06T00:00Z --baseline-to 2026-11-12T00:00Zprints the per-cell table and the firing cells.
python -m scripts.batch_pipeline_delivered_share_report --drillruns the hermetic simulator healthy and with the Japanese provider route down, printsprovider/ja 36/36 1.000then0/36 0.000, and reportsFIRING provider/ja. Pinned bytests/unit/test_batch_pipeline_delivered_share_contract.py.Production acceptance belongs to the release owner after independent exact-head review: retained 2026-11-13 Japanese dip, deployed Core Features signal read, and live alarm drill. The synthetic drill does not close acceptance. No additional production reads until the operator query budget is declared.
Must-not-change
ProjectionStore.acknowledgealready updates the result row and already reads the job row; this adds one job write carrying a first-delivery timestamp and a boolean. No new transaction, retry or fence.enqueued_at,stt_route,policyandprojection_bindingare only read.New state and its readers
jobs.delivered_atProjectionStore.acknowledge, same transaction asprojection_state=completedutils/batch_pipeline/delivered_share, the report scriptjobs.delivered_in_targetTrueis a positive delivery signalBoth are additive. Rows written before this change carry neither, so the live share reads zero delivery for one cohort after deploy and then recovers. No older reader selects an unknown field. Rollback is a revert; the fields become inert.
Tuning
MIN_VOLUME new: 20 admitted units per 15-minute cohort. No prior value existed because this cell is new; below the floor the alarm cannot fire, and the drill's 36-unit Japanese cohort clears it.
Sampling cost
delivered_share_pagewalks{namespace}_jobsfor the census vocabulary minusrecord_pending, admitted 20 to 5 minutes ago, ordered byenqueued_at, capped at 5,000 metadata rows. One page per 300 s on the maintenance leader. The at-cap cost is 1,440,000 reads/day/environment; the normal 2026-11 cohort is ~2,800 units (~800k/day). The read budget is declared in.github/firestore-collection-budgets.json. A saturated page setsomi_batch_pipeline_delivered_share_truncatedand covers the oldest rows only.BATCH_PIPELINE_DELIVERED_SHARE_ENABLED=off(also false/0/no) stops the page and hides every gauge. Default on, helper-backed, with a flag-budget entry.Alert
omi-batch-delivered-share-language(agent tier, 30m pending,omi-tier-silent): a cell fires when its share is below 70% of its own 7-day peak while at least 20 units were admitted in the cohort. The peak, not an average, keeps a sustained dip from lowering the baseline under itself for the length of the outage; after seven days of a total outage the baseline decays and the runbook requires a human update.Verification
Local unit tests: query shape and driver registration, aggregation, language/route bounding, delivery stamp (including replay stickiness), acknowledge job write, collector cadence/expiry/kill switch, backfill receipt fallback, alert and dashboard contracts, flag budget, Firestore index manifest, and the hermetic drill.
Failure-Class: none
Review fixes under SCA-2249
The exact-head review at
6fe54735a2found that configurable backfill steps could overlap or skip the fixed 900-second query cohort, and that selecting whole receipt-part maps exceeded the declared metadata boundary. This revision rejects every step except 900 and requires nonempty target and baseline ranges aligned to UTC quarter hours before creating a client. Historical cohorts count[start, end), including boundary admissions exactly once.Receipt reads select only completion state, summary persisted timestamp and part count. A legacy completed receipt without a summary timestamp gets a second read selecting explicit
projection_parts.<index>.persisted_atleaves. Part keys are numeric strings, so the literalprojection_parts.persisted_atmask would miss them. Unsupported counts or incomplete timestamp leaves abort the report. The declared upper bound is now two result reads per unstamped job; no conversation/speaker identifiers, whole receipt maps, audio or transcript payloads are selected. The operator must still declare the full target and baseline query budget before production reads.The failed CI shards on
6fe54735a2were diagnosed from run 43602269386:Focused validation for
6cfd272d0976487db4e13b944788fd544e25e6a5: 36 backfill contract tests (including the simulator drill), 17 delivered-share tests, and 8 notification contract tests passed. The acknowledge test also passed in isolation with the CPU guard enabled. Tests pin rejected steps/partial target and baseline windows before client creation, adjacent-cohort boundaries, SDK field-mask projection excluding unrelated receipt fields, and fail-closed incomplete legacy receipts.SCA-2249's posted ruling is to fix exactly these findings and ship without another review; it does not waive production acceptance. No manual nightly/whole-CI rerun, production read, credential change, merge or deployment was performed. Release-owner acceptance remains the retained 2026-11-13 Japanese dip, deployed Core Features signal and live alarm drill. Preserve blocked state until those are evidenced.
Push validation: all selected preflight checks, type checking (zero errors), and the bounded pre-push gate passed on
6cfd272d0976487db4e13b944788fd544e25e6a5using the locked worktree environment with no gate overrides. GitHub reports the published head mergeable; its new CI run is not used as production acceptance.Current-main integration correction
CI run 43607943059 failed shard 3/8 at
test_budget_file_declares_scope_and_count: its merged test tree contained 284 flag names but declared 283. Both branch and main separately declared 283 names correctly; a clean merge-tree reproduction confirmed that the independent additions combined without updating the shared count. Merged mainef42ee8f44e0dd47afd4f2f2e583716499be45bewithout conflicts and reconciled the count to 284. All 24 flag-budget tests pass. No test or budget threshold was weakened. The SCA-2249 review ruling and release-owned production acceptance remain unchanged.Published head
3a2e440054677906ff438257f69fa76427375f70: normal selected preflight, type checking, and bounded pre-push gate passed without overrides. GitHub reports this head mergeable. New CI results have not been collected. Hold renewed through 2026-11-14T18:00:00Z for release-owner production acceptance.