@norskvideo/ctl-dev-kit 0.2.138 → 0.2.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -265,6 +265,16 @@ jobs:
265
265
  # regen-manual.sh owns the slug list and which tiers run; with-display.sh
266
266
  # wraps the whole run in an X display for headless chromium (the engine tier
267
267
  # drives a raw chromium that needs one).
268
+ - name: Root the build shell against the host's nix GC
269
+ # The host collects the /nix its runner containers share, and an
270
+ # unrooted shell goes with it: the next job fetches Bun's release zip
271
+ # from github.com again (no binary cache holds it). One root per repo,
272
+ # beside norsk-ctl's, replaced as the shell changes.
273
+ run: |
274
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
275
+ mkdir -p "${root%/*}"
276
+ rm -f "$root" "$root"-*-link
277
+ nix develop .#build --profile "$root" --command true
268
278
  - name: Regenerate the docs bundle (all tiers)
269
279
  env:
270
280
  NORSK_CTL_BINARY: ${{ runner.temp }}/norsk-ctl
@@ -251,6 +251,16 @@ jobs:
251
251
  with:
252
252
  clean: true
253
253
 
254
+ - name: Root the build shell against the host's nix GC
255
+ # The host collects the /nix its runner containers share, and an
256
+ # unrooted shell goes with it: the next job fetches Bun's release zip
257
+ # from github.com again (no binary cache holds it). One root per repo,
258
+ # beside norsk-ctl's, replaced as the shell changes.
259
+ run: |
260
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
261
+ mkdir -p "${root%/*}"
262
+ rm -f "$root" "$root"-*-link
263
+ nix develop .#build --profile "$root" --command true
254
264
  - name: Build product image (copy-only, via the dev-kit driver, native ${{ matrix.arch }})
255
265
  run: |
256
266
  if [ -n "${PUBLISH_IMAGE}" ]; then
@@ -387,6 +397,16 @@ jobs:
387
397
  with:
388
398
  clean: true
389
399
 
400
+ - name: Root the build shell against the host's nix GC
401
+ # The host collects the /nix its runner containers share, and an
402
+ # unrooted shell goes with it: the next job fetches Bun's release zip
403
+ # from github.com again (no binary cache holds it). One root per repo,
404
+ # beside norsk-ctl's, replaced as the shell changes.
405
+ run: |
406
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
407
+ mkdir -p "${root%/*}"
408
+ rm -f "$root" "$root"-*-link
409
+ nix develop .#build --profile "$root" --command true
390
410
  - name: Decide whether the guides gate this publish
391
411
  id: plan
392
412
  run: |
@@ -744,6 +764,16 @@ jobs:
744
764
  echo "running scripts/doc-guide/prepull-extra.sh"
745
765
  ./scripts/doc-guide/prepull-extra.sh
746
766
  fi
767
+ - name: Root the build shell against the host's nix GC
768
+ # The host collects the /nix its runner containers share, and an
769
+ # unrooted shell goes with it: the next job fetches Bun's release zip
770
+ # from github.com again (no binary cache holds it). One root per repo,
771
+ # beside norsk-ctl's, replaced as the shell changes.
772
+ run: |
773
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
774
+ mkdir -p "${root%/*}"
775
+ rm -f "$root" "$root"-*-link
776
+ nix develop .#build --profile "$root" --command true
747
777
  - name: Install and build the workspaces the guides drive
748
778
  run: |
749
779
  nix develop .#build --command bash -c '
@@ -1024,6 +1054,16 @@ jobs:
1024
1054
  role-session-name: product-channels-${{ github.run_id }}
1025
1055
  aws-region: eu-west-1
1026
1056
 
1057
+ - name: Root the build shell against the host's nix GC
1058
+ # The host collects the /nix its runner containers share, and an
1059
+ # unrooted shell goes with it: the next job fetches Bun's release zip
1060
+ # from github.com again (no binary cache holds it). One root per repo,
1061
+ # beside norsk-ctl's, replaced as the shell changes.
1062
+ run: |
1063
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
1064
+ mkdir -p "${root%/*}"
1065
+ rm -f "$root" "$root"-*-link
1066
+ nix develop .#build --profile "$root" --command true
1027
1067
  - name: Record the image in the product's channels object
1028
1068
  if: ${{ vars.AWS_PRODUCT_ROLE_ARN != '' }}
1029
1069
  env:
@@ -499,6 +499,16 @@ jobs:
499
499
  # part-way (the runner OOM-killed one on 2026-10-03) leaves bumped
500
500
  # manifests beside the old lockfiles, and carrying on committed exactly
501
501
  # that. Fail here instead, before anything is committed.
502
+ - name: Root the build shell against the host's nix GC
503
+ # The host collects the /nix its runner containers share, and an
504
+ # unrooted shell goes with it: the next job fetches Bun's release zip
505
+ # from github.com again (no binary cache holds it). One root per repo,
506
+ # beside norsk-ctl's, replaced as the shell changes.
507
+ run: |
508
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
509
+ mkdir -p "${root%/*}"
510
+ rm -f "$root" "$root"-*-link
511
+ nix develop .#build --profile "$root" --command true
502
512
  - name: Refresh every lockfile against the new pins
503
513
  if: steps.night.outputs.changed == '1'
504
514
  env:
@@ -611,6 +611,16 @@ jobs:
611
611
  # part-way (the runner OOM-killed one on 2026-10-03) leaves bumped
612
612
  # manifests beside the old lockfiles, and carrying on committed exactly
613
613
  # that. Fail here instead, before anything is committed.
614
+ - name: Root the build shell against the host's nix GC
615
+ # The host collects the /nix its runner containers share, and an
616
+ # unrooted shell goes with it: the next job fetches Bun's release zip
617
+ # from github.com again (no binary cache holds it). One root per repo,
618
+ # beside norsk-ctl's, replaced as the shell changes.
619
+ run: |
620
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
621
+ mkdir -p "${root%/*}"
622
+ rm -f "$root" "$root"-*-link
623
+ nix develop .#build --profile "$root" --command true
614
624
  - name: Refresh every lockfile against the new pins
615
625
  if: steps.night.outputs.changed == '1'
616
626
  env:
@@ -151,8 +151,9 @@ export function ctlPackageProblem(flake: string): string | undefined {
151
151
  // dprint.json is canonical-plus-extension: the shared config is verbatim, but a
152
152
  // repo may exclude paths only it has (e.g. probe's generated components/lib/)
153
153
  // inside a sanctioned marker block at the head of `excludes`. Everything outside
154
- // the block is byte-compared; inside, only well-formed `"entry",` lines are
155
- // allowed so the block can't smuggle arbitrary config past the byte check.
154
+ // the block is byte-compared; inside, only well-formed `"entry",` lines and
155
+ // whole-line `//` comments (saying why a path is excluded) are allowed, so the
156
+ // block can't smuggle arbitrary config past the byte check.
156
157
  export const DPRINT_BEGIN = "// BEGIN repo-specific excludes";
157
158
  export const DPRINT_END = "// END repo-specific excludes";
158
159
 
@@ -179,9 +180,9 @@ function dprintProblem(actual: string, canonical: string): string | undefined {
179
180
  if (masked(a) !== masked(c)) {
180
181
  return `dprint.json has drifted from @norskvideo/ctl-dev-kit conventions/dprint.base.jsonc outside the repo-specific excludes block (${firstDiffLine(masked(a), masked(c))}). ${RESYNC}`;
181
182
  }
182
- const badLine = a.body.find((l) => !/^\s*"[^"]*",$/.test(l));
183
+ const badLine = a.body.find((l) => !/^\s*("[^"]*",|\/\/.*)$/.test(l));
183
184
  if (badLine !== undefined) {
184
- return `dprint.json repo-specific excludes block has a malformed line (${JSON.stringify(badLine.trim())}) — one double-quoted exclude entry per line, each ending with a comma.`;
185
+ return `dprint.json repo-specific excludes block has a malformed line (${JSON.stringify(badLine.trim())}) — one double-quoted exclude entry per line, each ending with a comma, or a whole-line // comment.`;
185
186
  }
186
187
  return undefined;
187
188
  }
@@ -103,6 +103,16 @@ jobs:
103
103
  - uses: actions/checkout@v5
104
104
  with:
105
105
  clean: true
106
+ - name: Root the build shell against the host's nix GC
107
+ # The host collects the /nix its runner containers share, and an
108
+ # unrooted shell goes with it: the next job fetches Bun's release zip
109
+ # from github.com again (no binary cache holds it). One root per repo,
110
+ # beside norsk-ctl's, replaced as the shell changes.
111
+ run: |
112
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
113
+ mkdir -p "${root%/*}"
114
+ rm -f "$root" "$root"-*-link
115
+ nix develop .#build --profile "$root" --command true
106
116
  - name: Shared-conventions drift-check (Workstream I)
107
117
  run: |
108
118
  nix develop .#build --command bash -c '
@@ -200,6 +210,16 @@ jobs:
200
210
  - uses: actions/checkout@v5
201
211
  with:
202
212
  clean: true
213
+ - name: Root the build shell against the host's nix GC
214
+ # The host collects the /nix its runner containers share, and an
215
+ # unrooted shell goes with it: the next job fetches Bun's release zip
216
+ # from github.com again (no binary cache holds it). One root per repo,
217
+ # beside norsk-ctl's, replaced as the shell changes.
218
+ run: |
219
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
220
+ mkdir -p "${root%/*}"
221
+ rm -f "$root" "$root"-*-link
222
+ nix develop .#build --profile "$root" --command true
203
223
  - name: Lint + typecheck + unit tests
204
224
  env:
205
225
  # The dev SDK lane, for a repo that opts in with .github/ci/sdk-dev.sh
@@ -99,6 +99,16 @@ jobs:
99
99
  - uses: actions/checkout@v5
100
100
  with:
101
101
  clean: true
102
+ - name: Root the build shell against the host's nix GC
103
+ # The host collects the /nix its runner containers share, and an
104
+ # unrooted shell goes with it: the next job fetches Bun's release zip
105
+ # from github.com again (no binary cache holds it). One root per repo,
106
+ # beside norsk-ctl's, replaced as the shell changes.
107
+ run: |
108
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
109
+ mkdir -p "${root%/*}"
110
+ rm -f "$root" "$root"-*-link
111
+ nix develop .#build --profile "$root" --command true
102
112
  - name: Shared-conventions drift-check (Workstream I)
103
113
  run: |
104
114
  nix develop .#build --command bash -c '
@@ -196,6 +206,16 @@ jobs:
196
206
  - uses: actions/checkout@v5
197
207
  with:
198
208
  clean: true
209
+ - name: Root the build shell against the host's nix GC
210
+ # The host collects the /nix its runner containers share, and an
211
+ # unrooted shell goes with it: the next job fetches Bun's release zip
212
+ # from github.com again (no binary cache holds it). One root per repo,
213
+ # beside norsk-ctl's, replaced as the shell changes.
214
+ run: |
215
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
216
+ mkdir -p "${root%/*}"
217
+ rm -f "$root" "$root"-*-link
218
+ nix develop .#build --profile "$root" --command true
199
219
  - name: Lint + typecheck + unit tests
200
220
  env:
201
221
  # The dev SDK lane, for a repo that opts in with .github/ci/sdk-dev.sh
@@ -426,6 +426,16 @@ jobs:
426
426
 
427
427
  # Everything below runs dev-kit and test-harness code out of node_modules,
428
428
  # and `clean: true` on the checkout means this job starts without any.
429
+ - name: Root the build shell against the host's nix GC
430
+ # The host collects the /nix its runner containers share, and an
431
+ # unrooted shell goes with it: the next job fetches Bun's release zip
432
+ # from github.com again (no binary cache holds it). One root per repo,
433
+ # beside norsk-ctl's, replaced as the shell changes.
434
+ run: |
435
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
436
+ mkdir -p "${root%/*}"
437
+ rm -f "$root" "$root"-*-link
438
+ nix develop .#build --profile "$root" --command true
429
439
  - name: Install dependencies
430
440
  run: nix develop .#build --command bun install --frozen-lockfile
431
441
 
@@ -131,6 +131,16 @@ jobs:
131
131
  # or before the first capture -- restores nothing; the build stubs what is
132
132
  # missing and the gate below refuses to deploy a stub. gh comes from the
133
133
  # build shell (the runners have no system gh).
134
+ - name: Root the build shell against the host's nix GC
135
+ # The host collects the /nix its runner containers share, and an
136
+ # unrooted shell goes with it: the next job fetches Bun's release zip
137
+ # from github.com again (no binary cache holds it). One root per repo,
138
+ # beside norsk-ctl's, replaced as the shell changes.
139
+ run: |
140
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
141
+ mkdir -p "${root%/*}"
142
+ rm -f "$root" "$root"-*-link
143
+ nix develop .#build --profile "$root" --command true
134
144
  - name: Restore the recorded guides' captures
135
145
  env:
136
146
  GH_TOKEN: ${{ github.token }}
@@ -282,6 +282,16 @@ jobs:
282
282
  # regen-manual.sh owns the slug list and honours SKIP_ENGINE; it rebuilds
283
283
  # every workspace the manual depends on first, and with-display.sh gives
284
284
  # headless chromium an X display.
285
+ - name: Root the build shell against the host's nix GC
286
+ # The host collects the /nix its runner containers share, and an
287
+ # unrooted shell goes with it: the next job fetches Bun's release zip
288
+ # from github.com again (no binary cache holds it). One root per repo,
289
+ # beside norsk-ctl's, replaced as the shell changes.
290
+ run: |
291
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
292
+ mkdir -p "${root%/*}"
293
+ rm -f "$root" "$root"-*-link
294
+ nix develop .#build --profile "$root" --command true
285
295
  - name: Regenerate the illustrated manual (deterministic tiers)
286
296
  env:
287
297
  NORSK_CTL_BINARY: ${{ runner.temp }}/norsk-ctl
@@ -297,6 +297,16 @@ jobs:
297
297
  # used to start with whatever an earlier run had left behind, which is how
298
298
  # the entitlement check below ran green for a day on a node_modules nobody
299
299
  # in the job had created, then died fleet-wide the first cold checkout.
300
+ - name: Root the build shell against the host's nix GC
301
+ # The host collects the /nix its runner containers share, and an
302
+ # unrooted shell goes with it: the next job fetches Bun's release zip
303
+ # from github.com again (no binary cache holds it). One root per repo,
304
+ # beside norsk-ctl's, replaced as the shell changes.
305
+ run: |
306
+ root="${RUNNER_TEMP%/*}/_norsk-shell-gcroot/${GITHUB_REPOSITORY//\//_}"
307
+ mkdir -p "${root%/*}"
308
+ rm -f "$root" "$root"-*-link
309
+ nix develop .#build --profile "$root" --command true
300
310
  - name: Install dependencies
301
311
  run: nix develop .#build --command bun install --frozen-lockfile
302
312
 
@@ -320,3 +320,49 @@ export function candidateConcurrencyProblems(yaml: string): string[] {
320
320
  }
321
321
  return problems;
322
322
  }
323
+
324
+ /** The step that roots a job's `.#build` shell before the job first enters it. */
325
+ export const SHELL_ROOT_STEP = "Root the build shell against the host's nix GC";
326
+
327
+ // The runner containers share the host's /nix, and the host collects it. Only
328
+ // norsk-ctl was rooted, so the first job after a collection fetched the shell's
329
+ // inputs again, and Bun's release zip is in no binary cache: it comes from
330
+ // github.com, unauthenticated. On 2026-11-08 GitHub timed those fetches out
331
+ // with 504s and six product jobs on two runners went red before a line of
332
+ // their own ran. The root sits beside norsk-ctl's, where the host sees it.
333
+ const SHELL_ROOT_REQUIREMENTS: { name: string; ok: (body: string) => boolean }[] = [
334
+ { name: "root", ok: (b) => /\$\{RUNNER_TEMP%\/\*\}\/_norsk-shell-gcroot\//.test(b) },
335
+ { name: "profile", ok: (b) => /nix develop \.#build --profile "\$root"/.test(b) },
336
+ ];
337
+
338
+ /** Jobs that enter `nix develop .#build` before a {@link SHELL_ROOT_STEP}
339
+ * that roots it, or whose root step lacks a requirement above. Per job, as
340
+ * {@link jobsMissingTestTempStep} is: a sibling's root is another repo
341
+ * checkout's shell only by coincidence. */
342
+ export function jobsEnteringUnrootedShell(yaml: string): string[] {
343
+ const lines = yaml.split("\n");
344
+ const bad: string[] = [];
345
+ let job: string | undefined;
346
+ let rooted = false;
347
+ let flagged = false;
348
+ lines.forEach((line, i) => {
349
+ const head = line.match(/^ {2}([A-Za-z_][\w-]*):\s*$/);
350
+ if (head) {
351
+ job = head[1];
352
+ rooted = false;
353
+ flagged = false;
354
+ return;
355
+ }
356
+ if (line.includes(`- name: ${SHELL_ROOT_STEP}`)) {
357
+ const body = stepBody(lines, i);
358
+ rooted = SHELL_ROOT_REQUIREMENTS.every((r) => r.ok(body));
359
+ return;
360
+ }
361
+ if (/^\s*#/.test(line) || !/nix develop \.#build\b/.test(line)) return;
362
+ if (!rooted && !flagged && job !== undefined) {
363
+ bad.push(job);
364
+ flagged = true;
365
+ }
366
+ });
367
+ return bad;
368
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.138",
3
+ "version": "0.2.140",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",