Skip to content

Commit 4525d2e

Browse files
committed
Merge remote-tracking branch 'github/main' into takeover-22654
2 parents 2d55610 + 9b1d351 commit 4525d2e

4,677 files changed

Lines changed: 470763 additions & 147207 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.

‎.agents/skills/test-t3-app/SKILL.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ Test with meaningful project and thread data. Read
2121
[references/sqlite-fixtures.md](references/sqlite-fixtures.md) only when
2222
inspecting or seeding SQLite. Stop the test server before direct fixture writes.
2323

24+
## Drive agent turns for free
25+
26+
Do not spend a paid model to see a turn render. `vp run dev` registers the
27+
`Replay (dev)` provider, which replays recorded turns with simulated streaming
28+
through the real adapter and orchestration. Its models are scenarios:
29+
`showcase` covers thinking, a plan, tool calls, an approval, and markdown.
30+
Press `Ctrl+Alt+Shift+R` for a picker (GNOME takes that key for screen
31+
recording), call `window.t3dev.replay("showcase")`
32+
with `preview_evaluate`, or run
33+
`node apps/server/src/bin.ts thread start --base-dir .t3 --provider devReplay --model showcase <project> "go"`.
34+
When the test needs real provider behavior, use that provider's cheapest
35+
model, such as Haiku for Claude or Luna for Codex.
36+
2437
## Use the Browser panel
2538

2639
Call `preview_status`, then `preview_open` if the Browser panel is

‎.agents/skills/test-t3-mobile/SKILL.md‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,21 @@ when inspecting or seeding SQLite. Stop the test server before fixture writes.
3131
From the checkout being tested on the selected device host, run:
3232

3333
```bash
34-
node scripts/mobile-native-client.ts ensure <ios|android> <device-id>
34+
vp run mobile:install <ios|android> <device-id>
3535
```
3636

37-
This reuses a matching native client or builds and installs one. Authorized
38-
mobile verification includes that build step unless the user prohibits it.
37+
This installs the dev client for the checkout's native fingerprint: from the
38+
device, the local cache, or the shared cache in seconds, building once only
39+
when no machine has that fingerprint yet (5-15 minutes, logged to the file it
40+
names). The device id may be omitted when exactly one device is booted. It
41+
prints one JSON line; on failure it names the next command. Mobile verification
42+
includes that step unless the user prohibits it.
43+
44+
For a device you opened in an agent-device session elsewhere (a device pool,
45+
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`
46+
from the directory you opened the session in. It installs the cached build into
47+
that session (`--abi arm64-v8a` for an ARM Android device; `--metro <url>` also
48+
opens it against Metro) and never builds.
3949

4050
Start `vp run dev:client` from `apps/mobile`, or reuse a healthy Metro belonging
4151
to this checkout. Open its printed development-client URL with AgentDevice

‎.coderabbit.config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@ export default defineConfig((ctx) => ({
2626
path: "apps/web/src/**/*.{tsx,css}",
2727
instructions: "Hold changed code to the rules in docs/internals/web-ui.md.",
2828
},
29+
{
30+
path: "**/*.test.*",
31+
instructions:
32+
"Hold changed tests to the rules in docs/internals/testing.md. Request tests only as those rules allow.",
33+
},
2934
],
3035
},
3136
knowledge_base: {
3237
code_guidelines: {
3338
filePatterns: [
3439
{ files: "docs/internals/effect-services.md", applyTo: "{apps,packages,infra}/**/*.ts" },
3540
{ files: "docs/internals/web-ui.md", applyTo: "apps/web/src/**/*.{tsx,css}" },
41+
{ files: "docs/internals/testing.md", applyTo: "{apps,packages,infra}/**/*.{ts,tsx}" },
3642
],
3743
},
3844
},

‎.devcontainer/devcontainer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 24, Rust stable)
1+
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 26, Rust stable)
22
// and the canonical setup in docs/operations/development.md: global `vp`, `vp i`.
33
// Contributor doc: docs/internals/devcontainer.md
44
{
@@ -8,7 +8,7 @@
88
// nodeGypDependencies (default true) brings python3/make/g++, which Linux
99
// needs for node-pty's node-gyp fallback (its prebuilds are mac/win only).
1010
"ghcr.io/devcontainers/features/node:2": {
11-
"version": "24"
11+
"version": "26"
1212
},
1313
// native/resource-monitor (edition 2024, needs stable >= 1.85). The server
1414
// degrades gracefully without the binary, but CI checks cargo fmt + test.

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ github:myacoub91
5959
github:naMqe-h
6060
github:nateEc
6161
github:naveed949
62+
github:nexxeln
6263
github:nmggithub
6364
github:Noojuno
6465
github:notkainoa
Lines changed: 116 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,153 @@
11
name: Setup CI dependencies
22
description: Install Vite+ and the workspace dependencies from cache.
3+
inputs:
4+
task-cache-read-token:
5+
description: Read-only credential for the private maintainer task cache
6+
required: false
7+
default: ""
8+
install:
9+
description: Set to "false" to set up Vite+ only, with no pnpm store or install
10+
required: false
11+
default: "true"
12+
install-args:
13+
description: Arguments for `vp install`, such as filters. Empty installs the whole workspace.
14+
required: false
15+
default: ""
316
runs:
417
using: composite
518
steps:
6-
# setup-vp reuses an installed exact version, so restoring its home skips the
7-
# installer download on every job.
19+
# ~/.vite-plus holds vp, the Node.js runtime, and pnpm. A cache entry never
20+
# updates, so the key names all three versions; otherwise a pnpm or Node.js
21+
# bump makes every job download them from npm again.
822
- name: Resolve Vite+ version
923
id: vp
1024
shell: bash
1125
run: |
1226
echo "version=$(sed -nE 's/^ vite-plus: ([0-9][^ ]*)$/\1/p' pnpm-workspace.yaml)" >> "$GITHUB_OUTPUT"
27+
echo "node=$(jq -r '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
28+
echo "pnpm=$(jq -r '.packageManager' package.json)" >> "$GITHUB_OUTPUT"
1329
30+
# Pinned because release-desktop.yml signs builds with this action in the job.
1431
- name: Cache Vite+
32+
id: vp_cache
1533
if: steps.vp.outputs.version != ''
16-
uses: actions/cache@v6
34+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
1735
with:
1836
path: ~/.vite-plus
19-
key: vite-plus-home-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}
37+
key: vite-plus-home-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}-node${{ steps.vp.outputs.node }}-${{ steps.vp.outputs.pnpm }}
2038

39+
# setup-vp always runs the installer, which fetches vp from npm even when
40+
# this exact version is installed. A cache hit already has everything, so
41+
# skip setup-vp and do its remaining work here. This keeps npm outages from
42+
# failing jobs.
43+
- name: Use cached Vite+
44+
if: steps.vp_cache.outputs.cache-hit == 'true'
45+
shell: bash
46+
run: |
47+
echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"
48+
"$HOME/.vite-plus/bin/vp" env use "${{ steps.vp.outputs.node }}"
49+
50+
# vp gives each Node.js download attempt 10 minutes by default, so one
51+
# stalled stream holds the job that long. It retries 3 times and resumes
52+
# partial bytes, so a shorter limit costs a slow download only a retry.
2153
- name: Setup Vite+
22-
uses: voidzero-dev/setup-vp@v1
54+
if: steps.vp_cache.outputs.cache-hit != 'true'
55+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
56+
env:
57+
VP_DOWNLOAD_TIMEOUT: "120"
2358
with:
2459
node-version-file: package.json
2560
cache: false
2661
run-install: false
2762

28-
- name: Resolve pnpm store path
63+
# A shared key lets whichever install saves first, often a small filtered
64+
# one, become every job's store. Each set of install args gets its own.
65+
- name: Resolve pnpm store
2966
id: pnpm_store
67+
if: inputs.install == 'true'
3068
shell: bash
69+
env:
70+
INSTALL_ARGS: ${{ inputs.install-args }}
3171
run: |
32-
store_path="$(vp pm cache dir)"
33-
echo "path=$store_path" >> "$GITHUB_OUTPUT"
72+
echo "path=$(vp pm cache dir)" >> "$GITHUB_OUTPUT"
73+
metadata_dir="${pnpm_config_cache_dir:-$RUNNER_TEMP/pnpm-metadata}"
74+
echo "pnpm_config_cache_dir=$metadata_dir" >> "$GITHUB_ENV"
75+
echo "verified=$metadata_dir/lockfile-verified.jsonl" >> "$GITHUB_OUTPUT"
76+
if [[ -z "$INSTALL_ARGS" ]]; then
77+
echo "namespace=full" >> "$GITHUB_OUTPUT"
78+
else
79+
echo "namespace=filtered-$(printf '%s' "$INSTALL_ARGS" | cksum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
80+
fi
3481
35-
# setup-vp's shared cache key ignores install filters. Keep full installs in a
36-
# separate namespace, including fallback restores.
82+
# Filtered installs prefer the current full store, which holds every package,
83+
# over an older store of their own.
3784
# The pnpm store stays a cache tarball on the runner's own disk. A store on a
3885
# Blacksmith sticky disk mounts in under a second, but pnpm then copies every
3986
# package across filesystems instead of hard-linking it: install took 28-49s
4087
# against 9s plus an 11s restore.
41-
- name: Cache full pnpm store
42-
uses: actions/cache@v6
88+
- name: Restore pnpm store
89+
id: pnpm_cache
90+
if: inputs.install == 'true'
91+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
4392
with:
4493
path: ${{ steps.pnpm_store.outputs.path }}
45-
key: pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
94+
key: pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
4695
restore-keys: |
96+
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
97+
pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-
4798
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-
4899
100+
# pnpm accepts an earlier pass for the same lockfile and policy at any age, so
101+
# a cached record skips fetching registry metadata for every package.
102+
- name: Restore lockfile verification
103+
id: pnpm_verified
104+
if: inputs.install == 'true'
105+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
106+
with:
107+
path: ${{ steps.pnpm_store.outputs.verified }}
108+
key: pnpm-verified-v1-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
109+
49110
- name: Install dependencies
111+
if: inputs.install == 'true'
50112
shell: bash
51-
run: vp install
113+
env:
114+
INSTALL_ARGS: ${{ inputs.install-args }}
115+
# Unquoted so each filter is its own argument.
116+
run: vp install $INSTALL_ARGS
117+
118+
- name: Save lockfile verification
119+
if: inputs.install == 'true' && steps.pnpm_verified.outputs.cache-hit != 'true'
120+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
121+
with:
122+
path: ${{ steps.pnpm_store.outputs.verified }}
123+
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
124+
125+
# A filtered install that started from the current full store adds nothing
126+
# worth a second copy of it.
127+
- name: Save pnpm store
128+
if: >-
129+
inputs.install == 'true' &&
130+
steps.pnpm_cache.outputs.cache-hit != 'true' &&
131+
(steps.pnpm_store.outputs.namespace == 'full' ||
132+
steps.pnpm_cache.outputs.cache-matched-key != format('pnpm-full-v1-{0}-{1}-{2}', runner.os, runner.arch, hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json')))
133+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
134+
with:
135+
path: ${{ steps.pnpm_store.outputs.path }}
136+
key: ${{ steps.pnpm_cache.outputs.cache-primary-key }}
137+
138+
- name: Enable shared task cache
139+
if: >-
140+
github.repository == 'pingdotgg/t3code' &&
141+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
142+
hashFiles('.task-cache.json') != '' &&
143+
inputs.task-cache-read-token != ''
144+
shell: bash
145+
env:
146+
T3_TASK_CACHE_READ_TOKEN: ${{ inputs.task-cache-read-token }}
147+
run: |
148+
node infra/task-cache/scripts/install-ci.ts
149+
if [[ ( "$GITHUB_EVENT_NAME" == pull_request && "$GITHUB_BASE_REF" == main ) || ( "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/main ) ]]; then
150+
echo 'VP_REMOTE_CACHE=read-write' >> "$GITHUB_ENV"
151+
else
152+
echo 'VP_REMOTE_CACHE=read' >> "$GITHUB_ENV"
153+
fi

‎.github/scripts/ci-changes.cjs‎

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
1-
// Decides which CI jobs a change needs. Prints `key=value` lines for
2-
// $GITHUB_OUTPUT; a job runs unless its key is "false".
3-
//
4-
// node ci-changes.cjs --paths <file> gate by the listed paths
5-
// node ci-changes.cjs --paths <file> --full run every Linux job, gate only the macOS lint
6-
// node ci-changes.cjs changed paths unknown: run everything
7-
//
8-
// Every changed path maps to workspace packages, which then pull in their
9-
// dependents from package.json. A path this file does not recognize runs
10-
// everything, so a new root file or directory can only cost minutes.
1+
// Unknown paths run every job; recognized packages pull in their dependents.
2+
// scripts/check-changed.ts shares these decisions so local checks match CI.
113
const fs = require("node:fs");
124
const path = require("node:path");
135

146
const root = path.resolve(__dirname, "../..");
157

16-
// Never read by a build, typecheck, or test. Lint still formats them.
178
const INERT = [
189
/^docs\//,
1910
/^\.(agents|cursor|vscode|devcontainer|macroscope|repos)\//,
2011
/^[^/]+\.md$/,
2112
/^LICENSE$/,
2213
];
2314

24-
// Run everything: the root vite.config.ts loads the first as setup for every
25-
// package's tests, and the vendored mobile tarballs are installed dependencies.
15+
// Shared test setup and vendored mobile dependencies affect every package.
2616
const RUNS_EVERYTHING = [
2717
/^packages\/shared\/src\/(HostProcess|testing\/longTempDir)\.ts$/,
2818
/^apps\/mobile\/deps\//,
2919
];
3020

31-
// Paths outside a package, or files inside one that other packages read
32-
// through relative imports rather than a package.json dependency.
21+
// Includes cross-package reads absent from package.json dependencies.
3322
const EXTRA_OWNERS = [
3423
// Vite configs and tsconfigs of these apps import scripts/lib directly.
3524
[/^scripts\/lib\//, ["@t3tools/desktop", "@t3tools/mobile", "@t3tools/web", "t3"]],
@@ -41,10 +30,10 @@ const EXTRA_OWNERS = [
4130
];
4231
const RUST = /^native\/(resource-monitor|kde-snap-shot|hyprland-snap-shot)\//;
4332

44-
// Tests that read another package's files without declaring it. The scripts
45-
// tests read app manifests, assets, and sources (cursor-sdk-packaging,
46-
// third-party-licenses, brand-assets, build-desktop-artifact).
33+
// These tests read other packages without declaring dependencies.
4734
const TEST_ONLY_DEPS = {
35+
// Evals import the server's source to test its real model-facing text.
36+
"@t3tools/evals": ["t3"],
4837
"@t3tools/provider-pi": ["@t3tools/client-runtime"],
4938
"@t3tools/scripts": [
5039
"@t3tools/desktop",
@@ -54,17 +43,12 @@ const TEST_ONLY_DEPS = {
5443
"@t3tools/provider-cursor",
5544
],
5645
};
57-
// Declared dependencies that only feed a build step: the server bundles the
58-
// built web app (apps/server/vite.config.ts) but never imports it.
46+
// The server bundles the web build without importing it.
5947
const BUILD_ONLY_DEPS = { t3: ["@t3tools/web"] };
6048

61-
// Sources scripts/mobile-native-static-check.ts lints, plus the tool and rule
62-
// configuration that decides how it lints them, plus the root package.json
63-
// that defines the lint:mobile command.
6449
const MOBILE_NATIVE =
6550
/^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$|^\.github\/scripts\/ci-changes\.cjs$|^\.github\/actions\/ci-changes\//;
6651

67-
// Jobs that test every package except these, which have jobs of their own.
6852
const OWN_TEST_JOB = new Set(["t3", "@t3tools/web", "@t3tools/monorepo"]);
6953

7054
function readWorkspace() {
@@ -106,8 +90,7 @@ function readWorkspace() {
10690
return packages;
10791
}
10892

109-
// Returns the packages a path touches, [] for an inert path, or null when the
110-
// path is not understood and everything must run.
93+
// [] means inert; null means unknown and requires every job.
11194
function ownersOf(file, packages) {
11295
if (INERT.some((pattern) => pattern.test(file))) return [];
11396
// A manifest can change dependencies or versions other packages read.
@@ -146,7 +129,6 @@ function decide(files, packages, full) {
146129
if (everything) {
147130
affected = all;
148131
} else {
149-
// Add dependents until nothing changes.
150132
let grew = true;
151133
while (grew) {
152134
grew = false;
@@ -201,4 +183,6 @@ function main() {
201183
for (const [key, value] of Object.entries(outputs)) console.log(`${key}=${value}`);
202184
}
203185

204-
main();
186+
module.exports = { readWorkspace, decide };
187+
188+
if (require.main === module) main();

‎.github/scripts/ci-changes.d.cts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
interface WorkspacePackage {
2+
readonly name: string;
3+
readonly dir: string;
4+
readonly hasTest: boolean;
5+
readonly deps: ReadonlyArray<string>;
6+
}
7+
8+
export function readWorkspace(): Array<WorkspacePackage>;
9+
10+
export function decide(
11+
files: ReadonlyArray<string> | null,
12+
packages: ReadonlyArray<WorkspacePackage>,
13+
full: boolean,
14+
): {
15+
affected: Array<string>;
16+
outputs: {
17+
typecheck: boolean;
18+
build: boolean;
19+
test: boolean;
20+
test_packages: string;
21+
test_web: boolean;
22+
test_server: boolean;
23+
rust: boolean;
24+
release_smoke: boolean;
25+
mobile_native: boolean;
26+
};
27+
};

0 commit comments

Comments
 (0)