Repository navigation
5869 lines (5564 loc) · 332 KB
/
Copy pathci.yml
File metadata and controls
5869 lines (5564 loc) · 332 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
name: CI
on:
push:
branches:
- main
# ⭐ NO `branches:` filter here, deliberately (#16482). A `pull_request:`
# trigger filtered to `branches: [main]` does not run at all when the PR's
# base is a feature branch — and a workflow that does not run publishes NO
# check run, which is an ABSENCE, not a skip. Branch protection reads that as
# permanently pending, so every required context this file publishes reports
# nothing on such a PR. Measured on the #14478 stack: six card PRs showed
# 8-11 light checks and ZERO of the six required contexts; the first real
# signal arrived at the trunk PR, after every card was written, reviewed and
# merged. Correctness rested on local runs quoted into PR bodies — a
# discipline, not a gate.
#
# Runner cost of removing the filter, measured 2026-09-08 over the 30 days
# 2026-08-09 → 2026-09-08 (4000 PRs read, `sort=created&direction=desc` paged
# until the window closed): 6 of 4000 PRs had a base other than `main`
# (0.15%), all six the #14478/#15679 stack. At the window's measured 7008
# pull_request runs per workflow, 0.15% is ~10.5 extra runs per workflow per
# 30 days ≈ 2.5/week, or ~57 job-runs/week across both files at 23 job-runs
# per PR event. Even the pessimistic bound — one uncancelled run per one of
# those PRs' 115 commits — is 1.6% of current pull_request spend. Small, so
# the trigger is widened unconditionally rather than gated on a label or on
# "the base is an open PR's head" (#16482 records the arithmetic).
#
# ⛔ Do NOT mirror this widening onto the `push:` trigger above. `push:` is
# per-branch, not per-PR: unfiltering it would run this workflow on every
# push to every agent branch in the repo, which is a different and far larger
# population than the 6 PRs measured here.
pull_request:
# Merge queue: the queue builds each PR as speculatively merged onto the
# current main and only lands it if this workflow is green on that result —
# the race-free version of the "pull main and re-verify before merging"
# discipline (AGENTS.md multi-agent §7/§10). Every workflow that produces a
# branch-protection-required check MUST carry this trigger, or queue builds
# wait forever on a check that never reports.
merge_group:
# ── THE SCHEDULED FULL RUN (#16467), every 4 hours since #25771 ──────────
# `push` above now computes the Test Core package set with `--affected`
# against `github.event.before`, so a merge no longer re-tests the whole
# workspace it just tested in the queue. Something still has to run the FULL
# battery on `main`, on a clock, or "main is green" stops being a statement
# about the workspace and becomes a statement about the last diff.
#
# This is that run. Minute 0 rather than an offset minute ON PURPOSE, and
# against the sibling convention in test-nightly-tiers.yml: the reading this
# feeds — `scripts/ci/select-shard-timings-run.mjs` — wants one complete run
# per window far more than it wants a short queue wait, and a run that starts
# a few minutes late is still that window's run. What it must NOT do is
# collide with the next one, which the concurrency group below decides.
#
# EVERY 4 HOURS, not hourly (#25771, maintainer ruling Q6 = C): the job logic
# is unchanged — the run is still the full battery and still finds flakes on
# an unchanged SHA — at six runs a day instead of twenty-four, most of which
# re-tested a SHA an earlier run had already tested. Every runner-minute it
# spends competes with PR and merge-queue capacity.
#
# ⛔ This is a NEW TRIGGER KEY, not a widening of `push:`. The ⛔ above still
# binds: `push:` stays filtered to `main`.
schedule:
- cron: '0 */4 * * *'
# The same full battery, on demand: an operator who has just landed a fix for
# a red scheduled run should not have to wait up to 4 hours to see it answered.
# Treated as `full` by the selection script for the same reason `schedule` is.
workflow_dispatch:
# Superseded runs on the same PR waste runners and delay feedback; cancel them.
# A push to `main` is the opposite case, and gets a group of its OWN (#25373).
#
# ⭐ `github.event.after` IS LOAD-BEARING IN THIS KEY. A push run is the only
# run that tests ITS OWN merge: Test Core computes `--affected` against
# `github.event.before` (see `on.schedule` above), so a push run that does not
# finish leaves that merge's diff with no Test Core verdict on `main` until the
# next scheduled full run. (Since #31519 a push run whose every commit has a
# green queue run BORROWS that verdict, see `queue-verdict` below: its own
# verdict is then the jobs it runs plus the queue runs it names, and it still
# has to finish for its record and its seeds to land.) Main merges land every ~9–16 min and a push run takes ~27,
# so under the old shared key `ci-CI-push-refs/heads/main` the next merge
# cancelled it: 31 of 40 push runs on 2026-10-23 01:03Z–11:03Z, most of them
# inside "Run this shard's tests". (The Turbo seed is NOT what was lost: the
# "Save Turbo cache (main only)" steps are `if: always()` and run on a
# cancelled job too.) `cancel-in-progress: false` alone does NOT fix it:
# GitHub keeps ONE pending run per group and cancels it when a third arrives;
# replayed on the same 40 arrivals, 18 still die. So the push segment is the
# pushed commit. `github.event.after` is set on a push and absent on
# `schedule`, `workflow_dispatch` and `merge_group`, which still fall through
# to `github.ref`; on `pull_request` the PR number wins before it is reached.
# Two push runs never share a group, so every one runs to completion. The seed
# key carries `github.sha`, so two overlapping main runs never write the same
# key.
#
# ⭐ `github.event_name` IS LOAD-BEARING TOO (#16467). A `schedule` and a
# `workflow_dispatch` run on `main` both fall through to `refs/heads/main`;
# without the event name they share one group and an on-demand run cancels the
# scheduled one (and, under any key that drops `github.event.after`, the next
# merge cancels both, which is how 36 of 60 hourly-era push runs died).
#
# ⛔ Do not "simplify" either segment away. `scripts/ci/scheduled-full-run.mjs
# --check-concurrency` evaluates this expression against push, schedule,
# dispatch, PR and queue contexts on two different commits. It reds when two
# pushes share a group, when a push shares one with a schedule or dispatch run,
# or when two schedule, dispatch or same-PR runs stop sharing one (a run-unique
# key such as `github.sha` or `github.run_id` would switch cancellation off for
# those events too).
#
# `cancel-in-progress` stays `true`: with a per-commit push group it never
# fires on a push, and for everything else it is the policy. Two scheduled
# runs overlapping means one of them is over 4 hours old, and a 4-hour-old
# measurement of `main` is strictly the worse of the two. Test Core's wall clock
# is well inside the cadence (~39 shard-minutes across the shards), so this is
# the exceptional path, not the normal one.
concurrency:
group: ci-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.event.after || github.ref }}
cancel-in-progress: true
# ── THE TWO SPEEDS (#22998) ──────────────────────────────────────────────────
# A `pull_request` run carries the FAST SET: `Build Core`, `Test Core`
# (affected-only) and `Build Docs`. A `merge_group` run carries the fast set
# plus the three `dogfood` shards (#30461, ruling record 6663883327, letter B),
# whose job alone spells
#
# github.event_name != 'pull_request'
#
# in its `if:`, so a dogfood red shows on the queue build of the entry that
# carries it rather than first on `main`'s push run after it, and the red
# ejects that entry: the context is in the required set again (below).
# `main`'s 4-hourly `schedule` run, its `push` runs and an on-demand
# `workflow_dispatch` carry the FULL BATTERY: all of that plus the jobs
# below that spell
#
# github.event_name != 'pull_request' && github.event_name != 'merge_group'
#
# in their `if:` — `dogfood-verify` and `ui-published-artifacts` — and
# `temporal-conformance`, which since ruling record 7146156389 (#37095)
# also runs on a `merge_group` entry whose diff hits the filter's
# `temporal_live` paths (never on `pull_request`). It is in the required set
# again (ruling record 7238262118), so a red on that queue run ejects the
# entry instead of landing on `main`. Nothing is deleted: the jobs moved off the per-PR
# path, `ui-published-artifacts` never had one (#26717). A red in one of them is a main-red
# for the owning lane, and the publish lane reads the full battery before its
# approval (release.yml's `full-battery` job,
# `scripts/ci/scheduled-full-run.mjs --release-gate`). ⛔ No affected-only
# dogfood filter on the queue: the shards run on every entry, through the
# `core` output, which is 'true' on `merge_group` (letter C was not ruled).
# The queue enforces only the ruleset's required set. `Dogfood Regression
# Gate` left it by #22998 and rejoined it by the #30461 follow-up ruling
# (ruling record 6669982756); `Temporal Conformance (live PG + MySQL)` left it
# by #22998 and rejoined it by ruling record 7238262118 (#38087).
# check:required-contexts pins both rows.
#
# Spelled as a DENY-list of the per-PR events on purpose — the filter
# contract's half 1 below, applied to events: a trigger added to `on:` later
# RUNS these jobs, and the failure direction of a wrong guess is a slower PR,
# never a full battery that silently stopped running. `dogfood-gate` keeps
# `if: always()` (check:shard-attestation pins it): with both legs skipped (a
# pull request) it counts zero expected attestations and concludes success,
# exactly as on a filter-skipped diff; on a queue build it counts the three
# shards' credentials and `dogfood-verify`'s skip as zero expected.
#
# ── A PUSH RUN BORROWS WHAT THE QUEUE RAN (#31519) ────────────────────────────
# Every commit the merge queue lands was tested there on the SAME sha, so on
# the same tree and the same ci.yml. Measured over the 136 push runs of
# 2026-11-07T13:00Z to 2026-11-08T13:00Z: 136 of 136 ran on a sha with a green
# queue run, built on the commit's first parent (208 of 208 commits). So a push
# run asks first: `queue-verdict` walks the pushed commits and reads each one's
# newest `merge_group` run (scripts/ci/scheduled-full-run.mjs HALF 4, which
# carries the rules). Only when EVERY commit is covered does the push borrow:
#
# still runs filter, the probe and its record (`Borrowed queue verdict`),
# the three main-only jobs above, Type Check UI and Lint UI
# (wider on push; Lint UI also seeds its Turbo cache on push
# only), Build Core and Build UI Deps (their seeds), and the
# Test Core and dogfood shards as SEED-ONLY legs: the plan and
# the closure build (replayed from the remote cache the queue
# wrote), the prune and the save; no tests, no attestation;
# Test UI runs unless the head's queue run ran the whole suite green on
# all sixteen shards (`borrowed-verdict` decides, #31519 Q2 = B);
# skips Build Docs, Build & E2E UI, Live E2E UI, and the three
# aggregates (`Test Core`, `Dogfood Regression Gate`, `Test
# UI`), which would otherwise read green over legs that never
# ran. A push run gates no merge, so no required context is lost.
#
# Every job spells it `needs.queue-verdict.outputs.covered != 'true'`, so a
# probe that is skipped (every other event) or dies leaves the empty string
# and the job runs exactly as before: the probe fails toward running.
# `borrowedVerdictWiring` in that script pins the spellings, the record job's
# name (the release gate reads it to re-check the queue run) and that no
# main-only job reads the probe. The 4-hourly `schedule` run is untouched: it
# is the full battery.
# ⭐ EVERY GIT TRANSFER IN THIS FILE IS BOUNDED BY ITS BYTE RATE (#34994).
# A git HTTP request that moves under 1000 bytes/s for 120 s is aborted by curl
# (exit 128, "curl 28 Operation too slow"), so the retry around it runs:
# actions/checkout's own fetch retry (3 attempts) and the "Fetch this commit's
# history" step's (scripts/ci/fetch-history.sh, 3 attempts). On 2026-11-16/17,
# 48 checkout or fetch steps here and in lint.yml ran to their 8-25 minute
# budget with no index-pack running: the server never started the pack, while
# its `remote:` progress kept the log moving, and siblings in the same run
# took 51-65 s. The slowest healthy wait for the pack is ~15 s and a healthy
# receive runs at MiB/s, so neither number cuts a slow transfer that moves.
# The step budgets stay the outer wall. Same block in lint.yml; the script
# sets the same defaults for a local run.
env:
GIT_HTTP_LOW_SPEED_LIMIT: '1000'
GIT_HTTP_LOW_SPEED_TIME: '120'
jobs:
queue-verdict:
name: Queue verdict
# Push only, and before anything else: every borrowing job needs it.
# The two pr-event terms come first so check-expected-skips reads the
# skip on a PR and in the queue as expected; the push term decides.
if: github.event_name != 'pull_request' && github.event_name != 'merge_group' && github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 5
# `actions: read` is the merge_group run listings and the head run's jobs;
# `contents: read` is the checkout and the compare of before...after.
permissions:
actions: read
contents: read
outputs:
covered: ${{ steps.probe.outputs.covered }}
runs: ${{ steps.probe.outputs.runs }}
ui_full_green: ${{ steps.probe.outputs.ui_full_green }}
steps:
# The script imports node builtins and its own siblings only (release.yml's
# `full-battery` runs it the same way), so no install.
- name: Checkout the scripts
uses: actions/checkout@v7
with:
sparse-checkout: scripts
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
# `continue-on-error`: a probe that crashes leaves `covered` empty, and
# empty means the whole battery runs. It must never red the push run.
- name: Ask the merge queue whether it ran every pushed commit green
id: probe
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
OS_PUSH_BEFORE: ${{ github.event.before }}
OS_PUSH_AFTER: ${{ github.event.after }}
run: node scripts/ci/scheduled-full-run.mjs --queue-verdict --before "$OS_PUSH_BEFORE" --after "$OS_PUSH_AFTER"
borrowed-verdict:
# The run's record that it borrowed, and the job the release gate looks
# for by NAME (scheduled-full-run.mjs HALF 3): when it ran, the gate
# re-reads the head commit's queue run. Do not rename it.
name: Borrowed queue verdict
needs: queue-verdict
# The pr-event terms are for check-expected-skips, as on queue-verdict.
if: ${{ success() && github.event_name != 'pull_request' && github.event_name != 'merge_group' && needs.queue-verdict.outputs.covered == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
outputs:
test_ui: ${{ steps.test-ui.outputs.test_ui }}
steps:
# Depth 2: the selector below diffs the head against its first parent.
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 2
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
- name: Name the queue runs this push borrows
env:
OS_QUEUE_RUNS: ${{ needs.queue-verdict.outputs.runs }}
run: |
{
echo '### Borrowed queue verdict'
echo
echo 'Every pushed commit has a green `merge_group` run of this workflow on its first parent. Head first:'
echo
for id in ${OS_QUEUE_RUNS//,/ }; do
echo "- ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/$id"
done
} | tee -a "$GITHUB_STEP_SUMMARY"
# #31519 Q2 = B. Test UI is borrowed only when the head's queue run ran
# all sixteen shards green (the probe's `ui_full_green`) AND that run
# selected the WHOLE suite. The second half is recomputed here with the
# queue's own selector on the same tree against the same base: the probe
# checked that the queue run was built on the head's first parent, which
# is the base its Test UI select step read. Anything else, a selector
# error included, runs the whole suite on this push.
- name: Decide whether Test UI runs on this push
id: test-ui
env:
OS_UI_FULL_GREEN: ${{ needs.queue-verdict.outputs.ui_full_green }}
run: |
decision=run
if [ "$OS_UI_FULL_GREEN" != 'true' ]; then
echo "The head's queue run did not run all sixteen Test UI shards green: Test UI runs on this push."
elif [ ! -f ui/package.json ]; then
echo 'No ui/ tree on this commit: nothing to borrow.'
else
status=0
parent=$(git rev-parse HEAD^1) || status=2
if [ "$status" -eq 0 ]; then
node ui/scripts/select-affected-tests.mjs --base "$parent" --out "$RUNNER_TEMP/affected-tests.txt" \
> "$RUNNER_TEMP/select.out" || status=$?
cat "$RUNNER_TEMP/select.out"
fi
if [ "$status" -eq 0 ] && [ "$(tail -n 1 "$RUNNER_TEMP/select.out")" = 'mode=full' ]; then
decision=skip
echo "The head's queue run ran the whole ui suite (base $parent) on sixteen green shards: Test UI is borrowed."
else
echo "The head's queue run ran the affected ui tests only, or the selector reached no verdict (exit $status): Test UI runs the whole suite on this push."
fi
fi
echo "test_ui=$decision" >> "$GITHUB_OUTPUT"
filter:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: read
outputs:
# On the `schedule` / `workflow_dispatch` full runs (#16467) everything
# counts as changed: dorny/paths-filter is skipped there (no diff to
# resolve), a skipped step's output is the empty string (falsy), and
# `|| 'true'` supplies the value without touching PR/push behavior.
#
# On merge_group the step RUNS (the diff is the queue base_sha against
# the group head, see the step below), but only the three ui outputs
# and `temporal_live` (#37095) read it. `docs`, `core` and `crosspkg` stay 'true' there through the
# `github.event_name != 'merge_group' &&` guard: the queue build is the
# last validation before main, and those jobs run on every entry, as
# they did before the step ran on this event. On any other event the
# guard is true and the expression reads exactly as `<output> ||
# 'true'` did.
docs: ${{ github.event_name != 'merge_group' && steps.changes.outputs.docs || 'true' }}
# Read by `test-plan`, `test` (ORed with `crosspkg`) and `build-core`,
# on merge_group / push / schedule by `dogfood`, and on push / schedule
# by `dogfood-verify` and `temporal-conformance` (which on merge_group
# reads `temporal_live` instead, #37095) — see the `core` filter below
# and each job's `if:`.
core: ${{ github.event_name != 'merge_group' && steps.changes.outputs.core || 'true' }}
# Gates the `test` job ONLY, ORed with `core` — see the `crosspkg`
# filter below and the `test` job's `if:` (#9829, #10015).
crosspkg: ${{ github.event_name != 'merge_group' && steps.changes.outputs.crosspkg || 'true' }}
# [#37095] Read by `temporal-conformance` on merge_group ONLY: the queue
# build runs that job when the merged diff touches the paths in the
# `temporal_live` filter below (ruling record 7146156389, which revises
# #22998 for this one job). Every other event ignores it. Fail-open like
# the ui outputs: a queue build whose step failed reads '' → 'true'.
temporal_live: ${{ steps.changes.outputs.temporal_live || 'true' }}
# The objectui tree under `ui/` (objectstack#25677). Three outputs, read
# together by the five `* UI` jobs at the bottom of this file (Type Check
# UI, Test UI, Lint UI, Build & E2E UI and Live E2E UI):
# ui — a path under ui/, a root file the ui jobs build from
# (the lockfile, the workspace, turbo.json), or a root
# the ui gates read (every root workflow, the prompts,
# the objectui skill bundle; see the filter below);
# ui_consumers — one of the seven packages objectui installs from this
# tree changed, so the Console is compiled (Type Check
# UI), built (Build & E2E UI) and tested (Test UI, since
# objectstack#28220) against the new shape in the PR
# that moves it;
# ui_tree — `ui/package.json` exists in this checkout.
# On merge_group `ui` and `ui_consumers` come from the queue diff
# (objectstack#25867): an entry whose merged diff against
# `merge_group.base_sha` touches no ui path and none of the seven
# packages skips the five ui jobs, exactly as the same diff does on its
# PR head; an entry that touches one runs them (Lint UI reads `ui`
# alone, so one of the seven by itself does not start it). If the step
# fails (the base cannot be fetched, the diff errors), it is
# `continue-on-error` there, its outputs are empty and `|| 'true'` runs
# every ui job.
#
# `ui_tree` is what keeps the ui jobs SKIPPED, not failed, on a tree that
# does not carry ui/ yet: `ui` and `ui_consumers` fall back to 'true' on
# schedule / dispatch (half 1 below), and on push to main a spec change
# sets `ui_consumers`, so neither path output alone can tell a job there
# is nothing to build. Its step runs on every event, so the `|| 'true'`
# fallback is reached only when this job died before it — and then THE
# FILTER CONTRACT's "run everything" is the intended reading.
ui: ${{ steps.changes.outputs.ui || 'true' }}
ui_consumers: ${{ steps.changes.outputs.ui_consumers || 'true' }}
ui_tree: ${{ steps.ui-tree.outputs.present || 'true' }}
# ── THE FILTER CONTRACT, both halves (#4928) ──────────────────────────
#
# Half 1 is the `|| 'true'` above: when in doubt, RUN EVERYTHING. It
# covers a missing output VALUE.
#
# Half 2 is every downstream `if:` in this file, and it used to be
# missing. GitHub wraps an `if:` that names no status function in an
# IMPLICIT success(), so the original `if: needs.filter.outputs.core ==
# 'true'` had TWO independent paths to "skip" when this job DIED
# (checkout flake, a dorny/paths-filter fault, the 10-minute timeout):
# the implicit success() is false, and the output is no longer a
# trustworthy 'true'. Both roads led to skipping test / dogfood /
# build-core — and skipped counts as SUCCESS in branch protection, so a
# single flake here produced a fully green, zero-test-run, mergeable PR
# with no red signal anywhere.
#
# So every downstream job now spells the contract as "skip only when the
# filter EXPLICITLY said false":
#
# if: ${{ !cancelled() && needs.filter.outputs.<name> != 'false' }}
#
# `!cancelled()` displaces the implicit success() (a genuine run-level
# cancellation still skips — #3668's lifecycle reasoning); `!= 'false'`
# makes the empty string mean "run", exactly like `|| 'true'` does. This
# is deliberately robust to BOTH readings of what a failed job's outputs
# are — null/empty or the `|| 'true'` fallback — because `'' != 'false'`
# and `'true' != 'false'` are both true. The old form was broken under
# both, because the implicit success() dominates either way.
#
# Third occurrence of this GitHub semantic in one audit; the other two
# were release.yml's publish-integrity guard and its docker job (#4900).
steps:
- name: Checkout repository
uses: actions/checkout@v7
# No `if:` on purpose: every event needs this answer, and a skipped step
# would hand `ui_tree` the `|| 'true'` fallback on a tree without ui/.
- name: Detect the imported ui/ tree
id: ui-tree
run: |
if [ -f ui/package.json ]; then
echo 'present=true' >> "$GITHUB_OUTPUT"
echo 'ui/package.json is present: the ui jobs are scheduled by the ui / ui_consumers outputs.'
else
echo 'present=false' >> "$GITHUB_OUTPUT"
echo 'ui/package.json is absent: every ui job skips on this run.'
fi
# ⭐ SPELLED AS AN ALLOW-LIST, never as a deny-list (#16467). This
# action reads a diff, and only three events hand it one it can resolve
# unaided: `pull_request` (base vs head), `push` (`event.before` vs
# `after`) and `merge_group` (the payload's `base_sha` vs `head_sha`; at
# the pinned v4.0.3, src/main.ts reads both when `base` / `ref` are
# unset, and src/git.ts fetches the base sha at depth 1 and diffs the two
# trees, `base..head`). `schedule` and `workflow_dispatch` hand it
# neither, and under a deny-list spelling they would RUN the action with
# no resolvable base.
#
# That failure direction is the dangerous one: every filter output would
# come back `false`, `|| 'true'` supplies nothing (the output exists and
# says `false`), and every downstream `!= 'false'` guard SKIPS — so the
# scheduled full run would have been an entirely green, entirely empty run
# of nothing at all. An allow-list makes each new event fail toward
# THE FILTER CONTRACT's half 1 instead: the step is skipped, its outputs
# are the empty string, `|| 'true'` fills them in, and everything runs.
#
# `merge_group` joined the list for the ui outputs (#25867; the
# three core-side outputs above ignore the step on that event), and
# `temporal_live` reads it there too since ruling record 7146156389
# (#37095: `temporal-conformance` runs on a queue entry that hits it). Its
# `continue-on-error` is the fail-open half there: a queue build whose
# base cannot be fetched reads as "run every ui job", never as a red
# `filter` job. On pull_request and push a failure stays red, as before.
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: changes
if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'merge_group'
continue-on-error: ${{ github.event_name == 'merge_group' }}
with:
filters: |
docs:
- 'apps/docs/**'
- 'content/**'
- 'pnpm-lock.yaml'
- '.github/workflows/ci.yml'
# Build Docs' setup (#27673): see the same three rows under `core:`.
- '.nvmrc'
- '.github/actions/setup-workspace/**'
- '.github/actions/setup-pnpm/**'
# setup-pnpm materialises the pnpm the root manifest's
# `packageManager` field pins (#27717), so a diff confined to
# that field changes the pnpm Build Docs installs with. `core:`
# already carries this row for its own jobs.
- 'package.json'
core:
- 'packages/**'
- 'examples/**'
- 'apps/!(docs)/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'tsconfig.json'
- 'tsconfig.base.json'
- 'tsconfig.test.base.json'
- 'vitest.preset.mts'
- '.github/workflows/ci.yml'
# THE SETUP EVERY CORE JOB RUNS FIRST (#27673): each one starts
# with `./.github/actions/setup-workspace`, which calls
# `./.github/actions/setup-pnpm` and hands actions/setup-node
# `.nvmrc` as its `node-version-file`. Before these rows a diff
# confined to one of the three matched no list here, so every job
# that runs it skipped on the PR and the change first ran in the
# merge queue. One row per action, not `.github/actions/**`:
# `half-state-patrol` is no step of any job in this file. The
# `docs` and `ui` lists carry the rows their own jobs run.
- '.nvmrc'
- '.github/actions/setup-workspace/**'
- '.github/actions/setup-pnpm/**'
# BUILD INPUTS outside every package (#21202): turbo.json itself,
# its `globalDependencies`, and each `$TURBO_ROOT$/…` input of a
# build task Build Core's `pnpm build` runs. A diff confined to
# one of them moves the build hashes it reaches, and before these
# entries it matched nothing here, so Build Core skipped and the
# merge queue ran that build first (PR #21199, turbo.json only).
# Every core-gated job starts on such a diff, not Build Core
# alone: each one builds, and turbo re-runs every task downstream
# of a moved build hash.
#
# scripts/check-ci-filter-parity.mjs DERIVES the required set from
# turbo.json and the root `build` script, and reds while a declared
# build input is uncovered here, or while a literal entry beside
# them covers none of them and none of Build Core's guards below
# (a leftover). `tsconfig.json` and the
# `packages/cli/...` input are covered by the entries above;
# `@objectstack/docs#build` (its input is `content/**`) is the
# docs filter's, since `pnpm build` excludes that package.
#
# WIDTH: literal files, not `scripts/**`. Over the 3288
# first-parent commits of `main` in the 30 days to `1371dc980c`,
# through picomatch 2.3.1 and 4.0.5 (they agree on every row),
# `core` matched 2247; these entries add 28, `scripts/**` with
# turbo.json and tsup.config.ts would add 593, 516 of them diffs
# touching a `scripts/pm/` tool or a `scripts/check-*` gate.
- 'turbo.json'
- 'tsup.config.ts'
# `@objectstack/skills#build` copies the repository root's
# `skills/**` into its publish tree, so that catalog is a build
# input of a task `pnpm build` runs (turbo.json declares it as
# `$TURBO_ROOT$/skills/**`; check-ci-filter-parity holds it here).
- 'skills/**'
- 'scripts/build-input-hash.mjs'
- 'scripts/check-dev-prereqs.mjs'
- 'scripts/check-dts-emitted.mjs'
- 'scripts/check-dts-references.mjs'
- 'scripts/check-regen-pending.mjs'
- 'scripts/cli-build-prerequisite.mjs'
- 'scripts/git-env.mjs'
- 'scripts/import-prerequisite.mjs'
- 'scripts/invoked-as.mjs'
- 'scripts/js-comment-mask.mjs'
- 'scripts/regen-artifacts.mjs'
- 'scripts/sync-scaffold-emission-policy.mjs'
- 'scripts/sync-template-versions.mjs'
- 'scripts/ts-parse.mjs'
- 'scripts/tsup-drop-sources-content.mjs'
- 'scripts/workspace-enumerator.mjs'
# The ui tree's root build inputs (#27283): turbo.json's generic
# `build` task hashes them for every `@object-ui/*` build, and the
# same task runs for every package `pnpm build` builds, so a diff
# confined to one moves Build Core's hashes too.
- 'ui/tsconfig.json'
- 'ui/scripts/vite-*.ts'
- 'ui/scripts/build-plugin-stylesheet.mjs'
- 'ui/scripts/check-dist-completeness.mjs'
- 'ui/scripts/invoked-as.mjs'
- 'ui/scripts/vitest-invocation-guard.mjs'
# The Console's vite config emits its Service Worker from this
# generator's source (#29155), so it is a build and test input of
# every `@object-ui/*` package in turbo.json.
- 'ui/packages/mobile/src/serviceWorkerSource.ts'
# TEST INPUTS outside every package (#27961): each `$TURBO_ROOT$/…`
# input of turbo.json's generic `test` task. That task runs for
# every package Test Core tests, so a diff confined to one moves
# every `#test` hash, and before these rows Test Core first ran on
# it in the merge queue. `vitest.preset.mts` above and the
# `vite-*.ts` / `vitest-invocation-guard.mjs` build rows cover the
# other three; check-ci-filter-parity derives the set from
# turbo.json and reds while one is uncovered here.
- 'ui/vitest.config.mts'
- 'ui/vitest.setup.*'
- 'ui/scripts/test-shard-*'
- 'ui/apps/console/vitest.config.ts'
- 'ui/apps/console/vite.config.ts'
# BUILD CORE'S GUARDS (#21341): every repository script the
# build-core job's own steps run (named by a `run:` step or
# reached through its `pnpm check:*` alias) and each one's
# first-party imports. Build Core is the only job that runs
# them, so before these rows a diff confined to one started no
# Build Core and the changed guard ran nowhere before the merge
# queue (PR #17100 changed only check-lean-entry-closure.mjs;
# Build Core skipped). A change to the guard runs the guard.
#
# Not a hand-kept list: scripts/check-ci-filter-parity.mjs
# DERIVES the set from the job's steps and reds while a script a
# step runs is uncovered here, or while a literal row covers
# neither a build input nor such a script (a leftover of a
# deleted step). Scripts that are also build inputs
# (check-dts-emitted.mjs and the helpers the guards import) are
# covered by the rows above and are not repeated.
# population-floor.mjs is here because check-dual-build-cjs-
# loads.mjs imports it.
#
# WIDTH: over the 3287 first-parent commits of `main` in the 30
# days to `96b12b589f`, through picomatch 2.3.1 and 4.0.5 (they
# agree on every row), `core` matched 2276; these rows add 2.
- 'scripts/check-dts-closure.mjs'
- 'scripts/check-dual-build-cjs-loads.mjs'
- 'scripts/check-lean-entry-closure.mjs'
- 'scripts/check-sourcemap-no-sources-content.mjs'
- 'scripts/ci/assert-turbo-remote-cache.mjs'
- 'scripts/ci/prune-turbo-cache.mjs'
- 'scripts/population-floor.mjs'
# [#38528] The temporal_live coverage gate Build Core runs before
# the build (its step says why there): a change to the gate runs
# the gate.
- 'scripts/check-temporal-live-filter.mjs'
# Test inputs that live OUTSIDE every package (#9829, #10015). Packages
# whose suites read across their own boundary declare that radius in
# scripts/check-cross-package-test-inputs.mjs, and turbo.json mirrors each
# as a `$TURBO_ROOT$/…` input. The step that pulls those packages back into
# the affected set, `--union-into` in the `test` job below, is a step
# INSIDE that job — so when NO filter matches the changed path the job
# never starts, the union never runs, and the declaration buys nothing at
# PR time: the merge queue is the first signal, which is the #7802 failure
# this whole mechanism exists to prevent.
#
# Measured by instantiating every one of turbo.json's `$TURBO_ROOT$`
# declarations to a real tracked file and running it through these filters
# with picomatch — the matcher dorny/paths-filter uses — under BOTH 2.3.1
# (what the action's own lockfile resolves and ncc-bundles) and 4.0.5 (what
# this tree resolves); the two agree on every row. On `0bfbeb70c`, 19 of 64
# declarations were core=false. #9829 closed the nine rooted at `scripts/`;
# the four roots added below are the remaining ten (#10015).
#
# Deliberately a SEPARATE output rather than a widening of `core`, because
# it gates ONE job — the `test` job ORs it with `core`, while Build Core,
# Dogfood and Temporal Conformance stay filtered exactly as they are today.
# That separation is what makes `content/**` affordable at all. Widening
# `core` would put the whole core pipeline on every docs PR; here a
# docs-only diff starts Test Core, whose package set is `turbo ls
# --affected` (empty for such a diff) UNIONED with the packages whose
# declarations matched — so it runs the declaring package, not the
# workspace. Measured through the real `--union-into` on all three
# content-only commits in the window below: `create-objectstack` alone,
# all three times, against a positive control where a
# `packages/lint/src/**` diff unions in @objectstack/spec and
# @objectstack/core.
#
# WIDTH, per entry — each is exactly what some package declared, never a
# root rounded up:
# `scripts/**` and `content/**` are declared verbatim, by
# @objectstack/spec and create-objectstack respectively, so the
# narrower filter does not exist and a hand-kept list of the paths
# inside them is the failure mode #7802 recorded ("a list you must
# remember to update"). Eight further single-file `scripts/`
# declarations and six narrower `content/docs/…` ones (spec, cli,
# dogfood) sit inside the two.
# The last four are a single file, a single subtree, a single file and a
# single file, because that is what the declarations say — NOT `docs/**`,
# `skills/**` or `.github/workflows/**`. Over the last 100 first-parent
# commits of `main` at `0bfbeb70c`, three of those roots would newly have
# started Test Core on 5, 2 and 3 commits; the declared paths on ZERO.
# `skills/objectstack-automation/SKILL.md` joined later (#10178) and was
# NOT in that window's measurement — it is declared by @objectstack/rest,
# one file, and the `skills/**` root it sits in is still declined here.
#
# PRICE, re-measured over that same 100-commit window through this matcher:
# Test Core scheduling goes 80/100 → 83/100. All three additions are
# content-only docs commits, and each runs one package's suite.
#
# This list is a SECOND recognizer of those declarations and is kept in
# step with them BY HAND: nothing fails today when a declaration lands in a
# root no entry here covers. Closing that is #10379.
crosspkg:
- 'scripts/**'
- 'content/**'
- 'docs/audits/2026-07-unknown-key-strictness-ledger.md'
- 'skills/objectstack-formula/**'
- 'skills/objectstack-automation/SKILL.md'
# @objectstack/spec's scripts/export-list.test.ts corpus gate reads
# the whole published catalog (#12201). Verbatim per the declaration;
# it subsumes the two narrower skills entries above, which are left
# as the packages that declared them spelled them.
- 'skills/**'
- '.github/workflows/scaffold-e2e.yml'
- '.claude/skills/spec-property-retirement/SKILL.md'
# @objectstack/lint's production-witness suite reads the repo-root
# SDUI manifest (#12924) — verbatim per the declaration in
# scripts/cross-package-test-inputs.mjs (check:ci-filter-parity
# holds this list to the declarations; the examples/ page files
# the same suite declares are covered by entries the core filter
# already carries).
- 'sdui.manifest.json'
# @objectstack/rest's meta-state-route-doc-spelling test discovers
# its population instead of listing it (#14561): it asks git for
# the authored-prose corpus under content/, docs/ and skills/ and
# judges every file that mentions the route. Verbatim per that
# declaration. `content/**` and `skills/**` above already cover
# two of the three roots; this is the third, and the FIRST entry
# to open the `docs/` root that the WIDTH note above records as
# declined — declined then because no declaration reached past
# `docs/audits/...`, and reached now because one does. The
# narrower audits entry is left as the package that declared it
# spelled it, exactly as the two narrower `skills/` entries were.
- 'docs/**'
# @objectstack/mcp's src/skill-md.test.ts imports the Console's
# "Download skill" mirror and pins it byte-identical to the
# SKILL.md the server renders (#31017) -- the server's half of the
# drift pin ui/apps/console/src/pages/developer/
# objectstack-skill.test.ts carries since #30865. That Console
# half runs only when Test UI starts, which a diff confined to
# packages/mcp never does; this half runs in Test Core on every
# packages/mcp change, `core` already starting it. Verbatim per
# the declaration, one file: a mirror-only diff starts Test Core
# here and `--union-into` adds @objectstack/mcp to it.
- 'ui/apps/console/src/pages/developer/objectstack-skill.ts'
# The objectui tree, the root files the ui jobs build from, and the
# five paths outside ui/ that the ui jobs' gates and tests read
# (objectstack#25712):
# - every root workflow, not ci.yml alone: Lint UI's pre-install
# import graph check scans all of `.github/workflows/` for ui
# scripts run before an install. ci.yml, the guard itself, is
# one of them. Measured over the 211 merges of the 7 days before
# this entry: 3 changed another workflow and no ui path;
# - `.github/prompts/**`, where objectui's prompts moved in
# objectstack#25957 and which Lint UI's prompt-keys check reads;
# - `skills/objectui/**`, objectui's skill bundle since
# objectstack#26097. Lint UI's skill gates (skills-paths,
# skill-examples, skill-eval-tokens, doc-json,
# shell-escape-residue) and Test UI's skill readers find it
# through `ui/scripts/skill-bundle-root.mjs`;
# - `content/docs/frontend/**`, the ObjectUI SDK pages since the
# objectui.org docs folded into this site. Lint UI's doc gates
# (doc-types, doc-snippets, doc-json, doc-fences, spec-symbols)
# and the Test UI tests that render a guide's example read them;
# - `content/docs/ui/pages.mdx`, where the per-element data
# binding section of the old data-source guide landed. Two Test
# UI pins read its fences and its block table (objectstack#27145).
# And, a class of its own outside that count: each file outside ui/
# that a ui test reads, named verbatim (objectstack#37935, #38133;
# the group at the end of this list). `check:ci-filter-parity`
# derives those rows from the ui tests and holds them to them both
# ways, and pins this whole step's input and every ui job's `if:`
# (objectstack#38132).
ui:
- 'ui/**'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'turbo.json'
- '.github/workflows/**'
- '.github/prompts/**'
- 'skills/objectui/**'
- 'content/docs/frontend/**'
- 'content/docs/ui/pages.mdx'
# turbo.json's `globalDependencies`: every build task hashes
# them, so they move what the ui jobs build, the SDUI manifest's
# regeneration included (#26137).
- 'tsconfig.json'
- 'tsconfig.base.json'
- 'tsconfig.test.base.json'
- 'tsup.config.ts'
# The committed SDUI manifest, its record, its producer and its
# offline gate. Build & E2E UI regenerates the manifest and
# compares it with the committed bytes (#26137), so a diff that
# moves only one of these still runs that comparison.
- 'sdui.manifest.json'
- 'scripts/sdui-manifest.record.json'
- 'scripts/gen-sdui-manifest-node.mjs'
- 'scripts/check-sdui-manifest.mjs'
# The setup every ui job runs first (#27673):
# `./.github/actions/setup-pnpm`, and `.nvmrc`, which each job's
# actions/setup-node step reads as `node-version-file`. A diff
# confined to either matched no list, so no ui job ran it on the
# PR, nor in the queue, where these outputs read the same diff.
- '.nvmrc'
- '.github/actions/setup-pnpm/**'
# The root manifest, because setup-pnpm reads its `packageManager`
# field to pick the pnpm every ui job runs (#27717). A diff
# confined to a pnpm bump matched no list here, so the ui jobs
# skipped on the PR and in the queue alike.
- 'package.json'
# The root path walker, which ui/scripts/select-affected-tests.mjs
# imports at run time (`loadPathWalker`) to place every ui test:
# select-affected-tests.test.ts asserts on it. A read inside an
# imported ui module, which the gate's ui-test scan does not see,
# so it is named here rather than in the group below.
- 'scripts/check-cross-package-test-inputs.mjs'
# ── UI TEST READS OUTSIDE ui/ ───────────────────────────────
# Each file outside ui/ that a ui test reads, named verbatim
# (#37935, #38133). A diff confined to one could break the test
# that reads it while starting no ui job, on the PR or in the
# queue (this list reads the queue diff too). Named files rather
# than a subtree: a subtree row would start the whole ui battery
# on every edit beside the one file a test reads, and `ui_consumers`
# already covers the seven packages it names.
# `check:ci-filter-parity` derives the readers from the ui tests
# and holds every row below this heading to them, both ways. A
# read deliberately left unscheduled is a `ui-read trade-off:`
# line naming the file and why, never a missing row.
#
# studioMenuPlacement.test.ts holds ADR-0084's type-to-group
# table equal to the Studio menu code.
- 'docs/adr/0084-application-builder-information-architecture.md'
# quick-reference-commands-4149.test.ts holds the root
# CONTRIBUTING.md's UI Workspace commands to the ui scripts.
- 'CONTRIBUTING.md'
# identityImportFields.endpointColumns-34536.test.ts holds the
# identity import dialog's columns to what the endpoint reads.
- 'packages/plugins/plugin-auth/src/admin-import-users.ts'
# The ui shard planner and selector tests import the shard
# count from the root roster reader, which imports invoked-as.
- 'scripts/ci-shard-matrix.mjs'
- 'scripts/invoked-as.mjs'
# metadata-form-option-names.test.ts loads the platform zh-CN
# forms pack through `new URL(literal, import.meta.url)` and holds
# the Console's option maps equal to it.
- 'packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts'
# ui-read trade-off: packages/mcp/src/skill-md.ts -- the
# Console's objectstack-skill.test.ts imports it to pin the
# "Download skill" mirror; the server half of that drift pin
# runs in Test Core on every packages/mcp change, and a
# mirror-only diff starts it through the `crosspkg` row (#31017).
# The modules it loads at runtime (ask-skill.generated.ts,
# mcp-http-tools.ts and theirs) inherit this trade-off.
# The seven packages objectui installs from this tree (the set its
# `.objectstack-pin` used to pack). A change here compiles, builds
# and tests the Console in the same PR — the check the retired Spec
# Shape Gate ran hourly against a clone of objectui main. Test UI
# reads this list since objectstack#28220: its selector already
# turns full for any of these packages.
ui_consumers:
- 'packages/spec/**'
- 'packages/client/**'
- 'packages/core/**'
- 'packages/formula/**'
- 'packages/lint/**'
- 'packages/sdui-parser/**'
- 'packages/types/**'
# [#37095] What makes the merge queue run `temporal-conformance`
# (ruling record 7146156389): the pgvector store, the driver whose
# whole suite that job runs against the live servers, the
# live-server files its filtered steps select, the service-analytics
# files whose live-PostgreSQL cells key on OS_TEST_POSTGRES_URL
# (#21564), and this file.
#
# [#38528] AND every workspace source those tests LOAD. A live test
# reaches other packages' source through its vitest alias, and their
# `dist/` (built from `src/` by the job's build steps) through the
# package link; a row for the test alone left the source under test
# unscheduled, so a queue entry changing only that source skipped
# this job, landed, and went red first on `main`.
# `node scripts/check-temporal-live-filter.mjs` (`--self-test` beside it)
# walks each live test's run-time import closure the way vitest
# resolves it and reds on a closure file no row below matches;
# `--list` prints each closure and the row covering each file. A row
# is a package's `src/**` where the closure enters through the
# package's barrel (it then reaches nearly every module, and a
# file-by-file list would red on the next re-export), a narrower
# directory where it reaches one corner of a package, and a literal
# path for a single file. The service-analytics `src/**` row and the
# metadata-protocol `src/**` row replace the per-file and per-glob
# rows those packages carried, which they cover.
temporal_live:
- 'packages/plugins/knowledge-pgvector/**'
- 'packages/drivers/driver-sql/**'
- 'packages/runtime/src/**/cascade-delete-multivalue-lookup-real-driver*'
# [#37100] The adapter contract suite the pgvector store runs
# against the live PostgreSQL (`src/testing.ts`), and [#38528]
# the service it is a store of: every knowledge-pgvector live
# file loads `KnowledgeServicePlugin` through the alias.
- 'packages/services/service-knowledge/src/**'
# [#38528] The migration statements the metadata-protocol live
# files execute (they import the migration beside them, and the
# package barrel through objectql), and the manifest
# `discovery-version.ts` imports.
- 'packages/metadata-protocol/src/**'
- 'packages/metadata-protocol/package.json'
# [#21564] The live-PostgreSQL cells of service-analytics, and
# [#38528] the service they test.
- 'packages/services/service-analytics/src/**'
# [#38528] The packages every live test loads through the alias
# or the package link, each reached through its barrel:
# `@objectstack/core` (capability-mount.live-postgres loads
# `capability-composition.ts`; driver-sql's `sql-driver.ts`
# imports the barrel), objectql (the knowledge-pgvector and
# analytics files run ObjectQL over SqlDriver), and what those
# barrels import in turn.
- 'packages/core/src/**'
- 'packages/objectql/src/**'
- 'packages/types/src/**'
- 'packages/formula/src/**'
- 'packages/metadata/src/**'
- 'packages/metadata-core/src/**'
- 'packages/metadata-fs/src/**'
- 'packages/lint/src/**'
- 'packages/sdui-parser/src/**'
- 'packages/observability/src/**'
- 'packages/services/service-settings/src/**'
# [#38528] KnowledgeServicePlugin's default embedder and the
# `@objectstack/platform-objects/system` objects it registers.
- 'packages/plugins/embedder-openai/src/**'
- 'packages/platform-objects/src/system/**'
# [#38528] The analytics bucket-enumeration live file runs the
# wasm SQLite driver beside PostgreSQL.
- 'packages/drivers/driver-sqlite-wasm/src/**'
# [#38528] `@objectstack/spec`, loaded through the alias by its
# barrel: every namespace it re-exports and the root modules.
# Not `src/**`: `src/migrations/` (two thirds of the tree, the
# conversion kits) and `src/studio/` are outside every closure.
- 'packages/spec/src/*.ts'
- 'packages/spec/src/ai/**'
- 'packages/spec/src/api/**'
- 'packages/spec/src/automation/**'
- 'packages/spec/src/contracts/**'
- 'packages/spec/src/conversions/**'
- 'packages/spec/src/data/**'
- 'packages/spec/src/identity/**'
- 'packages/spec/src/integration/**'
- 'packages/spec/src/kernel/**'
- 'packages/spec/src/marketplace/**'
- 'packages/spec/src/meta-spelling/**'
- 'packages/spec/src/qa/**'
- 'packages/spec/src/security/**'
- 'packages/spec/src/shared/**'
- 'packages/spec/src/system/**'
- 'packages/spec/src/ui/**'
# The manifest `metadata-core`'s artifact conversion reads.
- 'packages/spec/package.json'
# [#38528] What the live tests' vitest configs load before any
# test: the configs outside a row above, the preflight runtime's
# config runs, the memory-tmp env helper, and the comment mask
# driver-sql's isolation test imports.
- 'packages/metadata-protocol/vitest.config.ts'
- 'packages/runtime/vitest.config.ts'
- 'packages/services/service-analytics/vitest.config.ts'
- 'packages/qa/vitest-filter-preflight/src/**'
- 'packages/runtime/src/expected-read-refusal-noise.ts'
- 'scripts/vitest-memory-tmp.mjs'
- 'scripts/js-comment-mask.mjs'
- 'scripts/invoked-as.mjs'
# [#38528] The guard that holds this list to the closures.
- 'scripts/check-temporal-live-filter.mjs'
- '.github/workflows/ci.yml'
# ── WHICH TEST CORE SHARDS START (#26084) ─────────────────────────────
# The `test` matrix used to be the literal 1..8, so every Test Core run
# started eight runners, and a shard whose bin was empty paid checkout,
# install and its package-set selection before printing "No packages on this
# shard". Measured over the 25 most recent completed pull_request runs on
# 2026-10-27 (40415024961 to 40426272873): 72 of 168 Test Core shard jobs
# were empty, 7020 runner-seconds, ~97 s each. A diff that reaches no
# package (a root script, a doc, a workflow) fills one to three bins of
# eight.
#
# This job runs the shards' own selection and partition ONCE and publishes
# the indices of the bins that hold work; `test` builds its matrix from
# them. The plan never re-sizes: the count stays SHARD_COUNT, so a started
# shard carries exactly the slice it carried before, and only the empty ones
# are not created. Every shard re-derives the plan from its own package set
# and reds when its digest differs (`--verify` in "Compute this shard's
# package set"), so the plan cannot silently disagree with the shards it
# leaves out. scripts/ci/plan-test-core-shards.mjs carries the reasoning.
#
# The price is one serial hop: Test Core's shards start after this job, ~65-95
# s later (the same checkout + install a shard pays before its selection,
# measured on run 40426272873's shards), on every run that starts Test Core.
#
# Same `if:` as `test`, so the plan exists exactly when the matrix could.
# Fail-open both ways (THE FILTER CONTRACT): a plan job that dies publishes
# no outputs, the matrix falls back to its full literal, and the gate counts
# that same fallback.
test-plan:
name: Plan Test Core shards
needs: filter
if: ${{ !cancelled() && (needs.filter.outputs.core != 'false' || needs.filter.outputs.crosspkg != 'false') }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
outputs:
shards: ${{ steps.plan.outputs.shards }}
digest: ${{ steps.plan.outputs.digest }}
steps:
# Depth 1, then the step below: the same history the shards fetch, because
# the selection diffs against the PR's merge base, the queue's base_sha or
# the push's before sha, and every shard re-derives this plan (#22034).
- name: Checkout repository
uses: actions/checkout@v7
# The `test` job's step of the same name, the same script with its own
# budget (the `test` job's comment says why and sizes the budget).
- name: Fetch this commit's history and the base branch
timeout-minutes: 8
env:
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
run: bash scripts/ci/fetch-history.sh
# Restore only: the `test` shards save this key.