Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions .github/workflows/prepare-source.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: prepare-source
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
prepare:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: false
- uses: actions/setup-node@v7
with:
node-version: 24
- name: Prepare formatting and dependency locks on the runner
shell: bash
run: |
trap 'git diff --binary > "$RUNNER_TEMP/source-preparation.patch"' EXIT
git ls-files -z '*.go' | xargs -0 -r gofmt -w
go mod tidy
npm install --package-lock-only --ignore-scripts --registry=https://registry.npmjs.org/
node scripts/naming.mjs --fix
- uses: actions/upload-artifact@v7
if: always()
with:
name: source-preparation
path: ${{ runner.temp }}/source-preparation.patch
retention-days: 7
- name: Prepared artifacts must be committed
run: git diff --exit-code
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bitruntime

Go and TypeScript implementations of [bitwire 0.6.0](https://github.com/Bitspark/bitwire/tree/v0.6.0): addressless endpoints, addressed access, complete byte-keyed trees, local pairs and WebSocket carriers, and the hydrated layer of [decision 0019](https://github.com/Bitspark/bitwire/blob/v0.6.0/docs/decisions/0019-hydrated-wire-protocol.md) ([hydrated/README.md](hydrated/README.md)).
Go and TypeScript implementations of [bitwire 0.7.0](https://github.com/Bitspark/bitwire/tree/v0.7.0): addressless endpoints, addressed access, complete byte-keyed trees, local pairs and WebSocket carriers, and the hydrated layer of [decision 0019](https://github.com/Bitspark/bitwire/blob/v0.7.0/docs/decisions/0019-hydrated-wire-protocol.md) ([hydrated/README.md](hydrated/README.md)).

Wire grants sending ground ontos values. Endpoint adds one detachable receive owner, termination and closure. AddressedWire adds a separate path parameter; an AddressedEndpoint presents that layer over an existing endpoint. WireNode is a complete deixis tree whose own values are send capabilities.

Expand All @@ -9,11 +9,11 @@ Wire grants sending ground ontos values. Endpoint adds one detachable receive ow
Install the release package and shared contract:

```sh
npm install --allow-remote=root --@bitspark:registry=https://registry.npmjs.org @bitspark/bitwire@0.6.0 https://github.com/Bitspark/bitruntime/releases/download/v0.7.1/bitspark-bitruntime-0.7.1.tgz
npm install --allow-remote=root --@bitspark:registry=https://registry.npmjs.org @bitspark/bitwire@0.7.0 @bitspark/ontos-core@0.16.0 https://github.com/Bitspark/bitruntime/releases/download/v0.8.0/bitspark-bitruntime-0.8.0.tgz
```

```ts
import { atom } from '@bitspark/bitwire';
import { atom } from '@bitspark/ontos-core';
import { pair, addressed, bind } from '@bitspark/bitruntime/core';

const [left, right] = pair();
Expand All @@ -34,7 +34,7 @@ A raw endpoint can send an atom directly. The addressed facade works on the same
## Go

```sh
go get github.com/Bitspark/bitruntime@v0.7.1
go get github.com/Bitspark/bitruntime@v0.8.0
```

Use `core/go.NewPair` and `websocket/go.Dial`, `Accept`, `NewServer` or `Listen`. They return bitwire Endpoints. `core/go.Addressed`, `Bind`, `Under` and `AsAddressed` implement the same layering as TypeScript; absent tree paths return ErrMissingPath. `hydrated/go` provides `NewScope`, `NewEndpoint`, `NewNamespace` and `NewTuple` over bitwire's hydrated declarations. A receiver runs on its endpoint's dispatcher. Close does not wait for or cancel dispatched application work.
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Releasing

One root `vX.Y.Z` tag versions the Go module and TypeScript package together. bitruntime 0.7.1 implements bitwire 0.6.0: raw ontos-codec-v1 messages, the optional `bitwire/addressed/1` layer, WebSocket `bitwire.ontos.v2` and the hydrated layer `bitwire/hydrated/1` (decision 0019).
One root `vX.Y.Z` tag versions the Go module and TypeScript package together. bitruntime 0.8.0 implements bitwire 0.7.0 with public ontos 0.16.0: raw ontos-codec-v1 messages, the optional `bitwire/addressed/1` layer, WebSocket `bitwire.ontos.v2` and the hydrated layer `bitwire/hydrated/1` (decision 0019).

- Go module: `github.com/Bitspark/bitruntime`, packages `core/go`, `websocket/go` and `hydrated/go`.
- TypeScript package: `@bitspark/bitruntime`, subpaths `/core`, `/websocket` and `/hydrated`.
Expand Down
2 changes: 1 addition & 1 deletion conformance/interop/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"fmt"
core "github.com/Bitspark/bitruntime/core/go"
ws "github.com/Bitspark/bitruntime/websocket/go"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
ontos "github.com/bitspark/ontos/core/go"
"net/http"
"os"
"time"
Expand Down
2 changes: 1 addition & 1 deletion conformance/interop/hydrated/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
core "github.com/Bitspark/bitruntime/core/go"
hydrated "github.com/Bitspark/bitruntime/hydrated/go"
websocket "github.com/Bitspark/bitruntime/websocket/go"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
ontos "github.com/bitspark/ontos/core/go"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/go/addressed.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core

import (
"errors"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
ontos "github.com/bitspark/ontos/core/go"
)

// Addressed is an inert facade over the same endpoint and its receive ownership.
Expand Down
2 changes: 1 addition & 1 deletion core/go/addressed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package core_test
import (
"errors"
core "github.com/Bitspark/bitruntime/core/go"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
ontos "github.com/bitspark/ontos/core/go"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion core/go/node_boundary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"testing"

core "github.com/Bitspark/bitruntime/core/go"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
deixis "github.com/bitspark/deixis/core/go"
ontos "github.com/bitspark/ontos/core/go"
)

type boundarySlot struct {
Expand Down
2 changes: 1 addition & 1 deletion core/go/pair.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package core

import (
"errors"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
ontos "github.com/bitspark/ontos/core/go"
"sync"
)

Expand Down
2 changes: 1 addition & 1 deletion core/go/pair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core_test

import (
core "github.com/Bitspark/bitruntime/core/go"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
ontos "github.com/bitspark/ontos/core/go"
"testing"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion core/go/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core

import (
"errors"
ontos "github.com/Bitspark/bitwire/ontos/go/core"
wire "github.com/Bitspark/bitwire/wire/go"
ontos "github.com/bitspark/ontos/core/go"
"reflect"
)

Expand Down
5 changes: 2 additions & 3 deletions core/ts/src/addressed.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { capturePath, packAddressed, unpackAddressed,
type Endpoint, type AddressedEndpoint, type Wire, type AddressedWire,
type WireNode, type Path, type Value } from '@bitspark/bitwire';
import { type Value } from '@bitspark/ontos-core';
import { capturePath, packAddressed, unpackAddressed, type Endpoint, type AddressedEndpoint, type Wire, type AddressedWire, type WireNode, type Path } from '@bitspark/bitwire';

// Inert facade: receiving is attached only by receive(), with the raw owner's lifetime.
export function addressed(endpoint: Endpoint): AddressedEndpoint {
Expand Down
3 changes: 2 additions & 1 deletion core/ts/src/pair.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { encodeMessage, type Value, type Endpoint, type Termination } from '@bitspark/bitwire';
import { type Value } from '@bitspark/ontos-core';
import { encodeMessage, type Endpoint, type Termination } from '@bitspark/bitwire';
import { pairOptions, type PairOptions } from './limits.ts';
class PairEndpoint implements Endpoint {
readonly closed: Promise<Termination>;
Expand Down
3 changes: 2 additions & 1 deletion core/ts/src/tree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Atom, type Children, type DeixisNode, type Value, type Path } from '@bitspark/bitwire';
import { Atom, type Value } from '@bitspark/ontos-core';
import { type Children, type DeixisNode, type Path } from '@bitspark/bitwire';
export function compose<T>(own: T, children: Children<T> = []): DeixisNode<T> {
const captured: Children<T> = Object.freeze(children.map(([key,node])=> {
if(!(key instanceof Atom)||!node)throw new TypeError('invalid child');
Expand Down
3 changes: 2 additions & 1 deletion core/ts/test/addressed.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {test} from 'node:test';
import assert from 'node:assert/strict';
import {atom,tuple,pathEqual} from '@bitspark/bitwire';
import { atom, tuple } from '@bitspark/ontos-core';
import { pathEqual } from '@bitspark/bitwire';
import {checkAddressedEndpoints} from '@bitspark/bitwire/conformance';
import {pair,addressed,bind,under,asAddressed,compose,MissingPathError} from '../../../dist/core/ts/src/index.js';

Expand Down
2 changes: 1 addition & 1 deletion core/ts/test/node-boundary.test.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test} from 'node:test';
import assert from 'node:assert/strict';
import {compose as composeBytes} from '@bitspark/deixis-core';
import {atom, tuple} from '@bitspark/bitwire';
import { atom, tuple } from '@bitspark/ontos-core';
import {compose, asAddressed, addressed, pair, route} from '../../../dist/core/ts/src/index.js';

// Each implementation is checked against these hand-written observations. The
Expand Down
3 changes: 2 additions & 1 deletion core/ts/test/node-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {compose as composeBytes, type DeixisNode as BytesNode} from '@bitspark/deixis-core';
import {atom, type DeixisNode, type Wire, type WireNode} from '@bitspark/bitwire';
import { atom } from '@bitspark/ontos-core';
import { type DeixisNode, type Wire, type WireNode } from '@bitspark/bitwire';
import {compose, asAddressed} from '../src/index.js';

// Check each independently declared structural surface, rather than concealing
Expand Down
2 changes: 1 addition & 1 deletion core/ts/test/pair.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {test} from 'node:test';
import assert from 'node:assert/strict';
import {atom,tuple} from '@bitspark/bitwire';
import { atom, tuple } from '@bitspark/ontos-core';
import {checkWirePair} from '@bitspark/bitwire/conformance';
import {pair,compose,select,route} from '../../../dist/core/ts/src/index.js';
const e=(id=1)=>tuple([atom([id]),atom([0,255])]);
Expand Down
32 changes: 32 additions & 0 deletions docs/ONTOS-WIRE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Shared native value migration

The owner's 4 November 2026 migration moves Go and TypeScript mixed tuple
structure to the optional `ontos/wire` package. The runtime imports public ontos
0.16.0 and bitwire 0.7.0; all raw and hydrated ground values use that same family.
`hydrated.NewTuple` and `hydratedTuple` compose the shared factory with this
runtime's leaf recognition and endpoint-to-sending-face projection. They no
longer implement or own a separate tuple class. The old runtime tuple types are
removed; inspect structure with `Items` / `items`, or the ontos native tuple type.

The factory is private. A tuple constructed under another policy is refused on
local delivery and before remote export staging. Qualified immutable children
retain their sharing; local admission does not unfold them. Ground-only tuples
still collapse to ground ontos tuples. Closed/stale capabilities remain structural
leaves; liveness is checked at the same operations as before.

The runtime retains queues and dispatch, received context, namespaces, scopes,
random export identifiers, staged whole-value admission, aliases, proxies,
ownership and lifetime. Its D8 limits still count node occurrences, depth,
atom/reference bytes and encoded frames. The separate limits of explicit
ontos/deixis conversion are not imposed on native construction or sending.

No transport bytes or negotiated protocol names change. Raw carriers and bitnode
routing still carry ground ontos frames. The pure hydrated reference/frame codec
remains in bitwire. The optional value package has no knowledge of transports,
Function, Stream, Cell or their behavior.

Qualification retains every existing vector, ownership, alias, scope, lifetime,
deep/shared value, local/network and Go/TypeScript interoperability observation.
Additional tests reject tuples from foreign qualification factories and prove
that forged containers cannot conceal endpoint ownership. There are no legacy
decoders, duplicate value implementations or compatibility tuple aliases.
50 changes: 21 additions & 29 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
# bitruntime 0.7.1
# bitruntime 0.8.0

0.7.1 publishes what 0.7.0 tagged: its library code is unchanged. The v0.7.0
release run failed in its Go consumer smoke on Linux after the tag, so v0.7.0
has a public Go module but no GitHub release or tarball. The smoke is fixed and
CI now runs it against each pushed commit.
This release uses bitwire 0.7.0 and public ontos 0.16.0. The optional ontos/wire
package owns the Go and TypeScript native mixed-value structure. The runtime
supplies its private capability-recognition and sending-face policy to that
factory. See the [migration contract](ONTOS-WIRE.md).

## The hydrated layer, introduced in 0.7.0
The runtime's duplicate tuple implementation and exported tuple class/type are
removed. Use `hydratedTuple` / `NewTuple` for runtime-qualified construction and
`items` / `Items` for observation. Ground values come directly from the public
ontos packages; the old bitwire ground subpaths and re-exports are removed.

This release adds the hydrated wire layer, realizing bitwire decision 0019 over
bitwire 0.6.0's public hydrated declarations and shared pure codec. A message may
carry live Wires inside its structure. A Wire travels as a reference that its
receiver turns back into a usable send-only Wire. A reference returning to its
owner restores the original Wire. Routers between participants see only ground
values.
Transport bytes and protocol names remain unchanged: ontos-codec-v1,
bitwire/addressed/1, bitwire.ontos.v2 and bitwire/hydrated/1. Export/import,
namespace, ownership, lifetime, liveness, context, queue, dispatch and D8 counting
rules remain runtime responsibilities. Foreign-factory tuples cannot hide owner
handles from local or remote admission. Deep and shared native values retain
their existing operational behavior.

`hydrated/go` and the TypeScript subpath `/hydrated` provide:
- **Scopes.** One per participant incarnation, with a random token. Export ids
are 16 unpredictable octets, so one reference never reveals another.
- **Endpoints.** Their sending faces are the only exportable local Wires. An
export ends when its endpoint closes, a receiver failure terminates the
endpoint, and termination is reported as bitwire's `Termination`.
- **Proxies.** Recognized throughout the namespace, so forwarding never wraps a
proxy in another.
- **Liveness and context.** Liveness is judged on send. The composition's
received context is delivered beside each value, never inside it.
- **Bounds.** Nodes, depth and bytes are counted one way in both directions.
Conversion refuses before allocating, and incoming frames count whole.
The complete release gate retains Go race tests, TypeScript checks and tests,
independent vectors, composition conformance, bidirectional Go/TypeScript
interoperability, and fresh installed consumers. Go is distributed through the
root tag; the TypeScript archive is a GitHub release asset with SHA256SUMS.

Validation covers decision 0019's observations in Go and TypeScript, the
independent vectors, the composition conformance suite, Go race tests,
Go/TypeScript hydrated interoperability in both roles and fresh installed
consumers. The core and WebSocket guarantees of 0.6.0 are unchanged. TypeScript
ships as the release tarball with SHA256SUMS; Go ships through the root tag.
This is a coordinated source/dependency cutover. It does not deploy existing
services or add Function, Stream or Cell semantics to the runtime.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module github.com/Bitspark/bitruntime
go 1.26.0

require (
github.com/Bitspark/bitwire v0.6.0
github.com/Bitspark/bitwire v0.7.0
github.com/bitspark/deixis v0.6.0
github.com/bitspark/ontos v0.16.0
github.com/bitspark/ontos/wire/go v0.16.0
github.com/coder/websocket v1.8.15
)
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
github.com/Bitspark/bitwire v0.6.0 h1:Da4R/tRW+hw615DrsaPJ2KwFz0s/kagKdgN9nXfOf1s=
github.com/Bitspark/bitwire v0.6.0/go.mod h1:RCsIrMm1o0hg/SlyG2LkXXSzj2CMLEhoOIuuw8XrePk=
github.com/Bitspark/bitwire v0.7.0 h1:5VnpAiiQ9SoyGra87O+/r9huTkm+Vy/VVyGCbCUm7to=
github.com/Bitspark/bitwire v0.7.0/go.mod h1:WedbikTlAIMhqnP7ALzbusHYwV1HRjK+w11MpCd8S8k=
github.com/bitspark/deixis v0.6.0 h1:YAbZiEB+wlQtZoTwLd2+3xGagsfVqmOEH0Fh+fzzaOA=
github.com/bitspark/deixis v0.6.0/go.mod h1:jw08wxGevbjoJPBnUaDX549ayvjIOOlLk5GXhIkxu5A=
github.com/bitspark/ontos v0.16.0 h1:/LA9+ukd9+/WgIWLShUwlTB06bfpqEo43t9CGh9umgY=
github.com/bitspark/ontos v0.16.0/go.mod h1:GLOg9USEPJXJ7RN7iiOJ7OVlyM8b3X4lN0ZVTg2G3QY=
github.com/bitspark/ontos/wire/go v0.16.0 h1:yxuAMqLzizIALYlM1gryR76xfSDn9gFqRZKuWZPABWc=
github.com/bitspark/ontos/wire/go v0.16.0/go.mod h1:SsVBydSV21ifocddxxKuyZ7zZ21F5OPV2Vot74YM3GI=
github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNUA=
github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
7 changes: 4 additions & 3 deletions hydrated/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Hydrated wires

**Status, 7 October 2026:** the realization of bitwire decision 0019, the hydrated
**Status, 4 November 2026:** the realization of bitwire decision 0019, the hydrated
wire protocol's first edition, accepted at bitwire `5b1de82`, for bitruntime
0.7.1 (first implemented in 0.7.0). It implements bitwire 0.6.0's public hydrated
0.8.0 (first implemented in 0.7.0). It implements bitwire 0.7.0's public hydrated
declarations
(`HydratedValue`, `HydratedWire`, `HydratedEndpoint`, `ReceivedContext`) and
encodes and decodes through bitwire's shared pure hydrated codec, which owns the
grammar and its bounds. No private copy of either remains here.
grammar and its bounds. No private copy of either remains here. The shared native
value structure now comes from ontos/wire; see [the migration contract](../docs/ONTOS-WIRE.md).

[The Go package](go/hydrated.go) and [the TypeScript module](ts/src/index.ts)
hold the stateful half of the protocol:
Expand Down
Loading
Loading