Repository navigation
fix(memory): read turn_lessons' row-token helper through text_scoring - #15737
unstablebrainiac wants to merge 1 commit into
Conversation
kirodotdev#15688 replaced lessons.py's by-name imports from text_scoring with reads through the owner module. kirodotdev#15517, which merged after it, added turn_lessons with one bare _row_stem_tokens_for_scan call, so main raises NameError: name '_row_stem_tokens_for_scan' is not defined on every turn_lessons call (flake8 F821). Read it through _text_scoring like the other callers in the file.
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 62306ce Description read[DESCRIPTION-READ] 40954c6bc6a0d9a41086167b229e142acc95cd30547835b63017b3350078eb9c 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 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (1 item) — 1 justifiedIntent: FIX — make
Verified on base: [FIRST-PRINCIPLES-REVIEWED] 62306ce Description read[DESCRIPTION-READ] 734b692028d4f07dd156a533af64c642b4672f6335f21e8ebce37215b1aa0270 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
|
CI on 62306ce fails the tests main fails, minus the ones this PR fixes, plus what looks like one Windows flake.
|
|
Thanks @unstablebrainiac — this exact lessons.py hunk landed on main via #15744 (d8fa6a5), which also carried the fold-catalogue fix, so this PR is now a no-op. Closing as superseded; credit for the F821 fix is yours. |
Problem / Motivation
Goal: Matching lessons to follow-up messages works again on main:
turn_lessonsstops raisingNameError.On main, every call to
turn_lessonsraisesNameError: name '_row_stem_tokens_for_scan' is not definedatsrc/kiro_crew/vector_memory_runtime/lessons.py:1206, and flake8 reports F821 on that line.test/test_lesson_turn_injection.pyfails on main for the same reason.Why it matters
A session with
memory.inject_lessons_per_turnon hits the error on its follow-up messages, so the feature #15517 added cannot run. Any branch built on current main also fails flake8 on this line and the turn-lesson tests, whatever it changes.Not a goal
turn_lessonsmatches or ranks lessons.text_scoringnames through the module.What changed (motivation → approach → change)
#15688 replaced
lessons.py's by-name imports fromtext_scoringwith reads through the owner module (_text_scoring.<name>). #15517 went green on a base from before #15688 and merged after it. Its newturn_lessonskept one bare_row_stem_tokens_for_scan(...)call, which no longer resolves. The two edits did not touch the same lines, so the merge was clean and nothing re-ran the checks.turn_lessonsnow reads_text_scoring._row_stem_tokens_for_scan, as the file's other two callers do. The change is that one line insrc/kiro_crew/vector_memory_runtime/lessons.py.Backwards compatibility
Compatible: it restores the behavior #15517 shipped. No API, config or stored data changes.
Tests
No new test.
test/test_lesson_turn_injection.pyalready callsturn_lessons: on main it fails with thisNameError, and with this change it passes. Together with the composition-contract, keyword-scoring and vector-memory suites: 392 passed, 14 skipped. flake8 oversrc/kiro_crew test, isort and mypy oversrc/kiro_crew/are clean.Manual verification
N/A — the existing unit tests call the failing line directly.
Related Issues
no linked issue: this fixes a regression on main from the merge order of #15688 and #15517.
Pattern harvest
Not generalizable: flake8 F821 already flags this name. It reached main because #15517's checks ran on a base from before #15688 and the clean textual merge started no re-run. That is a merge-ordering gap, not a missing lint or review rule.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)