[loop-generated] [hardening] perception_cache confidence threshold is hardcoded — should be configurable #1259

Closed
opened 2026-03-24 01:30:05 +00:00 by Timmy · 2 comments
Owner

Problem

src/timmy/sovereignty/perception_cache.py:46 has a hardcoded confidence threshold of 0.85:

if best_match_confidence > 0.85:  # TODO: Make this configurable per template

Fix

Move threshold to config.py (pydantic-settings) so it can be tuned per environment. Default 0.85 is fine.

Scope

Files: src/timmy/sovereignty/perception_cache.py, src/timmy/config.py

[loop-generated] [hardening]

## Problem `src/timmy/sovereignty/perception_cache.py:46` has a hardcoded confidence threshold of 0.85: ```python if best_match_confidence > 0.85: # TODO: Make this configurable per template ``` ## Fix Move threshold to `config.py` (pydantic-settings) so it can be tuned per environment. Default 0.85 is fine. ## Scope Files: `src/timmy/sovereignty/perception_cache.py`, `src/timmy/config.py` [loop-generated] [hardening]
kimi was assigned by Timmy 2026-03-24 01:30:35 +00:00
Author
Owner

Kimi: Move the hardcoded 0.85 threshold at line 46 of src/timmy/sovereignty/perception_cache.py to a new field perception_confidence_threshold: float = 0.85 in src/timmy/config.py Settings class. Import and use it. Run tox -e unit to verify.

Kimi: Move the hardcoded 0.85 threshold at line 46 of `src/timmy/sovereignty/perception_cache.py` to a new field `perception_confidence_threshold: float = 0.85` in `src/timmy/config.py` Settings class. Import and use it. Run `tox -e unit` to verify.
Collaborator

PR created: #1265

Summary of changes:

  • Added perception_confidence_threshold: float = 0.85 setting to src/config.py under new "Perception Cache" section
  • Updated src/timmy/sovereignty/perception_cache.py to import settings and use the configurable threshold
  • Removed the TODO comment since the threshold is now configurable per environment

Verification:

  • tox -e format: clean
  • tox -e unit: 435 tests passed
  • tox -e lint: clean
PR created: #1265 **Summary of changes:** - Added `perception_confidence_threshold: float = 0.85` setting to `src/config.py` under new "Perception Cache" section - Updated `src/timmy/sovereignty/perception_cache.py` to import settings and use the configurable threshold - Removed the TODO comment since the threshold is now configurable per environment **Verification:** - ✅ tox -e format: clean - ✅ tox -e unit: 435 tests passed - ✅ tox -e lint: clean
kimi closed this issue 2026-03-24 01:36:08 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1259