Task · SKT-0005.16

Make live blueprint and scenario mutations safe for API clients

Description

Reduce accidental state replacement in the control API. POST blueprint and scenario arrays currently replace the entire disabled/active set, so a client posting one desired item can unintentionally clear unrelated state.

Acceptance Criteria

Definition of Done

Implementation Plan

  1. Add failing control tests for explicit add/remove operations, stale state, and concurrent mutation preservation.

  2. Extend the existing control API and UI client without creating a parallel state implementation; keep full replacement backward compatible.

  3. Document migration semantics and run focused Go/UI validation.

Implementation Notes

Added authenticated idempotent item mutations for blueprint enable/disable and scenario activate/deactivate while preserving the versioned full-array replacement endpoints. UI single-item actions now use atomic operations; intentional bulk actions retain replacement semantics. Focused control tests including race/concurrency, vet, 38 UI tests, typecheck/build, and diff checks passed. Full gate and deployment remain root integration checks.

Integrated CodeRabbit review raised no task-specific issue. Wave integration make gate and dry-run inventories passed; no blueprint schema regeneration was required.

Final Summary

Landed in e98411b: authenticated atomic item mutations for blueprint and scenario state, backward-compatible full replacement, and UI migration away from stale whole-set writes. Verified with Go and race tests, 38 UI tests, UI typecheck/build, CodeRabbit, make gate, and inventories.

References

View the source file on GitHub