Commit Graph

1 Commits

Author SHA1 Message Date
HAL9000 ef532c5302 fix(autonomy-guardrail): make load_from_metadata atomic
Refactor load_from_metadata() to validate both AutonomyGuardrails and
GuardrailAuditTrail models before writing either to state. This ensures
atomicity: if any validation fails, no state is modified.

Previously, guardrails were written before audit trail validation,
leaving the system in an inconsistent state if the second validation
failed.

Changes:
- Validate both models in Phase 1 before any writes
- Write both models atomically in Phase 2 only after validation succeeds
- Add comprehensive BDD tests for atomic load behavior
- Update pyproject.toml to ignore import sorting in features/steps

ISSUES CLOSED: #7504
2026-04-23 09:08:11 +00:00