@indigoai-us/hq-cloud 6.16.34 → 6.16.36

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 (119) hide show
  1. package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
  2. package/dist/bin/sync-runner-watch-loop.js +20 -8
  3. package/dist/bin/sync-runner-watch-loop.js.map +1 -1
  4. package/dist/bin/sync-runner-watch-loop.test.js +1 -2
  5. package/dist/bin/sync-runner-watch-loop.test.js.map +1 -1
  6. package/dist/bin/sync-runner.test.js +21 -24
  7. package/dist/bin/sync-runner.test.js.map +1 -1
  8. package/dist/cli/share.d.ts.map +1 -1
  9. package/dist/cli/share.js +18 -7
  10. package/dist/cli/share.js.map +1 -1
  11. package/dist/cli/share.test.js +30 -3
  12. package/dist/cli/share.test.js.map +1 -1
  13. package/dist/cli/sync.d.ts.map +1 -1
  14. package/dist/cli/sync.js +3 -2
  15. package/dist/cli/sync.js.map +1 -1
  16. package/dist/cli/sync.test.js +6 -6
  17. package/dist/cli/sync.test.js.map +1 -1
  18. package/dist/company-vault-transport.d.ts +0 -2
  19. package/dist/company-vault-transport.d.ts.map +1 -1
  20. package/dist/company-vault-transport.js +0 -2
  21. package/dist/company-vault-transport.js.map +1 -1
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/journal-baseline.test.js +18 -15
  27. package/dist/journal-baseline.test.js.map +1 -1
  28. package/dist/journal-delta-writes.test.js +2 -2
  29. package/dist/journal-delta-writes.test.js.map +1 -1
  30. package/dist/journal-public-boundary.test.d.ts +2 -0
  31. package/dist/journal-public-boundary.test.d.ts.map +1 -0
  32. package/dist/journal-public-boundary.test.js +216 -0
  33. package/dist/journal-public-boundary.test.js.map +1 -0
  34. package/dist/journal-record-proxy.d.ts +11 -0
  35. package/dist/journal-record-proxy.d.ts.map +1 -0
  36. package/dist/journal-record-proxy.js +71 -0
  37. package/dist/journal-record-proxy.js.map +1 -0
  38. package/dist/journal-row-store.d.ts +76 -3
  39. package/dist/journal-row-store.d.ts.map +1 -1
  40. package/dist/journal-row-store.js +450 -43
  41. package/dist/journal-row-store.js.map +1 -1
  42. package/dist/journal-row-store.test.js +139 -6
  43. package/dist/journal-row-store.test.js.map +1 -1
  44. package/dist/journal-snapshot-decoder.d.ts +18 -0
  45. package/dist/journal-snapshot-decoder.d.ts.map +1 -0
  46. package/dist/journal-snapshot-decoder.js +373 -0
  47. package/dist/journal-snapshot-decoder.js.map +1 -0
  48. package/dist/journal-snapshot-memory-helpers.d.ts +30 -0
  49. package/dist/journal-snapshot-memory-helpers.d.ts.map +1 -0
  50. package/dist/journal-snapshot-memory-helpers.js +203 -0
  51. package/dist/journal-snapshot-memory-helpers.js.map +1 -0
  52. package/dist/journal-snapshot-memory.test.d.ts +2 -0
  53. package/dist/journal-snapshot-memory.test.d.ts.map +1 -0
  54. package/dist/journal-snapshot-memory.test.js +32 -0
  55. package/dist/journal-snapshot-memory.test.js.map +1 -0
  56. package/dist/journal-snapshot-v4-memory.test.d.ts +2 -0
  57. package/dist/journal-snapshot-v4-memory.test.d.ts.map +1 -0
  58. package/dist/journal-snapshot-v4-memory.test.js +24 -0
  59. package/dist/journal-snapshot-v4-memory.test.js.map +1 -0
  60. package/dist/journal-snapshot-v4.d.ts +52 -0
  61. package/dist/journal-snapshot-v4.d.ts.map +1 -0
  62. package/dist/journal-snapshot-v4.js +352 -0
  63. package/dist/journal-snapshot-v4.js.map +1 -0
  64. package/dist/journal-snapshot-v4.test.d.ts +2 -0
  65. package/dist/journal-snapshot-v4.test.d.ts.map +1 -0
  66. package/dist/journal-snapshot-v4.test.js +280 -0
  67. package/dist/journal-snapshot-v4.test.js.map +1 -0
  68. package/dist/journal-store.test.js +335 -17
  69. package/dist/journal-store.test.js.map +1 -1
  70. package/dist/journal.d.ts +10 -8
  71. package/dist/journal.d.ts.map +1 -1
  72. package/dist/journal.js +165 -50
  73. package/dist/journal.js.map +1 -1
  74. package/dist/journal.test.js +1 -1
  75. package/dist/journal.test.js.map +1 -1
  76. package/dist/manifest/build-manifest.bench.test.js +165 -58
  77. package/dist/manifest/build-manifest.bench.test.js.map +1 -1
  78. package/dist/remote-pull.js +6 -4
  79. package/dist/remote-pull.js.map +1 -1
  80. package/dist/remote-pull.test.js +72 -0
  81. package/dist/remote-pull.test.js.map +1 -1
  82. package/dist/session-log-retention.test.js +3 -3
  83. package/dist/session-log-retention.test.js.map +1 -1
  84. package/dist/skill-telemetry.d.ts +1 -2
  85. package/dist/skill-telemetry.d.ts.map +1 -1
  86. package/dist/skill-telemetry.js +1 -10
  87. package/dist/skill-telemetry.js.map +1 -1
  88. package/dist/sync/child-process-sync-worker-env.test.d.ts +2 -0
  89. package/dist/sync/child-process-sync-worker-env.test.d.ts.map +1 -0
  90. package/dist/sync/child-process-sync-worker-env.test.js +38 -0
  91. package/dist/sync/child-process-sync-worker-env.test.js.map +1 -0
  92. package/dist/sync/feature-flags.d.ts +0 -16
  93. package/dist/sync/feature-flags.d.ts.map +1 -1
  94. package/dist/sync/feature-flags.js +0 -11
  95. package/dist/sync/feature-flags.js.map +1 -1
  96. package/dist/sync/index.d.ts +2 -2
  97. package/dist/sync/index.d.ts.map +1 -1
  98. package/dist/sync/index.js +1 -1
  99. package/dist/sync/index.js.map +1 -1
  100. package/dist/sync/logger.test.js +1 -3
  101. package/dist/sync/logger.test.js.map +1 -1
  102. package/dist/sync/metrics.test.js +0 -3
  103. package/dist/sync/metrics.test.js.map +1 -1
  104. package/dist/sync/push-receiver.d.ts +0 -7
  105. package/dist/sync/push-receiver.d.ts.map +1 -1
  106. package/dist/sync/push-receiver.js.map +1 -1
  107. package/dist/sync/state-store.d.ts +23 -0
  108. package/dist/sync/state-store.d.ts.map +1 -1
  109. package/dist/sync/state-store.js +114 -39
  110. package/dist/sync/state-store.js.map +1 -1
  111. package/dist/sync/state-store.test.js +82 -0
  112. package/dist/sync/state-store.test.js.map +1 -1
  113. package/dist/watcher.test.js +7 -8
  114. package/dist/watcher.test.js.map +1 -1
  115. package/package.json +1 -1
  116. package/dist/daemon-worker.d.ts +0 -11
  117. package/dist/daemon-worker.d.ts.map +0 -1
  118. package/dist/daemon-worker.js +0 -22
  119. package/dist/daemon-worker.js.map +0 -1
@@ -0,0 +1,32 @@
1
+ import { afterEach, describe, expect, it } from "vitest";
2
+ import { cleanupSnapshotMemoryTest, configuredMemoryRowCount, measureRecovery, memoryTestTimeoutMs, MIN_SNAPSHOT_BYTES_PER_ROW, } from "./journal-snapshot-memory-helpers.js";
3
+ const DEFAULT_V3_ROW_COUNT = 100_000;
4
+ const V3_ROW_COUNT = configuredMemoryRowCount("HQ_SNAPSHOT_MEMORY_ROW_COUNT", DEFAULT_V3_ROW_COUNT);
5
+ const MAX_RECOVERY_GROWTH_BYTES = 128 * 1024 * 1024;
6
+ const V3_TEST_TIMEOUT_MS = memoryTestTimeoutMs(V3_ROW_COUNT, DEFAULT_V3_ROW_COUNT);
7
+ afterEach(cleanupSnapshotMemoryTest);
8
+ describe("v3 snapshot streaming recovery memory", () => {
9
+ /**
10
+ * CI's `ci` job runs this source test through `pnpm run coverage`. The gate
11
+ * bounds the default 100k-row streaming recovery peak growth (heapUsed +
12
+ * arrayBuffers) and proves that the same whole-payload control exceeds that
13
+ * budget. The row-count override is measurement-only, so its larger fixture
14
+ * does not redefine the 100k gate. This does not claim that peak growth is
15
+ * the packed store's retained size, or that a 100k fixture bounds every
16
+ * production snapshot; retained and transient readings are emitted separately.
17
+ */
18
+ it("keeps streaming recovery below the peak budget while the whole-payload control exceeds it", () => {
19
+ const wholePayload = measureRecovery("whole-payload", V3_ROW_COUNT);
20
+ const streaming = measureRecovery("streaming", V3_ROW_COUNT);
21
+ expect(wholePayload.snapshotBytes).toBeGreaterThan(V3_ROW_COUNT * MIN_SNAPSHOT_BYTES_PER_ROW);
22
+ expect(streaming.snapshotBytes).toBeGreaterThan(V3_ROW_COUNT * MIN_SNAPSHOT_BYTES_PER_ROW);
23
+ expect(wholePayload.recoveredRowCount).toBe(V3_ROW_COUNT);
24
+ expect(streaming.recoveredRowCount).toBe(V3_ROW_COUNT);
25
+ expect(wholePayload.peakGrowth).toBeGreaterThan(MAX_RECOVERY_GROWTH_BYTES);
26
+ expect(streaming.transientGrowth).toBeLessThan(wholePayload.transientGrowth);
27
+ if (V3_ROW_COUNT === DEFAULT_V3_ROW_COUNT) {
28
+ expect(streaming.peakGrowth).toBeLessThan(MAX_RECOVERY_GROWTH_BYTES);
29
+ }
30
+ }, V3_TEST_TIMEOUT_MS);
31
+ });
32
+ //# sourceMappingURL=journal-snapshot-memory.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal-snapshot-memory.test.js","sourceRoot":"","sources":["../src/journal-snapshot-memory.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,sCAAsC,CAAC;AAE9C,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,YAAY,GAAG,wBAAwB,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACpG,MAAM,yBAAyB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AACpD,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;AAEnF,SAAS,CAAC,yBAAyB,CAAC,CAAC;AAErC,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD;;;;;;;;OAQG;IACH,EAAE,CAAC,2FAA2F,EAAE,GAAG,EAAE;QACnG,MAAM,YAAY,GAAG,eAAe,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;QACpE,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAE7D,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,YAAY,GAAG,0BAA0B,CAAC,CAAC;QAC9F,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,YAAY,GAAG,0BAA0B,CAAC,CAAC;QAC3F,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1D,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACvD,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;QAC3E,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QAC7E,IAAI,YAAY,KAAK,oBAAoB,EAAE,CAAC;YAC1C,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAC;QACvE,CAAC;IACH,CAAC,EAAE,kBAAkB,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=journal-snapshot-v4-memory.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal-snapshot-v4-memory.test.d.ts","sourceRoot":"","sources":["../src/journal-snapshot-v4-memory.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { afterEach, describe, expect, it } from "vitest";
2
+ import { cleanupSnapshotMemoryTest, configuredMemoryRowCount, measureV4Recovery, memoryTestTimeoutMs, } from "./journal-snapshot-memory-helpers.js";
3
+ // About 9 MiB at the fixed fixture shape: safely above the >8 MiB precondition
4
+ // while still exercising nine 1 MiB decoder chunks without the v3 gate's 100k cost.
5
+ const DEFAULT_V4_MEMORY_ROW_COUNT = 65_000;
6
+ const V4_MEMORY_ROW_COUNT = configuredMemoryRowCount("HQ_SNAPSHOT_V4_MEMORY_ROW_COUNT", DEFAULT_V4_MEMORY_ROW_COUNT);
7
+ const MAX_V4_DECODER_PAYLOAD_FACTOR = 1.5;
8
+ const MIN_V4_SNAPSHOT_BYTES = 8 * 1_048_576;
9
+ const V4_TEST_TIMEOUT_MS = memoryTestTimeoutMs(V4_MEMORY_ROW_COUNT, DEFAULT_V4_MEMORY_ROW_COUNT);
10
+ afterEach(cleanupSnapshotMemoryTest);
11
+ describe("HQSNAP4 streaming recovery memory", () => {
12
+ /**
13
+ * CI's `ci` job runs this source test through `pnpm run coverage`. The
14
+ * 65k-row fixture remains a multi-chunk (>8 MiB) decoder measurement, but
15
+ * lives in its own file so one worker does not also carry the v3 100k gate.
16
+ */
17
+ it("keeps decoder peak growth below one and a half payloads when the payload spans many chunks", () => {
18
+ const measurement = measureV4Recovery(V4_MEMORY_ROW_COUNT);
19
+ expect(measurement.snapshotBytes).toBeGreaterThan(MIN_V4_SNAPSHOT_BYTES);
20
+ expect(measurement.recoveredRowCount).toBe(V4_MEMORY_ROW_COUNT);
21
+ expect(measurement.decoderPeakGrowth).toBeLessThan(measurement.snapshotBytes * MAX_V4_DECODER_PAYLOAD_FACTOR);
22
+ }, V4_TEST_TIMEOUT_MS);
23
+ });
24
+ //# sourceMappingURL=journal-snapshot-v4-memory.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal-snapshot-v4-memory.test.js","sourceRoot":"","sources":["../src/journal-snapshot-v4-memory.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,+EAA+E;AAC/E,oFAAoF;AACpF,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAC3C,MAAM,mBAAmB,GAAG,wBAAwB,CAClD,iCAAiC,EACjC,2BAA2B,CAC5B,CAAC;AACF,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAC1C,MAAM,qBAAqB,GAAG,CAAC,GAAG,SAAS,CAAC;AAC5C,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,mBAAmB,EAAE,2BAA2B,CAAC,CAAC;AAEjG,SAAS,CAAC,yBAAyB,CAAC,CAAC;AAErC,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD;;;;OAIG;IACH,EAAE,CAAC,4FAA4F,EAAE,GAAG,EAAE;QACpG,MAAM,WAAW,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;QAE3D,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;QACzE,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChE,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,aAAa,GAAG,6BAA6B,CAAC,CAAC;IAChH,CAAC,EAAE,kBAAkB,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { JournalRowStore } from "./journal-row-store.js";
2
+ import { type StateStoreSnapshotChunks } from "./sync/state-store.js";
3
+ import type { SyncJournal, V3JournalState } from "./types.js";
4
+ export declare const JOURNAL_SNAPSHOT_V4_MAGIC: Buffer<ArrayBuffer>;
5
+ type JournalSnapshotPayload = {
6
+ lastRecordSequence: number;
7
+ state: V3JournalState;
8
+ };
9
+ /** Return the packed views installed while decoding an HQSNAP4 payload, if any. */
10
+ export declare function decodedV4JournalRows(journal: SyncJournal): JournalRowStore | undefined;
11
+ /** Test-only seam after v4 chunks become one contiguous decoder payload. */
12
+ export declare function setV4JournalSnapshotDecodeMemorySampleHookForTest(hook: (() => void) | undefined): void;
13
+ /**
14
+ * HQSNAP4 payload, frozen for the reader-before-writer release.
15
+ *
16
+ * The outer 52-byte StateStore header is unchanged: bytes 0..7 are ASCII
17
+ * `HQSNAP4\\0`; bytes 8..15 are the unsigned generation (big-endian); bytes
18
+ * 16..19 are the unsigned payload length (big-endian); bytes 20..51 are the
19
+ * 32-byte scope digest. A trailing SHA-256 covers that header and every payload
20
+ * byte. The payload is the following ordered sequence of sections. Each section
21
+ * is `u32be byteLength`, exact bytes, then zero padding until the next section's
22
+ * data starts on an eight-byte boundary. There is no implicit or optional
23
+ * section, and padding bytes must be zero.
24
+ *
25
+ * 1. metadata JSON: `{lastRecordSequence,state:{journal:{version,lastSync,pulls}},rowCount}`;
26
+ * it deliberately omits `journal.files`.
27
+ * 2. directories JSON string table (id 0 is `""`).
28
+ * 3. leafBlob raw bytes; every leaf is the row-store's `u32le UTF-8 length`
29
+ * followed by its UTF-8 bytes.
30
+ * 4. hashes: `rowCount * 32` raw bytes.
31
+ * 5. remoteEtags: `rowCount * 16` raw bytes.
32
+ * 6. sizes, mtimes, ctimes, syncedAts: each `rowCount` IEEE-754 binary64 LE.
33
+ * 7. flags: `rowCount` unsigned 16-bit LE values.
34
+ * 8. createdBySubs, dirIds, leaves: each `rowCount` unsigned 32-bit LE values.
35
+ * 9. propertyOrderIds: `rowCount` unsigned 16-bit LE values.
36
+ * 10. iterationNext and iterationPrevious: each `rowCount` signed 32-bit LE values.
37
+ * 11. buckets: unsigned 32-bit LE values; its power-of-two length is encoded by
38
+ * this section's byte length.
39
+ * 12. hashFallbacks, etagFallbacks, syncedAtFallbacks, leafFallbacks, removedAts,
40
+ * removedReasons, localDeleteIntents, authors, and propertyOrders: one JSON
41
+ * section each, in exactly that order. Map sections are sorted `[rowId,value]`
42
+ * pairs; `authors` id 0 is `""`; property orders are string-key arrays.
43
+ *
44
+ * The raw typed-array sections are little-endian. Node deployments are
45
+ * little-endian; a big-endian host rejects HQSNAP4 rather than writing or
46
+ * interpreting a different byte format.
47
+ */
48
+ export declare function encodeV4JournalSnapshot(generation: number, scopeDigest: Buffer, payload: JournalSnapshotPayload): Buffer;
49
+ /** Decode an authenticated HQSNAP4 payload into row-store views, never JSON rows. */
50
+ export declare function decodeV4JournalSnapshot(chunks: StateStoreSnapshotChunks): unknown;
51
+ export {};
52
+ //# sourceMappingURL=journal-snapshot-v4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal-snapshot-v4.d.ts","sourceRoot":"","sources":["../src/journal-snapshot-v4.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAgC,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAqB,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,KAAK,EAAgB,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5E,eAAO,MAAM,yBAAyB,qBAAoB,CAAC;AAO3D,KAAK,sBAAsB,GAAG;IAAE,kBAAkB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAEpF,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,eAAe,GAAG,SAAS,CAEtF;AAED,4EAA4E;AAC5E,wBAAgB,iDAAiD,CAAC,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAEtG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,sBAAsB,GAC9B,MAAM,CAsDR;AAED,qFAAqF;AACrF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAmDjF"}
@@ -0,0 +1,352 @@
1
+ import * as crypto from "node:crypto";
2
+ import { createJournalRecordProxy } from "./journal-record-proxy.js";
3
+ import { JournalRowStore } from "./journal-row-store.js";
4
+ import { SNAPSHOT_V4_MAGIC } from "./sync/state-store.js";
5
+ export const JOURNAL_SNAPSHOT_V4_MAGIC = SNAPSHOT_V4_MAGIC;
6
+ const SNAPSHOT_FIXED_HEADER_BYTES = 52;
7
+ const SECTION_ALIGNMENT_BYTES = 8;
8
+ const decodedRows = new WeakMap();
9
+ let decodeMemorySampleHookForTest;
10
+ /** Return the packed views installed while decoding an HQSNAP4 payload, if any. */
11
+ export function decodedV4JournalRows(journal) {
12
+ return decodedRows.get(journal);
13
+ }
14
+ /** Test-only seam after v4 chunks become one contiguous decoder payload. */
15
+ export function setV4JournalSnapshotDecodeMemorySampleHookForTest(hook) {
16
+ decodeMemorySampleHookForTest = hook;
17
+ }
18
+ /**
19
+ * HQSNAP4 payload, frozen for the reader-before-writer release.
20
+ *
21
+ * The outer 52-byte StateStore header is unchanged: bytes 0..7 are ASCII
22
+ * `HQSNAP4\\0`; bytes 8..15 are the unsigned generation (big-endian); bytes
23
+ * 16..19 are the unsigned payload length (big-endian); bytes 20..51 are the
24
+ * 32-byte scope digest. A trailing SHA-256 covers that header and every payload
25
+ * byte. The payload is the following ordered sequence of sections. Each section
26
+ * is `u32be byteLength`, exact bytes, then zero padding until the next section's
27
+ * data starts on an eight-byte boundary. There is no implicit or optional
28
+ * section, and padding bytes must be zero.
29
+ *
30
+ * 1. metadata JSON: `{lastRecordSequence,state:{journal:{version,lastSync,pulls}},rowCount}`;
31
+ * it deliberately omits `journal.files`.
32
+ * 2. directories JSON string table (id 0 is `""`).
33
+ * 3. leafBlob raw bytes; every leaf is the row-store's `u32le UTF-8 length`
34
+ * followed by its UTF-8 bytes.
35
+ * 4. hashes: `rowCount * 32` raw bytes.
36
+ * 5. remoteEtags: `rowCount * 16` raw bytes.
37
+ * 6. sizes, mtimes, ctimes, syncedAts: each `rowCount` IEEE-754 binary64 LE.
38
+ * 7. flags: `rowCount` unsigned 16-bit LE values.
39
+ * 8. createdBySubs, dirIds, leaves: each `rowCount` unsigned 32-bit LE values.
40
+ * 9. propertyOrderIds: `rowCount` unsigned 16-bit LE values.
41
+ * 10. iterationNext and iterationPrevious: each `rowCount` signed 32-bit LE values.
42
+ * 11. buckets: unsigned 32-bit LE values; its power-of-two length is encoded by
43
+ * this section's byte length.
44
+ * 12. hashFallbacks, etagFallbacks, syncedAtFallbacks, leafFallbacks, removedAts,
45
+ * removedReasons, localDeleteIntents, authors, and propertyOrders: one JSON
46
+ * section each, in exactly that order. Map sections are sorted `[rowId,value]`
47
+ * pairs; `authors` id 0 is `""`; property orders are string-key arrays.
48
+ *
49
+ * The raw typed-array sections are little-endian. Node deployments are
50
+ * little-endian; a big-endian host rejects HQSNAP4 rather than writing or
51
+ * interpreting a different byte format.
52
+ */
53
+ export function encodeV4JournalSnapshot(generation, scopeDigest, payload) {
54
+ assertLittleEndian();
55
+ if (!Number.isSafeInteger(generation) || generation < 0)
56
+ throw new Error("HQSNAP4 requires a safe nonnegative generation");
57
+ if (scopeDigest.length !== 32)
58
+ throw new Error("HQSNAP4 requires a 32-byte scope digest");
59
+ validatePayload(payload);
60
+ const rows = new JournalRowStore(Object.keys(payload.state.journal.files).length, { trackChanges: false });
61
+ for (const [entryPath, entry] of Object.entries(payload.state.journal.files))
62
+ rows.set(entryPath, entry);
63
+ const snapshot = rows.toSnapshot();
64
+ const metadata = {
65
+ lastRecordSequence: payload.lastRecordSequence,
66
+ state: {
67
+ journal: {
68
+ version: payload.state.journal.version,
69
+ lastSync: payload.state.journal.lastSync,
70
+ ...(payload.state.journal.pulls === undefined ? {} : { pulls: payload.state.journal.pulls }),
71
+ },
72
+ },
73
+ rowCount: snapshot.rowCount,
74
+ };
75
+ const sections = new V4SectionWriter();
76
+ sections.json(metadata);
77
+ sections.json(snapshot.directories);
78
+ sections.raw(snapshot.leafBlob);
79
+ sections.raw(snapshot.hashes);
80
+ sections.raw(snapshot.remoteEtags);
81
+ sections.raw(snapshot.sizes);
82
+ sections.raw(snapshot.mtimes);
83
+ sections.raw(snapshot.ctimes);
84
+ sections.raw(snapshot.syncedAts);
85
+ sections.raw(snapshot.flags);
86
+ sections.raw(snapshot.createdBySubs);
87
+ sections.raw(snapshot.dirIds);
88
+ sections.raw(snapshot.leaves);
89
+ sections.raw(snapshot.propertyOrderIds);
90
+ sections.raw(snapshot.iterationNext);
91
+ sections.raw(snapshot.iterationPrevious);
92
+ sections.raw(snapshot.buckets);
93
+ sections.json(snapshot.hashFallbacks);
94
+ sections.json(snapshot.etagFallbacks);
95
+ sections.json(snapshot.syncedAtFallbacks);
96
+ sections.json(snapshot.leafFallbacks);
97
+ sections.json(snapshot.removedAts);
98
+ sections.json(snapshot.removedReasons);
99
+ sections.json(snapshot.localDeleteIntents);
100
+ sections.json(snapshot.authors);
101
+ sections.json(snapshot.propertyOrders);
102
+ const body = sections.finish();
103
+ const header = Buffer.alloc(SNAPSHOT_FIXED_HEADER_BYTES);
104
+ JOURNAL_SNAPSHOT_V4_MAGIC.copy(header, 0);
105
+ header.writeBigUInt64BE(BigInt(generation), 8);
106
+ header.writeUInt32BE(body.length, 16);
107
+ scopeDigest.copy(header, 20);
108
+ const checksum = crypto.createHash("sha256").update(header).update(body).digest();
109
+ return Buffer.concat([header, body, checksum]);
110
+ }
111
+ /** Decode an authenticated HQSNAP4 payload into row-store views, never JSON rows. */
112
+ export function decodeV4JournalSnapshot(chunks) {
113
+ assertLittleEndian();
114
+ const body = Buffer.allocUnsafe(chunks.byteLength);
115
+ let offset = 0;
116
+ for (const chunk of chunks) {
117
+ if (chunk.length > body.length - offset)
118
+ throw new Error("HQSNAP4 payload has an invalid byte length");
119
+ chunk.copy(body, offset);
120
+ offset += chunk.length;
121
+ }
122
+ if (offset !== body.length)
123
+ throw new Error("HQSNAP4 payload has an invalid byte length");
124
+ decodeMemorySampleHookForTest?.();
125
+ const sections = new V4SectionReader(body);
126
+ const metadata = decodeMetadata(sections.json("metadata"));
127
+ const snapshot = {
128
+ rowCount: metadata.rowCount,
129
+ directories: decodeStrings(sections.json("directories"), "directory"),
130
+ leafBlob: sections.uint8("leaf blob"),
131
+ hashes: sections.uint8("hashes"),
132
+ remoteEtags: sections.uint8("remote etags"),
133
+ sizes: sections.float64("sizes"),
134
+ mtimes: sections.float64("mtimes"),
135
+ ctimes: sections.float64("ctimes"),
136
+ syncedAts: sections.float64("synced ats"),
137
+ flags: sections.uint16("flags"),
138
+ createdBySubs: sections.uint32("created-by subs"),
139
+ dirIds: sections.uint32("directory ids"),
140
+ leaves: sections.uint32("leaves"),
141
+ propertyOrderIds: sections.uint16("property order ids"),
142
+ iterationNext: sections.int32("iteration next"),
143
+ iterationPrevious: sections.int32("iteration previous"),
144
+ buckets: sections.uint32("buckets"),
145
+ hashFallbacks: decodeStringEntries(sections.json("hash fallbacks"), "hash fallback"),
146
+ etagFallbacks: decodeStringEntries(sections.json("etag fallbacks"), "etag fallback"),
147
+ syncedAtFallbacks: decodeStringEntries(sections.json("synced-at fallbacks"), "synced-at fallback"),
148
+ leafFallbacks: decodeStringEntries(sections.json("leaf fallbacks"), "leaf fallback"),
149
+ removedAts: decodeStringEntries(sections.json("removed ats"), "removed-at"),
150
+ removedReasons: decodeRemovedReasons(sections.json("removed reasons")),
151
+ localDeleteIntents: decodeLocalDeleteIntents(sections.json("local delete intents")),
152
+ authors: decodeStrings(sections.json("authors"), "author"),
153
+ propertyOrders: decodePropertyOrders(sections.json("property orders")),
154
+ };
155
+ sections.finish();
156
+ const rows = JournalRowStore.fromSnapshot(snapshot);
157
+ const journal = {
158
+ files: createJournalRecordProxy(rows),
159
+ version: metadata.version,
160
+ lastSync: metadata.lastSync,
161
+ ...(metadata.pulls === undefined ? {} : { pulls: metadata.pulls }),
162
+ };
163
+ decodedRows.set(journal, rows);
164
+ return { lastRecordSequence: metadata.lastRecordSequence, state: { journal } };
165
+ }
166
+ class V4SectionWriter {
167
+ chunks = [];
168
+ length = 0;
169
+ json(value) {
170
+ this.raw(Buffer.from(JSON.stringify(value), "utf8"));
171
+ }
172
+ raw(values) {
173
+ const bytes = Buffer.from(values.buffer, values.byteOffset, values.byteLength);
174
+ const length = Buffer.alloc(4);
175
+ length.writeUInt32BE(bytes.length);
176
+ this.chunks.push(length, bytes);
177
+ this.length += length.length + bytes.length;
178
+ const padding = paddingAfterSection(this.length);
179
+ if (padding !== 0) {
180
+ this.chunks.push(Buffer.alloc(padding));
181
+ this.length += padding;
182
+ }
183
+ }
184
+ finish() {
185
+ return Buffer.concat(this.chunks, this.length);
186
+ }
187
+ }
188
+ class V4SectionReader {
189
+ body;
190
+ offset = 0;
191
+ constructor(body) {
192
+ this.body = body;
193
+ }
194
+ json(label) {
195
+ const bytes = this.section(label);
196
+ try {
197
+ return JSON.parse(bytes.toString("utf8"));
198
+ }
199
+ catch (error) {
200
+ throw new Error(`HQSNAP4 has invalid ${label} JSON`, { cause: error });
201
+ }
202
+ }
203
+ uint8(label) {
204
+ return this.section(label);
205
+ }
206
+ uint16(label) {
207
+ return this.typed(label, Uint16Array);
208
+ }
209
+ uint32(label) {
210
+ return this.typed(label, Uint32Array);
211
+ }
212
+ int32(label) {
213
+ return this.typed(label, Int32Array);
214
+ }
215
+ float64(label) {
216
+ return this.typed(label, Float64Array);
217
+ }
218
+ finish() {
219
+ if (this.offset !== this.body.length)
220
+ throw new Error("HQSNAP4 has trailing bytes");
221
+ }
222
+ section(label) {
223
+ if (this.offset + 4 > this.body.length)
224
+ throw new Error(`HQSNAP4 has a truncated ${label} length`);
225
+ const length = this.body.readUInt32BE(this.offset);
226
+ const start = this.offset + 4;
227
+ const end = start + length;
228
+ if (end > this.body.length || end < start)
229
+ throw new Error(`HQSNAP4 has a truncated ${label}`);
230
+ this.offset = end;
231
+ const padding = paddingAfterSection(this.offset);
232
+ if (this.offset + padding > this.body.length)
233
+ throw new Error(`HQSNAP4 has truncated ${label} padding`);
234
+ for (let index = 0; index < padding; index += 1) {
235
+ if (this.body[this.offset + index] !== 0)
236
+ throw new Error(`HQSNAP4 has nonzero ${label} padding`);
237
+ }
238
+ this.offset += padding;
239
+ return this.body.subarray(start, end);
240
+ }
241
+ typed(label, Type) {
242
+ const bytes = this.section(label);
243
+ if (bytes.byteLength % Type.BYTES_PER_ELEMENT !== 0 || bytes.byteOffset % Type.BYTES_PER_ELEMENT !== 0) {
244
+ throw new Error(`HQSNAP4 has an unaligned ${label} section`);
245
+ }
246
+ return new Type(bytes.buffer, bytes.byteOffset, bytes.byteLength / Type.BYTES_PER_ELEMENT);
247
+ }
248
+ }
249
+ function paddingAfterSection(offset) {
250
+ return (SECTION_ALIGNMENT_BYTES + 4 - (offset % SECTION_ALIGNMENT_BYTES)) % SECTION_ALIGNMENT_BYTES;
251
+ }
252
+ function decodeMetadata(value) {
253
+ if (!isRecord(value))
254
+ throw new Error("HQSNAP4 has invalid metadata");
255
+ const lastRecordSequence = value.lastRecordSequence;
256
+ const rowCount = value.rowCount;
257
+ const state = value.state;
258
+ if (typeof lastRecordSequence !== "number" || !Number.isSafeInteger(lastRecordSequence) || lastRecordSequence < 0
259
+ || typeof rowCount !== "number" || !Number.isSafeInteger(rowCount) || rowCount < 0 || !isRecord(state)
260
+ || !isRecord(state.journal))
261
+ throw new Error("HQSNAP4 has invalid metadata");
262
+ const journal = state.journal;
263
+ if ((journal.version !== "1" && journal.version !== "2") || typeof journal.lastSync !== "string"
264
+ || (journal.pulls !== undefined && !Array.isArray(journal.pulls)))
265
+ throw new Error("HQSNAP4 has invalid journal metadata");
266
+ return {
267
+ lastRecordSequence,
268
+ rowCount,
269
+ version: journal.version,
270
+ lastSync: journal.lastSync,
271
+ ...(journal.pulls === undefined ? {} : { pulls: journal.pulls }),
272
+ };
273
+ }
274
+ function decodeStrings(value, label) {
275
+ if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {
276
+ throw new Error(`HQSNAP4 has an invalid ${label} table`);
277
+ }
278
+ return value;
279
+ }
280
+ function decodeStringEntries(value, label) {
281
+ if (!Array.isArray(value))
282
+ throw new Error(`HQSNAP4 has invalid ${label} entries`);
283
+ return value.map((item) => {
284
+ if (!Array.isArray(item) || item.length !== 2 || !Number.isInteger(item[0]) || typeof item[1] !== "string") {
285
+ throw new Error(`HQSNAP4 has an invalid ${label} entry`);
286
+ }
287
+ return [item[0], item[1]];
288
+ });
289
+ }
290
+ function decodeRemovedReasons(value) {
291
+ const validReasons = new Set(["scope_shrink", "narrow_apply", "manual", "local-delete"]);
292
+ const entries = decodeStringEntries(value, "removed-reason");
293
+ if (entries.some(([, reason]) => !validReasons.has(reason)))
294
+ throw new Error("HQSNAP4 has an invalid removed reason");
295
+ return entries;
296
+ }
297
+ function decodeLocalDeleteIntents(value) {
298
+ if (!Array.isArray(value))
299
+ throw new Error("HQSNAP4 has invalid local delete intents");
300
+ return value.map((item) => {
301
+ if (!Array.isArray(item) || item.length !== 2 || !Number.isInteger(item[0]) || !isRecord(item[1])) {
302
+ throw new Error("HQSNAP4 has an invalid local delete intent");
303
+ }
304
+ const intent = item[1];
305
+ if (intent.version !== 1 || typeof intent.remoteEtag !== "string" || typeof intent.localHash !== "string"
306
+ || (intent.localKind !== "file" && intent.localKind !== "symlink")) {
307
+ throw new Error("HQSNAP4 has an invalid local delete intent");
308
+ }
309
+ return [item[0], {
310
+ version: 1,
311
+ remoteEtag: intent.remoteEtag,
312
+ localHash: intent.localHash,
313
+ localKind: intent.localKind,
314
+ }];
315
+ });
316
+ }
317
+ function decodePropertyOrders(value) {
318
+ if (!Array.isArray(value) || value.some((order) => !Array.isArray(order) || order.some((key) => typeof key !== "string"))) {
319
+ throw new Error("HQSNAP4 has invalid property orders");
320
+ }
321
+ return value;
322
+ }
323
+ function validatePayload(payload) {
324
+ if (!Number.isSafeInteger(payload.lastRecordSequence) || payload.lastRecordSequence < 0
325
+ || !isRecord(payload.state) || !isJournal(payload.state.journal)) {
326
+ throw new Error("HQSNAP4 has an invalid journal payload");
327
+ }
328
+ }
329
+ function isJournal(value) {
330
+ if (!isRecord(value) || (value.version !== "1" && value.version !== "2") || typeof value.lastSync !== "string" || !isRecord(value.files)) {
331
+ return false;
332
+ }
333
+ if (value.pulls !== undefined && !Array.isArray(value.pulls))
334
+ return false;
335
+ return Object.values(value.files).every(isJournalEntry);
336
+ }
337
+ function isJournalEntry(value) {
338
+ if (!isRecord(value) || typeof value.hash !== "string" || typeof value.size !== "number"
339
+ || !Number.isFinite(value.size) || typeof value.syncedAt !== "string"
340
+ || (value.direction !== "up" && value.direction !== "down"))
341
+ return false;
342
+ return true;
343
+ }
344
+ function isRecord(value) {
345
+ return typeof value === "object" && value !== null && !Array.isArray(value);
346
+ }
347
+ function assertLittleEndian() {
348
+ const probe = new Uint16Array([1]);
349
+ if (new Uint8Array(probe.buffer)[0] !== 1)
350
+ throw new Error("HQSNAP4 requires a little-endian host");
351
+ }
352
+ //# sourceMappingURL=journal-snapshot-v4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal-snapshot-v4.js","sourceRoot":"","sources":["../src/journal-snapshot-v4.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAgC,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAiC,MAAM,uBAAuB,CAAC;AAGzF,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAE3D,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,MAAM,WAAW,GAAG,IAAI,OAAO,EAAgC,CAAC;AAChE,IAAI,6BAAuD,CAAC;AAI5D,mFAAmF;AACnF,MAAM,UAAU,oBAAoB,CAAC,OAAoB;IACvD,OAAO,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,iDAAiD,CAAC,IAA8B;IAC9F,6BAA6B,GAAG,IAAI,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM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ED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,kBAAkB;IACzB,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AACtG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=journal-snapshot-v4.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal-snapshot-v4.test.d.ts","sourceRoot":"","sources":["../src/journal-snapshot-v4.test.ts"],"names":[],"mappings":""}