feat(mobile): add glanceable agents snapshot contract - #5535
Open
iscekic wants to merge 7 commits into
Open
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (87 files)
Previous Review Summaries (5 snapshots, latest commit af85672)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit af85672)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous review (commit 404cdee)Status: No Issues Found | Recommendation: Merge Files Reviewed (86 files)
Previous review (commit 4083fdb)Status: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
Previous review (commit 44f0caa)Status: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Previous review (commit e13a240)Status: 3 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (20 files)
Reviewed by grok-4.6 · Input: 132.2K · Output: 7.5K · Cached: 271.2K Review guidance: REVIEW.md from base branch |
This was referenced Aug 27, 2026
…ties-3cf8 # Conflicts: # apps/mobile/knip.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
No new behavior — no screen, widget, or notification shows anything different. This change only adds background plumbing that later levels render as an agents summary.
The
GlanceableAgentsSnapshotcontract is added: one versioned, privacy-minimal schema for every glanceable surface. It carries a status, three counts, safe timestamps, and an opaque scope key, and never titles, prompts, names, or raw ids. Producers may omit the optional account epoch until every producer sends it, then the option must be removed.Files
packages/app-shared/src/glanceable-agents-snapshot.ts— adds the version-1 schema, session-count mapping, FNV-1a scope-key hashing, snapshot builder, and revision ordering.packages/app-shared/package.json— exports the new./glanceable-agents-snapshotsubpath.The
GlanceablePublisherstate machine derives a versioned snapshot from the active-sessions tray cache and emits it to every registered sink. It starts the activity on the first eligible emit, coalesces later happy updates, and schedules the 8-second terminal end when work empties. Expiry and strict revision ordering stop a stale producer from overwriting newer data.Files
apps/mobile/src/lib/glanceable/publisher.ts— implements the state machine with session, fetch-start, and fetch-error handlers, coalesce and terminal timers, expiry, and the terminal-blank gate.apps/mobile/src/lib/glanceable/sink-registry.ts— defines theGlanceableSinkcontract and registry, plus a pluggable delivery registrar that stays a no-op until later slices register tokens.apps/mobile/src/lib/glanceable/mount.tsx— React glue that subscribes to theactiveSessions.listtray cache and builds one publisher per signed-in context.apps/mobile/src/app/(app)/_layout.tsx— mounts the publisher and the org fence in the app layout.The persist sink mirrors the last snapshot and its scope key in SecureStore so a JS restart can fence the surface. A monotonic epoch guards the async restore, so a live write during the read is never clobbered by a stale record. Later levels read this stored snapshot for the iOS and Android widgets.
Files
apps/mobile/src/lib/glanceable/persist.ts— adds the SecureStore mirror, the epoch-guarded restore, the schema-validated parse, and thepersistGlanceableSink.Terminal blanking zeroes the surface on logout, direct account switch, org switch, and confirmed lost org. A monotonic terminal-blank epoch gates the publisher, so a cache success after a blank cannot republish or restart. Blanking runs before credentials persist, and a direct account switch also clears the query cache so a stale org list cannot drive a false blank.
Files
apps/mobile/src/lib/glanceable/cleanup.ts— terminal blanking, the terminal-blank epoch gate, the pure org-fence decision, and the stale republish path.apps/mobile/src/lib/auth/auth-context.tsx— blanks synchronously at the start of sign-out and before account-switch credential persist; clears the query cache on switch.apps/mobile/src/lib/organization-context.tsx— blanks before an org change and makes a same-value selection a no-op.The org fence reacts to
organizations.list: a selected org missing from a successful list blanks the surface as privacy, while a loading or errored list never blanks. An error republishes the last snapshot as stale, and a terminal snapshot keeps its signed-out or privacy status.Files
apps/mobile/src/lib/glanceable/org-fence.ts— queries the org list and dispatches a privacy blank or a stale republish.Presentation resolves a snapshot to locked copy keys with a ranked count order, and signed-out or org-invalid flags take precedence. Happy snapshots render counts only, and every other status maps to one locked copy key. The open action routes through the pending-deep-link gate instead of calling
router.navigate.Files
apps/mobile/src/lib/glanceable/presentation.ts— status resolution, count rank order, primary count, and spoken-label key assembly.apps/mobile/src/lib/glanceable/open-agents.ts— stashes the Agents tab destination through the pending-deep-link gate.apps/mobile/src/i18n/locales/en.json— adds the 13 locked English copy keys for the glanceable surface and a channel name.The pure-logic vitest project includes the glanceable test directory.
Files
apps/mobile/vitest.pure.config.ts— addssrc/lib/glanceable/**/*.test.tsto the include list.Tests: 5 new suites cover the snapshot contract, publisher, persist, cleanup, and presentation.
Generated: none.
Verification
Visual Changes
Visual Changes: N/A
Reviewer Notes
No human steps are required for this change, before or after merge.
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.
audit-w8b-live-activities-3cf8— feat(mobile): add glanceable agents snapshot contract #5535 ← this PRaudit-w8b-live-activities-3cf8-s2— feat(mobile): add iOS Live Activity and widgets #5553audit-w8b-live-activities-3cf8-s3— feat(mobile): add Android agents widget and live update #5585audit-w8b-live-activities-3cf8-s4— feat(mobile): deliver glanceable snapshot updates #5620 (tip)