Skip to content

Phase 7: Resilience & test hardening#5

Merged
Lushenwar merged 3 commits into
mainfrom
phase7-resilience
Jul 8, 2026
Merged

Phase 7: Resilience & test hardening#5
Lushenwar merged 3 commits into
mainfrom
phase7-resilience

Conversation

@Lushenwar

Copy link
Copy Markdown
Owner

Summary

  • 7A — Deterministic LLM fallbacks. LLMUnavailable is raised on all three failure modes (timeout/network, malformed/non-schema JSON, empty/refused). The orchestrator models this as a real degraded terminal state: empty suspect list (nothing fabricated), raw git diffs + vector-matched runbooks preserved on the incident, contract-valid payload, warning surfaced in the Slack card and dashboard badge. Postmortem generation failure writes an honest placeholder instead of crashing.
  • Contract: degraded status + degraded/degraded_reason/raw_commits diagnostics fields; impact figures now nullable — the contract-validation test caught that real runs were already writing nulls.
  • 7B — 18 backend tests: state-machine transitions, degraded payload validated against contract/pipeline_schema.json with jsonschema, diff-window extraction against a real temp git repo, runbook similarity ranking, all LLM failure modes. Fully offline/deterministic.
  • 7C — dashboard smoke tests: incident feed renders, DiffViewer mounts, PostmortemEditor loads content (Jest + RTL).
  • 7D — CI: GitHub Actions running black/flake8/pytest and ESLint/jest on every push; badge added to README. core/ and sandbox/ are now black-formatted (most of the diff churn).

Verification

  • pytest core/tests -q — 18 passed
  • npm test — 3 passed; npm run lint — clean
  • black --check + flake8 — clean
  • Live forced failure: core booted with a bad OPENROUTER_API_KEY, real incident triggered → finished cleanly as status=degraded, suspects [], runbooks still matched, 3 raw commits attached

🤖 Generated with Claude Code

Lushenwar and others added 3 commits July 8, 2026 00:55
- LLMUnavailable raised on the three failure modes (timeout/network,
  malformed or non-schema JSON, empty/refused response) in ranking and
  postmortem generation
- Orchestrator degrades honestly: 'degraded' terminal status, empty
  suspect list, raw diffs + runbook matches preserved, contract-valid
  payload; Slack card and dashboard badge surface the flag
- contract: add 'degraded' status + degraded/raw_commits fields; allow
  null impact figures (real writes were already null — caught by test)
- 18 backend tests (state transitions, degraded contract validation,
  diff-window extraction on a temp repo, runbook ranking, LLM failure
  modes); 3 dashboard smoke tests (Jest + RTL)
- GitHub Actions CI: black/flake8/pytest + ESLint/jest; badge in README
- black-formatted core/ and sandbox/; flake8 clean at 110 cols

Verified live: server booted with a bad API key, real triggered incident
finished cleanly as status=degraded with no fabricated diagnosis.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Lushenwar
Lushenwar merged commit 4f312d8 into main Jul 8, 2026
4 checks passed
@Lushenwar
Lushenwar deleted the phase7-resilience branch July 8, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant