Skip to content

feat(mobile): deliver glanceable snapshot updates - #5620

Open
iscekic wants to merge 37 commits into
audit-w8b-live-activities-3cf8-s3from
audit-w8b-live-activities-3cf8-s4
Open

feat(mobile): deliver glanceable snapshot updates#5620
iscekic wants to merge 37 commits into
audit-w8b-live-activities-3cf8-s3from
audit-w8b-live-activities-3cf8-s4

Conversation

@iscekic

@iscekic iscekic commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The iOS app now keeps the Active Agents Live Activity and the Lock Screen and Home Screen widgets current while the app is backgrounded or closed. They show how many agents are running, need input, or are reconnecting, a status line such as "No work in progress", and how long eligible work has run.

The Android Active Agents notification now updates in the background instead of only while the app is open.

If the device cannot show Live Activities, the Agents tab shows a one-time prompt to open Settings and enable them.

Signing out now also removes the device's background-update registration, so the signed-out account stops updating the Live Activity and widgets.


Reviewer Notes

A user_activity_tokens table stores device activity tokens for the glanceable surfaces. It holds the iOS push-to-start, iOS activity, and Android ongoing tokens, keyed by user and an optional organization, with a unique constraint on the token and cascade deletion with the user. Account soft-delete now also deletes these rows so a deleted user stops receiving glanceable deliveries.

Files
  • packages/db/src/schema.ts — adds the user_activity_tokens table, its unique token index, and its user-plus-organization index.
  • packages/db/src/migrations/0233_square_daimon_hellstrom.sql — creates the table, the user foreign key, and both indexes.
  • apps/web/src/lib/user/index.ts — deletes the user's activity-token rows in the soft-delete path.

Two new user mutations register and unregister activity tokens. registerActivityToken upserts on the token so a re-registration replaces the row, and unregisterActivityToken deletes only a row owned by the caller.

Files
  • apps/web/src/routers/user-router.ts — adds registerActivityToken and unregisterActivityToken and imports the new table.

The active-sessions core moves into a reusable server function. The tRPC procedure now delegates to listActiveSessions, which keeps the worker fetch, the enrichment, and the cloud-agent merge, so the snapshot builder can reuse it without a tRPC context.

Files
  • apps/web/src/lib/active-sessions-list.ts — new module holding the fetch, parse, enrich, and cloud-merge logic.
  • apps/web/src/routers/active-sessions-router.ts — the list procedure now calls listActiveSessions and re-exports its types.

A new internal route builds the privacy-minimal glanceable snapshot for a user. It requires the internal secret, re-checks organization membership when an organization is named, and returns the same versioned shape the mobile publisher derives locally. The builder reads only each session's status, so titles, ids, and other raw fields never leave the server.

Files
  • apps/web/src/app/api/internal/glanceable-agents-snapshot/route.ts — the secret-authenticated route with the organization re-check.
  • apps/web/src/lib/glanceable-agents-snapshot-server.ts — builds the snapshot from the active-sessions list through the shared builder.

A new push data variant active_agents_glanceable carries the aggregate snapshot. It has a versioned revision, an opaque scope key, counts, status, and safe timestamps, and never a title or id. A new active-agents Android channel and count-free generic copy route this payload.

Files
  • packages/notifications/src/push-data.ts — adds the variant and the GlanceableLiveActivityContentState type.
  • packages/notifications/src/push-presentation.ts — adds the channel and the routing and generic-copy cases.
  • packages/notifications/src/locales/en.json — adds the generic body string for the glanceable push.

The notifications worker now sends Live Activity APNs pushes and aggregate glanceable deliveries. A token-based APNs client signs a provider JWT and sends start or update pushes, and a pure orchestrator builds the snapshot and pushes it to iOS activity tokens and Expo tokens. After each cloud-agent session push, the worker delivers the fresh snapshot best-effort.

Files
  • services/notifications/src/lib/apns-live-activity.ts — new APNs client with JWT signing, request building, and parallel sending.
  • services/notifications/src/lib/glanceable-delivery.ts — new orchestrator whose IO is injected for tests.
  • services/notifications/src/index.ts — wires the dependencies, reads the credentials, and delivers after the session push.

The worker gains optional configuration for the snapshot and APNs delivery. KILO_WEB_API_BASE_URL names the web origin, and the four APNs values name the signing key and the topic. A missing value skips that part of delivery instead of failing the push.

Files
  • services/notifications/src/bindings.d.ts — declares the new optional bindings.
  • services/notifications/wrangler.jsonc — sets KILO_WEB_API_BASE_URL to the production origin.
  • ENVIRONMENT.md — documents the five new values.

The mobile app applies active_agents_glanceable pushes in the foreground and in a headless background task. A scope-key fence and an updatedAt check discard stale or foreign pushes, and the applied snapshot rebases its revision onto the local sequence and its local account epoch. The foreground handler suppresses these pushes as banners, and taps land on the Agents tab.

Files
  • apps/mobile/src/lib/notifications.ts — adds the apply logic, the background task, and the foreground suppression.
  • apps/mobile/src/lib/notification-path.ts — routes a glanceable tap to the Agents tab.
  • apps/mobile/src/app/_layout.tsx — registers the background handler at module scope.
  • apps/mobile/app.config.ts — enables background remote notifications.
  • apps/mobile/package.json — adds expo-task-manager.

An iOS delivery registrar registers and unregisters the Live Activity and push-to-start tokens. Registration waits for any in-flight logout unregister to settle, and unregistration reports the tokens it attempted so logout can tombstone them.

Files
  • apps/mobile/src/lib/glanceable/delivery-registration.ts — new registrar wiring the two token mutations.
  • apps/mobile/src/lib/glanceable/sink-registry.ts — adds the delivery hook and the token-only context.
  • apps/mobile/src/lib/auth/push-registration-reconciliation.ts — imports the registrar as a side effect.

The iOS Live Activity renders status, counts, and an elapsed timer from the shared content-state. The sink adopts an existing activity after a process restart, guards revisions, marks the surface denied only on a permanent ActivityKit failure, and triggers a one-time Settings prompt from the Agents tab.

Files
  • apps/mobile/src/glanceable-ios/active-agents-live-activity.tsx — the Live Activity layout with inlined English copy.
  • apps/mobile/src/glanceable-ios/ios-sink.ts — start, update, adopt, end, and token registration.
  • apps/mobile/src/glanceable-ios/view-props.ts — builds the surface props and the content-state.
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.ts — the one-time Settings alert.
  • apps/mobile/src/app/(app)/(tabs)/(2_agents)/index.tsx — shows the alert when the tab regains focus.

Logout now awaits activity-token unregistration and tombstones a failed attempt. Reconciliation retries only the recorded tokens, marks the activity part done when it succeeds, and orders registration against the unregister so a new session's tokens are never re-deleted.

Files
  • apps/mobile/src/lib/auth/logout-cleanup.ts — extends the tombstone with activity tokens and awaits unregistration.
  • apps/mobile/src/lib/auth/logout-reconciliation.ts — retries the recorded tokens and marks the activity part done.

Tests: 14 test files updated across the mobile, web, and notifications suites.
Generated: 1 lockfile updated and 2 Drizzle migration metadata files regenerated.


Verification

No E2E report was attached for this section, and no manual tests were run.

Visual Changes

Visual Changes: N/A

Human steps:

  • after merge — set APNS_TEAM_ID, APNS_KEY_ID, APNS_PRIVATE_KEY, and APNS_TOPIC in the notifications Worker. Without them, iOS Live Activity delivery silently skips.

Notes: none.

Stacked PRs — merge bottom to top. Each level shows only its own diff.

Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.

  1. audit-w8b-live-activities-3cf8feat(mobile): add glanceable agents snapshot contract #5535
  2. audit-w8b-live-activities-3cf8-s2feat(mobile): add iOS Live Activity and widgets #5553
  3. audit-w8b-live-activities-3cf8-s3feat(mobile): add Android agents widget and live update #5585
  4. audit-w8b-live-activities-3cf8-s4feat(mobile): deliver glanceable snapshot updates #5620 ← this PR (tip)

Add activity-token registration and background delivery so eligible work updates the iOS Live Activity, Android ongoing notification, and Home widgets without opening the app. Logout unregisters tokens. Old clients ignore the new payload type.
Comment thread apps/mobile/src/lib/notifications.ts
Comment thread apps/mobile/src/lib/glanceable/delivery-registration.ts Outdated
Comment thread apps/mobile/src/lib/glanceable/delivery-registration.ts Outdated
Comment thread services/notifications/src/lib/glanceable-delivery.ts Outdated
Comment thread services/notifications/src/lib/glanceable-delivery.ts
@kilo-code-bot

kilo-code-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Credential-shaped glanceable-refresh error fixture was replaced with a generic string; the test still asserts queue ack and logs only the session id.

Files Reviewed (1 file)
  • services/cloud-agent-next/src/telemetry/report-consumer.glanceable.test.ts
Previous Review Summaries (14 snapshots, latest commit cee6acb)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit cee6acb)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Terminal Live Activity ends now retire APNs targets under a generation fence before fresh work can start, with failed refresh isolated from queue ack.

Files Reviewed (6 files)
  • services/notifications/src/lib/apns-live-activity.ts
  • services/notifications/src/lib/apns-live-activity.test.ts
  • services/notifications/src/lib/glanceable-delivery-deps.ts
  • services/notifications/src/lib/glanceable-delivery.test.ts
  • services/notifications/src/lib/glanceable-delivery.ts
  • services/notifications/src/lib/glanceable-refresh.ts

Previous review (commit 35cf697)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Committed Cloud Agent run reports now refresh glanceable counts after the report transaction, with failed refresh isolated so the queue still acks.

Files Reviewed (3 files)
  • services/cloud-agent-next/src/notifications-binding.ts
  • services/cloud-agent-next/src/telemetry/report-consumer.glanceable.test.ts
  • services/cloud-agent-next/src/telemetry/report-consumer.ts

Previous review (commit 7428272)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Generation-fenced glanceable refresh now runs from session metadata, heartbeat, and disconnect transitions, with APNs timestamp ordering and Expo supersession checks covering the concurrent-delivery races.

Files Reviewed (18 files)
  • packages/notifications/src/rpc-schemas.test.ts
  • packages/notifications/src/rpc-schemas.ts
  • services/notifications/src/dos/NotificationChannelDO.ts
  • services/notifications/src/index.ts
  • services/notifications/src/lib/apns-live-activity.test.ts
  • services/notifications/src/lib/apns-live-activity.ts
  • services/notifications/src/lib/expo-push.test.ts
  • services/notifications/src/lib/expo-push.ts
  • services/notifications/src/lib/glanceable-delivery-deps.ts
  • services/notifications/src/lib/glanceable-delivery.test.ts
  • services/notifications/src/lib/glanceable-delivery.ts
  • services/notifications/src/lib/glanceable-refresh.ts
  • services/session-ingest/src/dos/UserConnectionDO.test.ts
  • services/session-ingest/src/dos/UserConnectionDO.ts
  • services/session-ingest/src/ingest/metadata.test.ts
  • services/session-ingest/src/ingest/metadata.ts
  • services/session-ingest/src/notifications-binding.ts
  • services/session-ingest/src/remote-session-notifications.ts

Previous review (commit 453669e)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Idle ends now keep scope delivery registered so rotated Live Activity and Android tokens still update widgets after the visible surface goes away.

Files Reviewed (15 files)
  • apps/mobile/src/glanceable-android/android-sink.test.ts
  • apps/mobile/src/glanceable-android/android-sink.ts
  • apps/mobile/src/glanceable-ios/ios-sink.test.ts
  • apps/mobile/src/glanceable-ios/ios-sink.ts
  • apps/mobile/src/lib/auth/logout-cleanup.test.ts
  • apps/mobile/src/lib/auth/logout-cleanup.ts
  • apps/mobile/src/lib/glanceable/cleanup.ts
  • apps/mobile/src/lib/glanceable/delivery-registration.test.ts
  • apps/mobile/src/lib/glanceable/delivery-registration.ts
  • apps/mobile/src/lib/glanceable/publisher.ts
  • apps/mobile/src/lib/glanceable/sink-registry.ts
  • apps/mobile/src/lib/notifications.test.ts
  • patches/expo-widgets@57.0.11.patch
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Previous review (commit 2864988)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Idle ActivityKit recovery now clears the denied latch after a verified identity read even when Agents is empty, and Android native deadlines hide expired counts without a JS timer.

Files Reviewed (15 files)
  • apps/mobile/modules/active-agents-live-update/android/src/main/AndroidManifest.xml
  • apps/mobile/modules/active-agents-live-update/android/src/main/java/com/kilocode/activeagentsliveupdate/ActiveAgentsDeadlineReceiver.kt
  • apps/mobile/modules/active-agents-live-update/android/src/main/java/com/kilocode/activeagentsliveupdate/ActiveAgentsLiveUpdateModule.kt
  • apps/mobile/src/glanceable-android/active-agents-widget.test.ts
  • apps/mobile/src/glanceable-android/android-sink.test.ts
  • apps/mobile/src/glanceable-android/android-sink.ts
  • apps/mobile/src/glanceable-android/live-update.ts
  • apps/mobile/src/glanceable-android/register.test.ts
  • apps/mobile/src/glanceable-android/register.ts
  • apps/mobile/src/glanceable-android/widget-props.test.ts
  • apps/mobile/src/glanceable-android/widget-props.ts
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.test.ts
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.ts
  • apps/mobile/src/lib/glanceable/presentation.test.ts
  • apps/mobile/src/lib/glanceable/presentation.ts

Previous review (commit a07b005)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

ActivityKit recovery no longer clears the denied latch unless eligible work is already present, so re-enabling Live Activities with an empty Agents tab never starts a later activity on that same focus.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/lib/glanceable/activity-kit-prompt.ts 66 Ineligible recovery leaves the ActivityKit denied latch set
Files Reviewed (5 files)
  • apps/mobile/src/app/(app)/(tabs)/(2_agents)/index.tsx
  • apps/mobile/src/glanceable-ios/ios-sink.ts
  • apps/mobile/src/i18n/locales/en.json
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.test.ts
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.ts - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit 609fc68)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

ActivityKit recovery no longer clears the denied latch unless eligible work is already present, so re-enabling Live Activities with an empty Agents tab never starts a later activity on that same focus.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/lib/glanceable/activity-kit-prompt.ts 66 Ineligible recovery leaves the ActivityKit denied latch set
Files Reviewed (12 files)
  • apps/mobile/src/app/(app)/(tabs)/(2_agents)/index.mounted.test.tsx
  • apps/mobile/src/app/(app)/(tabs)/(2_agents)/index.tsx
  • apps/mobile/src/glanceable-ios/ios-sink.test.ts
  • apps/mobile/src/glanceable-ios/ios-sink.ts
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.test.ts
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.ts - 1 issue
  • apps/mobile/src/lib/glanceable/cleanup.test.ts
  • apps/mobile/src/lib/glanceable/cleanup.ts
  • apps/mobile/src/lib/glanceable/publisher.test.ts
  • apps/mobile/src/lib/glanceable/publisher.ts
  • apps/mobile/src/lib/notifications.test.ts
  • apps/mobile/src/lib/notifications.ts

Fix these issues in Kilo Cloud

Previous review (commit fa8897d)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental i18n-only change since the last review: glanceable mobile status keys and activeAgentsGlanceable notification copy are present in every locale with matching keys and no empty values.

Files Reviewed (172 files)
  • apps/mobile/src/i18n/locales/af.json
  • apps/mobile/src/i18n/locales/am.json
  • apps/mobile/src/i18n/locales/ar.json
  • apps/mobile/src/i18n/locales/az.json
  • apps/mobile/src/i18n/locales/be.json
  • apps/mobile/src/i18n/locales/bg.json
  • apps/mobile/src/i18n/locales/bn.json
  • apps/mobile/src/i18n/locales/bs.json
  • apps/mobile/src/i18n/locales/ca.json
  • apps/mobile/src/i18n/locales/ckb.json
  • apps/mobile/src/i18n/locales/cs.json
  • apps/mobile/src/i18n/locales/cy.json
  • apps/mobile/src/i18n/locales/da.json
  • apps/mobile/src/i18n/locales/de.json
  • apps/mobile/src/i18n/locales/el.json
  • apps/mobile/src/i18n/locales/es.json
  • apps/mobile/src/i18n/locales/et.json
  • apps/mobile/src/i18n/locales/eu.json
  • apps/mobile/src/i18n/locales/fa.json
  • apps/mobile/src/i18n/locales/fi.json
  • apps/mobile/src/i18n/locales/fil.json
  • apps/mobile/src/i18n/locales/fr.json
  • apps/mobile/src/i18n/locales/ga.json
  • apps/mobile/src/i18n/locales/gl.json
  • apps/mobile/src/i18n/locales/gu.json
  • apps/mobile/src/i18n/locales/ha.json
  • apps/mobile/src/i18n/locales/he.json
  • apps/mobile/src/i18n/locales/hi.json
  • apps/mobile/src/i18n/locales/hr.json
  • apps/mobile/src/i18n/locales/ht.json
  • apps/mobile/src/i18n/locales/hu.json
  • apps/mobile/src/i18n/locales/hy.json
  • apps/mobile/src/i18n/locales/id.json
  • apps/mobile/src/i18n/locales/ig.json
  • apps/mobile/src/i18n/locales/is.json
  • apps/mobile/src/i18n/locales/it.json
  • apps/mobile/src/i18n/locales/ja.json
  • apps/mobile/src/i18n/locales/ka.json
  • apps/mobile/src/i18n/locales/kk.json
  • apps/mobile/src/i18n/locales/km.json
  • apps/mobile/src/i18n/locales/kn.json
  • apps/mobile/src/i18n/locales/ko.json
  • apps/mobile/src/i18n/locales/lo.json
  • apps/mobile/src/i18n/locales/lt.json
  • apps/mobile/src/i18n/locales/lv.json
  • apps/mobile/src/i18n/locales/mg.json
  • apps/mobile/src/i18n/locales/mi.json
  • apps/mobile/src/i18n/locales/mk.json
  • apps/mobile/src/i18n/locales/ml.json
  • apps/mobile/src/i18n/locales/mn.json
  • apps/mobile/src/i18n/locales/mr.json
  • apps/mobile/src/i18n/locales/ms.json
  • apps/mobile/src/i18n/locales/mt.json
  • apps/mobile/src/i18n/locales/my.json
  • apps/mobile/src/i18n/locales/nb.json
  • apps/mobile/src/i18n/locales/ne.json
  • apps/mobile/src/i18n/locales/nl.json
  • apps/mobile/src/i18n/locales/om.json
  • apps/mobile/src/i18n/locales/or.json
  • apps/mobile/src/i18n/locales/pa.json
  • apps/mobile/src/i18n/locales/pl.json
  • apps/mobile/src/i18n/locales/ps.json
  • apps/mobile/src/i18n/locales/pt-BR.json
  • apps/mobile/src/i18n/locales/pt.json
  • apps/mobile/src/i18n/locales/ro.json
  • apps/mobile/src/i18n/locales/ru.json
  • apps/mobile/src/i18n/locales/si.json
  • apps/mobile/src/i18n/locales/sk.json
  • apps/mobile/src/i18n/locales/sl.json
  • apps/mobile/src/i18n/locales/so.json
  • apps/mobile/src/i18n/locales/sq.json
  • apps/mobile/src/i18n/locales/sr.json
  • apps/mobile/src/i18n/locales/sv.json
  • apps/mobile/src/i18n/locales/sw.json
  • apps/mobile/src/i18n/locales/ta.json
  • apps/mobile/src/i18n/locales/te.json
  • apps/mobile/src/i18n/locales/th.json
  • apps/mobile/src/i18n/locales/tr.json
  • apps/mobile/src/i18n/locales/uk.json
  • apps/mobile/src/i18n/locales/ur.json
  • apps/mobile/src/i18n/locales/uz.json
  • apps/mobile/src/i18n/locales/vi.json
  • apps/mobile/src/i18n/locales/yo.json
  • apps/mobile/src/i18n/locales/zh-Hans.json
  • apps/mobile/src/i18n/locales/zh-Hant.json
  • apps/mobile/src/i18n/locales/zu.json
  • packages/notifications/src/locales/af.json
  • packages/notifications/src/locales/am.json
  • packages/notifications/src/locales/ar.json
  • packages/notifications/src/locales/az.json
  • packages/notifications/src/locales/be.json
  • packages/notifications/src/locales/bg.json
  • packages/notifications/src/locales/bn.json
  • packages/notifications/src/locales/bs.json
  • packages/notifications/src/locales/ca.json
  • packages/notifications/src/locales/ckb.json
  • packages/notifications/src/locales/cs.json
  • packages/notifications/src/locales/cy.json
  • packages/notifications/src/locales/da.json
  • packages/notifications/src/locales/de.json
  • packages/notifications/src/locales/el.json
  • packages/notifications/src/locales/es.json
  • packages/notifications/src/locales/et.json
  • packages/notifications/src/locales/eu.json
  • packages/notifications/src/locales/fa.json
  • packages/notifications/src/locales/fi.json
  • packages/notifications/src/locales/fil.json
  • packages/notifications/src/locales/fr.json
  • packages/notifications/src/locales/ga.json
  • packages/notifications/src/locales/gl.json
  • packages/notifications/src/locales/gu.json
  • packages/notifications/src/locales/ha.json
  • packages/notifications/src/locales/he.json
  • packages/notifications/src/locales/hi.json
  • packages/notifications/src/locales/hr.json
  • packages/notifications/src/locales/ht.json
  • packages/notifications/src/locales/hu.json
  • packages/notifications/src/locales/hy.json
  • packages/notifications/src/locales/id.json
  • packages/notifications/src/locales/ig.json
  • packages/notifications/src/locales/is.json
  • packages/notifications/src/locales/it.json
  • packages/notifications/src/locales/ja.json
  • packages/notifications/src/locales/ka.json
  • packages/notifications/src/locales/kk.json
  • packages/notifications/src/locales/km.json
  • packages/notifications/src/locales/kn.json
  • packages/notifications/src/locales/ko.json
  • packages/notifications/src/locales/lo.json
  • packages/notifications/src/locales/lt.json
  • packages/notifications/src/locales/lv.json
  • packages/notifications/src/locales/mg.json
  • packages/notifications/src/locales/mi.json
  • packages/notifications/src/locales/mk.json
  • packages/notifications/src/locales/ml.json
  • packages/notifications/src/locales/mn.json
  • packages/notifications/src/locales/mr.json
  • packages/notifications/src/locales/ms.json
  • packages/notifications/src/locales/mt.json
  • packages/notifications/src/locales/my.json
  • packages/notifications/src/locales/nb.json
  • packages/notifications/src/locales/ne.json
  • packages/notifications/src/locales/nl.json
  • packages/notifications/src/locales/om.json
  • packages/notifications/src/locales/or.json
  • packages/notifications/src/locales/pa.json
  • packages/notifications/src/locales/pl.json
  • packages/notifications/src/locales/ps.json
  • packages/notifications/src/locales/pt-BR.json
  • packages/notifications/src/locales/pt.json
  • packages/notifications/src/locales/ro.json
  • packages/notifications/src/locales/ru.json
  • packages/notifications/src/locales/si.json
  • packages/notifications/src/locales/sk.json
  • packages/notifications/src/locales/sl.json
  • packages/notifications/src/locales/so.json
  • packages/notifications/src/locales/sq.json
  • packages/notifications/src/locales/sr.json
  • packages/notifications/src/locales/sv.json
  • packages/notifications/src/locales/sw.json
  • packages/notifications/src/locales/ta.json
  • packages/notifications/src/locales/te.json
  • packages/notifications/src/locales/th.json
  • packages/notifications/src/locales/tr.json
  • packages/notifications/src/locales/uk.json
  • packages/notifications/src/locales/ur.json
  • packages/notifications/src/locales/uz.json
  • packages/notifications/src/locales/vi.json
  • packages/notifications/src/locales/yo.json
  • packages/notifications/src/locales/zh-Hans.json
  • packages/notifications/src/locales/zh-Hant.json
  • packages/notifications/src/locales/zu.json

Previous review (commit 5853a07)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • apps/mobile/src/app/(app)/(tabs)/(2_agents)/index.mounted.test.tsx

Previous review (commit 05664ca)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files)
  • apps/mobile/src/lib/auth/logout-cleanup.test.ts
  • apps/mobile/src/lib/auth/logout-cleanup.ts
  • apps/mobile/src/lib/auth/logout-reconciliation.test.ts
  • apps/mobile/src/lib/auth/logout-reconciliation.ts
  • apps/mobile/src/lib/glanceable/delivery-registration.test.ts
  • apps/mobile/src/lib/glanceable/delivery-registration.ts

Previous review (commit fe6f60a)

Status: 3 Issues Found | Recommendation: Address before merge

Executive Summary

Failed activity-token unregister on account/org switch still overwrites a pending push-token tombstone, and org-switch registration can still race the fire-and-forget delete.

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/lib/auth/logout-cleanup.ts 191 Failed switch unregister overwrites a pending push-token tombstone
apps/mobile/src/lib/organization-context.tsx 78 Org-switch token unregister is fire-and-forget, so the new org can re-register before delete settles
apps/mobile/src/lib/auth/logout-reconciliation.ts 96 hasPendingActivityUnregister treats another user's tombstone as blocking
Files Reviewed (6 files)
  • apps/mobile/knip.json
  • apps/mobile/src/glanceable-android/register.test.ts
  • apps/mobile/src/glanceable-android/register.ts
  • apps/mobile/src/glanceable-ios/ios-sink.test.ts
  • apps/mobile/src/glanceable-ios/ios-sink.ts
  • apps/mobile/src/lib/unread-counts-invalidation-mount.test.ts

Fix these issues in Kilo Cloud

Previous review (commit caf4017)

Status: 5 Issues Found | Recommendation: Address before merge

Executive Summary

Failed activity-token unregister on account/org switch still overwrites a pending push-token tombstone, and org-switch registration can still race the fire-and-forget delete.

Overview

Severity Count
CRITICAL 0
WARNING 5
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/lib/auth/logout-cleanup.ts 191 Failed switch unregister overwrites a pending push-token tombstone
apps/mobile/src/lib/organization-context.tsx 78 Org-switch token unregister is fire-and-forget, so the new org can re-register before delete settles
apps/mobile/src/glanceable-ios/ios-sink.ts 97 Async endNow leaves the Live Activity handle live across an await
apps/mobile/src/glanceable-android/register.ts 51 Restored widget snapshot ignores expiresAt after process death
apps/mobile/src/lib/auth/logout-reconciliation.ts 96 hasPendingActivityUnregister treats another user's tombstone as blocking
Files Reviewed (8 files)
  • apps/mobile/src/lib/auth/logout-reconciliation.test.ts
  • apps/mobile/src/lib/auth/logout-reconciliation.ts - 1 issue
  • apps/mobile/src/lib/glanceable/activity-kit-prompt.ts
  • apps/mobile/src/lib/glanceable/delivery-registration.test.ts
  • apps/mobile/src/lib/glanceable/delivery-registration.ts
  • apps/mobile/src/lib/glanceable/sink-registry.ts
  • services/notifications/src/lib/glanceable-delivery.test.ts
  • services/notifications/src/lib/glanceable-delivery.ts

Fix these issues in Kilo Cloud

Previous review (commit 3367927)

Status: 8 Issues Found | Recommendation: Address before merge

Executive Summary

Failed activity-token unregister on account/org switch overwrites a pending push-token tombstone, and org-switch registration can race the fire-and-forget delete.

Overview

Severity Count
CRITICAL 0
WARNING 8
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/mobile/src/lib/auth/logout-cleanup.ts 191 Failed switch unregister overwrites a pending push-token tombstone
apps/mobile/src/lib/organization-context.tsx 78 Org-switch token unregister is fire-and-forget, so the new org can re-register before delete settles
apps/mobile/src/glanceable-ios/ios-sink.ts 229 Async endNow leaves the Live Activity handle live across an await
apps/mobile/src/lib/notifications.ts 156 Headless empty snapshot still never ends the Live Activity: the 8s timer is scheduled then the background task returns
apps/mobile/src/lib/glanceable/delivery-registration.ts 183 Token registration proceeds when logout reconciliation is spacing-skipped
apps/mobile/src/lib/glanceable/delivery-registration.ts 250 Failed unregister tombstones tokens that already succeeded
services/notifications/src/lib/glanceable-delivery.ts 34 Every snapshot send uses APNs start for still-registered push-to-start tokens
apps/mobile/src/glanceable-android/register.ts 65 Restored widget snapshot ignores expiresAt after process death
Files Reviewed (18 files)
  • apps/mobile/package.json
  • apps/mobile/src/app/_layout.tsx
  • apps/mobile/src/lib/auth/auth-context.test.tsx
  • apps/mobile/src/lib/auth/auth-context.tsx
  • apps/mobile/src/lib/auth/logout-cleanup.test.ts
  • apps/mobile/src/lib/auth/logout-cleanup.ts - 1 issue
  • apps/mobile/src/lib/auth/push-registration-reconciliation.test.ts
  • apps/mobile/src/lib/auth/push-registration-reconciliation.ts
  • apps/mobile/src/lib/notifications.test.ts
  • apps/mobile/src/lib/notifications.ts - 1 issue
  • apps/web/src/lib/user/index.test.ts
  • apps/web/src/lib/user/index.ts
  • apps/web/src/routers/active-sessions-router.ts
  • packages/db/src/migrations/0234_smiling_natasha_romanoff.sql
  • packages/db/src/migrations/meta/0234_snapshot.json
  • packages/db/src/migrations/meta/_journal.json
  • packages/db/src/schema.ts
  • pnpm-lock.yaml

Fix these issues in Kilo Cloud

Previous review (commit 4f68438)

Status: 8 Issues Found | Recommendation: Address before merge

Executive Summary

Failed activity-token unregister on account/org switch overwrites a pending push-token tombstone, and org-switch registration can race the fire-and-forget delete.

Overview

Severity Count
CRITICAL 0
WARNING 8
SUGGESTION 0

[Snapshot truncated.]

Additional previous summary content was truncated to keep this comment within platform limits.


Reviewed by grok-4.6 · Input: 98.4K · Output: 3.8K · Cached: 261.1K

Review guidance: REVIEW.md from base branch audit-w8b-live-activities-3cf8-s3

@iscekic

iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

(bot) The restored-widget expiry finding is fixed on its owning Android level in 190654f and forwarded here by 520eb88. The handler preserves privacy blanks and hides expired counts. The other four current findings remain under repair.

@iscekic

iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

(bot) Commit fe6f60a fixes concurrent activity teardown and the unread-count test import failure. Commit 05664ca preserves pending push cleanup, orders iOS scope mutations, and checks tombstone ownership. The cleanup recheck found no further issues. Focused proof covers 33 lifecycle/unread tests and 71 cleanup tests. CI must confirm typed checks against regenerated declarations.

@iscekic

iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

(bot) Fixed idle ActivityKit recovery in 2864988. The capability probe now clears denial after verified identity reads, even without eligible work. Later work starts without another focus event. Forty focused tests pass, including storage failures and privacy races. Native device verification remains pending.

@iscekic

iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

(bot) BLOCKED: audit-w8b-live-activities-3cf8

BLOCKED

Section result

The section cannot satisfy physical Apple Push Notification service (APNs) verification with the available inputs and device state.
Native terminal privacy after process restart remains unproved after implementation and review rounds.
The section has no human-ready label; no completion claim or verification waiver was made.

Required external action

Restore the physical APNs verification setup for this section.
Supply APNS_TEAM_ID, APNS_KEY_ID, and a usable APNS_PRIVATE_KEY through approved private configuration.
Use APNS_TOPIC=com.kilocode.kiloapp and connect an available provisioned physical iPhone.
Never put credentials in a PR, comment, scratch handoff, or chat response.

Evidence:

  • The original handoff, lines 51–54, requires physical push proof and forbids substituting simulator evidence.
  • decisions.md, entries 79 and 82, records unsuccessful credential sourcing and the absent team/key identifiers.
  • The current services/notifications/wrangler.jsonc:11–14 has no APNs variables.
  • The current services/notifications/wrangler.jsonc:65–81 has no APNS_PRIVATE_KEY binding.
  • On 2026-08-28, xcrun devicectl list devices reports one paired iPhone as unavailable and no available physical device.
  • No environment file or credential value was read or copied during this generation.

This is an external runtime gate, not a CI waiver or an exhaustion of the work budget.
The device setup must prove immediate dismissal after native process restart and an unobserved remote start/end.
If ActivityKit cannot expose still-visible ended content, the lifecycle needs an approved change before completion.
The current implementation only retains native handles within one native process.

PR state

Repository: Kilo-Org/cloud.
Worktree: /Users/igor/Projects/.worktrees/audit-w8b-live-activities-3cf8.
Branch: audit-w8b-live-activities-3cf8-s4.
Latest pushed head: 421a090, test(cloud-agent): replace credential-shaped error fixture.

Level PR Final mechanical gate
1 #5535 OK
2 #5553 OK
3 #5585 OK
4 #5620 Not green; current-head CI and bot review are incomplete

The gate files remain in gates/ beside this report.
The lower mechanical gates do not complete the section's runtime, advocate, cumulative-review, and description requirements.
Existing assignments came from earlier generations; this generation assigned or requested nobody.
No PR state, title, label, or description was changed.

Work completed this generation

  • Verified the switching stack, four PRs, pushed history, inherited nine-path native patch, and empty resource ledger.
  • Prepared the patched mobile dependency closure with a frozen lockfile and disabled lifecycle scripts.
  • Fixed three test lint errors through native continuation r2.
  • Fixed dismissed-target terminal-barrier poisoning through native repair r3.
  • Preserved transient native retries and the existing terminal submission order.
  • Replaced a synthetic credential-shaped CI fixture through l4-ci-fixture-r1.
  • Committed and pushed only that one-file CI repair as 421a090.

Verification and acceptance outcomes

Outcome Evidence
Native scoped checks Five checks pass in the r3 report
Native focused tests 111 pass: 106 existing plus five new cases
Disappearance regression Two cases fail before the fix and pass afterward
Transient native retry Three new cases pass
Dismissed-target review findings-l4-terminal-native-r3.md resolves finding 2
Native restart privacy Still open; retained handles do not survive native process exit
Native compilation Not run; prior Swift syntax parsing is not compilation
Physical APNs delivery Not run; required credentials and an available device are absent
CI fixture checks Five checks pass, including 14 focused tests
Current-head CI Unconfirmed after the new push; not described as passing

All local checks target changed files and run serially through run-checks.sh.
No repository-wide check was run locally.

Preserved native work

Nine native paths remain uncommitted because the native implementation loop still has the required privacy-proof finding.
The working tree and native-preserved-g21.diff preserve the complete patch.
The new native test file has intent-to-add state from the workflow snapshot; no native content was committed.

  • apps/mobile/src/glanceable-ios/ios-sink.native.test.ts
  • apps/mobile/src/glanceable-ios/ios-sink.test.ts
  • apps/mobile/src/glanceable-ios/ios-sink.ts
  • apps/mobile/src/lib/glanceable/publisher.ts
  • apps/mobile/src/lib/glanceable/sink-registry.ts
  • apps/mobile/src/lib/notifications.test.ts
  • apps/mobile/src/lib/notifications.ts
  • patches/expo-widgets@57.0.11.patch
  • pnpm-lock.yaml

Preserve these files when restoring the verification setup.
Do not redispatch already-landed plan slices.

Repair rounds and counters

  • Native r1: implemented recovery and native retention; STOPPED EARLY on dependency preparation.
  • Native r2: test-lint continuation; five checks and 106 tests pass.
  • Native cumulative review r2: two findings, both accepted.
  • Native r3: dismissed-target repair; five checks and 111 tests pass.
  • Native bounded review r3: product finding resolved; required native privacy proof remains open.
  • L4 TruffleHog fixture: one pushed repair, 421a090; no second round has run.
  • L4 layout TS2322: correction remains in the uncommitted native patch; no pushed fix yet.
  • No takeover or consultant call occurred in this generation.
  • Simplify and translation each completed once in prior generations; neither was repeated.
  • Historical counters in decisions.md remain authoritative; incomplete bot iteration totals were not reset or invented.

Current-head CI diagnoses

The diagnoses refer to the prior pushed head cee6acb.
They are findings, not reasons to waive CI.

  • TruffleHog: run 33211150695, job 98984394915, reports a synthetic Postgres-shaped test fixture.
  • Its one-file repair is pushed in 421a090; the scanner must verify the new head.
  • Typecheck: run 33211151088, job 98984524929, reports TS2322 in notifications.test.ts:118:89.
  • The inherited native patch changes the invalid null layout to { banner: null }.
  • No CI evidence proves that uncommitted correction yet.

Sanitized diagnosis and excerpts remain in ci-g21-diagnoses.md and ci-g21-*-failure-excerpt.txt.
No scanner configuration or production security check was weakened.

Remaining completion work

These are unfinished steps, not additional terminal blockers.

  • Prove the required native privacy behavior, then close the native review and land its patch.
  • Complete the final user-advocate loop and cumulative section review.
  • Run backend, iOS, and Android verification with the required physical push cases.
  • Produce the E2E report and fresh descriptions.
  • Obtain current-head CI, bot review, and resolved findings for every PR.
  • Pass the full gate before calling pr-api.sh ready for all four PRs together.

Rejected findings, workflow fixes, and resources

  • This generation rejected no new finding.
  • Prior technical rejections remain in decisions.md and were not reopened.
  • The inherited native-patch-lint fixer returned NO WORKFLOW FIX NEEDED; its documented preparation succeeded.
  • No workflow-fixer dispatch or workflow edit occurred this generation.
  • No E2E slot, stack, device, recorder, or server was started.
  • No outstanding inbox request remains.
  • resources.md contains only the empty table row.
  • Keep the scratch directory, worktree, branch, PRs, and uncommitted native patch for follow-up work.

@iscekic

iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

(bot) BLOCKED: audit-w8b-live-activities-3cf8

BLOCKED
The crash watchdog hit its relaunch cap (3) for this section (orchestrator window dead).
Inspect /Users/igor/Projects/.scratch/kilo-workflow-audit-w8b-live-activities-3cf8.YCZxd and the newest logs, then relaunch by hand with a relay note (templates/handoff-relay.md).

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