Recipes

Port 938 upstream t3code commits into the Supaterm fork with per-commit triage and parallel worktrees

Discovered from README cross-links · yesterday

Software & DevOps

Reviewed and ported 938 upstream commits into a fork, keeping fork features

What they did

Supaterm had drifted 938 commits behind upstream t3code (v0.1.3 through v0.1.5 and nightlies up to 32ecd71726) after an earlier port attempt was reverted. The maintainer requested a full port and approved scope after reviewing a 938-row inventory and 39 decision items, then said "do what u think make sense" for open items and ran the work as /full-stop. Every upstream commit was reviewed against the fork before any code changed and classified Bring, Adapt, Skip or Decide. Commits were cherry-picked in upstream order from a renamed copy of upstream (t3 to Supaterm, upstream "Settled" to the fork's "Done"), so conflicts only appeared where the fork really diverged, and each conflict was resolved toward fork behavior. Ported commits keep their upstream author and carry an `Upstream: <sha>` trailer; fork-only fixes and adaptations are separate `fix:`/`refactor:` commits, and current main was merged in at the end. Result: 733 commits ported, 203 skipped with evidence, 2 ported in part. A second round re-examined every skipped and partial row so nothing was left behind, running in parallel worktrees merged back: upstream's 18k-line dead-code deletion sliced across server/packages, web/desktop and mobile plus a cross-slice knip sweep; a single command dispatcher replacing the fork's appCommandBus; mobile per-route new-task flow state, shared media leases with close-on-blur, search reopening after back, and app-link pipe parsing; Android centered and book-mode sheets; release guards so desktop builds that cannot open no longer publish and the Windows CLI build retries and verifies its Node.js download; and deletion of fork-only inert code left over since the outbox change. Fork features stayed intact: pinned messages, next-prompt suggestions, split panes, voice input, Central Icons, and removal of T3 Connect and idle auto-compaction. Verification ran `node scripts/check-changed.ts origin/main` over the merged branch (format, lint, both knip passes, typecheck of all 36 packages, tests beside changes, React Compiler coverage), with sweeps every 40 to 80 ported commits, each regression bisected to its commit and fixed at the cause. Android debug (arm64) and iOS simulator Debug builds succeeded, and a web dev server ran against isolated state exercising the stash shortcut, Cmd+K, Cmd+B, Cmd+Shift+O, thread find, a Replay showcase turn through an approval, and Settings with no server errors.

How it went

733 commits ported, 203 skipped with evidence, 2 partial; full CI green on round-2 heads, Android and iOS native builds succeed, and a web dev-server pass exercised shortcuts, thread find, an approval flow and Settings with no logged errors. Cross-provider reviews found no defects in round 2's bug pass, and quality findings were fixed, one with a test that fails on the old code. Manual device passes on Android and iOS, the first nightly's desktop launch check, and a real-client look at Force stop, the resizable file explorer, chip colors and F6 navigation remain.

Worth knowing

The per-row decisions and adaptation notes live in a ledger kept outside the repository, so the triage rationale is not reproducible from the repo alone. New database migrations (002_ThreadMessageSearch, an FTS index about three times message text size, and 003_ActiveTurnItemIndexes) ship with the port, and native dependencies changed (react-native-screens repacked as supacode.48, enriched-markdown as supacode.19, expo-sharing built from source on Android, new keyboard-controller, expo-audio and expo-video patches, plus a highlighter module), so a new native client is required. Behavior changes include pairing links no longer attaching new addresses unless the machine answered on a saved route, GitHub tokens only sent to configured hosts, and Escape closing thread find before a thread selection. Release caches across runs, the external-PR mobile preview workflow, and remaining raw key listeners were deliberately left out, and queue drag reordering stays removed by decision.

Wiring

The port ran inside the Supaterm fork with Claude Opus 5.5 in the Claude Code harness, using subagents per commit range and parallel git worktrees for the second round, merged back into one branch. Upstream was added as a renamed copy (t3 to Supaterm, "Settled" to "Done") so cherry-picks applied cleanly except at real divergence points. Reviews ran through Codex with GPT-6.1 Sol at xhigh effort, covering bugs, security and code quality for both rounds. Verification used the repo's own `node scripts/check-changed.ts origin/main` gate (format, lint, two knip passes, typecheck of 36 packages, adjacent tests, React Compiler coverage), plus Android debug and iOS simulator builds and a web dev server against isolated state. The maintainer approved scope from a 938-row inventory and 39 decision items, and the work ran as /full-stop.

Try it yourself

Port the upstream commits my fork is missing, using a triage-first workflow.

1. Find the last upstream commit my fork actually synced to (check merge history and any reverted port PRs), then list every upstream commit after it up to upstream main HEAD.
2. Before changing any code, review each upstream commit against the fork and classify it Bring, Adapt, Skip or Decide, with a one-line reason. Write the ledger to a file in the repo (not outside it) so the decisions are reviewable.
3. Cherry-pick in upstream order from a renamed copy of upstream (apply the fork's rename mapping first) so conflicts only appear where the fork really diverged. Resolve every conflict toward the fork's behavior. Keep upstream authorship and add an `Upstream: <sha>` trailer; put fork-only fixes in separate `fix:`/`refactor:` commits.
4. Preserve the fork's own features explicitly. List them up front and check each one after the port.
5. Do a second pass over every Skip and partial row to confirm nothing real was left behind, running independent slices in parallel worktrees and merging back.
6. After every 40 to 80 ported commits, run the repo's changed-files check (format, lint, knip, typecheck of all packages, tests beside changes). Bisect any regression to its commit and fix the cause, not the symptom.
7. Build native targets (Android debug and iOS simulator Debug) and run a dev server against isolated state to exercise the main shortcuts, search, an approval flow and settings; confirm the server logs no errors.
8. Get an independent review pass for bugs, security and code quality, fix the findings, and add a test that fails on the old code for any behavioral fix.
9. Report what still needs manual device checks and list the behavior changes users will notice (migrations, native dependency bumps, auth and link handling).

Source

Tools in this stack