@cotal-ai/core 0.65.0 → 0.67.0
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/auth-provider.d.ts +16 -9
- package/dist/auth-provider.d.ts.map +1 -1
- package/dist/backup-config.d.ts +1 -1
- package/dist/backup-config.d.ts.map +1 -1
- package/dist/backup-config.js +6 -2
- package/dist/backup-config.js.map +1 -1
- package/dist/connector.d.ts +24 -0
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js.map +1 -1
- package/dist/endpoint-action.d.ts.map +1 -1
- package/dist/endpoint-action.js +9 -10
- package/dist/endpoint-action.js.map +1 -1
- package/dist/endpoint-envelope.d.ts +1 -1
- package/dist/endpoint-envelope.d.ts.map +1 -1
- package/dist/endpoint-envelope.js +1 -3
- package/dist/endpoint-envelope.js.map +1 -1
- package/dist/endpoint-error.d.ts +5 -1
- package/dist/endpoint-error.d.ts.map +1 -1
- package/dist/endpoint-error.js +9 -6
- package/dist/endpoint-error.js.map +1 -1
- package/dist/endpoint-grants.d.ts +1 -1
- package/dist/endpoint-grants.d.ts.map +1 -1
- package/dist/endpoint-grants.js +1 -0
- package/dist/endpoint-grants.js.map +1 -1
- package/dist/endpoint-invoke.d.ts +6 -0
- package/dist/endpoint-invoke.d.ts.map +1 -1
- package/dist/endpoint-invoke.js +6 -0
- package/dist/endpoint-invoke.js.map +1 -1
- package/dist/endpoint-reconcile.js +2 -2
- package/dist/endpoint-reconcile.js.map +1 -1
- package/dist/endpoint-serve-kv.d.ts.map +1 -1
- package/dist/endpoint-serve-kv.js +29 -44
- package/dist/endpoint-serve-kv.js.map +1 -1
- package/dist/endpoint-service.d.ts +20 -10
- package/dist/endpoint-service.d.ts.map +1 -1
- package/dist/endpoint-service.js +37 -8
- package/dist/endpoint-service.js.map +1 -1
- package/dist/endpoint.d.ts +8 -8
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoint.js +19 -20
- package/dist/endpoint.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lifecycle-saga.d.ts.map +1 -1
- package/dist/lifecycle-saga.js +27 -27
- package/dist/lifecycle-saga.js.map +1 -1
- package/dist/lifecycle-state.d.ts +44 -36
- package/dist/lifecycle-state.d.ts.map +1 -1
- package/dist/lifecycle-state.js +34 -49
- package/dist/lifecycle-state.js.map +1 -1
- package/dist/provision.d.ts +14 -1
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +27 -4
- package/dist/provision.js.map +1 -1
- package/dist/remote-manager-authority.d.ts +13 -1
- package/dist/remote-manager-authority.d.ts.map +1 -1
- package/dist/remote-manager-authority.js +24 -17
- package/dist/remote-manager-authority.js.map +1 -1
- package/dist/spaces.d.ts +5 -1
- package/dist/spaces.d.ts.map +1 -1
- package/dist/spaces.js +50 -15
- package/dist/spaces.js.map +1 -1
- package/dist/subjects.d.ts +9 -0
- package/dist/subjects.d.ts.map +1 -1
- package/dist/subjects.js +14 -0
- package/dist/subjects.js.map +1 -1
- package/dist/transfer.d.ts +110 -0
- package/dist/transfer.d.ts.map +1 -0
- package/dist/transfer.js +325 -0
- package/dist/transfer.js.map +1 -0
- package/package.json +1 -1
package/dist/transfer.js
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resume transfer store: a carried transcript's path from the operator's host to one manager
|
|
3
|
+
* instance (docs/design/resume-transfer.md sections 3 and 4).
|
|
4
|
+
*
|
|
5
|
+
* Objects are written in the stock Object Store layout so the stock `get` reads and verifies them,
|
|
6
|
+
* but never with the stock `put`: that draws a random chunk subject per call and purges what it wrote
|
|
7
|
+
* on any error, so an interrupted upload could only restart from byte zero. Here the chunk subject is
|
|
8
|
+
* derived from the digest and every chunk publish is pinned to the previous one's stream sequence, so
|
|
9
|
+
* the broker's chain is the checkpoint and any writer of the same bytes continues it.
|
|
10
|
+
*/
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import { headers } from "@nats-io/nats-core";
|
|
13
|
+
import { jetstream, jetstreamManager } from "@nats-io/jetstream";
|
|
14
|
+
import { Objm } from "@nats-io/obj";
|
|
15
|
+
import { objectStoreStream, transferBucket } from "./subjects.js";
|
|
16
|
+
import { fromObjectStoreDigest } from "./artifact.js";
|
|
17
|
+
import { isCasLoss } from "./endpoint-records.js";
|
|
18
|
+
/** The stock client's default chunk, and the most a chunk carries. */
|
|
19
|
+
export const TRANSFER_CHUNK_MAX = 128 * 1024;
|
|
20
|
+
/** Room left under `max_payload` for the publish's headers. */
|
|
21
|
+
const HEADER_ROOM = 4 * 1024;
|
|
22
|
+
/** Transcript bytes acknowledged through a chunk. */
|
|
23
|
+
export const OFFSET_HEADER = "Cotal-Offset";
|
|
24
|
+
/** Chunks acknowledged through a chunk. */
|
|
25
|
+
export const CHUNK_HEADER = "Cotal-Chunk";
|
|
26
|
+
const EXPECTED_LAST_SUBJECT_SEQ = "Nats-Expected-Last-Subject-Sequence";
|
|
27
|
+
const HEX64 = /^[0-9a-f]{64}$/;
|
|
28
|
+
/** A record's chunk subject token: this protocol's hex digest or the stock client's nuid, never a wildcard. */
|
|
29
|
+
const STOCK_NUID = /^[0-9A-Za-z]{1,64}$/;
|
|
30
|
+
function assertHex(hex) {
|
|
31
|
+
if (!HEX64.test(hex))
|
|
32
|
+
throw new Error(`transfer: ${JSON.stringify(hex)} is not a 64-character lowercase hex digest`);
|
|
33
|
+
}
|
|
34
|
+
/** Base64url with its padding kept, the stock client's encoding for meta subjects and digests. */
|
|
35
|
+
function paddedBase64Url(bytes) {
|
|
36
|
+
return bytes.toString("base64").replace(/\+/g, "-").replace(/\//g, "_");
|
|
37
|
+
}
|
|
38
|
+
/** `$O.<bucket>.C.<hex>`: one stable chunk subject per transcript, so every attempt at the same bytes
|
|
39
|
+
* extends the same chain. */
|
|
40
|
+
export function transferChunkSubject(bucket, hex) {
|
|
41
|
+
assertHex(hex);
|
|
42
|
+
return `$O.${bucket}.C.${hex}`;
|
|
43
|
+
}
|
|
44
|
+
/** `$O.<bucket>.M.<name>`, the name encoded as the stock client encodes it. */
|
|
45
|
+
export function transferMetaSubject(bucket, hex) {
|
|
46
|
+
assertHex(hex);
|
|
47
|
+
return `$O.${bucket}.M.${paddedBase64Url(Buffer.from(`sha256:${hex}`))}`;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Create the instance's transfer bucket, or verify one that exists, and return its name. Same
|
|
51
|
+
* discipline as `ensureArtifactStore`: a store that exists under the name with other bounds is
|
|
52
|
+
* refused rather than adopted. `max_age` must be 0, because a per-message age can drop the start of
|
|
53
|
+
* a chain and keep its end (design section 4.5); direct get must be on, because the hit check and the
|
|
54
|
+
* resume read use it.
|
|
55
|
+
*/
|
|
56
|
+
export async function ensureTransferStore(nc, space, instanceId) {
|
|
57
|
+
const bucket = transferBucket(space, instanceId);
|
|
58
|
+
const stream = objectStoreStream(bucket);
|
|
59
|
+
const jsm = await jetstreamManager(nc);
|
|
60
|
+
await new Objm(jetstream(nc)).create(bucket, { max_bytes: -1 });
|
|
61
|
+
const { config } = await jsm.streams.info(stream);
|
|
62
|
+
const drift = [];
|
|
63
|
+
const want = [`$O.${bucket}.C.>`, `$O.${bucket}.M.>`];
|
|
64
|
+
if (JSON.stringify(config.subjects ?? []) !== JSON.stringify(want))
|
|
65
|
+
drift.push(`subjects are ${JSON.stringify(config.subjects ?? [])}, expected ${JSON.stringify(want)}`);
|
|
66
|
+
if (config.mirror)
|
|
67
|
+
drift.push("it is a MIRROR of another stream");
|
|
68
|
+
if (config.sources?.length)
|
|
69
|
+
drift.push(`it SOURCES ${config.sources.length} other stream(s)`);
|
|
70
|
+
if (String(config.discard) !== "new")
|
|
71
|
+
drift.push(`discard is ${config.discard}, expected new`);
|
|
72
|
+
if (String(config.storage) !== "file")
|
|
73
|
+
drift.push(`storage is ${config.storage}, expected file`);
|
|
74
|
+
if (String(config.retention) !== "limits")
|
|
75
|
+
drift.push(`retention is ${config.retention}, expected limits`);
|
|
76
|
+
if (config.allow_rollup_hdrs !== true)
|
|
77
|
+
drift.push("allow_rollup_hdrs is false, expected true (the commit is a subject rollup)");
|
|
78
|
+
if (config.allow_direct !== true)
|
|
79
|
+
drift.push("allow_direct is false, expected true (the hit and resume reads are direct gets)");
|
|
80
|
+
if (config.max_age !== 0)
|
|
81
|
+
drift.push(`max_age is ${config.max_age}, expected 0 (an age can drop the start of a chain and keep its end)`);
|
|
82
|
+
if (config.sealed === true)
|
|
83
|
+
drift.push("the stream is SEALED (writes permanently refused)");
|
|
84
|
+
for (const [field, value] of [["max_bytes", config.max_bytes], ["max_msgs", config.max_msgs],
|
|
85
|
+
["max_msgs_per_subject", config.max_msgs_per_subject], ["max_msg_size", config.max_msg_size]])
|
|
86
|
+
if (value !== -1)
|
|
87
|
+
drift.push(`${field} is ${value}, expected -1`);
|
|
88
|
+
if (drift.length)
|
|
89
|
+
throw new Error(`transfer store ${stream} has drifted: ${drift.join("; ")} - refusing to adopt it (delete it, or reconcile it deliberately)`);
|
|
90
|
+
return bucket;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The operator's transfer instrument (design section 6): publish the one object's chunk and meta
|
|
94
|
+
* subjects in one instance's bucket, and read the last message of each with a direct get. It names
|
|
95
|
+
* no other object, no stream API beyond those two reads, and no consumer, so a copied instrument can
|
|
96
|
+
* extend or commit only the transcript the CLI hashed before minting it.
|
|
97
|
+
*/
|
|
98
|
+
export function transferWriterGrants(space, instanceId, hex, connId) {
|
|
99
|
+
const bucket = transferBucket(space, instanceId);
|
|
100
|
+
const subjects = [transferChunkSubject(bucket, hex), transferMetaSubject(bucket, hex)];
|
|
101
|
+
const direct = `$JS.API.DIRECT.GET.${objectStoreStream(bucket)}`;
|
|
102
|
+
return { publish: [...subjects, ...subjects.map((s) => `${direct}.${s}`)], subscribe: [`_INBOX_${connId}.>`] };
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A manager instance's transfer reader (design section 6): create and read its own bucket's stream,
|
|
106
|
+
* stream it through the stock `get`'s push consumer, and remove a transfer with the stock delete
|
|
107
|
+
* marker and a filtered purge. Every row names the instance's own stream, so it reads no other
|
|
108
|
+
* instance's transfers. The push consumer delivers to this connection's own inbox, and a caller-chosen
|
|
109
|
+
* `deliver_subject` could only export the bucket this reader is already entitled to.
|
|
110
|
+
*/
|
|
111
|
+
export function transferReaderGrants(space, instanceId, connId) {
|
|
112
|
+
const bucket = transferBucket(space, instanceId);
|
|
113
|
+
const stream = objectStoreStream(bucket);
|
|
114
|
+
return {
|
|
115
|
+
publish: [
|
|
116
|
+
// The stock Object Store client opens its manager with the account API check.
|
|
117
|
+
"$JS.API.INFO",
|
|
118
|
+
`$JS.API.STREAM.CREATE.${stream}`,
|
|
119
|
+
`$JS.API.STREAM.INFO.${stream}`,
|
|
120
|
+
`$JS.API.STREAM.MSG.GET.${stream}`,
|
|
121
|
+
`$JS.API.STREAM.PURGE.${stream}`,
|
|
122
|
+
`$JS.API.CONSUMER.CREATE.${stream}`,
|
|
123
|
+
`$JS.API.CONSUMER.CREATE.${stream}.>`,
|
|
124
|
+
`$O.${bucket}.M.>`,
|
|
125
|
+
// Flow control replies of the stock get's push consumer, which the broker names by stream.
|
|
126
|
+
`$JS.FC.${stream}.>`,
|
|
127
|
+
],
|
|
128
|
+
subscribe: [`_INBOX_${connId}.>`],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function lastOnSubject(jsm, stream, subject, read) {
|
|
132
|
+
return read === "direct"
|
|
133
|
+
? jsm.direct.getMessage(stream, { last_by_subj: subject })
|
|
134
|
+
: jsm.streams.getMessage(stream, { last_by_subj: subject });
|
|
135
|
+
}
|
|
136
|
+
/** Read the last chunk on the transcript's chunk subject: the writer's resume point. */
|
|
137
|
+
export async function readChainHead(jsm, bucket, hex) {
|
|
138
|
+
const m = await lastOnSubject(jsm, objectStoreStream(bucket), transferChunkSubject(bucket, hex), "direct");
|
|
139
|
+
if (m === null)
|
|
140
|
+
return { offset: 0, chunks: 0, seq: 0 };
|
|
141
|
+
const offset = Number(m.header.get(OFFSET_HEADER));
|
|
142
|
+
const chunks = Number(m.header.get(CHUNK_HEADER));
|
|
143
|
+
if (!Number.isSafeInteger(offset) || offset <= 0 || !Number.isSafeInteger(chunks) || chunks <= 0)
|
|
144
|
+
throw new Error(`transfer chunk ${m.subject}#${m.seq} carries no valid ${OFFSET_HEADER}/${CHUNK_HEADER} headers`);
|
|
145
|
+
return { offset, chunks, seq: m.seq };
|
|
146
|
+
}
|
|
147
|
+
export async function readMetaHead(jsm, bucket, hex, read) {
|
|
148
|
+
const m = await lastOnSubject(jsm, objectStoreStream(bucket), transferMetaSubject(bucket, hex), read);
|
|
149
|
+
if (m === null)
|
|
150
|
+
return { seq: 0, live: false };
|
|
151
|
+
const info = JSON.parse(m.string());
|
|
152
|
+
if (info.deleted === true)
|
|
153
|
+
return { seq: m.seq, live: false, nuid: info.nuid };
|
|
154
|
+
return { seq: m.seq, live: true, nuid: info.nuid, chunks: info.chunks, digest: info.digest };
|
|
155
|
+
}
|
|
156
|
+
/** The connection's chunk size: the stock default, lowered to fit `max_payload`. */
|
|
157
|
+
function chunkSize(nc) {
|
|
158
|
+
const maxPayload = nc.info?.max_payload;
|
|
159
|
+
if (!maxPayload)
|
|
160
|
+
throw new Error("transfer: the connection reports no max_payload");
|
|
161
|
+
const size = Math.min(TRANSFER_CHUNK_MAX, maxPayload - HEADER_ROOM);
|
|
162
|
+
if (size <= 0)
|
|
163
|
+
throw new Error(`transfer: max_payload ${maxPayload} leaves no room for a chunk`);
|
|
164
|
+
return size;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* One pass of the writer (design 4.2-4.4): skip to the target on a live record, continue the chain from
|
|
168
|
+
* its head, and commit. A refused chunk expectation rereads the head and continues when a chunk is
|
|
169
|
+
* left; an empty subject means the target removed the transfer, which only the target can resolve.
|
|
170
|
+
* `sent` and `chunks` count what this pass published.
|
|
171
|
+
*/
|
|
172
|
+
export async function writeTransfer(nc, bucket, bytes) {
|
|
173
|
+
const digest = createHash("sha256").update(bytes).digest();
|
|
174
|
+
const hex = digest.toString("hex");
|
|
175
|
+
// The writer's instrument holds its two direct gets and nothing else on the JetStream API.
|
|
176
|
+
const jsm = await jetstreamManager(nc, { checkAPI: false });
|
|
177
|
+
const js = jetstream(nc);
|
|
178
|
+
const meta = await readMetaHead(jsm, bucket, hex, "direct");
|
|
179
|
+
if (meta.live)
|
|
180
|
+
return { state: "live", sent: 0, chunks: 0 };
|
|
181
|
+
const subject = transferChunkSubject(bucket, hex);
|
|
182
|
+
const max = chunkSize(nc);
|
|
183
|
+
let head = await readChainHead(jsm, bucket, hex);
|
|
184
|
+
let sent = 0;
|
|
185
|
+
let published = 0;
|
|
186
|
+
while (head.offset < bytes.length) {
|
|
187
|
+
const end = Math.min(head.offset + max, bytes.length);
|
|
188
|
+
const h = headers();
|
|
189
|
+
h.set(OFFSET_HEADER, String(end));
|
|
190
|
+
h.set(CHUNK_HEADER, String(head.chunks + 1));
|
|
191
|
+
h.set(EXPECTED_LAST_SUBJECT_SEQ, String(head.seq));
|
|
192
|
+
try {
|
|
193
|
+
const ack = await js.publish(subject, bytes.subarray(head.offset, end), { headers: h });
|
|
194
|
+
sent += end - head.offset;
|
|
195
|
+
published++;
|
|
196
|
+
head = { offset: end, chunks: head.chunks + 1, seq: ack.seq };
|
|
197
|
+
}
|
|
198
|
+
catch (e) {
|
|
199
|
+
if (!isCasLoss(e))
|
|
200
|
+
throw e;
|
|
201
|
+
head = await readChainHead(jsm, bucket, hex);
|
|
202
|
+
if (head.seq === 0)
|
|
203
|
+
return { state: "removed", sent, chunks: published };
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const record = {
|
|
207
|
+
name: `sha256:${hex}`,
|
|
208
|
+
bucket,
|
|
209
|
+
nuid: hex,
|
|
210
|
+
size: bytes.length,
|
|
211
|
+
chunks: head.chunks,
|
|
212
|
+
mtime: new Date().toISOString(),
|
|
213
|
+
deleted: false,
|
|
214
|
+
options: { max_chunk_size: max },
|
|
215
|
+
digest: `SHA-256=${paddedBase64Url(digest)}`,
|
|
216
|
+
};
|
|
217
|
+
const h = headers();
|
|
218
|
+
h.set("Nats-Rollup", "sub");
|
|
219
|
+
h.set(EXPECTED_LAST_SUBJECT_SEQ, String(meta.seq));
|
|
220
|
+
try {
|
|
221
|
+
await js.publish(transferMetaSubject(bucket, hex), JSON.stringify(record), { headers: h });
|
|
222
|
+
}
|
|
223
|
+
catch (e) {
|
|
224
|
+
if (!isCasLoss(e))
|
|
225
|
+
throw e;
|
|
226
|
+
return { state: "refused", sent, chunks: published };
|
|
227
|
+
}
|
|
228
|
+
return { state: "committed", sent, chunks: published };
|
|
229
|
+
}
|
|
230
|
+
/** Messages held on one subject, read with `STREAM.INFO` and `subjects_filter`. */
|
|
231
|
+
async function subjectCount(jsm, stream, subject) {
|
|
232
|
+
const info = await jsm.streams.info(stream, { subjects_filter: subject });
|
|
233
|
+
return info.state.subjects?.[subject] ?? 0;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Remove a transfer whole (design 4.5): the stock delete for a live record (its marker, then one
|
|
237
|
+
* filtered purge of the record's chunk subject), otherwise the purge alone of each chunk subject that
|
|
238
|
+
* holds a message: the chain's, and the one a delete marker names, whose chunks remain when a stop fell
|
|
239
|
+
* between the marker and its purge (a stock put names a random one). A transfer with neither is already
|
|
240
|
+
* removed and nothing is written, because a stock delete of a deleted record publishes another marker.
|
|
241
|
+
*/
|
|
242
|
+
export async function removeTransfer(nc, bucket, hex) {
|
|
243
|
+
const jsm = await jetstreamManager(nc);
|
|
244
|
+
const meta = await readMetaHead(jsm, bucket, hex, "stream");
|
|
245
|
+
if (meta.live) {
|
|
246
|
+
await (await new Objm(jetstream(nc)).open(bucket)).delete(`sha256:${hex}`);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const stream = objectStoreStream(bucket);
|
|
250
|
+
const marked = meta.nuid !== undefined && STOCK_NUID.test(meta.nuid) ? [`$O.${bucket}.C.${meta.nuid}`] : [];
|
|
251
|
+
for (const subject of new Set([transferChunkSubject(bucket, hex), ...marked]))
|
|
252
|
+
if ((await subjectCount(jsm, stream, subject)) > 0)
|
|
253
|
+
await jsm.streams.purge(stream, { filter: subject });
|
|
254
|
+
}
|
|
255
|
+
/** Every transfer in the bucket, listed from the stream's subjects and the last message of each. */
|
|
256
|
+
export async function listTransfers(nc, bucket) {
|
|
257
|
+
const jsm = await jetstreamManager(nc);
|
|
258
|
+
const stream = objectStoreStream(bucket);
|
|
259
|
+
const chunkPrefix = `$O.${bucket}.C.`;
|
|
260
|
+
const metaPrefix = `$O.${bucket}.M.`;
|
|
261
|
+
const info = await jsm.streams.info(stream, { subjects_filter: `$O.${bucket}.>` });
|
|
262
|
+
const last = new Map();
|
|
263
|
+
for (const subject of Object.keys(info.state.subjects ?? {})) {
|
|
264
|
+
let hex;
|
|
265
|
+
if (subject.startsWith(chunkPrefix))
|
|
266
|
+
hex = subject.slice(chunkPrefix.length);
|
|
267
|
+
else if (subject.startsWith(metaPrefix)) {
|
|
268
|
+
const name = Buffer.from(subject.slice(metaPrefix.length), "base64url").toString();
|
|
269
|
+
if (!name.startsWith("sha256:"))
|
|
270
|
+
continue;
|
|
271
|
+
hex = name.slice("sha256:".length);
|
|
272
|
+
}
|
|
273
|
+
else
|
|
274
|
+
continue;
|
|
275
|
+
if (!HEX64.test(hex))
|
|
276
|
+
continue;
|
|
277
|
+
const m = await lastOnSubject(jsm, stream, subject, "stream");
|
|
278
|
+
if (m === null)
|
|
279
|
+
continue;
|
|
280
|
+
const at = m.time;
|
|
281
|
+
const seen = last.get(hex);
|
|
282
|
+
if (!seen || at > seen)
|
|
283
|
+
last.set(hex, at);
|
|
284
|
+
}
|
|
285
|
+
return [...last].map(([hex, lastWrite]) => ({ hex, lastWrite }));
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Read a committed object with the stock `get` and check it against the requested digest. The chunk
|
|
289
|
+
* count is checked first, because the stock `get` of a record whose chunks were swept waits for them
|
|
290
|
+
* and never returns (design 4.5). The record is the writer's claim: the stock `get` recomputes the
|
|
291
|
+
* digest over what it streams, and the record's own digest must name the bytes the operator asked for.
|
|
292
|
+
*/
|
|
293
|
+
export async function fetchTransfer(nc, bucket, hex) {
|
|
294
|
+
const jsm = await jetstreamManager(nc);
|
|
295
|
+
const meta = await readMetaHead(jsm, bucket, hex, "stream");
|
|
296
|
+
if (!meta.live)
|
|
297
|
+
return { state: "absent" };
|
|
298
|
+
if (meta.nuid === undefined || !HEX64.test(meta.nuid) || meta.chunks === undefined)
|
|
299
|
+
return { state: "invalid", reason: "the record names no chunk subject or chunk count" };
|
|
300
|
+
const held = await subjectCount(jsm, objectStoreStream(bucket), `$O.${bucket}.C.${meta.nuid}`);
|
|
301
|
+
if (held !== meta.chunks)
|
|
302
|
+
return { state: "invalid", reason: `the record names ${meta.chunks} chunks and ${held} are held` };
|
|
303
|
+
let recorded;
|
|
304
|
+
try {
|
|
305
|
+
recorded = fromObjectStoreDigest(meta.digest ?? "");
|
|
306
|
+
}
|
|
307
|
+
catch (e) {
|
|
308
|
+
return { state: "invalid", reason: e.message };
|
|
309
|
+
}
|
|
310
|
+
if (recorded !== `sha256:${hex}`)
|
|
311
|
+
return { state: "invalid", reason: `the record's digest is ${recorded}` };
|
|
312
|
+
const os = await new Objm(jetstream(nc)).open(bucket);
|
|
313
|
+
try {
|
|
314
|
+
const bytes = await os.getBlob(`sha256:${hex}`);
|
|
315
|
+
if (bytes === null)
|
|
316
|
+
return { state: "absent" };
|
|
317
|
+
if (createHash("sha256").update(bytes).digest("hex") !== hex)
|
|
318
|
+
return { state: "invalid", reason: "the bytes read do not hash to the name" };
|
|
319
|
+
return { state: "fetched", bytes };
|
|
320
|
+
}
|
|
321
|
+
catch (e) {
|
|
322
|
+
return { state: "invalid", reason: e.message };
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+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