conformance/

directory
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2026 License: Apache-2.0

README

Conformance

Status: 0.2 reference composition plus a preserved historical 0.1.0 runtime baseline.

Current 0.2 composition reference

Run node scripts/composition.mjs for the Go and TypeScript reference proof. It exercises one receive owner, sibling and overlapping selections through an explicit dispatcher, nested selection/mount/forward preservation, and borrowed endpoint lifetime. Actual selected Endpoint views share that root attachment, exercise nested receive/send paths, detach/rebind and closure notification, and preserve a captured return capability after their teardown. This is test-only composition evidence, not Nightseam adoption or a claim about generated generic adapters. The reference's longest-prefix rule is dispatcher policy; the primitive endpoint has no registration paths or matching mode. The independent oracle is shared by both drivers.

Historical 0.1.0 runtime baseline

The remaining sections describe the unchanged 0.1.0 contract at the pinned Nightseam revision. Its registration precedence and close behavior are historical observations, not obligations on Bitwire 0.2's send-only Wire. Keeping these cases runnable prevents migration from silently rewriting the previous evidence.

Run the independent cases against the Go and TypeScript Nightseam implementations:

node scripts/conformance.mjs

The runner fetches the exact public revision in nightseam.json into a temporary directory. It checks that revision, installs its pinned TypeScript dependencies, compiles the TypeScript driver, and runs both drivers. It compares every observation with the shared cases and exits unsuccessfully on any missing, extra or mismatched result. No private sibling checkout is used. Requirements are Git, Go 1.26+, Node 24+, pnpm 12.4.1 and access to public source/dependency registries. --language=go or --language=ts selects a driver; --keep-scratch retains the fetched tree for diagnosis. Temporary dependency files never become Bitwire package dependencies.

What the historical baseline establishes
Cases Observable requirement
Empty, nested and concatenated selection The request arrives at the declared root path, the callback sees a path relative to its view, and the response returns unchanged.
Selected mounted access and empty mount key Mounting consumes one segment, including an empty key; the selected child remains the destination.
Opaque paths Empty segments, embedded separators, split segments, composed/decomposed Unicode and scalar/NUL strings remain distinguishable in actual dispatch.
Exact and namespace routes Exact match wins, otherwise the longest segment prefix wins; duplicate registration is refused.
Return access Selection, mounting and forwarding preserve capability identity at their own boundaries.
Mount and registration lifetime Detach is idempotent and releases registration; closing a mount notifies its own receiver once and frees its child registration; its borrowed child still answers. Closing a selected view closes its endpoint.
Forwarding lifetime Requests and responses traverse two local carriers; detaching forwarding leaves both borrowed origins usable.

The Go driver and TypeScript driver use the public runtime's real local pairs, selection, mounts and forwarding. Their observers delegate every operation; they supply no replacement routing, queue or return implementation. Drivers record actual results. Expectations are authored separately in the fixture and checked by the runner.

The fixture has four scenario kinds: access specifies prefixes, nested selections, an optional mount key, a call path and payload; routing specifies registrations and calls; lifetime follows the detach/close sequence above; forwarding connects and detaches two real pairs. Each case has a unique id and an expected observation object. Drivers ignore expected; only the runner reads it. The same input and expected output are used in both languages.

Profile boundaries exposed by the cases

Path validity does not guarantee admission of every frame. The retained nightseam.duplex/1 profile requires a nonempty root path for requests and events. [] is a valid relative path but a root request there is refused; [""] is a nonempty path and reaches its distinct registered operation. The opaque-path case asserts both observations. Empty selection is tested with the supported ['call'] operation; a selected nonempty prefix may use [] as a suffix. See the pinned profile.

Similarly, a new carrier may map a request's return capability to own its correlation and lifetime. The identity requirements concern pure composition: the observers compare before/after selection, mounting or forwarding, never across a new local pair's admission boundary. The response itself is exercised end to end through the mapped capability.

What remains distinct

This is evidence about the pinned implementation before adoption. The Go driver uses Nightseam's nominal native types. The TypeScript driver also imports Nightseam's native declarations. Neither claims that Nightseam already imports or re-exports published Bitwire types. Adoption needs separate checks using the released artifacts and migrated consumer; then the drivers can use that version.

The baseline does not yet cover every frame field, asynchronous admission laws, pending-request cancellation after detach, concurrent lifetime interleavings, remote carriers, checked invocation context, scoped references or reference release. Those are explicit remaining conformance/profile obligations, not guarantees inferred from these ten cases. Runtime-specific coverage stays with its owner. Declaration compilation alone is never behavioral conformance.

Adapter integration still required

The next layer compares a declared model used directly and through local, selected, mounted and remote wires. Generic cases vary a slot between data and models with callable behavior. The same generic adapter must preserve behavior without inspecting the particular slot implementation. That checks both access composition and the generator's distinct type-substitution obligation.

Directories

Path Synopsis
reference
go command
This executable is a test-only composition reference, not a shipped runtime.
This executable is a test-only composition reference, not a shipped runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL