Added CHANGELOG.md entry under [Unreleased] > Fixed for issue #7504
documenting the atomic load_from_metadata fix. Resolved merge conflict
in pyproject.toml by combining both B010 and I001 ruff ignore rules
for Behave step files. Rebased on latest master to resolve mergeable
status.
ISSUES CLOSED: #7504
- Replace no-op assertions in step_assert_in_sync and step_assert_both_in_sync with meaningful state validation checks
- Set context.error in addition to context.load_error so generic validation error steps work correctly
- Add missing step definition for "I have metadata with valid guardrails"
- Store plan_id in context during load steps for use in assertion steps
All atomic load BDD tests now pass with proper validation of guardrail and audit trail state.
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