Task 61 — Local-first degradation
Phase: 6
Initiative: 42
Status: done
Owner: —
Slug: local-degradation
Goal
Когда cloud LLM, peers или сеть недоступны, агент следует configured safe fallback: deterministic rules, local skills, reduced-capability models, queued work, operator notification.
Acceptance criteria
- Define degradation modes enum (Offline, Degraded, Full)
- Create DegradationManager with health-check orchestration
- Implement DeterministicFallbackEngine for rule-based decisions
- Implement SafeFallbackStrategies: local skills, reduced-capability models, queued work
- Add operator notification system (webhook/email/telegram)
- Add degradation state observability (metrics, logs, status endpoint)
- Create degradation configuration schema (appsettings.json)
- Add unit tests for fallback logic
- Document degradation behavior in README
Scope / Likely files
src/agent/Degradation/
Dependencies
- блокирует / опирается на: task_004 — multi-provider-llm
- блокирует / опирается на: task_022 — semantic-routing
- блокирует / опирается на: task_060 — offline-resilience
Implementation notes
- Created
src/agent/Degradation/directory with:DegradationMode.cs- enum and record types for mode/health/statusDegradationConfig.cs- configuration for health checks, fallback, notifications, observabilityDegradationManager.cs- BackgroundService orchestrating health checks and mode transitionsDeterministicFallbackEngine.cs- rule-based fallback strategy selectionOperatorNotificationService.cs- webhook/Telegram/email notificationsDegradationObservability.cs- metrics, logging, status reports
- Updated
AppConfig.cswithDegradationConfigproperty - Updated
Program.cswith DI registration - Added unit tests in
tests/Hercules.Agent.Tests/Degradation/DegradationTests.cs(19 tests passing)
Validation
- Build:
dotnet build src/agent/Hercules.csproj- succeeded - Tests:
dotnet test --filter DegradationTests- 19 passed
Risks / Rollback
Неожиданная silent degradation; явный mode flag + observability.
Links
- Backlog: ../backlog.md
- Roadmap (EN): ../../ROADMAP-EN.md
- Roadmap (RU): ../../ROADMAP-RU.md