The new step `the hot tier size_bytes should be {n:d}` in
features/steps/acms_hot_storage_tier_steps.py shared the matched
pattern of the existing
`the hot tier size_bytes should be {expected:d}` step in
features/steps/acms_context_analysis_engine_steps.py — Behave's
step registry strips parameter names when computing the pattern,
so both compile to the same regex. Every scenario hitting the
step raised AmbiguousStep at run-time, which Behave reports as
"errored" (not "failed"); that produced the 6 errored scenarios
on `features/acms_hot_storage_tier.feature` (lines 9, 96, 101,
149, 202, 210) seen in CI unit_tests.
Rename the new step and its `at most` companion to
`the hot storage tier size_bytes should be ...` (mirroring the
HotStorageTier class name) so the patterns no longer collide
with the analysis-engine TierDistribution step. Update the 8
feature-file references in `acms_hot_storage_tier.feature` to
match. The other-metric steps (entry_count, hit_count, miss_count,
max_entries, max_bytes) keep their `the hot tier` prefix because
they have no analogous collision — the analysis-engine file uses
`count` (not `entry_count`), so they are already unambiguous.
ISSUES CLOSED: #9972
Update the then-step for removing entries from the hot storage tier to
assert on context.last_remove_result (set by the when-step) instead of
calling remove() a second time. The double-removal caused the assertion
to always fail because the entry was already gone. Also update the
feature file scenarios to use the when-step before the then-step.
ISSUES CLOSED: #9972
Apply ruff format to hot.py and acms_hot_storage_tier_steps.py to fix
CI lint job failure (format --check was rejecting multi-line expressions
that ruff prefers on a single line).
ISSUES CLOSED: #9972
- Created src/cleveragents/acms/storage/__init__.py - new storage subpackage
- Created src/cleveragents/acms/storage/hot.py - HotStorageTier class backed by
OrderedDict for O(1) LRU operations with configurable max_entries and max_bytes
capacity parameters, optional on_evict callback for warm-tier demotion,
hit_count/miss_count/entry_count/size_bytes metrics, and threading.RLock safety
- Updated src/cleveragents/acms/__init__.py to export HotStorageTier
- Created features/acms_hot_storage_tier.feature with 36 BDD scenarios covering
construction, put/get, LRU eviction, eviction callbacks, remove, clear, and
thread safety
- Created features/steps/acms_hot_storage_tier_steps.py with step definitions
- All quality gates pass: lint, typecheck, unit_tests (36/36 scenarios)
ISSUES CLOSED: #9972