Skip to content

fix(sync): reuse exact source files across upload bundles - #25479

Merged
Git-on-my-level merged 15 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-source-reuse
Nov 16, 2026
Merged

Git-on-my-level merged 15 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-source-reuse

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

A sync file uploaded again in a different bundle currently receives another batch identity, ASR job and additive projection. Reuse exact original source files independently of bundle membership, and serialize their visible projection through one owner-scoped source receipt.

This bounded first slice covers ordinary anonymous sync uploads of at most 64 files, with trusted capture clocks and a device identity. The server HMAC binds original filename/bytes, owner/device/epoch/source semantics, canonical decoded audio and exact split bounds. Exact repeated files inside one bundle contribute one input. Timing or lexical similarity alone never suppresses speech. New files and unproven partial overlaps retain normal processing.

Completed canonical results can satisfy later uploads with their own retained audio and encrypted alias markers, outside both paid queues. Alias projection returns existing outputs with zero new speech/usage seconds. Transactional ownership also refuses a second visible copy from already-racing jobs. Source provenance is independent of speaker labels. Protocol-2 markers fail closed on older projectors.

Safety and rollback

  • Default on under BATCH_SOURCE_REUSE_ENABLED. False stops new source enrollment/admission aliases. Already-computed jobs without an accepted alias wait while OFF. Accepted aliases reuse a current canonical or durably fall back to their own retained audio under normal paid admission and charging; accepted source-key jobs retain their projection fences. Missing-input repair preserves the original source boundaries after OFF.
  • Raw-upload archiving, WAL receipts, covered ACKs and audio release decisions are unchanged. Every alias stages its own audio before admission; cancellation leaves the normal staging outbox reachable.
  • Check source/output deletion and privacy generation at artifact registration, admission and projection. Dependencies remain on jobs/results/artifacts. Source receipts use the existing projection collection's erasure and TTL authority.
  • Normal accounting settles current-canonical alias speech at zero; fallback speech is charged normally, including month-rollover and partial-settlement fences. No historical charges or refunds change.
  • Closed-label counters expose reused source input, avoided pre-dispatch ASR input, waits/refusals, undecidable tails, duplicate projection refusals alias custody failures and committed fallback transitions. Successful aliases do not increment duplicate-projection refusals. Input envelopes are not GPU runtime, padded/VAD ASR windows or dollars.

The source_alias disposition exits through normal zero-speech completion once its canonical result is current and ready. If its canonical becomes invalid, a transaction rechecks the alias's own deletion/generation/ledger/audio fences, reserves source ownership and routes the same unit to normal multilingual provider admission and charging, including long audio with no frozen LID verdict. Normal funding checks precede ASR; validated BYOK admission snapshots retain the existing decide-once contract. It suspends/restores the same result-log slot across restart; no second log link or usage completion is created. Canonical recovery racing the transition either wins reuse or loses to the durable fallback reservation. Canonical text and deleted destinations are never restored. Conversation purge still discovers inherited audit provenance, erases linked source receipts, and preserves an erased ordering edge if the result slot is suspended. Erased aliases cannot run; no new aliases enroll while OFF. Conversation erasure follows bounded fallback audit provenance, removes segment-linked source receipts, and retains an erased ordering edge if the result slot is suspended. No worker-count, provider-capacity or queue-rate tuning is included.

Scope and limits

Native-to-sync byte/frame discovery, partial-file equivalence, cross-bundle in-flight compute reservations and stored-data canonical views remain separate work. Already-racing jobs can compute before the projection owner exists; their second projection is refused. Reuse requires artifacts within existing retention. Per-file packing increases small-unit count; measure queue latency and quality alongside reuse.

No changes to donor_dedupe.py, assignment.py or transcript_for_llm.py. No UI, production reads/writes, deployment, historical reprocessing or workflows changed. The runbook proposes a bounded historical dry run; it is not run.

Validation

  • 84 synthetic source-reuse cases, including erased/quarantined/dead canonical results, incomplete ledgers, expired/missing receipts, OFF behavior, alias erasure, both threaded recovery race orders, paid admission/charging, log-slot restart, suspended-slot erasure and provenance-linked purge, plus the original cases: cross/within-bundle exact files, genuine new tails, equal time with different bytes/devices/epochs, 26-second clock displacement, silence/repeated speech, partial/touching/gapped inputs, corrected/translated text, both sync ownership orders, deletion/restore, missing/expired artifacts, cancellation, untranscribed input, month rollover, accepted-alias restart and repair after OFF, ancestry dependencies, and a long source adjacent to a 44-second native row.
  • CI intake regression: optional filename proof now abstains on unparseable clocks and explicit clock-recovery policies, preserving normal decoder admission. The unchanged long-speech file passes all 27 cases.
  • GPU shim investigation: unchanged runtime-contract file passes all 105 cases on both the branch and pinned main; Parakeet call CPU is 0.046s versus 0.049s. Identical import graphs contain no source-reuse modules. No budget or allowlist change.
  • Mixed-version admission parity: optional source fields may be absent on pre-reuse WorkItems in both queues and database admission. Reuse decoding now has its own caller helper; the shared clock/coverage module is restored byte-for-byte. The unchanged pinned-main parity file passes 14 cases; legacy GPU/provider admission and decoder close propagation are covered separately.
  • Strict Firestore document fixtures execute real artifact, admission and projection code and reject reads after writes. Real contention/emulator, deployed behavior and device quality are unverified.
  • Existing intake/audio/projection/artifact/erasure/flag/reupload files: 266 passing tests, each in its own process. Final checks and managed push-hook receipts are recorded in the private lane report.
  • Offline two-owner packet replay supports zero additional proved historical exclusions: the packet contains no exact source receipts. Fleet savings remain unmeasured.

Product invariants affected

none

Failure-Class: none

Line-Count-Exception: backend/utils/batch_pipeline/projection.py | 1798 -> 1803 | Only delegates exact-source alias fencing to its dedicated module before payload projection.

🤖 Generated with Claude Code

Git-on-my-level and others added 11 commits November 16, 2026 16:03
Fence each byte-proven source range to one projection owner and retain zero-charge aliases outside paid queues. Keep custody and uncertain sources on their existing paths.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reuse the existing TTL and erasure authority for bounded source receipts.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replay accepted per-file decode boundaries after rollback, and keep file order stable across upload bundles.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep strict document transaction ordering while stubbing the unrelated scheduling frontier query.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the full long-source duration for the adjacent forty-four-second native-row regression.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep artifact checks strict before compute reuse, while durable canonical output ownership can settle already-computed duplicates without waiting on expired temporary ASR files.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Use the existing capture freshness threshold rather than introducing another scheduling class.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Hold already-computed duplicates while the kill switch is off, preserve accepted zero-charge aliases, and type the validated canonical metadata boundary.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Separate CPU file decoding from worker-safe metrics and receipt readers; derive range identity from the existing private file HMAC. Register the reviewed alias lifecycle writer without expanding environment or deployment exceptions.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Declare file, context and decoder contracts in the stricter sync typecheck scope.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Classify the result_ready alias writer in the production vocabulary census; preserve its complete writer-discovery guard.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T10:01:14.552802Z 60e5914 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60e591497a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

p.get('state') != 'ready' or p.get('disposition') or p.get('privacy_reason')
for p in (entry.get('projection_parts') or {}).values()
)
or ledger.get('status') != 'completed'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid waiting on bundle completion inside the projection fence

If two overlapping bundles are admitted before either finishes, such as A=[F,G] and B=[F,H], capture-time ordering can put A/F, B/F, A/G in the owner log. Once A/F is ready, A's ledger remains processing until G projects because ProjectionStore.prepare_accounting() requires all siblings to be ready. B/F's project_alias() nevertheless calls this predicate and is rejected even with require_artifacts=False; its SourceReuseUnavailable stops the owner walk (projection.py:1542-1546), so G can never project. This deadlocks both bundles and subsequent uploads for that owner. Keep the full-bundle accounting requirement for admission reuse, but avoid waiting on it inside the ordered projection fence.

Useful? React with 👍 / 👎.

Comment on lines +599 to +600
if project_alias(self.store, item, binding, self.clock(), policy=policy):
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve deletion settlement before probing source aliases

If an ordinary source-key job's original conversation is deleted after admission, this new probe calls ProjectionSession.prepare() before both the _projection_privacy_deleted branch and the existing CONVERSATION_DELETED catch below. That prepare checks privacy even when no source receipt exists, so BatchPrivacyBlocked now escapes without writing the zero-speech deletion disposition or advancing the owner watermark. The owner walk breaks on this exception, leaving later uploads blocked, indefinitely for soft-deleted source rows without a purge tombstone. Preserve the existing deletion-settlement path around this probe instead of bypassing it.

Useful? React with 👍 / 👎.

item, source_alias_of=candidate['segment_id'], source_conversation_ids=tuple(candidate['dependencies'])
)
# Always retain the newly uploaded audio before admitting this alias.
frozen = with_context(unit.wav, {**context, 'source_reuse_key': item.source_reuse_key})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Offload alias WAV freezing to the sync executor

For a long reused source file, this calls with_context() directly on the event loop. That helper concatenates and slices the entire WAV several times, with an allowed hour-long unit occupying about 115 MB; an isolated check delayed a 10 ms heartbeat by approximately 2.2 seconds in this environment. Concurrent uploads and health checks cannot run during those copies. Offload the freeze using run_blocking(sync_executor, with_context, ...), as the ordinary intake path already does and the CPU-bound dispatch rule in backend/AGENTS.md requires.

AGENTS.md reference: backend/AGENTS.md:L272-L272

Useful? React with 👍 / 👎.

Git-on-my-level and others added 4 commits November 16, 2026 17:20
R40: admit retained alias audio through ordinary multilingual provider funding when its canonical result becomes invalid. Reserve fallback ownership transactionally, preserve the original result-log slot across restart, keep own privacy/erasure fences, and settle fresh speech through normal accounting. Count duplicate projection refusals only on actual refusals.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep inherited canonical references reachable to conversation purge without using them as live projection authority. Erase linked source receipts and preserve the ordering edge when deletion races a suspended fallback result slot.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Let the supplied decoder retain ordinary admission authority when optional source reuse cannot parse a filename. Keep explicit clock-recovery adapters out of exact-source reuse. Preserve the existing language and clock tests unchanged; add alternate-name and recovery-policy coverage.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Treat source fields as optional at shared database and paid-queue boundaries. Move source-specific decode selection into its own caller helper and restore the pinned shared coverage module byte-for-byte. Keep the parity fixture unchanged; cover both legacy queue routes with strict transaction regressions.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit ebf23f7 into BasedHardware:main Nov 16, 2026
66 of 68 checks passed
Git-on-my-level added a commit that referenced this pull request Nov 17, 2026
…marked (#25597)

## Problem

Since 2026-11-16 ~19:00Z, sync (offline-upload) users stopped getting
transcripts. Their conversations finish with an empty transcript, the
"Discussion notes" placeholder title and no notes.

- #25479 (`67ac7b04629`, `BATCH_SOURCE_REUSE_ENABLED` default on)
shipped with Cloud Run deploys `5097caa` and `235baea` (18:41–19:16Z).
Sync intake now stamps `protocol_version=2, source_reuse_version=1` on
every job with a `source_reuse_key`.
- The ordered merger also runs inside the GKE GPU worker
(`commit_source=gpu_pump`). That worker deploys separately and is still
on `ef42ee8`
(image digest `sha256:ffbcd66a…`), which is older than #25479. At
`ef42ee8`, `merge.py` copies `protocol_version` onto the result row,
  but not `source_reuse_version` / `source_alias_version`.
- `ProjectionSession` refuses a protocol-2 row without the marker with
`ProjectionBlocked('immutable result binding mismatch')`.
A blocked head has no retry bound and no terminal disposition, and
projection is strictly ordered per owner, so every later result for that
owner waits behind it, live captures included. Merge holds then park new
results in `result_ready`.

Prod evidence (ro-prod, 2026-11-17),
`stop=blocked_immutable_result_binding_mismatch` owner-drain log lines
on backend-integration, per 3 minutes:

| Window | Lines |
| --- | --- |
| 18:50Z Nov 16 | 0 |
| 19:05Z Nov 16 | 1,208 |
| 10:30Z Nov 17 | ≥5,000 (query cap) |

As of 10:31Z: about 888 owners blocked, about 14.8k unmarked rows, and
about 463k results pending projection.

## Fix

`source_reader_marked(entry, job)` in
`batch_pipeline_projection_protocol.py`, used by the binding gate in
`batch_pipeline_projection_session.py`.
A protocol-2 row with **neither** marker field is admitted when the
immutable job carries `source_reuse_version == 1` or
`source_alias_version == 1` and a `source_reuse_key`. A marker that is
present but wrong is still refused, and so is a row without a reuse key.

There's no flag. Once backend-integration serves this, the existing
owner drain retries the blocked heads and the held results merge and
project.
No data repair is needed.

## Not in this PR

- Rolling the GPU worker from current main (separate deploy). It is
required so new rows carry the marker.
- A bound and alert for a permanently blocked projection head.
- The source-alias fallback merged by an old pump is not exercised.

## Tests

`backend/tests/unit/test_batch_pipeline_source_reader_marker.py` has 12
cases, including the session-level production error without the fix.
231 passed across it plus `test_batch_pipeline_source_reuse.py`,
`test_batch_pipeline_projection.py`,
`test_batch_pipeline_sweep_owner_chain.py` and
`test_batch_pipeline_quarantine.py`.

Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path

🤖 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/25597?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/25597?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F25597&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 17, 2026
… the summary is owed (#25611)

## Problem

Since 2026-11-16 22:17Z, about half of new recordings show on Home as a
row titled "Discussion notes" with no summary and the default emoji.
They never change.

Two defects overlap in that window. This PR fixes the second one. The
first is already fixed on main and is waiting on a deploy.

1. **Transcripts stopped landing (not this PR).** #25479 shipped on
Cloud Run at 18:11–18:52Z on 11-16 while the GPU worker stayed on an
older image, so source-reuse results were committed without their marker
and the projector refused them. Projection is ordered per owner, so
every later recording for that owner waits behind the refused result.
#25597 fixes this; it merged at 11:38Z on 11-17 and is not serving yet
(all four Cloud Run services report release `0ce3965`).
2. **A capture with no notes gets the fallback title (this PR).** #25462
added the deterministic label "Discussion notes" for generated notes
whose headline is unusable. `_quality_processing_notes` applied it to
every conversation write that carries a `structured` map, including the
in-progress stub a listen socket creates and the raw completion of a
batch capture. Neither has notes.

What the stamped title does to a batch capture:

- **Home shows a finished row.** `transcribing_hold.applies` and
`home_step.classify` read any non-empty title as "has notes". The row
leaves the bounded "Transcribing…" presentation and shows "Discussion
notes" with no expiry.
- **The first-summary obligation is not registered.**
`stamp_projection_debt` skips a row that already has a title, so the row
gets no `summary_due_at`. The repair sweep never sees it; it depends on
one enrichment attempt.
- **A stamped zero-content stub is no longer classified as noise** by
the expired empty-capture rule.

## Evidence (prod, read-only tier, aggregates only, 2026-11-17
14:50–15:21Z)

Completed `batch_live_v1` rows, 12,656 sampled across 11-16 12:00Z →
11-17 14:50Z:

| Rows carrying the fallback title (n=3,756) | value |
| --- | --- |
| `title_change_reason = initial_title` | 100% |
| title stamped minus row created (p10 / p50 / p90) | 0.0 s / 0.0 s /
0.1 s |
| title stamped minus recording finished (p50) | 126 s **before** the
finish |
| `content_word_units = 0` when stamped | 99.6% |
| notes run recorded (`notes_written_at`, notes input hash) | 0% |
| `summary_first_pending_at` / `summary_due_at` | 0.0% / 0.1% |
| first row stamped | 11-16 22Z hour (the listen roll to `235baea`
finished 22:17Z) |

The title is written at creation, on a row with no speech, before any
model call. The model is not returning a placeholder. Rows created
through the idempotent create path skip this writer and stay untitled,
which is why the same feed mixes "Discussion notes" rows with untitled
or "Transcribing…" rows.

Replayed on unmodified `f47914db885`: a stub written through
`upsert_conversation_with_lifecycle` commits `title='Discussion notes'`,
`title_change_reason='initial_title'`; `replace_record` then stamps no
debt; `home_step.classify` returns `ready`.

For the transcript stall, on the same sample: `record_audio_closed` is
true on ≈100% of rows throughout, while rows with a landed transcript
fall from 82–88% (finished 11-16 14–18Z) to 51% (19Z), 16% (22Z) and
6–20% since. `summary_first_pending_at` tracks that within 1 point every
hour. Of 60 owners with a stuck row, 49 had a chain head that was
`pending`, `protocol_version=2`, with no source marker and committed a
median 15.4 h earlier; the median owner had 563 results pending behind
it.

## Changes

On by default. No new flag, Firestore read, provider call or stored-data
rewrite.

- **Write.** `_quality_processing_notes` leaves the title empty when
`home_titles.notes_pending` holds (no usable title, overview, gist,
section body, task or event) and there is no user title or stored valid
title. A stored stand-in title is kept and a stored placeholder is
cleared. Generated notes with an unusable headline still get the
fallback label.
- **Admission.** `stamp_projection_debt` treats a placeholder as
untitled. Rows stamped before this change are enrolled when their
transcript lands.
- **Read.** `transcribing_hold.applies`, the `processing` branch of
`home_step.classify`, `empty_capture.applies` and
`legacy_empty_wire.project` treat a placeholder as untitled.
`home_titles.placeholder_title_wire`, applied at the same API exits as
the transcribing hold, serves a row that carries only the fallback label
as untitled. It matches the two labels `title_or_fallback` produces and
nothing else, and never changes a user title or a row with notes.

- **Home feed.** `GET /v1/home/feed` serves a title sealed at write
time, so the list-wire rule does not reach it. `database/home_feed.py`
now applies `home_titles.display_title` to conversation cards: a bare
fallback label with no preview is served as untitled.

Rows already stamped are healed on read. `utils/summary_quality.py` is
byte-identical to main, so the notes prompt fingerprint and its reuse
checkpoints are unchanged.

## Not in this PR

- Deploying #25597 and rolling the GPU worker. Both are required before
transcripts and summaries land again.
- A bound and alert for a permanently blocked projection head (also
called out by #25597).
- A backfill for rows stamped in the window whose transcript lands
before this PR serves and whose enrichment attempt fails. They keep a
transcript with no registered obligation. The verification query below
counts them; if the count is not zero, a follow-up enrols them.
- `process_conversation` recovery's `stored_content_is_replaceable`
still reads a placeholder as a title.

## Serving and rollback

Serves from `backend-listen` (stub writes), `backend` (list and detail
reads) and `backend-integration` (projection). Each part is independent,
so the services can roll in any order. Rollback is a revert; no stored
state depends on the change.

Deploy this before or with #25597 if possible. The projector then
registers the obligation for stamped rows as the backlog drains.

## Verification after deploy (read-only)

1. **New rows are no longer stamped.** Completed `batch_live_v1` rows
created after the listen roll, stored `structured.title` matching
`^discussion (notes|\d+)$` with `summary_output_present != true`: 37–64%
per finished hour now → **0%**.
2.
`sum(increase(omi_fallback_total{component="conversation_notes",to_mode="deterministic_title"}[1h]))`:
about 15,800/h now. It should fall by more than 90%, to the rate of
generated notes with an unusable headline.
3. **Stamped rows are enrolled.** Rows created 11-16 22:17Z → deploy
that carry the fallback title and a `record_projection_revision` set
after the integration roll: `summary_due_at` or `summary_completed_at`
present on 100%.
4. **Residue.** Rows with the fallback title, a
`record_projection_revision`, no `summary_due_at`, no
`summary_completed_at`, no `summary_blocked_reason` and
`summary_output_present != true`. For projections that land after the
integration roll: 0. For projections that landed before it (6 in the
last pre-deploy sample): the count must only fall; what remains is the
backfill population above.
5. **End to end, after #25597 and the worker roll.** Share of rows
finished more than 15 minutes ago with `summary_output_present = true`:
5–12% now → back to the 57–63% of 11-16 14–18Z.

## Tests

`backend/tests/unit/test_notes_pending_title.py`, 43 cases (plus one pin
in `test_summary_quality.py` so a new fallback label fails beside the
policy that emits it): stub create and raw completion stay untitled; a
stored placeholder is cleared; a stored stand-in, user title or earlier
generated title is kept; generated notes with an empty headline still
get the fallback; the projection enrols a placeholder-only row and
leaves titled or summarised rows alone; Home classifies a stamped
capture as transcribing with the bounded wait; the wire rule and its
non-matches; a stamped expired empty capture is noise; a pending write
is sanitized like generated notes and records no title fallback; the
Home card title rule.

Focused regression at `fd3ee68a9c7` (before the review fixes; the
review-fix commit re-ran the 5 directly affected files, 154 passed): the
91 test files that reference the touched modules, one pytest process per
file, cloud credentials unset. 89 files pass.
`test_chat_edits_firestore.py` is skip-only (it needs the emulator).
`test_empty_capture_recovery.py` has 7 failures, all `RuntimeError: Opus
support requires opuslib and the native libopus library` on the
development host; CI has the library. `test_llm_input_prompt_version.py`
passes: the notes prompt fingerprint is unchanged.

Also run: `scripts/pr-preflight` (39 checks), runtime-image contracts
(19 images), the conversation lifecycle write guard, import-time purity,
async blockers and the dead-code ratchet.

No production writes, deploys or flag changes were made. No app UI
change.

## Product invariants affected

none

## Failure class (fixes)

Failure-Class: FC-provisional-home-content-published-as-final

The admission half also reopens the contract of
`FC-content-write-omits-implied-obligation`: the projection landed
content without recording the obligation, this time because a
placeholder satisfied the "already titled" check.

Line-Count-Exception: backend/database/conversations.py | 5225 -> 5245 |
The pending-notes rule belongs in the one transaction that decides the
stored title, beside the user-title and stability rules it must not
override.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Git-on-my-level added a commit that referenced this pull request Nov 17, 2026
Cloud Run intake and the separately deployed GKE ordered merger must not
depend on copying a required marker in lockstep. A stale copier
previously committed protocol-2 source results without the marker and
blocked the owner's projection chain (#25479 / 2026-11-16).

This change makes source-marker recovery from the immutable job a
permanent counted contract, adds one registry used by
intake/alias/fallback producers, both merge paths and projection, and
stamps `required_result_markers` on new jobs. A current merger refuses
unknown protocol/marker requirements before writing a result or
consuming an owner log sequence, leaving work ready for a capable
merger. The refusal counter is exported by each GKE worker child's
private metrics registry as well as Cloud Run.
`BATCH_RESULT_PROTOCOL_GUARD_ENABLED` defaults on; false restores legacy
copying. Explicit conflicting versions remain refused; null copies are
treated as missing only under a supported explicit job map. A witnessed
legacy projector alias-to-own-audio transition may retain its unknown
envelope; only that exact known marker transition is interpreted,
without modifying the job or accepting unknown requirements. A full
provider/usage replay covers it.

The registry covers job-authoritative source metadata, not compute
capabilities. No capability heartbeat is added: one upgraded replica
cannot prove the absence of old workers. New semantic readers still
deploy first. A pre-guard worker may omit copies; the reader recovers
registered markers from the job. No production access, deploy, merge,
requeue, account change, or flag change. #25617's alerting and
projection-drain files are unchanged.

Validation: 627 tests across 10 focused unit files pass in separate
pytest processes via omi-heavy; new regressions cover real admission
plus historical merger-copy behavior and successful alias
projection/owner watermark advancement, canonical intake through
scheduler/merge, wrong-copy refusal, unknown protocols/markers without
log mutation, accepted-alias fallback refusal, kill switch, registry
completeness, and actual GPU worker /metrics export. The lifecycle
writer inventory also passes all 1899 cases through backend/test.sh
after updating the reviewed field sites for centralized stamping. See
the run record for final preflight/CI results. These are local synthetic
transaction/state-machine checks, not runtime acceptance.

Pre-push also exposed an existing stale failure-class migration test: it
copied a seed that now has a family while asserting the family was
absent. Its temporary fixture now explicitly removes that field; the
assertion and CLI behavior stay unchanged.

Scope panel: scope-20261117t172601-0ddf, launched before implementation.
Review panel review-20261117t181832-92dc completed with all six findings
triaged: five accepted and addressed (legacy stamping, positional/global
completeness checks, operator response and null copies), one rejected
because incapable workers must not reinterpret unknown protocols using
old slot assumptions. The final source head is being validated after
those fixes. No merge/deploy approval is implied.

Failure-Class: FC-mirrored-model-omits-new-member
Batch-State-Exit: Unsupported result protocol requirements remain
result_ready with merge_pending=true and existing audio/result custody;
a capable merger commits the same job without repair/requeue. Refusal
attempts are counted; no terminal state, new queue, or timer is
introduced.


Final CI follow-up: a pre-existing concurrency test passed every
assertion but repeatedly billed a cold lazy lifecycle-module import to
its 1-second call-phase CPU budget. A module-scoped test fixture now
loads that same real lifecycle owner during setup, matching the duration
guard's documented exclusion of per-process import work. Actual
transaction/reconcile code, assertions, production V3 behavior, rollout
flags and CPU limits are unchanged. All 26 tests pass canonically; the
previously slow call measured 0.14 CPU seconds locally.
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