Repository navigation
fix(config): keep memory.history_idle_hours a positive finite number - #26518
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the field now goes through the same Notes
[DESIGN-REVIEWED] 7be5c37 Description read[DESCRIPTION-READ] e19ede285a86b0183567bb6e294bf16ba7bf55bb2136bf01c3f552245bcfd7c7 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One rider beyond the Goal, a new load-time floor at 0.5 hours. It is reversible, so it is a note. Notes
What this change shipsInventory (4 items) — 2 justifiedIntent: keep history consolidation running on a sane idle timer whatever is hand-written in
[FIRST-PRINCIPLES-REVIEWED] 7be5c37 Description read[DESCRIPTION-READ] 7977cb0812076933eb17fca85ec7fe5cfb6f2ea50823ad3ab562fff0793e273e That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: config loader now refuses a non-positive or non-finite memory.history_idle_hours and raises a value below 0.5 to the floor, with the reference table row and tests updated to match.
Problem / Motivation
Goal: History consolidation runs on a sane idle timer whatever number sits in
memory.history_idle_hours, and an olderconfig.jsonstill loads.memory.history_idle_hoursis the one memory number the loader reads with a baresection.get(...). The schema pass lets any JSON number through, so0,-5,InfinityandNaNreach the code that multiplies it by 3600.Why it matters
A zero or negative value makes history consolidate on every idle check. A non-finite value means it never consolidates, so daily history and lessons silently stop. Either way there is no warning.
Not a goal
What changed (motivation → approach → change)
The idle timer can be zero, negative or infinite because this field skips the
_safe_*read its siblings use. It now reads like them:"3"from an older file0, negative,Infinity,NaN,null, text,trueThe floor lives in
config/memory_sections.pyasHISTORY_IDLE_HOURS_MIN. Thedocs/configuration.mdrow says what the field accepts.Backwards compatibility
Compatible: no value makes the load fail. A usable value loads exactly as before, and
"3"still reads as 3.0.Reader: src/kiro_crew/cli_server.py:_run_task -- chat -- multiplies a positive finite float by 3600 (
test_digit_string_from_an_older_file_is_read_as_hours)Reader: src/kiro_crew/slack/gateway_runtime/service_boot.py:_init_services -- chat -- reads the same built
MemoryConfig(test_wrong_type_never_reaches_the_multiplier)Reader: src/kiro_crew/history_consolidation.py:reconfigure -- chat -- hot reload builds through the same loader (
test_unusable_number_takes_the_default_with_a_warning)Tests
test/test_config_history_idle_hours.pyrunsload()on raw JSON (0,-5,Infinity,NaN,1e400,0.1,null,"abc","3") and calls the builder directly without the schema pass. It checks the value, that it is a float, and that exactly the changed cases log.Proof: not provable -- other: prove.py reverts the shared constant with the builder, so the mutated run stops at collection. Reverting only the builder hunk by hand turns 19 of the 31 new cases red; all 31 pass with the fix.
Determinism: 3 repeated runs under xdist and a reversed class order, all green. The tests use temp files and
caplogonly.Related set: 40 test files touching the config loader, section builders, memory handlers and hot reload, 2259 passed. isort, flake8, black, mypy and the flake-pattern ratchet pass.
Manual verification
N/A — unit coverage sufficient: the change is one pure function on the load path, tested through
load()and directly.Related Issues
Fixes #26515
Sibling sweep
Swept: git grep -nE "=section.get("[a-z_]*(hours|secs|days|dim|count|max|min|size|limit|timeout|pct|threshold)")" -- src/kiro_crew/config/
Sibling: src/kiro_crew/config/section_builders.py:280 -- not affected -- embedding_dim is not a timer; a wrong width needs a store rebuild, not a load-time reset
Pattern harvest
Rule candidate: semgrep
Pattern: a numeric DTO field built with a bare
SectionReader.getinstead ofSectionReader.readwith a_safe_*coercerChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)