Commit Graph

5 Commits

Author SHA1 Message Date
HAL9000 5c5309f35d fix(ci): add missing effective set count step definition
CI / lint (push) Successful in 50s
CI / benchmark-regression (push) Failing after 46s
CI / typecheck (push) Successful in 1m21s
CI / security (push) Successful in 1m20s
CI / quality (push) Successful in 1m3s
CI / build (push) Successful in 35s
CI / helm (push) Successful in 32s
CI / integration_tests (push) Successful in 3m22s
CI / push-validation (push) Successful in 33s
CI / e2e_tests (push) Successful in 55s
CI / unit_tests (push) Successful in 5m49s
CI / docker (push) Successful in 2m1s
CI / coverage (push) Successful in 13m13s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (push) Failing after 24m24s
The Behave scenario at line 671 of consolidated_domain_models.feature
asserts 'the effective set should have {count:d} invariants' but no
step handler existed, causing UndefinedStepError and CI failure.

Adds the missing step: @then('the effective set should have {count:d} invariants')
to step_invariant_models_steps.py, mirroring the existing invariant-set count pattern.
2026-05-16 04:14:17 +00:00
HAL9000 761622f746 fix(invariant): pass action_name in list_invariants when scope is ACTION
Fixes list_invariants(effective=True) to forward action_name to
get_effective_invariants when scope is ACTION, ensuring action-scoped
invariants are included in effective invariant lists.

Also applies ruff formatting to the return statement in get_effective_invariants.

Addresses reviewer observation about list_invariants gap.

Refs: #9126
2026-05-16 04:14:17 +00:00
freemo bf52a9c648 fix(invariant): restore ACTION scope in merge_invariants and InvariantSet.merge precedence chain
The 4-tier invariant precedence chain (plan > action > project > global) was
broken at the domain layer — merge_invariants() and InvariantSet.merge() only
accepted 3 parameters (plan, project, global), silently dropping all action-
scoped invariants. Added action_invariants as a fourth parameter with proper
backward compatibility (default to empty list). Updated module docstrings,
InvariantScope docstring, and InvariantService.get_effective_invariants() to
reflect the correct precedence chain. Added comprehensive BDD test scenarios
covering four-tier merge precedence, action-before-project ordering, and effective
invariant computation with all four scopes.

ISSUES CLOSED: #9126
2026-05-16 04:14:17 +00:00
freemo f510c7b5a3 fix(invariant): add frozen=True to Invariant model config and redesign soft-delete pattern
CI / lint (pull_request) Successful in 28s
CI / typecheck (pull_request) Successful in 57s
CI / security (pull_request) Successful in 54s
CI / quality (pull_request) Successful in 33s
CI / build (pull_request) Successful in 34s
CI / helm (pull_request) Successful in 24s
CI / unit_tests (pull_request) Failing after 7m11s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 17m51s
CI / integration_tests (pull_request) Failing after 23m12s
CI / coverage (pull_request) Successful in 10m51s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m49s
Replace validate_assignment=True with frozen=True on Invariant,
InvariantViolation, InvariantEnforcementRecord, and InvariantSet models
to enforce the value-object immutability contract required by the spec.

Redesign InvariantService.remove_invariant() to use model_copy(update=
{'active': False}) instead of direct field mutation, since frozen models
raise ValidationError on assignment.

Fix invariant_reconciliation_actor_steps.py step that mutated
inv.non_overridable = True to construct the Invariant directly with
non_overridable=True at creation time.

Add BDD scenarios covering:
- Immutability contract: mutation raises error on all three models
- Hashability: frozen Pydantic v2 models are hashable
- Soft-delete copy-and-replace: removed invariant is a new object

All 266 scenarios pass. Lint and typecheck pass.

ISSUES CLOSED: #3116
2026-04-05 18:20:15 +00:00
freemo 2d4b330f75 feat(invariant): add invariant models and enforcement
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Failing after 14s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 30s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / security (pull_request) Successful in 33s
CI / integration_tests (pull_request) Successful in 2m49s
CI / unit_tests (pull_request) Successful in 5m25s
CI / docker (pull_request) Has been skipped
2026-02-22 09:23:35 +00:00