@wildshard/shard-format 0.79.3 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildshard/shard-format",
3
- "version": "0.79.3",
3
+ "version": "0.81.0",
4
4
  "description": "The raw shardfile format: the spec, the validator and a validate CLI. The public, versioned contract every other repo builds on.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -29,6 +29,7 @@
29
29
  "packages/wire/src/net-command.ts",
30
30
  "src/cli/*.ts",
31
31
  "src/cli/*.mjs",
32
+ "src/scripts/.kit/wildshard-agent-requests.mjs",
32
33
  "!src/cli/*.test.ts",
33
34
  "corpus/exports/**",
34
35
  "src/format/meshopt-static.mjs",
@@ -1,3 +1,4 @@
1
+ import { markedFetch } from '../scripts/.kit/wildshard-agent-requests.mjs'
1
2
  import { loadCandidate } from './corpus-candidate.ts'
2
3
  import { corpusGate } from './corpus-gate.ts'
3
4
  import {
@@ -24,8 +25,13 @@ interface CorpusArgs {
24
25
  readonly only: string | undefined
25
26
  /** ZS3: store drift blocks too (corpus.yml's nightly once ZS11 finalizes the retired and proof shards). */
26
27
  readonly strictStore?: boolean
28
+ /** The network read under the Wildshard agent marker (QA 11-25 row 128); tests pass a stub. */
29
+ readonly fetch?: typeof fetch
27
30
  }
28
31
 
32
+ /** Every read the command makes, marked through the kit's shared helper: it reads production's store and release files. */
33
+ type MarkedArgs = Readonly<CorpusArgs> & Readonly<{ get: typeof fetch }>
34
+
29
35
  const EXIT_OK = 0
30
36
  const EXIT_INVALID = 3
31
37
  const NONE = 0
@@ -43,20 +49,21 @@ interface LiveSet {
43
49
  }
44
50
 
45
51
  /** ZS3 (J507): the API's list, engine's pins and every hash a signed release file or placement names. */
46
- async function liveSet(args: Readonly<CorpusArgs>): Promise<LiveSet> {
47
- const pins = await readPins(args.pins ?? LIVE_PINS)
52
+ async function liveSet(args: MarkedArgs): Promise<LiveSet> {
53
+ const pins = await readPins(args.pins ?? LIVE_PINS, args.get)
48
54
  const listed = await listKept({
49
55
  api: args.api,
50
56
  cache: args.cache,
51
57
  validator: '',
58
+ fetch: args.get,
52
59
  })
53
- const live = await liveHashes({ packs: PACKS, listed, pins })
60
+ const live = await liveHashes({ packs: PACKS, listed, pins }, args.get)
54
61
  return { pins, listed, live }
55
62
  }
56
63
 
57
64
  /** Every live original's row (ZS3, FE13). */
58
65
  async function corpusRows(
59
- args: Readonly<CorpusArgs>,
66
+ args: MarkedArgs,
60
67
  set: Readonly<LiveSet>,
61
68
  ): Promise<Readonly<{ rows: CorpusRow[]; validator: string }>> {
62
69
  const validator = await readVersion()
@@ -71,6 +78,7 @@ async function corpusRows(
71
78
  validator,
72
79
  pins: set.pins,
73
80
  live: set.live,
81
+ fetch: args.get,
74
82
  ...candidate,
75
83
  ...only,
76
84
  })
@@ -89,13 +97,13 @@ function gateBlocking(rows: readonly CorpusRow[]): number {
89
97
 
90
98
  /** ZS3: the API's listed originals beyond the live ones; a drifted one blocks. */
91
99
  async function storeDrift(
92
- args: Readonly<CorpusArgs>,
100
+ args: MarkedArgs,
93
101
  set: Readonly<LiveSet>,
94
102
  ): Promise<number> {
95
103
  const kept = classifyKept(set.listed, {
96
104
  live: set.live,
97
105
  pins: set.pins,
98
- pointed: await pointedHashes(args.api),
106
+ pointed: await pointedHashes(args.api, args.get),
99
107
  })
100
108
  process.stdout.write(`${keptLines(kept).join('\n')}\n`)
101
109
  return kept.drift.length
@@ -103,7 +111,8 @@ async function storeDrift(
103
111
 
104
112
  /** `shard-format corpus`: every live original, as stored (FE3, ZS3), gated by FE5's known failures and ZS3's store
105
113
  * drift; `--usage` writes FE13's record over the live originals only. */
106
- async function corpusCommand(args: Readonly<CorpusArgs>): Promise<number> {
114
+ async function corpusCommand(input: Readonly<CorpusArgs>): Promise<number> {
115
+ const args: MarkedArgs = { ...input, get: markedFetch(input.fetch ?? fetch) }
107
116
  const set = await liveSet(args)
108
117
  const { rows, validator } = await corpusRows(args, set)
109
118
  process.stdout.write(`${corpusReport(rows)}\n`)
@@ -4,7 +4,6 @@ import { MarkedBossPresentationSchema } from './bossProfiles.ts';
4
4
 
5
5
  const finite = v.pipe(v.number(), v.finite());
6
6
  const id = v.pipe(v.string(), v.minLength(1), v.maxLength(128));
7
- const home = v.strictObject({ x: finite, y: finite, z: finite, r: v.pipe(finite, v.minValue(Number.MIN_VALUE)) });
8
7
  const capture = v.union([
9
8
  v.strictObject({ flag: id }), v.strictObject({ action: id }),
10
9
  v.strictObject({ finish: v.literal(true) }), v.strictObject({ settle: v.literal('weather.fields') }),
@@ -24,13 +23,6 @@ export const ClientHeldMeleeSchema: v.StrictObjectSchema<{ readonly kind: v.Gene
24
23
  composed: v.optional(v.boolean(), false), stowedMode: v.exactOptional(id),
25
24
  finish: v.exactOptional(v.strictObject({ part: id, look: id, image: id, library: id })),
26
25
  });
27
- /** The existing SpeciesBrains catalogue, with original registration order and
28
- * body homes. The program and rig rows are referenced, never copied here. */
29
- export const ClientSpeciesProgramSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{ readonly kind: v.GenericSchema<ClientSpeciesProgramRowsInput['kind'], ClientSpeciesProgramRows['kind']>; readonly library: v.ExactOptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['library'], undefined>, Exclude<ClientSpeciesProgramRows['library'], undefined>>, undefined>; readonly catalogue: v.ExactOptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['catalogue'], undefined>, Exclude<ClientSpeciesProgramRows['catalogue'], undefined>>, undefined>; readonly homes: v.ExactOptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['homes'], undefined>, Exclude<ClientSpeciesProgramRows['homes'], undefined>>, undefined>; readonly shove: v.OptionalSchema<v.GenericSchema<Exclude<ClientSpeciesProgramRowsInput['shove'], undefined>, Exclude<ClientSpeciesProgramRows['shove'], undefined>>, false>; }, undefined>, v.CheckAction<{ [K in keyof ClientSpeciesProgramRows]: ClientSpeciesProgramRows[K] }, 'Species program requires one source'>]> = v.pipe(v.strictObject({ kind: v.literal('species.program'), library: v.exactOptional(id),
30
- catalogue: v.exactOptional(v.strictObject({ owner: id, actors: id, looks: id })),
31
- homes: v.exactOptional(v.pipe(v.record(id, home), v.maxEntries(256))), shove: v.optional(v.boolean(), false),
32
- }), v.check(row => row.catalogue === undefined ? row.library !== undefined
33
- : row.library === undefined && row.homes === undefined && !row.shove, 'Species program requires one source'));
34
26
  /** Saved page composition on the original flag/reward/NPC owners. Captures
35
27
  * select bounded platform actions, never a method or property path. */
36
28
  export const ClientQuestPageSchema: v.StrictObjectSchema<{ readonly kind: v.GenericSchema<ClientQuestPageRowsInput['kind'], ClientQuestPageRows['kind']>; readonly rows: v.GenericSchema<ClientQuestPageRowsInput['rows'], ClientQuestPageRows['rows']>; readonly progress: v.OptionalSchema<v.GenericSchema<Exclude<ClientQuestPageRowsInput['progress'], undefined>, Exclude<ClientQuestPageRows['progress'], undefined>>, false>; readonly promptOrder: v.GenericSchema<ClientQuestPageRowsInput['promptOrder'], ClientQuestPageRows['promptOrder']>; readonly endpoints: v.OptionalSchema<v.GenericSchema<Exclude<ClientQuestPageRowsInput['endpoints'], undefined>, Exclude<ClientQuestPageRows['endpoints'], undefined>>, readonly []>; readonly capture: v.OptionalSchema<v.GenericSchema<Exclude<ClientQuestPageRowsInput['capture'], undefined>, Exclude<ClientQuestPageRows['capture'], undefined>>, Record<never, never>>; }, undefined> = v.strictObject({ kind: v.literal('quest.page'),
@@ -105,40 +97,6 @@ interface ClientHeldMeleeRowsFields {
105
97
  };
106
98
  }
107
99
  export type ClientHeldMeleeRows = { [Key in keyof ClientHeldMeleeRowsFields]: ClientHeldMeleeRowsFields[Key] };
108
- interface ClientSpeciesProgramRowsInputFields {
109
- kind: 'species.program';
110
- library?: string;
111
- catalogue?: {
112
- owner: string;
113
- actors: string;
114
- looks: string;
115
- };
116
- homes?: Record<string, {
117
- x: number;
118
- y: number;
119
- z: number;
120
- r: number;
121
- }>;
122
- shove?: boolean | undefined;
123
- }
124
- export type ClientSpeciesProgramRowsInput = { [Key in keyof ClientSpeciesProgramRowsInputFields]: ClientSpeciesProgramRowsInputFields[Key] };
125
- interface ClientSpeciesProgramRowsFields {
126
- kind: 'species.program';
127
- library?: string;
128
- catalogue?: {
129
- owner: string;
130
- actors: string;
131
- looks: string;
132
- };
133
- homes?: Record<string, {
134
- x: number;
135
- y: number;
136
- z: number;
137
- r: number;
138
- }>;
139
- shove: boolean;
140
- }
141
- export type ClientSpeciesProgramRows = { [Key in keyof ClientSpeciesProgramRowsFields]: ClientSpeciesProgramRowsFields[Key] };
142
100
  interface ClientQuestPageRowsInputFields {
143
101
  kind: 'quest.page';
144
102
  rows: Omit<v.InferInput<typeof PersistedQuestPageSchema>, 'capture'>;
@@ -11,10 +11,10 @@ export function clientOwnershipRules(source: Shardfile, sections: ReadonlyMap<st
11
11
  const features = raw === undefined ? [] : parseClientPlan(raw).features;
12
12
  const page = hasDeclaredClientPage(source);
13
13
  if (!page) return rigs;
14
- // OF19d1: a page drawing its declared bodies from their looks needs no species program
15
- const errors: string[] = [...rigs], program = !pageDrawsDeclaredLooks(source, sections.get('sim/runtime-plan'), features);
14
+ // OF19d1, FORMAT-PRUNE FP20: a page draws its declared bodies from their looks (the species program is deleted)
15
+ const declaredPlan = sections.get('sim/runtime-plan'), errors: string[] = [...rigs, ...declaredPlan === undefined || pageDrawsDeclaredLooks(source, declaredPlan) ? [] : ['Data page draws its creatures from their declared looks']];
16
16
  if (source.runtime !== null) errors.push('Native client features require their typed data page owner');
17
- for (const kind of ['world.scenes', 'motion.channels', ...program ? ['species.program'] as const : [], 'held.melee', 'quest.page'] as const)
17
+ for (const kind of ['world.scenes', 'motion.channels', 'held.melee', 'quest.page'] as const)
18
18
  if (!features.some(row => row.kind === kind)) errors.push(`Data page requires ${kind}`);
19
19
  const quest = features.find(row => row.kind === 'quest.page'), held = features.find(row => row.kind === 'held.melee');
20
20
  const declared = source.questHost?.page;
@@ -26,7 +26,7 @@ export function clientOwnershipRules(source: Shardfile, sections: ReadonlyMap<st
26
26
  // ONE-FORMAT OF19b0/OF19c0: declared spawns, their species and encounters run beside the plan's keeper (the engine
27
27
  // refuses a body both own); declared crowds do not
28
28
  if (source.crowds.length > 0) errors.push('Data page native roster cannot also install declared crowds');
29
- for (const name of ['world/scenes', 'world/targets', ...program ? ['actors/species-programs'] : [], 'sim/runtime-plan', 'sim/scripts', 'look/painted'])
29
+ for (const name of ['world/scenes', 'world/targets', 'sim/runtime-plan', 'sim/scripts', 'look/painted'])
30
30
  if (!sections.has(name)) errors.push(`Data page requires ${name}`);
31
31
  const channels = new Set(source.clientChannels?.map(row => row.id));
32
32
  for (const feature of features) if (feature.kind === 'motion.channels') {
@@ -17,7 +17,7 @@ import { isJsonData } from './json.ts';
17
17
  import { LightEmittersSchema } from './lightEmitters.ts';
18
18
  import { EasedFieldsSchema } from './easedFields.ts';
19
19
  import { SceneMotionSchema } from './sceneMotion.ts';
20
- import { ClientHeldMeleeSchema, ClientSpeciesProgramSchema, ClientQuestPageSchema, ClientHeldBossSchema, ClientSpawnedBossSchema, ClientPlayerEnterSchema, ClientBossTelegraphSchema } from './clientNative.ts';
20
+ import { ClientHeldMeleeSchema, ClientQuestPageSchema, ClientHeldBossSchema, ClientSpawnedBossSchema, ClientPlayerEnterSchema, ClientBossTelegraphSchema } from './clientNative.ts';
21
21
 
22
22
  const finite=v.pipe(v.number(),v.finite()),rgb=v.tuple([finite,finite,finite]);
23
23
  const label=v.pipe(v.string(),v.minLength(1),v.maxLength(512));
@@ -98,10 +98,6 @@ export const ClientFeatureSchema: v.GenericSchema<ClientFeatureInput, ClientFeat
98
98
  v.strictObject({ kind: v.literal('practice.course'), course: v.picklist(['horse', 'grapple']),
99
99
  title: label, blurb: label, icon: v.pipe(v.string(), v.minLength(1), v.maxLength(4096)), art: label, file: label }),
100
100
  v.strictObject({ kind: v.literal('held.claims.prepare'), id, source: v.exactOptional(v.strictObject({ slots: label, library: label })) }),
101
- // OF30: retired (no pinned product names it since OF22; the engine runs nothing for it), still admitted so retained
102
- // originals (Driftwood r4 to r6) keep validating; species-deprecations counts it until the J486 delete.
103
- v.strictObject({ kind: v.literal('population.product-creatures') }),
104
- v.strictObject({ kind: v.literal('population.hull-book') }),
105
101
  v.strictObject({ kind: v.literal('held.claims.install'), claims: id, preparation: v.exactOptional(v.picklist(['kit','world'])) }),
106
102
  v.strictObject({ kind: v.literal('held.claims.enter'), claims: id,
107
103
  grapple: v.strictObject({ item: id, profile: GrappleProfileSchema, hooks: GrappleHooksSchema, presentation: label }) }),
@@ -135,7 +131,7 @@ export const ClientFeatureSchema: v.GenericSchema<ClientFeatureInput, ClientFeat
135
131
  v.strictObject({ kind: v.literal('world.scenes') }),
136
132
  v.strictObject({ kind: v.literal('world.baked'), rows: v.pipe(v.array(BakedTilesSchema), v.minLength(1), v.maxLength(4), v.check(rows => new Set(rows.map(row => row.id)).size === rows.length, 'unique baked tile ids')) }),
137
133
  v.strictObject({ kind: v.literal('motion.channels'), rows: SceneMotionSchema }),
138
- ClientHeldMeleeSchema, ClientSpeciesProgramSchema, ClientQuestPageSchema, ClientTrailsSchema, ClientCuesSchema,
134
+ ClientHeldMeleeSchema, ClientQuestPageSchema, ClientTrailsSchema, ClientCuesSchema,
139
135
  ClientHeldBossSchema, ClientSpawnedBossSchema, ClientPlayerEnterSchema, ClientBossTelegraphSchema,
140
136
  v.strictObject({ kind: v.literal('light.emitters'), rows: LightEmittersSchema }),
141
137
  v.strictObject({ kind: v.literal('weather.fields'), rows: EasedFieldsSchema, quest: id }),
@@ -177,8 +173,7 @@ export type ClientFeatureInput = { kind: 'strings.register'; } | { kind: 'conten
177
173
  species: string; guest: string; weather: string; sites?: string; figures: { rider: string; captain: string;
178
174
  storm: 'rider' | 'captain'; }; } | { kind: 'practice.course'; course: 'horse' | 'grapple'; title: string;
179
175
  blurb: string; icon: string; art: string; file: string; } | { kind: 'held.claims.prepare'; id: string;
180
- source?: { slots: string; library: string; }; } | { kind: 'population.product-creatures'; } | { kind:
181
- 'population.hull-book'; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
176
+ source?: { slots: string; library: string; }; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
182
177
  { kind: 'held.claims.enter'; claims: string; grapple: { item: string; profile: v.InferInput<typeof GrappleProfileSchema>; hooks: v.InferOutput<typeof GrappleHooksSchema>; presentation: string; };
183
178
  } | { kind: 'portal.ride'; rows: v.InferInput<typeof DeclaredPortalRideSchema>; } | { kind: 'held.cosmetics'; } | { kind: 'held.ranged-feel'; } | {
184
179
  kind: 'bag.finds'; id: string; quest: string; file: string; } | { kind: 'look.painterly'; shadeTint: [number,
@@ -206,8 +201,7 @@ export type ClientFeatureInput = { kind: 'strings.register'; } | { kind: 'conten
206
201
  Record<string, 'uCloudShadow' | 'uToonNight' | 'uSeaLevel' | 'uCloudTime'>; toonSeaLevel: boolean; }; })[]; }
207
202
  | { kind: 'world.scenes'; } | { kind: 'world.baked'; rows: (v.InferInput<typeof BakedTilesSchema>)[]; } | {
208
203
  kind: 'motion.channels'; rows: v.InferInput<typeof SceneMotionSchema>; } | v.InferInput<typeof
209
- ClientHeldMeleeSchema> | v.InferInput<typeof ClientSpeciesProgramSchema> | v.InferInput<typeof
210
- ClientQuestPageSchema> | v.InferInput<typeof ClientTrailsSchema>
204
+ ClientHeldMeleeSchema> | v.InferInput<typeof ClientQuestPageSchema> | v.InferInput<typeof ClientTrailsSchema>
211
205
  | v.InferInput<typeof ClientCuesSchema> | v.InferInput<typeof ClientHeldBossSchema> | v.InferInput<typeof
212
206
  ClientSpawnedBossSchema> | v.InferInput<typeof ClientPlayerEnterSchema> | v.InferInput<typeof
213
207
  ClientBossTelegraphSchema> | { kind: 'light.emitters'; rows: v.InferInput<typeof LightEmittersSchema>; } | {
@@ -241,8 +235,7 @@ export type ClientFeatureRow = { kind: 'strings.register'; } | { kind: 'content.
241
235
  species: string; guest: string; weather: string; sites?: string; figures: { rider: string; captain: string;
242
236
  storm: 'rider' | 'captain'; }; } | { kind: 'practice.course'; course: 'horse' | 'grapple'; title: string;
243
237
  blurb: string; icon: string; art: string; file: string; } | { kind: 'held.claims.prepare'; id: string;
244
- source?: { slots: string; library: string; }; } | { kind: 'population.product-creatures'; } | { kind:
245
- 'population.hull-book'; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
238
+ source?: { slots: string; library: string; }; } | { kind: 'held.claims.install'; claims: string; preparation?: 'kit' | 'world'; } |
246
239
  { kind: 'held.claims.enter'; claims: string; grapple: { item: string; profile: v.InferOutput<typeof GrappleProfileSchema>; hooks: v.InferOutput<typeof GrappleHooksSchema>; presentation: string; };
247
240
  } | { kind: 'portal.ride'; rows: v.InferOutput<typeof DeclaredPortalRideSchema>; } | { kind: 'held.cosmetics'; } | { kind: 'held.ranged-feel'; } | {
248
241
  kind: 'bag.finds'; id: string; quest: string; file: string; } | { kind: 'look.painterly'; shadeTint: [number,
@@ -270,8 +263,7 @@ export type ClientFeatureRow = { kind: 'strings.register'; } | { kind: 'content.
270
263
  number; })[]; lent: Record<string, 'uCloudShadow' | 'uToonNight' | 'uSeaLevel' | 'uCloudTime'>; toonSeaLevel:
271
264
  boolean; }; })[]; } | { kind: 'world.scenes'; } | { kind: 'world.baked'; rows: (v.InferOutput<typeof
272
265
  BakedTilesSchema>)[]; } | { kind: 'motion.channels'; rows: v.InferOutput<typeof SceneMotionSchema>; } |
273
- v.InferOutput<typeof ClientHeldMeleeSchema> | v.InferOutput<typeof ClientSpeciesProgramSchema> |
274
- v.InferOutput<typeof ClientQuestPageSchema> |
266
+ v.InferOutput<typeof ClientHeldMeleeSchema> | v.InferOutput<typeof ClientQuestPageSchema> |
275
267
  v.InferOutput<typeof ClientTrailsSchema> | v.InferOutput<typeof ClientCuesSchema> | v.InferOutput<typeof
276
268
  ClientHeldBossSchema> | v.InferOutput<typeof ClientSpawnedBossSchema> | v.InferOutput<typeof
277
269
  ClientPlayerEnterSchema> | v.InferOutput<typeof ClientBossTelegraphSchema> | { kind: 'light.emitters'; rows:
@@ -17,6 +17,7 @@ import {
17
17
  CookPreparationSchema,
18
18
  CookSpecPreparationSchema,
19
19
  } from './cook-preparation.ts'
20
+ import { ShardVersionSchema } from './shard-version.ts'
20
21
 
21
22
  import type {
22
23
  CookPreparation,
@@ -44,6 +45,7 @@ interface CookMount {
44
45
  interface LegacyCookData {
45
46
  readonly version: typeof COOK_DATA_VERSION
46
47
  readonly mounts: readonly CookMount[]
48
+ readonly shardVersion?: string
47
49
  /** 'fence' packs what the boot reads before control; unset, the whole level. */
48
50
  readonly packs?: 'fence'
49
51
  /** The stable identities a recorded cold boot read before control. */
@@ -105,6 +107,7 @@ const identities: GenericSchema<unknown, string[]> = pipe(
105
107
  const LegacyCookDataSchema = strictObject({
106
108
  version: literal(COOK_DATA_VERSION),
107
109
  mounts: mountRows,
110
+ shardVersion: exactOptional(ShardVersionSchema),
108
111
  packs: exactOptional(literal('fence')),
109
112
  fence: exactOptional(identities),
110
113
  })
@@ -112,17 +115,21 @@ const LegacyCookDataSchema = strictObject({
112
115
  const PreparedCookDataSchema = strictObject({
113
116
  ...CookPreparationSchema.entries,
114
117
  mounts: mountRows,
118
+ shardVersion: exactOptional(ShardVersionSchema),
115
119
  })
116
120
  /** SHARD-COMPAT PR4: preparation spec 4, which names no engine. */
117
121
  const SpecCookDataSchema = strictObject({
118
122
  ...CookSpecPreparationSchema.entries,
119
123
  mounts: mountRows,
124
+ shardVersion: exactOptional(ShardVersionSchema),
120
125
  })
121
126
  interface PreparedCookData extends CookPreparation {
122
127
  readonly mounts: readonly CookMount[]
128
+ readonly shardVersion?: string
123
129
  }
124
130
  interface SpecCookData extends CookSpecPreparation {
125
131
  readonly mounts: readonly CookMount[]
132
+ readonly shardVersion?: string
126
133
  }
127
134
  type CookData = LegacyCookData | PreparedCookData | SpecCookData
128
135
  const CookDataSchema: GenericSchema<unknown, CookData> = variant('version', [
@@ -10,10 +10,6 @@ import {
10
10
  } from './manifest-deprecations.ts'
11
11
  import { SAVE_REVISION_DEPRECATION } from './save-revision.ts'
12
12
  import { SCHEMA_SOURCE_DEPRECATION } from './schema-source.ts'
13
- import {
14
- SPECIES_FEATURE_DEPRECATIONS,
15
- SPECIES_SECTION_DEPRECATIONS,
16
- } from './species-deprecations.ts'
17
13
 
18
14
  import type { OutputIndex } from './outputIndex.ts'
19
15
 
@@ -42,8 +38,6 @@ interface DeprecationRule extends Deprecation {
42
38
  readonly uses: (shard: Readonly<DeprecationInput>) => boolean
43
39
  }
44
40
 
45
- const LEGACY_SPELLING = '0.1'
46
- const NONE = 0
47
41
  /** Deprecated in the current format with no data change: a shard file of any version may still carry it. */
48
42
  const CURRENT = '0.1.0.1'
49
43
  /** Format 0.1.0.2's envelope (SHARD-COMPAT CP14, FORMAT-PRUNE FP4 and FP25). */
@@ -64,32 +58,8 @@ function field(value: unknown, key: string): unknown {
64
58
  : undefined
65
59
  }
66
60
 
67
- /** Whether `key` names a field anywhere inside `value`. */
68
- function hasKey(value: unknown, key: string): boolean {
69
- const pending: unknown[] = [value]
70
- while (pending.length > NONE) {
71
- const next = pending.pop()
72
- if (typeof next === 'object' && next !== null) {
73
- if (!Array.isArray(next) && Object.hasOwn(next, key)) {
74
- return true
75
- }
76
- const children: readonly unknown[] = Object.values(next)
77
- pending.push(...children)
78
- }
79
- }
80
- return false
81
- }
82
-
61
+ /** FORMAT-PRUNE FP24 deleted `version.two-part` with the spelling and its chain step: the format no longer admits `0.1`. */
83
62
  const RULES: readonly DeprecationRule[] = [
84
- {
85
- id: 'version.two-part',
86
- path: 'shard.json version and requires.sdk spelled "0.1"',
87
- since: '0.1.0.0',
88
- replacement: 'the four-part "0.1.0.0"',
89
- migration: 'fp6-four-part-version',
90
- uses: (shard: Readonly<DeprecationInput>): boolean =>
91
- field(shard.index, 'version') === LEGACY_SPELLING,
92
- },
93
63
  {
94
64
  id: 'shard.version',
95
65
  path: 'shard.json version beside the layout marker formatVersion 2 (SHARD-COMPAT CP14)',
@@ -127,7 +97,6 @@ const RULES: readonly DeprecationRule[] = [
127
97
  SAVE_REVISION_DEPRECATION,
128
98
  SCHEMA_SOURCE_DEPRECATION,
129
99
  ...COOK_DEPRECATIONS,
130
- ...SPECIES_FEATURE_DEPRECATIONS,
131
100
  {
132
101
  id: 'requires.capabilities',
133
102
  path: 'shard.json requires.capabilities (FORMAT-PRUNE FP4): always empty, never read',
@@ -150,19 +119,6 @@ const RULES: readonly DeprecationRule[] = [
150
119
  uses: (shard: Readonly<DeprecationInput>): boolean =>
151
120
  field(field(shard.index, 'runtime'), 'trust') !== undefined,
152
121
  },
153
- ...SPECIES_SECTION_DEPRECATIONS,
154
- {
155
- id: 'items.legacySlot',
156
- path: 'an item equipment row legacySlot: a closed list of engine-native weapon names (FORMAT-PRUNE FP17)',
157
- since: CURRENT,
158
- replacement:
159
- 'none yet: it goes with engine native weapon slots, so a new item names no slot',
160
- migration: undefined,
161
- uses: (shard: Readonly<DeprecationInput>): boolean =>
162
- [...shard.sections.values()].some((section: unknown): boolean =>
163
- hasKey(section, 'legacySlot'),
164
- ),
165
- },
166
122
  {
167
123
  id: 'admission.server',
168
124
  path: 'shard.json admission.server (native assembly, FORMAT-PRUNE FP16)',
@@ -183,8 +139,8 @@ interface SaveBridge {
183
139
  readonly reader: string
184
140
  }
185
141
 
186
- /** FP17's sort of the `legacy*` fields. `items.legacySlot` is shard data only, so it is a deprecation above; the
187
- * species book's `piercing.legacy` goes with the species-program family (FP15); none can be migrated by data alone. */
142
+ /** FP17's sort of the `legacy*` fields. The closed item slot field was shard data only and is deleted (FP22e); the
143
+ * species-program family is deleted (FP20), its hunt bands' old kinds list optional until no kept file writes it. */
188
144
  const SAVE_BRIDGES: readonly SaveBridge[] = [
189
145
  {
190
146
  path: 'loadout bow.legacyItem',
@@ -57,8 +57,6 @@ const CLIENT_FEATURE_SIDES: Readonly<Record<ClientFeatureKind, SideEntry>> =
57
57
  'motion.channels': VIEW,
58
58
  'page.life': VIEW,
59
59
  'player.enter': both('fallFloor'),
60
- 'population.hull-book': VIEW,
61
- 'population.product-creatures': VIEW,
62
60
  'population.wildlife': VIEW,
63
61
  'portal.ride': both('portalRide'),
64
62
  'practice.course': VIEW,
@@ -71,7 +69,6 @@ const CLIENT_FEATURE_SIDES: Readonly<Record<ClientFeatureKind, SideEntry>> =
71
69
  'quest.views': VIEW,
72
70
  'quest.world': both('places'),
73
71
  'riding.session': VIEW,
74
- 'species.program': VIEW,
75
72
  'state.adventure': both('saves'),
76
73
  'stealth.entry': both('stealth'),
77
74
  'strings.register': VIEW,
@@ -25,6 +25,7 @@ import {
25
25
  } from './format-migration-prune.ts'
26
26
  import { validationSourceBytes } from './validationReceipt.ts'
27
27
  import {
28
+ SHARDFILE_FLOOR,
28
29
  SHARDFILE_VERSIONS,
29
30
  compareShardfileVersions,
30
31
  parseShardfileVersion,
@@ -55,33 +56,12 @@ interface FormatMigration {
55
56
  readonly repairs?: (shard: Readonly<MigratingShard>) => boolean
56
57
  }
57
58
 
58
- const TWO_PART = 2
59
59
  const ZERO = 0
60
60
  const ONE = 1
61
- const LEGACY_SPELLING = '0.1'
62
- const FOUR_PART_ZERO = '0.1.0.0'
63
61
 
64
- /** FORMAT-PRUNE FP6: the two-part spelling `0.1` becomes `0.1.0.0`, the same format written the one way. */
65
- const fourPartVersion: FormatMigration = {
66
- id: 'fp6-four-part-version',
67
- to: FOUR_PART_ZERO,
68
- touches: 'data',
69
- affects: [],
70
- apply: (shard: Readonly<MigratingShard>): void => {
71
- const { requires } = shard.index
72
- if (
73
- typeof requires === 'object' &&
74
- requires !== null &&
75
- Reflect.get(requires, 'sdk') === LEGACY_SPELLING
76
- ) {
77
- Reflect.set(requires, 'sdk', FOUR_PART_ZERO)
78
- }
79
- },
80
- }
81
-
82
- /** Every migration, oldest first. */
62
+ /** Every migration, oldest first. FORMAT-PRUNE FP24 deleted FP6's `fp6-four-part-version` (`0.1` to `0.1.0.0`) with
63
+ * the two-part spelling: the chain starts at the floor. */
83
64
  const FORMAT_MIGRATIONS: readonly FormatMigration[] = [
84
- fourPartVersion,
85
65
  journalGlyphImages,
86
66
  shardfilePointer,
87
67
  dropRuntimeTrust,
@@ -98,8 +78,7 @@ const FORMAT_MIGRATIONS: readonly FormatMigration[] = [
98
78
  levelLook,
99
79
  ]
100
80
 
101
- /** Whether a file at `version` still needs a step that writes `to`. The legacy two-part spelling sits just below its
102
- * four-part twin, so the spelling step runs once and never again. */
81
+ /** Whether a file at `version` still needs a step that writes `to`. */
103
82
  function versionBelow(version: string, to: string): boolean {
104
83
  const left = parseShardfileVersion(version)
105
84
  const right = parseShardfileVersion(to)
@@ -109,9 +88,7 @@ function versionBelow(version: string, to: string): boolean {
109
88
  return difference < ZERO
110
89
  }
111
90
  }
112
- return (
113
- version.split('.').length === TWO_PART && to.split('.').length > TWO_PART
114
- )
91
+ return false
115
92
  }
116
93
 
117
94
  /** Refuse one step: a `to` that is no format version, out of version order after `last`, or a save-affecting step with
@@ -135,7 +112,7 @@ function checkStep(step: Readonly<FormatMigration>, last: string): void {
135
112
  /** Refuse a registry the chain cannot run as written (FE8): a repeated id, or a step `checkStep` refuses. */
136
113
  function checkMigrations(migrations: readonly FormatMigration[]): void {
137
114
  const ids = new Set<string>()
138
- let last: string = LEGACY_SPELLING
115
+ let last: string = SHARDFILE_FLOOR
139
116
  for (const step of migrations) {
140
117
  if (ids.has(step.id)) {
141
118
  throw new Error(`Migration ${step.id} is registered twice`)
@@ -4,7 +4,6 @@ import { parsePlatformDataSection } from './platformDataSections.ts'
4
4
 
5
5
  /** One defining context catalogue for author-build intake and worker transport. */
6
6
  export const HEADLESS_CONTEXT_SECTIONS = [
7
- 'actors/species-programs',
8
7
  'view/modules',
9
8
  'sim/scripts',
10
9
  'actors/spawn-scripts',
@@ -43,8 +43,7 @@ export const CatalogueIconSchema: v.GenericSchema<CatalogueIconNameInput, Catalo
43
43
  'sword', 'deer', 'elk', 'boar', 'bear', 'ghost', 'ironhide', 'meat', 'hide', 'tusk', 'antlers', 'bolt', 'claw', 'shell', 'coconut', 'coin', 'seaglass', 'rope', 'whetstone', 'chart', 'bearclaw', 'boartusk', 'crossbow', 'rifle', 'lever', 'longbow', 'hat', 'cape', 'charm', 'necklace', 'glyph', 'purse', 'talon', 'leopard', 'wolf', 'eagle', 'rider', 'horse', 'grapple']);
44
44
  const equipmentNumber = v.pipe(finite, v.minValue(0), v.maxValue(10000));
45
45
  const cue = v.pipe(v.string(), v.regex(/^cue\.[a-z][a-zA-Z0-9.-]*$/u), v.maxLength(128));
46
- const equipment: v.StrictObjectSchema<{ readonly id: v.GenericSchema<ItemEquipmentRowsInput['id'], ItemEquipmentRows['id']>; readonly legacySlot: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['legacySlot'], undefined>, Exclude<ItemEquipmentRows['legacySlot'], undefined>>, undefined>; readonly ui: v.GenericSchema<ItemEquipmentRowsInput['ui'], ItemEquipmentRows['ui']>; readonly meta: v.StrictObjectSchema<{ readonly name: v.GenericSchema<ItemEquipmentRowsInput['meta']['name'], ItemEquipmentRows['meta']['name']>; readonly icon: v.GenericSchema<ItemEquipmentRowsInput['meta']['icon'], ItemEquipmentRows['meta']['icon']>; readonly blurb: v.GenericSchema<ItemEquipmentRowsInput['meta']['blurb'], ItemEquipmentRows['meta']['blurb']>; readonly category: v.GenericSchema<ItemEquipmentRowsInput['meta']['category'], ItemEquipmentRows['meta']['category']>; }, undefined>; readonly cues: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['cues'], undefined>, Exclude<ItemEquipmentRows['cues'], undefined>>, undefined>; readonly hitStop: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['hitStop'], undefined>, Exclude<ItemEquipmentRows['hitStop'], undefined>>, undefined>; readonly rangedFeel: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['rangedFeel'], undefined>, Exclude<ItemEquipmentRows['rangedFeel'], undefined>>, undefined>; readonly tags: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['tags'], undefined>, Exclude<ItemEquipmentRows['tags'], undefined>>, undefined>; }, undefined> = v.strictObject({ id: v.pipe(v.string(), v.regex(/^weapon\.[a-z][a-zA-Z0-9.-]*$/u), v.maxLength(128)),
47
- legacySlot: v.exactOptional(v.picklist(['crossbow', 'sword', 'rifle', 'sword-iron', 'bow', 'sabre', 'spear', 'empty'])),
46
+ const equipment: v.StrictObjectSchema<{ readonly id: v.GenericSchema<ItemEquipmentRowsInput['id'], ItemEquipmentRows['id']>; readonly ui: v.GenericSchema<ItemEquipmentRowsInput['ui'], ItemEquipmentRows['ui']>; readonly meta: v.StrictObjectSchema<{ readonly name: v.GenericSchema<ItemEquipmentRowsInput['meta']['name'], ItemEquipmentRows['meta']['name']>; readonly icon: v.GenericSchema<ItemEquipmentRowsInput['meta']['icon'], ItemEquipmentRows['meta']['icon']>; readonly blurb: v.GenericSchema<ItemEquipmentRowsInput['meta']['blurb'], ItemEquipmentRows['meta']['blurb']>; readonly category: v.GenericSchema<ItemEquipmentRowsInput['meta']['category'], ItemEquipmentRows['meta']['category']>; }, undefined>; readonly cues: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['cues'], undefined>, Exclude<ItemEquipmentRows['cues'], undefined>>, undefined>; readonly hitStop: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['hitStop'], undefined>, Exclude<ItemEquipmentRows['hitStop'], undefined>>, undefined>; readonly rangedFeel: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['rangedFeel'], undefined>, Exclude<ItemEquipmentRows['rangedFeel'], undefined>>, undefined>; readonly tags: v.ExactOptionalSchema<v.GenericSchema<Exclude<ItemEquipmentRowsInput['tags'], undefined>, Exclude<ItemEquipmentRows['tags'], undefined>>, undefined>; }, undefined> = v.strictObject({ id: v.pipe(v.string(), v.regex(/^weapon\.[a-z][a-zA-Z0-9.-]*$/u), v.maxLength(128)),
48
47
  ui: v.strictObject({ name: text, icon: CatalogueIconSchema, swapIcon: v.pipe(text, v.maxLength(512)),
49
48
  touch: v.picklist(['melee', 'bow', 'ranged', 'throwing']), lockOn: v.boolean(), melee: v.boolean(), tracers: v.boolean(),
50
49
  inputContext: v.exactOptional(name), swapName: v.exactOptional(text), huntersEye: v.exactOptional(v.boolean()),
@@ -249,5 +248,5 @@ export interface ShardItemsInput { version: 1; catalogue?: ({ id: ItemFamilyName
249
248
  export interface ShardItems { version: 1; catalogue?: ({ id: ItemFamilyNameRows; label: string; icon: CatalogueIconName; travels: boolean; })[]; kept?: KeptItemRows[]; rows: ((WeaponItemRows) | (ToolItemRows))[]; launches?: Record<string, v.InferOutput<typeof BodyLaunchSchema>>; pickups?: Record<string, v.InferOutput<typeof ClaimedPickupSchema>>; contexts: (ItemContextRows)[]; runtimeContexts?: (ItemFamilyNameRows)[]; loadout: { effects?: { statuses: boolean; player: v.InferOutput<typeof LootEconomySchema.entries.grants.entries.player>; worn: v.InferOutput<typeof LootEconomySchema.entries.grants.entries.worn>; weapons: ({ items: (`weapon.${string}`)[]; grants: v.InferOutput<typeof LootEconomySchema.entries.grants.entries.weapons>; })[]; hitCap?: `effect.${string}`; }; runtime?: { pause: boolean; sliceMs?: number; owners: ({ item: `weapon.${string}`; slot: 'primary' | 'rifle' | 'secondary' | 'extra'; row: 'native' | 'declared'; presentation?: boolean; })[]; }; native?: v.InferOutput<typeof NativeLoadoutRowSchema>; inventory?: { kinds: (ItemFamilyNameRows)[]; slots: number; counts: { min: number; max: number; integer: boolean; complete: boolean; }; quantity: 'unchecked' | 'positive-safe-integer'; snapshot: 'order' | 'roster'; stackLimit?: number; restoreError: string; }; primary: (`weapon.${string}`) | null; secondary: (`weapon.${string}`) | null; tools: (`tool.${string}`)[]; level?: LevelLoadout; }; }
250
249
  export interface NativeSweptPolicyRowsInput { kind: 'swept'; step: ItemFamilyNameRowsInput; selection?: v.InferInput<typeof NativeLoadoutRowSchema>; eye: number; initial: number; source: 'env' | 'owner'; slots: ({ item: `weapon.${string}`; weapon: `weapon.${string}`; tags: (`${string}.${string}`)[]; combo: (ItemFamilyNameRowsInput)[]; heavy: ItemFamilyNameRowsInput; })[]; contact: { slack: number; direction: [number, number, number]; push: [number, number]; running: number; }; lunge: { maxHeight: number; minDistance: number; minRadius: number; lengthScale: number; }; }
251
250
  export interface NativeSweptPolicyRows { kind: 'swept'; step: ItemFamilyNameRows; selection?: v.InferOutput<typeof NativeLoadoutRowSchema>; eye: number; initial: number; source: 'env' | 'owner'; slots: ({ item: `weapon.${string}`; weapon: `weapon.${string}`; tags: (`${string}.${string}`)[]; combo: (ItemFamilyNameRows)[]; heavy: ItemFamilyNameRows; })[]; contact: { slack: number; direction: [number, number, number]; push: [number, number]; running: number; }; lunge: { maxHeight: number; minDistance: number; minRadius: number; lengthScale: number; }; }
252
- export interface ItemEquipmentRowsInput { id: string; legacySlot?: 'crossbow' | 'sword' | 'rifle' | 'sword-iron' | 'bow' | 'sabre' | 'spear' | 'empty'; ui: { name: string; icon: CatalogueIconNameInput; swapIcon: string; touch: 'melee' | 'bow' | 'ranged' | 'throwing'; lockOn: boolean; melee: boolean; tracers: boolean; inputContext?: ItemFamilyNameRowsInput; swapName?: string; huntersEye?: boolean; ammo?: { label: string; segments: number; magazine?: boolean; bagLabel?: string; bagLabelFor?: string; }; }; meta: { name: string; icon: CatalogueIconNameInput; blurb: string; category: ItemFamilyNameRowsInput; }; cues?: { fire: string; reload: string; impact: string; dry?: string; hit?: string; heavy?: string; charge?: Record<string, string>; }; hitStop?: { body: number; head: number; kill: number; }; rangedFeel?: { kick: { body: number; head: number; kill: number; side: number; killSide: number; }; trauma: { kill: number; head: number; killKinds: (ItemFamilyNameRowsInput)[]; headKinds: (ItemFamilyNameRowsInput)[]; }; }; tags?: (`${string}.${string}`)[]; }
253
- export interface ItemEquipmentRows { id: string; legacySlot?: 'crossbow' | 'sword' | 'rifle' | 'sword-iron' | 'bow' | 'sabre' | 'spear' | 'empty'; ui: { name: string; icon: CatalogueIconName; swapIcon: string; touch: 'melee' | 'bow' | 'ranged' | 'throwing'; lockOn: boolean; melee: boolean; tracers: boolean; inputContext?: ItemFamilyNameRows; swapName?: string; huntersEye?: boolean; ammo?: { label: string; segments: number; magazine?: boolean; bagLabel?: string; bagLabelFor?: string; }; }; meta: { name: string; icon: CatalogueIconName; blurb: string; category: ItemFamilyNameRows; }; cues?: { fire: string; reload: string; impact: string; dry?: string; hit?: string; heavy?: string; charge?: Record<string, string>; }; hitStop?: { body: number; head: number; kill: number; }; rangedFeel?: { kick: { body: number; head: number; kill: number; side: number; killSide: number; }; trauma: { kill: number; head: number; killKinds: (ItemFamilyNameRows)[]; headKinds: (ItemFamilyNameRows)[]; }; }; tags?: (`${string}.${string}`)[]; }
251
+ export interface ItemEquipmentRowsInput { id: string; ui: { name: string; icon: CatalogueIconNameInput; swapIcon: string; touch: 'melee' | 'bow' | 'ranged' | 'throwing'; lockOn: boolean; melee: boolean; tracers: boolean; inputContext?: ItemFamilyNameRowsInput; swapName?: string; huntersEye?: boolean; ammo?: { label: string; segments: number; magazine?: boolean; bagLabel?: string; bagLabelFor?: string; }; }; meta: { name: string; icon: CatalogueIconNameInput; blurb: string; category: ItemFamilyNameRowsInput; }; cues?: { fire: string; reload: string; impact: string; dry?: string; hit?: string; heavy?: string; charge?: Record<string, string>; }; hitStop?: { body: number; head: number; kill: number; }; rangedFeel?: { kick: { body: number; head: number; kill: number; side: number; killSide: number; }; trauma: { kill: number; head: number; killKinds: (ItemFamilyNameRowsInput)[]; headKinds: (ItemFamilyNameRowsInput)[]; }; }; tags?: (`${string}.${string}`)[]; }
252
+ export interface ItemEquipmentRows { id: string; ui: { name: string; icon: CatalogueIconName; swapIcon: string; touch: 'melee' | 'bow' | 'ranged' | 'throwing'; lockOn: boolean; melee: boolean; tracers: boolean; inputContext?: ItemFamilyNameRows; swapName?: string; huntersEye?: boolean; ammo?: { label: string; segments: number; magazine?: boolean; bagLabel?: string; bagLabelFor?: string; }; }; meta: { name: string; icon: CatalogueIconName; blurb: string; category: ItemFamilyNameRows; }; cues?: { fire: string; reload: string; impact: string; dry?: string; hit?: string; heavy?: string; charge?: Record<string, string>; }; hitStop?: { body: number; head: number; kill: number; }; rangedFeel?: { kick: { body: number; head: number; kill: number; side: number; killSide: number; }; trauma: { kill: number; head: number; killKinds: (ItemFamilyNameRows)[]; headKinds: (ItemFamilyNameRows)[]; }; }; tags?: (`${string}.${string}`)[]; }
@@ -53,8 +53,6 @@ const DATA_SECTION_NAMES: Readonly<Record<keyof PlatformDataSections, true>> = {
53
53
  'models/island-library': true,
54
54
  "player/stealth": true,
55
55
  "explore/catalogue": true,
56
- "look/rigged-hulls": true,
57
- "look/hull-book": true,
58
56
  "look/toon": true,
59
57
  "look/painted": true,
60
58
  "look/colour-functions": true,
@@ -75,7 +73,6 @@ const DATA_SECTION_NAMES: Readonly<Record<keyof PlatformDataSections, true>> = {
75
73
  "held/melee": true,
76
74
  "ui/completion": true,
77
75
  "sim/runtime-plan": true,
78
- "actors/species-programs": true,
79
76
  "actors/moves": true,
80
77
  "actors/spawn-scripts": true,
81
78
  "actors/return-scripts": true,
@@ -10,6 +10,7 @@ import type { AudioWaiver } from './audio-waiver.ts';
10
10
  import { isOutputIndex, outputBlobPath } from './outputAddress.ts';
11
11
  import { OUTPUT_SECTIONS, assembleOutputTransport, isPlatformDataSection, type OutputHostSectionName } from './outputFields.ts';
12
12
  import * as v from 'valibot';
13
+ import { ShardVersionSchema } from './shard-version.ts';
13
14
  import { assertFormatWindow } from './format-window.ts';
14
15
  import { assertCellBounds } from './cellBounds.ts';
15
16
  import { ShardfileFieldSchemas, parseShardfile, type Shardfile } from './shardSchema.ts';
@@ -45,6 +46,8 @@ const PreparationSpecNumberSchema = v.pipe(v.number(), v.integer(), v.minValue(L
45
46
  /** Format 2 inventories every emitted byte except its index and validation receipt. */
46
47
  export const OutputIndexSchema: v.GenericSchema<OutputIndexRowsInput, OutputIndexRows> & { readonly entries: { readonly [Key in keyof OutputIndexRows]-?: v.GenericSchema<OutputIndexRowsInput[Key], OutputIndexRows[Key]> } } = v.strictObject({
47
48
  format: v.literal('wildshard.shardfile'),
49
+ /** Author-written package version. Earlier stored shardfiles omit it. */
50
+ shardVersion: v.exactOptional(ShardVersionSchema),
48
51
  /** SHARD-COMPAT CP14 (FP25): the format version itself from 0.1.0.2; the legacy envelope carries the frozen layout marker
49
52
  * `2` here and its version in `version`. `checkIndexEnvelope` holds each envelope to its own fields. */
50
53
  formatVersion: IndexFormatVersionSchema, version: LegacyIndexVersionSchema,
@@ -242,6 +245,7 @@ export function assembleOutputShardfile(input: unknown, sections: ReadonlyMap<st
242
245
  /** Exact admitted data, independent of validator implementation metadata. */
243
246
  interface OutputIndexRowsInputFields {
244
247
  format: "wildshard.shardfile";
248
+ shardVersion?: string;
245
249
  formatVersion: typeof LEGACY_LAYOUT | IndexFormatVersion;
246
250
  sdk?: "0.2" | "0.3";
247
251
  /** A spec this package reads (3, 4), or a newer one kept unread (SP1b1a). */
@@ -342,6 +346,7 @@ interface OutputIndexRowsInputFields {
342
346
  export type OutputIndexRowsInput = { [Key in keyof OutputIndexRowsInputFields]: OutputIndexRowsInputFields[Key] };
343
347
  interface OutputIndexRowsFields {
344
348
  format: "wildshard.shardfile";
349
+ shardVersion?: string;
345
350
  formatVersion: typeof LEGACY_LAYOUT | IndexFormatVersion;
346
351
  sdk?: "0.2" | "0.3";
347
352
  /** A spec this package reads (3, 4), or a newer one kept unread (SP1b1a). */