Skip to content

Commit 6bfe10b

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-8944
# Conflicts: # scripts/build-desktop-artifact.test.ts
2 parents 3550005 + 3a8c250 commit 6bfe10b

32,564 files changed

Lines changed: 2505293 additions & 1837718 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: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ description: Test T3 Code's web and desktop UI through its built-in Browser pane
55

66
# Test T3 web and desktop
77

8-
Use T3's built-in Browser panel for verification. If its tools are absent or
9-
the panel reports unavailable, explain the blocker and stop verification.
10-
Do not install or switch to another automation system. For native mobile
11-
testing, use [test-t3-mobile](../test-t3-mobile/SKILL.md).
8+
Use T3's built-in Browser panel for verification. Follow the recovery steps
9+
below before declaring it unavailable. Do not install or switch to another
10+
automation system. For native mobile testing, use
11+
[test-t3-mobile](../test-t3-mobile/SKILL.md).
1212

1313
## Start the app
1414

@@ -21,10 +21,28 @@ 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

26-
Call `preview_status`, then `preview_open` if the Browser panel is
27-
closed. Navigate to the complete startup pairing URL once with
39+
Call `preview_status`. If no tab can be automated, call `preview_open`, including
40+
when status reports `available: false` or `tabId: null`. Status can report
41+
unavailable simply because no tab exists yet; opening a tab needs no user action.
42+
Stop verification and explain the blocker only if the tools are absent or
43+
`preview_open` reports unavailable or fails.
44+
45+
Navigate to the complete startup pairing URL once with
2846
`preview_navigate`, then use `preview_snapshot` and T3's interaction tools.
2947
If the token was consumed or expired, run `node apps/server/src/bin.ts pair`
3048
for a fresh one. Keep using the same tab.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ vp run mobile:install <ios|android> <device-id>
3636

3737
This installs the dev client for the checkout's native fingerprint: from the
3838
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. Authorized mobile
42-
verification includes that step unless the user prohibits it.
39+
when no machine has that fingerprint yet: in the `Mobile Dev Client` workflow
40+
on Blacksmith when HEAD is pushed and `gh` may dispatch it (the command waits),
41+
otherwise here (5-15 minutes, logged to the file it names). The device id may be omitted when exactly one device is booted. It
42+
prints one JSON line; on failure it names the next command. Mobile verification
43+
includes that step unless the user prohibits it.
4344

4445
For a device you opened in an agent-device session elsewhere (a device pool,
4546
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`

‎.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
},

‎.github/SECURITY.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Security policy
22

33
Report security vulnerabilities affecting T3 Code or T3 Tools-operated infrastructure to
4-
[security@ping.gg](mailto:security@ping.gg). Please do not disclose them publicly until we have had
4+
[security@t3.codes](mailto:security@t3.codes). Please do not disclose them publicly until we have had
55
a reasonable opportunity to investigate and remediate them.
66

77
See the [full security policy](https://t3.codes/security-policy) for reporting details, scope,

‎.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

‎.github/actions/ci-changes/action.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ outputs:
55
value: ${{ steps.detect.outputs.typecheck }}
66
build:
77
value: ${{ steps.detect.outputs.build }}
8+
desktop_launch:
9+
value: ${{ steps.detect.outputs.desktop_launch }}
810
test:
911
value: ${{ steps.detect.outputs.test }}
1012
test_packages:

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ inputs:
55
description: Read-only credential for the private maintainer task cache
66
required: false
77
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: ""
16+
save-pnpm-store:
17+
description: Set to "false" when a concurrent job with the same install args saves the pnpm store
18+
required: false
19+
default: "true"
820
runs:
921
using: composite
1022
steps:
@@ -19,10 +31,11 @@ runs:
1931
echo "node=$(jq -r '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
2032
echo "pnpm=$(jq -r '.packageManager' package.json)" >> "$GITHUB_OUTPUT"
2133
34+
# Pinned because release-desktop.yml signs builds with this action in the job.
2235
- name: Cache Vite+
2336
id: vp_cache
2437
if: steps.vp.outputs.version != ''
25-
uses: actions/cache@v6
38+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
2639
with:
2740
path: ~/.vite-plus
2841
key: vite-plus-home-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}-node${{ steps.vp.outputs.node }}-${{ steps.vp.outputs.pnpm }}
@@ -38,38 +51,97 @@ runs:
3851
echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"
3952
"$HOME/.vite-plus/bin/vp" env use "${{ steps.vp.outputs.node }}"
4053
54+
# vp gives each Node.js download attempt 10 minutes by default, so one
55+
# stalled stream holds the job that long. It retries 3 times and resumes
56+
# partial bytes, so a shorter limit costs a slow download only a retry.
4157
- name: Setup Vite+
4258
if: steps.vp_cache.outputs.cache-hit != 'true'
43-
uses: voidzero-dev/setup-vp@v1
59+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
60+
env:
61+
VP_DOWNLOAD_TIMEOUT: "120"
4462
with:
4563
node-version-file: package.json
4664
cache: false
4765
run-install: false
4866

49-
- name: Resolve pnpm store path
67+
# A shared key lets whichever install saves first, often a small filtered
68+
# one, become every job's store. Each set of install args gets its own.
69+
- name: Resolve pnpm store
5070
id: pnpm_store
71+
if: inputs.install == 'true'
5172
shell: bash
73+
env:
74+
INSTALL_ARGS: ${{ inputs.install-args }}
5275
run: |
53-
store_path="$(vp pm cache dir)"
54-
echo "path=$store_path" >> "$GITHUB_OUTPUT"
76+
echo "path=$(vp pm cache dir)" >> "$GITHUB_OUTPUT"
77+
metadata_dir="${pnpm_config_cache_dir:-$RUNNER_TEMP/pnpm-metadata}"
78+
echo "pnpm_config_cache_dir=$metadata_dir" >> "$GITHUB_ENV"
79+
echo "verified=$metadata_dir/lockfile-verified.jsonl" >> "$GITHUB_OUTPUT"
80+
if [[ -z "$INSTALL_ARGS" ]]; then
81+
echo "namespace=full" >> "$GITHUB_OUTPUT"
82+
else
83+
echo "namespace=filtered-$(printf '%s' "$INSTALL_ARGS" | cksum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
84+
fi
5585
56-
# setup-vp's shared cache key ignores install filters. Keep full installs in a
57-
# separate namespace, including fallback restores.
86+
# Filtered installs prefer the current full store, which holds every package,
87+
# over an older store of their own.
5888
# The pnpm store stays a cache tarball on the runner's own disk. A store on a
5989
# Blacksmith sticky disk mounts in under a second, but pnpm then copies every
6090
# package across filesystems instead of hard-linking it: install took 28-49s
6191
# against 9s plus an 11s restore.
62-
- name: Cache full pnpm store
63-
uses: actions/cache@v6
92+
- name: Restore pnpm store
93+
id: pnpm_cache
94+
if: inputs.install == 'true'
95+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
6496
with:
6597
path: ${{ steps.pnpm_store.outputs.path }}
66-
key: pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
98+
key: pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
6799
restore-keys: |
100+
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
101+
pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-
68102
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-
69103
104+
# pnpm accepts an earlier pass for the same lockfile and policy at any age, so
105+
# a cached record skips fetching registry metadata for every package.
106+
- name: Restore lockfile verification
107+
id: pnpm_verified
108+
if: inputs.install == 'true'
109+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
110+
with:
111+
path: ${{ steps.pnpm_store.outputs.verified }}
112+
key: pnpm-verified-v1-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
113+
70114
- name: Install dependencies
115+
if: inputs.install == 'true'
71116
shell: bash
72-
run: vp install
117+
env:
118+
INSTALL_ARGS: ${{ inputs.install-args }}
119+
# Unquoted so each filter is its own argument.
120+
run: vp install $INSTALL_ARGS
121+
122+
- name: Save lockfile verification
123+
if: inputs.install == 'true' && steps.pnpm_verified.outputs.cache-hit != 'true'
124+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
125+
with:
126+
path: ${{ steps.pnpm_store.outputs.verified }}
127+
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
128+
129+
# A filtered install that started from the current full store adds nothing
130+
# worth a second copy of it. A stacked PR, based on a branch other than the
131+
# default, saves a ~1 GB store only its own reruns can read, so it only restores.
132+
# Concurrent jobs with the same install args reserve one key, so the losers
133+
# compress the store for nothing; all but one pass save-pnpm-store: false.
134+
- name: Save pnpm store
135+
if: >-
136+
inputs.install == 'true' && inputs.save-pnpm-store == 'true' &&
137+
(github.event_name != 'pull_request' || github.base_ref == github.event.repository.default_branch) &&
138+
steps.pnpm_cache.outputs.cache-hit != 'true' &&
139+
(steps.pnpm_store.outputs.namespace == 'full' ||
140+
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')))
141+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
142+
with:
143+
path: ${{ steps.pnpm_store.outputs.path }}
144+
key: ${{ steps.pnpm_cache.outputs.cache-primary-key }}
73145

74146
- name: Enable shared task cache
75147
if: >-

‎.github/scripts/check-nightly-release.cjs‎

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,42 +40,67 @@ async function assertReleaseSource({ github, context, releaseChannel }) {
4040

4141
const isNightlyTag = (tag) => /^v.*-nightly\./.test(tag) || tag.startsWith("nightly-v");
4242

43-
async function findLatestNightly({ github, context }) {
44-
const releases = await github.paginate(github.rest.repos.listReleases, {
45-
...context.repo,
46-
per_page: 100,
47-
});
48-
return releases
49-
.filter((release) => !release.draft && release.published_at && isNightlyTag(release.tag_name))
50-
.sort((a, b) => Date.parse(b.published_at) - Date.parse(a.published_at))[0];
43+
// Only the three fields the gate reads. The REST list also returns every asset,
44+
// which made a full scan tens of megabytes.
45+
const RELEASES_QUERY = `
46+
query ($owner: String!, $repo: String!, $cursor: String) {
47+
repository(owner: $owner, name: $repo) {
48+
releases(first: 100, after: $cursor, orderBy: { field: CREATED_AT, direction: DESC }) {
49+
pageInfo { hasNextPage endCursor }
50+
nodes { tagName isDraft publishedAt }
51+
}
52+
}
53+
}
54+
`;
55+
56+
// Returns the nightly with the newest publishedAt. Release order follows the
57+
// tagged commit date, not publication, so every page is read unless `isSettled`
58+
// says the newest nightly seen so far already decides the caller's answer.
59+
async function findLatestNightly({ github, context, isSettled = () => false }) {
60+
let latest;
61+
let cursor = null;
62+
do {
63+
const { repository } = await github.graphql(RELEASES_QUERY, { ...context.repo, cursor });
64+
const { nodes, pageInfo } = repository.releases;
65+
for (const release of nodes) {
66+
if (release.isDraft || !release.publishedAt || !isNightlyTag(release.tagName)) continue;
67+
if (!latest || Date.parse(release.publishedAt) > Date.parse(latest.publishedAt)) {
68+
latest = release;
69+
}
70+
}
71+
if (latest && isSettled(latest)) return latest;
72+
cursor = pageInfo.hasNextPage ? pageInfo.endCursor : null;
73+
} while (cursor);
74+
return latest;
5175
}
5276

5377
async function shouldReleaseNightly({ github, context, core, now = Date.now() }) {
54-
const lastNightly = await findLatestNightly({ github, context });
78+
const isInGap = (release) => now - Date.parse(release.publishedAt) < MINIMUM_RELEASE_GAP_MS;
79+
// Any nightly inside the gap means the newest one is too, so stop reading.
80+
const lastNightly = await findLatestNightly({ github, context, isSettled: isInGap });
5581

5682
if (!lastNightly) {
5783
core.info("No published nightly found. Proceeding with release.");
5884
return true;
5985
}
6086

61-
if (now - Date.parse(lastNightly.published_at) < MINIMUM_RELEASE_GAP_MS) {
62-
core.info(`Nightly ${lastNightly.tag_name} was published less than six hours ago. Skipping.`);
87+
const tag = lastNightly.tagName;
88+
if (isInGap(lastNightly)) {
89+
core.info(`Nightly ${tag} was published less than six hours ago. Skipping.`);
6390
return false;
6491
}
6592

6693
const { data: comparison } = await github.rest.repos.compareCommitsWithBasehead({
6794
...context.repo,
68-
basehead: `${lastNightly.tag_name}...${context.sha}`,
95+
basehead: `${tag}...${context.sha}`,
6996
per_page: 1,
7097
});
7198
if (comparison.status !== "ahead") {
72-
core.info(
73-
`Candidate commit is ${comparison.status} relative to ${lastNightly.tag_name}. Skipping.`,
74-
);
99+
core.info(`Candidate commit is ${comparison.status} relative to ${tag}. Skipping.`);
75100
return false;
76101
}
77102

78-
core.info(`New commits since ${lastNightly.tag_name}, and the six-hour gap has passed.`);
103+
core.info(`New commits since ${tag}, and the six-hour gap has passed.`);
79104
return true;
80105
}
81106

@@ -85,7 +110,7 @@ async function resolveLatestNightlyCommit({ github, context, core }) {
85110
throw new Error("No published nightly found. Stable releases build the latest nightly commit.");
86111
}
87112

88-
const tag = lastNightly.tag_name;
113+
const tag = lastNightly.tagName;
89114
const { data: commit } = await github.rest.repos.getCommit({ ...context.repo, ref: tag });
90115
const version = /^(?:nightly-)?v(\d+\.\d+\.\d+)-nightly\./.exec(tag)?.[1];
91116
if (!version) {

0 commit comments

Comments
 (0)