Skip to content

Commit aa82f6f

Browse files
pmaxhoganclaude
andcommitted
ci: chaos harness jobs (hermetic + fake-drive PR-gating, real-drive M4-gated)
Wire the STRESS_HARNESS s7 jobs, matching ci.yml style (rust-cache, SQLX_OFFLINE): - chaos-hermetic (every PR, ubuntu): run-all; the admin/NTFS/real-Drive rows SKIP cleanly on a stock non-elevated Linux runner. - chaos-fake-drive (every PR, windows): the NTFS-shaped + fault-injection rows become runnable against the InMemoryRemoteStore (still unelevated). - chaos-real-drive: WIRED but `if: false`-skipped until M4 (the DRIVEN_E2E_REFRESH_TOKEN secret is absent until GoogleDriveStore lands; secrets are unavailable in a job-level `if`, so the maintainer flips the literal gate at M4). Skips cleanly, never fails. - chaos-soak (weekly cron, informational): a seeded fuzz soak; uploads target/chaos-fuzz-failures/<seed>.json on a violation for bit-reproducible replay. Both PR jobs exit 0 = all pass/skip, 1 = any fail (STRESS_HARNESS s9). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8meqeTo8bcZ3zjgKjBnJ4
1 parent 379f226 commit aa82f6f

1 file changed

Lines changed: 129 additions & 0 deletions

File tree

.github/workflows/chaos.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Chaos
2+
3+
# Driven stress / chaos harness (design/STRESS_HARNESS.md s7).
4+
#
5+
# Jobs:
6+
# chaos-hermetic - every PR, ubuntu. Runs every scenario whose requires()
7+
# is satisfiable on a stock non-elevated Linux runner
8+
# (no real-Drive creds, no admin); the rest SKIP cleanly.
9+
# chaos-fake-drive - every PR, windows. Adds the Windows / NTFS-shaped rows
10+
# and the s3.7 / s5 fault-injection scenarios against the
11+
# InMemoryRemoteStore. Still no real Drive, no elevation.
12+
# chaos-real-drive - WIRED but SKIPPED until M4: gated on the
13+
# DRIVEN_E2E_REFRESH_TOKEN secret, which is absent until
14+
# the GoogleDriveStore (M4) lands. It skips cleanly, it
15+
# does NOT fail (STRESS_HARNESS s7 "Gating on M4").
16+
# chaos-soak - weekly cron: a long seeded fuzz run. Informational.
17+
18+
on:
19+
push:
20+
branches: [main]
21+
pull_request:
22+
branches: [main]
23+
schedule:
24+
# Weekly soak, Monday 06:00 UTC (STRESS_HARNESS s7 chaos-soak).
25+
- cron: "0 6 * * 1"
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}
29+
cancel-in-progress: true
30+
31+
env:
32+
CARGO_TERM_COLOR: always
33+
RUST_BACKTRACE: 1
34+
# The harness boots the headless core whose state layer uses sqlx
35+
# compile-time-checked queries; CI has no live DB, so resolve against the
36+
# committed .sqlx/ cache (same as ci.yml).
37+
SQLX_OFFLINE: "true"
38+
39+
jobs:
40+
chaos-hermetic:
41+
name: chaos hermetic (ubuntu)
42+
# Skip the PR run on the scheduled trigger; the soak job covers cron.
43+
if: github.event_name != 'schedule'
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: dtolnay/rust-toolchain@stable
48+
- name: Install Linux Tauri deps
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
52+
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
53+
- uses: Swatinem/rust-cache@v2
54+
# run-all capability-gates every scenario: on a stock non-elevated Linux
55+
# runner the admin / NTFS / real-Drive rows SKIP (recorded, never red);
56+
# everything else runs against the headless core + InMemoryRemoteStore.
57+
# Exit code: 0 = all pass/skip, 1 = any fail (STRESS_HARNESS s9).
58+
- name: chaos run-all (hermetic)
59+
run: cargo run -p driven-chaos -- run-all --hermetic
60+
61+
chaos-fake-drive:
62+
name: chaos fake-drive (windows)
63+
if: github.event_name != 'schedule'
64+
runs-on: windows-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: dtolnay/rust-toolchain@stable
68+
- uses: Swatinem/rust-cache@v2
69+
# On Windows the additional NTFS-shaped and fault-injection rows that the
70+
# Linux job SKIPs become runnable (still against the fake remote, still
71+
# unelevated - the admin/VSS rows SKIP). Same exit-code semantics.
72+
- name: chaos run-all (fake-drive)
73+
run: cargo run -p driven-chaos -- run-all --hermetic
74+
75+
chaos-real-drive:
76+
name: chaos real-drive (M4-gated, skipped)
77+
# WIRED but SKIPPED until M4 (STRESS_HARNESS s7 "Gating on M4"): the
78+
# real-Drive E2E refresh token does not exist until the GoogleDriveStore
79+
# (M4) lands, so this job is configured now and stays `if: false`-skipped.
80+
# The `secrets` context is NOT available in a job-level `if`, so we cannot
81+
# gate on the secret being present here - instead the maintainer flips this
82+
# literal `false` to `true` (or to a `vars.*` flag) when the
83+
# DRIVEN_E2E_REFRESH_TOKEN secret is configured at M4. Until then the job is
84+
# SKIPPED, never FAILED.
85+
if: ${{ false }}
86+
runs-on: ubuntu-latest
87+
env:
88+
DRIVEN_E2E_REFRESH_TOKEN: ${{ secrets.DRIVEN_E2E_REFRESH_TOKEN }}
89+
DRIVEN_E2E_DEST_FOLDER_ID: ${{ secrets.DRIVEN_E2E_DEST_FOLDER_ID }}
90+
steps:
91+
- uses: actions/checkout@v4
92+
- uses: dtolnay/rust-toolchain@stable
93+
- name: Install Linux Tauri deps
94+
run: |
95+
sudo apt-get update
96+
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
97+
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
98+
- uses: Swatinem/rust-cache@v2
99+
# With real creds present, the cap:real_drive_creds rows run against a
100+
# throwaway Drive folder; everything else runs as in the hermetic job.
101+
- name: chaos run-all (real Drive)
102+
run: cargo run -p driven-chaos -- run-all --hermetic
103+
104+
chaos-soak:
105+
name: chaos soak (weekly fuzz)
106+
# Weekly cron only; informational, does not gate merges (STRESS_HARNESS s7).
107+
if: github.event_name == 'schedule'
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v4
111+
- uses: dtolnay/rust-toolchain@stable
112+
- name: Install Linux Tauri deps
113+
run: |
114+
sudo apt-get update
115+
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
116+
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
117+
- uses: Swatinem/rust-cache@v2
118+
# A long seeded fuzz run; the seed is recorded in the log and any
119+
# invariant violation writes target/chaos-fuzz-failures/<seed>.json for
120+
# bit-reproducible replay (STRESS_HARNESS s4.3).
121+
- name: chaos fuzz (seeded soak)
122+
run: cargo run -p driven-chaos -- fuzz --seed ${{ github.run_id }} --duration 30m
123+
- name: upload fuzz failure replays
124+
if: failure()
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: chaos-fuzz-failures
128+
path: target/chaos-fuzz-failures/
129+
if-no-files-found: ignore

0 commit comments

Comments
 (0)