Skip to content

fix: reject incompatible Apple runtime companions - #484

Merged
leehack merged 3 commits into
mainfrom
fix/apple-companion-abi-guard
Sep 7, 2026
Merged

fix: reject incompatible Apple runtime companions#484
leehack merged 3 commits into
mainfrom
fix/apple-companion-abi-guard

Conversation

@leehack

@leehack leehack commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #483. Prerequisite for draft release #482; this corrective PR does not prepare or publish a release.

Reject resolved Apple llama.cpp companions whose framework pin does not match the core before emitting LookupInProcess. Existing app constraints llamadart: ^0.8.22 with companion ^0.0.17 otherwise admit a v0.4.0 core patch while retaining v0.3.0 frameworks. This release-exposed defect was found before core0.8.23 publication; the name-only hook behavior predates the release-prep PR.

Exact scope

  • Resolve the actual companion from the nearest consumer/workspace package_config version2, including relative percent-encoded roots and dependency/path overrides. Declared constraints do not authorize an ABI.
  • Verify unique companion entry, package identity/version metadata, the complete maintained SwiftPM template and exact native v0.4.0 pin. The template digest normalizes only tag, one checksum and CRLF; arbitrary helper URL changes and decoy comments cannot authorize different binaries. Missing, malformed, duplicated or mismatched metadata fails with an actionable diagnostic before any process asset is emitted.
  • Reject unverified companion Artifacts overrides rather than treating a tag string as proof of their binary ABI. Core native runtime/source/backend overrides cannot bypass the check.
  • Declare consumer pubspec, package_config, resolved companion pubspec/Package.swift and Artifacts-directory cache dependencies. Canonical hooks_runner1.5.0 hashes missing directories and detects creation, preventing a later local override from inheriting a cached successful result.
  • Use direct yaml dependency for real pubspec dependency parsing, covering flow syntax and nested keys. LiteRT-only, non-Apple and no-companion fallback behavior remain unchanged.
  • No package version, native/Web/LiteRT pin, framework, generated binding, public engine API or publication workflow changed.

Validation

  • Canonical Flutter3.47.1 / Dart3.13.1 workspace prep, whole format/analyze PASS.
  • Real build-hook focused suite34/34 PASS: old0.0.17/v3 rejected on iOS/macOS despite overrides; supported0.0.18/v4 process lookup; missing/duplicate/malformed metadata, false new version, wrong target, hardcoded helper URL/decoy comments, local artifacts; workspace roots/cache dependencies; flow YAML/path override bypass; existing no-companion/nonApple/LiteRT-only/mixed contracts.
  • Full VM2002 passed/77 fixture skips on the complete production correction; full Chrome925/925 PASS. Final test-only URI assertion portability correction revalidated in the focused34/34 suite.
  • Platform import boundary, release docs verifier, Node20 website7tests/production build/strict links PASS.
  • Live old published companion0.0.17 archive inspected: Package.swift pin is v0.3.0; archive SHA256 bffa3a62325c530ca3aa34f222f34f7670e81f67cc31ed410a93df7c8f680bf8. Tests exercise the maintained manifest with this incompatible identity through the actual hook.
  • This is a pre-build compatibility check, not a new native runtime; no physical device rerun is claimed or needed to prove the rejected build branch. Existing Pixel qualification stays separate.

High-risk regression review

  • Classification: high-risk artifactConsumer and regressionPolicy (the durable AGENTS guard rule); no existing readiness requirement was weakened.
  • Implementation: isolated fix/apple-companion-abi-guard.
  • Exact head 93966bf0268e20b83eb3348297ad1e1eeb44b0f3, base 9ed77aa12dbd6a6daef185a5bff7484b5a9a5f5f.
  • Independent Astra QA: PASS on exact93966bf after correcting the initial loose Swift fragment bypass in603e2c1. Auditor independently reran34/34 actual-hook tests and verified unchanged/CRLF manifests plus altered URL/tag/helper/repository rejection. No remaining bounded blocker.
  • Final exact-head hosted checks15/15 SUCCESS, CLEAN/MERGEABLE, zero total/unresolved review threads. CI: https://github.com/leehack/llamadart/actions/runs/34136399935 ; LiteRT: https://github.com/leehack/llamadart/actions/runs/34136399960 . PR remains draft.
  • Canonical local high-risk evidence evaluator reports internally consistent evidence, but unverifiedPrerequisites / externalPrerequisitesUnavailable: repository-local tooling cannot authenticate the dedicated App/auditor/protected environment/ruleset. This known owner-controlled governance boundary is not bypassed and no operational attestation is claimed. Evidence: /private/tmp/appleguard-readiness.json.
  • Production branch deletion/bypass proof: actual hook negative tests fail if validation is removed and process assets are emitted.
  • Known PR-caused P1s: zero after fixes and independent final audit. This safely rejects mismatched consumer constraints; it does not automatically rewrite an existing application's dependencies.

No mark-ready, merge, tag, release, publication, workflow dispatch, settings or pin change was performed. Release#482 remains blocked until this prerequisite is reviewed and separately approved/merged, then integrated and requalified.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Chat app preview removed for leehack/llamadart-chat-pr-484.

@leehack
leehack marked this pull request as ready for review September 7, 2026 18:40
@leehack
leehack merged commit ccc2d35 into main Sep 7, 2026
15 checks passed
@leehack
leehack deleted the fix/apple-companion-abi-guard branch September 7, 2026 18:40
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.

Reject ABI-incompatible resolved Apple runtime companions before FFI

1 participant