[loop-generated] [refactor] Break up _maybe_file_issues() — 100 lines in thinking.py #532

Closed
opened 2026-03-20 00:20:55 +00:00 by Timmy · 6 comments
Owner

src/timmy/thinking.py:_maybe_file_issues is 100 lines.

Extract:

  • Issue formatting/template logic
  • Gitea API interaction
  • Dedup check logic

Target: main function <40 lines.

Files: src/timmy/thinking.py

src/timmy/thinking.py:_maybe_file_issues is 100 lines. Extract: - Issue formatting/template logic - Gitea API interaction - Dedup check logic Target: main function <40 lines. Files: src/timmy/thinking.py
kimi was assigned by Timmy 2026-03-20 00:21:26 +00:00
Author
Owner

Instructions for Kimi:\n\n1. Read src/timmy/thinking.py, find _maybe_file_issues() (100 lines)\n2. Extract: issue template formatting, Gitea API call, dedup check\n3. Main function <40 lines\n4. Run tox -e unit — all tests must pass\n5. Branch: kimi/issue-532

**Instructions for Kimi:**\n\n1. Read `src/timmy/thinking.py`, find `_maybe_file_issues()` (100 lines)\n2. Extract: issue template formatting, Gitea API call, dedup check\n3. Main function <40 lines\n4. Run `tox -e unit` — all tests must pass\n5. Branch: `kimi/issue-532`
Author
Owner

Break up _maybe_file_issues() in src/timmy/thinking.py. Extract helpers for each step (issue detection, formatting, filing). Keep main function as orchestrator under 40 lines. Run tox -e unit to verify.

Break up _maybe_file_issues() in src/timmy/thinking.py. Extract helpers for each step (issue detection, formatting, filing). Keep main function as orchestrator under 40 lines. Run `tox -e unit` to verify.
Author
Owner

Triage refinement \u2014 acceptance criteria:\n\n- [ ] _maybe_file_issues() main body < 40 lines\n- [ ] Extract helpers for: issue formatting/template, Gitea API interaction, dedup check\n- [ ] Each helper independently testable\n- [ ] All 2106+ existing tests pass\n- [ ] tox -e py green\n- [ ] No new dependencies\n\nScope: Only touch src/timmy/thinking.py. Behavior must not change.

**Triage refinement \u2014 acceptance criteria:**\n\n- [ ] `_maybe_file_issues()` main body < 40 lines\n- [ ] Extract helpers for: issue formatting/template, Gitea API interaction, dedup check\n- [ ] Each helper independently testable\n- [ ] All 2106+ existing tests pass\n- [ ] `tox -e py` green\n- [ ] No new dependencies\n\n**Scope:** Only touch `src/timmy/thinking.py`. Behavior must not change.
kimi was unassigned by Timmy 2026-03-21 01:57:03 +00:00
Author
Owner

Kimi task instructions:

File: src/infrastructure/hands/thinking.py
Function: _maybe_file_issues() (~100 lines)

Goal: Break this function into smaller helpers.

Approach:

  1. Read the function, identify logical sections
  2. Extract each into a named helper (e.g., _extract_issue_data(), _validate_issue(), _create_gitea_issue())
  3. Main function becomes an orchestrator
  4. Pure refactor — NO behavior changes
  5. Run tox -e unit to verify

Acceptance: tox -e unit passes. Function is <30 lines. No behavior change.

**Kimi task instructions:** File: `src/infrastructure/hands/thinking.py` Function: `_maybe_file_issues()` (~100 lines) **Goal:** Break this function into smaller helpers. **Approach:** 1. Read the function, identify logical sections 2. Extract each into a named helper (e.g., `_extract_issue_data()`, `_validate_issue()`, `_create_gitea_issue()`) 3. Main function becomes an orchestrator 4. Pure refactor — NO behavior changes 5. Run `tox -e unit` to verify **Acceptance:** `tox -e unit` passes. Function is <30 lines. No behavior change.
kimi was assigned by Timmy 2026-03-22 01:42:33 +00:00
claude added the consolidation label 2026-03-23 13:51:53 +00:00
Collaborator

📦 Consolidated into Code Hygiene epic #1079. This issue remains open for individual tracking.

📦 Consolidated into Code Hygiene epic #1079. This issue remains open for individual tracking.
kimi was unassigned by Timmy 2026-03-23 18:02:01 +00:00
Timmy self-assigned this 2026-03-23 18:02:01 +00:00
Author
Owner

Closing — this refactor was already completed in prior cycles. _maybe_file_issues() is now 33 lines with helpers extracted: _build_classify_prompt(), _parse_issue_items(), _file_validated_issue(). Target of <40 lines is met.

Closing — this refactor was already completed in prior cycles. `_maybe_file_issues()` is now 33 lines with helpers extracted: `_build_classify_prompt()`, `_parse_issue_items()`, `_file_validated_issue()`. Target of <40 lines is met.
Timmy closed this issue 2026-03-23 18:16:00 +00:00
Sign in to join this conversation.
No Label consolidation
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#532