-
Notifications
You must be signed in to change notification settings - Fork 27
1378 lines (1134 loc) · 44.2 KB
/
ci.yml
File metadata and controls
1378 lines (1134 loc) · 44.2 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]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
security-regressions:
name: Fast Security Regressions
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run security regression contract tests
run: |
cargo test -p hush-cli --test abuse_harness -- --nocapture
cargo test -p hush-cli --test hunt_e2e -- --nocapture --test-threads=1
cargo test -p clawdstrike --test security_regressions -- --nocapture
cargo test -p hushd --test security_regressions -- --nocapture
cargo test -p hush-cli hush_run::tests::connect_proxy_rejects_ip_target_with_allowlisted_sni_mismatch -- --exact
cargo test -p hush-cli hush_run::tests::connect_proxy_hostname_target_is_ip_pinned_after_policy_check -- --exact
policy-torture:
name: Policy Torture (PR Gate)
runs-on: ubuntu-latest
timeout-minutes: 20
needs: security-regressions
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Run policy torture battery
run: bash rulesets/tests/policy-torture/run.sh
- name: Upload policy torture JSON reports
if: always()
uses: actions/upload-artifact@v6
with:
name: policy-torture-reports
path: rulesets/tests/policy-torture/reports/*.json
if-no-files-found: error
check:
name: Check
runs-on: ubuntu-latest
needs: [security-regressions, policy-torture]
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Check formatting
run: cargo fmt --all -- --check
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "24"
- name: Install TypeScript compiler
run: npm install -g typescript@5.9.3
- name: Smoke test TS file dependency workflows
run: bash scripts/smoke-ts-file-deps.sh
- name: Validate Docker Compose topology
run: docker compose -f infra/docker/docker-compose.services.yaml config > /dev/null
- name: Lint moved paths
run: bash scripts/path-lint.sh
- name: Validate moved path targets
run: bash scripts/move-validation.sh
- name: Validate architecture guardrails
run: bash scripts/architecture-guardrails.sh
- name: Slop audit (critical paths)
run: bash scripts/slop-audit.sh
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install mypy
run: python -m pip install --disable-pip-version-check mypy==1.19.1
- name: Validate docs code blocks
run: tools/scripts/validate-docs
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --all-targets
- name: Test
run: cargo test --all --exclude sdr-integration-tests
sdk-conformance:
name: SDK Conformance Vectors
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: packages/sdk/hush-go/go.mod
cache: true
cache-dependency-path: packages/sdk/hush-go/go.sum
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: packages/sdk/hush-ts/package-lock.json
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Run SDK conformance runner
run: bash scripts/run-sdk-conformance.sh
terminal-tui:
name: Terminal TUI
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
working-directory: apps/terminal
run: bun install --frozen-lockfile
- name: Type check
working-directory: apps/terminal
run: bun run typecheck
- name: Unit tests
working-directory: apps/terminal
run: bun test
- name: Wrapper smoke tests
run: cargo test -p hush-cli tui::tests -- --nocapture
- name: Installed wrapper smoke
shell: bash
run: |
set -euo pipefail
cargo build -p hush-cli --bin clawdstrike --bin hush
STAGE="$RUNNER_TEMP/clawdstrike-tui-stage"
mkdir -p "$STAGE/bin" "$STAGE/share/clawdstrike/tui"
cp target/debug/clawdstrike "$STAGE/bin/clawdstrike"
cp target/debug/hush "$STAGE/bin/hush"
cp apps/terminal/package.json "$STAGE/share/clawdstrike/tui/"
cp apps/terminal/bun.lockb "$STAGE/share/clawdstrike/tui/"
cp crates/services/hush-cli/assets/tui/cli.js "$STAGE/share/clawdstrike/tui/"
cp -R apps/terminal/src "$STAGE/share/clawdstrike/tui/src"
(
cd "$STAGE/share/clawdstrike/tui"
bun install --production --frozen-lockfile
)
"$STAGE/bin/clawdstrike" tui doctor --json > "$RUNNER_TEMP/tui-doctor.json"
grep '"runtime"' "$RUNNER_TEMP/tui-doctor.json"
tauri-rust-check:
name: Tauri Rust Crates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Linux dependencies for Tauri
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
protobuf-compiler
sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-tauri-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-tauri-
${{ runner.os }}-cargo-
- name: Check desktop Tauri crate
run: cargo check --manifest-path apps/desktop/src-tauri/Cargo.toml
- name: Check agent macOS packaging sources
shell: bash
run: |
set -euo pipefail
required=(
apps/agent/src-tauri/macos/system-extension/entitlements/agent-app.entitlements
apps/agent/src-tauri/macos/system-extension/entitlements/combined-system-extension.entitlements
apps/agent/src-tauri/macos/system-extension/plists/agent-packaging-template.plist
apps/agent/src-tauri/macos/system-extension/plists/combined-system-extension-template.plist
apps/agent/src-tauri/macos/system-extension/profiles/developer-id-profile-template.plist
)
for path in "${required[@]}"; do
[[ -f "$path" ]] || {
echo "missing macOS packaging asset: $path" >&2
exit 1
}
done
CLAWDSTRIKE_VALIDATE_MACOS_PACKAGING=1 cargo check --manifest-path apps/agent/src-tauri/Cargo.toml
desktop-frontend:
name: Desktop Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
working-directory: apps/desktop
run: bun install --frozen-lockfile
- name: Type check
working-directory: apps/desktop
run: bun run typecheck
- name: Unit tests
working-directory: apps/desktop
run: bun run test
- name: Build
working-directory: apps/desktop
run: bun run build
control-console:
name: Control Console
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: apps/control-console/package-lock.json
- name: Install dependencies
working-directory: apps/control-console
run: npm ci
- name: Type check
working-directory: apps/control-console
run: npm run typecheck
- name: Unit tests
working-directory: apps/control-console
run: npm test
- name: Build
working-directory: apps/control-console
run: npm run build
sdr-integration-tests:
name: SDR Integration Tests
runs-on: ubuntu-latest
timeout-minutes: 15
needs: check
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-sdr-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-sdr-
${{ runner.os }}-cargo-
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Spine pipeline tests
run: cargo test -p hush-spine --test pipeline_test
- name: Bridge roundtrip tests
run: cargo test -p sdr-integration-tests --test bridge_roundtrip_test
- name: K8s audit bridge reliability tests
run: cargo test -p sdr-integration-tests --test k8s_audit_bridge_reliability -- --nocapture
- name: E2E pipeline tests
run: cargo test -p sdr-integration-tests --test e2e_pipeline
adaptive-control-integration:
name: Adaptive Control Integration (NATS + Postgres)
runs-on: ubuntu-latest
timeout-minutes: 25
needs: check
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Run control-api adaptive integration tests
run: 'cargo test -p clawdstrike-control-api integration_tests:: -- --nocapture'
msrv:
name: Minimum Supported Rust Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@1.93
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Build with MSRV
run: cargo build --all-targets
offline:
name: Offline Build/Test (vendored)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Test offline
run: scripts/cargo-offline.sh test --workspace --all-targets
env:
CARGO_NET_OFFLINE: "true"
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Build documentation
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
security-audit:
name: Security Audit
runs-on: ubuntu-latest
needs: security-regressions
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-audit
run: cargo install cargo-audit --locked --version 0.22.0
- name: Enforce advisory exception policy metadata
run: tools/scripts/check-advisory-expiry.sh
- name: Run security audits
run: |
audit_ignores=(
--ignore RUSTSEC-2024-0375 \
--ignore RUSTSEC-2025-0141 \
--ignore RUSTSEC-2024-0388 \
--ignore RUSTSEC-2024-0411 \
--ignore RUSTSEC-2024-0412 \
--ignore RUSTSEC-2024-0413 \
--ignore RUSTSEC-2024-0414 \
--ignore RUSTSEC-2024-0415 \
--ignore RUSTSEC-2024-0416 \
--ignore RUSTSEC-2024-0417 \
--ignore RUSTSEC-2024-0418 \
--ignore RUSTSEC-2024-0419 \
--ignore RUSTSEC-2024-0420 \
--ignore RUSTSEC-2024-0429 \
--ignore RUSTSEC-2024-0436 \
--ignore RUSTSEC-2025-0057 \
--ignore RUSTSEC-2025-0134 \
--ignore RUSTSEC-2024-0370 \
--ignore RUSTSEC-2021-0145 \
--ignore RUSTSEC-2025-0075 \
--ignore RUSTSEC-2025-0080 \
--ignore RUSTSEC-2025-0081 \
--ignore RUSTSEC-2025-0098 \
--ignore RUSTSEC-2025-0100 \
--ignore RUSTSEC-2025-0119
)
cargo audit --deny warnings "${audit_ignores[@]}"
cargo audit --deny warnings --file apps/desktop/src-tauri/Cargo.lock "${audit_ignores[@]}"
license-check:
name: License Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-deny
uses: taiki-e/install-action@cargo-deny
- name: Generate desktop Tauri cargo metadata
run: cargo metadata --manifest-path apps/desktop/src-tauri/Cargo.toml --format-version 1 --locked > desktop-tauri-metadata.json
- name: Run cargo-deny for workspace
run: cargo deny check
- name: Run cargo-deny for desktop Tauri crate
run: cargo deny check --metadata-path desktop-tauri-metadata.json licenses sources
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install Linux dependencies for desktop Tauri coverage
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate workspace coverage report
run: cargo llvm-cov --all-features --lcov --output-path lcov.workspace.info
- name: Generate desktop Tauri coverage report
run: cargo llvm-cov --manifest-path apps/desktop/src-tauri/Cargo.toml --lcov --output-path lcov.desktop.info
- name: Combine coverage reports
run: |
cat lcov.workspace.info lcov.desktop.info > lcov.info
- name: Enforce changed-file Rust coverage floor
env:
GITHUB_BASE_REF: ${{ github.base_ref }}
CHANGED_RUST_COVERAGE_THRESHOLD: "70"
run: |
if [ -z "${GITHUB_BASE_REF}" ]; then
echo "No base ref (non-PR run); skipping changed-file Rust coverage gate."
exit 0
fi
git fetch --no-tags --depth=1 origin "${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}"
# In shallow PR checkouts, merge-base may be missing even when origin/<base> exists.
# Retry after fetching full history so three-dot diff stays stable.
if ! git diff --name-only "origin/${GITHUB_BASE_REF}...HEAD" -- '*.rs' ':(exclude)infra/vendor/**' > changed_rust_files.txt; then
echo "Shallow diff failed; fetching additional history for merge-base resolution"
git fetch --no-tags --prune --unshallow origin || git fetch --no-tags --prune origin
git fetch --no-tags origin "${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}"
git diff --name-only "origin/${GITHUB_BASE_REF}...HEAD" -- '*.rs' ':(exclude)infra/vendor/**' > changed_rust_files.txt
fi
if [ ! -s changed_rust_files.txt ]; then
echo "No changed Rust files; skipping changed-file Rust coverage gate."
exit 0
fi
# This job merges coverage from the root Rust workspace and the
# desktop Tauri crate. Keep generating desktop LCOV, but exclude the
# long-lived Tauri surface from the changed-line floor until it has a
# dedicated changed-line gate instead of inheriting legacy branch
# churn. Also exclude standalone crates still outside the combined
# coverage set and test-only Rust sources that do not emit stable
# LCOV entries in this job.
grep -v '^apps/agent/src-tauri/' changed_rust_files.txt \
| grep -v '^apps/desktop/src-tauri/' \
| grep -v '^crates/bridges/hush-go-native/' \
| grep -v '^packages/sdk/hush-py/hush-native/' \
| grep -Ev '(^|/)tests/|_test\.rs$|_tests\.rs$|integration_tests\.rs$' \
| grep -Ev '^crates/libs/hunt-(correlate|query|scan)/src/(lib|error)\.rs$' \
| grep -Ev '^crates/libs/(hush-core|clawdstrike)/src/lib\.rs$' \
| grep -Ev '^crates/services/hush-cli/src/tests\.rs$' \
> changed_rust_files.coverage.txt || true
if [ ! -s changed_rust_files.coverage.txt ]; then
echo "No workspace Rust files changed; skipping changed-file Rust coverage gate."
exit 0
fi
tools/scripts/check-changed-rust-coverage.py \
--lcov lcov.info \
--changed-files-file changed_rust_files.coverage.txt \
--git-diff-range "origin/${GITHUB_BASE_REF}...HEAD" \
--threshold "${CHANGED_RUST_COVERAGE_THRESHOLD}"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: lcov.info
fail_ci_if_error: false
wasm:
name: WASM Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-wasm-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-wasm-
- name: Install wasm-pack
run: cargo install wasm-pack --locked --version 0.14.0
- name: Build WASM
run: |
cd crates/libs/hush-wasm
wasm-pack build --target web --release
- name: Verify committed Node.js WASM artifacts are in sync
run: |
cd crates/libs/hush-wasm
wasm-pack build --target nodejs --release --out-dir pkg-node
for f in hush_wasm.js hush_wasm.d.ts hush_wasm_bg.wasm.d.ts; do
if ! cmp -s "$f" "pkg-node/$f"; then
echo "ERROR: $f is out of sync with wasm-pack --target nodejs output"
echo "Run: cd crates/libs/hush-wasm && ./build.sh"
exit 1
fi
done
- name: Check bundle size
run: |
SIZE=$(wc -c < crates/libs/hush-wasm/pkg/hush_wasm_bg.wasm)
echo "Bundle size: $SIZE bytes ($(( SIZE / 1024 ))KB)"
# Limit raised from 1.75MiB after adding policy-event + OCSF conversion
# support to hush-wasm (via clawdstrike-policy-event/clawdstrike-ocsf).
# Current baseline ~2.25MiB; 2.5MiB cap leaves ~10% headroom.
if [ $SIZE -gt 2621440 ]; then
echo "ERROR: Bundle exceeds 2.5MiB limit"
exit 1
fi
echo "Bundle size is within 2.5MiB limit"
proptest:
name: Property Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-proptest-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-proptest-
- name: Run property tests
run: cargo test --workspace proptest
env:
PROPTEST_CASES: 500
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Cache cargo registry
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-integration-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-integration-
${{ runner.os }}-cargo-
- name: Build daemon
run: cargo build -p hushd
- name: Start daemon in background
run: |
./target/debug/hushd start &
echo $! > /tmp/hushd.pid
env:
RUST_LOG: info
- name: Wait for daemon health
run: |
for i in {1..30}; do
if curl -s http://127.0.0.1:9876/health | grep -q '"status":"healthy"'; then
echo "Daemon is healthy"
exit 0
fi
echo "Waiting for daemon... (attempt $i/30)"
sleep 1
done
echo "Daemon failed to start"
exit 1
- name: Run integration tests
run: cargo test -p hushd --test integration
env:
HUSHD_TEST_URL: http://127.0.0.1:9876
- name: Stop daemon
if: always()
run: |
if [ -f /tmp/hushd.pid ]; then
kill $(cat /tmp/hushd.pid) 2>/dev/null || true
rm /tmp/hushd.pid
fi
fuzz-check:
name: Fuzz Smoke (PR)
runs-on: ubuntu-latest
needs: security-regressions
steps:
- uses: actions/checkout@v6
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-fuzz
run: cargo install cargo-fuzz --locked --version 0.13.1
- name: Build fuzz targets
run: |
cd fuzz
cargo +nightly build
- name: Run fuzz smoke targets
run: |
cd fuzz
cargo +nightly fuzz run fuzz_policy_parse -- -max_total_time=30
cargo +nightly fuzz run fuzz_irm_net_parse -- -max_total_time=30
cargo +nightly fuzz run fuzz_remote_extends_parse -- -max_total_time=30
typescript-sdk:
name: TypeScript SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/sdk/hush-ts
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: |
packages/sdk/hush-ts/package-lock.json
packages/adapters/clawdstrike-adapter-core/package-lock.json
- name: Bootstrap file deps (adapter-core)
working-directory: packages/adapters/clawdstrike-adapter-core
run: npm ci
- name: Build file deps (adapter-core)
working-directory: packages/adapters/clawdstrike-adapter-core
run: npm run build
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Verify package exports
run: |
node -e "const sdk = require('./dist/index.cjs'); console.log('CJS exports:', Object.keys(sdk).slice(0, 10))"
node --input-type=module -e "import * as sdk from './dist/index.js'; console.log('ESM exports:', Object.keys(sdk).slice(0, 10))"
agent-fail-closed-smoke:
name: Agent Fail-Closed Smoke
runs-on: ubuntu-latest
needs: security-regressions
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: |
packages/adapters/clawdstrike-adapter-core/package-lock.json
packages/adapters/clawdstrike-openai/package-lock.json
packages/adapters/clawdstrike-claude/package-lock.json
packages/adapters/clawdstrike-hush-cli-engine/package-lock.json
packages/adapters/clawdstrike-hushd-engine/package-lock.json
- name: Install dependencies
run: |
npm --prefix packages/adapters/clawdstrike-adapter-core ci
npm --prefix packages/adapters/clawdstrike-openai ci
npm --prefix packages/adapters/clawdstrike-claude ci
npm --prefix packages/adapters/clawdstrike-hush-cli-engine ci
npm --prefix packages/adapters/clawdstrike-hushd-engine ci
- name: Build dependencies and adapters
run: |
npm --prefix packages/adapters/clawdstrike-adapter-core run build
npm --prefix packages/adapters/clawdstrike-openai run build
npm --prefix packages/adapters/clawdstrike-claude run build
npm --prefix packages/adapters/clawdstrike-hush-cli-engine run build
npm --prefix packages/adapters/clawdstrike-hushd-engine run build
- name: Run fail-closed smoke POCs
run: node tools/scripts/agent-fail-closed-smoke.mjs
- name: Upload fail-closed smoke report
if: always()
uses: actions/upload-artifact@v6
with:
name: agent-fail-closed-smoke-report
path: |
docs/reports/agent-fail-closed-smoke.json
docs/reports/agent-fail-closed-smoke.md
if-no-files-found: error
adapter-core-cross-adapter:
name: Adapter Core Cross-Adapter
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/adapters/clawdstrike-adapter-core
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: packages/adapters/clawdstrike-adapter-core/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run cross-adapter decision parity suite
run: npm run test:cross-adapter
openclaw-plugin:
name: OpenClaw Plugin
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/adapters/clawdstrike-openclaw
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: packages/adapters/clawdstrike-openclaw/package-lock.json
- name: Bootstrap file deps (adapter-core)
working-directory: packages/adapters/clawdstrike-adapter-core
run: npm ci
- name: Build file deps (adapter-core)
working-directory: packages/adapters/clawdstrike-adapter-core
run: npm run build
- name: Bootstrap file deps (policy)
working-directory: packages/policy/clawdstrike-policy
run: npm ci
- name: Build file deps (policy)
working-directory: packages/policy/clawdstrike-policy
run: npm run build
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Build
run: npm run build
- name: Test
run: npm test
- name: OpenClaw E2E (simulated runtime)
run: npm run e2e
openclaw-plugin-runtime-matrix:
name: OpenClaw Runtime (${{ matrix.openclaw_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
openclaw_version: ['2026.2.15', '2026.2.25', 'latest']
defaults:
run:
working-directory: packages/adapters/clawdstrike-openclaw
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: packages/adapters/clawdstrike-openclaw/package-lock.json
- name: Bootstrap file deps (adapter-core)
working-directory: packages/adapters/clawdstrike-adapter-core
run: npm ci
- name: Build file deps (adapter-core)
working-directory: packages/adapters/clawdstrike-adapter-core
run: npm run build
- name: Bootstrap file deps (policy)
working-directory: packages/policy/clawdstrike-policy
run: npm ci
- name: Build file deps (policy)
working-directory: packages/policy/clawdstrike-policy
run: npm run build
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Install OpenClaw CLI (${{ matrix.openclaw_version }})
working-directory: .
run: npm install -g openclaw@${{ matrix.openclaw_version }}
- name: Prepare OpenClaw runtime artifact directories
working-directory: .
run: |
mkdir -p \
artifacts/openclaw-install-link-smoke-${{ matrix.openclaw_version }} \
artifacts/openclaw-runtime-smoke-${{ matrix.openclaw_version }} \
artifacts/openclaw-runtime-blocked-e2e-${{ matrix.openclaw_version }}
touch \
artifacts/openclaw-install-link-smoke-${{ matrix.openclaw_version }}/.keep \
artifacts/openclaw-runtime-smoke-${{ matrix.openclaw_version }}/.keep \
artifacts/openclaw-runtime-blocked-e2e-${{ matrix.openclaw_version }}/.keep
- name: OpenClaw install-link smoke
working-directory: .
run: OPENCLAW_RUNTIME_ARTIFACT_DIR=artifacts/openclaw-install-link-smoke-${{ matrix.openclaw_version }} bash scripts/openclaw-plugin-install-link-smoke.sh
- name: Assert install-link summary checks
working-directory: .
run: |
jq -e '
.result == "pass"
and .checks.installCommandSucceeded
and .checks.enableCommandSucceeded
and .checks.pluginInfoJsonPresent
and .checks.pluginIdMatches
and .checks.pluginStatusLoaded
and .checks.configLoadPathContainsLink
and .checks.configEntryEnabled
and .checks.allExpectedHooksPresent
and (.checks.idMismatchWarningPresent | not)
' artifacts/openclaw-install-link-smoke-${{ matrix.openclaw_version }}/summary.json >/dev/null