Skip to content

refactor(src): reorganize plaud_tools by surface (core/cli/mcp_pt/tray)#188

Merged
massive-value merged 2 commits into
mainfrom
refactor/src-layout-by-surface
Jul 8, 2026
Merged

refactor(src): reorganize plaud_tools by surface (core/cli/mcp_pt/tray)#188
massive-value merged 2 commits into
mainfrom
refactor/src-layout-by-surface

Conversation

@massive-value

Copy link
Copy Markdown
Owner

Summary

Splits the flat src/plaud_tools/ file list into packages grouped by consumer, decided from actual import fan-in/fan-out rather than guesswork:

  • core/ — shared domain layer (client, session, auth, transport, models, errors, appdata, layout, transcode, query, ai_clients) used by 2+ of cli/mcp/tray
  • cli/cli.py, doctor.py, and process_probe.py (renamed from mcp_lifecycle.py — the old name outlived a prior dead-code removal that left only a doctor-only process-enumerator probe)
  • mcp_pt/mcp.py, server.py (named mcp_pt, not mcp, to avoid shadowing the mcp SDK package these modules import)
  • tray/ — unchanged, plus completions/, scripts/ (PS1 update/uninstall templates), and ps1_templates.py consolidated in since they're tray-exclusive by actual usage

assets/ and the repo-root /scripts/ stay put: assets/icon.ico is shared by both the mcp_pt and tray PyInstaller builds, and /scripts/install.ps1 is fetched by a public raw-GitHub URL baked into the README.

No behavior, CLI/MCP surface, or entry-point change — pure module reorg. Also updated:

  • All relative/absolute imports across src/, tests/, scripts/
  • pyproject.toml entry points + mypy overrides
  • pyinstaller/*.spec hiddenimports and bundled-data paths
  • CI/ADR comments referencing the renamed module
  • Current-state docs (CLAUDE.md, CONTEXT.md, CONTRIBUTING.md)

Historical docs (CHANGELOG entries, ADRs, plan docs) were deliberately left untouched — they describe what was true when written.

Two bugs caught by the test suite during the move (both fixed here, not pre-existing):

  1. ps1_templates.py's dev-mode path resolution broke when the file moved a directory deeper — fixed.
  2. --diagnose-enum's error string changed text, which would have silently defeated a regression test checking for the old string — test updated to match.

Test plan

  • pytest -q -m "not live" — 1027 passed
  • ruff check src/ scripts/ tests/ — clean
  • mypy src/plaud_tools — clean
  • Reinstalled editable package (pip install -e . --no-deps) and verified all four console-script entry points (plaud-tools, pt, plaud-mcp, plaud-tray) resolve and report the correct version
  • Verified scripts_dir() and the new assets/completions paths resolve correctly at runtime

🤖 Generated with Claude Code

massive-value and others added 2 commits July 8, 2026 12:33
Split the flat src/plaud_tools/ file list into packages grouped by
consumer, using real import fan-in/fan-out (not guesswork) to decide
ownership:

- core/    shared domain layer (client, session, auth, transport, models,
           errors, appdata, layout, transcode, query, ai_clients) used by
           2+ of cli/mcp/tray
- cli/     cli.py, doctor.py, and process_probe.py (renamed from
           mcp_lifecycle.py — the old name outlived a prior dead-code
           removal that left only a doctor-only process-enumerator probe)
- mcp_pt/  mcp.py, server.py (named mcp_pt, not mcp, to avoid shadowing
           the `mcp` SDK package these modules import)
- tray/    unchanged, plus completions/, scripts/ (PS1 update/uninstall
           templates), and ps1_templates.py consolidated in since they're
           tray-exclusive by actual usage

assets/ and the repo-root /scripts/ stay put: assets/icon.ico is shared
by both the mcp_pt and tray PyInstaller builds, and /scripts/install.ps1
is fetched by a public raw-GitHub URL baked into the README.

No behavior, CLI/MCP surface, or entry-point change. Updated all
relative/absolute imports, pyproject.toml entry points + mypy overrides,
pyinstaller hiddenimports/data paths, CI/ADR comments, and current-state
docs (CLAUDE.md, CONTEXT.md, CONTRIBUTING.md) accordingly. Historical
docs (CHANGELOG entries, ADRs, plan docs) left untouched since they
describe what was true when written.

1027 tests pass, ruff/mypy clean, all four console-script entry points
verified against the reinstalled editable package.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Caught by CI: the earlier grep sweep for stale scripts/ references
excluded .yml files, missing this hardcoded path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@massive-value massive-value merged commit 91cefcf into main Jul 8, 2026
16 checks passed
@massive-value massive-value deleted the refactor/src-layout-by-surface branch July 8, 2026 18:41
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