Add real browser CultMesh transport proof
This commit is contained in:
parent
4af7398372
commit
8eb89e38ec
29 changed files with 2936 additions and 47 deletions
|
|
@ -4,23 +4,38 @@ Date: 2026-08-17
|
|||
|
||||
## Status
|
||||
|
||||
This is the implementation map for the missing real-browser checkpoint. The
|
||||
current `samples/eve-two-runtime` proof uses jsdom and one local TypeScript
|
||||
CultMesh node. It is a clean package-consumer and contract-validation proof,
|
||||
not browser networking.
|
||||
This is the implementation map for the browser Verse boundary.
|
||||
`samples/eve-two-runtime` remains the clean package-consumer/jsdom checkpoint.
|
||||
`samples/eve-browser-network` runs a durable C# provider, a real Chromium Eve
|
||||
lowerer, and an independent C# headless observer over the same authenticated
|
||||
binary CultNet WebSocket route. It proves one canonical command effect,
|
||||
idempotent retry, shared observation, and provider restart.
|
||||
|
||||
The current substrate is incomplete:
|
||||
The current substrate has a browser client boundary and local live proof, but
|
||||
not a complete public Verse proof:
|
||||
|
||||
- `cultmesh-ts` is a Node package and imports `node:dgram` at its root;
|
||||
- `cultnet-ts` mixes browser-safe schema contracts with Node transport,
|
||||
filesystem, crypto, stream, and UDP modules;
|
||||
- `cultnet-ts/contracts` is the browser-safe contract entrypoint; the package
|
||||
root still includes Node transport, filesystem, crypto, stream, and UDP
|
||||
modules and must not enter browser bundles;
|
||||
- C# and TypeScript now share `cultnet.database_subscribe.v0`,
|
||||
`cultnet.database_unsubscribe.v0`, and `cultnet.database_change_raw.v0`;
|
||||
the browser-safe transport package that consumes them does not exist yet;
|
||||
- Kotlin has a channel-aware WebSocket transport adapter; C# and TypeScript do
|
||||
not expose the equivalent browser/server pair;
|
||||
`cultmesh-browser` consumes those messages as explicit document leases;
|
||||
- `cultmesh-browser` owns stable identity, route refresh, resubscription, and
|
||||
typed operation correlation without exposing direct document writes;
|
||||
- Kotlin has a channel-aware WebSocket transport adapter, TypeScript has the
|
||||
browser client, and `GameCult.Networking.WebSockets` provides the bounded C#
|
||||
schema server host adapter;
|
||||
- Hermodr can lower Odin state into a browser, but it is an infrastructure
|
||||
runtime, not the missing clean-consumer game API.
|
||||
runtime, not the clean-consumer game API;
|
||||
- the sample rendezvous port currently returns one configured local route;
|
||||
discovery from a live Odin and automatic route rotation are not yet in the
|
||||
executable cross-runtime gate.
|
||||
- the sample validates its surface against Eve's canonical TypeScript contract,
|
||||
but its provider still carries a minimal local C# DTO mirror. The
|
||||
released-artifact gate requires the renderer-neutral C# Eve surface contract
|
||||
as an independently consumable Eve artifact; Unity must not be that contract's
|
||||
package owner.
|
||||
|
||||
## Authority Map
|
||||
|
||||
|
|
@ -83,12 +98,13 @@ Shared paths:
|
|||
|
||||
Deletion line:
|
||||
|
||||
- stop calling jsdom a browser runtime;
|
||||
- split browser-safe CultNet contracts from the Node transport package;
|
||||
- add the missing subscription messages to the shared generated contract
|
||||
catalog instead of retyping them in a browser adapter;
|
||||
- do not retain a sample-only WebSocket protocol after the canonical adapter
|
||||
exists.
|
||||
- the jsdom checkpoint remains labeled as a Node-hosted DOM proof;
|
||||
- browser applications import `cultmesh-browser` and
|
||||
`cultnet-ts/contracts`, never the Node-only package roots;
|
||||
- subscription messages remain one shared schema contract across the C# and
|
||||
TypeScript catalogs;
|
||||
- the real provider adapter must consume the canonical WebSocket message lane;
|
||||
no sample-only WebSocket protocol is permitted.
|
||||
|
||||
## Required Runtime Shape
|
||||
|
||||
|
|
@ -96,16 +112,24 @@ The browser-facing package must be importable by a standards-mode browser or a
|
|||
normal bundler without Node polyfills. It exposes a narrow API shaped like:
|
||||
|
||||
```ts
|
||||
const mesh = await CultMeshBrowser.connect({
|
||||
const mesh = await CultMeshBrowserClient.connect({
|
||||
rendezvous: odin,
|
||||
verseId: "sample.counter",
|
||||
providerId: "sample.counter-provider",
|
||||
runtimeId: "sample.browser",
|
||||
});
|
||||
|
||||
using surface = await mesh.leaseDocument(eveSurface, "eve:surface:counter");
|
||||
surface.watch(render);
|
||||
using surface = await mesh.leaseRawDocument({
|
||||
schemaId: "gamecult.eve.surface.v1",
|
||||
recordKey: "eve:surface:counter",
|
||||
});
|
||||
surface.watch(record => render(decodeCultNetPayload(record)));
|
||||
|
||||
const receipt = await mesh.invoke(incrementCounter, {}, {
|
||||
const receipt = await mesh.invoke({
|
||||
serviceId: "sample.counter",
|
||||
operation: "increment",
|
||||
payloadSchema: "sample.increment.v1",
|
||||
payload: {},
|
||||
idempotencyKey: crypto.randomUUID(),
|
||||
});
|
||||
```
|
||||
|
|
@ -136,6 +160,20 @@ identity, authority, and idempotency validation happen before provider code.
|
|||
|
||||
## Acceptance Gate
|
||||
|
||||
Current executable coverage from `scripts/verify-eve-browser-network.mjs`:
|
||||
|
||||
- authenticated binary C# WebSocket provider;
|
||||
- real Chromium and independent C# headless consumers;
|
||||
- shared surface and counter document leases;
|
||||
- Eve button to typed operation to provider receipt to shared state;
|
||||
- duplicate idempotency key produces one effect;
|
||||
- provider restart rehydrates the `.cc` state;
|
||||
- generated browser bundle contains no `node:` builtin import.
|
||||
|
||||
The full public Verse gate still requires live Odin discovery, physical route
|
||||
rotation during retained leases, released-artifact-only .NET consumption, and
|
||||
Windows/Linux CI.
|
||||
|
||||
From an empty temporary consumer using packed/released artifacts only:
|
||||
|
||||
1. start a provider daemon with one durable counter document and one validated
|
||||
|
|
|
|||
|
|
@ -61,11 +61,17 @@ cd E:\Projects\EveUnity
|
|||
powershell -ExecutionPolicy Bypass -File .\scripts\run-release-consumer-tests.ps1
|
||||
```
|
||||
|
||||
This checkpoint proves clean package consumption, canonical Eve contract
|
||||
This first checkpoint proves clean package consumption, canonical Eve contract
|
||||
validation, and two independent lowering/observation consumers inside Node. It
|
||||
does **not** claim a real browser process, an Odin-discovered network hop, or
|
||||
cross-language command execution. Those are the next public Verse conformance
|
||||
gates; do not cite this sample as evidence that they exist. Their owner map and
|
||||
executable acceptance contract are recorded in
|
||||
cross-language command execution. Do not cite it as evidence for those layers.
|
||||
|
||||
The next executable checkpoint is
|
||||
[`samples/eve-browser-network`](../../../../samples/eve-browser-network/README.md).
|
||||
It runs a durable C# provider, a real Chromium Eve lowerer, and an independent
|
||||
C# headless observer over the same authenticated binary CultNet WebSocket lane.
|
||||
It proves command idempotency and provider restart. Live Odin discovery and
|
||||
route rotation remain separate gates. Their owner map and full acceptance
|
||||
contract are recorded in
|
||||
[`browser-verse-transport.md`](../browser-verse-transport.md).
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue