Jonathan Haas commited on
Commit ·
2bfbca6
1
Parent(s): 3aa9dc0
Add scheduled CI fault profile matrix and local profile runner
Browse filesFiles changed (7)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263name: Fault Profiles
on: schedule: - cron: "0 9 * * 1" workflow_dispatch: inputs: profile: description: "Fault profile to run" type: choice default: all options: - all - quick - network - storage - contract
concurrency: group: fault-profiles-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false
jobs: fault-profiles: runs-on: ubuntu-latest timeout-minutes: 30 strategy: fail-fast: false matrix: profile: - quick - network - storage - contract if: github.event_name != 'workflow_dispatch' || github.event.inputs.profile == 'all' || github.event.inputs.profile == matrix.profile steps: - name: Checkout uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Python uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: "3.12"
- name: Install uv uses: astral-sh/setup-uv@8d55fbecc275b1c35dbe060458839f8d30439ccf # v3
- name: Sync dependencies run: uv sync --extra dev
- name: Run fault profile run: | set -euo pipefail mkdir -p .artifacts/fault-profiles ./scripts/run_fault_profiles.sh "${{ matrix.profile }}" | tee ".artifacts/fault-profiles/${{ matrix.profile }}.log"
- name: Upload profile artifact if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: fault-profile-${{ matrix.profile }}-${{ github.run_id }} path: .artifacts/fault-profiles/${{ matrix.profile }}.log if-no-files-found: warn12345 unmodified lines101112131415.PHONY: check test-fast test-faults test-soak security-gatecheck:uv run ruff check src tests5 unmodified linestest-faults:./scripts/test_faults.shtest-soak:uv run pytest -q tests/test_main_audio.py -k soak12345 unmodified lines101112131415161718.PHONY: check test-fast test-faults test-fault-profiles test-soak security-gatecheck:uv run ruff check src tests5 unmodified linestest-faults:./scripts/test_faults.shtest-fault-profiles:./scripts/run_fault_profiles.sh alltest-soak:uv run pytest -q tests/test_main_audio.py -k soak
195 unmodified lines196197198199200201195 unmodified lines- Security maintenance: [`docs/operations/security-maintenance.md`](docs/operations/security-maintenance.md).- Error taxonomy: [`docs/operations/error-taxonomy.md`](docs/operations/error-taxonomy.md).- Observability runbook: [`docs/operations/observability-runbook.md`](docs/operations/observability-runbook.md).- Skills developer guide: [`docs/operations/skills-development.md`](docs/operations/skills-development.md).- Provenance verification: [`docs/operations/provenance-verification.md`](docs/operations/provenance-verification.md).- Incident response: [`docs/operations/incident-response.md`](docs/operations/incident-response.md).195 unmodified lines196197198199200201202203204195 unmodified lines- Security maintenance: [`docs/operations/security-maintenance.md`](docs/operations/security-maintenance.md).- Error taxonomy: [`docs/operations/error-taxonomy.md`](docs/operations/error-taxonomy.md).- Observability runbook: [`docs/operations/observability-runbook.md`](docs/operations/observability-runbook.md).- Fault resilience profiles:- local: `make test-fault-profiles` (runs `quick`, `network`, `storage`, `contract`)- CI: scheduled `Fault Profiles` workflow runs weekly with per-profile artifacts- Skills developer guide: [`docs/operations/skills-development.md`](docs/operations/skills-development.md).- Provenance verification: [`docs/operations/provenance-verification.md`](docs/operations/provenance-verification.md).- Incident response: [`docs/operations/incident-response.md`](docs/operations/incident-response.md).
106 unmodified lines107108109110111112113106 unmodified lines- [x] `RX02` Add persistent recovery journal for interrupted actions and post-restart reconciliation. `P0`- [ ] `RX03` Add dead-letter queue for failed outbound notifications/webhooks with replay controls. `P1`- [x] `RX04` Add stricter timeout budgets per turn phase (listen/think/speak/act). `P0`- [ ] `RX05` Add chaos/fault profile runner in CI for scheduled resilience regression tests. `P1`- [x] `RX06` Add runtime invariant checks to detect impossible state combinations and auto-heal. `P1`## 11) Observability and Evaluation (6 items)106 unmodified lines107108109110111112113106 unmodified lines- [x] `RX02` Add persistent recovery journal for interrupted actions and post-restart reconciliation. `P0`- [ ] `RX03` Add dead-letter queue for failed outbound notifications/webhooks with replay controls. `P1`- [x] `RX04` Add stricter timeout budgets per turn phase (listen/think/speak/act). `P0`- [x] `RX05` Add chaos/fault profile runner in CI for scheduled resilience regression tests. `P1`- [x] `RX06` Add runtime invariant checks to detect impossible state combinations and auto-heal. `P1`## 11) Observability and Evaluation (6 items)
1234567891011121314151617181920212223242526272829303132#!/usr/bin/env bashset -euo pipefail
profile="${1:-quick}"
case "$profile" in quick) pattern="timeout or cancelled or invalid_json or api_error or storage_error or missing_store or unknown_error or summary_unavailable or http_error or network_client_error" ;; network) pattern="failed and reach and parameterized" ;; storage) pattern="timed and parameterized" ;; contract) pattern="cancelled and parameterized" ;; all) for name in quick network storage contract; do "$0" "$name" done exit 0 ;; *) echo "Unknown fault profile: $profile" >&2 echo "Expected one of: quick, network, storage, contract, all" >&2 exit 2 ;;esac
uv run pytest -q tests/test_tools_services.py -m fault -k "$pattern"1234#!/usr/bin/env bashset -euo pipefailuv run pytest -q tests/test_tools_services.py -m fault -k "timeout or cancelled or invalid_json or api_error or storage_error or missing_store or unknown_error or summary_unavailable or http_error or network_client_error"1234#!/usr/bin/env bashset -euo pipefail./scripts/run_fault_profiles.sh quick
3724 unmodified lines37253726372737283729373037313732373337348 unmodified lines37433744374537463747374837493724 unmodified linesdef test_fault_subset_selector_covers_critical_taxonomy_codes(self):project_root = Path(__file__).resolve().parents[1]script_text = (project_root / "scripts" / "test_faults.sh").read_text()makefile_text = (project_root / "Makefile").read_text()# Keep Makefile and script contract coupled through delegation.assert "./scripts/test_faults.sh" in makefile_textcritical_codes = {"timeout",8 unmodified lines"network_client_error",}for code in critical_codes:assert code in script_textdef test_error_taxonomy_doc_mentions_home_assistant_conversation_timers_reminders_calendar(self):project_root = Path(__file__).resolve().parents[1]3724 unmodified lines3725372637273728372937303731373237333734373537368 unmodified lines37453746374737483749375037513724 unmodified linesdef test_fault_subset_selector_covers_critical_taxonomy_codes(self):project_root = Path(__file__).resolve().parents[1]script_text = (project_root / "scripts" / "test_faults.sh").read_text()profile_runner_text = (project_root / "scripts" / "run_fault_profiles.sh").read_text()makefile_text = (project_root / "Makefile").read_text()# Keep Makefile and script contract coupled through delegation.assert "./scripts/test_faults.sh" in makefile_textassert "./scripts/run_fault_profiles.sh quick" in script_textcritical_codes = {"timeout",8 unmodified lines"network_client_error",}for code in critical_codes:assert code in profile_runner_textdef test_error_taxonomy_doc_mentions_home_assistant_conversation_timers_reminders_calendar(self):project_root = Path(__file__).resolve().parents[1]
.github/workflows/fault-profiles.ymlAdded+63
Makefile+4-1
README.md+3
TODO.md+1-1
scripts/run_fault_profiles.shAdded+32
scripts/test_faults.sh+1-1
tests/test_tools_services.py+3-1