refactor(session-cache): rename staleness_minutes to staleness_seconds #94
Reference in New Issue
Block a user
Delete Branch "feat/staleness-seconds"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rename
session_cache.staleness_minutes→session_cache.staleness_secondsChange the unit of
session_cache.stalenessfrom minutes to seconds so it can express finer-grained (sub-minute) staleness windows. This is a straight rename, not an additive/compat knob — no deprecated alias, matching the project's convention of updating every consumer in the same change (see how the old quota flat-keys shape was removed).New bounds
Validator reasoning (preserved, adapted to seconds)
session_cache.get()miss every turn whileput()still writes and the classifier-failure cascade'sstale_readignores staleness and replays regardless. The reasoning is unit-independent — a 5-second floor keeps that protection.Files changed (13, all in one commit)
src/config.py—STALENESS_MINUTES_MIN/MAX→STALENESS_SECONDS_MIN/MAX(5/7200);staleness_minutes: int = 20→staleness_seconds: int = 1200; validator and error message updatedsrc/dispatcher.py— dropped the* 60conversion (field is native seconds now)src/admin.py—_INT_KNOBSkey/path/constants,_CONFIG_ALLOWLIST,_CONFIG_GET_ORDER,_runtime_state, error message templateadmin/frontend/controls.html— note keys, tooltip text,NUMBER_BOUNDSmin/max/stepconfig/config.yaml—staleness_seconds: 1200tests/test_admin_runtime.py,tests/test_admin_frontend.py,tests/test_admin_knob_coverage.py,tests/test_admin_config.py— every old key/bound referencedocs/admin-portal.md,docs/evaluation.md,README.md— prose and valuestests/test_chat_completions.py— stale TTL commentNot touched
config/config.local.yaml— gitignored, holds live production overrides, will be migrated separately after mergeplans/session-classification-cache-ttl.md,plans/classifier-input-scope-check.md— historical planning docs left as recordVerification
Full test suite passes: 2139 passed (94s).