Repository navigation
fix(distribution): keep devtools out of user artifacts - #691
Conversation
Problem: devtools is a source-checkout control plane, but wheel artifacts exposed it as both an importable package and console script. That confused the product/dev boundary and left sdist rebuild behavior unverified.\n\nWhat changed: remove devtools from user wheel packaging, extend the Nix package smoke to prove runtime scripts remain present and devtools is absent, and add devtools verify-distribution-surface to build wheel/sdist artifacts, rebuild from unpacked sdist without .git, smoke installed runtime entrypoints, and reject installed devtools.\n\nVerification: ruff, mypy, focused devtools tests, devtools verify-distribution-surface, devtools verify-manifests, devtools render-all --check, and nix flake check.\n\nRef #593\n\nCo-Authored-By: Claude <[email protected]>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 31 minutes and 15 seconds.Comment |
Polylogue Proof PackRefs: Affected Domains
Additional routed domains with zero affected claims
Focused Gates
Required PR Gates
Optional Confidence Gates
Known Gaps
Additional gaps in zero-claim routed domains
Oracle / Cost
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 191f5d57de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| polylogue = "polylogue.cli:main" | ||
| polylogued = "polylogue.daemon.cli:main" | ||
| polylogue-mcp = "polylogue.mcp.cli:main" | ||
| devtools = "devtools.__main__:main" | ||
|
|
There was a problem hiding this comment.
Reintroduce a callable devtools entry for uv-run workflows
Removing devtools from the project’s script surface means jobs that execute uv run devtools ... no longer have a valid command to run after uv sync (see .github/workflows/ci.yml lines 32-33, 50, and 84). uv run treats module execution as an explicit -m/--module mode (uv help run), so these workflow steps now fail instead of invoking the control-plane CLI.
Useful? React with 👍 / 👎.
| bin_dir = venv_dir / ("Scripts" if os.name == "nt" else "bin") | ||
| _run((str(bin_dir / "polylogue"), "--version"), cwd=install_dir, env=env) | ||
| _run((str(bin_dir / "polylogue"), "--help"), cwd=install_dir, env=env) |
There was a problem hiding this comment.
Use Windows-safe executable names in distribution smoke checks
The smoke test builds absolute paths like Scripts/polylogue and executes them directly, but on Windows console entry points are generated as launcher files (e.g., .exe/.cmd), so these extensionless paths will not resolve reliably and the check fails on os.name == 'nt'. The same assumption also weakens the devtools-absence check because it only probes Scripts/devtools without launcher suffixes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR tightens Polylogue’s distribution boundary by removing devtools from the installed wheel surface and adding a new checkout-side verification command to smoke built artifacts. It also updates the Nix/package smoke checks and generated documentation so the declared distribution story matches the intended runtime surface.
Changes:
- Remove
devtoolsfrom packaged wheel entrypoints while keepingpolylogue,polylogued, andpolylogue-mcpas supported runtime scripts. - Add
devtools verify-distribution-surfaceto build wheel/sdist artifacts, inspect wheel contents, rebuild from unpacked sdist, and smoke installed runtime commands. - Update Nix smoke checks and generated distribution/devtools documentation to reflect the new boundary and verification coverage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/devtools/test_verify_distribution_surface.py |
Adds unit tests for the new distribution-surface verifier and packaging assertions. |
pyproject.toml |
Removes the devtools console script and limits wheel packaging to polylogue. |
flake.nix |
Drops devtools from import checks and extends the Nix smoke test to runtime scripts plus devtools absence. |
docs/verification-catalog.md |
Refreshes generated proof/coverage counts after manifest changes. |
docs/plans/distribution-coverage.yaml |
Updates the distribution coverage manifest to describe the new local verification gate and remaining gaps. |
docs/devtools.md |
Adds the new verify-distribution-surface command to the generated devtools catalog. |
devtools/verify_distribution_surface.py |
Implements the new wheel/sdist verification and installed-artifact smoke command. |
devtools/command_catalog.py |
Registers the new devtools command in the command catalog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bin_dir = venv_dir / ("Scripts" if os.name == "nt" else "bin") | ||
| _run((str(bin_dir / "polylogue"), "--version"), cwd=install_dir, env=env) | ||
| _run((str(bin_dir / "polylogue"), "--help"), cwd=install_dir, env=env) | ||
| _run((str(bin_dir / "polylogue"), "--plain", "count"), cwd=install_dir, env=env) | ||
| _run((str(python), "-m", "polylogue", "--version"), cwd=install_dir, env=env) | ||
| _run((str(bin_dir / "polylogued"), "--help"), cwd=install_dir, env=env) | ||
| _run((str(bin_dir / "polylogue-mcp"), "--help"), cwd=install_dir, env=env) | ||
| if (bin_dir / "devtools").exists(): |
| rendered = " ".join(cmd) | ||
| print(f"verify-distribution-surface: {rendered}", file=sys.stderr) | ||
| result = subprocess.run(tuple(cmd), cwd=cwd, env=env, text=True, capture_output=True, check=False) | ||
| if result.returncode == 0: | ||
| return | ||
| output = "\n".join(part for part in (result.stdout.strip(), result.stderr.strip()) if part) | ||
| raise DistributionVerificationError(f"command failed ({result.returncode}): {rendered}\n{output}") |
| polylogued --help >/dev/null | ||
| polylogue-mcp --help >/dev/null | ||
| ! command -v devtools >/dev/null |
| sdist_wheel_dir = work_dir / "sdist-wheel" | ||
| _run(("uv", "build", "--out-dir", str(sdist_wheel_dir), "--wheel", str(unpacked)), cwd=work_dir) | ||
| sdist_wheel = _single_artifact(sdist_wheel_dir, "*.whl") | ||
| _verify_wheel_surface(sdist_wheel) | ||
| _smoke_installed_wheel(sdist_wheel, work_dir / "sdist-wheel-install") |
| assert not any("devtools" in call for call in calls) | ||
|
|
||
|
|
Summary Keep devtools as a source-checkout control plane instead of a shipped user artifact, and add an installed distribution gate for the wheel/sdist surface. Problem Polylogue exposed devtools as both a console script and wheel package, which blurred the product/dev boundary tracked in #593. The distribution checks also proved artifact construction more than installed artifact behavior. Solution Remove devtools from wheel packaging and runtime console scripts while retaining polylogue, polylogued, and polylogue-mcp. Add devtools verify-distribution-surface to build wheel/sdist artifacts, rebuild from unpacked sdist without .git, smoke installed runtime entrypoints, and reject installed/importable devtools. Update the Nix smoke and distribution manifest to match. Verification ruff check devtools/verify_distribution_surface.py tests/unit/devtools/test_verify_distribution_surface.py devtools/command_catalog.py ruff format --check devtools/verify_distribution_surface.py tests/unit/devtools/test_verify_distribution_surface.py devtools/command_catalog.py mypy devtools/verify_distribution_surface.py tests/unit/devtools/test_verify_distribution_surface.py pytest -q tests/unit/devtools/test_verify_distribution_surface.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_render_devtools_reference.py tests/unit/devtools/test_build_package.py devtools verify-distribution-surface --work-dir .local/distribution-surface-check devtools verify-manifests devtools render-all --check devtools verify --quick nix flake check Closes #593
Summary
Keeps
devtoolsas a source-checkout control plane instead of a shipped user artifact, and adds an installed distribution gate for the wheel/sdist surface.Problem
#593 called out that Polylogue's distribution boundary was confused:
pyproject.tomlexposeddevtoolsas a console script and shipped thedevtoolspackage in user wheels. That made repo-maintenance tooling look like part of the installed product surface, while the build only proved that artifacts could be produced, not that installed artifacts had the intended entrypoints or build metadata.Solution
Remove
devtoolsfrom wheel packaging and console scripts while keepingpolylogue,polylogued, andpolylogue-mcpas runtime entrypoints. Extend the Nix package smoke check to prove those runtime scripts exist and thatdevtoolsis absent.Add
devtools verify-distribution-surface, which builds checkout wheel/sdist artifacts, verifies wheel contents and entry points, installs the checkout-built wheel in a fresh environment, unpacks the sdist outside.git, rebuilds a wheel from that unpacked sdist, installs it, and smokes the same runtime surface. The gate also rejects importable or executabledevtoolsfrom installed wheels.Update the distribution coverage manifest and generated docs to record the realized state: local wheel/sdist verification now exists, while CI scheduling and exact Nix/devshell parity remain coverage gaps.
Verification
ruff check devtools/verify_distribution_surface.py tests/unit/devtools/test_verify_distribution_surface.py devtools/command_catalog.pyruff format --check devtools/verify_distribution_surface.py tests/unit/devtools/test_verify_distribution_surface.py devtools/command_catalog.pymypy devtools/verify_distribution_surface.py tests/unit/devtools/test_verify_distribution_surface.pypytest -q tests/unit/devtools/test_verify_distribution_surface.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_render_devtools_reference.py tests/unit/devtools/test_build_package.py(14 passed)devtools verify-distribution-surface --work-dir .local/distribution-surface-checkdevtools verify-manifestsdevtools render-all --checkdevtools verify --quickvia pre-push hooknix flake check(all checks passed; omitted incompatible non-Linux systems)Closes #593