Skip to content

feat(mobile): J5's archive warning on every mobile archive door - #845

Merged
Jacksondr5 merged 4 commits into
j5/mainfrom
j5code/mobile-archive-warning
Nov 1, 2026
Merged

Jacksondr5 merged 4 commits into
j5/mainfrom
j5code/mobile-archive-warning

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Problem

Mobile archived directly, without J5's archive preflight (register D13). On mobile, archiving an agent ended its open asks and left its children running, and archiving a Captain retired its Crews, all with no warning. A Crew seat's refusal sent people to a Fleet page that mobile doesn't have (F2).

Closes #835

What changed

  • Web's archive preflight now lives once in packages/client-runtime/src/j5/archiveFlow.ts: reading the facts and participant names, deciding whether to warn, building the warning, and the flow itself. Web's archiveFlow.ts and archiveFlowClient.ts are thin bindings, and web's dialog and its tests are unchanged. presentParticipantIdentity moves beside it as j5/participant-identity.
  • Every mobile archive door (swipe, row menu, sidebar) goes through the one executeAction("archive") in upstream's useThreadListActions.ts. After upstream's working-thread check, that branch makes one call into J5-owned apps/mobile/src/j5/archive/confirmArchive.ts.
  • When the facts call for it, mobile opens a J5-owned scrollable sheet, apps/mobile/src/j5/archive/ArchiveWarningSheet.tsx. Its host mounts beside upstream's Dialog.Host in App.tsx. The sheet shows every fact web shows: the Crews it commands seat by seat, agents placed beneath that keep running, every open ask with its full intent (urgent first), "couldn't check" for a failed read, and the workspace reassurance. One Cancel and one destructive confirm. Android's back gesture cancels.
  • When there is nothing to warn about, the archive goes through with no dialog. Unarchive is unchanged.
  • The seat refusal now says Archive crew is "on the Fleet page in J5 on web or desktop", on mobile and in the server's guard message. Delete on mobile shows the server's message, so it is covered too.
  • docs/j5/product/upstream.md D13 now says the dialog shows on web and mobile.

UI changes

Android 16 emulator, 1080×2400, light theme. Both sides use the same isolated test home, with real Claude Haiku agents holding six open asks and a child. Base is 31447c91c6, head is 8b9472c848. iOS is deferred to Checkpoint 1 on Jackson's iPhone; no iOS UI has been verified.

Archiving an agent with six open asks and a child. Before: Archive in the row menu removed the agent straight away, ending its asks without a word. After: the warning lists the child that keeps running and every ask in full, blocking first.

Before After
Row menu Archive on an agent with open asks, before Archive warning listing the child and the blocking and soon asks in full, after
Agent gone from Chats right after Archive, with no warning, before Archive warning scrolled to its FYI asks and workspace note, after

Archiving a Crew seat on its own. The refusal now says where Archive crew is: web or desktop.

Before After
Crew seat archive refusal pointing to the Fleet page, before Crew seat archive refusal naming web or desktop, after

More states after the change:

Captain's warning Seat delete refused Confirmed Settings > Archive
Captain archive warning listing its Crew and seat, after Crew seat delete refusal naming web or desktop, after Agent archived while its child stays in Chats, after Archived agent and clean thread listed in Settings Archive, after

Live testing

Android: pass at 8b9472c848, run by the crew's tester (GPT-6 Astra through Codex) with real Claude Haiku 5.5 agents on an isolated test server. Report: project artifact test-reports/j5code-mobile-wave1b-tester/8b9472c848.md.

  • Row-menu Archive on an agent with six open asks (each intent over 120 characters) and a child. The warning showed every intent in full, ordered blocking, soon, then FYI. Cancel and the Back gesture kept the agent and all six asks. Confirm archived the agent, the six asks left the web Inbox, and the child kept running.
  • A clean agent archived straight away, with no warning.
  • Settings > Archive listed both archived threads, and Unarchive restored each.
  • Archiving or deleting a Crew seat on its own was refused, with the message naming web or desktop.
  • The Captain's warning listed its Crew and seat. Cancel kept both.
  • On 74e28a3860 the tester found the urgency label running into "To"; 8b9472c848 fixes it, and the captures above are from that head.

Not exercised live, and why:

  • Archive by swipe. On a server that can settle, the swipe offers Settle and Snooze; Archive only appears there on older servers. It calls the same archiveThread as the row menu, and useThreadListActions.test.ts covers that a declined warning sends no archive.
  • The sidebar door. It only appears in the wide layout, and also calls archiveThread.
  • Confirming a Captain's archive. Skipped to keep the Crew fixture for iOS.
  • A failed preflight read, and the brief loading wait. These are hard to force on a live server; confirmArchive.test.ts covers that a failed read warns "Couldn't check" rather than archiving silently.
  • iOS. Deferred to Checkpoint 1 on Jackson's iPhone: the Captain paused iOS Simulators for the rest of wave 1 after one boot overloaded the Mac. No iOS UI has been verified.

Upstream impact

  • apps/mobile/src/features/home/useThreadListActions.ts: one import and one call into confirmJ5Archive.
  • apps/mobile/src/App.tsx: one import and <ArchiveWarningHost /> beside <Dialog.Host />.
  • Both are recorded in FORK.md case 21 (text and ledger rows) and in apps/mobile/src/j5/upstreamSeams.test.ts.
  • No change to what upstream's product does beyond the D13 warning Jackson already decided (2026-08-29).

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: confirmArchive.test.ts (clean, warned, declined, seat refused, failed read, not an agent), archiveWarningOrder.test.ts (urgent first), a declined-warning case in useThreadListActions.test.ts; web's 22 archive tests stay green
  • UI changes: Android before/after above; iOS deferred to Checkpoint 1
  • Live testing: Android passed; iOS deferred to Checkpoint 1
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR
  • Upstream product: D13 already covers the warning; the register text now names mobile
  • Surfaces: every mobile archive door shares one executor; web follows the shared flow; delete's seat refusal is covered by the server text; unarchive unchanged; providers and contracts untouched
  • Docs: register D13 rewritten; archive-flow.md and the user docs already describe this behavior

Built by Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

Jacksondr5 and others added 2 commits October 31, 2026 20:08
Mobile archived directly, so an agent's open asks ended and its children were
left without the person seeing either, and a Crew seat's refusal pointed to a
Fleet page mobile lacks.

The web archive preflight (facts read, warning payload, flow) moves to
client-runtime, and mobile's one archive executor calls it after upstream's
working-thread check. The native confirm shows the same measured facts as
text; an agent with nothing to warn about archives at once. A seat's refusal
names web or desktop for Archive crew, on mobile and in the server's message.

Closes #835

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 1, 2026 12:50am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 23 billable files and costs up to $5.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 4 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 51 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 31447c9 and 8b9472c.

Files selected for processing: 23
  • FORK.md
  • apps/mobile/src/App.tsx
  • apps/mobile/src/features/home/useThreadListActions.test.ts
  • apps/mobile/src/features/home/useThreadListActions.ts
  • apps/mobile/src/j5/archive/ArchiveWarningSheet.tsx
  • apps/mobile/src/j5/archive/archiveWarningOrder.test.ts
  • apps/mobile/src/j5/archive/archiveWarningOrder.ts
  • apps/mobile/src/j5/archive/confirmArchive.test.ts
  • apps/mobile/src/j5/archive/confirmArchive.ts
  • apps/mobile/src/j5/upstreamSeams.test.ts
  • apps/server/src/j5/a2a/crewSeatArchiveGuard.ts
  • apps/web/src/j5/a2a/ArchiveWarningContent.tsx
  • apps/web/src/j5/a2a/HumanInboxPage.tsx
  • apps/web/src/j5/a2a/SpawnBrief.tsx
  • apps/web/src/j5/a2a/ThreadA2ARenderer.tsx
  • apps/web/src/j5/a2a/archiveFlow.ts
  • apps/web/src/j5/a2a/archiveFlowClient.ts
  • apps/web/src/j5/fleet/FleetPage.tsx
  • docs/j5/product/upstream.md
  • packages/client-runtime/package.json
  • packages/client-runtime/src/j5/archiveFlow.test.ts
  • packages/client-runtime/src/j5/archiveFlow.ts
  • packages/client-runtime/src/j5/participantIdentity.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 effective changed lines (test files excluded in mixed PRs). labels Nov 1, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Combined panel review (reviewer-opus + reviewer-sol) at 24cfb07

Verdict: one should-fix, nothing else. Not merge-ready until it's resolved, the screenshots are on the PR, and the tester has passed it on a device.

Should-fix: the mobile warning hides open asks and cuts intents short (raised by both of us)

apps/mobile/src/j5/archive/archiveWarningText.ts:66 lists the first 5 asks and then "and N more". :18–23 cuts every intent at 120 characters. Nothing lets the person see the rest before confirming.

Failure scenario: an agent has six open asks, and the sixth is BLOCKING. On mobile the person confirms "Archive anyway" and ends an obligation they never saw. An intent over 120 characters loses the decision it asks for.

That breaks docs/j5/product/features/archive-flow.md AC3 ("lists every open ask with its urgency, direction, counterpart, time open, and verbatim intent").

The constraint behind it is real. Dialog.android.tsx puts the message in Compose's AlertDialog.Text, which cuts off long text instead of scrolling. iOS's Alert does scroll. So removing the cap isn't enough on Android.

Ways to resolve it:

  • (a) Preferred: show the full payload in a scrollable view that J5 owns (a sheet, modal or screen). Keep confirmJ5Archive as the single call from useThreadListActions.ts, so the executor edit doesn't change. If the view needs a mount point, record it as a FORK.md case and a seams-test row.
  • (b) Only as a product deviation the Captain accepts explicitly: keep the cap, but sort asks blocking > soon > fyi > none before cutting, so a hidden ask never outranks a shown one. This reduces the risk but doesn't fix missing facts or full intents. It also doesn't guarantee that a large Crew or placement section fits.

This finding stays open until (a) lands or the Captain accepts (b) in writing.

Checked and fine

  • The move into packages/client-runtime/src/j5/archiveFlow.ts keeps web's old archiveFlow.ts and archiveFlowClient.ts behaviour. Web keeps thin bindings, and its dialog and tests are unchanged.
  • Every mobile archive door (swipe, row menu, sidebar) goes through the one executeAction("archive"). The command palette's "archive" entry only opens Archived threads.
  • The J5 check runs after upstream's working-thread check and before the undo invalidation and mutation. Declining it leaves the thread untouched (tested).
  • Fast path for a clean agent or a non-agent thread: no dialog.
  • A failed read shows "Couldn't check".
  • A Crew seat is refused and the message names web or desktop. The server guard's message does too.
  • Unarchive is unchanged.
  • The preflight reads the thread's own environment: scopeThreadRef(thread.environmentId, …).
  • FORK.md case 21 text, its file-table row and its upstreamSeams.test.ts row are all there. The D13 register text names mobile.

Considered and dropped

  • On Android, a new dialog that replaces this one never calls onCancel, so the promise would stay pending. That's rare (another dialog has to open while this one is up), so we left it out.
  • vi.waitFor in confirmArchive.test.ts: lint passes, and it's an existing mobile test pattern.

Reviewer-run checks

  • mobile: src/j5/archive, useThreadListActions.test.ts, upstreamSeams.test.ts, 68 tests in 4 files, all passed
  • client-runtime: archiveFlow.test.ts, 2 passed
  • web: src/j5/a2a, 45 tests in 7 files, all passed
  • vp lint is clean on the changed files

Still pending: before/after captures (Android and iOS) and the tester's device verdict.

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

…able sheet

Android's alert can't scroll, so the text warning capped asks at five and cut
intents, which could end a blocking ask the person never saw (archive-flow
AC3). The warning is now a J5 sheet mounted beside upstream's Dialog host:
every ask with its whole intent, urgent first, and one destructive confirm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Combined panel re-review (reviewer-opus + reviewer-sol) at 74e28a3

Verdict: the should-fix is resolved, with no new findings. The panel approves the source. Still pending: updated before/after captures (Android and iOS) and the tester's device verdict.

What we checked

  • ArchiveWarningSheet.tsx renders every ask with its full intent. There's no cap, no clipping and no numberOfLines, and the list sits inside a flex-1 ScrollView. Asks are sorted blocking > soon > fyi > none, keeping the server's order within an urgency (archiveWarningOrder.test.ts).
  • Crew seats, the placement subtree, each "couldn't check" line and the workspace note are all still shown.
  • Every way out settles the promise:
    • Confirm and Cancel each resolve it.
    • Android back calls onRequestClose, which cancels.
    • On iOS, a swipe-down on a pageSheet also cancels: React Native 0.88's RCTModalHostViewComponentView sends onRequestClose from presentationControllerDidAttemptToDismiss and presentationControllerDidDismiss.
    • A new request cancels the one already showing. That also fixes the stranded-promise case we had dropped as rare.
  • confirmJ5Archive is still the single seam (confirm: presentArchiveWarning).
  • The host mounts beside Dialog.Host in App.tsx. It's recorded in FORK.md case 21 and the file-table row (now B, 21), and the seams test has an <ArchiveWarningHost /> reach.

Reviewer-run checks

  • mobile src/j5/archive, useThreadListActions.test.ts, upstreamSeams.test.ts: 66 tests in 4 files, all passed (both reviewers)
  • vp lint is clean on src/j5/archive and App.tsx

For the device pass: check that the sheet presents from every archive door on iOS, including the iPad sidebar, and that a long list scrolls with both buttons still visible.

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Panel note (reviewer-opus + reviewer-sol) at 8b9472c

This push only changes spacing: the urgency label and the direction text use mr-2 in place of the row's gap-x-2, which Android didn't apply (the tester's finding). It changes 3 class names in ArchiveWarningSheet.tsx. Our approval of the source at 74e28a3 still stands.

Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.

This branch was successfully deployed

1 active deployment
Preview — 8b9472c8 Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile: J5's archive warning on every archive door

1 participant