Skip to content

Add executable provider runtime artifact contract - #1250

Open
i386 wants to merge 2 commits into
jd/experimental-apple-runtimefrom
jd/apple-provider-artifact
Open

Add executable provider runtime artifact contract#1250
i386 wants to merge 2 commits into
jd/experimental-apple-runtimefrom
jd/apple-provider-artifact

Conversation

@i386

@i386 i386 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Experimental stacked change

This is the 2A provider artifact layer of the experimental Apple runtime roadmap in #1246.

  • Stacked on Add experimental Apple runtime #1249; review and merge that PR first.
  • Base branch: jd/experimental-apple-runtime
  • This is experimental and is not connected to production model gossip, mesh routing, or the public OpenAI frontend.
  • Trying the Apple runtime requires Apple silicon, macOS Golden Gate (macOS 27), full Xcode 27 selected with xcode-select, Apple Intelligence enabled, and the system model downloaded.

Why this layer exists

MeshLLM already has native runtime artifacts for backend libraries selected against the Skippy ABI. An Apple system-model integration is a different shape: it is a signed executable provider with its own process boundary, protocol version, model identities, platform requirements, entitlements, and lifecycle.

This PR gives executable providers a provider-neutral package, resolution, verification, download, and immutable-cache contract before the host supervisor and SDK bindings are added. Apple is the first consumer, but the contract does not embed Foundation Models semantics.

What changes

  • Adds the publishable mesh-llm-provider-runtime crate.
  • Defines schema-v1 provider-runtime.json bundle manifests and provider-runtimes.json release indexes.
  • Selects artifacts by OS/architecture/minimum OS, artifact/provider/protocol/model selector, semantic version, and source priority.
  • Supports in-place bundles, immutable cache installs, and verified HTTP ZIP downloads.
  • Enforces safe relative paths, payload and ZIP symlink rejection, SHA-256 verification, executable entrypoints, bounded archives, unique coordinates/model IDs, and exact release-index/payload agreement.
  • Keeps cache coordinates immutable at <cache>/<artifact-id>/<version>/<os>-<arch>/.
  • Updates Apple packaging to emit and validate the shared contract, ZIP/checksum sidecars, a release index, and descriptive signing metadata.
  • Proves that the same artifact survives CLI, Swift bundle, Node package, and JVM resource carrier layouts.
  • Routes the new crate through affected-crate, Clippy, SDK-smoke, publication, Docker/Fly, and CI consistency inventories.
  • Documents the contract in docs/design/PROVIDER_RUNTIMES.md.

This layer deliberately does not launch or supervise the provider, bind it into SDK lifecycle APIs, or advertise it across a mesh. Those are the next stacked changes.

Try it

From the repository root:

  1. Confirm the Golden Gate developer environment:

    xcode-select -p
    xcodebuild -version
    xcrun --sdk macosx --show-sdk-version

    The selected path must be full Xcode/Xcode beta and the SDK must be 27.x.

  2. Build the carrier-neutral Apple provider artifact:

    just apple::package
  3. Validate provider-runtime.json, every declared file digest, and the executable bit using the shared Rust contract:

    just apple::contract
  4. Exercise the same artifact in every planned SDK carrier layout:

    just apple::carriers

    Expected summary:

    {
      "carriers": [
        "cli_runtimes_apple",
        "jvm_ai_meshllm_apple-runtime_macos-arm64_runtime",
        "node_node_modules__mesh-llm_apple-runtime-darwin-arm64_runtime",
        "swift_MeshLLMAppleRuntime.bundle_Contents_Resources_runtime"
      ],
      "status": "pass"
    }
  5. To exercise the experimental parent runtime itself:

    just apple::run status
    just apple::run serve --port 11435

    In another terminal:

    curl -s http://127.0.0.1:11435/v1/models | jq
    just apple::rest

    The parent PR's providers/apple/README.md includes captured Golden Gate output for a buffered completion, SSE streaming, usage accounting, and a REST tool execution.

Generated artifacts are under target/apple-runtime/package/, including the bundle, ZIP, SHA-256 sidecars, and provider-runtimes.json.

Validation

  • just build
  • just with-lld cargo fmt --all -- --check
  • just with-lld cargo test -p mesh-llm-provider-runtime — 11 passed
  • just with-lld cargo clippy -p mesh-llm-provider-runtime --all-targets -- -D warnings
  • just with-lld cargo package -p mesh-llm-provider-runtime --allow-dirty --no-verify
  • just apple::carriers — CLI, Swift, Node, and JVM carrier layouts passed
  • actionlint -config-file .github/actionlint.yaml
  • shellcheck providers/apple/Packaging/package.sh providers/apple/QA/carriers.sh
  • repo-consistency: ci-crate-lists, publish-crates, and release-targets
  • python3 scripts/tests/test_publish_crates.py — 9 passed

Next stack

2B will add the Rust host supervisor: resolve the artifact, enforce platform signing policy, launch and health-check the sidecar, forward requests, drain it, and terminate it with the owning MeshLLM instance. Later changes will bind that lifecycle into Rust, Swift, Node/Electron, and Kotlin/JVM before private-mesh routing is enabled.

Closes no issue; advances #1246.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 65678510-fe93-41f5-96f0-d75f565684ec

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@i386
i386 force-pushed the jd/apple-provider-artifact branch from d178ace to 6811dd0 Compare August 19, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant