Skip to content

Remove the not-captured calendar gap UI from conversations - #20884

Merged
Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/capture-gap-ui
Oct 7, 2026
Merged

Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/capture-gap-ui

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

Remove the mobile Conversations list placeholders for calendar meetings that were not captured, and delete the client models, fetch, and localization that only existed to render them. Server-side calendar capture gaps, including the discard override and GET /v1/calendar/capture-gaps, stay in place.

Product invariants affected

None. This removes a read-only UI surface (calendar capture-gap placeholders)
and its dead client plumbing; conversation processing, the calendar discard
override, and the capture-gaps HTTP endpoint are unchanged.

Test plan

  • cd app && bash test.sh (exit 0; spine suite printed 00:32 +138: All tests passed!)
  • flutter analyze on the touched Dart sources reports only the pre-existing constant_identifier_names infos already counted in app/analysis_baseline.json
  • grep -rn "aptureGap" app/lib app/test returns no hits

Review in cubic

@Git-on-my-level

Copy link
Copy Markdown
Member Author

Lane verdict chain (head ea383421be):

  • Implement: cursor grok-4.7-high — 109 files, +4/−835, UI + dead client plumbing only; backend endpoint/discard override untouched (coordinator scope-verified).
  • Review: codex gpt-6-luna (read-only, adversarial) — VERDICT: SHIP, blocking: none, non-blocking: none.
  • Coordinator verification: fork head == PR head == ea383421be; grep -rn "aptureGap" app/lib app/test → 0 hits; conversations + unit suites re-run locally: 1977 passed; body gates (failure-class, product invariants, changelog) green.
  • Merge gated on full CI green for this head.

@Git-on-my-level Git-on-my-level added the ci:full Maintainer-granted: run full CI on this fork PR label Oct 7, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Full review chain for head 46ef07a31d (net diff origin/main...HEAD = +4/−835, app/ + one generator line):

Merge gated on full CI green for 46ef07a31d.

@Git-on-my-level
Git-on-my-level merged commit 230bb1b into BasedHardware:main Oct 7, 2026
45 checks passed
Git-on-my-level added a commit that referenced this pull request Oct 7, 2026
## What changed and why

Hardens the never-lose-audio paths on the phone:

- **Capture liveness watchdog**: while the coordinator believes capture
is
live, a watchdog now detects "socket down or no audio frames flowing"
and
  forces recovery at a WAL boundary instead of silently continuing to
  believe audio is being captured.
- **Stale-WAL reconciliation**: local WALs stuck in `miss` past a
threshold
are reported at startup/foreground instead of only retrying silently, so
  uploads that never land are visible.
- **Calendar capture-gap monitor**: while a calendar meeting the user is
  attending is active and capture is not owning, the app records a
  capture-gap signal through the existing calendar capture telemetry —
post-capture visibility, not the conversation-list placeholders removed
  in #20884.
- **Backend loss accounting**: conversation finalize emits a counter
with
  `capture_evidence.coverage` and covered-span vs wall-span seconds, so
  partial captures are countable in metrics.

## Why

A real 120-minute meeting produced zero server-side audio for its first
70
minutes (device made no server contact), and nothing in the product
noticed.
The server cannot transcribe audio it never receives, so the fix is at
the
capture client: notice silence-while-live, surface
not-owning-during-meeting,
and account for partial coverage server-side.

## Failure-Class
Failure-Class: none

## Product invariants affected

- INV-CAP-1 — this PR's diff touches `app/lib/services/capture/**` and
`app/lib/services/wals/**`. It adds no pause, unsubscribe, or fence: the
  watchdog only forces recovery (WAL finalize + new session) when frames
  have already stopped flowing, and the gap monitor is telemetry-only.
  Every audio frame captured still reaches the socket or a durable WAL
  write; nothing discards frames.
- INV-MEM-4 — `backend/utils/conversations/process_conversation.py` is
in
its path globs. The change adds a telemetry emission next to
finalization;
it does not create an intake route, promote, archive, or fast-track any
  memory, and canonical intake routing is untouched.
- INV-TASK-2 — `backend/utils/conversations/process_conversation.py` is
in
  its path globs. The change adds no capture proposal surface; task
  suggestion policy and its Suggested surfaces are untouched.

## Line-Count-Exception

Line-Count-Exception: app/lib/services/capture/capture_controller.dart |
4081 -> 4211 | watchdog state hooks, suspension invalidation and
socket-aware recovery callbacks; split deferred to the #9838 follow-up
Line-Count-Exception: app/lib/services/capture/capture_coordinator.dart
| 2842 -> 2932 | watchdog wiring, socket-aware recovery dispatch and
suspension-gap tracking
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2576
-> 2636 | stale-miss reporting and reconciliation on startup and
foreground
Line-Count-Exception:
backend/utils/conversations/process_conversation.py | 3574 -> 3577 |
three-line coverage counter emission at conversation finalize

## Test plan

- `app`: capture/watchdog/WAL-stale suites — 138 spine + 412 affected
tests
  pass (coordinator re-runs the load-bearing subset before review)
- `backend`: `tests/unit/test_capture_loss_accounting.py` — 14 passed

## UI-Evidence
UI-Evidence: none -- no user-visible surface changed in this PR; the gap
monitor is telemetry-only and recovery is behavior-preserving at equal
UX.

## Known limitations

- The watchdog detects loss while the app runs; a killed/backgrounded
app
  before capture starts is covered by the calendar gap monitor's signal,
not prevention — prevention (meeting-aware capture nudge) is a
follow-up.
- Backend counter is in-process until scraped; no dashboard yet.

## Review round 1 fixes (grok REQUEST CHANGES → addressed)

- P1: calendar gap polling now only fires for locally known uncaptured
meetings (from cached calendar-list responses), with 60s→10min
exponential backoff — zero steady-state polling when no meeting is
imminent or capture is owning (b92a4d2).
- P2: liveness failures now carry the observed wall-gap and are
invalidated across app suspension; `onAppResumed` clears pending
failures before the reducer can apply them — no mid-sentence mic stop
after screen lock (0f58880).
- P2: recovery branch chosen from current socket readiness at check
time; socket-down prefers reconnect, and a keepalive-restored socket
discards a queued failure instead of restarting the mic (f9e1475).
- P3: finalize accounting test now exercises the internal Pydantic
`CaptureEvidenceMetadata` path (faf763f).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Maintainer-granted: run full CI on this fork PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant