@wildshard/shard-format 0.69.0 → 0.69.2
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.69.
|
|
3
|
+
"version": "0.69.2",
|
|
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": {
|
|
@@ -41,7 +41,6 @@ const EMPTY_INDEX_FIELDS: readonly (readonly [string, string | undefined])[] = [
|
|
|
41
41
|
['schemas', undefined],
|
|
42
42
|
['runtime', 'files'],
|
|
43
43
|
['runtime', 'lines'],
|
|
44
|
-
['requires', 'capabilities'],
|
|
45
44
|
]
|
|
46
45
|
/** FORMAT-PRUNE FP15: OF30 cut B leaves these as plain JSON nothing reads. */
|
|
47
46
|
const SPECIES_PROGRAM_FAMILY: readonly string[] = [
|
|
@@ -94,7 +93,7 @@ const RULES: readonly DeprecationRule[] = [
|
|
|
94
93
|
},
|
|
95
94
|
{
|
|
96
95
|
id: 'shard.empty-fields',
|
|
97
|
-
path: 'shard.json schemas, runtime.files
|
|
96
|
+
path: 'shard.json schemas, runtime.files and runtime.lines (FORMAT-PRUNE FP4)',
|
|
98
97
|
since: ENVELOPE,
|
|
99
98
|
replacement: 'nothing: each is always empty and no reader reads it',
|
|
100
99
|
migration: 'fp4-drop-empty-index-fields',
|
|
@@ -106,6 +105,26 @@ const RULES: readonly DeprecationRule[] = [
|
|
|
106
105
|
: field(field(shard.index, outer), inner) !== undefined,
|
|
107
106
|
),
|
|
108
107
|
},
|
|
108
|
+
{
|
|
109
|
+
id: 'requires.sdk',
|
|
110
|
+
path: 'shard.json requires.sdk (SHARD-COMPAT CP8): a copy of the format version',
|
|
111
|
+
since: ENVELOPE,
|
|
112
|
+
replacement:
|
|
113
|
+
'nothing: formatVersion names the format; writers stop sourcing it, then it goes at zero users',
|
|
114
|
+
migration: undefined,
|
|
115
|
+
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
116
|
+
field(field(shard.index, 'requires'), 'sdk') !== undefined,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'requires.capabilities',
|
|
120
|
+
path: 'shard.json requires.capabilities (FORMAT-PRUNE FP4): always empty, never read',
|
|
121
|
+
since: ENVELOPE,
|
|
122
|
+
replacement:
|
|
123
|
+
'nothing: the build source hash covers it, so writers stop sourcing it, then it goes at zero users',
|
|
124
|
+
migration: undefined,
|
|
125
|
+
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
126
|
+
field(field(shard.index, 'requires'), 'capabilities') !== undefined,
|
|
127
|
+
},
|
|
109
128
|
{
|
|
110
129
|
id: 'manifest.gridShardfile',
|
|
111
130
|
path: 'sections/ui/level manifest.gridShardfile (and the discovery mount)',
|
|
@@ -26,7 +26,8 @@ const formatVersionField: FormatMigration = {
|
|
|
26
26
|
},
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/** FORMAT-PRUNE FP4: `schemas`, `runtime.files
|
|
29
|
+
/** FORMAT-PRUNE FP4: `schemas`, `runtime.files` and `runtime.lines`, always empty, never read. `requires.capabilities` stays:
|
|
30
|
+
* it is part of the assembled source the build's source hash covers, so it goes only with the writers that stop sourcing it. */
|
|
30
31
|
const dropEmptyIndexFields: FormatMigration = {
|
|
31
32
|
id: 'fp4-drop-empty-index-fields',
|
|
32
33
|
to: ENVELOPE,
|
|
@@ -35,14 +36,11 @@ const dropEmptyIndexFields: FormatMigration = {
|
|
|
35
36
|
apply: (shard: MigratingShard): void => {
|
|
36
37
|
const { index } = shard
|
|
37
38
|
Reflect.deleteProperty(index, 'schemas')
|
|
38
|
-
const { runtime
|
|
39
|
+
const { runtime } = index
|
|
39
40
|
if (isRecord(runtime)) {
|
|
40
41
|
Reflect.deleteProperty(runtime, 'files')
|
|
41
42
|
Reflect.deleteProperty(runtime, 'lines')
|
|
42
43
|
}
|
|
43
|
-
if (isRecord(requires)) {
|
|
44
|
-
Reflect.deleteProperty(requires, 'capabilities')
|
|
45
|
-
}
|
|
46
44
|
},
|
|
47
45
|
}
|
|
48
46
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$doc": "J426 (Jake, 2026-11-18): the one armed-zone list. A zone named here has done the work to get under the J410 lines, and from then on every memory gate refuses it back over them, with no override flag and no report-only fallback: the format's offline estimate over lines.playingBytes / lines.loadingBytes (check, validate, cook, upload), the declared worst-location total over the J408 1.5 GB line, the runtime tier and a stale runtime reading; engine's ledger, footprint and boot-line guards read the same list. A zone not named here reports only (J424). Each zone's playingBytes / loadingBytes are its offline estimate when it was armed (memory epoch in `epoch`); the offline estimate refuses over the larger of the line and that reading plus 0.5% (memory-armed.ts ARMED_ALLOWANCE), so a zone EM11 measured under the line whose conservative estimate reads over it (Nine's playing) is locked at its armed state. Decimal bytes. Format memory-armed.ts reads this; engine reads @wildshard/format/src/format/memory-armed.json.
|
|
2
|
+
"$doc": "J426 (Jake, 2026-11-18): the one armed-zone list. A zone named here has done the work to get under the J410 lines, and from then on every memory gate refuses it back over them, with no override flag and no report-only fallback: the format's offline estimate over lines.playingBytes / lines.loadingBytes (check, validate, cook, upload), the declared worst-location total over the J408 1.5 GB line, the runtime tier and a stale runtime reading; engine's ledger, footprint and boot-line guards read the same list. A zone not named here reports only (J424). Each zone's playingBytes / loadingBytes are its offline estimate when it was armed (memory epoch in `epoch`); the offline estimate refuses over the larger of the line and that reading plus 0.5% (memory-armed.ts ARMED_ALLOWANCE), so a zone EM11 measured under the line whose conservative estimate reads over it (Nine's playing) is locked at its armed state. Decimal bytes. Format memory-armed.ts reads this; engine reads @wildshard/format/src/format/memory-armed.json. CP10 judges a stored original by its stored verdict, so no pinned product is re-judged and nothing is held (FORMAT-PRUNE FP12): the four zones once held (Driftwood, Nalati, Nine Dragon, Pine) are armed again at their epoch-8 readings (SHARD-COMPAT CP10, after Pine r10 and Nalati r5 pinned), and only a new upload over a line is refused. Arming moves to the API catalogue at FP27.",
|
|
3
3
|
"lines": {
|
|
4
4
|
"playingBytes": 1000000000,
|
|
5
5
|
"loadingBytes": 1500000000
|
|
@@ -180,6 +180,38 @@
|
|
|
180
180
|
"playingBytes": 772000529,
|
|
181
181
|
"loadingBytes": 1108011593,
|
|
182
182
|
"evidence": "engine-pinned product revision 2 (tar f4a1d611cccc), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
183
|
+
},
|
|
184
|
+
"driftwood-isle": {
|
|
185
|
+
"armed": "2026-11-18",
|
|
186
|
+
"by": "mini-pinemem5",
|
|
187
|
+
"epoch": 8,
|
|
188
|
+
"playingBytes": 820905616,
|
|
189
|
+
"loadingBytes": 1157545785,
|
|
190
|
+
"evidence": "shard-driftwood e736730 built with format 0.37 (epoch 8); codex-nalati locked pairs on the EM11 upper read 990.5 / 1,344.7 MB (meta MEMORY-GATES); re-armed 2026-11-21 by SHARD-COMPAT CP10 (J486): engine pins and cooks validate judged stored, so an older pinned product is never re-judged"
|
|
191
|
+
},
|
|
192
|
+
"nalati-grasslands": {
|
|
193
|
+
"armed": "2026-11-18",
|
|
194
|
+
"by": "mini-pinemem5",
|
|
195
|
+
"epoch": 8,
|
|
196
|
+
"playingBytes": 945736154,
|
|
197
|
+
"loadingBytes": 1328901899,
|
|
198
|
+
"evidence": "shard-nalati 1d5014e8 built with format 0.37 (epoch 8); mini-resweep EM11 upper on the J420 stand-in: playing 0.940 GB less the worker, loading 1.470 GB (meta MEMORY-GATES); re-armed 2026-11-21 by SHARD-COMPAT CP10 (J486): engine pins and cooks validate judged stored, so an older pinned product is never re-judged"
|
|
199
|
+
},
|
|
200
|
+
"nine-dragon-stack": {
|
|
201
|
+
"armed": "2026-11-18",
|
|
202
|
+
"by": "mini-pinemem5",
|
|
203
|
+
"epoch": 8,
|
|
204
|
+
"playingBytes": 1023504847,
|
|
205
|
+
"loadingBytes": 1434692360,
|
|
206
|
+
"evidence": "shard-nine-dragon 8779b872 built with format 0.37 (epoch 8); mini-pinemem6 prepared online boot on engine d0fd6e62, 9 pairs: playing upper 0.938 GB, loading upper 1.435 GB (meta 1677f091). The estimate's playing (1,023.5 MB) is over the 1.0 GB line, so it locks at that reading; re-armed 2026-11-21 by SHARD-COMPAT CP10 (J486): engine pins and cooks validate judged stored, so an older pinned product is never re-judged"
|
|
207
|
+
},
|
|
208
|
+
"pine-hollow": {
|
|
209
|
+
"armed": "2026-11-18",
|
|
210
|
+
"by": "mini-pinemem5",
|
|
211
|
+
"epoch": 8,
|
|
212
|
+
"playingBytes": 920666659,
|
|
213
|
+
"loadingBytes": 1298769921,
|
|
214
|
+
"evidence": "shard-pine-hollow 400ed4b7 built with format 0.37 (epoch 8); mini-pinemem6 prepared online boot on engine f0a96518, 9 pairs: playing upper 0.969 GB, loading upper 1.407 GB (meta 118a2b13); re-armed 2026-11-21 by SHARD-COMPAT CP10 (J486): engine pins and cooks validate judged stored, so an older pinned product is never re-judged"
|
|
183
215
|
}
|
|
184
216
|
}
|
|
185
217
|
}
|
|
@@ -72,13 +72,12 @@ export function parseOutputDescriptorIndex(input: unknown): OutputIndex | null {
|
|
|
72
72
|
return isOutputIndex(input) ? parseOutputIndexRows(input) : null;
|
|
73
73
|
}
|
|
74
74
|
/** The fields only the legacy envelope (`formatVersion: 2`, formats 0.1 to 0.1.0.1) carries; 0.1.0.2 drops each
|
|
75
|
-
* (SHARD-COMPAT CP14; FORMAT-PRUNE FP3 `runtime.trust`, FP4 the always-empty
|
|
75
|
+
* (SHARD-COMPAT CP14; FORMAT-PRUNE FP3 `runtime.trust`, FP4 the always-empty index lists). */
|
|
76
76
|
// oxlint-disable-next-line typescript/prefer-readonly-parameter-types -- valibot output, only read
|
|
77
77
|
function legacyIndexFields(index: OutputIndex): readonly string[] {
|
|
78
78
|
return [
|
|
79
79
|
index.version === undefined ? undefined : 'version',
|
|
80
80
|
index.schemas === undefined ? undefined : 'schemas',
|
|
81
|
-
index.requires.capabilities === undefined ? undefined : 'requires.capabilities',
|
|
82
81
|
index.runtime?.files === undefined ? undefined : 'runtime.files',
|
|
83
82
|
index.runtime?.lines === undefined ? undefined : 'runtime.lines',
|
|
84
83
|
index.runtime === null || !Object.hasOwn(index.runtime, 'trust') ? undefined : 'runtime.trust',
|
|
@@ -94,7 +93,7 @@ function checkIndexEnvelope(index: OutputIndex): void {
|
|
|
94
93
|
}
|
|
95
94
|
return;
|
|
96
95
|
}
|
|
97
|
-
const needed = ['version', 'schemas',
|
|
96
|
+
const needed = ['version', 'schemas', ...index.runtime === null ? [] : ['runtime.files', 'runtime.lines']];
|
|
98
97
|
const missing = needed.filter((field: string): boolean => !carried.includes(field));
|
|
99
98
|
if (missing.length > 0) {
|
|
100
99
|
throw new Error(`Legacy shard.json (formatVersion 2) needs ${missing.join(', ')}`);
|
|
@@ -40,7 +40,7 @@ const tileCount = (2 * CHUNK_HALF / WIRE_TILE_SIZES.l0) ** 2 + (2 * CHUNK_HALF /
|
|
|
40
40
|
/** Stable authored shard identity and deterministic seed. */
|
|
41
41
|
export const IdentitySchema: v.GenericSchema<ShardIdentityInput, ShardIdentity> = v.strictObject({ slug: name, name: v.pipe(v.string(), v.minLength(1), v.maxLength(limits.idCharacters)), author: v.pipe(v.string(), v.minLength(1), v.maxLength(limits.idCharacters)), revision: positive, seed: ShardNaturalSchema });
|
|
42
42
|
/** Wire revision, capabilities and exact commons declarations. */
|
|
43
|
-
export const RequiresSchema: v.GenericSchema<ShardRequiresInput, ShardRequires> = v.strictObject({ sdk: v.picklist(SHARDFILE_VERSIONS), capabilities:
|
|
43
|
+
export const RequiresSchema: v.GenericSchema<ShardRequiresInput, ShardRequires> = v.strictObject({ sdk: v.picklist(SHARDFILE_VERSIONS), capabilities: ShardNamesSchema, commons: v.pipe(v.array(ShardHashSchema), v.maxLength(limits.commons)), commonsWire: v.optional(v.record(ShardHashSchema, ShardNaturalSchema), {}), commonsCosts: v.optional(CommonsCostsSchema, {}) });
|
|
44
44
|
/** Authored compressed and resident ceilings. */
|
|
45
45
|
export const BudgetsSchema: v.GenericSchema<ShardBudgetsInput, ShardBudgets> = v.strictObject({
|
|
46
46
|
/** Reviewed whole-client floor retained when an opaque runtime becomes declared data. */
|
|
@@ -224,8 +224,7 @@ interface ShardIdentityFields {
|
|
|
224
224
|
export type ShardIdentity = { [Key in keyof ShardIdentityFields]: ShardIdentityFields[Key] };
|
|
225
225
|
interface ShardRequiresInputFields {
|
|
226
226
|
sdk: ShardfileVersion;
|
|
227
|
-
|
|
228
|
-
capabilities?: ShardNamesInput;
|
|
227
|
+
capabilities: ShardNamesInput;
|
|
229
228
|
commons: (ShardHashInput)[];
|
|
230
229
|
commonsWire?: Record<string, ShardNaturalInput> | undefined;
|
|
231
230
|
commonsCosts?: v.InferInput<typeof CommonsCostsSchema> | undefined;
|
|
@@ -233,7 +232,7 @@ interface ShardRequiresInputFields {
|
|
|
233
232
|
export type ShardRequiresInput = { [Key in keyof ShardRequiresInputFields]: ShardRequiresInputFields[Key] };
|
|
234
233
|
interface ShardRequiresFields {
|
|
235
234
|
sdk: ShardfileVersion;
|
|
236
|
-
capabilities
|
|
235
|
+
capabilities: ShardNames;
|
|
237
236
|
commons: (ShardHash)[];
|
|
238
237
|
commonsWire: Record<string, ShardNatural>;
|
|
239
238
|
commonsCosts: v.InferOutput<typeof CommonsCostsSchema>;
|
package/src/format/version.ts
CHANGED
|
@@ -123,28 +123,39 @@ function withoutKeys(value: unknown, keys: readonly string[]): unknown {
|
|
|
123
123
|
)
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/** The rows `outputIndexEnvelope` returns: the writer's own rows, typed so it keeps reading them, with `version` and
|
|
127
|
+
* `schemas` possibly gone and `formatVersion` possibly the version string. */
|
|
128
|
+
type IndexEnvelope<Rows> = Omit<Rows, 'formatVersion' | 'schemas' | 'version'> &
|
|
129
|
+
Readonly<{
|
|
130
|
+
formatVersion: unknown
|
|
131
|
+
version?: unknown
|
|
132
|
+
schemas?: unknown
|
|
133
|
+
}>
|
|
134
|
+
|
|
126
135
|
/** SHARD-COMPAT CP14: writers build the legacy `shard.json` rows (`formatVersion: 2`, `version`, the always-empty lists)
|
|
127
136
|
* and pass them here. At a `version` of 0.1.0.2 or later this returns the envelope that version writes: `formatVersion`
|
|
128
|
-
* is the version, and `version`, `schemas`, `runtime.files`, `runtime.lines
|
|
129
|
-
* `
|
|
130
|
-
function outputIndexEnvelope(
|
|
131
|
-
rows:
|
|
132
|
-
):
|
|
137
|
+
* is the version, and `version`, `schemas`, `runtime.files`, `runtime.lines` and `runtime.trust` go. An older
|
|
138
|
+
* `version` comes back unchanged. */
|
|
139
|
+
function outputIndexEnvelope<Rows extends Readonly<Record<string, unknown>>>(
|
|
140
|
+
rows: Rows,
|
|
141
|
+
): IndexEnvelope<Rows> {
|
|
133
142
|
const { version } = rows
|
|
134
|
-
if (typeof version !== 'string' || !writesIndexFormatVersion(version)) {
|
|
135
|
-
return { ...rows }
|
|
136
|
-
}
|
|
137
143
|
const { version: _version, schemas: _schemas, ...rest } = rows
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
const envelope: Record<string, unknown> =
|
|
145
|
+
typeof version !== 'string' || !writesIndexFormatVersion(version)
|
|
146
|
+
? { ...rows }
|
|
147
|
+
: {
|
|
148
|
+
...rest,
|
|
149
|
+
formatVersion: version,
|
|
150
|
+
runtime: withoutKeys(rest['runtime'], ['files', 'lines', 'trust']),
|
|
151
|
+
}
|
|
152
|
+
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- the writer's own rows; only envelope fields change
|
|
153
|
+
return envelope as IndexEnvelope<Rows>
|
|
144
154
|
}
|
|
145
155
|
|
|
146
156
|
export {
|
|
147
157
|
outputIndexEnvelope,
|
|
158
|
+
type IndexEnvelope,
|
|
148
159
|
SHARDFILE_VERSION,
|
|
149
160
|
SHARDFILE_VERSIONS,
|
|
150
161
|
LEGACY_INDEX_VERSIONS,
|