Repository navigation
Expand file tree
/
Copy pathPACKAGE.ts
More file actions
1444 lines (1400 loc) · 69 KB
/
Copy pathPACKAGE.ts
File metadata and controls
1444 lines (1400 loc) · 69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { nativeFfiInputs, nativeFfiLib, rehearsalNative } from "./scripts/native-targets.ts"
import { BuildAndCheckTypeScriptPackage } from "@smthrs/repo-targets"
import { ReviewDocsAgainstCode, ReviewJsdocAgainstCode } from "@smthrs/repo-targets"
import { Smithers } from "@smthrs/targets"
import * as Input from "@smthrs/targets/Input"
import { Package as flowsJjPackage } from "./crates/flows-jj/PACKAGE.ts"
import { Package as machinedPackage } from "./crates/smithers-machined/PACKAGE.ts"
import { Package as backendPackage } from "./packages/backend/PACKAGE.ts"
import { Package as appPackage } from "./apps/app/PACKAGE.ts"
import { Package as modelHostAppPackage } from "./apps/model-host/PACKAGE.ts"
import project from "./apps/site/src/data/project.json" with { type: "json" }
import { Package as modelHostPackage } from "./packages/smithers/agent/model-host/PACKAGE.ts"
import { Package as integrationsPackage } from "./packages/smithers/agent/integrations/PACKAGE.ts"
import { Package as flowsPackage } from "./packages/smithers/flows/PACKAGE.ts"
import { Package as codingFlowsPackage } from "./flows/PACKAGE.ts"
// Workspace selections cross package boundaries as explicit files. Expansion
// retains the shared ignore, repository, symlink and host-state rules.
const workspaceFiles = async (patterns: ReadonlyArray<string>) =>
(await Promise.all(patterns.map((pattern) => Input.expandGlob(import.meta.dirname, "", `//${pattern}`, {
packageScoped: false
})))).flat().sort().map((path) => Smithers.file(`//${path}`))
const workspaceSources = await workspaceFiles([
"packages/*/src/**/*.ts", "packages/*/*/src/**/*.ts", "packages/*/*/*/src/**/*.ts"
])
const workspaceReviewSources = await workspaceFiles([
"packages/*/src/**", "packages/*/*/src/**", "packages/*/*/*/src/**"
])
const workspaceReadmes = await workspaceFiles([
"packages/*/README.md", "packages/*/*/README.md", "packages/*/*/*/README.md"
])
const flowEntries = await workspaceFiles(["flows/**/flow.ts", "flows/**/flow.mdx", "flows/**/SKILL.md"])
export const cacheToken = Smithers.Secret("SMITHERS_CACHE_READ_TOKEN")
export const cacheWriteToken = Smithers.Secret("SMITHERS_CACHE_WRITE_TOKEN")
export const cacheUrl = Smithers.Secret("SMITHERS_CACHE_URL")
export const rootPackageJson = Smithers.file("//package.json")
export const rootTsconfig = Smithers.file("//tsconfig.base.json")
export const workspaceTsconfig = Smithers.file("//tsconfig.json")
export const rootJSDocConfig = Smithers.file("//eslint.jsdoc.js")
export const rootInvariantsConfig = Smithers.file("//eslint.invariants.js")
// --- reference docs pipeline (apps/site/prompts/*.md) ---------------------
// The agent that writes generated reference pages. Declared inline because
// this workspace has no `.smithers/agents.ts`; `S.Agents.<name>` would fail
// at index time. Pages are committed, so the model only runs under
// `smithers-build target <pkg>:referenceDocs --write`, never under `ci`.
export const docsWriter = Smithers.Agent.ClaudeCode({ model: "opus" })
export const referenceStyle = Smithers.file("//apps/site/prompts/reference-style.md")
// --- end reference docs pipeline ------------------------------------------
const workspace = Smithers.pnpmWorkspace("//pnpm-workspace.yaml")
const tsconfig = Smithers.Tsconfig({
summary: "Regenerate and check the workspace tsconfig.json from PACKAGE.ts.",
featured: true,
mode: "check",
extends: rootTsconfig,
compilerOptions: {
noEmit: true,
lib: ["ES2024"],
module: "NodeNext",
moduleResolution: "NodeNext",
paths: { "*": ["./*"] }
},
include: [
Smithers.file("PACKAGE.ts"),
Smithers.glob("apps/*/PACKAGE.ts"),
Smithers.glob("crates/*/PACKAGE.ts"),
Smithers.glob("evals/*/PACKAGE.ts"),
Smithers.file("scripts/PACKAGE.ts"),
Smithers.glob("scripts/*/PACKAGE.ts"),
Smithers.file("flows/PACKAGE.ts"),
Smithers.file("examples/PACKAGE.ts"),
// One entry per nesting depth, spelled out. Packages nest: a granular
// package lives inside the product package it belongs to, so
// `@smthrs/canonical` is `packages/smithers/flows/canonical` and
// `@smthrs/cli` is `packages/smithers`. Three depths cover the tree, and
// `packages/**` is deliberately not used: it would sweep in every `dist`
// tree a build writes, which is the same reason `pnpm-workspace.yaml`
// names one parent at a time.
Smithers.glob("packages/*/PACKAGE.ts"),
Smithers.glob("packages/*/*/PACKAGE.ts"),
Smithers.glob("packages/*/*/*/PACKAGE.ts"),
],
exclude: [
Smithers.glob("**/dist/**"),
Smithers.glob("packages/coding-agent/examples/extensions/gondolin/**")
]
})
// The package manager comes from `.smithers/WORKSPACE.ts`, which is where the
// workspace declares it once; the two targets name the file it writes because
// a target's output tree and declared inputs are fixed when this file is
// evaluated, before any workspace declaration has been read.
const lockfilePath = "pnpm-lock.yaml"
const lockfile = Smithers.Lockfile({
lockfilePath,
manifests: [workspace]
})
const nodeModules = Smithers.Install({
lockfilePath,
lockfile,
// The workspace definition also keys the install on every patch file its
// patchedDependencies names, so no patch list is kept here.
workspaceManifest: workspace,
// The registry, and the Playwright browser builds (with their apt
// dependencies) the prepared environment installs for the locked release.
destinations: [
"registry.npmjs.org",
"cdn.playwright.dev",
"playwright-bkakghazbfe7grc5.z01.azurefd.net",
"mr-z01.tm-azurefd.net",
"deb.debian.org",
"debian.map.fastly.net",
"debian.map.fastlydns.net"
]
})
/**
* The tool releases a prepared microVM environment installs, each pinned to
* its linux/arm64 artifact and reviewed SHA-256. `scripts/check-toolchain-pins.mjs`
* fails when a version here disagrees with `.node-version`, WORKSPACE.ts,
* go.mod or rust-toolchain.toml. Domain rules match the name a connection
* resolved through, so CDN CNAME targets are listed beside their aliases.
*
* @since 1.0.0
* @category build
*/
const environmentToolchain = Smithers.Environment.Toolchain({
downloads: {
node: {
version: "26.5.0",
url: "https://nodejs.org/dist/v26.5.0/node-v26.5.0-linux-arm64.tar.xz",
sha256: "036df0b49662ebb350eb56f1cac603699b1e9ed1e2603ee129fefda473479030"
},
pnpm: {
version: "11.25.0",
url: "https://registry.npmjs.org/pnpm/-/pnpm-11.25.0.tgz",
sha256: "33dd0748f27e7916c4f1c8b6943461983e3453b06bbda6312a6280130b4881e5"
},
bun: {
version: "1.4.1",
url: "https://github.com/oven-sh/bun/releases/download/bun-v1.4.1/bun-linux-aarch64.zip",
sha256: "580ce77533108dc6b10bec1721397e4f5aa44e909726da2451d483dfc5e581d6"
},
go: {
version: "1.26.8",
url: "https://go.dev/dl/go1.26.8.linux-arm64.tar.gz",
sha256: "211ffced9dcb9633a55eac6364816ec0ddd951389a740e88fa8b3337971bdda0"
},
jj: {
version: "0.39.0",
url: "https://github.com/jj-vcs/jj/releases/download/v0.39.0/jj-v0.39.0-aarch64-unknown-linux-musl.tar.gz",
sha256: "15bbb0199adf57929d1e3cd90ae0b47356858cbe374814769815a1fb87d5ad1d"
},
rg: {
version: "14.1.1",
url: "https://github.com/BurntSushi/ripgrep/releases/download/14.1.1/ripgrep-14.1.1-aarch64-unknown-linux-gnu.tar.gz",
sha256: "c827481c4ff4ea10c9dc7a4022c8de5db34a5737cb74484d62eb94a95841ab2f"
},
fd: {
version: "10.2.0",
url: "https://github.com/sharkdp/fd/releases/download/v10.2.0/fd-v10.2.0-aarch64-unknown-linux-musl.tar.gz",
sha256: "4e8e596646d047d904f2c5ca74b39dccc69978b6e1fb101094e534b0b59c1bb0"
},
jq: {
version: "1.7.1",
url: "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-arm64",
sha256: "4dd2d8a0661df0b22f1bb9a1f9830f06b6f3b8f7d91211a1ef5d7c4f06a8b4a5"
},
rustup: {
version: "1.28.2",
url: "https://static.rust-lang.org/rustup/archive/1.28.2/aarch64-unknown-linux-gnu/rustup-init",
sha256: "e3853c5a252fca15252d07cb23a1bdd9377a8c6f3efa01531109281ae47f841c"
}
},
rust: { channel: "1.98.0", components: ["clippy", "rustfmt"], targets: ["wasm32-wasip1"] },
postgres: "18",
destinations: [
"nodejs.org",
"registry.npmjs.org",
"github.com",
"objects.githubusercontent.com",
"release-assets.githubusercontent.com",
"go.dev",
"dl.google.com",
"static.rust-lang.org",
"fastly-static.rust-lang.org",
"dualstack.k.sni.global.fastly.net",
"deb.debian.org",
"debian.map.fastly.net",
"debian.map.fastlydns.net",
"www.postgresql.org",
"www.mirrors.postgresql.org",
"apt.postgresql.org",
"dualstack.t.sni.global.fastly.net"
]
})
/**
* The public project copy derived from one small data file: the root README,
* the shared regions on the docs overview, and the repository manifest's
* description. The generated files stay committed so GitHub, npm tooling, and
* the static site all work without first running the build.
*
* `run` writes the files and `lint` checks them for drift. The GIFs are data
* edges even though the renderer only writes their paths: deleting either
* asset must break the graph instead of leaving a dead README and docs page.
*
* @since 1.0.0
* @category build
*/
const projectCopySource = Smithers.file("//apps/site/src/data/project.json")
const projectCopy = Smithers.Generate({
summary: "Regenerate and drift-check the README and shared public project copy.",
featured: true,
script: Smithers.file("//apps/site/scripts/generate-project-copy.mjs"),
data: [
projectCopySource,
Smithers.file("//apps/site/public/images/app/home.png"),
Smithers.file("//apps/site/public/images/build-graph.gif"),
Smithers.file("//apps/site/public/images/build-graph-light.gif")
],
changes: ["README.md", "package.json", "apps/site/src/content/docs/docs/index.mdx", "apps/site/src/content/docs/docs/developers.mdx"]
})
/**
* Applies the canonical one-sentence description to the GitHub About panel.
* ToolRun is an explicit run-only irreversible operation, so no build, lint,
* test, or CI traversal can update the remote repository accidentally.
*
* @since 1.0.0
* @category release
*/
const repoAbout = Smithers.ToolRun({
command: "gh",
args: ["repo", "edit", "smithersai/smithers", "--description", project.description],
inputs: [projectCopySource],
deps: [projectCopy],
cwd: "."
})
// Explicitly snapshot every contributor's current edits. This run-only target
// is never executed by build, test, lint, or CI and never cached or replayed.
const commit = Smithers.ToolRun({
command: "node",
args: ["scripts/commit.mjs"],
inputs: [Smithers.file("//scripts/commit.mjs")],
deps: [],
cwd: "."
})
// --- factory projection ----------------------------------------------------
// The factory is declared in .smithers/FACTORY.ts beside WORKSPACE.ts: the
// featured flows, the Dispatcher table, the GitHub policy, and the homepage.
// This target projects that declaration into .smithers/factory.json and
// .smithers/home.json, the files smithers.sh reads from the public mirror, so
// a visitor signed out sees them and a workspace without node_modules never
// evaluates FACTORY.ts for a card. The planner fills the declaration from the
// loaded file; nothing here restates it.
const factoryProjection = Smithers.FactoryProjection({
entries: flowEntries,
summary: "Regenerate and drift-check .smithers/factory.json and .smithers/home.json from .smithers/FACTORY.ts.",
featured: true
})
// --- end factory projection ------------------------------------------------
// --- target index ----------------------------------------------------------
// The declaration-derived target index smithers.sh reads from the public
// mirror to show targets beside files: one row per labeled target with its
// rule, kinds, declared inputs and outputs, labeled dependencies, and the
// declaring file, and nothing keyed on a host. The planner fills the rows
// from the loaded declarations, so their content is key material and an edit
// to any PACKAGE.ts re-keys the check. `target --write` writes the file and
// `lint` fails on drift; `smithers-build index '//...'` prints the same rows.
const targetIndex = Smithers.TargetIndex({
summary: "Regenerate and drift-check .smithers/target-index.json, the declaration-derived target index.",
featured: true,
gates: [codingFlowsPackage.testCoverage]
})
// --- end target index ------------------------------------------------------
const ubuntu = "ubuntu-latest"
// One Node for every environment, named once in `.node-version` at the root:
// setup-node reads it here through `node-version-file`, `scripts/ci/cloud.sh`
// reads it to bootstrap a Cloud runner, and fnm, nvm and asdf read it on a
// developer's machine. Before this the same fact was spelled three ways and
// three different releases came out: package.json said >=22.19.0, ci.yml
// installed 22.19.0, and the Cloud bootstrap downloaded 24.21.0.
const node = Smithers.CiToolchain.Node({ versionFile: ".node-version", npmRelease: "11.16.0" })
const bun = Smithers.CiToolchain.Bun({ release: "1.4.1" })
const jj = Smithers.CiToolchain.Jj({ release: "0.39.0" })
// `@smthrs/std` proves its portable search against a real `rg`: the conformance
// suite runs both implementations and compares them. Without the binary the
// native half cannot start and the parity check, which is the point of the
// suite, is the thing that fails.
const ripgrep = Smithers.CiToolchain.Ripgrep({ release: "14.1.1" })
// Confined targets run under bubblewrap on Linux, which the hosted runner
// image does not ship. The step is a no-op on the macOS and Windows rows.
const bubblewrap = Smithers.CiToolchain.Apt({ packages: ["bubblewrap"] })
const packageSystemTools = Smithers.CiToolchain.Apt({ packages: ["bubblewrap", "openssh-server"] })
// `//packages/smithers/build/build-cli:test` drives a real `forge` and a real Go toolchain:
// it builds and tests a Foundry package and asserts `forge fmt --check` drift,
// and it builds a Go package tree. Without them six cases fail on the REQUIRED
// ubuntu row with `host binary "forge" is not present on PATH`, which is a
// missing toolchain rather than a defect.
//
// These were withdrawn once, on the theory that they displaced pnpm from PATH
// and caused ~50 `spawn pnpm ENOENT` failures. That was wrong: the failures
// persisted through two pushes with no Go and no Foundry declared, and 52 of
// the 55 are the Windows `pnpm.cmd` shim problem, on a row that is advisory.
// Foundry v1.8.1 installed cleanly on every runner when it was last declared.
const go = Smithers.CiToolchain.Go({ release: "1.26.8" })
const foundry = Smithers.CiToolchain.Foundry({ release: "v1.8.1" })
// Hosted runners pull anonymously from shared addresses, and Docker Hub
// answered `429 Too Many Requests` for the pinned postgres and alpine images
// on the Release gates lane (job 114021383970: four postgres services and the
// container sandbox suites). Google's Docker Hub mirror serves the same
// digests; the daemon falls back to Docker Hub for anything it cannot serve.
const dockerImageStore = Smithers.CiToolchain.Docker({
imageStore: "containerd",
registryMirrors: ["https://mirror.gcr.io"]
})
// The storage matrix (`packages/smithers/flows/database/scripts/test-matrix.mjs`)
// runs every SQL-backed package suite on SQLite and on a throwaway PostgreSQL
// cluster it starts with `initdb`/`pg_ctl`, and refuses when they are missing.
const postgres = Smithers.CiToolchain.Postgres({ release: "18" })
// Hosted Go adapters need a real database server; each test suite creates its
// own database on it. This target runs only in the required Linux backend job,
// not in the cross-platform package matrix.
const backendPostgres = Smithers.Docker.Service({
image: "postgres@sha256:ef257d85f76e48da1c64832459b59fcaba1a4dac97bf5d7450c77753542eee94",
env: { POSTGRES_USER: "smithers", POSTGRES_PASSWORD: "smithers-backend-test" },
ports: { "5432": 55435 },
readiness: {
exec: ["pg_isready", "-h", "127.0.0.1", "-U", "smithers", "-d", "postgres"],
timeout: "120s"
},
stop: { signal: "SIGTERM", grace: "10s" }
})
// Clippy and the FFI tests, run by the rust-ffi CI job. Only a
// trusted-process-binding build can import a source outside a guest, so its
// source import CLI test runs as a second pass. It keeps its own rustup home
// and target directory so it never writes nativeFfiLib's output.
const nativeFfi = Smithers.Shell.Build({
shell: "mkdir -p .native-ffi-check; export RUSTUP_HOME=\"$PWD/.native-ffi-check/rustup\" CARGO_TARGET_DIR=\"$PWD/.native-ffi-check/target\"; rustup toolchain install && cargo clippy -p smithers-ffi --all-targets --locked -- -D warnings && cargo test -p smithers-ffi --locked && cargo test -p smithers-ffi --locked --features trusted-process-binding --test source_import_cli && touch .native-ffi-check/qualified",
outDirs: ["//.native-ffi-check"],
data: nativeFfiInputs,
sandbox: { network: true },
timeout: "30m"
})
const rehearsalNativeEnv = "export SMITHERS_REHEARSAL_JJ_EXPORT_BINARY=\"$PWD/.rehearsal-native/smithers-jj-export\" SMITHERS_REHEARSAL_MACHINED_BINARY=\"$PWD/.rehearsal-native/rehearsal_daemon\"; "
// Fill a declared module cache on a clean runner.
const backendGoModules = Smithers.Go.ModDownload({
mod: Smithers.file("//go.mod"),
sum: Smithers.file("//go.sum"),
outDirs: ["//.backend-go-modcache"],
sandbox: { network: true },
destinations: ["proxy.golang.org", "sum.golang.org", "storage.googleapis.com"]
})
// sqlc owns product row models; the backend suite regenerates and compiles them.
const backendSQLC = Smithers.Shell.Build({
shell: "GOBIN=\"$PWD/.backend-sqlc\" go install github.com/sqlc-dev/sqlc/cmd/sqlc@v1.30.0",
outDirs: ["//.backend-sqlc"],
data: [Smithers.file("//go.mod")],
sandbox: { network: true },
timeout: "15m"
})
// C-COL-06: qualify the shared corpus and daemon refusals in both languages.
const machinedWire = Smithers.Shell.Test({
shell: "go test -count=1 -p 4 -v ./packages/backend/internal/compose -run '^(TestMachinedWire.*|TestWireContentLimit|TestMachinedSkeletonDisabled)$' && cargo test --locked -p smithers-machined --test golden --test fake_host --test local",
data: [backendPackage.buildInputs, flowsJjPackage.nativeSources,
machinedPackage.buildInputs,
Smithers.file("//crates/flows-jj/Cargo.toml"),
Smithers.file("//Cargo.toml"), Smithers.file("//Cargo.lock"),
Smithers.file("//rust-toolchain.toml"), Smithers.file("//go.mod"), Smithers.file("//go.sum")],
env: { GOMAXPROCS: "8", GOFLAGS: "-buildvcs=false -mod=readonly", CARGO_BUILD_JOBS: "2" },
sandbox: "none",
exclusive: true,
timeout: "30m"
})
// `go test` streams megabytes of logs, so its failures rarely reach the
// output tail a failed target reports; they are repeated on stderr. The
// failure context is capped at 400 lines, which once hid half the packages,
// so a per-package ok/FAIL and `--- FAIL` summary follows it: the failure
// report keeps the last 64 KiB of stderr, so the summary goes last. It keeps
// a timeout panic's "running tests:" block, which names a hung test (#3071).
// The backup, restore and upgrade-recovery suites run the PostgreSQL programs
// on PATH (`postgres` in the go-backend job, pkgs.postgresql_18 on the Cloud
// machine); without them the suite fails instead of skipping them.
const backendGo = Smithers.Shell.Test({
shell: rehearsalNativeEnv + "export PATH=\"$PWD/.backend-sqlc:$PATH\"; if [ -z \"${SMITHERS_POSTGRES_TEST_BIN:-}\" ]; then pg_ctl_path=$(command -v pg_ctl) || { echo 'PostgreSQL 18 programs (pg_ctl, initdb, pg_dump, psql) must be on PATH for the backend backup and restore tests' >&2; exit 1; }; export SMITHERS_POSTGRES_TEST_BIN=\"${pg_ctl_path%/*}\"; fi; export SMITHERS_FFI_LIBRARY_PATH=\"$PWD/.native-ffi/target/debug/libsmithers_ffi.so\"; export SMITHERS_WIKI_TEST_FFI=\"$SMITHERS_FFI_LIBRARY_PATH\"; export GOMODCACHE=\"$PWD/.backend-go-modcache\"; bash scripts/check-sqlc-drift.sh || exit $?; go test -run '^$' ./packages/backend/db/product || exit $?; python3 -B -m unittest scripts/test_check_go_boundaries.py packages/backend/db/product/test_adopt_unit.py || exit $?; bash scripts/check-public-backend-boundary.sh || exit $?; sh scripts/test-backend-consumer.sh || exit $?; unformatted=$(gofmt -l packages/backend apps/backend distribution docs/api) || exit $?; test -z \"$unformatted\" || { printf 'gofmt -w needed:\\n%s\\n' \"$unformatted\"; exit 1; }; go build ./packages/backend/... ./apps/backend/... ./distribution/... ./docs/api/... || exit $?; go vet ./packages/backend/... ./apps/backend/... ./distribution/... ./docs/api/... || exit $?; log=$(mktemp) || exit $?; packages=$(go list ./packages/backend/... ./apps/backend/... ./distribution/... ./docs/api/...) || exit $?; packages=$(printf '%s\\n' \"$packages\" | grep -v '/internal/compose$') || exit $?; go test -p 4 -count=1 -timeout 40m $packages >\"$log\" 2>&1; status=$?; node scripts/backend-compose-tests.mjs >>\"$log\" 2>&1 || status=1; cat \"$log\"; if [ $status -ne 0 ]; then printf 'go test failures:\\n' >&2; grep -E -A30 '^[[:space:]]*--- FAIL|^panic:|^FAIL' \"$log\" | head -n 400 >&2; printf 'go test summary:\\n' >&2; grep -E '^(ok|FAIL)[[:space:]]|^[[:space:]]*--- FAIL|^panic: test timed out|^[[:space:]]+running tests:|^[[:space:]]+Test[^[:space:]]+ \([0-9]' \"$log\" >&2; fi; rm -f \"$log\"; exit $status",
env: {
GOFLAGS: "-buildvcs=false -mod=readonly",
GOMAXPROCS: "2",
SMITHERS_REQUIRE_DATABASE_TESTS: "1",
GOPROXY: "off",
// Every suite creates and drops its own databases through this server.
SMITHERS_TEST_DATABASE_URL: "postgres://smithers:smithers-backend-test@127.0.0.1:55435/postgres?sslmode=disable"
},
data: [
backendGoModules,
backendSQLC,
rehearsalNative,
Smithers.file("//scripts/check-sqlc-drift.sh"),
Smithers.file("//scripts/check-go-boundaries.py"),
Smithers.file("//scripts/check-public-backend-boundary.sh"),
Smithers.file("//scripts/test-backend-consumer.sh"),
Smithers.file("//scripts/backend-compose-tests.mjs"),
Smithers.file("//scripts/test_check_go_boundaries.py"),
nativeFfiLib,
modelHostPackage.lib,
integrationsPackage.lib,
flowsPackage.lib,
// The bootstrap regression starts the production coding-host seat layers.
codingFlowsPackage.codingHostInputs,
workspace,
Smithers.file("//pnpm-lock.yaml"),
modelHostAppPackage.backendInputs,
// The composed code-document proof runs the shipped app clients in Bun.
appPackage.solidCodegenInputs,
Smithers.file("//apps/app/e2e/real/code-document-install.fixture.ts"),
Smithers.file("//apps/model-host/build.mjs"),
Smithers.file("//apps/model-host/package.json"),
Smithers.file("//go.mod"),
Smithers.file("//go.sum"),
Smithers.file("//packages/rpc/contracts/app-bootstrap-v1.schema.json"),
backendPackage.buildInputs,
Smithers.glob("//apps/backend/**/*"),
Smithers.glob("//distribution/**/*"),
Smithers.glob("//docs/api/**/*")
],
services: [backendPostgres],
sandbox: { network: "loopback" },
// Process-wide seams and environment forbid broad t.Parallel in compose.
// Four isolated file workers replace the observed 72-minute serial run.
// Other packages measured 26 minutes; leave headroom for CI and setup.
// Full concurrent elapsed time remains a post-landing CI measurement (#3775).
timeout: "100m"
})
// The access-control tests (member, admission, authorization, credential and
// person-only files of compose, services, identity and middleware), on their own
// budget so a hang elsewhere in backendGo cannot hide them (#3071). The list is
// file-derived and committed in scripts/backend-access-tests.json; each file runs
// as its own `go test` process, so a hang panics one file, not the package.
// backendGo still runs these tests too.
const backendAccessTestSources = [
Smithers.file("//scripts/backend-access-tests.mjs"),
Smithers.file("//scripts/backend-access-tests.json"),
Smithers.glob("//packages/backend/internal/compose/*_test.go"),
Smithers.glob("//packages/backend/internal/services/*_test.go"),
Smithers.glob("//packages/backend/internal/identity/*_test.go"),
Smithers.glob("//packages/backend/internal/middleware/*_test.go")
]
// Fails when a matching test file or Test func is missing from the committed list.
const backendAccessTests = Smithers.Shell.Diff({
shell: "node scripts/backend-access-tests.mjs --check",
data: backendAccessTestSources,
changes: [],
timeout: "2m"
})
const backendGoAccess = Smithers.Shell.Test({
shell: rehearsalNativeEnv + "export PATH=\"$PWD/.backend-sqlc:$PATH\"; export SMITHERS_FFI_LIBRARY_PATH=\"$PWD/.native-ffi/target/debug/libsmithers_ffi.so\"; export SMITHERS_WIKI_TEST_FFI=\"$SMITHERS_FFI_LIBRARY_PATH\"; export GOMODCACHE=\"$PWD/.backend-go-modcache\"; runs=$(mktemp) || exit $?; log=$(mktemp) || exit $?; node scripts/backend-access-tests.mjs --runs >\"$runs\" || exit $?; status=0; while read -r pkg pattern; do go test -count=1 -timeout 30m -run \"$pattern\" \"./$pkg/\" >>\"$log\" 2>&1 || status=1; done <\"$runs\"; cat \"$log\"; if [ $status -ne 0 ]; then printf 'go test failures:\\n' >&2; grep -E -A30 '^[[:space:]]*--- FAIL|^panic:|^FAIL' \"$log\" | head -n 400 >&2; printf 'go test summary:\\n' >&2; grep -E '^(ok|FAIL)[[:space:]]|^[[:space:]]*--- FAIL|^panic: test timed out|^[[:space:]]+running tests:|^[[:space:]]+Test[^[:space:]]+ \([0-9]' \"$log\" >&2; fi; rm -f \"$runs\" \"$log\"; exit $status",
env: {
GOFLAGS: "-buildvcs=false -mod=readonly",
GOMAXPROCS: "2",
SMITHERS_REQUIRE_DATABASE_TESTS: "1",
GOPROXY: "off",
SMITHERS_TEST_DATABASE_URL: "postgres://smithers:smithers-backend-test@127.0.0.1:55435/postgres?sslmode=disable"
},
data: [
backendGoModules,
backendSQLC,
nativeFfiLib,
rehearsalNative,
...backendAccessTestSources,
Smithers.file("//go.mod"),
Smithers.file("//go.sum"),
backendPackage.buildInputs
],
services: [backendPostgres],
sandbox: { network: "loopback" },
// 78 files run one by one; a single 30m per-file hang still leaves room.
timeout: "75m"
})
// The product API spec is bundled from one source per tag, so changes under
// different tags never edit the same file. `run` re-bundles; `lint` fails when
// the committed docs/api/openapi.yaml is stale.
const openapiBundle = Smithers.Generate({
summary: "Bundle docs/api/openapi.yaml from its per-tag sources and drift-check it.",
script: Smithers.file("//scripts/openapi-bundle.mjs"),
data: [Smithers.glob("//docs/api/openapi/*.yaml")],
changes: ["docs/api/openapi.yaml"]
})
// The Go and TypeScript product API clients are generated from the bundle.
// `run` regenerates both; `lint` fails when either is stale.
const openapiClients = Smithers.Generate({
summary: "Generate the Go and TypeScript product API clients from docs/api/openapi.yaml and drift-check them.",
script: Smithers.file("//scripts/openapi-clients.mjs"),
data: [Smithers.file("//docs/api/openapi.yaml")],
changes: ["packages/backend/apiclient/client.gen.go", "packages/smithers/src/internal/backend/ProductApi.ts"]
})
const nativeFilesystem = [{
package: "smithers-ffi",
binary: "smithers-jj-export",
toolchain: "1.98.0",
environment: "SMITHERS_WORKSPACE_JJ_EXPORT_BINARY",
platforms: ["linux", "darwin", "win32"]
}] as const
// Cheap drift checks retain a verdict for every commit independently of full CI.
const driftJob = {
id: "drift",
name: "Per-commit drift",
runsOn: ubuntu,
// A clean run takes 7-10 minutes on ubuntu-latest; a 10-minute cap
// cancelled runs before //:driftCi and //:ci, leaving a SHA with no verdict.
timeoutMinutes: 20,
toolchain: Smithers.CiToolchain.Needs({ runtimes: [node, bun] }),
steps: [
{ name: "Formatting", verb: Smithers.Verb.Lint, pattern: "//...:fmt" },
{ name: "Target index drift", verb: Smithers.Verb.Lint, pattern: "//:targetIndex" },
// factory.json drift used to surface only in the Release gates (#3770).
{ name: "Factory projection drift", verb: Smithers.Verb.Lint, pattern: "//:factoryProjection" },
{ name: "Backend access test list drift", verb: Smithers.Verb.Lint, pattern: "//:backendAccessTests" },
{ name: "OpenAPI bundle drift", verb: Smithers.Verb.Lint, pattern: "//:openapiBundle" },
{ name: "OpenAPI client drift", verb: Smithers.Verb.Lint, pattern: "//:openapiClients" },
{ name: "Documentation drift", verb: Smithers.Verb.Lint, pattern: "//scripts:docsDrift" },
{ name: "Declaration baseline", verb: Smithers.Verb.Build, pattern: "//scripts:apiBaseline" },
{ name: "Conflict markers", verb: Smithers.Verb.Lint, pattern: "//scripts:conflictMarkers" },
{ name: "Tracked file hygiene", verb: Smithers.Verb.Lint, pattern: "//scripts:trackedHygiene" },
{ name: "Generated drift workflow", verb: Smithers.Verb.Lint, pattern: "//:driftCi" },
{ name: "Generated CI workflow", verb: Smithers.Verb.Lint, pattern: "//:ci" }
]
} as const
const trustedDriftCi = Smithers.GithubCiGen({
workflowName: "Trusted drift",
output: ".github/workflows/trusted-drift.yml",
pushBranches: [],
pullRequest: false,
workflowDispatch: false,
workflowCall: true,
concurrency: "commit",
knownRed: ".github/ci-known-red.json",
mode: "check",
requiredJobs: ["drift"],
jobs: [{ ...driftJob, trustedSetupRevision: "c4ece3f812c7720ac622c11582d5ef2c085d6a2c" }]
})
const driftCi = Smithers.GithubCiGen({
workflowName: "Drift",
output: ".github/workflows/drift.yml",
concurrency: "commit",
trustedWorkflowRevision: "d578fb2d62f0b7164a25c625918ddb3a192458c0",
workflowDispatch: false,
knownRed: ".github/ci-known-red.json",
mode: "check",
deps: [trustedDriftCi],
requiredJobs: ["drift"],
jobs: [driftJob]
})
const ci = Smithers.GithubCiGen({
summary: "Regenerate and drift-check .github/workflows/ci.yml, the pipeline definition (not the run itself).",
featured: true,
cacheUrlSecret: cacheUrl,
cacheTokenSecret: cacheToken,
workflowDispatch: false,
// Targets already red on main, each with an owner and an expiry. A step
// fails only on a red target this list does not name, so a new regression
// stands out from the known ones. Delete an entry in the change that fixes it.
knownRed: ".github/ci-known-red.json",
// Every step writes its per-label results file and each job uploads them, so
// a check receipt reads a target's status from CI, never from the log (#3663).
results: true,
mode: "check",
gates: [
{ name: "documentation parity", verb: Smithers.Verb.Docs, pattern: "//packages/...", job: "test" },
{ name: "example typecheck", verb: Smithers.Verb.Build, pattern: "//examples/...", job: "test" },
{ name: "example suite", verb: Smithers.Verb.Test, pattern: "//examples/...", job: "test" },
{ name: "shared Go backend", verb: Smithers.Verb.Test, pattern: "//:backendGo", job: "go-backend" },
{ name: "backend access-control tests", verb: Smithers.Verb.Test, pattern: "//:backendGoAccess", job: "go-backend-access" },
{ name: "native FFI compiler and tests", verb: Smithers.Verb.Build, pattern: "//:nativeFfi", job: "rust-ffi" },
{ name: "web bundle compatibility", verb: Smithers.Verb.Test, pattern: "//scripts:webBundleContract" }
],
requiredJobs: [
"test",
"repository",
"scripts",
"docs",
"apps-e2e",
"apps-browser-1",
"apps-browser-2",
"apps-browser-3",
"rust",
"wasm-repro",
"browser",
"packages",
"go-backend",
"go-backend-access",
"rust-ffi"
],
jobs: [
{
id: "test",
name: "workspace graph (coverage gates enforced)",
runsOn: ubuntu,
// Run 36319330660 exceeded 120 min before this split; keep the workspace budget.
// Remote-cache hits and the remaining workspace budget are tracked in #2254.
timeoutMinutes: 180,
toolchain: Smithers.CiToolchain.Needs({
cargoBinaries: nativeFilesystem,
runtimes: [node, bun],
jj,
ripgrep,
apt: bubblewrap,
go,
foundry,
postgres,
docker: dockerImageStore,
workflowLint: Smithers.CiToolchain.Actionlint({
release: "1.7.11",
workflows: [
".github/workflows/ci.yml",
".github/workflows/release.yml",
".github/workflows/release-auth.yml",
".github/workflows/npm-dist-tag.yml",
".github/workflows/apps-deploy.yml",
".github/workflows/distribution.yml",
".github/workflows/canary.yml",
".github/workflows/reliability.yml",
".github/workflows/native-windows.yml",
".github/workflows/mirror-sync.yml",
".github/workflows/drift.yml",
".github/workflows/reference-host.yml",
".github/workflows/trusted-drift.yml",
".github/workflows/trusted-setup-validation.yml"
]
})
}),
steps: [
{ name: "Examples", verb: Smithers.Verb.Ci, pattern: "//examples/..." },
{ name: "Workspace targets", verb: Smithers.Verb.Ci, pattern: "//packages/...", parallelism: 2 }
]
},
{
// Everything the workspace graph used to run after its package step.
// None of it reads that step's results, so it starts with the other
// gates instead of queueing behind ~95 minutes of packages (#2361).
id: "repository",
name: "repository flows, apps and evals",
runsOn: ubuntu,
// Run 36691217680: these steps took ~24 min inside the workspace graph;
// leave room for the package builds they no longer share with it.
timeoutMinutes: 60,
toolchain: Smithers.CiToolchain.Needs({
cargoBinaries: nativeFilesystem,
runtimes: [node, bun],
jj,
ripgrep,
apt: bubblewrap,
go,
foundry,
postgres,
docker: dockerImageStore
}),
steps: [
// The registry and migrate-detector checks over flows/. `//flows/...`
// would also select the 45-minute codingNative/codingBundle gates.
{ name: "Repository flows", verb: Smithers.Verb.Test, pattern: "//flows:pack" },
// The one case that proves the coding host's judge tunnels through the
// egress proxy its environment names instead of dialling the gateway
// directly. `//flows:pack` does not reach it, and the repo-contract
// grep beside it bans identifiers, not behaviour: a composition that
// keeps the approved spelling and hands it an environment naming no
// proxy passes that gate and fails this one.
{ name: "Judge egress", verb: Smithers.Verb.Test, pattern: "//flows:egress" },
// The repository, wiki and release-content fixtures.
// `//flows:pack` reaches none of them and neither did any other job, so
// until these two steps existed the only thing that ran them was
// `pnpm test` inside flows/, which no workflow invokes. The seven
// fixtures that skip themselves without the Plue adapter and exporter
// are deliberately not here: they are declared in the native gate,
// where a missing prerequisite refuses instead of skipping.
{ name: "Repository flow fixtures", verb: Smithers.Verb.Test, pattern: "//flows:repository" },
{ name: "Wiki and release fixtures", verb: Smithers.Verb.Test, pattern: "//flows:fixtures" },
// ESLint and dprint over the flows tree: `//flows:lint` and `//flows:fmt`.
{ name: "Repository flows lint", verb: Smithers.Verb.Lint, pattern: "//flows/..." },
{ name: "Public export JSDoc", verb: Smithers.Verb.Lint, pattern: "//:jsdocTree" },
{ name: "Script lint", verb: Smithers.Verb.Lint, pattern: "//scripts:lint" },
{ name: "JSDoc rule harness", verb: Smithers.Verb.Test, pattern: "//:jsdocRules" },
{ name: "Factory harness", verb: Smithers.Verb.Test, pattern: "//:factoryHarness" },
// Every `evals/*` directory is its own workspace member now, so each
// one's targets carry the standard `check`/`test` names and run from
// the directory that pins their toolchain.
{
name: "Agent eval suite (offline, baseline-gated)",
verb: Smithers.Verb.Test,
pattern: "//evals/agent:test"
},
{ name: "Agent eval typecheck", verb: Smithers.Verb.Build, pattern: "//evals/agent:check" },
// The authoring fine-tune's dataset validator. It reads the committed
// `data/pilot-sft.jsonl` and nothing else, so it gates offline; the
// Fireworks upload and training targets beside it are `run`-verb only
// and never enter a `ci` graph.
{
name: "Authoring eval dataset (offline)",
verb: Smithers.Verb.Test,
pattern: "//evals/authoring:test"
},
{ name: "Authoring eval typecheck", verb: Smithers.Verb.Build, pattern: "//evals/authoring:check" },
// Offline fixtures need only the workspace install. Docker and funded
// benchmark runs remain operator commands.
{ name: "SWE-bench offline fixtures", verb: Smithers.Verb.Test, pattern: "//evals/swebench:offline", parallelism: 1 },
{ name: "SWE-bench rig typecheck", verb: Smithers.Verb.Build, pattern: "//evals/swebench:check" },
{ name: "SWE-bench rig lint", verb: Smithers.Verb.Lint, pattern: "//evals/swebench/..." },
// Apps and repository flows have separate source roots from packages.
// Keep the review flow and its seeded-bug eval in the required gates.
{ name: "Server typecheck and tests", verb: Smithers.Verb.Ci, pattern: "//apps/server/..." },
{ name: "Review flow", verb: Smithers.Verb.Ci, pattern: "//flows/review/..." },
{ name: "Bug worker", verb: Smithers.Verb.Ci, pattern: "//apps/bug-worker/..." },
{ name: "Project copy drift", verb: Smithers.Verb.Lint, pattern: "//:projectCopy" },
// smithers.sh: the landing page and the Starlight docs. `astro check`
// and `astro build` over apps/site/src/content/docs.
{ name: "Site", verb: Smithers.Verb.Ci, pattern: "//apps/site/..." },
{
name: "Review eval suite (offline, baseline-gated)",
verb: Smithers.Verb.Test,
pattern: "//evals/review-seeded-bugs/..."
},
{
name: "Review eval typecheck",
verb: Smithers.Verb.Build,
pattern: "//evals/review-seeded-bugs:check"
},
// The command-recommender scorer: hit@5, top-1, and coverage over the
// server's recommendation log. Offline: it scores a checked-in
// fixture and gates on its baseline; the live pull is operator-run.
{
name: "Recommend eval suite (offline, baseline-gated)",
verb: Smithers.Verb.Test,
pattern: "//evals/recommend/..."
},
{
name: "Recommend eval typecheck",
verb: Smithers.Verb.Build,
pattern: "//evals/recommend:check"
},
// The fault matrix no longer typechecks here. It used to need its own
// step because it was its own workspace member with its own tsconfig;
// every case now lives in the package it tests, under `test/faults`,
// which that package's `check` already covers through the
// `//packages/...` step above. The reason for the check is unchanged:
// a stale fixture is deterministic and cheap to catch, and
// `fixtures/claimChild.ts` once called the removed `Control.pause` and
// died at runtime in every case that spawned it.
{ name: "Generated workflow drift", verb: Smithers.Verb.Lint, pattern: "//:ci" },
// The factory projection smithers.sh serves from the public mirror:
// the featured flows, the Dispatcher table, and the homepage,
// declared in .smithers/FACTORY.ts, rendered over the flows/ tree,
// checked in.
{ name: "Factory projection drift", verb: Smithers.Verb.Lint, pattern: "//:factoryProjection" },
// The declaration-derived target index smithers.sh reads from the
// public mirror, one row per labeled target, checked in.
{ name: "Target index drift", verb: Smithers.Verb.Lint, pattern: "//:targetIndex" }
]
},
{
id: "scripts",
name: "script gates",
runsOn: ubuntu,
// Run 36369423415: 13m18s; leave room for uncached work.
timeoutMinutes: 60,
toolchain: Smithers.CiToolchain.Needs({
cargoBinaries: nativeFilesystem,
runtimes: [node, bun],
jj,
ripgrep,
apt: bubblewrap,
go,
foundry,
postgres,
docker: dockerImageStore,
artifacts: Smithers.CiToolchain.Artifacts({
artifact: "ci-test-tier-evidence",
sources: [
{ from: "/tmp/smithers-ci-inventory-*.json" },
{ from: "/tmp/smithers-mutations-*" },
{ from: "/tmp/smithers-benchmark-*" },
{ from: "/tmp/smithers-runner-*.log" },
{ from: "/tmp/smithers-runner-*.json" }
]
})
}),
steps: [{ name: "Script gates", verb: Smithers.Verb.Test, pattern: "//scripts/..." }]
},
{
id: "docs",
name: "published package documentation",
runsOn: ubuntu,
timeoutMinutes: 45,
toolchain: Smithers.CiToolchain.Needs({ runtimes: [node, bun], apt: bubblewrap }),
steps: [{ name: "Package documentation tarballs", verb: Smithers.Verb.Test, pattern: "//scripts:packageDocs" }]
},
{
id: "apps-e2e",
name: "apps e2e (Playwright T1)",
runsOn: ubuntu,
// UI units and conformance plus the TUI; browsers run in their own jobs.
timeoutMinutes: 70,
toolchain: Smithers.CiToolchain.Needs({
cargoBinaries: nativeFilesystem,
runtimes: [node, bun],
jj,
ripgrep,
apt: bubblewrap,
artifacts: Smithers.CiToolchain.Artifacts({
artifact: "apps-e2e-artifacts",
sources: [
{ from: "/tmp/smithers-*.png" },
{ from: "apps/reports", as: "reports" },
{ from: "apps/app/test-results", as: "playwright-test-results" },
{ from: "apps/app/playwright-report", as: "playwright-report" }
]
})
}),
// Fail the UI's Linux checks promptly, without waiting behind the
// workspace graph. Each tier remains a required, separate command.
steps: [
{ name: "UI typecheck", verb: Smithers.Verb.Build, pattern: "//apps/app:check" },
{ name: "UI unit tests", verb: Smithers.Verb.Test, pattern: "//apps/app:unitTests" },
// The literal pin left the unit gate when `src/` became app source
// only; it is its own lint target over `apps/app/lint/conformance`.
{ name: "UI conformance lint", verb: Smithers.Verb.Test, pattern: "//apps/app:conformance" },
// The terminal UI's typecheck, lint, format check and Bun suite. Its
// shell-change capture runs the native helper this job installs.
{ name: "TUI typecheck, lint and tests", verb: Smithers.Verb.Ci, pattern: "//apps/tui/..." },
// The browser and tmux tiers are exclusive, so the wildcards above omit
// them and each runs here by label.
{ name: "TUI end-to-end suite", verb: Smithers.Verb.Test, pattern: "//apps/tui:e2eTests" }
]
},
{
id: "apps-browser-1",
name: "UI browser end-to-end shard 1",
runsOn: ubuntu,
timeoutMinutes: 45,
toolchain: Smithers.CiToolchain.Needs({
cargoBinaries: nativeFilesystem,
runtimes: [node, bun],
jj,
ripgrep,
apt: bubblewrap,
artifacts: Smithers.CiToolchain.Artifacts({
artifact: "apps-browser-1-artifacts",
sources: [
{ from: "/tmp/smithers-*.png" },
{ from: "apps/reports", as: "reports" },
{ from: "apps/app/test-results", as: "playwright-test-results" },
{ from: "apps/app/playwright-report", as: "playwright-report" },
// What a red step kept before the next cleared test-results/, and
// this run's stages.json (apps/app/scripts/run-pr-e2e.mjs says why).
{ from: "apps/app/stage-evidence", as: "stage-evidence" }
]
})
}),
steps: [{ name: "UI browser end-to-end shard 1", verb: Smithers.Verb.Test, pattern: "//apps/app:browserE2eShard1" }]
},
{
id: "apps-browser-2",
name: "UI browser end-to-end shard 2",
runsOn: ubuntu,
timeoutMinutes: 45,
toolchain: Smithers.CiToolchain.Needs({
cargoBinaries: nativeFilesystem,
runtimes: [node, bun],
jj,
ripgrep,
apt: bubblewrap,
artifacts: Smithers.CiToolchain.Artifacts({
artifact: "apps-browser-2-artifacts",
sources: [
{ from: "/tmp/smithers-*.png" },
{ from: "apps/reports", as: "reports" },
{ from: "apps/app/test-results", as: "playwright-test-results" },
{ from: "apps/app/playwright-report", as: "playwright-report" },
// What a red step kept before the next cleared test-results/, and
// this run's stages.json (apps/app/scripts/run-pr-e2e.mjs says why).
{ from: "apps/app/stage-evidence", as: "stage-evidence" }
]
})
}),
steps: [{ name: "UI browser end-to-end shard 2", verb: Smithers.Verb.Test, pattern: "//apps/app:browserE2eShard2" }]
},
{
id: "apps-browser-3",
name: "UI browser end-to-end shard 3",
runsOn: ubuntu,
timeoutMinutes: 45,
toolchain: Smithers.CiToolchain.Needs({
cargoBinaries: nativeFilesystem,
runtimes: [node, bun],
jj,
ripgrep,
apt: bubblewrap,
artifacts: Smithers.CiToolchain.Artifacts({
artifact: "apps-browser-3-artifacts",
sources: [
{ from: "/tmp/smithers-*.png" },
{ from: "apps/reports", as: "reports" },
{ from: "apps/app/test-results", as: "playwright-test-results" },
{ from: "apps/app/playwright-report", as: "playwright-report" },
// What a red step kept before the next cleared test-results/, and
// this run's stages.json (apps/app/scripts/run-pr-e2e.mjs says why).
{ from: "apps/app/stage-evidence", as: "stage-evidence" }
]
})
}),
steps: [{ name: "UI browser end-to-end shard 3", verb: Smithers.Verb.Test, pattern: "//apps/app:browserE2eShard3" }]
},
{
id: "rust",
name: "rust fmt + clippy + test",
runsOn: ubuntu,
timeoutMinutes: 30,
toolchain: Smithers.CiToolchain.Needs({
runtimes: [node],
rust: Smithers.CiToolchain.Rust({})
}),
steps: [
{ name: "Cargo lint gates", verb: Smithers.Verb.Lint, pattern: "//crates/flows-jj/..." },
{ name: "Third-party notices", verb: Smithers.Verb.Test, pattern: "//scripts:thirdPartyNotices" },
{ name: "Cargo test suite", verb: Smithers.Verb.Test, pattern: "//crates/flows-jj:cargoTest" },
{ name: "Daemon document component tests", verb: Smithers.Verb.Test, pattern: "//crates/smithers-machined:documentComponents" }
]
},
{
id: "rust-ffi",
name: "native FFI compiler and tests",
runsOn: ubuntu,
timeoutMinutes: 60,
toolchain: Smithers.CiToolchain.Needs({
runtimes: [node],
jj,
ripgrep,
apt: bubblewrap,
rust: Smithers.CiToolchain.Rust({ cache: false })
}),
steps: [{ name: "Native FFI clippy and tests", verb: Smithers.Verb.Build, pattern: "//:nativeFfi" }]
},
{
id: "wasm-repro",
name: "wasm reproducibility",
runsOn: ubuntu,
timeoutMinutes: 30,
toolchain: Smithers.CiToolchain.Needs({
runtimes: [node],
rust: Smithers.CiToolchain.Rust({ cache: false })
}),
steps: [
{ name: "Build-script unit tests", verb: Smithers.Verb.Test, pattern: "//crates/flows-jj:buildScript" },
{
name: "Rebuild and byte-compare flows_jj.wasm",
verb: Smithers.Verb.Test,
pattern: "//crates/flows-jj:wasmReproducibility"
}
]
},
{
id: "browser",
// This historical job id is pinned by the release roster contract.
// The displayed name and selected suite describe compilation, not E2E.
name: "web bundle compatibility",
runsOn: ubuntu,
timeoutMinutes: 10,
toolchain: Smithers.CiToolchain.Needs({ runtimes: [node] }),
steps: [{ name: "Web bundle compilation guard", verb: Smithers.Verb.Test, pattern: "//scripts:webBundleContract" }]
},
{
// One matrix over the three platforms, replacing the two copy-pasted