feat: implement runbook matching (Task 10)#5
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andmatch_runbook()function to find matching runbooks byalert_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.runbook_hint=alert_type, which correctly maps incoming alerts to their corresponding runbook ID.Testing
consensus_desyncand other alert types.