Skip to content

fix: require pure Python forwarding shape - #693

Open
ApexWorm wants to merge 2 commits into
peteromallet:mainfrom
ApexWorm:fix/python-passthrough-semantic-gate
Open

fix: require pure Python forwarding shape#693
ApexWorm wants to merge 2 commits into
peteromallet:mainfrom
ApexWorm:fix/python-passthrough-semantic-gate

Conversation

@ApexWorm

@ApexWorm ApexWorm commented Aug 1, 2026

Copy link
Copy Markdown

Problem

The Python passthrough detector relied on textual param=param matches, which labels decorated command entrypoints, functions that construct requests, and typed dataclass fixture factories as high-confidence redundant wrappers.

Fix

Parse Python modules and only report undecorated top-level functions whose body is an optional docstring plus one return that directly forwards parameters to a statically rooted, non-constructor call target. This preserves genuine lower-case forwarding aliases while rejecting multi-step functions, nested request construction, dynamic receivers, and Capitalized class-constructor factories.

Verification

  • python3 -m pytest desloppify/languages/python/tests/test_py_extractors.py -q # 39 passed
  • python3 -m pytest desloppify/languages/python/tests -q # 289 passed
  • python3 -m pytest desloppify/languages/python/tests/test_py_commands.py desloppify/tests/commands/test_cmd_detect.py desloppify/tests/commands/test_commands_base.py -q # 41 passed
  • python3 -m ruff check desloppify/languages/python/extractors.py desloppify/languages/python/tests/test_py_extractors.py
  • python3 -m ruff format --check desloppify/languages/python/extractors.py desloppify/languages/python/tests/test_py_extractors.py

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