@@ -66,7 +66,13 @@ iterations.
6666 Cargo.toml changes needed. The cdylib target produces the `.wasm` file
6767- `iscc_alloc`/`iscc_dealloc` are the WASM host memory management pair — host allocates via
6868 `iscc_alloc`, writes data, calls FFI functions, then frees via `iscc_dealloc`
69- - Debug WASM binary is ~10.5MB; release + wasm-opt would reduce significantly
69+ - Debug WASM binary is ~10.5MB; release + wasm-opt reduces significantly
70+ - wasm-opt release config in `crates/iscc-wasm/Cargo.toml`:
71+ `[package.metadata.wasm-pack.profile.release]` with
72+ `wasm-opt = ["-O", "--enable-bulk-memory", "--enable-nontrapping-float-to-int"]`. Rust's LLVM
73+ emits `memory.copy` (bulk-memory) and `i32.trunc_sat_f64_s/u` (nontrapping-float-to-int) — both
74+ must be enabled for wasm-opt to accept the binary. If future Rust versions emit more post-MVP
75+ ops, add specific `--enable-*` flags (or switch to `--enable-all` as last resort)
7076- Install target: `rustup target add wasm32-wasip1`
7177- Build: `cargo build -p iscc-ffi --target wasm32-wasip1`
7278- Output: `target/wasm32-wasip1/debug/iscc_ffi.wasm`
@@ -110,10 +116,11 @@ iterations.
110116- Go streaming hasher pattern: `DataHasher`/`InstanceHasher` structs hold `rt *Runtime` +
111117 `ptr uint32` (opaque WASM pointer). Factory methods on Runtime call `iscc_*_hasher_new()` and
112118 check for NULL. `Update` writes bytes via `writeBytes`, calls `iscc_*_hasher_update` (returns
113- i32 as bool: 0=error, nonzero=ok). `Finalize` calls `iscc_*_hasher_finalize` (returns string
114- pointer) and uses `callStringResult`. `Close` calls `iscc_*_hasher_free` and zeroes `h.ptr` to
115- prevent double-free (fire-and-forget, safe to call multiple times). No sret ABI needed — all
116- streaming hasher FFI functions use simple i32 params/returns
119+ i32 as bool: 0=error, nonzero=ok). `UpdateFrom` reads from `io.Reader` in 64 KiB chunks and
120+ delegates to `Update`. `Finalize` calls `iscc_*_hasher_finalize` (returns string pointer) and
121+ uses `callStringResult`. `Close` calls `iscc_*_hasher_free` and zeroes `h.ptr` to prevent
122+ double-free (fire-and-forget, safe to call multiple times). No sret ABI needed — all streaming
123+ hasher FFI functions use simple i32 params/returns
117124- Byte-buffer-returning WASM functions use sret ABI: caller allocates 8 bytes (IsccByteBuffer or
118125 IsccByteBufferArray struct), passes ptr as first arg. Function writes struct fields to that ptr.
119126 The free functions (iscc_free_byte_buffer, iscc_free_byte_buffer_array) take the struct by
@@ -156,8 +163,37 @@ iterations.
156163 via regex `r'^version\s*=\s*"(.+?)"'`, updates `package.json` (json stdlib) and `pom.xml` (regex
157164 replacement). Supports `--check` flag. mise tasks: `version:sync`, `version:check`
158165
166+ ## Release Workflow
167+
168+ - PR merge: `gh pr merge N --merge` (merge commit, not squash) preserves commit history
169+ - Tag on main: `git tag vX.Y.Z && git push origin vX.Y.Z` triggers `.github/workflows/release.yml`
170+ - Release workflow matches pattern `push: tags: [v*.*.*]`
171+ - After tagging, switch back to develop: `git checkout develop`
172+ - If local changes block branch switch, `git stash push -m "reason" <file>` then `git stash pop`
173+ after switching back
174+ - OIDC trusted publishing for crates.io requires crate to exist first (first publish needs API
175+ token). PyPI supports pending trusted publishers. npm uses `NPM_TOKEN` secret
176+ - Release workflow has 4 `workflow_dispatch` inputs: `crates-io`, `pypi`, `npm`, `maven` (all
177+ boolean, default false). Jobs: `publish-crates-io`, `build-wheels`, `build-sdist`,
178+ `publish-pypi`, `build-napi`, `publish-npm-lib`, `build-wasm`, `publish-npm-wasm`, `build-jni`,
179+ `assemble-jar`
180+ - `build-jni` matrix: 5 platforms with `native-dir` and `lib-name` matrix vars matching NativeLoader
181+ conventions. Artifacts named `jni-{native-dir}` (e.g., `jni-linux-x86_64`)
182+ - `assemble-jar` downloads `jni-*` artifacts into `jni-staging/`, iterates subdirectories to copy
183+ native libs to `src/main/resources/META-INF/native/{native-dir}/`. Uses
184+ `mvn package -DskipTests` and uploads JAR as `iscc-lib-jar` artifact
185+ - `actions/download-artifact@v4` default behavior (no `merge-multiple`) creates per-artifact
186+ subdirectories named after the artifact — useful for iterating platform-specific downloads
187+
159188## Documentation
160189
190+ - Ecosystem page: `docs/ecosystem.md` — covers official (iscc-core, iscc-lib) and community
191+ (iscc-core-ts) implementations. Uses `icon: lucide/globe`. Nav entry in `zensical.toml` placed
192+ between "Explanation" and "Reference" as a top-level entry
193+ - `branciard/iscc-core-ts`: TypeScript port, Apache-2.0, v0.3.0, all 9 gen\_\*\_v0 and
194+ gen_iscc_id_v0/v1 and gen_flake_code_v0. Vendors official `data.json` (66KB). 263 tests across
195+ 18 suites. Author: François Branciard. NGI Zero Core / NLnet funded. Status: active development,
196+ not production-ready
161197- How-to guide structure: YAML front matter (`icon`, `description`) → title → intro → installation →
162198 code generation (9 subsections: Meta, Text, Image, Audio, Video, Mixed, Data, Instance,
163199 ISCC-CODE) → streaming → text utilities → conformance testing → error handling
@@ -172,12 +208,18 @@ iterations.
172208 AlgCdcChunks, AlgSimhash) not present in Python/Node.js guides
173209- All 6 how-to guides complete: Rust (356 lines), Python (353), Node.js (281), WASM (338), Go (388),
174210 Java (321)
211+ - `docs/architecture.md` and `docs/development.md` include all 6 binding crates (Python, Node.js,
212+ WASM, C FFI, JNI, Go) in diagrams, layout trees, and tables. Go uses dotted arrow (`-.->`) in
213+ Mermaid to indicate indirect WASM dependency via `iscc-ffi`
175214- Java guide key differences from Go: no runtime object (static methods), "Setup" section replaces
176215 "Runtime setup", streaming uses opaque `long` handles with try-finally (not defer),
177216 `genIsccCodeV0` exposes `boolean wide` parameter (Go hardcodes to false)
178217- docs/index.md landing page: 6 Quick Start tabs (Rust, Python, Node.js, Java, Go, WASM) + 7
179218 Available Bindings table rows. All tabs use `gen_text_code_v0("Hello World")`. mdformat
180219 auto-reformats JS imports to multi-line style in code blocks inside tabbed markdown
220+ - WASM how-to (`docs/howto/wasm.md`) uses `@iscc/wasm` throughout (20 occurrences). Always verify
221+ npm package names against `docs/index.md` and `crates/*/README.md` — the wasm-pack howto
222+ originally had `@iscc/iscc-wasm` (wrong)
181223
182224## Codec Internals
183225
0 commit comments