Commit Graph

5 Commits

Author SHA1 Message Date
HAL9000 c7a20eccd0 fix(cli): preserve no-flag list_invariants "all scopes" semantics
CI / load-versions (pull_request) Successful in 31s
CI / push-validation (pull_request) Successful in 37s
CI / lint (pull_request) Successful in 44s
CI / typecheck (pull_request) Successful in 1m10s
CI / security (pull_request) Successful in 1m24s
CI / build (pull_request) Successful in 36s
CI / quality (pull_request) Successful in 1m22s
CI / helm (pull_request) Successful in 2m7s
CI / unit_tests (pull_request) Successful in 7m55s
CI / docker (pull_request) Successful in 2m54s
CI / integration_tests (pull_request) Successful in 12m23s
CI / coverage (pull_request) Successful in 14m4s
CI / status-check (pull_request) Successful in 3s
The previous refactor routed list_invariants through _resolve_scope,
which silently changed the no-flags behavior: _resolve_scope returns
(GLOBAL, "system") when no flag is given (the `add` default), so
`agents invariant list` filtered to only global+system invariants
instead of returning every active invariant.

InvariantService.list_invariants documents scope=None / source_name=None
as "all scopes" / "all sources"; the listing CLI must preserve that
contract. Inline the mutual-exclusion check in list_invariants and
restore the if/elif chain that leaves scope/source_name=None when no
flag is set, while keeping `agents invariant add` defaulting to global.

Tests added:
- "List invariants with no flags passes no scope filter" verifies the
  service is called with scope=None, source_name=None.
- "List invariants with conflicting scope flags rejected" covers the
  new BadParameter raise path.

ISSUES CLOSED: #11049
2026-06-18 02:28:23 -04:00
cleveragents-auto 26662836aa test(cli): preserve invariant scope coverage after rebase 2026-06-18 02:28:23 -04:00
HAL9000 ca2a050d51 fix(cli): fix invariant add scope handling (#11049)
Fix `_resolve_scope()` to properly check the `is_global` parameter
instead of silently ignoring it. Replace the standalone if/elif chain
in `list_invariants` with a call to `_resolve_scope()` so that scope
flag conflicts are consistently rejected on both `add` and `list`
commands via mutual-exclusion validation.

- Explicit global check in _resolve_scope() for correctness
- list_invariants uses shared _resolve_scope for consistent validation
- BDD coverage: add scenario for list with conflicting scope flags
- Robot coverage: add list-scope-conflict smoke test
- CHANGELOG.md and CONTRIBUTORS.md updated

ISSUES CLOSED: #11049
2026-06-18 02:28:23 -04:00
HAL9000 d547029200 fix(cli): fix invariant add scope handling (#6331)
Ensure invariant add enforces explicit scope selection and covers missing flag error in CLI tests.

ISSUES CLOSED: #6331
2026-06-14 15:06:44 -04:00
freemo 41ca082022 Tests: Improved coverage to get us back above 97%
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Failing after 13s
CI / quality (pull_request) Successful in 17s
CI / build (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 34s
CI / security (pull_request) Successful in 33s
CI / coverage (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
CI / integration_tests (pull_request) Successful in 2m31s
CI / unit_tests (pull_request) Successful in 6m43s
CI / docker (pull_request) Has been skipped
2026-02-22 15:29:41 -05:00