Skip to content

Fix the competing tools module root in mypy - #1421

Merged
trissim merged 1 commit into
mainfrom
fix/tools-package-namespace
Nov 2, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/tools-package-namespace

Conversation

@trissim

@trissim trissim commented Nov 2, 2026

Copy link
Copy Markdown

Summary

1 commit, 1 line replaced in pyproject.toml; one observer file identity instead of two. No production Python, checker suppression or baseline comparison change.

Source-root repair

Before: [tool.mypy].mypy_path = ["src", "tools"]. With the existing --explicit-package-bases, selecting tools/physical_ui.py names it physical_ui, while its consumers import tools.physical_ui. Core's ClientTypeErrors.findings selects paths and reads the client's configuration, so both hosted #3873 jobs abort on the duplicate module before checking the dependency change.

After: ["src", "."]. The repository root owns the tools namespace, exactly as tools/physical_ui_candidate.py, tools/physical_ui_admission.py, tools/physical_ui.py, acceptance and performance consumers already import it. src still owns toad.

This removes the competing root declaration; it does not rename imports, wrap the checker, edit captured baseline sources, disable diagnostics, add an alias or suppress a file.

Proof

Mypy's own process_options executed with the same explicit-package-bases flag. Before: both physical UI input paths map to bare names and base_dir=.../tools. After: they map to tools.physical_ui / tools.physical_ui_candidate and repository base_dir, matching module-selected names. Both probes returned 0. Complete import scan of tools/**/*.py found local imports already qualified under tools; no bare observer consumer needs the removed root.

A provisional tools/__init__.py alone did not change the source mapping because the explicit tools root still wins. It was removed before this commit, not kept as a ceremonial fix.

Artifacts: /home/ts/.cache/agent-scratch/pi-ui-performance/mypy-namespace-77.log (before), mypy-namespace-78.log (init alone insufficient), mypy-namespace-79.log (correct root). No pytest or local NRA gate run.

The checker was finding the file so thoroughly it found two of it.

Assumed: the declared qualified imports remain the intended development namespace. Core #3873 must recapture/rerun with this Toad main for both materialized cuts; old immutable failure logs remain unchanged.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 19:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit 3fe4222 into main Nov 2, 2026
2 of 4 checks passed
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.

2 participants