@orkestrel/capture 0.0.9 → 0.0.11
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/README.md +4 -2
- package/dist/src/core/index.cjs +77 -24
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +124 -51
- package/dist/src/core/index.d.ts +124 -51
- package/dist/src/core/index.js +76 -25
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +1026 -330
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +523 -22
- package/dist/src/server/index.d.ts +523 -22
- package/dist/src/server/index.js +1005 -333
- package/dist/src/server/index.js.map +1 -1
- package/package.json +8 -8
|
@@ -99,7 +99,9 @@ export declare const CAPTURE_ERROR_BRAND: unique symbol;
|
|
|
99
99
|
* `USAGE` is a refused command line and exits 64; every other condition exits 1. `SELECTION`
|
|
100
100
|
* names a selector, variant, case, state, or portfolio the host does not declare. `HOST` names a
|
|
101
101
|
* wrapper, configuration, or declaration fault. `STAGE` names a runner stage that did not
|
|
102
|
-
* complete. `EVIDENCE` names a record, report,
|
|
102
|
+
* complete. `EVIDENCE` names a record, report, journal, or manifest that fails its protocol, and a
|
|
103
|
+
* document of another version. `REGISTRY` names an accepted registry that is absent, fails
|
|
104
|
+
* authentication, or lags the declarations. `LOOKUP` names a state lookup that is absent or stale.
|
|
103
105
|
* `CONTAINMENT` names a path that leaves the authorized roots.
|
|
104
106
|
*
|
|
105
107
|
* @example
|
|
@@ -107,7 +109,7 @@ export declare const CAPTURE_ERROR_BRAND: unique symbol;
|
|
|
107
109
|
* CAPTURE_ERROR_CODES.includes('USAGE') // true
|
|
108
110
|
* ```
|
|
109
111
|
*/
|
|
110
|
-
export declare const CAPTURE_ERROR_CODES: readonly ["USAGE", "SELECTION", "HOST", "STAGE", "EVIDENCE", "CONTAINMENT"];
|
|
112
|
+
export declare const CAPTURE_ERROR_CODES: readonly ["USAGE", "SELECTION", "HOST", "STAGE", "EVIDENCE", "REGISTRY", "LOOKUP", "CONTAINMENT"];
|
|
111
113
|
|
|
112
114
|
/**
|
|
113
115
|
* Names the default lookup journal file inside a portfolio directory.
|
|
@@ -188,10 +190,10 @@ export declare const CAPTURE_STATUS_PRECEDENCE: readonly ["duplicate", "orphan",
|
|
|
188
190
|
*
|
|
189
191
|
* @example
|
|
190
192
|
* ```ts
|
|
191
|
-
* CAPTURE_VERSION //
|
|
193
|
+
* CAPTURE_VERSION // 2
|
|
192
194
|
* ```
|
|
193
195
|
*/
|
|
194
|
-
export declare const CAPTURE_VERSION =
|
|
196
|
+
export declare const CAPTURE_VERSION = 2;
|
|
195
197
|
|
|
196
198
|
/**
|
|
197
199
|
* Names the journey artifact a final case wrote and the SHA-256 of its bytes.
|
|
@@ -382,6 +384,20 @@ export declare interface CaptureDigest {
|
|
|
382
384
|
readonly digest: string;
|
|
383
385
|
}
|
|
384
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Names a digest's file map by the key a document's population table stores it under.
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* ```ts
|
|
392
|
+
* const shared: CaptureDigestReference = { patterns: ['src/core/**'], files: key, digest }
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
export declare interface CaptureDigestReference {
|
|
396
|
+
readonly patterns: readonly string[];
|
|
397
|
+
readonly files: string;
|
|
398
|
+
readonly digest: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
385
401
|
/**
|
|
386
402
|
* Records an emitted destination and its producing case duration.
|
|
387
403
|
*
|
|
@@ -460,6 +476,21 @@ export declare interface CaptureErrorOptions {
|
|
|
460
476
|
readonly cause?: unknown;
|
|
461
477
|
}
|
|
462
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Extends the image manifest with independently authenticated collection evidence.
|
|
481
|
+
*
|
|
482
|
+
* @remarks Absence means no collection attestation; historical lookups supply none implicitly.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* ```ts
|
|
486
|
+
* const manifest = readCaptureManifest(JSON.parse(text), file)
|
|
487
|
+
* manifest.collections // readonly receipts or undefined
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
export declare interface CaptureExpandedManifest extends CaptureManifest {
|
|
491
|
+
readonly collections?: readonly CaptureCollectionReceipt[];
|
|
492
|
+
}
|
|
493
|
+
|
|
463
494
|
/**
|
|
464
495
|
* Reports a frame's freshness classification and every supporting reason.
|
|
465
496
|
*
|
|
@@ -529,20 +560,20 @@ export declare interface CaptureLookup {
|
|
|
529
560
|
*
|
|
530
561
|
* @remarks
|
|
531
562
|
* A successful capture merges the journal and changes the manifest digest, retiring this journal
|
|
532
|
-
* logically without a second filesystem mutation in the capture transaction. The `
|
|
533
|
-
* stores each distinct path-to-hash map under its digest; every lookup names that digest in
|
|
534
|
-
* `inputs` field.
|
|
563
|
+
* logically without a second filesystem mutation in the capture transaction. The `populations`
|
|
564
|
+
* table stores each distinct path-to-hash map under its digest; every lookup names that digest in
|
|
565
|
+
* its `inputs` field.
|
|
535
566
|
*
|
|
536
567
|
* @example
|
|
537
568
|
* ```ts
|
|
538
|
-
* const journal: CaptureLookupJournal = { version:
|
|
569
|
+
* const journal: CaptureLookupJournal = { version: 2, populations: {}, lookups: [] }
|
|
539
570
|
* ```
|
|
540
571
|
*/
|
|
541
572
|
export declare interface CaptureLookupJournal {
|
|
542
573
|
readonly collections?: readonly CaptureCollectionReceipt[];
|
|
543
|
-
readonly version:
|
|
574
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
544
575
|
readonly manifest?: string;
|
|
545
|
-
readonly
|
|
576
|
+
readonly populations: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
546
577
|
readonly lookups: ReadonlyArray<Omit<CaptureLookup, 'inputs'> & {
|
|
547
578
|
readonly inputs: string;
|
|
548
579
|
}>;
|
|
@@ -553,17 +584,45 @@ export declare interface CaptureLookupJournal {
|
|
|
553
584
|
*
|
|
554
585
|
* @example
|
|
555
586
|
* ```ts
|
|
556
|
-
* const manifest:
|
|
557
|
-
*
|
|
587
|
+
* const manifest: CaptureManifest = readCaptureManifest(JSON.parse(text), file)
|
|
588
|
+
* Object.keys(manifest.entries) // stamped image keys
|
|
558
589
|
* ```
|
|
559
590
|
*/
|
|
560
591
|
export declare interface CaptureManifest {
|
|
561
|
-
readonly version:
|
|
592
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
562
593
|
readonly registry: CaptureRegistry;
|
|
563
594
|
readonly entries: Readonly<Record<string, CaptureStamp>>;
|
|
564
595
|
readonly lookups: readonly CaptureLookup[];
|
|
565
596
|
}
|
|
566
597
|
|
|
598
|
+
/**
|
|
599
|
+
* Stores a manifest with each distinct file map once, in a table keyed by the map's digest.
|
|
600
|
+
*
|
|
601
|
+
* @remarks
|
|
602
|
+
* Each `populations` key is the digest from `buildCaptureDigest([], files)` over the path-to-hash
|
|
603
|
+
* map it stores. Each stamp's `shared.files`, each lookup's `inputs`, and each collection receipt's
|
|
604
|
+
* `inputs.files` names a key in that table. The expanded `CaptureExpandedManifest` carries every
|
|
605
|
+
* map in place.
|
|
606
|
+
*
|
|
607
|
+
* @example
|
|
608
|
+
* ```ts
|
|
609
|
+
* const document: unknown = JSON.parse(text)
|
|
610
|
+
* if (isCaptureManifestDocument(document)) Object.keys(document.populations) // distinct map digests
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
export declare interface CaptureManifestDocument {
|
|
614
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
615
|
+
readonly populations: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
616
|
+
readonly registry: CaptureRegistry;
|
|
617
|
+
readonly entries: Readonly<Record<string, Omit<CaptureStamp, 'shared'> & {
|
|
618
|
+
readonly shared: CaptureDigestReference;
|
|
619
|
+
}>>;
|
|
620
|
+
readonly lookups: CaptureLookupJournal['lookups'];
|
|
621
|
+
readonly collections?: ReadonlyArray<Omit<CaptureCollectionReceipt, 'inputs'> & {
|
|
622
|
+
readonly inputs: CaptureDigestReference;
|
|
623
|
+
}>;
|
|
624
|
+
}
|
|
625
|
+
|
|
567
626
|
/**
|
|
568
627
|
* Maps the states one portfolio writes to its output variant and physical root.
|
|
569
628
|
*
|
|
@@ -678,7 +737,7 @@ export declare interface CaptureProvided {
|
|
|
678
737
|
* ```
|
|
679
738
|
*/
|
|
680
739
|
export declare interface CaptureReceipt {
|
|
681
|
-
readonly version:
|
|
740
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
682
741
|
readonly variant: string;
|
|
683
742
|
readonly time: string;
|
|
684
743
|
readonly report: {
|
|
@@ -701,7 +760,7 @@ export declare interface CaptureReceipt {
|
|
|
701
760
|
* ```
|
|
702
761
|
*/
|
|
703
762
|
export declare interface CaptureRegistry {
|
|
704
|
-
readonly version:
|
|
763
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
705
764
|
readonly receipts: readonly CaptureReceipt[];
|
|
706
765
|
readonly entries: readonly CaptureDestination[];
|
|
707
766
|
readonly digest: string;
|
|
@@ -737,7 +796,7 @@ export declare interface CaptureReport {
|
|
|
737
796
|
* ```
|
|
738
797
|
*/
|
|
739
798
|
export declare interface CaptureRequest extends CaptureSelection, CaptureIdentity {
|
|
740
|
-
readonly version:
|
|
799
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
741
800
|
readonly command: 'journey' | 'capture';
|
|
742
801
|
readonly mode?: string;
|
|
743
802
|
readonly variants: readonly string[];
|
|
@@ -772,7 +831,7 @@ export declare interface CaptureRules {
|
|
|
772
831
|
* ```
|
|
773
832
|
*/
|
|
774
833
|
export declare interface CaptureRun {
|
|
775
|
-
readonly version:
|
|
834
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
776
835
|
readonly identity?: CaptureIdentity;
|
|
777
836
|
readonly request?: CaptureRequest;
|
|
778
837
|
readonly variant: string;
|
|
@@ -892,21 +951,6 @@ export declare interface CaptureStamp extends CaptureEntry {
|
|
|
892
951
|
*/
|
|
893
952
|
export declare type CaptureStatus = 'current' | (typeof CAPTURE_STATUS_PRECEDENCE)[number];
|
|
894
953
|
|
|
895
|
-
/**
|
|
896
|
-
* Extends the image manifest with independently authenticated collection evidence.
|
|
897
|
-
*
|
|
898
|
-
* @remarks Absence means no collection attestation; historical lookups supply none implicitly.
|
|
899
|
-
*
|
|
900
|
-
* @example
|
|
901
|
-
* ```ts
|
|
902
|
-
* const manifest: unknown = JSON.parse(text)
|
|
903
|
-
* if (isCaptureStoredManifest(manifest)) manifest.collections // readonly receipts or undefined
|
|
904
|
-
* ```
|
|
905
|
-
*/
|
|
906
|
-
export declare interface CaptureStoredManifest extends CaptureManifest {
|
|
907
|
-
readonly collections?: readonly CaptureCollectionReceipt[];
|
|
908
|
-
}
|
|
909
|
-
|
|
910
954
|
/**
|
|
911
955
|
* Mirrors the members of a Vitest file, suite, or test task that case collection reads.
|
|
912
956
|
*
|
|
@@ -1231,6 +1275,20 @@ export declare function isCaptureDestination(value: unknown): value is CaptureDe
|
|
|
1231
1275
|
*/
|
|
1232
1276
|
export declare function isCaptureDigest(value: unknown): value is CaptureDigest;
|
|
1233
1277
|
|
|
1278
|
+
/**
|
|
1279
|
+
* Checks whether a digest names its file map by a table key beside its patterns and combined digest.
|
|
1280
|
+
*
|
|
1281
|
+
* @param value - The stored digest reference
|
|
1282
|
+
* @returns True if the patterns are valid and both digests are SHA-256 hexadecimal; false otherwise
|
|
1283
|
+
*
|
|
1284
|
+
* @example
|
|
1285
|
+
* ```ts
|
|
1286
|
+
* isCaptureDigestReference({ patterns: ['src/**'], files: 'a'.repeat(64), digest: 'b'.repeat(64) }) // true
|
|
1287
|
+
* isCaptureDigestReference({ patterns: ['src/**'], files: {}, digest: 'b'.repeat(64) }) // false
|
|
1288
|
+
* ```
|
|
1289
|
+
*/
|
|
1290
|
+
export declare function isCaptureDigestReference(value: unknown): value is CaptureDigestReference;
|
|
1291
|
+
|
|
1234
1292
|
/**
|
|
1235
1293
|
* Checks whether an emitted entry includes a finite nonnegative case duration.
|
|
1236
1294
|
*
|
|
@@ -1266,6 +1324,20 @@ export declare function isCaptureEntry(value: unknown): value is CaptureEntry;
|
|
|
1266
1324
|
*/
|
|
1267
1325
|
export declare function isCaptureError(value: unknown): value is CaptureError;
|
|
1268
1326
|
|
|
1327
|
+
/**
|
|
1328
|
+
* Checks whether an expanded manifest and its optional collection receipts have the supported schema.
|
|
1329
|
+
*
|
|
1330
|
+
* @param value - The expanded manifest
|
|
1331
|
+
* @returns True if the manifest and any collection receipts are valid; false otherwise
|
|
1332
|
+
*
|
|
1333
|
+
* @example
|
|
1334
|
+
* ```ts
|
|
1335
|
+
* isCaptureExpandedManifest(readCaptureManifest(JSON.parse(text), file)) // true with or without collections
|
|
1336
|
+
* isCaptureExpandedManifest(null) // false
|
|
1337
|
+
* ```
|
|
1338
|
+
*/
|
|
1339
|
+
export declare function isCaptureExpandedManifest(value: unknown): value is CaptureExpandedManifest;
|
|
1340
|
+
|
|
1269
1341
|
/**
|
|
1270
1342
|
* Checks the host's declared viewport without deriving geometry from an output name.
|
|
1271
1343
|
*
|
|
@@ -1345,26 +1417,41 @@ export declare function isCaptureLookup(value: unknown): value is CaptureLookup;
|
|
|
1345
1417
|
*
|
|
1346
1418
|
* @example
|
|
1347
1419
|
* ```ts
|
|
1348
|
-
* isCaptureLookupJournal({ version:
|
|
1349
|
-
* isCaptureLookupJournal({ version:
|
|
1420
|
+
* isCaptureLookupJournal({ version: 2, populations: {}, lookups: [] }) // true
|
|
1421
|
+
* isCaptureLookupJournal({ version: 1, populations: {}, lookups: [] }) // false
|
|
1350
1422
|
* ```
|
|
1351
1423
|
*/
|
|
1352
1424
|
export declare function isCaptureLookupJournal(value: unknown): value is CaptureLookupJournal;
|
|
1353
1425
|
|
|
1354
1426
|
/**
|
|
1355
|
-
* Checks whether an
|
|
1427
|
+
* Checks whether an expanded manifest has the supported schema without discarding malformed rows.
|
|
1356
1428
|
*
|
|
1357
1429
|
* @param value - The manifest
|
|
1358
1430
|
* @returns True if every inherited member validates; false otherwise
|
|
1359
1431
|
*
|
|
1360
1432
|
* @example
|
|
1361
1433
|
* ```ts
|
|
1362
|
-
* isCaptureManifest(JSON.parse(text)) // true for
|
|
1434
|
+
* isCaptureManifest(readCaptureManifest(JSON.parse(text), file)) // true for an expanded manifest.json
|
|
1363
1435
|
* isCaptureManifest('manifest') // false
|
|
1364
1436
|
* ```
|
|
1365
1437
|
*/
|
|
1366
1438
|
export declare function isCaptureManifest(value: unknown): value is CaptureManifest;
|
|
1367
1439
|
|
|
1440
|
+
/**
|
|
1441
|
+
* Checks whether a stored manifest holds its population table and every member that names a table key.
|
|
1442
|
+
*
|
|
1443
|
+
* @param value - The decoded manifest file
|
|
1444
|
+
* @returns True if the version, table, registry, stamps, lookups, and collections are valid; false otherwise
|
|
1445
|
+
* @remarks Table digests and reference existence are verified when the document is read.
|
|
1446
|
+
*
|
|
1447
|
+
* @example
|
|
1448
|
+
* ```ts
|
|
1449
|
+
* isCaptureManifestDocument(JSON.parse(text)) // true for a written manifest.json
|
|
1450
|
+
* isCaptureManifestDocument({ version: 1, populations: {}, entries: {}, lookups: [] }) // false
|
|
1451
|
+
* ```
|
|
1452
|
+
*/
|
|
1453
|
+
export declare function isCaptureManifestDocument(value: unknown): value is CaptureManifestDocument;
|
|
1454
|
+
|
|
1368
1455
|
/**
|
|
1369
1456
|
* Checks whether a serialized path stays within the portable relative-path vocabulary.
|
|
1370
1457
|
*
|
|
@@ -1430,7 +1517,7 @@ export declare function isCaptureRegistry(value: unknown): value is CaptureRegis
|
|
|
1430
1517
|
* @example
|
|
1431
1518
|
* ```ts
|
|
1432
1519
|
* isCaptureRequest(JSON.parse(text)) // true for a well-formed runner request
|
|
1433
|
-
* isCaptureRequest({ version:
|
|
1520
|
+
* isCaptureRequest({ version: 1 }) // false
|
|
1434
1521
|
* ```
|
|
1435
1522
|
*/
|
|
1436
1523
|
export declare function isCaptureRequest(value: unknown): value is CaptureRequest;
|
|
@@ -1505,20 +1592,6 @@ export declare function isCaptureSources(value: unknown): value is CaptureSource
|
|
|
1505
1592
|
*/
|
|
1506
1593
|
export declare function isCaptureStamp(value: unknown): value is CaptureStamp;
|
|
1507
1594
|
|
|
1508
|
-
/**
|
|
1509
|
-
* Checks optional collection metadata without upgrading historical image evidence.
|
|
1510
|
-
*
|
|
1511
|
-
* @param value - The inherited image transaction
|
|
1512
|
-
* @returns True if its existing manifest and any collection receipts are valid; false otherwise
|
|
1513
|
-
*
|
|
1514
|
-
* @example
|
|
1515
|
-
* ```ts
|
|
1516
|
-
* isCaptureStoredManifest(JSON.parse(text)) // true for a manifest with or without collections
|
|
1517
|
-
* isCaptureStoredManifest(null) // false
|
|
1518
|
-
* ```
|
|
1519
|
-
*/
|
|
1520
|
-
export declare function isCaptureStoredManifest(value: unknown): value is CaptureStoredManifest;
|
|
1521
|
-
|
|
1522
1595
|
/**
|
|
1523
1596
|
* Compares complete populations without erasing duplicates.
|
|
1524
1597
|
*
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -99,7 +99,9 @@ export declare const CAPTURE_ERROR_BRAND: unique symbol;
|
|
|
99
99
|
* `USAGE` is a refused command line and exits 64; every other condition exits 1. `SELECTION`
|
|
100
100
|
* names a selector, variant, case, state, or portfolio the host does not declare. `HOST` names a
|
|
101
101
|
* wrapper, configuration, or declaration fault. `STAGE` names a runner stage that did not
|
|
102
|
-
* complete. `EVIDENCE` names a record, report,
|
|
102
|
+
* complete. `EVIDENCE` names a record, report, journal, or manifest that fails its protocol, and a
|
|
103
|
+
* document of another version. `REGISTRY` names an accepted registry that is absent, fails
|
|
104
|
+
* authentication, or lags the declarations. `LOOKUP` names a state lookup that is absent or stale.
|
|
103
105
|
* `CONTAINMENT` names a path that leaves the authorized roots.
|
|
104
106
|
*
|
|
105
107
|
* @example
|
|
@@ -107,7 +109,7 @@ export declare const CAPTURE_ERROR_BRAND: unique symbol;
|
|
|
107
109
|
* CAPTURE_ERROR_CODES.includes('USAGE') // true
|
|
108
110
|
* ```
|
|
109
111
|
*/
|
|
110
|
-
export declare const CAPTURE_ERROR_CODES: readonly ["USAGE", "SELECTION", "HOST", "STAGE", "EVIDENCE", "CONTAINMENT"];
|
|
112
|
+
export declare const CAPTURE_ERROR_CODES: readonly ["USAGE", "SELECTION", "HOST", "STAGE", "EVIDENCE", "REGISTRY", "LOOKUP", "CONTAINMENT"];
|
|
111
113
|
|
|
112
114
|
/**
|
|
113
115
|
* Names the default lookup journal file inside a portfolio directory.
|
|
@@ -188,10 +190,10 @@ export declare const CAPTURE_STATUS_PRECEDENCE: readonly ["duplicate", "orphan",
|
|
|
188
190
|
*
|
|
189
191
|
* @example
|
|
190
192
|
* ```ts
|
|
191
|
-
* CAPTURE_VERSION //
|
|
193
|
+
* CAPTURE_VERSION // 2
|
|
192
194
|
* ```
|
|
193
195
|
*/
|
|
194
|
-
export declare const CAPTURE_VERSION =
|
|
196
|
+
export declare const CAPTURE_VERSION = 2;
|
|
195
197
|
|
|
196
198
|
/**
|
|
197
199
|
* Names the journey artifact a final case wrote and the SHA-256 of its bytes.
|
|
@@ -382,6 +384,20 @@ export declare interface CaptureDigest {
|
|
|
382
384
|
readonly digest: string;
|
|
383
385
|
}
|
|
384
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Names a digest's file map by the key a document's population table stores it under.
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* ```ts
|
|
392
|
+
* const shared: CaptureDigestReference = { patterns: ['src/core/**'], files: key, digest }
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
export declare interface CaptureDigestReference {
|
|
396
|
+
readonly patterns: readonly string[];
|
|
397
|
+
readonly files: string;
|
|
398
|
+
readonly digest: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
385
401
|
/**
|
|
386
402
|
* Records an emitted destination and its producing case duration.
|
|
387
403
|
*
|
|
@@ -460,6 +476,21 @@ export declare interface CaptureErrorOptions {
|
|
|
460
476
|
readonly cause?: unknown;
|
|
461
477
|
}
|
|
462
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Extends the image manifest with independently authenticated collection evidence.
|
|
481
|
+
*
|
|
482
|
+
* @remarks Absence means no collection attestation; historical lookups supply none implicitly.
|
|
483
|
+
*
|
|
484
|
+
* @example
|
|
485
|
+
* ```ts
|
|
486
|
+
* const manifest = readCaptureManifest(JSON.parse(text), file)
|
|
487
|
+
* manifest.collections // readonly receipts or undefined
|
|
488
|
+
* ```
|
|
489
|
+
*/
|
|
490
|
+
export declare interface CaptureExpandedManifest extends CaptureManifest {
|
|
491
|
+
readonly collections?: readonly CaptureCollectionReceipt[];
|
|
492
|
+
}
|
|
493
|
+
|
|
463
494
|
/**
|
|
464
495
|
* Reports a frame's freshness classification and every supporting reason.
|
|
465
496
|
*
|
|
@@ -529,20 +560,20 @@ export declare interface CaptureLookup {
|
|
|
529
560
|
*
|
|
530
561
|
* @remarks
|
|
531
562
|
* A successful capture merges the journal and changes the manifest digest, retiring this journal
|
|
532
|
-
* logically without a second filesystem mutation in the capture transaction. The `
|
|
533
|
-
* stores each distinct path-to-hash map under its digest; every lookup names that digest in
|
|
534
|
-
* `inputs` field.
|
|
563
|
+
* logically without a second filesystem mutation in the capture transaction. The `populations`
|
|
564
|
+
* table stores each distinct path-to-hash map under its digest; every lookup names that digest in
|
|
565
|
+
* its `inputs` field.
|
|
535
566
|
*
|
|
536
567
|
* @example
|
|
537
568
|
* ```ts
|
|
538
|
-
* const journal: CaptureLookupJournal = { version:
|
|
569
|
+
* const journal: CaptureLookupJournal = { version: 2, populations: {}, lookups: [] }
|
|
539
570
|
* ```
|
|
540
571
|
*/
|
|
541
572
|
export declare interface CaptureLookupJournal {
|
|
542
573
|
readonly collections?: readonly CaptureCollectionReceipt[];
|
|
543
|
-
readonly version:
|
|
574
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
544
575
|
readonly manifest?: string;
|
|
545
|
-
readonly
|
|
576
|
+
readonly populations: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
546
577
|
readonly lookups: ReadonlyArray<Omit<CaptureLookup, 'inputs'> & {
|
|
547
578
|
readonly inputs: string;
|
|
548
579
|
}>;
|
|
@@ -553,17 +584,45 @@ export declare interface CaptureLookupJournal {
|
|
|
553
584
|
*
|
|
554
585
|
* @example
|
|
555
586
|
* ```ts
|
|
556
|
-
* const manifest:
|
|
557
|
-
*
|
|
587
|
+
* const manifest: CaptureManifest = readCaptureManifest(JSON.parse(text), file)
|
|
588
|
+
* Object.keys(manifest.entries) // stamped image keys
|
|
558
589
|
* ```
|
|
559
590
|
*/
|
|
560
591
|
export declare interface CaptureManifest {
|
|
561
|
-
readonly version:
|
|
592
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
562
593
|
readonly registry: CaptureRegistry;
|
|
563
594
|
readonly entries: Readonly<Record<string, CaptureStamp>>;
|
|
564
595
|
readonly lookups: readonly CaptureLookup[];
|
|
565
596
|
}
|
|
566
597
|
|
|
598
|
+
/**
|
|
599
|
+
* Stores a manifest with each distinct file map once, in a table keyed by the map's digest.
|
|
600
|
+
*
|
|
601
|
+
* @remarks
|
|
602
|
+
* Each `populations` key is the digest from `buildCaptureDigest([], files)` over the path-to-hash
|
|
603
|
+
* map it stores. Each stamp's `shared.files`, each lookup's `inputs`, and each collection receipt's
|
|
604
|
+
* `inputs.files` names a key in that table. The expanded `CaptureExpandedManifest` carries every
|
|
605
|
+
* map in place.
|
|
606
|
+
*
|
|
607
|
+
* @example
|
|
608
|
+
* ```ts
|
|
609
|
+
* const document: unknown = JSON.parse(text)
|
|
610
|
+
* if (isCaptureManifestDocument(document)) Object.keys(document.populations) // distinct map digests
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
export declare interface CaptureManifestDocument {
|
|
614
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
615
|
+
readonly populations: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
616
|
+
readonly registry: CaptureRegistry;
|
|
617
|
+
readonly entries: Readonly<Record<string, Omit<CaptureStamp, 'shared'> & {
|
|
618
|
+
readonly shared: CaptureDigestReference;
|
|
619
|
+
}>>;
|
|
620
|
+
readonly lookups: CaptureLookupJournal['lookups'];
|
|
621
|
+
readonly collections?: ReadonlyArray<Omit<CaptureCollectionReceipt, 'inputs'> & {
|
|
622
|
+
readonly inputs: CaptureDigestReference;
|
|
623
|
+
}>;
|
|
624
|
+
}
|
|
625
|
+
|
|
567
626
|
/**
|
|
568
627
|
* Maps the states one portfolio writes to its output variant and physical root.
|
|
569
628
|
*
|
|
@@ -678,7 +737,7 @@ export declare interface CaptureProvided {
|
|
|
678
737
|
* ```
|
|
679
738
|
*/
|
|
680
739
|
export declare interface CaptureReceipt {
|
|
681
|
-
readonly version:
|
|
740
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
682
741
|
readonly variant: string;
|
|
683
742
|
readonly time: string;
|
|
684
743
|
readonly report: {
|
|
@@ -701,7 +760,7 @@ export declare interface CaptureReceipt {
|
|
|
701
760
|
* ```
|
|
702
761
|
*/
|
|
703
762
|
export declare interface CaptureRegistry {
|
|
704
|
-
readonly version:
|
|
763
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
705
764
|
readonly receipts: readonly CaptureReceipt[];
|
|
706
765
|
readonly entries: readonly CaptureDestination[];
|
|
707
766
|
readonly digest: string;
|
|
@@ -737,7 +796,7 @@ export declare interface CaptureReport {
|
|
|
737
796
|
* ```
|
|
738
797
|
*/
|
|
739
798
|
export declare interface CaptureRequest extends CaptureSelection, CaptureIdentity {
|
|
740
|
-
readonly version:
|
|
799
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
741
800
|
readonly command: 'journey' | 'capture';
|
|
742
801
|
readonly mode?: string;
|
|
743
802
|
readonly variants: readonly string[];
|
|
@@ -772,7 +831,7 @@ export declare interface CaptureRules {
|
|
|
772
831
|
* ```
|
|
773
832
|
*/
|
|
774
833
|
export declare interface CaptureRun {
|
|
775
|
-
readonly version:
|
|
834
|
+
readonly version: typeof CAPTURE_VERSION;
|
|
776
835
|
readonly identity?: CaptureIdentity;
|
|
777
836
|
readonly request?: CaptureRequest;
|
|
778
837
|
readonly variant: string;
|
|
@@ -892,21 +951,6 @@ export declare interface CaptureStamp extends CaptureEntry {
|
|
|
892
951
|
*/
|
|
893
952
|
export declare type CaptureStatus = 'current' | (typeof CAPTURE_STATUS_PRECEDENCE)[number];
|
|
894
953
|
|
|
895
|
-
/**
|
|
896
|
-
* Extends the image manifest with independently authenticated collection evidence.
|
|
897
|
-
*
|
|
898
|
-
* @remarks Absence means no collection attestation; historical lookups supply none implicitly.
|
|
899
|
-
*
|
|
900
|
-
* @example
|
|
901
|
-
* ```ts
|
|
902
|
-
* const manifest: unknown = JSON.parse(text)
|
|
903
|
-
* if (isCaptureStoredManifest(manifest)) manifest.collections // readonly receipts or undefined
|
|
904
|
-
* ```
|
|
905
|
-
*/
|
|
906
|
-
export declare interface CaptureStoredManifest extends CaptureManifest {
|
|
907
|
-
readonly collections?: readonly CaptureCollectionReceipt[];
|
|
908
|
-
}
|
|
909
|
-
|
|
910
954
|
/**
|
|
911
955
|
* Mirrors the members of a Vitest file, suite, or test task that case collection reads.
|
|
912
956
|
*
|
|
@@ -1231,6 +1275,20 @@ export declare function isCaptureDestination(value: unknown): value is CaptureDe
|
|
|
1231
1275
|
*/
|
|
1232
1276
|
export declare function isCaptureDigest(value: unknown): value is CaptureDigest;
|
|
1233
1277
|
|
|
1278
|
+
/**
|
|
1279
|
+
* Checks whether a digest names its file map by a table key beside its patterns and combined digest.
|
|
1280
|
+
*
|
|
1281
|
+
* @param value - The stored digest reference
|
|
1282
|
+
* @returns True if the patterns are valid and both digests are SHA-256 hexadecimal; false otherwise
|
|
1283
|
+
*
|
|
1284
|
+
* @example
|
|
1285
|
+
* ```ts
|
|
1286
|
+
* isCaptureDigestReference({ patterns: ['src/**'], files: 'a'.repeat(64), digest: 'b'.repeat(64) }) // true
|
|
1287
|
+
* isCaptureDigestReference({ patterns: ['src/**'], files: {}, digest: 'b'.repeat(64) }) // false
|
|
1288
|
+
* ```
|
|
1289
|
+
*/
|
|
1290
|
+
export declare function isCaptureDigestReference(value: unknown): value is CaptureDigestReference;
|
|
1291
|
+
|
|
1234
1292
|
/**
|
|
1235
1293
|
* Checks whether an emitted entry includes a finite nonnegative case duration.
|
|
1236
1294
|
*
|
|
@@ -1266,6 +1324,20 @@ export declare function isCaptureEntry(value: unknown): value is CaptureEntry;
|
|
|
1266
1324
|
*/
|
|
1267
1325
|
export declare function isCaptureError(value: unknown): value is CaptureError;
|
|
1268
1326
|
|
|
1327
|
+
/**
|
|
1328
|
+
* Checks whether an expanded manifest and its optional collection receipts have the supported schema.
|
|
1329
|
+
*
|
|
1330
|
+
* @param value - The expanded manifest
|
|
1331
|
+
* @returns True if the manifest and any collection receipts are valid; false otherwise
|
|
1332
|
+
*
|
|
1333
|
+
* @example
|
|
1334
|
+
* ```ts
|
|
1335
|
+
* isCaptureExpandedManifest(readCaptureManifest(JSON.parse(text), file)) // true with or without collections
|
|
1336
|
+
* isCaptureExpandedManifest(null) // false
|
|
1337
|
+
* ```
|
|
1338
|
+
*/
|
|
1339
|
+
export declare function isCaptureExpandedManifest(value: unknown): value is CaptureExpandedManifest;
|
|
1340
|
+
|
|
1269
1341
|
/**
|
|
1270
1342
|
* Checks the host's declared viewport without deriving geometry from an output name.
|
|
1271
1343
|
*
|
|
@@ -1345,26 +1417,41 @@ export declare function isCaptureLookup(value: unknown): value is CaptureLookup;
|
|
|
1345
1417
|
*
|
|
1346
1418
|
* @example
|
|
1347
1419
|
* ```ts
|
|
1348
|
-
* isCaptureLookupJournal({ version:
|
|
1349
|
-
* isCaptureLookupJournal({ version:
|
|
1420
|
+
* isCaptureLookupJournal({ version: 2, populations: {}, lookups: [] }) // true
|
|
1421
|
+
* isCaptureLookupJournal({ version: 1, populations: {}, lookups: [] }) // false
|
|
1350
1422
|
* ```
|
|
1351
1423
|
*/
|
|
1352
1424
|
export declare function isCaptureLookupJournal(value: unknown): value is CaptureLookupJournal;
|
|
1353
1425
|
|
|
1354
1426
|
/**
|
|
1355
|
-
* Checks whether an
|
|
1427
|
+
* Checks whether an expanded manifest has the supported schema without discarding malformed rows.
|
|
1356
1428
|
*
|
|
1357
1429
|
* @param value - The manifest
|
|
1358
1430
|
* @returns True if every inherited member validates; false otherwise
|
|
1359
1431
|
*
|
|
1360
1432
|
* @example
|
|
1361
1433
|
* ```ts
|
|
1362
|
-
* isCaptureManifest(JSON.parse(text)) // true for
|
|
1434
|
+
* isCaptureManifest(readCaptureManifest(JSON.parse(text), file)) // true for an expanded manifest.json
|
|
1363
1435
|
* isCaptureManifest('manifest') // false
|
|
1364
1436
|
* ```
|
|
1365
1437
|
*/
|
|
1366
1438
|
export declare function isCaptureManifest(value: unknown): value is CaptureManifest;
|
|
1367
1439
|
|
|
1440
|
+
/**
|
|
1441
|
+
* Checks whether a stored manifest holds its population table and every member that names a table key.
|
|
1442
|
+
*
|
|
1443
|
+
* @param value - The decoded manifest file
|
|
1444
|
+
* @returns True if the version, table, registry, stamps, lookups, and collections are valid; false otherwise
|
|
1445
|
+
* @remarks Table digests and reference existence are verified when the document is read.
|
|
1446
|
+
*
|
|
1447
|
+
* @example
|
|
1448
|
+
* ```ts
|
|
1449
|
+
* isCaptureManifestDocument(JSON.parse(text)) // true for a written manifest.json
|
|
1450
|
+
* isCaptureManifestDocument({ version: 1, populations: {}, entries: {}, lookups: [] }) // false
|
|
1451
|
+
* ```
|
|
1452
|
+
*/
|
|
1453
|
+
export declare function isCaptureManifestDocument(value: unknown): value is CaptureManifestDocument;
|
|
1454
|
+
|
|
1368
1455
|
/**
|
|
1369
1456
|
* Checks whether a serialized path stays within the portable relative-path vocabulary.
|
|
1370
1457
|
*
|
|
@@ -1430,7 +1517,7 @@ export declare function isCaptureRegistry(value: unknown): value is CaptureRegis
|
|
|
1430
1517
|
* @example
|
|
1431
1518
|
* ```ts
|
|
1432
1519
|
* isCaptureRequest(JSON.parse(text)) // true for a well-formed runner request
|
|
1433
|
-
* isCaptureRequest({ version:
|
|
1520
|
+
* isCaptureRequest({ version: 1 }) // false
|
|
1434
1521
|
* ```
|
|
1435
1522
|
*/
|
|
1436
1523
|
export declare function isCaptureRequest(value: unknown): value is CaptureRequest;
|
|
@@ -1505,20 +1592,6 @@ export declare function isCaptureSources(value: unknown): value is CaptureSource
|
|
|
1505
1592
|
*/
|
|
1506
1593
|
export declare function isCaptureStamp(value: unknown): value is CaptureStamp;
|
|
1507
1594
|
|
|
1508
|
-
/**
|
|
1509
|
-
* Checks optional collection metadata without upgrading historical image evidence.
|
|
1510
|
-
*
|
|
1511
|
-
* @param value - The inherited image transaction
|
|
1512
|
-
* @returns True if its existing manifest and any collection receipts are valid; false otherwise
|
|
1513
|
-
*
|
|
1514
|
-
* @example
|
|
1515
|
-
* ```ts
|
|
1516
|
-
* isCaptureStoredManifest(JSON.parse(text)) // true for a manifest with or without collections
|
|
1517
|
-
* isCaptureStoredManifest(null) // false
|
|
1518
|
-
* ```
|
|
1519
|
-
*/
|
|
1520
|
-
export declare function isCaptureStoredManifest(value: unknown): value is CaptureStoredManifest;
|
|
1521
|
-
|
|
1522
1595
|
/**
|
|
1523
1596
|
* Compares complete populations without erasing duplicates.
|
|
1524
1597
|
*
|