Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/mobile-parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ memory, 6 advanced configuration.
| P16 | Session settings: permission mode including YOLO, model, native command, token usage and account limits. `index.html` `#session-settings`, `controls.js`. | native · 2 | `partial` - the new-conversation and session permission pickers show the runtime modes the paired host allows (#130). **Usage** shows the open conversation’s available token, context and account-limit data (#190). The model picker selects available options through the host for the current conversation (#204). **Session details** shows the exact session’s reported runtime, model, route, permissions, and available usage details (#282). |
| P17 | Thread actions: rename, fork, archive, find in transcript, expand details. `index.html` `#thread-actions`, `app.js`. | native · 2 | `partial` - **Actions** in a conversation shows the host’s rename, fork and archive options with any reason the host cannot perform them (#115). **Find in conversation** searches the loaded transcript and can request earlier pages (#208). **Session details** shows the active conversation’s reported settings and usage (#282). |
| P18 | Review changed files and the selected turn's diff. `app.js` `#review-pane`, `#review-content`, `fileChanges()`. | native · 2 | `present`. A signed transcript patch expands inline or opens in read-only turn review. Both show bounded monospace pages and scroll long lines horizontally (#223). **Copy patch page** copies the visible page and preserves split fragments (#197). Turn review can select and copy one line (#283). Physical touch verification remains open. |
| P19 | Session alerts with per-event preferences and tap-through to the thread: approvals, questions, finished turns, goals, failures. `settings.js` `notificationPreferences()`, `app.js` `registerNotifications()`, `sw.js` `push` and `notificationclick`. | native · 2 | `partial`. iPhone and opt-in Android Firebase builds support approval alert enrollment and a signed lookup on the selected host when tapped (#143, #147, #194, #206). Alert preferences are stored per pairing (#210). The host and relay can send an optional opaque pairing hint (#231, #233). Both clients bind taps to saved pairings (#236) and can open another saved host that has approval alerts enabled after a fresh signed lookup (#239). A tap opens the exact pending approval or question when several requests share one conversation (#288). The hosted APNs worker also supports finished, failed, and goal alerts using saved device preferences. Those alerts open OX Mobile (#308). The host supports a signed lookup of a recipient’s session alert (#317). The APNs worker currently includes a lookup reference only for approvals and questions, so tapping a finished, failed or goal alert opens the app. Verify delivery and cold tap-through on physical devices. See N1–N2 and G6. |
| P19 | Session alerts with per-event preferences and tap-through to the thread: approvals, questions, finished turns, goals, failures. `settings.js` `notificationPreferences()`, `app.js` `registerNotifications()`, `sw.js` `push` and `notificationclick`. | native · 2 | `partial`. iPhone and opt-in Android Firebase builds support approval alert enrollment and a signed lookup on the selected host when tapped (#143, #147, #194, #206). Alert preferences are stored per pairing (#210). The host and relay can send an optional opaque pairing hint (#231, #233). Both clients bind taps to saved pairings (#236) and can open another saved host that has approval alerts enabled after a fresh signed lookup (#239). A tap opens the exact pending approval or question when several requests share one conversation (#288). The hosted APNs worker also supports finished, failed, and goal alerts using saved device preferences. Those alerts open OX Mobile (#308). A finished, failed, or goal alert can open its conversation on iPhone when the host sends a routable reference. The phone uses the signed lookup from #317 and checks the exact route and thread before opening it. Older alerts open OX Mobile. Verify delivery and cold tap-through on physical devices. See N1–N2 and G6. |
| P20 | This phone's appearance and input: theme, text size, Enter key, motion. `settings.js` `behaviorForm(true)`. | native · 2 | `partial`. System, Light and Dark appearance and text size settings are available before pairing and in Host settings. **System** text size uses Android's current font scaling (#234). The iPhone composer keeps UIKit Dynamic Type. The Hardware Enter key choice sets new line or send and is saved on this phone (#203). Arcade respects iPhone Reduce Motion (#253) and Android Remove animations (#270). |

### 3. Terminal
Expand Down Expand Up @@ -136,7 +136,7 @@ and release evidence and the checks still open.
| G3 Camera QR scanning | iPhone QR (#101) linked with xtool on Linux and passed the iOS 27 simulator launch check. The Android camera implementation (#124) scanned a synthetic invitation in the Android 15 emulator and returned to the pairing form. Physical camera permission, rotation, and live pairing remain open. |
| G4 A real iPhone: install, live host, end-to-end headless setup | The iOS 27 simulator verifies launch and Keychain access. A crash report for TestFlight 1689.1 identified a stack overflow in Settings. GPUI's `stacker` feature now moves deep layout, prepaint and paint onto heap stack segments, so nesting depth no longer depends on the 1,008 KiB main-thread stack. OX Mobile guarantees each protected call 2 MiB, about 1,100 levels of Taffy layout, because Taffy lays out a whole subtree inside one call. The simulator runs every screen at 512 KiB, half the device stack, and a 1,000-level `--stack-stress` tree must draw. Without `stacker` that tree crashed at 256 KiB and at 512 KiB while every real screen passed. Retest the current pilot build on the affected iPhone. End-to-end setup from a physical iPhone against a headless host remains open. [Crash and first fix](https://github.com/oxstack/ox/pull/299) · [stacker and the 2x margin test](https://github.com/oxstack/ox/pull/339) · [Main simulator run](https://github.com/oxstack/ox/actions/runs/46467580066/job/142049971553) |
| G5 A real Android device: keyboard, camera, notifications, distribution | The API 36 emulator exercised keyboard typing and dismissal. A fixture-signed ARM64 release passed signature and 16 KiB alignment checks. An opt-in Firebase ARM64 package passed unsigned release checks (#235). The 1766 ARM64 APK from main contains the native conversation reader and composer and passes 16 KiB alignment. Its protected signing job was skipped. Signed installation and notification delivery on a physical Android device remain open. [1766 APK](https://github.com/oxstack/ox/actions/runs/46467580066/artifacts/15405837149) · [Signing job](https://github.com/oxstack/ox/actions/runs/46467580066/job/142056614579) |
| G6 Approval push and tap-through | The self-operated relay passed tests and the non-root OCI runtime check. The hosted APNs pilot worker deployed from main and received Apple's `BadDeviceToken` response for a synthetic routing token. A notification tap can open the exact paired approval after a fresh signed lookup (#206). Verify production enrollment, delivery, and cold-start tap-through on physical iPhone and Android devices. Include expired and resolved approvals and an offline host. The hosted worker covers APNs. FCM still needs a pilot deployment and signed Android app. [OCI runtime check](https://github.com/oxstack/ox/actions/runs/46228148582) · [APNs deployment from main](https://github.com/oxstack/ox/actions/runs/46477859747/job/142056911055) |
| G6 Approval push and tap-through | The self-operated relay passed tests and the non-root OCI runtime check. The hosted APNs pilot worker deployed from main and received Apple's `BadDeviceToken` response for a synthetic routing token. A notification tap can open the exact paired approval after a fresh signed lookup (#206). On 2026-12-03, a tester reported that tapping alerts consistently opened OX Mobile correctly during regular iPhone use. Verify production enrollment, delivery, and cold-start tap-through on physical iPhone and Android devices. Include expired and resolved approvals and an offline host. The hosted worker covers APNs. FCM still needs a pilot deployment and signed Android app. [OCI runtime check](https://github.com/oxstack/ox/actions/runs/46228148582) · [APNs deployment from main](https://github.com/oxstack/ox/actions/runs/46477859747/job/142056911055) |
| G7 Live Activity and biometric gate | The opt-in Live Activity preview follows the selected conversation and passed [iOS 27 simulator verification](https://github.com/oxstack/ox/actions/runs/46238610742). The [unsigned arm64 iPhone archive](https://github.com/oxstack/ox/actions/runs/46256378866/job/141325812265) contains the device widget. Verify signed installation, session status, and Face ID or passcode on a physical iPhone. |
| G8 Accessibility and input on both platforms | The UIKit editor passed simulator launch and input-layout checks (#100). An iOS 27 simulator cold launch rendered the native offline approval alert with the banner behind it. On a 320 × 640 API 36 emulator at 200% text, TalkBack focused the native pairing entry and the Firebase approval notices. Android 1698 exposed no focusable transcript, editor, or Send control in the conversation. In the same emulator, the native conversation prototype exposed its launcher, role-labeled messages, a multiline Message field and Send above the keyboard. Reading caused no signed host action. Each explicit Send produced one signed action on the selected thread for text, a photo, or both. A delayed rejection restored the draft. Test the full workflow on physical devices, including VoiceOver, TalkBack speech and gestures, iPhone Dynamic Type, dictation, selection, and hardware-keyboard behavior. [iOS approval check](https://github.com/oxstack/ox/actions/runs/46424825658/job/141869120260) · [Android pairing](https://github.com/oxstack/ox/pull/297) · [Android approval notices](https://github.com/oxstack/ox/pull/298) · [Android transcript](https://github.com/oxstack/ox/pull/302) · [Android composer](https://github.com/oxstack/ox/pull/303) |
| G9 A phone-only setup | ChatGPT and Claude Code sign-in, one custom provider with a static model, provider API-key entry, and paired-device management are available in the app. Run the end-to-end setup from a physical phone against a headless host. |
Expand Down
14 changes: 12 additions & 2 deletions mobile-push-worker/src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const NOTIFICATION_TITLE = COPY.approval.title;
export const NOTIFICATION_BODY = COPY.approval.body;
/** These wait for an answer in the paired app; a tap looks the request up. */
const ASKS = new Set(['approval', 'question']);
const SESSION_ALERTS = new Set(['finished', 'goal_reached', 'failed']);
// Older hosts use unmarked event references for APNs collapse only.
const SESSION_REF_PREFIX = 's1_';

const APNS_ORIGIN = 'https://api.push.apple.com';
const MAX_BODY_BYTES = 4096;
Expand Down Expand Up @@ -133,15 +136,22 @@ export async function handle(request, env, deps = {}) {
}

/**
* The alert copy is fixed. An ask carries its opaque reference, which the
* phone uses to look the request up; the other kinds only open the app.
* The alert copy is fixed. An ask carries its opaque request reference.
* A marked session reference can be looked up by the paired phone.
*/
export function buildApnsPayload(eventRef, pairingHint, kind = 'approval') {
const { title, body } = COPY[kind];
const sessionRef = SESSION_ALERTS.has(kind) && eventRef.startsWith(SESSION_REF_PREFIX)
? eventRef.slice(SESSION_REF_PREFIX.length)
: '';
const routedSession = typeof pairingHint === 'string'
&& BASE64URL_32.test(pairingHint)
&& BASE64URL_32.test(sessionRef);
return {
aps: { alert: { title, body } },
ox: {
...(ASKS.has(kind) ? { approval_ref: eventRef } : {}),
...(routedSession ? { session_ref: sessionRef } : {}),
...(kind === 'approval' ? {} : { kind }),
...(pairingHint === undefined ? {} : { pairing_hint: pairingHint }),
},
Expand Down
52 changes: 51 additions & 1 deletion mobile-push-worker/test/worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const KEY_PEM = privateKey.export({ type: 'pkcs8', format: 'pem' });
const NOW = 1_800_000_000_000;
const TOKEN = 'ab'.repeat(32);
const EVENT_REF = 'A'.repeat(43);
const MARKED_REF = `s1_${EVENT_REF}`;
const HINT = 'AotRyyBJqaA9SJpj5QmKEth9c6Q0fAgK1whvlSmTBmQ';

function fakeKv() {
Expand Down Expand Up @@ -185,9 +186,11 @@ test('malformed input never reaches the provider', async () => {
alert({ routingToken: 'AB'.repeat(32) }),
alert({ routingToken: `${TOKEN}/../x` }),
alert({ eventRef: 'short' }),
alert({ kind: 'failed', eventRef: `${MARKED_REF}=`, pairingHint: HINT }),
alert({ expiresAt: '1' }),
alert({ expiresAt: NOW + 11 * 60_000 }),
alert({ pairingHint: 'x' }),
alert({ kind: 'finished', eventRef: MARKED_REF, pairingHint: `${HINT.slice(0, -1)}R` }),
alert({ kind: 'toString' }),
alert({ kind: 'Your account is locked' }),
alert({ kind: 5 }),
Expand Down Expand Up @@ -247,7 +250,7 @@ test('a body with no declared length is cut off at the limit', async () => {
assert.equal(provider.calls.length, 0);
});

test('each kind has its own fixed copy and only an ask carries a reference', async () => {
test('each kind has fixed copy and legacy session alerts open the app generically', async () => {
for (const kind of Object.keys(COPY)) {
const provider = apns();
const result = await run(post(alert({ kind, pairingHint: HINT })), env(), provider);
Expand All @@ -267,6 +270,53 @@ test('each kind has its own fixed copy and only an ask carries a reference', asy
}
});

test('each session alert forwards its canonical marked reference when paired', async () => {
for (const kind of ['finished', 'goal_reached', 'failed']) {
const provider = apns();
const result = await run(post(alert({ kind, pairingHint: HINT, eventRef: MARKED_REF })), env(), provider);
assert.equal(result.body.status, 'delivered', kind);
const { init } = provider.calls[0];
assert.equal(init.headers['apns-collapse-id'], MARKED_REF, kind);
assert.deepEqual(JSON.parse(init.body), {
aps: { alert: COPY[kind] },
ox: { kind, pairing_hint: HINT, session_ref: EVENT_REF },
}, kind);
}
});

test('unpaired, unknown-version and malformed session references stay generic', async () => {
const cases = [
{ eventRef: MARKED_REF },
{ eventRef: `s2_${EVENT_REF}`, pairingHint: HINT },
{ eventRef: MARKED_REF.slice(0, -1), pairingHint: HINT },
{ eventRef: `${MARKED_REF}A`, pairingHint: HINT },
// This last character has the same decoded bytes as A but sets unused bits.
{ eventRef: `${MARKED_REF.slice(0, -1)}B`, pairingHint: HINT },
];
for (const testCase of cases) {
const provider = apns();
const result = await run(post(alert({ kind: 'finished', ...testCase })), env(), provider);
assert.equal(result.body.status, 'delivered', testCase.eventRef);
assert.deepEqual(JSON.parse(provider.calls[0].init.body).ox, {
kind: 'finished',
...(testCase.pairingHint ? { pairing_hint: HINT } : {}),
}, testCase.eventRef);
}
});

test('a session marker does not change approval or question envelopes', async () => {
for (const kind of ['approval', 'question']) {
const provider = apns();
const result = await run(post(alert({ kind, pairingHint: HINT, eventRef: MARKED_REF })), env(), provider);
assert.equal(result.body.status, 'delivered', kind);
assert.deepEqual(JSON.parse(provider.calls[0].init.body).ox, {
approval_ref: MARKED_REF,
...(kind === 'approval' ? {} : { kind }),
pairing_hint: HINT,
}, kind);
}
});

test('requests that overlap on a cold start share one provider token', async () => {
const provider = apns();
const environment = env();
Expand Down