Skip to content

feat: implement runbook matching (Task 10)#5

Merged
itenev merged 4 commits into
mainfrom
feat/runbook-matching
Jun 7, 2026
Merged

feat: implement runbook matching (Task 10)#5
itenev merged 4 commits into
mainfrom
feat/runbook-matching

Conversation

@loki-hermes-agent

Copy link
Copy Markdown

Summary

Implements Task 10: Runbook matching for the agentic node ops system.

Changes

  • src/agentic_node_ops/runbooks.py: YAML parsing with dataclasses (Runbook, RunbookTrigger, RunbookAction, RunbookDiagnostic) and match_runbook() function to find matching runbooks by alert_type.
  • tests/test_runbooks.py: 6 comprehensive tests covering loading (valid, empty, directory) and matching (found, not found, multiple triggers) scenarios.
  • docs/hermes-implementation-plan.md: Updated to mark Task 10 as complete.
  • Note: The webhook receiver already sets runbook_hint=alert_type, which correctly maps incoming alerts to their corresponding runbook ID.

Testing

  • All 49 tests passing locally.
  • Runbook matching correctly identifies consensus_desync and other alert types.

loki-hermes-agent[bot] added 4 commits June 7, 2026 11:56
- Create src/agentic_node_ops/runbooks.py with YAML parsing and dataclasses (Runbook, RunbookTrigger, RunbookAction, RunbookDiagnostic)
- Add match_runbook() function to find matching runbook by alert_type
- Create tests/test_runbooks.py with 6 tests covering loading and matching scenarios
- Update docs/hermes-implementation-plan.md to mark Task 10 complete
- Note: webhook receiver already sets runbook_hint=alert_type, correctly mapping to runbook ID
- Remove unused imports (RunbookAction, RunbookDiagnostic) from tests/test_runbooks.py
- Apply ruff formatting
- Update README.md project structure and status table to reflect Phase 1 & 2 completion (119 tests, 88% coverage, runbook matching, processor, database)
- Add requires_explicit_unlock and phase to RunbookAction
- Log warnings instead of silently ignoring failed runbook loads
- Enforce min_severity filtering in match_runbook
- Add test coverage for privileged actions and severity filtering
- Add 'description' field to RunbookDiagnostic to match consensus_desync.yaml
- Add test loading actual consensus_desync.yaml to catch schema mismatches in CI
- Correct README Phase 2 status to 'In progress' to reflect pending tasks
@itenev
itenev merged commit ce352d6 into main Jun 7, 2026
2 checks passed
@itenev
itenev deleted the feat/runbook-matching branch June 7, 2026 09:47
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