pi-remote-control/docs/NEXT-STEPS.md

6.1 KiB

Next Steps — Resume Pointer

Last updated: 2026-05-16. Where we are: Phase 2 mostly done. T-2.0..T-2.6, T-2.8, T-2.9, T-2.11 on main. App runs end-to-end on iPhone 12 mini + simulator. XCUI test target wired with 8/8 passing tests. Where we go next: T-2.7 PreConnectPool, T-2.10 Background lifecycle, T-2.12 TestFlight, T-2.13 MVP smoke. Plus: fix 8 pre-existing unit-test failures (4 Keychain entitlements + 4 Pairing http-scheme).

This document is the "where did I leave off" anchor. Read this first when resuming work. The rest of docs/ is reference.


State at end of session

Item Status
Phase 0 — Stream Spike done. Verdict GREEN with caveat (pipe-pane unreliable). Branch feat/spike-stream kept.
Phase 0.5 — Control-Mode Spike done. Verdict: Path B — tmux control mode.
Phase 1 plan updated to Path B.
Interface Contracts (IC-1..IC-4) frozen 2026-05-15.
Phase 1 implementation done 2026-05-15. All T-1.0..T-1.10 on main. Smoke 12/12.
Phase 1 — follow-up fixes POST /pair smoke test, WS keys/key/paste handler, POST /sessions response shape.
Phase 2 iOS — T-2.0 scaffold done.
Phase 2 iOS — T-2.1..T-2.5, T-2.9 core done. WebSocket, Pairing, Terminal, ModifierBar, SessionConnection, APNs.
Phase 2 iOS — T-2.6 SessionSwitcher done 2026-05-16. SessionRegistry + SessionSwitcher + SessionRow.
Phase 2 iOS — T-2.7 PreConnectPool not started.
Phase 2 iOS — T-2.8 StatusBar done 2026-05-16. State indicator, action buttons.
Phase 2 iOS — T-2.10 Background lifecycle not started. Scaffolding exists in AppState (appWillForeground/appDidBackground).
Phase 2 iOS — T-2.11 Face-ID + Settings done 2026-05-16. SettingsView, FaceIDGate, LockView.
Phase 2 iOS — T-2.12 TestFlight not started. Needs Apple credentials.
Phase 2 iOS — T-2.13 MVP smoke not started.
Phase 2 iOS — XCUITest infrastructure (bonus) done 2026-05-16. piRemoteUITests target, 8/8 tests, --uitest mode, accessibility IDs, idb workflow documented in docs/SIMULATOR-AUTOMATION.md (iOS repo).
Bug Backlog ⚠️ 8 pre-existing unit-test failures (4 Keychain -34018 entitlements + 4 Pairing http-scheme tests). Not regressions, undocumented.

Branches on remote git.vpsj.de/jay/pi-remote-control:

  • main — all Phase 1 + follow-up fixes (latest: POST /sessions shape).
  • feat/spike-stream — Phase 0 PoC, throwaway.
  • feat/spike-tmux-cc — Phase 0.5 PoC, throwaway. Reference impl for T-1.1.

Branches on remote git.vpsj.de/jay/pi-remote-ios:

  • main — T-2.0..T-2.6, T-2.8, T-2.9, T-2.11 + UI test target + idb docs.
  • legacy feat/p2-t2.* branches kept for history; all already on main via merge commits.

Open work (in priority order)

Phase 2 remaining

  • T-2.10 Background lifecycle. App-foreground triggers reconnect + delta pull, stale-frame freezes during sync, keep-alive ping in foreground only. Partial scaffolding exists in AppState (appWillForeground / appDidBackground are used by Face-ID gate). Touches: Sources/Core/Sessions/SessionConnection.swift, Sources/App/AppState.swift.
  • T-2.7 PreConnectPool. Hot WS per known session + cached last frame; switching shows the cached frame instantly with a "syncing…" pill. Touches: Sources/Core/Sessions/PreConnectPool.swift (new), Sources/Core/Sessions/SessionConnection.swift. Conflict risk with T-2.10 — sequence them.
  • T-2.12 TestFlight pipeline. Build / archive / upload scripts + internal testers list. Verify production APNs path. Needs Apple Developer credentials (paid program). Touches: docs/DISTRIBUTION.md, scripts/ or Fastfile.
  • T-2.13 MVP smoke. Manual on-device checklist: pair → render → input → backgrounded → push → reopen <1s → session-switch. Documents in docs/PHASE-2-report.md (iOS repo).

Bug backlog (not regressions, pre-existing)

  • Keychain unit tests fail with -34018 errSecMissingEntitlement (4 cases). Likely needs Keychain-Access-Group in the test target's entitlements, or running under signed bundle. Investigate or skip with a documented reason.
  • Pairing unit tests testParseQR_{http,https,wrongScheme}_throws fail (4 cases). Either the parser silently accepts http/https now (regression hidden by the fp optional change) or the tests need updating to match the new lenient behaviour.

Phase 3 — not yet in scope

Slash palette, voice, themes, search, etc. See docs/PHASE-3-ios-augmentation.md.


Reading order for resumption

  1. docs/NEXT-STEPS.md (this file)
  2. docs/SYNC.md — current claims, gate, contracts
  3. docs/PHASE-2-ios-mvp.md — what's left to build for iOS
  4. iOS repo: docs/SIMULATOR-AUTOMATION.md — how to drive the sim
  5. iOS repo: docs/BUILD.md — build + install + launch commands
  6. Spec only if you forget the why: docs/reference/SPEC-ios-app.md

Conventions established

  • Async subagent dispatch. All worker tasks via subagent({ async: true, context: "fresh" }). Worktree isolation for parallel-on-same-repo work; same-repo iOS+sidecar splits are inherently isolated.
  • Reviewer fan-in. After parallel implementation, dispatch one reviewer agent with all branch summaries pre-loaded; reviewer writes review.md for the orchestrator to apply.
  • Sim test infra (--uitest mode). Pre-fetch a fresh /pair-qr token per test, launch with --reset-state --pair-with-url <url>. MainTerminalView in --uitest mode skips the WS so XCUITest can reach app-idle within the 120 s window. Pasteboard prompt suppressed via xcrun simctl privacy grant pasteboard de.vpsj.pi-remote.
  • Sidecar manual restart pattern. tmux kill-session -t pi-sidecar; tmux new-session -d -s pi-sidecar -x 220 -y 50 "pi -nt -ne -ns -np -nc --no-session --offline -e extensions/remote-control --remote-control". Pre-fill 3 sessions (main, work, logs) for any manual E2E test.
  • Don't expand scope. Stick to v3 spec; new ideas go into a v4 review round, not into open PRs.