Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/wright-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-analyzer"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-bench"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-cli"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-consumer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-consumer"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-core"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-driver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-driver"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-ir/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-ir"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-language/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-language"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-lpp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-lpp"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-lsp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-lsp"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-opy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-opy"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-ostw/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-ostw"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/wright-transform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "wright-transform"
publish = false
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 25 additions & 2 deletions docs/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 3 additions & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 22 additions & 0 deletions scripts/verify-dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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))
Expand Down