Skip to content

fix(stealth-diagnostic): stop sync wrapper from shadowing the subpackage#10

Merged
codeisalifestyle merged 1 commit into
mainfrom
fix/stealth-diagnostic-name-collision
Jun 20, 2026
Merged

fix(stealth-diagnostic): stop sync wrapper from shadowing the subpackage#10
codeisalifestyle merged 1 commit into
mainfrom
fix/stealth-diagnostic-name-collision

Conversation

@codeisalifestyle

Copy link
Copy Markdown
Owner

Summary

  • The sync convenience wrapper was exported as stealth_diagnostic — the same name as the mithwire.stealth_diagnostic subpackage. Binding it on the mithwire namespace overwrote the subpackage attribute, so import mithwire.stealth_diagnostic.<x> as alias (compiles to IMPORT_FROM, which walks that attribute) raised cannot import name '<x>' from 'stealth_diagnostic' (unknown location). The from mithwire.stealth_diagnostic.<x> import ... form still worked, which masked the bug.
  • Rename the sync wrapper to diagnose_stealth. The async run_stealth_diagnostic and the mithwire.stealth_diagnostic.* import paths are unchanged, so existing consumers (including mithwire-mcp, which imports mithwire.stealth_diagnostic.probes) are unaffected.
  • Add regression tests: mithwire.stealth_diagnostic must be the module, and import mithwire.stealth_diagnostic.probes as p must resolve.

Test plan

  • Previously-broken import resolves 10/10 across fresh processes on a clean editable install
  • Full engine suite: 25 passed (uv run pytest, the CI lane)
  • CI green

Made with Cursor

The sync convenience wrapper was exported as `stealth_diagnostic`, the
same name as the `mithwire.stealth_diagnostic` subpackage. Binding it on
the `mithwire` namespace overwrote the subpackage attribute, so
`import mithwire.stealth_diagnostic.<x> as alias` (which compiles to
IMPORT_FROM and walks that attribute) raised
"cannot import name '<x>' from 'stealth_diagnostic' (unknown location)".
The `from mithwire.stealth_diagnostic.<x> import ...` form happened to
work, which masked the bug.

Rename the sync wrapper to `diagnose_stealth`. The async
`run_stealth_diagnostic` and the `mithwire.stealth_diagnostic.*` import
paths are unchanged, so existing consumers (incl. mithwire-mcp) are
unaffected. Add regression tests asserting `mithwire.stealth_diagnostic`
is the module and that the dotted submodule import resolves.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codeisalifestyle codeisalifestyle merged commit 5d2ae72 into main Jun 20, 2026
1 check passed
@codeisalifestyle codeisalifestyle deleted the fix/stealth-diagnostic-name-collision branch June 20, 2026 02:37
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