Skip to content

Commit 357de0b

Browse files
radroidclaude
authored andcommitted
fix(t3x): apply the sync test-timeout to every gate, not just fork CI (#32)
Follow-up to a393ff0, from an independent review of it. Three real defects, two of them regressions that commit introduced. 1. The timeout override never reached the pipeline that needs it most. a393ff0 fixed only t3x-ci.yml. The daily sync runs its own verify via scripts/t3x/sync-upstream.sh (`$RUN $script`, plain `vp run test`), and the resolver prompt tells the agent to run plain `vp run test` too. So the next upstream delta would rebase cleanly, fail verify on the exact test that was just diagnosed, and escalate as `verify-failed` — reopening issue #29's class of failure through a different door. Threaded through all three. 2. `--testTimeout=60000` silently HALVED apps/server's budget. apps/server/vite.config.ts pins testTimeout: 120_000, with a comment saying its sqlite+git+orchestration tests "can exceed the default budget on loaded CI hosts". The flag applies to every package, so 60s cut the heaviest suite in half — the same failure class the override exists to prevent. Now 120000, the highest value any package configures, so it lowers nothing: web 15s -> 120s, root 60s -> 120s, server 120s -> 120s. The old comment claiming it "only stops apps/web's override" was simply false. 3. Both SEAMS.md churn commands always returned 0. Git's approxidate silently ignores a relative suffix on an absolute date, so `--since="<iso> -60 days"` means `--since="<iso>"` — an empty window. The previous wrong-but-working command was replaced with two non-working ones, and since the doc says "if the ledger and this document disagree, the ledger is right", a literal regeneration would have zeroed every churn and risk figure. Now uses `--since="@<epoch>"` arithmetic, with the trap documented and a self-check value (ChatView should return ~59, not 0). Also corrects SEAMS.md against the tree a393ff0 actually created: merge-base b64ae88 (not 887dd6e), totals +1468/-112, claude.md row +78/-31. That commit edited a seam file without updating its own row, so a new rule says to update the row and totals in the same commit — the ledger measures the tree a commit creates, not the one it started from. Finally, records in the runbook that an upstream sync is the sanctioned exception to AGENTS.md's "do not run repo-wide checks" — a rebase can break any package, so the full suite is the point. Every file changed here is fork-owned, so the ledger totals above stay accurate. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
1 parent 9a4424e commit 357de0b

5 files changed

Lines changed: 45 additions & 16 deletions

File tree

‎.github/workflows/t3x-ci.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ jobs:
5555
# Proven upstream-inherited, not a fork regression: branch `t3x/ci-control-upstream` — pristine
5656
# upstream/main plus this workflow file and nothing else — fails identically (run 30386125253).
5757
#
58-
# 60s is not arbitrary: it is what the ROOT vite.config.ts already uses. This only stops
59-
# apps/web's tighter local override from being applied on slower hardware than it assumes.
58+
# 120000 is deliberate: it is the HIGHEST value any package configures
59+
# (apps/server/vite.config.ts pins 120s for sqlite+git+orchestration integration tests). The
60+
# flag applies to every package, so a lower value would silently CUT apps/server's budget in
61+
# half — the same failure class this override exists to prevent. At 120s no package is
62+
# lowered: web 15s -> 120s, root 60s -> 120s, server 120s -> 120s.
6063
# The job's own `timeout-minutes` remains the backstop against a genuinely hung test.
64+
# Keep in sync with the `test` case in `scripts/t3x/sync-upstream.sh`.
6165
- name: Test
6266
if: ${{ !cancelled() }}
63-
run: vp run test --testTimeout=60000
67+
run: vp run test --testTimeout=120000

‎.github/workflows/t3x-sync-resolve.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ jobs:
114114
where they did NOT textually conflict, and adjust the fork's patches if upstream
115115
changed the semantics of an API the fork hooks into. If a fork patch became
116116
empty (upstream absorbed it), drop it and note that.
117-
4. Verify: run `vp run typecheck`, `vp run lint`, then `vp run test`. Fix the fork's
118-
patches until all three pass.
117+
4. Verify: run `vp run typecheck`, `vp run lint`, then
118+
`vp run test --testTimeout=120000`. The --testTimeout flag is required: apps/web
119+
pins 15s, which is too tight for this fork's 2-core runners, and 120s matches the
120+
fork's CI gate without lowering any package's own budget. Note the flag must NOT
121+
come after a `--` separator or it is silently ignored. Fix the fork's patches until
122+
all three pass.
119123
5. Push the branch: `git push -u origin HEAD`.
120124
6. Open a PR into `main` with `gh pr create`, title "t3x: resolve upstream sync
121125
(run ${{ github.run_id }})". In the body summarise: the upstream range merged,

‎docs/t3x/SEAMS.md‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
**The authoritative list of every upstream-owned file this fork edits.**
44

5-
Measured, not asserted: **34 upstream-owned files, +1466 / -112 lines**, against merge-base
6-
`887dd6e45` (the 2026-07-28 upstream sync). Everything else the fork adds lives in new files upstream
5+
Measured, not asserted: **34 upstream-owned files, +1468 / -112 lines**, against merge-base
6+
`b64ae880e` (the 2026-07-28 upstream sync). Everything else the fork adds lives in new files upstream
77
has never seen and cannot conflict.
88

99
The churn and risk columns are still measured against the _previous_ merge-base `89c5a192f`, because
@@ -21,6 +21,11 @@ recurring rebase conflict in a file this doc said the fork did not touch) went u
2121
>
2222
> **Tripwire:** the surface is already far past "a handful of rows". Before adding row 35, re-isolate
2323
> something instead. Prefer fork-owned files even when an in-place edit is smaller.
24+
>
25+
> **Self-reference:** if your change edits a file that already has a row here, update that row and
26+
> the header totals **in the same commit**. This ledger measures the tree the commit creates, not the
27+
> tree it started from — a commit that edits `docs/providers/claude.md` and leaves the row alone
28+
> makes this document wrong the moment it lands. That has already happened once.
2429
2530
## Reading the risk column
2631

@@ -67,7 +72,7 @@ Sorted by risk, worst first.
6772
| `apps/mobile/src/native/T3ComposerEditor.native.tsx` | +3 | 1 | **3** | Plumbs `onComposerSubmit` |
6873
| `apps/mobile/src/components/AppSymbol.tsx` | +2 | 1 | **2** | `return:` icon entry |
6974
| `apps/mobile/…/T3ComposerEditorModule.kt` | +1 | 1 | **1** | Event-name list entry |
70-
| `docs/providers/claude.md` | +76/-31 | ~0 | **~0** | Fixes the broken multi-account recipe. Near-frozen upstream (last touched 2026-04-29) — **the one row worth upstreaming**, which would remove it |
75+
| `docs/providers/claude.md` | +78/-31 | ~0 | **~0** | Fixes the broken multi-account recipe. Near-frozen upstream (last touched 2026-04-29) — **the one row worth upstreaming**, which would remove it |
7176

7277
**Per surface:** `apps/web` 8 · `apps/mobile` 7 · `apps/desktop` 7 · `apps/server` 5 ·
7378
`packages/**` 5 · `docs/` 1 · repo root 1.
@@ -123,12 +128,15 @@ That prints exactly the upstream-owned files the fork edits. Churn for any one o
123128
the merge-base date, **not** to today, so the number is reproducible after the fact:
124129

125130
```bash
126-
SINCE=$(git show -s --format=%cI "$MB")
127-
git log --oneline --since="$SINCE" --until="$SINCE" --before="$SINCE" "$MB" -- <path> | wc -l
128-
# simpler and equivalent: the 60 days of upstream history ending at the merge-base
129-
git log --oneline "$MB" --since="$(git show -s --format=%cI "$MB") -60 days" -- <path> | wc -l
131+
MBTS=$(git show -s --format=%ct "$MB") # merge-base commit time, epoch seconds
132+
git log --oneline --since="@$((MBTS - 60 * 86400))" "$MB" -- <path> | wc -l
130133
```
131134

135+
The `@<epoch>` form is load-bearing. Git's approxidate parser **silently ignores** a relative suffix
136+
on an absolute date, so `--since="<iso-date> -60 days"` is treated as `--since="<iso-date>"` — an
137+
empty window that returns 0 for every file. Verify the command is working before trusting it:
138+
`apps/web/src/components/ChatView.tsx` should return a number in the 50s, not 0.
139+
132140
**Re-run both after every upstream sync and update this file — including the merge-base hash in the
133141
header.** Every churn and risk figure shifts once the newly absorbed commits fall inside the window,
134142
so a ledger quoting an old merge-base is stale even when its file list is still right. If the

‎docs/t3x/sync-agent-runbook.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,14 @@ This is the checklist the workflow prompt mirrors — follow it if you resolve l
106106
still behaves.
107107
4. If a patch commit went **empty/dropped**, upstream absorbed it — confirm the behaviour now
108108
exists upstream, drop the patch, and note it.
109-
5. Verify: `vp run typecheck && vp run lint && vp run test`. Fix the fork's patches to match
110-
upstream's new internals until green.
109+
5. Verify: `vp run typecheck && vp run lint && vp run test --testTimeout=120000`. Fix the fork's
110+
patches to match upstream's new internals until green.
111+
112+
Two notes. **`AGENTS.md` says "do not run repo-wide checks" — an upstream sync is the sanctioned
113+
exception.** A rebase can break any package, so the full suite is the point; that rule is about
114+
routine feature work. And the `--testTimeout` flag is required (see the section above); it must
115+
not follow a `--` separator or it is silently ignored.
116+
111117
6. **When green:** push the branch and open a PR into `main` (`gh pr create`). A human reviews
112118
and **lands it — see [Landing a sync PR](#landing-a-sync-pr-do-not-use-the-github-merge-button);
113119
the GitHub merge button does not work on a rebased branch.** The recovery tag

‎scripts/t3x/sync-upstream.sh‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,17 @@ if [[ "$SKIP_VERIFY" == 1 ]]; then
128128
exit 0
129129
fi
130130

131+
# Per-script extra args, so the daily verify matches the fork's CI gate exactly. `test` needs
132+
# --testTimeout because apps/web pins 15s (tuned for upstream's blacksmith runners) and this fork
133+
# runs on 2-core ubuntu-latest, where an upstream CPU-bound test reliably blows it. 120s is the
134+
# highest any package configures (apps/server), so it never LOWERS a package's own budget.
135+
# Keep in sync with `.github/workflows/t3x-ci.yml`.
131136
for script in $VERIFY; do
132-
echo "→ verify: $RUN $script"
137+
EXTRA=""
138+
if [[ "$script" == "test" ]]; then EXTRA="--testTimeout=120000"; fi
139+
echo "→ verify: $RUN $script $EXTRA"
133140
# shellcheck disable=SC2086
134-
if ! $RUN "$script"; then
141+
if ! $RUN "$script" $EXTRA; then
135142
FAILING_STEP="$script"
136143
fail "verification step '$script' failed"
137144
write_status daily verify-failed "rebase clean but '$script' failed"

0 commit comments

Comments
 (0)