@nicia-ai/typegraph 0.47.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.cjs +27 -19
- package/dist/backend/index.d.cts +37 -55
- package/dist/backend/index.d.ts +37 -55
- package/dist/backend/index.js +4 -4
- package/dist/backend/postgres/index.cjs +7 -7
- package/dist/backend/postgres/index.d.cts +21 -7
- package/dist/backend/postgres/index.d.ts +21 -7
- package/dist/backend/postgres/index.js +6 -6
- package/dist/backend/postgres/pglite-store.cjs +17 -17
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +14 -14
- package/dist/backend/postgres/pglite.cjs +8 -8
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +7 -7
- package/dist/backend/sqlite/index.cjs +7 -7
- package/dist/backend/sqlite/index.d.cts +20 -7
- package/dist/backend/sqlite/index.d.ts +20 -7
- package/dist/backend/sqlite/index.js +6 -6
- package/dist/backend/sqlite/libsql.cjs +8 -8
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +6 -6
- package/dist/backend/sqlite/local-store.cjs +18 -18
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +15 -15
- package/dist/backend/sqlite/local.cjs +9 -9
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +7 -7
- package/dist/{chunk-EMIB2RXD.cjs → chunk-2HIYYMWY.cjs} +99 -96
- package/dist/chunk-2HIYYMWY.cjs.map +1 -0
- package/dist/{chunk-6KFLYYOC.cjs → chunk-2QGYQBS2.cjs} +5 -5
- package/dist/{chunk-6KFLYYOC.cjs.map → chunk-2QGYQBS2.cjs.map} +1 -1
- package/dist/{chunk-5FT3TLPK.js → chunk-2SYZXD54.js} +16 -13
- package/dist/chunk-2SYZXD54.js.map +1 -0
- package/dist/{chunk-XYBQI6LE.js → chunk-2TYSSBU5.js} +6 -6
- package/dist/{chunk-XYBQI6LE.js.map → chunk-2TYSSBU5.js.map} +1 -1
- package/dist/{chunk-6JVZSOHQ.cjs → chunk-3FPR224C.cjs} +26 -26
- package/dist/{chunk-6JVZSOHQ.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
- package/dist/{chunk-MFZR4QKM.cjs → chunk-3KOY4FH3.cjs} +181 -4
- package/dist/chunk-3KOY4FH3.cjs.map +1 -0
- package/dist/{chunk-6FWSNSRE.js → chunk-4WMMBDS5.js} +4 -4
- package/dist/chunk-4WMMBDS5.js.map +1 -0
- package/dist/{chunk-NG2RB5WL.js → chunk-5K2BKEBD.js} +18 -3
- package/dist/chunk-5K2BKEBD.js.map +1 -0
- package/dist/chunk-5PRKMB24.cjs +124 -0
- package/dist/chunk-5PRKMB24.cjs.map +1 -0
- package/dist/chunk-6LN7FIVU.js +107 -0
- package/dist/chunk-6LN7FIVU.js.map +1 -0
- package/dist/{chunk-I4G3SQPF.cjs → chunk-7XUYFFR4.cjs} +7 -7
- package/dist/chunk-7XUYFFR4.cjs.map +1 -0
- package/dist/{chunk-KH7XW7VV.js → chunk-ACGSAMD3.js} +24 -27
- package/dist/chunk-ACGSAMD3.js.map +1 -0
- package/dist/{chunk-QS3NQZVC.js → chunk-AX6JGVTZ.js} +16 -11
- package/dist/chunk-AX6JGVTZ.js.map +1 -0
- package/dist/{chunk-DJZTXBWY.js → chunk-BRRP76WO.js} +71 -30
- package/dist/chunk-BRRP76WO.js.map +1 -0
- package/dist/{chunk-5UMTUOM5.js → chunk-CT3ZKTOF.js} +5 -4
- package/dist/chunk-CT3ZKTOF.js.map +1 -0
- package/dist/{chunk-XY5OMOJD.js → chunk-DZAICA5J.js} +3 -3
- package/dist/{chunk-XY5OMOJD.js.map → chunk-DZAICA5J.js.map} +1 -1
- package/dist/{chunk-OIFSOPSR.cjs → chunk-EZEEWCFJ.cjs} +38 -156
- package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
- package/dist/{chunk-AMMWA76F.cjs → chunk-FA2AFWLP.cjs} +6 -6
- package/dist/{chunk-AMMWA76F.cjs.map → chunk-FA2AFWLP.cjs.map} +1 -1
- package/dist/{chunk-FNOMT74T.js → chunk-I4GAZH5Z.js} +180 -5
- package/dist/chunk-I4GAZH5Z.js.map +1 -0
- package/dist/{chunk-WGX7JH7E.cjs → chunk-JB6T4GLL.cjs} +106 -134
- package/dist/chunk-JB6T4GLL.cjs.map +1 -0
- package/dist/{chunk-MX4DHSQP.cjs → chunk-JFRT7S3B.cjs} +92 -98
- package/dist/chunk-JFRT7S3B.cjs.map +1 -0
- package/dist/{chunk-SE6EGQSD.js → chunk-KF6K7TGH.js} +38 -66
- package/dist/chunk-KF6K7TGH.js.map +1 -0
- package/dist/{chunk-ZHNXLS3C.js → chunk-NACVVDWB.js} +208 -8
- package/dist/chunk-NACVVDWB.js.map +1 -0
- package/dist/{chunk-M35DF33T.js → chunk-OD4SSY2U.js} +29 -16
- package/dist/chunk-OD4SSY2U.js.map +1 -0
- package/dist/{chunk-U5EDAVOJ.cjs → chunk-OTUPEF2W.cjs} +54 -49
- package/dist/chunk-OTUPEF2W.cjs.map +1 -0
- package/dist/{chunk-BCQ76AXA.cjs → chunk-PFBRJBUL.cjs} +107 -94
- package/dist/chunk-PFBRJBUL.cjs.map +1 -0
- package/dist/{chunk-AVGUJWVX.js → chunk-S5TERQVW.js} +15 -132
- package/dist/chunk-S5TERQVW.js.map +1 -0
- package/dist/chunk-SIT26LAZ.cjs +614 -0
- package/dist/chunk-SIT26LAZ.cjs.map +1 -0
- package/dist/{chunk-BR7SHKGM.cjs → chunk-SR725PWF.cjs} +548 -507
- package/dist/chunk-SR725PWF.cjs.map +1 -0
- package/dist/{chunk-5FBRVORR.cjs → chunk-TKZXMWQF.cjs} +8 -7
- package/dist/chunk-TKZXMWQF.cjs.map +1 -0
- package/dist/{chunk-425IZOQ5.cjs → chunk-TQHGE7UC.cjs} +20 -2
- package/dist/chunk-TQHGE7UC.cjs.map +1 -0
- package/dist/{chunk-GYUJZARH.cjs → chunk-TUNPBZY3.cjs} +4 -4
- package/dist/{chunk-GYUJZARH.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
- package/dist/chunk-UGHG7PGX.js +592 -0
- package/dist/chunk-UGHG7PGX.js.map +1 -0
- package/dist/{chunk-KABFHAL7.cjs → chunk-UMGZDVOA.cjs} +213 -12
- package/dist/chunk-UMGZDVOA.cjs.map +1 -0
- package/dist/{chunk-UPAJHMW3.cjs → chunk-WCCATHMB.cjs} +54 -57
- package/dist/chunk-WCCATHMB.cjs.map +1 -0
- package/dist/{chunk-LEWHMOUY.js → chunk-YIURNGXI.js} +4 -4
- package/dist/{chunk-LEWHMOUY.js.map → chunk-YIURNGXI.js.map} +1 -1
- package/dist/{chunk-EP4RUYD6.js → chunk-YVF2EM7B.js} +3 -3
- package/dist/{chunk-EP4RUYD6.js.map → chunk-YVF2EM7B.js.map} +1 -1
- package/dist/{chunk-NNQ6A3RM.js → chunk-ZFMCDJGB.js} +7 -12
- package/dist/chunk-ZFMCDJGB.js.map +1 -0
- package/dist/core/index.cjs +6 -6
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +2 -2
- package/dist/ddl-BL1NZLMY.d.cts +78 -0
- package/dist/ddl-D_oW-EVO.d.ts +78 -0
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-merge/index.cjs +334 -191
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +65 -15
- package/dist/graph-merge/index.d.ts +65 -15
- package/dist/graph-merge/index.js +174 -32
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-CHTv4XMZ.d.cts → index-COs_z6nV.d.cts} +2 -2
- package/dist/{index-CzoJ3MUw.d.ts → index-D7d1u2gr.d.ts} +2 -2
- package/dist/index.cjs +90 -86
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/interchange/index.cjs +38 -38
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +10 -10
- package/dist/{manager-DlY1vlla.d.cts → manager-CYaff3n3.d.cts} +2 -2
- package/dist/{manager-B6sOQzcQ.d.ts → manager-D9eRT_ns.d.ts} +2 -2
- package/dist/{materialize-indexes-DQL4xcpf.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
- package/dist/{materialize-indexes-sskhp-c_.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
- package/dist/{postgres-BXy_nyMs.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
- package/dist/{postgres-B6YOUcaK.d.ts → postgres-DMj39MEu.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +25 -26
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
- package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +8 -8
- package/dist/{searchable-D9gMiwcS.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
- package/dist/{searchable-0Cn_lY8U.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
- package/dist/{sqlite-DioSxaPe.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
- package/dist/{sqlite-ClXuBYAj.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
- package/dist/{store-5j-w5onJ.d.ts → store-JUVvtmR4.d.cts} +113 -26
- package/dist/{store-CFedKGU5.d.cts → store-UzrGvZOo.d.ts} +113 -26
- package/dist/{temporal-CjO9FH1l.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
- package/dist/{temporal-Ce1pG0S1.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
- package/dist/{types-DKkMJZjR.d.cts → types-BqFZTQmV.d.cts} +29 -4
- package/dist/{types-DKkMJZjR.d.ts → types-BqFZTQmV.d.ts} +29 -4
- package/dist/{types-BrdOFu48.d.ts → types-Bx74kaTt.d.ts} +1 -1
- package/dist/{types-oj_OGAaZ.d.cts → types-CXAhpW-c.d.cts} +1 -1
- package/dist/{where-D1wKCJ4Q.d.cts → where-DI_Fqz-X.d.cts} +1 -1
- package/dist/{where-C8w2627G.d.ts → where-O-k2wgYm.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3HGRTCDU.cjs +0 -269
- package/dist/chunk-3HGRTCDU.cjs.map +0 -1
- package/dist/chunk-425IZOQ5.cjs.map +0 -1
- package/dist/chunk-5FBRVORR.cjs.map +0 -1
- package/dist/chunk-5FT3TLPK.js.map +0 -1
- package/dist/chunk-5UMTUOM5.js.map +0 -1
- package/dist/chunk-6FWSNSRE.js.map +0 -1
- package/dist/chunk-AVGUJWVX.js.map +0 -1
- package/dist/chunk-BCQ76AXA.cjs.map +0 -1
- package/dist/chunk-BR7SHKGM.cjs.map +0 -1
- package/dist/chunk-DJZTXBWY.js.map +0 -1
- package/dist/chunk-EMIB2RXD.cjs.map +0 -1
- package/dist/chunk-FNOMT74T.js.map +0 -1
- package/dist/chunk-I4G3SQPF.cjs.map +0 -1
- package/dist/chunk-JR6SX5RH.cjs +0 -268
- package/dist/chunk-JR6SX5RH.cjs.map +0 -1
- package/dist/chunk-KABFHAL7.cjs.map +0 -1
- package/dist/chunk-KH7XW7VV.js.map +0 -1
- package/dist/chunk-M35DF33T.js.map +0 -1
- package/dist/chunk-MFZR4QKM.cjs.map +0 -1
- package/dist/chunk-MX4DHSQP.cjs.map +0 -1
- package/dist/chunk-NAZ2RA4L.js +0 -254
- package/dist/chunk-NAZ2RA4L.js.map +0 -1
- package/dist/chunk-NG2RB5WL.js.map +0 -1
- package/dist/chunk-NNQ6A3RM.js.map +0 -1
- package/dist/chunk-OIFSOPSR.cjs.map +0 -1
- package/dist/chunk-QS3NQZVC.js.map +0 -1
- package/dist/chunk-SE6EGQSD.js.map +0 -1
- package/dist/chunk-SHSSRCFR.js +0 -246
- package/dist/chunk-SHSSRCFR.js.map +0 -1
- package/dist/chunk-U5EDAVOJ.cjs.map +0 -1
- package/dist/chunk-UPAJHMW3.cjs.map +0 -1
- package/dist/chunk-WGX7JH7E.cjs.map +0 -1
- package/dist/chunk-ZHNXLS3C.js.map +0 -1
- package/dist/ddl-CprnMXJ-.d.ts +0 -38
- package/dist/ddl-DJA7Lci5.d.cts +0 -38
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { a as Store, aP as Node, ce as UniqueIntrospection } from '../store-
|
|
4
|
-
import { aj as TypeGraphError, ak as TypeGraphErrorOptions } from '../index-
|
|
1
|
+
import { dP as NodeId, dg as NodeType, bh as JsonValue, dw as EdgeId, d8 as GraphDef, dQ as NodeKinds, dD as GetNodeType, aM as GraphBackend, bi as KindAnnotations, dN as MetaEdge, dr as EdgeType, S as DeleteBehavior, ce as TemporalMode, I as IndexDeclaration, aQ as GraphExtensionVersion, ak as ExtensionNodeDef, ae as ExtensionEdgeDef, ap as ExtensionOntologyRelation, ai as ExtensionIndex } from '../types-BqFZTQmV.cjs';
|
|
2
|
+
export { u as ContributionDiagnostic, v as ContributionDiagnosticState, J as ContributionRepairEntry, K as ContributionRepairResult } from '../types-BqFZTQmV.cjs';
|
|
3
|
+
import { a as Store, aP as Node, ce as UniqueIntrospection } from '../store-JUVvtmR4.cjs';
|
|
4
|
+
import { aj as TypeGraphError, ak as TypeGraphErrorOptions } from '../index-COs_z6nV.cjs';
|
|
5
5
|
import { R as Result } from '../result-DWo6mUVz.cjs';
|
|
6
6
|
export { i as isErr, a as isOk, u as unwrap } from '../result-DWo6mUVz.cjs';
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import '../temporal-
|
|
9
|
-
import '../searchable-
|
|
10
|
-
import '../manager-
|
|
11
|
-
import '../materialize-indexes-
|
|
8
|
+
import '../temporal-5GqpYCk2.cjs';
|
|
9
|
+
import '../searchable-DHJMh_nj.cjs';
|
|
10
|
+
import '../manager-CYaff3n3.cjs';
|
|
11
|
+
import '../materialize-indexes-DTtAnvfY.cjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The composite MERGE IDENTITY key for a node: the pair `(kind, id)`.
|
|
@@ -200,6 +200,33 @@ type GraphBranch<G extends GraphDef> = Readonly<{
|
|
|
200
200
|
hash: string;
|
|
201
201
|
}> | undefined;
|
|
202
202
|
}>;
|
|
203
|
+
declare const INGESTION_BRANCH_BRAND: unique symbol;
|
|
204
|
+
/**
|
|
205
|
+
* Node collections exposed by an {@link IngestionBranch}. They retain normal
|
|
206
|
+
* validation, reads, and staging writes, but omit APIs that claim a declared
|
|
207
|
+
* uniqueness constraint exists on the relaxed physical working copy.
|
|
208
|
+
*/
|
|
209
|
+
type IngestionNodeCollections<G extends GraphDef> = Readonly<{
|
|
210
|
+
[K in keyof Store<G>["nodes"]]-?: Pick<Store<G>["nodes"][K], "create" | "getById" | "getByIds" | "update" | "updateWhere" | "delete" | "hardDelete" | "find" | "count" | "createFromRecord" | "upsertById" | "upsertByIdFromRecord" | "bulkCreate" | "bulkUpsertById" | "bulkInsert" | "bulkDelete" | "bulkFindByIndex">;
|
|
211
|
+
}>;
|
|
212
|
+
/**
|
|
213
|
+
* Opaque handle for an untrusted ingestion working copy.
|
|
214
|
+
*
|
|
215
|
+
* The ordinary {@link Store} is intentionally absent: callers may stage and
|
|
216
|
+
* inspect graph data through the typed collections, then pass this handle to
|
|
217
|
+
* merge planning, but cannot access schema evolution, transactions, or runtime
|
|
218
|
+
* internals. `close()` releases the private working-copy backend.
|
|
219
|
+
*/
|
|
220
|
+
type IngestionBranch<G extends GraphDef> = Readonly<{
|
|
221
|
+
[INGESTION_BRANCH_BRAND]: true;
|
|
222
|
+
id: BranchId;
|
|
223
|
+
base: BaseVersion;
|
|
224
|
+
nodes: IngestionNodeCollections<G>;
|
|
225
|
+
edges: Store<G>["edges"];
|
|
226
|
+
close: () => Promise<void>;
|
|
227
|
+
}>;
|
|
228
|
+
/** A normal branch or an opaque ingestion branch accepted by merge entrypoints. */
|
|
229
|
+
type MergeBranch<G extends GraphDef> = GraphBranch<G> | IngestionBranch<G>;
|
|
203
230
|
/**
|
|
204
231
|
* Options for {@link GraphBranch} creation. `id` is optional — when omitted a
|
|
205
232
|
* fresh id is generated.
|
|
@@ -470,7 +497,7 @@ type MergeOptions<G extends GraphDef = GraphDef> = Readonly<{
|
|
|
470
497
|
type MergeIncrementalArgs<G extends GraphDef = GraphDef> = Readonly<{
|
|
471
498
|
forkPoint: Store<G>;
|
|
472
499
|
target: Store<G>;
|
|
473
|
-
branches: readonly
|
|
500
|
+
branches: readonly MergeBranch<G>[];
|
|
474
501
|
options?: Omit<MergeOptions<G>, "target">;
|
|
475
502
|
}>;
|
|
476
503
|
/**
|
|
@@ -967,9 +994,11 @@ declare class MatchEvidenceError extends MergeError {
|
|
|
967
994
|
* `includeTemporal: true` carries `validFrom`/`validTo` through unchanged,
|
|
968
995
|
* preserving the base's exact valid-time window on the clone: create-time
|
|
969
996
|
* paths default an omitted `validFrom` to the row's own creation instant
|
|
970
|
-
* (see #240)
|
|
971
|
-
*
|
|
972
|
-
*
|
|
997
|
+
* (see #240) — except for a BORN-ENDED row, whose stated `validTo` at or before
|
|
998
|
+
* the write instant leaves it with no lower bound at all (see #407) — and
|
|
999
|
+
* export/import round-trip a still-open-left `valid_from` (a born-ended row, or
|
|
1000
|
+
* one that predates the #240 fix) as an explicit `null` rather than silently
|
|
1001
|
+
* dropping it — see `InterchangeNodeSchema.validFrom`'s doc.
|
|
973
1002
|
* Without either half of this, the clone's re-import would re-stamp the
|
|
974
1003
|
* affected base rows to the CLONE's creation instant instead — narrowing
|
|
975
1004
|
* their validity window and making `asOf` reads on the fork diverge from
|
|
@@ -1085,6 +1114,27 @@ declare function cloneWorkingCopyStrategy<G extends GraphDef>(makeBackend: MakeB
|
|
|
1085
1114
|
*/
|
|
1086
1115
|
declare function branch<G extends GraphDef>(baseStore: GraphBranch<G>["store"], makeBackend: MakeBackend, options?: BranchOptions, strategy?: WorkingCopyStrategy<G>): Promise<Result<GraphBranch<G>, BranchError>>;
|
|
1087
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* Constraint-aware working copies for untrusted ingestion.
|
|
1119
|
+
*
|
|
1120
|
+
* An ingestion branch persists a mechanically-derived schema with node
|
|
1121
|
+
* uniqueness declarations removed. That lets aliases reach merge planning,
|
|
1122
|
+
* where canonical candidate generation and final resolved-write validation use
|
|
1123
|
+
* the canonical graph's constraints. Every other working-copy constraint stays
|
|
1124
|
+
* active during staging.
|
|
1125
|
+
*/
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Creates an isolated ingestion branch whose node uniqueness constraints are
|
|
1129
|
+
* deferred until the resolved merge write set is applied.
|
|
1130
|
+
*
|
|
1131
|
+
* The returned handle deliberately exposes no ordinary Store. Its typed node
|
|
1132
|
+
* and edge collections are sufficient to stage and inspect incoming data, and
|
|
1133
|
+
* merge entrypoints accept the handle directly. Call `close()` when the working
|
|
1134
|
+
* copy is no longer needed.
|
|
1135
|
+
*/
|
|
1136
|
+
declare function ingestionBranch<G extends GraphDef>(baseStore: GraphBranch<G>["store"], makeBackend: MakeBackend, options?: BranchOptions): Promise<Result<IngestionBranch<G>, BranchError>>;
|
|
1137
|
+
|
|
1088
1138
|
/**
|
|
1089
1139
|
* The shared SCORING stage (design §4, the single match-decision point).
|
|
1090
1140
|
*
|
|
@@ -1379,7 +1429,7 @@ type MergePlanArtifact = MergePlanArtifactV1;
|
|
|
1379
1429
|
type MergePlanArtifactV1Input = Omit<MergePlanArtifactV1, "digest">;
|
|
1380
1430
|
|
|
1381
1431
|
/** Builds a durable, reviewable snapshot merge plan without mutating the target. */
|
|
1382
|
-
declare function planMerge<G extends GraphDef>(store: Store<G>,
|
|
1432
|
+
declare function planMerge<G extends GraphDef>(store: Store<G>, branchInputs: readonly MergeBranch<G>[], optionsInput?: MergeOptions<G>): Promise<Result<MergePlanArtifact, MergeError>>;
|
|
1383
1433
|
/** Builds a durable, reviewable incremental merge plan without mutating the target. */
|
|
1384
1434
|
declare function planMergeIncremental<G extends GraphDef>(args: MergeIncrementalArgs<G>): Promise<Result<MergePlanArtifact, MergeError>>;
|
|
1385
1435
|
/** Validates and atomically applies an approved serialized merge plan. */
|
|
@@ -1408,7 +1458,7 @@ declare function applyMergePlan<G extends GraphDef>(target: Store<G>, input: Mer
|
|
|
1408
1458
|
* report and committed graph are identical across any permutation.
|
|
1409
1459
|
* @param optionsInput Caller-facing {@link MergeOptions}; normalized internally.
|
|
1410
1460
|
*/
|
|
1411
|
-
declare function merge<G extends GraphDef>(store: Store<G>,
|
|
1461
|
+
declare function merge<G extends GraphDef>(store: Store<G>, branchInputs: readonly MergeBranch<G>[], optionsInput?: MergeOptions<G>): Promise<Result<MergeReport<G>, MergeError>>;
|
|
1412
1462
|
/**
|
|
1413
1463
|
* Incremental merge — the public fork-point-vs-live-target entry point (design
|
|
1414
1464
|
* §6.4-B / §6.6). It treats `forkPoint` as the immutable ancestor, folds the live
|
|
@@ -1722,4 +1772,4 @@ type KeylessConfig = Readonly<{
|
|
|
1722
1772
|
sortFields: readonly string[];
|
|
1723
1773
|
}>;
|
|
1724
1774
|
|
|
1725
|
-
export { type BaseAmbiguity, type BaseNodeLookup, type BaseVersion, BaseVersionMismatchError, BranchError, type BranchId, type BranchOptions, type BranchProvenance, type CandidateDiagnostic, type CandidateDiagnostics, type CandidateDiagnosticsOptions, type CandidateSource, CandidateSourceError, type ComparisonCeilingPolicy, type ConflictingValue, type DeleteModifyConflict, type DeleteModifyPolicy, type DroppedItem, type Embedder, type EntityRef, type EntityResolution, type GraphBranch, IdentityMergeConflictError, InvalidMergeOptionsError, InvalidMergePlanError, type KeylessConfig, MERGE_ERROR_CODES, MERGE_OPTION_DEFAULTS, MERGE_PLAN_DIGEST_ALGORITHM, MERGE_PLAN_FORMAT_VERSION, type MakeBackend, type MatchEvidence, MatchEvidenceError, type MatchSource, type MatchStrategy, MergeConflictError, MergeConstraintConflictError, type MergeConstraintConflictErrorDetails, MergeError, type MergeIncrementalArgs, type MergeOptions, type MergePlanAnchors, type MergePlanArtifact, type MergePlanArtifactV1, type MergePlanArtifactV1Input, type MergePlanBranchAnchor, type MergePlanCandidateDiagnostic, type MergePlanCanonicalMapping, MergePlanCapabilityError, type MergePlanDiagnostics, type MergePlanDigest, MergePlanDigestMismatchError, type MergePlanEdgeDelete, type MergePlanEdgeUpsert, type MergePlanEntityRef, type MergePlanEntityResolution, type MergePlanGuards, type MergePlanIdentityAssertion, type MergePlanMatchEvidence, type MergePlanMatchSource, type MergePlanNodeDelete, type MergePlanNodeUpsert, MergePlanOriginMismatchError, type MergePlanProposedSummary, type MergePlanProvenanceOptions, type MergePlanRetype, type MergePlanReview, type MergePlanRevisionFence, type MergePlanSchemaFence, MergePlanSchemaMismatchError, type MergePlanSimilarityStrategy, type MergePlanTargetFence, MergePlanTargetMismatchError, type MergePlanTypeReconciliation, type MergePlanWrites, MergePlanningStaleError, type MergeReport, type MergedCounts, type NormalizedMergeOptions, type PropertyConflict, type PropertyConflictPolicy, type ProvenanceGraph, type ProvenanceIndex, type ProvenanceNode, type ProvenanceQuery, type ProvenanceRecord, type ReconcileTypesMode, type ResolveConfig, type ResolveMap, type ResolvedCluster, Result, type SimilarityStrategy, SimilarityUnavailableError, type SourceScope, StaleMergePlanError, type TypeReconciliation, UnsupportedMergePlanVersionError, VALIDITY_END_TARGET_PRECEDENCE, type ValidityEndResolution, type WorkingCopyStrategy, applyMergePlan, asBaseVersion, asBranchId, branch, cloneWorkingCopyStrategy, computeBaseVersion, merge, mergeIncremental, normalizeMergeOptions, openProvenanceStore, persistProvenanceRecords, planMerge, planMergeIncremental, provenanceGraphId, readProvenance };
|
|
1775
|
+
export { type BaseAmbiguity, type BaseNodeLookup, type BaseVersion, BaseVersionMismatchError, BranchError, type BranchId, type BranchOptions, type BranchProvenance, type CandidateDiagnostic, type CandidateDiagnostics, type CandidateDiagnosticsOptions, type CandidateSource, CandidateSourceError, type ComparisonCeilingPolicy, type ConflictingValue, type DeleteModifyConflict, type DeleteModifyPolicy, type DroppedItem, type Embedder, type EntityRef, type EntityResolution, type GraphBranch, IdentityMergeConflictError, type IngestionBranch, type IngestionNodeCollections, InvalidMergeOptionsError, InvalidMergePlanError, type KeylessConfig, MERGE_ERROR_CODES, MERGE_OPTION_DEFAULTS, MERGE_PLAN_DIGEST_ALGORITHM, MERGE_PLAN_FORMAT_VERSION, type MakeBackend, type MatchEvidence, MatchEvidenceError, type MatchSource, type MatchStrategy, type MergeBranch, MergeConflictError, MergeConstraintConflictError, type MergeConstraintConflictErrorDetails, MergeError, type MergeIncrementalArgs, type MergeOptions, type MergePlanAnchors, type MergePlanArtifact, type MergePlanArtifactV1, type MergePlanArtifactV1Input, type MergePlanBranchAnchor, type MergePlanCandidateDiagnostic, type MergePlanCanonicalMapping, MergePlanCapabilityError, type MergePlanDiagnostics, type MergePlanDigest, MergePlanDigestMismatchError, type MergePlanEdgeDelete, type MergePlanEdgeUpsert, type MergePlanEntityRef, type MergePlanEntityResolution, type MergePlanGuards, type MergePlanIdentityAssertion, type MergePlanMatchEvidence, type MergePlanMatchSource, type MergePlanNodeDelete, type MergePlanNodeUpsert, MergePlanOriginMismatchError, type MergePlanProposedSummary, type MergePlanProvenanceOptions, type MergePlanRetype, type MergePlanReview, type MergePlanRevisionFence, type MergePlanSchemaFence, MergePlanSchemaMismatchError, type MergePlanSimilarityStrategy, type MergePlanTargetFence, MergePlanTargetMismatchError, type MergePlanTypeReconciliation, type MergePlanWrites, MergePlanningStaleError, type MergeReport, type MergedCounts, type NormalizedMergeOptions, type PropertyConflict, type PropertyConflictPolicy, type ProvenanceGraph, type ProvenanceIndex, type ProvenanceNode, type ProvenanceQuery, type ProvenanceRecord, type ReconcileTypesMode, type ResolveConfig, type ResolveMap, type ResolvedCluster, Result, type SimilarityStrategy, SimilarityUnavailableError, type SourceScope, StaleMergePlanError, type TypeReconciliation, UnsupportedMergePlanVersionError, VALIDITY_END_TARGET_PRECEDENCE, type ValidityEndResolution, type WorkingCopyStrategy, applyMergePlan, asBaseVersion, asBranchId, branch, cloneWorkingCopyStrategy, computeBaseVersion, ingestionBranch, merge, mergeIncremental, normalizeMergeOptions, openProvenanceStore, persistProvenanceRecords, planMerge, planMergeIncremental, provenanceGraphId, readProvenance };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { a as Store, aP as Node, ce as UniqueIntrospection } from '../store-
|
|
4
|
-
import { aj as TypeGraphError, ak as TypeGraphErrorOptions } from '../index-
|
|
1
|
+
import { dP as NodeId, dg as NodeType, bh as JsonValue, dw as EdgeId, d8 as GraphDef, dQ as NodeKinds, dD as GetNodeType, aM as GraphBackend, bi as KindAnnotations, dN as MetaEdge, dr as EdgeType, S as DeleteBehavior, ce as TemporalMode, I as IndexDeclaration, aQ as GraphExtensionVersion, ak as ExtensionNodeDef, ae as ExtensionEdgeDef, ap as ExtensionOntologyRelation, ai as ExtensionIndex } from '../types-BqFZTQmV.js';
|
|
2
|
+
export { u as ContributionDiagnostic, v as ContributionDiagnosticState, J as ContributionRepairEntry, K as ContributionRepairResult } from '../types-BqFZTQmV.js';
|
|
3
|
+
import { a as Store, aP as Node, ce as UniqueIntrospection } from '../store-UzrGvZOo.js';
|
|
4
|
+
import { aj as TypeGraphError, ak as TypeGraphErrorOptions } from '../index-D7d1u2gr.js';
|
|
5
5
|
import { R as Result } from '../result-DWo6mUVz.js';
|
|
6
6
|
export { i as isErr, a as isOk, u as unwrap } from '../result-DWo6mUVz.js';
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import '../temporal-
|
|
9
|
-
import '../searchable-
|
|
10
|
-
import '../manager-
|
|
11
|
-
import '../materialize-indexes-
|
|
8
|
+
import '../temporal-CbnLzTmM.js';
|
|
9
|
+
import '../searchable-bpE1bBfc.js';
|
|
10
|
+
import '../manager-D9eRT_ns.js';
|
|
11
|
+
import '../materialize-indexes-DJ3ykH59.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* The composite MERGE IDENTITY key for a node: the pair `(kind, id)`.
|
|
@@ -200,6 +200,33 @@ type GraphBranch<G extends GraphDef> = Readonly<{
|
|
|
200
200
|
hash: string;
|
|
201
201
|
}> | undefined;
|
|
202
202
|
}>;
|
|
203
|
+
declare const INGESTION_BRANCH_BRAND: unique symbol;
|
|
204
|
+
/**
|
|
205
|
+
* Node collections exposed by an {@link IngestionBranch}. They retain normal
|
|
206
|
+
* validation, reads, and staging writes, but omit APIs that claim a declared
|
|
207
|
+
* uniqueness constraint exists on the relaxed physical working copy.
|
|
208
|
+
*/
|
|
209
|
+
type IngestionNodeCollections<G extends GraphDef> = Readonly<{
|
|
210
|
+
[K in keyof Store<G>["nodes"]]-?: Pick<Store<G>["nodes"][K], "create" | "getById" | "getByIds" | "update" | "updateWhere" | "delete" | "hardDelete" | "find" | "count" | "createFromRecord" | "upsertById" | "upsertByIdFromRecord" | "bulkCreate" | "bulkUpsertById" | "bulkInsert" | "bulkDelete" | "bulkFindByIndex">;
|
|
211
|
+
}>;
|
|
212
|
+
/**
|
|
213
|
+
* Opaque handle for an untrusted ingestion working copy.
|
|
214
|
+
*
|
|
215
|
+
* The ordinary {@link Store} is intentionally absent: callers may stage and
|
|
216
|
+
* inspect graph data through the typed collections, then pass this handle to
|
|
217
|
+
* merge planning, but cannot access schema evolution, transactions, or runtime
|
|
218
|
+
* internals. `close()` releases the private working-copy backend.
|
|
219
|
+
*/
|
|
220
|
+
type IngestionBranch<G extends GraphDef> = Readonly<{
|
|
221
|
+
[INGESTION_BRANCH_BRAND]: true;
|
|
222
|
+
id: BranchId;
|
|
223
|
+
base: BaseVersion;
|
|
224
|
+
nodes: IngestionNodeCollections<G>;
|
|
225
|
+
edges: Store<G>["edges"];
|
|
226
|
+
close: () => Promise<void>;
|
|
227
|
+
}>;
|
|
228
|
+
/** A normal branch or an opaque ingestion branch accepted by merge entrypoints. */
|
|
229
|
+
type MergeBranch<G extends GraphDef> = GraphBranch<G> | IngestionBranch<G>;
|
|
203
230
|
/**
|
|
204
231
|
* Options for {@link GraphBranch} creation. `id` is optional — when omitted a
|
|
205
232
|
* fresh id is generated.
|
|
@@ -470,7 +497,7 @@ type MergeOptions<G extends GraphDef = GraphDef> = Readonly<{
|
|
|
470
497
|
type MergeIncrementalArgs<G extends GraphDef = GraphDef> = Readonly<{
|
|
471
498
|
forkPoint: Store<G>;
|
|
472
499
|
target: Store<G>;
|
|
473
|
-
branches: readonly
|
|
500
|
+
branches: readonly MergeBranch<G>[];
|
|
474
501
|
options?: Omit<MergeOptions<G>, "target">;
|
|
475
502
|
}>;
|
|
476
503
|
/**
|
|
@@ -967,9 +994,11 @@ declare class MatchEvidenceError extends MergeError {
|
|
|
967
994
|
* `includeTemporal: true` carries `validFrom`/`validTo` through unchanged,
|
|
968
995
|
* preserving the base's exact valid-time window on the clone: create-time
|
|
969
996
|
* paths default an omitted `validFrom` to the row's own creation instant
|
|
970
|
-
* (see #240)
|
|
971
|
-
*
|
|
972
|
-
*
|
|
997
|
+
* (see #240) — except for a BORN-ENDED row, whose stated `validTo` at or before
|
|
998
|
+
* the write instant leaves it with no lower bound at all (see #407) — and
|
|
999
|
+
* export/import round-trip a still-open-left `valid_from` (a born-ended row, or
|
|
1000
|
+
* one that predates the #240 fix) as an explicit `null` rather than silently
|
|
1001
|
+
* dropping it — see `InterchangeNodeSchema.validFrom`'s doc.
|
|
973
1002
|
* Without either half of this, the clone's re-import would re-stamp the
|
|
974
1003
|
* affected base rows to the CLONE's creation instant instead — narrowing
|
|
975
1004
|
* their validity window and making `asOf` reads on the fork diverge from
|
|
@@ -1085,6 +1114,27 @@ declare function cloneWorkingCopyStrategy<G extends GraphDef>(makeBackend: MakeB
|
|
|
1085
1114
|
*/
|
|
1086
1115
|
declare function branch<G extends GraphDef>(baseStore: GraphBranch<G>["store"], makeBackend: MakeBackend, options?: BranchOptions, strategy?: WorkingCopyStrategy<G>): Promise<Result<GraphBranch<G>, BranchError>>;
|
|
1087
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* Constraint-aware working copies for untrusted ingestion.
|
|
1119
|
+
*
|
|
1120
|
+
* An ingestion branch persists a mechanically-derived schema with node
|
|
1121
|
+
* uniqueness declarations removed. That lets aliases reach merge planning,
|
|
1122
|
+
* where canonical candidate generation and final resolved-write validation use
|
|
1123
|
+
* the canonical graph's constraints. Every other working-copy constraint stays
|
|
1124
|
+
* active during staging.
|
|
1125
|
+
*/
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Creates an isolated ingestion branch whose node uniqueness constraints are
|
|
1129
|
+
* deferred until the resolved merge write set is applied.
|
|
1130
|
+
*
|
|
1131
|
+
* The returned handle deliberately exposes no ordinary Store. Its typed node
|
|
1132
|
+
* and edge collections are sufficient to stage and inspect incoming data, and
|
|
1133
|
+
* merge entrypoints accept the handle directly. Call `close()` when the working
|
|
1134
|
+
* copy is no longer needed.
|
|
1135
|
+
*/
|
|
1136
|
+
declare function ingestionBranch<G extends GraphDef>(baseStore: GraphBranch<G>["store"], makeBackend: MakeBackend, options?: BranchOptions): Promise<Result<IngestionBranch<G>, BranchError>>;
|
|
1137
|
+
|
|
1088
1138
|
/**
|
|
1089
1139
|
* The shared SCORING stage (design §4, the single match-decision point).
|
|
1090
1140
|
*
|
|
@@ -1379,7 +1429,7 @@ type MergePlanArtifact = MergePlanArtifactV1;
|
|
|
1379
1429
|
type MergePlanArtifactV1Input = Omit<MergePlanArtifactV1, "digest">;
|
|
1380
1430
|
|
|
1381
1431
|
/** Builds a durable, reviewable snapshot merge plan without mutating the target. */
|
|
1382
|
-
declare function planMerge<G extends GraphDef>(store: Store<G>,
|
|
1432
|
+
declare function planMerge<G extends GraphDef>(store: Store<G>, branchInputs: readonly MergeBranch<G>[], optionsInput?: MergeOptions<G>): Promise<Result<MergePlanArtifact, MergeError>>;
|
|
1383
1433
|
/** Builds a durable, reviewable incremental merge plan without mutating the target. */
|
|
1384
1434
|
declare function planMergeIncremental<G extends GraphDef>(args: MergeIncrementalArgs<G>): Promise<Result<MergePlanArtifact, MergeError>>;
|
|
1385
1435
|
/** Validates and atomically applies an approved serialized merge plan. */
|
|
@@ -1408,7 +1458,7 @@ declare function applyMergePlan<G extends GraphDef>(target: Store<G>, input: Mer
|
|
|
1408
1458
|
* report and committed graph are identical across any permutation.
|
|
1409
1459
|
* @param optionsInput Caller-facing {@link MergeOptions}; normalized internally.
|
|
1410
1460
|
*/
|
|
1411
|
-
declare function merge<G extends GraphDef>(store: Store<G>,
|
|
1461
|
+
declare function merge<G extends GraphDef>(store: Store<G>, branchInputs: readonly MergeBranch<G>[], optionsInput?: MergeOptions<G>): Promise<Result<MergeReport<G>, MergeError>>;
|
|
1412
1462
|
/**
|
|
1413
1463
|
* Incremental merge — the public fork-point-vs-live-target entry point (design
|
|
1414
1464
|
* §6.4-B / §6.6). It treats `forkPoint` as the immutable ancestor, folds the live
|
|
@@ -1722,4 +1772,4 @@ type KeylessConfig = Readonly<{
|
|
|
1722
1772
|
sortFields: readonly string[];
|
|
1723
1773
|
}>;
|
|
1724
1774
|
|
|
1725
|
-
export { type BaseAmbiguity, type BaseNodeLookup, type BaseVersion, BaseVersionMismatchError, BranchError, type BranchId, type BranchOptions, type BranchProvenance, type CandidateDiagnostic, type CandidateDiagnostics, type CandidateDiagnosticsOptions, type CandidateSource, CandidateSourceError, type ComparisonCeilingPolicy, type ConflictingValue, type DeleteModifyConflict, type DeleteModifyPolicy, type DroppedItem, type Embedder, type EntityRef, type EntityResolution, type GraphBranch, IdentityMergeConflictError, InvalidMergeOptionsError, InvalidMergePlanError, type KeylessConfig, MERGE_ERROR_CODES, MERGE_OPTION_DEFAULTS, MERGE_PLAN_DIGEST_ALGORITHM, MERGE_PLAN_FORMAT_VERSION, type MakeBackend, type MatchEvidence, MatchEvidenceError, type MatchSource, type MatchStrategy, MergeConflictError, MergeConstraintConflictError, type MergeConstraintConflictErrorDetails, MergeError, type MergeIncrementalArgs, type MergeOptions, type MergePlanAnchors, type MergePlanArtifact, type MergePlanArtifactV1, type MergePlanArtifactV1Input, type MergePlanBranchAnchor, type MergePlanCandidateDiagnostic, type MergePlanCanonicalMapping, MergePlanCapabilityError, type MergePlanDiagnostics, type MergePlanDigest, MergePlanDigestMismatchError, type MergePlanEdgeDelete, type MergePlanEdgeUpsert, type MergePlanEntityRef, type MergePlanEntityResolution, type MergePlanGuards, type MergePlanIdentityAssertion, type MergePlanMatchEvidence, type MergePlanMatchSource, type MergePlanNodeDelete, type MergePlanNodeUpsert, MergePlanOriginMismatchError, type MergePlanProposedSummary, type MergePlanProvenanceOptions, type MergePlanRetype, type MergePlanReview, type MergePlanRevisionFence, type MergePlanSchemaFence, MergePlanSchemaMismatchError, type MergePlanSimilarityStrategy, type MergePlanTargetFence, MergePlanTargetMismatchError, type MergePlanTypeReconciliation, type MergePlanWrites, MergePlanningStaleError, type MergeReport, type MergedCounts, type NormalizedMergeOptions, type PropertyConflict, type PropertyConflictPolicy, type ProvenanceGraph, type ProvenanceIndex, type ProvenanceNode, type ProvenanceQuery, type ProvenanceRecord, type ReconcileTypesMode, type ResolveConfig, type ResolveMap, type ResolvedCluster, Result, type SimilarityStrategy, SimilarityUnavailableError, type SourceScope, StaleMergePlanError, type TypeReconciliation, UnsupportedMergePlanVersionError, VALIDITY_END_TARGET_PRECEDENCE, type ValidityEndResolution, type WorkingCopyStrategy, applyMergePlan, asBaseVersion, asBranchId, branch, cloneWorkingCopyStrategy, computeBaseVersion, merge, mergeIncremental, normalizeMergeOptions, openProvenanceStore, persistProvenanceRecords, planMerge, planMergeIncremental, provenanceGraphId, readProvenance };
|
|
1775
|
+
export { type BaseAmbiguity, type BaseNodeLookup, type BaseVersion, BaseVersionMismatchError, BranchError, type BranchId, type BranchOptions, type BranchProvenance, type CandidateDiagnostic, type CandidateDiagnostics, type CandidateDiagnosticsOptions, type CandidateSource, CandidateSourceError, type ComparisonCeilingPolicy, type ConflictingValue, type DeleteModifyConflict, type DeleteModifyPolicy, type DroppedItem, type Embedder, type EntityRef, type EntityResolution, type GraphBranch, IdentityMergeConflictError, type IngestionBranch, type IngestionNodeCollections, InvalidMergeOptionsError, InvalidMergePlanError, type KeylessConfig, MERGE_ERROR_CODES, MERGE_OPTION_DEFAULTS, MERGE_PLAN_DIGEST_ALGORITHM, MERGE_PLAN_FORMAT_VERSION, type MakeBackend, type MatchEvidence, MatchEvidenceError, type MatchSource, type MatchStrategy, type MergeBranch, MergeConflictError, MergeConstraintConflictError, type MergeConstraintConflictErrorDetails, MergeError, type MergeIncrementalArgs, type MergeOptions, type MergePlanAnchors, type MergePlanArtifact, type MergePlanArtifactV1, type MergePlanArtifactV1Input, type MergePlanBranchAnchor, type MergePlanCandidateDiagnostic, type MergePlanCanonicalMapping, MergePlanCapabilityError, type MergePlanDiagnostics, type MergePlanDigest, MergePlanDigestMismatchError, type MergePlanEdgeDelete, type MergePlanEdgeUpsert, type MergePlanEntityRef, type MergePlanEntityResolution, type MergePlanGuards, type MergePlanIdentityAssertion, type MergePlanMatchEvidence, type MergePlanMatchSource, type MergePlanNodeDelete, type MergePlanNodeUpsert, MergePlanOriginMismatchError, type MergePlanProposedSummary, type MergePlanProvenanceOptions, type MergePlanRetype, type MergePlanReview, type MergePlanRevisionFence, type MergePlanSchemaFence, MergePlanSchemaMismatchError, type MergePlanSimilarityStrategy, type MergePlanTargetFence, MergePlanTargetMismatchError, type MergePlanTypeReconciliation, type MergePlanWrites, MergePlanningStaleError, type MergeReport, type MergedCounts, type NormalizedMergeOptions, type PropertyConflict, type PropertyConflictPolicy, type ProvenanceGraph, type ProvenanceIndex, type ProvenanceNode, type ProvenanceQuery, type ProvenanceRecord, type ReconcileTypesMode, type ResolveConfig, type ResolveMap, type ResolvedCluster, Result, type SimilarityStrategy, SimilarityUnavailableError, type SourceScope, StaleMergePlanError, type TypeReconciliation, UnsupportedMergePlanVersionError, VALIDITY_END_TARGET_PRECEDENCE, type ValidityEndResolution, type WorkingCopyStrategy, applyMergePlan, asBaseVersion, asBranchId, branch, cloneWorkingCopyStrategy, computeBaseVersion, ingestionBranch, merge, mergeIncremental, normalizeMergeOptions, openProvenanceStore, persistProvenanceRecords, planMerge, planMergeIncremental, provenanceGraphId, readProvenance };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createStoreWithSchema } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import { importGraphStream, exportGraphStream, importGraph, exportGraph } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import { storeBackend, storeRuntime, transactionBackend } from '../chunk-
|
|
6
|
-
import { computeSchemaHash, serializeSchema } from '../chunk-
|
|
1
|
+
import { createStoreWithSchema } from '../chunk-BRRP76WO.js';
|
|
2
|
+
import '../chunk-YIURNGXI.js';
|
|
3
|
+
import { importGraphStream, exportGraphStream, importGraph, exportGraph } from '../chunk-AX6JGVTZ.js';
|
|
4
|
+
import '../chunk-KF6K7TGH.js';
|
|
5
|
+
import { storeBackend, storeRuntime, transactionBackend } from '../chunk-I4GAZH5Z.js';
|
|
6
|
+
import { computeSchemaHash, serializeSchema } from '../chunk-2TYSSBU5.js';
|
|
7
7
|
import { defineNode } from '../chunk-SHFBB23Q.js';
|
|
8
|
-
import {
|
|
9
|
-
import { compareStrings, generateId, lockRecordedGraphWrite, readRevisionOrigin, readRecordedClock, forceRecordedGraphRevision, advanceRevisionClock, compareCodePoints } from '../chunk-
|
|
8
|
+
import { forceWriteTransactionRevision, normalizeIdentityPair, identityReferenceKey, identityValidityWindowsOverlap, identityAssertionSemanticKey } from '../chunk-ZFMCDJGB.js';
|
|
9
|
+
import { compareStrings, generateId, encodeTupleKey, lockRecordedGraphWrite, readRevisionOrigin, readRecordedClock, forceRecordedGraphRevision, advanceRevisionClock, compareCodePoints } from '../chunk-S5TERQVW.js';
|
|
10
10
|
import { sortedReplacer } from '../chunk-JBQQ7THH.js';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import { snapshotExportContention } from '../chunk-UGHG7PGX.js';
|
|
12
12
|
import { createSqlSchema } from '../chunk-NVY5CJFP.js';
|
|
13
|
-
import
|
|
13
|
+
import '../chunk-6LN7FIVU.js';
|
|
14
14
|
import { getNodeKinds, getEdgeKinds, defineInternalGraph } from '../chunk-HEV35TGT.js';
|
|
15
15
|
import { validateEdgeEndpoints, computeUniqueKey } from '../chunk-GLHXM7C4.js';
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import { canonicalizeDatabaseTimestamp } from '../chunk-
|
|
16
|
+
import '../chunk-DZAICA5J.js';
|
|
17
|
+
import { canonicalizeDatabaseTimestamp } from '../chunk-5K2BKEBD.js';
|
|
18
18
|
import '../chunk-KKBDXCLQ.js';
|
|
19
19
|
import '../chunk-SDBBMD4N.js';
|
|
20
20
|
import '../chunk-P6YLZTRE.js';
|
|
@@ -1885,12 +1885,24 @@ function contentComponentOf(version) {
|
|
|
1885
1885
|
// src/graph-merge/working-copy.ts
|
|
1886
1886
|
var CLONE_IMPORT_BATCH_SIZE = 1e3;
|
|
1887
1887
|
function cloneWorkingCopyStrategy(makeBackend) {
|
|
1888
|
+
return cloneWorkingCopyWithGraphStrategy(
|
|
1889
|
+
makeBackend,
|
|
1890
|
+
(baseStore) => baseStore.graph
|
|
1891
|
+
);
|
|
1892
|
+
}
|
|
1893
|
+
function cloneIngestionWorkingCopyStrategy(makeBackend) {
|
|
1894
|
+
return cloneWorkingCopyWithGraphStrategy(
|
|
1895
|
+
makeBackend,
|
|
1896
|
+
(baseStore) => graphWithoutNodeUniqueness(baseStore.graph)
|
|
1897
|
+
);
|
|
1898
|
+
}
|
|
1899
|
+
function cloneWorkingCopyWithGraphStrategy(makeBackend, graphForClone) {
|
|
1888
1900
|
return {
|
|
1889
1901
|
create: async (baseStore) => {
|
|
1890
1902
|
const backend = await makeBackend();
|
|
1891
1903
|
try {
|
|
1892
1904
|
const [freshStore] = await createStoreWithSchema(
|
|
1893
|
-
baseStore
|
|
1905
|
+
graphForClone(baseStore),
|
|
1894
1906
|
backend,
|
|
1895
1907
|
{
|
|
1896
1908
|
// Keep descendants branchable with the same O(1) anchor contract,
|
|
@@ -1939,6 +1951,30 @@ function cloneWorkingCopyStrategy(makeBackend) {
|
|
|
1939
1951
|
}
|
|
1940
1952
|
};
|
|
1941
1953
|
}
|
|
1954
|
+
function graphWithoutNodeUniqueness(graph) {
|
|
1955
|
+
const nodes = Object.fromEntries(
|
|
1956
|
+
Object.entries(graph.nodes).map(([name, registration]) => {
|
|
1957
|
+
const { unique: _omitted, ...withoutUnique } = registration;
|
|
1958
|
+
return [name, Object.freeze(withoutUnique)];
|
|
1959
|
+
})
|
|
1960
|
+
);
|
|
1961
|
+
const extension = graph.extension?.nodes === void 0 ? graph.extension : Object.freeze({
|
|
1962
|
+
...graph.extension,
|
|
1963
|
+
nodes: Object.freeze(
|
|
1964
|
+
Object.fromEntries(
|
|
1965
|
+
Object.entries(graph.extension.nodes).map(([name, node]) => {
|
|
1966
|
+
const { unique: _omitted, ...withoutUnique } = node;
|
|
1967
|
+
return [name, Object.freeze(withoutUnique)];
|
|
1968
|
+
})
|
|
1969
|
+
)
|
|
1970
|
+
)
|
|
1971
|
+
});
|
|
1972
|
+
return Object.freeze({
|
|
1973
|
+
...graph,
|
|
1974
|
+
nodes: Object.freeze(nodes),
|
|
1975
|
+
extension
|
|
1976
|
+
});
|
|
1977
|
+
}
|
|
1942
1978
|
|
|
1943
1979
|
// src/graph-merge/branch.ts
|
|
1944
1980
|
async function branch(baseStore, makeBackend, options, strategy) {
|
|
@@ -1947,7 +1983,7 @@ async function branch(baseStore, makeBackend, options, strategy) {
|
|
|
1947
1983
|
const id = options?.id ?? asBranchId(generateId());
|
|
1948
1984
|
const workingCopyStrategy = strategy ?? cloneWorkingCopyStrategy(makeBackend);
|
|
1949
1985
|
const store = await workingCopyStrategy.create(baseStore);
|
|
1950
|
-
const schemaAnchor = await
|
|
1986
|
+
const schemaAnchor = await captureBranchSchemaAnchor(store);
|
|
1951
1987
|
return ok({
|
|
1952
1988
|
id,
|
|
1953
1989
|
base,
|
|
@@ -1962,7 +1998,7 @@ async function branch(baseStore, makeBackend, options, strategy) {
|
|
|
1962
1998
|
);
|
|
1963
1999
|
}
|
|
1964
2000
|
}
|
|
1965
|
-
async function
|
|
2001
|
+
async function captureBranchSchemaAnchor(store) {
|
|
1966
2002
|
try {
|
|
1967
2003
|
const schemaRow = await storeBackend(store).getActiveSchema(store.graphId);
|
|
1968
2004
|
return schemaRow === void 0 ? void 0 : { version: schemaRow.version, hash: schemaRow.schema_hash };
|
|
@@ -1975,6 +2011,53 @@ async function readSchemaAnchor(store) {
|
|
|
1975
2011
|
}
|
|
1976
2012
|
}
|
|
1977
2013
|
|
|
2014
|
+
// src/graph-merge/ingestion-branch.ts
|
|
2015
|
+
var PRIVATE_BRANCHES = /* @__PURE__ */ new WeakMap();
|
|
2016
|
+
async function ingestionBranch(baseStore, makeBackend, options) {
|
|
2017
|
+
try {
|
|
2018
|
+
const created = await branch(
|
|
2019
|
+
baseStore,
|
|
2020
|
+
makeBackend,
|
|
2021
|
+
options,
|
|
2022
|
+
cloneIngestionWorkingCopyStrategy(makeBackend)
|
|
2023
|
+
);
|
|
2024
|
+
if (isErr(created)) {
|
|
2025
|
+
return err(
|
|
2026
|
+
new BranchError("Failed to create constraint-aware ingestion branch", {
|
|
2027
|
+
cause: created.error
|
|
2028
|
+
})
|
|
2029
|
+
);
|
|
2030
|
+
}
|
|
2031
|
+
const privateBranch = created.data;
|
|
2032
|
+
const { base, id, store } = privateBranch;
|
|
2033
|
+
const handle = Object.freeze({
|
|
2034
|
+
id,
|
|
2035
|
+
base,
|
|
2036
|
+
nodes: store.nodes,
|
|
2037
|
+
edges: store.edges,
|
|
2038
|
+
close: async () => storeBackend(store).close()
|
|
2039
|
+
});
|
|
2040
|
+
PRIVATE_BRANCHES.set(handle, privateBranch);
|
|
2041
|
+
return ok(handle);
|
|
2042
|
+
} catch (error) {
|
|
2043
|
+
return err(
|
|
2044
|
+
new BranchError("Failed to create constraint-aware ingestion branch", {
|
|
2045
|
+
cause: error
|
|
2046
|
+
})
|
|
2047
|
+
);
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
function unwrapMergeBranch(input) {
|
|
2051
|
+
const privateBranch = PRIVATE_BRANCHES.get(input);
|
|
2052
|
+
if (privateBranch !== void 0) {
|
|
2053
|
+
return privateBranch;
|
|
2054
|
+
}
|
|
2055
|
+
return input;
|
|
2056
|
+
}
|
|
2057
|
+
function unwrapMergeBranches(inputs) {
|
|
2058
|
+
return inputs.map((input) => unwrapMergeBranch(input));
|
|
2059
|
+
}
|
|
2060
|
+
|
|
1978
2061
|
// src/graph-merge/blocking.ts
|
|
1979
2062
|
var UNBLOCKED_BUCKET_KEY = "unblocked";
|
|
1980
2063
|
var KEY_PART_SEPARATOR = "\0";
|
|
@@ -6658,20 +6741,67 @@ function nodeWriteWindowOptions(write) {
|
|
|
6658
6741
|
...write.validTo === void 0 ? {} : { validTo: write.validTo }
|
|
6659
6742
|
};
|
|
6660
6743
|
}
|
|
6661
|
-
async function applyNodeRows(nodesApi, deletions, upserts) {
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
}
|
|
6665
|
-
const committed = /* @__PURE__ */ new Set();
|
|
6744
|
+
async function applyNodeRows(target, txBackend, nodesApi, deletions, upserts) {
|
|
6745
|
+
const afterImages = /* @__PURE__ */ new Map();
|
|
6746
|
+
const upsertsByKind = /* @__PURE__ */ new Map();
|
|
6666
6747
|
for (const upsert of upserts) {
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6748
|
+
const items = upsertsByKind.get(upsert.kind);
|
|
6749
|
+
if (items === void 0) upsertsByKind.set(upsert.kind, [upsert]);
|
|
6750
|
+
else items.push(upsert);
|
|
6751
|
+
}
|
|
6752
|
+
for (const [kind, items] of upsertsByKind) {
|
|
6753
|
+
const currentRows = await nodeCollection(nodesApi, kind).getByIds(
|
|
6754
|
+
items.map((item) => item.id),
|
|
6755
|
+
INCLUDE_TOMBSTONES
|
|
6671
6756
|
);
|
|
6672
|
-
|
|
6757
|
+
const currentById = /* @__PURE__ */ new Map();
|
|
6758
|
+
for (const node of currentRows) {
|
|
6759
|
+
if (node !== void 0) currentById.set(node.id, nodeProps2(node));
|
|
6760
|
+
}
|
|
6761
|
+
for (const item of items) {
|
|
6762
|
+
const props = createDataKeyedBag();
|
|
6763
|
+
const unset = new Set(
|
|
6764
|
+
Object.entries(item.props).filter(([, value]) => value === void 0).map(([key]) => key)
|
|
6765
|
+
);
|
|
6766
|
+
for (const [key, value] of Object.entries(
|
|
6767
|
+
currentById.get(item.id) ?? {}
|
|
6768
|
+
)) {
|
|
6769
|
+
if (!unset.has(key)) props[key] = value;
|
|
6770
|
+
}
|
|
6771
|
+
for (const [key, value] of Object.entries(item.props)) {
|
|
6772
|
+
if (value !== void 0) props[key] = value;
|
|
6773
|
+
}
|
|
6774
|
+
afterImages.set(mergeKey(kind, item.id), props);
|
|
6775
|
+
}
|
|
6673
6776
|
}
|
|
6674
|
-
return
|
|
6777
|
+
return storeRuntime(target).applyResolvedNodeUniqueness(
|
|
6778
|
+
txBackend,
|
|
6779
|
+
{
|
|
6780
|
+
upserts: upserts.map((upsert) => ({
|
|
6781
|
+
kind: upsert.kind,
|
|
6782
|
+
id: upsert.id,
|
|
6783
|
+
props: requireDefined(
|
|
6784
|
+
afterImages.get(mergeKey(upsert.kind, upsert.id))
|
|
6785
|
+
)
|
|
6786
|
+
})),
|
|
6787
|
+
releases: deletions
|
|
6788
|
+
},
|
|
6789
|
+
async () => {
|
|
6790
|
+
for (const deletion of deletions) {
|
|
6791
|
+
await nodeCollection(nodesApi, deletion.kind).delete(deletion.id);
|
|
6792
|
+
}
|
|
6793
|
+
const committed = /* @__PURE__ */ new Set();
|
|
6794
|
+
for (const upsert of upserts) {
|
|
6795
|
+
await nodeCollection(nodesApi, upsert.kind).upsertByIdFromRecord(
|
|
6796
|
+
upsert.id,
|
|
6797
|
+
upsert.props,
|
|
6798
|
+
nodeWriteWindowOptions(upsert)
|
|
6799
|
+
);
|
|
6800
|
+
committed.add(mergeKey(upsert.kind, upsert.id));
|
|
6801
|
+
}
|
|
6802
|
+
return committed.size;
|
|
6803
|
+
}
|
|
6804
|
+
);
|
|
6675
6805
|
}
|
|
6676
6806
|
async function applyEdgeRows(edgesApi, deletions, upserts) {
|
|
6677
6807
|
for (const deletion of deletions) {
|
|
@@ -6732,7 +6862,13 @@ async function applyInternalMergePlan(plan, nodesApi, edgesApi, target, txBacken
|
|
|
6732
6862
|
);
|
|
6733
6863
|
let committedNodes;
|
|
6734
6864
|
try {
|
|
6735
|
-
committedNodes = await applyNodeRows(
|
|
6865
|
+
committedNodes = await applyNodeRows(
|
|
6866
|
+
target,
|
|
6867
|
+
txBackend,
|
|
6868
|
+
nodesApi,
|
|
6869
|
+
nodeDeletions,
|
|
6870
|
+
nodeUpserts
|
|
6871
|
+
);
|
|
6736
6872
|
} catch (error) {
|
|
6737
6873
|
throw error instanceof IdentityEndpointValidityError ? translateIdentityCommitError(error) : error;
|
|
6738
6874
|
}
|
|
@@ -7396,7 +7532,8 @@ function incrementalSchemaError() {
|
|
|
7396
7532
|
{ details: {} }
|
|
7397
7533
|
);
|
|
7398
7534
|
}
|
|
7399
|
-
async function planMerge(store,
|
|
7535
|
+
async function planMerge(store, branchInputs, optionsInput = {}) {
|
|
7536
|
+
const branches = unwrapMergeBranches(branchInputs);
|
|
7400
7537
|
const normalized = tryNormalize(optionsInput);
|
|
7401
7538
|
if (isErr(normalized)) return err(normalized.error);
|
|
7402
7539
|
const options = normalized.data;
|
|
@@ -7437,7 +7574,8 @@ async function planMerge(store, branches, optionsInput = {}) {
|
|
|
7437
7574
|
);
|
|
7438
7575
|
}
|
|
7439
7576
|
async function planMergeIncremental(args) {
|
|
7440
|
-
const { forkPoint, target
|
|
7577
|
+
const { forkPoint, target } = args;
|
|
7578
|
+
const branches = unwrapMergeBranches(args.branches);
|
|
7441
7579
|
const normalized = tryNormalize(args.options ?? {}, ["target"]);
|
|
7442
7580
|
if (isErr(normalized)) return err(normalized.error);
|
|
7443
7581
|
const options = normalized.data;
|
|
@@ -7878,6 +8016,8 @@ function identityConsistencySeeds(artifact, profile) {
|
|
|
7878
8016
|
}
|
|
7879
8017
|
async function applyWireMergeWrites(target, nodesApi, edgesApi, txBackend, artifact) {
|
|
7880
8018
|
const committedNodes = await applyNodeRows(
|
|
8019
|
+
target,
|
|
8020
|
+
txBackend,
|
|
7881
8021
|
nodesApi,
|
|
7882
8022
|
artifact.writes.nodeDeletes,
|
|
7883
8023
|
artifact.writes.nodeUpserts.map((upsert) => ({
|
|
@@ -8050,7 +8190,8 @@ async function applyMergePlan(target, input) {
|
|
|
8050
8190
|
);
|
|
8051
8191
|
}
|
|
8052
8192
|
}
|
|
8053
|
-
async function merge(store,
|
|
8193
|
+
async function merge(store, branchInputs, optionsInput = {}) {
|
|
8194
|
+
const branches = unwrapMergeBranches(branchInputs);
|
|
8054
8195
|
const normalized = tryNormalize(optionsInput);
|
|
8055
8196
|
if (isErr(normalized)) {
|
|
8056
8197
|
return err(normalized.error);
|
|
@@ -8527,7 +8668,8 @@ async function commitIncrementalPlan(target, plan, guard) {
|
|
|
8527
8668
|
);
|
|
8528
8669
|
}
|
|
8529
8670
|
async function mergeIncremental(args) {
|
|
8530
|
-
const { forkPoint, target
|
|
8671
|
+
const { forkPoint, target } = args;
|
|
8672
|
+
const branches = unwrapMergeBranches(args.branches);
|
|
8531
8673
|
const normalized = tryNormalize(args.options ?? {}, ["target"]);
|
|
8532
8674
|
if (isErr(normalized)) {
|
|
8533
8675
|
return err(normalized.error);
|
|
@@ -8571,6 +8713,6 @@ async function mergeIncremental(args) {
|
|
|
8571
8713
|
);
|
|
8572
8714
|
}
|
|
8573
8715
|
|
|
8574
|
-
export { BaseVersionMismatchError, BranchError, CandidateSourceError, IdentityMergeConflictError, InvalidMergeOptionsError, InvalidMergePlanError, MERGE_ERROR_CODES, MERGE_OPTION_DEFAULTS, MERGE_PLAN_DIGEST_ALGORITHM, MERGE_PLAN_FORMAT_VERSION, MatchEvidenceError, MergeConflictError, MergeConstraintConflictError, MergeError, MergePlanCapabilityError, MergePlanDigestMismatchError, MergePlanOriginMismatchError, MergePlanSchemaMismatchError, MergePlanTargetMismatchError, MergePlanningStaleError, SimilarityUnavailableError, StaleMergePlanError, UnsupportedMergePlanVersionError, VALIDITY_END_TARGET_PRECEDENCE, applyMergePlan, asBaseVersion, asBranchId, branch, cloneWorkingCopyStrategy, computeBaseVersion, merge, mergeIncremental, normalizeMergeOptions, openProvenanceStore, persistProvenanceRecords, planMerge, planMergeIncremental, provenanceGraphId, readProvenance };
|
|
8716
|
+
export { BaseVersionMismatchError, BranchError, CandidateSourceError, IdentityMergeConflictError, InvalidMergeOptionsError, InvalidMergePlanError, MERGE_ERROR_CODES, MERGE_OPTION_DEFAULTS, MERGE_PLAN_DIGEST_ALGORITHM, MERGE_PLAN_FORMAT_VERSION, MatchEvidenceError, MergeConflictError, MergeConstraintConflictError, MergeError, MergePlanCapabilityError, MergePlanDigestMismatchError, MergePlanOriginMismatchError, MergePlanSchemaMismatchError, MergePlanTargetMismatchError, MergePlanningStaleError, SimilarityUnavailableError, StaleMergePlanError, UnsupportedMergePlanVersionError, VALIDITY_END_TARGET_PRECEDENCE, applyMergePlan, asBaseVersion, asBranchId, branch, cloneWorkingCopyStrategy, computeBaseVersion, ingestionBranch, merge, mergeIncremental, normalizeMergeOptions, openProvenanceStore, persistProvenanceRecords, planMerge, planMergeIncremental, provenanceGraphId, readProvenance };
|
|
8575
8717
|
//# sourceMappingURL=index.js.map
|
|
8576
8718
|
//# sourceMappingURL=index.js.map
|