Skip to content

Fix rename tech debt, restructure internal docs#10

Merged
ianhi merged 3 commits intomainfrom
fix/rename-tech-debt
Mar 11, 2026
Merged

Fix rename tech debt, restructure internal docs#10
ianhi merged 3 commits intomainfrom
fix/rename-tech-debt

Conversation

@ianhi
Copy link
Copy Markdown
Collaborator

@ianhi ianhi commented Mar 11, 2026

Summary

  • Fix parse_wheel_filename to count python/abi/platform tags from end instead of fragile isdigit() heuristic
  • Fix rename_wheel_from_bytes to raise ValueError on malformed dist-info instead of silent fallback to version "0.0.0"
  • Extract _rename_wheel_files() shared helper eliminating ~100 lines of duplication between rename_wheel and rename_wheel_from_bytes
  • Fix inspect_wheel to use proper booleans instead of string "True"/"False"
  • Fix cache_dir() to respect $XDG_CACHE_HOME
  • Add 17 new tests covering rename_wheel_from_bytes, inspect_wheel, cache_dir, rename_cache_key, parse_wheel_filename edge cases, and update_imports=False
  • Restructure docs: Move detailed internal docs from AGENTS.md into INTERNAL_DOCS/ directory with topic-focused files. Add planning.md for cross-session agent communication.

Test plan

  • All 242 tests pass (uv run pytest tests/)
  • Ruff check passes
  • Pre-commit hooks pass (ruff format, markdownlint)

🤖 Generated with Claude Code

ianhi and others added 3 commits March 10, 2026 22:29
…ols, XDG cache

- Fix parse_wheel_filename to count python/abi/platform from end instead
  of fragile isdigit() heuristic for build tag detection
- Fix rename_wheel_from_bytes to raise ValueError on malformed dist-info
  instead of silently falling back to version "0.0.0"
- Extract _rename_wheel_files() shared helper, eliminating ~100 lines of
  duplication between rename_wheel and rename_wheel_from_bytes
- Fix inspect_wheel to use proper booleans instead of string "True"/"False"
- Fix cache_dir() to respect XDG_CACHE_HOME
- Fix CLI inspect bool check from == "True" to truthiness
- Add comprehensive tests: TestParseWheelFilenameEdgeCases,
  TestRenameWheelFromBytes, TestInspectWheel, TestCacheDir,
  TestRenameCacheKey, plus update_imports=False and .tar.gz rejection
- Update AGENTS.md known issues checklist (12 items now resolved)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move detailed internal documentation from AGENTS.md into topic-focused
files under INTERNAL_DOCS/ (architecture, testing, known-issues, etc.).
AGENTS.md now links to CLAUDE.md for rules and provides agent-specific
guidance. CLAUDE.md is the single source of truth for project rules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add INTERNAL_DOCS/planning.md with current priorities, decisions log,
  session notes, and conventions for cross-session communication
- Add purpose descriptions to all INTERNAL_DOCS/ files
- Cross-reference planning.md from known-issues.md
- Update AGENTS.md and CLAUDE.md to reference planning.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ianhi ianhi merged commit bc01698 into main Mar 11, 2026
5 checks passed
@ianhi ianhi deleted the fix/rename-tech-debt branch March 11, 2026 03:11
ianhi added a commit that referenced this pull request Mar 11, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ianhi added a commit that referenced this pull request Mar 11, 2026
…ng (#11)

* Update planning.md session notes after v0.2.0 release and PR #10 merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix critical XSS, UnicodeDecodeError, broad exceptions, and fragile stream rewriting

- Fix XSS in server/html.py: escape all user-controlled values with html.escape()
- Fix UnicodeDecodeError in rename.py and patch.py: gracefully skip non-UTF8 .py files
- Fix broad except Exception in run.py (now TOMLDecodeError/ValueError/KeyError)
  and upstream.py (now ValueError/TypeError)
- Log upstream HTTP errors instead of silently swallowing them
- Fix fragile filename rewriting in stream.py: use parse_wheel_filename() instead
  of naive split("-")
- Fix type annotations in _find_package_dir: explicit set[str] and dict[str, int]
- Update known-issues.md and planning.md with round 2 review findings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant