@wildshard/shard-format 0.75.0 → 0.77.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 +2 -1
- package/src/format/deprecations.ts +7 -1
- package/src/format/engine-floor.ts +68 -0
- package/src/format/format-migration-manifest.ts +183 -0
- package/src/format/format-migration-prune.ts +1 -1
- package/src/format/format-migrations.ts +8 -0
- package/src/format/heldFinishes.ts +5 -3
- package/src/format/items.ts +1 -1
- package/src/format/json-schema.ts +9 -0
- package/src/format/loadout.ts +7 -5
- package/src/format/manifest-deprecations.ts +174 -6
- package/src/format/memory-armed.json +1 -203
- package/src/format/memory-armed.ts +4 -25
- package/src/format/memory-epoch.ts +1 -1
- package/src/format/memory-line.ts +12 -3
- package/src/format/outputIndex.ts +12 -2
- package/src/format/policy-verdict.ts +1 -1
- package/src/format/shardSections.ts +35 -3
- package/src/format/shardfile-stream-rows.ts +13 -1
- package/src/format/shardfile-stream.ts +3 -2
- package/src/format/shardfileValidation.ts +3 -2
- package/src/format/version.ts +24 -6
- package/src/format/weapon-slot.ts +55 -0
|
@@ -1,209 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$doc": "J426 (Jake, 2026-11-18): the
|
|
2
|
+
"$doc": "J426 (Jake, 2026-11-18): the J410 memory lines every memory gate judges an armed shard by. Which shards are armed is the API catalogue's word (FORMAT-PRUNE FP27, `/api/catalogue` `armed`, its `memory_armed` table seeded from this file's former `zones`): admission passes it to the format (FP27b), and since FP27c the format keeps no list of its own, so a gate given no catalogue word reports only (J424). An armed shard's offline estimate refuses over lines.loadingBytes (J445); playing and runtime overages report. Decimal bytes.",
|
|
3
3
|
"lines": {
|
|
4
4
|
"playingBytes": 1000000000,
|
|
5
5
|
"loadingBytes": 1500000000
|
|
6
|
-
},
|
|
7
|
-
"zones": {
|
|
8
|
-
"brasscap-mesa": {
|
|
9
|
-
"armed": "2026-11-18",
|
|
10
|
-
"by": "mini-pinemem5",
|
|
11
|
-
"epoch": 8,
|
|
12
|
-
"playingBytes": 679221837,
|
|
13
|
-
"loadingBytes": 984731013,
|
|
14
|
-
"evidence": "engine-pinned product revision 6 (tar f42fe0449a93), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
15
|
-
},
|
|
16
|
-
"far-reach": {
|
|
17
|
-
"armed": "2026-11-18",
|
|
18
|
-
"by": "mini-pinemem5",
|
|
19
|
-
"epoch": 8,
|
|
20
|
-
"playingBytes": 999952196,
|
|
21
|
-
"loadingBytes": 1415754105,
|
|
22
|
-
"evidence": "engine-pinned product revision 4 (tar 5bc5adcf764a), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
23
|
-
},
|
|
24
|
-
"ink-cel-valley": {
|
|
25
|
-
"armed": "2026-11-18",
|
|
26
|
-
"by": "mini-pinemem5",
|
|
27
|
-
"epoch": 8,
|
|
28
|
-
"playingBytes": 636979847,
|
|
29
|
-
"loadingBytes": 925290035,
|
|
30
|
-
"evidence": "engine-pinned product revision 1 (tar 5764c86a258a), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
31
|
-
},
|
|
32
|
-
"open-plot-alien-plain": {
|
|
33
|
-
"armed": "2026-11-18",
|
|
34
|
-
"by": "mini-pinemem5",
|
|
35
|
-
"epoch": 8,
|
|
36
|
-
"playingBytes": 665173554,
|
|
37
|
-
"loadingBytes": 967392441,
|
|
38
|
-
"evidence": "engine-pinned product revision 1 (tar c32cd9fb9229), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
39
|
-
},
|
|
40
|
-
"open-plot-clockwork-canyon": {
|
|
41
|
-
"armed": "2026-11-18",
|
|
42
|
-
"by": "mini-pinemem5",
|
|
43
|
-
"epoch": 8,
|
|
44
|
-
"playingBytes": 675751489,
|
|
45
|
-
"loadingBytes": 982935896,
|
|
46
|
-
"evidence": "engine-pinned product revision 1 (tar 3b322eccd99e), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
47
|
-
},
|
|
48
|
-
"open-plot-coral-drift": {
|
|
49
|
-
"armed": "2026-11-18",
|
|
50
|
-
"by": "mini-pinemem5",
|
|
51
|
-
"epoch": 8,
|
|
52
|
-
"playingBytes": 681768940,
|
|
53
|
-
"loadingBytes": 992453778,
|
|
54
|
-
"evidence": "engine-pinned product revision 1 (tar 87841749dc3f), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
55
|
-
},
|
|
56
|
-
"open-plot-desert-ruin": {
|
|
57
|
-
"armed": "2026-11-18",
|
|
58
|
-
"by": "mini-pinemem5",
|
|
59
|
-
"epoch": 8,
|
|
60
|
-
"playingBytes": 686478807,
|
|
61
|
-
"loadingBytes": 997958716,
|
|
62
|
-
"evidence": "engine-pinned product revision 1 (tar 3b65bfef7275), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
63
|
-
},
|
|
64
|
-
"open-plot-ember-forge": {
|
|
65
|
-
"armed": "2026-11-18",
|
|
66
|
-
"by": "mini-pinemem5",
|
|
67
|
-
"epoch": 8,
|
|
68
|
-
"playingBytes": 679682616,
|
|
69
|
-
"loadingBytes": 987005255,
|
|
70
|
-
"evidence": "engine-pinned product revision 1 (tar e1a3a9325e8e), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
71
|
-
},
|
|
72
|
-
"open-plot-fossil-badlands": {
|
|
73
|
-
"armed": "2026-11-18",
|
|
74
|
-
"by": "mini-pinemem5",
|
|
75
|
-
"epoch": 8,
|
|
76
|
-
"playingBytes": 671308241,
|
|
77
|
-
"loadingBytes": 976533532,
|
|
78
|
-
"evidence": "engine-pinned product revision 1 (tar 5bbdd51b8db9), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
79
|
-
},
|
|
80
|
-
"open-plot-frostline-peaks": {
|
|
81
|
-
"armed": "2026-11-18",
|
|
82
|
-
"by": "mini-pinemem5",
|
|
83
|
-
"epoch": 8,
|
|
84
|
-
"playingBytes": 694731191,
|
|
85
|
-
"loadingBytes": 1007041500,
|
|
86
|
-
"evidence": "engine-pinned product revision 1 (tar ec7b8879a343), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
87
|
-
},
|
|
88
|
-
"open-plot-jungle-ziggurat": {
|
|
89
|
-
"armed": "2026-11-18",
|
|
90
|
-
"by": "mini-pinemem5",
|
|
91
|
-
"epoch": 8,
|
|
92
|
-
"playingBytes": 683128342,
|
|
93
|
-
"loadingBytes": 992540003,
|
|
94
|
-
"evidence": "engine-pinned product revision 1 (tar 62fdb3cc7e41), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
95
|
-
},
|
|
96
|
-
"open-plot-lantern-bayou": {
|
|
97
|
-
"armed": "2026-11-18",
|
|
98
|
-
"by": "mini-pinemem5",
|
|
99
|
-
"epoch": 8,
|
|
100
|
-
"playingBytes": 679945285,
|
|
101
|
-
"loadingBytes": 989938627,
|
|
102
|
-
"evidence": "engine-pinned product revision 1 (tar 1f9fb1cba098), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
103
|
-
},
|
|
104
|
-
"open-plot-mosslight-ruins": {
|
|
105
|
-
"armed": "2026-11-18",
|
|
106
|
-
"by": "mini-pinemem5",
|
|
107
|
-
"epoch": 8,
|
|
108
|
-
"playingBytes": 693006386,
|
|
109
|
-
"loadingBytes": 1006944516,
|
|
110
|
-
"evidence": "engine-pinned product revision 1 (tar 19840339238b), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
111
|
-
},
|
|
112
|
-
"open-plot-night-market": {
|
|
113
|
-
"armed": "2026-11-18",
|
|
114
|
-
"by": "mini-pinemem5",
|
|
115
|
-
"epoch": 8,
|
|
116
|
-
"playingBytes": 709180040,
|
|
117
|
-
"loadingBytes": 1028237840,
|
|
118
|
-
"evidence": "engine-pinned product revision 1 (tar d8fe11c2db67), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
119
|
-
},
|
|
120
|
-
"open-plot-patchwork-fairground": {
|
|
121
|
-
"armed": "2026-11-18",
|
|
122
|
-
"by": "mini-pinemem5",
|
|
123
|
-
"epoch": 8,
|
|
124
|
-
"playingBytes": 670516626,
|
|
125
|
-
"loadingBytes": 974863462,
|
|
126
|
-
"evidence": "engine-pinned product revision 1 (tar e517f4814ef6), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
127
|
-
},
|
|
128
|
-
"open-plot-saltwind-lighthouse": {
|
|
129
|
-
"armed": "2026-11-18",
|
|
130
|
-
"by": "mini-pinemem5",
|
|
131
|
-
"epoch": 8,
|
|
132
|
-
"playingBytes": 657567209,
|
|
133
|
-
"loadingBytes": 956173411,
|
|
134
|
-
"evidence": "engine-pinned product revision 1 (tar 2e37a04b0c9e), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
135
|
-
},
|
|
136
|
-
"open-plot-sky-harbor": {
|
|
137
|
-
"armed": "2026-11-18",
|
|
138
|
-
"by": "mini-pinemem5",
|
|
139
|
-
"epoch": 8,
|
|
140
|
-
"playingBytes": 671985118,
|
|
141
|
-
"loadingBytes": 977835231,
|
|
142
|
-
"evidence": "engine-pinned product revision 1 (tar 9aa4a9839015), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
143
|
-
},
|
|
144
|
-
"open-plot-sky-race": {
|
|
145
|
-
"armed": "2026-11-18",
|
|
146
|
-
"by": "mini-pinemem5",
|
|
147
|
-
"epoch": 8,
|
|
148
|
-
"playingBytes": 671490214,
|
|
149
|
-
"loadingBytes": 977159704,
|
|
150
|
-
"evidence": "engine-pinned product revision 1 (tar a5633d8eee7f), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
151
|
-
},
|
|
152
|
-
"open-plot-starfall-observatory": {
|
|
153
|
-
"armed": "2026-11-18",
|
|
154
|
-
"by": "mini-pinemem5",
|
|
155
|
-
"epoch": 8,
|
|
156
|
-
"playingBytes": 674717033,
|
|
157
|
-
"loadingBytes": 981241332,
|
|
158
|
-
"evidence": "engine-pinned product revision 1 (tar 25331b613be1), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
159
|
-
},
|
|
160
|
-
"open-plot-thin-ice": {
|
|
161
|
-
"armed": "2026-11-18",
|
|
162
|
-
"by": "mini-pinemem5",
|
|
163
|
-
"epoch": 8,
|
|
164
|
-
"playingBytes": 657896658,
|
|
165
|
-
"loadingBytes": 957357794,
|
|
166
|
-
"evidence": "engine-pinned product revision 1 (tar 4546f70ddac2), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
167
|
-
},
|
|
168
|
-
"pastel-plain": {
|
|
169
|
-
"armed": "2026-11-18",
|
|
170
|
-
"by": "mini-pinemem5",
|
|
171
|
-
"epoch": 8,
|
|
172
|
-
"playingBytes": 636958876,
|
|
173
|
-
"loadingBytes": 925256481,
|
|
174
|
-
"evidence": "engine-pinned product revision 1 (tar e42e2f5f5793), a shard with no runtime reading; epoch-8 golden estimate; mini-resweep reads every light zone under both J410 lines standalone"
|
|
175
|
-
},
|
|
176
|
-
"sunscar-dunes": {
|
|
177
|
-
"armed": "2026-11-18",
|
|
178
|
-
"by": "mini-pinemem5",
|
|
179
|
-
"epoch": 8,
|
|
180
|
-
"playingBytes": 772000529,
|
|
181
|
-
"loadingBytes": 1108011593,
|
|
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
|
-
"pine-hollow": {
|
|
201
|
-
"armed": "2026-11-18",
|
|
202
|
-
"by": "mini-pinemem5",
|
|
203
|
-
"epoch": 8,
|
|
204
|
-
"playingBytes": 920666659,
|
|
205
|
-
"loadingBytes": 1298769921,
|
|
206
|
-
"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"
|
|
207
|
-
}
|
|
208
6
|
}
|
|
209
7
|
}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
import armed from './memory-armed.json' with { type: 'json' }
|
|
2
2
|
|
|
3
|
-
/** The armed-zone readings are shared with the engine. J445 uses the common
|
|
4
|
-
* loading ceiling for offline refusal and the playing line for reporting. */
|
|
5
|
-
interface ArmedZone {
|
|
6
|
-
readonly armed: string
|
|
7
|
-
readonly by: string
|
|
8
|
-
readonly epoch: number
|
|
9
|
-
readonly playingBytes: number
|
|
10
|
-
readonly loadingBytes: number
|
|
11
|
-
readonly evidence: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
3
|
type ArmedKind = 'playing' | 'loading'
|
|
15
4
|
|
|
16
5
|
/** FORMAT-PRUNE FP27b: the zone a memory gate judges. Admission passes the API catalogue's `armed` beside the slug
|
|
17
|
-
* (`{ slug, armed }`);
|
|
6
|
+
* (`{ slug, armed }`); since FP27c the format keeps no list, so a bare slug is not armed and reports only (J424). */
|
|
18
7
|
type ZoneRef =
|
|
19
8
|
| string
|
|
20
9
|
| undefined
|
|
@@ -45,18 +34,10 @@ const ARMED_LINES: Readonly<Record<ArmedKind, number>> = Object.freeze({
|
|
|
45
34
|
loading: armed.lines.loadingBytes,
|
|
46
35
|
})
|
|
47
36
|
|
|
48
|
-
|
|
49
|
-
armed.
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
/** J424 (QA 11-18 row 29): a zone armed once but held out of `ARMED_ZONES` while engine pins an older product of it
|
|
53
|
-
* that reads over its line. It reports only; it moves back to `zones` (re-armed) when its engine re-pin lands. */
|
|
54
|
-
/** True when the zone is armed (J426): the catalogue's word when admission passed it, else the format's list. */
|
|
37
|
+
/** True when the zone is armed (J426): the API catalogue's word, which admission passes (FP27b). A bare slug carries no
|
|
38
|
+
* word: since FP27c the format keeps no armed list, so it reports only (J424). */
|
|
55
39
|
function zoneArmed(zone?: ZoneRef): boolean {
|
|
56
|
-
|
|
57
|
-
return zone.armed
|
|
58
|
-
}
|
|
59
|
-
return zone !== undefined && Object.hasOwn(ARMED_ZONES, zone)
|
|
40
|
+
return typeof zone === 'object' && zone.armed
|
|
60
41
|
}
|
|
61
42
|
|
|
62
43
|
/** The common lines for an armed zone. A revision's own reading is evidence,
|
|
@@ -103,9 +84,7 @@ function staleReadingAdmitted(zone: ZoneRef): boolean {
|
|
|
103
84
|
|
|
104
85
|
export {
|
|
105
86
|
ARMED_LINES,
|
|
106
|
-
ARMED_ZONES,
|
|
107
87
|
type ArmedKind,
|
|
108
|
-
type ArmedZone,
|
|
109
88
|
type ZoneRef,
|
|
110
89
|
armedLine,
|
|
111
90
|
armedZone,
|
|
@@ -47,7 +47,7 @@ function staleRuntimeIssues(
|
|
|
47
47
|
identity?: Readonly<{
|
|
48
48
|
slug: string
|
|
49
49
|
saveRevision: number
|
|
50
|
-
/** FP27b: the API catalogue's armed state; absent, the
|
|
50
|
+
/** FP27b: the API catalogue's armed state; absent, the shard is not armed (FP27c). */
|
|
51
51
|
armed?: boolean | ReadonlySet<string> | undefined
|
|
52
52
|
}>,
|
|
53
53
|
): StaleRuntimeIssue[] {
|
|
@@ -33,7 +33,9 @@ function overHardLine(bytes: number): string {
|
|
|
33
33
|
function hardLineIssue(
|
|
34
34
|
kind: 'playing' | 'loading',
|
|
35
35
|
bytes: number,
|
|
36
|
-
zone?:
|
|
36
|
+
zone?:
|
|
37
|
+
| ZoneRef
|
|
38
|
+
| Readonly<{ slug?: string | undefined; armed?: boolean; line: number }>,
|
|
37
39
|
): {
|
|
38
40
|
readonly code: 'perf-playing-memory' | 'perf-loading-memory'
|
|
39
41
|
readonly metric: string
|
|
@@ -41,9 +43,16 @@ function hardLineIssue(
|
|
|
41
43
|
readonly limit: number
|
|
42
44
|
readonly severity: 'refusal' | 'warning'
|
|
43
45
|
} {
|
|
46
|
+
// FP27c: a zone with its own line carries the catalogue's armed word beside its slug, as a ZoneRef does.
|
|
44
47
|
const { slug, line } =
|
|
45
48
|
typeof zone === 'object' && 'line' in zone
|
|
46
|
-
?
|
|
49
|
+
? {
|
|
50
|
+
slug:
|
|
51
|
+
zone.armed === undefined
|
|
52
|
+
? zone.slug
|
|
53
|
+
: { slug: zone.slug, armed: zone.armed },
|
|
54
|
+
line: zone.line,
|
|
55
|
+
}
|
|
47
56
|
: { slug: zone, line: ARMED_LINES[kind] }
|
|
48
57
|
const severity = ratchetSeverity(slug, kind, { line, actual: bytes })
|
|
49
58
|
const over =
|
|
@@ -95,7 +104,7 @@ type MemoryContext =
|
|
|
95
104
|
mountedImages: number
|
|
96
105
|
index?: TierIndex
|
|
97
106
|
judged?: 'upload' | 'stored'
|
|
98
|
-
/** FP27b: the API catalogue's armed state for this shard; absent, the
|
|
107
|
+
/** FP27b: the API catalogue's armed state for this shard; absent, the shard is not armed (FP27c). */
|
|
99
108
|
armed?: boolean | ReadonlySet<string> | undefined
|
|
100
109
|
}>
|
|
101
110
|
|
|
@@ -17,7 +17,8 @@ import { ClientPlanRuntimeSchema } from './runtime.ts';
|
|
|
17
17
|
import { RuntimeSpawnsSchema } from './runtimeSpawns.ts';
|
|
18
18
|
import { RowsSchema } from './rows.ts';
|
|
19
19
|
import { ShardHashSchema, ShardNaturalSchema, IdentitySchema, RequiresSchema, FilesSchema, type ShardIdentityInput, type ShardRequiresInput, type ShardReferencesInput, type ShardIdentity, type ShardRequires, type ShardReferences } from './shardSections.ts';
|
|
20
|
-
import { LEGACY_LAYOUT, writesNoRequiresSdk, writesPreparationMarker, writesSaveRevision } from './version.ts';
|
|
20
|
+
import { LEGACY_LAYOUT, carriesEngineFloor, writesNoRequiresSdk, writesPreparationMarker, writesSaveRevision } from './version.ts';
|
|
21
|
+
import { checkNoMovedWords } from './manifest-deprecations.ts';
|
|
21
22
|
import { IndexFormatVersionSchema, LegacyIndexVersionSchema } from './index-format-version.ts';
|
|
22
23
|
import type { IndexFormatVersion, LegacyIndexVersion } from './version.ts';
|
|
23
24
|
import { isJsonData, isJsonDataWithFileSchemas } from './json.ts';
|
|
@@ -138,11 +139,18 @@ function checkNoRequiresSdk(index: OutputIndex): void {
|
|
|
138
139
|
const version = index.formatVersion === LEGACY_LAYOUT ? undefined : index.formatVersion;
|
|
139
140
|
if (version !== undefined && writesNoRequiresSdk(version) && index.requires.sdk !== undefined) { throw new Error(`Format ${version} carries no requires.sdk (shard.json; FORMAT-PRUNE FP33)`); }
|
|
140
141
|
}
|
|
142
|
+
/** FP47b: `requires.engine` is a 0.1.0.6 word; an older file never carries it (an engine on that format refuses it). */
|
|
143
|
+
// oxlint-disable-next-line typescript/prefer-readonly-parameter-types -- valibot output, only read
|
|
144
|
+
function checkEngineFloorVersion(index: OutputIndex): void {
|
|
145
|
+
const version = index.formatVersion === LEGACY_LAYOUT ? undefined : index.formatVersion;
|
|
146
|
+
if (index.requires.engine !== undefined && (version === undefined || !carriesEngineFloor(version))) { throw new Error(`Format ${String(version ?? index.formatVersion)} carries no requires.engine (shard.json; from 0.1.0.6, FORMAT-PRUNE FP47b)`); }
|
|
147
|
+
}
|
|
141
148
|
function parseOutputIndexRows(input: unknown): OutputIndex {
|
|
142
149
|
const index = v.parse(OutputIndexSchema, input);
|
|
143
150
|
checkIndexEnvelope(index);
|
|
144
151
|
checkSaveRevisionSpelling(input, index);
|
|
145
152
|
checkNoRequiresSdk(index);
|
|
153
|
+
checkEngineFloorVersion(index);
|
|
146
154
|
const prepared = preparationSpecOf(index) !== undefined || unreadPreparationSpec(index) !== undefined;
|
|
147
155
|
if (prepared && index.cook === undefined) { throw new Error(`Missing cook preparation: run wildshard prepare <folder> --base <exact-preview-url> (${index.identity.slug})`); }
|
|
148
156
|
if (prepared && index.cook !== undefined && index.cook.bytes > MAX_COOK_BYTES) { throw new Error('Cook preparation exceeds byte cap'); }
|
|
@@ -230,7 +238,9 @@ export function assembleOutputFields(index: OutputIndex, sections: ReadonlyMap<s
|
|
|
230
238
|
}
|
|
231
239
|
/** The default untrusted reader always checks sections and the full host schema. */
|
|
232
240
|
export function assembleOutputShardfile(input: unknown, sections: ReadonlyMap<string, unknown>): Shardfile {
|
|
233
|
-
const
|
|
241
|
+
const index = parseOutputIndex(input);
|
|
242
|
+
checkNoMovedWords(index.formatVersion, sections.get('ui/level'));
|
|
243
|
+
const source = parseShardfile(assembleOutputFields(index, sections), sections);
|
|
234
244
|
const errors = clientOwnershipRules(source, sections); if (errors.length > 0) throw new Error(errors.join('; '));
|
|
235
245
|
return source;
|
|
236
246
|
}
|
|
@@ -13,7 +13,7 @@ import type { ZoneRef } from './memory-armed.ts'
|
|
|
13
13
|
type Judged = 'upload' | 'stored'
|
|
14
14
|
|
|
15
15
|
/** How admission judges a shard: CP10's `judged`, and FP27b's `armed`, the API catalogue's armed state for it (absent,
|
|
16
|
-
* the
|
|
16
|
+
* the shard is not armed: since FP27c the format keeps no list). */
|
|
17
17
|
interface JudgedPorts {
|
|
18
18
|
readonly judged?: Judged | undefined
|
|
19
19
|
readonly armed?: boolean | ReadonlySet<string> | undefined
|
|
@@ -11,6 +11,7 @@ import type { FormatVersion } from './version.ts';
|
|
|
11
11
|
import { RuntimeCostSchema } from './runtimeCost.ts';
|
|
12
12
|
import { CommonsCostsSchema } from './commonsCosts.ts';
|
|
13
13
|
import { ScriptBindingsSchema } from './scripts.ts';
|
|
14
|
+
import { EngineReleaseSchema } from './engine-floor.ts';
|
|
14
15
|
|
|
15
16
|
const CHUNK_HALF = WIRE_CELL.half, CELL_BELOW = WIRE_CELL.below, CELL_ABOVE = WIRE_CELL.above;
|
|
16
17
|
/** Nonnegative safe wire integer. */
|
|
@@ -45,7 +46,7 @@ const IdentityRowSchema = v.strictObject({ slug: name, name: v.pipe(v.string(),
|
|
|
45
46
|
function identityWithSaveRevision(row: Readonly<v.InferOutput<typeof IdentityRowSchema>>): ShardIdentity { const { revision: _old, saveRevision: _new, ...rest } = row; return { ...rest, saveRevision: saveRevisionOf(row) }; }
|
|
46
47
|
export const IdentitySchema: v.GenericSchema<ShardIdentityInput, ShardIdentity> = v.pipe(IdentityRowSchema, v.check(oneSaveRevisionSpelling, 'Shard identity needs exactly one of saveRevision or revision'), v.transform(identityWithSaveRevision));
|
|
47
48
|
/** Wire revision, capabilities and exact commons declarations. */
|
|
48
|
-
export const RequiresSchema: v.GenericSchema<ShardRequiresInput, ShardRequires> = v.strictObject({ sdk: v.exactOptional(v.picklist(SHARDFILE_VERSIONS)), capabilities: v.exactOptional(ShardNamesSchema), commons: v.pipe(v.array(ShardHashSchema), v.maxLength(limits.commons)), commonsWire: v.optional(v.record(ShardHashSchema, ShardNaturalSchema), {}), commonsCosts: v.optional(CommonsCostsSchema, {}) });
|
|
49
|
+
export const RequiresSchema: v.GenericSchema<ShardRequiresInput, ShardRequires> = v.strictObject({ sdk: v.exactOptional(v.picklist(SHARDFILE_VERSIONS)), capabilities: v.exactOptional(ShardNamesSchema), engine: v.exactOptional(EngineReleaseSchema), commons: v.pipe(v.array(ShardHashSchema), v.maxLength(limits.commons)), commonsWire: v.optional(v.record(ShardHashSchema, ShardNaturalSchema), {}), commonsCosts: v.optional(CommonsCostsSchema, {}) });
|
|
49
50
|
/** Authored compressed and resident ceilings. */
|
|
50
51
|
export const BudgetsSchema: v.GenericSchema<ShardBudgetsInput, ShardBudgets> = v.strictObject({
|
|
51
52
|
/** Reviewed whole-client floor retained when an opaque runtime becomes declared data. */
|
|
@@ -80,8 +81,26 @@ export const FarImpostorSchema: v.GenericSchema<FarImpostorInput, FarImpostor> =
|
|
|
80
81
|
});
|
|
81
82
|
/** One far impostor row. */
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
const UNIT_MIN = 0;
|
|
85
|
+
const UNIT_MAX = 1;
|
|
86
|
+
const unit = v.pipe(ShardFiniteSchema, v.minValue(UNIT_MIN), v.maxValue(UNIT_MAX));
|
|
87
|
+
const rgb = v.tuple([ShardFiniteSchema, ShardFiniteSchema, ShardFiniteSchema]);
|
|
88
|
+
const tint = v.exactOptional(rgb);
|
|
89
|
+
const farGrade = v.strictObject({ exposure: ShardFiniteSchema, saturation: ShardFiniteSchema, contrast: ShardFiniteSchema, tint });
|
|
90
|
+
const bandHeight = v.pipe(ShardFiniteSchema, v.minValue(UNIT_MIN), v.maxValue(CELL_ABOVE));
|
|
91
|
+
const farBand = v.strictObject({ colour: rgb, height: bandHeight, opacity: unit, own: unit });
|
|
92
|
+
const farHaze = v.strictObject({ colour: rgb });
|
|
93
|
+
const farFamily = v.picklist(['toon', 'painterly', 'pbr']);
|
|
94
|
+
/**
|
|
95
|
+
* FORMAT-PRUNE FP40: how the far tier draws the proxy (the shard's own far look, as its repo bake wrote `far.json`'s
|
|
96
|
+
* `look`): its shading `family`, the `haze` it fades into, an optional `grade` on its own pixels and an optional mood
|
|
97
|
+
* `band` (SF19b: a fog strip rising at its border, `height` metres, seen from the road; `own` its share inside the cell).
|
|
98
|
+
*/
|
|
99
|
+
const farLook: v.GenericSchema<FarLook, FarLook> = v.strictObject({ family: farFamily, haze: farHaze, grade: v.exactOptional(farGrade), band: v.exactOptional(farBand) });
|
|
100
|
+
const optionalFarLook = v.exactOptional(farLook);
|
|
101
|
+
|
|
102
|
+
/** Nullable far proxy references, bounds and conservative costs (its impostor's file is one of `files`), and its look. */
|
|
103
|
+
export const FarSchema: v.GenericSchema<ShardFarInput, ShardFar> = v.nullable(v.pipe(v.strictObject({ files: ShardReferencesSchema, bounds: CellBoundsSchema, impostor: v.exactOptional(FarImpostorSchema), look: optionalFarLook, ...costs }),
|
|
85
104
|
v.check((far) => far.impostor === undefined || (far.files.includes(far.impostor.file) && far.impostor.bottom < far.impostor.top), 'far impostor file and span')));
|
|
86
105
|
/** Finite local player position and yaw; its default remains in root composition. */
|
|
87
106
|
export const SpawnSchema: v.GenericSchema<ShardSpawnInput, ShardSpawn> = v.strictObject({ x: ShardFiniteSchema, y: ShardFiniteSchema, z: ShardFiniteSchema, yaw: ShardFiniteSchema });
|
|
@@ -236,6 +255,8 @@ interface ShardRequiresInputFields {
|
|
|
236
255
|
sdk?: FormatVersion;
|
|
237
256
|
/** FORMAT-PRUNE FP4: deprecated (always empty, never read); the chain drops it and writers stop sourcing it. */
|
|
238
257
|
capabilities?: ShardNamesInput;
|
|
258
|
+
/** FORMAT-PRUNE FP47b (J505): the lowest engine release that can draw this product (0.1.0.6 on; `engine-floor.ts`). */
|
|
259
|
+
engine?: string;
|
|
239
260
|
commons: (ShardHashInput)[];
|
|
240
261
|
commonsWire?: Record<string, ShardNaturalInput> | undefined;
|
|
241
262
|
commonsCosts?: v.InferInput<typeof CommonsCostsSchema> | undefined;
|
|
@@ -244,6 +265,7 @@ export type ShardRequiresInput = { [Key in keyof ShardRequiresInputFields]: Shar
|
|
|
244
265
|
interface ShardRequiresFields {
|
|
245
266
|
sdk?: FormatVersion;
|
|
246
267
|
capabilities?: ShardNames;
|
|
268
|
+
engine?: string;
|
|
247
269
|
commons: (ShardHash)[];
|
|
248
270
|
commonsWire: Record<string, ShardNatural>;
|
|
249
271
|
commonsCosts: v.InferOutput<typeof CommonsCostsSchema>;
|
|
@@ -361,10 +383,19 @@ interface FarImpostorFields {
|
|
|
361
383
|
range: ShardFinite;
|
|
362
384
|
}
|
|
363
385
|
export type FarImpostor = { [Key in keyof FarImpostorFields]: FarImpostorFields[Key] };
|
|
386
|
+
type FarRgb = [number, number, number];
|
|
387
|
+
/** FP40: a far row's look; the input and output agree. */
|
|
388
|
+
interface FarLook {
|
|
389
|
+
family: 'toon' | 'painterly' | 'pbr';
|
|
390
|
+
haze: { colour: FarRgb };
|
|
391
|
+
grade?: { exposure: number; saturation: number; contrast: number; tint?: FarRgb };
|
|
392
|
+
band?: { colour: FarRgb; height: number; opacity: number; own: number };
|
|
393
|
+
}
|
|
364
394
|
export type ShardFarInput = (Omit<{
|
|
365
395
|
files: ShardReferencesInput;
|
|
366
396
|
bounds: CellBoundsInput;
|
|
367
397
|
impostor?: FarImpostorInput;
|
|
398
|
+
look?: FarLook;
|
|
368
399
|
}, keyof ({
|
|
369
400
|
compressed: ShardNaturalInput;
|
|
370
401
|
decoded: ShardNaturalInput;
|
|
@@ -382,6 +413,7 @@ export type ShardFar = (Omit<{
|
|
|
382
413
|
files: ShardReferences;
|
|
383
414
|
bounds: CellBounds;
|
|
384
415
|
impostor?: FarImpostor;
|
|
416
|
+
look?: FarLook;
|
|
385
417
|
}, keyof ({
|
|
386
418
|
compressed: ShardNatural;
|
|
387
419
|
decoded: ShardNatural;
|
|
@@ -10,6 +10,10 @@ import { cookMountPath, readCookData } from './cook-data.ts'
|
|
|
10
10
|
import { requireCookPreparation } from './cook-preparation.ts'
|
|
11
11
|
import { deprecationReport } from './deprecations.ts'
|
|
12
12
|
import { issueError, withIssueCode } from './issue-codes.ts'
|
|
13
|
+
import {
|
|
14
|
+
checkDiscoveryMount,
|
|
15
|
+
isDiscoveryMount,
|
|
16
|
+
} from './manifest-deprecations.ts'
|
|
13
17
|
import { validatePlatformFile } from './platformFileFamilies.ts'
|
|
14
18
|
import { decisionModuleContracts } from './scriptContract.ts'
|
|
15
19
|
import { mountSharesBlob } from './shardfile-reads.ts'
|
|
@@ -174,7 +178,15 @@ function cookSteps(replay: Readonly<Replay>, index: OutputIndex): void {
|
|
|
174
178
|
if (mount.path !== cookMountPath(mount.url)) {
|
|
175
179
|
throw new Error(`Mount path differs from its URL: ${mount.url}`)
|
|
176
180
|
}
|
|
177
|
-
|
|
181
|
+
if (isDiscoveryMount(mount.path)) {
|
|
182
|
+
checkDiscoveryMount(
|
|
183
|
+
index.formatVersion,
|
|
184
|
+
mount.path,
|
|
185
|
+
listedBytes(replay, mount),
|
|
186
|
+
)
|
|
187
|
+
} else {
|
|
188
|
+
readListed(replay, mount)
|
|
189
|
+
}
|
|
178
190
|
}
|
|
179
191
|
}
|
|
180
192
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { SHARDFILE_ADMISSION_LIMITS as limits } from './admissionLimits.ts'
|
|
17
17
|
import { assertSectionSides } from './feature-sides.ts'
|
|
18
18
|
import { issueError, withIssueCode } from './issue-codes.ts'
|
|
19
|
+
import { unheldMount } from './manifest-deprecations.ts'
|
|
19
20
|
import { parseOutputIndex, validateOutputSection } from './outputIndex.ts'
|
|
20
21
|
import { admittedVerdict } from './policy-verdict.ts'
|
|
21
22
|
import { assertScriptSides } from './script-sides.ts'
|
|
@@ -102,9 +103,9 @@ const STREAM_KEPT_CAP = 48_000_000
|
|
|
102
103
|
const NONE = 0
|
|
103
104
|
const NEXT = 1
|
|
104
105
|
|
|
105
|
-
/** Whether a member is held whole after its check: everything but blobs,
|
|
106
|
+
/** Whether a member is held whole after its check: everything but blobs, `unheldMount`s, and JSON and Wasm blobs. */
|
|
106
107
|
function keptPath(path: string): boolean {
|
|
107
|
-
if (
|
|
108
|
+
if (unheldMount(path)) {
|
|
108
109
|
return false
|
|
109
110
|
}
|
|
110
111
|
const extension = path.slice(path.lastIndexOf('.') + NEXT)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cookMountPath, readCookData } from './cook-data.ts';
|
|
2
|
+
import { checkDiscoveryMount } from './manifest-deprecations.ts';
|
|
2
3
|
import { requireCookPreparation } from './cook-preparation.ts';
|
|
3
4
|
import { parseOutputIndex, validateOutputSection, assembleOutputShardfile, type OutputFile, type OutputIndex } from './outputIndex.ts';
|
|
4
5
|
import { asWrittenIdentity } from './save-revision.ts';
|
|
@@ -65,7 +66,7 @@ export interface ShardfileValidationPorts {
|
|
|
65
66
|
* and budget policy only reports, since it was judged at upload. Default `'upload'`: the policy refuses. */
|
|
66
67
|
readonly judged?: Judged;
|
|
67
68
|
/** FORMAT-PRUNE FP27b: whether the API catalogue arms this shard (`/api/catalogue` `armed`). Admission passes it; absent,
|
|
68
|
-
* the
|
|
69
|
+
* the shard is not armed: since FP27c the format keeps no list. */
|
|
69
70
|
readonly armed?: boolean | ReadonlySet<string> | undefined;
|
|
70
71
|
/** D31: hold no file's bytes between checks. `assets`, here and in the result, reads each file again from `files`, so a
|
|
71
72
|
* host's peak is its largest file rather than the shard, at the cost of those repeat reads. */
|
|
@@ -218,7 +219,7 @@ function readCook(index: OutputIndex, read: ReadListed, ports: Pick<ShardfileVal
|
|
|
218
219
|
if (!mountSharesBlob(mount, index.files)) {
|
|
219
220
|
if (mount.path !== cookMountPath(mount.url)) { throw new Error(`Mount path differs from its URL: ${mount.url}`); }
|
|
220
221
|
// MG6 epoch 3: the engine images a shard mounts decode at boot like its own (Far Reach's sky and textures).
|
|
221
|
-
mountedImages += mountedImageBytes(mount.path, read(mount));
|
|
222
|
+
mountedImages += mountedImageBytes(mount.path, checkDiscoveryMount(index.formatVersion, mount.path, read(mount)));
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
return { cook, mountedImages };
|
package/src/format/version.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { LEGACY_PREPARATION_SPEC, PREPARED_SDK } from './preparation-spec.ts'
|
|
|
5
5
|
const ZERO = 0
|
|
6
6
|
const ONE = 1
|
|
7
7
|
|
|
8
|
-
const SHARDFILE_VERSION = '0.1.0.
|
|
8
|
+
const SHARDFILE_VERSION = '0.1.0.6'
|
|
9
9
|
/** Formats whose `shard.json` names its version in `version`, beside the frozen layout marker `formatVersion: 2`.
|
|
10
10
|
* Legacy 0.1 is the byte-preserving spelling of 0.1.0.0. */
|
|
11
11
|
const LEGACY_INDEX_VERSIONS: readonly ['0.1', '0.1.0.0', '0.1.0.1'] = [
|
|
@@ -19,8 +19,9 @@ const INDEX_FORMAT_VERSIONS: readonly [
|
|
|
19
19
|
'0.1.0.2',
|
|
20
20
|
'0.1.0.3',
|
|
21
21
|
'0.1.0.4',
|
|
22
|
+
'0.1.0.5',
|
|
22
23
|
typeof SHARDFILE_VERSION,
|
|
23
|
-
] = ['0.1.0.2', '0.1.0.3', '0.1.0.4', SHARDFILE_VERSION] as const
|
|
24
|
+
] = ['0.1.0.2', '0.1.0.3', '0.1.0.4', '0.1.0.5', SHARDFILE_VERSION] as const
|
|
24
25
|
const SHARDFILE_VERSIONS: readonly [
|
|
25
26
|
...typeof LEGACY_INDEX_VERSIONS,
|
|
26
27
|
...typeof INDEX_FORMAT_VERSIONS,
|
|
@@ -44,6 +45,9 @@ const SHARDFILE_VERSION_SAVE_REVISION = '0.1.0.4'
|
|
|
44
45
|
/** The first format whose `shard.json` carries no `requires.sdk` (FORMAT-PRUNE FP33, SHARD-COMPAT CP8): it only ever
|
|
45
46
|
* copied the format version, and nothing reads it. */
|
|
46
47
|
const SHARDFILE_VERSION_NO_REQUIRES_SDK = '0.1.0.5'
|
|
48
|
+
/** The first format whose `shard.json` may name the lowest engine release that draws it, `requires.engine` (FORMAT-PRUNE
|
|
49
|
+
* FP47b, J505): an engine on an older format refuses the word, so the floor holds there too. */
|
|
50
|
+
const SHARDFILE_VERSION_ENGINE_FLOOR = '0.1.0.6'
|
|
47
51
|
/** A format version's four parts. */
|
|
48
52
|
type FormatVersionParts = readonly [number, number, number, number]
|
|
49
53
|
/** @deprecated SHARD-COMPAT SP10: use `FormatVersionParts`. */
|
|
@@ -152,6 +156,13 @@ function writesNoRequiresSdk(version: string): boolean {
|
|
|
152
156
|
)
|
|
153
157
|
}
|
|
154
158
|
|
|
159
|
+
/** Whether a format version may carry `requires.engine` (0.1.0.6 on, FP47b). */
|
|
160
|
+
function carriesEngineFloor(version: string): boolean {
|
|
161
|
+
return (
|
|
162
|
+
compareShardfileVersions(version, SHARDFILE_VERSION_ENGINE_FLOOR) >= ZERO
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
155
166
|
/** FP26: a copy of an identity row with `revision` spelled `saveRevision`; anything else as it is. */
|
|
156
167
|
function withSaveRevision(identity: unknown): unknown {
|
|
157
168
|
if (
|
|
@@ -183,6 +194,14 @@ function withoutKeys(value: unknown, keys: readonly string[]): unknown {
|
|
|
183
194
|
)
|
|
184
195
|
}
|
|
185
196
|
|
|
197
|
+
/** `requires` as `version` writes it: no `sdk` from 0.1.0.5 (FORMAT-PRUNE FP33), no `engine` floor below 0.1.0.6 (FP47b). */
|
|
198
|
+
function requiresAt(requires: unknown, version: string): unknown {
|
|
199
|
+
return withoutKeys(requires, [
|
|
200
|
+
...(writesNoRequiresSdk(version) ? ['sdk'] : []),
|
|
201
|
+
...(carriesEngineFloor(version) ? [] : ['engine']),
|
|
202
|
+
])
|
|
203
|
+
}
|
|
204
|
+
|
|
186
205
|
/** The rows a version from 0.1.0.3 on changes in place: PR4's preparation marker, FP26's save lineage, then FP33's
|
|
187
206
|
* `requires.sdk`. */
|
|
188
207
|
function laterEnvelopeRows(
|
|
@@ -203,10 +222,7 @@ function laterEnvelopeRows(
|
|
|
203
222
|
if (writesSaveRevision(version)) {
|
|
204
223
|
envelope['identity'] = withSaveRevision(envelope['identity'])
|
|
205
224
|
}
|
|
206
|
-
|
|
207
|
-
if (writesNoRequiresSdk(version)) {
|
|
208
|
-
envelope['requires'] = withoutKeys(envelope['requires'], ['sdk'])
|
|
209
|
-
}
|
|
225
|
+
envelope['requires'] = requiresAt(envelope['requires'], version)
|
|
210
226
|
}
|
|
211
227
|
|
|
212
228
|
/** The rows `outputIndexEnvelope` returns: the writer's own rows, typed so it keeps reading them, with `version` and
|
|
@@ -262,6 +278,8 @@ export {
|
|
|
262
278
|
writesPreparationMarker,
|
|
263
279
|
writesSaveRevision,
|
|
264
280
|
writesNoRequiresSdk,
|
|
281
|
+
carriesEngineFloor,
|
|
282
|
+
SHARDFILE_VERSION_ENGINE_FLOOR,
|
|
265
283
|
SHARDFILE_VERSION_PREPARATION,
|
|
266
284
|
SHARDFILE_VERSION_SAVE_REVISION,
|
|
267
285
|
SHARDFILE_VERSION_NO_REQUIRES_SDK,
|