Skip to content

Add Rust component WASM steps with explicit lifecycles - #41

Merged
fazzatti merged 3 commits into
devfrom
feat/wasm-support
Oct 12, 2026
Merged

fazzatti merged 3 commits into
devfrom
feat/wasm-support

Conversation

@fazzatti

@fazzatti fazzatti commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Rust component exports can now run as typed native Convee steps, with the same input, output, error and finalization hooks as other pipeline work. The optional /wasm API provides fresh instances per call and a separate persistentWasm owner with explicit close/disposal, optional reopening and idle cleanup, bounded admission and finite replacement after unsafe failures. Failed work is never replayed.

The optional /wasm/jco adapter reuses compiled modules while creating independent generated binding sessions. Preparation is lazy by default, with eager preparation and preload() available; ready() initializes a persistent guest. Generated declarations infer export names, inputs and outputs. Asset manifests support SHA-256 checks, and host imports and their cleanup remain explicit. Core imports gain no Rust, Jco or WASI runtime dependency.

Three runnable Rust/WIT examples cover application behavior, state, declared errors, panics, explicit host capabilities and a broad owned-value ABI matrix. A two-core WAT fixture exercises module linking and malformed guest outputs. The locked Rust 1.96.0 / wit-bindgen 0.62.0 / Jco 1.37.0 build regenerates all fixtures in CI. The main README covers all supported usage and design, including typed steps, preparation, ownership, Rust bindings, host capabilities, recovery, workers and runtime limits. Public APIs retain their TSDoc. Version 2.3.0 is an additive minor bump from dev's 2.2.0; this PR does not publish a release.

ABI verification:

  • 56 required categories and all 59 generated ABI exports, with inventory checks preventing silent omissions. Fresh and persistent instances run the same matrix directly and inside real workers.
  • Every supported owned-value type family: scalar widths, signed/unsigned bigint, float edge values, Unicode, every scalar list family, typed-array offsets, records, tuples, variants, enums, flags, nested options/results and aliases. Full u8/s8 domains, all eight-flag combinations and all enumerators in 256/257-case fixtures are enumerated.
  • Canonical layout boundaries include mixed-width record padding/stride, integer/float variant joins, 16/17 arguments, indirect aggregates, memory growth and retained-output independence. Rust-side reversal and field/bit observations complement round trips; 128 reproducible nested aggregates broaden the cases.
  • 118 concrete type-signature assertions, plus invalid consumers, verify names, input/output tuples, nested shapes, typed arrays, host imports and plugins.
  • Real malformed char, UTF-8, string pointer and byte-list ranges reject; future calls use safe replacement instances. Additional tests cover invalid JS inputs, declared coercions, missing/wrong non-first assets, incompatible valid modules, host failures, cleanup and no replay.

Local validation at signed head 72505b0:

  • Full deno task verify: 53 test groups / 985 BDD steps, types, docs, 30 README examples, architecture, depth, isolated Deno consumers and JSR dry run pass.
  • Exact authored production coverage: 3334/3334 lines, 1330/1330 branches, 297/297 functions on Deno 2.9.7/macOS. No production source or coverage gate changed in the ABI follow-up; generated third-party fixture glue remains separately integration-tested.
  • Final matrix passes Node 24.1.0, Bun 1.4.3 and all six Vite development/production paths across Chromium, Firefox and WebKit. Each browser report records 56 cases, 59 exports, four execution modes, four malformed-output checks and zero remaining workers.
  • All three Rust examples and the WAT fixture rebuild successfully with the pinned toolchain.

The complete finite inventory covers the documented synchronous owned-value memory32/UTF-8 profile, not every value, nesting combination, malformed binary or toolchain version. Resource handles, guest async/streams/JSPI, shared/borrowed memory, threads, implicit WASI and other encodings are outside this profile. Generated scalar coercions are documented; applications can add stricter input plugins. Synchronous guests require workers for hard interruption. No performance speedup is claimed.

CI run 38184916286 passes all 13 jobs at signed head 72505b0; its test-merge tree matches the feature tree. The downloaded CI report independently confirms 3334/3334 lines, 1332/1332 branches and 297/297 functions. Deno 2.9.6/Linux records two additional fully covered branches at workers/entry.ts compared with local Deno 2.9.7/macOS. The runtime matrix also passes Deno 2.6.0 and Node 22.12.0. The Rust job rebuilds and tests all four component fixtures. 69/69 mutation cases, the seeded stress suite and both retention jobs pass on this head. These are exact CI LCOV/quality counts, not an inference from a coverage-upload status.

Documentation consolidation at signed head 93e820a: the main README is now the only Markdown guide in the repository and package. The standalone WASM/testing guides and contributor section are removed. All 32 README examples type-check, the fresh-step and persistent examples execute with the documented results, all 7 architecture/package checks pass, and the JSR publish dry run succeeds. README anchors and example-source targets are checked. This follow-up changes documentation, the package documentation allowlist and its corresponding test expectation; authored runtime source and ABI tests are unchanged from the fully verified 72505b0 above.

@codecov-commenter

codecov-commenter commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.65059% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (dev@027e453). Learn more about missing BASE report.

Files with missing lines Patch % Lines
test/wasm/abi-cases.ts 99.43% 0 Missing and 5 partials ⚠️

❌ Your patch status has failed because the patch coverage (99.65%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@          Coverage Diff           @@
##             dev      #41   +/-   ##
======================================
  Coverage       ?   71.32%           
======================================
  Files          ?       57           
  Lines          ?    31314           
  Branches       ?      719           
======================================
  Hits           ?    22336           
  Misses         ?     8973           
  Partials       ?        5           
Files with missing lines Coverage Δ
examples/component-pair/generated/modules.ts 100.00% <100.00%> (ø)
examples/component-pair/generated/pair.js 44.81% <ø> (ø)
examples/rust-abi/bindings.ts 100.00% <100.00%> (ø)
examples/rust-abi/generated/abi.js 77.19% <ø> (ø)
examples/rust-abi/generated/modules.ts 100.00% <100.00%> (ø)
examples/rust-host/generated/host.js 51.43% <ø> (ø)
examples/rust-host/generated/modules.ts 100.00% <100.00%> (ø)
examples/rust-text/bindings.ts 100.00% <100.00%> (ø)
examples/rust-text/document.worker.ts 100.00% <100.00%> (ø)
examples/rust-text/generated/modules.ts 100.00% <100.00%> (ø)
... and 8 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fazzatti
fazzatti merged commit 695a10f into dev Oct 12, 2026
13 checks passed
fazzatti added a commit that referenced this pull request Oct 12, 2026
* Export types (#6)

* docs: improve readme

* Create main.yml (#1)

* package: add jsr.json (#2)

* Feat jsr (#3)

* package: add jsr.json

* fix: jsr path

* feat: switch to deno (#4)

* Switch to Deno (#5)

* feat: switch to deno

* fix uuid generation

* feat: add export types

* packaging: bump version to 0.1.1

* refactor: replace storeOutput with storeMetadata and update tests accordingly

* chore: update version to 0.8.0 in deno.json (#28)

* Update src/utils/reduce-pipeline-steps-to-names.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/pipeline/index.unit.test.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/pipeline/index.unit.test.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix: pipeline types and add plugin functionality for pipeline-level o… (#30)

* Fix: error handling in CreateProcess to enrich and throw unhandled er… (#32)

* feat: add BeltPlugin tests and enhance plugin types with metadata handling

* docs: update README to enhance installation, usage, and core concepts sections

* feat: enhance GitHub Actions workflow for publishing with version detection and tagging

* refactor: streamline plugin and process engine implementations with enhanced documentation

* chore: update version numbers in deno.json and deno.lock for release

* Complete V1 refactor (#35)

* Release 0.10.0 (#34)

* V1 refactor

* refactor library docs and release workflows

* chore: update version number to 1.0.0 in deno.json

* chore: update publishing configuration and version number to 1.0.1 in deno.json

* feat: add intentional workers and scoped parallel execution (#40)

* Update publish configuration (#37)

* Export types (#6)

* docs: improve readme

* Create main.yml (#1)

* package: add jsr.json (#2)

* Feat jsr (#3)

* package: add jsr.json

* fix: jsr path

* feat: switch to deno (#4)

* Switch to Deno (#5)

* feat: switch to deno

* fix uuid generation

* feat: add export types

* packaging: bump version to 0.1.1

* refactor: replace storeOutput with storeMetadata and update tests accordingly

* chore: update version to 0.8.0 in deno.json (#28)

* Update src/utils/reduce-pipeline-steps-to-names.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/pipeline/index.unit.test.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/pipeline/index.unit.test.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix: pipeline types and add plugin functionality for pipeline-level o… (#30)

* Fix: error handling in CreateProcess to enrich and throw unhandled er… (#32)

* feat: add BeltPlugin tests and enhance plugin types with metadata handling

* docs: update README to enhance installation, usage, and core concepts sections

* feat: enhance GitHub Actions workflow for publishing with version detection and tagging

* refactor: streamline plugin and process engine implementations with enhanced documentation

* chore: update version numbers in deno.json and deno.lock for release

* Complete V1 refactor (#35)

* Release 0.10.0 (#34)

* V1 refactor

* refactor library docs and release workflows

* chore: update version number to 1.0.0 in deno.json

* chore: update publishing configuration and version number to 1.0.1 in deno.json

* feat!: harden Convee runtime and add comprehensive quality gates (#38)

* feat!: harden execution contracts and add comprehensive quality gates

Unify lifecycle drivers, isolate invocation contexts, preserve argument tuples, normalize plugin descriptors, and repair fluent/type-depth contracts.

Add deterministic, generated, concurrency, mutation, architecture, package, retention and benchmark validation across supported Deno runtimes.

BREAKING CHANGE: enforce explicit tuple transport, body-only recovery, last-completed history and defensive configuration ownership. Prepare version 2.0.0 with documented migration guidance.

* fix(ci): parse colored mutation test summaries accurately

Normalize ANSI formatting before recognizing Deno failed-test summaries. Keep infrastructure failures and timeouts distinct from assertion kills. Add eight tooling regressions to the quality gate and verify the campaign with forced color.

* ci: refresh pinned actions to supported Node 24 runtimes

Use verified official checkout 7.0.1, upload-artifact 7.0.1 and Codecov 7.0.0 revisions. Preserve scoped permissions, existing inputs and the supported Deno matrix.

* docs: make usage and testing guides release-ready

Remove branch-only release commentary and Deno-only support framing. Keep migration guidance, document the actual CI matrix separately, and describe the reusable release workflow without candidate or unpublished-package instructions.

* docs: restore the published README walkthrough and examples

Restore the live 1.0.1 README layout, badges, architecture walkthrough, sync APIs, error model, design notes and license. Retain original example use cases and add current lifecycle, tuple, context and migration guidance.\n\nType-check 21 standalone snippets without rejecting import-only teaching examples. Add six regression tests for the development-only checker and document its scope. No library runtime, API, version or release-workflow changes.

* Add onFinally lifecycle hooks in Convee 2.1 (#39)

* feat: add typed worker pools and parallel steps

Add optional worker registries, configured recipes and roles, bounded reusable pools, and ordinary async Steps with typed split/join and error policies. Include lifecycle, real-worker, type and package-consumer coverage; prepare the additive 2.2.0 release.

* test: classify suites and use BDD throughout

Rename all suites with explicit unit or integration categories, replace native registration with describe/it, and align task discovery and replay references. Preserve existing assertions and production sources.

* refactor: use aliases for repository imports

Use public, source, test and tooling aliases throughout repository checks. Generate README and type-depth imports through the import map while preserving isolated package-consumer verification.

* test: enforce full coverage and document public API contracts

Cover late transport callbacks after pool shutdown, require 100% line/branch/function coverage, and expand public TSDoc across both entrypoints and callable surfaces. Production code and type signatures are unchanged.

Verified full local checks, isolated native-worker consumption, both stale-callback guard mutants, and rejection of incomplete coverage reports.

* feat: redesign intentional workers and parallel lifetimes

* feat: add Rust WASM steps and typed bindings (#41)

* feat: add Rust component WASM steps with explicit lifecycles

* test(wasm): establish owned-value ABI conformance matrix

* docs: consolidate consumer guidance in README

* fix: upload verified production coverage to Codecov (#43)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.

2 participants