Skip to content

Wasm-path thenable-resolution: guest consuming a host Thenable result (blocks #103 pilot data path) #205

Description

@hyperpolymath

Problem

The Deno source-to-source backend can consume a Thenable-returning extern because the emitted JS consumer can await it directly. The wasm/Node backend (--vscode-extensioncodegen_node.ml + packages/affine-vscode/mod.js) cannot: there is no await/thenable-resolution mechanism for a wasm guest — no ExprAwait, no AWAIT token, and the issue-#103 design sketch's thenableThen / thenableResultString/Int/Json primitives were explicitly deferred in slice-1 and never built.

A mod.js comment (added in #200) says the wasm path "needs the thenable-resolution primitives — tracked in #199", but #199 became the host→guest callback ABI (function-value handlers), which is a different axis (host calls guest). Consuming a host Thenable result in a wasm guest is still untracked and unbuilt. This issue is that tracking item.

Impact

languageClientSendRequest (#200) returns a Thenable handle the wasm guest cannot resolve. So the rsr-certifier vscode pilot (PR-5d, #103 acceptance) can restore the withProgress-wrapped UX (host→guest callback works) but not the live in-process data (status-bar tier/score, DiagnosticCollection population, dynamic webview) which require reading the rsr/getCompliance (server: rsr.checkCompliance executeCommand, {tier,tier_code,score}) result.

Design space (not decided)

Acceptance

  • A wasm-guest AffineScript program can obtain the resolved value of a host Thenable (languageClientSendRequest).
  • rsr-certifier pilot consumes rsr/getCompliance and populates status-bar/diagnostics/webview from the live result.

Refs #103, #199

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions