Fresh import of Groupthink-dev/stallari-yrs under the DD-450 freeze; NOT yet cut over. Pending metadata/ref verification and promotion to Stallari/yrs.
  • Swift 44.1%
  • Rust 28.1%
  • C 15.1%
  • Makefile 12.7%
Find a file
Piers cb90961161
DD-295 Phase C — fix xcframework module.modulemap + Info.plist determinism (bumps to 0.1.1)
- xcframework Headers dir was missing module.modulemap → consumer 'import CStallariYRS' fails.
  Stage headers + modulemap in build/staged-headers/ before xcodebuild -create-xcframework.
- xcodebuild emits Info.plist AvailableLibraries in non-deterministic order.
  Post-process with python3 plistlib to sort by LibraryIdentifier.
- New SHA-256: 1d5f14c250d0db606a9c8607729a4d1fcb88c545ba68e86d176fc05987a6e8e5
- New tag: 0.1.1 (0.1.0 retained per never-delete rule; harness pins 0.1.1).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 18:00:54 +10:00
rust Add iOS support: platform-conditional linker flags + C stub 2026-04-27 06:53:09 +10:00
Sources Add iOS support: platform-conditional linker flags + C stub 2026-04-27 06:53:09 +10:00
Tests/StallariYRSTests Initial scaffold: Rust FFI bridge + Swift wrapper for yrs CRDT 2026-04-22 17:14:29 +10:00
.gitignore DD-295 Phase C — binary-distribution preflight (rust-toolchain.toml, Makefile targets, Package.swift binaryTarget placeholders, README) 2026-05-16 17:48:18 +10:00
CLAUDE.md Initial scaffold: Rust FFI bridge + Swift wrapper for yrs CRDT 2026-04-22 17:14:29 +10:00
Makefile DD-295 Phase C — fix xcframework module.modulemap + Info.plist determinism (bumps to 0.1.1) 2026-05-16 18:00:54 +10:00
Package.swift DD-295 Phase C — fix xcframework module.modulemap + Info.plist determinism (bumps to 0.1.1) 2026-05-16 18:00:54 +10:00
README.md DD-295 Phase C — binary-distribution preflight (rust-toolchain.toml, Makefile targets, Package.swift binaryTarget placeholders, README) 2026-05-16 17:48:18 +10:00
rust-toolchain.toml DD-295 Phase C — binary-distribution preflight (rust-toolchain.toml, Makefile targets, Package.swift binaryTarget placeholders, README) 2026-05-16 17:48:18 +10:00

stallari-yrs

Swift Package Manager library wrapping the yrs Rust CRDT library via C FFI. Provides YDocument, YText, YAwareness for collaborative document editing in Stallari.

Build

Requires Rust toolchain with Apple targets (pinned via rust-toolchain.toml):

rustup target add aarch64-apple-darwin aarch64-apple-ios
cargo install cbindgen

Local development build (rebuilds the Rust static lib + Swift wrapper from source):

make build              # macOS arm64 only
make universal          # macOS + iOS arm64
make release-xcframework  # production: deterministic xcframework + SHA-256 (DD-295 Phase C)

Run tests:

make test

Binary distribution

Per DD-295 Phase C amendment § "Binary-distributed siblings", consumers of this package resolve CStallariYRS as a SwiftPM binaryTarget(url:, checksum:) pointing at the stallari_yrs.xcframework.zip asset attached to each tagged GH Release on groupthink-dev/stallari-yrs. The published xcframework bundles both macos-arm64 and ios-arm64 static-library variants built with cargo build --release --locked against the pinned Rust toolchain. make release-xcframework builds the asset; make verify-xcframework validates determinism (two consecutive builds must produce identical SHA-256). Release assets are append-only — never deleted, never re-uploaded with --clobber — to preserve swift package resolve for any historical consumer commit.

Architecture

rust/src/lib.rs          → C FFI bridge (#[no_mangle] pub extern "C")
Sources/CStallariYRS/    → C module (module.modulemap + yrs_ffi.h) — input to xcframework build
Sources/StallariYRS/     → Swift wrappers (YDocument, YText, YAwareness)
lib/                     → Compiled static libraries (git-ignored, populated by `make build`)
build/                   → xcframework + zip output (git-ignored, populated by `make release-xcframework`)

Memory Management

Every yrs_*_new has a corresponding yrs_*_free. Swift classes call free in deinit. Buffers returned by FFI functions must be freed with yrs_buf_free or yrs_string_free.

YDocument is @unchecked Sendable — yrs uses internal RwLock. Callers should serialise write access via an actor (PadEngine in stallari-harness).