@nicia-ai/typegraph 0.59.0 → 0.60.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/CHANGELOG.md +20 -0
- package/README.md +3 -0
- package/dist/backend/postgres/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +2 -2
- package/dist/backend/postgres/pglite-store.d.ts +2 -2
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.d.cts +2 -2
- package/dist/backend/sqlite/local-store.d.ts +2 -2
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/{chunk-MKQY4ZLZ.js → chunk-2DKIJP2R.js} +73 -41
- package/dist/chunk-2DKIJP2R.js.map +1 -0
- package/dist/{chunk-6BVZHDAZ.js → chunk-43DOTETB.js} +3 -3
- package/dist/{chunk-6BVZHDAZ.js.map → chunk-43DOTETB.js.map} +1 -1
- package/dist/{chunk-IV5W7LKW.cjs → chunk-A22XPVBQ.cjs} +2 -2
- package/dist/chunk-A22XPVBQ.cjs.map +1 -0
- package/dist/{chunk-W4NT4IMI.js → chunk-B4P4DAW3.js} +3 -3
- package/dist/{chunk-W4NT4IMI.js.map → chunk-B4P4DAW3.js.map} +1 -1
- package/dist/{chunk-CA76FVJB.cjs → chunk-CNFKFE5L.cjs} +399 -367
- package/dist/chunk-CNFKFE5L.cjs.map +1 -0
- package/dist/{chunk-EN67I47R.cjs → chunk-EHDLHPMK.cjs} +9 -9
- package/dist/{chunk-EN67I47R.cjs.map → chunk-EHDLHPMK.cjs.map} +1 -1
- package/dist/{chunk-V3JKR2CN.js → chunk-FTDRMXIJ.js} +5 -5
- package/dist/{chunk-V3JKR2CN.js.map → chunk-FTDRMXIJ.js.map} +1 -1
- package/dist/{chunk-3GX5HTPP.js → chunk-ILVXUOQY.js} +3 -3
- package/dist/{chunk-3GX5HTPP.js.map → chunk-ILVXUOQY.js.map} +1 -1
- package/dist/{chunk-XGYUUUHY.cjs → chunk-KGQVK2II.cjs} +40 -40
- package/dist/{chunk-XGYUUUHY.cjs.map → chunk-KGQVK2II.cjs.map} +1 -1
- package/dist/{chunk-BPYZUJX5.cjs → chunk-MTJAT6UO.cjs} +5 -5
- package/dist/{chunk-BPYZUJX5.cjs.map → chunk-MTJAT6UO.cjs.map} +1 -1
- package/dist/{chunk-2GZL5ED3.cjs → chunk-OKA6H3B3.cjs} +19 -19
- package/dist/{chunk-2GZL5ED3.cjs.map → chunk-OKA6H3B3.cjs.map} +1 -1
- package/dist/{chunk-26CL47SW.cjs → chunk-PTFO3JI5.cjs} +110 -110
- package/dist/{chunk-26CL47SW.cjs.map → chunk-PTFO3JI5.cjs.map} +1 -1
- package/dist/{chunk-UOHFBYYH.cjs → chunk-Q6ZVQWH7.cjs} +36 -36
- package/dist/{chunk-UOHFBYYH.cjs.map → chunk-Q6ZVQWH7.cjs.map} +1 -1
- package/dist/{chunk-HWWPL2YL.js → chunk-QWIR5533.js} +2 -2
- package/dist/chunk-QWIR5533.js.map +1 -0
- package/dist/{chunk-DZ3ETMXF.js → chunk-UVQMUBZ6.js} +6 -6
- package/dist/{chunk-DZ3ETMXF.js.map → chunk-UVQMUBZ6.js.map} +1 -1
- package/dist/{chunk-E6PU35DE.js → chunk-W6K6NSRT.js} +4 -4
- package/dist/{chunk-E6PU35DE.js.map → chunk-W6K6NSRT.js.map} +1 -1
- package/dist/graph-merge/index.cjs +119 -119
- package/dist/graph-merge/index.d.cts +2 -2
- package/dist/graph-merge/index.d.ts +2 -2
- package/dist/graph-merge/index.js +7 -7
- package/dist/{graph-templates-DQnmCPkd.d.ts → graph-templates-ClBhrXiA.d.ts} +1 -1
- package/dist/{graph-templates-Buh-RlmQ.d.cts → graph-templates-DfmKDARd.d.cts} +1 -1
- package/dist/index.cjs +68 -68
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/interchange/index.cjs +28 -28
- package/dist/interchange/index.d.cts +2 -2
- package/dist/interchange/index.d.ts +2 -2
- package/dist/interchange/index.js +5 -5
- package/dist/{local-store-impl-GFBZBCTN.cjs → local-store-impl-QGSRYFZF.cjs} +9 -9
- package/dist/{local-store-impl-GFBZBCTN.cjs.map → local-store-impl-QGSRYFZF.cjs.map} +1 -1
- package/dist/{local-store-impl-EPUMDNQJ.js → local-store-impl-VEVK2VGA.js} +8 -8
- package/dist/{local-store-impl-EPUMDNQJ.js.map → local-store-impl-VEVK2VGA.js.map} +1 -1
- package/dist/{pglite-store-impl-DB4RRLB7.cjs → pglite-store-impl-33CI3P3M.cjs} +9 -9
- package/dist/{pglite-store-impl-DB4RRLB7.cjs.map → pglite-store-impl-33CI3P3M.cjs.map} +1 -1
- package/dist/{pglite-store-impl-M5PWKN7Z.js → pglite-store-impl-RDPTOOP3.js} +8 -8
- package/dist/{pglite-store-impl-M5PWKN7Z.js.map → pglite-store-impl-RDPTOOP3.js.map} +1 -1
- package/dist/profiler/index.d.cts +2 -2
- package/dist/profiler/index.d.ts +2 -2
- package/dist/provenance/index.cjs +15 -15
- package/dist/provenance/index.d.cts +2 -2
- package/dist/provenance/index.d.ts +2 -2
- package/dist/provenance/index.js +2 -2
- package/dist/schema/index.cjs +34 -34
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +4 -4
- package/dist/{store-sLu0hcRm.d.ts → store-B5WZ8E5m.d.ts} +225 -215
- package/dist/{store-CvtRQ8Nb.d.cts → store-DdhFpX53.d.cts} +225 -215
- package/package.json +1 -1
- package/dist/chunk-CA76FVJB.cjs.map +0 -1
- package/dist/chunk-HWWPL2YL.js.map +0 -1
- package/dist/chunk-IV5W7LKW.cjs.map +0 -1
- package/dist/chunk-MKQY4ZLZ.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCNFKFE5L_cjs = require('../chunk-CNFKFE5L.cjs');
|
|
4
4
|
require('../chunk-7BHUIAZR.cjs');
|
|
5
5
|
var chunkYE6JZ25V_cjs = require('../chunk-YE6JZ25V.cjs');
|
|
6
6
|
require('../chunk-JFLJVLNU.cjs');
|
|
7
|
-
var
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
7
|
+
var chunkKGQVK2II_cjs = require('../chunk-KGQVK2II.cjs');
|
|
8
|
+
require('../chunk-PTFO3JI5.cjs');
|
|
9
|
+
require('../chunk-MTJAT6UO.cjs');
|
|
10
10
|
require('../chunk-Y6M5BFRJ.cjs');
|
|
11
11
|
require('../chunk-GD7IWK36.cjs');
|
|
12
12
|
require('../chunk-R255UE5U.cjs');
|
|
13
13
|
require('../chunk-XUCVGEJT.cjs');
|
|
14
|
-
var
|
|
14
|
+
var chunkOKA6H3B3_cjs = require('../chunk-OKA6H3B3.cjs');
|
|
15
15
|
require('../chunk-6YKISECL.cjs');
|
|
16
16
|
var chunkUVVDQGOY_cjs = require('../chunk-UVVDQGOY.cjs');
|
|
17
|
-
var
|
|
18
|
-
var
|
|
17
|
+
var chunkQ6ZVQWH7_cjs = require('../chunk-Q6ZVQWH7.cjs');
|
|
18
|
+
var chunkA22XPVBQ_cjs = require('../chunk-A22XPVBQ.cjs');
|
|
19
19
|
var chunkWEXAMJTA_cjs = require('../chunk-WEXAMJTA.cjs');
|
|
20
20
|
var chunkOGK7F2J3_cjs = require('../chunk-OGK7F2J3.cjs');
|
|
21
21
|
var chunkEOLNL35G_cjs = require('../chunk-EOLNL35G.cjs');
|
|
@@ -755,7 +755,7 @@ function identityEndpointKey(assertion) {
|
|
|
755
755
|
return chunkFSSQ4YNU_cjs.encodeTupleKey(endpointTuple(assertion));
|
|
756
756
|
}
|
|
757
757
|
function identitySemanticKey(assertion) {
|
|
758
|
-
return
|
|
758
|
+
return chunkQ6ZVQWH7_cjs.identityAssertionSemanticKey(
|
|
759
759
|
assertion.relation,
|
|
760
760
|
assertion.a,
|
|
761
761
|
assertion.b
|
|
@@ -819,7 +819,7 @@ function assertNoOpposingIdentityRelations(assertions) {
|
|
|
819
819
|
);
|
|
820
820
|
for (const sameAssertion of same) {
|
|
821
821
|
for (const differentAssertion of different) {
|
|
822
|
-
if (!
|
|
822
|
+
if (!chunkQ6ZVQWH7_cjs.identityValidityWindowsOverlap(sameAssertion, differentAssertion)) {
|
|
823
823
|
continue;
|
|
824
824
|
}
|
|
825
825
|
throw new IdentityMergeConflictError(
|
|
@@ -979,7 +979,7 @@ function remapIdentityAssertionEndpoints(assertions, canonicalOf, retypeMap, sto
|
|
|
979
979
|
);
|
|
980
980
|
continue;
|
|
981
981
|
}
|
|
982
|
-
const [a, b] =
|
|
982
|
+
const [a, b] = chunkQ6ZVQWH7_cjs.normalizeIdentityPair(remappedA, remappedB);
|
|
983
983
|
const endpointWindowA = endpointWindows.get(mergeKeyOf(a));
|
|
984
984
|
const endpointWindowB = endpointWindows.get(mergeKeyOf(b));
|
|
985
985
|
const validFrom = [
|
|
@@ -1134,7 +1134,7 @@ async function buildIdentityPeerProbe(target, probedIds, targetPeers, plan, prof
|
|
|
1134
1134
|
(group) => group.map((member) => mergeKey(member.kind, member.id))
|
|
1135
1135
|
)
|
|
1136
1136
|
]);
|
|
1137
|
-
const ledger = (await relevantLedgerAssertions(target, memberKeys,
|
|
1137
|
+
const ledger = (await relevantLedgerAssertions(target, memberKeys, chunkA22XPVBQ_cjs.storeBackend(target))).filter(
|
|
1138
1138
|
(assertion) => !plannedDeletions.has(mergeKey(assertion.a.kind, assertion.a.id)) && !plannedDeletions.has(mergeKey(assertion.b.kind, assertion.b.id))
|
|
1139
1139
|
);
|
|
1140
1140
|
return {
|
|
@@ -1155,7 +1155,7 @@ async function buildIdentityPeerProbe(target, probedIds, targetPeers, plan, prof
|
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
1157
|
async function snapshotIdentityClasses(target, seeds, liveKeys, plannedDeletions, txBackend) {
|
|
1158
|
-
const classes = await
|
|
1158
|
+
const classes = await chunkA22XPVBQ_cjs.storeRuntime(target).structuralIdentityClasses(
|
|
1159
1159
|
seeds,
|
|
1160
1160
|
txBackend
|
|
1161
1161
|
);
|
|
@@ -1163,7 +1163,7 @@ async function snapshotIdentityClasses(target, seeds, liveKeys, plannedDeletions
|
|
|
1163
1163
|
const groups = [];
|
|
1164
1164
|
for (const seed of seeds) {
|
|
1165
1165
|
const key = mergeKey(seed.kind, seed.id);
|
|
1166
|
-
const members = (classes.get(
|
|
1166
|
+
const members = (classes.get(chunkQ6ZVQWH7_cjs.identityReferenceKey(seed)) ?? [seed]).filter(
|
|
1167
1167
|
(member) => !plannedDeletions.has(mergeKey(member.kind, member.id))
|
|
1168
1168
|
);
|
|
1169
1169
|
groups.push(members);
|
|
@@ -1172,7 +1172,7 @@ async function snapshotIdentityClasses(target, seeds, liveKeys, plannedDeletions
|
|
|
1172
1172
|
return { fingerprints, groups };
|
|
1173
1173
|
}
|
|
1174
1174
|
async function relevantLedgerAssertions(target, memberKeys, backend) {
|
|
1175
|
-
const current = await
|
|
1175
|
+
const current = await chunkA22XPVBQ_cjs.storeRuntime(target).identityAssertionsAtTarget(
|
|
1176
1176
|
backend,
|
|
1177
1177
|
"state"
|
|
1178
1178
|
);
|
|
@@ -1245,7 +1245,7 @@ async function assertPlannedIdentityIdsFresh(target, txBackend, plan) {
|
|
|
1245
1245
|
...plan.identityRetractions.map((retraction) => retraction.id)
|
|
1246
1246
|
];
|
|
1247
1247
|
if (plannedIds.length === 0) return;
|
|
1248
|
-
const storedById = await
|
|
1248
|
+
const storedById = await chunkA22XPVBQ_cjs.storeRuntime(target).identityAssertionRowsByIds(
|
|
1249
1249
|
plannedIds,
|
|
1250
1250
|
txBackend
|
|
1251
1251
|
);
|
|
@@ -1298,7 +1298,7 @@ function affectedIdentityClassSeeds(plan, profile) {
|
|
|
1298
1298
|
return [...seedsByKey.values()];
|
|
1299
1299
|
}
|
|
1300
1300
|
async function assertMergedIdentityClassesConsistent(target, txBackend, plan) {
|
|
1301
|
-
await
|
|
1301
|
+
await chunkA22XPVBQ_cjs.storeRuntime(target).assertIdentityClassesConsistentAtTarget(
|
|
1302
1302
|
txBackend,
|
|
1303
1303
|
affectedIdentityClassSeeds(plan, target.graph.identity?.sameIdAcrossKinds)
|
|
1304
1304
|
);
|
|
@@ -1352,7 +1352,7 @@ function translateIdentityCommitError(error) {
|
|
|
1352
1352
|
}
|
|
1353
1353
|
async function assertIdentityPeersStable(target, txBackend, probe, plan) {
|
|
1354
1354
|
if (probe === void 0) return;
|
|
1355
|
-
const live = (await
|
|
1355
|
+
const live = (await chunkA22XPVBQ_cjs.storeRuntime(target).liveNodesSharingIds(probe.ids, txBackend)).filter((peer) => !probe.plannedDeletions.has(mergeKey(peer.kind, peer.id)));
|
|
1356
1356
|
const seedKindsById = /* @__PURE__ */ new Map();
|
|
1357
1357
|
for (const seed of probe.seeds) {
|
|
1358
1358
|
const kinds = seedKindsById.get(seed.id) ?? /* @__PURE__ */ new Set();
|
|
@@ -1482,7 +1482,7 @@ function filterRowsByIds(rows, ids) {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
async function fetchNodesByIds(backend, graphId, kind, ids) {
|
|
1484
1484
|
if (ids.length === 0) return [];
|
|
1485
|
-
const rowsById2 = await
|
|
1485
|
+
const rowsById2 = await chunkA22XPVBQ_cjs.getNodeRowsByIds(
|
|
1486
1486
|
backend,
|
|
1487
1487
|
chunkOGK7F2J3_cjs.batchPointReadVerdict(backend),
|
|
1488
1488
|
graphId,
|
|
@@ -1493,7 +1493,7 @@ async function fetchNodesByIds(backend, graphId, kind, ids) {
|
|
|
1493
1493
|
}
|
|
1494
1494
|
async function fetchEdgesByIds(backend, graphId, kind, ids) {
|
|
1495
1495
|
if (ids.length === 0) return [];
|
|
1496
|
-
const rowsById2 = await
|
|
1496
|
+
const rowsById2 = await chunkA22XPVBQ_cjs.getEdgeRowsByIds(
|
|
1497
1497
|
backend,
|
|
1498
1498
|
chunkOGK7F2J3_cjs.batchPointReadVerdict(backend),
|
|
1499
1499
|
graphId,
|
|
@@ -1682,8 +1682,8 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true, pr
|
|
|
1682
1682
|
const nodeKinds = chunk6ODVH5SA_cjs.getNodeKinds(graph);
|
|
1683
1683
|
const edgeKinds = chunk6ODVH5SA_cjs.getEdgeKinds(graph);
|
|
1684
1684
|
const [baseIdentity, forkIdentity] = await Promise.all([
|
|
1685
|
-
|
|
1686
|
-
|
|
1685
|
+
chunkA22XPVBQ_cjs.storeRuntime(baseStore).readCurrentIdentityAssertions("archival"),
|
|
1686
|
+
chunkA22XPVBQ_cjs.storeRuntime(forkStore).readCurrentIdentityAssertions("archival")
|
|
1687
1687
|
]);
|
|
1688
1688
|
const baseIdentityById = new Map(
|
|
1689
1689
|
baseIdentity.map((assertion) => [assertion.id, assertion])
|
|
@@ -1699,21 +1699,21 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true, pr
|
|
|
1699
1699
|
for (const kind of nodeKinds) {
|
|
1700
1700
|
const nodeIds = prunedKeys === void 0 ? [] : idsForKind(prunedKeys.nodes, kind);
|
|
1701
1701
|
const baseRows = prunedKeys === void 0 ? await enumerateAllNodes(
|
|
1702
|
-
|
|
1702
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
1703
1703
|
baseStore.graphId,
|
|
1704
1704
|
kind
|
|
1705
1705
|
) : await fetchNodesByIds(
|
|
1706
|
-
|
|
1706
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
1707
1707
|
baseStore.graphId,
|
|
1708
1708
|
kind,
|
|
1709
1709
|
nodeIds
|
|
1710
1710
|
);
|
|
1711
1711
|
const forkRowsFetched = captureForkState || prunedKeys === void 0 ? await enumerateAllNodes(
|
|
1712
|
-
|
|
1712
|
+
chunkA22XPVBQ_cjs.storeBackend(forkStore),
|
|
1713
1713
|
forkStore.graphId,
|
|
1714
1714
|
kind
|
|
1715
1715
|
) : await fetchNodesByIds(
|
|
1716
|
-
|
|
1716
|
+
chunkA22XPVBQ_cjs.storeBackend(forkStore),
|
|
1717
1717
|
forkStore.graphId,
|
|
1718
1718
|
kind,
|
|
1719
1719
|
nodeIds
|
|
@@ -1746,21 +1746,21 @@ async function diffAgainstBase(baseStore, forkStore, captureForkState = true, pr
|
|
|
1746
1746
|
for (const kind of edgeKinds) {
|
|
1747
1747
|
const edgeIds = prunedKeys === void 0 ? [] : idsForKind(prunedKeys.edges, kind);
|
|
1748
1748
|
const baseRows = prunedKeys === void 0 ? await enumerateAllEdges(
|
|
1749
|
-
|
|
1749
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
1750
1750
|
baseStore.graphId,
|
|
1751
1751
|
kind
|
|
1752
1752
|
) : await fetchEdgesByIds(
|
|
1753
|
-
|
|
1753
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
1754
1754
|
baseStore.graphId,
|
|
1755
1755
|
kind,
|
|
1756
1756
|
edgeIds
|
|
1757
1757
|
);
|
|
1758
1758
|
const forkRowsFetched = captureForkState || prunedKeys === void 0 ? await enumerateAllEdges(
|
|
1759
|
-
|
|
1759
|
+
chunkA22XPVBQ_cjs.storeBackend(forkStore),
|
|
1760
1760
|
forkStore.graphId,
|
|
1761
1761
|
kind
|
|
1762
1762
|
) : await fetchEdgesByIds(
|
|
1763
|
-
|
|
1763
|
+
chunkA22XPVBQ_cjs.storeBackend(forkStore),
|
|
1764
1764
|
forkStore.graphId,
|
|
1765
1765
|
kind,
|
|
1766
1766
|
edgeIds
|
|
@@ -1860,10 +1860,10 @@ async function readActiveSchemaVersion(backend, graphId) {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
async function computeSchemaComponent(store) {
|
|
1862
1862
|
const version = await readActiveSchemaVersion(
|
|
1863
|
-
|
|
1863
|
+
chunkA22XPVBQ_cjs.storeBackend(store),
|
|
1864
1864
|
store.graphId
|
|
1865
1865
|
);
|
|
1866
|
-
return
|
|
1866
|
+
return chunkOKA6H3B3_cjs.computeSchemaHash(chunkOKA6H3B3_cjs.serializeSchema(store.graph, version));
|
|
1867
1867
|
}
|
|
1868
1868
|
function byDigestEntry(left, right) {
|
|
1869
1869
|
const byKind = chunkNYWU6CBZ_cjs.compareStrings(left.kind, right.kind);
|
|
@@ -1922,15 +1922,15 @@ async function computeBaseVersion(store) {
|
|
|
1922
1922
|
computeSchemaComponent(store),
|
|
1923
1923
|
store.revisionOriginNow(),
|
|
1924
1924
|
store.revisionNow(),
|
|
1925
|
-
readActiveSchemaVersion(
|
|
1925
|
+
readActiveSchemaVersion(chunkA22XPVBQ_cjs.storeBackend(store), store.graphId)
|
|
1926
1926
|
]);
|
|
1927
1927
|
return asBaseVersion(
|
|
1928
1928
|
`${schemaComponent2}${SCHEMA_VERSION_TAG}${activeVersion}${TOKEN_SEPARATOR}${revisionComponent(origin, revision)}`
|
|
1929
1929
|
);
|
|
1930
1930
|
}
|
|
1931
|
-
const lineage =
|
|
1931
|
+
const lineage = chunkA22XPVBQ_cjs.resolveLineage(store);
|
|
1932
1932
|
if (lineage !== void 0) {
|
|
1933
|
-
const backend =
|
|
1933
|
+
const backend = chunkA22XPVBQ_cjs.storeBackend(store);
|
|
1934
1934
|
const [schemaComponent2, activeVersion, origin, revision] = await Promise.all([
|
|
1935
1935
|
computeSchemaComponent(store),
|
|
1936
1936
|
readActiveSchemaVersion(backend, store.graphId),
|
|
@@ -1940,7 +1940,7 @@ async function computeBaseVersion(store) {
|
|
|
1940
1940
|
// tracking) still gets a durable per-graph namespace to distinguish
|
|
1941
1941
|
// it from an unrelated database whose engine coincidentally reports
|
|
1942
1942
|
// the same revision. See `engineComponent`'s own doc.
|
|
1943
|
-
|
|
1943
|
+
chunkA22XPVBQ_cjs.ensureRevisionOrigin(
|
|
1944
1944
|
backend,
|
|
1945
1945
|
chunkOGK7F2J3_cjs.recordedRevisionOriginsVerdict(backend),
|
|
1946
1946
|
store.revisionSchema,
|
|
@@ -1961,9 +1961,9 @@ async function computeBaseVersion(store) {
|
|
|
1961
1961
|
);
|
|
1962
1962
|
}
|
|
1963
1963
|
async function computeStoreContentComponent(store) {
|
|
1964
|
-
const identityAssertions = await
|
|
1964
|
+
const identityAssertions = await chunkA22XPVBQ_cjs.storeRuntime(store).readCurrentIdentityAssertions("state");
|
|
1965
1965
|
return computeContentComponent(
|
|
1966
|
-
|
|
1966
|
+
chunkA22XPVBQ_cjs.storeBackend(store),
|
|
1967
1967
|
store.graphId,
|
|
1968
1968
|
store.graph,
|
|
1969
1969
|
identityAssertions
|
|
@@ -2017,7 +2017,7 @@ function revisionOriginOf(version) {
|
|
|
2017
2017
|
}
|
|
2018
2018
|
async function revisionOriginMatch(backend, schema, graphId, expectedVersion) {
|
|
2019
2019
|
const expectedOrigin = revisionOriginOf(expectedVersion) ?? engineAnchorOriginOf(expectedVersion);
|
|
2020
|
-
const liveOrigin = await
|
|
2020
|
+
const liveOrigin = await chunkA22XPVBQ_cjs.readRevisionOrigin(backend, schema, graphId);
|
|
2021
2021
|
return { expectedOrigin, liveOrigin, matches: liveOrigin === expectedOrigin };
|
|
2022
2022
|
}
|
|
2023
2023
|
function revisionPartsOf(version) {
|
|
@@ -2044,9 +2044,9 @@ function schemaActiveVersionOf(version) {
|
|
|
2044
2044
|
async function lineageDeltaSinceAnchor(baseStore, base) {
|
|
2045
2045
|
const revisionAnchor = revisionAnchorOf(base);
|
|
2046
2046
|
if (revisionAnchor !== void 0) {
|
|
2047
|
-
if (!
|
|
2047
|
+
if (!chunkA22XPVBQ_cjs.storeCaptureEnabled(baseStore)) return void 0;
|
|
2048
2048
|
const originMatch = await revisionOriginMatch(
|
|
2049
|
-
|
|
2049
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
2050
2050
|
baseStore.revisionSchema,
|
|
2051
2051
|
baseStore.graphId,
|
|
2052
2052
|
base
|
|
@@ -2054,25 +2054,25 @@ async function lineageDeltaSinceAnchor(baseStore, base) {
|
|
|
2054
2054
|
if (!originMatch.matches || originMatch.liveOrigin === void 0) {
|
|
2055
2055
|
return void 0;
|
|
2056
2056
|
}
|
|
2057
|
-
return
|
|
2058
|
-
|
|
2059
|
-
|
|
2057
|
+
return chunkA22XPVBQ_cjs.recordedRelationsLineage(baseStore).changesSince(
|
|
2058
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
2059
|
+
chunkA22XPVBQ_cjs.encodeRecordedLineageRevision(originMatch.liveOrigin, revisionAnchor),
|
|
2060
2060
|
baseStore.graphId
|
|
2061
2061
|
);
|
|
2062
2062
|
}
|
|
2063
2063
|
const engineAnchor = engineAnchorOf(base);
|
|
2064
2064
|
if (engineAnchor === void 0) return void 0;
|
|
2065
2065
|
const engineOriginMatch = await revisionOriginMatch(
|
|
2066
|
-
|
|
2066
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
2067
2067
|
baseStore.revisionSchema,
|
|
2068
2068
|
baseStore.graphId,
|
|
2069
2069
|
base
|
|
2070
2070
|
);
|
|
2071
2071
|
if (!engineOriginMatch.matches) return void 0;
|
|
2072
|
-
const lineage =
|
|
2072
|
+
const lineage = chunkA22XPVBQ_cjs.resolveLineage(baseStore);
|
|
2073
2073
|
if (lineage === void 0) return void 0;
|
|
2074
2074
|
return lineage.changesSince(
|
|
2075
|
-
|
|
2075
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
2076
2076
|
engineAnchor,
|
|
2077
2077
|
baseStore.graphId
|
|
2078
2078
|
);
|
|
@@ -2097,7 +2097,7 @@ function cloneWorkingCopyWithGraphStrategy(makeBackend, graphForClone) {
|
|
|
2097
2097
|
create: async (baseStore) => {
|
|
2098
2098
|
const backend = await makeBackend();
|
|
2099
2099
|
try {
|
|
2100
|
-
const [freshStore] = await
|
|
2100
|
+
const [freshStore] = await chunkCNFKFE5L_cjs.createStoreWithSchema(
|
|
2101
2101
|
graphForClone(baseStore),
|
|
2102
2102
|
backend,
|
|
2103
2103
|
{
|
|
@@ -2133,15 +2133,15 @@ function cloneWorkingCopyWithGraphStrategy(makeBackend, graphForClone) {
|
|
|
2133
2133
|
batchSize: CLONE_IMPORT_BATCH_SIZE
|
|
2134
2134
|
};
|
|
2135
2135
|
const result = chunkEOLNL35G_cjs.snapshotExportContention(
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
) === void 0 ? await
|
|
2136
|
+
chunkA22XPVBQ_cjs.storeBackend(baseStore),
|
|
2137
|
+
chunkA22XPVBQ_cjs.storeBackend(freshStore)
|
|
2138
|
+
) === void 0 ? await chunkKGQVK2II_cjs.importGraphStream(
|
|
2139
2139
|
freshStore,
|
|
2140
|
-
|
|
2140
|
+
chunkKGQVK2II_cjs.exportGraphStream(baseStore, exportOptions),
|
|
2141
2141
|
importOptions
|
|
2142
|
-
) : await
|
|
2142
|
+
) : await chunkKGQVK2II_cjs.importGraph(
|
|
2143
2143
|
freshStore,
|
|
2144
|
-
await
|
|
2144
|
+
await chunkKGQVK2II_cjs.exportGraph(baseStore, exportOptions),
|
|
2145
2145
|
importOptions
|
|
2146
2146
|
);
|
|
2147
2147
|
if (!result.success) {
|
|
@@ -2177,7 +2177,7 @@ function resolvedTableNamesEqual(a, b) {
|
|
|
2177
2177
|
return [...keys].every((key) => a[key] === b[key]);
|
|
2178
2178
|
}
|
|
2179
2179
|
function forkAliasesBase(connectedBackend, baseStore) {
|
|
2180
|
-
const baseBackend =
|
|
2180
|
+
const baseBackend = chunkA22XPVBQ_cjs.storeBackend(baseStore);
|
|
2181
2181
|
return connectedBackend === baseBackend || chunkEOLNL35G_cjs.isBackendDerivedFrom(connectedBackend, baseBackend) || chunkEOLNL35G_cjs.isBackendDerivedFrom(baseBackend, connectedBackend) || chunkEOLNL35G_cjs.sharesSerializedTransactionResource(connectedBackend, baseBackend);
|
|
2182
2182
|
}
|
|
2183
2183
|
function coalescedWorkingCopyClose(store) {
|
|
@@ -2185,7 +2185,7 @@ function coalescedWorkingCopyClose(store) {
|
|
|
2185
2185
|
let inFlight;
|
|
2186
2186
|
return async () => {
|
|
2187
2187
|
if (closed) return;
|
|
2188
|
-
inFlight ??=
|
|
2188
|
+
inFlight ??= chunkA22XPVBQ_cjs.storeBackend(store).close().then(() => {
|
|
2189
2189
|
closed = true;
|
|
2190
2190
|
}).finally(() => {
|
|
2191
2191
|
inFlight = void 0;
|
|
@@ -2231,7 +2231,7 @@ function forkedWorkingCopyStrategy(options) {
|
|
|
2231
2231
|
{ details: { inheritedTables, connectedTables } }
|
|
2232
2232
|
);
|
|
2233
2233
|
}
|
|
2234
|
-
const forkStore =
|
|
2234
|
+
const forkStore = chunkCNFKFE5L_cjs.createStore(baseStore.graph, backend, forkOptions);
|
|
2235
2235
|
const forkVersion = await computeBaseVersion(forkStore);
|
|
2236
2236
|
if (forkVersion !== base) {
|
|
2237
2237
|
throw new BranchError(
|
|
@@ -2279,7 +2279,7 @@ function graphWithoutNodeUniqueness(graph) {
|
|
|
2279
2279
|
async function branch(baseStore, makeBackend, options, strategy) {
|
|
2280
2280
|
try {
|
|
2281
2281
|
const base = await computeBaseVersion(baseStore);
|
|
2282
|
-
const id = options?.id ?? asBranchId(
|
|
2282
|
+
const id = options?.id ?? asBranchId(chunkA22XPVBQ_cjs.generateId());
|
|
2283
2283
|
const workingCopyStrategy = strategy ?? cloneWorkingCopyStrategy(makeBackend);
|
|
2284
2284
|
const store = await workingCopyStrategy.create(baseStore, base);
|
|
2285
2285
|
const { schemaAnchor, forkRevision } = await captureBranchForkState(store);
|
|
@@ -2301,14 +2301,14 @@ async function branch(baseStore, makeBackend, options, strategy) {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
async function captureBranchForkState(store) {
|
|
2303
2303
|
try {
|
|
2304
|
-
const schemaRow = await
|
|
2304
|
+
const schemaRow = await chunkA22XPVBQ_cjs.storeBackend(store).getActiveSchema(store.graphId);
|
|
2305
2305
|
const schemaAnchor = schemaRow === void 0 ? void 0 : { version: schemaRow.version, hash: schemaRow.schema_hash };
|
|
2306
|
-
const lineage =
|
|
2307
|
-
const forkRevision = lineage === void 0 ? void 0 : await lineage.revision(
|
|
2306
|
+
const lineage = chunkA22XPVBQ_cjs.resolveLineage(store);
|
|
2307
|
+
const forkRevision = lineage === void 0 ? void 0 : await lineage.revision(chunkA22XPVBQ_cjs.storeBackend(store));
|
|
2308
2308
|
return { schemaAnchor, forkRevision };
|
|
2309
2309
|
} catch (error) {
|
|
2310
2310
|
try {
|
|
2311
|
-
await
|
|
2311
|
+
await chunkA22XPVBQ_cjs.storeBackend(store).close();
|
|
2312
2312
|
} catch {
|
|
2313
2313
|
}
|
|
2314
2314
|
throw error;
|
|
@@ -2364,7 +2364,7 @@ async function ingestionBranch(baseStore, makeBackend, options) {
|
|
|
2364
2364
|
close: coalescedWorkingCopyClose(store)
|
|
2365
2365
|
});
|
|
2366
2366
|
PRIVATE_BRANCHES.set(handle, privateBranch);
|
|
2367
|
-
|
|
2367
|
+
chunkKGQVK2II_cjs.registerIngestionImportTarget(handle, store);
|
|
2368
2368
|
return chunkVF42UUBN_cjs.ok(handle);
|
|
2369
2369
|
} catch (error) {
|
|
2370
2370
|
return chunkVF42UUBN_cjs.err(
|
|
@@ -2387,8 +2387,8 @@ function unwrapMergeBranches(inputs) {
|
|
|
2387
2387
|
|
|
2388
2388
|
// src/graph-merge/apply-callbacks.ts
|
|
2389
2389
|
var NODE_READ_NAMES = [
|
|
2390
|
-
...
|
|
2391
|
-
...
|
|
2390
|
+
...chunkCNFKFE5L_cjs.NODE_TEMPORAL_READ_NAMES,
|
|
2391
|
+
...chunkCNFKFE5L_cjs.CURRENT_ONLY_READ_NAMES
|
|
2392
2392
|
];
|
|
2393
2393
|
function pickReadMethods(source, names) {
|
|
2394
2394
|
return Object.fromEntries(names.map((name) => [name, source[name]]));
|
|
@@ -2406,12 +2406,12 @@ function mergePlanReadContext(tx, graph) {
|
|
|
2406
2406
|
kind,
|
|
2407
2407
|
pickReadMethods(
|
|
2408
2408
|
chunkBXHAPCQG_cjs.requireDefined(tx.edges[kind]),
|
|
2409
|
-
|
|
2409
|
+
chunkCNFKFE5L_cjs.EDGE_TEMPORAL_READ_NAMES
|
|
2410
2410
|
)
|
|
2411
2411
|
])
|
|
2412
2412
|
),
|
|
2413
2413
|
..."identity" in tx ? {
|
|
2414
|
-
identity: pickReadMethods(tx.identity,
|
|
2414
|
+
identity: pickReadMethods(tx.identity, chunkCNFKFE5L_cjs.IDENTITY_READ_NAMES)
|
|
2415
2415
|
} : {}
|
|
2416
2416
|
};
|
|
2417
2417
|
}
|
|
@@ -5229,7 +5229,7 @@ function buildProvenanceGraph(targetGraphId) {
|
|
|
5229
5229
|
});
|
|
5230
5230
|
}
|
|
5231
5231
|
async function openProvenanceStore(...args) {
|
|
5232
|
-
const [backend, targetGraphId] = args.length === 1 ? [
|
|
5232
|
+
const [backend, targetGraphId] = args.length === 1 ? [chunkA22XPVBQ_cjs.storeBackend(args[0]), args[0].graphId] : args;
|
|
5233
5233
|
const graph = buildOwnedProvenanceGraph(targetGraphId);
|
|
5234
5234
|
const preflight = await inspectSidecarGraphId(backend, graph, targetGraphId);
|
|
5235
5235
|
if (preflight.state === "refuse") {
|
|
@@ -5241,7 +5241,7 @@ async function openProvenanceStore(...args) {
|
|
|
5241
5241
|
throw provenanceGraphIdCollision(graph.id, targetGraphId, claim.reason);
|
|
5242
5242
|
}
|
|
5243
5243
|
}
|
|
5244
|
-
const [store] = await
|
|
5244
|
+
const [store] = await chunkCNFKFE5L_cjs.createStoreWithSchema(graph, backend);
|
|
5245
5245
|
return store;
|
|
5246
5246
|
}
|
|
5247
5247
|
async function claimSidecarOwnership(backend, graph, targetGraphId) {
|
|
@@ -5311,14 +5311,14 @@ async function inspectSidecarGraphId(port, graph, targetGraphId) {
|
|
|
5311
5311
|
if (activeSchema === void 0) {
|
|
5312
5312
|
return { state: "refuse", reason: "application-graph" };
|
|
5313
5313
|
}
|
|
5314
|
-
const ownedHash = await
|
|
5315
|
-
|
|
5314
|
+
const ownedHash = await chunkOKA6H3B3_cjs.computeSchemaHash(
|
|
5315
|
+
chunkOKA6H3B3_cjs.serializeSchema(graph, activeSchema.version)
|
|
5316
5316
|
);
|
|
5317
5317
|
if (activeSchema.schema_hash === ownedHash) {
|
|
5318
5318
|
return { state: "refuse", reason: "unowned-exact-schema-graph" };
|
|
5319
5319
|
}
|
|
5320
|
-
const legacyHash = await
|
|
5321
|
-
|
|
5320
|
+
const legacyHash = await chunkOKA6H3B3_cjs.computeSchemaHash(
|
|
5321
|
+
chunkOKA6H3B3_cjs.serializeSchema(buildProvenanceGraph(targetGraphId), activeSchema.version)
|
|
5322
5322
|
);
|
|
5323
5323
|
if (activeSchema.schema_hash !== legacyHash) {
|
|
5324
5324
|
return { state: "refuse", reason: "application-graph" };
|
|
@@ -6017,12 +6017,12 @@ function dedupeEntityKeys(keys) {
|
|
|
6017
6017
|
}
|
|
6018
6018
|
async function branchPruneTo(baseStore, branch2) {
|
|
6019
6019
|
if (branch2.forkRevision === void 0) return void 0;
|
|
6020
|
-
const forkLineage =
|
|
6020
|
+
const forkLineage = chunkA22XPVBQ_cjs.resolveLineage(branch2.store);
|
|
6021
6021
|
if (forkLineage === void 0) return void 0;
|
|
6022
6022
|
const forkRevision = branch2.forkRevision;
|
|
6023
6023
|
const forkDelta = await safeLineageDelta(
|
|
6024
6024
|
() => forkLineage.changesSince(
|
|
6025
|
-
|
|
6025
|
+
chunkA22XPVBQ_cjs.storeBackend(branch2.store),
|
|
6026
6026
|
forkRevision,
|
|
6027
6027
|
branch2.store.graphId
|
|
6028
6028
|
)
|
|
@@ -6056,7 +6056,7 @@ async function stageBranches(baseStore, branches, captureTargetStateFor) {
|
|
|
6056
6056
|
const windowedEdges = [];
|
|
6057
6057
|
const newIdentityAssertions = [];
|
|
6058
6058
|
const retractedIdentityAssertions = [];
|
|
6059
|
-
const baseIdentityAssertions = await
|
|
6059
|
+
const baseIdentityAssertions = await chunkA22XPVBQ_cjs.storeRuntime(baseStore).readCurrentIdentityAssertions("state");
|
|
6060
6060
|
let targetNodeVersions = /* @__PURE__ */ new Map();
|
|
6061
6061
|
let targetEdgeSignatures = /* @__PURE__ */ new Map();
|
|
6062
6062
|
for (const branch2 of branches) {
|
|
@@ -6216,7 +6216,7 @@ function reconcileTypes(clusters, closure, mode) {
|
|
|
6216
6216
|
// src/graph-merge/write-fence.ts
|
|
6217
6217
|
async function lockMergeTargetWrite(txBackend, input) {
|
|
6218
6218
|
try {
|
|
6219
|
-
await
|
|
6219
|
+
await chunkA22XPVBQ_cjs.lockSchemaVersionForStoreWrite(
|
|
6220
6220
|
{ graphId: input.graphId, schemaVersion: input.schemaVersion },
|
|
6221
6221
|
txBackend
|
|
6222
6222
|
);
|
|
@@ -6227,7 +6227,7 @@ async function lockMergeTargetWrite(txBackend, input) {
|
|
|
6227
6227
|
throw input.staleSchemaError(error);
|
|
6228
6228
|
}
|
|
6229
6229
|
if (input.graphLock === "required") {
|
|
6230
|
-
const lock = await
|
|
6230
|
+
const lock = await chunkA22XPVBQ_cjs.lockRecordedGraphWrite(txBackend, input.graphId);
|
|
6231
6231
|
if (input.requireFreshSnapshot && lock.coordination !== void 0) {
|
|
6232
6232
|
const isolation = chunkEOLNL35G_cjs.graphCommandCoordinationIsolation(
|
|
6233
6233
|
txBackend.commands,
|
|
@@ -7190,7 +7190,7 @@ async function applyNodeRows(target, txBackend, nodesApi, deletions, upserts) {
|
|
|
7190
7190
|
afterImages.set(mergeKey(kind, item.id), props);
|
|
7191
7191
|
}
|
|
7192
7192
|
}
|
|
7193
|
-
return
|
|
7193
|
+
return chunkA22XPVBQ_cjs.storeRuntime(target).applyResolvedNodeUniqueness(
|
|
7194
7194
|
txBackend,
|
|
7195
7195
|
{
|
|
7196
7196
|
upserts: upserts.map((upsert) => ({
|
|
@@ -7238,7 +7238,7 @@ async function applyEdgeRows(edgesApi, deletions, upserts) {
|
|
|
7238
7238
|
}
|
|
7239
7239
|
async function applyIdentityRows(target, txBackend, assertions, retractions, assertConsistent) {
|
|
7240
7240
|
try {
|
|
7241
|
-
const applied = await
|
|
7241
|
+
const applied = await chunkA22XPVBQ_cjs.storeRuntime(target).applyIdentityMergeAtTarget(
|
|
7242
7242
|
txBackend,
|
|
7243
7243
|
retractions,
|
|
7244
7244
|
assertions
|
|
@@ -7337,7 +7337,7 @@ async function applyInternalMergePlan(plan, nodesApi, edgesApi, target, txBacken
|
|
|
7337
7337
|
}
|
|
7338
7338
|
var MERGE_COMMIT_ATTEMPTS = 3;
|
|
7339
7339
|
async function commitPlan(target, plan, expectedBaseVersion) {
|
|
7340
|
-
if (!
|
|
7340
|
+
if (!chunkA22XPVBQ_cjs.storeBackend(target).capabilities.execution.interactiveTransactions) {
|
|
7341
7341
|
throw new MergeError(
|
|
7342
7342
|
"merge() requires a transaction-capable target backend. The merged plan (canonical upserts, soft-deletes, edge upserts) must commit atomically; a non-transactional fallback would leave a partially-merged graph on a mid-commit failure. (mergeIncremental() enforces the same requirement.)",
|
|
7343
7343
|
{ details: { capability: "execution.interactiveTransactions" } }
|
|
@@ -7348,19 +7348,19 @@ async function commitPlan(target, plan, expectedBaseVersion) {
|
|
|
7348
7348
|
{
|
|
7349
7349
|
operation: "commitPlan",
|
|
7350
7350
|
attempts: MERGE_COMMIT_ATTEMPTS,
|
|
7351
|
-
target:
|
|
7351
|
+
target: chunkA22XPVBQ_cjs.storeBackend(target)
|
|
7352
7352
|
},
|
|
7353
7353
|
() => target.transaction(async (tx) => {
|
|
7354
7354
|
if (expectedBaseVersion !== void 0) {
|
|
7355
7355
|
await assertTargetUnchanged(
|
|
7356
|
-
|
|
7356
|
+
chunkA22XPVBQ_cjs.transactionBackend(tx),
|
|
7357
7357
|
target,
|
|
7358
7358
|
expectedBaseVersion
|
|
7359
7359
|
);
|
|
7360
7360
|
}
|
|
7361
7361
|
await assertPlannedIdentityIdsFresh(
|
|
7362
7362
|
target,
|
|
7363
|
-
|
|
7363
|
+
chunkA22XPVBQ_cjs.transactionBackend(tx),
|
|
7364
7364
|
plan
|
|
7365
7365
|
);
|
|
7366
7366
|
return applyInternalMergePlan(
|
|
@@ -7368,7 +7368,7 @@ async function commitPlan(target, plan, expectedBaseVersion) {
|
|
|
7368
7368
|
tx.nodes,
|
|
7369
7369
|
tx.edges,
|
|
7370
7370
|
target,
|
|
7371
|
-
|
|
7371
|
+
chunkA22XPVBQ_cjs.transactionBackend(tx)
|
|
7372
7372
|
);
|
|
7373
7373
|
}, mergeCommitTransactionOptions(target))
|
|
7374
7374
|
)
|
|
@@ -7385,7 +7385,7 @@ var MERGE_COMMIT_TX_OPTIONS = {
|
|
|
7385
7385
|
isolationLevel: "serializable"
|
|
7386
7386
|
};
|
|
7387
7387
|
function mergeCommitTransactionOptions(target) {
|
|
7388
|
-
return
|
|
7388
|
+
return chunkA22XPVBQ_cjs.storeCaptureEnabled(target) ? void 0 : MERGE_COMMIT_TX_OPTIONS;
|
|
7389
7389
|
}
|
|
7390
7390
|
async function engineAnchorMismatch(lineage, session, graphId, expectedRevision) {
|
|
7391
7391
|
const liveRevision = await lineage.revision(session);
|
|
@@ -7434,7 +7434,7 @@ async function assertTargetUnchanged(txBackend, target, expectedBaseVersion) {
|
|
|
7434
7434
|
}
|
|
7435
7435
|
);
|
|
7436
7436
|
}
|
|
7437
|
-
const liveRevision = await
|
|
7437
|
+
const liveRevision = await chunkA22XPVBQ_cjs.readRecordedClock(
|
|
7438
7438
|
txBackend,
|
|
7439
7439
|
target.revisionSchema,
|
|
7440
7440
|
target.graphId
|
|
@@ -7510,7 +7510,7 @@ async function assertTargetUnchanged(txBackend, target, expectedBaseVersion) {
|
|
|
7510
7510
|
txBackend,
|
|
7511
7511
|
target.graphId,
|
|
7512
7512
|
target.graph,
|
|
7513
|
-
await
|
|
7513
|
+
await chunkA22XPVBQ_cjs.storeRuntime(target).identityAssertionsAtTarget(txBackend, "state")
|
|
7514
7514
|
);
|
|
7515
7515
|
const expectedContent = contentComponentOf(expectedBaseVersion);
|
|
7516
7516
|
if (liveContent !== expectedContent) {
|
|
@@ -7557,11 +7557,11 @@ async function toleratedByEngineAnchor(store, expectedVersion, liveVersion) {
|
|
|
7557
7557
|
liveVersion
|
|
7558
7558
|
);
|
|
7559
7559
|
if (expectedRevision === void 0) return false;
|
|
7560
|
-
const lineage =
|
|
7560
|
+
const lineage = chunkA22XPVBQ_cjs.resolveLineage(store);
|
|
7561
7561
|
if (lineage === void 0) return false;
|
|
7562
7562
|
const mismatch = await engineAnchorMismatch(
|
|
7563
7563
|
lineage,
|
|
7564
|
-
|
|
7564
|
+
chunkA22XPVBQ_cjs.storeBackend(store),
|
|
7565
7565
|
store.graphId,
|
|
7566
7566
|
expectedRevision
|
|
7567
7567
|
);
|
|
@@ -7627,7 +7627,7 @@ async function tryOpenProvenanceStore(target) {
|
|
|
7627
7627
|
}
|
|
7628
7628
|
}
|
|
7629
7629
|
function assertPublicPlanCapability(target) {
|
|
7630
|
-
if (!
|
|
7630
|
+
if (!chunkA22XPVBQ_cjs.storeBackend(target).capabilities.execution.interactiveTransactions) {
|
|
7631
7631
|
throw new MergePlanCapabilityError(
|
|
7632
7632
|
"Public merge plans require a transaction-capable target backend.",
|
|
7633
7633
|
{ details: { capability: "execution.interactiveTransactions" } }
|
|
@@ -7646,7 +7646,7 @@ function assertPublicPlanCapability(target) {
|
|
|
7646
7646
|
async function captureMergePlanTargetFence(target) {
|
|
7647
7647
|
assertPublicPlanCapability(target);
|
|
7648
7648
|
const [activeSchema, schemaHash, origin, revision] = await Promise.all([
|
|
7649
|
-
|
|
7649
|
+
chunkA22XPVBQ_cjs.storeBackend(target).getActiveSchema(target.graphId),
|
|
7650
7650
|
computeSchemaComponent(target),
|
|
7651
7651
|
target.revisionOriginNow(),
|
|
7652
7652
|
target.revisionNow()
|
|
@@ -7812,7 +7812,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
7812
7812
|
}
|
|
7813
7813
|
}
|
|
7814
7814
|
for (const branch2 of branches) {
|
|
7815
|
-
const branchSchemaRow = await
|
|
7815
|
+
const branchSchemaRow = await chunkA22XPVBQ_cjs.storeBackend(branch2.store).getActiveSchema(
|
|
7816
7816
|
branch2.store.graphId
|
|
7817
7817
|
);
|
|
7818
7818
|
let drifted;
|
|
@@ -7820,7 +7820,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
7820
7820
|
const anchor = branch2.schemaAnchor;
|
|
7821
7821
|
drifted = anchor === void 0 ? branchSchemaRow !== void 0 : branchSchemaRow?.version !== anchor.version || branchSchemaRow.schema_hash !== anchor.hash;
|
|
7822
7822
|
} else {
|
|
7823
|
-
const sourceSchemaRow = await
|
|
7823
|
+
const sourceSchemaRow = await chunkA22XPVBQ_cjs.storeBackend(store).getActiveSchema(
|
|
7824
7824
|
store.graphId
|
|
7825
7825
|
);
|
|
7826
7826
|
drifted = branchSchemaRow?.schema_hash !== sourceSchemaRow?.schema_hash;
|
|
@@ -7865,7 +7865,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
7865
7865
|
options.embedder
|
|
7866
7866
|
);
|
|
7867
7867
|
const ctx = {
|
|
7868
|
-
backend:
|
|
7868
|
+
backend: chunkA22XPVBQ_cjs.storeBackend(store),
|
|
7869
7869
|
...embeddings === void 0 ? {} : { embeddings }
|
|
7870
7870
|
};
|
|
7871
7871
|
const candidates = await generateAllCandidates(
|
|
@@ -7893,7 +7893,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
7893
7893
|
])
|
|
7894
7894
|
])
|
|
7895
7895
|
];
|
|
7896
|
-
const targetPeers = identityProbeIds === void 0 ? [] : await
|
|
7896
|
+
const targetPeers = identityProbeIds === void 0 ? [] : await chunkA22XPVBQ_cjs.storeRuntime(target).liveNodesSharingIds(identityProbeIds);
|
|
7897
7897
|
const stagedIdentityIds = [
|
|
7898
7898
|
.../* @__PURE__ */ new Set([
|
|
7899
7899
|
...staging.newIdentityAssertions.map((staged) => staged.assertion.id),
|
|
@@ -7902,7 +7902,7 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
7902
7902
|
)
|
|
7903
7903
|
])
|
|
7904
7904
|
];
|
|
7905
|
-
const storedIdentityRowsById = stagedIdentityIds.length === 0 || target.graph.identity === void 0 ? NO_STORED_ASSERTIONS : await
|
|
7905
|
+
const storedIdentityRowsById = stagedIdentityIds.length === 0 || target.graph.identity === void 0 ? NO_STORED_ASSERTIONS : await chunkA22XPVBQ_cjs.storeRuntime(target).identityAssertionRowsByIds(
|
|
7906
7906
|
stagedIdentityIds
|
|
7907
7907
|
);
|
|
7908
7908
|
const identityContext = {
|
|
@@ -7927,14 +7927,14 @@ async function resolveMerge(store, target, branches, options, useBaseSources, in
|
|
|
7927
7927
|
if (plan.identityAssertions.length > 0) {
|
|
7928
7928
|
assertOneIdOneTruth(
|
|
7929
7929
|
plan.identityAssertions,
|
|
7930
|
-
await
|
|
7930
|
+
await chunkA22XPVBQ_cjs.storeRuntime(target).identityAssertionRowsByIds(
|
|
7931
7931
|
plan.identityAssertions.map((assertion) => assertion.id)
|
|
7932
7932
|
)
|
|
7933
7933
|
);
|
|
7934
7934
|
}
|
|
7935
7935
|
let identityGuard;
|
|
7936
7936
|
if (identityProbeIds !== void 0 && incremental !== void 0) {
|
|
7937
|
-
const freshPeers = await
|
|
7937
|
+
const freshPeers = await chunkA22XPVBQ_cjs.storeRuntime(target).liveNodesSharingIds(identityProbeIds);
|
|
7938
7938
|
const built = await buildIdentityPeerProbe(
|
|
7939
7939
|
target,
|
|
7940
7940
|
identityProbeIds,
|
|
@@ -8132,7 +8132,7 @@ async function planMergeIncremental(args) {
|
|
|
8132
8132
|
computeSchemaComponent(target)
|
|
8133
8133
|
]);
|
|
8134
8134
|
if (forkSchema !== targetSchema) return chunkVF42UUBN_cjs.err(incrementalSchemaError());
|
|
8135
|
-
const forkActiveSchema = await
|
|
8135
|
+
const forkActiveSchema = await chunkA22XPVBQ_cjs.storeBackend(forkPoint).getActiveSchema(
|
|
8136
8136
|
forkPoint.graphId
|
|
8137
8137
|
);
|
|
8138
8138
|
const targetBranch = {
|
|
@@ -8514,7 +8514,7 @@ async function assertMergePlanFenceInsideTransaction(target, txBackend, artifact
|
|
|
8514
8514
|
{ details: { expected: artifact.target.schema, live: liveSchema } }
|
|
8515
8515
|
);
|
|
8516
8516
|
}
|
|
8517
|
-
const liveOrigin = await
|
|
8517
|
+
const liveOrigin = await chunkA22XPVBQ_cjs.readRevisionOrigin(
|
|
8518
8518
|
txBackend,
|
|
8519
8519
|
target.revisionSchema,
|
|
8520
8520
|
target.graphId
|
|
@@ -8530,7 +8530,7 @@ async function assertMergePlanFenceInsideTransaction(target, txBackend, artifact
|
|
|
8530
8530
|
}
|
|
8531
8531
|
);
|
|
8532
8532
|
}
|
|
8533
|
-
const liveRevision = await
|
|
8533
|
+
const liveRevision = await chunkA22XPVBQ_cjs.readRecordedClock(
|
|
8534
8534
|
txBackend,
|
|
8535
8535
|
target.revisionSchema,
|
|
8536
8536
|
target.graphId
|
|
@@ -8606,7 +8606,7 @@ async function applyWireMergeWrites(target, nodesApi, edgesApi, txBackend, artif
|
|
|
8606
8606
|
txBackend,
|
|
8607
8607
|
identityAssertions,
|
|
8608
8608
|
identityRetractions,
|
|
8609
|
-
() =>
|
|
8609
|
+
() => chunkA22XPVBQ_cjs.storeRuntime(target).assertIdentityClassesConsistentAtTarget(
|
|
8610
8610
|
txBackend,
|
|
8611
8611
|
identityConsistencySeeds(
|
|
8612
8612
|
artifact,
|
|
@@ -8614,8 +8614,8 @@ async function applyWireMergeWrites(target, nodesApi, edgesApi, txBackend, artif
|
|
|
8614
8614
|
)
|
|
8615
8615
|
)
|
|
8616
8616
|
);
|
|
8617
|
-
if (!
|
|
8618
|
-
await
|
|
8617
|
+
if (!chunkA22XPVBQ_cjs.forceRecordedGraphRevision(txBackend, target.graphId) && !chunkA22XPVBQ_cjs.forceWriteTransactionRevision(txBackend)) {
|
|
8618
|
+
await chunkA22XPVBQ_cjs.advanceRevisionClock(
|
|
8619
8619
|
txBackend,
|
|
8620
8620
|
target.revisionSchema,
|
|
8621
8621
|
target.graphId,
|
|
@@ -8691,10 +8691,10 @@ async function applyMergePlan(target, input, options = {}) {
|
|
|
8691
8691
|
{
|
|
8692
8692
|
operation: "applyMergePlan",
|
|
8693
8693
|
attempts: MERGE_COMMIT_ATTEMPTS,
|
|
8694
|
-
target:
|
|
8694
|
+
target: chunkA22XPVBQ_cjs.storeBackend(target)
|
|
8695
8695
|
},
|
|
8696
8696
|
() => target.transaction(async (tx) => {
|
|
8697
|
-
const txBackend =
|
|
8697
|
+
const txBackend = chunkA22XPVBQ_cjs.transactionBackend(tx);
|
|
8698
8698
|
await assertMergePlanFenceInsideTransaction(
|
|
8699
8699
|
target,
|
|
8700
8700
|
txBackend,
|
|
@@ -9196,11 +9196,11 @@ async function assertForkPointUnchanged(precondition) {
|
|
|
9196
9196
|
liveVersion
|
|
9197
9197
|
);
|
|
9198
9198
|
if (expectedEngineRevision !== void 0) {
|
|
9199
|
-
const lineage =
|
|
9199
|
+
const lineage = chunkA22XPVBQ_cjs.resolveLineage(precondition.store);
|
|
9200
9200
|
if (lineage !== void 0) {
|
|
9201
9201
|
const mismatch = await engineAnchorMismatch(
|
|
9202
9202
|
lineage,
|
|
9203
|
-
|
|
9203
|
+
chunkA22XPVBQ_cjs.storeBackend(precondition.store),
|
|
9204
9204
|
precondition.store.graphId,
|
|
9205
9205
|
expectedEngineRevision
|
|
9206
9206
|
);
|
|
@@ -9219,7 +9219,7 @@ async function assertForkPointUnchanged(precondition) {
|
|
|
9219
9219
|
);
|
|
9220
9220
|
}
|
|
9221
9221
|
async function commitIncrementalPlan(target, plan, guard) {
|
|
9222
|
-
if (!
|
|
9222
|
+
if (!chunkA22XPVBQ_cjs.storeBackend(target).capabilities.execution.interactiveTransactions) {
|
|
9223
9223
|
throw new MergeError(
|
|
9224
9224
|
"mergeIncremental() requires a transaction-capable target backend. Incremental writes must preflight existing rows and commit atomically; non-transactional fallback would allow partial graph writes.",
|
|
9225
9225
|
{ details: { capability: "execution.interactiveTransactions" } }
|
|
@@ -9230,10 +9230,10 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
9230
9230
|
{
|
|
9231
9231
|
operation: "commitIncrementalPlan",
|
|
9232
9232
|
attempts: MERGE_COMMIT_ATTEMPTS,
|
|
9233
|
-
target:
|
|
9233
|
+
target: chunkA22XPVBQ_cjs.storeBackend(target)
|
|
9234
9234
|
},
|
|
9235
9235
|
() => target.transaction(async (tx) => {
|
|
9236
|
-
await lockMergeTargetWrite(
|
|
9236
|
+
await lockMergeTargetWrite(chunkA22XPVBQ_cjs.transactionBackend(tx), {
|
|
9237
9237
|
graphId: target.graphId,
|
|
9238
9238
|
schemaVersion: target.introspect().schemaVersion,
|
|
9239
9239
|
graphLock: target.revisionTrackingEnabled ? "required" : "not-required",
|
|
@@ -9251,12 +9251,12 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
9251
9251
|
);
|
|
9252
9252
|
await assertPlannedIdentityIdsFresh(
|
|
9253
9253
|
target,
|
|
9254
|
-
|
|
9254
|
+
chunkA22XPVBQ_cjs.transactionBackend(tx),
|
|
9255
9255
|
plan
|
|
9256
9256
|
);
|
|
9257
9257
|
await assertIdentityPeersStable(
|
|
9258
9258
|
target,
|
|
9259
|
-
|
|
9259
|
+
chunkA22XPVBQ_cjs.transactionBackend(tx),
|
|
9260
9260
|
guard.identityPeerProbe,
|
|
9261
9261
|
plan
|
|
9262
9262
|
);
|
|
@@ -9268,7 +9268,7 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
9268
9268
|
nodesApi,
|
|
9269
9269
|
edgesApi,
|
|
9270
9270
|
target,
|
|
9271
|
-
|
|
9271
|
+
chunkA22XPVBQ_cjs.transactionBackend(tx)
|
|
9272
9272
|
);
|
|
9273
9273
|
}, mergeCommitTransactionOptions(target))
|
|
9274
9274
|
)
|
|
@@ -9362,10 +9362,10 @@ var CandidateWriteSetSchema = zod.z.object({
|
|
|
9362
9362
|
target: CandidateWriteSetTargetSchema,
|
|
9363
9363
|
nodes: zod.z.array(candidateNodeSchema),
|
|
9364
9364
|
edges: zod.z.array(candidateEdgeSchema),
|
|
9365
|
-
identity:
|
|
9365
|
+
identity: chunkKGQVK2II_cjs.InterchangeIdentitySchema.optional()
|
|
9366
9366
|
});
|
|
9367
9367
|
async function captureCandidateWriteSetTarget(target) {
|
|
9368
|
-
const activeSchema = await
|
|
9368
|
+
const activeSchema = await chunkA22XPVBQ_cjs.storeBackend(target).getActiveSchema(
|
|
9369
9369
|
target.graphId
|
|
9370
9370
|
);
|
|
9371
9371
|
return {
|
|
@@ -9444,7 +9444,7 @@ async function planCandidateWriteSet(args) {
|
|
|
9444
9444
|
}
|
|
9445
9445
|
const candidate = created.data;
|
|
9446
9446
|
try {
|
|
9447
|
-
const imported = await
|
|
9447
|
+
const imported = await chunkKGQVK2II_cjs.importGraph(
|
|
9448
9448
|
candidate,
|
|
9449
9449
|
interchangeDocument(writeSet),
|
|
9450
9450
|
{
|
|
@@ -9542,7 +9542,7 @@ function reviewRowKey(row) {
|
|
|
9542
9542
|
return JSON.stringify([row.role, row.kind, row.id]);
|
|
9543
9543
|
}
|
|
9544
9544
|
async function captureReviewBaseline(target) {
|
|
9545
|
-
const backend =
|
|
9545
|
+
const backend = chunkA22XPVBQ_cjs.storeBackend(target);
|
|
9546
9546
|
const rows = [];
|
|
9547
9547
|
for (const kind of chunk6ODVH5SA_cjs.getNodeKinds(target.graph)) {
|
|
9548
9548
|
for (const row of await enumerateAllNodes(backend, target.graphId, kind)) {
|
|
@@ -9564,7 +9564,7 @@ async function captureReviewBaseline(target) {
|
|
|
9564
9564
|
});
|
|
9565
9565
|
}
|
|
9566
9566
|
}
|
|
9567
|
-
const identity = await
|
|
9567
|
+
const identity = await chunkA22XPVBQ_cjs.storeRuntime(target).readCurrentIdentityAssertions(
|
|
9568
9568
|
"archival",
|
|
9569
9569
|
{
|
|
9570
9570
|
includeDeleted: true
|