Skip to content

fix(rust): vendor repo data so the metaobjects crate packages and builds on its own - #614

Merged
dmealing merged 3 commits into
mainfrom
fm/mo-1-3-0-rc-verify
Nov 20, 2026
Merged

dmealing merged 3 commits into
mainfrom
fm/mo-1-3-0-rc-verify

Conversation

@dmealing

@dmealing dmealing commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

1.3.0 release-candidate verification

Release SHA: 882f58c63c4add2c4f925f562a021657c2b3017b (main). Nothing published, no version bumped.

Check Result
scripts/ci-local.sh --strict-toolchains (full, every lane) pass (33m52s)
npm quickstart (README), clean node:22 container, 14 packed 1.3.0 tarballs: meta --version, init, gen --list --probe, eject entity queries names barrel, gen, verify --codegen, tsc --noEmit, npm audit pass, 0 vulnerabilities
Same with pnpm (needs @metaobjectsdev/metadata, codegen-ts, runtime-ts declared directly, as the docs say) pass
Python 1.3.0 wheel + sdist in clean python:3.12: load_directory, metaobjects CLI pass
C#, Java, Kotlin covered by the green ci-local lanes; not re-run as separate clean-container quickstarts
Rust cargo package with verification, metaobjects failed before this PR (the tarball did not compile: include_str! reached outside the crate); passes with it
Rust cargo publish --dry-run on a scratch copy with publish flipped on (the repo keeps publish = false) metaobjects passes
metaobjects-codegen, metaobjects-cli dry run / package cannot run until metaobjects is on crates.io (they depend on it by version); path deps now carry version = "0.1.0"

This PR is the fix for the Rust packaging failure. no-mistakes took 1 run.

What Changed

  • Vendors the repo files the metaobjects crate embeds (spec/metamodel/*.json, fixtures/conformance/ERROR-CODES.json, library/) as byte-identical copies under server/rust/metaobjects/data/. providers.rs, errors.rs, build.rs and the validate/* test fixtures now read from data/, so cargo package sees everything the build needs.
  • Adds tests/vendored_data_parity.rs, which fails when a copy differs from its source or when the library file counts diverge. It names the cp / rsync command that fixes the drift. Outside the repository it passes without comparing.
  • Adds version = "0.1.0" to the path dependencies in metaobjects-cli and metaobjects-codegen, so the workspace crates resolve when packaged. Amends ADR-0065 with Amendment 2, which records the vendoring rule.
Validation

Risk Assessment

✅ Low: Mechanical vendoring of embedded data into the Rust crate so it packages standalone. The copies are byte-identical to their sources, and a new parity test guards against drift. Nothing publishes and no version changes.

Testing

The change lets the metaobjects Rust crate package and build alone. Vendored data parity test passes, cargo package verifies the extracted tarball, and a scratch consumer built from that tarball loads the shipped ai and iam libraries. Two scenarios pass live. The Rust publish dry run is untested: all three crates set publish = false, so cargo refuses it, and codegen/cli verify needs metaobjects on crates.io. That needs Doug's decision. Broad regression came from the configured test command scripts/ci-local.sh --affected --strict-toolchains, which passed at the target commit. No source changed this turn, so it did not run again.

  • Live validation: ✅ go - 2 of 3 scenarios driven live against the product
Scenario Result Live Evidence
metaobjects crate packages and its tarball compiles on its own (cargo package verify) ✅ pass live (validation evidence) (cargo package -p metaobjects: packaged 86 files incl. 30 under data/, verify compile of extracted tarball EX…
packaged metaobjects embeds shipped libraries and loads them through its public API from outside the repo ✅ pass live Scratch consumer crate in DEV_SCRATCH, path dep on target/package/metaobjects-0.1.0; output: libraries=["ai","iam"], iam_sources=2 (library:iam/model.yaml, library:iam/requirements.yaml) (also in evid…
publish dry run on the Rust crates (metaobjects, metaobjects-codegen, metaobjects-cli) ⏸️ untested no Blocked by intent: all three crates set publish = false, so cargo refuses the dry run. codegen and cli verify also needs metaobjects on crates.io. Not run with publish flipped, because that changes pu…
Evidence: Rust packaging and consumer evidence log for 2b539bf
# Target 2b539bfbc: fix(rust) metaobjects crate packages and builds on its own
$ cargo test -p metaobjects --test vendored_data_parity            -> ok (1 passed)
$ cargo package -p metaobjects --list                             -> 86 files, 30 under data/
$ cargo package -p metaobjects                                    -> Packaged 86 files; Verifying ... Finished  (EXIT 0)
$ scratch consumer (path dep on target/package/metaobjects-0.1.0), run:
    libraries=["ai", "iam"]
    iam_sources=2 (library:iam/model.yaml, library:iam/requirements.yaml)
$ cargo publish --dry-run -p metaobjects                          -> refused: publish = false (EXIT 101)
$ cargo publish --dry-run -p metaobjects-codegen                  -> refused: publish = false (EXIT 101)
$ cargo publish --dry-run -p metaobjects-cli                      -> refused: publish = false (EXIT 101)
$ cargo package -p metaobjects-codegen --list                     -> lists files (EXIT 0)
$ cargo package -p metaobjects-codegen                            -> verify fails: no matching package named `metaobjects` on crates.io (EXIT 101)
  • Outcome: ⚠️ 2 issues (1 warning, 1 info) across 1 run (2m25s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 2 issues (1 warning, 1 info)
  • ⚠️ server/rust/metaobjects/Cargo.toml:10 - cargo publish --dry-run cannot run on metaobjects, metaobjects-codegen or metaobjects-cli: all three set publish = false ("first crates.io release is a separate, approved step"). The intent asks for a publish dry run on the Rust crates. Options: (a) temporarily flip publish on for the dry run only, (b) accept cargo package verify on metaobjects as the proxy and dry-run codegen/cli after metaobjects is on crates.io. Needs Doug's call; no edit made.
  • ℹ️ server/rust/metaobjects-codegen/Cargo.toml:14 - cargo package -p metaobjects-codegen verify fails with "no matching package named metaobjects found" on crates.io. Expected per the commit (codegen and cli need metaobjects published first). Not a regression.
  • Live validation: ✅ go - 2 of 3 scenarios driven live against the product
Scenario Result Live Evidence
metaobjects crate packages and its tarball compiles on its own (cargo package verify) ✅ pass live (validation evidence) (cargo package -p metaobjects: packaged 86 files incl. 30 under data/, verify compile of extracted tarball EX…
packaged metaobjects embeds shipped libraries and loads them through its public API from outside the repo ✅ pass live Scratch consumer crate in DEV_SCRATCH, path dep on target/package/metaobjects-0.1.0; output: libraries=["ai","iam"], iam_sources=2 (library:iam/model.yaml, library:iam/requirements.yaml) (also in evid…
publish dry run on the Rust crates (metaobjects, metaobjects-codegen, metaobjects-cli) ⏸️ untested no Blocked by intent: all three crates set publish = false, so cargo refuses the dry run. codegen and cli verify also needs metaobjects on crates.io. Not run with publish flipped, because that changes pu…
  • scripts/ci-local.sh --affected --strict-toolchains
  • cargo test -p metaobjects --test vendored_data_parity (in server/rust) — passes against real repo sources (spec/metamodel and library/ present, so the early return is not taken)
  • cargo package -p metaobjects --list — 86 files, 30 under data/
  • cargo package -p metaobjects — packages and verify-compiles the extracted tarball (EXIT 0)
  • scratch consumer crate in DEV_SCRATCH with path dep on target/package/metaobjects-0.1.0; cargo run prints libraries [ai, iam] and iam core sources (EXIT 0)
  • cargo publish --dry-run -p metaobjects|metaobjects-codegen|metaobjects-cli — all refused, publish = false (EXIT 101 each)
  • cargo package -p metaobjects-codegen --list (EXIT 0) and cargo package -p metaobjects-codegen (verify fails, EXIT 101: metaobjects not on crates.io)
  • Cleanup: removed target/package, the scratch consumer crate and target; worktree git status clean
  • Broad regression: configured test command scripts/ci-local.sh --affected --strict-toolchains already passed at target commit (baseline). Not re-run; no source or test files changed in this turn.
🔧 **Document** - 4 issues found → auto-fixed ✅
  • ⚠️ server/rust/metaobjects/build.rs:1 - Module doc said it embeds the repo-root library/ tree and that an absent directory yields an empty embed. The change now embeds the vendored data/library/ copy, which ships in the packaged crate. Fixed: the header now names data/library/ and the parity test; the absent-directory sentence was removed.
  • ⚠️ server/rust/metaobjects/src/providers.rs:1 - Module doc said the module embeds spec/metamodel/*.json directly. It now embeds the copies under data/metamodel/. Fixed: the doc names the copies and the parity test.
  • ⚠️ server/rust/metaobjects/src/errors.rs:3 - Module doc said the test reads the fixture file. It now reads data/ERROR-CODES.json. Fixed: the doc names the copy and the parity test.
  • ℹ️ spec/decisions/ADR-0065-rust-is-the-sixth-port.md:31 - Judgment call, not fixed. The crate now vendors byte-identical copies of spec/metamodel, fixtures/conformance/ERROR-CODES.json and library/ under server/rust/metaobjects/data/, held by tests/vendored_data_parity.rs. ADR-0065's layout section records none of this, and the decision is cross-cutting: it duplicates the single-source pattern the C# port also uses. Doug should decide whether to record it as an ADR-0065 amendment. Related: the parity test's failure message says only copy it again and gives no command. Changing that message is executable behavior, so it is out of scope for this doc phase.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

The crate embedded the metamodel JSON, the shared error catalogue and the shipped
libraries from outside its directory, so the packaged tarball did not compile (and
would have embedded no libraries). Vendor them under data/ with a byte-parity test
against the source copies, and give the codegen and cli path dependencies a version
requirement so they can be packaged once metaobjects is on crates.io.
@dmealing
dmealing merged commit 59bc5ed into main Nov 20, 2026
10 checks passed
@dmealing
dmealing deleted the fm/mo-1-3-0-rc-verify branch November 20, 2026 05:48
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