Repository navigation
Description
Parent: #16. Depends on #37's generated async-operation lifecycle; #35 is required for the real authorized same-logical-sketch cross-thread proof. Governed by #13 and constrained by #15's closed import contract.
Scope
Implement the first private, generated v1 resource registry and facade-owned semantic handles. A handle is validated as (logical_sketch_scope, slot, generation, kind, rights); it is not a raw Wasmtime object, Store/Instance identity, pointer, numeric capability bit, or global resource ID. Implement only a synthetic resource with generated create/use/close operations through #37's submit/poll/yield/cancel lifecycle.
The registry is owned by the logical sketch and is shared by every authorized instance/thread in that sketch. It is not cloned per Store. The root and any child guest thread may use a resource only when its rights declare it shareable and it belongs to the same logical sketch. A separate sketch, a stale generation, a wrong kind/right, a forged handle, or a closed resource receives a bounded facade-owned error before any host effect.
Every create reserves bounded registry/quota state before scheduling. Close, cancellation, terminal operation, trap, thread exit, and sketch teardown have an idempotent, deterministic cleanup path that invalidates the generation and releases all permits/registrations. Completion never retains guest pointers, Store/Instance/Caller, resource-table borrows, mutex guards, or DashMap guards across an await, wakeup, cancellation callback, or guest re-entry.
Non-goals
No Blob bytes, streaming, file handles, paths, output files, std::io adapters, Read/Write/Seek, host filesystem/network/process/clock authority, real timers, Tauri, WASI linking, or worker containment. #17 owns bounded transfer/backpressure and exact output. A blocking standard-library adapter is deferred under #13 until #17's transfer contract and #35 are available.
Import and authority invariants
- Use only the generated exact
kernal-api:v1imports from feat(wasm-abi): define and generate the versioned core-Wasm ABI contract #36/feat(wasm-abi): dispatch generated async operations through poll, yield, and cancellation #37; do not add broad namespaces, ambient WASI, or a handwritten test ABI. - Existing P1/thread compatibility imports remain explicit and authority-free under feat(wasm): establish threaded sketch build, import validation, and lifecycle substrate #15/feat(wasm): bootstrap owned threaded guest instances #35.
- Resource sharing is an authorization decision, never an accidental consequence of a shared Wasm memory, Store cloning, or thread identity.
- Public APIs expose only semantic resource/result/error types; all Wasmtime, Tokio, registry, raw handle encoding, and backend types remain private.
RED → GREEN
- RED: a generated fixture characterizes that no scoped, generation-safe resource can be created, used, and closed through the generated lifecycle.
- RED: fixtures demonstrate that raw-slot reuse, a stale handle, cross-sketch use, wrong kind/right, duplicate close, close-versus-completion, and teardown can otherwise confuse ownership or leak quota.
- GREEN: generated create/use/close succeeds for one synthetic resource and every operation uses feat(wasm-abi): dispatch generated async operations through poll, yield, and cancellation #37's sole lifecycle/explicit
RuntimeHandle; no second scheduler, ABI path, or ambient callback exists. - GREEN: handle reuse increments generation; stale/forged/cross-scope/wrong-kind/wrong-right/closed handles fail with bounded semantic errors before host effects.
- GREEN: per-resource and per-sketch quotas reject before scheduling; close/cancel/trap/thread-exit/sketch teardown release registrations, pending operations, and permits exactly once, with zero live-resource/pending-operation counters after teardown.
- GREEN: root proof confirms Store/Instance independence from logical scope and no retained pointer, Store, resource/lock/DashMap guard across suspension or completion.
- GREEN: after feat(wasm): bootstrap owned threaded guest instances #35, a real Rust
wasm32-wasip1-threadsartifact proves explicitly shareable resource use from two authorized guest instances in the same logical sketch, while a different logical sketch is rejected. This must not be replaced by a native/mock-thread proof. - GREEN: default-feature isolation and Linux/macOS/Windows x86-64/ARM64 compilation remain intact.
Deliverables and closure
Deliver generated semantic resource declarations/facade, private logical-sketch registry, quota/cleanup instrumentation, raw and real-artifact fixtures, and Soldr-only focused commands. Close only when #17 can build Blob and OutputFile capabilities on these handles without widening imports, duplicating lifecycle state, or treating a Store as a security scope.
Activity
zackees commentedon Sep 12, 2026
Closed as completed. The shared logical-sketch OperationHub provides generation-safe synthetic resource create/use/close through the sole generated lifecycle, including shareability checks, quota reservation, stale/closed defenses, idempotent teardown, and a real threaded guest proof using a shared resource across authorized guest instances. No import surface was widened.