Skip to content

fix(distribution): keep devtools out of user artifacts - #691

Merged
Sinity merged 1 commit into
masterfrom
feature/fix/distribution-surface-gate
May 2, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/fix/distribution-surface-gate

Conversation

@Sinity

@Sinity Sinity commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

Keeps devtools as 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.toml exposed devtools as a console script and shipped the devtools package 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 devtools from wheel packaging and console scripts while keeping polylogue, polylogued, and polylogue-mcp as runtime entrypoints. Extend the Nix package smoke check to prove those runtime scripts exist and that devtools is 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 executable devtools from 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.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 (14 passed)
  • devtools verify-distribution-surface --work-dir .local/distribution-surface-check
  • devtools verify-manifests
  • devtools render-all --check
  • devtools verify --quick via pre-push hook
  • nix flake check (all checks passed; omitted incompatible non-Linux systems)

Closes #593

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]>
Copilot AI review requested due to automatic review settings May 2, 2026 05:50
@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 15 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1c8f9201-d845-4236-bdba-4bcfe9ff7484

📥 Commits

Reviewing files that changed from the base of the PR and between 64b3331 and 191f5d5.

📒 Files selected for processing (8)
  • devtools/command_catalog.py
  • devtools/verify_distribution_surface.py
  • docs/devtools.md
  • docs/plans/distribution-coverage.yaml
  • docs/verification-catalog.md
  • flake.nix
  • pyproject.toml
  • tests/unit/devtools/test_verify_distribution_surface.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/distribution-surface-gate

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 31 minutes and 15 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Polylogue Proof Pack

Refs: origin/master..HEAD
Changed paths: 8

Affected Domains

  • architecture_discipline — 1 claim(s), maturity growing
  • spec_completeness — 3 claim(s), maturity seed
Additional routed domains with zero affected claims
  • distribution — maturity seed
  • docs_media — maturity seed
  • test_quality — maturity growing

Focused Gates

  • devtools render-all --check — generated surface or renderer changed
  • devtools verify-manifests — assurance coverage manifest changed
  • devtools render-verification-catalog --check — coverage manifests feed proof subjects
  • devtools proof-pack --path docs/plans/distribution-coverage.yaml --markdown — coverage changes feed proof-pack gaps

Required PR Gates

  • devtools verify --quick — full PR gate remains explicit
  • devtools verify — full PR gate remains explicit

Optional Confidence Gates

  • devtools build-package — deployment readiness gate; run when packaging or release confidence matters
  • nix flake check — deployment readiness gate; run when packaging or release confidence matters

Known Gaps

  • none for domains with affected claims
Additional gaps in zero-claim routed domains
  • distribution: dev_install: Not verified in CI; devshell is canonical environment [owner: distribution; next: Add package/build or cross-artifact CI gate], distribution: No scenario for install/package verification [owner: scenario-coverage; next: Add scenario family or generated projection for this subject], install_parity: Local gate smokes wheel and sdist-built wheel, but exact Nix/devshell parity is not yet compared in CI [owner: distribution; next: Add CI job comparing devtools verify-distribution-surface with nix flake check smoke output], macos: No macOS CI runner [owner: distribution; next: Add package/build or cross-artifact CI gate], sdist: Distribution gate exists locally but is not scheduled in CI [owner: distribution; next: Add CI job for devtools verify-distribution-surface], wheel: Distribution gate exists locally but is not scheduled in CI [owner: distribution; next: Add CI job for devtools verify-distribution-surface], windows: No Windows CI runner [owner: distribution; next: Add package/build or cross-artifact CI gate]
  • docs_media: docs_media: No scenario for documentation freshness verification [owner: scenario-coverage; next: Add scenario family or generated projection for this subject], docs_media: README examples and media are not yet generated from executable scenario projections. [owner: docs-media; next: Add executable scenario projection or media integrity gate], docs_media: Screenshots and VHS media have no committed nonblank/readability verification. [owner: docs-media; next: Add executable scenario projection or media integrity gate]
  • test_quality: direct_coverage: Coverage per-module not tracked (only aggregate fail_under) [owner: test-quality; next: Add measurable quality gate for this dimension], flakiness: No systematic flakiness tracking, CI retry, or quarantine [owner: test-quality; next: Add measurable quality gate for this dimension], fuzz: Atheris fuzz targets not run in CI [owner: test-quality; next: Add measurable quality gate for this dimension], mock_depth: Mock depth not measured or enforced [owner: test-quality; next: Add measurable quality gate for this dimension]

Oracle / Cost

  • oracle mix: {"construction_sanity": 18, "drift_check": 1}
  • cost tier: {"static": 19}
  • stable affected obligations: 18
  • agent judgment cells: 0

@Sinity
Sinity merged commit ae31b3d into master May 2, 2026
16 of 17 checks passed
@Sinity
Sinity deleted the feature/fix/distribution-surface-gate branch May 2, 2026 05:54

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread pyproject.toml
Comment on lines 111 to 114
polylogue = "polylogue.cli:main"
polylogued = "polylogue.daemon.cli:main"
polylogue-mcp = "polylogue.mcp.cli:main"
devtools = "devtools.__main__:main"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +121 to +123
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

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 devtools from packaged wheel entrypoints while keeping polylogue, polylogued, and polylogue-mcp as supported runtime scripts.
  • Add devtools verify-distribution-surface to 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.

Comment on lines +121 to +128
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():
Comment on lines +188 to +194
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}")
Comment thread flake.nix
Comment on lines +205 to +207
polylogued --help >/dev/null
polylogue-mcp --help >/dev/null
! command -v devtools >/dev/null
Comment on lines +82 to +86
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")
Comment on lines +65 to +67
assert not any("devtools" in call for call in calls)


Sinity added a commit that referenced this pull request May 7, 2026
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
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.

fix(distribution): gate installed artifacts and build metadata

2 participants