@adea-ai/plugins 4.0.0 → 4.0.1
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/dist/catalog-store.d.ts +81 -0
- package/dist/catalog-store.js +487 -0
- package/dist/catalog-store.js.map +1 -0
- package/dist/consumer-index.d.ts +1 -1
- package/dist/consumer-index.js +17 -7
- package/dist/consumer-index.js.map +1 -1
- package/dist/icon-mirror.d.ts +2 -2
- package/dist/icon-mirror.js +38 -25
- package/dist/icon-mirror.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +56 -51
- package/dist/index.js.map +1 -1
- package/dist/publication.d.ts +8 -11
- package/dist/publication.js +8 -11
- package/dist/publication.js.map +1 -1
- package/dist/site-icons.d.ts +2 -0
- package/dist/site-icons.js +34 -8
- package/dist/site-icons.js.map +1 -1
- package/dist/sources.js +1 -1
- package/dist/sources.js.map +1 -1
- package/native/build-provenance.txt +5 -5
- package/native/staged-reader-win32-arm64.node +0 -0
- package/native/staged-reader-win32-x64.node +0 -0
- package/package.json +6 -4
- package/src/artifacts.test.ts +80 -0
- package/src/catalog-store.ts +546 -0
- package/src/consumer-index.test.ts +125 -0
- package/src/consumer-index.ts +23 -8
- package/src/default-head.test.ts +143 -0
- package/src/icon-mirror.ts +36 -23
- package/src/index.test.ts +122 -0
- package/src/index.ts +82 -53
- package/src/manifest-retry.test.ts +49 -0
- package/src/publication.ts +8 -11
- package/src/site-icons.test.ts +73 -0
- package/src/site-icons.ts +27 -10
- package/src/source-config-sync.test.ts +84 -0
- package/src/source-digest.test.ts +58 -1
- package/src/sources-json.test.ts +18 -1
- package/src/sources.ts +1 -1
- package/src/write-artifacts.test.ts +375 -0
- package/native/README.md +0 -24
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process'
|
|
2
|
+
import {
|
|
3
|
+
mkdtemp,
|
|
4
|
+
mkdir,
|
|
5
|
+
readFile,
|
|
6
|
+
readdir,
|
|
7
|
+
rename,
|
|
8
|
+
rm,
|
|
9
|
+
symlink,
|
|
10
|
+
utimes,
|
|
11
|
+
writeFile,
|
|
12
|
+
} from 'node:fs/promises'
|
|
13
|
+
import { tmpdir } from 'node:os'
|
|
14
|
+
import { join } from 'node:path'
|
|
15
|
+
import { fileURLToPath } from 'node:url'
|
|
16
|
+
import { describe, expect, test } from 'bun:test'
|
|
17
|
+
import {
|
|
18
|
+
catalogFingerprint,
|
|
19
|
+
withCatalogRead,
|
|
20
|
+
writeArtifacts,
|
|
21
|
+
type GeneratedArtifacts,
|
|
22
|
+
type PublicationStep,
|
|
23
|
+
} from './index.js'
|
|
24
|
+
import { catalogPathsIn } from './catalog-store.js'
|
|
25
|
+
|
|
26
|
+
const artifacts = (name: string) =>
|
|
27
|
+
({ 'catalog.v1.json': name, 'integrity.json': name }) as GeneratedArtifacts
|
|
28
|
+
|
|
29
|
+
const child = fileURLToPath(new URL('../test-support/catalog-writer-child.ts', import.meta.url))
|
|
30
|
+
|
|
31
|
+
/** Runs a writer in its own process, optionally with its own TMPDIR. */
|
|
32
|
+
function runWriter(
|
|
33
|
+
output: string,
|
|
34
|
+
content: string,
|
|
35
|
+
crashAt: PublicationStep | 'none',
|
|
36
|
+
options: { waitMs?: number; tmp?: string } = {}
|
|
37
|
+
) {
|
|
38
|
+
const result = spawnSync(
|
|
39
|
+
process.execPath,
|
|
40
|
+
[
|
|
41
|
+
child,
|
|
42
|
+
output,
|
|
43
|
+
content,
|
|
44
|
+
crashAt,
|
|
45
|
+
...(options.waitMs === undefined ? [] : [String(options.waitMs)]),
|
|
46
|
+
],
|
|
47
|
+
{
|
|
48
|
+
encoding: 'utf8',
|
|
49
|
+
env: {
|
|
50
|
+
...process.env,
|
|
51
|
+
...(options.tmp ? { TMPDIR: options.tmp, TMP: options.tmp, TEMP: options.tmp } : {}),
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
// Windows reports a forced termination as an exit status, not a signal.
|
|
56
|
+
const killed =
|
|
57
|
+
result.signal === 'SIGKILL' || (process.platform === 'win32' && result.status !== 0)
|
|
58
|
+
return { stdout: result.stdout.trim(), stderr: result.stderr, killed }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** A promise the test resolves to let a paused writer continue. */
|
|
62
|
+
function gate() {
|
|
63
|
+
let open!: () => void
|
|
64
|
+
const opened = new Promise<void>((resolve) => {
|
|
65
|
+
open = resolve
|
|
66
|
+
})
|
|
67
|
+
return { open, opened }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function withParent(run: (parent: string) => Promise<void>) {
|
|
71
|
+
const parent = await mkdtemp(join(tmpdir(), 'catalog-writers-'))
|
|
72
|
+
try {
|
|
73
|
+
await run(parent)
|
|
74
|
+
} finally {
|
|
75
|
+
await rm(parent, { recursive: true, force: true })
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const read = (output: string) => readFile(join(output, 'catalog.v1.json'), 'utf8')
|
|
80
|
+
/** Coordination leftovers beside an output; a settled output has none. */
|
|
81
|
+
const leftovers = async (parent: string) =>
|
|
82
|
+
(await readdir(parent)).filter(
|
|
83
|
+
(name) => name.startsWith('.catalog-') || name.endsWith('.previous')
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
describe('writer coordination', () => {
|
|
87
|
+
test('writers with different temporary directories exclude each other', () =>
|
|
88
|
+
withParent(async (parent) => {
|
|
89
|
+
const output = join(parent, 'generated')
|
|
90
|
+
await writeArtifacts(output, artifacts('first'))
|
|
91
|
+
const otherTmp = join(parent, 'other-tmp')
|
|
92
|
+
await mkdir(otherTmp)
|
|
93
|
+
const paused = gate()
|
|
94
|
+
const reached = gate()
|
|
95
|
+
const holder = writeArtifacts(output, artifacts('holder'), {
|
|
96
|
+
onStep: async (step) => {
|
|
97
|
+
if (step !== 'staged') return
|
|
98
|
+
reached.open()
|
|
99
|
+
await paused.opened
|
|
100
|
+
},
|
|
101
|
+
})
|
|
102
|
+
await reached.opened
|
|
103
|
+
// The diagnosed race: the lock lived in TMPDIR, so a writer with another
|
|
104
|
+
// TMPDIR took its own lock and swapped concurrently. Both in-process and
|
|
105
|
+
// as a separate process with its own TMPDIR, the second writer now meets
|
|
106
|
+
// the first writer's lock.
|
|
107
|
+
const previousTmp = process.env.TMPDIR
|
|
108
|
+
process.env.TMPDIR = otherTmp
|
|
109
|
+
try {
|
|
110
|
+
await expect(writeArtifacts(output, artifacts('intruder'), { waitMs: 0 })).rejects.toThrow(
|
|
111
|
+
'CATALOG_WRITE_IN_PROGRESS'
|
|
112
|
+
)
|
|
113
|
+
} finally {
|
|
114
|
+
if (previousTmp === undefined) delete process.env.TMPDIR
|
|
115
|
+
else process.env.TMPDIR = previousTmp
|
|
116
|
+
}
|
|
117
|
+
const separate = runWriter(output, 'separate', 'none', { waitMs: 0, tmp: otherTmp })
|
|
118
|
+
expect(separate.stdout).toContain('CATALOG_WRITE_IN_PROGRESS')
|
|
119
|
+
expect(await read(output)).toBe('first')
|
|
120
|
+
paused.open()
|
|
121
|
+
await holder
|
|
122
|
+
expect(await read(output)).toBe('holder')
|
|
123
|
+
expect(await readdir(otherTmp)).toEqual([])
|
|
124
|
+
expect(await leftovers(parent)).toEqual([])
|
|
125
|
+
}))
|
|
126
|
+
|
|
127
|
+
test('a waiting writer publishes after the holder, never in between', () =>
|
|
128
|
+
withParent(async (parent) => {
|
|
129
|
+
const output = join(parent, 'generated')
|
|
130
|
+
const steps: string[] = []
|
|
131
|
+
const paused = gate()
|
|
132
|
+
const reached = gate()
|
|
133
|
+
const first = writeArtifacts(output, artifacts('first'), {
|
|
134
|
+
onStep: async (step) => {
|
|
135
|
+
steps.push(`first:${step}`)
|
|
136
|
+
if (step !== 'backed-up') return
|
|
137
|
+
reached.open()
|
|
138
|
+
await paused.opened
|
|
139
|
+
},
|
|
140
|
+
})
|
|
141
|
+
await reached.opened
|
|
142
|
+
const contending = gate()
|
|
143
|
+
const second = writeArtifacts(output, artifacts('second'), {
|
|
144
|
+
pollMs: 1,
|
|
145
|
+
onStep: (step) => {
|
|
146
|
+
steps.push(`second:${step}`)
|
|
147
|
+
if (step === 'acquiring') contending.open()
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
await contending.opened
|
|
151
|
+
// Let the second writer poll the held lock a few times.
|
|
152
|
+
await new Promise((resolve) => setTimeout(resolve, 20))
|
|
153
|
+
paused.open()
|
|
154
|
+
await Promise.all([first, second])
|
|
155
|
+
expect(steps).toEqual([
|
|
156
|
+
'first:acquiring',
|
|
157
|
+
'first:staged',
|
|
158
|
+
'first:backed-up',
|
|
159
|
+
'second:acquiring',
|
|
160
|
+
'first:swapped',
|
|
161
|
+
'first:cleaned',
|
|
162
|
+
'second:staged',
|
|
163
|
+
'second:backed-up',
|
|
164
|
+
'second:swapped',
|
|
165
|
+
'second:cleaned',
|
|
166
|
+
])
|
|
167
|
+
expect(await read(output)).toBe('second')
|
|
168
|
+
expect(await leftovers(parent)).toEqual([])
|
|
169
|
+
}))
|
|
170
|
+
|
|
171
|
+
test('outputs that differ only in case share one lock', () => {
|
|
172
|
+
expect(catalogPathsIn('/x', 'Generated').lock).toBe(catalogPathsIn('/x', 'generated').lock)
|
|
173
|
+
expect(catalogPathsIn('/x', 'generated').lock).not.toBe(catalogPathsIn('/x', 'other').lock)
|
|
174
|
+
expect(
|
|
175
|
+
catalogPathsIn('/x', 'generated').lock.startsWith(join('/x', '.catalog-generated-'))
|
|
176
|
+
).toBe(true)
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
describe('publication against a read snapshot', () => {
|
|
181
|
+
test('refuses to overwrite a catalog replaced after the base was read', () =>
|
|
182
|
+
withParent(async (parent) => {
|
|
183
|
+
const output = join(parent, 'generated')
|
|
184
|
+
await writeArtifacts(output, artifacts('base'))
|
|
185
|
+
// The diagnosed race: a scoped sync validated the output and read its
|
|
186
|
+
// lock, another writer replaced the catalog, and the sync then published
|
|
187
|
+
// over it. The base read and the publication now compare fingerprints.
|
|
188
|
+
const base = await withCatalogRead(output, () => catalogFingerprint(output))
|
|
189
|
+
await writeArtifacts(output, artifacts('concurrent'))
|
|
190
|
+
await expect(
|
|
191
|
+
writeArtifacts(output, artifacts('stale'), { expectedBase: base })
|
|
192
|
+
).rejects.toThrow('CATALOG_BASE_CHANGED')
|
|
193
|
+
expect(await read(output)).toBe('concurrent')
|
|
194
|
+
const fresh = await withCatalogRead(output, () => catalogFingerprint(output))
|
|
195
|
+
await writeArtifacts(output, artifacts('rebased'), { expectedBase: fresh })
|
|
196
|
+
expect(await read(output)).toBe('rebased')
|
|
197
|
+
expect(await leftovers(parent)).toEqual([])
|
|
198
|
+
}))
|
|
199
|
+
|
|
200
|
+
test('an absent output is a base, and a first publication must still find it absent', () =>
|
|
201
|
+
withParent(async (parent) => {
|
|
202
|
+
const output = join(parent, 'generated')
|
|
203
|
+
const base = await withCatalogRead(output, () => catalogFingerprint(output))
|
|
204
|
+
expect(base).toBe('absent')
|
|
205
|
+
await writeArtifacts(output, artifacts('other'))
|
|
206
|
+
await expect(
|
|
207
|
+
writeArtifacts(output, artifacts('mine'), { expectedBase: base })
|
|
208
|
+
).rejects.toThrow('CATALOG_BASE_CHANGED')
|
|
209
|
+
expect(await read(output)).toBe('other')
|
|
210
|
+
}))
|
|
211
|
+
|
|
212
|
+
test('a coordinated reader never observes the swap window', () =>
|
|
213
|
+
withParent(async (parent) => {
|
|
214
|
+
const output = join(parent, 'generated')
|
|
215
|
+
await writeArtifacts(output, artifacts('old'))
|
|
216
|
+
const paused = gate()
|
|
217
|
+
const reached = gate()
|
|
218
|
+
const writer = writeArtifacts(output, artifacts('new'), {
|
|
219
|
+
onStep: async (step) => {
|
|
220
|
+
if (step !== 'backed-up') return
|
|
221
|
+
reached.open()
|
|
222
|
+
await paused.opened
|
|
223
|
+
},
|
|
224
|
+
})
|
|
225
|
+
await reached.opened
|
|
226
|
+
// Between the renames the output does not exist on disk.
|
|
227
|
+
await expect(read(output)).rejects.toThrow()
|
|
228
|
+
const reader = withCatalogRead(output, () => read(output), { pollMs: 1 })
|
|
229
|
+
await new Promise((resolve) => setTimeout(resolve, 10))
|
|
230
|
+
paused.open()
|
|
231
|
+
expect(await reader).toBe('new')
|
|
232
|
+
await writer
|
|
233
|
+
}))
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
describe('crash recovery', () => {
|
|
237
|
+
const cases: readonly { step: PublicationStep; expected: string }[] = [
|
|
238
|
+
{ step: 'staged', expected: 'old' },
|
|
239
|
+
{ step: 'backed-up', expected: 'old' },
|
|
240
|
+
{ step: 'swapped', expected: 'new' },
|
|
241
|
+
{ step: 'cleaned', expected: 'new' },
|
|
242
|
+
]
|
|
243
|
+
for (const { step, expected } of cases) {
|
|
244
|
+
test(`a writer killed after "${step}" is ${expected === 'old' ? 'rolled back' : 'completed'} by the next reader`, () =>
|
|
245
|
+
withParent(async (parent) => {
|
|
246
|
+
const output = join(parent, 'generated')
|
|
247
|
+
await writeArtifacts(output, artifacts('old'))
|
|
248
|
+
const crashed = runWriter(output, 'new', step)
|
|
249
|
+
expect(crashed.killed).toBe(true)
|
|
250
|
+
expect(crashed.stdout).toBe('')
|
|
251
|
+
// The killed process left its lock behind; its holder is gone.
|
|
252
|
+
expect((await readdir(parent)).some((name) => name.endsWith('.lock'))).toBe(true)
|
|
253
|
+
expect(await withCatalogRead(output, () => read(output), { waitMs: 0 })).toBe(expected)
|
|
254
|
+
expect(await leftovers(parent)).toEqual([])
|
|
255
|
+
await writeArtifacts(output, artifacts('after'), { waitMs: 0 })
|
|
256
|
+
expect(await read(output)).toBe('after')
|
|
257
|
+
}))
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
test('a writer killed during a first publication leaves no output and no residue', () =>
|
|
261
|
+
withParent(async (parent) => {
|
|
262
|
+
const output = join(parent, 'generated')
|
|
263
|
+
expect(runWriter(output, 'new', 'staged').killed).toBe(true)
|
|
264
|
+
await writeArtifacts(output, artifacts('next'), { waitMs: 0 })
|
|
265
|
+
expect(await read(output)).toBe('next')
|
|
266
|
+
expect(await leftovers(parent)).toEqual([])
|
|
267
|
+
}))
|
|
268
|
+
|
|
269
|
+
test('a holder on another host is broken only after its heartbeat lease expires', () =>
|
|
270
|
+
withParent(async (parent) => {
|
|
271
|
+
const output = join(parent, 'generated')
|
|
272
|
+
await writeArtifacts(output, artifacts('old'))
|
|
273
|
+
const { lock, owner } = catalogPathsIn(parent, 'generated')
|
|
274
|
+
await mkdir(lock)
|
|
275
|
+
await writeFile(owner, JSON.stringify({ token: 'remote', pid: 1, host: 'elsewhere.invalid' }))
|
|
276
|
+
await expect(
|
|
277
|
+
writeArtifacts(output, artifacts('blocked'), { waitMs: 0, staleAfterMs: 60_000 })
|
|
278
|
+
).rejects.toThrow(/CATALOG_WRITE_IN_PROGRESS: .*pid 1 on elsewhere\.invalid/)
|
|
279
|
+
const old = new Date(Date.now() - 120_000)
|
|
280
|
+
await utimes(owner, old, old)
|
|
281
|
+
await writeArtifacts(output, artifacts('new'), { waitMs: 0, staleAfterMs: 60_000 })
|
|
282
|
+
expect(await read(output)).toBe('new')
|
|
283
|
+
expect(await leftovers(parent)).toEqual([])
|
|
284
|
+
}))
|
|
285
|
+
|
|
286
|
+
test('a holder that lost its lock refuses to swap', () =>
|
|
287
|
+
withParent(async (parent) => {
|
|
288
|
+
const output = join(parent, 'generated')
|
|
289
|
+
await writeArtifacts(output, artifacts('old'))
|
|
290
|
+
const { lock, owner } = catalogPathsIn(parent, 'generated')
|
|
291
|
+
const writer = writeArtifacts(output, artifacts('late'), {
|
|
292
|
+
onStep: async (step) => {
|
|
293
|
+
if (step !== 'staged') return
|
|
294
|
+
// Another contender judged this holder stale and took the lock.
|
|
295
|
+
await rename(lock, `${lock}.taken`)
|
|
296
|
+
await mkdir(lock)
|
|
297
|
+
await writeFile(owner, JSON.stringify({ token: 'other', pid: process.pid, host: 'x' }))
|
|
298
|
+
},
|
|
299
|
+
})
|
|
300
|
+
await expect(writer).rejects.toThrow('CATALOG_LOCK_LOST')
|
|
301
|
+
expect(await read(output)).toBe('old')
|
|
302
|
+
expect(JSON.parse(await readFile(owner, 'utf8')).token).toBe('other')
|
|
303
|
+
}))
|
|
304
|
+
|
|
305
|
+
test('preserves a backup whose provenance is unknown', () =>
|
|
306
|
+
withParent(async (parent) => {
|
|
307
|
+
const output = join(parent, 'generated')
|
|
308
|
+
await mkdir(output)
|
|
309
|
+
await writeFile(join(output, 'catalog.v1.json'), 'current')
|
|
310
|
+
await mkdir(`${output}.previous`)
|
|
311
|
+
await writeFile(join(`${output}.previous`, 'recovery'), 'saved')
|
|
312
|
+
await expect(writeArtifacts(output, artifacts('blocked'))).rejects.toThrow(
|
|
313
|
+
'CATALOG_RECOVERY_REQUIRED'
|
|
314
|
+
)
|
|
315
|
+
expect(await readFile(join(`${output}.previous`, 'recovery'), 'utf8')).toBe('saved')
|
|
316
|
+
expect(await read(output)).toBe('current')
|
|
317
|
+
expect(await withCatalogRead(output, () => read(output))).toBe('current')
|
|
318
|
+
expect(await readFile(join(`${output}.previous`, 'recovery'), 'utf8')).toBe('saved')
|
|
319
|
+
}))
|
|
320
|
+
|
|
321
|
+
test('a failed write keeps the previous catalog and releases the lock', () =>
|
|
322
|
+
withParent(async (parent) => {
|
|
323
|
+
const output = join(parent, 'generated')
|
|
324
|
+
await writeArtifacts(output, artifacts('previous'))
|
|
325
|
+
await expect(
|
|
326
|
+
writeArtifacts(output, { ...artifacts('broken'), 'missing/file': 'bad' })
|
|
327
|
+
).rejects.toThrow('CATALOG_ARTIFACT_NAME_INVALID')
|
|
328
|
+
await expect(
|
|
329
|
+
writeArtifacts(output, artifacts('broken'), {
|
|
330
|
+
onStep: (step) => {
|
|
331
|
+
if (step === 'backed-up') throw new Error('injected failure')
|
|
332
|
+
},
|
|
333
|
+
})
|
|
334
|
+
).rejects.toThrow('injected failure')
|
|
335
|
+
expect(await read(output)).toBe('previous')
|
|
336
|
+
expect(await leftovers(parent)).toEqual([])
|
|
337
|
+
await writeArtifacts(output, artifacts('later'), { waitMs: 0 })
|
|
338
|
+
expect(await read(output)).toBe('later')
|
|
339
|
+
}))
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
describe('reserved paths', () => {
|
|
343
|
+
test('refuses outputs inside coordination files or backups', () =>
|
|
344
|
+
withParent(async (parent) => {
|
|
345
|
+
const output = join(parent, 'generated')
|
|
346
|
+
const { lock } = catalogPathsIn(parent, 'generated')
|
|
347
|
+
for (const destination of [lock, `${output}.previous`, join(`${output}.previous`, 'x')])
|
|
348
|
+
await expect(writeArtifacts(destination, artifacts('blocked'))).rejects.toThrow(
|
|
349
|
+
'CATALOG_WRITE_LOCK_RESERVED'
|
|
350
|
+
)
|
|
351
|
+
await mkdir(lock)
|
|
352
|
+
const alias = join(parent, 'lock-alias')
|
|
353
|
+
await symlink(lock, alias, 'dir')
|
|
354
|
+
await expect(writeArtifacts(join(alias, 'nested'), artifacts('blocked'))).rejects.toThrow(
|
|
355
|
+
'CATALOG_WRITE_LOCK_RESERVED'
|
|
356
|
+
)
|
|
357
|
+
await rm(lock, { recursive: true })
|
|
358
|
+
// A backup can still be read by hand, without coordination.
|
|
359
|
+
await mkdir(`${output}.previous`)
|
|
360
|
+
await writeFile(join(`${output}.previous`, 'catalog.v1.json'), 'saved')
|
|
361
|
+
expect(await withCatalogRead(`${output}.previous`, () => read(`${output}.previous`))).toBe(
|
|
362
|
+
'saved'
|
|
363
|
+
)
|
|
364
|
+
}))
|
|
365
|
+
|
|
366
|
+
test('preserves filesystem semantics for a symlink followed by dot dot', () =>
|
|
367
|
+
withParent(async (parent) => {
|
|
368
|
+
const real = join(parent, 'real')
|
|
369
|
+
await mkdir(join(real, 'child'), { recursive: true })
|
|
370
|
+
await symlink(join(real, 'child'), join(parent, 'link'), 'dir')
|
|
371
|
+
await writeArtifacts(`${parent}/link/../generated`, artifacts('real target'))
|
|
372
|
+
expect(await read(join(real, 'generated'))).toBe('real target')
|
|
373
|
+
await expect(read(join(parent, 'generated'))).rejects.toThrow()
|
|
374
|
+
}))
|
|
375
|
+
})
|
package/native/README.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Windows staged reader
|
|
2
|
-
|
|
3
|
-
The Windows reader opens the final path component with `CreateFileW` and
|
|
4
|
-
`FILE_FLAG_OPEN_REPARSE_POINT`, refuses reparse points, directories and non-disk
|
|
5
|
-
handles, then reads from that same handle on a Node-API async worker. The parent
|
|
6
|
-
directory remains trusted, and regular-file contents may change through another
|
|
7
|
-
handle. This is not filesystem confinement or a snapshot. The Windows reader
|
|
8
|
-
caps input at 512 MiB and returns no bytes on failure; the POSIX reader retains
|
|
9
|
-
its existing behavior. Missing paths retain `ENOENT`.
|
|
10
|
-
|
|
11
|
-
`scripts/build-staged-reader.sh` builds x64 and arm64 modules on Linux from
|
|
12
|
-
Zig 0.14.1 and Node 24.22.1 headers and import libraries, checking each pinned
|
|
13
|
-
SHA-256 before use. It records the source commit and output hashes in
|
|
14
|
-
`build-provenance.txt`. There is no runtime download or installation hook.
|
|
15
|
-
The release workflow builds the modules before packing them; the package
|
|
16
|
-
includes only the production modules and provenance, while the repository root
|
|
17
|
-
build copies available production modules beside the compiled reader. Missing,
|
|
18
|
-
invalid, or unsupported binaries fail closed.
|
|
19
|
-
|
|
20
|
-
The Windows qualification workflow builds the same sources and exercises both
|
|
21
|
-
architectures with Node and Bun, including size limits and concurrent pathname
|
|
22
|
-
replacement. It also checks the source and compiled reader layouts. A successful
|
|
23
|
-
cross-compile alone does not establish Windows compatibility; in particular,
|
|
24
|
-
Bun's Windows loader must be tested with the Node import library.
|