Skip to content

Level the leg scaffold, round 4: ship the two extension-point seams in the wheel (RULED Q-L8 (a)) - #8

Merged
brettheap merged 1 commit into
mainfrom
chore/level-round-4-package-the-seams
Sep 10, 2026
Merged

brettheap merged 1 commit into
mainfrom
chore/level-round-4-package-the-seams

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Lane: openxfactory-4-opendox-extraction (formerly openxfactory-opendox)

Refs opensoft/openXfactory#656

Ruling

RULED Q-L8 (Brett Heap, 2026-09-10 ~15:4xZ, verbatim "rule Q-L8 (a) approve, (b) (b′), (c) approve"), (a):

(a) APPROVED — openDox-code levelling round 4: package the seams. pyproject.toml ships route_extension and subcommand_extension (the Q-L1 seams at src/<name>.py) as top-level modules of the opendox distribution; proven by building the wheel and importing both from it in a clean venv; scaffold file only. Then openXdox-code levelling round 3 bumps the pinned dependency to openDox-code's new main.

(b)/(b′) and (c) of the same ruling are out of scope here — they land on openXdox-code and on openxFactory's own scripts respectively, in their own PRs.

The defect

Carve leg 1 placed the two Q-L1 extension-point seams at src/route_extension.py and src/subcommand_extension.py — top-level modules of src/, because the arrived code imports them by bare name (src/opendox/cli.py:65 import subcommand_extension, src/opendox/serve.py:117 import route_extension). [tool.setuptools.packages.find] discovers only the opendox package, so a built wheel — and therefore pip install git+…openDox-code@<sha>, which is how openXdox-code's levelling round 2 consumes this repository — omitted both modules, and the installed opendox.cli raised ModuleNotFoundError: No module named 'subcommand_extension': 493 of leg 3's 615 validate errors at openXdox-code. The source-tree validate here never caught it because pip install -e ".[test]" puts src/ on the path directly instead of packaging it.

The change

pyproject.toml only, alongside the existing packages.find:

[tool.setuptools]
package-dir = { "" = "src" }
py-modules = ["route_extension", "subcommand_extension"]

[tool.setuptools.packages.find]
where = ["src"]

Scaffold file only. No row in docs/opendox-carve-manifest.yaml covers pyproject.toml (RULED OQ-C: the manifest declares what leaves openxFactory, never what a destination assembles), and no carved row (src/opendox/**, tests/**) is touched.

Proof

BEFORE (origin/main ce53b489) — wheel omits both seams:

$ unzip -l dist/*.whl | grep -E 'route_extension|subcommand_extension'
(empty — exit 1)

Full BEFORE listing: 45 files, all under opendox/ or opendox-0.0.0.dist-info/ — no top-level module.

AFTER — wheel ships both:

$ unzip -l dist/*.whl | grep -E 'route_extension|subcommand_extension'
    30017  2026-09-10 15:51   route_extension.py
     5059  2026-09-10 15:51   subcommand_extension.py

Full AFTER listing: 47 files — the same 45 plus both seams at the wheel root.

Import proof 1 — clean venv, pip install dist/opendox-0.0.0-py3-none-any.whl (not editable):

$ python -c "import route_extension, subcommand_extension; print('ok')"
ok

Import proof 2 — clean venv, pip install "git+https://github.com/opensoft/openDox-code@fd6ceb8615e4084de82541593c0df11520da1849" (the exact path openXdox-code's levelling round 2 uses):

$ python -c "import route_extension, subcommand_extension; print('ok')"
ok

On the exact three-module compound line the task asked for (import opendox.cli, route_extension, subcommand_extension) — run against both installs above, for the record:

  • BEFORE this fix, the same command raises exactly the reported defect:

    File ".../opendox/cli.py", line 65, in <module>
        import subcommand_extension  # noqa: E402
    ModuleNotFoundError: No module named 'subcommand_extension'
    
  • AFTER this fix, that specific error is gone — cli.py:65 now resolves — and the import proceeds to a separate, pre-existing, already-disclosed condition unrelated to this change: opendox.workbench (reached via opendox.authoring, module-level) does from openxdox.snapshot import find_validator, and openxdox does not exist yet — it is the package the next-but-one leg (openXdox-code) provides. This is not a new finding: this repository's own root conftest.py already documents it verbatim —

    awaits openXdox-code leg the module imports openxdox.*, directly or through opendox.workbench / opendox.branch_session / opendox.cli. The ruled § 5.5 carve rewrite points these at openxdox, which is the NEXT-but-one leg; under the hard order (opendox_code first) leg 1 cannot wait for it.

    — and pyproject.toml itself already names openxdox as a deliberate non-dependency. tests/test_workbench.py is on the root collect_ignore list for exactly this reason. This PR does not touch src/opendox/** (a carved row) and does not attempt to resolve it; it is the same reach the CARVE LEG 3 memo predicted would become dominant once the subcommand_extension defect was fixed, and it is squarely inside the scope of the BUILD arc / openXdox-code leg, not Q-L8 (a).
    Diagnostic only, not part of this PR: installing a throwaway stub openxdox.snapshot.find_validator into a scratch venv's site-packages (never committed, never touching this repository) lets import opendox.cli, route_extension, subcommand_extension proceed further, past workbench.py, until it reaches the next real cross-column import (opendox.branch_session needing openxdox.gate_console) — confirming this is a broad, multi-module, already-known gap, not anything this fix could or should paper over.

validate (as written, .github/workflows/validate.yml), run locally:

$ python -m pip install -e ".[test]"
$ python -m pytest -q tests/test_leg_shape.py --noconftest
............                                                             [100%]
12 passed in 0.05s

Lands on Brett Heap's ruling Q-L8 (a) via the lane's gate; openXdox-code's dependency pin bumps to this merge in its levelling round 3.

🤖 Generated with Claude Code

…s in the wheel (RULED Q-L8 (a))

openDox-code's wheel omitted the two Q-L1 extension-point seams
(route_extension.py, subcommand_extension.py) placed at the top of src/ by
carve leg 1, because [tool.setuptools.packages.find] discovers only the
opendox package. A pip install of this repository from git — the path
openXdox-code's levelling round 2 uses — therefore installed an opendox.cli
that raised ModuleNotFoundError: No module named 'subcommand_extension' at
import time: 493 of leg 3's 615 validate errors at openXdox-code. The
source-tree validate here never caught it because pip install -e '.[test]'
puts src/ on the path directly instead of packaging it.

Fix: declare both modules as top-level py-modules of the opendox
distribution, alongside the existing packages.find. Scaffold file only;
nothing else changes.

RULED Q-L8 (a) (opensoft/openXfactory#656, Brett Heap, 2026-09-10, verbatim
"rule Q-L8 (a) approve, (b) (b′), (c) approve"): APPROVED, proven by
building the wheel and importing both modules from it in a clean venv.

Lane: openxfactory-4-opendox-extraction
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 10, 2026 15:58
@brettheap
brettheap marked this pull request as ready for review September 10, 2026 15:58
@sonarqubecloud

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot 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.

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 hours and 8 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

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.

🟢 Approval recommended

The change is minimal, correctly targets wheel packaging behavior (via py-modules), and aligns with the stated defect and proof without introducing behavioral risk.

Pull request overview

This PR updates the packaging configuration for the openDox code leg so that the two top-level extension-point “seam” modules (route_extension.py and subcommand_extension.py) are included in built wheels and therefore importable after non-editable installs.

Changes:

  • Adds py-modules = ["route_extension", "subcommand_extension"] under [tool.setuptools] so setuptools ships the two top-level src/*.py modules in the wheel.
  • Documents (in-file) the rationale and the specific failure mode that occurs when the modules are omitted from wheel builds.
File summaries
File Description
pyproject.toml Declares the two seam modules as top-level py-modules so they are packaged into the wheel and importable post-install.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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