fix(invariant): restore ACTION scope in merge_invariants and InvariantSet.merge precedence chain #11143

Merged
HAL9000 merged 4 commits from bugfix/m3-fix-action-scope-invariant-merge into master 2026-05-16 04:14:35 +00:00

4 Commits

Author SHA1 Message Date
HAL9000 13aa0b06f4 fix(ci): add missing effective set count step definition
CI / lint (pull_request) Successful in 1m30s
CI / typecheck (pull_request) Successful in 1m42s
CI / security (pull_request) Successful in 1m40s
CI / helm (pull_request) Successful in 30s
CI / build (pull_request) Successful in 49s
CI / push-validation (pull_request) Successful in 27s
CI / quality (pull_request) Successful in 1m44s
CI / integration_tests (pull_request) Successful in 7m35s
CI / unit_tests (pull_request) Successful in 9m47s
CI / docker (pull_request) Successful in 1m38s
CI / coverage (pull_request) Successful in 12m35s
CI / status-check (pull_request) Successful in 3s
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 00:13:40 +00:00
HAL9000 fb55056ff7 fix(ci): update all merge_invariants callers to use 4-param signature
CI / helm (pull_request) Successful in 40s
CI / lint (pull_request) Successful in 1m16s
CI / build (pull_request) Successful in 1m16s
CI / quality (pull_request) Successful in 1m27s
CI / typecheck (pull_request) Successful in 1m43s
CI / security (pull_request) Successful in 1m54s
CI / push-validation (pull_request) Successful in 31s
CI / unit_tests (pull_request) Failing after 7m6s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 7m44s
CI / status-check (pull_request) Failing after 4s
The PR #11143 adds action_invariants as a 4th parameter to
merge_invariants() and InvariantSet.merge(), but two call sites
were not updated:

- benchmarks/invariant_merge_bench.py: 5 calls with 3 positional args
- robot/helper_m3_e2e_verification.py: 2 calls using keyword args

All call sites now pass action_invariants=[] for backward-compatible
empty-action behavior.
2026-05-15 05:29:16 +00:00
HAL9000 d63f1a5c23 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-15 05:29:16 +00:00
freemo 7c362f5b04 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-15 05:29:15 +00:00