Skip to content

plan/loader strictness: silent ?? 0 table-instance defaults; deep schema gaps yield raw TypeError #94

Description

@lann

Severity: low — "malformed plan fails loudly" contract hygiene.

  1. streamTableInstance/futureTableInstance (exec/executor.ts:1021-1024)
    default out-of-range indices to component instance 0 via ?? 0, while
    the sibling streamElem accessor throws a typed PlanError
    (:1013-1020). Same class: srcTable ?? 0 / dstTable ?? 0 in
    stream_builtins.ts:862-864. Make them throw; add
    streamTables/futureTables to the loader's required-array list for
    formatVersion 2 (plan/loader.ts:116-131 currently omits them, and
    elems(undefined) yields []).

  2. Deep-schema gap: loader validates formatVersion, top-level arrays, and
    the types table exhaustively, but initializers / trampolines /
    canonicalOptions / coreDefs are not shape-checked — a plan with
    {"op":"instantiate-module"} missing args dies as a raw TypeError
    in runInitializers, not a PlanError. Loud but untyped; close the
    gap to typed errors.

Found in the 2026-08-10 adversarial conformance review (runtime + translator vs component-model @ 73b7ad5 definitions.py; wasmtime-environ 47.0.3 treated as trusted).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions