cursedbelt-server 4.48.0 → 4.49.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/server/activity/store.d.ts +1 -1
- package/dist/server/analytics/injectedScripts.d.ts +1 -1
- package/dist/server/analytics/injectedScripts.js +1 -1
- package/dist/server/analytics/webAnalytics.d.ts +1 -1
- package/dist/server/analytics/webAnalytics.js +1 -1
- package/dist/server/auth/loginThrottleDurable.d.ts +3 -3
- package/dist/server/auth/loginThrottleDurable.js +3 -3
- package/dist/server/auth/passwordCost.js +1 -1
- package/dist/server/ctgrChunkDurable.d.ts +1 -1
- package/dist/server/ctgrChunkDurable.js +1 -1
- package/dist/server/d1/backup.d.ts +1 -1
- package/dist/server/d1/backup.js +1 -1
- package/dist/server/d1/http.d.ts +2 -2
- package/dist/server/d1/http.js +2 -2
- package/dist/server/d1/invocation.js +1 -1
- package/dist/server/d1/limits.d.ts +1 -1
- package/dist/server/d1/limits.js +1 -1
- package/dist/server/d1/pullD1.d.ts +4 -1
- package/dist/server/d1/pullD1.js +5 -2
- package/dist/server/d1/scheduling.d.ts +1 -1
- package/dist/server/d1/scheduling.js +1 -1
- package/dist/server/d1/types.d.ts +1 -1
- package/dist/server/d1/types.js +1 -1
- package/dist/server/d1/values.d.ts +1 -1
- package/dist/server/d1/values.js +1 -1
- package/dist/server/dropzone/index.d.ts +1 -0
- package/dist/server/dropzone/index.js +1 -0
- package/dist/server/dropzone/report.d.ts +188 -0
- package/dist/server/dropzone/report.js +430 -0
- package/dist/server/dropzone/scan.d.ts +22 -3
- package/dist/server/dropzone/scan.js +46 -1
- package/dist/server/engagement/index.d.ts +1 -1
- package/dist/server/engagement/index.js +1 -1
- package/dist/server/guard/argon2Binding.js +1 -1
- package/dist/server/guard/kdfWorkerEntry.js +2 -2
- package/dist/server/incidents/index.d.ts +1 -1
- package/dist/server/incidents/index.js +1 -1
- package/dist/server/incidents/store.d.ts +1 -1
- package/dist/server/incidents/store.js +1 -1
- package/dist/server/jobs/timeout.d.ts +1 -1
- package/dist/server/jobs/timeout.js +1 -1
- package/dist/server/master-lock/accountsPage.d.ts +1 -1
- package/dist/server/master-lock/accountsPage.js +2 -2
- package/dist/server/master-lock/guard.js +1 -1
- package/dist/server/master-lock/lockPage.d.ts +1 -1
- package/dist/server/master-lock/lockPage.js +2 -2
- package/dist/server/master-lock/masterLock.d.ts +2 -2
- package/dist/server/master-lock/masterLock.js +2 -2
- package/dist/server/metrics/normalizeRoute.js +1 -1
- package/dist/server/metrics/telemetrySink.d.ts +2 -2
- package/dist/server/metrics/telemetrySink.js +1 -1
- package/dist/server/middleware/zValidator.js +2 -2
- package/dist/server/notifications/hub.js +1 -1
- package/dist/server/requestLog/requestMetrics.d.ts +2 -2
- package/dist/server/requestLog/requestMetrics.js +2 -2
- package/dist/server/retention/archive.d.ts +1 -1
- package/dist/server/retention/archive.js +2 -2
- package/dist/server/satellite/config.js +2 -2
- package/dist/server/satellite/door.d.ts +1 -1
- package/dist/server/sharing/contract.d.ts +1 -1
- package/dist/server/storage/binaryStore.d.ts +1 -1
- package/dist/server/storage/binaryStore.js +3 -3
- package/dist/server/storage/derivatives.d.ts +2 -2
- package/dist/server/storage/derivatives.js +2 -2
- package/dist/server/storage/files/adapter.d.ts +2 -2
- package/dist/server/storage/files/adapter.js +10 -10
- package/dist/server/storage/files/catalogue.d.ts +1 -1
- package/dist/server/storage/files/catalogue.js +4 -4
- package/dist/server/storage/files/chunkedUpload.d.ts +2 -2
- package/dist/server/storage/files/chunkedUpload.js +1 -1
- package/dist/server/storage/files/fileRoutes.d.ts +1 -1
- package/dist/server/storage/files/fileRoutes.js +4 -4
- package/dist/server/storage/files/mimeByExt.js +1 -1
- package/dist/server/storage/files/stack.d.ts +2 -2
- package/dist/server/storage/files/types.d.ts +4 -4
- package/dist/server/storage/files/types.js +1 -1
- package/dist/server/storage/index.js +1 -1
- package/dist/server/storage/objectStoreMediaStore.js +1 -1
- package/dist/server/storage/transcodeJobs.js +5 -5
- package/dist/server/storage/types.d.ts +1 -1
- package/dist/server/storage/types.js +1 -1
- package/dist/server/storage/videoDerivativeKeys.d.ts +1 -1
- package/dist/server/storage/videoDerivativeKeys.js +1 -1
- package/dist/server/storage/videoProcessor.js +1 -1
- package/dist/server/sync/status.d.ts +1 -1
- package/dist/server/zipStream.d.ts +1 -1
- package/dist/server/zipStream.js +1 -1
- package/docs/activity.md +2 -2
- package/docs/retention.md +2 -2
- package/package.json +1 -1
- package/src/leafSubpathsImportNothing.spec.ts +1 -1
- package/src/namedSubpathsResolve.spec.ts +1 -1
- package/src/noTimerDialsAPeer.spec.ts +1 -1
- package/src/nodeBuiltinsAreProbedByCalling.spec.ts +1 -1
- package/src/publishShape.spec.ts +1 -1
- package/src/server/activity/store.ts +1 -1
- package/src/server/analytics/injectedScripts.spec.ts +1 -1
- package/src/server/analytics/injectedScripts.ts +1 -1
- package/src/server/analytics/webAnalytics.ts +1 -1
- package/src/server/auth/loginThrottleDurable.ts +3 -3
- package/src/server/auth/passwordCost.ts +1 -1
- package/src/server/bench/cpuBudget.spec.ts +1 -1
- package/src/server/bench/tail.spec.ts +1 -1
- package/src/server/ctgrChunkDurable.ts +1 -1
- package/src/server/d1/backup.spec.ts +1 -1
- package/src/server/d1/backup.ts +1 -1
- package/src/server/d1/http.ts +2 -2
- package/src/server/d1/invocation.spec.ts +1 -1
- package/src/server/d1/invocation.ts +1 -1
- package/src/server/d1/limits.ts +1 -1
- package/src/server/d1/pullD1.spec.ts +9 -1
- package/src/server/d1/pullD1.ts +5 -2
- package/src/server/d1/scheduling.ts +1 -1
- package/src/server/d1/types.ts +1 -1
- package/src/server/d1/values.ts +1 -1
- package/src/server/dropzone/index.ts +8 -0
- package/src/server/dropzone/report.spec.ts +275 -0
- package/src/server/dropzone/report.ts +568 -0
- package/src/server/dropzone/scan.spec.ts +2 -2
- package/src/server/dropzone/scan.ts +68 -5
- package/src/server/engagement/engagement.spec.ts +1 -1
- package/src/server/engagement/index.ts +1 -1
- package/src/server/google-oauth/googleOAuth.spec.ts +1 -1
- package/src/server/guard/argon2Binding.ts +1 -1
- package/src/server/guard/kdfWorkerEntry.ts +2 -2
- package/src/server/incidents/index.ts +1 -1
- package/src/server/incidents/store.ts +1 -1
- package/src/server/jobs/timeout.ts +1 -1
- package/src/server/master-lock/accountsPage.spec.ts +2 -2
- package/src/server/master-lock/accountsPage.ts +2 -2
- package/src/server/master-lock/beaconNeverReachesTheWall.spec.ts +2 -2
- package/src/server/master-lock/guard.spec.ts +2 -2
- package/src/server/master-lock/guard.ts +1 -1
- package/src/server/master-lock/lockPage.spec.ts +1 -1
- package/src/server/master-lock/lockPage.ts +2 -2
- package/src/server/master-lock/masterLock.spec.ts +1 -1
- package/src/server/master-lock/masterLock.ts +2 -2
- package/src/server/master-lock/sessions.spec.ts +1 -1
- package/src/server/metrics/normalizeRoute.ts +1 -1
- package/src/server/metrics/telemetrySink.ts +3 -3
- package/src/server/middleware/bodyLimit.spec.ts +1 -1
- package/src/server/middleware/zValidator.spec.ts +3 -3
- package/src/server/middleware/zValidator.ts +3 -3
- package/src/server/notifications/hub.ts +1 -1
- package/src/server/requestLog/requestMetrics.spec.ts +2 -2
- package/src/server/requestLog/requestMetrics.ts +3 -3
- package/src/server/retention/archive.spec.ts +2 -2
- package/src/server/retention/archive.ts +2 -2
- package/src/server/satellite/config.ts +2 -2
- package/src/server/satellite/door.ts +1 -1
- package/src/server/satellite/satellite.spec.ts +1 -1
- package/src/server/sharing/contract.ts +1 -1
- package/src/server/storage/binaryServerProcessing.spec.ts +1 -1
- package/src/server/storage/binaryServerProcessing.ts +4 -4
- package/src/server/storage/binaryStore.spec.ts +6 -6
- package/src/server/storage/binaryStore.ts +4 -4
- package/src/server/storage/chunked.integration.spec.ts +2 -2
- package/src/server/storage/derivatives.ts +2 -2
- package/src/server/storage/fileUploadClient.integration.spec.ts +1 -1
- package/src/server/storage/files/adapter.photo.spec.ts +2 -2
- package/src/server/storage/files/adapter.spec.ts +3 -3
- package/src/server/storage/files/adapter.ts +10 -10
- package/src/server/storage/files/catalogue.spec.ts +1 -1
- package/src/server/storage/files/catalogue.ts +4 -4
- package/src/server/storage/files/chunkedUpload.spec.ts +5 -5
- package/src/server/storage/files/chunkedUpload.ts +3 -3
- package/src/server/storage/files/fileRoutes.spec.ts +3 -3
- package/src/server/storage/files/fileRoutes.ts +5 -5
- package/src/server/storage/files/mimeByExt.ts +1 -1
- package/src/server/storage/files/stack.ts +3 -3
- package/src/server/storage/files/types.ts +6 -6
- package/src/server/storage/index.ts +1 -1
- package/src/server/storage/objectStoreMediaStore.ts +1 -1
- package/src/server/storage/sources.ts +1 -1
- package/src/server/storage/transcodeJobs.ts +5 -5
- package/src/server/storage/types.ts +2 -2
- package/src/server/storage/uploadSession.spec.ts +1 -1
- package/src/server/storage/videoDerivativeKeys.spec.ts +3 -3
- package/src/server/storage/videoDerivativeKeys.ts +1 -1
- package/src/server/storage/videoProcessor.ts +1 -1
- package/src/server/sync/status.ts +1 -1
- package/src/server/sync/timer.spec.ts +1 -1
- package/src/server/worker-argon2/index.spec.ts +1 -1
- package/src/server/zipStream.spec.ts +2 -2
- package/src/server/zipStream.ts +1 -1
- package/src/shippedFilesAreTracked.spec.ts +2 -2
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
import type { Dirent } from "node:fs";
|
|
36
36
|
import { readdir, rm, rmdir, stat } from "node:fs/promises";
|
|
37
37
|
import { join, relative } from "node:path";
|
|
38
|
+
import type { IngestReporter, ReportFile, ReportResult } from "./report.js";
|
|
38
39
|
|
|
39
40
|
/** A file the sweep found, with everything a handler needs to decide about it. */
|
|
40
41
|
export interface DroppedFile {
|
|
@@ -89,7 +90,7 @@ export interface ScanOptions {
|
|
|
89
90
|
*
|
|
90
91
|
* 🔴 Load-bearing for sidecar art, and it cannot be done later. A folder's `cover.jpg` is
|
|
91
92
|
* only reachable while the directory still exists, and filing the audio out of it removes
|
|
92
|
-
* the
|
|
93
|
+
* the neighbors — by the time anything else could look, they are gone. Capturing on the
|
|
93
94
|
* walk also costs one `readdir` per directory instead of one per file, which on a 6,000
|
|
94
95
|
* track library is the difference between seconds and minutes.
|
|
95
96
|
*/
|
|
@@ -246,8 +247,34 @@ export async function pruneEmptyDirs(root: string, dir = root): Promise<number>
|
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
249
|
|
|
249
|
-
/**
|
|
250
|
-
|
|
250
|
+
/**
|
|
251
|
+
* What the app supplies: what to do with one file. `uploading(key)` names the binary-server key its
|
|
252
|
+
* bytes stage under, once the handler knows it — station's Uploads page shows that transfer's own
|
|
253
|
+
* progress on the file's row.
|
|
254
|
+
*/
|
|
255
|
+
export type DropHandler = (file: DroppedFile, ctx: { uploading(key: string): void }) => Promise<DropOutcome>;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* A sweep's outcome in the words station's Uploads page reads (`report.ts`) — `null` for `held`, which
|
|
259
|
+
* is a standing state rather than an event: the file stays where it is and every sweep meets it
|
|
260
|
+
* again, so it is shown as left alone (`skipped`) instead of journaled every five minutes.
|
|
261
|
+
*/
|
|
262
|
+
export function reportResultOf(outcome: DropOutcome): ReportResult | null {
|
|
263
|
+
const detail = outcome.detail ? { detail: outcome.detail } : {};
|
|
264
|
+
switch (outcome.kind) {
|
|
265
|
+
case "stored":
|
|
266
|
+
return { outcome: "added", ...detail };
|
|
267
|
+
case "duplicate":
|
|
268
|
+
return { outcome: "duplicate", ...detail };
|
|
269
|
+
// Refused by the app's own rule (a format it does not take) — not filed, and not a failure.
|
|
270
|
+
case "discard":
|
|
271
|
+
return { outcome: "blocked", detail: outcome.detail ?? "not something this app files" };
|
|
272
|
+
case "held":
|
|
273
|
+
return null;
|
|
274
|
+
case "failed":
|
|
275
|
+
return { outcome: "failed", detail: outcome.detail };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
251
278
|
|
|
252
279
|
/**
|
|
253
280
|
* Walk a dropzone, hand every file to `handle`, and leave nothing behind that was dealt with.
|
|
@@ -259,8 +286,35 @@ export type DropHandler = (file: DroppedFile) => Promise<DropOutcome>;
|
|
|
259
286
|
export async function sweepDropzone(
|
|
260
287
|
root: string,
|
|
261
288
|
handle: DropHandler,
|
|
262
|
-
opts: ScanOptions & {
|
|
289
|
+
opts: ScanOptions & {
|
|
290
|
+
dryRun?: boolean;
|
|
291
|
+
onProgress?: (done: number, total: number) => void;
|
|
292
|
+
/**
|
|
293
|
+
* Write what the sweep is doing for station's Uploads page (`createIngestReporter`). The dropzone
|
|
294
|
+
* is ONE account, id `""`: each top-level folder is a source, loose files one more. Never on a
|
|
295
|
+
* dry run, which files nothing. Every hook is guarded — a reporter fault never costs a file.
|
|
296
|
+
*/
|
|
297
|
+
report?: IngestReporter;
|
|
298
|
+
} = {},
|
|
299
|
+
): Promise<SweepReport> {
|
|
300
|
+
const reporter = opts.dryRun ? undefined : opts.report;
|
|
301
|
+
try {
|
|
302
|
+
const report = await sweep(root, handle, opts, reporter);
|
|
303
|
+
reporter?.finish();
|
|
304
|
+
return report;
|
|
305
|
+
} catch (error) {
|
|
306
|
+
reporter?.finish(error instanceof Error ? error.message : String(error));
|
|
307
|
+
throw error;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
async function sweep(
|
|
312
|
+
root: string,
|
|
313
|
+
handle: DropHandler,
|
|
314
|
+
opts: ScanOptions & { dryRun?: boolean; onProgress?: (done: number, total: number) => void },
|
|
315
|
+
reporter: IngestReporter | undefined,
|
|
263
316
|
): Promise<SweepReport> {
|
|
317
|
+
const as = (file: DroppedFile): ReportFile => ({ accountId: "", path: file.path, relativePath: file.relativePath, size: file.size });
|
|
264
318
|
const report: SweepReport = {
|
|
265
319
|
scanned: 0,
|
|
266
320
|
stored: 0,
|
|
@@ -274,19 +328,25 @@ export async function sweepDropzone(
|
|
|
274
328
|
remaining: 0,
|
|
275
329
|
};
|
|
276
330
|
|
|
331
|
+
reporter?.walking();
|
|
277
332
|
const files = await scanDropzone(root, opts);
|
|
333
|
+
reporter?.found(files.map(as));
|
|
278
334
|
for (const [index, file] of files.entries()) {
|
|
279
335
|
report.scanned++;
|
|
280
336
|
opts.onProgress?.(index + 1, files.length);
|
|
281
337
|
|
|
282
338
|
if (!(await isStable(file, opts.stabilityMs))) {
|
|
283
339
|
report.unstable.push(file.relativePath);
|
|
340
|
+
reporter?.progress.waiting(as(file), "copying");
|
|
284
341
|
continue;
|
|
285
342
|
}
|
|
286
343
|
|
|
287
344
|
let outcome: DropOutcome;
|
|
345
|
+
reporter?.progress.uploading(as(file), "");
|
|
288
346
|
try {
|
|
289
|
-
outcome = opts.dryRun
|
|
347
|
+
outcome = opts.dryRun
|
|
348
|
+
? { kind: "held", detail: "dry run" }
|
|
349
|
+
: await handle(file, { uploading: (key) => reporter?.progress.uploading(as(file), key) });
|
|
290
350
|
} catch (error) {
|
|
291
351
|
// Rule 3: a handler that throws costs one file, never the sweep.
|
|
292
352
|
outcome = {
|
|
@@ -295,6 +355,9 @@ export async function sweepDropzone(
|
|
|
295
355
|
};
|
|
296
356
|
}
|
|
297
357
|
|
|
358
|
+
const result = reportResultOf(outcome);
|
|
359
|
+
if (result) reporter?.result(as(file), result);
|
|
360
|
+
else reporter?.progress.waiting(as(file), "skipped");
|
|
298
361
|
switch (outcome.kind) {
|
|
299
362
|
case "stored":
|
|
300
363
|
case "duplicate":
|
|
@@ -443,7 +443,7 @@ describe("the data directory is the APP's answer, and no answer means OFF", () =
|
|
|
443
443
|
expect(verdict).toEqual({ enabled: true, dbPath: "/data/family/engagement.sqlite", reason: null });
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
test("an assigned APP_DATA_DIR is
|
|
446
|
+
test("an assigned APP_DATA_DIR is honored with no resolver at all", () => {
|
|
447
447
|
const verdict = readEngagementEnv("family", { ...live, APP_DATA_DIR: "/srv/family" });
|
|
448
448
|
expect(verdict.dbPath).toBe("/srv/family/engagement.sqlite");
|
|
449
449
|
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `policy.ts` holds the three privacy rules that make it safe to run USER-KEYED analytics
|
|
8
8
|
* inside private household apps, and four copies of a privacy promise is four promises, with
|
|
9
9
|
* nothing keeping them the same — three of the twelve files had already forked (in `music`,
|
|
10
|
-
* doc comments only; the
|
|
10
|
+
* doc comments only; the behavior was identical in all four, so the plurality's text is what
|
|
11
11
|
* came across). The browser half — the beacon — is React and lives in the design system's tier;
|
|
12
12
|
* it depends on nothing here but the wire shape `POST <mount>/view {place}`.
|
|
13
13
|
*
|
|
@@ -243,7 +243,7 @@ describe('buildConsentUrl', () => {
|
|
|
243
243
|
expect(u.searchParams.get('prompt')).toBe('consent');
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
-
test('an explicit prompt is
|
|
246
|
+
test('an explicit prompt is honored', () => {
|
|
247
247
|
expect(url({ prompt: 'select_account' }).searchParams.get('prompt')).toBe('select_account');
|
|
248
248
|
});
|
|
249
249
|
|
|
@@ -114,7 +114,7 @@ export const argon2idDeriverFrom = (binding: RawArgon2idBinding): Argon2idDerive
|
|
|
114
114
|
// 0x10 and 0x13 ARE the Argon2 version identifiers: the spec, the reference
|
|
115
115
|
// implementation and every envelope on disk write them in hex. Biome's autofix
|
|
116
116
|
// rewrites them as 16 and 19 — the same map and a worse one, because nobody
|
|
117
|
-
// reading an `$argon2id$v=19$` record would
|
|
117
|
+
// reading an `$argon2id$v=19$` record would recognize the decimal.
|
|
118
118
|
// biome-ignore lint/complexity/useSimpleNumberKeys: see above — hex IS the spec's spelling
|
|
119
119
|
const NODE_RS_VERSION: Readonly<Record<number, number>> = { 0x10: 0, 0x13: 1 };
|
|
120
120
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The SHIPPED KDF worker entry (05 §B6).
|
|
3
3
|
*
|
|
4
|
-
* Unlike a
|
|
5
|
-
* because every
|
|
4
|
+
* Unlike a marshaling worker — where every marshaler declares its own entry
|
|
5
|
+
* because every marshaler has its own schema — there is exactly ONE password
|
|
6
6
|
* KDF in the platform (Law #7), so there is exactly one entry and the framework
|
|
7
7
|
* ships it. A host does not write this file; it points
|
|
8
8
|
* `createKdfWorkerPasswordVerifier({ entry: kdfWorkerEntryUrl() })` at it.
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* something is new.
|
|
30
30
|
* - {@link runIncidentSweep} — runs checks; a check that THROWS resolves
|
|
31
31
|
* nothing, so a broken detector can never announce that an outage is over.
|
|
32
|
-
* - channels — in-app (the fleet's existing notification
|
|
32
|
+
* - channels — in-app (the fleet's existing notification center), email, and a
|
|
33
33
|
* text message from this Mac that reads `chat.db` back to prove it left.
|
|
34
34
|
* - {@link createIncidentNotifier} — composes the three-sentence message and
|
|
35
35
|
* sends it on OPEN, on ESCALATE and on RESOLVE. Never on an observation.
|
|
@@ -89,7 +89,7 @@ const toIncident = (r: Row): Incident => ({
|
|
|
89
89
|
* bytes free, items failed, commits behind — and a string slipping in there is
|
|
90
90
|
* how a file name reaches an SMS. See the header of `types.ts`.
|
|
91
91
|
*
|
|
92
|
-
* It throws rather than
|
|
92
|
+
* It throws rather than sanitizing, because a detector author meets the failure
|
|
93
93
|
* in their own test run, which is the only moment the mistake is cheap.
|
|
94
94
|
*/
|
|
95
95
|
export function assertNoContent(report: IncidentReport): void {
|
|
@@ -21,7 +21,7 @@ export class JobTimeoutError extends Error {
|
|
|
21
21
|
* Resolve/reject with `promise`, but reject with a {@link JobTimeoutError} if it
|
|
22
22
|
* has not settled within `timeoutMs`. `onTimeout` fires on timeout — the runner
|
|
23
23
|
* uses it to abort the handler's context signal so a cooperative handler can
|
|
24
|
-
* short-circuit (a pending promise cannot be force-
|
|
24
|
+
* short-circuit (a pending promise cannot be force-canceled).
|
|
25
25
|
*
|
|
26
26
|
* Order matters: the timeout promise is rejected BEFORE `onTimeout` runs. Aborting
|
|
27
27
|
* the signal can synchronously resolve a cooperative handler; if that resolution
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 🔴 The accounts page, and the one bug it exists to make impossible.
|
|
3
3
|
*
|
|
4
4
|
* `cursedbelt@2.5.1`'s React dialog minted a FRESH `kdf` salt on every rotation. Every
|
|
5
|
-
* account on an app derives under one shared descriptor, so
|
|
5
|
+
* account on an app derives under one shared descriptor, so honoring that salt stores a
|
|
6
6
|
* verifier hash nothing can match — the owner sets a new password, the rotation logs him
|
|
7
7
|
* out, and neither the old nor the new one opens the app. The server refuses that shape with
|
|
8
8
|
* `409 stale-client`; this page is what replaces the client that sent it.
|
|
@@ -104,7 +104,7 @@ describe("🔴 the rotation this page performs cannot be the one that locked the
|
|
|
104
104
|
|
|
105
105
|
test("and the shape it replaced is still refused, distinguishably", async () => {
|
|
106
106
|
// The 409 stays. This page is why nothing sends that shape any more — not a reason to
|
|
107
|
-
// start
|
|
107
|
+
// start honoring it, which would be the lockout itself.
|
|
108
108
|
const { guard } = build();
|
|
109
109
|
const cookie = await open(guard);
|
|
110
110
|
const res = await guard.handle(
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ── Why it is here and not in the app ───────────────────────────────────────
|
|
5
5
|
* `cursedbelt@2.5.1`'s React `MasterLockMenuItems` dialog minted a FRESH `kdf` salt on every
|
|
6
6
|
* rotation, which is what the wire looked like before accounts existed. Every account on an
|
|
7
|
-
* app now derives under ONE shared descriptor, so
|
|
7
|
+
* app now derives under ONE shared descriptor, so honoring that salt would store a verifier
|
|
8
8
|
* hash nothing could ever match: the owner sets a new password, the rotation logs him out,
|
|
9
9
|
* and neither the old nor the new one opens the app. `guard.ts` therefore answers that shape
|
|
10
10
|
* `409 {"error":"stale-client"}`. That is the safe failure; this page is the fix.
|
|
@@ -62,7 +62,7 @@ export { MASTER_LOCK_MIN_PASSWORD_LENGTH } from "./lockPage.js";
|
|
|
62
62
|
* The document.
|
|
63
63
|
*
|
|
64
64
|
* It links the LOCK's stylesheet first and its own second, so the two pages share one set of
|
|
65
|
-
*
|
|
65
|
+
* color tokens and a change to the palette cannot land on only one of them.
|
|
66
66
|
*/
|
|
67
67
|
export function accountsPageHtml(options: LockPageOptions): string {
|
|
68
68
|
const label = escapeHtml(options.appLabel);
|
|
@@ -188,7 +188,7 @@ describe("the CSP keeps the beacon out by construction", () => {
|
|
|
188
188
|
|
|
189
189
|
describe("the other half — a public shell that carries it", () => {
|
|
190
190
|
/**
|
|
191
|
-
* The shell an app ships: inline
|
|
191
|
+
* The shell an app ships: inline color-scheme bootstrap, its own bundle, and the beacon.
|
|
192
192
|
* An app asserts this about ITS OWN `index.html` (rule 3 — a repo's gate proves that repo);
|
|
193
193
|
* what this package owes it is a helper pair that cannot disagree with the wall's.
|
|
194
194
|
*/
|
|
@@ -197,7 +197,7 @@ describe("the other half — a public shell that carries it", () => {
|
|
|
197
197
|
${WEB_ANALYTICS_TAG}
|
|
198
198
|
</head><body><div id="root"></div><script type="module" src="/src/main.tsx"></script></body></html>`;
|
|
199
199
|
|
|
200
|
-
test("the helper
|
|
200
|
+
test("the helper recognizes the tag, and says no when it is missing", () => {
|
|
201
201
|
expect(htmlCarriesWebAnalytics(SHELL)).toBe(true);
|
|
202
202
|
expect(htmlCarriesWebAnalytics(SHELL.replace(WEB_ANALYTICS_TAG, ""))).toBe(false);
|
|
203
203
|
});
|
|
@@ -156,9 +156,9 @@ describe("while locked", () => {
|
|
|
156
156
|
expect(JSON.stringify(body)).not.toContain("argon2");
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
test("🔴 a rotation carrying a STALE kdf is refused, not silently
|
|
159
|
+
test("🔴 a rotation carrying a STALE kdf is refused, not silently honored", async () => {
|
|
160
160
|
// The pre-accounts wire minted a fresh salt on every rotation. Every account now
|
|
161
|
-
// derives under one shared descriptor, so
|
|
161
|
+
// derives under one shared descriptor, so honoring that would store a verifier hash
|
|
162
162
|
// nothing can ever match — the owner sets a new password, the rotation logs him out,
|
|
163
163
|
// and neither the old nor the new one opens the app. `409 stale-client` is the one
|
|
164
164
|
// refusal here that is deliberately distinguishable from a wrong password.
|
|
@@ -304,7 +304,7 @@ export function createMasterLockGuard(options: MasterLockGuardOptions): MasterLo
|
|
|
304
304
|
* owner would set a new password, be logged out by the rotation, and find that
|
|
305
305
|
* neither the old nor the new one opens the app.
|
|
306
306
|
*
|
|
307
|
-
* There is no safe way to
|
|
307
|
+
* There is no safe way to honor it either, since every account on this app shares
|
|
308
308
|
* one descriptor. So it is refused, loudly, with the one thing that distinguishes
|
|
309
309
|
* it from a wrong password.
|
|
310
310
|
*/
|
|
@@ -113,7 +113,7 @@ describe("🔴 every password field on the wall can be shown and hidden (task 07
|
|
|
113
113
|
expect(inputs.length).toBeGreaterThan(0);
|
|
114
114
|
expect((html.match(/data-reveal/g) ?? []).length).toBe(inputs.length);
|
|
115
115
|
for (const input of inputs) expect(input).toMatch(/autocomplete="(current|new)-password"/);
|
|
116
|
-
// …and still no inline script: the
|
|
116
|
+
// …and still no inline script: the behavior ships in the same-origin file.
|
|
117
117
|
expect(html).not.toMatch(/<script(?![^>]*\bsrc=)[^>]*>/);
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -192,7 +192,7 @@ button.quiet[disabled]{opacity:.5}
|
|
|
192
192
|
*
|
|
193
193
|
* Markup: {@link withRevealToggles} wraps each `type="password"` input in `.secret` with a
|
|
194
194
|
* `<button type="button" data-reveal>` after it — the inputs keep every attribute, `autocomplete`
|
|
195
|
-
* included, so a password manager still sees a password field.
|
|
195
|
+
* included, so a password manager still sees a password field. Behavior:
|
|
196
196
|
* {@link MASTER_LOCK_REVEAL_SOURCE}, interpolated into BOTH same-origin scripts, because the wall's
|
|
197
197
|
* CSP is `script-src 'self'` and allows no inline script (`MASTER_LOCK_CSP`, pinned by
|
|
198
198
|
* `beaconNeverReachesTheWall.spec.ts`). Nothing about the CSP changes for this.
|
|
@@ -216,7 +216,7 @@ export function withRevealToggles(html: string): string {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
|
-
* The toggle's
|
|
219
|
+
* The toggle's behavior, as browser source. It flips the input BEFORE it to `text` and back,
|
|
220
220
|
* keeps `aria-pressed`/`aria-label` true to what is on screen, and returns every field to
|
|
221
221
|
* `password` when its form submits — so a manager saving the credential sees a password field.
|
|
222
222
|
* Publishes itself on `globalThis`, the seam `lockPage.spec.ts` drives it through.
|
|
@@ -135,7 +135,7 @@ describe("unlock", () => {
|
|
|
135
135
|
expect(locked).toEqual([false]);
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
test("the minted token is what `presents`
|
|
138
|
+
test("the minted token is what `presents` recognizes, and nothing else is", async () => {
|
|
139
139
|
const { lock } = build();
|
|
140
140
|
const result = await lock.unlock(VERIFIER);
|
|
141
141
|
if (!result.ok) throw new Error("expected an unlock");
|
|
@@ -414,7 +414,7 @@ export class MasterLock {
|
|
|
414
414
|
*
|
|
415
415
|
* `null` means "no live unlock is presented here", which is the only thing that may
|
|
416
416
|
* ever refuse a request. It deliberately does not fall back to {@link unlocked}: that
|
|
417
|
-
* reads "somebody's device is open", and
|
|
417
|
+
* reads "somebody's device is open", and honoring it would make the unlock AMBIENT —
|
|
418
418
|
* a second browser signed in as the owner would walk through having typed nothing, and
|
|
419
419
|
* would then be served whichever tenant happened to be open. While an app had one
|
|
420
420
|
* password that was merely sloppy; with several it hands the wrong library to the
|
|
@@ -482,7 +482,7 @@ export class MasterLock {
|
|
|
482
482
|
* answer's latency says nothing the answer itself does not.
|
|
483
483
|
*
|
|
484
484
|
* 🔴 **Every account is tried, and the loop does not stop at the first match.**
|
|
485
|
-
* Stopping early is the obvious
|
|
485
|
+
* Stopping early is the obvious optimization and it is a timing oracle: a password
|
|
486
486
|
* matching the first account would answer in one argon2id and a wrong one in N, so the
|
|
487
487
|
* shape of the reply would say how many tenants exist and roughly where in the list
|
|
488
488
|
* this one sits. The cost is bounded by how many passwords the owner has made — single
|
|
@@ -74,7 +74,7 @@ function world() {
|
|
|
74
74
|
return { lock, settle: () => writes.settle() };
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
/** Does a brand-new request, after everything settled,
|
|
77
|
+
/** Does a brand-new request, after everything settled, honor this token? */
|
|
78
78
|
async function opens(token: string): Promise<boolean> {
|
|
79
79
|
const { lock } = await request();
|
|
80
80
|
return lock.presents(req(token));
|
|
@@ -5,7 +5,7 @@ import type { Context } from 'hono';
|
|
|
5
5
|
* (e.g. `/api/v1/notes/:id`). The method is tracked separately.
|
|
6
6
|
*
|
|
7
7
|
* Two wrinkles, same as the old Express normalizer:
|
|
8
|
-
* 1. ctgr GET-
|
|
8
|
+
* 1. ctgr GET-tunneled mutations match the `/ctgr<xx>` twin route — we map them
|
|
9
9
|
* back to the real verb + path so a POST and its ctgr twin aggregate together.
|
|
10
10
|
* 2. Unmatched requests (404s, static, the SPA fallback) have no matched route
|
|
11
11
|
* pattern, so we collapse dynamic-looking segments to avoid unbounded
|
|
@@ -27,7 +27,7 @@ import { createMetricsBuffer, type MetricRow, type MetricsBuffer } from './metri
|
|
|
27
27
|
* run concurrently in many datacentres, so a `/metrics` scrape reaches ONE
|
|
28
28
|
* arbitrary isolate holding a random fraction of the counters. The in-process
|
|
29
29
|
* registry has nowhere to live. (A Durable Object does have a durable identity
|
|
30
|
-
* *and* memory, and is the real `prom-client`
|
|
30
|
+
* *and* memory, and is the real `prom-client` analog — but it is a whole
|
|
31
31
|
* stateful object to operate for counters Analytics Engine already aggregates.
|
|
32
32
|
* Prometheus itself also needs an always-on host to scrape FROM, and that host
|
|
33
33
|
* is the Mac this fleet is trying to switch off.)
|
|
@@ -46,7 +46,7 @@ import { createMetricsBuffer, type MetricRow, type MetricsBuffer } from './metri
|
|
|
46
46
|
* Worker supplies the real binding at runtime).
|
|
47
47
|
*
|
|
48
48
|
* Platform limits, which {@link toDataPoint} respects:
|
|
49
|
-
* **1** index of ≤96 bytes, ≤**20** blobs
|
|
49
|
+
* **1** index of ≤96 bytes, ≤**20** blobs totaling ≤5120 bytes, ≤**20** doubles.
|
|
50
50
|
*/
|
|
51
51
|
export interface AnalyticsEngineDataset {
|
|
52
52
|
writeDataPoint(point: {
|
|
@@ -124,7 +124,7 @@ function truncateUtf8(value: string, maxBytes: number): string {
|
|
|
124
124
|
const encoded = new TextEncoder().encode(value);
|
|
125
125
|
if (encoded.length <= maxBytes) return value;
|
|
126
126
|
return new TextDecoder('utf-8', { fatal: false }).decode(encoded.subarray(0, maxBytes)).replace(
|
|
127
|
-
// A cut through a multi-byte sequence decodes to U+FFFD; drop that trailing
|
|
127
|
+
// A cut through a multi-byte sequence decodes to U+FFFD; drop that trailing artifact.
|
|
128
128
|
/�+$/,
|
|
129
129
|
'',
|
|
130
130
|
);
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
* `apps/roms/src/server/limits.test.ts` is where this came from (2026-09-17). Most of
|
|
17
17
|
* that file is about roms' own `routes.ts` — that every bounded-body call site takes its
|
|
18
18
|
* ceiling from `MAX_BODY_BYTES` — and stays there, because it asserts about an app's
|
|
19
|
-
* routes. What travels with the module is its two
|
|
19
|
+
* routes. What travels with the module is its two behavioral tests (an honest oversized
|
|
20
20
|
* declaration is refused with both numbers in the message; a body with no declared length
|
|
21
21
|
* is NOT refused on that ground alone), extended here to the three readers the app-side
|
|
22
22
|
* file never exercised.
|
|
@@ -190,7 +190,7 @@ describe('zValidator — ctgr GET-tunnel integration (the protection-critical pa
|
|
|
190
190
|
return app;
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
-
test('a
|
|
193
|
+
test('a tunneled POST validates the decoded body (not the empty GET body)', async () => {
|
|
194
194
|
const enc = await encodeRequest('POST', '/notes', { body: 'hi' });
|
|
195
195
|
const res = await makeApp().fetch(new Request(ORIGIN + enc.chunks[0].url));
|
|
196
196
|
expect(res.status).toBe(200);
|
|
@@ -198,7 +198,7 @@ describe('zValidator — ctgr GET-tunnel integration (the protection-critical pa
|
|
|
198
198
|
expect(await res.json()).toEqual({ ok: true, body: { body: 'hi', pinned: false } });
|
|
199
199
|
});
|
|
200
200
|
|
|
201
|
-
test('a
|
|
201
|
+
test('a tunneled POST with an invalid decoded body returns the 400 envelope', async () => {
|
|
202
202
|
const enc = await encodeRequest('POST', '/notes', { body: 123 });
|
|
203
203
|
const res = await makeApp().fetch(new Request(ORIGIN + enc.chunks[0].url));
|
|
204
204
|
expect(res.status).toBe(400);
|
|
@@ -207,7 +207,7 @@ describe('zValidator — ctgr GET-tunnel integration (the protection-critical pa
|
|
|
207
207
|
expect(env.error.context?.issues?.[0].path).toBe('body');
|
|
208
208
|
});
|
|
209
209
|
|
|
210
|
-
test('the direct (non-
|
|
210
|
+
test('the direct (non-tunneled) verb route still validates the live body', async () => {
|
|
211
211
|
const res = await makeApp().fetch(json('/notes', { body: 'direct' }));
|
|
212
212
|
expect(res.status).toBe(200);
|
|
213
213
|
expect(await res.json()).toEqual({ ok: true, body: { body: 'direct', pinned: false } });
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* The raw request that reaches this middleware is a *GET with no body*, so reading
|
|
16
16
|
* `c.req.json()` would validate `undefined` and every tunneled call would 400.
|
|
17
17
|
* We therefore read the ctgr-decoded body first and fall back to the live request
|
|
18
|
-
* only for direct (non-
|
|
18
|
+
* only for direct (non-tunneled) calls. This is exactly why a route must use
|
|
19
19
|
* `zValidator` and never the raw `@hono/zod-validator`.
|
|
20
20
|
* 2. **The canonical envelope.** `@hono/zod-validator`'s default failure body is its
|
|
21
21
|
* own shape; cursedbelt maps every zod issue to a `ValidationIssue` under
|
|
@@ -37,8 +37,8 @@ export type ZValidatorTarget = 'json' | 'form' | 'query' | 'param';
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Read the value a target validates against. The body targets (`json`/`form`) prefer
|
|
40
|
-
* the ctgr-decoded body so a
|
|
41
|
-
* URL-bound targets (`query`/`param`) are never
|
|
40
|
+
* the ctgr-decoded body so a tunneled mutation validates its real payload; the
|
|
41
|
+
* URL-bound targets (`query`/`param`) are never tunneled (GETs go direct) and read
|
|
42
42
|
* from the live request. A query object collapses single-valued keys to a string so
|
|
43
43
|
* `z.string()`/`z.coerce.number()` field schemas see a scalar (repeated keys stay an
|
|
44
44
|
* array) — matching Hono's own validator semantics.
|
|
@@ -91,7 +91,7 @@ export function createNotificationHub(options: NotificationHubOptions = {}): Not
|
|
|
91
91
|
const set = listeners.get(userId);
|
|
92
92
|
if (!set) return;
|
|
93
93
|
// Snapshot: a listener may unsubscribe itself while being called (a
|
|
94
|
-
// stream that has just been
|
|
94
|
+
// stream that has just been canceled does exactly that).
|
|
95
95
|
for (const listener of [...set]) {
|
|
96
96
|
try {
|
|
97
97
|
listener(event);
|
|
@@ -94,7 +94,7 @@ describe("the check: a request through a real app lands a row", () => {
|
|
|
94
94
|
expect(rows()).toEqual([]);
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
test("it sees every route: a
|
|
97
|
+
test("it sees every route: a parameterized route by its PATTERN, and a miss", async () => {
|
|
98
98
|
const metrics = track(openRequestMetrics(dir));
|
|
99
99
|
const app = appOver(metrics, (a) => a.get("/api/v1/thing/:id", (c) => c.json({ ok: true })));
|
|
100
100
|
await app.fetch(new Request("http://app.test/api/v1/thing/42"));
|
|
@@ -261,7 +261,7 @@ describe("0002_request_place — where a request came from, never its address (t
|
|
|
261
261
|
expect(names).toEqual(expect.arrayContaining(["region", "city"]));
|
|
262
262
|
});
|
|
263
263
|
|
|
264
|
-
test("the default places a
|
|
264
|
+
test("the default places a tunneled request by its cf-ipcountry header; a direct one is unplaced", async () => {
|
|
265
265
|
const m = track(openRequestMetrics(dir));
|
|
266
266
|
const app = appOver(m);
|
|
267
267
|
await app.fetch(new Request("http://app.test/healthz", { headers: { "cf-ipcountry": "CA" } }));
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ── Why it is here (4.21.0) ─────────────────────────────────────────────────
|
|
7
7
|
* `apps/family` and `apps/roms` held this module byte-identically (task 265's rollout), and
|
|
8
8
|
* `check-copies` counted it as five copy groups. The API, the header marker and the migration name
|
|
9
|
-
* are exactly the apps' — a live corpus is
|
|
9
|
+
* are exactly the apps' — a live corpus is recognized by `METRICS_APPLICATION_ID` and by the
|
|
10
10
|
* `0001_request_metrics` row in its migrations table, so changing either would make every
|
|
11
11
|
* existing `metrics.sqlite` look inherited and archive it. Bun-only (`bun:sqlite`, `node:fs`): under
|
|
12
12
|
* Node the export map routes this subpath to `_bunOnly.js`, the way `./engagement` does; it is NOT
|
|
@@ -138,7 +138,7 @@ const sizeOf = (path: string): number => (existsSync(path) ? statSync(path).size
|
|
|
138
138
|
export function retireInheritedCorpus(dir: string): string | null {
|
|
139
139
|
const live = join(dir, METRICS_DB);
|
|
140
140
|
if (!existsSync(live)) return null;
|
|
141
|
-
// An empty file with no journal holds nothing — SQLite simply
|
|
141
|
+
// An empty file with no journal holds nothing — SQLite simply initializes it.
|
|
142
142
|
if (sizeOf(live) === 0 && SIDECARS.every((s) => sizeOf(live + s) === 0)) return null;
|
|
143
143
|
if (headerApplicationId(live) === METRICS_APPLICATION_ID) return null;
|
|
144
144
|
|
|
@@ -182,7 +182,7 @@ export interface RequestMetricsOptions {
|
|
|
182
182
|
/**
|
|
183
183
|
* Place each request (`{ country, region?, city? }` or `null`) — never an address; the raw IP
|
|
184
184
|
* is not stored. Default: the edge's own answer, `locateFromCloudflare` (the `cf-ipcountry`
|
|
185
|
-
* header every
|
|
185
|
+
* header every tunneled request carries). station passes its DB-IP reader here.
|
|
186
186
|
*/
|
|
187
187
|
locate?: RequestLocator;
|
|
188
188
|
}
|
|
@@ -46,7 +46,7 @@ describe("createJsonlArchive", () => {
|
|
|
46
46
|
]);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
test("every segment is
|
|
49
|
+
test("every segment is cataloged in an APPEND-only index, and verifyArchive re-proves them", () => {
|
|
50
50
|
const dir = tmp();
|
|
51
51
|
const sink = createJsonlArchive({ app: "notes", resource: "sync-history", home: home(dir) });
|
|
52
52
|
sink.write([{ seq: 1 }], AT);
|
|
@@ -125,7 +125,7 @@ describe("pendingBytes — the staleness signal a deployed box can actually obse
|
|
|
125
125
|
expect(sink.pendingBytes()).toBe(second.bytes);
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
test("the
|
|
128
|
+
test("the catalog is not counted as pending — it is not history, it is the list", () => {
|
|
129
129
|
const dir = tmp();
|
|
130
130
|
const sink = createJsonlArchive({ app: "notes", resource: "sync-history", home: home(dir, false) });
|
|
131
131
|
const only = sink.write([{ seq: 1 }], AT);
|
|
@@ -190,7 +190,7 @@ export interface JsonlArchiveOptions {
|
|
|
190
190
|
* The index is what makes the archive answerable without reading gigabytes —
|
|
191
191
|
* "what is in here, how many rows, and does it still hash the same" — and it is
|
|
192
192
|
* appended rather than rewritten so a crash mid-write can cost at most the last
|
|
193
|
-
* line, never the
|
|
193
|
+
* line, never the catalog.
|
|
194
194
|
*/
|
|
195
195
|
export function createJsonlArchive(options: JsonlArchiveOptions): ArchiveSink {
|
|
196
196
|
const { app, resource } = options;
|
|
@@ -292,7 +292,7 @@ export function createJsonlArchive(options: JsonlArchiveOptions): ArchiveSink {
|
|
|
292
292
|
`${JSON.stringify({ app, resource, ...segment, path: undefined, file })}\n`,
|
|
293
293
|
);
|
|
294
294
|
} catch {
|
|
295
|
-
// The
|
|
295
|
+
// The catalog is a convenience; the segment is the archive. A failed
|
|
296
296
|
// index append must never make a sealed segment look unsealed and send
|
|
297
297
|
// the same rows through again.
|
|
298
298
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* ## Why, since 4.19.0 (task 281)
|
|
8
8
|
*
|
|
9
9
|
* Measured 2026-09-23: nine `appConfig.ts` copies in five versions, plus `appData.ts`,
|
|
10
|
-
* `stageIdentity.ts` and `runtimeMode.ts`
|
|
10
|
+
* `stageIdentity.ts` and `runtimeMode.ts` traveling with them. The file's whole job is
|
|
11
11
|
* `productionBlockers` + `assertUsable`, and the versions differed in exactly that job:
|
|
12
12
|
*
|
|
13
13
|
* · lineage B (`flix`, `station`, `patterns`) threw a plain `Error` — a misconfigured boot
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* The union of the protections is what is here. What an app still owns is its identity: its own
|
|
24
24
|
* fields, its `stakes` sentence, and its own blockers, passed as `extra` — never a fork of this.
|
|
25
25
|
*
|
|
26
|
-
* ## The one
|
|
26
|
+
* ## The one behavior that is STRICTER than every copy
|
|
27
27
|
*
|
|
28
28
|
* The refusal fires when the instance is `live` — a release OR a production build — where lineage
|
|
29
29
|
* A asked only "is this a production build". Every `scripts/service.ts` sets
|
|
@@ -139,7 +139,7 @@ export function parseEmailList(raw: string | undefined): string[] {
|
|
|
139
139
|
export interface DoorConfig {
|
|
140
140
|
/** A release — {@link isRelease}. */
|
|
141
141
|
deployed: boolean;
|
|
142
|
-
/** This instance's own origin, when known. A stage is
|
|
142
|
+
/** This instance's own origin, when known. A stage is recognized by it. */
|
|
143
143
|
publicUrl?: string;
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -55,7 +55,7 @@ describe('isRelease — one question, one variable', () => {
|
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
describe('who the door opens for', () => {
|
|
58
|
-
it('a stage is
|
|
58
|
+
it('a stage is recognized by its own hostname, never by a flag', () => {
|
|
59
59
|
expect(isStageOrigin('https://vault-stage.cursedalchemy.com')).toBe(true);
|
|
60
60
|
expect(isStageOrigin('https://vault.cursedalchemy.com')).toBe(false);
|
|
61
61
|
expect(isStageOrigin('not a url')).toBe(false);
|
|
@@ -100,7 +100,7 @@ export type Awaitable<T> = T | Promise<T>;
|
|
|
100
100
|
/**
|
|
101
101
|
* Either store, as a consumer that works over both sees it: every method's result is
|
|
102
102
|
* {@link Awaitable}. `mountShareRoutes` takes this, and awaits every call — awaiting a
|
|
103
|
-
* synchronous value is a no-op, so the sync store's
|
|
103
|
+
* synchronous value is a no-op, so the sync store's behavior through it is unchanged.
|
|
104
104
|
*/
|
|
105
105
|
export type AwaitableShareStore = {
|
|
106
106
|
readonly [K in keyof AsyncShareStore]: AsyncShareStore[K] extends (...args: infer A) => Promise<infer R>
|
|
@@ -83,7 +83,7 @@ describe('createBinaryServerProcessing — video', () => {
|
|
|
83
83
|
expect(bs.submissions[0]?.posterOnly).toBe(true);
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
test('a failed job maps to status failed (never throws into the
|
|
86
|
+
test('a failed job maps to status failed (never throws into the catalog)', async () => {
|
|
87
87
|
const bs = fakeBs({ fail: true });
|
|
88
88
|
const { videoProcessor } = createBinaryServerProcessing(cfg(bs.fetchImpl));
|
|
89
89
|
const res = await videoProcessor({
|