Task 58 — Configuration и policy rollout
Phase: 6
Initiative: 41
Status: done
Owner: —
Slug: config-policy-rollout
Goal
Подписанные версионированные configuration и policy бандлы: staged rollout, local validation, expiry, rollback, last-known-good fallback.
Acceptance criteria
- Add
ConfigRolloutConfigsection toAppConfig.cs(bundles path, signing required, staging groups, validation timeout) - Create
src/agent/Config/Rollout/Models.cs—ConfigBundle,BundleStage,BundleStatus,RolloutStaterecords - Create
src/agent/Config/Rollout/ISignedBundleValidator.csinterface withValidateAsyncmethod - Create
src/agent/Config/Rollout/SignedBundleValidator.cs— HMAC-SHA256 signature verification (reusesPackageSigningServiceapproach) - Create
src/agent/Config/Rollout/IRolloutManager.csinterface withApplyBundleAsync,PromoteStageAsync,RollbackAsync,GetCurrentStatemethods - Create
src/agent/Config/Rollout/RolloutManager.cs— staged rollout logic with expiry checks, last-known-good fallback - Create
src/agent/Config/Rollout/LocalConfigValidator.cs— schema/constraint validation before applying a bundle - Integrate
RolloutManagerintoRuntimeConfigStore— new config bundles flow through rollout instead of directUpdate - Add
RolloutController— GET /api/rollout/state, POST /api/rollout/apply, POST /api/rollout/promote, POST /api/rollout/rollback - Register rollout services in DI (WebAPI Program.cs)
- Unit tests for
RolloutManager(stage promotion, expiry, rollback, last-known-good) dotnet build+dotnet testpass (existing tests unaffected)
Scope / Likely files
src/agent/Config/Rollout/
Dependencies
- блокирует / опирается на: task_015 — secrets-config
- блокирует / опирается на: task_055 — security-ops
Risks / Rollback
Bad config rollout; staged + dry-run + monitoring.
Implementation notes
- Created
src/agent/Config/Rollout/with 7 files: Models.cs, ISignedBundleValidator.cs, SignedBundleValidator.cs, IRolloutManager.cs, RolloutManager.cs, LocalConfigValidator.cs, RolloutExpiryChecker.cs ConfigRolloutConfig: bundles path, signature requirements, staging duration, expiry checker interval, LKG settingsSignedBundleValidator: HMAC-SHA256 signature validation, trusted signers by fingerprint, version compatibility checksRolloutManager: Pending→Staging→Production→Retired lifecycle; auto-promotes to Staging on apply; saves LKG before promoting to Production; applies config toRuntimeConfigStoreon promotion; full rollback to LKG with reason trackingLocalConfigValidator: JSON parse validation, payload size limits, config/policy type-specific checks, semver version warningsRolloutExpiryChecker: BackgroundService that retires expired bundles periodicallyRolloutController: 5 REST endpoints (state, apply, promote, rollback, bundle/{id})- DI registration in WebAPI
Program.cs - Tests: 15 new tests (RolloutManagerTests + LocalConfigValidatorTests) — all pass
-
Build: succeeded Tests: 1534 pass, 8 pre-existing failures (OtelService, NumericValidator, BudgetGuard)
Links
- Backlog: ../backlog.md
- Roadmap (EN): ../../ROADMAP-EN.md
- Roadmap (RU): ../../ROADMAP-RU.md