diff --git a/crates/wright-analyzer/Cargo.toml b/crates/wright-analyzer/Cargo.toml index d70e22f..63a95c9 100644 --- a/crates/wright-analyzer/Cargo.toml +++ b/crates/wright-analyzer/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-analyzer" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-bench/Cargo.toml b/crates/wright-bench/Cargo.toml index b25c9c6..2e4b1f9 100644 --- a/crates/wright-bench/Cargo.toml +++ b/crates/wright-bench/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-bench" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-cli/Cargo.toml b/crates/wright-cli/Cargo.toml index ffeb10f..3d2b33b 100644 --- a/crates/wright-cli/Cargo.toml +++ b/crates/wright-cli/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-cli" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-consumer/Cargo.toml b/crates/wright-consumer/Cargo.toml index 1860e98..7364864 100644 --- a/crates/wright-consumer/Cargo.toml +++ b/crates/wright-consumer/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-consumer" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-core/Cargo.toml b/crates/wright-core/Cargo.toml index 75e432b..deb8b9e 100644 --- a/crates/wright-core/Cargo.toml +++ b/crates/wright-core/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-core" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-driver/Cargo.toml b/crates/wright-driver/Cargo.toml index 4d5d16a..1e856ad 100644 --- a/crates/wright-driver/Cargo.toml +++ b/crates/wright-driver/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-driver" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-ir/Cargo.toml b/crates/wright-ir/Cargo.toml index 7b1686f..a29dc25 100644 --- a/crates/wright-ir/Cargo.toml +++ b/crates/wright-ir/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-ir" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-language/Cargo.toml b/crates/wright-language/Cargo.toml index d41bb62..9e93bf4 100644 --- a/crates/wright-language/Cargo.toml +++ b/crates/wright-language/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-language" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-lpp/Cargo.toml b/crates/wright-lpp/Cargo.toml index 8b16a74..9f35d80 100644 --- a/crates/wright-lpp/Cargo.toml +++ b/crates/wright-lpp/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-lpp" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-lsp/Cargo.toml b/crates/wright-lsp/Cargo.toml index 7b6da2d..ea1c1e7 100644 --- a/crates/wright-lsp/Cargo.toml +++ b/crates/wright-lsp/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-lsp" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-opy/Cargo.toml b/crates/wright-opy/Cargo.toml index 379b036..f0a53a8 100644 --- a/crates/wright-opy/Cargo.toml +++ b/crates/wright-opy/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-opy" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-ostw/Cargo.toml b/crates/wright-ostw/Cargo.toml index 9d1ac7e..b4d234e 100644 --- a/crates/wright-ostw/Cargo.toml +++ b/crates/wright-ostw/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-ostw" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/crates/wright-transform/Cargo.toml b/crates/wright-transform/Cargo.toml index 80fdb01..cc69c14 100644 --- a/crates/wright-transform/Cargo.toml +++ b/crates/wright-transform/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "wright-transform" +publish = false version.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/docs/architecture.md b/docs/architecture.md index 89615fa..655a9f8 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -81,6 +81,11 @@ Language repositories own source parsing, semantics, lowering, diagnostics, and compatibility evidence. Wright adapters translate those owner contracts into driver results and do not become a second implementation. +The workspace Cargo packages are internal implementation boundaries for the +Wright product. They are explicitly non-publishable; the binary/package-manager +release flow does not imply a stable crates.io contract for `wright-core`, +`wright-ir`, `wright-driver`, or the language adapters. + ## Source-form integrations ### Raw Workshop diff --git a/docs/embedding.md b/docs/embedding.md index 5213047..11eee31 100644 --- a/docs/embedding.md +++ b/docs/embedding.md @@ -18,10 +18,33 @@ safe source-edit contracts, and the transport adapters | `wright-serve` stdio/JSON-RPC adapters | **stable** | Thin mappings over `ToolService`; MCP not implemented (no agent evidence) | | `wright-transform` passes | experimental per pass | Only evidence-backed passes ship in `compat`; `aggressive` is an explicit experimental marker | +The Rust packages in this workspace are implementation packages for the Wright +product, not a crates.io distribution surface. They are explicitly marked +`publish = false`; the current public release flow is the CLI/LSP binary and +package-manager distribution. A separately reviewed Rust embedding package +would require an intentional public API and publication decision. + +## Source-language owner boundary + +`wright-opy` and `wright-ostw` are narrow Wright adapters. Their target +boundary is the released `opy-rs` and `deltin-rs` owner APIs for +source-language parsing, semantic behavior, compiler/lowering behavior, +diagnostics, and reconstruction. Wright adapters may translate those contracts +into driver results and compose them with canonical `workshop-rs` WIR/catalog +APIs for Wright-owned analysis, conversion, and emission. They must not depend +on source-language CLI packages, private compiler packages, or recreate owner +behavior locally. + +The migration is release-coordinated: if an owner contract is not yet +available in a consumable release, the adapter remains on its current released +contract until the owner release and the canonical Workshop dependency are +compatible. It must not introduce a local semantic workaround or a text-based +compatibility layer just to bypass that coordination boundary. + ## Embedding contract -External consumers depend on `wright-driver` only (never internal crates, no -CLI subprocess, no text scraping): +Consumers embedding Wright from a checkout depend on `wright-driver` only +(never internal crates, no CLI subprocess, no text scraping): ```rust use wright_driver::{CompilerSession, InputSpec, SessionConfig, SourceKind, Profile}; diff --git a/docs/release.md b/docs/release.md index 2709529..94a5062 100644 --- a/docs/release.md +++ b/docs/release.md @@ -52,7 +52,9 @@ workflow is the single product release path: 1. `release-please-action` maintains one root Release PR for the Wright product. `release-please-config.json` uses the `simple` release type, with `version.txt` and `CHANGELOG.md` as its product-level version and changelog - files. No workspace crate is published to crates.io. + files. No workspace crate is published to crates.io. Every workspace + package explicitly sets `publish = false`, so Cargo package publication + cannot become an accidental release surface. 2. The Release PR updates the shared workspace version, `Cargo.lock`, and the checked-in `dist/` metadata. All workspace crate changes are included in the product changelog decision. diff --git a/scripts/verify-dist.py b/scripts/verify-dist.py index 702a077..d3765f4 100644 --- a/scripts/verify-dist.py +++ b/scripts/verify-dist.py @@ -37,6 +37,27 @@ def workspace_version() -> str: raise SystemExit("wright-cli not found in workspace metadata") +def verify_workspace_packages_are_private() -> None: + metadata = subprocess.run( + ["cargo", "metadata", "--no-deps", "--format-version", "1"], + cwd=REPO_ROOT, + check=True, + capture_output=True, + text=True, + ).stdout + public = [ + package["name"] + for package in json.loads(metadata)["packages"] + if package.get("publish") != [] + ] + if public: + fail( + "workspace packages must set publish = false; " + f"public packages: {', '.join(sorted(public))}" + ) + print("ok: workspace packages explicitly non-publishable") + + def load_generator(): spec = importlib.util.spec_from_file_location( "wright_dist", REPO_ROOT / "scripts" / "update-dist-manifests.py" @@ -54,6 +75,7 @@ def main() -> None: gen = load_generator() version = workspace_version() print(f"workspace version: {version}") + verify_workspace_packages_are_private() with tempfile.TemporaryDirectory() as tmp: generated = gen.generate(version, {}, Path(tmp))