Skip to content

Add Swift and Kotlin bindings via UniFFI#34

Merged
titusz merged 118 commits into
mainfrom
develop
Mar 24, 2026
Merged

Add Swift and Kotlin bindings via UniFFI#34
titusz merged 118 commits into
mainfrom
develop

Conversation

@titusz
Copy link
Copy Markdown
Member

@titusz titusz commented Mar 21, 2026

Summary

  • Add UniFFI scaffolding crate (crates/iscc-uniffi/) exposing all 32 Tier 1 API symbols
  • Add Swift Package (packages/swift/) with generated bindings and full conformance tests
  • Add Kotlin JVM project (packages/kotlin/) with generated bindings and full conformance tests
  • Add Swift CI job on macOS runner, Swift documentation (docs/howto/swift.md)
  • Update README with Swift and Kotlin in the Available Bindings table
  • Add Swift version sync to scripts/version_sync.py
  • Add effort levels to CID agent definitions
  • Fix bundle not on PATH in devcontainer Dockerfile

Test plan

  • All Rust tests pass (cargo test --workspace)
  • All Python tests pass (pytest)
  • Swift conformance tests pass (all 9 gen_*_v0 functions)
  • Kotlin conformance tests pass (all 9 gen_*_v0 functions)
  • Pre-push quality gates pass (clippy, ruff, ty, security, complexity)
  • CI passes on GitHub

CID Agent added 30 commits March 9, 2026 06:49
Add missing Ruby and C#/.NET entries, update Java to Maven Central,
update C/C++ to GitHub Releases. Fix stale Java Quick Start tab.
Add bindings table consistency requirement to documentation spec.
Update 6 existing crate CLAUDE.md files with verified corrections:
- iscc-lib: fix symbol count, add META_TRIM_META, document feature gates
- iscc-py: fix function count (21→27), add SumCodeResult, correct build matrix
- iscc-napi: itemize API surface, fix conformance count, correct NPM secret
- iscc-wasm: 12 fixes including wasm-opt flags, publishing flow, struct exceptions
- iscc-ffi: add csbindgen section, complete symbol lists, opaque handle types
- iscc-rb: expand test entries, add unsafe as_slice() safety pattern

Create 4 new CLAUDE.md files for previously undocumented directories:
- iscc-jni: JNI naming, opaque pointer pattern, Maven build, 12 pitfalls
- packages/go: pure Go reimplementation, embedded conformance, 9 pitfalls
- packages/dotnet: P/Invoke bindings, SafeHandle, NuGet publishing, 9 pitfalls
- packages/cpp: header-only C++17, RAII guards, vcpkg portfile, 6 pitfalls
- update-state: sonnet→opus with effort medium
- define-next: effort max
- advance: effort high
- review: effort high
- Swift and Kotlin binding issues: low→normal priority
Add crates/iscc-uniffi/ — shared UniFFI scaffolding crate exposing all 32
Tier 1 symbols from iscc-lib via proc macros. This is the foundation for
Swift and Kotlin bindings.

- 10 gen function wrappers with owned-type signatures
- 4 text utilities, 4 algorithm primitives, 1 soft hash
- 2 encoding utilities, 3 codec operations, 5 constant getters
- 2 streaming Object types (DataHasher/InstanceHasher with Mutex<Option>)
- 1 diagnostic (conformance_selftest)
- 11 result Record types + IsccUniError enum
- 21 unit tests, clippy clean, workspace unaffected
…erified

All verification criteria pass: build, 21 tests, clippy clean, no regressions.
Updated learnings with UniFFI patterns, agent memory with review shortcuts.
Debian's ruby package ships bundler as a default gem (library only)
without installing a binstub. Add explicit gem install bundler so
the bundle executable lands in /usr/local/bin/.
Add uniffi-bindgen CLI binary to iscc-uniffi crate (bindgen feature +
[[bin]] section). Create packages/swift/ with SPM manifest, UniFFI-generated
Swift bindings (all 32 Tier 1 symbols), C header + module map for FFI target,
XCTest conformance tests (9 methods, 50 vectors), vendored data.json, and
per-package README.
Add `swift:` job to ci.yml that builds the UniFFI native library and runs
`swift test` on macos-14. Uses -Xlinker -rpath for runtime library discovery.
Rename IsccLibFFI → iscc_uniffiFFI in SPM target name, directory, and
modulemap to match the UniFFI-generated `canImport(iscc_uniffiFFI)`
import in iscc_uniffi.swift.
- Create docs/howto/swift.md with full Swift howto guide (all 10 gen
  functions, streaming, codec, text utils, constants, conformance)
- Create packages/swift/CLAUDE.md with per-package agent documentation
- Add Swift install/quickstart sections and polyglot mention to README.md
- Add Swift to zensical.toml nav and gen_llms_full.py ORDERED_PAGES
Create Constants.swift with public isccLibVersion constant and add
Swift sync target (_get_swift_version / _sync_swift_version) to
scripts/version_sync.py. All 14 targets now stay in sync with the
workspace version from root Cargo.toml.
CID Agent added 29 commits March 22, 2026 08:17
…kflow

Add 4 Android ABI targets (aarch64, armv7, x86_64, x86) to build-kotlin-native
matrix. Conditional steps: NDK setup via nttld/setup-ndk@v1 (r27c), cargo-ndk
install, and cargo ndk build. Desktop build step unchanged but now conditional
to skip Android targets.
…32 path issue found

Verified all 11 next.md criteria pass. Codex review found JNA ARM32 resource
path mismatch: spec says `android-armv7/` but JNA expects `android-arm/`.
Filed as new issue. Deleted resolved critical issue (Android native libs).
Add JAR content validation to test-kotlin-release job: depends on
assemble-kotlin, downloads the assembled JAR artifact, and verifies
all 9 JNA native library resource paths are present before publish.
…e JAR selection fixed

Codex review caught that `ls *.jar | head -1` picks -javadoc.jar alphabetically
instead of the runtime JAR. Fixed by filtering out classifier JARs. Resolved
Kotlin JAR smoke test issue from issues.md.
Add build script, Swift FFI headers, per-crate Cargo.toml files, and
root Cargo.toml to the hashFiles() cache key, preventing stale
XCFramework artifacts when these inputs change.
Adds a "Verify main matches tag" step that fails fast on tag-triggered
releases if main HEAD has diverged from the tagged commit SHA. Prevents
building XCFramework binaries from source different than what was tagged.
The guard is conditional on tag triggers only — workflow_dispatch
re-triggers are unaffected.
Add `swift package dump-package` step to the swift CI job that validates
the consumer-facing root Package.swift parses correctly. Runs early
(before UniFFI build) with no working-directory override, catching
structural regressions in the SPM manifest.
… update

Replace tag-push trigger with workflow_dispatch. New prepare-release job
builds Swift XCFramework, updates Package.swift checksum, commits to main,
then creates the tag — so the tagged commit always has the correct checksum.
Eliminates force-retag that broke release reproducibility.
@titusz titusz merged commit 36b0aa2 into main Mar 24, 2026
32 checks passed
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