Skip to content

ADR 0004: resolve mux-runtime from source, freeze crates.io - #32

Merged
DerekCorniello merged 7 commits into
mainfrom
adr/runtime-resolved-from-source
Jul 29, 2026
Merged

ADR 0004: resolve mux-runtime from source, freeze crates.io#32
DerekCorniello merged 7 commits into
mainfrom
adr/runtime-resolved-from-source

Conversation

@DerekCorniello

@DerekCorniello DerekCorniello commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Records the decision the other three PRs implement, so it lands first.

Why

ADRs 0002 and 0003 disagreed about what is authoritative for the runtime. 0002 had the compiler pin a semver range on a published mux-runtime, so a coupled change shipped publish-first. 0003 then had CI build from sibling source, so a coupled change went green without a publish. The seam between them is what produced the [patch.crates-io] block in mux-compiler, and with it a release-checklist item and a publish handshake for every coupled change - the loose thread behind muxlang/mux-runtime#26 and muxlang/mux-compiler#316.

Two findings drove the direction:

  • The compiler never used mux-runtime as a Rust library. Zero mux_runtime:: references. The dependency existed only to stage source where the compiler could find it.
  • crates.io was the highest-friction install channel, not the lowest. cargo install mux-lang needs a Rust toolchain plus the exact LLVM 22 development libraries, then compiles llvm-sys from scratch. The documented install path is the prebuilt installer, which needs none of that.

What 0004 decides

  • mux-runtime is a git dependency on main, pinned to one commit by Cargo.lock, so --locked builds stay reproducible. This extends 0003's "verify against source" from CI to release.
  • The compiler always links the full prebuilt runtime and never builds one while compiling a program. Measured: static linking already discards unreferenced archive members, so hello world is 16K against a feature-trimmed runtime and 16K against the full one.
  • crates.io is frozen - existing versions stay published and are not yanked, no new ones.
  • Automating the pin was considered and rejected: both repos' CI already build against the other's main, so an FFI break surfaces without the pin moving.

Supersedes 0002's release-time publish ordering; independent versioning otherwise stands.

Also in this PR

release-process.md rewritten for the no-publish flow, ARCHITECTURE.md and README.md corrected (they described a crates.io pin and mux --version, a flag clap rejects), and SKILL.md - the canonical copy of the mux agent skill - updated, since it still documented a runtime build cache and MUX_RUNTIME_FEATURES that no longer exist.

Review order

This one, then muxlang/mux-compiler (the implementation), then mux-runtime and mux-website (docs describing what now exists).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

0002 and 0003 disagreed about what is authoritative for the runtime.
0002 had the compiler pin a semver range on a published mux-runtime, so
a coupled change shipped publish-first; 0003 then had CI build from
sibling source so a coupled change went green without a publish. The seam
between them is what produced the [patch.crates-io] block in
mux-compiler, and with it a release-checklist item and a publish
handshake for every coupled change.

0004 settles it in 0003's direction and extends it to release time: the
runtime is a git dependency pinned to one commit by Cargo.lock, and the
crates.io channel is frozen rather than yanked. Two findings drove it -
the compiler has zero mux_runtime:: references, so the dependency was
only ever a source-delivery mechanism; and cargo install was the
highest-friction install path, needing a Rust toolchain plus exact LLVM
22 dev libraries, while the documented path is the prebuilt installer.

Mark the superseded ordering in 0002, rewrite the release process (the
mux-runtime section no longer describes a publish), and correct the
ARCHITECTURE dependency graph and repo table, which both still described
a crates.io pin.
It solved a problem already covered three ways. mux-runtime's CI builds
mux-compiler main against the runtime source, and mux-compiler's build.yml
tests against runtime main on every PR, so an FFI break surfaces from both
directions without the pin moving (ADR 0003). A coupled change moves the
pin itself via `cargo update -p mux-runtime`, and a release settles it
deliberately. A lock that trails runtime main between those moments costs
nothing - that is what a lock is for.

What remained was a daily CI run, PR noise, and a token question, for
freshness nothing was waiting on. Record the rejection in ADR 0004 so it
is not re-proposed.
Feature-trimmed runtimes were measured to buy nothing - static linking
already discards unreferenced archive members, so hello world is 16K
either way - while costing a build cache, source lookups, and a
five-level resolution order that hid a broken release from every
developer machine.

Restate the version stamp's purpose too: with the source-build cache
gone it identifies which runtime a binary was built against, rather than
keying a cache.
It still listed the three source lookups the compiler used to try - a
sibling checkout, MUX_RUNTIME_SRC, and cargo's git checkout for the
locked commit - all removed with the source-build path in ADR 0004. The
compiler links a prebuilt archive and never builds one while compiling a
program.
Same caveat the compiler's CONTRIBUTING, AGENTS, and the website install
docs now carry. Cargo emits a dependency's rlib and never its staticlib,
so describing the library as simply "built by cargo into target/" is the
wording that led to a compiler which could not link anything.
SKILL.md is the canonical copy of the mux agent skill, and it still
described the rc-leak-check trap as a stale runtime in ~/.cache/mux-lang
selected by MUX_RUNTIME_FEATURES. Neither exists: there is no build cache
and no feature selection. Replace it with what an agent actually needs -
the three prebuilt sources, the cargo build -p mux-runtime requirement,
MUX_RUNTIME_LIB overriding everything, and why leak-check.sh forces it.

ARCHITECTURE still described the runtime link as an independent semver
pin reported by `mux --version`, a flag clap rejects.
Comment thread ARCHITECTURE.md Outdated
Comment thread docs/release-process.md Outdated
@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown

Greptile Summary

Records the decision to resolve mux-runtime from source and freeze crates.io releases.

  • Adds ADR 0004 and marks ADR 0002’s publish-ordering decision as superseded.
  • Aligns architecture and agent guidance with prebuilt-runtime lookup and linking.
  • Rewrites release guidance around lockfile-pinned runtime commits and no-publish releases.
  • Corrects repository and CLI-version documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the runtime lookup documentation now includes the sibling library layout, and the release procedure requires the changelog entry to land with the runtime change.

Important Files Changed

Filename Overview
docs/decisions/0004-runtime-resolved-from-source.md Introduces the source-resolution and crates.io-freeze decision, including runtime linking, pinning, and release consequences.
docs/release-process.md Replaces registry publishing with lockfile pin settlement and now requires runtime changelog entries in the change PR before merge.
ARCHITECTURE.md Updates runtime dependency, prebuilt-library lookup, installation layout, and version-reporting documentation.
SKILL.md Replaces obsolete runtime-cache guidance with the current prebuilt-runtime resolution and leak-check workflow.
docs/decisions/0002-independent-versioning.md Clearly marks the obsolete runtime publishing sequence as superseded while retaining independent versioning.
README.md Updates the runtime repository description to reflect its lockfile-pinned git dependency.
docs/decisions/README.md Adds ADR 0004 to the decision index and states its relationship to ADR 0002.

Reviews (2): Last reviewed commit: "Address PR review: align the resolution ..." | Re-trigger Greptile

Two findings from Greptile on #32.

ARCHITECTURE and ADR 0004 described the release-install case as the
library sitting beside the binary, omitting the sibling `lib/` that
SKILL.md documents and that scripts/install.sh actually produces. Three
canonical documents describing the same search should not disagree about
where it looks, particularly when one prebuilt library can shadow
another. Both now name the same two locations.

The mux-runtime steps had the changelog entry follow the merge, which
makes it a separate change and leaves a window where main carries code
with no record of it. With no version tags that entry is the only
history, so it now lands in the same PR as the change.
@sonarqubecloud

Copy link
Copy Markdown

@DerekCorniello
DerekCorniello merged commit 90f4956 into main Jul 29, 2026
4 checks passed
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.

1 participant