Skip to content

refactor: extract core/provers/ffi architecture with clean dependency…#716

Draft
vivianjeng wants to merge 5 commits into
mainfrom
refactor-with-ai
Draft

refactor: extract core/provers/ffi architecture with clean dependency…#716
vivianjeng wants to merge 5 commits into
mainfrom
refactor-with-ai

Conversation

@vivianjeng

Copy link
Copy Markdown
Member

… boundaries

Introduces the new monorepo architecture per CLAUDE.md:

  • core/: Prover trait, MoproError, ProofBytes — zero FFI deps
  • provers/circom-adapter, halo2-adapter, noir-adapter: thin Prover impls with optional uniffi/wasm/flutter feature gates on output types
  • ffi/common: Arch/Mode/PlatformBuilder traits + shared build utilities
  • ffi/uniffi, ffi/wasm, ffi/flutter, ffi/react-native: build-pipeline backends; each defines its own Platform struct (orphan rule), zero deps on core or provers
  • scripts/check-boundaries.sh: CI-ready boundary invariant check
  • tests/build.rs: replaces src/bin/*.rs; backends triggered via env vars (IOS_ARCHS, ANDROID_ARCHS, WEB_ARCHS, FLUTTER_ARCHS, REACT_NATIVE_ARCHS)
  • .github/workflows/new-arch.yml: check/test/boundary/binding_ios/binding_wasm jobs

… boundaries

Introduces the new monorepo architecture per CLAUDE.md:

- core/: Prover trait, MoproError, ProofBytes — zero FFI deps
- provers/circom-adapter, halo2-adapter, noir-adapter: thin Prover impls
  with optional uniffi/wasm/flutter feature gates on output types
- ffi/common: Arch/Mode/PlatformBuilder traits + shared build utilities
- ffi/uniffi, ffi/wasm, ffi/flutter, ffi/react-native: build-pipeline
  backends; each defines its own Platform struct (orphan rule), zero
  deps on core or provers
- scripts/check-boundaries.sh: CI-ready boundary invariant check
- tests/build.rs: replaces src/bin/*.rs; backends triggered via env vars
  (IOS_ARCHS, ANDROID_ARCHS, WEB_ARCHS, FLUTTER_ARCHS, REACT_NATIVE_ARCHS)
- .github/workflows/new-arch.yml: check/test/boundary/binding_ios/binding_wasm jobs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 12f0c4dd-0cb3-4805-9679-9fbfb22b0273

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor-with-ai

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 and usage tips.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 21, 2026

Copy link
Copy Markdown

Deploying mopro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2016c2a
Status: ✅  Deploy successful!
Preview URL: https://43363476.mopro.pages.dev
Branch Preview URL: https://refactor-with-ai.mopro.pages.dev

View logs

vivianjeng and others added 4 commits June 21, 2026 22:12
…exist

patch_package_version now reads Cargo.lock to detect whether a package
has multiple versions. When it does, it uses the `name@x.y.z` spec to
target the correct major version instead of failing with an ambiguity error.

Also replace Command::new("cargo") with env CARGO in ios/android/wasm
backends so nested cargo calls from build.rs use the correct binary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fi from host build

tests/ is now a pure build-pipeline driver (no lib code, no mopro-ffi dep).
test-app/ holds the actual library that gets compiled for iOS/Android/Wasm.
build_from_env_at(project_dir) added to mopro-build-common; each backend
exposes build_at(project_dir) so tests/build.rs can point at test-app/.

This avoids compiling mopro-ffi and linking cdylib/staticlib for the host
when running `cargo build -p tests`, significantly reducing CI cold-build time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without this, build.rs inherits the build script's working directory
(tests/) instead of project_dir (test-app/), causing the nested build
to compile the wrong crate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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