Package Apple provider in macOS products - #1255
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review. |
3e41d21 to
d69d6b8
Compare
|
This pull request has not been updated in at least 5 days. It will be closed after 7 days of inactivity to keep the active review queue current. Please update it within 2 days if the changes are still moving forward. |
|
Collapsed into #1444, which rebases the whole Apple Core AI stack onto current |
Important
Experimental: you must have macOS Golden Gate (macOS 27) on Apple silicon to run this. This does not enable
apple/systemin published releases or advertise it to mesh peers.Stack
apple/system@27.0routing.Why
The supervisor in #1252 can already drive Apple's on-device system model, but a user must point it at a development bundle manually. That is not a product: installers and unpacked releases need to carry one verified sidecar in a stable location, the host must find it without SDK-specific environment variables, and public artifacts must fail closed unless the executable has a real Developer ID signature and accepted Apple notarization.
For eligible Apple silicon users, this moves
apple/systemtoward a zero-checkpoint-download, private, Apple-accelerated inference option that behaves like the same OpenAI-compatible MeshLLM model from every host-capable SDK. Foundation Models stays isolated in one Swift sidecar; the Rust host and SDKs do not link or reimplement Apple's API, and Skippy pipeline parallelism is not involved.What changed
provider-runtimes/apple/<runtime-id>beside the release host and native Metal runtime.product-manifest.jsonwith provider ID, version, kind, protocol, canonical path, complete tree SHA-256, and provider-manifest SHA-256.provider-runtimes/through the existing atomic Unix installer transaction.MESH_LLM_PROVIDER_RUNTIME_BUNDLE_DIRnorMESH_LLM_PROVIDER_RUNTIME_INDEX.notarytoolsubmission, matching manifest/signature identity, and passingspctlassessment before product composition.There is no Apple backward-compatibility path here: the provider uses the mandatory protocol and version metadata introduced by #1252.
Requirements
You must have:
xcode-select; Command Line Tools alone are insufficient.Confirm the environment:
The developer path should end in
Xcode.app/Contents/Developeror the beta equivalent, the SDK should be 27.x, and status should reportapple/system@27.0as available.Try the packaged product
From the repository root:
Build the release host, native Metal runtime, ad-hoc Apple provider, and composed tarball, then run the full product smoke:
Inspect the retained result:
jq . target/apple-runtime/product-qa/summary.jsonThe important discovery evidence is:
{ "provider_discovery": "adjacent_product_bundle", "provider_bundle_override_used": false, "provider_index_override_used": false }To run the composed product manually, extract it:
Start the packaged host. The ad-hoc allowance is only for this local experimental artifact; there is deliberately no provider discovery override:
MESH_LLM_APPLE_PROVIDER_ALLOW_AD_HOC=1 \ ./target/apple-runtime/manual-product/mesh-bundle/mesh-llm \ --log-format json serve \ --port 9337 --console 3131 --headlessSend a completion over MeshLLM REST:
Exercise the deterministic tool path:
Captured Golden Gate output
This output came from the extracted release product, not the direct Swift development server:
{ "status": "pass", "model": "apple/system", "versioned_model": "apple/system@27.0", "provider_discovery": "adjacent_product_bundle", "provider_bundle_override_used": false, "completion_content": "apple runtime REST ready", "tool_executions": [{ "name": "mesh_fixture_lookup", "arguments": {"key": "rest-demo"}, "result": "mesh-fixture-value-for-rest-demo" }], "stream_done": true, "client_disconnect_cancelled": true, "provider_reported_in_management_api": true, "provider_restarted_after_crash": true, "provider_exited_with_meshllm": true }Public signing and notarization
A release operator first stores notarization credentials in Keychain using Apple's
notarytool, then runs:MESH_APPLE_RUNTIME_CODESIGN_IDENTITY="Developer ID Application: Example (TEAMID)" \ MESH_APPLE_RUNTIME_NOTARY_PROFILE=mesh-llm-notary \ just apple::release-product \ v0.72.1 0.1.0 \ https://github.com/Mesh-LLM/mesh-llm/releases/download/v0.72.1/meshllm-apple-runtime-darwin-arm64.zip \ distThe exact provider ZIP is submitted with
--wait; onlyAcceptedproceeds. Composition then independently validates the provider contract, strict code signature, declared/actual team and signing identifiers, andspctlassessment.notarization.jsonrecords the submission result but never credentials.This machine has only the local
Mesh-LLM Local Codesignidentity, so the public lane was correctly exercised as a fail-closed credential gate rather than falsely marked notarized. Producing the public artifact requires the release team's Developer ID Application certificate and notary profile.Validation
just apple::packagejust apple::product 0.72.1 target/apple-runtime/productjust apple::product-smoke 0.72.1 target/apple-runtime/product-recheckjust with-lld python3 -m unittest scripts.tests.test_package_release scripts.tests.test_install_sh— 34 passedjust with-lld cargo fmt --all -- --checkbash -n scripts/package-release.sh providers/apple/Packaging/package.sh providers/apple/QA/mesh.sh providers/apple/QA/product.shshellcheck scripts/package-release.sh providers/apple/Packaging/package.sh providers/apple/QA/mesh.sh providers/apple/QA/product.shgit diff --checkNext stack
Package this same signed artifact into every host-capable macOS SDK carrier: Rust bundle/resource discovery, Swift Bundle/XCFramework resources and sandbox lifecycle, Node/Electron optional platform package, and Kotlin/JVM resource extraction. All carriers should invoke the same host lifecycle and pass one protocol/product test suite; none should bind Foundation Models independently.