Skip to content

Design lightweight first-party language provider distribution and lazy loading #240

Description

@Teakowa

Parent milestone: #242

Goal

Decouple Wright's release cadence from faster-moving first-party source-language implementations by distributing them as independently released LPP provider executables that Wright can resolve, install lazily, and reuse locally.

For #242, OPY is the only provider implementation target. workshop-rs remains Wright's direct build-time canonical Workshop dependency, and DEL/OSTW is a future consumer only after the OPY path is proven on real projects.

Context

Wright currently links source-language implementations directly, so ordinary owner-side releases can force Wright dependency churn even when Wright's product/tooling layer has not changed.

LPP already provides the process boundary. This issue owns only the smallest first-party distribution and local resolution layer needed to make that process boundary practical. It must not become a package manager, registry ecosystem, plugin framework, or project dependency system.

The intended ownership is:

wright
├─ workshop-rs            direct stable canonical core
└─ provider resolver
   └─ local executable
      └─ LPP client
         └─ opy-provider  released by opy-rs

Source entry/project semantics are defined by #243 and the language owner, not by the distribution layer.

Approved design

Distribution source

First-party OPY provider binaries are published by wrightkit/opy-rs through GitHub Releases. Wright does not maintain a separate provider registry service or package index.

A release provides a deterministic target-specific provider archive and integrity checksum for each supported Wright target. The archive contains the provider executable and only packaging metadata required to unpack/install it.

Distribution metadata must not duplicate runtime language capabilities, LPP protocol negotiation, source-language dependencies, or workshop-rs compatibility. Those remain owner/runtime concerns and are negotiated through LPP where applicable.

Resolution precedence

When an OPY workflow requires a provider, Wright resolves it in this order:

  1. explicitly configured local provider executable;
  2. already installed active first-party OPY provider;
  3. lazy bootstrap of the latest stable first-party OPY provider from the owner GitHub Release.

Raw Workshop workflows and unrelated Wright commands never resolve, download, or spawn the OPY provider.

The resolved result is a local executable path handed to the existing LPP runtime / ProviderRegistry; #240 does not introduce a second provider runtime.

Local installation state

Use a small per-user, versioned provider store with one active version pointer, conceptually:

<wright-data>/providers/opy/
├─ <version>/<target>/opy-provider
└─ active

The versioned directory and active pointer exist only to support atomic installation/update, offline reuse, and preservation of the previous working provider if an update fails. They are not a project lockfile or dependency graph.

No provider state is written into the user's source project.

Lazy bootstrap

On first OPY use when no explicit or installed provider exists:

  1. resolve the latest stable opy-rs provider release for the current supported target;
  2. download to temporary storage;
  3. verify the published SHA-256 checksum;
  4. unpack/install into a versioned temporary/final location;
  5. activate only after the complete artifact has been verified and installed successfully.

A failed or partial download/install never becomes active. Offline/missing-provider failures are explicit and must not silently fall back to Wright's old static OPY implementation.

Updates

Normal wright check/compile/lint/analyze invocations do not contact GitHub merely to check for newer provider versions.

Provider updates are explicit, e.g. a dedicated wright provider update opy-style action. This keeps ordinary CI runs deterministic/offline-friendly while still allowing opy-rs to release independently from Wright.

The exact CLI spelling may follow Wright's existing command conventions during implementation; the contract is that routine source commands do not perform automatic update polling.

Product integration boundary

#240 ends once it resolves a verified local OPY provider executable. #243 owns how Wright passes the user-selected OPY entry/path through the LPP adapter and how owner diagnostics/canonical Workshop output/provenance return to Wright.

opy-rs remains responsible for #!mainFile, includes, preprocessing/macros, project/source closure, semantics, diagnostics/provenance, and compiler behavior. Distribution must not require Wright to discover OPY project files.

Scope

  • Define and implement first-party OPY provider release artifact naming/selection for supported Wright targets.
  • Resolve explicit local providers and installed first-party providers.
  • Lazily bootstrap a missing first-party OPY provider from opy-rs GitHub Releases.
  • Verify downloaded artifacts and activate installs atomically.
  • Reuse installed providers offline.
  • Provide an explicit update path without automatic update polling on normal source commands.
  • Feed the resolved executable into the existing Wright LPP runtime / ProviderRegistry.
  • Support migration from the static OPY integration to the Converge source-language workflows on an explicit provider boundary #243 provider-backed product path.
  • Validate the design against a pinned Bastion or Overwatch-AI-PVE workflow before generalizing it.

Non-goals

  • No npm/crates.io-style registry or package index.
  • No dependency solver or transitive provider dependency graph.
  • No wright.lock or project-level provider lockfile/state.
  • No generic plugin ABI or dynamic-library/FFI framework.
  • No provider marketplace or third-party discovery service.
  • No runtime/dynamic replacement for Wright's direct workshop-rs dependency.
  • No periodic/TTL provider update checks during normal source commands.
  • No LPP redesign for downloading, version selection, or installation.
  • No OPY/DEL semantics or project discovery in Wright.
  • No DEL/OSTW provider implementation in Make Wright CLI CI-ready for real Workshop and OverPy projects #242.
  • No speculative distribution abstraction for future provider ecosystems.

Acceptance criteria

  • Ordinary opy-rs implementation/provider releases do not require a Wright release.
  • workshop-rs remains Wright's direct stable canonical Workshop dependency.
  • opy-rs owns and publishes the first-party OPY provider artifact.
  • Wright resolves an OPY provider through explicit local configuration, installed active provider, or lazy first-use bootstrap, in that precedence order.
  • Raw Workshop and unrelated workflows perform no OPY provider network or process work.
  • A downloaded provider is verified before activation; failed/partial installs cannot become active.
  • An installed provider can be reused with no network access.
  • Missing provider/offline/bootstrap failures are explicit and do not silently select the static OPY implementation.
  • Normal source commands do not poll for updates; provider update is an explicit action.
  • Distribution metadata does not duplicate LPP runtime capability/protocol negotiation.
  • Provider resolution produces a local executable consumed by the existing LPP runtime / ProviderRegistry rather than introducing another execution abstraction.
  • No project-level lockfile, registry/index service, dependency solver, or provider dependency graph is introduced.
  • A pinned Bastion or Overwatch-AI-PVE workflow validates lazy install plus provider-backed execution before the pattern is copied to DEL/OSTW.
  • Independent design ablation confirms that versioned local storage, active selection state, artifact integrity metadata, and any other retained distribution state are required by the approved OPY workflow.

Dependencies / ownership

Readiness

Design direction is resolved and implementation can proceed. Keep the first implementation OPY-specific and small; generalize only after the pinned real-project workflow demonstrates a repeated need.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions