@nicia-ai/typegraph 0.55.0 → 0.56.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 +14 -0
- package/dist/backend/index.cjs +86 -86
- package/dist/backend/index.js +7 -7
- package/dist/backend/postgres/index.cjs +22 -22
- package/dist/backend/postgres/index.js +8 -8
- 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/postgres/pglite.cjs +10 -10
- package/dist/backend/postgres/pglite.js +9 -9
- package/dist/backend/sqlite/index.cjs +21 -21
- package/dist/backend/sqlite/index.js +8 -8
- package/dist/backend/sqlite/libsql.cjs +12 -12
- package/dist/backend/sqlite/libsql.js +8 -8
- 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/backend/sqlite/local.cjs +10 -10
- package/dist/backend/sqlite/local.js +9 -9
- package/dist/{chunk-S5WG5AFG.cjs → chunk-2XUAUSMI.cjs} +12 -12
- package/dist/{chunk-S5WG5AFG.cjs.map → chunk-2XUAUSMI.cjs.map} +1 -1
- package/dist/{chunk-MTE255N3.cjs → chunk-36XLQHZA.cjs} +4 -4
- package/dist/{chunk-MTE255N3.cjs.map → chunk-36XLQHZA.cjs.map} +1 -1
- package/dist/{chunk-FWSGKOBN.js → chunk-6LTRZOUU.js} +6 -6
- package/dist/{chunk-FWSGKOBN.js.map → chunk-6LTRZOUU.js.map} +1 -1
- package/dist/{chunk-YVKPUSHS.js → chunk-75KH6Y2W.js} +16 -7
- package/dist/chunk-75KH6Y2W.js.map +1 -0
- package/dist/{chunk-MJXEO7YA.js → chunk-762VPGHN.js} +5 -5
- package/dist/{chunk-MJXEO7YA.js.map → chunk-762VPGHN.js.map} +1 -1
- package/dist/{chunk-GGDTMBNA.cjs → chunk-7CCVR2QF.cjs} +54 -54
- package/dist/{chunk-GGDTMBNA.cjs.map → chunk-7CCVR2QF.cjs.map} +1 -1
- package/dist/{chunk-7EOJO6QB.js → chunk-7MHENVRG.js} +3 -3
- package/dist/{chunk-7EOJO6QB.js.map → chunk-7MHENVRG.js.map} +1 -1
- package/dist/{chunk-7B3DSFX3.cjs → chunk-AUTRK6WM.cjs} +4 -4
- package/dist/{chunk-7B3DSFX3.cjs.map → chunk-AUTRK6WM.cjs.map} +1 -1
- package/dist/{chunk-SIQ4BFL5.js → chunk-AZP5CCHL.js} +4 -4
- package/dist/{chunk-SIQ4BFL5.js.map → chunk-AZP5CCHL.js.map} +1 -1
- package/dist/{chunk-WTW7RWAG.cjs → chunk-BYUIOM4L.cjs} +6 -6
- package/dist/{chunk-WTW7RWAG.cjs.map → chunk-BYUIOM4L.cjs.map} +1 -1
- package/dist/{chunk-74FNI3PT.js → chunk-C3TJU4KQ.js} +6 -6
- package/dist/chunk-C3TJU4KQ.js.map +1 -0
- package/dist/{chunk-7V2R4MH6.js → chunk-CEQOTZGB.js} +5 -5
- package/dist/{chunk-7V2R4MH6.js.map → chunk-CEQOTZGB.js.map} +1 -1
- package/dist/{chunk-TKFQLKH2.cjs → chunk-CYKHSH5O.cjs} +36 -36
- package/dist/{chunk-TKFQLKH2.cjs.map → chunk-CYKHSH5O.cjs.map} +1 -1
- package/dist/{chunk-D5TCKAQT.cjs → chunk-DGIA64DM.cjs} +4 -4
- package/dist/{chunk-D5TCKAQT.cjs.map → chunk-DGIA64DM.cjs.map} +1 -1
- package/dist/{chunk-FFR3YUY2.js → chunk-E4QYEWVH.js} +5 -5
- package/dist/{chunk-FFR3YUY2.js.map → chunk-E4QYEWVH.js.map} +1 -1
- package/dist/{chunk-467YITD4.cjs → chunk-ETU5IILQ.cjs} +13 -13
- package/dist/{chunk-467YITD4.cjs.map → chunk-ETU5IILQ.cjs.map} +1 -1
- package/dist/{chunk-HW3IX2RF.js → chunk-EWRLWI7W.js} +4 -4
- package/dist/{chunk-HW3IX2RF.js.map → chunk-EWRLWI7W.js.map} +1 -1
- package/dist/{chunk-KZ6OHFDV.js → chunk-F2S5JWCT.js} +3 -3
- package/dist/{chunk-KZ6OHFDV.js.map → chunk-F2S5JWCT.js.map} +1 -1
- package/dist/{chunk-45WPPI64.js → chunk-FMCPKMQI.js} +3 -3
- package/dist/{chunk-45WPPI64.js.map → chunk-FMCPKMQI.js.map} +1 -1
- package/dist/{chunk-QM6IQW7B.js → chunk-ILHVYKXJ.js} +7 -7
- package/dist/{chunk-QM6IQW7B.js.map → chunk-ILHVYKXJ.js.map} +1 -1
- package/dist/{chunk-ECYEWFEH.cjs → chunk-J34FSPSC.cjs} +16 -6
- package/dist/chunk-J34FSPSC.cjs.map +1 -0
- package/dist/{chunk-GFYCLCGU.cjs → chunk-KM3CLHDB.cjs} +9 -9
- package/dist/{chunk-GFYCLCGU.cjs.map → chunk-KM3CLHDB.cjs.map} +1 -1
- package/dist/{chunk-SLNH62T3.js → chunk-KQYUKOGX.js} +3 -3
- package/dist/{chunk-SLNH62T3.js.map → chunk-KQYUKOGX.js.map} +1 -1
- package/dist/{chunk-7I2PYI4U.cjs → chunk-KR3N6Y7O.cjs} +67 -67
- package/dist/{chunk-7I2PYI4U.cjs.map → chunk-KR3N6Y7O.cjs.map} +1 -1
- package/dist/{chunk-HZCOCNIX.cjs → chunk-L2REUAJB.cjs} +24 -24
- package/dist/{chunk-HZCOCNIX.cjs.map → chunk-L2REUAJB.cjs.map} +1 -1
- package/dist/{chunk-VU65FXEG.js → chunk-LFXBFPI2.js} +66 -29
- package/dist/chunk-LFXBFPI2.js.map +1 -0
- package/dist/{chunk-NXRSR6QG.js → chunk-MHM6OGZR.js} +9 -9
- package/dist/{chunk-NXRSR6QG.js.map → chunk-MHM6OGZR.js.map} +1 -1
- package/dist/{chunk-FCUSVSYX.js → chunk-MRGWM5LE.js} +10 -10
- package/dist/{chunk-FCUSVSYX.js.map → chunk-MRGWM5LE.js.map} +1 -1
- package/dist/{chunk-WXGMDROJ.js → chunk-QDNEXTON.js} +7 -7
- package/dist/{chunk-WXGMDROJ.js.map → chunk-QDNEXTON.js.map} +1 -1
- package/dist/{chunk-VYU5H4FO.js → chunk-RXA2D3UR.js} +3 -3
- package/dist/{chunk-VYU5H4FO.js.map → chunk-RXA2D3UR.js.map} +1 -1
- package/dist/{chunk-XODNY4QI.js → chunk-TIBSLFHR.js} +6 -6
- package/dist/{chunk-XODNY4QI.js.map → chunk-TIBSLFHR.js.map} +1 -1
- package/dist/{chunk-KZG7HQSN.cjs → chunk-UVMSWO6X.cjs} +173 -173
- package/dist/{chunk-KZG7HQSN.cjs.map → chunk-UVMSWO6X.cjs.map} +1 -1
- package/dist/{chunk-ORPT5EQW.cjs → chunk-UZ6CJUC5.cjs} +27 -27
- package/dist/chunk-UZ6CJUC5.cjs.map +1 -0
- package/dist/{chunk-GNF3PHEQ.cjs → chunk-VF2IMMZT.cjs} +17 -17
- package/dist/{chunk-GNF3PHEQ.cjs.map → chunk-VF2IMMZT.cjs.map} +1 -1
- package/dist/{chunk-PGZV3E3I.cjs → chunk-VXEHEPC4.cjs} +4 -4
- package/dist/{chunk-PGZV3E3I.cjs.map → chunk-VXEHEPC4.cjs.map} +1 -1
- package/dist/{chunk-OJ47LMOB.cjs → chunk-WIUHN6SZ.cjs} +669 -628
- package/dist/chunk-WIUHN6SZ.cjs.map +1 -0
- package/dist/{chunk-HNW5IDB3.js → chunk-WIZB5U6N.js} +7 -7
- package/dist/{chunk-HNW5IDB3.js.map → chunk-WIZB5U6N.js.map} +1 -1
- package/dist/{chunk-IDQZI6GL.js → chunk-XH75W3O5.js} +3 -3
- package/dist/{chunk-IDQZI6GL.js.map → chunk-XH75W3O5.js.map} +1 -1
- package/dist/{chunk-T7LSSV7J.cjs → chunk-XXEFDJHY.cjs} +45 -45
- package/dist/{chunk-T7LSSV7J.cjs.map → chunk-XXEFDJHY.cjs.map} +1 -1
- package/dist/{chunk-GORCU2GR.cjs → chunk-Z4NU4MYB.cjs} +123 -123
- package/dist/{chunk-GORCU2GR.cjs.map → chunk-Z4NU4MYB.cjs.map} +1 -1
- package/dist/{chunk-KFC3OUV4.cjs → chunk-ZHK3HEZ2.cjs} +130 -130
- package/dist/{chunk-KFC3OUV4.cjs.map → chunk-ZHK3HEZ2.cjs.map} +1 -1
- package/dist/{chunk-FYMYLZGX.cjs → chunk-ZXXGMQC3.cjs} +10 -10
- package/dist/{chunk-FYMYLZGX.cjs.map → chunk-ZXXGMQC3.cjs.map} +1 -1
- package/dist/graph-merge/index.cjs +577 -99
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +108 -4
- package/dist/graph-merge/index.d.ts +108 -4
- package/dist/graph-merge/index.js +495 -21
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{graph-templates-qraW63Ry.d.ts → graph-templates-BSA9VU_O.d.ts} +1 -1
- package/dist/{graph-templates--hp2U4kn.d.cts → graph-templates-Cg7DpEOF.d.cts} +1 -1
- package/dist/index.cjs +95 -95
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -16
- package/dist/interchange/index.cjs +33 -33
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +10 -10
- package/dist/{local-store-impl-HXBO3VF4.js → local-store-impl-77DCLAAY.js} +18 -18
- package/dist/{local-store-impl-HXBO3VF4.js.map → local-store-impl-77DCLAAY.js.map} +1 -1
- package/dist/{local-store-impl-CUQKHHOZ.cjs → local-store-impl-NJCWM3KR.cjs} +22 -22
- package/dist/{local-store-impl-CUQKHHOZ.cjs.map → local-store-impl-NJCWM3KR.cjs.map} +1 -1
- package/dist/{pglite-store-impl-BD3AVOUH.js → pglite-store-impl-3VFSYLAJ.js} +18 -18
- package/dist/{pglite-store-impl-BD3AVOUH.js.map → pglite-store-impl-3VFSYLAJ.js.map} +1 -1
- package/dist/{pglite-store-impl-C3MQ72LT.cjs → pglite-store-impl-LHLJ3GBQ.cjs} +22 -22
- package/dist/{pglite-store-impl-C3MQ72LT.cjs.map → pglite-store-impl-LHLJ3GBQ.cjs.map} +1 -1
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/provenance/index.cjs +21 -21
- package/dist/provenance/index.d.cts +1 -1
- package/dist/provenance/index.d.ts +1 -1
- package/dist/provenance/index.js +5 -5
- package/dist/schema/index.cjs +36 -36
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +6 -6
- package/dist/{store-stw2AEB4.d.ts → store-CQ3uzXla.d.ts} +58 -27
- package/dist/{store-DTEkUQ0k.d.cts → store-DbHAgVMH.d.cts} +58 -27
- package/package.json +1 -1
- package/dist/chunk-74FNI3PT.js.map +0 -1
- package/dist/chunk-ECYEWFEH.cjs.map +0 -1
- package/dist/chunk-OJ47LMOB.cjs.map +0 -1
- package/dist/chunk-ORPT5EQW.cjs.map +0 -1
- package/dist/chunk-VU65FXEG.js.map +0 -1
- package/dist/chunk-YVKPUSHS.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLAIMS, UNIQUE_SIDECAR_BATCH, BATCH_POINT_READ, STATEMENT_EXECUTION, CONTRIBUTION_HEALTH, RECORDED_REVISION_ORIGINS } from './chunk-
|
|
1
|
+
import { CLAIMS, UNIQUE_SIDECAR_BATCH, BATCH_POINT_READ, STATEMENT_EXECUTION, CONTRIBUTION_HEALTH, RECORDED_REVISION_ORIGINS } from './chunk-75KH6Y2W.js';
|
|
2
2
|
import { ConfigurationError } from './chunk-ADOABE3R.js';
|
|
3
3
|
import { requireDefined, createDataKeyedBag } from './chunk-QD2JFTSL.js';
|
|
4
4
|
|
|
@@ -198,5 +198,5 @@ function assertRecursiveTraversal(verdict, operation) {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
export { assertRecursiveTraversal, assumeRecursiveTraversalSupported, batchPointReadVerdict, claimsVerdict, contributionHealthVerdict, createClaimsVerdictThunk, missingRequiredExtras, recordedRevisionOriginsVerdict, recursiveTraversalUnsupportedError, requireExtras, resolveBundle, resolveRecursiveTraversal, statementExecutionVerdict, uniqueSidecarBatchVerdict };
|
|
201
|
-
//# sourceMappingURL=chunk-
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
201
|
+
//# sourceMappingURL=chunk-XH75W3O5.js.map
|
|
202
|
+
//# sourceMappingURL=chunk-XH75W3O5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/backend/capabilities/resolve.ts","../src/backend/capabilities/recursive-traversal.ts"],"names":[],"mappings":";;;;;AA6IA,SAAS,aAAA,CAMP,SACA,MAAA,EAIC;AACD,EAAA,MAAM,WACJ,kBAAA,EAA6D;AAC/D,EAAA,MAAM,gBAA0B,EAAC;AACjC,EAAA,KAAA,MAAW,SAAS,MAAA,EAAQ;AAC1B,IAAA,MAAM,OAAA,GAAU,MAAM,OAAA,CAAQ,MAAA;AAAA,MAC5B,CAAC,MAAA,KAAW,OAAA,CAAQ,MAAM,CAAA,KAAM;AAAA,KAClC;AACA,IAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACxB,MAAA,QAAA,CAAS,KAAA,CAAM,EAAE,CAAA,GAAI,EAAE,SAAS,IAAA,EAAM,OAAA,EAAS,MAAM,OAAA,EAAQ;AAAA,IAC/D,CAAA,MAAO;AACL,MAAA,QAAA,CAAS,KAAA,CAAM,EAAE,CAAA,GAAI;AAAA,QACnB,OAAA,EAAS,KAAA;AAAA,QACT,OAAA;AAAA,QACA,aAAa,KAAA,CAAM;AAAA,OACrB;AACA,MAAA,aAAA,CAAc,IAAA,CAAK,MAAM,EAAE,CAAA;AAAA,IAC7B;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,QAAA;AAAA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A,IACA;AAAA,MACE,UAAA,EACE;AAAA;AACJ,GACF;AACF;AAGO,SAAS,wBAAA,CACd,SACA,SAAA,EAC4E;AAC5E,EAAA,IAAI,QAAQ,SAAA,EAAW;AACvB,EAAA,MAAM,kCAAA,CAAmC,SAAS,SAAS,CAAA;AAC7D","file":"chunk-IDQZI6GL.js","sourcesContent":["/**\n * The bundle verdict resolver — generalizing `claimSupport`\n * (`store/claims/backing.ts`).\n *\n * Resolution splits in two (ruling B1): the VERDICT — the support decision,\n * resolved once against `GraphBackend` and threaded — and the BINDING\n * (`bind.ts`) — the actual member functions, bound at the call site off\n * whichever port the site holds. A verdict carries names, never functions\n * (I19), so it crosses transaction boundaries safely.\n */\nimport { ConfigurationError } from \"../../errors\";\nimport { createDataKeyedBag } from \"../../utils/object\";\nimport { requireDefined } from \"../../utils/presence\";\nimport { type BackendCapabilities, type GraphBackend } from \"../types\";\nimport {\n BATCH_POINT_READ,\n type CapabilityBundleDefinition,\n type CapabilityBundleDisposition,\n type CapabilityBundleExtra,\n CLAIMS,\n CONTRIBUTION_HEALTH,\n type OptionalGraphBackendMember,\n RECORDED_REVISION_ORIGINS,\n STATEMENT_EXECUTION,\n UNIQUE_SIDECAR_BATCH,\n} from \"./bundle-registry\";\n\n/**\n * A bundle's extras, as a type-level map from extra id to the UNION of\n * member names that extra covers — derived from the definition's `extras`\n * array by `const` inference, never hand-written.\n */\nexport type CapabilityExtraSpec = Readonly<\n Record<string, OptionalGraphBackendMember>\n>;\n\n/**\n * One extra's verdict. `present: true` carries the member NAMES, not the\n * member functions (ruling B1) — the names are what the accessor binds\n * from, at the site, off the port.\n */\nexport type ExtraVerdict<M extends OptionalGraphBackendMember> =\n | Readonly<{ present: true; members: readonly M[] }>\n | Readonly<{\n present: false;\n missing: readonly M[];\n disposition: CapabilityBundleDisposition;\n }>;\n\n/** The verdict map: one entry per extra id, never a boolean. */\nexport type ExtraVerdicts<X extends CapabilityExtraSpec> = Readonly<{\n [K in keyof X]: ExtraVerdict<X[K]>;\n}>;\n\nexport type GatedBundleVerdict<\n MCore extends OptionalGraphBackendMember,\n X extends CapabilityExtraSpec,\n> =\n | Readonly<{\n supported: true;\n bundle: string;\n /** The core, guaranteed present. Names, not functions. */\n members: readonly MCore[];\n extras: ExtraVerdicts<X>;\n /** The `present: false` keys of `extras`. */\n missingExtras: readonly (keyof X)[];\n }>\n | Readonly<{\n supported: false;\n bundle: string;\n missing: readonly MCore[];\n /** Why it is unsupported: the bundle's own `disposition`, verbatim. */\n disposition: CapabilityBundleDisposition;\n }>;\n\n/** No `supported` field: a graduated bundle has no bundle-level verdict. */\nexport type GraduatedBundleVerdict<X extends CapabilityExtraSpec> = Readonly<{\n bundle: string;\n extras: ExtraVerdicts<X>;\n missingExtras: readonly (keyof X)[];\n}>;\n\n/**\n * Recovers the id→members map from a definition's `extras` TUPLE (not\n * `readonly CapabilityBundleExtra<XId, MExtra>[]` — over the array type the\n * id→members association is erased and `ExtraVerdicts<X>` degenerates to an\n * index signature).\n */\nexport type SpecOf<\n XS extends readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[],\n> = { [K in XS[number] as K[\"id\"]]: K[\"members\"][number] };\n\nexport type ExtrasOf<D extends CapabilityBundleDefinition> = SpecOf<\n NonNullable<D[\"extras\"]>\n>;\nexport type ExtraMember<\n D extends CapabilityBundleDefinition,\n X extends keyof ExtrasOf<D>,\n> = Extract<ExtrasOf<D>[X], OptionalGraphBackendMember>;\n\n/**\n * The definition union and the return-type mapping. Structural, matching\n * `bundle-registry.ts`'s `BundleMembers` helper's own lesson: reading `core`\n * off `D` directly (rather than re-matching `GatedBundleDefinition`) avoids\n * an unmatched `infer` silently widening to the member constraint.\n */\nexport type BundleVerdictOf<D extends CapabilityBundleDefinition> =\n D extends (\n {\n kind: \"graduated\";\n extras: infer XS extends readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[];\n }\n ) ?\n GraduatedBundleVerdict<SpecOf<XS>>\n : D extends (\n {\n kind: \"gated\";\n core: readonly (infer MCore extends OptionalGraphBackendMember)[];\n extras?: infer XS extends\n | readonly CapabilityBundleExtra<string, OptionalGraphBackendMember>[]\n | undefined;\n }\n ) ?\n GatedBundleVerdict<\n MCore,\n SpecOf<\n XS extends (\n readonly CapabilityBundleExtra<string, OptionalGraphBackendMember>[]\n ) ?\n XS\n : []\n >\n >\n : never;\n\nfunction resolveExtras<\n const XS extends readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[],\n>(\n backend: GraphBackend,\n extras: XS,\n): Readonly<{\n extras: ExtraVerdicts<SpecOf<XS>>;\n missingExtras: readonly (keyof SpecOf<XS>)[];\n}> {\n const verdicts =\n createDataKeyedBag<ExtraVerdict<OptionalGraphBackendMember>>();\n const missingExtras: string[] = [];\n for (const extra of extras) {\n const missing = extra.members.filter(\n (member) => backend[member] === undefined,\n );\n if (missing.length === 0) {\n verdicts[extra.id] = { present: true, members: extra.members };\n } else {\n verdicts[extra.id] = {\n present: false,\n missing,\n disposition: extra.disposition,\n };\n missingExtras.push(extra.id);\n }\n }\n return {\n extras: verdicts as ExtraVerdicts<SpecOf<XS>>,\n missingExtras: missingExtras,\n };\n}\n\n/**\n * The `claims` bidirectional cross-check (ruling F2), reproducing\n * `store/claims/backing.ts`'s pre-B7 message text, code and suggestion\n * BYTE-FOR-BYTE. B7 made `claimSupport` (`backing.ts`) delegate to\n * {@link resolveBundle}, so this is now the ONLY place the check runs — there\n * is no second copy left to keep in sync. `bidirectional` is `claims`-only by\n * design (§5.2.1): the two trailing sentences below name \"claim\"/\"fence\"\n * vocabulary that is specific to that one bundle, and a future bundle raising\n * `crossCheck` to `\"bidirectional\"` must carry its own justification row and,\n * with it, its own message pair here.\n *\n * @throws {ConfigurationError} when the declaration and the member surface\n * disagree in either direction.\n */\nfunction assertClaimsBidirectionalAgreement(\n backend: GraphBackend,\n definition: Readonly<{\n declaration?: keyof BackendCapabilities;\n core: readonly OptionalGraphBackendMember[];\n portSurfaceCode: string;\n }>,\n): void {\n if (definition.declaration === undefined) return;\n const declared = backend.capabilities[definition.declaration] === true;\n const present = definition.core.filter(\n (member) => backend[member] !== undefined,\n );\n if (declared && present.length === definition.core.length) return;\n if (!declared && present.length === 0) return;\n\n const missing = definition.core.filter(\n (member) => backend[member] === undefined,\n );\n const declarationName = definition.declaration;\n throw new ConfigurationError(\n declared ?\n `This backend declares \\`${declarationName}: true\\` but does not implement ${missing.join(\", \")}. ` +\n \"A declared constraint would then be written without the fence the declaration promises.\"\n : `This backend implements ${present.join(\", \")} but does not declare \\`${declarationName}: true\\`. ` +\n \"Claim support is read from the declaration, so these members would never be called.\",\n { code: definition.portSurfaceCode, missing, present },\n {\n suggestion:\n declared ?\n `Implement the missing members, or drop \\`${declarationName}\\` from the backend's capabilities.`\n : `Declare \\`${declarationName}: true\\` in the backend's capabilities, or drop the claim members.`,\n },\n );\n}\n\n/**\n * Resolved ONCE, at construction or entry, against the top-level backend —\n * never against a `TransactionBackend` (I15's `@ts-expect-error` row).\n *\n * Rules: the member surface is read always; the declaration is read only\n * when the definition names one AND `crossCheck !== \"none\"` (only `claims`\n * qualifies in the pilot registry); a gated bundle's core must be complete\n * or the bundle is unsupported with `missing`; a graduated bundle has no\n * bundle-level verdict, only per-extra verdicts. `missingExtras` is built by\n * the SAME fold that builds `extras` (one pass, one owner).\n */\nexport function resolveBundle<const D extends CapabilityBundleDefinition>(\n backend: GraphBackend,\n definition: D,\n): BundleVerdictOf<D> {\n const extras = (definition.extras ?? []) as readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[];\n const { extras: extraVerdicts, missingExtras } = resolveExtras(\n backend,\n extras,\n );\n\n // Rule 1: the declaration is read whenever `crossCheck !== \"none\"`,\n // regardless of kind — a graduated bundle's \"core\" for this purpose is the\n // union of every extra's members, since it has no core of its own. Only\n // `claims` (gated) exercises this in the pilot registry, but the check\n // itself must not silently no-op for a hypothetical graduated bidirectional\n // bundle (T11's mutation pins exactly this).\n if (definition.crossCheck === \"bidirectional\") {\n const memberSet =\n definition.kind === \"gated\" ?\n definition.core\n : extras.flatMap((extra) => extra.members);\n assertClaimsBidirectionalAgreement(backend, {\n ...(definition.declaration === undefined ?\n {}\n : { declaration: definition.declaration }),\n core: memberSet,\n portSurfaceCode: definition.portSurfaceCode,\n });\n }\n\n if (definition.kind === \"graduated\") {\n return {\n bundle: definition.id,\n extras: extraVerdicts,\n missingExtras,\n } as unknown as BundleVerdictOf<D>;\n }\n\n const missing = definition.core.filter(\n (member) => backend[member] === undefined,\n );\n if (missing.length > 0) {\n return {\n supported: false,\n bundle: definition.id,\n missing,\n disposition: definition.disposition,\n } as unknown as BundleVerdictOf<D>;\n }\n return {\n supported: true,\n bundle: definition.id,\n members: definition.core,\n extras: extraVerdicts,\n missingExtras,\n } as unknown as BundleVerdictOf<D>;\n}\n\n/** The literal operation names a bundle's `operations` table declares. */\nexport type OperationNames<D extends CapabilityBundleDefinition> =\n D[\"operations\"][number][\"operation\"];\n\n/** The extras a named operation `requires`, read from the ROW — never re-spelled at the call site. */\nexport type RequiredExtrasOf<\n D extends CapabilityBundleDefinition,\n Op extends OperationNames<D>,\n> =\n Extract<D[\"operations\"][number], { operation: Op }> extends (\n { requires: infer R extends readonly string[] }\n ) ?\n R[number]\n : never;\n\n/**\n * The registry's row lookup plus the presence fold, extracted verbatim from\n * {@link requireExtras}'s body (ruling B8 spec item 3): the ONE owner of\n * \"what this operation requires\" that both `requireExtras`'s default throw\n * and a call site's own `refuse` callback consult.\n *\n * `operation` is the literal key of the bundle's `operations` tuple, so the\n * required extras are looked up TYPE-LEVEL from the registry — no second\n * spelling of `requires` at the call site.\n *\n * @throws {ConfigurationError} naming the unknown operation when `operation`\n * is not a row of `definition.operations`.\n */\nexport function missingRequiredExtras<\n const D extends CapabilityBundleDefinition,\n Op extends OperationNames<D>,\n>(\n definition: D,\n verdict: BundleVerdictOf<D>,\n operation: Op,\n): readonly string[] {\n const row = definition.operations.find(\n (candidate) => candidate.operation === operation,\n );\n if (row === undefined) {\n throw new ConfigurationError(\n `Unknown operation \"${operation}\" for capability bundle \"${definition.id}\".`,\n { bundle: definition.id, operation },\n );\n }\n const required = row.requires ?? [];\n const extras:\n | Readonly<Record<string, ExtraVerdict<OptionalGraphBackendMember>>>\n | undefined = \"extras\" in verdict ? verdict.extras : undefined;\n return required.filter(\n (id) => extras === undefined || extras[id]?.present !== true,\n );\n}\n\n/**\n * The refusal for an operation whose `requires` extras are absent — how a\n * GRADUATED bundle refuses where the tree refuses today: the row names the\n * operation and the extras, this asserts they are present, and\n * {@link bindExtra} (`bind.ts`) binds them off the port.\n *\n * `refuse`, when supplied, is called instead of the registry-coded throw\n * below — this is how a call site keeps its OWN existing error text (message,\n * `details` shape, order relative to other refusals) while the registry\n * stays the one owner of \"what this operation requires\" (ruling B8 spec item\n * 3). Omitting it keeps the default behavior byte-identical to before this\n * parameter existed.\n *\n * @throws {ConfigurationError} naming the row's own `code` when one or more\n * required extras is absent from the verdict and no `refuse` callback is\n * supplied; otherwise calls `refuse(missing)`, which never returns.\n */\nexport function requireExtras<\n const D extends CapabilityBundleDefinition,\n Op extends OperationNames<D>,\n>(\n definition: D,\n verdict: BundleVerdictOf<D>,\n operation: Op,\n refuse?: (missing: readonly string[]) => never,\n): asserts verdict is BundleVerdictOf<D> & {\n extras: {\n [K in RequiredExtrasOf<D, Op> & keyof ExtrasOf<D>]: Extract<\n ExtraVerdict<ExtraMember<D, K>>,\n { present: true }\n >;\n };\n} {\n const missing = missingRequiredExtras(definition, verdict, operation);\n if (missing.length === 0) return;\n\n if (refuse !== undefined) refuse(missing);\n\n // `missingRequiredExtras` already threw the unknown-operation error above\n // when the row would be undefined, so `requireDefined` here is a redundant\n // (never-failing) narrowing, not a second lookup that could disagree.\n const { disposition } = requireDefined(\n definition.operations.find(\n (candidate) => candidate.operation === operation,\n ),\n );\n if (disposition.kind === \"refuse\") {\n throw new ConfigurationError(\n `Operation \"${operation}\" on capability bundle \"${definition.id}\" requires ${missing.join(\", \")}.`,\n { code: disposition.code, bundle: definition.id, operation, missing },\n );\n }\n // No pilot row reaches this: every row with a non-empty `requires` in the\n // registry disposes `refuse` (a graduated bundle's fallback rows never\n // name `requires` — the fallback IS the degrade path). Kept as a named,\n // typed refusal rather than a silent pass so a future `fallback` +\n // `requires` row cannot pass `requireExtras` unnoticed.\n throw new ConfigurationError(\n `Operation \"${operation}\" on capability bundle \"${definition.id}\" requires ${missing.join(\", \")}, and the registry names no refusal code for this fallback-dispositioned row.`,\n { bundle: definition.id, operation, missing },\n );\n}\n\n// ---------------------------------------------------------------------------\n// The six named verdict accessors — GraphBackend-only, no exceptions (I15).\n// ---------------------------------------------------------------------------\n\nexport function claimsVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof CLAIMS> {\n return resolveBundle(backend, CLAIMS);\n}\n\nexport function uniqueSidecarBatchVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof UNIQUE_SIDECAR_BATCH> {\n return resolveBundle(backend, UNIQUE_SIDECAR_BATCH);\n}\n\nexport function batchPointReadVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof BATCH_POINT_READ> {\n return resolveBundle(backend, BATCH_POINT_READ);\n}\n\nexport function statementExecutionVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof STATEMENT_EXECUTION> {\n return resolveBundle(backend, STATEMENT_EXECUTION);\n}\n\nexport function contributionHealthVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof CONTRIBUTION_HEALTH> {\n return resolveBundle(backend, CONTRIBUTION_HEALTH);\n}\n\nexport function recordedRevisionOriginsVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof RECORDED_REVISION_ORIGINS> {\n return resolveBundle(backend, RECORDED_REVISION_ORIGINS);\n}\n\n// ---------------------------------------------------------------------------\n// The claims verdict THUNK — the reference implementation of §5.2.3's INTENT\n// (one owner, at-most-once resolution, no re-derivation) moved to WHEN it\n// resolves rather than IF (ruling B7 refinement 2).\n// ---------------------------------------------------------------------------\n\n/**\n * A memoized, at-most-once resolution of the `claims` bundle's verdict\n * against ONE backend.\n *\n * Eager resolution at store construction is forbidden: T14's\n * contradictory-declaration backends must still be able to construct a store\n * and create nodes — only a constrained edge write may legally reach the\n * bidirectional cross-check's throw, and it must do so lazily, at the first\n * write that needs the verdict.\n *\n * A cached verdict cannot go stale because `GraphBackend` is deep-frozen (B1):\n * nothing can flip `capabilities.constraintClaims` or add/remove a claim\n * member on a backend object after this thunk has already resolved it, so\n * \"resolve once and reuse forever\" is exactly as safe as \"resolve every\n * time\" — for one backend object, they observe the same immutable answer.\n */\nexport type ClaimsVerdictThunk = () => BundleVerdictOf<typeof CLAIMS>;\n\n/**\n * Interning: the same backend object always gets back the SAME thunk object.\n * This is what makes \"one shared thunk per backend\" structural rather than a\n * convention every population site has to honor — a second call to\n * {@link createClaimsVerdictThunk} for a backend already minted cannot produce\n * a second, independently-memoized verdict.\n */\nconst CLAIMS_VERDICT_THUNKS = new WeakMap<GraphBackend, ClaimsVerdictThunk>();\n\n/**\n * Mints — or returns the already-minted — {@link ClaimsVerdictThunk} for\n * `backend`.\n *\n * The thunk resolves {@link resolveBundle}`(backend, CLAIMS)` on its first\n * call and caches the outcome, INCLUDING a thrown `ConfigurationError`: a\n * refusal is cached and re-thrown on every subsequent call, never\n * re-resolved. Both layers — interning here, memoization inside the thunk —\n * are required: interning alone would still let two independently-memoized\n * thunks exist for one backend if a caller ignored the shared one; memoizing\n * alone would still let two different call sites mint two different thunks\n * that could disagree about whether they had already resolved.\n */\nexport function createClaimsVerdictThunk(\n backend: GraphBackend,\n): ClaimsVerdictThunk {\n const existing = CLAIMS_VERDICT_THUNKS.get(backend);\n if (existing !== undefined) return existing;\n\n type Memo =\n | Readonly<{ state: \"resolved\"; verdict: BundleVerdictOf<typeof CLAIMS> }>\n | Readonly<{ state: \"thrown\"; error: unknown }>;\n let memo: Memo | undefined;\n\n const thunk: ClaimsVerdictThunk = () => {\n if (memo === undefined) {\n try {\n memo = { state: \"resolved\", verdict: resolveBundle(backend, CLAIMS) };\n } catch (error) {\n memo = { state: \"thrown\", error };\n throw error;\n }\n }\n if (memo.state === \"thrown\") throw memo.error;\n return memo.verdict;\n };\n\n CLAIMS_VERDICT_THUNKS.set(backend, thunk);\n return thunk;\n}\n","/**\n * The `recursiveTraversal` capability: whether this engine can compute a\n * BOUNDED TRANSITIVE CLOSURE of a relation in one round trip — the traversal\n * primitive, not the SQL syntax.\n */\nimport { ConfigurationError } from \"../../errors\";\nimport { type BackendCapabilities } from \"../types\";\n\n/**\n * Whether this engine can compute a BOUNDED TRANSITIVE CLOSURE of a relation\n * in one round trip — the traversal primitive, not the SQL syntax. A SQL\n * engine satisfies it with `WITH RECURSIVE`; a graph-native engine satisfies\n * it with a native expansion operator. What the capability promises is the\n * SEMANTICS: given a seed set, a step relation, and a hop bound, the engine\n * returns the reachable set (optionally with depth and path) without the\n * client issuing one statement per hop.\n *\n * Absent means SUPPORTED. Every engine TypeGraph ships supports it, and every\n * custom backend already has the six emission sites run against it\n * unconditionally: making absence mean `false` would refuse traversals that\n * work today. This mirrors `returning`, not `constraintClaims` — absence is\n * only allowed to mean \"false\" where absence is SAFE, and here it is not. A\n * backend that genuinely lacks the primitive must say so.\n */\nexport type RecursiveTraversalCapability = Readonly<{\n supported: boolean;\n /**\n * Why the engine lacks it — surfaced in every refusal's details so the\n * state is named rather than implied. Required when `supported: false` and\n * forbidden when `true`, so the union cannot carry a dangling reason.\n */\n reason?: string;\n}>;\n\n/**\n * The brand. Declared but never exported, and never assigned at runtime — it\n * exists only so that an object literal outside this module is not assignable\n * to {@link RecursiveTraversalVerdict}. Compare `VectorSlot`'s construction\n * discipline: the type is public, the constructor is the seam.\n */\ndeclare const RECURSIVE_TRAVERSAL_VERDICT: unique symbol;\n\n/**\n * The decision, branded so it can only originate from this module's\n * constructors. Round 1 made the verdict a required *field*, which forces a\n * token, not a verdict: any caller could satisfy it by writing\n * `{ supported: true }` inline, and nothing tied the value to the resolver.\n * The brand closes that at the type level.\n */\nexport type RecursiveTraversalVerdict = Readonly<\n { [RECURSIVE_TRAVERSAL_VERDICT]: true } & (\n { supported: true } | { supported: false; reason: string }\n )\n>;\n\n/** THE one reader of `capabilities.recursiveTraversal`, and THE one constructor. */\nexport function resolveRecursiveTraversal(\n capabilities: BackendCapabilities,\n): RecursiveTraversalVerdict {\n const declared = capabilities.recursiveTraversal;\n if (declared === undefined) {\n return { supported: true } as RecursiveTraversalVerdict;\n }\n if (declared.supported) {\n return { supported: true } as RecursiveTraversalVerdict;\n }\n // A raw custom-backend object may never have passed the §4 assert\n // (`assertBundledCapabilityDeclarations`), so `reason` is not guaranteed to\n // be present even though the type says it is. Naming the state explicitly\n // beats a default that would hide a contradictory declaration.\n return {\n supported: false,\n reason:\n declared.reason ??\n \"backend declares recursiveTraversal: { supported: false }\",\n } as RecursiveTraversalVerdict;\n}\n\n/**\n * The ONE sanctioned way to obtain a verdict without a backend: the query\n * compiler's public entry point `compileQuery(ast, graphId, \"postgres\")`\n * takes no backend at all, so it has no capabilities to resolve from. The\n * reason string is required and is echoed in nothing — it exists so the call\n * site states why it is allowed to assume.\n */\nexport function assumeRecursiveTraversalSupported(\n reason: string,\n): RecursiveTraversalVerdict {\n // `reason` is intentionally unused in the returned verdict: it documents\n // the assumption at the call site rather than becoming part of the value.\n void reason;\n return { supported: true } as RecursiveTraversalVerdict;\n}\n\n/** THE one refusal builder. */\nexport function recursiveTraversalUnsupportedError(\n verdict: Extract<RecursiveTraversalVerdict, { supported: false }>,\n operation: string,\n): ConfigurationError {\n return new ConfigurationError(\n `${operation} requires recursive traversal, but this backend declares recursiveTraversal: { supported: false }.`,\n {\n code: \"RECURSIVE_TRAVERSAL_UNSUPPORTED\",\n capability: \"recursiveTraversal\",\n operation,\n reason: verdict.reason,\n },\n {\n suggestion:\n \"Use a backend that supports recursive traversal, or avoid this query shape.\",\n },\n );\n}\n\n/** THE one assertion: refuses when the verdict says the engine cannot. */\nexport function assertRecursiveTraversal(\n verdict: RecursiveTraversalVerdict,\n operation: string,\n): asserts verdict is Extract<RecursiveTraversalVerdict, { supported: true }> {\n if (verdict.supported) return;\n throw recursiveTraversalUnsupportedError(verdict, operation);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/backend/capabilities/resolve.ts","../src/backend/capabilities/recursive-traversal.ts"],"names":[],"mappings":";;;;;AA6IA,SAAS,aAAA,CAMP,SACA,MAAA,EAIC;AACD,EAAA,MAAM,WACJ,kBAAA,EAA6D;AAC/D,EAAA,MAAM,gBAA0B,EAAC;AACjC,EAAA,KAAA,MAAW,SAAS,MAAA,EAAQ;AAC1B,IAAA,MAAM,OAAA,GAAU,MAAM,OAAA,CAAQ,MAAA;AAAA,MAC5B,CAAC,MAAA,KAAW,OAAA,CAAQ,MAAM,CAAA,KAAM;AAAA,KAClC;AACA,IAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACxB,MAAA,QAAA,CAAS,KAAA,CAAM,EAAE,CAAA,GAAI,EAAE,SAAS,IAAA,EAAM,OAAA,EAAS,MAAM,OAAA,EAAQ;AAAA,IAC/D,CAAA,MAAO;AACL,MAAA,QAAA,CAAS,KAAA,CAAM,EAAE,CAAA,GAAI;AAAA,QACnB,OAAA,EAAS,KAAA;AAAA,QACT,OAAA;AAAA,QACA,aAAa,KAAA,CAAM;AAAA,OACrB;AACA,MAAA,aAAA,CAAc,IAAA,CAAK,MAAM,EAAE,CAAA;AAAA,IAC7B;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,QAAA;AAAA,IACR;AAAA,GACF;AACF;AAgBA,SAAS,kCAAA,CACP,SACA,UAAA,EAKM;AACN,EAAA,IAAI,UAAA,CAAW,gBAAgB,MAAA,EAAW;AAC1C,EAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,YAAA,CAAa,UAAA,CAAW,WAAW,CAAA,KAAM,IAAA;AAClE,EAAA,MAAM,OAAA,GAAU,WAAW,IAAA,CAAK,MAAA;AAAA,IAC9B,CAAC,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QAAA,MAAM,KAAA;AAAA,MACR;AAAA,IACF;AACA,IAAA,IAAI,IAAA,CAAK,KAAA,KAAU,QAAA,EAAU,MAAM,IAAA,CAAK,KAAA;AACxC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EACd,CAAA;AAEA,EAAA,qBAAA,CAAsB,GAAA,CAAI,SAAS,KAAK,CAAA;AACxC,EAAA,OAAO,KAAA;AACT;;;ACxdO,SAAS,0BACd,YAAA,EAC2B;AAC3B,EAAA,MAAM,WAAW,YAAA,CAAa,kBAAA;AAC9B,EAAA,IAAI,aAAa,MAAA,EAAW;AAC1B,IAAA,OAAO,EAAE,WAAW,IAAA,EAAK;AAAA,EAC3B;AACA,EAAA,IAAI,SAAS,SAAA,EAAW;AACtB,IAAA,OAAO,EAAE,WAAW,IAAA,EAAK;AAAA,EAC3B;AAKA,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,KAAA;AAAA,IACX,MAAA,EACE,SAAS,MAAA,IACT;AAAA,GACJ;AACF;AASO,SAAS,kCACd,MAAA,EAC2B;AAI3B,EAAA,OAAO,EAAE,WAAW,IAAA,EAAK;AAC3B;AAGO,SAAS,kCAAA,CACd,SACA,SAAA,EACoB;AACpB,EAAA,OAAO,IAAI,kBAAA;AAAA,IACT,GAAG,SAAS,CAAA,kGAAA,CAAA;AAAA,IACZ;AAAA,MACE,IAAA,EAAM,iCAAA;AAAA,MACN,UAAA,EAAY,oBAAA;AAAA,MACZ,SAAA;AAAA,MACA,QAAQ,OAAA,CAAQ;AAAA,KAClB;AAAA,IACA;AAAA,MACE,UAAA,EACE;AAAA;AACJ,GACF;AACF;AAGO,SAAS,wBAAA,CACd,SACA,SAAA,EAC4E;AAC5E,EAAA,IAAI,QAAQ,SAAA,EAAW;AACvB,EAAA,MAAM,kCAAA,CAAmC,SAAS,SAAS,CAAA;AAC7D","file":"chunk-XH75W3O5.js","sourcesContent":["/**\n * The bundle verdict resolver — generalizing `claimSupport`\n * (`store/claims/backing.ts`).\n *\n * Resolution splits in two (ruling B1): the VERDICT — the support decision,\n * resolved once against `GraphBackend` and threaded — and the BINDING\n * (`bind.ts`) — the actual member functions, bound at the call site off\n * whichever port the site holds. A verdict carries names, never functions\n * (I19), so it crosses transaction boundaries safely.\n */\nimport { ConfigurationError } from \"../../errors\";\nimport { createDataKeyedBag } from \"../../utils/object\";\nimport { requireDefined } from \"../../utils/presence\";\nimport { type BackendCapabilities, type GraphBackend } from \"../types\";\nimport {\n BATCH_POINT_READ,\n type CapabilityBundleDefinition,\n type CapabilityBundleDisposition,\n type CapabilityBundleExtra,\n CLAIMS,\n CONTRIBUTION_HEALTH,\n type OptionalGraphBackendMember,\n RECORDED_REVISION_ORIGINS,\n STATEMENT_EXECUTION,\n UNIQUE_SIDECAR_BATCH,\n} from \"./bundle-registry\";\n\n/**\n * A bundle's extras, as a type-level map from extra id to the UNION of\n * member names that extra covers — derived from the definition's `extras`\n * array by `const` inference, never hand-written.\n */\nexport type CapabilityExtraSpec = Readonly<\n Record<string, OptionalGraphBackendMember>\n>;\n\n/**\n * One extra's verdict. `present: true` carries the member NAMES, not the\n * member functions (ruling B1) — the names are what the accessor binds\n * from, at the site, off the port.\n */\nexport type ExtraVerdict<M extends OptionalGraphBackendMember> =\n | Readonly<{ present: true; members: readonly M[] }>\n | Readonly<{\n present: false;\n missing: readonly M[];\n disposition: CapabilityBundleDisposition;\n }>;\n\n/** The verdict map: one entry per extra id, never a boolean. */\nexport type ExtraVerdicts<X extends CapabilityExtraSpec> = Readonly<{\n [K in keyof X]: ExtraVerdict<X[K]>;\n}>;\n\nexport type GatedBundleVerdict<\n MCore extends OptionalGraphBackendMember,\n X extends CapabilityExtraSpec,\n> =\n | Readonly<{\n supported: true;\n bundle: string;\n /** The core, guaranteed present. Names, not functions. */\n members: readonly MCore[];\n extras: ExtraVerdicts<X>;\n /** The `present: false` keys of `extras`. */\n missingExtras: readonly (keyof X)[];\n }>\n | Readonly<{\n supported: false;\n bundle: string;\n missing: readonly MCore[];\n /** Why it is unsupported: the bundle's own `disposition`, verbatim. */\n disposition: CapabilityBundleDisposition;\n }>;\n\n/** No `supported` field: a graduated bundle has no bundle-level verdict. */\nexport type GraduatedBundleVerdict<X extends CapabilityExtraSpec> = Readonly<{\n bundle: string;\n extras: ExtraVerdicts<X>;\n missingExtras: readonly (keyof X)[];\n}>;\n\n/**\n * Recovers the id→members map from a definition's `extras` TUPLE (not\n * `readonly CapabilityBundleExtra<XId, MExtra>[]` — over the array type the\n * id→members association is erased and `ExtraVerdicts<X>` degenerates to an\n * index signature).\n */\nexport type SpecOf<\n XS extends readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[],\n> = { [K in XS[number] as K[\"id\"]]: K[\"members\"][number] };\n\nexport type ExtrasOf<D extends CapabilityBundleDefinition> = SpecOf<\n NonNullable<D[\"extras\"]>\n>;\nexport type ExtraMember<\n D extends CapabilityBundleDefinition,\n X extends keyof ExtrasOf<D>,\n> = Extract<ExtrasOf<D>[X], OptionalGraphBackendMember>;\n\n/**\n * The definition union and the return-type mapping. Structural, matching\n * `bundle-registry.ts`'s `BundleMembers` helper's own lesson: reading `core`\n * off `D` directly (rather than re-matching `GatedBundleDefinition`) avoids\n * an unmatched `infer` silently widening to the member constraint.\n */\nexport type BundleVerdictOf<D extends CapabilityBundleDefinition> =\n D extends (\n {\n kind: \"graduated\";\n extras: infer XS extends readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[];\n }\n ) ?\n GraduatedBundleVerdict<SpecOf<XS>>\n : D extends (\n {\n kind: \"gated\";\n core: readonly (infer MCore extends OptionalGraphBackendMember)[];\n extras?: infer XS extends\n | readonly CapabilityBundleExtra<string, OptionalGraphBackendMember>[]\n | undefined;\n }\n ) ?\n GatedBundleVerdict<\n MCore,\n SpecOf<\n XS extends (\n readonly CapabilityBundleExtra<string, OptionalGraphBackendMember>[]\n ) ?\n XS\n : []\n >\n >\n : never;\n\nfunction resolveExtras<\n const XS extends readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[],\n>(\n backend: GraphBackend,\n extras: XS,\n): Readonly<{\n extras: ExtraVerdicts<SpecOf<XS>>;\n missingExtras: readonly (keyof SpecOf<XS>)[];\n}> {\n const verdicts =\n createDataKeyedBag<ExtraVerdict<OptionalGraphBackendMember>>();\n const missingExtras: string[] = [];\n for (const extra of extras) {\n const missing = extra.members.filter(\n (member) => backend[member] === undefined,\n );\n if (missing.length === 0) {\n verdicts[extra.id] = { present: true, members: extra.members };\n } else {\n verdicts[extra.id] = {\n present: false,\n missing,\n disposition: extra.disposition,\n };\n missingExtras.push(extra.id);\n }\n }\n return {\n extras: verdicts as ExtraVerdicts<SpecOf<XS>>,\n missingExtras: missingExtras,\n };\n}\n\n/**\n * The `claims` bidirectional cross-check (ruling F2), reproducing\n * `store/claims/backing.ts`'s pre-B7 message text, code and suggestion\n * BYTE-FOR-BYTE. B7 made `claimSupport` (`backing.ts`) delegate to\n * {@link resolveBundle}, so this is now the ONLY place the check runs — there\n * is no second copy left to keep in sync. `bidirectional` is `claims`-only by\n * design (§5.2.1): the two trailing sentences below name \"claim\"/\"fence\"\n * vocabulary that is specific to that one bundle, and a future bundle raising\n * `crossCheck` to `\"bidirectional\"` must carry its own justification row and,\n * with it, its own message pair here.\n *\n * @throws {ConfigurationError} when the declaration and the member surface\n * disagree in either direction.\n */\nfunction assertClaimsBidirectionalAgreement(\n backend: GraphBackend,\n definition: Readonly<{\n declaration?: keyof BackendCapabilities;\n core: readonly OptionalGraphBackendMember[];\n portSurfaceCode: string;\n }>,\n): void {\n if (definition.declaration === undefined) return;\n const declared = backend.capabilities[definition.declaration] === true;\n const present = definition.core.filter(\n (member) => backend[member] !== undefined,\n );\n if (declared && present.length === definition.core.length) return;\n if (!declared && present.length === 0) return;\n\n const missing = definition.core.filter(\n (member) => backend[member] === undefined,\n );\n const declarationName = definition.declaration;\n throw new ConfigurationError(\n declared ?\n `This backend declares \\`${declarationName}: true\\` but does not implement ${missing.join(\", \")}. ` +\n \"A declared constraint would then be written without the fence the declaration promises.\"\n : `This backend implements ${present.join(\", \")} but does not declare \\`${declarationName}: true\\`. ` +\n \"Claim support is read from the declaration, so these members would never be called.\",\n { code: definition.portSurfaceCode, missing, present },\n {\n suggestion:\n declared ?\n `Implement the missing members, or drop \\`${declarationName}\\` from the backend's capabilities.`\n : `Declare \\`${declarationName}: true\\` in the backend's capabilities, or drop the claim members.`,\n },\n );\n}\n\n/**\n * Resolved ONCE, at construction or entry, against the top-level backend —\n * never against a `TransactionBackend` (I15's `@ts-expect-error` row).\n *\n * Rules: the member surface is read always; the declaration is read only\n * when the definition names one AND `crossCheck !== \"none\"` (only `claims`\n * qualifies in the pilot registry); a gated bundle's core must be complete\n * or the bundle is unsupported with `missing`; a graduated bundle has no\n * bundle-level verdict, only per-extra verdicts. `missingExtras` is built by\n * the SAME fold that builds `extras` (one pass, one owner).\n */\nexport function resolveBundle<const D extends CapabilityBundleDefinition>(\n backend: GraphBackend,\n definition: D,\n): BundleVerdictOf<D> {\n const extras = (definition.extras ?? []) as readonly CapabilityBundleExtra<\n string,\n OptionalGraphBackendMember\n >[];\n const { extras: extraVerdicts, missingExtras } = resolveExtras(\n backend,\n extras,\n );\n\n // Rule 1: the declaration is read whenever `crossCheck !== \"none\"`,\n // regardless of kind — a graduated bundle's \"core\" for this purpose is the\n // union of every extra's members, since it has no core of its own. Only\n // `claims` (gated) exercises this in the pilot registry, but the check\n // itself must not silently no-op for a hypothetical graduated bidirectional\n // bundle (T11's mutation pins exactly this).\n if (definition.crossCheck === \"bidirectional\") {\n const memberSet =\n definition.kind === \"gated\" ?\n definition.core\n : extras.flatMap((extra) => extra.members);\n assertClaimsBidirectionalAgreement(backend, {\n ...(definition.declaration === undefined ?\n {}\n : { declaration: definition.declaration }),\n core: memberSet,\n portSurfaceCode: definition.portSurfaceCode,\n });\n }\n\n if (definition.kind === \"graduated\") {\n return {\n bundle: definition.id,\n extras: extraVerdicts,\n missingExtras,\n } as unknown as BundleVerdictOf<D>;\n }\n\n const missing = definition.core.filter(\n (member) => backend[member] === undefined,\n );\n if (missing.length > 0) {\n return {\n supported: false,\n bundle: definition.id,\n missing,\n disposition: definition.disposition,\n } as unknown as BundleVerdictOf<D>;\n }\n return {\n supported: true,\n bundle: definition.id,\n members: definition.core,\n extras: extraVerdicts,\n missingExtras,\n } as unknown as BundleVerdictOf<D>;\n}\n\n/** The literal operation names a bundle's `operations` table declares. */\nexport type OperationNames<D extends CapabilityBundleDefinition> =\n D[\"operations\"][number][\"operation\"];\n\n/** The extras a named operation `requires`, read from the ROW — never re-spelled at the call site. */\nexport type RequiredExtrasOf<\n D extends CapabilityBundleDefinition,\n Op extends OperationNames<D>,\n> =\n Extract<D[\"operations\"][number], { operation: Op }> extends (\n { requires: infer R extends readonly string[] }\n ) ?\n R[number]\n : never;\n\n/**\n * The registry's row lookup plus the presence fold, extracted verbatim from\n * {@link requireExtras}'s body (ruling B8 spec item 3): the ONE owner of\n * \"what this operation requires\" that both `requireExtras`'s default throw\n * and a call site's own `refuse` callback consult.\n *\n * `operation` is the literal key of the bundle's `operations` tuple, so the\n * required extras are looked up TYPE-LEVEL from the registry — no second\n * spelling of `requires` at the call site.\n *\n * @throws {ConfigurationError} naming the unknown operation when `operation`\n * is not a row of `definition.operations`.\n */\nexport function missingRequiredExtras<\n const D extends CapabilityBundleDefinition,\n Op extends OperationNames<D>,\n>(\n definition: D,\n verdict: BundleVerdictOf<D>,\n operation: Op,\n): readonly string[] {\n const row = definition.operations.find(\n (candidate) => candidate.operation === operation,\n );\n if (row === undefined) {\n throw new ConfigurationError(\n `Unknown operation \"${operation}\" for capability bundle \"${definition.id}\".`,\n { bundle: definition.id, operation },\n );\n }\n const required = row.requires ?? [];\n const extras:\n | Readonly<Record<string, ExtraVerdict<OptionalGraphBackendMember>>>\n | undefined = \"extras\" in verdict ? verdict.extras : undefined;\n return required.filter(\n (id) => extras === undefined || extras[id]?.present !== true,\n );\n}\n\n/**\n * The refusal for an operation whose `requires` extras are absent — how a\n * GRADUATED bundle refuses where the tree refuses today: the row names the\n * operation and the extras, this asserts they are present, and\n * {@link bindExtra} (`bind.ts`) binds them off the port.\n *\n * `refuse`, when supplied, is called instead of the registry-coded throw\n * below — this is how a call site keeps its OWN existing error text (message,\n * `details` shape, order relative to other refusals) while the registry\n * stays the one owner of \"what this operation requires\" (ruling B8 spec item\n * 3). Omitting it keeps the default behavior byte-identical to before this\n * parameter existed.\n *\n * @throws {ConfigurationError} naming the row's own `code` when one or more\n * required extras is absent from the verdict and no `refuse` callback is\n * supplied; otherwise calls `refuse(missing)`, which never returns.\n */\nexport function requireExtras<\n const D extends CapabilityBundleDefinition,\n Op extends OperationNames<D>,\n>(\n definition: D,\n verdict: BundleVerdictOf<D>,\n operation: Op,\n refuse?: (missing: readonly string[]) => never,\n): asserts verdict is BundleVerdictOf<D> & {\n extras: {\n [K in RequiredExtrasOf<D, Op> & keyof ExtrasOf<D>]: Extract<\n ExtraVerdict<ExtraMember<D, K>>,\n { present: true }\n >;\n };\n} {\n const missing = missingRequiredExtras(definition, verdict, operation);\n if (missing.length === 0) return;\n\n if (refuse !== undefined) refuse(missing);\n\n // `missingRequiredExtras` already threw the unknown-operation error above\n // when the row would be undefined, so `requireDefined` here is a redundant\n // (never-failing) narrowing, not a second lookup that could disagree.\n const { disposition } = requireDefined(\n definition.operations.find(\n (candidate) => candidate.operation === operation,\n ),\n );\n if (disposition.kind === \"refuse\") {\n throw new ConfigurationError(\n `Operation \"${operation}\" on capability bundle \"${definition.id}\" requires ${missing.join(\", \")}.`,\n { code: disposition.code, bundle: definition.id, operation, missing },\n );\n }\n // No pilot row reaches this: every row with a non-empty `requires` in the\n // registry disposes `refuse` (a graduated bundle's fallback rows never\n // name `requires` — the fallback IS the degrade path). Kept as a named,\n // typed refusal rather than a silent pass so a future `fallback` +\n // `requires` row cannot pass `requireExtras` unnoticed.\n throw new ConfigurationError(\n `Operation \"${operation}\" on capability bundle \"${definition.id}\" requires ${missing.join(\", \")}, and the registry names no refusal code for this fallback-dispositioned row.`,\n { bundle: definition.id, operation, missing },\n );\n}\n\n// ---------------------------------------------------------------------------\n// The six named verdict accessors — GraphBackend-only, no exceptions (I15).\n// ---------------------------------------------------------------------------\n\nexport function claimsVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof CLAIMS> {\n return resolveBundle(backend, CLAIMS);\n}\n\nexport function uniqueSidecarBatchVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof UNIQUE_SIDECAR_BATCH> {\n return resolveBundle(backend, UNIQUE_SIDECAR_BATCH);\n}\n\nexport function batchPointReadVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof BATCH_POINT_READ> {\n return resolveBundle(backend, BATCH_POINT_READ);\n}\n\nexport function statementExecutionVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof STATEMENT_EXECUTION> {\n return resolveBundle(backend, STATEMENT_EXECUTION);\n}\n\nexport function contributionHealthVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof CONTRIBUTION_HEALTH> {\n return resolveBundle(backend, CONTRIBUTION_HEALTH);\n}\n\nexport function recordedRevisionOriginsVerdict(\n backend: GraphBackend,\n): BundleVerdictOf<typeof RECORDED_REVISION_ORIGINS> {\n return resolveBundle(backend, RECORDED_REVISION_ORIGINS);\n}\n\n// ---------------------------------------------------------------------------\n// The claims verdict THUNK — the reference implementation of §5.2.3's INTENT\n// (one owner, at-most-once resolution, no re-derivation) moved to WHEN it\n// resolves rather than IF (ruling B7 refinement 2).\n// ---------------------------------------------------------------------------\n\n/**\n * A memoized, at-most-once resolution of the `claims` bundle's verdict\n * against ONE backend.\n *\n * Eager resolution at store construction is forbidden: T14's\n * contradictory-declaration backends must still be able to construct a store\n * and create nodes — only a constrained edge write may legally reach the\n * bidirectional cross-check's throw, and it must do so lazily, at the first\n * write that needs the verdict.\n *\n * A cached verdict cannot go stale because `GraphBackend` is deep-frozen (B1):\n * nothing can flip `capabilities.constraintClaims` or add/remove a claim\n * member on a backend object after this thunk has already resolved it, so\n * \"resolve once and reuse forever\" is exactly as safe as \"resolve every\n * time\" — for one backend object, they observe the same immutable answer.\n */\nexport type ClaimsVerdictThunk = () => BundleVerdictOf<typeof CLAIMS>;\n\n/**\n * Interning: the same backend object always gets back the SAME thunk object.\n * This is what makes \"one shared thunk per backend\" structural rather than a\n * convention every population site has to honor — a second call to\n * {@link createClaimsVerdictThunk} for a backend already minted cannot produce\n * a second, independently-memoized verdict.\n */\nconst CLAIMS_VERDICT_THUNKS = new WeakMap<GraphBackend, ClaimsVerdictThunk>();\n\n/**\n * Mints — or returns the already-minted — {@link ClaimsVerdictThunk} for\n * `backend`.\n *\n * The thunk resolves {@link resolveBundle}`(backend, CLAIMS)` on its first\n * call and caches the outcome, INCLUDING a thrown `ConfigurationError`: a\n * refusal is cached and re-thrown on every subsequent call, never\n * re-resolved. Both layers — interning here, memoization inside the thunk —\n * are required: interning alone would still let two independently-memoized\n * thunks exist for one backend if a caller ignored the shared one; memoizing\n * alone would still let two different call sites mint two different thunks\n * that could disagree about whether they had already resolved.\n */\nexport function createClaimsVerdictThunk(\n backend: GraphBackend,\n): ClaimsVerdictThunk {\n const existing = CLAIMS_VERDICT_THUNKS.get(backend);\n if (existing !== undefined) return existing;\n\n type Memo =\n | Readonly<{ state: \"resolved\"; verdict: BundleVerdictOf<typeof CLAIMS> }>\n | Readonly<{ state: \"thrown\"; error: unknown }>;\n let memo: Memo | undefined;\n\n const thunk: ClaimsVerdictThunk = () => {\n if (memo === undefined) {\n try {\n memo = { state: \"resolved\", verdict: resolveBundle(backend, CLAIMS) };\n } catch (error) {\n memo = { state: \"thrown\", error };\n throw error;\n }\n }\n if (memo.state === \"thrown\") throw memo.error;\n return memo.verdict;\n };\n\n CLAIMS_VERDICT_THUNKS.set(backend, thunk);\n return thunk;\n}\n","/**\n * The `recursiveTraversal` capability: whether this engine can compute a\n * BOUNDED TRANSITIVE CLOSURE of a relation in one round trip — the traversal\n * primitive, not the SQL syntax.\n */\nimport { ConfigurationError } from \"../../errors\";\nimport { type BackendCapabilities } from \"../types\";\n\n/**\n * Whether this engine can compute a BOUNDED TRANSITIVE CLOSURE of a relation\n * in one round trip — the traversal primitive, not the SQL syntax. A SQL\n * engine satisfies it with `WITH RECURSIVE`; a graph-native engine satisfies\n * it with a native expansion operator. What the capability promises is the\n * SEMANTICS: given a seed set, a step relation, and a hop bound, the engine\n * returns the reachable set (optionally with depth and path) without the\n * client issuing one statement per hop.\n *\n * Absent means SUPPORTED. Every engine TypeGraph ships supports it, and every\n * custom backend already has the six emission sites run against it\n * unconditionally: making absence mean `false` would refuse traversals that\n * work today. This mirrors `returning`, not `constraintClaims` — absence is\n * only allowed to mean \"false\" where absence is SAFE, and here it is not. A\n * backend that genuinely lacks the primitive must say so.\n */\nexport type RecursiveTraversalCapability = Readonly<{\n supported: boolean;\n /**\n * Why the engine lacks it — surfaced in every refusal's details so the\n * state is named rather than implied. Required when `supported: false` and\n * forbidden when `true`, so the union cannot carry a dangling reason.\n */\n reason?: string;\n}>;\n\n/**\n * The brand. Declared but never exported, and never assigned at runtime — it\n * exists only so that an object literal outside this module is not assignable\n * to {@link RecursiveTraversalVerdict}. Compare `VectorSlot`'s construction\n * discipline: the type is public, the constructor is the seam.\n */\ndeclare const RECURSIVE_TRAVERSAL_VERDICT: unique symbol;\n\n/**\n * The decision, branded so it can only originate from this module's\n * constructors. Round 1 made the verdict a required *field*, which forces a\n * token, not a verdict: any caller could satisfy it by writing\n * `{ supported: true }` inline, and nothing tied the value to the resolver.\n * The brand closes that at the type level.\n */\nexport type RecursiveTraversalVerdict = Readonly<\n { [RECURSIVE_TRAVERSAL_VERDICT]: true } & (\n { supported: true } | { supported: false; reason: string }\n )\n>;\n\n/** THE one reader of `capabilities.recursiveTraversal`, and THE one constructor. */\nexport function resolveRecursiveTraversal(\n capabilities: BackendCapabilities,\n): RecursiveTraversalVerdict {\n const declared = capabilities.recursiveTraversal;\n if (declared === undefined) {\n return { supported: true } as RecursiveTraversalVerdict;\n }\n if (declared.supported) {\n return { supported: true } as RecursiveTraversalVerdict;\n }\n // A raw custom-backend object may never have passed the §4 assert\n // (`assertBundledCapabilityDeclarations`), so `reason` is not guaranteed to\n // be present even though the type says it is. Naming the state explicitly\n // beats a default that would hide a contradictory declaration.\n return {\n supported: false,\n reason:\n declared.reason ??\n \"backend declares recursiveTraversal: { supported: false }\",\n } as RecursiveTraversalVerdict;\n}\n\n/**\n * The ONE sanctioned way to obtain a verdict without a backend: the query\n * compiler's public entry point `compileQuery(ast, graphId, \"postgres\")`\n * takes no backend at all, so it has no capabilities to resolve from. The\n * reason string is required and is echoed in nothing — it exists so the call\n * site states why it is allowed to assume.\n */\nexport function assumeRecursiveTraversalSupported(\n reason: string,\n): RecursiveTraversalVerdict {\n // `reason` is intentionally unused in the returned verdict: it documents\n // the assumption at the call site rather than becoming part of the value.\n void reason;\n return { supported: true } as RecursiveTraversalVerdict;\n}\n\n/** THE one refusal builder. */\nexport function recursiveTraversalUnsupportedError(\n verdict: Extract<RecursiveTraversalVerdict, { supported: false }>,\n operation: string,\n): ConfigurationError {\n return new ConfigurationError(\n `${operation} requires recursive traversal, but this backend declares recursiveTraversal: { supported: false }.`,\n {\n code: \"RECURSIVE_TRAVERSAL_UNSUPPORTED\",\n capability: \"recursiveTraversal\",\n operation,\n reason: verdict.reason,\n },\n {\n suggestion:\n \"Use a backend that supports recursive traversal, or avoid this query shape.\",\n },\n );\n}\n\n/** THE one assertion: refuses when the verdict says the engine cannot. */\nexport function assertRecursiveTraversal(\n verdict: RecursiveTraversalVerdict,\n operation: string,\n): asserts verdict is Extract<RecursiveTraversalVerdict, { supported: true }> {\n if (verdict.supported) return;\n throw recursiveTraversalUnsupportedError(verdict, operation);\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCYKHSH5O_cjs = require('./chunk-CYKHSH5O.cjs');
|
|
4
4
|
var chunk5X46XWNH_cjs = require('./chunk-5X46XWNH.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkZXXGMQC3_cjs = require('./chunk-ZXXGMQC3.cjs');
|
|
6
|
+
var chunkJ34FSPSC_cjs = require('./chunk-J34FSPSC.cjs');
|
|
7
7
|
var chunkOJHFXL7Y_cjs = require('./chunk-OJHFXL7Y.cjs');
|
|
8
8
|
var chunkNI2XPJQ2_cjs = require('./chunk-NI2XPJQ2.cjs');
|
|
9
9
|
var chunkRNI64RB4_cjs = require('./chunk-RNI64RB4.cjs');
|
|
@@ -100,7 +100,7 @@ function spanningDifferentAssertion(assertions, first, second) {
|
|
|
100
100
|
// src/identity/sql-target.ts
|
|
101
101
|
var MAX_REFERENCE_CHUNK_SIZE = 200;
|
|
102
102
|
function identityChunkSize(target, input) {
|
|
103
|
-
const parameterLimit =
|
|
103
|
+
const parameterLimit = chunkCYKHSH5O_cjs.recordedBindParamBudget(target);
|
|
104
104
|
const chunkSize = Math.floor(
|
|
105
105
|
(parameterLimit - input.fixedParameters) / input.parametersPerItem
|
|
106
106
|
);
|
|
@@ -198,8 +198,8 @@ function publicNodeRef(ref) {
|
|
|
198
198
|
return ref;
|
|
199
199
|
}
|
|
200
200
|
async function lockIdentityGraph(target, graphId) {
|
|
201
|
-
const plan =
|
|
202
|
-
const fence =
|
|
201
|
+
const plan = chunkJ34FSPSC_cjs.resolveWriteFencePlan(target);
|
|
202
|
+
const fence = chunkJ34FSPSC_cjs.requireWriteFence(plan, "identity graph lock", "advisory-lock");
|
|
203
203
|
switch (fence.kind) {
|
|
204
204
|
case "lock": {
|
|
205
205
|
await target.execute(
|
|
@@ -218,8 +218,8 @@ async function lockIdentityGraph(target, graphId) {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
async function lockIdentityEnablementNodes(target, schema) {
|
|
221
|
-
const plan =
|
|
222
|
-
const fence =
|
|
221
|
+
const plan = chunkJ34FSPSC_cjs.resolveWriteFencePlan(target);
|
|
222
|
+
const fence = chunkJ34FSPSC_cjs.requireWriteFence(
|
|
223
223
|
plan,
|
|
224
224
|
"identity enablement drain",
|
|
225
225
|
"table-lock"
|
|
@@ -238,10 +238,10 @@ async function lockIdentityEnablementNodes(target, schema) {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
async function loadNodeSnapshot(target, schema, graphId, coordinate) {
|
|
241
|
-
const sqlCoordinate =
|
|
241
|
+
const sqlCoordinate = chunkCYKHSH5O_cjs.identitySqlCoordinate(coordinate, chunkNI2XPJQ2_cjs.nowIso());
|
|
242
242
|
const rows = await target.execute(
|
|
243
243
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(
|
|
244
|
-
|
|
244
|
+
chunkCYKHSH5O_cjs.identityNodeSnapshotSource(schema, graphId, sqlCoordinate)
|
|
245
245
|
)
|
|
246
246
|
);
|
|
247
247
|
return rows.map((row) => ({
|
|
@@ -322,7 +322,7 @@ async function loadCurrentStructuralClasses(target, schema, graphId, references)
|
|
|
322
322
|
}
|
|
323
323
|
async function loadCurrentVisibleMembers(target, schema, graphId, ref) {
|
|
324
324
|
const now = chunkNI2XPJQ2_cjs.nowIso();
|
|
325
|
-
const coordinate =
|
|
325
|
+
const coordinate = chunkCYKHSH5O_cjs.identitySqlCoordinate(void 0, now);
|
|
326
326
|
const rows = await target.execute(
|
|
327
327
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
328
328
|
WITH anchor AS (
|
|
@@ -348,7 +348,7 @@ async function loadCurrentVisibleMembers(target, schema, graphId, ref) {
|
|
|
348
348
|
WHERE n.graph_id = ${graphId}
|
|
349
349
|
AND n.kind = m.kind
|
|
350
350
|
AND n.id = m.id
|
|
351
|
-
AND ${
|
|
351
|
+
AND ${chunkCYKHSH5O_cjs.identityNodeVisibilitySql(coordinate, "n")}
|
|
352
352
|
`)
|
|
353
353
|
);
|
|
354
354
|
const members = rows.map((row) => ({ kind: row.kind, id: row.id })).toSorted((left, right) => compareReferences(left, right));
|
|
@@ -397,18 +397,18 @@ async function loadHistoricalClasses(target, schema, graphId, references, coordi
|
|
|
397
397
|
return combined;
|
|
398
398
|
}
|
|
399
399
|
const currentInstant = chunkNI2XPJQ2_cjs.nowIso();
|
|
400
|
-
const sqlCoordinate =
|
|
400
|
+
const sqlCoordinate = chunkCYKHSH5O_cjs.identitySqlCoordinate(coordinate, currentInstant);
|
|
401
401
|
const seeds = chunkAYQBEVQY_cjs.sql.join(
|
|
402
402
|
uniqueReferences.map((ref) => chunkAYQBEVQY_cjs.sql`(${ref.kind}, ${ref.id})`),
|
|
403
403
|
chunkAYQBEVQY_cjs.sql`, `
|
|
404
404
|
);
|
|
405
|
-
const reconstruction =
|
|
405
|
+
const reconstruction = chunkCYKHSH5O_cjs.historicalIdentityReconstructionCtes({
|
|
406
406
|
schema,
|
|
407
407
|
graphId,
|
|
408
408
|
coordinate: sqlCoordinate,
|
|
409
409
|
seedSource: chunkAYQBEVQY_cjs.sql`VALUES ${seeds}`,
|
|
410
410
|
sameIdAcrossKinds,
|
|
411
|
-
recursiveTraversal:
|
|
411
|
+
recursiveTraversal: chunkZXXGMQC3_cjs.resolveRecursiveTraversal(target.capabilities)
|
|
412
412
|
});
|
|
413
413
|
const rows = await target.execute(
|
|
414
414
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
@@ -416,7 +416,7 @@ async function loadHistoricalClasses(target, schema, graphId, references, coordi
|
|
|
416
416
|
${reconstruction}
|
|
417
417
|
SELECT member.seed_kind, member.seed_id,
|
|
418
418
|
member.kind AS member_kind, member.id AS member_id,
|
|
419
|
-
CASE WHEN ${
|
|
419
|
+
CASE WHEN ${chunkCYKHSH5O_cjs.identityNodeVisibilitySql(sqlCoordinate, "n")}
|
|
420
420
|
THEN 1 ELSE 0 END AS is_visible
|
|
421
421
|
FROM identity_members member
|
|
422
422
|
JOIN node_snapshot n ON n.kind = member.kind AND n.id = member.id
|
|
@@ -467,10 +467,10 @@ function visibleMembersAtCoordinate(ctx, ref) {
|
|
|
467
467
|
);
|
|
468
468
|
}
|
|
469
469
|
async function loadAssertions(target, schema, graphId, coordinate, currentInstant) {
|
|
470
|
-
const source =
|
|
470
|
+
const source = chunkCYKHSH5O_cjs.identityAssertionSnapshotSource(
|
|
471
471
|
schema,
|
|
472
472
|
graphId,
|
|
473
|
-
|
|
473
|
+
chunkCYKHSH5O_cjs.identitySqlCoordinate(coordinate, currentInstant),
|
|
474
474
|
void 0
|
|
475
475
|
);
|
|
476
476
|
const rows = await target.execute(
|
|
@@ -509,10 +509,10 @@ async function loadAssertionsTouching(target, schema, graphId, references, coord
|
|
|
509
509
|
}
|
|
510
510
|
return [...byId.values()];
|
|
511
511
|
}
|
|
512
|
-
const source =
|
|
512
|
+
const source = chunkCYKHSH5O_cjs.identityAssertionSnapshotSource(
|
|
513
513
|
schema,
|
|
514
514
|
graphId,
|
|
515
|
-
|
|
515
|
+
chunkCYKHSH5O_cjs.identitySqlCoordinate(coordinate, chunkNI2XPJQ2_cjs.nowIso()),
|
|
516
516
|
relation
|
|
517
517
|
);
|
|
518
518
|
const aMatches = referenceCondition(
|
|
@@ -527,7 +527,7 @@ async function loadAssertionsTouching(target, schema, graphId, references, coord
|
|
|
527
527
|
);
|
|
528
528
|
const rows = await target.execute(
|
|
529
529
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
530
|
-
SELECT ${
|
|
530
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
531
531
|
FROM (${source}) identity_assertions
|
|
532
532
|
WHERE ${aMatches} OR ${bMatches}
|
|
533
533
|
`)
|
|
@@ -1235,10 +1235,10 @@ function owedProbeChunkSize(target) {
|
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
1237
|
function liveDifferentSource(schema, graphId) {
|
|
1238
|
-
return
|
|
1238
|
+
return chunkCYKHSH5O_cjs.identityAssertionSnapshotSource(
|
|
1239
1239
|
schema,
|
|
1240
1240
|
graphId,
|
|
1241
|
-
|
|
1241
|
+
chunkCYKHSH5O_cjs.identitySqlCoordinate(void 0, chunkNI2XPJQ2_cjs.nowIso()),
|
|
1242
1242
|
"different"
|
|
1243
1243
|
);
|
|
1244
1244
|
}
|
|
@@ -1427,7 +1427,7 @@ async function validateCurrentRelation(ctx, target, relation, operation, a, b) {
|
|
|
1427
1427
|
async function currentAssertionForPair(target, schema, graphId, relation, a, b) {
|
|
1428
1428
|
const rows = await target.execute(
|
|
1429
1429
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
1430
|
-
SELECT ${
|
|
1430
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1431
1431
|
FROM ${schema.identityAssertionsTable}
|
|
1432
1432
|
WHERE graph_id = ${graphId}
|
|
1433
1433
|
AND rel = ${relation}
|
|
@@ -1446,7 +1446,7 @@ async function assertionForExactWindow(target, schema, graphId, relation, a, b,
|
|
|
1446
1446
|
const validToMatch = window.validTo === void 0 ? chunkAYQBEVQY_cjs.sql`valid_to IS NULL` : chunkAYQBEVQY_cjs.sql`valid_to = ${window.validTo}`;
|
|
1447
1447
|
const rows = await target.execute(
|
|
1448
1448
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
1449
|
-
SELECT ${
|
|
1449
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1450
1450
|
FROM ${schema.identityAssertionsTable}
|
|
1451
1451
|
WHERE graph_id = ${graphId}
|
|
1452
1452
|
AND rel = ${relation}
|
|
@@ -1478,7 +1478,7 @@ async function insertAssertion(target, schema, graphId, relation, a, b, operatio
|
|
|
1478
1478
|
function buildAssertionRow(graphId, relation, a, b, timestamp, options) {
|
|
1479
1479
|
return {
|
|
1480
1480
|
graph_id: graphId,
|
|
1481
|
-
id: options?.id ??
|
|
1481
|
+
id: options?.id ?? chunkCYKHSH5O_cjs.generateId(),
|
|
1482
1482
|
rel: relation,
|
|
1483
1483
|
a_kind: a.kind,
|
|
1484
1484
|
a_id: a.id,
|
|
@@ -1533,7 +1533,7 @@ function windowOverlapSql(alias, lowerBoundary, upperBoundary) {
|
|
|
1533
1533
|
`;
|
|
1534
1534
|
}
|
|
1535
1535
|
async function loadIdentityWindowLedger(input) {
|
|
1536
|
-
|
|
1536
|
+
chunkZXXGMQC3_cjs.assertRecursiveTraversal(
|
|
1537
1537
|
input.recursiveTraversal,
|
|
1538
1538
|
"identity window ledger read"
|
|
1539
1539
|
);
|
|
@@ -1647,7 +1647,7 @@ async function loadIdentityWindowLedger(input) {
|
|
|
1647
1647
|
WHERE assertion.graph_id = ${graphId}
|
|
1648
1648
|
AND ${windowOverlapSql("assertion", lowerBoundary, upperBoundary)}
|
|
1649
1649
|
)
|
|
1650
|
-
SELECT 'assertion' AS row_type, ${
|
|
1650
|
+
SELECT 'assertion' AS row_type, ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS},
|
|
1651
1651
|
NULL AS node_kind, NULL AS node_id,
|
|
1652
1652
|
NULL AS node_created_at, NULL AS node_deleted_at
|
|
1653
1653
|
FROM selected_assertions
|
|
@@ -1793,7 +1793,7 @@ async function createIdentityWindowValidator(ctx, target, requests, operationIns
|
|
|
1793
1793
|
requests,
|
|
1794
1794
|
operationInstant,
|
|
1795
1795
|
sameIdAcrossKinds: ctx.sameIdAcrossKinds,
|
|
1796
|
-
recursiveTraversal:
|
|
1796
|
+
recursiveTraversal: chunkZXXGMQC3_cjs.resolveRecursiveTraversal(target.capabilities)
|
|
1797
1797
|
});
|
|
1798
1798
|
if (ignoredAssertionIds.size > 0) {
|
|
1799
1799
|
const retained = ledger.assertions.filter(
|
|
@@ -1856,7 +1856,7 @@ async function insertAssertionRows(target, schema, rows) {
|
|
|
1856
1856
|
await executeIdentityStatement(
|
|
1857
1857
|
target,
|
|
1858
1858
|
chunkAYQBEVQY_cjs.sql`
|
|
1859
|
-
INSERT INTO ${schema.identityAssertionsTable} (${
|
|
1859
|
+
INSERT INTO ${schema.identityAssertionsTable} (${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}) VALUES ${chunkAYQBEVQY_cjs.sql.join(values, chunkAYQBEVQY_cjs.sql`, `)}
|
|
1860
1860
|
`
|
|
1861
1861
|
);
|
|
1862
1862
|
}
|
|
@@ -1877,7 +1877,7 @@ async function loadAssertionsByIds(target, schema, graphId, ids) {
|
|
|
1877
1877
|
);
|
|
1878
1878
|
const rows = await target.execute(
|
|
1879
1879
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
1880
|
-
SELECT ${
|
|
1880
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1881
1881
|
FROM ${schema.identityAssertionsTable}
|
|
1882
1882
|
WHERE graph_id = ${graphId} AND id IN (${idList})
|
|
1883
1883
|
`)
|
|
@@ -2511,7 +2511,7 @@ async function bulkAssertWindowedPairs(ctx, target, relation, pairs, touch, oper
|
|
|
2511
2511
|
async function findCurrentAssertionById(target, schema, graphId, id) {
|
|
2512
2512
|
const rows = await target.execute(
|
|
2513
2513
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
2514
|
-
SELECT ${
|
|
2514
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
2515
2515
|
FROM ${schema.identityAssertionsTable}
|
|
2516
2516
|
WHERE graph_id = ${graphId}
|
|
2517
2517
|
AND id = ${id}
|
|
@@ -2562,7 +2562,7 @@ async function retractCurrentAssertions(ctx, target, ids, touch, resolveValidTo)
|
|
|
2562
2562
|
);
|
|
2563
2563
|
const rows = await target.execute(
|
|
2564
2564
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
2565
|
-
SELECT ${
|
|
2565
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
2566
2566
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
2567
2567
|
WHERE graph_id = ${ctx.graphId}
|
|
2568
2568
|
AND id IN (${placeholders})
|
|
@@ -2663,7 +2663,7 @@ async function retractPlannedAssertions(ctx, target, retractions, touch) {
|
|
|
2663
2663
|
}
|
|
2664
2664
|
async function runIdentityMutation(ctx, fn) {
|
|
2665
2665
|
let touched = false;
|
|
2666
|
-
return
|
|
2666
|
+
return chunkCYKHSH5O_cjs.runInWriteTransaction(
|
|
2667
2667
|
{
|
|
2668
2668
|
graphId: ctx.graphId,
|
|
2669
2669
|
schemaVersion: ctx.schemaVersion,
|
|
@@ -2674,7 +2674,7 @@ async function runIdentityMutation(ctx, fn) {
|
|
|
2674
2674
|
ctx.backend,
|
|
2675
2675
|
async (target) => {
|
|
2676
2676
|
await lockIdentityGraph(target, ctx.graphId);
|
|
2677
|
-
return
|
|
2677
|
+
return chunkCYKHSH5O_cjs.withRecordedIdentityMutationTarget(
|
|
2678
2678
|
target,
|
|
2679
2679
|
(rawTarget, touch) => fn(
|
|
2680
2680
|
rawTarget,
|
|
@@ -3115,7 +3115,7 @@ function rethrowTaggedWithAssertion(error, assertionId, progress) {
|
|
|
3115
3115
|
async function importIdentityAssertionsIntoTarget(ctx, target, assertions, mode, ignoredAssertionIds = /* @__PURE__ */ new Set()) {
|
|
3116
3116
|
let created = 0;
|
|
3117
3117
|
let skipped = 0;
|
|
3118
|
-
await
|
|
3118
|
+
await chunkCYKHSH5O_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget, touch) => {
|
|
3119
3119
|
const operationInstant = chunkNI2XPJQ2_cjs.nowIso();
|
|
3120
3120
|
const normalized = assertions.map((assertion) => ({
|
|
3121
3121
|
assertion,
|
|
@@ -3365,7 +3365,7 @@ async function rebuildIdentityClosureForContext(ctx) {
|
|
|
3365
3365
|
requireAtomicIdentityBackend(ctx.backend, ctx.graphId);
|
|
3366
3366
|
async function rebuildAtTarget(target) {
|
|
3367
3367
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3368
|
-
await
|
|
3368
|
+
await chunkCYKHSH5O_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3369
3369
|
const activeKinds = identityActiveKinds(ctx.registry);
|
|
3370
3370
|
const snapshot = await loadSnapshot(
|
|
3371
3371
|
rawTarget,
|
|
@@ -3557,7 +3557,7 @@ async function assertAffectedIdentityClassesConsistent(ctx, target, seeds) {
|
|
|
3557
3557
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3558
3558
|
const observed = await findAffectedClassInconsistency(ctx, target, seeds);
|
|
3559
3559
|
if (observed === void 0) return;
|
|
3560
|
-
await
|
|
3560
|
+
await chunkCYKHSH5O_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3561
3561
|
await replaceClosure(
|
|
3562
3562
|
rawTarget,
|
|
3563
3563
|
ctx.schema,
|
|
@@ -3587,7 +3587,7 @@ async function deleteAssertionsTouchingKinds(target, schema, graphId, kinds, tou
|
|
|
3587
3587
|
);
|
|
3588
3588
|
const rows = await target.execute(
|
|
3589
3589
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
3590
|
-
SELECT ${
|
|
3590
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3591
3591
|
FROM ${schema.identityAssertionsTable}
|
|
3592
3592
|
WHERE graph_id = ${graphId}
|
|
3593
3593
|
AND (a_kind IN (${kindList2}) OR b_kind IN (${kindList2}))
|
|
@@ -3724,7 +3724,7 @@ async function liveNodeKindsSharingIds(ctx, target, ids) {
|
|
|
3724
3724
|
async function foldIdentityForCreatedNodes(ctx, target, references) {
|
|
3725
3725
|
if (references.length === 0 || ctx.sameIdAcrossKinds === "ignore") return;
|
|
3726
3726
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3727
|
-
await
|
|
3727
|
+
await chunkCYKHSH5O_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3728
3728
|
const liveKindsById = await liveNodeKindsSharingIds(
|
|
3729
3729
|
ctx,
|
|
3730
3730
|
rawTarget,
|
|
@@ -3792,7 +3792,7 @@ async function readNodeDeletionInstant(target, schema, graphId, ref) {
|
|
|
3792
3792
|
async function requireNodeValidityEndCompatible(ctx, target, ref, validTo) {
|
|
3793
3793
|
const rows = await target.execute(
|
|
3794
3794
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
3795
|
-
SELECT ${
|
|
3795
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3796
3796
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
3797
3797
|
WHERE graph_id = ${ctx.graphId}
|
|
3798
3798
|
AND deleted_at IS NULL
|
|
@@ -3819,7 +3819,7 @@ async function requireNodeValidityEndCompatible(ctx, target, ref, validTo) {
|
|
|
3819
3819
|
}
|
|
3820
3820
|
async function detachIdentityForNode(ctx, target, ref, mode) {
|
|
3821
3821
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3822
|
-
await
|
|
3822
|
+
await chunkCYKHSH5O_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget, touch) => {
|
|
3823
3823
|
const touchesNode = chunkAYQBEVQY_cjs.sql`
|
|
3824
3824
|
(
|
|
3825
3825
|
(a_kind = ${ref.kind} AND a_id = ${ref.id})
|
|
@@ -3829,7 +3829,7 @@ async function detachIdentityForNode(ctx, target, ref, mode) {
|
|
|
3829
3829
|
const scope = mode === "hard" ? chunkAYQBEVQY_cjs.sql`` : chunkAYQBEVQY_cjs.sql`AND valid_to IS NULL AND deleted_at IS NULL`;
|
|
3830
3830
|
const rows = await rawTarget.execute(
|
|
3831
3831
|
chunkAYQBEVQY_cjs.asCompiledRowsSql(chunkAYQBEVQY_cjs.sql`
|
|
3832
|
-
SELECT ${
|
|
3832
|
+
SELECT ${chunkCYKHSH5O_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3833
3833
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
3834
3834
|
WHERE graph_id = ${ctx.graphId}
|
|
3835
3835
|
${scope}
|
|
@@ -3941,5 +3941,5 @@ exports.requireNodeValidityEndCompatible = requireNodeValidityEndCompatible;
|
|
|
3941
3941
|
exports.separationRebuildRequired = separationRebuildRequired;
|
|
3942
3942
|
exports.toTransferAssertion = toTransferAssertion;
|
|
3943
3943
|
exports.validateIdentityForContext = validateIdentityForContext;
|
|
3944
|
-
//# sourceMappingURL=chunk-
|
|
3945
|
-
//# sourceMappingURL=chunk-
|
|
3944
|
+
//# sourceMappingURL=chunk-XXEFDJHY.cjs.map
|
|
3945
|
+
//# sourceMappingURL=chunk-XXEFDJHY.cjs.map
|