relearn: _FAMILY_BY_KEY.setdefault freezes distilled fix text for the daemon's process lifetime
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start in core/optimize/analyzers/relearn.py, around _FAMILY_BY_KEY (~257) and apply_distill_to_residual (~663); read how distilled results and _KNOWN_FAMILIES precedence are handled. Add a regression test that calls apply_distill_to_residual twice in one process with different output for the same family key. Done means the second scan serves the latest text while built-in family precedence remains intact.
Written by the indexing model from the issue text.
Description
Severity: Medium
Model: sonnet
Severity: Medium
Where: tokenjam (core/optimize/analyzers/relearn.py ~line 663, _FAMILY_BY_KEY at ~257)
Observed: apply_distill_to_residual stashes LLM-distilled family title/fix text into the module-global _FAMILY_BY_KEY via setdefault. First write per distilled: key wins for the life of the process; later scans in the same process can never refresh that text. The serve-time background job runs this analyzer repeatedly in a long-lived daemon, so a tj serve process up for days keeps serving whatever fix text it first generated per family until restart. One-shot CLI runs are unaffected (fresh process). Flagged by Greptile on PR #482 (against the pre-rename pothole.py); still present at the PR head.
Fix direction: Replace setdefault with an explicit overwrite when a fresh distill result exists (or key the stash by content hash / carry a timestamp and refresh when the residual cluster changes). Keep built-in _KNOWN_FAMILIES precedence intact.
Done when: Two successive scans in one process with different distill output for the same family key serve the latest text; regression test simulates two apply_distill_to_residual calls in-process.
- Dominant language
- Python
- Stars
- 122
- Forks
- 35
- Avg merge
- 4d 30m
- Merged PRs (30d)
- 4
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Metabuilder-Labs/tokenjam
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Metabuilder-Labs/tokenjam#786 ·
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Metabuilder-Labs/tokenjam#759 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Metabuilder-Labs/tokenjam#728 ·
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Metabuilder-Labs/tokenjam#591 ·
-
bug good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Metabuilder-Labs/tokenjam#559 ·
All issues in Metabuilder-Labs/tokenjam
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
autowarefoundation/autoware_carla_scenario#1485 ·
Maintainers usually reply within 1 day
-
needs-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Official-Space-AI/OpenPhysGraspGen#114 ·
Maintainers usually reply within 2 days
-
changelog investigate
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ramnes/notion-sdk-py#441 ·
-
copy_tree splits same-file errors into charactersPossibly taken @Gambit-Checkmate claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 14 days