Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d355947
port: import Nightseam v0.6.0 runtime and transport sources verbatim
jm9e Sep 26, 2026
042df79
transports, profile: adapt the seam, pipe, WebSocket and bitwire/1 en…
jm9e Sep 26, 2026
ff4ce22
transports: gofmt the conformance suite
jm9e Sep 26, 2026
9019801
core, dispatch, engine: adapt the v0.6.0 runtime to Bitwire 0.3.0
jm9e Sep 26, 2026
467bc12
docs: record where each ported piece went and what changed
jm9e Sep 26, 2026
5ce1e0d
port: import Nightseam v0.6.0 TypeScript runtime and transport source…
jm9e Sep 26, 2026
e3237a7
conformance: interoperate with Nightseam v0.6.0 peers over real WebSo…
jm9e Sep 26, 2026
2d8c45f
docs: record the port's provenance and the milestone's changes
jm9e Sep 26, 2026
cf5cef9
core, engine: copy a message before validating it
jm9e Sep 26, 2026
2eafd8a
dispatch: port the v0.6.0 dispatcher and wire tests
jm9e Sep 26, 2026
53abde5
dispatch: port the v0.6.0 full-carrier send tests
jm9e Sep 26, 2026
bd80e2c
engine: port the v0.6.0 root cancellation-reservation tests
jm9e Sep 26, 2026
90041b7
engine: answer a call the peer's end cut off as disconnected, and sen…
jm9e Sep 26, 2026
b092aee
build: smoke the runtime path from a fresh public Go module
jm9e Sep 26, 2026
7766a1d
core: port the v0.6.0 At, Mount and path encoding tests
jm9e Sep 26, 2026
c4348bc
core: port the v0.6.0 local pair tests
jm9e Sep 26, 2026
1290375
core: test the pair's close, pending-slot and closed-carrier fixes
jm9e Sep 26, 2026
21af095
core: port the v0.6.0 invocation lifecycle tests and experiment
jm9e Sep 26, 2026
1a0dd08
core: port the v0.6.0 publication and trace tests through the root
jm9e Sep 26, 2026
b88a9d3
core: port the v0.6.0 ForwardWire tests
jm9e Sep 26, 2026
35ae910
request: settle an unencodable bridged reply instead of stranding its…
jm9e Sep 26, 2026
02a652a
engine: port v0.6.0's peer, backpressure, pacing and Unicode tests
jm9e Sep 26, 2026
eefc1ef
engine: hold the bitwire/1 vectors by a running peer of each role
jm9e Sep 26, 2026
6aa3f31
engine: port v0.6.0's seam and Prepare tests
jm9e Sep 26, 2026
6ca3144
engine: hold R27 close codes and R28 answers at the root
jm9e Sep 26, 2026
9c3e393
engine/websocket: port v0.6.0's connection-setup tests
jm9e Sep 26, 2026
9c93bb7
engine: hold the fixed peer end and close code in the ported tests
jm9e Sep 26, 2026
282b9ec
docs: describe the runtime path and record its release unit
jm9e Sep 26, 2026
9d3d3f6
core, dispatch, engine, transports: adapt the v0.6.0 TypeScript runti…
jm9e Sep 26, 2026
ebc02b6
core, dispatch, engine, transports: port the v0.6.0 TypeScript tests
jm9e Sep 26, 2026
a5de955
build, docs: check, test, smoke and release the TypeScript package fr…
jm9e Sep 26, 2026
c584d78
conformance: interoperate bitruntime's TypeScript runtime too
jm9e Sep 26, 2026
e6fbcaa
conformance: make the recorder's cancellation independent of timing
jm9e Sep 26, 2026
264e36d
request (ts): settle an unencodable bridged reply instead of strandin…
jm9e Sep 26, 2026
1f67594
core, engine, transports: fix what the independent review of the port…
jm9e Sep 26, 2026
888c8e5
ci: format every Go file and run the interoperability matrix
jm9e Sep 26, 2026
d0a38ea
docs: write the v0.2.0 release notes and the release unit's coordinates
jm9e Sep 26, 2026
1ce0f50
docs: spell every Bitspark project as its repository is named
jm9e Sep 26, 2026
ea43a68
core, engine, transports: fix what the independent review of the Type…
jm9e Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,34 @@ jobs:
with:
node-version: 24
cache: npm
cache-dependency-path: core/ts/package-lock.json
cache-dependency-path: package-lock.json
- name: Go formatting
run: test -z "$(gofmt -l core/go)"
run: test -z "$(gofmt -l $(git ls-files '*.go'))"
- run: go vet ./...
- run: go test -race -count=1 ./...
- run: npm ci --ignore-scripts
working-directory: core/ts
- run: npm run check
working-directory: core/ts
- run: npm run build
working-directory: core/ts
- run: npm test
working-directory: core/ts
- run: node scripts/package-smoke.mjs
interop:
# bitruntime and Nightseam v0.6.0, Go and TypeScript, in every pairing over
# real WebSockets, and bitruntime's bytes against Nightseam's.
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: false
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
cache-dependency-path: |
package-lock.json
conformance/interop/nightseam/ts/package-lock.json
- run: npm ci --ignore-scripts
- run: npm run build
- run: node scripts/interop.mjs
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ jobs:
with:
node-version: 24
cache: npm
cache-dependency-path: core/ts/package-lock.json
cache-dependency-path: package-lock.json
- name: Verify version
run: test "$GITHUB_REF_NAME" = "v$(node -p "require('./core/ts/package.json').version")"
run: test "$GITHUB_REF_NAME" = "v$(node -p "require('./package.json').version")"
- run: go vet ./...
- run: go test -race -count=1 ./...
- run: npm ci --ignore-scripts && npm run check && npm run build && npm test
working-directory: core/ts
- run: node scripts/package-smoke.mjs
- run: node scripts/interop.mjs
- run: node scripts/go-smoke.mjs "$GITHUB_REF_NAME"
- name: Pack release
run: |
mkdir release
npm pack ./core/ts --pack-destination release
npm pack . --pack-destination release
cd release
sha256sum *.tgz > SHA256SUMS
- name: Publish source and package artifacts
Expand Down
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# Working here as an agent

Read the [charter](CHARTER.md), and in Bitwire read
Read the [charter](CHARTER.md), and in bitwire read
[decision 0007](https://github.com/Bitspark/bitwire/blob/main/docs/decisions/0007-using-bitwire-never-requires-nightseam.md),
[decision 0010](https://github.com/Bitspark/bitwire/blob/main/docs/decisions/0010-bitwire-holds-the-contract-and-bitruntime-implements-it.md),
[decision 0012](https://github.com/Bitspark/bitwire/blob/main/docs/decisions/0012-explicit-data-and-wire-trees.md)
and the [carrier specification](https://github.com/Bitspark/bitwire/blob/main/docs/wire/carriers.md),
before changing this tree.

- Implement the Bitwire contract; never redefine it. If the contract or a
specification looks wrong, raise it in Bitwire, don't work around it here.
- Implement the bitwire contract; never redefine it. If the contract or a
specification looks wrong, raise it in bitwire, don't work around it here.
- Use `Wire.send(message)` and full `WireTree = DeixisNode<Wire>`, symmetric
with Bitstore's `Data.read()` / `DataTree = DeixisNode<Data>`. The old
with bitstore's `Data.read()` / `DataTree = DeixisNode<Data>`. The old
path-taking access is explicitly `AddressedWire`. Never disguise an opaque
router as a full tree or implement the superseded `End` naming proposal.
- Depend on Bitwire and, in their own modules, on transport libraries. Never
depend on Nightseam, bittype or Bitlink.
- When porting from Nightseam:
- Depend on bitwire and, in their own modules, on transport libraries. Never
depend on nightseam, bittype or bitlink.
- When porting from nightseam:
- port from an identified commit;
- keep the released v0.6.0 apart from its unreleased commits;
- record the provenance in `NOTICE`;
- add no aliases or re-exports.
- Test against Bitwire's independent cases and vectors. Never make an
- Test against bitwire's independent cases and vectors. Never make an
expectation match what the code happens to do.
- Treat Nightseam's recorded defects (nightseam#720–#724) as acceptance criteria
- Treat nightseam's recorded defects (nightseam#720–#724) as acceptance criteria
for the ported code.
- After the initial bootstrap, use a branch or worktree and a pull request.
Squash a green change onto `main`.
Expand Down
25 changes: 22 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,29 @@

## Unreleased

- Implement the path hand-written adapters use, ported from nightseam v0.6.0
(`5cc9723`) with provenance in `NOTICE`: the transport seam, in-memory pipe
and WebSocket (`transports`); `At`, `Mount`, `Forward`, the local pair and the
invocation lifecycle (`core`); the dispatcher and the `Call`, `Emit`,
`Handle` and `Register` helpers (`dispatch`); and the `bitwire/1` protocol
engine with WebSocket connection setup (`engine`). The engine sends, accepts
and refuses exactly what v0.6.0 does and presents the protocol only through
its root Endpoint.
- Fix rather than port nightseam's recorded defects in this path: a closing
pair answers its queued refusals (nightseam#722), a pair response frees its
call's slot before the caller holds it (nightseam#658), every ended carrier
classifies as one closed error that forwarding answers as `disconnected`,
observe-only close codes are never sent, and forwarding fails only a refused
message. See [the port record](docs/port-from-nightseam.md).
- Hold the engine to nightseam v0.6.0 peers over real WebSockets in both roles
and both languages, and to its bytes (`scripts/interop.mjs`).

## 0.1.0 (26 September 2026)

- Implement the first Go/TypeScript structural core: full generic tree
construction/selection/decomposition, derived sending, and an explicit
addressed facade with exact UTF-8 path conversion. Validate with independent
Bitwire structural observations, native edge cases and package consumers.
bitwire structural observations, native edge cases and package consumers.
Establish source-tag and GitHub tarball delivery for this bounded core;
carriers and the wider runtime/consumer migration remain pending.

Expand All @@ -17,11 +36,11 @@

- Name the old opaque addressed access `AddressedWire` and keep the
Endpoint/return-capability boundary explicit. Update the charter, agent
instructions and migration kickoff to follow Bitwire decision 0012 without
instructions and migration kickoff to follow bitwire decision 0012 without
claiming the runtime or consumer networking migration is implemented.

- Document the family component-first layout with two-letter language directories,
command paths and explicit adoption notes for existing source. Add the interactive
kickoff for the first runtime and bitsystem3 migration.

- Charter the repository (Bitwire decision 0010): what it owns, what it promises and how that is versioned, what independent evidence checks it, and which change its separation makes easier.
- Charter the repository (bitwire decision 0010): what it owns, what it promises and how that is versioned, what independent evidence checks it, and which change its separation makes easier.
55 changes: 32 additions & 23 deletions CHARTER.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# Charter

[Bitwire decision 0010](https://github.com/Bitspark/bitwire/blob/main/docs/decisions/0010-bitwire-holds-the-contract-and-bitruntime-implements-it.md)
[bitwire decision 0010](https://github.com/Bitspark/bitwire/blob/main/docs/decisions/0010-bitwire-holds-the-contract-and-bitruntime-implements-it.md)
requires every new repository to open with answers to four questions. A
repository owns an independently useful compatibility commitment. A module owns a
coherent semantic decision.

## 1. What decisions does it own?

How the Bitwire contract is implemented in Go and TypeScript, including the
How the bitwire contract is implemented in Go and TypeScript, including the
maintainer's `Wire` / `WireTree` naming decision:

- module layout and package coordinates;
- concurrency, buffering and backpressure strategy, and resource bounds within the
carrier contract;
- the engine's public hooks for context, observation and tracing. These are
designed together with Bitwire's received-context contract change.
- which transports ship, following Bitwire decision 0009:
designed together with bitwire's received-context contract change.
- which transports ship, following bitwire decision 0009:
- the in-memory pipe;
- WebSocket;
- `bitwire-stream/1` over stdio, TCP and Unix sockets.
- the live-reference mechanism and tunnels. They depend on stated capabilities (an
Endpoint plus lifetime and scope), not on a concrete peer.
- concrete full `WireTree` construction, partial selection, decomposition and
reconstruction, using Deixis's generic byte-keyed structural contract;
reconstruction, using deixis's generic byte-keyed structural contract;
- derived sending through `select(tree, path).own().send(message)` and explicit
adapters to the separate `AddressedWire` carrier access contract. An opaque
router does not become a full tree merely by being wrapped or renamed.

It does **not** own:

- the contract, the protocol, the carrier contract or the conformance expectations,
which are Bitwire's;
which are bitwire's;
- declaration semantics or identity, which are bittype's;
- adapters or the identity check, which are Bitlink's;
- adapters or the identity check, which are bitlink's;
- validation, which is bitschema's;
- authority, which stays with its consumers.

The naming across the two families is `WireTree = DeixisNode<Wire>` and
`DataTree = DeixisNode<Data>`. `Wire.send(message)` is addressless;
`Data.read()` reads bytes. Bitstore owns `Data` and `DataTree`, and Deixis owns
`Data.read()` reads bytes. bitstore owns `Data` and `DataTree`, and deixis owns
the common structure and laws. Materialized `DeixisNode<Bytes>` values remain
the storage codec's snapshots. This charter does not move storage implementation
into bitruntime.
Expand All @@ -53,17 +53,23 @@ capabilities remain separate from the native primitive rename.

Each release states:

- which Bitwire contract version it implements;
- which bitwire contract version it implements;
- which protocol revisions it implements (`bitwire/1`, …);
- which conformance suite revision it passes.

Modules are versioned independently. The first structural-core milestone uses
one root Go module, `github.com/Bitspark/bitruntime`, with package `core/go`, and
one TypeScript package, `@bitspark/bitruntime-core`, in `core/ts`. The initial
root `v0.1.0` tag versions these two implementations together. Future components
need their module boundaries recorded before joining this release unit or
publishing separately. Before 1.0 there is no compatibility promise. There are
no aliases or re-exports of Nightseam.
Modules are versioned independently. The runtime path's components — core,
transports, engine and dispatch — form one release unit: one root Go module,
`github.com/Bitspark/bitruntime`, whose packages are `core/go`,
`transports/go`, `transports/websocket/go`, `engine/go`, `engine/websocket/go`
and `dispatch/go`, and one TypeScript package, `@bitspark/bitruntime`, with a
subpath per component. Root tags version them together; `v0.1.0` released the
structural core alone as `@bitspark/bitruntime-core`. They move together because
the engine and the pair create the invocations and received context that
dispatch reads, which the TypeScript package keeps private to itself. Later
components (live references, tunnels, telemetry, authentication integration)
record their module boundaries before joining this unit or publishing
separately. Before 1.0 there is no compatibility promise. There are no aliases
or re-exports of nightseam.

The initial release process publishes Go through its source tag and TypeScript
as a GitHub release tarball with checksums. Registry publication is separately
Expand All @@ -72,13 +78,16 @@ configured and cannot be inferred from the presence of a tarball. See

## 3. What independently written evidence checks the promise?

- Bitwire's conformance cases, run against released bitruntime from a test-only
module in Bitwire.
- The initial core runs its actual implementations against Bitwire's independent
- bitwire's conformance cases, run against released bitruntime from a test-only
module in bitwire.
- The initial core runs its actual implementations against bitwire's independent
structural oracle as well as native edge cases. These observations do not
stand in for the still-pending carrier/runtime suites.
stand in for the carrier/runtime suites, which bitwire runs from its own
test-only module.
- nightseam v0.6.0's `bitwire/1` tables, vendored byte for byte in
`vectors/bitwire-1`, and the byte-level transcripts of `scripts/interop.mjs`.
- The portable byte vectors for `bitwire-stream/1`.
- Interoperability runs against Nightseam v0.6.0 peers, until the last consumer
- Interoperability runs against nightseam v0.6.0 peers, until the last consumer
moves.
- Deliberately unlawful implementations, which check that the cases reject
violations.
Expand Down Expand Up @@ -106,11 +115,11 @@ more:
| live | Scopes, bindings, owners and release for live references |
| tunnel | Many channels over one connection |
| telemetry (optional) | Observation and tracing adapters |
| auth-integration (optional) | Wire-level authentication integration above Archon |
| auth-integration (optional) | Wire-level authentication integration above archon |

## The first milestone

bitsystem3 is the first consumer to move off Nightseam. It needs the path its
bitsystem3 is the first consumer to move off nightseam. It needs the path its
hand-written adapters use: carriers, dispatch, helpers, selection and connection
setup.

Expand Down
25 changes: 15 additions & 10 deletions LAYOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ directory. Do not organize implementations as repository-root `go/` or `ts/`,

Use exactly two lowercase letters: `go`, `ts`, `py`, `rs`, `hs`, `cc`,
`jv`, `sw`; other assigned codes include `rb`, `kt`, `cs` and `sh`.
Bitwire already uses `hs` for Haskell. Service SDKs and their source manifests
bitwire already uses `hs` for Haskell. Service SDKs and their source manifests
also follow their own language registry; register a code there before using it.

Source, native tests and language-specific package metadata belong with the
Expand All @@ -34,15 +34,20 @@ rewrite an immutable published release or bypass a frozen-foundation policy.

## Adoption in this repository

The initial structural core is delivered in `core/{go,ts}`. Its Go module
manifest stays at the root; TypeScript package metadata stays in `core/ts`.
The next runtime milestone uses `transports/{go,ts}`, `engine/{go,ts}` and
`dispatch/{go,ts}`. Later modules use the same shape:
`live/{go,ts}`, `tunnel/{go,ts}`, `telemetry/{go,ts}` and
`auth-integration/{go,ts}`. Those are intended paths, not delivered packages.
Do not create empty language packages. The module/package coordinates and
release process are specified in [RELEASING.md](RELEASING.md) for the core;
later modules need their own explicit allocation before release.
The runtime path is delivered in `core/{go,ts}`, `transports/{go,ts}`,
`transports/websocket/go`, `engine/{go,ts}`, `engine/websocket/go` and
`dispatch/{go,ts}`. The Go module manifest and the TypeScript package manifest
both stay at the repository root, as build manifests of one release unit;
sources, native tests and the packages' contents stay under each component's
language directory. Shared, non-public machinery lives in
`internal/<name>/go` and `core/ts/src/internal`. Language-neutral test data
lives in `vectors/`, and test-only interoperability programs in
`conformance/interop/<implementation>/<lang>`.

Later modules use the same shape: `live/{go,ts}`, `tunnel/{go,ts}`,
`telemetry/{go,ts}` and `auth-integration/{go,ts}`. Those are intended paths,
not delivered packages. Do not create empty language packages. Record a later
module's coordinates in [RELEASING.md](RELEASING.md) before it is released.

Start the first consumer migration with the
[kickoff prompt](docs/bitsystem3-migration-kickoff.md).
45 changes: 45 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,48 @@ The structural-core implementations are written against the public Bitwire
0.3.0 contract. Structural test expectations are derived from Bitwire's
independent conformance/trees/expected.json under Apache-2.0. No Nightseam
runtime source is ported in the v0.1.0 structural core.

Ported from Nightseam
---------------------

The transports, the addressed operators, the local pair, the invocation
lifecycle, the dispatcher and helpers, and the bitwire/1 protocol engine are
ported from Nightseam (https://github.com/Bitspark/nightseam), Copyright 2026
Bitspark and the Nightseam contributors, licensed under the Apache License,
Version 2.0. The port is from the released v0.6.0 only, commit
5cc9723a24646c40ed1861f892b2b23eb6d785d7; none of its later, unreleased commits
is included. The unmodified sources are recorded in this repository's history
as their own commit, and every modification is a later commit.

Nightseam v0.6.0 bitruntime
duplex/go/duplex.go, pipe.go transports/go
duplex/go/ws/ws.go transports/websocket/go
duplex/go/wire.go core/go/addressed.go, internal/profile/go
runtime/go/wire_pair.go core/go/pair.go
runtime/go/invocation.go core/go/invocation.go
runtime/go/publication.go,
meta.go, trace.go core/go
runtime/go/wire.go core/go/forward.go, core/go/errors.go,
dispatch/go/dispatch.go,
internal/request/go, engine/go/wire.go
runtime/go/dispatcher.go dispatch/go/dispatcher.go
runtime/go/peer.go engine/go/peer.go, internal/profile/go
runtime/go/http.go engine/websocket/go
runtime/go/json.go,
internal/scalarjson internal/profile/go
duplex/ts/src/index.ts transports/ts
duplex/ts/src/wire.ts core/ts/src/addressed.ts,
core/ts/src/internal/path.ts
runtime/ts/src/wire-pair.ts,
invocation.ts, trace.ts,
error.ts core/ts/src
runtime/ts/src/envelope.ts,
unicode.ts core/ts/src/internal
runtime/ts/src/wire.ts dispatch/ts/src, core/ts/src/forward.ts,
core/ts/src/internal, engine/ts/src
runtime/ts/src/dispatcher.ts dispatch/ts/src/dispatcher.ts
runtime/ts/src/peer.ts engine/ts/src/peer.ts
runtime/go and runtime/ts tests the corresponding *_test.go and ts/test

The files under vectors/bitwire-1/ are byte-identical copies of Nightseam
v0.6.0's conformance/tables/frames.json, serials.json and unicode.json.
Loading
Loading