fix(acms): fix ruff format violations and deduplicate CHANGELOG entry
CI / helm (pull_request) Successful in 37s
CI / build (pull_request) Successful in 55s
CI / push-validation (pull_request) Successful in 39s
CI / lint (pull_request) Successful in 1m16s
CI / quality (pull_request) Successful in 1m17s
CI / security (pull_request) Successful in 1m31s
CI / typecheck (pull_request) Successful in 1m46s
CI / e2e_tests (pull_request) Successful in 4m30s
CI / integration_tests (pull_request) Successful in 5m39s
CI / unit_tests (pull_request) Failing after 6m24s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 9m54s
CI / status-check (pull_request) Failing after 4s

- Apply ruff format to features/steps/acms_budget_enforcement_steps.py
- Apply ruff format to robot/helper_acms_budget_enforcement.py
- Remove 3 duplicate ACMS Budget Enforcement entries from CHANGELOG.md

Resolves CI lint failure (ruff format --check) on PR #9673
This commit is contained in:
2026-04-24 19:39:27 +00:00
parent 73ac26e86f
commit 119b1a1f5d
3 changed files with 5 additions and 36 deletions
-21
View File
@@ -23,27 +23,6 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
defensive copy returns, `__post_init__` cross-validation, and byte-accurate UTF-8
size measurement.
- **ACMS Budget Enforcement** (#9583): Introduced `BudgetEnforcer`, `BudgetViolation`,
and `ContextFile` components enforcing per-file (`max_file_size`) and cumulative
(`max_total_size`) size constraints on assembled context. Files exceeding limits are
excluded with clear, actionable violation messages. Includes argument validation,
defensive copy returns, `__post_init__` cross-validation, and byte-accurate UTF-8
size measurement.
- **ACMS Budget Enforcement** (#9583): Introduced `BudgetEnforcer`, `BudgetViolation`,
and `ContextFile` components enforcing per-file (`max_file_size`) and cumulative
(`max_total_size`) size constraints on assembled context. Files exceeding limits are
excluded with clear, actionable violation messages. Includes argument validation,
defensive copy returns, `__post_init__` cross-validation, and byte-accurate UTF-8
size measurement.
- **ACMS Budget Enforcement** (#9583): Introduced `BudgetEnforcer`, `BudgetViolation`,
and `ContextFile` components enforcing per-file (`max_file_size`) and cumulative
(`max_total_size`) size constraints on assembled context. Files exceeding limits are
excluded with clear, actionable violation messages. Includes argument validation,
defensive copy returns, `__post_init__` cross-validation, and byte-accurate UTF-8
size measurement.
- Wired `StrategyActor` into the real plan execution path: `_get_plan_executor`
in `plan.py` now resolves the strategy actor via `resolve_strategy_actor()`
(reading the `actor.default.strategy` config key) instead of always
@@ -128,9 +128,7 @@ def step_total_size_should_be(context, size: int) -> None:
def step_total_size_should_not_exceed(context, size: int) -> None:
"""Verify the total context size does not exceed limit."""
actual_size = context.budget_enforcer.get_total_size()
assert (
actual_size <= size
), f"Total size {actual_size} exceeds limit {size}"
assert actual_size <= size, f"Total size {actual_size} exceeds limit {size}"
@then("a budget violation warning should be generated for the file")
@@ -140,18 +138,14 @@ def step_budget_violation_warning_generated(context) -> None:
assert len(violations) > 0, "No budget violations were recorded"
@then(
"a budget violation warning should be generated for exceeding max_total_size"
)
@then("a budget violation warning should be generated for exceeding max_total_size")
def step_budget_violation_for_total_size(context) -> None:
"""Verify that a budget violation for max_total_size was generated."""
violations = context.budget_enforcer.get_violations()
total_size_violations = [
v for v in violations if v.violation_type == "max_total_size"
]
assert (
len(total_size_violations) > 0
), "No max_total_size violations were recorded"
assert len(total_size_violations) > 0, "No max_total_size violations were recorded"
@then("a budget violation error should be generated")
@@ -239,9 +233,7 @@ def step_violation_includes_limit(context, limit: int) -> None:
violations = context.budget_enforcer.get_violations()
assert len(violations) > 0, "No violations found"
violation = violations[-1]
assert violation.limit == limit, (
f"Expected limit {limit}, got {violation.limit}"
)
assert violation.limit == limit, f"Expected limit {limit}, got {violation.limit}"
@then("both files should be included in the assembled context")
+1 -3
View File
@@ -224,9 +224,7 @@ def _test_assembled_context() -> None:
enforcer.add_file("b.txt", "world")
context = enforcer.get_assembled_context()
assert context == "hello\nworld", (
f"Expected 'hello\\nworld', got {context!r}"
)
assert context == "hello\nworld", f"Expected 'hello\\nworld', got {context!r}"
# Empty enforcer returns empty string
enforcer2 = BudgetEnforcer(max_file_size=1000, max_total_size=5000)