Skip to the content.

Task 57 — Управление жизненным циклом

Phase: 6 Initiative: 36 Status: done Owner: — Slug: lifecycle-management

Goal

CLI и API: inventory, start, stop, drain, update, canary, health check, rollback, decommissioning агентов и skill packages.

Acceptance criteria

Scope / Likely files

src/agent/CLI/Commands/AgentLifecycleCommand.cs, src/agent/Hercules.WebApi/Controllers/LifecycleController.cs

Dependencies

Risks / Rollback

Случайный downtime; canary + auto-rollback при health-degradation.

Implementation notes

Date: 2026-08-14

src/agent/Lifecycle/Models.cs — DTOs: AgentInventoryEntry, SkillPackageInventoryEntry, AgentResourceUsage, LifecycleActionResult, HealthCheckResult, CanaryResult, RollbackResult, LifecycleAction enum.

src/agent/Lifecycle/ILifecycleService.cs — Interface with 10 methods: agent inventory, start/stop/drain/decommission, health check, package update/canary/promote/rollback.

src/agent/Lifecycle/LifecycleService.cs — In-process lifecycle management:

src/agent/Hercules.WebApi/Controllers/LifecycleController.cs — 11 endpoints:

src/agent/CLI/ConsoleUI.cs — Added /lifecycle command with 11 sub-commands:

src/agent/Program.cs + src/agent/Hercules.WebApi/Program.cs — Registered ILifecycleService in DI.

Tests: tests/Hercules.Agent.Tests/Lifecycle/LifecycleServiceTests.cs — 17 unit tests (all pass).

Validation: