@indigoai-us/hq-cloud 6.16.20 → 6.16.22

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.
Files changed (110) hide show
  1. package/dist/bin/sync-runner-installation-id.d.ts +66 -0
  2. package/dist/bin/sync-runner-installation-id.d.ts.map +1 -0
  3. package/dist/bin/sync-runner-installation-id.js +138 -0
  4. package/dist/bin/sync-runner-installation-id.js.map +1 -0
  5. package/dist/bin/sync-runner-manifest.d.ts +120 -0
  6. package/dist/bin/sync-runner-manifest.d.ts.map +1 -0
  7. package/dist/bin/sync-runner-manifest.js +348 -0
  8. package/dist/bin/sync-runner-manifest.js.map +1 -0
  9. package/dist/bin/sync-runner-manifest.test.d.ts +12 -0
  10. package/dist/bin/sync-runner-manifest.test.d.ts.map +1 -0
  11. package/dist/bin/sync-runner-manifest.test.js +510 -0
  12. package/dist/bin/sync-runner-manifest.test.js.map +1 -0
  13. package/dist/bin/sync-runner.d.ts +55 -0
  14. package/dist/bin/sync-runner.d.ts.map +1 -1
  15. package/dist/bin/sync-runner.js +69 -0
  16. package/dist/bin/sync-runner.js.map +1 -1
  17. package/dist/bin/sync-runner.test.js +217 -0
  18. package/dist/bin/sync-runner.test.js.map +1 -1
  19. package/dist/company-slug.d.ts +31 -0
  20. package/dist/company-slug.d.ts.map +1 -0
  21. package/dist/company-slug.js +52 -0
  22. package/dist/company-slug.js.map +1 -0
  23. package/dist/company-slug.test.d.ts +7 -0
  24. package/dist/company-slug.test.d.ts.map +1 -0
  25. package/dist/company-slug.test.js +43 -0
  26. package/dist/company-slug.test.js.map +1 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +5 -0
  30. package/dist/index.js.map +1 -1
  31. package/dist/journal-ledger-index.test.d.ts +15 -0
  32. package/dist/journal-ledger-index.test.d.ts.map +1 -0
  33. package/dist/journal-ledger-index.test.js +247 -0
  34. package/dist/journal-ledger-index.test.js.map +1 -0
  35. package/dist/journal.d.ts +110 -0
  36. package/dist/journal.d.ts.map +1 -1
  37. package/dist/journal.js +253 -5
  38. package/dist/journal.js.map +1 -1
  39. package/dist/manifest/US-002.acceptance.test.d.ts +11 -0
  40. package/dist/manifest/US-002.acceptance.test.d.ts.map +1 -0
  41. package/dist/manifest/US-002.acceptance.test.js +160 -0
  42. package/dist/manifest/US-002.acceptance.test.js.map +1 -0
  43. package/dist/manifest/US-004.acceptance.test.d.ts +12 -0
  44. package/dist/manifest/US-004.acceptance.test.d.ts.map +1 -0
  45. package/dist/manifest/US-004.acceptance.test.js +173 -0
  46. package/dist/manifest/US-004.acceptance.test.js.map +1 -0
  47. package/dist/manifest/build-manifest.bench.test.d.ts +22 -0
  48. package/dist/manifest/build-manifest.bench.test.d.ts.map +1 -0
  49. package/dist/manifest/build-manifest.bench.test.js +563 -0
  50. package/dist/manifest/build-manifest.bench.test.js.map +1 -0
  51. package/dist/manifest/build-manifest.d.ts +355 -0
  52. package/dist/manifest/build-manifest.d.ts.map +1 -0
  53. package/dist/manifest/build-manifest.js +1139 -0
  54. package/dist/manifest/build-manifest.js.map +1 -0
  55. package/dist/manifest/build-manifest.test.d.ts +10 -0
  56. package/dist/manifest/build-manifest.test.d.ts.map +1 -0
  57. package/dist/manifest/build-manifest.test.js +1172 -0
  58. package/dist/manifest/build-manifest.test.js.map +1 -0
  59. package/dist/manifest/contract.d.ts +356 -0
  60. package/dist/manifest/contract.d.ts.map +1 -0
  61. package/dist/manifest/contract.js +542 -0
  62. package/dist/manifest/contract.js.map +1 -0
  63. package/dist/manifest/contract.test.d.ts +17 -0
  64. package/dist/manifest/contract.test.d.ts.map +1 -0
  65. package/dist/manifest/contract.test.js +304 -0
  66. package/dist/manifest/contract.test.js.map +1 -0
  67. package/dist/manifest/import-graph.test.d.ts +25 -0
  68. package/dist/manifest/import-graph.test.d.ts.map +1 -0
  69. package/dist/manifest/import-graph.test.js +120 -0
  70. package/dist/manifest/import-graph.test.js.map +1 -0
  71. package/dist/manifest/ledger-shard-isolation.test.d.ts +18 -0
  72. package/dist/manifest/ledger-shard-isolation.test.d.ts.map +1 -0
  73. package/dist/manifest/ledger-shard-isolation.test.js +153 -0
  74. package/dist/manifest/ledger-shard-isolation.test.js.map +1 -0
  75. package/dist/manifest/snapshot-store.d.ts +160 -0
  76. package/dist/manifest/snapshot-store.d.ts.map +1 -0
  77. package/dist/manifest/snapshot-store.js +300 -0
  78. package/dist/manifest/snapshot-store.js.map +1 -0
  79. package/dist/manifest/snapshot-store.test.d.ts +11 -0
  80. package/dist/manifest/snapshot-store.test.d.ts.map +1 -0
  81. package/dist/manifest/snapshot-store.test.js +133 -0
  82. package/dist/manifest/snapshot-store.test.js.map +1 -0
  83. package/dist/manifest/upload-manifest.d.ts +336 -0
  84. package/dist/manifest/upload-manifest.d.ts.map +1 -0
  85. package/dist/manifest/upload-manifest.js +1022 -0
  86. package/dist/manifest/upload-manifest.js.map +1 -0
  87. package/dist/manifest/upload-manifest.test.d.ts +10 -0
  88. package/dist/manifest/upload-manifest.test.d.ts.map +1 -0
  89. package/dist/manifest/upload-manifest.test.js +1116 -0
  90. package/dist/manifest/upload-manifest.test.js.map +1 -0
  91. package/dist/manifest-reconcile.d.ts.map +1 -1
  92. package/dist/manifest-reconcile.js +1 -26
  93. package/dist/manifest-reconcile.js.map +1 -1
  94. package/dist/posix-key.d.ts +36 -0
  95. package/dist/posix-key.d.ts.map +1 -0
  96. package/dist/posix-key.js +38 -0
  97. package/dist/posix-key.js.map +1 -0
  98. package/dist/s3.d.ts +2 -18
  99. package/dist/s3.d.ts.map +1 -1
  100. package/dist/s3.js +6 -20
  101. package/dist/s3.js.map +1 -1
  102. package/dist/sync/journal-ledger-stream.d.ts +56 -0
  103. package/dist/sync/journal-ledger-stream.d.ts.map +1 -0
  104. package/dist/sync/journal-ledger-stream.js +191 -0
  105. package/dist/sync/journal-ledger-stream.js.map +1 -0
  106. package/dist/sync/journal-ledger-stream.test.d.ts +12 -0
  107. package/dist/sync/journal-ledger-stream.test.d.ts.map +1 -0
  108. package/dist/sync/journal-ledger-stream.test.js +134 -0
  109. package/dist/sync/journal-ledger-stream.test.js.map +1 -0
  110. package/package.json +2 -1
@@ -0,0 +1,563 @@
1
+ /**
2
+ * Stat-walk benchmark for the manifest builder (US-002).
3
+ *
4
+ * The acceptance bar is a cost bar, not a correctness one: a 70,000-file HQ
5
+ * root must be enumerable in under 2 seconds and under 64 MB of resident
6
+ * growth, because this runs in the background on a laptop that is also
7
+ * running the user's editor. A regression here does not break the audit — it
8
+ * makes the machine feel slow, which is the failure mode that gets the whole
9
+ * feature switched off.
10
+ *
11
+ * The measurement is deliberately narrow:
12
+ *
13
+ * - the fixture is built ONCE in `beforeAll` and excluded from the timing;
14
+ * - files are empty, so the numbers describe directory traversal + `lstat`,
15
+ * not disk throughput;
16
+ * - `hashPolicy: "ledger-only"` guarantees not a single byte of content is
17
+ * read, so sha256 throughput cannot mask a walk regression;
18
+ * - only `walkStats.walkMs` is asserted — the builder's own measurement of
19
+ * the walk, not the harness's view of the whole call.
20
+ */
21
+ import * as fs from "node:fs";
22
+ import * as os from "node:os";
23
+ import * as path from "node:path";
24
+ import * as v8 from "node:v8";
25
+ import * as vm from "node:vm";
26
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
27
+ import { buildSyncManifest } from "./build-manifest.js";
28
+ import { SYNC_MANIFEST_DEFAULT_CHUNK_BYTE_BUDGET, SYNC_MANIFEST_MAX_CHUNK_BYTES, } from "./contract.js";
29
+ import { PERSONAL_VAULT_JOURNAL_SLUG } from "../journal.js";
30
+ import { runManifestUploadPass } from "./upload-manifest.js";
31
+ const FILE_COUNT = 70_000;
32
+ const DIRECTORY_COUNT = 700;
33
+ /**
34
+ * The cost bar: 2 seconds of walk for 70,000 files.
35
+ *
36
+ * Asserted unconditionally. This file does NOT run in `pnpm test` — it has its
37
+ * own config (`vitest.bench.config.ts`, `pnpm run bench:manifest`) that runs it
38
+ * alone in a single fork, and its own CI job, because a wall clock measured
39
+ * against ~150 concurrently-scheduled suites is not a measurement. The same
40
+ * code timed 1.3s alone, 1.6s in one full run and 3.3s in the next; isolating
41
+ * the run removes that spread rather than widening the budget to swallow it.
42
+ */
43
+ const MAX_WALK_MS = 2_000;
44
+ const MAX_RSS_GROWTH_BYTES = 64 * 1024 * 1024;
45
+ /**
46
+ * Cold-ledger hash benchmark: how much does the FIRST pass after an upgrade
47
+ * cost when the journal has no reusable hash for anything?
48
+ *
49
+ * This is the case that broke on a real machine. The personal vault held
50
+ * ~690k files, the journal predated hashing, and the then-default `auto`
51
+ * policy therefore READ every one of them: 9m40s and 2.9 GB peak RSS for a
52
+ * step that runs after every sync cycle. The stat walk is not the problem —
53
+ * opening files is.
54
+ *
55
+ * 5,000 files is enough to measure per-file open+read+digest cost honestly
56
+ * while keeping the fixture buildable in CI; the numbers are printed so the
57
+ * README can quote a measured figure rather than a guess.
58
+ */
59
+ const HASH_FILE_COUNT = 5_000;
60
+ const HASH_FILE_BYTES = 4 * 1024;
61
+ /**
62
+ * A real collection before each measurement. Vitest does not run workers with
63
+ * `--expose-gc`, so without this the delta reports whatever heap V8 happened
64
+ * to grab and never returned — noise that swamps the signal and makes the
65
+ * budget flaky in both directions. Falls back to `null` (no forced GC) if the
66
+ * runtime refuses, in which case the generous budget still holds.
67
+ */
68
+ function acquireGc() {
69
+ const existing = globalThis.gc;
70
+ if (typeof existing === "function")
71
+ return existing;
72
+ try {
73
+ v8.setFlagsFromString("--expose-gc");
74
+ const exposed = vm.runInNewContext("gc");
75
+ v8.setFlagsFromString("--no-expose-gc");
76
+ return typeof exposed === "function" ? exposed : null;
77
+ }
78
+ catch {
79
+ return null;
80
+ }
81
+ }
82
+ let base;
83
+ let hqRoot;
84
+ let stateDir;
85
+ describe("buildSyncManifest stat-walk benchmark", () => {
86
+ beforeAll(() => {
87
+ base = fs.mkdtempSync(path.join(os.tmpdir(), "hq-manifest-bench-"));
88
+ hqRoot = path.join(base, "hq");
89
+ stateDir = path.join(base, "state");
90
+ fs.mkdirSync(stateDir, { recursive: true });
91
+ // 700 directories x 100 files: wide enough that per-directory `readdir`
92
+ // overhead is represented, shallow enough to stay realistic for an HQ root.
93
+ const perDirectory = FILE_COUNT / DIRECTORY_COUNT;
94
+ for (let dirIndex = 0; dirIndex < DIRECTORY_COUNT; dirIndex++) {
95
+ const dir = path.join(hqRoot, "bench", `d${dirIndex}`);
96
+ fs.mkdirSync(dir, { recursive: true });
97
+ for (let fileIndex = 0; fileIndex < perDirectory; fileIndex++) {
98
+ fs.writeFileSync(path.join(dir, `f${fileIndex}.md`), "");
99
+ }
100
+ }
101
+ }, 300_000);
102
+ afterAll(() => {
103
+ fs.rmSync(base, { recursive: true, force: true });
104
+ });
105
+ it(`walks ${FILE_COUNT} files within budget`, async () => {
106
+ // A GC before the baseline (when the runner exposes one) keeps the delta
107
+ // from charging this walk for garbage the fixture build left behind.
108
+ const forceGc = acquireGc();
109
+ forceGc?.();
110
+ const rssBefore = process.memoryUsage().rss;
111
+ const result = await buildSyncManifest({
112
+ scope: { kind: "personal" },
113
+ hqRoot,
114
+ stateDir,
115
+ installationId: "install-bench",
116
+ machineId: "machine-bench",
117
+ source: "cli",
118
+ sequence: 1,
119
+ hashPolicy: "ledger-only",
120
+ listJournalsImpl: () => [],
121
+ // Well above the budget: the assertion below is what fails on a
122
+ // regression, not a truncated walk that would silently "pass" fast.
123
+ maxWallMs: 120_000,
124
+ persistSnapshot: false,
125
+ });
126
+ forceGc?.();
127
+ const rssAfter = process.memoryUsage().rss;
128
+ // Print the numbers so a CI run records the trend, not just pass/fail.
129
+ process.stdout.write(`manifest stat-walk: ${result.walkStats.walkMs}ms, ` +
130
+ `${((rssAfter - rssBefore) / (1024 * 1024)).toFixed(1)}MB RSS for ${FILE_COUNT} files\n`);
131
+ expect(result.walkStats.truncated).toBe(false);
132
+ expect(result.walkStats.filesWalked).toBe(FILE_COUNT);
133
+ expect(result.walkStats.hashedFiles).toBe(0);
134
+ expect(result.walkStats.walkMs).toBeLessThan(MAX_WALK_MS);
135
+ expect(rssAfter - rssBefore).toBeLessThan(MAX_RSS_GROWTH_BYTES);
136
+ }, 120_000);
137
+ });
138
+ /**
139
+ * The cost of a COLD ledger, and the guarantee that the default never pays it.
140
+ *
141
+ * Separate fixture from the stat-walk bench above: that one uses empty files
142
+ * (so it measures traversal), while this one needs real bytes to measure
143
+ * open + read + sha256.
144
+ */
145
+ describe("buildSyncManifest cold-ledger hash cost", () => {
146
+ let hashBase;
147
+ let hashRoot;
148
+ let hashStateDir;
149
+ beforeAll(() => {
150
+ hashBase = fs.mkdtempSync(path.join(os.tmpdir(), "hq-manifest-hash-bench-"));
151
+ hashRoot = path.join(hashBase, "hq");
152
+ hashStateDir = path.join(hashBase, "state");
153
+ fs.mkdirSync(hashStateDir, { recursive: true });
154
+ const body = "x".repeat(HASH_FILE_BYTES);
155
+ const perDirectory = 100;
156
+ for (let index = 0; index < HASH_FILE_COUNT; index += 1) {
157
+ const dir = path.join(hashRoot, "bench", `d${Math.floor(index / perDirectory)}`);
158
+ fs.mkdirSync(dir, { recursive: true });
159
+ fs.writeFileSync(path.join(dir, `f${index}.md`), body);
160
+ }
161
+ }, 300_000);
162
+ afterAll(() => {
163
+ fs.rmSync(hashBase, { recursive: true, force: true });
164
+ });
165
+ function optionsFor(overrides) {
166
+ return {
167
+ scope: { kind: "personal" },
168
+ hqRoot: hashRoot,
169
+ stateDir: hashStateDir,
170
+ installationId: "install-bench",
171
+ machineId: "machine-bench",
172
+ source: "cli",
173
+ sequence: 1,
174
+ listJournalsImpl: () => [],
175
+ maxWallMs: 600_000,
176
+ persistSnapshot: false,
177
+ ...overrides,
178
+ };
179
+ }
180
+ it(`measures the unbounded first-pass hash cost for ${HASH_FILE_COUNT} cold files`, async () => {
181
+ const forceGc = acquireGc();
182
+ forceGc?.();
183
+ const rssBefore = process.memoryUsage().rss;
184
+ const startedAt = Date.now();
185
+ const result = await buildSyncManifest(optionsFor({ hashPolicy: "full" }));
186
+ const elapsedMs = Date.now() - startedAt;
187
+ forceGc?.();
188
+ const rssGrowthMb = (process.memoryUsage().rss - rssBefore) / (1024 * 1024);
189
+ // Recorded, not asserted as a budget: this measures the path the default
190
+ // deliberately avoids, and its absolute cost varies wildly by disk. The
191
+ // README quotes these numbers.
192
+ process.stdout.write(`manifest cold-ledger hash (hashPolicy="full"): ${HASH_FILE_COUNT} files: ` +
193
+ `${elapsedMs}ms / ${rssGrowthMb.toFixed(1)}MB RSS ` +
194
+ `(${((HASH_FILE_COUNT * HASH_FILE_BYTES) / (1024 * 1024)).toFixed(1)}MB read)\n`);
195
+ expect(result.walkStats.hashedFiles).toBe(HASH_FILE_COUNT);
196
+ expect(result.walkStats.unhashedFiles).toBe(0);
197
+ }, 600_000);
198
+ it("the DEFAULT policy reads nothing at all on the same cold fixture", async () => {
199
+ // The guarantee the fix rests on. Every file is still REPORTED — the
200
+ // manifest is complete — it is just stat-only, so the first pass after an
201
+ // upgrade costs a walk instead of a full read of the vault.
202
+ const startedAt = Date.now();
203
+ const result = await buildSyncManifest(optionsFor({}));
204
+ const elapsedMs = Date.now() - startedAt;
205
+ process.stdout.write(`manifest cold-ledger stat-only (default): ${HASH_FILE_COUNT} files: ${elapsedMs}ms\n`);
206
+ expect(result.walkStats.hashedFiles).toBe(0);
207
+ expect(result.walkStats.unhashedFiles).toBe(HASH_FILE_COUNT);
208
+ expect(result.walkStats.filesWalked).toBe(HASH_FILE_COUNT);
209
+ expect(result.chunks.flatMap((chunk) => chunk.entries)).toHaveLength(HASH_FILE_COUNT);
210
+ }, 300_000);
211
+ it("`auto` spreads the cost across passes instead of paying it all at once", async () => {
212
+ const result = await buildSyncManifest(optionsFor({ hashPolicy: "auto", maxHashedFiles: 500, maxHashMs: 60_000 }));
213
+ expect(result.walkStats.hashedFiles).toBe(500);
214
+ expect(result.walkStats.unhashedFiles).toBe(HASH_FILE_COUNT - 500);
215
+ // Bounded, but never lossy: the scope is still fully described.
216
+ expect(result.chunks.flatMap((chunk) => chunk.entries)).toHaveLength(HASH_FILE_COUNT);
217
+ }, 300_000);
218
+ });
219
+ // ─────────────────────────────────────────────────────────────────────────────
220
+ // Ledger read cost (memory)
221
+ // ─────────────────────────────────────────────────────────────────────────────
222
+ /**
223
+ * The manifest tail step's memory footprint, measured on the shape that
224
+ * actually hurt: a vault whose JOURNAL is large.
225
+ *
226
+ * WHY THIS IS A GATE, NOT A REPORT
227
+ * --------------------------------
228
+ * On a real operator vault this step peaked at 1,112 MB of resident memory for
229
+ * a 199k-entry personal scope. It is a background audit that runs after every
230
+ * sync pass on a laptop that is also running the user's editor, so a gigabyte
231
+ * is not a slow audit — it is the reason a user switches the feature off.
232
+ *
233
+ * FOUR CAUSES, ALL IN THE LEDGER READ, NONE IN THE WALK
234
+ * -----------------------------------------------------
235
+ * Measured on a 200,000-file synthetic tree, the walk itself costs ~220 MB and
236
+ * the build's chunking and snapshot add ~10 MB. Everything else was spent
237
+ * before the walk statted its first file:
238
+ *
239
+ * 1. `listJournals()` read and parsed EVERY journal shard on the machine to
240
+ * keep the one that describes this scope, and did it again for every
241
+ * scope in a fanout. `readLedger` now reads one shard, and
242
+ * `ledger-shard-isolation.test.ts` counts the journal files opened so
243
+ * that cannot quietly become "all of them" again.
244
+ * 2. `readJournal()` deep-clones every journal it returns into the writer
245
+ * baseline WeakMap. A read-only caller pays double for a baseline it will
246
+ * never diff against. The read-only path skips it.
247
+ * 3. Reading that one shard still cost its file size TWICE — once as a UTF-8
248
+ * string, once as a parsed object graph — before a single row was looked
249
+ * at. `streamJournalLedgerRows` scans the document in 256 KB chunks and
250
+ * parses each row on its own instead, so the transient set is bounded by
251
+ * a chunk rather than by the vault.
252
+ * 4. The derived map retained the parsed `JournalEntry` objects, which pinned
253
+ * the whole parse result behind the index built FROM it. The index now
254
+ * holds a six-field projection with the repeated strings shared, so the
255
+ * parse is collectable the moment the read returns.
256
+ *
257
+ * (1) and (2) took a 200,000-FILE measurement from 1,113 MB to 599 MB. (3) and
258
+ * (4) took the ledger read on this fixture from 113.6 MB to 24 MB of resident
259
+ * growth, and the same 200,000-file measurement to ~437 MB peak — under the
260
+ * 500 MB bar this step has to clear to be worth leaving switched on.
261
+ *
262
+ * IN-PROCESS, NOT A CHILD WITH `--max-old-space-size`
263
+ * --------------------------------------------------
264
+ * A heap ceiling would fail the run with an OOM abort, which reports "the
265
+ * child died" rather than a number, and it bounds only V8's heap — while most
266
+ * of the regression showed up as resident growth outside it. This file already
267
+ * runs alone, in a single fork, on its own CI runner (see
268
+ * `vitest.bench.config.ts`), which is the isolation a memory measurement needs;
269
+ * sampling RSS there measures the thing the budget is actually about.
270
+ */
271
+ const LEDGER_ENTRY_COUNT = 200_000;
272
+ const LEDGER_COMPANY_COUNT = 4;
273
+ const LEDGER_COMPANY_ENTRY_COUNT = 50_000;
274
+ const LEDGER_DISK_FILE_COUNT = 2_000;
275
+ /**
276
+ * 30 MB of resident growth for this fixture — the measurement plus 20%.
277
+ *
278
+ * Measured: 24.1, 24.2 and 24.1 MB across three isolated runs, which is the
279
+ * spread this file's single-fork, own-CI-runner isolation buys. The previous
280
+ * budget was 260 MB against a 113.6 MB measurement, and headroom that wide
281
+ * stops being headroom: it would have absorbed every regression this gate
282
+ * names without anyone noticing. Re-reading every shard (`listJournals()`)
283
+ * puts this fixture back near 356 MB, materialising the shard whole puts it
284
+ * near 114 MB, and both are now loudly out of budget rather than comfortably
285
+ * inside it.
286
+ *
287
+ * If this trips on a slower or differently-sized CI runner, the honest fix is
288
+ * to re-measure and move the number WITH a note saying what it measured — not
289
+ * to widen it until it stops complaining.
290
+ *
291
+ * This fixture understates the whole-vault picture on purpose: it pairs a
292
+ * 200k-entry ledger with a 2,000-file tree, because the walk's own cost is
293
+ * already gated by the stat-walk bench above and does not need paying for
294
+ * twice. On a real 200k-FILE vault the same code measures ~437 MB peak.
295
+ */
296
+ const MAX_LEDGER_RSS_GROWTH_BYTES = 30 * 1024 * 1024;
297
+ describe("buildSyncManifest ledger read cost", () => {
298
+ let ledgerBase;
299
+ let ledgerRoot;
300
+ let ledgerStateDir;
301
+ let previousStateDir;
302
+ function writeLegacyJournal(stateDir, slug, entryCount) {
303
+ const files = {};
304
+ for (let index = 0; index < entryCount; index += 1) {
305
+ files[`ledger/d${Math.floor(index / 100)}/f${index}.md`] = {
306
+ hash: `sha256:${index.toString(16).padStart(64, "0")}`,
307
+ size: 1024 + index,
308
+ syncedAt: "2026-01-01T00:00:00.000Z",
309
+ direction: "up",
310
+ };
311
+ }
312
+ fs.writeFileSync(path.join(stateDir, `sync-journal.${slug}.json`), JSON.stringify({ version: "2", files, pulls: [] }), "utf8");
313
+ }
314
+ beforeAll(() => {
315
+ ledgerBase = fs.mkdtempSync(path.join(os.tmpdir(), "hq-manifest-ledger-bench-"));
316
+ ledgerRoot = path.join(ledgerBase, "hq");
317
+ ledgerStateDir = path.join(ledgerBase, "state");
318
+ fs.mkdirSync(ledgerStateDir, { recursive: true });
319
+ // The journal reader resolves its own state dir from the environment, so
320
+ // the fixture has to own it for the duration of this suite. Without this
321
+ // the bench would read the DEVELOPER'S real journals — which is how the
322
+ // original 1.1 GB measurement was first reproduced, and is not something a
323
+ // CI budget can be built on.
324
+ previousStateDir = process.env.HQ_STATE_DIR;
325
+ process.env.HQ_STATE_DIR = ledgerStateDir;
326
+ writeLegacyJournal(ledgerStateDir, PERSONAL_VAULT_JOURNAL_SLUG, LEDGER_ENTRY_COUNT);
327
+ // The other shards exist only to be NOT read. Before the fix they were
328
+ // parsed on every build, for every scope.
329
+ for (let index = 0; index < LEDGER_COMPANY_COUNT; index += 1) {
330
+ writeLegacyJournal(ledgerStateDir, `company-${index}`, LEDGER_COMPANY_ENTRY_COUNT);
331
+ }
332
+ const perDirectory = 100;
333
+ for (let index = 0; index < LEDGER_DISK_FILE_COUNT; index += 1) {
334
+ const dir = path.join(ledgerRoot, "ledger", `d${Math.floor(index / perDirectory)}`);
335
+ fs.mkdirSync(dir, { recursive: true });
336
+ fs.writeFileSync(path.join(dir, `f${index}.md`), "");
337
+ }
338
+ }, 600_000);
339
+ afterAll(() => {
340
+ if (previousStateDir === undefined)
341
+ delete process.env.HQ_STATE_DIR;
342
+ else
343
+ process.env.HQ_STATE_DIR = previousStateDir;
344
+ fs.rmSync(ledgerBase, { recursive: true, force: true });
345
+ });
346
+ it(`builds a ${LEDGER_ENTRY_COUNT}-entry ledger scope within the memory budget`, async () => {
347
+ const forceGc = acquireGc();
348
+ forceGc?.();
349
+ const rssBefore = process.memoryUsage().rss;
350
+ let peakRss = rssBefore;
351
+ const sampler = setInterval(() => {
352
+ peakRss = Math.max(peakRss, process.memoryUsage().rss);
353
+ }, 20);
354
+ let result;
355
+ try {
356
+ result = await buildSyncManifest({
357
+ scope: { kind: "personal" },
358
+ hqRoot: ledgerRoot,
359
+ stateDir: ledgerStateDir,
360
+ installationId: "install-bench",
361
+ machineId: "machine-bench",
362
+ source: "cli",
363
+ sequence: 1,
364
+ hashPolicy: "never",
365
+ // Deliberately NOT stubbed: reading the ledger off disk is the thing
366
+ // being measured.
367
+ maxWallMs: 600_000,
368
+ persistSnapshot: false,
369
+ });
370
+ }
371
+ finally {
372
+ clearInterval(sampler);
373
+ }
374
+ const peakGrowth = peakRss - rssBefore;
375
+ process.stdout.write(`manifest ledger read: ${LEDGER_ENTRY_COUNT} ledger entries + ` +
376
+ `${LEDGER_COMPANY_COUNT * LEDGER_COMPANY_ENTRY_COUNT} entries in other shards, ` +
377
+ `${LEDGER_DISK_FILE_COUNT} files on disk: ` +
378
+ `${(peakGrowth / (1024 * 1024)).toFixed(1)}MB peak RSS growth\n`);
379
+ // The scope is fully described — the budget is never met by reporting less.
380
+ expect(result.walkStats.truncated).toBe(false);
381
+ expect(result.walkStats.filesWalked).toBe(LEDGER_DISK_FILE_COUNT);
382
+ const reported = result.chunks.flatMap((chunk) => chunk.entries);
383
+ expect(reported.length).toBe(LEDGER_ENTRY_COUNT);
384
+ expect(reported.filter((entry) => entry.source === "ledger").length).toBe(LEDGER_ENTRY_COUNT - LEDGER_DISK_FILE_COUNT);
385
+ expect(peakGrowth).toBeLessThan(MAX_LEDGER_RSS_GROWTH_BYTES);
386
+ }, 600_000);
387
+ });
388
+ /**
389
+ * Upload-pass memory benchmark: 200,000 entries, streamed.
390
+ *
391
+ * WHAT THIS GATES
392
+ * ---------------
393
+ * The upload half of the pass must stay inside the same 500 MB bar the build
394
+ * half does — below it the audit is worth leaving switched on beside a user's
395
+ * editor, above it the honest answer is to switch it off. The pass now mints
396
+ * one `SyncManifestUpload` at a time from a `ManifestChunkPlan` instead of
397
+ * materialising the whole chunk set before the first POST, and serialises the
398
+ * local snapshot incrementally instead of through one `JSON.stringify` of
399
+ * every entry. `peakLiveChunks` is asserted alongside the budget because it is
400
+ * the STRUCTURAL property the budget rests on: a future edit that collects the
401
+ * chunks again would still fit this fixture long before it fits a real vault.
402
+ *
403
+ * WHAT THIS DOES NOT CLAIM
404
+ * ------------------------
405
+ * Measured honestly, on this fixture and on a 200,000-FILE variant of it, the
406
+ * streaming change does not move peak RSS: ~348 MB before and after. It should
407
+ * not be quoted as the fix for the 642 MB seen on the operator's real 199k
408
+ * scope. A chunk's `entries` is a `slice` — 200,000 POINTERS, ~1.6 MB — not a
409
+ * copy of the entries, so the chunk set was never the term that dominates.
410
+ * What does dominate is inherent to a single-pass build: the walk's records,
411
+ * the entry objects, and the snapshot map, each O(entries) and each live at
412
+ * once because the delta decision needs the whole set before the first chunk
413
+ * can be sized. Cutting THAT needs a two-pass build, which is a separate
414
+ * change; this gate exists so the upload half cannot quietly re-add a copy on
415
+ * top of it.
416
+ *
417
+ * WHY IT MEASURES THE UPLOAD PASS AND NOT THE BUILDER
418
+ * --------------------------------------------------
419
+ * The builder alone never sees the chunk set — that is the point of the plan
420
+ * being lazy — so benchmarking `buildSyncManifest` would report a number this
421
+ * regression cannot move.
422
+ */
423
+ const STREAM_ENTRY_COUNT = 200_000;
424
+ const STREAM_DISK_FILE_COUNT = 2_000;
425
+ /**
426
+ * 500 MB of peak HEAP growth for a 200,000-entry upload pass.
427
+ *
428
+ * The product bar, not a measurement plus headroom. Measured at ~90 MB on this
429
+ * fixture across runs, so the gate is loose today — deliberately: it is the
430
+ * BUDGET this step has to live inside, and tightening it to the current
431
+ * measurement would fail the next legitimate entry-shape change rather than
432
+ * the next regression. `peakLiveChunks` is the tight assertion here.
433
+ */
434
+ const MAX_STREAM_HEAP_GROWTH_BYTES = 500 * 1024 * 1024;
435
+ describe("runManifestUploadPass streaming cost", () => {
436
+ let streamBase;
437
+ let streamRoot;
438
+ let streamStateDir;
439
+ let previousStateDir;
440
+ beforeAll(() => {
441
+ streamBase = fs.mkdtempSync(path.join(os.tmpdir(), "hq-manifest-stream-bench-"));
442
+ streamRoot = path.join(streamBase, "hq");
443
+ streamStateDir = path.join(streamBase, "state");
444
+ fs.mkdirSync(streamStateDir, { recursive: true });
445
+ previousStateDir = process.env.HQ_STATE_DIR;
446
+ process.env.HQ_STATE_DIR = streamStateDir;
447
+ const files = {};
448
+ for (let index = 0; index < STREAM_ENTRY_COUNT; index += 1) {
449
+ files[`ledger/d${Math.floor(index / 100)}/f${index}.md`] = {
450
+ hash: `sha256:${index.toString(16).padStart(64, "0")}`,
451
+ size: 1024 + index,
452
+ mtimeMs: 1_700_000_000_000 + index,
453
+ syncedAt: "2026-01-01T00:00:00.000Z",
454
+ direction: "up",
455
+ };
456
+ }
457
+ fs.writeFileSync(path.join(streamStateDir, `sync-journal.${PERSONAL_VAULT_JOURNAL_SLUG}.json`), JSON.stringify({ version: "2", lastSync: "", files, pulls: [] }), "utf8");
458
+ for (let index = 0; index < STREAM_DISK_FILE_COUNT; index += 1) {
459
+ const dir = path.join(streamRoot, "ledger", `d${Math.floor(index / 100)}`);
460
+ fs.mkdirSync(dir, { recursive: true });
461
+ fs.writeFileSync(path.join(dir, `f${index}.md`), "");
462
+ }
463
+ }, 600_000);
464
+ afterAll(() => {
465
+ if (previousStateDir === undefined)
466
+ delete process.env.HQ_STATE_DIR;
467
+ else
468
+ process.env.HQ_STATE_DIR = previousStateDir;
469
+ fs.rmSync(streamBase, { recursive: true, force: true });
470
+ });
471
+ it(`streams a ${STREAM_ENTRY_COUNT}-entry pass within the memory budget`, async () => {
472
+ const forceGc = acquireGc();
473
+ forceGc?.();
474
+ // HEAP, not RSS, for this one. The other benches in this file run first
475
+ // and leave the process holding hundreds of megabytes of resident pages
476
+ // that the allocator happily REUSES, so resident *growth* reads near zero
477
+ // whether the chunk set is streamed or materialised — it measures the page
478
+ // cache, not the code. `heapUsed` is what the duplicate chunk set actually
479
+ // consumed, and it is what a forced GC can honestly re-baseline.
480
+ const heapBefore = process.memoryUsage().heapUsed;
481
+ const rssBefore = process.memoryUsage().rss;
482
+ let peakHeap = heapBefore;
483
+ let peakRss = rssBefore;
484
+ const sampler = setInterval(() => {
485
+ const usage = process.memoryUsage();
486
+ peakHeap = Math.max(peakHeap, usage.heapUsed);
487
+ peakRss = Math.max(peakRss, usage.rss);
488
+ }, 20);
489
+ let liveChunks = 0;
490
+ let peakLiveChunks = 0;
491
+ let sentChunks = 0;
492
+ let sentEntries = 0;
493
+ // The canary metric. 6.16.21 put 15.9-17.9 MiB bodies on the wire here and
494
+ // nothing in this bench noticed, because the bench only ever asserted
495
+ // memory. Peak body size is now measured on the same run.
496
+ let maxBodyBytes = 0;
497
+ let result;
498
+ try {
499
+ result = await runManifestUploadPass({
500
+ scope: { kind: "personal" },
501
+ hqRoot: streamRoot,
502
+ stateDir: streamStateDir,
503
+ installationId: "install-bench",
504
+ machineId: "machine-bench",
505
+ source: "cli",
506
+ hashPolicy: "never",
507
+ maxWallMs: 600_000,
508
+ uploadWallMs: 600_000,
509
+ env: {},
510
+ transport: async (chunk) => {
511
+ // Serialise exactly as a real transport would: the JSON of the chunk
512
+ // in flight is part of the peak this budget covers.
513
+ liveChunks += 1;
514
+ peakLiveChunks = Math.max(peakLiveChunks, liveChunks);
515
+ sentEntries += chunk.entries.length;
516
+ sentChunks += 1;
517
+ const body = JSON.stringify(chunk);
518
+ if (body.length === 0)
519
+ throw new Error("empty chunk body");
520
+ maxBodyBytes = Math.max(maxBodyBytes, Buffer.byteLength(body, "utf8"));
521
+ liveChunks -= 1;
522
+ return {
523
+ status: 200,
524
+ body: {
525
+ status: "accepted",
526
+ snapshotId: "0123456789abcdef0123456789abcdef",
527
+ completed: sentChunks === chunk.chunkCount,
528
+ materialised: sentChunks === chunk.chunkCount,
529
+ },
530
+ };
531
+ },
532
+ });
533
+ }
534
+ finally {
535
+ clearInterval(sampler);
536
+ }
537
+ const peakHeapGrowth = peakHeap - heapBefore;
538
+ process.stdout.write(`manifest upload stream: ${STREAM_ENTRY_COUNT} entries in ${sentChunks} chunk(s): ` +
539
+ `${(peakHeapGrowth / (1024 * 1024)).toFixed(1)}MB peak heap growth, ` +
540
+ `${((peakRss - rssBefore) / (1024 * 1024)).toFixed(1)}MB peak RSS growth, ` +
541
+ `${(peakRss / (1024 * 1024)).toFixed(1)}MB absolute peak RSS, ` +
542
+ `${(maxBodyBytes / (1024 * 1024)).toFixed(2)}MiB largest chunk body\n`);
543
+ // The budget is never met by reporting less: the whole scope went out.
544
+ expect(result.status).toBe("uploaded");
545
+ expect(sentEntries).toBe(STREAM_ENTRY_COUNT);
546
+ expect(sentChunks).toBeGreaterThan(1);
547
+ // One chunk alive at a time — the property the budget actually rests on.
548
+ expect(peakLiveChunks).toBe(1);
549
+ expect(peakHeapGrowth).toBeLessThan(MAX_STREAM_HEAP_GROWTH_BYTES);
550
+ // THE 6.16.21 GATE. Every body the transport saw fits the client budget,
551
+ // which sits a full MiB under the server's `SYNC_MANIFEST_MAX_CHUNK_BYTES`
552
+ // and 6 MiB under API Gateway's own ceiling. Asserted on bodies rather
553
+ // than on the plan's self-report, because the plan's arithmetic is exactly
554
+ // what was wrong before.
555
+ expect(maxBodyBytes).toBeLessThanOrEqual(SYNC_MANIFEST_DEFAULT_CHUNK_BYTE_BUDGET);
556
+ expect(SYNC_MANIFEST_DEFAULT_CHUNK_BYTE_BUDGET).toBeLessThan(SYNC_MANIFEST_MAX_CHUNK_BYTES);
557
+ // A byte budget necessarily means MORE, smaller chunks than the count
558
+ // bound alone would have planned. Pinned so a regression that silently
559
+ // stops splitting on bytes fails here too.
560
+ expect(sentChunks).toBeGreaterThan(Math.ceil(STREAM_ENTRY_COUNT / 50_000));
561
+ }, 600_000);
562
+ });
563
+ //# sourceMappingURL=build-manifest.bench.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-manifest.bench.test.js","sourceRoot":"","sources":["../../src/manifest/build-manifest.bench.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,uCAAuC,EACvC,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B;;;;;;;;;GASG;AACH,MAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,CAAC;AAEjC;;;;;;GAMG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