@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.
- package/dist/bin/sync-runner-installation-id.d.ts +66 -0
- package/dist/bin/sync-runner-installation-id.d.ts.map +1 -0
- package/dist/bin/sync-runner-installation-id.js +138 -0
- package/dist/bin/sync-runner-installation-id.js.map +1 -0
- package/dist/bin/sync-runner-manifest.d.ts +120 -0
- package/dist/bin/sync-runner-manifest.d.ts.map +1 -0
- package/dist/bin/sync-runner-manifest.js +348 -0
- package/dist/bin/sync-runner-manifest.js.map +1 -0
- package/dist/bin/sync-runner-manifest.test.d.ts +12 -0
- package/dist/bin/sync-runner-manifest.test.d.ts.map +1 -0
- package/dist/bin/sync-runner-manifest.test.js +510 -0
- package/dist/bin/sync-runner-manifest.test.js.map +1 -0
- package/dist/bin/sync-runner.d.ts +55 -0
- package/dist/bin/sync-runner.d.ts.map +1 -1
- package/dist/bin/sync-runner.js +69 -0
- package/dist/bin/sync-runner.js.map +1 -1
- package/dist/bin/sync-runner.test.js +217 -0
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/company-slug.d.ts +31 -0
- package/dist/company-slug.d.ts.map +1 -0
- package/dist/company-slug.js +52 -0
- package/dist/company-slug.js.map +1 -0
- package/dist/company-slug.test.d.ts +7 -0
- package/dist/company-slug.test.d.ts.map +1 -0
- package/dist/company-slug.test.js +43 -0
- package/dist/company-slug.test.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/journal-ledger-index.test.d.ts +15 -0
- package/dist/journal-ledger-index.test.d.ts.map +1 -0
- package/dist/journal-ledger-index.test.js +247 -0
- package/dist/journal-ledger-index.test.js.map +1 -0
- package/dist/journal.d.ts +110 -0
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +253 -5
- package/dist/journal.js.map +1 -1
- package/dist/manifest/US-002.acceptance.test.d.ts +11 -0
- package/dist/manifest/US-002.acceptance.test.d.ts.map +1 -0
- package/dist/manifest/US-002.acceptance.test.js +160 -0
- package/dist/manifest/US-002.acceptance.test.js.map +1 -0
- package/dist/manifest/US-004.acceptance.test.d.ts +12 -0
- package/dist/manifest/US-004.acceptance.test.d.ts.map +1 -0
- package/dist/manifest/US-004.acceptance.test.js +173 -0
- package/dist/manifest/US-004.acceptance.test.js.map +1 -0
- package/dist/manifest/build-manifest.bench.test.d.ts +22 -0
- package/dist/manifest/build-manifest.bench.test.d.ts.map +1 -0
- package/dist/manifest/build-manifest.bench.test.js +563 -0
- package/dist/manifest/build-manifest.bench.test.js.map +1 -0
- package/dist/manifest/build-manifest.d.ts +355 -0
- package/dist/manifest/build-manifest.d.ts.map +1 -0
- package/dist/manifest/build-manifest.js +1139 -0
- package/dist/manifest/build-manifest.js.map +1 -0
- package/dist/manifest/build-manifest.test.d.ts +10 -0
- package/dist/manifest/build-manifest.test.d.ts.map +1 -0
- package/dist/manifest/build-manifest.test.js +1172 -0
- package/dist/manifest/build-manifest.test.js.map +1 -0
- package/dist/manifest/contract.d.ts +356 -0
- package/dist/manifest/contract.d.ts.map +1 -0
- package/dist/manifest/contract.js +542 -0
- package/dist/manifest/contract.js.map +1 -0
- package/dist/manifest/contract.test.d.ts +17 -0
- package/dist/manifest/contract.test.d.ts.map +1 -0
- package/dist/manifest/contract.test.js +304 -0
- package/dist/manifest/contract.test.js.map +1 -0
- package/dist/manifest/import-graph.test.d.ts +25 -0
- package/dist/manifest/import-graph.test.d.ts.map +1 -0
- package/dist/manifest/import-graph.test.js +120 -0
- package/dist/manifest/import-graph.test.js.map +1 -0
- package/dist/manifest/ledger-shard-isolation.test.d.ts +18 -0
- package/dist/manifest/ledger-shard-isolation.test.d.ts.map +1 -0
- package/dist/manifest/ledger-shard-isolation.test.js +153 -0
- package/dist/manifest/ledger-shard-isolation.test.js.map +1 -0
- package/dist/manifest/snapshot-store.d.ts +160 -0
- package/dist/manifest/snapshot-store.d.ts.map +1 -0
- package/dist/manifest/snapshot-store.js +300 -0
- package/dist/manifest/snapshot-store.js.map +1 -0
- package/dist/manifest/snapshot-store.test.d.ts +11 -0
- package/dist/manifest/snapshot-store.test.d.ts.map +1 -0
- package/dist/manifest/snapshot-store.test.js +133 -0
- package/dist/manifest/snapshot-store.test.js.map +1 -0
- package/dist/manifest/upload-manifest.d.ts +336 -0
- package/dist/manifest/upload-manifest.d.ts.map +1 -0
- package/dist/manifest/upload-manifest.js +1022 -0
- package/dist/manifest/upload-manifest.js.map +1 -0
- package/dist/manifest/upload-manifest.test.d.ts +10 -0
- package/dist/manifest/upload-manifest.test.d.ts.map +1 -0
- package/dist/manifest/upload-manifest.test.js +1116 -0
- package/dist/manifest/upload-manifest.test.js.map +1 -0
- package/dist/manifest-reconcile.d.ts.map +1 -1
- package/dist/manifest-reconcile.js +1 -26
- package/dist/manifest-reconcile.js.map +1 -1
- package/dist/posix-key.d.ts +36 -0
- package/dist/posix-key.d.ts.map +1 -0
- package/dist/posix-key.js +38 -0
- package/dist/posix-key.js.map +1 -0
- package/dist/s3.d.ts +2 -18
- package/dist/s3.d.ts.map +1 -1
- package/dist/s3.js +6 -20
- package/dist/s3.js.map +1 -1
- package/dist/sync/journal-ledger-stream.d.ts +56 -0
- package/dist/sync/journal-ledger-stream.d.ts.map +1 -0
- package/dist/sync/journal-ledger-stream.js +191 -0
- package/dist/sync/journal-ledger-stream.js.map +1 -0
- package/dist/sync/journal-ledger-stream.test.d.ts +12 -0
- package/dist/sync/journal-ledger-stream.test.d.ts.map +1 -0
- package/dist/sync/journal-ledger-stream.test.js +134 -0
- package/dist/sync/journal-ledger-stream.test.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal-ledger-stream.d.ts","sourceRoot":"","sources":["../../src/sync/journal-ledger-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAQH;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,uBAAuB,GAC7B,IAAI,CAgJN"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incremental reader for the `files` member of a legacy journal document.
|
|
3
|
+
*
|
|
4
|
+
* WHY A HAND-WRITTEN SCANNER AND NOT `JSON.parse`
|
|
5
|
+
* -----------------------------------------------
|
|
6
|
+
* The manifest builder's tail step reads ONE journal shard and needs six
|
|
7
|
+
* fields per row. `JSON.parse` cannot give it those without first
|
|
8
|
+
* materialising the entire document twice over: once as a UTF-8 string the
|
|
9
|
+
* size of the file, and again as a parsed object graph. On a 200,000-entry
|
|
10
|
+
* shard (~34 MB on disk) that pair costs ~200 MB of resident growth before the
|
|
11
|
+
* caller has looked at a single row — and RSS, unlike heap, does not come back
|
|
12
|
+
* when the garbage collector frees it. The transient allocation IS the peak,
|
|
13
|
+
* and the peak is the budget.
|
|
14
|
+
*
|
|
15
|
+
* Streaming the document in 256 KB chunks and parsing each row's small value
|
|
16
|
+
* object on its own keeps the transient set bounded by one chunk plus one row,
|
|
17
|
+
* so the resident cost becomes the compact index the caller retains and
|
|
18
|
+
* nothing else. Measured on the 200,000-entry bench fixture: 260 MB → 182 MB
|
|
19
|
+
* of resident growth, and (perhaps counter-intuitively) faster than
|
|
20
|
+
* `JSON.parse`, because 200,000 small parses beat one 34 MB parse plus the
|
|
21
|
+
* `Object.entries` array it takes to walk the result.
|
|
22
|
+
*
|
|
23
|
+
* WHAT THIS DELIBERATELY IS NOT
|
|
24
|
+
* -----------------------------
|
|
25
|
+
* It is not a general JSON parser and must never be used as one. It tracks
|
|
26
|
+
* just enough structure — string/escape state and container depth — to find
|
|
27
|
+
* the top-level `files` object and slice out each of its members verbatim.
|
|
28
|
+
* Every value is then handed to the real `JSON.parse`, so number, escape, and
|
|
29
|
+
* unicode semantics are V8's rather than this file's. Anything malformed
|
|
30
|
+
* surfaces as a `SyntaxError` from that parse, which callers already treat as
|
|
31
|
+
* a corrupt shard.
|
|
32
|
+
*
|
|
33
|
+
* On-disk format is untouched: this reads exactly the bytes the existing
|
|
34
|
+
* writer produces.
|
|
35
|
+
*/
|
|
36
|
+
import * as fs from "node:fs";
|
|
37
|
+
import { StringDecoder } from "node:string_decoder";
|
|
38
|
+
/** Chunk size for the read loop. Bounds the transient set; not a tuning knob. */
|
|
39
|
+
const CHUNK_BYTES = 1 << 18;
|
|
40
|
+
/**
|
|
41
|
+
* Stream the `files` members of the journal document at `filePath`.
|
|
42
|
+
*
|
|
43
|
+
* Stops reading as soon as the `files` object closes: a shard's `pulls` tail
|
|
44
|
+
* is not the ledger, and on a large journal declining to read it is free.
|
|
45
|
+
*
|
|
46
|
+
* Throws whatever `fs` throws for an unreadable file, and `SyntaxError` for a
|
|
47
|
+
* row whose JSON is malformed. A document with no top-level `files` member
|
|
48
|
+
* simply yields nothing — the same thing an empty ledger yields, which is the
|
|
49
|
+
* correct reading of a locator file.
|
|
50
|
+
*/
|
|
51
|
+
export function streamJournalLedgerRows(filePath, onRow) {
|
|
52
|
+
const fd = fs.openSync(filePath, "r");
|
|
53
|
+
const decoder = new StringDecoder("utf8");
|
|
54
|
+
const buffer = Buffer.allocUnsafe(CHUNK_BYTES);
|
|
55
|
+
// Structural state. `depth` counts open containers; `filesDepth` records the
|
|
56
|
+
// depth INSIDE the `files` object once we have found it.
|
|
57
|
+
let depth = 0;
|
|
58
|
+
let filesDepth = -1;
|
|
59
|
+
let expectFilesObject = false;
|
|
60
|
+
// String state. `lastString` is the most recently completed string literal,
|
|
61
|
+
// which is how a key is recognised: the token before a `:`.
|
|
62
|
+
let inString = false;
|
|
63
|
+
let escaped = false;
|
|
64
|
+
let stringBuffer = "";
|
|
65
|
+
let lastString = "";
|
|
66
|
+
// Capture state for the row currently being sliced out.
|
|
67
|
+
// "" = not capturing, "pending" = past the `:` but not yet at the value's
|
|
68
|
+
// first character, "container" = value is an object/array, "scalar" = value
|
|
69
|
+
// is a number/string/literal and ends at the next `,` or `}`.
|
|
70
|
+
let capture = "";
|
|
71
|
+
let captureDepth = 0;
|
|
72
|
+
let captureKey = "";
|
|
73
|
+
let captureBuffer = "";
|
|
74
|
+
let done = false;
|
|
75
|
+
function emit(valueJson) {
|
|
76
|
+
// `captureKey` is the literal's RAW text, escapes and all. Decoding it
|
|
77
|
+
// through `JSON.parse` is what keeps a key like `a\"b` or `café/x.md`
|
|
78
|
+
// from reaching the caller as its own source text — but the overwhelming
|
|
79
|
+
// majority of vault paths contain no escape at all, and paying a parse per
|
|
80
|
+
// row for them would give back the win this reader exists for.
|
|
81
|
+
const key = captureKey.includes("\\") ? JSON.parse(`"${captureKey}"`) : captureKey;
|
|
82
|
+
capture = "";
|
|
83
|
+
captureBuffer = "";
|
|
84
|
+
onRow(key, valueJson);
|
|
85
|
+
}
|
|
86
|
+
function feed(text) {
|
|
87
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
88
|
+
const char = text[index];
|
|
89
|
+
// Whitespace between `:` and the value belongs to neither.
|
|
90
|
+
if (capture === "pending") {
|
|
91
|
+
if (char === " " || char === "\n" || char === "\r" || char === "\t")
|
|
92
|
+
continue;
|
|
93
|
+
capture = char === "{" || char === "[" ? "container" : "scalar";
|
|
94
|
+
}
|
|
95
|
+
if (capture)
|
|
96
|
+
captureBuffer += char;
|
|
97
|
+
if (inString) {
|
|
98
|
+
if (escaped)
|
|
99
|
+
escaped = false;
|
|
100
|
+
else if (char === "\\")
|
|
101
|
+
escaped = true;
|
|
102
|
+
else if (char === '"') {
|
|
103
|
+
inString = false;
|
|
104
|
+
lastString = stringBuffer;
|
|
105
|
+
stringBuffer = "";
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
stringBuffer += char;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (char === '"') {
|
|
112
|
+
inString = true;
|
|
113
|
+
stringBuffer = "";
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (char === "{" || char === "[") {
|
|
117
|
+
depth += 1;
|
|
118
|
+
if (expectFilesObject && char === "{") {
|
|
119
|
+
filesDepth = depth;
|
|
120
|
+
expectFilesObject = false;
|
|
121
|
+
}
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (char === "}" || char === "]") {
|
|
125
|
+
// A scalar row value ends at the brace that closes `files`.
|
|
126
|
+
if (capture === "scalar" && depth === captureDepth) {
|
|
127
|
+
emit(captureBuffer.slice(0, -1).trim());
|
|
128
|
+
}
|
|
129
|
+
depth -= 1;
|
|
130
|
+
if (capture === "container" && depth === captureDepth) {
|
|
131
|
+
emit(captureBuffer);
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
// `files` itself just closed: the rest of the document is not ledger.
|
|
135
|
+
if (filesDepth !== -1 && depth < filesDepth) {
|
|
136
|
+
done = true;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (char === ",") {
|
|
142
|
+
if (capture === "scalar" && depth === captureDepth) {
|
|
143
|
+
emit(captureBuffer.slice(0, -1).trim());
|
|
144
|
+
}
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (char === ":" && !capture) {
|
|
148
|
+
if (depth === filesDepth) {
|
|
149
|
+
capture = "pending";
|
|
150
|
+
captureKey = lastString;
|
|
151
|
+
captureBuffer = "";
|
|
152
|
+
captureDepth = depth;
|
|
153
|
+
}
|
|
154
|
+
else if (depth === 1 && lastString === "files") {
|
|
155
|
+
expectFilesObject = true;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
for (;;) {
|
|
162
|
+
const read = fs.readSync(fd, buffer, 0, CHUNK_BYTES, null);
|
|
163
|
+
if (read === 0)
|
|
164
|
+
break;
|
|
165
|
+
// The decoder holds back a split multi-byte sequence until its
|
|
166
|
+
// continuation arrives, so a chunk boundary can never mint a lone
|
|
167
|
+
// replacement character mid-path.
|
|
168
|
+
feed(decoder.write(buffer.subarray(0, read)));
|
|
169
|
+
if (done)
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
feed(decoder.end());
|
|
173
|
+
// Reaching EOF with the document still open means it was TRUNCATED — a
|
|
174
|
+
// half-written shard, a full disk, a killed process. `JSON.parse` would
|
|
175
|
+
// have thrown here, and this reader must too: emitting the rows it happened
|
|
176
|
+
// to reach would hand the caller a short ledger that looks complete, and a
|
|
177
|
+
// short ledger is not a harmless one. Every file the truncated tail
|
|
178
|
+
// described would then be reported as untracked drift.
|
|
179
|
+
//
|
|
180
|
+
// `done` is the legitimate early exit: the `files` object closed and the
|
|
181
|
+
// rest of the document is deliberately unread, so the balance of a `pulls`
|
|
182
|
+
// tail we never looked at is none of our business.
|
|
183
|
+
if (depth !== 0 || inString || capture) {
|
|
184
|
+
throw new SyntaxError("journal-ledger-stream: unexpected end of JSON input");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
finally {
|
|
188
|
+
fs.closeSync(fd);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=journal-ledger-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal-ledger-stream.js","sourceRoot":"","sources":["../../src/sync/journal-ledger-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,iFAAiF;AACjF,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,CAAC;AAW5B;;;;;;;;;;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AI,CAAC;gBAC3B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,SAAS,CAAC;YACR,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;YAC3D,IAAI,IAAI,KAAK,CAAC;gBAAE,MAAM;YACtB,+DAA+D;YAC/D,kEAAkE;YAClE,kCAAkC;YAClC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,IAAI;gBAAE,OAAO;QACnB,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACpB,uEAAuE;QACvE,wEAAwE;QACxE,4EAA4E;QAC5E,2EAA2E;QAC3E,oEAAoE;QACpE,uDAAuD;QACvD,EAAE;QACF,yEAAyE;QACzE,2EAA2E;QAC3E,mDAAmD;QACnD,IAAI,KAAK,KAAK,CAAC,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;YACvC,MAAM,IAAI,WAAW,CAAC,qDAAqD,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The streaming ledger reader must agree with `JSON.parse` on every document
|
|
3
|
+
* the journal writer can produce — that is the whole safety argument for using
|
|
4
|
+
* a hand-written scanner at all.
|
|
5
|
+
*
|
|
6
|
+
* So the central test is not a hand-picked example, it is an EQUIVALENCE: for
|
|
7
|
+
* each fixture, the rows this reader emits are compared against the rows
|
|
8
|
+
* `JSON.parse` yields from the same bytes. A fixture that the two disagree on
|
|
9
|
+
* is a bug in this file by construction, whichever one is "right".
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=journal-ledger-stream.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal-ledger-stream.test.d.ts","sourceRoot":"","sources":["../../src/sync/journal-ledger-stream.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The streaming ledger reader must agree with `JSON.parse` on every document
|
|
3
|
+
* the journal writer can produce — that is the whole safety argument for using
|
|
4
|
+
* a hand-written scanner at all.
|
|
5
|
+
*
|
|
6
|
+
* So the central test is not a hand-picked example, it is an EQUIVALENCE: for
|
|
7
|
+
* each fixture, the rows this reader emits are compared against the rows
|
|
8
|
+
* `JSON.parse` yields from the same bytes. A fixture that the two disagree on
|
|
9
|
+
* is a bug in this file by construction, whichever one is "right".
|
|
10
|
+
*/
|
|
11
|
+
import * as fs from "node:fs";
|
|
12
|
+
import * as os from "node:os";
|
|
13
|
+
import * as path from "node:path";
|
|
14
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
15
|
+
import { streamJournalLedgerRows } from "./journal-ledger-stream.js";
|
|
16
|
+
let dir;
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
dir = fs.mkdtempSync(path.join(os.tmpdir(), "hq-ledger-stream-"));
|
|
19
|
+
});
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
22
|
+
});
|
|
23
|
+
function write(name, text) {
|
|
24
|
+
const filePath = path.join(dir, name);
|
|
25
|
+
fs.writeFileSync(filePath, text, "utf8");
|
|
26
|
+
return filePath;
|
|
27
|
+
}
|
|
28
|
+
function streamed(filePath) {
|
|
29
|
+
const out = {};
|
|
30
|
+
streamJournalLedgerRows(filePath, (key, valueJson) => {
|
|
31
|
+
out[key] = JSON.parse(valueJson);
|
|
32
|
+
});
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
function parsed(filePath) {
|
|
36
|
+
const doc = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
37
|
+
return doc.files ?? {};
|
|
38
|
+
}
|
|
39
|
+
describe("streamJournalLedgerRows — equivalence with JSON.parse", () => {
|
|
40
|
+
const cases = {
|
|
41
|
+
"an ordinary journal": {
|
|
42
|
+
version: "2",
|
|
43
|
+
files: {
|
|
44
|
+
"notes/a.md": { hash: "sha256:aa", size: 1, syncedAt: "2026-01-01T00:00:00.000Z", direction: "up" },
|
|
45
|
+
"notes/b.md": { hash: "sha256:bb", size: 2, syncedAt: "2026-01-02T00:00:00.000Z", direction: "down" },
|
|
46
|
+
},
|
|
47
|
+
pulls: [{ id: "p1", at: "2026-01-02T00:00:00.000Z" }],
|
|
48
|
+
},
|
|
49
|
+
"an empty files map": { version: "2", files: {}, pulls: [] },
|
|
50
|
+
"no files member at all": { schema: "hq-sync-journal-locator@1", scopeId: "x" },
|
|
51
|
+
"files declared last": {
|
|
52
|
+
pulls: [{ id: "p1" }],
|
|
53
|
+
version: "2",
|
|
54
|
+
files: { "z.md": { hash: "sha256:zz", size: 3, syncedAt: "2026-01-01T00:00:00.000Z", direction: "up" } },
|
|
55
|
+
},
|
|
56
|
+
"nested and heterogeneous row values": {
|
|
57
|
+
version: "2",
|
|
58
|
+
files: {
|
|
59
|
+
"deep.md": {
|
|
60
|
+
hash: "sha256:dd",
|
|
61
|
+
size: 4,
|
|
62
|
+
syncedAt: "2026-01-01T00:00:00.000Z",
|
|
63
|
+
direction: "up",
|
|
64
|
+
localDeleteIntent: { version: 1, remoteEtag: "e", localHash: "h", localKind: "file" },
|
|
65
|
+
outOfScopeProtected: true,
|
|
66
|
+
ctimeMs: null,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
pulls: [],
|
|
70
|
+
},
|
|
71
|
+
"keys and values that exercise the string scanner": {
|
|
72
|
+
version: "2",
|
|
73
|
+
files: {
|
|
74
|
+
// A quote, a backslash, a brace, a colon and a comma inside a KEY —
|
|
75
|
+
// every character the scanner treats as structural when it is outside
|
|
76
|
+
// a string, and must not when it is inside one.
|
|
77
|
+
'odd"key\\with{braces}:and,commas.md': { hash: "sha256:ee", size: 5, syncedAt: "t", direction: "up" },
|
|
78
|
+
"unicode/café/日本語/🗂.md": { hash: "sha256:ff", size: 6, syncedAt: "t", direction: "down" },
|
|
79
|
+
"escapes.md": { hash: 'sha256:with"quote\\and\\\\backslash', size: 7, syncedAt: "t\nnewline", direction: "up" },
|
|
80
|
+
},
|
|
81
|
+
pulls: [],
|
|
82
|
+
},
|
|
83
|
+
"a row whose value is not an object": {
|
|
84
|
+
version: "2",
|
|
85
|
+
files: { "scalar.md": 42, "nulled.md": null, "stringy.md": "plain", "listed.md": [1, 2, 3] },
|
|
86
|
+
pulls: [],
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
for (const [name, document] of Object.entries(cases)) {
|
|
90
|
+
it(`matches JSON.parse for ${name}`, () => {
|
|
91
|
+
const filePath = write("journal.json", JSON.stringify(document));
|
|
92
|
+
expect(streamed(filePath)).toEqual(parsed(filePath));
|
|
93
|
+
});
|
|
94
|
+
it(`matches JSON.parse for ${name}, pretty-printed`, () => {
|
|
95
|
+
// The writer emits compact JSON, but a journal repaired by hand is still
|
|
96
|
+
// a journal — and whitespace is exactly where a naive scanner breaks.
|
|
97
|
+
const filePath = write("journal-pretty.json", JSON.stringify(document, null, 2));
|
|
98
|
+
expect(streamed(filePath)).toEqual(parsed(filePath));
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
describe("streamJournalLedgerRows — chunk boundaries are not row boundaries", () => {
|
|
103
|
+
it("reads a document far larger than one read buffer identically", () => {
|
|
104
|
+
// Comfortably past the 256 KB chunk size, so keys, values, and multi-byte
|
|
105
|
+
// sequences all land mid-buffer somewhere in the run.
|
|
106
|
+
const files = {};
|
|
107
|
+
for (let index = 0; index < 20_000; index += 1) {
|
|
108
|
+
files[`notes/café-${index}/日本語-${index}.md`] = {
|
|
109
|
+
hash: `sha256:${index.toString(16).padStart(64, "0")}`,
|
|
110
|
+
size: index,
|
|
111
|
+
syncedAt: "2026-01-01T00:00:00.000Z",
|
|
112
|
+
direction: index % 2 === 0 ? "up" : "down",
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const filePath = write("big.json", JSON.stringify({ version: "2", files, pulls: [] }));
|
|
116
|
+
const rows = streamed(filePath);
|
|
117
|
+
expect(Object.keys(rows)).toHaveLength(20_000);
|
|
118
|
+
expect(rows).toEqual(parsed(filePath));
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
describe("streamJournalLedgerRows — malformed input surfaces, never fabricates", () => {
|
|
122
|
+
it("throws rather than reporting a truncated document as a short ledger", () => {
|
|
123
|
+
const filePath = write("truncated.json", '{"version":"2","files":{"a.md":{"hash":"sha256:aa","siz');
|
|
124
|
+
expect(() => streamed(filePath)).toThrow(SyntaxError);
|
|
125
|
+
});
|
|
126
|
+
it("throws for a row whose value is not valid JSON", () => {
|
|
127
|
+
const filePath = write("bad-row.json", '{"files":{"a.md":{"hash":,}},"pulls":[]}');
|
|
128
|
+
expect(() => streamed(filePath)).toThrow(SyntaxError);
|
|
129
|
+
});
|
|
130
|
+
it("propagates an unreadable file", () => {
|
|
131
|
+
expect(() => streamed(path.join(dir, "missing.json"))).toThrow();
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
//# sourceMappingURL=journal-ledger-stream.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal-ledger-stream.test.js","sourceRoot":"","sources":["../../src/sync/journal-ledger-stream.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE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M,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,sEAAsE,EAAE,GAAG,EAAE;IACpF,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,QAAQ,GAAG,KAAK,CAAC,gBAAgB,EAAE,yDAAyD,CAAC,CAAC;QACpG,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,QAAQ,GAAG,KAAK,CAAC,cAAc,EAAE,0CAA0C,CAAC,CAAC;QACnF,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cloud",
|
|
3
|
-
"version": "6.16.
|
|
3
|
+
"version": "6.16.22",
|
|
4
4
|
"description": "HQ by Indigo cloud sync engine — bidirectional S3 sync for mobile access",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"typecheck": "tsc --noEmit",
|
|
45
45
|
"lint": "eslint .",
|
|
46
46
|
"test": "vitest run src/",
|
|
47
|
+
"bench:manifest": "vitest run --config vitest.bench.config.ts",
|
|
47
48
|
"coverage": "vitest run src/ --coverage --coverage.reporter=text-summary --coverage.reporter=json-summary",
|
|
48
49
|
"test:e2e": "HQ_TEST_ALLOW_NETWORK=1 tsc && HQ_TEST_ALLOW_NETWORK=1 vitest run test/",
|
|
49
50
|
"test:e2e:laptop-mini": "HQ_TEST_ALLOW_NETWORK=1 vitest run test/share-sync.integration.test.ts",
|