Skip to content

test(extension): qualify the MEP 0.2.0-draft.1 model line and prepare 0.6.0 - #80

Merged
DamianReeves merged 3 commits into
mainfrom
DamianReeves/mep-0-2
Nov 1, 2026
Merged

DamianReeves merged 3 commits into
mainfrom
DamianReeves/mep-0-2

Conversation

@DamianReeves

Copy link
Copy Markdown
Member

Summary

Extension 0.5.0 (released 2026-10-28, PR #54) already declares MEP 0.2.0-draft.1 and keeps 0.1. It serves morphir.frontend.compileModel and morphir.backend.generateModel, with claims version 0.1.0-draft.2. This PR adds the tests and the host qualification that were missing, and prepares release 0.6.0 with the current dependencies (Ruff 0.0.20). The protocol, claims and tuples do not change.

OpenSpec change: openspec/changes/qualify-mep-model-line · bead morphir-ukvn.1.6.9

Model transport tuples

Operation Profile Codec Envelope IR
morphir.frontend.compileModel morphir-ir morphir-json 0.1.0-draft.1 3.0.0, 4.0.0
morphir.backend.generateModel morphir-ir morphir-json 0.1.0-draft.1 3.0.0, 4.0.0

Ion: not offered. The extension advertises no Ion tuple. It refuses Ion payloads and Ion evidence on WASM and native alike, and it never converts Ion to JSON.

Changes

  • model_session.rs: tests for a host that prefers Ion and also offers JSON (the guest agrees on JSON in the host's order, as test(rust): show the guest negotiates an advertised model format morphir-gleam#31 does); an Ion-only host (no model tuple, no conversion, 0.1 compile still works); compile admission that does not grant generation; wrong envelope version in the output tuple, the input tuple and the model.
  • model_golden.rs and tests/golden/: golden envelopes, exact payload bytes and generated files for compileModel and generateModel at IR 3.0.0 and 4.0.0, through a negotiated session. Each payload file's SHA-256 equals the envelope digest. MORPHIR_UPDATE_GOLDEN=1 writes them again. The files are -text in .gitattributes and excluded from the whitespace hooks.
  • model_transport.rs: wrong envelope version refusals on the direct path.
  • morphir-python-extension/tests/session.rs: the process executable runs both model operations in a 0.2.0-draft.1 session and exits by itself.
  • morphir-python-binding 0.6.0.
  • OpenSpec: python/model-transport gains the "Host default not supported" and "Host offers only formats the extension does not serve" scenarios.

Qualification

MoonBit worker host, finos/morphir-moonbit main 40623b8 (clean), macOS arm64, native CLI and npm CLI (Node v24.22.1). Contract 0.2.0 pins:

Run Rows Result
mise run test:cli-extism-python (MEP 0.1 path, Python 0.4.1 and 0.4.2) 32 all passed
Candidate 0.6.0 model line, WASM (82c5d35e…) and process executable, both CLIs 32 all passed
Published 0.5.0 WASM, same model line IR 4 rows passed, same payload digest

The model-line rows check:

  • describe: protocols 0.1 and 0.2.0-draft.1, and the JSON 4.0.0 tuples.
  • Model compile at IR 4: negotiates 0.2.0-draft.1 and the tuple morphir-ir/morphir-json/0.1.0-draft.1/4.0.0, and model.json is the payload (78b00954…).
  • Model generate, a consumer check of the generated Python, and a recompile to the same model.json bytes.
  • A refusal of a wrong envelope version.
  • Equal npm and native outputs.
  • Worker stop with an acknowledged shutdown and code 0. The stop method is exited-after-exit, except for WASM on the npm CLI, where it is thread-termination, the host's documented stop method for a Node worker thread.

finos/morphir Rust host 0.4.0-beta.10 (MEP 0.1, the compatibility pin): mise run extension:bundle with the candidate passes the offline v3 and v4 round trips and the installed-integrity check.

Local checks: mise run rust:check and mise run check pass (2639 tests, 34 BDD scenarios).

Finding (host, not changed here)

The MoonBit CLI selects the model line for any guest that declares 0.2.0-draft.1, and then it refuses --ir-version 3 ("a model compile returns IR 4.0.0", apps/morphir/cli/extension.mbt:841). With 0.4.2 the host compiled IR 3 on MEP 0.1. The Python guest still offers IR 3.0.0 tuples and the 0.1 compile method. This PR does not change that host. The finding is tracked as bead morphir-oeas.

Release plan

After CI is green: a manual Release workflow run (dry run) on this branch. After maintainer approval: merge, then tag extension/python/v0.6.0 at the reviewed commit. The release keeps its current shape: WASM and five process executables, release.json descriptors, .sha256 files, attestations, MCK reports and SHA256SUMS. finos/morphir keeps its extension/python/v0.4.2 pin. Its bundle pins move in a separate PR.

The published CLI morphir-python 0.1.2 keeps compiler 0.5.0 until there is a native and CLI release. That release is not part of this PR.

… 0.6.0

Extension 0.5.0 already serves morphir.frontend.compileModel and
morphir.backend.generateModel on MEP 0.2.0-draft.1 and keeps 0.1. Add the
tests that it lacked:

- a host that prefers Ion but also offers JSON agrees on JSON;
- a host that offers only Ion gets no model tuple and keeps 0.1 compile;
- compile admission does not grant generation;
- a wrong envelope version is refused in each direction;
- golden envelopes, exact payload bytes and generated files for IR 3.0.0
  and 4.0.0 through a negotiated session;
- the process executable serves both model operations and stops by itself.

Keep the golden files byte-exact (no line-ending conversion, no
whitespace hooks). Set the compiler crate to 0.6.0 for the release with
Ruff 0.0.20 and the current dependencies. Add the OpenSpec change
qualify-mep-model-line with the host-default scenario.
… line

The candidate passes describe, model compile, generate, consumer check and recompile from the native and npm CLIs as WASM and process guests. Record that the host refuses IR 3 on the model line and that a WASM worker on the npm CLI stops by thread termination.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T03:02:18.753352Z 93dafdd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Refusals now assert the JSON-RPC code and reason: -32013 for an operation the session did not negotiate and -32602 unsupported_tuple for a wrong envelope version. The compile-only and wrong-envelope tests first show the unchanged generate request succeeds, so a malformed request cannot pass as a refusal.
@DamianReeves

Copy link
Copy Markdown
Member Author

Review findings and release dry run

The review findings were checked one by one:

  • Fixed in d70053a. Refusal tests now assert the exact JSON-RPC code and reason: -32013 for "not negotiated", and -32602 for unsupported_tuple. Each one first shows that the unchanged request succeeds.
  • Rejected after a check.
    • "-text makes golden diffs binary": git diff still shows text.
    • The payload helper's decode limit: the helper decodes only a payload that the session already accepted.

CI is green at d70053a.

Release dry run. Run 41267831018 at d70053a succeeded:

  • five native wheels;
  • the process candidate set, with MCK reports and rechecks on five platforms;
  • the extension bundle candidate.

Every publish job was skipped.

Dry-run asset SHA-256
morphir-python-binding-0.6.0.wasm ce0cba07f0395ff8179b42eb021ade05c68197f69b8e9c0c8bc369d2a035727c
morphir-python-binding-0.6.0.release.json df3211f4d8e63ae4b50c2ff614f49e6d849991d6f33513cbd63c3127cc450164
morphir-python-extension-0.6.0.release.json 662cf407075ad9d46bcec8296b3fc154c712d2a08c9e623f2c92aab036f07e53
morphir-python-extension-0.6.0.tar.gz 8ecbe7fb7b5e41946109dae45afa2ec1c116e0231e751f884f9c9a8d4753fb95

MoonBit worker host, dry-run bytes. finos/morphir-moonbit main 40623b8, macOS arm64. The dry-run WASM and the dry-run aarch64-apple-darwin process executable passed 32 of 32 model-line rows from the native and npm CLIs.

Merge and the extension/python/v0.6.0 tag wait for maintainer approval.

@DamianReeves
DamianReeves merged commit 560a650 into main Nov 1, 2026
39 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