Skip to content

Consider migrating class-identity checks to deltic A8 recognition predicates #48

Description

@lann

Deltic's embedder-api amendment A8 (pinned as of 0.1.0-pre.g50778a1, PR #47) removes class identity from the embedder API: cross-boundary brands are Symbol.for registry symbols carried by @deltic/protocol, re-exported unchanged from @deltic/runtime/embedder, with recognition predicates for consumers.

This repository still recognizes deltic values by class identity:

  • js/deltic/websocket.ts:526error instanceof WitError
  • js/deltic/websocket.ts:897stream instanceof Stream
  • examples/deltic-demo/run.ts:129err instanceof WitError

Under the repo's own single-copy pin discipline (exam-deltic, the MODULE-IDENTITY comments) these are correct. The exposure is downstream: js/deltic/websocket.ts is the browser-first host module, and an embedder that combines it with a different deltic pin in its graph gets two runtime copies — upstream now diagnoses stateful cross-copy traffic loudly (A8's copy census), but our instanceof checks would silently fail to recognize foreign-copy values before upstream ever sees them.

Decision to make: migrate the three sites to the A8 recognition predicates (making the host module robust to multi-copy graphs), or record the single-copy requirement as a stated constraint of consuming js/deltic/websocket.ts and keep instanceof. If migrating, the MODULE-IDENTITY comments narrow to the remaining reasons for the pin gate (one translator/runtime plan-format coupling per graph, review surface).

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