[claude] Split thinking.py into focused sub-modules (#1279) #1306

Merged
claude merged 1 commits from claude/issue-1279 into main 2026-03-24 01:57:05 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
a23850b7fd refactor: split thinking.py (1383 lines) into focused sub-modules
Some checks failed
Tests / lint (pull_request) Failing after 37s
Tests / test (pull_request) Has been skipped
Convert src/timmy/thinking.py into a package with 8 modules, each under
500 lines. Public API (ThinkingEngine, thinking_engine, search_thoughts,
Thought, SEED_TYPES, _THINKING_PROMPT) is unchanged via __init__.py re-exports.

Modules:
- _db.py         — Thought dataclass and SQLite access layer (50 lines)
- seeds.py       — Seed constants and _THINKING_PROMPT template (129 lines)
- _distillation.py — _DistillationMixin: fact extraction + memory checks (215 lines)
- _issue_filing.py — _IssueFilingMixin: Gitea issue creation from thoughts (170 lines)
- _snapshot.py   — _SnapshotMixin: system snapshot + memory context (173 lines)
- _seeds_mixin.py  — _SeedsMixin: seed-type selection and context gathering (191 lines)
- engine.py      — ThinkingEngine class (inherits all mixins) (430 lines)
- __init__.py    — Public facade with search_thoughts and singleton (142 lines)

Update test patches to reference correct sub-module paths
(timmy.thinking.engine.settings, timmy.thinking._snapshot.HOT_MEMORY_PATH, etc.)

Fixes #1279

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 21:56:10 -04:00