|
| 1 | +--- |
| 2 | +name: review-t3-upstream |
| 3 | +description: Review T3 Code upstream changes for selective adoption into Pylon. Use when the user asks what changed upstream, whether Pylon should sync or update, which T3 commits or pull requests are worth adopting, how the forks differ, or asks to integrate selected upstream work. Fetch the protected upstream remote, consult the durable review ledger, group and assess candidate changes, wait for an explicit user decision, and then selectively port approved work with Pylon-first conflict resolution. |
| 4 | +--- |
| 5 | + |
| 6 | +# Review T3 Upstream |
| 7 | + |
| 8 | +Treat upstream review as a product decision workflow, not a synchronization command. Explain what changed and help the user choose before changing Pylon. |
| 9 | + |
| 10 | +## Preserve the fork invariants |
| 11 | + |
| 12 | +Read `AGENTS.md`, `.agents/upstream-review.md`, and [references/decision-framework.md](references/decision-framework.md) before reviewing candidates. |
| 13 | + |
| 14 | +- Keep `origin` pointed at the private `rynfar/pylon` repository and `pylon` as its product branch. |
| 15 | +- Keep `t3code-upstream` and `t3code-fork` fetch-only. Never push to them or re-enable their push URLs. |
| 16 | +- Never hard-reset Pylon, replace it with upstream, or merge all of upstream by default. |
| 17 | +- Preserve visible Pylon identity and Pylon-specific product behavior. Compatibility identifiers may remain T3-named until deliberately migrated. |
| 18 | +- Separate review from integration. Do not edit code, create an integration branch, cherry-pick, merge, commit, or push until the user explicitly selects change sets. |
| 19 | + |
| 20 | +## Phase 1: Preflight the repository |
| 21 | + |
| 22 | +Run from the Pylon repository root: |
| 23 | + |
| 24 | +```bash |
| 25 | +git status --short --branch |
| 26 | +git remote -v |
| 27 | +git branch --show-current |
| 28 | +git rev-parse --verify pylon |
| 29 | +``` |
| 30 | + |
| 31 | +Confirm: |
| 32 | + |
| 33 | +- `origin` fetches and pushes `rynfar/pylon`; |
| 34 | +- `t3code-upstream` fetches `pingdotgg/t3code` and has a disabled push URL; |
| 35 | +- `.agents/upstream-review.md` contains a `reviewed-through` commit; |
| 36 | +- the current checkout belongs to Pylon. |
| 37 | + |
| 38 | +A dirty tree does not block read-only review, but it blocks integration. Never stash, discard, or commit unrelated work to make the tree clean. |
| 39 | + |
| 40 | +If a required remote or ledger is missing, stop and explain the exact repair. Do not silently rewrite source-control configuration. |
| 41 | + |
| 42 | +## Phase 2: Refresh and bound the review |
| 43 | + |
| 44 | +Fetch only the official upstream tracking branch: |
| 45 | + |
| 46 | +```bash |
| 47 | +git fetch --prune t3code-upstream main |
| 48 | +``` |
| 49 | + |
| 50 | +Read the ledger cursor as `<cursor>`, then verify it is still in upstream history: |
| 51 | + |
| 52 | +```bash |
| 53 | +git merge-base --is-ancestor <cursor> t3code-upstream/main |
| 54 | +``` |
| 55 | + |
| 56 | +If that check fails, stop. Report that upstream history or the ledger diverged and investigate before choosing a new cursor. |
| 57 | + |
| 58 | +Collect candidates in chronological order and detect patch-equivalent work already present in Pylon: |
| 59 | + |
| 60 | +```bash |
| 61 | +git log --reverse --date=short --format='%H%x09%ad%x09%s' <cursor>..t3code-upstream/main |
| 62 | +git cherry -v pylon t3code-upstream/main <cursor> |
| 63 | +``` |
| 64 | + |
| 65 | +Record the exact upstream head used for the report. Never describe a moving branch without its commit SHA. |
| 66 | + |
| 67 | +## Phase 3: Understand the changes |
| 68 | + |
| 69 | +Group commits into coherent change sets before presenting them. A pull request, a dependency chain, or several commits implementing one behavior should normally be one decision. |
| 70 | + |
| 71 | +For every candidate change set: |
| 72 | + |
| 73 | +1. Inspect the complete commit diff and file list with `git show --stat --summary <sha>` and `git show <sha>`. |
| 74 | +2. When a title references a pull request, inspect its description and relevant review context with `gh pr view <number> --repo pingdotgg/t3code` when available. |
| 75 | +3. Trace dependencies on earlier or later upstream commits. Do not recommend a commit alone when it requires a series. |
| 76 | +4. Compare touched paths with Pylon's changes since the fork base. Identify semantic conflicts, not only textual conflicts. |
| 77 | +5. Evaluate every applicable client, provider, contract, connection mode, migration, generated file, and document. |
| 78 | +6. Classify the change using the decision framework and give a concrete Pylon recommendation. |
| 79 | + |
| 80 | +Do not infer value from a commit title alone. Read the implementation and tests. |
| 81 | + |
| 82 | +## Phase 4: Present a decision brief |
| 83 | + |
| 84 | +Lead with a compact summary: |
| 85 | + |
| 86 | +- upstream head and review range; |
| 87 | +- number of commits and coherent change sets; |
| 88 | +- patch-equivalent or already-adopted work; |
| 89 | +- highest-value recommendations; |
| 90 | +- areas likely to conflict with Pylon. |
| 91 | + |
| 92 | +For each change set, report: |
| 93 | + |
| 94 | +- stable candidate ID, upstream SHA, and pull request; |
| 95 | +- what changed in plain language; |
| 96 | +- why Pylon would or would not benefit; |
| 97 | +- recommendation: **adopt now**, **consider**, **defer**, or **skip**; |
| 98 | +- affected surfaces and providers; |
| 99 | +- dependency chain; |
| 100 | +- conflict risk and expected integration shape: clean cherry-pick, cherry-pick with adaptation, or manual port; |
| 101 | +- validation required. |
| 102 | + |
| 103 | +End with an explicit decision request keyed by candidate ID. Do not integrate while the user's selection is ambiguous. |
| 104 | + |
| 105 | +## Phase 5: Lock completed review decisions |
| 106 | + |
| 107 | +After the user decides every candidate through the reported upstream head, prepare one ledger batch and the new `reviewed-through` value. Do not modify the ledger yet when an approved integration still needs a clean branch setup. |
| 108 | + |
| 109 | +Record each change set as adopted, skipped, or deferred with its upstream SHA or PR, rationale, and eventual Pylon branch or commit when known. Deferred work remains visible in the ledger even though the cursor advances. |
| 110 | + |
| 111 | +Do not advance the cursor when: |
| 112 | + |
| 113 | +- the user has not decided every candidate; |
| 114 | +- the report covered only a filtered subset; |
| 115 | +- upstream history validation failed; |
| 116 | +- the session ended before decisions were confirmed. |
| 117 | + |
| 118 | +If the user selects no integration, update the ledger as the only intended source change and offer a scoped commit and push. If the user selects work to integrate, create the integration branch first, then update the ledger on that branch after the integration outcome is known. |
| 119 | + |
| 120 | +## Phase 6: Integrate only approved change sets |
| 121 | + |
| 122 | +Before modifying the ledger or source, require a clean worktree, then refresh the private product branch without rewriting history: |
| 123 | + |
| 124 | +```bash |
| 125 | +git fetch origin pylon |
| 126 | +git switch pylon |
| 127 | +git pull --ff-only origin pylon |
| 128 | +git switch -c upstream/<yyyy-mm-dd>-<topic> |
| 129 | +``` |
| 130 | + |
| 131 | +Choose the smallest faithful integration method: |
| 132 | + |
| 133 | +- Use `git cherry-pick -x <sha>` in oldest-first order for coherent commits that fit Pylon. |
| 134 | +- Cherry-pick a complete dependency series when the selected behavior depends on it. |
| 135 | +- Manually port only the approved behavior when upstream structure, branding, migrations, or product direction conflict. Cite the upstream PR and SHA in the commit body. |
| 136 | +- Never resolve conflicts by taking all of `theirs`. Read both sides and preserve Pylon's intent. |
| 137 | +- If the integration proves materially broader than the approved change set, stop and return to the user with the new scope. |
| 138 | + |
| 139 | +Use `pylon-branding` for asset or visible-name conflicts and `effect-server` for Effect, orchestration, provider, contract, or persistence changes. Treat migration number collisions, generated route trees, lockfiles, mobile native projects, and compatibility identifiers as explicit reconciliation work. |
| 140 | + |
| 141 | +Run the smallest relevant tests, lint, formatting, typechecks, asset checks, and real-client verification required by `AGENTS.md`. Do not claim upstream tests prove the adapted Pylon behavior. |
| 142 | + |
| 143 | +Show the integrated diff, validation results, and remaining risks. Do not merge into `pylon`, push, or open a pull request unless the user explicitly requests that publishing step. |
| 144 | + |
| 145 | +## Finish with traceability |
| 146 | + |
| 147 | +When the integration outcome becomes known, append the prepared batch to `.agents/upstream-review.md` on the integration branch and advance the cursor to the reviewed upstream head. If integration is abandoned, record the decisions separately without claiming an adopted Pylon commit. |
| 148 | + |
| 149 | +Keep the review ledger and final handoff aligned. Report: |
| 150 | + |
| 151 | +- upstream PRs and SHAs reviewed; |
| 152 | +- user decisions; |
| 153 | +- Pylon branch and commits created; |
| 154 | +- adaptations made for Pylon; |
| 155 | +- checks run and unresolved risks; |
| 156 | +- whether anything remains deferred. |
0 commit comments