Files
cleveragents-core/features/tdd_context_tier_defaults_1443.feature
HAL9000 013b779e30 fix(v3.7.1): Align ContextTierService default budget values with TierBudget model (#1443)
The DEFAULT_MAX_TOKENS_HOT was 8000 (should be 16000),
DEFAULT_MAX_DECISIONS_WARM was 500 (should be 100), and
DEFAULT_MAX_DECISIONS_COLD was 5000 (should be 500). These values in context_tier_settings.py did not match the canonical defaults defined in TierBudget model (tiers.py) or Settings class defaults, causing incorrect budget enforcement when settings were None.

ISSUES CLOSED: #1443
2026-06-17 15:28:59 -04:00

47 lines
2.1 KiB
Gherkin

# TDD regression test for bug #1443 - context_tier_settings.py wrong defaults.
#
# Issue #1443 documented that DEFAULT constants in ``context_tier_settings.py``
# were hardcoded to wrong values (hot=8000, warm=500, cold=5000) instead of the
# spec-aligned values (hot=16000, warm=100, cold=500). This test verifies that
# ``budget_from_settings(None)`` and module-level default constants use correct
# spec-defined values.
#
# See: https://git.cleverthis.com/cleveragents/cleveragents-core/issues/1443
@tdd_issue @tdd_issue_1443
Feature: TDD Issue #1443 - Correct defaults in context_tier_settings.py
As a developer calling budget_from_settings with no configuration
I want the returned TierBudget to use spec-defined capacity limits
So that hot/warm/cold tier eviction behavior matches the specification
@tdd_issue @tdd_issue_1443
Scenario: budget_from_settings(None) hot value meets spec 16000
Given the budget helper has not been called yet
When I invoke budget_from_settings with None config
Then the budget hot capacity matches 16000
@tdd_issue @tdd_issue_1443
Scenario: budget_from_settings(None) warm value meets spec 100
Given the budget helper has not been called yet
When I invoke budget_from_settings with None config
Then the budget warm capacity matches 100
@tdd_issue @tdd_issue_1443
Scenario: budget_from_settings(None) cold value meets spec 500
Given the budget helper has not been called yet
When I invoke budget_from_settings with None config
Then the budget cold capacity matches 500
@tdd_issue @tdd_issue_1443
Scenario: Module-level DEFAULT_MAX constants match spec values
Given the module default constants exist
When I read DEFAULT_MAX_TOKENS_HOT, DEFAULT_MAX_DECISIONS_WARM and DEFAULT_MAX_DECISIONS_COLD
Then all three module constants must equal spec-aligned values
@tdd_issue @tdd_issue_1443
Scenario: budget_from_settings result differs from old wrong defaults entirely
Given the budget helper has not been called yet
When I invoke budget_from_settings with None config
Then every budget field must NOT be an old wrong default value