fix: remove top-level discord_utils.py duplicate (#34) #62

Closed
cal wants to merge 13 commits from ai/paper-dynasty-discord-34 into main
Owner

Summary

  • Deleted discord_utils.py (top-level, 252 lines) — identical duplicate of helpers/discord_utils.py
  • Updated helpers/main.py line 36: from discord_utils import *from .discord_utils import * (relative import from helpers package)
  • Updated helpers.py line 36: from discord_utils import *from helpers.discord_utils import *

What was fixed

The top-level discord_utils.py was a dead duplicate of helpers/discord_utils.py. Both files were exactly 251 lines with identical content.

The import in helpers/main.py (loaded by helpers/__init__.py) pointed at the top-level file; this PR redirects it to the canonical helpers/discord_utils.py via a relative import, then deletes the duplicate.

helpers.py is effectively superseded by the helpers/ package (Python loads the package, not the .py file), but its import was updated for consistency. Note: helpers.py picked up one cosmetic linter reformatting at line 1685 (no behavioral change).

Files changed

  • discord_utils.py — deleted
  • helpers/main.py — relative import fix
  • helpers.py — absolute import fix

Tests

No test suite exists for this module. Verified by reading back modified files.

🤖 Generated with Claude Code

## Summary - Deleted `discord_utils.py` (top-level, 252 lines) — identical duplicate of `helpers/discord_utils.py` - Updated `helpers/main.py` line 36: `from discord_utils import *` → `from .discord_utils import *` (relative import from helpers package) - Updated `helpers.py` line 36: `from discord_utils import *` → `from helpers.discord_utils import *` ## What was fixed The top-level `discord_utils.py` was a dead duplicate of `helpers/discord_utils.py`. Both files were exactly 251 lines with identical content. The import in `helpers/main.py` (loaded by `helpers/__init__.py`) pointed at the top-level file; this PR redirects it to the canonical `helpers/discord_utils.py` via a relative import, then deletes the duplicate. `helpers.py` is effectively superseded by the `helpers/` package (Python loads the package, not the `.py` file), but its import was updated for consistency. Note: `helpers.py` picked up one cosmetic linter reformatting at line 1685 (no behavioral change). ## Files changed - `discord_utils.py` — deleted - `helpers/main.py` — relative import fix - `helpers.py` — absolute import fix ## Tests No test suite exists for this module. Verified by reading back modified files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cal added 1 commit 2026-03-05 12:35:44 +00:00
fix: remove top-level discord_utils.py duplicate (#34)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m10s
36e3c782c2
Delete the dead top-level discord_utils.py (identical to helpers/discord_utils.py).
Update helpers/main.py and helpers.py to import from helpers.discord_utils
instead of the now-removed top-level module.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cal added the
ai-reviewing
label 2026-03-05 12:45:32 +00:00
cal reviewed 2026-03-05 12:47:01 +00:00
cal left a comment
Author
Owner

AI Code Review

Files Reviewed

  • discord_utils.py (deleted — top-level duplicate)
  • helpers/main.py (modified — relative import fix)
  • helpers.py (modified — absolute import fix)
  • helpers/__init__.py (read for context — unchanged)

Findings

Correctness

  • Deleted discord_utils.py is confirmed identical to helpers/discord_utils.py — the duplicate claim is accurate.
  • helpers/main.py line 36: from .discord_utils import * is the correct relative import for a module inside the helpers/ package. Resolves to helpers/discord_utils.py as intended.
  • helpers.py line 36: from helpers.discord_utils import * is the correct absolute import. Note: helpers.py is superseded by the helpers/ package at runtime (Python loads the package), so this change is cosmetic/consistency only.
  • Grep confirms no other files in the codebase imported from the top-level discord_utils — no missed callers.
  • helpers/__init__.py line 29 already imports from .discord_utils import * directly, independent of helpers/main.py. The package's export namespace is unaffected.

Import Chain After PR

  • Before: helpers/__init__helpers.main → top-level discord_utils (duplicate) AND helpers/__init__helpers/discord_utils
  • After: helpers/__init__helpers.mainhelpers/discord_utils AND helpers/__init__helpers/discord_utils
  • Both paths now resolve to the single canonical file. ✓

Security

  • No issues found.

Style & Conventions

  • Cosmetic linter reformatting at helpers/main.py:1681–1683 and helpers.py:1682–1684 (.description = (f"...").description = f"..."). No behavioral change.

Suggestions

  • None.

Verdict: APPROVED

Clean, well-scoped dead-code removal. All callers updated, no regressions introduced, import chain correctly redirected to the canonical helpers/discord_utils.py. Resolves issue #34.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `discord_utils.py` (deleted — top-level duplicate) - `helpers/main.py` (modified — relative import fix) - `helpers.py` (modified — absolute import fix) - `helpers/__init__.py` (read for context — unchanged) ### Findings #### Correctness - Deleted `discord_utils.py` is confirmed identical to `helpers/discord_utils.py` — the duplicate claim is accurate. - `helpers/main.py` line 36: `from .discord_utils import *` is the correct relative import for a module inside the `helpers/` package. Resolves to `helpers/discord_utils.py` as intended. - `helpers.py` line 36: `from helpers.discord_utils import *` is the correct absolute import. Note: `helpers.py` is superseded by the `helpers/` package at runtime (Python loads the package), so this change is cosmetic/consistency only. - Grep confirms no other files in the codebase imported from the top-level `discord_utils` — no missed callers. - `helpers/__init__.py` line 29 already imports `from .discord_utils import *` directly, independent of `helpers/main.py`. The package's export namespace is unaffected. #### Import Chain After PR - Before: `helpers/__init__` → `helpers.main` → top-level `discord_utils` (duplicate) AND `helpers/__init__` → `helpers/discord_utils` - After: `helpers/__init__` → `helpers.main` → `helpers/discord_utils` AND `helpers/__init__` → `helpers/discord_utils` - Both paths now resolve to the single canonical file. ✓ #### Security - No issues found. #### Style & Conventions - Cosmetic linter reformatting at `helpers/main.py:1681–1683` and `helpers.py:1682–1684` (`.description = (f"...")` → `.description = f"..."`). No behavioral change. #### Suggestions - None. ### Verdict: APPROVED Clean, well-scoped dead-code removal. All callers updated, no regressions introduced, import chain correctly redirected to the canonical `helpers/discord_utils.py`. Resolves issue #34. --- *Automated review by Claude PR Reviewer*
cal added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-05 12:47:29 +00:00
cal changed target branch from main to next-release 2026-03-07 07:32:39 +00:00
cal force-pushed ai/paper-dynasty-discord-34 from 36e3c782c2 to bb548da0c6 2026-03-07 07:33:55 +00:00 Compare
cal changed target branch from next-release to main 2026-03-23 04:14:24 +00:00
Author
Owner

Closing — will re-implement fresh against main. Original PR had unrebaseable conflicts from the scouting refactor.

Closing — will re-implement fresh against `main`. Original PR had unrebaseable conflicts from the scouting refactor.
cal closed this pull request 2026-03-23 04:15:30 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-discord#62
No description provided.