@amalgm/live 0.2.54 → 0.2.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/PURPOSE.md +6 -0
  2. package/dist/contracts/binding.d.ts +3 -2
  3. package/dist/contracts/binding.d.ts.map +1 -1
  4. package/dist/contracts/deployments.d.ts +39 -0
  5. package/dist/contracts/deployments.d.ts.map +1 -0
  6. package/dist/contracts/deployments.js +75 -0
  7. package/dist/contracts/deployments.js.map +1 -0
  8. package/dist/contracts/index.d.ts +1 -0
  9. package/dist/contracts/index.d.ts.map +1 -1
  10. package/dist/contracts/index.js +1 -0
  11. package/dist/contracts/index.js.map +1 -1
  12. package/dist/detection/adapter-contract.d.ts +0 -33
  13. package/dist/detection/adapter-contract.d.ts.map +1 -1
  14. package/dist/detection/adapter-contract.js +0 -32
  15. package/dist/detection/adapter-contract.js.map +1 -1
  16. package/dist/detection/diff.d.ts +5 -87
  17. package/dist/detection/diff.d.ts.map +1 -1
  18. package/dist/detection/diff.js +5 -111
  19. package/dist/detection/diff.js.map +1 -1
  20. package/dist/detection/enrollment.d.ts +8 -17
  21. package/dist/detection/enrollment.d.ts.map +1 -1
  22. package/dist/detection/enrollment.js +8 -73
  23. package/dist/detection/enrollment.js.map +1 -1
  24. package/dist/detection/index.d.ts +5 -8
  25. package/dist/detection/index.d.ts.map +1 -1
  26. package/dist/detection/index.js +5 -8
  27. package/dist/detection/index.js.map +1 -1
  28. package/dist/detection/territory.d.ts +1 -27
  29. package/dist/detection/territory.d.ts.map +1 -1
  30. package/dist/detection/territory.js +1 -77
  31. package/dist/detection/territory.js.map +1 -1
  32. package/dist/transfer/cargo.d.ts +46 -12
  33. package/dist/transfer/cargo.d.ts.map +1 -1
  34. package/dist/transfer/cargo.js +52 -18
  35. package/dist/transfer/cargo.js.map +1 -1
  36. package/dist/transfer/download.d.ts +8 -6
  37. package/dist/transfer/download.d.ts.map +1 -1
  38. package/dist/transfer/download.js +8 -6
  39. package/dist/transfer/download.js.map +1 -1
  40. package/dist/transfer/index.d.ts +2 -1
  41. package/dist/transfer/index.d.ts.map +1 -1
  42. package/dist/transfer/index.js +2 -1
  43. package/dist/transfer/index.js.map +1 -1
  44. package/dist/transfer/ranges.d.ts +43 -0
  45. package/dist/transfer/ranges.d.ts.map +1 -0
  46. package/dist/transfer/ranges.js +109 -0
  47. package/dist/transfer/ranges.js.map +1 -0
  48. package/dist/transfer/refs.d.ts +35 -0
  49. package/dist/transfer/refs.d.ts.map +1 -0
  50. package/dist/transfer/refs.js +45 -0
  51. package/dist/transfer/refs.js.map +1 -0
  52. package/dist-cjs/contracts/deployments.js +81 -0
  53. package/dist-cjs/contracts/deployments.js.map +1 -0
  54. package/dist-cjs/contracts/index.js +1 -0
  55. package/dist-cjs/contracts/index.js.map +1 -1
  56. package/dist-cjs/detection/adapter-contract.js +1 -34
  57. package/dist-cjs/detection/adapter-contract.js.map +1 -1
  58. package/dist-cjs/detection/diff.js +5 -113
  59. package/dist-cjs/detection/diff.js.map +1 -1
  60. package/dist-cjs/detection/enrollment.js +9 -75
  61. package/dist-cjs/detection/enrollment.js.map +1 -1
  62. package/dist-cjs/detection/index.js +5 -8
  63. package/dist-cjs/detection/index.js.map +1 -1
  64. package/dist-cjs/detection/territory.js +1 -79
  65. package/dist-cjs/detection/territory.js.map +1 -1
  66. package/dist-cjs/transfer/cargo.js +55 -20
  67. package/dist-cjs/transfer/cargo.js.map +1 -1
  68. package/dist-cjs/transfer/download.js +8 -6
  69. package/dist-cjs/transfer/download.js.map +1 -1
  70. package/dist-cjs/transfer/index.js +2 -1
  71. package/dist-cjs/transfer/index.js.map +1 -1
  72. package/dist-cjs/transfer/ranges.js +114 -0
  73. package/dist-cjs/transfer/ranges.js.map +1 -0
  74. package/dist-cjs/transfer/refs.js +49 -0
  75. package/dist-cjs/transfer/refs.js.map +1 -0
  76. package/package.json +2 -2
  77. package/dist/detection/continuity.d.ts +0 -54
  78. package/dist/detection/continuity.d.ts.map +0 -1
  79. package/dist/detection/continuity.js +0 -85
  80. package/dist/detection/continuity.js.map +0 -1
  81. package/dist/transfer/presign.d.ts +0 -26
  82. package/dist/transfer/presign.d.ts.map +0 -1
  83. package/dist/transfer/presign.js +0 -44
  84. package/dist/transfer/presign.js.map +0 -1
  85. package/dist-cjs/detection/continuity.js +0 -88
  86. package/dist-cjs/detection/continuity.js.map +0 -1
  87. package/dist-cjs/transfer/presign.js +0 -48
  88. package/dist-cjs/transfer/presign.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"enrollment.d.ts","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D;;qEAEqE;AACrE,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,qBAAqB,gBAAoC,CAAC;AAgDvE;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;8EAC8E;AAC9E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGjE;AAsDD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,SAAK,GAAG,gBAAgB,CAalF"}
1
+ {"version":3,"file":"enrollment.d.ts","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D;;qEAEqE;AACrE,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,qBAAqB,gBAAoC,CAAC;AAEvE;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;8EAC8E;AAC9E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGjE;AAsDD;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,SAAK,GAAG,gBAAgB,CAalF"}
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Detection enrollment policies.
2
+ * Detection enrollment policy.
3
3
  *
4
- * Current user ground enrolls everything except structural local state and
5
- * paths excluded by its tracked `.amalgmignore`; `.gitignore` never decides
6
- * Amalgm enrollment. `defaultShouldEnroll` remains only as the older explicit
7
- * registration policy for additive API compatibility. Current portable paths
8
- * already use `/`; a host converts its native separator at the boundary. A
9
- * literal `\\` is therefore preserved as part of a POSIX filename. Both
10
- * policies are pure strings-in/verdict-out and never inspect disk themselves.
4
+ * User ground enrolls everything except structural local state and paths
5
+ * excluded by its tracked `.amalgmignore`; `.gitignore` never decides Amalgm
6
+ * enrollment, and there are no implicit dependency, dotfile, cache, or secret
7
+ * exclusions. Portable paths already use `/`; a host converts its native
8
+ * separator at the boundary. A literal `\\` is therefore preserved as part of
9
+ * a POSIX filename. The policy is pure strings-in/verdict-out and never
10
+ * inspects disk itself.
11
11
  */
12
12
  /** The Git-like names at the user-ground boundary. Structural coordination
13
13
  * state is local and cannot be negated by user policy; the ignore file is
@@ -15,71 +15,6 @@
15
15
  export const AMALGM_CONTROL_DIRECTORY = '.amalgm';
16
16
  export const AMALGM_IGNORE_FILE = '.amalgmignore';
17
17
  export const DEFAULT_AMALGM_IGNORE = `/${AMALGM_CONTROL_DIRECTORY}/\n`;
18
- const EXCLUDED_DIRECTORIES = new Set([
19
- '.amalgm',
20
- '.aws',
21
- '.cache',
22
- '.docker',
23
- '.git',
24
- '.gnupg',
25
- '.gradle',
26
- '.hg',
27
- '.kube',
28
- '.mypy_cache',
29
- '.next',
30
- '.nyc_output',
31
- '.parcel-cache',
32
- '.pytest_cache',
33
- '.ruff_cache',
34
- '.ssh',
35
- '.svn',
36
- '.svelte-kit',
37
- '.turbo',
38
- '.venv',
39
- '.vite',
40
- '__pycache__',
41
- 'coverage',
42
- 'node_modules',
43
- ]);
44
- const EXCLUDED_FILES = new Set([
45
- '.DS_Store',
46
- 'Thumbs.db',
47
- 'desktop.ini',
48
- 'npm-debug.log',
49
- 'pnpm-debug.log',
50
- 'yarn-debug.log',
51
- 'yarn-error.log',
52
- ]);
53
- function isPrivateFile(name) {
54
- if (/^\.env(?:\..+)?$/i.test(name) && !/\.example$/i.test(name))
55
- return true;
56
- if (/^(?:credentials?|secrets?)\.(?:json|ya?ml|toml|ini|conf)$/i.test(name))
57
- return true;
58
- if (/^id_(?:dsa|ecdsa|ed25519|rsa)$/i.test(name))
59
- return true;
60
- if (/^(?:\.git-credentials|\.netrc|\.npmrc|\.pypirc|auth\.json|kubeconfig)$/i.test(name))
61
- return true;
62
- if (/^(?:service[-_]?account|firebase[-_]?adminsdk).*\.json$/i.test(name))
63
- return true;
64
- return /\.(?:key|keystore|kdbx|p12|pfx|pem|ppk|tfstate(?:\.backup)?)$/i.test(name);
65
- }
66
- /**
67
- * Legacy explicit-registration policy retained for additive API compatibility.
68
- * Current user-ground Detect must use {@link createUserGroundEnrollmentPolicy};
69
- * there are no implicit dependency, dotfile, cache, or secret exclusions.
70
- * Both separators are path separators; '' never enrolls.
71
- *
72
- * @deprecated Use `createUserGroundEnrollmentPolicy` for current user ground.
73
- */
74
- export const defaultShouldEnroll = (relPath) => {
75
- const parts = normalizedRelativePath(String(relPath || '').replace(/\\/g, '/')).split('/').filter(Boolean);
76
- const name = parts.at(-1);
77
- if (name === undefined || parts.some((part) => EXCLUDED_DIRECTORIES.has(part)))
78
- return false;
79
- if (EXCLUDED_FILES.has(name) || isPrivateFile(name))
80
- return false;
81
- return !name.startsWith('.#') && !name.endsWith('~') && !/\.(?:swp|swo)$/i.test(name);
82
- };
83
18
  /**
84
19
  * One normalized spelling for portable enrollment and ignore matching.
85
20
  * Portable relative paths use `/`. Do not reinterpret `\\`: it is a valid,
@@ -1 +1 @@
1
- {"version":3,"file":"enrollment.js","sourceRoot":"","sources":["../../src/detection/enrollment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;qEAEqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAClD,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,wBAAwB,KAAK,CAAC;AAEvE,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC;IACnC,SAAS;IACT,MAAM;IACN,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IACR,SAAS;IACT,KAAK;IACL,OAAO;IACP,aAAa;IACb,OAAO;IACP,aAAa;IACb,eAAe;IACf,eAAe;IACf,aAAa;IACb,MAAM;IACN,MAAM;IACN,aAAa;IACb,QAAQ;IACR,OAAO;IACP,OAAO;IACP,aAAa;IACb,UAAU;IACV,cAAc;CACf,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,WAAW;IACX,WAAW;IACX,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;CACjB,CAAC,CAAC;AAEH,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7E,IAAI,4D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7 @@
1
1
  /**
2
2
  * Detection — the pure cores that turn observed disk evidence into facts.
3
3
  * Normative sources:
4
- * entity-model.md (identity axioms, the two continuity witnesses) and
4
+ * entity-model.md (identity axioms, the two identity witnesses) and
5
5
  * entity-implementation.md (the ratified seams).
6
6
  *
7
7
  * Everything here is rows and entries in, verdicts out. Walking disk,
@@ -10,15 +10,13 @@
10
10
  * policy) and this layer owns only the laws:
11
11
  *
12
12
  * - `adapter-contract` the seven rails, the ratified detect socket,
13
- * descriptor conviction, the three-state truth
14
- * judgment, the reference adapter
13
+ * and descriptor conviction
15
14
  * - `classify` text/binary from detect's own read evidence
16
15
  * - `refusal` declined-vs-broken, named where it is raised
17
- * - `enrollment` tracked user-ground policy plus legacy compatibility
18
- * - `diff` the compare functions: file/dir/link identity
19
- * - `continuity` root rescue and the undecided address
16
+ * - `enrollment` the tracked user-ground policy
17
+ * - `diff` directory channel identity from inode and address
20
18
  * - `watch-boundary` generation-safe Watch input and coverage output
21
- * - `territory` nearest-repository recorder selection
19
+ * - `territory` nearest-repository ownership, indexed per graph
22
20
  * - `record-proposal` the exact Detect-to-Record contract
23
21
  * - `batch` net-difference planning and Watch settlement
24
22
  * - `content` text/binary/link replay from one captured read
@@ -28,7 +26,6 @@
28
26
  export * from './adapter-contract.js';
29
27
  export * from './batch.js';
30
28
  export * from './classify.js';
31
- export * from './continuity.js';
32
29
  export * from './content.js';
33
30
  export * from './diff.js';
34
31
  export * from './echo.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Detection — the pure cores that turn observed disk evidence into facts.
3
3
  * Normative sources:
4
- * entity-model.md (identity axioms, the two continuity witnesses) and
4
+ * entity-model.md (identity axioms, the two identity witnesses) and
5
5
  * entity-implementation.md (the ratified seams).
6
6
  *
7
7
  * Everything here is rows and entries in, verdicts out. Walking disk,
@@ -10,15 +10,13 @@
10
10
  * policy) and this layer owns only the laws:
11
11
  *
12
12
  * - `adapter-contract` the seven rails, the ratified detect socket,
13
- * descriptor conviction, the three-state truth
14
- * judgment, the reference adapter
13
+ * and descriptor conviction
15
14
  * - `classify` text/binary from detect's own read evidence
16
15
  * - `refusal` declined-vs-broken, named where it is raised
17
- * - `enrollment` tracked user-ground policy plus legacy compatibility
18
- * - `diff` the compare functions: file/dir/link identity
19
- * - `continuity` root rescue and the undecided address
16
+ * - `enrollment` the tracked user-ground policy
17
+ * - `diff` directory channel identity from inode and address
20
18
  * - `watch-boundary` generation-safe Watch input and coverage output
21
- * - `territory` nearest-repository recorder selection
19
+ * - `territory` nearest-repository ownership, indexed per graph
22
20
  * - `record-proposal` the exact Detect-to-Record contract
23
21
  * - `batch` net-difference planning and Watch settlement
24
22
  * - `content` text/binary/link replay from one captured read
@@ -28,7 +26,6 @@
28
26
  export * from './adapter-contract.js';
29
27
  export * from './batch.js';
30
28
  export * from './classify.js';
31
- export * from './continuity.js';
32
29
  export * from './content.js';
33
30
  export * from './diff.js';
34
31
  export * from './echo.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detection/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC"}
@@ -1,15 +1,5 @@
1
- /** Nearest-repository ownership for one detected entity transition. */
1
+ /** Nearest-repository ownership, indexed once for a whole graph. */
2
2
  import type { CloudEntityRecord } from '../entities/cloud.js';
3
- import type { EntityReadPort, EntityRow } from '../entities/types.js';
4
- export interface EntityRecorderTarget {
5
- readonly kind: 'entity';
6
- readonly resourceId: string;
7
- }
8
- export interface RepositoryRecorderTarget {
9
- readonly kind: 'repository';
10
- readonly resourceId: string;
11
- }
12
- export type RecorderTarget = EntityRecorderTarget | RepositoryRecorderTarget;
13
3
  export interface RepositoryTerritoryNode {
14
4
  readonly uuid: string;
15
5
  readonly type: CloudEntityRecord['type'];
@@ -29,20 +19,4 @@ export interface RepositoryTerritoryIndex<Node extends RepositoryTerritoryNode>
29
19
  * owner in this index.
30
20
  */
31
21
  export declare function indexRepositoryTerritory<Node extends RepositoryTerritoryNode>(nodes: readonly Node[]): RepositoryTerritoryIndex<Node>;
32
- export interface RecorderTransition {
33
- readonly base: Pick<CloudEntityRecord, 'uuid' | 'type' | 'parentUUID' | 'name' | 'status'> | null;
34
- readonly result: Pick<CloudEntityRecord, 'uuid' | 'type' | 'parentUUID' | 'name' | 'status'>;
35
- }
36
- /** The nearest repo at or above `uuid`; nested repositories win. */
37
- export declare function nearestRepository(uuid: string | null, byUuid: EntityReadPort['byUuid']): EntityRow | null;
38
- /**
39
- * Name every recorder whose state a transition can change.
40
- *
41
- * Ordinary changes outside repository territory publish on the entity UUID.
42
- * A change wholly inside one repository publishes only the repository parcel.
43
- * Crossing a repository boundary also publishes the entity graph transition,
44
- * plus the source and/or destination repositories whose identity maps and
45
- * Checkpoints changed.
46
- */
47
- export declare function recorderTargets(transition: RecorderTransition, byUuid: EntityReadPort['byUuid']): readonly RecorderTarget[];
48
22
  //# sourceMappingURL=territory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"territory.d.ts","sourceRoot":"","sources":["../../src/detection/territory.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBA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,IAAI,EACnB,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC/B,SAAS,GAAG,IAAI,CAYlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC/B,SAAS,cAAc,EAAE,CA+C3B"}
1
+ {"version":3,"file":"territory.d.ts","sourceRoot":"","sources":["../../src/detection/territory.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB,CAAC,IAAI,SAAS,uBAAuB;IAC5E,gFAAgF;IAChF,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,8DAA8D;IAC9D,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,IAAI,EAAE,CAAC;CAChD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,SAAS,uBAAuB,EAC3E,KAAK,EAAE,SAAS,IAAI,EAAE,GACrB,wBAAwB,CAAC,IAAI,CAAC,CAuChC"}
@@ -1,4 +1,4 @@
1
- /** Nearest-repository ownership for one detected entity transition. */
1
+ /** Nearest-repository ownership, indexed once for a whole graph. */
2
2
  /**
3
3
  * Index nearest-repository territory once for a complete or boundary-trimmed
4
4
  * graph. Hosts use this when one scan needs ownership for every row: repeated
@@ -49,80 +49,4 @@ export function indexRepositoryTerritory(nodes) {
49
49
  ownedBy: (repositoryId) => Object.freeze([...(owned.get(repositoryId) ?? [])]),
50
50
  });
51
51
  }
52
- /** The nearest repo at or above `uuid`; nested repositories win. */
53
- export function nearestRepository(uuid, byUuid) {
54
- const seen = new Set();
55
- let cursor = uuid;
56
- while (cursor !== null) {
57
- if (seen.has(cursor))
58
- throw new Error(`registry corrupt: parent cycle at ${cursor}`);
59
- seen.add(cursor);
60
- const row = byUuid(cursor);
61
- if (!row)
62
- throw new Error(`no entity ${cursor}`);
63
- if (row.type === 'repo.git')
64
- return row;
65
- cursor = row.parentUuid;
66
- }
67
- return null;
68
- }
69
- /**
70
- * Name every recorder whose state a transition can change.
71
- *
72
- * Ordinary changes outside repository territory publish on the entity UUID.
73
- * A change wholly inside one repository publishes only the repository parcel.
74
- * Crossing a repository boundary also publishes the entity graph transition,
75
- * plus the source and/or destination repositories whose identity maps and
76
- * Checkpoints changed.
77
- */
78
- export function recorderTargets(transition, byUuid) {
79
- const { base, result } = transition;
80
- if (base !== null && base.uuid !== result.uuid) {
81
- throw new Error('a recorder transition cannot change entity UUID');
82
- }
83
- const before = nearestRepository(base?.parentUUID ?? null, byUuid);
84
- const after = nearestRepository(result.parentUUID, byUuid);
85
- const add = (targets, target) => {
86
- if (!targets.some((candidate) => candidate.resourceId === target.resourceId))
87
- targets.push(target);
88
- };
89
- // Every `.git` boundary starts its own repository rail, even when nested.
90
- // Its enclosing repository changes only when the boundary's graph entry
91
- // changes; ordinary Card/Checkpoint advancement remains on the inner rail.
92
- if (base?.type === 'repo.git' || result.type === 'repo.git') {
93
- const targets = [];
94
- add(targets, {
95
- kind: result.type === 'repo.git' ? 'repository' : 'entity',
96
- resourceId: result.uuid,
97
- });
98
- const boundaryChanged = base === null
99
- || base.type !== result.type
100
- || base.parentUUID !== result.parentUUID
101
- || base.name !== result.name
102
- || base.status !== result.status;
103
- if (boundaryChanged) {
104
- if (before)
105
- add(targets, { kind: 'repository', resourceId: before.uuid });
106
- if (after)
107
- add(targets, { kind: 'repository', resourceId: after.uuid });
108
- }
109
- return Object.freeze(targets);
110
- }
111
- if (base === null) {
112
- return Object.freeze(after
113
- ? [{ kind: 'repository', resourceId: after.uuid }]
114
- : [{ kind: 'entity', resourceId: result.uuid }]);
115
- }
116
- if (before?.uuid === after?.uuid) {
117
- return Object.freeze(before
118
- ? [{ kind: 'repository', resourceId: before.uuid }]
119
- : [{ kind: 'entity', resourceId: result.uuid }]);
120
- }
121
- const targets = [{ kind: 'entity', resourceId: result.uuid }];
122
- for (const repository of [before, after]) {
123
- if (repository)
124
- add(targets, { kind: 'repository', resourceId: repository.uuid });
125
- }
126
- return Object.freeze(targets);
127
- }
128
52
  //# sourceMappingURL=territory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"territory.js","sourceRoot":"","sources":["../../src/detection/territory.ts"],"names":[],"mappings":"AAAA,uEAAuE;AA8BvE;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAsB;IAEtB,MAAM,MAAM,GAAG,IAAI,GAAG,EAAgB,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9F,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,MAAM,OAAO,GAAG,CAAC,IAAU,EAAe,EAAE;QAC1C,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;QAChE,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,8CAA8C,IAA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artifacts.
2
+ * Cargo stream — cold transport of many complete small artifacts.
3
3
  *
4
4
  * A register journey moves file counts, not just bytes: tens of thousands
5
5
  * of small artifacts whose per-artifact negotiation frames would dwarf the
6
- * payload. A wave carries whole artifacts every chunk and the manifest
7
- * identityso the frame count scales with bytes moved, never with file
8
- * count. Only artifacts at or below the wave byte bound ride waves; larger
9
- * artifacts keep per-artifact transfer where chunk reuse pays.
6
+ * payload. The set streams as self-contained segments. Each segment carries
7
+ * whole artifacts every chunk and the manifest identity so the frame
8
+ * count scales with bytes moved, never with file count. Segments flow
9
+ * through one bounded window and never wait on one another's durability
10
+ * acknowledgements; the authority verifies and seals each segment
11
+ * independently, so an interruption loses only unacknowledged segments and
12
+ * a rerun resumes from the sealed inventory. Only artifacts at or below the
13
+ * segment byte bound ride the stream; larger artifacts keep per-artifact
14
+ * transfer where chunk reuse pays.
10
15
  */
11
- export declare const CARGO_WAVE_BYTES: number;
16
+ export declare const CARGO_SEGMENT_BYTES: number;
12
17
  /** Bounded by the 64KiB binary-frame header law: every artifact declaration
13
18
  * (content hash, bytes, chunk list) rides the JSON header, and 256 worst-case
14
19
  * declarations stay under the bound with margin. The byte bound, not this
15
- * count, decides the wave tally on real grounds. */
16
- export declare const CARGO_WAVE_ARTIFACTS = 256;
17
- export interface CargoWaveItem {
20
+ * count, decides the segment tally on real grounds. */
21
+ export declare const CARGO_SEGMENT_ARTIFACTS = 256;
22
+ /** Four full segments may be in flight at once. The window keeps the wire
23
+ * busy while earlier segments await the authority's per-segment durability
24
+ * fan-out, and worst-case payload residency (plaintext plus one encoded
25
+ * copy per in-flight segment) stays comfortably inside a 1-GiB runtime. */
26
+ export declare const CARGO_STREAM_IN_FLIGHT_BYTES: number;
27
+ export interface CargoItem {
28
+ /** Artifact identity the authority must acknowledge sealing. */
29
+ readonly contentHash: string;
30
+ /** Exact byte count of the complete artifact. */
18
31
  readonly bytes: number;
19
32
  }
20
- export interface CargoWave<T extends CargoWaveItem> {
33
+ export interface CargoSegment<T extends CargoItem> {
21
34
  readonly items: readonly T[];
22
35
  readonly bytes: number;
23
36
  }
24
- /** Pack items in order into waves within the byte and artifact bounds. */
25
- export declare function planCargoWaves<T extends CargoWaveItem>(items: readonly T[]): readonly CargoWave<T>[];
37
+ export interface CargoStreamPorts<T extends CargoItem> {
38
+ /** Transmit one self-contained segment and return the content hashes the
39
+ * authority sealed for it. Resolving means every returned artifact is
40
+ * durable; segments share nothing, so the port may be called for a later
41
+ * segment while earlier acknowledgements are still outstanding. */
42
+ send(segment: CargoSegment<T>): Promise<readonly string[]>;
43
+ }
44
+ export interface CargoStreamOptions {
45
+ readonly lanes?: number;
46
+ readonly maxInFlightBytes?: number;
47
+ }
48
+ export interface CargoStreamReceipt {
49
+ readonly segments: number;
50
+ readonly artifacts: number;
51
+ readonly bytes: number;
52
+ }
53
+ /** Pack items in order into segments within the byte and artifact bounds. */
54
+ export declare function planCargoSegments<T extends CargoItem>(items: readonly T[]): readonly CargoSegment<T>[];
55
+ /** Stream one cold set of small artifacts as bounded pipelined segments.
56
+ * Every item must come back sealed or the stream fails; a failure stops new
57
+ * admission, lets in-flight segments settle, and leaves their sealed work
58
+ * durable for the resuming rerun. */
59
+ export declare function streamCargo<T extends CargoItem>(items: readonly T[], ports: CargoStreamPorts<T>, options?: CargoStreamOptions): Promise<CargoStreamReceipt>;
26
60
  //# sourceMappingURL=cargo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cargo.d.ts","sourceRoot":"","sources":["../../src/transfer/cargo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,eAAO,MAAM,gBAAgB,QAA4B,CAAC;AAC1D;;;oDAGoD;AACpD,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,aAAa;IAChD,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,E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AAC;CACxB;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,EACnD,KAAK,EAAE,SAAS,CAAC,EAAE,GAClB,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAyB5B;AAED;;;qCAGqC;AACrC,wBAAsB,WAAW,CAAC,CAAC,SAAS,SAAS,EACnD,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC1B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAqB7B"}
@@ -1,35 +1,49 @@
1
1
  /**
2
- * Cargo waves — cold transport of many complete small artifacts.
2
+ * Cargo stream — cold transport of many complete small artifacts.
3
3
  *
4
4
  * A register journey moves file counts, not just bytes: tens of thousands
5
5
  * of small artifacts whose per-artifact negotiation frames would dwarf the
6
- * payload. A wave carries whole artifacts every chunk and the manifest
7
- * identityso the frame count scales with bytes moved, never with file
8
- * count. Only artifacts at or below the wave byte bound ride waves; larger
9
- * artifacts keep per-artifact transfer where chunk reuse pays.
6
+ * payload. The set streams as self-contained segments. Each segment carries
7
+ * whole artifacts every chunk and the manifest identity so the frame
8
+ * count scales with bytes moved, never with file count. Segments flow
9
+ * through one bounded window and never wait on one another's durability
10
+ * acknowledgements; the authority verifies and seals each segment
11
+ * independently, so an interruption loses only unacknowledged segments and
12
+ * a rerun resumes from the sealed inventory. Only artifacts at or below the
13
+ * segment byte bound ride the stream; larger artifacts keep per-artifact
14
+ * transfer where chunk reuse pays.
10
15
  */
11
16
  import { FILE_TRANSFER_BATCH_BYTES } from './batches.js';
12
- export const CARGO_WAVE_BYTES = FILE_TRANSFER_BATCH_BYTES;
17
+ import { DEFAULT_TRANSFER_CONCURRENCY, weightedParallelForEach } from './parallel.js';
18
+ export const CARGO_SEGMENT_BYTES = FILE_TRANSFER_BATCH_BYTES;
13
19
  /** Bounded by the 64KiB binary-frame header law: every artifact declaration
14
20
  * (content hash, bytes, chunk list) rides the JSON header, and 256 worst-case
15
21
  * declarations stay under the bound with margin. The byte bound, not this
16
- * count, decides the wave tally on real grounds. */
17
- export const CARGO_WAVE_ARTIFACTS = 256;
18
- /** Pack items in order into waves within the byte and artifact bounds. */
19
- export function planCargoWaves(items) {
20
- const waves = [];
22
+ * count, decides the segment tally on real grounds. */
23
+ export const CARGO_SEGMENT_ARTIFACTS = 256;
24
+ /** Four full segments may be in flight at once. The window keeps the wire
25
+ * busy while earlier segments await the authority's per-segment durability
26
+ * fan-out, and worst-case payload residency (plaintext plus one encoded
27
+ * copy per in-flight segment) stays comfortably inside a 1-GiB runtime. */
28
+ export const CARGO_STREAM_IN_FLIGHT_BYTES = 4 * CARGO_SEGMENT_BYTES;
29
+ /** Pack items in order into segments within the byte and artifact bounds. */
30
+ export function planCargoSegments(items) {
31
+ const segments = [];
21
32
  let current = [];
22
33
  let bytes = 0;
23
34
  for (const item of items) {
35
+ if (typeof item.contentHash !== 'string' || item.contentHash.length === 0) {
36
+ throw new Error('cargo item is missing its content identity');
37
+ }
24
38
  if (!Number.isSafeInteger(item.bytes) || item.bytes < 0) {
25
- throw new Error('cargo wave item byte count is invalid');
39
+ throw new Error('cargo item byte count is invalid');
26
40
  }
27
- if (item.bytes > CARGO_WAVE_BYTES) {
28
- throw new Error('cargo wave item exceeds the wave byte bound');
41
+ if (item.bytes > CARGO_SEGMENT_BYTES) {
42
+ throw new Error('cargo item exceeds the segment byte bound');
29
43
  }
30
44
  if (current.length > 0
31
- && (bytes + item.bytes > CARGO_WAVE_BYTES || current.length >= CARGO_WAVE_ARTIFACTS)) {
32
- waves.push({ items: current, bytes });
45
+ && (bytes + item.bytes > CARGO_SEGMENT_BYTES || current.length >= CARGO_SEGMENT_ARTIFACTS)) {
46
+ segments.push({ items: current, bytes });
33
47
  current = [];
34
48
  bytes = 0;
35
49
  }
@@ -37,7 +51,27 @@ export function planCargoWaves(items) {
37
51
  bytes += item.bytes;
38
52
  }
39
53
  if (current.length > 0)
40
- waves.push({ items: current, bytes });
41
- return waves;
54
+ segments.push({ items: current, bytes });
55
+ return segments;
56
+ }
57
+ /** Stream one cold set of small artifacts as bounded pipelined segments.
58
+ * Every item must come back sealed or the stream fails; a failure stops new
59
+ * admission, lets in-flight segments settle, and leaves their sealed work
60
+ * durable for the resuming rerun. */
61
+ export async function streamCargo(items, ports, options = {}) {
62
+ const segments = planCargoSegments(items);
63
+ let artifacts = 0;
64
+ let bytes = 0;
65
+ await weightedParallelForEach(segments, options.lanes ?? DEFAULT_TRANSFER_CONCURRENCY, options.maxInFlightBytes ?? CARGO_STREAM_IN_FLIGHT_BYTES, (segment) => Math.max(segment.bytes, 1), async (segment) => {
66
+ const sealed = new Set(await ports.send(segment));
67
+ for (const item of segment.items) {
68
+ if (!sealed.has(item.contentHash)) {
69
+ throw new Error(`cargo authority did not seal ${item.contentHash}`);
70
+ }
71
+ }
72
+ artifacts += segment.items.length;
73
+ bytes += segment.bytes;
74
+ });
75
+ return { segments: segments.length, artifacts, bytes };
42
76
  }
43
77
  //# sourceMappingURL=cargo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cargo.js","sourceRoot":"","sources":["../../src/transfer/cargo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAC1D;;;oDAGoD;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAWxC,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAC5B,KAAmB;IAEnB,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,IAAI,OAAO,GAAQ,EAAE,CAAC;IACtB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,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,CAAC;AAClB,CAAC;AAED;;;qCAGqC;AACrC,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAmB,EACnB,KAA0B,EAC1B,UAA8B,EAAE;IAEhC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,uBAAuB,CAC3B,QAAQ,EACR,OAAO,CAAC,KAAK,IAAI,4BAA4B,EAC7C,OAAO,CAAC,gBAAgB,IAAI,4BAA4B,EACxD,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,EACvC,KAAK,EAAE,OAAO,EAAE,EAAE;QAChB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;gBAClC,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;QACD,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;QAClC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IACzB,CAAC,CACF,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACzD,CAAC"}
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * Download a set of immutable artifacts into a machine cache.
3
3
  *
4
- * The set is the primitive: one plan wave proves every manifest and asks the
5
- * cache which chunks are gaps, one chunk wave fetches every gap across the
6
- * whole set under a single bound, and one seal wave verifies each complete
4
+ * The set is the primitive: one plan phase proves every manifest and asks the
5
+ * cache which chunks are gaps, one fetch phase obtains every gap across the
6
+ * whole set under a single bound, and one seal phase verifies each complete
7
7
  * artifact. A lone artifact is a set of one — there is no second path. This
8
8
  * shape removes per-artifact serialization: no artifact waits behind
9
9
  * another's plan or seal, only behind the shared fetch bound. Each chunk is
10
10
  * still its own storage request — the set changes scheduling, not the
11
11
  * request count.
12
12
  *
13
- * Every chunk is one content-addressed storage object, so the host's ports
14
- * fetch chunks independently parallelism, transport, and decryption are the
15
- * host's concern; the verification laws here are not.
13
+ * Every chunk keeps one content-addressed identity, whether its sealed
14
+ * envelope lives alone or as a byte range inside an immutable pack. The
15
+ * host's ports resolve and fetch those identities; parallelism, storage
16
+ * layout, transport, and decryption are the host's concern, while the
17
+ * verification laws here remain singular.
16
18
  */
17
19
  import { type ContentManifest } from '../contracts/content.js';
18
20
  import type { Sha256Hex } from '../entities/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/transfer/download.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAqC,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAO/E,MAAM,WAAW,aAAa,CAAC,aAAa;IAC1C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,6EAA6E;IAC7E,QAAQ,CACN,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,QAAQ,CACN,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,eAAe,EACzB,KAAK,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,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;sEACkE;IAClE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,eAAe,CAAC,aAAa;IAC5C,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAQD;;uCAEuC;AACvC,wBAAsB,WAAW,CAAC,aAAa,EAC7C,SAAS,EAAE,SAAS,gBAAgB,EAAE,EACtC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,EACnC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,SAAS,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC,CA+DpD;AAED,sDAAsD;AACtD,wBAAsB,QAAQ,CAAC,aAAa,EAC1C,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,EACnC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAIzC"}
@@ -1,18 +1,20 @@
1
1
  /**
2
2
  * Download a set of immutable artifacts into a machine cache.
3
3
  *
4
- * The set is the primitive: one plan wave proves every manifest and asks the
5
- * cache which chunks are gaps, one chunk wave fetches every gap across the
6
- * whole set under a single bound, and one seal wave verifies each complete
4
+ * The set is the primitive: one plan phase proves every manifest and asks the
5
+ * cache which chunks are gaps, one fetch phase obtains every gap across the
6
+ * whole set under a single bound, and one seal phase verifies each complete
7
7
  * artifact. A lone artifact is a set of one — there is no second path. This
8
8
  * shape removes per-artifact serialization: no artifact waits behind
9
9
  * another's plan or seal, only behind the shared fetch bound. Each chunk is
10
10
  * still its own storage request — the set changes scheduling, not the
11
11
  * request count.
12
12
  *
13
- * Every chunk is one content-addressed storage object, so the host's ports
14
- * fetch chunks independently parallelism, transport, and decryption are the
15
- * host's concern; the verification laws here are not.
13
+ * Every chunk keeps one content-addressed identity, whether its sealed
14
+ * envelope lives alone or as a byte range inside an immutable pack. The
15
+ * host's ports resolve and fetch those identities; parallelism, storage
16
+ * layout, transport, and decryption are the host's concern, while the
17
+ * verification laws here remain singular.
16
18
  */
17
19
  import { CHUNK_BYTES, checkContentManifest } from '../contracts/content.js';
18
20
  import { assertTransferArtifact } from './artifacts.js';