MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / seedVault

Function seedVault

tooling/scripts/perf-web-runtime.mjs:207–244  ·  view source on GitHub ↗
(vaultRoot, count)

Source from the content-addressed store, hash-verified

205}
206
207async function seedVault(vaultRoot, count) {
208 const inbox = join(vaultRoot, 'inbox')
209 const quick = join(vaultRoot, 'quick')
210 const archive = join(vaultRoot, 'archive')
211 const trash = join(vaultRoot, 'trash')
212 await Promise.all([
213 mkdir(inbox, { recursive: true }),
214 mkdir(quick, { recursive: true }),
215 mkdir(archive, { recursive: true }),
216 mkdir(trash, { recursive: true })
217 ])
218
219 const files = []
220 for (let index = 0; index < count; index += 1) {
221 const id = formatIndex(index)
222 const topic = index % 20
223 const sprint = index % 13
224 const title = `Perf Note ${id} Topic ${topic}`
225 const body = `# ${title}
226
227This is a synthetic runtime benchmark note for ZenNotes.
228It contains searchable token runtime-benchmark-${id} and shared topic-${topic}.
229
230## Details
231
232- Index: ${index}
233- Topic: ${topic}
234- Sprint: ${sprint}
235- Status: ${index % 3 === 0 ? 'active' : 'reference'}
236
237The body is intentionally modest so note-open timing measures app overhead more than disk throughput.
238
239#perf #topic-${topic} #sprint-${sprint}
240${largeNoteLines > 0 && index === Math.min(count - 1, largeNoteIndex) ? largeNoteBody(largeNoteLines, id) : ''}`
241 files.push([join(inbox, `${id} - topic-${topic}.md`), body])
242 }
243 await writeFilesInBatches(files)
244}
245
246function appendBounded(buffer, chunk, maxLength = 12000) {
247 const next = `${buffer}${chunk}`

Callers 1

mainFunction · 0.70

Calls 3

formatIndexFunction · 0.70
largeNoteBodyFunction · 0.70
writeFilesInBatchesFunction · 0.70

Tested by

no test coverage detected