(vaultRoot, count)
| 205 | } |
| 206 | |
| 207 | async 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 | |
| 227 | This is a synthetic runtime benchmark note for ZenNotes. |
| 228 | It 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 | |
| 237 | The 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 | |
| 246 | function appendBounded(buffer, chunk, maxLength = 12000) { |
| 247 | const next = `${buffer}${chunk}` |
no test coverage detected