|
| 1 | +# Premote Staging Procedure |
| 2 | + |
| 3 | +Use this procedure to promote T3 Code `staging` to `main` for Jordan's local fleet. |
| 4 | + |
| 5 | +## Lanes |
| 6 | + |
| 7 | +- `original`: `/home/jgigg/code/t3code/.worktrees/original`, branch `original`, tracks `upstream/main`. |
| 8 | +- `nightly`: `/home/jgigg/code/t3code/.worktrees/nightly`, branch `nightly`, latest upstream plus replayed local topics. |
| 9 | +- `staging`: `/home/jgigg/code/t3code/.worktrees/staging`, branch `staging`, final verification lane. |
| 10 | +- `main`: `/home/jgigg/code/t3code`, branch `main`, live day-to-day lane. |
| 11 | +- Mac launcher checkout: `/Users/giggabit-mac/code/projects/t3code`, branch `main` after promotion. |
| 12 | + |
| 13 | +## Workflow |
| 14 | + |
| 15 | +1. Confirm the user explicitly wants staging promoted and accepts downtime for T3 Code Main. |
| 16 | +2. Audit: |
| 17 | + - `fleet-doctor` |
| 18 | + - remote `git status --short --branch` for all durable lanes |
| 19 | + - `git worktree list --porcelain` |
| 20 | + - running `t3code-dev-main`, `dev-runner`, Electron, and Vite+ processes |
| 21 | +3. Verify staging under Node `24.13.1`: |
| 22 | + - `mise x node@24.13.1 -- bash -lc './node_modules/.bin/vp check'` |
| 23 | + - `mise x node@24.13.1 -- bash -lc './node_modules/.bin/vp run typecheck'` |
| 24 | + - `mise x node@24.13.1 -- bash -lc './node_modules/.bin/vp run lint:mobile'` |
| 25 | + - `mise x node@24.13.1 -- bash -lc 'pnpm run topic-plugins:check'` |
| 26 | +4. Save backups: |
| 27 | + - dirty Mac patch or stash |
| 28 | + - dirty Linux temporary-worktree patches |
| 29 | + - `refs/backup/premote-staging/<timestamp>/{main,staging,original,nightly,origin-main,origin-staging,upstream-main}` where refs exist |
| 30 | +5. Stop T3 Code Main before mutating `/home/jgigg/code/t3code`. |
| 31 | +6. Promote locally: |
| 32 | + - `cd /home/jgigg/code/t3code` |
| 33 | + - `git reset --hard staging` |
| 34 | +7. Push safely: |
| 35 | + - create `origin/backup/premote-staging-<timestamp>-origin-main` |
| 36 | + - create `origin/backup/premote-staging-<timestamp>-origin-staging` |
| 37 | + - `git push --force-with-lease=main:<old-origin-main-sha> origin main:main` |
| 38 | + - `git push --force-with-lease=staging:<old-origin-staging-sha> origin staging:staging` |
| 39 | + - push `nightly` only after the durable nightly worktree exists and is clean |
| 40 | +8. Ensure durable Linux worktrees exist: |
| 41 | + - Reset `original` to `upstream/main` after backup. |
| 42 | + - Create or update `.worktrees/nightly` on branch `nightly`. If no newer replay candidate exists, it may temporarily match `staging`. |
| 43 | + - Keep `.worktrees/staging` on branch `staging`. |
| 44 | + - Keep `/home/jgigg/code/t3code` on branch `main`. |
| 45 | +9. Restart T3 Code Main with `~/.local/bin/t3code-dev-main`. |
| 46 | +10. Verify: |
| 47 | + - `git -C /home/jgigg/code/t3code rev-parse HEAD` |
| 48 | + - `curl -fsS https://giggabit-server.tailfb378a.ts.net/main/` |
| 49 | + - process list shows the launcher running from `/home/jgigg/code/t3code` |
| 50 | +11. Update Mac: |
| 51 | + - fetch origin |
| 52 | + - switch to `main` |
| 53 | + - reset to `origin/main` |
| 54 | + - reapply only intentional saved edits |
| 55 | +12. Local cleanup: |
| 56 | + - Remove temporary Linux worktrees after backup. |
| 57 | + - Delete extra local branches only when their commits are reachable from durable branches or backup refs. |
| 58 | + - Leave remote branch cleanup for a separate explicit pass. |
0 commit comments