Skip to content

fix(app): keep S1 capture identity safe across WAL resets - #20473

Merged
Git-on-my-level merged 4 commits into
mainfrom
lane/capture-root-rotation
Oct 3, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
lane/capture-root-rotation

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

STOP — unrelated trunk is red

Draft only. Do not merge or ship. Exact pushed head: 1c82e2a5426415de1f497ea10de25545a6746571; identity fix 253d4a0550, required mobile changelog 1c82e2a542.

The owning analyzer gate fails on unchanged app/test/widgets/capturing_finish_swipe_back_test.dart:120: PeopleProvider(loadPeople: () async => []) returns List<dynamic> but the production seam requires Future<PeopleListResponse?>. The file is byte-identical on origin/main at task base 8fb7dc1ccf. A narrow retry with TZ=UTC, artifact-local TMPDIR, and pinned Flutter 3.44.5 reproduces the diagnostic. GitHub's Ubuntu/Flutter 3.44.5 analyzer independently confirms the same error:

Dart Analyze & Tests — failure

ERROR|COMPILE_TIME_ERROR|RETURN_OF_INVALID_TYPE_FROM_CLOSURE|app/test/widgets/capturing_finish_swipe_back_test.dart|120|86|2|The returned type 'List<dynamic>' isn't returnable from a 'Future<PeopleListResponse?>' function, as required by the closure's context.

Per the task's mechanical stop rule, this lane does not repair unrelated trunk, continue landing, launch further verification, or claim green CI. Independent Luna review was prepared/planned but not launched before the stop. Local full-suite execution terminated at the Flutter harness with TestDeviceException(Shell subprocess crashed with SIGTERM (-15).) after +1368; no final tally/exit code was captured. The separate spine pass completed +138: All tests passed!. No full-suite pass is claimed. Local journeys were held; CI hermetic journeys were still running at the last observation.

Summary

Lane E of merge-golive-all-users; companion to backend #20427. No mobile build, release tag, workflow dispatch, merge, or deployment performed.

  • Bind cached live S1 roots to the WAL allocator object, reset generation, and account. clearUserData and codec ordinal resets bump the fence; controller cleanup and existing capture-session boundaries invalidate the root.
  • Root allocation and frame admission are synchronous on the same Dart isolate. The first frame after a reset gets a new UUID v4. This avoids the crash/logout/deletion persistence protocol needed to durably reserve all issued ordinals.
  • Individual/pending/synced/corrupted WAL deletion never resets the live counter. Restart/reinstall constructs a new namespace independent of surviving WALs. Old WALs retain their original upload claims. A stale codec completion after logout cannot reset the successor session.
  • Define-off builds emit no evidence and preserve exact binary audio bytes. Existing S1 wire and stored shapes are unchanged.

Invariant: a (capture_root, clock_epoch, source_frame) triple never identifies two different admitted audio frames, relying on fresh UUID v4 namespaces and monotonic ordinals inside each namespace.

Optional build-enable decision — prepared, NOT committed or pushed

Store build commands in codemagic.yaml call app/scripts/build_provenance_dart_defines.sh (iOS lines 140/505; Android 347/918). Codemagic documents CM_BUILD_ID and CM_WORKFLOW_NAME. The local-only enabling diff appends this block after the existing validated provenance output:

+if [[ -n "${CM_BUILD_ID:-}" ]]; then
+  case "${CM_WORKFLOW_NAME:-}" in
+    'Auto Deploy iOS to Internal TestFlight' | 'Release iOS to Testflight' | 'Auto Deploy Android to Internal Play Store' | 'Release Android Internal Production')
+      printf '%s\n' '--dart-define=CAPTURE_EVIDENCE_V1_DARK_WRITE=true'
+      ;;
+  esac
+fi

The helper diff and its new 17-case test remain uncommitted in this worktree because landing stopped on red trunk. They are intended as a separate optional commit that the coordinator can drop if David declines. Local, unknown, desktop, and Shorebird workflows remain unopted-in. Before resuming, correct the new test's Process.run to includeParentEnvironment: false so its sanitized environment truly excludes inherited variables. No codemagic.yaml or .github/ edit occurred.

Verification evidence

  • Before-fix socket regression: 4 reset scenarios fail. Verbatim example: Expected: not '7cc66125-c35b-474f-a07e-163550385752' / Actual: '7cc66125-c35b-474f-a07e-163550385752'.
  • Focused final define-on: 00:01 +9 ~1: All tests passed!; define-off: 1 pass, exact binary equality and absent socket/WAL/header evidence.
  • WAL regressions: 111 pass; existing explicit-root tests define-on: 103 pass; stale codec/logout suite: 00:00 +4: All tests passed!.
  • Final mutations: remove clearUserData generation bump -> 2 failures; fixed UUID reused across fresh install -> 6 failures; exact restoration -> 9 pass.
  • Build-helper test: 4 emit cases fail before helper change; 00:02 +17: All tests passed! after. Existing provenance shell harness passes. This is local prepared work, not pushed-head CI coverage.
  • Pre-push normal gate, make preflight, and PR-body preflight: 22 checks pass. PR Metadata Preflight, Hygiene, and Formatting pass remotely.

Local-only artifacts: .agent-artifacts/capture-root-rotation/REPORT.md, red-before-fix.log, green-final-define-on.log, green-v2-define-off.log, mutation1-v2.log, mutation2-v2.log, postrestore-green.log, build-defines-{red,green}.log, analyze-ratchet.log, full-test-suite.log, make-preflight.log, pr-preflight.log. No logs/credentials/customer data are committed.

Reviewer risks

Inspect all four frame-admission consumers, allocator replacement, logout/codec interleavings, and root lifetime. Mixed-root WALs can lose eligibility for an evidence claim, but existing logic fails closed to ordinary upload rather than dropping speech. The raw allocator's explicit-root test seam does not itself generate UUIDs; uniqueness is coordinated by production capture callers. Workflow display-name renames require deliberate opt-in-list updates. The optional test needs the environment correction above. Independent Luna review and full mobile/device/store qualification remain incomplete.

Product invariants affected

pr-preflight --suggest reports no required invariant citations. S1 identity safety is proved at the emitted socket/upload boundary. No ratified contract, stored shape, or backend change.

Failure-Class: none
Failure-Class-Reason: No registered failure class describes capture frame identity reuse after allocator resets. The socket regression is the reusable guard; the fenced registry is unchanged.

Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4003 -> 4018 | Synchronous root invalidation keyed to the WAL allocator, reset generation and account; no hot-file rewrite.
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2569 -> 2576 | Expose/bump the capture namespace fence at existing reset boundaries and reject stale codec completion.

GUARD CHANGED

app/test/support/capture/capture_replay_world.dart gains only upload-header observation (UploadAttempt.captureEvidence); no oracle/guard is loosened. Removing reset rotation and reusing a fixed root still fail the socket consumer tests.

SCOPE ADDED

The mandatory mobile changelog fragment is its own commit, 1c82e2a542, separate from optional build enablement.

SPEC DIVERGENCE

The generated template incorrectly claims the selected public Omi repository has no pre-push/failure-class tooling. The documented Flutter component gates, not unrelated Bun desktop suites, are authoritative here. The requested green-CI stop point and separate enablement commit cannot be completed while the task's red-trunk stop rule applies.

🤖 Generated with Claude Code

Git-on-my-level and others added 3 commits October 3, 2026 23:03
Bind live capture roots to the WAL allocator identity, reset generation,
and account so surviving controllers cannot reissue retired audio claims.
Rotate on codec resets and reject stale codec completion after logout.
Prove socket/upload identity and unchanged define-off bytes in replay tests.

Failure-Class: none
Failure-Class-Reason: No registered class describes capture frame identity reuse after allocator resets; the scoped socket regression is the reusable guard without modifying the fenced registry.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin Fusion <[email protected]>
Include the durable mobile fragment required by the publication gate.
Keep this repository-required record separate from build enablement.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin Fusion <[email protected]>
…ure loader

PeopleProvider.loadPeople now returns Future<PeopleListResponse?>; the
fixture still returned an empty list, an error-severity analyzer
diagnostic that reds Dart Analyze for every app PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review October 3, 2026 16:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T17:04:43.096660Z 67b8c57 Draft marked ready
ℹ️ 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.

…ation

# Conflicts:
#	app/test/widgets/capturing_finish_swipe_back_test.dart

@cubic-dev-ai cubic-dev-ai 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.

1 issue found and verified against the latest diff

Confidence score: 4/5

  • In local_wal_sync.dart, stop() clears _frames without a generation check, so a stale stop could discard frames from a newer sync. Apply the same generation fence used in onAudioCodecChanged.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/lib/services/wals/local_wal_sync.dart">

<violation number="1" location="app/lib/services/wals/local_wal_sync.dart:637">
P2: `onAudioCodecChanged` now fences its tail clear behind `_isCurrent(generation)`, but the sibling `stop()` method (just above) performs the exact same drain/chunk/flush + `_frames = []` sequence with no generation fence. A `stop()` that captured the pre-logout generation and resumes after `clearUserData()` has run will execute its unconditional `_frames = []; _frameSynced = [];`, wiping any frames the successor session has already pushed through `onFrameCaptured` (which is not generation-gated). Apply the same guard to `stop()` so a stale teardown cannot clear the successor session's live frames.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

await _drainPendantTail(generation);
await _enqueueBuffer(() => _chunk(generation));
await _enqueueBuffer(() => _flush(generation));
if (!_isCurrent(generation)) 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.

P2: onAudioCodecChanged now fences its tail clear behind _isCurrent(generation), but the sibling stop() method (just above) performs the exact same drain/chunk/flush + _frames = [] sequence with no generation fence. A stop() that captured the pre-logout generation and resumes after clearUserData() has run will execute its unconditional _frames = []; _frameSynced = [];, wiping any frames the successor session has already pushed through onFrameCaptured (which is not generation-gated). Apply the same guard to stop() so a stale teardown cannot clear the successor session's live frames.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At app/lib/services/wals/local_wal_sync.dart, line 637:

<comment>`onAudioCodecChanged` now fences its tail clear behind `_isCurrent(generation)`, but the sibling `stop()` method (just above) performs the exact same drain/chunk/flush + `_frames = []` sequence with no generation fence. A `stop()` that captured the pre-logout generation and resumes after `clearUserData()` has run will execute its unconditional `_frames = []; _frameSynced = [];`, wiping any frames the successor session has already pushed through `onFrameCaptured` (which is not generation-gated). Apply the same guard to `stop()` so a stale teardown cannot clear the successor session's live frames.</comment>

<file context>
@@ -629,13 +634,15 @@ class LocalWalSyncImpl with WidgetsBindingObserver implements LocalWalSync {
     await _drainPendantTail(generation);
     await _enqueueBuffer(() => _chunk(generation));
     await _enqueueBuffer(() => _flush(generation));
+    if (!_isCurrent(generation)) return;
     _frames = [];
     _frameSynced = [];
</file context>

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

ℹ️ 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".

@@ -629,13 +634,15 @@ class LocalWalSyncImpl with WidgetsBindingObserver implements LocalWalSync {
await _drainPendantTail(generation);
await _enqueueBuffer(() => _chunk(generation));
await _enqueueBuffer(() => _flush(generation));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Abort callers when rejecting a stale codec switch

When clearUserData() advances the session while this method is awaiting its drain/flush operations, this return makes onAudioCodecChanged resolve successfully without applying the requested codec. Callers such as _startPhoneSessionBody then continue starting the PCM16 recorder, while the WAL still labels subsequent frames with the previous codec (often Opus), producing incorrectly encoded WAL metadata and potentially unusable uploaded audio. Make the stale rejection observable so the caller aborts or retries the codec setup for the successor session.

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 18506a3 into main Oct 3, 2026
43 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/capture-root-rotation branch October 3, 2026 17:17
Git-on-my-level added a commit that referenced this pull request Oct 3, 2026
…ons (#20427)

## Round 11 — fixes complete, pushed and full CI green; DRAFT for
independent review
Fixes 1–4 are separate commits: `c99a0c0701`, `3a084d1a14`,
`f8fa58ecc3`, `fd6b87c72a`. Pushed HEAD is
`9d8c5a64f4c7fc9775c2c7a43e3b84318ce623bd` after merging current main
`d4062b9ee8` and restoring unintended hook formatting; `app/` is
byte-identical to merged main. Final merged-head local gates passed: 491
tests, 17/17 killed mutations, canonical pyright zero errors, make
preflight 49 checks and PR metadata preflight 46 checks. First guarded
push exited 0 after `Bounded pre-push gate passed`; local/remote
equality confirmed, no CPU retry or exit 141. Full final-head CI is
GREEN, including the explicitly dispatched `--all` four-shard backend
suite, guardrails, PR-selected units, static contracts, emulator proofs,
hermetic E2E/stack gauntlets, metadata/hygiene and CodeQL. No CPU-only
reds or reruns. PR remains DRAFT/MERGEABLE for independent review;
deployment/admission/widening remain coordinator-owned.

## Summary and safety
- Fix 1 migrates the ten stale allowlist assertions to
`SYNC_LINEAGE_S1_REQUIRED=true` without weakening S1 checks: absent S1
retains pre-lineage whole-batch routing; explicit valid-S1 variants
preserve per-segment, allowlist/master, retry and enrichment-debt
coverage. Its local fail-closed test guard denies real Firestore
getters/constructors while StrictFirestore injection remains available.
- Fix 2: committed mode never calls receipt-only `source_map.snapshot()`
when proof is unavailable. Missing notes, conflict/incomplete state and
real 4096-byte envelope overflow persist explicit unknown evidence while
speech still commits. Flag-off keeps the existing owner-filtered receipt
snapshot byte-identical.
- Fix 3: source frames are proven only by recognized Deepgram word or
finalized Soniox token intervals, each <=2 seconds, max 256 intervals
per segment. Map independently through accepted sends, round inward,
merge only overlap/touching ranges, and fill ZERO positive gaps.
Segment-only spans abstain. Private timing fields do not enter
transcript queues or persistence. The omitted-middle-phrase test drives
the real producer mapping and sync/VAD/STT/intake path and asserts the
new speech actually persists.
- Fix 4: stop note work at 512 stored notes and 512 examined callback
entries, mark incomplete, preserve earlier notes and leave speech
admission to the existing bounded transcript queues. Large
invalid/duplicate callbacks are also bounded; an already-full note map
does not consume the next callback iterable.
- No Flutter, speaker_resolution, audio_placement, smart-merge,
assignment/bridge, workflow or other-worktree edits in this round. No
production reads, deploy, admission flip or widening performed.

All round-11 backend tests run only via `backend/test.sh` file lists,
with ADC/service-account vars removed, fresh CLOUDSDK_CONFIG, synthetic
project, FIRESTORE_EMULATOR_HOST=127.0.0.1:8085 and loopback metadata
endpoint. No bare pytest or real Firestore is permitted. The old stopped
saved-row ambiguity witness is NOT rerun; only the already fully stubbed
real-process deferral witness is used. New mutation execution adds a
fail-closed Firestore constructor/getter guard and records runtime
bytecode installation/restoration plus source hashes.

Environment deviation disclosed: the owned `.venv` disappeared during
initial fix-3 validation, which incorrectly used the fenced shared
object-store interpreter. That result is not accepted as landing
evidence. The owned worktree `.venv` was recreated from its own lock
with `sync-python-deps.sh`; all final fix-3 tests were rerun there. No
shared-checkout change was needed for recovery. No repository
archives/copies are created in scratch; evidence is logs.
Historical round-9 safety incident remains disclosed: an optional
ambiguity mutant reached an unstubbed Firestore lookup with ambient
read-only credentials. It was stopped; COULD NOT DETERMINE whether its
read RPC completed, and no returned data was observed. It is not a
passing proof. This round uses the stricter isolation above and does not
repeat that witness.

## Final design
- Live counts socket-local decoded samples
(`backend/utils/audio_timeline.py`); WAL/VAD starts from the phone-clock
basename (`backend/utils/sync/pipeline.py`). Missing frames, reconnects
and provider clocks defeat a universal offset or created_at winner. No
clock rewrite here.
- Speech and `committed_transcript_v1` proof commit in the same existing
transaction; acknowledge only after a successful live merge. Proof
contains source positions, receipt wall windows and bounded root/epoch
lifetime history, never transcript text/uid/row/segment IDs.
- Before VAD/STT, require same provenance/root/epoch/channel/rate,
conflict-free complete lifetime history, actual decoded geometry and
observed WAL-wall agreement at BOTH intersection edges within 2 seconds.
Time agreement rejects incompatible lifetimes; it never establishes
identity itself. Receipt alone cannot authorize consumer suppression.
- Missing/malformed/conflicting/overflowed proof keeps audio. Pre-live,
missed, untranscribed and omitted-phrase frames remain; span-only
providers intentionally lose suppression recall. Opus decodes before
trim. Kept discontinuous intervals stay separate; <=250ms whole-frame
context per side may retain edge repeats. Marked trimmed derivatives
bypass only the existing 1-second VAD floor, preserving new subsecond
speech. Fully committed audio skips providers/enrichment; prior retry
enrichment debt still completes.
- Lexical fallback is dormant on the production intake seam without
observed WAL-lifetime context. Exact delivery retry dedupe additionally
requires an existing shared nonempty `sync:` scope; repeated text alone
is not identity.
- Strict AND tolerant multiple-canonical overlap stays pending unless
one compatible stamp names exactly one canonical. No created_at guess.
Three bounded rereads, then retryable failure/re-upload, not a new
duplicate row.
- Default-on `SYNC_LINEAGE_S1_REQUIRED` gates per-segment routing on
separate admission, complete validated claims for exact uploaded
basenames and observed decoded maps. Absent/invalid S1 keeps pre-lineage
whole-batch routing, even after eventual allowlist widening. OFF/typo
broadens eligibility; it is NOT rollback.
- Bounds: 32 runs, 16 root/epoch entries, 512 notes, 16 acknowledged
generations, 4096-byte envelopes. No new serving query/index shape. Logs
remain content-free kept/dropped/context seconds, append/repeat/debt,
capped lineage filters/id_probe/span buckets.

## Verification so far
Fix 1: `10 failed, 60 passed` -> `92 passed`; shared lineage `78
passed`; WAL `58 passed` (round-10 logs). Fix 2: `4 failed, 46 passed`
with `AssertionError: receipt snapshot must not run while committed
coverage is enabled` -> `50 passed, 13 warnings in 7.99s`.
Fix 3 strengthened whole-span mutant: `E AssertionError: assert
'new-word-3' in ['live words']` and `E AssertionError: assert [] ==
['new-word-0'...-word-5', ...]`; `2 failed, 58 passed, 56 warnings in
10.85s`. Restored owned-env seven-file suite: 215 passed, zero failed.
Evidence: `.agent-artifacts/sync-lineage-dedupe/r11-fix{2,3}-*.log`.
Fix 4 before/after: `6 failed, 49 passed, 13 warnings in 11.72s` with `E
assert 10000 <= 512` -> `55 passed, 13 warnings in 12.24s`. Real enqueue
still rejects oversized speech batches through its existing capacity
error without note-side text loss.
Final merged-head canonical 11-file list: 491 passed, zero failed. Full
`backend/scripts/typecheck.sh`: `0 errors, 12465 warnings, 0
informations`. `make preflight`: 49 checks passed; PR metadata
preflight: `PR preflight passed: 46 checks in 392.31s.` Import
purity/module isolation and pinned formatting pass. Logs:
`r11-merged-{green,pyright,make-preflight,pr-preflight,format,import-purity,stub-check}.log`.
No guard or CPU timing limit changed.

## Executed mutation table — final merged HEAD 9d8c5a6
Exact lead-authored command: `backend/.venv/bin/python
.agent-artifacts/sync-lineage-dedupe/r11-run-mutations.py
--expected-head 9d8c5a6 --output-prefix
r11-merged`. Every row below ran via canonical file-isolated
`backend/test.sh`, with fail-closed Firestore constructors/getters. Each
baseline=0, mutant=1 on semantic assertions, restored=0; source SHA256
and installed/restored runtime bytecode hashes are recorded. 4053
backend/config source hashes unchanged and tracked production diff
empty. Metadata: `r11-merged-mutation-results.log`; verbatim logs:
`r11-merged-mutation-<name>-{baseline,red,restored}.log`.
| Mutation | Baseline / mutant / restored | Verdict |
|---|---|---|
| disable_audio_suppression | 0 / 1 / 0 | KILLED |
| ambiguous_legacy_none (fully stubbed real-process deferral) | 0 / 1 /
0 | KILLED |
| drop_new_speech | 0 / 1 / 0 | KILLED |
| ignore_audio_flag | 0 / 1 / 0 | KILLED |
| ignore_live_dedupe_flag | 0 / 1 / 0 | KILLED |
| ignore_listen_flag | 0 / 1 / 0 | KILLED |
| ignore_s1_required_flag | 0 / 1 / 0 | KILLED |
| ignore_dark_write_flag | 0 / 1 / 0 | KILLED |
| ignore_master_flag | 0 / 1 / 0 | KILLED |
| ignore_uid_allowlist | 0 / 1 / 0 | KILLED |
| leak_text_ids | 0 / 1 / 0 | KILLED |
| accept_receipt_without_committed_transcript | 0 / 1 / 0 | KILLED |
| accept_cross_lifetime_root | 0 / 1 / 0 | KILLED |
| bind_upload_without_s1_evidence | 0 / 1 / 0 | KILLED |
| receipt_fallback_in_committed_mode (real live persistence) | 0 / 1 / 0
| KILLED |
| whole_span_inference (saved omitted speech) | 0 / 1 / 0 | KILLED |
| cap_overrun | 0 / 1 / 0 | KILLED |
New-row verbatim red -> restored: `E AssertionError: assert
'source_position' == 'unknown'` -> `4 passed, 13 warnings in 7.00s`; `E
AssertionError: assert 'new-word-3' in ['live words']` -> `1 passed, 13
warnings in 5.82s`; `E assert 10000 <= 512` -> `1 passed, 13 warnings in
9.49s`. Guarded push succeeded first try (exit 0), remote equality
confirmed; evidence `r11-push-attempt1.log`. Full final-head CI GREEN:
https://github.com/BasedHardware/omi/actions/runs/37156881867
(workflow_dispatch, authoritative `--all` across all four shards +
guardrails + rollup); PR-selected unit
https://github.com/BasedHardware/omi/actions/runs/37156847467; static
https://github.com/BasedHardware/omi/actions/runs/37156847509; hermetic
E2E and Listen/Pusher + Sync Cloud Tasks gauntlets
https://github.com/BasedHardware/omi/actions/runs/37156847404;
source/hygiene repo checks
https://github.com/BasedHardware/omi/actions/runs/37156847566; final
metadata https://github.com/BasedHardware/omi/actions/runs/37156957511.
Emulator proofs, source-closure, OpenAPI, prod/dev config and CodeQL
also pass; mobile/desktop/web execution skips are expected from the net
diff. All runs are on `9d8c5a64f4`; no failed jobs or CPU-only
reds/reruns. No exit-141 transfer this round. Verbatim CI watch/check
logs are `r11-ci-full-watch.log` and `r11-ci-prchecks.log`.

## Flags, services and deploy sequence
C = Cloud Run
backend/backend-sync/backend-sync-backfill/backend-integration. L = GKE
backend-listen.
- `LISTEN_COMMITTED_CAPTURE_COVERAGE_ENABLED=true` on L; immutable
listen image + matching Helm rollout REQUIRED. Matching pusher literal
is inert; no pusher proof rollout required.
- `SYNC_WAL_AUDIO_COVERAGE_ENABLED`, `SYNC_LINEAGE_LIVE_DEDUPE_ENABLED`,
`SYNC_LINEAGE_S1_REQUIRED` default ON on C. Keep S1_REQUIRED=true;
OFF/typo broadens old-client routing.
- `SYNC_LINEAGE_RESOLVE_ENABLED` master ON/typo OFF across C+L; keep UID
allowlist David-only. `CAPTURE_EVIDENCE_V1_DARK_WRITE` backend admission
defaults OFF and needs separate reviewed config on L plus every C
ingress/worker; the mobile define is separate.
1. Finish fixes, guarded push, final mutations, independent review and
full CI; merge commit and verify Release Eligibility/index readiness.
Keep admission OFF and David-only.
2. Roll NEW listen producer image/chart FIRST, then NEW C consumer
revisions; admission OFF throughout. Drain mixed versions; verify every
served SHA/env. Never admit S1 with an old receipt-authorizing consumer.
3. Separately review/classify/compose admission in runtime base/overlays
+ listen Helm with matching inert pusher binding. Once all new code
serves, admit listen FIRST, then every C ingress/worker; verify
committed proof.
4. David/coordinator TestFlight build: independently merged root
rotation #20473 plus
`--dart-define=CAPTURE_EVIDENCE_V1_DARK_WRITE=true`; restart capture. No
app build/release here; no-S1 historical WALs cannot gain proof
retroactively.
5. Measure >=24h new-S1 acceptance and documented 48h David-only
widening gates; only then reviewed empty allowlist across C+L followed
by 24h all-user watch. Require <=10% doubled appended speech, zero
residual same-device sync-created rows/lost new speech, >=20 bound/split
decisions, truncation <=2%, lookup failures=0, no >5-minute stamp
stretch, and baseline failure/fence/listen gates.
Rollback: narrow cohort or master OFF across C+L while retaining
S1_REQUIRED=true; no flag rollback undoes appends. No
deploy/admission/widening performed.

## Coordinator-only remeasurement queries — NOT RUN
Replace START_UTC/END_UTC with the complete new-capture window. Fetch
ascending, split saturated windows; no UID/severity filter on these
id-free events. Full unchanged queries and caveats:
`.agent-artifacts/sync-lineage-dedupe/r9-prod-log-queries.txt`.
```text
((resource.type="cloud_run_revision" AND resource.labels.service_name=~"^(backend|backend-sync|backend-sync-backfill|backend-integration)$") OR (resource.type="k8s_container" AND resource.labels.namespace_name="prod-omi-backend" AND resource.labels.container_name="backend-listen"))
timestamp>="START_UTC" timestamp<"END_UTC"
(textPayload:"event=sync_wal_audio_coverage " OR textPayload:"event=sync_lineage_append ")
```
For binding/stretch append `(textPayload:"event=sync_lineage_resolve "
OR textPayload:"event=sync_lineage_lookup " OR
textPayload:"event=sync_lineage_probe " OR
textPayload:"event=sync_lineage_stamp_append ")` instead of the last
line. Logs measure audio/intake attempts, NOT semantic repeats or
residual saved rows. Coordinator must inspect authorized before/after
saved-row deltas, isolate newly appended sync speech and hand-label
repeats despite clock skew; divide repeated appended seconds by all
appended seconds and count distinct new same-device/same-origin
sync-created rows overlapping live. Do not replace quality gates with
dropped-audio telemetry.

## Product invariants affected
- INV-MEM-4: quality kill switches; no new memory promotion authority.
- INV-MEM-5: capture identity is not task/memory identity; no cohort
widening here.
Failure-Class: FC-offline-merge-clock-offset-dup
Line-Count-Exception: backend/utils/sync/pipeline.py | 2994 -> 3021 |
Thin helper imports, pending fence and two S1 admission call sites;
bounded coverage/claim validation remain in focused modules.
Line-Count-Exception: backend/routers/listen/receiver.py | 2237 -> 2257
| Thin committed-state/receipt-anchor calls and private word-range
cleanup; bounded producer/mapping logic lives in small modules.
Line-Count-Exception: backend/utils/stt/streaming.py | 2322 -> 2324 |
One import and one gated word-timing collector call; all
validation/mapping lives in the new small committed_words helper.

## GUARD CHANGED
Local fail-closed Firestore fixture from fix 1 and scratch mutation
execution guard; constructors/getters still raise. No hook, timing
limit, budget, S1 admission guard or security policy weakened.
## SCOPE ADDED
Required integration follow-ups: merge `7a8d15eb4a` brings current main,
preserves its Soniox recovery imports and fixes two type annotations;
corrective commit `9d8c5a64f4` restores 161 upstream Dart blobs
reformatted by the normal merge hook before package configuration
existed. Offline lock-enforced bootstrap restored the correct
package-manager-generated Dart 3.0 formatter context, and the normal
hook then reported `161 files (0 changed)`. Final app subtree is
byte-identical to main `d4062b9ee8`; no Flutter feature edits, hook
changes, bypasses or history rewrites. Private Deepgram/Soniox timing is
required for fix 3, not a provider-routing change.
## SPEC DIVERGENCE / reviewer risks
Span-only abstention and zero gap fill intentionally favor retaining new
speech over suppression recall. Ambiguous generations defer rather than
guessing by creation time; no historical repair. Review atomic
speech/proof merges, late callbacks, word/token timing accuracy and
residual re-transcription loss; root reuse within2s still relies on the
app rotation release; wall skew/backlog/context cause missed repeats,
and reaching the 512-note socket-lifetime cap stops later note
collection until a fresh socket, reducing suppression recall without
dropping sync speech. Check enrichment debt/live-write races, ambiguous
retry behavior, frozen-main flag-OFF parity and S1_REQUIRED typo
broadening. Independent review and authorized quality evidence remain
required before merge/widening.

Generated with [Devin](https://devin.ai)

🤖 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