Skip to content

fix(distribution): gate installed artifacts and build metadata #593

Closed

Description

@Sinity

Scope

Composite issue for distribution/package verifiability: wheel, sdist, Nix/devshell parity, console scripts, build metadata, and the product/devtools packaging boundary.

Resolution

Resolved by #691.

The product/control-plane boundary is not open: devtools is source-checkout-only. User wheels ship the runtime package and runtime entrypoints:

  • polylogue
  • polylogued
  • polylogue-mcp

devtools remains available from the source checkout/devshell wrapper.

Implemented State

  • pyproject.toml exposes only runtime console scripts.
  • [tool.hatch.build.targets.wheel] includes only the polylogue package.
  • devtools verify-distribution-surface builds wheel and sdist artifacts, installs them in fresh environments, rebuilds a wheel from unpacked sdist outside .git, and smokes installed runtime entrypoints.
  • Build metadata is verified through packaged polylogue/_build_info.py in the sdist rebuild path.

Remaining Gaps Tracked Elsewhere

The distribution coverage manifest still records broader non-blocking coverage gaps such as CI scheduling for the distribution gate, exact Nix/devshell parity comparison, and non-Linux runners. Those are coverage backlog items, not unresolved product-boundary decisions.

Ref #578

Activity

  1. added
    type:fix
    theme:verifiability
    area:devtools
    on May 1, 2026
  2. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Additional concrete acceptance points from the 2026-05-01 audit:

    • pyproject.toml:101-112 exposes both polylogue and devtools console scripts, and pyproject.toml:126-129 includes both packages in the wheel. Decide whether devtools is intentionally part of the installed product/operator surface or source-checkout-only control plane. Either decision needs distribution tests.
    • hatch_build.py:45-58 requires a .git checkout or an embedded polylogue/_build_info.py. The distribution gate should build a wheel from an unpacked sdist with no .git and verify polylogue --version still has the expected build metadata.

    These do not need separate issues if this distribution-surface gate owns them.

  3. changed the title [-]fix(distribution): gate wheel and sdist install parity[/-] [+]fix(distribution): gate installed artifacts and build metadata[/+] on May 1, 2026
  4. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Distribution-gate nuance: decide the product/control-plane boundary first, then make the packaging tests enforce that decision.

    Two valid outcomes are possible:

    • user distribution ships only polylogue; devtools remains source-checkout/devshell control plane, and wheel/sdist smoke tests assert devtools is absent;
    • user distribution intentionally ships devtools; then it becomes an installed operator surface with docs, console-script smoke tests, and a supported dependency story.

    Either way, the gate should build from source checkout, wheel, and unpacked sdist without .git, then compare polylogue --version, --help, and a tier-0 query/smoke. Build metadata should be proven from the packaged _build_info.py path, not by accidentally seeing the repository checkout.

  5. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Implementation anchors and acceptance additions from the 2026-05-01 follow-up audit.

    Code anchors:

    • pyproject.toml:110-115: project scripts expose both polylogue and devtools.
    • pyproject.toml:126-129: wheel includes both packages.
    • hatch_build.py:45-57: build metadata requires .git or existing polylogue/_build_info.py; otherwise raises.

    Acceptance additions:

    • Build sdist, unpack it outside .git, build wheel from unpacked sdist, and assert polylogue --version reports expected build metadata.
    • Decide whether devtools is intentionally shipped. If yes: installed wheel smoke includes devtools --list-commands --json. If no: remove script/package from wheel and add a negative distribution test.
    • Installed artifact smoke should cover both console scripts and python -m polylogue behavior where applicable.
    • Compare source checkout, wheel, sdist-built wheel, and Nix/devshell for the tier-0 smoke surface.

    Adjacent candidate: browser extension distribution is outside #593 today. If the extension is a shipped product surface, open or link fix(distribution): gate browser-extension packaging/install smoke; otherwise add a #593 acceptance item saying the extension is source-checkout-only for now.

  6. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Related leaf issue for extension distribution/testing: #649. If the browser extension is a shipped artifact, #593 should eventually include or link its package/install smoke; if it is source-checkout-only for now, record that explicitly in #593 acceptance.

  7. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Distribution decision from 2026-05-01 bundle

    Devtools should be source-checkout-only.

    Acceptance refinements:

    • User wheels should not expose devtools unless it is placed behind an explicit extra/operator install.
    • Installed artifact smoke should exercise polylogue, not rely on source-checkout devtools.
    • If distribution verification itself needs devtools, that gate belongs to source checkout / CI / devshell, not the user wheel.
    • polylogue --version, polylogue --help, and a tier-0 user command should be smoked from wheel/sdist/Nix contexts.

    Ref #635

  8. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Integrated executable-boundary direction from the 2026-05-01 UX feedback pass.

    Distribution acceptance should account for the intended executable split:

    polylogue       query-first archive CLI
    polylogued      long-running daemon for live ingestion, browser receiver, local API/web
    polylogue-mcp   MCP stdio bridge, preferred over `polylogue mcp`
    devtools        source-checkout repo control plane unless explicitly blessed for wheel shipping
    

    Packaging tests should verify whichever of these executables are shipped. If polylogue-mcp is introduced, MCP client configuration should use it directly and it should support --role read|write|admin without requiring the full daemon to be launched by the MCP client.

  9. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Distribution update from #679: polylogue-mcp = polylogue.mcp.cli:main is now declared as a console script alongside polylogue and devtools. This handles the MCP executable split requested in the packaging/distribution direction; broader packaging policy around whether devtools should ship remains open.

  10. Sinity commented on May 2, 2026

    @Sinity
    OwnerAuthor

    Implementation update from PR #680:

    Packaging now declares a third console script:

    • polylogue for the query-first archive CLI
    • polylogued for long-running local services, currently polylogued watch
    • polylogue-mcp for the MCP stdio bridge

    The PR includes a package build check and verifies .local/result/bin/polylogued --help plus .local/result/bin/polylogued watch --help, which caught and closed the packaging inclusion risk for the new daemon package.

    Remaining distribution-boundary work here: decide whether devtools remains shipped in the wheel or becomes source-checkout-only, and later ensure browser-capture service movement is reflected in installed entrypoints if it joins polylogued.

  11. 4 remaining items

  12. Sinity commented on May 2, 2026

    @Sinity
    OwnerAuthor

    Current distribution state (2026-05-02)

    Three console scripts are now declared and verified:

    Recent PRs #680 and #681 landed the executable split and package-build smoke checks.

    Remaining work

    The open decision from the comment thread: should devtools ship in the installed wheel? The 2026-05-01 bundle says "source-checkout-only," but this hasn't been codified in pyproject.toml yet.

    If the decision is confirmed:

    1. Remove devtools from pyproject.toml [tool.hatch.build.targets.wheel] packages
    2. Remove devtools console_scripts entry (or gate behind an [operator] extra)
    3. Add a distribution smoke test that asserts devtools is NOT importable from an installed wheel
    4. Build sdist, unpack outside .git, build wheel from unpacked sdist, verify polylogue --version reports expected metadata

    hatch_build.py:45-57 already handles the .git-vs-_build_info.py fallback — the sdist test will exercise that path.

  13. Sinity commented on May 2, 2026

    @Sinity
    OwnerAuthor

    Correction to the earlier stale wording: the devtools packaging decision is not open.

    The accepted decision is source-checkout-only, and #691 codified it:

    • pyproject.toml runtime scripts are polylogue, polylogued, and polylogue-mcp only.
    • Wheel packaging includes packages = [\"polylogue\"] only.
    • devtools verify-distribution-surface rejects installed artifacts that include devtools/, expose a devtools console script, or make devtools importable after wheel install.
    • The source-checkout/devshell still exposes devtools through the wrapper in flake.nix.

    The remaining distribution coverage gaps are CI/parity/platform scheduling items, not a product/control-plane boundary decision.

  14. Sinity commented on May 2, 2026

    @Sinity
    OwnerAuthor

    Follow-up correction: the previous correction still over-described the implementation as a negative anti-regression guard.

    The intended state is simpler:

    • pyproject.toml declares only runtime scripts and packages only polylogue.
    • devtools is available from source checkout/devshell, not a runtime wheel surface.
    • The distribution smoke should prove shipped runtime entrypoints and build metadata work. It should not carry permanent sentinel checks whose purpose is to fail if a devtools package/script/import appears later.

    A cleanup PR is removing those negative verifier checks and keeping the distribution gate focused on runtime artifact behavior.

  15. Sinity commented on May 2, 2026

    @Sinity
    OwnerAuthor

    Distribution-surface cleanup update: the branch now removes the extra anti-regression sentinels around devtools. The verifier still proves the supported runtime distribution surface (build metadata plus polylogue/polylogued/polylogue-mcp wheel/sdist install smokes), but no longer rejects devtools by package name, console-script name, installed binary, or importability. I also removed the equivalent Nix smoke and command-catalog/coverage-manifest wording so the durable record no longer describes that negative guard as intended verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:devtoolsarea:nixtheme:verifiabilitytool:codextype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions