feat(acms): implement budget enforcement for max_file_size and max_total_size constraints #11104

Closed
HAL9000 wants to merge 3 commits from bugfix/9673-acms-budget-enforcement into master

3 Commits

Author SHA1 Message Date
CleverAgents Bot 53146045fe ci: stop master workflow on PR updates
CI / lint (pull_request) Successful in 36s
CI / push-validation (pull_request) Successful in 20s
CI / build (pull_request) Successful in 29s
CI / typecheck (pull_request) Successful in 1m5s
CI / security (pull_request) Successful in 1m4s
CI / helm (pull_request) Successful in 42s
CI / quality (pull_request) Successful in 1m12s
CI / integration_tests (pull_request) Failing after 3m20s
CI / e2e_tests (pull_request) Successful in 3m40s
CI / unit_tests (pull_request) Failing after 6m24s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
Remove the stale pull_request trigger from master.yml so PR branch commits do not launch the master workflow.

Maintenance patch for PR #11104.
2026-06-10 20:18:05 -04:00
HAL9000 3a29ad83d3 fix(acms): remove double-deletion in _enforce_hot_budget and fix tests
CI / push-validation (pull_request) Successful in 30s
CI / build (pull_request) Successful in 40s
CI / helm (pull_request) Successful in 42s
CI / lint (pull_request) Successful in 53s
CI / quality (pull_request) Successful in 59s
CI / typecheck (pull_request) Successful in 1m6s
CI / security (pull_request) Successful in 1m16s
CI / integration_tests (pull_request) Failing after 3m49s
CI / e2e_tests (pull_request) Successful in 5m6s
CI / unit_tests (pull_request) Failing after 6m42s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 4s
CI / benchmark-publish (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
Fixes the critical KeyError introduced in the original commit: demote()
already pops the fragment from self._hot internally, so the subsequent
del self._hot[oldest_id] always raises KeyError. Remove the del.

Also updates all tests that assumed the old deletion behaviour:

- features/context_tier_runtime.feature: three scenarios updated to
  expect warm-tier demotion (not deletion) and TIER_DEMOTED events
  (not TIER_EVICTED) when budget enforcement fires
- robot/tdd_budget_eviction_deletes_not_demotes.robot: remove
  tdd_expected_fail tags — bug #1152 is now fixed; both TDD tests
  should pass normally
- robot/helper_context_tier_runtime.py: budget-evict command now
  asserts old-01 is demoted to warm, not absent from all tiers
- CONTRIBUTORS.md: fix residual git merge-conflict marker on line 29
  (<<* -> *)
- CHANGELOG.md: restore all entries stripped by prior commit; add
  correct entry for this fix referencing #1152 and #4275

ISSUES CLOSED: #1152, #4275
2026-06-10 17:37:15 -04:00
HAL9000 7a17aa28f3 feat(acms): implement budget enforcement fixes for hot-tier fragments
CI / push-validation (pull_request) Successful in 35s
CI / helm (pull_request) Successful in 44s
CI / build (pull_request) Successful in 1m4s
CI / quality (pull_request) Successful in 1m16s
CI / lint (pull_request) Successful in 1m18s
CI / benchmark-publish (pull_request) Has been skipped
CI / typecheck (pull_request) Successful in 1m35s
CI / security (pull_request) Successful in 1m38s
CI / benchmark-regression (pull_request) Failing after 1m8s
CI / integration_tests (pull_request) Failing after 4m4s
CI / e2e_tests (pull_request) Successful in 4m18s
CI / unit_tests (pull_request) Failing after 4m41s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
Fixed bug #1152 where _enforce_hot_budget() permanently deleted hot-tier
fragments instead of demoting them to warm tier per ACMS spec. Updated
evict_lru() in context_tiers.py to also demote hot-tier fragments to warm.
This ensures the downward lifecycle flow: hot→warm→cold preserves all context data.

Removed @tdd_expected_fail tags from tdd_budget_eviction_deletes_not_demotes.feature
which now serves as a permanent regression guard for the fix.

Key changes:
- tier_runtime.py/_enforce_hot_budget(): call demote() before deleting from hot tier
- context_tiers.py/evict_lru(): demote hot-tier evictions to warm instead of deleting
- BDD test removed @tdd_expected_fail tags (Bug #1152 is now fixed)

ISSUES CLOSED: #9673, #1152, #4275
2026-05-09 14:05:55 +00:00