Declare each document version as its full schema id

CultLib's C1 cut puts a document's declared version on the wire as its
schema id and refuses to register a binding whose version lacks `.vN`.
Every Stonks definition declared the bare version "v1", so after C1 the
provider advertisement sent to Odin would carry "v1", and registration
would refuse it first.

Each schemaVersion now equals the definition's schemaId, which is also
<schemaName>.v1. Against current CultLib main nothing moves: TS stores
and wire puts key records by schemaId, which is unchanged. Only the
schemaVersion field of the catalog entry the cache builds for newly
written records changes, together with the canonical JSON built from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 22:58:17 +02:00
commit 3f6e91c962

View file

@ -153,7 +153,7 @@ const requestEventDocument = defineDocumentType({
type: "request-event",
schemaId: "stonks.request_event.v1",
schemaName: "stonks.request_event",
schemaVersion: "v1",
schemaVersion: "stonks.request_event.v1",
schema: passThroughSchema,
indexes: {
direction: "direction",
@ -164,7 +164,7 @@ const marketSnapshotDocument = defineDocumentType({
type: "market-snapshot",
schemaId: "stonks.market_snapshot.v1",
schemaName: "stonks.market_snapshot",
schemaVersion: "v1",
schemaVersion: "stonks.market_snapshot.v1",
schema: passThroughSchema,
global: true,
});
@ -172,7 +172,7 @@ const providerAdvertisementDocument = defineDocumentType({
type: "provider-advertisement",
schemaId: "gamecult.eve.provider_advertisement.v1",
schemaName: "gamecult.eve.provider_advertisement",
schemaVersion: "v1",
schemaVersion: "gamecult.eve.provider_advertisement.v1",
schema: passThroughSchema,
name: (value) => value?.providerId || providerId,
});
@ -180,7 +180,7 @@ const commandBoundaryDocument = defineDocumentType({
type: "command-boundary",
schemaId: "stonks.command_boundary.v1",
schemaName: "stonks.command_boundary",
schemaVersion: "v1",
schemaVersion: "stonks.command_boundary.v1",
schema: passThroughSchema,
name: (value) => value?.boundaryId || value?.daemonId || "stonks",
});
@ -188,7 +188,7 @@ const transportProfileDocument = defineDocumentType({
type: "transport-profile",
schemaId: "stonks.transport_profile.v1",
schemaName: "stonks.transport_profile",
schemaVersion: "v1",
schemaVersion: "stonks.transport_profile.v1",
schema: passThroughSchema,
name: (value) => value?.profileId || value?.daemonId || "stonks",
});
@ -196,7 +196,7 @@ const eveSurfaceDocument = defineDocumentType({
type: "eve-surface",
schemaId: "gamecult.eve.surface_state.v1",
schemaName: "gamecult.eve.surface_state",
schemaVersion: "v1",
schemaVersion: "gamecult.eve.surface_state.v1",
schema: passThroughSchema,
global: true,
});