@sentropic/cluster-mesh 0.23.5 → 0.25.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/README.md +5 -0
- package/assets/storage/engram-memory/C6-FREEZE.md +63 -0
- package/assets/storage/engram-memory/contract-manifest.json +6 -4
- package/assets/storage/engram-memory/equivalence.json +1 -1
- package/assets/storage/engram-memory/neutral-asset-inventory.json +53 -0
- package/assets/storage/engram-memory/neutral-equivalence.json +44 -0
- package/assets/storage/postgres/007-consumed-counters.sql +17 -0
- package/assets/storage/postgres/008-instance-ownership.sql +35 -0
- package/assets/storage/postgres/engram-memory/001-projections.sql +14 -0
- package/assets/storage/postgres/engram-memory/002-host-ledger.sql +14 -0
- package/assets/storage/postgres/engram-memory/manifest.json +29 -0
- package/assets/storage/postgres/manifest.json +26 -0
- package/contracts/engram-memory-neutral-contract-v1.d.ts +367 -0
- package/dist/comments/postgres.d.ts +1 -0
- package/dist/comments/postgres.d.ts.map +1 -1
- package/dist/engram-memory/binding.d.ts +115 -0
- package/dist/engram-memory/binding.d.ts.map +1 -0
- package/dist/engram-memory/binding.js +239 -0
- package/dist/engram-memory/binding.js.map +1 -0
- package/dist/engram-memory/commit-result-recovery.d.ts +12 -0
- package/dist/engram-memory/commit-result-recovery.d.ts.map +1 -0
- package/dist/engram-memory/commit-result-recovery.js +14 -0
- package/dist/engram-memory/commit-result-recovery.js.map +1 -0
- package/dist/engram-memory/contract.d.ts +7 -1
- package/dist/engram-memory/contract.d.ts.map +1 -1
- package/dist/engram-memory/contract.js +7 -1
- package/dist/engram-memory/contract.js.map +1 -1
- package/dist/engram-memory/host-maintenance.d.ts +40 -0
- package/dist/engram-memory/host-maintenance.d.ts.map +1 -0
- package/dist/engram-memory/host-maintenance.js +44 -0
- package/dist/engram-memory/host-maintenance.js.map +1 -0
- package/dist/engram-memory/ledger.d.ts +75 -0
- package/dist/engram-memory/ledger.d.ts.map +1 -0
- package/dist/engram-memory/ledger.js +286 -0
- package/dist/engram-memory/ledger.js.map +1 -0
- package/dist/engram-memory/manifest.d.ts +1 -1
- package/dist/engram-memory/manifest.d.ts.map +1 -1
- package/dist/engram-memory/manifest.js +2 -1
- package/dist/engram-memory/manifest.js.map +1 -1
- package/dist/engram-memory/neutral-contract.d.ts +368 -0
- package/dist/engram-memory/neutral-contract.d.ts.map +1 -0
- package/dist/engram-memory/neutral-contract.js +39 -0
- package/dist/engram-memory/neutral-contract.js.map +1 -0
- package/dist/engram-memory/neutral-handle.d.ts +62 -0
- package/dist/engram-memory/neutral-handle.d.ts.map +1 -0
- package/dist/engram-memory/neutral-handle.js +131 -0
- package/dist/engram-memory/neutral-handle.js.map +1 -0
- package/dist/engram-memory/postgres-queries.d.ts +1 -1
- package/dist/engram-memory/postgres-queries.d.ts.map +1 -1
- package/dist/engram-memory/postgres-queries.js +111 -21
- package/dist/engram-memory/postgres-queries.js.map +1 -1
- package/dist/engram-memory/postgres.d.ts +51 -10
- package/dist/engram-memory/postgres.d.ts.map +1 -1
- package/dist/engram-memory/postgres.js +118 -17
- package/dist/engram-memory/postgres.js.map +1 -1
- package/dist/engram-memory/projection.d.ts +12 -0
- package/dist/engram-memory/projection.d.ts.map +1 -0
- package/dist/engram-memory/projection.js +123 -0
- package/dist/engram-memory/projection.js.map +1 -0
- package/dist/engram-memory/wire-adaptation.d.ts +61 -0
- package/dist/engram-memory/wire-adaptation.d.ts.map +1 -0
- package/dist/engram-memory/wire-adaptation.js +239 -0
- package/dist/engram-memory/wire-adaptation.js.map +1 -0
- package/dist/identity-contracts/access.d.ts +54 -0
- package/dist/identity-contracts/access.d.ts.map +1 -0
- package/dist/identity-contracts/access.js +168 -0
- package/dist/identity-contracts/access.js.map +1 -0
- package/dist/identity-contracts/accounts.d.ts +44 -0
- package/dist/identity-contracts/accounts.d.ts.map +1 -0
- package/dist/identity-contracts/accounts.js +149 -0
- package/dist/identity-contracts/accounts.js.map +1 -0
- package/dist/identity-contracts/descriptors.d.ts +12 -0
- package/dist/identity-contracts/descriptors.d.ts.map +1 -0
- package/dist/identity-contracts/descriptors.js +57 -0
- package/dist/identity-contracts/descriptors.js.map +1 -0
- package/dist/identity-contracts/doubles.d.ts +115 -0
- package/dist/identity-contracts/doubles.d.ts.map +1 -0
- package/dist/identity-contracts/doubles.js +340 -0
- package/dist/identity-contracts/doubles.js.map +1 -0
- package/dist/identity-contracts/enforcement.d.ts +27 -0
- package/dist/identity-contracts/enforcement.d.ts.map +1 -0
- package/dist/identity-contracts/enforcement.js +155 -0
- package/dist/identity-contracts/enforcement.js.map +1 -0
- package/dist/identity-contracts/errors.d.ts +71 -0
- package/dist/identity-contracts/errors.d.ts.map +1 -0
- package/dist/identity-contracts/errors.js +129 -0
- package/dist/identity-contracts/errors.js.map +1 -0
- package/dist/identity-contracts/index.d.ts +12 -0
- package/dist/identity-contracts/index.d.ts.map +1 -0
- package/dist/identity-contracts/index.js +13 -0
- package/dist/identity-contracts/index.js.map +1 -0
- package/dist/identity-contracts/ports.d.ts +116 -0
- package/dist/identity-contracts/ports.d.ts.map +1 -0
- package/dist/identity-contracts/ports.js +7 -0
- package/dist/identity-contracts/ports.js.map +1 -0
- package/dist/identity-contracts/resolution.d.ts +56 -0
- package/dist/identity-contracts/resolution.d.ts.map +1 -0
- package/dist/identity-contracts/resolution.js +87 -0
- package/dist/identity-contracts/resolution.js.map +1 -0
- package/dist/identity-contracts/tenancy.d.ts +52 -0
- package/dist/identity-contracts/tenancy.d.ts.map +1 -0
- package/dist/identity-contracts/tenancy.js +171 -0
- package/dist/identity-contracts/tenancy.js.map +1 -0
- package/dist/identity-contracts/types.d.ts +253 -0
- package/dist/identity-contracts/types.d.ts.map +1 -0
- package/dist/identity-contracts/types.js +7 -0
- package/dist/identity-contracts/types.js.map +1 -0
- package/dist/identity-contracts/workspaces.d.ts +37 -0
- package/dist/identity-contracts/workspaces.d.ts.map +1 -0
- package/dist/identity-contracts/workspaces.js +118 -0
- package/dist/identity-contracts/workspaces.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/mcp/memory-compose.d.ts +11 -0
- package/dist/integrations/mcp/memory-compose.d.ts.map +1 -0
- package/dist/integrations/mcp/memory-compose.js +79 -0
- package/dist/integrations/mcp/memory-compose.js.map +1 -0
- package/dist/integrations/mcp/memory-definition.d.ts +28 -0
- package/dist/integrations/mcp/memory-definition.d.ts.map +1 -0
- package/dist/integrations/mcp/memory-definition.js +2 -0
- package/dist/integrations/mcp/memory-definition.js.map +1 -0
- package/dist/integrations/mcp/memory-manifest.d.ts +4 -0
- package/dist/integrations/mcp/memory-manifest.d.ts.map +1 -0
- package/dist/integrations/mcp/memory-manifest.js +9 -0
- package/dist/integrations/mcp/memory-manifest.js.map +1 -0
- package/dist/integrations/mcp/memory-transport.d.ts +21 -0
- package/dist/integrations/mcp/memory-transport.d.ts.map +1 -0
- package/dist/integrations/mcp/memory-transport.js +47 -0
- package/dist/integrations/mcp/memory-transport.js.map +1 -0
- package/dist/integrations/mcp/memory.d.ts +19 -0
- package/dist/integrations/mcp/memory.d.ts.map +1 -0
- package/dist/integrations/mcp/memory.js +40 -0
- package/dist/integrations/mcp/memory.js.map +1 -0
- package/dist/loaders/mcp/index.d.ts +1 -0
- package/dist/loaders/mcp/index.d.ts.map +1 -1
- package/dist/loaders/mcp/index.js +1 -0
- package/dist/loaders/mcp/index.js.map +1 -1
- package/dist/loaders/mcp/memory.d.ts +6 -0
- package/dist/loaders/mcp/memory.d.ts.map +1 -0
- package/dist/loaders/mcp/memory.js +9 -0
- package/dist/loaders/mcp/memory.js.map +1 -0
- package/dist/modules/catalog.d.ts +2 -0
- package/dist/modules/catalog.d.ts.map +1 -1
- package/dist/modules/catalog.js +15 -1
- package/dist/modules/catalog.js.map +1 -1
- package/dist/modules/contracts.d.ts +1 -1
- package/dist/modules/contracts.d.ts.map +1 -1
- package/dist/modules/contracts.js +2 -0
- package/dist/modules/contracts.js.map +1 -1
- package/dist/storage/atomic.d.ts +66 -1
- package/dist/storage/atomic.d.ts.map +1 -1
- package/dist/storage/atomic.js +173 -1
- package/dist/storage/atomic.js.map +1 -1
- package/dist/storage/backend.d.ts +3 -0
- package/dist/storage/backend.d.ts.map +1 -1
- package/dist/storage/backend.js +8 -0
- package/dist/storage/backend.js.map +1 -1
- package/dist/storage/contracts.d.ts +13 -0
- package/dist/storage/contracts.d.ts.map +1 -1
- package/dist/storage/contracts.js +12 -0
- package/dist/storage/contracts.js.map +1 -1
- package/dist/storage/instance-ownership.d.ts.map +1 -1
- package/dist/storage/instance-ownership.js +25 -7
- package/dist/storage/instance-ownership.js.map +1 -1
- package/dist/storage/postgres/codec.d.ts +1 -0
- package/dist/storage/postgres/codec.d.ts.map +1 -1
- package/dist/storage/postgres/codec.js +19 -0
- package/dist/storage/postgres/codec.js.map +1 -1
- package/dist/storage/postgres/commit-results.d.ts +6 -0
- package/dist/storage/postgres/commit-results.d.ts.map +1 -0
- package/dist/storage/postgres/commit-results.js +28 -0
- package/dist/storage/postgres/commit-results.js.map +1 -0
- package/dist/storage/postgres/core.d.ts +3 -1
- package/dist/storage/postgres/core.d.ts.map +1 -1
- package/dist/storage/postgres/core.js +99 -36
- package/dist/storage/postgres/core.js.map +1 -1
- package/dist/storage/postgres/effects.d.ts +1 -1
- package/dist/storage/postgres/effects.d.ts.map +1 -1
- package/dist/storage/postgres/effects.js +31 -6
- package/dist/storage/postgres/effects.js.map +1 -1
- package/dist/storage/postgres/errors.d.ts.map +1 -1
- package/dist/storage/postgres/errors.js +13 -0
- package/dist/storage/postgres/errors.js.map +1 -1
- package/dist/storage/postgres/index.d.ts +1 -0
- package/dist/storage/postgres/index.d.ts.map +1 -1
- package/dist/storage/postgres/index.js +1 -0
- package/dist/storage/postgres/index.js.map +1 -1
- package/dist/storage/postgres/instance-guard.d.ts +48 -0
- package/dist/storage/postgres/instance-guard.d.ts.map +1 -0
- package/dist/storage/postgres/instance-guard.js +147 -0
- package/dist/storage/postgres/instance-guard.js.map +1 -0
- package/dist/storage/postgres/instance-ownership.d.ts +22 -0
- package/dist/storage/postgres/instance-ownership.d.ts.map +1 -0
- package/dist/storage/postgres/instance-ownership.js +165 -0
- package/dist/storage/postgres/instance-ownership.js.map +1 -0
- package/dist/storage/postgres/journal.d.ts +24 -8
- package/dist/storage/postgres/journal.d.ts.map +1 -1
- package/dist/storage/postgres/journal.js +43 -32
- package/dist/storage/postgres/journal.js.map +1 -1
- package/dist/storage/postgres/migrations.d.ts +2 -1
- package/dist/storage/postgres/migrations.d.ts.map +1 -1
- package/dist/storage/postgres/migrations.js +14 -4
- package/dist/storage/postgres/migrations.js.map +1 -1
- package/dist/storage/postgres/ordinary-transactions.d.ts.map +1 -1
- package/dist/storage/postgres/ordinary-transactions.js +3 -2
- package/dist/storage/postgres/ordinary-transactions.js.map +1 -1
- package/dist/storage/postgres/profiles.d.ts +15 -8
- package/dist/storage/postgres/profiles.d.ts.map +1 -1
- package/dist/storage/postgres/protocol.d.ts +14 -0
- package/dist/storage/postgres/protocol.d.ts.map +1 -1
- package/dist/storage/postgres/protocol.js.map +1 -1
- package/dist/storage/postgres/queries.js +5 -5
- package/dist/storage/postgres/queries.js.map +1 -1
- package/dist/storage/postgres/readers.js +2 -2
- package/dist/storage/postgres/readers.js.map +1 -1
- package/dist/storage/postgres/roots.d.ts.map +1 -1
- package/dist/storage/postgres/roots.js +10 -6
- package/dist/storage/postgres/roots.js.map +1 -1
- package/dist/storage/postgres/scope.d.ts +17 -8
- package/dist/storage/postgres/scope.d.ts.map +1 -1
- package/dist/storage/postgres/scope.js +4 -0
- package/dist/storage/postgres/scope.js.map +1 -1
- package/dist/storage/postgres/snapshots.d.ts +2 -2
- package/dist/storage/postgres/snapshots.d.ts.map +1 -1
- package/dist/storage/postgres/snapshots.js +7 -4
- package/dist/storage/postgres/snapshots.js.map +1 -1
- package/dist/storage/postgres/transactions.d.ts +11 -0
- package/dist/storage/postgres/transactions.d.ts.map +1 -1
- package/dist/storage/postgres/transactions.js +21 -0
- package/dist/storage/postgres/transactions.js.map +1 -1
- package/dist/storage/u64.d.ts +18 -0
- package/dist/storage/u64.d.ts.map +1 -0
- package/dist/storage/u64.js +54 -0
- package/dist/storage/u64.js.map +1 -0
- package/docs/memory-mcp-candidate.md +46 -0
- package/docs/memory-mcp.md +98 -0
- package/examples/memory-mcp-stdio.mjs +42 -0
- package/package.json +12 -2
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
export declare const MEMORY_NEUTRAL_CONTRACT: {
|
|
2
|
+
readonly name: "engram-memory-neutral-contract";
|
|
3
|
+
readonly version: "1.0.0";
|
|
4
|
+
readonly declaration: "contracts/engram-memory-neutral-contract-v1.d.ts";
|
|
5
|
+
readonly constructor: "openModuleStorageCanonicalMemoryStoreV1";
|
|
6
|
+
readonly engramVersion: "0.21.3";
|
|
7
|
+
readonly contractVersion: "memory-binding-v1";
|
|
8
|
+
readonly contractDigest: "sha256:dd0cccbd6e5e29766fbc9c48351ffe58f5b0a3162152f5ff02da0798c3244fee";
|
|
9
|
+
readonly genericContract: {
|
|
10
|
+
readonly name: "l3a-generic-module-storage-port";
|
|
11
|
+
readonly version: "v4.1";
|
|
12
|
+
readonly digest: "c7111c9e7293ee270a0b4dde277f1cfc40fa3c863c3915c6f9ccdd6935c46294";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const MEMORY_NEUTRAL_HANDLE_METHODS: readonly ["transact", "query", "readAggregate", "readCommitResult", "acquireFence", "checkFence", "releaseFence"];
|
|
16
|
+
export declare const MEMORY_NEUTRAL_TRANSACTION_METHODS: readonly ["readAggregate", "readRecords", "readChain", "findIdempotency", "apply"];
|
|
17
|
+
export interface NeutralEncodedValue {
|
|
18
|
+
readonly format: "utf8";
|
|
19
|
+
readonly data: string;
|
|
20
|
+
}
|
|
21
|
+
export type NeutralChainExpectation = {
|
|
22
|
+
readonly kind: "absent";
|
|
23
|
+
readonly allocation: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: "head";
|
|
26
|
+
readonly hash: string;
|
|
27
|
+
};
|
|
28
|
+
export interface NeutralRecordWrite {
|
|
29
|
+
readonly kind: string;
|
|
30
|
+
readonly key: string;
|
|
31
|
+
readonly value: NeutralEncodedValue;
|
|
32
|
+
readonly contentHash: string;
|
|
33
|
+
}
|
|
34
|
+
export interface NeutralChainAppend {
|
|
35
|
+
readonly chain: string;
|
|
36
|
+
readonly kind: string;
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly hash: string;
|
|
39
|
+
readonly value: NeutralEncodedValue;
|
|
40
|
+
readonly expectation: NeutralChainExpectation;
|
|
41
|
+
}
|
|
42
|
+
export interface NeutralAggregateUpdate {
|
|
43
|
+
readonly kind: string;
|
|
44
|
+
readonly key: string;
|
|
45
|
+
readonly value: NeutralEncodedValue;
|
|
46
|
+
readonly version: string;
|
|
47
|
+
}
|
|
48
|
+
export interface NeutralIndexWrite {
|
|
49
|
+
readonly index: string;
|
|
50
|
+
readonly key: string;
|
|
51
|
+
readonly value: NeutralEncodedValue;
|
|
52
|
+
}
|
|
53
|
+
/** Unused by the memory binding; carried for wire-shape fidelity with F §5.2. */
|
|
54
|
+
export interface NeutralRelationshipChange {
|
|
55
|
+
readonly kind: string;
|
|
56
|
+
}
|
|
57
|
+
/** Unused by the memory binding; carried for wire-shape fidelity with F §5.2. */
|
|
58
|
+
export interface NeutralBarrierWrite {
|
|
59
|
+
readonly kind: string;
|
|
60
|
+
}
|
|
61
|
+
/** Unused by the memory binding; carried for wire-shape fidelity with F §5.2. */
|
|
62
|
+
export interface NeutralAuthorizedPurgeIntent {
|
|
63
|
+
readonly kind: string;
|
|
64
|
+
}
|
|
65
|
+
export interface NeutralGuard {
|
|
66
|
+
readonly kind: "chain-head" | "chain-absent" | "aggregate-version";
|
|
67
|
+
readonly chain?: string;
|
|
68
|
+
readonly hash?: string;
|
|
69
|
+
readonly allocation?: string;
|
|
70
|
+
readonly aggregateKind?: string;
|
|
71
|
+
readonly aggregateKey?: string;
|
|
72
|
+
readonly version?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface NeutralAtomicUnit {
|
|
75
|
+
/** Producer-owned intent: persist and return unchanged with the idempotency entry. */
|
|
76
|
+
readonly intentHash: string;
|
|
77
|
+
readonly guards: ReadonlyArray<NeutralGuard>;
|
|
78
|
+
readonly records: ReadonlyArray<NeutralRecordWrite>;
|
|
79
|
+
readonly appends: ReadonlyArray<NeutralChainAppend>;
|
|
80
|
+
readonly updates: ReadonlyArray<NeutralAggregateUpdate>;
|
|
81
|
+
readonly relationships: ReadonlyArray<NeutralRelationshipChange>;
|
|
82
|
+
readonly barriers: ReadonlyArray<NeutralBarrierWrite>;
|
|
83
|
+
readonly purgeIntents: ReadonlyArray<NeutralAuthorizedPurgeIntent>;
|
|
84
|
+
readonly indexWrites: ReadonlyArray<NeutralIndexWrite>;
|
|
85
|
+
readonly moduleResult?: NeutralEncodedValue;
|
|
86
|
+
}
|
|
87
|
+
export interface NeutralWorkLimits {
|
|
88
|
+
readonly maxAppends: number;
|
|
89
|
+
readonly maxRecords: number;
|
|
90
|
+
readonly maxEncodedBytes: number;
|
|
91
|
+
}
|
|
92
|
+
export interface NeutralStorageScope {
|
|
93
|
+
readonly tenantId: string;
|
|
94
|
+
readonly workspaceId: string;
|
|
95
|
+
}
|
|
96
|
+
export type NeutralGrantLifetime = {
|
|
97
|
+
readonly kind: "invocation";
|
|
98
|
+
readonly invocationId: string;
|
|
99
|
+
} | {
|
|
100
|
+
readonly kind: "lease";
|
|
101
|
+
readonly expiresAt: string;
|
|
102
|
+
};
|
|
103
|
+
export interface NeutralScopeGrant {
|
|
104
|
+
readonly token: string;
|
|
105
|
+
readonly moduleId: string;
|
|
106
|
+
readonly scope: NeutralStorageScope;
|
|
107
|
+
readonly principalId: string;
|
|
108
|
+
readonly operations: ReadonlyArray<string>;
|
|
109
|
+
readonly issuer: string;
|
|
110
|
+
readonly authorityRevision: string;
|
|
111
|
+
readonly policyRevision: string;
|
|
112
|
+
readonly lifetime: NeutralGrantLifetime;
|
|
113
|
+
}
|
|
114
|
+
export interface NeutralProfileClaim {
|
|
115
|
+
readonly name: string;
|
|
116
|
+
readonly version: string;
|
|
117
|
+
readonly digest: string;
|
|
118
|
+
}
|
|
119
|
+
export interface NeutralModuleDescriptor {
|
|
120
|
+
readonly contractVersion: string;
|
|
121
|
+
readonly contractDigest: string;
|
|
122
|
+
readonly schemaVersions: ReadonlyArray<string>;
|
|
123
|
+
readonly requiredProfiles: ReadonlyArray<string>;
|
|
124
|
+
readonly optionalProfiles: ReadonlyArray<string>;
|
|
125
|
+
readonly chainKinds: ReadonlyArray<string>;
|
|
126
|
+
readonly queryNames: ReadonlyArray<string>;
|
|
127
|
+
readonly boundaries: ReadonlyArray<string>;
|
|
128
|
+
readonly pageLimits: {
|
|
129
|
+
readonly maxRecords: number;
|
|
130
|
+
readonly maxEncodedBytes: number;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export interface NeutralFenceProof {
|
|
134
|
+
readonly fenceId: string;
|
|
135
|
+
readonly epoch: string;
|
|
136
|
+
}
|
|
137
|
+
export interface NeutralWriterFence {
|
|
138
|
+
readonly fenceId: string;
|
|
139
|
+
readonly epoch: string;
|
|
140
|
+
}
|
|
141
|
+
export interface NeutralCommitOptions {
|
|
142
|
+
readonly limits: NeutralWorkLimits;
|
|
143
|
+
readonly idempotencyKey?: string;
|
|
144
|
+
readonly grant: NeutralScopeGrant;
|
|
145
|
+
/** Live acquisition identity: verified at entry, after waits, and at final commit validation. */
|
|
146
|
+
readonly fence: NeutralWriterFence;
|
|
147
|
+
}
|
|
148
|
+
export interface NeutralCommitReceipt {
|
|
149
|
+
readonly commitId: string;
|
|
150
|
+
readonly journalCursor: string;
|
|
151
|
+
}
|
|
152
|
+
export interface NeutralAggregateRead {
|
|
153
|
+
readonly kind: string;
|
|
154
|
+
readonly key: string;
|
|
155
|
+
readonly version: string;
|
|
156
|
+
readonly value: NeutralEncodedValue;
|
|
157
|
+
}
|
|
158
|
+
export interface NeutralRecordRead {
|
|
159
|
+
readonly kind: string;
|
|
160
|
+
readonly key: string;
|
|
161
|
+
readonly value: NeutralEncodedValue;
|
|
162
|
+
readonly contentHash: string;
|
|
163
|
+
}
|
|
164
|
+
export interface NeutralChainRecord {
|
|
165
|
+
readonly id: string;
|
|
166
|
+
readonly hash: string;
|
|
167
|
+
readonly value: NeutralEncodedValue;
|
|
168
|
+
}
|
|
169
|
+
export interface NeutralChainPage {
|
|
170
|
+
readonly chain: string;
|
|
171
|
+
readonly records: ReadonlyArray<NeutralChainRecord>;
|
|
172
|
+
}
|
|
173
|
+
export interface NeutralIdempotencySelector {
|
|
174
|
+
readonly commitIdentity: string;
|
|
175
|
+
}
|
|
176
|
+
export interface NeutralIdempotencyEntry {
|
|
177
|
+
readonly key: string;
|
|
178
|
+
readonly intentHash: string;
|
|
179
|
+
readonly moduleResult: NeutralEncodedValue;
|
|
180
|
+
}
|
|
181
|
+
export interface NeutralModuleTransaction {
|
|
182
|
+
readAggregate(kind: string, key: string): Promise<NeutralAggregateRead | null>;
|
|
183
|
+
readRecords(kind: string, keys: ReadonlyArray<string>): Promise<ReadonlyArray<NeutralRecordRead>>;
|
|
184
|
+
readChain(input: {
|
|
185
|
+
chain: string;
|
|
186
|
+
afterAllocation?: string;
|
|
187
|
+
limit: number;
|
|
188
|
+
}): Promise<NeutralChainPage>;
|
|
189
|
+
findIdempotency(selector: NeutralIdempotencySelector): Promise<NeutralIdempotencyEntry | null>;
|
|
190
|
+
apply(unit: NeutralAtomicUnit): Promise<void>;
|
|
191
|
+
}
|
|
192
|
+
export interface NeutralMemoryHandle {
|
|
193
|
+
readonly moduleId: string;
|
|
194
|
+
readonly descriptor: NeutralModuleDescriptor;
|
|
195
|
+
/** Closed backend class (G5 stays blocked: no Spanner member). */
|
|
196
|
+
readonly backend: "memory" | "sqlite" | "postgres";
|
|
197
|
+
readonly profiles: ReadonlyArray<NeutralProfileClaim>;
|
|
198
|
+
transact<T>(options: NeutralCommitOptions, operation: (transaction: NeutralModuleTransaction) => Promise<T>): Promise<{
|
|
199
|
+
readonly value: T;
|
|
200
|
+
readonly receipt: NeutralCommitReceipt;
|
|
201
|
+
}>;
|
|
202
|
+
/** Registered named queries of §4.1 (JCS in, JCS out). */
|
|
203
|
+
query(name: string, input: NeutralEncodedValue, grant: NeutralScopeGrant): Promise<NeutralEncodedValue>;
|
|
204
|
+
/** Snapshot aggregate read outside a transaction (grant-checked). */
|
|
205
|
+
readAggregate(kind: string, key: string, grant: NeutralScopeGrant): Promise<NeutralAggregateRead | null>;
|
|
206
|
+
/**
|
|
207
|
+
* Scoped, authority- and ownership-checked commit-result recovery (R-G4-7).
|
|
208
|
+
* Null when absent. Optional: a port without it degrades post-restart
|
|
209
|
+
* original-receipt replay to an explicit refusal (C4 open), never to a
|
|
210
|
+
* recomputed substitute.
|
|
211
|
+
*/
|
|
212
|
+
readCommitResult?(commitIdentity: string, grant: NeutralScopeGrant): Promise<NeutralEncodedValue | null>;
|
|
213
|
+
/** Canonical-instance acquisition (R-G3-1): refuses a second live holder, never queues. */
|
|
214
|
+
acquireFence(input: {
|
|
215
|
+
scope: NeutralStorageScope;
|
|
216
|
+
store_id: string;
|
|
217
|
+
grant: NeutralScopeGrant;
|
|
218
|
+
}): Promise<NeutralFenceProof>;
|
|
219
|
+
/**
|
|
220
|
+
* Freshness proof bound to the acquisition identity (binding §§9.3–9.6):
|
|
221
|
+
* throws NeutralStorageError on loss, expiry, revocation, or epoch/fence mismatch.
|
|
222
|
+
*/
|
|
223
|
+
checkFence(grant: NeutralScopeGrant, fence: NeutralWriterFence): Promise<void>;
|
|
224
|
+
/** Acquisition-bound release: only the live holder clears the fence; a stale identity never clears a successor. */
|
|
225
|
+
releaseFence(fence: NeutralWriterFence): Promise<void>;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Grant-bound scoped surface returned by a binding `bind` call: the grant
|
|
229
|
+
* is captured at bind time, so methods carry no per-call grant.
|
|
230
|
+
*/
|
|
231
|
+
export interface NeutralBoundScope {
|
|
232
|
+
transact<T>(options: Omit<NeutralCommitOptions, "grant">, operation: (transaction: NeutralModuleTransaction) => Promise<T>): Promise<{
|
|
233
|
+
readonly value: T;
|
|
234
|
+
readonly receipt: NeutralCommitReceipt;
|
|
235
|
+
}>;
|
|
236
|
+
query(name: string, input: NeutralEncodedValue): Promise<NeutralEncodedValue>;
|
|
237
|
+
readAggregate(kind: string, key: string): Promise<NeutralAggregateRead | null>;
|
|
238
|
+
readCommitResult?(commitIdentity: string): Promise<NeutralEncodedValue | null>;
|
|
239
|
+
acquireFence(input: {
|
|
240
|
+
scope: NeutralStorageScope;
|
|
241
|
+
store_id: string;
|
|
242
|
+
}): Promise<NeutralFenceProof>;
|
|
243
|
+
checkFence(fence: NeutralWriterFence): Promise<void>;
|
|
244
|
+
releaseFence(fence: NeutralWriterFence): Promise<void>;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Specified binding interface (binding §6.2, L3a §6.3): the composition
|
|
248
|
+
* binds a grant to a scope and receives the scoped surface. The delivered
|
|
249
|
+
* generic binding is synchronous while the Postgres binding is
|
|
250
|
+
* asynchronous; the constructor awaits either shape and MUST NOT assume
|
|
251
|
+
* one. A pre-bound flat NeutralMemoryHandle stays consumable as-is.
|
|
252
|
+
*/
|
|
253
|
+
export interface NeutralModuleStorageBinding {
|
|
254
|
+
readonly moduleId: string;
|
|
255
|
+
readonly descriptor: NeutralModuleDescriptor;
|
|
256
|
+
/** Closed backend class (G5 stays blocked: no Spanner member). */
|
|
257
|
+
readonly backend: "memory" | "sqlite" | "postgres";
|
|
258
|
+
readonly profiles: ReadonlyArray<NeutralProfileClaim>;
|
|
259
|
+
bind(grant: NeutralScopeGrant): NeutralBoundScope | Promise<NeutralBoundScope>;
|
|
260
|
+
}
|
|
261
|
+
/** Authoritative scope binding for one canonical store (binding §7.2). */
|
|
262
|
+
export interface MemoryScopeBindingV1 {
|
|
263
|
+
/** The one L3a scope this store serves. */
|
|
264
|
+
readonly scope: {
|
|
265
|
+
readonly tenantId: string;
|
|
266
|
+
readonly workspaceId: string;
|
|
267
|
+
};
|
|
268
|
+
/** Durable identity of this canonical store and its journal. */
|
|
269
|
+
readonly store_id: string;
|
|
270
|
+
/**
|
|
271
|
+
* Host authority binding one opaque `scope_ref` to the tenant/workspace
|
|
272
|
+
* pair it belongs to, or null when unknown. Composition-only: never
|
|
273
|
+
* serialized into a memory DTO, a stored value, or a receipt.
|
|
274
|
+
*/
|
|
275
|
+
readonly resolveScope: (scope_ref: string) => {
|
|
276
|
+
readonly tenantId: string;
|
|
277
|
+
readonly workspaceId: string;
|
|
278
|
+
} | null;
|
|
279
|
+
}
|
|
280
|
+
/** Composition contract of the provisional constructor (amendment §1.2, binding §6.2). */
|
|
281
|
+
export interface ModuleStorageMemoryStoreOptionsV1 {
|
|
282
|
+
/**
|
|
283
|
+
* Host-provisioned neutral port for `moduleId: 'engram-memory'`: either a
|
|
284
|
+
* pre-bound flat handle or a grant binding consumed synchronously or
|
|
285
|
+
* asynchronously (binding §6.2, L3a §6.3). Engram never constructs a backend.
|
|
286
|
+
*/
|
|
287
|
+
readonly handle: NeutralMemoryHandle | NeutralModuleStorageBinding;
|
|
288
|
+
/** Authoritative scope binding for this store (binding §7). */
|
|
289
|
+
readonly scope_binding: MemoryScopeBindingV1;
|
|
290
|
+
/** Host-issued grant: module `engram-memory`, the bound scope, exactly `['read', 'write']`. */
|
|
291
|
+
readonly grant: NeutralScopeGrant;
|
|
292
|
+
/** Engram clock: the single time source for `committed_at` sampling and receipts. */
|
|
293
|
+
readonly clock: {
|
|
294
|
+
now(): string;
|
|
295
|
+
};
|
|
296
|
+
/** Acquisition deadline for construction. */
|
|
297
|
+
readonly deadline_at: string;
|
|
298
|
+
/** Optional composition work limits: may raise a qualified bound, never weaken a refusal. */
|
|
299
|
+
readonly work_limits?: MemoryWorkLimitsV1;
|
|
300
|
+
}
|
|
301
|
+
/** Composition work limits: upper bounds only (binding §4.3). */
|
|
302
|
+
export interface MemoryWorkLimitsV1 {
|
|
303
|
+
readonly maxRecords?: number;
|
|
304
|
+
readonly maxEncodedBytes?: number;
|
|
305
|
+
/**
|
|
306
|
+
* Maintenance expiry batch bounds (binding §4.3): expiry work observed by
|
|
307
|
+
* a read commits in units of at most this many appends/records. Absent
|
|
308
|
+
* means the descriptor batch defaults below. The declared ceiling is never
|
|
309
|
+
* derived from observed work sizes.
|
|
310
|
+
*/
|
|
311
|
+
readonly maintenance_max_appends?: number;
|
|
312
|
+
readonly maintenance_max_records?: number;
|
|
313
|
+
}
|
|
314
|
+
export declare const MEMORY_NEUTRAL_ERROR_MAPPING: {
|
|
315
|
+
readonly 'fence-lost': {
|
|
316
|
+
readonly code: "FENCE_LOST";
|
|
317
|
+
readonly terminal: true;
|
|
318
|
+
};
|
|
319
|
+
readonly 'fence-conflict': {
|
|
320
|
+
readonly code: "FENCE_LOST";
|
|
321
|
+
readonly terminal: true;
|
|
322
|
+
};
|
|
323
|
+
readonly unauthorized: {
|
|
324
|
+
readonly code: "UNAUTHORIZED";
|
|
325
|
+
readonly terminal: false;
|
|
326
|
+
};
|
|
327
|
+
readonly 'authorization-expired': {
|
|
328
|
+
readonly code: "AUTHORIZATION_EXPIRED";
|
|
329
|
+
readonly terminal: false;
|
|
330
|
+
};
|
|
331
|
+
readonly 'authorization-revoked': {
|
|
332
|
+
readonly code: "AUTHORIZATION_REVOKED";
|
|
333
|
+
readonly terminal: false;
|
|
334
|
+
};
|
|
335
|
+
readonly 'capability-unavailable': {
|
|
336
|
+
readonly code: "CAPABILITY_UNAVAILABLE";
|
|
337
|
+
readonly terminal: false;
|
|
338
|
+
};
|
|
339
|
+
readonly 'cas-conflict': {
|
|
340
|
+
readonly code: "STORE_UNAVAILABLE";
|
|
341
|
+
readonly terminal: false;
|
|
342
|
+
};
|
|
343
|
+
readonly 'digest-conflict': {
|
|
344
|
+
readonly code: "DIGEST_CONFLICT";
|
|
345
|
+
readonly terminal: false;
|
|
346
|
+
};
|
|
347
|
+
readonly 'limit-exceeded': {
|
|
348
|
+
readonly code: "CAPABILITY_UNAVAILABLE";
|
|
349
|
+
readonly terminal: false;
|
|
350
|
+
};
|
|
351
|
+
readonly 'store-unavailable': {
|
|
352
|
+
readonly code: "STORE_UNAVAILABLE";
|
|
353
|
+
readonly terminal: false;
|
|
354
|
+
};
|
|
355
|
+
readonly 'not-found': {
|
|
356
|
+
readonly code: "NOT_FOUND";
|
|
357
|
+
readonly terminal: false;
|
|
358
|
+
};
|
|
359
|
+
readonly 'invalid-schema': {
|
|
360
|
+
readonly code: "INVALID_SCHEMA";
|
|
361
|
+
readonly terminal: false;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
export type NeutralStorageErrorCode = keyof typeof MEMORY_NEUTRAL_ERROR_MAPPING;
|
|
365
|
+
export interface NeutralStorageFailure {
|
|
366
|
+
readonly code: NeutralStorageErrorCode;
|
|
367
|
+
}
|
|
@@ -28,6 +28,7 @@ export declare const createCommentsPostgresRegistration: (options?: {
|
|
|
28
28
|
export declare const createCommentsPostgresStorage: (options: Omit<PostgresStorageOptions, 'moduleId' | 'assets' | 'descriptor' | 'projection' | 'validateEffects' | 'queries' | 'operations' | 'purgeAuthorize' | 'purgeFinalizer'> & {
|
|
29
29
|
readonly services?: CommentsServiceOptions;
|
|
30
30
|
}) => Promise<Readonly<{
|
|
31
|
+
ownership: import("../storage/postgres/instance-ownership.js").PgInstanceOwnershipSession | null;
|
|
31
32
|
bindNew: (supplied: import("../storage/authority.js").ScopeGrant<unknown>) => Promise<import("../storage/postgres/scope.js").PgScoped>;
|
|
32
33
|
revoke: (token: string) => Promise<void>;
|
|
33
34
|
recoverStaged: (operator: import("../storage/authority.js").ScopeGrant<unknown>, input: import("../storage/postgres/recovery.js").PgRecoveryRequest) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/comments/postgres.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AsB,EAAE,MAAM,0BAA0B,CAAC;AAIvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAcvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,eAAO,MAAM,mBAAmB,EAAE,gBA0BhC,CAAC;AACH,eAAO,MAAM,kCAAkC,aACpC;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;CAAE;;;+BAyD1C,WAAW,gCAAgC,CAAC,CAAC,CAAC,CAAC,WAC/C,WAAW,gCAAgC,CAAC,CAAC,CAAC,CAAC;0BAa/C,WAAW,gCAAgC,CAAC,CAAC,CAAC,CAAC,WAC/C,WAAW,gCAAgC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;GAkB7D,CAAC;AACF,eAAO,MAAM,6BAA6B,YAC/B,KACP,sBAAsB,EACpB,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,SAAS,GACT,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,CACnB,GAAG;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;CAAE;;;;;;;;;;;;;;;;;GASnD,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type ScopeGrant } from '../storage/authority.js';
|
|
2
|
+
import { type StorageScope } from '../storage/contracts.js';
|
|
3
|
+
import { type MemoryPostgresDriverProvider } from './postgres.js';
|
|
4
|
+
import type { HostRecoveryProof, MemoryAuthorityLedger } from './ledger.js';
|
|
5
|
+
/** The only operations Engram's neutral memory handle ever carries. */
|
|
6
|
+
export declare const MEMORY_HANDLE_OPERATIONS: readonly ["read", "write"];
|
|
7
|
+
/**
|
|
8
|
+
* Liveness of a maintain grant: it must carry the maintain operation and,
|
|
9
|
+
* for lease lifetimes, must not be expired. Revocation is checked against
|
|
10
|
+
* the live grants table by the G1b backend at use time; until then the
|
|
11
|
+
* fail-closed ports refuse everything anyway.
|
|
12
|
+
*/
|
|
13
|
+
export declare const assertMaintainGrantLive: (grant: unknown, nowIso?: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Host-only maintenance runner grant: exactly `['read', 'maintain']` (r2
|
|
16
|
+
* P1-C). The kernel needs read-coupled authority for consumer delivery
|
|
17
|
+
* (poison/retry) and snapshot reads, so a maintain-only runner cannot
|
|
18
|
+
* carry the live ports. This grant is never handed to Engram and never
|
|
19
|
+
* carries `write`: a combined read/write/maintain grant is refused at
|
|
20
|
+
* runtime and rejected at compile time (not assignable to this type).
|
|
21
|
+
*/
|
|
22
|
+
export type MemoryMaintainGrant = ScopeGrant<unknown> & {
|
|
23
|
+
readonly operations: readonly ['read', 'maintain'];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Neutral Engram-facing grant: exactly `['read','write']`, minted by the
|
|
27
|
+
* host assembly. It carries no maintain authority by construction.
|
|
28
|
+
*/
|
|
29
|
+
export type MemoryNeutralGrant = ScopeGrant<unknown> & {
|
|
30
|
+
readonly operations: readonly ['read', 'write'];
|
|
31
|
+
};
|
|
32
|
+
export interface MemoryHostBindingInput {
|
|
33
|
+
readonly driver: unknown;
|
|
34
|
+
readonly maintainGrant: unknown;
|
|
35
|
+
readonly invocationId: string;
|
|
36
|
+
readonly storeId: string;
|
|
37
|
+
}
|
|
38
|
+
export interface MemoryHostBinding {
|
|
39
|
+
readonly provider: MemoryPostgresDriverProvider;
|
|
40
|
+
readonly maintainGrant: MemoryMaintainGrant;
|
|
41
|
+
readonly memoryGrant: MemoryNeutralGrant;
|
|
42
|
+
readonly memoryOperations: typeof MEMORY_HANDLE_OPERATIONS;
|
|
43
|
+
/** The store this host composition serves; pinned against ledger entries. */
|
|
44
|
+
readonly storeId: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Kernel check-only authority: `bind` consults the authoritative grants
|
|
48
|
+
* table, so a revoked or never-issued maintain grant is refused by the
|
|
49
|
+
* store itself. Every host authority entry point takes one and binds the
|
|
50
|
+
* maintain grant before any effect.
|
|
51
|
+
*/
|
|
52
|
+
export interface MemoryAuthorityCheck {
|
|
53
|
+
readonly bind: (grant: ScopeGrant<unknown>) => Promise<unknown>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Assemble the host binding: checked PG provider, a host-issued grant with
|
|
57
|
+
* exactly the `['read', 'maintain']` runner operations (a combined
|
|
58
|
+
* read/write/maintain grant is refused — it would leak maintain authority
|
|
59
|
+
* into the write path), and the derived neutral grant (exactly read/write)
|
|
60
|
+
* for the same scope. The two grants are separate objects; Engram receives
|
|
61
|
+
* only the neutral one.
|
|
62
|
+
*/
|
|
63
|
+
export declare const assembleMemoryHostBinding: (input: MemoryHostBindingInput) => MemoryHostBinding;
|
|
64
|
+
/**
|
|
65
|
+
* Verify the binding against the kernel's authoritative grants table by
|
|
66
|
+
* binding the maintain grant: a revoked or never-issued grant is refused
|
|
67
|
+
* by the store itself, not by a local copy. An optional expected scope
|
|
68
|
+
* pins the binding to one scope — a foreign scope is refused even with a
|
|
69
|
+
* live grant. The binder is the kernel's `bind` (check-only, no issue).
|
|
70
|
+
*/
|
|
71
|
+
export declare const verifyHostBinding: (binder: MemoryAuthorityCheck, binding: MemoryHostBinding, scope?: StorageScope, storeId?: string) => Promise<void>;
|
|
72
|
+
/** Fresh host authentication for a later invocation (E8 answer 2). */
|
|
73
|
+
export interface MemoryContinuationAttestation {
|
|
74
|
+
readonly invocationId: string;
|
|
75
|
+
readonly issuedAt: string;
|
|
76
|
+
readonly hostPrincipal: string;
|
|
77
|
+
}
|
|
78
|
+
export interface MemoryContinuation {
|
|
79
|
+
readonly grant: ScopeGrant<unknown>;
|
|
80
|
+
readonly candidateId: string;
|
|
81
|
+
readonly storeId: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Issue the explicit host-controlled continuation grant for a retained
|
|
85
|
+
* candidate. The ledger must already hold the candidate (refusing on an
|
|
86
|
+
* empty or unknown ledger is correct until rehydration); the grant scope
|
|
87
|
+
* always comes from the retained record, so a foreign scope can never be
|
|
88
|
+
* minted; the attestation must carry a fresh invocation identity with host
|
|
89
|
+
* authn. Copied fields never grant: reusing the retained or an
|
|
90
|
+
* already-recorded invocation is refused by the ledger. The grant carries
|
|
91
|
+
* only the neutral operations with the new invocation lifetime, bound to
|
|
92
|
+
* the retained candidate and scope.
|
|
93
|
+
*/
|
|
94
|
+
export declare const issueContinuationGrant: (ledger: MemoryAuthorityLedger, binding: MemoryHostBinding, candidateId: string, attestation: MemoryContinuationAttestation, authority: MemoryAuthorityCheck) => Promise<MemoryContinuation>;
|
|
95
|
+
/** Spent or never-tracked candidate: the host ledger holds no entry. */
|
|
96
|
+
export declare class MemoryMaintenanceNotFoundError extends Error {
|
|
97
|
+
readonly code: "NOT_FOUND";
|
|
98
|
+
constructor(candidateId: string);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Reattach a host maintenance session to a retained candidate. An unknown
|
|
102
|
+
* candidate — never tracked, or drained after its invocation was spent —
|
|
103
|
+
* surfaces NOT_FOUND (never a refusal and never a fresh reservation). A
|
|
104
|
+
* foreign scope is refused; an expired maintain grant cannot reattach.
|
|
105
|
+
*/
|
|
106
|
+
export declare const reattachMemoryMaintenance: (binding: MemoryHostBinding, ledger: MemoryAuthorityLedger, candidateId: string, authority: MemoryAuthorityCheck) => Promise<MemoryMaintainGrant>;
|
|
107
|
+
/**
|
|
108
|
+
* Proof-only recovery through the host binding (E8 answer 4): the caller
|
|
109
|
+
* must hold a live maintain grant for the retained scope — a foreign
|
|
110
|
+
* scope is refused even with a live grant. Unknown or drained candidates
|
|
111
|
+
* are refused; use reattach to distinguish the spent (NOT_FOUND) case.
|
|
112
|
+
* By construction this path cannot write.
|
|
113
|
+
*/
|
|
114
|
+
export declare const proveForRecoveryAuthorized: (ledger: MemoryAuthorityLedger, binding: MemoryHostBinding, candidateId: string, scope: StorageScope | undefined, authority: MemoryAuthorityCheck) => Promise<HostRecovery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