Repository navigation
938 lines (801 loc) · 39.5 KB
/
Copy pathci.yml
File metadata and controls
938 lines (801 loc) · 39.5 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
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
# Unique non-PR groups also preserve pending main and manual runs.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
env:
GOFLAGS: -mod=readonly -trimpath
GOTOOLCHAIN: local
jobs:
go-test:
name: Go test
needs: [go-test-core, go-test-cli]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require all race shards
shell: bash
env:
CORE_RESULT: ${{ needs['go-test-core'].result }}
CLI_RESULT: ${{ needs['go-test-cli'].result }}
run: |
printf 'Go core: %s\nGo CLI shards: %s\n' "${CORE_RESULT:-missing}" "${CLI_RESULT:-missing}"
[[ "${CORE_RESULT:-}" == success && "${CLI_RESULT:-}" == success ]]
go-test-cli:
name: Go CLI shard ${{ matrix.shard }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
# setup-go restores cache entries with their saved mtimes. Once those are
# older than Go's 5-day trim limit, the race build trims every entry it
# did not use, including the non-race packages builtCLITestBinary reuses.
- name: Keep restored Go build cache
run: |
cache="$(go env GOCACHE)"
mkdir -p "$cache"
find "$cache" -type f -exec touch -c {} +
- name: Test CLI shard
run: python3 scripts/test-go-shard.py ${{ matrix.shard }} 4
go-test-core:
name: Go core
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Check formatting
shell: bash
run: |
mapfile -t files < <(git ls-files '*.go')
if [ "${#files[@]}" -gt 0 ]; then
diff="$(gofmt -l "${files[@]}")"
if [ -n "$diff" ]; then
echo "$diff"
exit 1
fi
fi
- name: Vet
run: go vet ./...
- name: Deadcode
run: |
output_file=$(mktemp)
go run golang.org/x/tools/cmd/deadcode@v0.45.0 -test ./... > "$output_file"
if [ -s "$output_file" ]; then
cat "$output_file"
exit 1
fi
- name: Test
shell: bash
run: |
packages=$(go list ./...)
mapfile -t packages < <(printf '%s\n' "$packages" | sed '\|^github.com/openclaw/crabbox/internal/cli$|d')
go test -race -count=1 -timeout=10m "${packages[@]}"
- name: Test Hyper-V restore claim loss between effects
run: go test -race -count=1 -timeout=2m -tags=crabbox_claim_fence_probe ./internal/providers/hyperv -run '^TestRestoreNativeCheckpointStopsAtInterFenceClaimChanges$'
- name: Require executed Linux supervision fixtures
shell: bash
run: |
go test ./internal/cli -run '^(TestWorkspaceOwnerWSL2Watchdog.*|TestWSL2(OrdinaryShortFrameWatchdogCleansState|MarkerPublicationFailureLeavesUnarmedDiagnosticState|GuardSurvivesPublishedMarkerBeforeArm|ProductionCleanup.*))$' -count=1 -json | tee "$RUNNER_TEMP/wsl-linux-tests.jsonl"
python3 - "$RUNNER_TEMP/wsl-linux-tests.jsonl" <<'PY'
import json, sys
records = [json.loads(line) for line in open(sys.argv[1])]
required = (
'TestWorkspaceOwnerWSL2WatchdogAllowsCompletedFrameExecution',
'TestWSL2OrdinaryShortFrameWatchdogCleansState',
'TestWSL2MarkerPublicationFailureLeavesUnarmedDiagnosticState',
'TestWSL2GuardSurvivesPublishedMarkerBeforeArm',
'TestWSL2ProductionCleanupKillsEntireStagingGroup',
'TestWSL2ProductionCleanupFailsClosedWithoutLiveGuard',
'TestWSL2ProductionCleanupFailsClosedWhenGuardMarkerChanges',
'TestWorkspaceOwnerWSL2WatchdogCleansCompletedFrameAfterLauncherExit',
'TestWorkspaceOwnerWSL2WatchdogPreservesIntentionalBackgroundWitness',
)
for name in required:
for action in ('run', 'pass'):
assert any(r.get('Test') == name and r['Action'] == action for r in records), (name, action)
assert not any(r['Action'] == 'skip' for r in records), 'native fixture skipped'
PY
- name: Require real SSH readiness diagnostics
shell: bash
run: |
go test ./internal/cli -run '^TestWaitForSSHReadyRealSSHTimeoutDiagnostic$' -count=1 -json | tee "$RUNNER_TEMP/ssh-readiness-tests.jsonl"
python3 - "$RUNNER_TEMP/ssh-readiness-tests.jsonl" <<'PY'
import json, sys
records = [json.loads(line) for line in open(sys.argv[1])]
root = 'TestWaitForSSHReadyRealSSHTimeoutDiagnostic'
required = [root] + [
f'{root}/proxy={proxy}/transport-success={success}'
for proxy in ('false', 'true')
for success in ('true', 'false')
]
for name in required:
for action in ('run', 'pass'):
assert any(r.get('Test') == name and r['Action'] == action for r in records), (name, action)
assert not any(r['Action'] == 'skip' for r in records), 'real SSH fixture skipped'
PY
- name: Build
run: go build -trimpath -o /tmp/crabbox ./cmd/crabbox
go-modules:
name: Go modules
needs: [go-modules-core, go-modules-cli]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Require all normal module tests
shell: bash
env:
CORE_RESULT: ${{ needs['go-modules-core'].result }}
CLI_RESULT: ${{ needs['go-modules-cli'].result }}
run: |
printf 'Go non-CLI and nested modules: %s\nGo normal CLI shards: %s\n' "${CORE_RESULT:-missing}" "${CLI_RESULT:-missing}"
[[ "${CORE_RESULT:-}" == success && "${CLI_RESULT:-}" == success ]]
go-modules-cli:
name: Go normal CLI shard ${{ matrix.shard }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Test normal CLI shard
run: python3 scripts/test-go-shard.py ${{ matrix.shard }} 4 --normal
go-modules-core:
name: Go normal non-CLI and nested modules
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Test non-CLI root and all nested modules
run: scripts/test-go-modules.sh --exclude-root-cli
go-coverage-cli:
name: Go CLI coverage shard ${{ matrix.shard }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2]
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Cover CLI shard
run: python3 scripts/test-go-shard.py ${{ matrix.shard }} 3 --coverprofile "${{ runner.temp }}/cli-${{ matrix.shard }}.out"
- name: Upload coverage profile
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: go-coverage-cli-${{ matrix.shard }}
path: ${{ runner.temp }}/cli-${{ matrix.shard }}.out
overwrite: true
if-no-files-found: error
retention-days: 1
go-coverage-core:
name: Go non-CLI coverage
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Cover other packages
shell: bash
run: |
packages=$(go list ./...)
mapfile -t packages < <(printf '%s\n' "$packages" | sed '\|^github.com/openclaw/crabbox/internal/cli$|d')
go test -count=1 -timeout=20m -covermode=atomic -coverprofile="${{ runner.temp }}/core.out" "${packages[@]}"
- name: Upload coverage profile
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: go-coverage-core
path: ${{ runner.temp }}/core.out
overwrite: true
if-no-files-found: error
retention-days: 1
go-coverage:
name: Go coverage
needs: [go-coverage-core, go-coverage-cli]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Require all coverage producers
shell: bash
env:
CORE_RESULT: ${{ needs['go-coverage-core'].result }}
CLI_RESULT: ${{ needs['go-coverage-cli'].result }}
run: |
printf 'Go non-CLI coverage: %s\nGo CLI coverage shards: %s\n' "${CORE_RESULT:-missing}" "${CLI_RESULT:-missing}"
[[ "${CORE_RESULT:-}" == success && "${CLI_RESULT:-}" == success ]]
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Download coverage profiles
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: go-coverage-*
path: ${{ runner.temp }}/go-coverage
merge-multiple: true
- name: Coverage
run: scripts/check-go-coverage.sh 90.0 --profiles "${{ runner.temp }}/go-coverage"
go:
name: Go
needs: [go-test, go-modules, go-coverage]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Require all Go checks
shell: bash
env:
GO_TEST_RESULT: ${{ needs['go-test'].result }}
GO_MODULES_RESULT: ${{ needs['go-modules'].result }}
GO_COVERAGE_RESULT: ${{ needs['go-coverage'].result }}
run: |
printf 'Go test: %s\nGo modules: %s\nGo coverage: %s\n' \
"${GO_TEST_RESULT:-missing}" "${GO_MODULES_RESULT:-missing}" "${GO_COVERAGE_RESULT:-missing}"
[[ "${GO_TEST_RESULT:-}" == success && "${GO_MODULES_RESULT:-}" == success && "${GO_COVERAGE_RESULT:-}" == success ]]
go-install:
name: Direct Go install
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: false
- name: Verify versioned remote module installation
run: scripts/verify-go-install.sh v0.0.0 "$(git rev-parse HEAD)"
windows-pond-mesh-cancellation:
name: Windows Pond Mesh Cancellation
needs: [windows-native-contracts, windows-powershell-architecture]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Require all native Windows contracts
shell: bash
env:
CONTRACTS_RESULT: ${{ needs['windows-native-contracts'].result }}
ARCHITECTURE_RESULT: ${{ needs['windows-powershell-architecture'].result }}
run: |
printf 'Windows contracts: %s\nPowerShell architecture: %s\n' \
"${CONTRACTS_RESULT:-missing}" "${ARCHITECTURE_RESULT:-missing}"
[[ "${CONTRACTS_RESULT:-}" == success && "${ARCHITECTURE_RESULT:-}" == success ]]
windows-powershell-architecture:
name: Windows PowerShell 5.1 architecture
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Test static SSH architecture in Windows PowerShell 5.1
shell: pwsh
env:
GOFLAGS: -mod=readonly -trimpath -p=1
GOMAXPROCS: 2
run: |
$name = 'TestStaticSSHArchitectureLocalWindowsPowerShell51Probe'
$events = @(go test -race ./internal/providers/ssh -run '^TestStaticSSHArchitectureLocalWindowsPowerShell51Probe$' -count=20 -timeout=8m -json)
$code = $LASTEXITCODE
$events | ForEach-Object { Write-Host $_ }
if ($code -ne 0) { exit $code }
& ./scripts/verify-go-test-events.ps1 -Events $events -RequiredTests @($name) -Label 'Windows PowerShell 5.1 architecture probe'
windows-native-contracts:
name: Native Windows contracts
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
id: windows_go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: true
cache-dependency-path: '**/go.sum'
- name: Test native Windows project detection
run: go test ./internal/cli -run '^(TestDetectInitProject|TestInitProjectDetectsRepoCommands)' -count=1 -timeout=5m -v
- name: Require PowerShell literal parsing on Windows
shell: pwsh
run: |
$required = @(
'TestPSQuoteRoundTripsThroughPowerShell',
'TestPowerShellGeneratedCommandPreservesValues',
'TestPowerShellBootstrapPreservesValues',
'TestPowerShellWSLBootstrapPreservesHereStringTerminators'
)
$events = @(go test ./internal/cli -run ('^(' + ($required -join '|') + ')$') -count=1 -timeout=5m -json)
$code = $LASTEXITCODE
$events | ForEach-Object { Write-Host $_ }
if ($code -ne 0) { exit $code }
$required += @($required | ForEach-Object { "$_/powershell.exe" })
& ./scripts/verify-go-test-events.ps1 -Events $events -RequiredTests $required -Label 'PowerShell literal parsing'
- name: Prove paired Windows connection-error classification
if: github.event_name == 'pull_request' && github.head_ref == 'security/emudhra-node-release'
shell: pwsh
run: ./scripts/native-windows-retry-proof.ps1
- name: Prove native TLS rejection and legitimate private CA
if: github.event_name == 'pull_request' && github.head_ref == 'security/emudhra-node-release'
run: go test ./internal/cli -run '^TestCoordinator(ReadDoesNotOverrideTLSVerificationWithCurl|HTTPSReadNeverDowngradesAfterDroppedHandshake|NativeHTTPReadRecoversAfterDroppedConnection)$' -count=1 -v
- name: Test native Windows local Git manifest handoff
run: go test ./internal/cli/ -run '^(TestGitLocalReceiverWindowsManifestHandoff|TestCoordinatorReadRetryWindowsConnectionErrors)$' -count=1 -v
- name: Require native Windows external slug reservation recovery and reuse
if: ${{ !cancelled() && steps.windows_go.outcome == 'success' }}
shell: pwsh
run: |
$required = @(
'TestLockSlugReservationAcquiresReclaimedAbandonedLock',
'TestWaitForSlugReservationLockRecoversAfterAbandonedLock',
'TestAllocateLeaseSlugWindowsReleaseAndReuse'
)
$events = @(go test ./internal/providers/external -run ('^(' + ($required -join '|') + ')$') -count=1 -timeout=2m -json)
$code = $LASTEXITCODE
$events | ForEach-Object { Write-Host $_ }
if ($code -ne 0) { exit $code }
& ./scripts/verify-go-test-events.ps1 -Events $events -RequiredTests $required -Label 'native external slug reservation test'
- name: Test user directory isolation
run: go test ./internal/testutil ./internal/providers/aws ./internal/providers/daytona ./internal/providers/digitalocean ./internal/providers/hyperv ./internal/providers/namespace ./internal/providers/scaleway ./internal/providers/vast ./internal/providers/vultr -count=1
- name: Test native Windows archive preparation ownership
run: go test ./internal/providers/blaxel -run '^TestRunPreparesArchiveBeforeCreate$' -count=1 -v
- name: Test managed Windows endpoint launch through CMD
run: go test ./internal/providers/sshhost -run '^TestMXCEndpointCommandThroughCMD$' -count=1 -v
- name: Test native Windows local history store, readers, and observation
run: go test ./internal/cli/ -run '^(TestLocalHistory|TestRunObservation(DelegatedAppRoundTrip|DisabledHasNoLedger|CapturesOnlyCommandWriters|AdoptsExistingCaptureOmissions|FinalFailureOnlyWarns|NeverEntersWireRequest|CoordinatorReferenceExcludesCredentials|CoordinatorTerminalAcknowledgment|PolicyIgnoresRepositoryFiles)$)' -count=1 -timeout=5m -v
- name: Require native Windows lease SSH root and managed-state contracts
# Keep independent contract evidence available after another test fails.
if: ${{ !cancelled() && steps.windows_go.outcome == 'success' }}
shell: pwsh
run: |
$required = @(
'TestManagedStateSyncExclusionIsLiteralAndProtected',
'TestManagedStateTransferScopeBoundaries',
'TestManagedStateTransferCaseSpelling',
'TestManagedStateArchiveRejectsSuppliedMarker',
'TestManagedStateTransferWindowsDirectoryAlias',
'TestManagedStateTransferWindowsShortName',
'TestWindowsFileSnapshotManagedTransferPath',
'TestWindowsFileSnapshotHandleMetadata',
'TestWindowsFileSnapshotDoesNotFollowJunction',
'TestManagedStateEntrySpellingRejectsReplacedPath',
'TestFileSnapshotPathInfoOpensContentDeniedFileForMetadata',
'TestLeaseSSHRootSelection',
'TestLeaseSSHOptionalDefaultCompatibility',
'TestLeaseSSHImportedFilePrivacy',
'TestLeaseSSHCoordinatorMetadataIgnoresInvalidGeneratedNamespace',
'TestLeaseSSHCoordinatorReleasedResolveBypassesGuestMaterial',
'TestLeaseSSHReleaseOnlyResolveSkipsGuestRebinding',
'TestSelectedLeaseSSHRootReuseAndCleanup',
'TestSelectedLeaseSSHRootWindowsACLContract',
'TestSelectedLeaseSSHRootWindowsPrivateComponents',
'TestSelectedLeaseSSHWindowsOwnedNamespaceSecuring',
'TestSelectedLeaseSSHWindowsClaimFirstNamespace',
'TestSelectedLeaseSSHWindowsPrivateKeyReuse',
'TestEnsureTestboxLeaseDirectoryCreatesPrivateWindowsComponents',
'TestEnsureLeaseSSHDirectoriesToleratesConcurrentCreation',
'TestWalkDirectoryPathToleratesConcurrentCreation',
'TestTestboxKeyPathAllowsSafeCustomIDs',
'TestUseLeaseKnownHostsScopesAndEnforcesHostVerification',
'TestSSHControlPathIsScopedByKey'
)
# POSIX mode tests are excluded; the native Windows ACL equivalents above must pass.
$events = @(go test ./internal/cli -run '^(Test(LeaseSSH|SelectedLeaseSSH|ManagedState)|Test(EnsureTestboxLeaseDirectoryCreatesPrivateWindowsComponents|EnsureLeaseSSHDirectoriesToleratesConcurrentCreation|WalkDirectoryPathToleratesConcurrentCreation|TestboxKeyPathAllowsSafeCustomIDs|UseLeaseKnownHostsScopesAndEnforcesHostVerification|SSHControlPathIsScopedByKey|WindowsFileSnapshotManagedTransferPath|WindowsFileSnapshotHandleMetadata|WindowsFileSnapshotDoesNotFollowJunction|FileSnapshotPathInfoOpensContentDeniedFileForMetadata)$)' -skip '^TestSelectedLeaseSSH(RootDoesNotRepairCallerDirectory|ExistingKeyRequiresPrivateMode)$' -count=1 -timeout=5m -json)
$code = $LASTEXITCODE
$events | ForEach-Object { Write-Host $_ }
if ($code -ne 0) { exit $code }
& ./scripts/verify-go-test-events.ps1 -Events $events -RequiredTests $required -Label 'native root contract'
- name: Test concurrent claim discovery and ownership
run: go test ./internal/cli/ -run '^Test(ClaimMetadata|ClaimTransaction|RemoveControllerFile|ConfirmedAbsentStateCleanup|PrivateRunOutput)' -count=1 -v
- name: Test pond mesh cancellation
run: go test ./internal/cli/ -run PondMeshCancel -count=1 -v
- name: Test native Windows runtime prerequisite
run: powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/test-windows-runtime.ps1
- name: Test Windows developer-image preparation in PowerShell 5.1
run: node --test scripts/install-windows-developer-tools.test.js
- name: Qualify actual managed Node artifacts (finite incident campaign)
if: github.event_name == 'pull_request' && github.head_ref == 'security/emudhra-node-release'
run: node scripts/native-node-bootstrap-proof.mjs
- name: Test native Windows detached process launch contract
run: powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/test-windows-detached-process.ps1 -AllowJobBreakawayDenied
- name: Run required native transport behaviors without skips
shell: pwsh
run: |
$required = @(
'TestRemoteActionsWorkspaceOriginNativeWindows',
'TestReadActionsWorkspaceStateNativeWindows',
'TestWindowsNativeStdinRuntime',
'TestWindowsNativeStdinSynchronousPipe',
'TestWindowsNativeRemoteCommandProcessStreamsAndArgv',
'TestWindowsRemoteRunScriptProcessArgv',
'TestWindowsNativeRemoteCommandInterpreterPaths',
'TestPackageManagerPreflightWindowsEnvironment',
'TestWindowsNativeStdinCancellation',
'TestWindowsSSHStdinReaderBehavior',
'TestWindowsWitnessRedirectedStdinUploadBehavior',
'TestWSLStageLauncherVerifiesAndConsumesReadyFile',
'TestWSLStageLauncherRejectsCorruptOrNonFileStage',
'TestWSLStageLauncherRejectsSameNonceValidReplacement',
'TestWSLStageLauncherIsFixedAndCarriesDigestBinding',
'TestWSLStageLauncherConfirmsOriginalAndCleanupTermination',
'TestWSLStageRootPreparationSecuresInheritedWindowsACL',
'TestWSLStageRootPreparationRejectsFilesAndReparsePoints',
'TestWSLStageRootPreparationCapabilityGrants',
'TestWSLStageRootPreparationRejectsCapabilityGrantsOnStagePaths',
'TestWSLStageShellDiscoveryWithoutWMI',
'TestWSLStageFrameworkInputPreamble',
'TestWSLStageDelayedInitialHandoff',
'TestWSLStageInitialHandoffBudgets',
'TestWSLStageBlindingBindsFullAndPartialDigests',
'TestWSLStageEntropyFailurePreventsDeliveryAndSpoolCreation',
'TestWSLStageBlindingStaysOutOfPublicTransportMetadata',
'TestVNCPasswordSSHBoundsWSLStageContext',
'TestRunSSHOutputBoundedDiscardsOutputOnDeferredCleanupFailure',
'TestPondMeshJobTerminationFailureStillKillsWindowsProcessTree'
)
$events = @(go test ./internal/cli/ -run ('^(' + ($required -join '|') + ')$') -count=1 -json)
$code = $LASTEXITCODE
$events | ForEach-Object { Write-Host $_ }
if ($code -ne 0) { exit $code }
& ./scripts/verify-go-test-events.ps1 -Events $events -RequiredTests $required -Label 'native behavior'
- name: Test native Windows failure captures and private outputs
run: go test ./internal/cli/ -run '^(TestFailureBundle|TestNativeWindowsFailureBundle|TestPrivateRunOutput|TestManagedAttestKeyWindows|TestArtifactOutputWindows)' -count=1 -v
- name: Test native Windows atomic private files
run: go test ./internal/atomicfile -run '^TestWritePrivate' -count=1 -v
- name: Test native Windows private staging and config persistence
run: go test ./internal/privatefile ./internal/cli -run '^Test(CreateTempWindows|ValidateWindowsDescriptor|WriteUserFileConfig(Atomic|UsesPrivateStaging))' -count=1 -v
- name: Test native Windows shared claim cancellation fences
run: go test ./internal/cli/ -run '^TestClaim(Shared|FenceContext)' -count=1 -v
- name: Test Windows SSH and rsync transport selection
run: go test ./internal/cli/ -run '^(TestWindowsWSLNativeToolProbeUsesDirectCommandOutput|TestWindowsWSLNativeToolPathsRejectsWindowsShims|TestDirectSSHExecutableSelection|TestSSHCommandContextUsesNativeWindowsOpenSSHEvenWhenPATHSelectsMSYS2|TestResolveWindowsNativeRsyncPairUsesExactSibling|TestResolveWindowsNativeRsyncPairFailsClosedWithoutSibling|TestBindWindowsNativeRsyncSSHPreservesOwnedArguments|TestWindowsNativeRsyncCommandUsesSiblingPairAndEnvironment|TestResolvedSSHCopyCommandUsesNativeWindowsSiblingPair|TestResolvedSSHCopyCommandFailsClosedWithoutNativeWindowsSibling)$' -count=1 -v
- name: Test native Windows Python and CMake preflight probes
run: go test ./internal/cli/ -run '^(TestPythonPreflightToolValidationAndTargetFiltering|TestPythonPreflightWindowsProbeUsesLiteralExecutableAndMissingContract|TestCMakePreflightNativeWindowsPresentAndMissing|TestMacOSPreflightSelection|TestPreflightCatalogMatchesRegistry)$' -count=1 -v
- name: Test Git workspace coherence
run: go test ./internal/cli/ -run '^(TestWindowsGitRootIdentityAcceptsShortAliasAndRejectsDistinctRoot|TestWindowsGitCoherenceRollbackRestoresIndexAfterSymbolicHeadFailure|TestWindowsGitSeedReplacesUnusableExactRootsAfterVerifiedClone|TestWindowsGitCoherenceSupportsDetachedSparseSplitAndLinkedIndexes|TestGitSeedFailurePhaseAndPreservation|TestGitSeedDiagnosticLabelsAndPrivacy|TestWorkspaceOwnerWindowsProtocolBehavior)$' -count=1 -v
- name: Test Git overlay snapshot capabilities
run: go test ./internal/cli/ -run '^(TestOpenGitOverlaySnapshotParentRejectsFilesAndReparsePoints|TestOpenGitOverlaySnapshotParentSupportsMetadataRestoration|TestGitOverlaySnapshotCleanupThawsReadOnlyFiles|TestGitOverlaySnapshotCopiesThroughNestedReadOnlyParents|TestGitOverlaySnapshotCleanupRejectsRootReplacementAndRetriesOriginal)$' -count=1 -v
connector-lifecycles:
name: Connector Lifecycles
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: false
- name: Test source-derived hermetic lifecycle packages
run: scripts/test-provider-lifecycles.sh
macos-intel-tools:
name: macOS Intel verification tools
runs-on: xcode-27
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Bootstrap Intel verification tools
run: bash scripts/setup-release-macos-architecture.sh x86_64 homebrew
- name: Prove Intel execution context and Homebrew
run: |
/usr/bin/arch -x86_64 /bin/bash -c 'test "$(uname -m)" = x86_64'
/usr/bin/arch -x86_64 /usr/local/bin/brew --version
apple-vm:
name: Apple VM
runs-on: xcode-27
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Verify Apple Silicon runner
run: test "$(uname -m)" = arm64
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.3
- name: Test macOS script compatibility
run: PATH="/usr/bin:/bin:$PATH" node --test scripts/mint-aws-devtools-image.test.js
- name: Qualify actual managed Node artifacts (finite incident campaign)
if: github.event_name == 'pull_request' && github.head_ref == 'security/emudhra-node-release'
run: node scripts/native-node-bootstrap-proof.mjs
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: false
- name: Prove native TLS rejection and legitimate private CA
if: github.event_name == 'pull_request' && github.head_ref == 'security/emudhra-node-release'
run: go test -race ./internal/cli -run '^TestCoordinator(ReadDoesNotOverrideTLSVerificationWithCurl|HTTPSReadNeverDowngradesAfterDroppedHandshake|NativeHTTPReadRecoversAfterDroppedConnection)$' -count=1 -v
- name: Vet native helper
run: go vet ./internal/applevmhelper ./cmd/crabbox-apple-vm-helper
- name: Require native macOS lease SSH root and managed-state contracts
shell: bash
run: |
set -o pipefail
go test -race ./internal/cli -run '^(Test(LeaseSSH|SelectedLeaseSSH|ManagedState)|Test(EnsureLeaseSSHDirectoriesToleratesConcurrentCreation|WalkDirectoryPathToleratesConcurrentCreation|TestboxKeyPathAllowsSafeCustomIDs|UseLeaseKnownHostsScopesAndEnforcesHostVerification|SSHControlPathIsScopedByKey)$)' -count=1 -timeout=5m -json | tee "$RUNNER_TEMP/lease-ssh-root-macos.jsonl"
node - "$RUNNER_TEMP/lease-ssh-root-macos.jsonl" <<'NODE'
const fs = require('node:fs');
const records = fs.readFileSync(process.argv[2], 'utf8').trim().split('\n').filter(Boolean).map(JSON.parse);
const required = [
'TestManagedStateSyncExclusionIsLiteralAndProtected',
'TestManagedStateTransferScopeBoundaries',
'TestManagedStateTransferCaseSpelling',
'TestManagedStateArchiveRejectsSuppliedMarker',
'TestManagedStateTransferAliasesAndDanglingLinks',
'TestLeaseSSHRootSelection',
'TestLeaseSSHOptionalDefaultCompatibility',
'TestLeaseSSHImportedFilePrivacy',
'TestLeaseSSHCoordinatorMetadataIgnoresInvalidGeneratedNamespace',
'TestLeaseSSHCoordinatorReleasedResolveBypassesGuestMaterial',
'TestLeaseSSHReleaseOnlyResolveSkipsGuestRebinding',
'TestSelectedLeaseSSHRootReuseAndCleanup',
'TestSelectedLeaseSSHRootDoesNotRepairCallerDirectory',
'TestSelectedLeaseSSHExistingKeyRequiresPrivateMode',
'TestEnsureLeaseSSHDirectoriesToleratesConcurrentCreation',
'TestWalkDirectoryPathToleratesConcurrentCreation',
'TestTestboxKeyPathAllowsSafeCustomIDs',
'TestUseLeaseKnownHostsScopesAndEnforcesHostVerification',
'TestSSHControlPathIsScopedByKey',
];
for (const name of required) {
for (const action of ['run', 'pass']) {
if (!records.some(record => record.Test === name && record.Action === action)) {
throw new Error(`required native root contract ${name} did not ${action}`);
}
}
}
if (records.some(record => record.Action === 'skip')) throw new Error('required native root contract was skipped');
NODE
- name: Test native macOS preflight and supervised cleanup
run: go test -race ./internal/cli -run '^(TestMacOSPreflight.*|TestMacOSPlatform.*|TestFunctionalPOSIXPreflightOwner)$' -count=1 -timeout=5m -v
- name: Test native helper and provider
run: go test -race ./internal/applevmhelper ./internal/providers/applevm
- name: Build Swift VM daemon
run: sh scripts/build-vmd.sh
- name: Build native helper with embedded daemon
run: go build -trimpath -tags vmdembed -o /tmp/crabbox-apple-vm-helper ./cmd/crabbox-apple-vm-helper
- name: Verify embedded daemon payload
run: /tmp/crabbox-apple-vm-helper vmd-info | grep -q '"embedded":true'
worker:
name: Worker
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.3
cache: npm
cache-dependency-path: worker/package-lock.json
- name: Install
run: npm ci
working-directory: worker
- name: Format
run: npm run format:check
working-directory: worker
- name: Lint
run: npm run lint
working-directory: worker
- name: Typecheck
run: npm run check
working-directory: worker
- name: Typecheck Node runtime
run: npm run check:node
working-directory: worker
- name: Test
run: npm test
working-directory: worker
- name: Build
run: npm run build
working-directory: worker
- name: Build Cloudflare Dynamic Workers
run: npm run build:cloudflare-dynamic-workers
working-directory: worker
- name: Build Node runtime
run: npm run build:node
working-directory: worker
- name: Check runtime base image pins
run: node scripts/check-docker-base-images.mjs
- name: Build Node runtime image
run: docker build -f worker/Dockerfile.node worker
worker-postgres-recovery:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- name: AWS recovery PostgreSQL integration
config: vitest.postgres.config.ts
cli: false
- name: Create retirement PostgreSQL integration
config: vitest.retire-postgres.config.ts
cli: true
services:
postgres:
# Docker Official Image; PostgreSQL 17 satisfies the supported 13+ runtime contract.
image: postgres:17-bookworm@sha256:051f7b7b3abdd564d5d1bd1e8c4b9c1b6e77087d1dd22020ede611c096a272e0
env:
POSTGRES_USER: crabbox_test
POSTGRES_PASSWORD: crabbox-test-only
POSTGRES_DB: crabbox_recovery_test
ports:
- 55432:5432
options: >-
--health-cmd "pg_isready -U crabbox_test -d crabbox_recovery_test"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.3
cache: npm
cache-dependency-path: worker/package-lock.json
- name: Install existing dependencies
run: npm ci
working-directory: worker
- name: Set up Go for CLI integration
if: matrix.cli
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: false
- name: Build CLI for integration
if: matrix.cli
run: go build -trimpath -o bin/crabbox ./cmd/crabbox
- name: Prove isolated PostgreSQL recovery
run: npm exec -- vitest run --config ${{ matrix.config }}
working-directory: worker
scripts:
name: Scripts
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.3
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: false
- name: Install script dependencies
run: sudo apt-get update && sudo apt-get install -y ripgrep
- name: Check generated Linux readiness contracts
run: node scripts/generate-linux-readiness.mjs --check
- name: Check generated bootstrap and OS catalog
run: node scripts/generate-bootstrap.mjs --check
- name: Qualify actual managed Node artifacts (finite incident campaign)
if: github.event_name == 'pull_request' && github.head_ref == 'security/emudhra-node-release'
run: node scripts/native-node-bootstrap-proof.mjs
- name: Prove native TLS rejection and legitimate private CA
if: github.event_name == 'pull_request' && github.head_ref == 'security/emudhra-node-release'
run: go test ./internal/cli -run '^TestCoordinator(ReadDoesNotOverrideTLSVerificationWithCurl|HTTPSReadNeverDowngradesAfterDroppedHandshake|NativeHTTPReadRecoversAfterDroppedConnection)$' -count=1 -v
- name: Prove pinned Rust and uv offline execution
timeout-minutes: 5
env:
CRABBOX_TEST_RUST_UV_DOWNLOAD: "1"
run: node --test --test-name-pattern='^reviewed Linux Rust and uv archives' scripts/linux-rust-uv.test.js
- name: Install pinned coordinator deployment tooling
run: npm ci --prefix worker --ignore-scripts
- name: Test
run: node --test scripts/*.test.js scripts/*.test.mjs
docs:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check translations (staleness is advisory)
run: node scripts/check-docs-i18n.mjs
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.3
- name: Set up Go
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.27.4"
go-version-file: go.mod
cache: false
- name: Check docs
run: scripts/check-docs.sh