Make Eve onboarding prove packaged authority routes
This commit is contained in:
parent
6c848bd6c0
commit
6835ea4c10
11 changed files with 151 additions and 49 deletions
|
|
@ -34,7 +34,7 @@ using var node = await CultMesh.CreateNodeAsync("counter.cc", new CultMeshNodeOp
|
|||
CacheOptions = new CultCacheOpenOptions { Registry = registry },
|
||||
DatabaseOptions = new CultNetDatabaseOptions
|
||||
{
|
||||
RuntimeId = "sample.counter-provider",
|
||||
RuntimeId = "sample.counter-daemon",
|
||||
DocumentRegistry = documents
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
# 2. Connect A Client By Stable Identity
|
||||
|
||||
Clients address a live session by stable Verse/provider identity. In this tutorial,
|
||||
`sample.counter` is the Verse id and `sample.counter-provider` is the authority
|
||||
`sample.counter` is the Verse id and `sample.counter-daemon` is the authority
|
||||
runtime Odin currently advertises for it. Application clients pass that typed
|
||||
pair, never a socket address and never one ambiguous string that might mean
|
||||
either identity. A product may expose only a Verse choice to its user; its
|
||||
selection owner then resolves the provider runtime from Odin's descriptor before
|
||||
opening the session. Discovery owns the current physical routes, and the session
|
||||
manager owns connection reuse, path rotation, and transport failure state.
|
||||
Each Odin route binds that authority runtime to one endpoint, protocol set, and
|
||||
generation. The client verifies the same tuple with the connected peer before
|
||||
the session becomes online; runtime membership and endpoint reachability are
|
||||
not independent routing evidence.
|
||||
|
||||
```csharp
|
||||
using GameCult.Mesh;
|
||||
|
|
@ -15,7 +19,9 @@ using GameCult.Mesh;
|
|||
var odinEndpoint = Environment.GetEnvironmentVariable("ODIN_ENDPOINT")
|
||||
?? throw new InvalidOperationException("Set ODIN_ENDPOINT to the configured rendezvous route.");
|
||||
const string verseId = "sample.counter";
|
||||
var target = new CultMeshSessionTarget(verseId, "sample.counter-provider");
|
||||
var target = new CultMeshSessionTarget(verseId, "sample.counter-daemon");
|
||||
using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(30));
|
||||
var cancellationToken = timeout.Token;
|
||||
using var mesh = new CultMeshClient(new CultMeshClientOptions
|
||||
{
|
||||
RendezvousEndpoints = new[] { odinEndpoint }
|
||||
|
|
@ -65,6 +71,11 @@ network proof):
|
|||
dotnet test tests/GameCult.Mesh.Tests/GameCult.Mesh.Tests.csproj --filter FullyQualifiedName~CultMeshSessionManagerTests
|
||||
```
|
||||
|
||||
The real checkpoint in chapter 4 additionally advertises a better-priority
|
||||
endpoint for the wrong authority runtime. Both the C# and browser clients must
|
||||
ignore it, verify the intended peer, survive route replacement, and reject
|
||||
wrong-source operation responses.
|
||||
|
||||
Advanced hosts may inject lookup sources, connectors, clocks, persistence, and
|
||||
diagnostics through the lower-level discovery and session APIs. Application
|
||||
features should not need them.
|
||||
|
|
|
|||
|
|
@ -97,6 +97,10 @@ GameCult dependency is `PackageReference Include="GameCult.Eve.Surface"`.
|
|||
This proves the renderer-neutral provider contract does not require a sibling
|
||||
Eve or CultLib source tree after packaging.
|
||||
|
||||
The real-process C# sample is then rebuilt from that same temporary NuGet feed.
|
||||
The source project references in its `.csproj` are contributor convenience only
|
||||
and are disabled by the checkpoint; they are not the consumer contract.
|
||||
|
||||
The first layer builds and packs `cultcache-ts`, `cultnet-ts`, `cultmesh-ts`,
|
||||
`@gamecult/eve-contracts`, and `@gamecult/eve-browser-lowering`, installs the
|
||||
tarballs into an empty temporary consumer, and runs
|
||||
|
|
@ -108,11 +112,11 @@ both consumers converge on the same state and canonical receipt identity, a
|
|||
duplicate idempotency key is not applied twice, and the state plus receipt
|
||||
survive reopening the `.cc` store.
|
||||
|
||||
The second layer runs a durable C# provider, a separate local Odin fixture, a
|
||||
real Chromium Eve lowerer, and an independent C# headless observer over binary
|
||||
The second layer runs a durable C# provider, a wrong-authority decoy, a separate
|
||||
local Odin fixture, a real Chromium Eve lowerer, and an independent C# headless observer over binary
|
||||
CultNet WebSocket lanes. The open browser resolves the `sample.counter` Verse
|
||||
through the canonical catalog, survives its provider restarting on a different route,
|
||||
and resubscribes. The retained C# client then invokes a second typed operation
|
||||
through the canonical catalog, rejects the decoy route, survives its provider
|
||||
restarting on a different route, and resubscribes. The retained C# client then invokes a second typed operation
|
||||
through `CultMeshClient.InvokeAsync`; Chromium and C# observe the same
|
||||
provider-authored state and receipt chronology. The same retained C# session
|
||||
then completes 10,000 typed no-op operations under explicit p99 and post-GC
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ The counter is now one small multiplayer game:
|
|||
typed operation boundary;
|
||||
- both clients remain attached when Odin moves the Verse to a replacement
|
||||
physical provider route.
|
||||
- a better-priority route bound to another runtime remains unreachable to both
|
||||
clients throughout the chronology.
|
||||
|
||||
Run the whole chronology from the CultLib checkout:
|
||||
|
||||
|
|
@ -34,8 +36,10 @@ packages, installs those artifacts into an empty temporary consumer, and proves
|
|||
DOM/headless convergence plus `.cc` reopen. This rejects a sample that only
|
||||
works through repository-relative source imports.
|
||||
|
||||
The third checkpoint boots separate Odin, provider, Chromium, and C# headless
|
||||
processes. Chromium performs the first increment. The provider then restarts on
|
||||
The third checkpoint boots separate Odin, intended provider, wrong-authority
|
||||
decoy provider, Chromium, and C# headless processes. Its C# application is built
|
||||
from the temporary NuGet feed produced by the first checkpoint, not sibling
|
||||
project references. Chromium performs the first increment. The provider then restarts on
|
||||
a different route, Odin advertises the replacement, and the retained clients
|
||||
resubscribe without application reconnect code. C# performs the second
|
||||
increment. Both clients must observe count 2 and both canonical receipt ids.
|
||||
|
|
|
|||
|
|
@ -4,14 +4,22 @@ This series builds one typed application state and presents it through multiple
|
|||
Eve runtimes. It is maintained as an API acceptance test: examples use public
|
||||
APIs, name the owner of each decision, and include a verification checkpoint.
|
||||
|
||||
Run the complete getting-started checkpoint:
|
||||
Application consumers install released packages and do not need the source
|
||||
repositories. This checkout also contains a maintainer checkpoint that creates
|
||||
the same clean consumers from local package artifacts:
|
||||
|
||||
```powershell
|
||||
pwsh -File ./scripts/verify-eve-getting-started.ps1
|
||||
```
|
||||
|
||||
With clean sibling CultLib and Eve checkouts, the command installs missing build
|
||||
dependencies and runs three explicit evidence layers. First it packs the
|
||||
The maintainer command takes an explicit `-EveRoot` when Eve is not a sibling:
|
||||
|
||||
```powershell
|
||||
pwsh -File ./scripts/verify-eve-getting-started.ps1 -EveRoot D:\src\Eve
|
||||
```
|
||||
|
||||
It installs missing build dependencies and runs three explicit evidence layers.
|
||||
First it packs the
|
||||
CultLib managed dependency closure plus `GameCult.Eve.Surface`, then restores
|
||||
and runs an empty .NET consumer using only `PackageReference`. Next it packs the five
|
||||
TypeScript packages into another empty temporary consumer, validates the Eve surface
|
||||
|
|
@ -20,7 +28,8 @@ headless observer converge, and reopens the durable `.cc` store. Then it boots a
|
|||
durable C# provider, local Odin fixture, real Chromium lowerer, and independent
|
||||
C# client. Chromium invokes before provider replacement; C# invokes afterward.
|
||||
Both retained clients prove discovery by identity, canonical receipts, provider
|
||||
restart on another route, resubscription, and durable convergence. The retained
|
||||
restart on another route, rejection of a better-priority wrong-authority route,
|
||||
resubscription, and durable convergence. The retained
|
||||
C# session also completes 10,000 non-persistent typed operations under p99 and
|
||||
post-GC managed-memory gates.
|
||||
Set `CHROME_PATH` only when no installed Chrome, Chromium, Edge, or Playwright
|
||||
|
|
@ -58,3 +67,6 @@ native projection. CultMesh owns discovery and connection continuity.
|
|||
pull request.
|
||||
- A setup step that depends on repository internals is an API defect, not
|
||||
acceptable tutorial folklore.
|
||||
- The maintainer command may read owner checkouts to create packages. Every
|
||||
sample process it launches must consume those package artifacts rather than
|
||||
compiling through sibling project references.
|
||||
|
|
|
|||
Loading…
Reference in a new issue