Skip to content

Commit 9481d7c

Browse files
authored
Merge branch 'main' into pr/bidi-message-direction
2 parents d8e825a + 8f7da3b commit 9481d7c

234 files changed

Lines changed: 10630 additions & 8075 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/VOUCHED.td‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,39 @@
1010
#
1111
# Keep entries sorted alphabetically.
1212
github:adityavardhansharma
13+
github:bil0000
1314
github:binbandit
1415
github:chrisdeeming
1516
github:chuks-qua
1617
github:cursoragent
18+
github:eggfriedrice24
1719
github:gbarros-dev
1820
github:gfsaaser24
1921
github:github-actions[bot]
22+
github:gsimone
2023
github:hwanseoc
2124
github:jamesx0416
25+
github:jappyjan
2226
github:jasonLaster
2327
github:JoeEverest
28+
github:justsomelegs
29+
github:mackinleysmith
2430
github:maria-rcks
2531
github:nmggithub
2632
github:Noojuno
2733
github:notkainoa
2834
github:PatrickBauer
35+
github:pc-style
36+
github:RakshithBhat03
2937
github:realAhmedRoach
38+
github:Rishet11
3039
github:saphid
40+
github:sethwebster
3141
github:shiroyasha9
42+
github:shivamhwp
3243
github:StiensWout
44+
github:SunkenInTime
45+
github:tarik02
46+
github:UtkarshUsername
3347
github:Yash-Singh1
34-
github:eggfriedrice24
3548
github:Ymit24
36-
github:shivamhwp
37-
github:jappyjan
38-
github:justsomelegs
39-
github:UtkarshUsername
40-
github:SunkenInTime
41-
github:bil0000

‎.github/workflows/ci.yml‎

Lines changed: 161 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ jobs:
3131
cache: true
3232
run-install: true
3333

34-
- name: Setup Rust
35-
uses: dtolnay/rust-toolchain@stable
36-
with:
37-
components: rustfmt
38-
3934
- name: Ensure Electron runtime is installed
4035
run: vp run --filter @t3tools/desktop ensure:electron
4136

@@ -45,9 +40,6 @@ jobs:
4540
- name: Typecheck
4641
run: vpr typecheck
4742

48-
- name: Check resource monitor formatting
49-
run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
50-
5143
- name: Build desktop pipeline
5244
run: vp run build:desktop
5345

@@ -57,6 +49,11 @@ jobs:
5749
grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
5850
grep -n "__clerk_internal_electron_passkeys" apps/desktop/dist-electron/preload.cjs
5951
52+
# Everything except `t3` (apps/server). `--parallel` drops the package
53+
# dependency ordering that `vp run` applies by default: these `test` tasks
54+
# declare no `dependsOn` and resolve workspace deps from source, so ordering
55+
# only bought us idle runners between dependency layers. The concurrency
56+
# limit stays at the default 4 so peak load per runner is unchanged.
6057
test:
6158
name: Test
6259
runs-on: blacksmith-8vcpu-ubuntu-2404
@@ -77,20 +74,65 @@ jobs:
7774
cache: true
7875
run-install: true
7976

80-
- name: Setup Rust
81-
uses: dtolnay/rust-toolchain@stable
82-
8377
- name: Ensure Electron runtime is installed
8478
run: vp run --filter @t3tools/desktop ensure:electron
8579

80+
- name: Test
81+
run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test
82+
83+
# apps/server sets `fileParallelism: false`, so its 239 files run strictly
84+
# one at a time. Sharding spreads them over separate runners instead of
85+
# separate workers, so no two server test files ever share a machine and the
86+
# isolation that flag buys is preserved exactly.
87+
test_server:
88+
name: Test Server ${{ matrix.shard }}
89+
runs-on: blacksmith-8vcpu-ubuntu-2404
90+
timeout-minutes: 10
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
shard: [1, 2, 3]
95+
steps:
96+
- name: Checkout
97+
uses: actions/checkout@v6
98+
with:
99+
sparse-checkout: |
100+
/*
101+
!/.repos/
102+
sparse-checkout-cone-mode: false
103+
104+
- name: Setup Vite+
105+
uses: voidzero-dev/setup-vp@v1
106+
with:
107+
node-version-file: package.json
108+
cache: true
109+
run-install: true
110+
111+
# No Electron setup here: `t3` (apps/server) has no Electron dependency
112+
# and none of its tests touch the runtime. Only the non-server `test`
113+
# job, which covers @t3tools/desktop, needs the download.
86114
- name: Test
87115
env:
88116
T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
89117
T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
90-
run: vp run test
118+
run: vp run --filter t3 test --shard ${{ matrix.shard }}/${{ strategy.job-total }}
91119

92-
- name: Publish transfer budget report
120+
# src/server.test.ts writes the budget report, so exactly one shard
121+
# produces these files. Gating the upload on their presence keeps a
122+
# single `thread-transfer-results` artifact per run, which is the name
123+
# thread-transfer-report.yml resolves.
124+
- name: Detect transfer budget report
125+
id: transfer_budget
93126
if: always()
127+
run: |
128+
if test -f "${{ runner.temp }}/thread-transfer-result.json"; then
129+
echo "present=true" >> "$GITHUB_OUTPUT"
130+
else
131+
echo "present=false" >> "$GITHUB_OUTPUT"
132+
fi
133+
134+
- name: Publish transfer budget report
135+
if: always() && steps.transfer_budget.outputs.present == 'true'
94136
run: |
95137
if test -f "${{ runner.temp }}/t3code-transfer-budget.md"; then
96138
tee -a "$GITHUB_STEP_SUMMARY" < "${{ runner.temp }}/t3code-transfer-budget.md"
@@ -99,19 +141,124 @@ jobs:
99141
fi
100142
101143
- name: Upload thread transfer result
102-
if: always()
144+
if: always() && steps.transfer_budget.outputs.present == 'true'
103145
uses: actions/upload-artifact@v7
104146
with:
105147
name: thread-transfer-results
106148
path: ${{ runner.temp }}/thread-transfer-result.json
107149
if-no-files-found: ignore
108150
retention-days: 30
109151

152+
# Split out of Check and Test: both paid ~7-9s to install a Rust toolchain
153+
# for checks that take under 3s, on the critical path of every PR.
154+
rust:
155+
name: Rust
156+
runs-on: blacksmith-4vcpu-ubuntu-2404
157+
timeout-minutes: 10
158+
steps:
159+
- name: Checkout
160+
uses: actions/checkout@v6
161+
with:
162+
sparse-checkout: |
163+
/*
164+
!/.repos/
165+
sparse-checkout-cone-mode: false
166+
167+
- name: Setup Rust
168+
uses: dtolnay/rust-toolchain@stable
169+
with:
170+
components: rustfmt
171+
172+
- name: Check resource monitor formatting
173+
run: cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
174+
110175
- name: Test resource monitor
111176
run: cargo test --locked --manifest-path native/resource-monitor/Cargo.toml
112177

178+
# The static analysis below needs a macOS runner, which bills ~6.7x a Linux
179+
# minute, so gate it on the native sources it actually lints instead of paying
180+
# for it on every push. Detection is API-only (no checkout) and fails open: if
181+
# the diff cannot be resolved, the lint runs.
182+
mobile_native_changes:
183+
name: Mobile Native Changes
184+
runs-on: blacksmith-2vcpu-ubuntu-2404
185+
timeout-minutes: 5
186+
permissions:
187+
contents: read
188+
pull-requests: read
189+
outputs:
190+
changed: ${{ steps.detect.outputs.changed }}
191+
steps:
192+
- name: Detect mobile native changes
193+
id: detect
194+
env:
195+
GH_TOKEN: ${{ github.token }}
196+
PR_NUMBER: ${{ github.event.pull_request.number }}
197+
BEFORE_SHA: ${{ github.event.before }}
198+
run: |
199+
set -uo pipefail
200+
201+
fail_open() {
202+
echo "$* Running native static analysis."
203+
echo "changed=true" >> "$GITHUB_OUTPUT"
204+
exit 0
205+
}
206+
207+
count_rows() {
208+
printf '%s\n' "$1" | grep -c . || true
209+
}
210+
211+
# One row per changed file, holding the new path and, for a rename,
212+
# the path it replaced: renaming a matched file out of the matched
213+
# paths removes a lint input just like editing it.
214+
row='[.filename, (.previous_filename // empty)] | @tsv'
215+
216+
if [[ -n "${PR_NUMBER}" ]]; then
217+
# The PR files endpoint stops at 3000 files and pagination cannot
218+
# extend it, so cross-check against the count the PR itself reports.
219+
expected=$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}" --jq '.changed_files') \
220+
|| fail_open "Could not read the pull request."
221+
rows=$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" --paginate --jq ".[] | ${row}") \
222+
|| fail_open "Could not resolve changed files."
223+
224+
listed=$(count_rows "$rows")
225+
if [[ "$listed" -lt "$expected" ]]; then
226+
fail_open "GitHub listed only ${listed} of ${expected} changed files."
227+
fi
228+
else
229+
rows=$(gh api "repos/${GITHUB_REPOSITORY}/compare/${BEFORE_SHA}...${GITHUB_SHA}" --jq ".files[]? | ${row}") \
230+
|| fail_open "Could not resolve changed files."
231+
232+
# The compare endpoint reports at most 300 files and pagination does
233+
# not extend that list, so a full list may be hiding native changes.
234+
listed=$(count_rows "$rows")
235+
if [[ "$listed" -ge 300 ]]; then
236+
fail_open "GitHub listed ${listed} changed files, the compare endpoint maximum."
237+
fi
238+
fi
239+
240+
paths=$(tr '\t' '\n' <<< "$rows")
241+
242+
# Sources scripts/mobile-native-static-check.ts lints, plus the tool
243+
# and rule configuration that decides how it lints them, plus the
244+
# root package.json that defines the lint:mobile command.
245+
pattern='^apps/mobile/.*\.(swift|kt|kts)$|^apps/mobile/(\.swiftlint\.yml|detekt\.yml|\.editorconfig|Brewfile)$|^scripts/mobile-native-static-check\.ts$|^package\.json$|^\.github/workflows/ci\.yml$'
246+
247+
if grep -qE "$pattern" <<< "$paths"; then
248+
echo "Native sources or lint configuration changed:"
249+
grep -E "$pattern" <<< "$paths"
250+
echo "changed=true" >> "$GITHUB_OUTPUT"
251+
else
252+
echo "No mobile native sources or lint configuration changed."
253+
echo "changed=false" >> "$GITHUB_OUTPUT"
254+
fi
255+
113256
mobile_native_static_analysis:
114257
name: Mobile Native Static Analysis
258+
needs: mobile_native_changes
259+
# Skip only on an explicit "no": a gate job that failed or errored leaves the
260+
# output empty, and that must run the lint rather than silently skip it.
261+
if: ${{ !cancelled() && needs.mobile_native_changes.outputs.changed != 'false' }}
115262
runs-on: blacksmith-6vcpu-macos-26
116263
timeout-minutes: 10
117264
steps:

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ __screenshots__/
2525
squashfs-root/
2626
.vercel
2727
.gstack/
28+
.plans/
2829
dist-electron/
2930
.electron-runtime/
3031
.showcase/

‎.macroscope/check-run-agents/effect-service-conventions.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Review changed TypeScript and directly affected call sites for the conventions b
6868
- Export direct schema predicates such as `export const isFoo = Schema.is(Foo)`. Flag a private `Schema.is` constant wrapped by a redundant function with the same signature.
6969
- Do not introduce a large `switch` or lookup table in an error's `message` getter to model failures that deserve separate error classes.
7070
- Catch statically known tagged failures with `Effect.catchTags({ ... })`, including when handling only one tag. Do not use `catchIf` with a schema predicate merely to recover one or more known `_tag` variants, and do not use `catchTag`. `Effect.catch` is appropriate when the entire error channel is intentionally handled; `catchIf` remains appropriate for genuinely structural predicates such as inspecting an underlying platform error code.
71+
- For startup reconciliation that repairs multiple independent entities, preserve interruption rather than reducing it to a warning. Retry a transient per-entity repair before readiness, then isolate a persistent failure so one bad entity cannot abort global startup or prevent later entities from being repaired. Require tests for both the retry-success path and persistent-failure continuation.
7172
- Do not add a helper whose only behavior is `(...args) => new SomeError({ ...args })`, including curried aliases used once with `mapError`. Construct the error at the failure boundary so its attributes and cause remain visible. Keep a mapper only when it performs real normalization, passes through existing domain errors, or adds reusable context/control flow.
7273
- When a reusable error-to-error translation clearly belongs to the target error type, prefer a descriptive static factory on that error class over a detached production-side switch. Do not force a static method for one-off inline mappings.
7374

‎.plans/01-shared-model-normalization.md‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎.plans/02-typed-ipc-boundaries.md‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)