@nicia-ai/typegraph 0.59.0 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +3 -0
  3. package/dist/backend/postgres/pglite-store.cjs +1 -1
  4. package/dist/backend/postgres/pglite-store.d.cts +2 -2
  5. package/dist/backend/postgres/pglite-store.d.ts +2 -2
  6. package/dist/backend/postgres/pglite-store.js +1 -1
  7. package/dist/backend/sqlite/local-store.cjs +1 -1
  8. package/dist/backend/sqlite/local-store.d.cts +2 -2
  9. package/dist/backend/sqlite/local-store.d.ts +2 -2
  10. package/dist/backend/sqlite/local-store.js +1 -1
  11. package/dist/{chunk-MKQY4ZLZ.js → chunk-2DKIJP2R.js} +73 -41
  12. package/dist/chunk-2DKIJP2R.js.map +1 -0
  13. package/dist/{chunk-6BVZHDAZ.js → chunk-43DOTETB.js} +3 -3
  14. package/dist/{chunk-6BVZHDAZ.js.map → chunk-43DOTETB.js.map} +1 -1
  15. package/dist/{chunk-IV5W7LKW.cjs → chunk-A22XPVBQ.cjs} +2 -2
  16. package/dist/chunk-A22XPVBQ.cjs.map +1 -0
  17. package/dist/{chunk-W4NT4IMI.js → chunk-B4P4DAW3.js} +3 -3
  18. package/dist/{chunk-W4NT4IMI.js.map → chunk-B4P4DAW3.js.map} +1 -1
  19. package/dist/{chunk-CA76FVJB.cjs → chunk-CNFKFE5L.cjs} +399 -367
  20. package/dist/chunk-CNFKFE5L.cjs.map +1 -0
  21. package/dist/{chunk-EN67I47R.cjs → chunk-EHDLHPMK.cjs} +9 -9
  22. package/dist/{chunk-EN67I47R.cjs.map → chunk-EHDLHPMK.cjs.map} +1 -1
  23. package/dist/{chunk-V3JKR2CN.js → chunk-FTDRMXIJ.js} +5 -5
  24. package/dist/{chunk-V3JKR2CN.js.map → chunk-FTDRMXIJ.js.map} +1 -1
  25. package/dist/{chunk-3GX5HTPP.js → chunk-ILVXUOQY.js} +3 -3
  26. package/dist/{chunk-3GX5HTPP.js.map → chunk-ILVXUOQY.js.map} +1 -1
  27. package/dist/{chunk-XGYUUUHY.cjs → chunk-KGQVK2II.cjs} +40 -40
  28. package/dist/{chunk-XGYUUUHY.cjs.map → chunk-KGQVK2II.cjs.map} +1 -1
  29. package/dist/{chunk-BPYZUJX5.cjs → chunk-MTJAT6UO.cjs} +5 -5
  30. package/dist/{chunk-BPYZUJX5.cjs.map → chunk-MTJAT6UO.cjs.map} +1 -1
  31. package/dist/{chunk-2GZL5ED3.cjs → chunk-OKA6H3B3.cjs} +19 -19
  32. package/dist/{chunk-2GZL5ED3.cjs.map → chunk-OKA6H3B3.cjs.map} +1 -1
  33. package/dist/{chunk-26CL47SW.cjs → chunk-PTFO3JI5.cjs} +110 -110
  34. package/dist/{chunk-26CL47SW.cjs.map → chunk-PTFO3JI5.cjs.map} +1 -1
  35. package/dist/{chunk-UOHFBYYH.cjs → chunk-Q6ZVQWH7.cjs} +36 -36
  36. package/dist/{chunk-UOHFBYYH.cjs.map → chunk-Q6ZVQWH7.cjs.map} +1 -1
  37. package/dist/{chunk-HWWPL2YL.js → chunk-QWIR5533.js} +2 -2
  38. package/dist/chunk-QWIR5533.js.map +1 -0
  39. package/dist/{chunk-DZ3ETMXF.js → chunk-UVQMUBZ6.js} +6 -6
  40. package/dist/{chunk-DZ3ETMXF.js.map → chunk-UVQMUBZ6.js.map} +1 -1
  41. package/dist/{chunk-E6PU35DE.js → chunk-W6K6NSRT.js} +4 -4
  42. package/dist/{chunk-E6PU35DE.js.map → chunk-W6K6NSRT.js.map} +1 -1
  43. package/dist/graph-merge/index.cjs +119 -119
  44. package/dist/graph-merge/index.d.cts +2 -2
  45. package/dist/graph-merge/index.d.ts +2 -2
  46. package/dist/graph-merge/index.js +7 -7
  47. package/dist/{graph-templates-DQnmCPkd.d.ts → graph-templates-ClBhrXiA.d.ts} +1 -1
  48. package/dist/{graph-templates-Buh-RlmQ.d.cts → graph-templates-DfmKDARd.d.cts} +1 -1
  49. package/dist/index.cjs +68 -68
  50. package/dist/index.d.cts +3 -3
  51. package/dist/index.d.ts +3 -3
  52. package/dist/index.js +8 -8
  53. package/dist/interchange/index.cjs +28 -28
  54. package/dist/interchange/index.d.cts +2 -2
  55. package/dist/interchange/index.d.ts +2 -2
  56. package/dist/interchange/index.js +5 -5
  57. package/dist/{local-store-impl-GFBZBCTN.cjs → local-store-impl-QGSRYFZF.cjs} +9 -9
  58. package/dist/{local-store-impl-GFBZBCTN.cjs.map → local-store-impl-QGSRYFZF.cjs.map} +1 -1
  59. package/dist/{local-store-impl-EPUMDNQJ.js → local-store-impl-VEVK2VGA.js} +8 -8
  60. package/dist/{local-store-impl-EPUMDNQJ.js.map → local-store-impl-VEVK2VGA.js.map} +1 -1
  61. package/dist/{pglite-store-impl-DB4RRLB7.cjs → pglite-store-impl-33CI3P3M.cjs} +9 -9
  62. package/dist/{pglite-store-impl-DB4RRLB7.cjs.map → pglite-store-impl-33CI3P3M.cjs.map} +1 -1
  63. package/dist/{pglite-store-impl-M5PWKN7Z.js → pglite-store-impl-RDPTOOP3.js} +8 -8
  64. package/dist/{pglite-store-impl-M5PWKN7Z.js.map → pglite-store-impl-RDPTOOP3.js.map} +1 -1
  65. package/dist/profiler/index.d.cts +2 -2
  66. package/dist/profiler/index.d.ts +2 -2
  67. package/dist/provenance/index.cjs +15 -15
  68. package/dist/provenance/index.d.cts +2 -2
  69. package/dist/provenance/index.d.ts +2 -2
  70. package/dist/provenance/index.js +2 -2
  71. package/dist/schema/index.cjs +34 -34
  72. package/dist/schema/index.d.cts +3 -3
  73. package/dist/schema/index.d.ts +3 -3
  74. package/dist/schema/index.js +4 -4
  75. package/dist/{store-sLu0hcRm.d.ts → store-B5WZ8E5m.d.ts} +225 -215
  76. package/dist/{store-CvtRQ8Nb.d.cts → store-DdhFpX53.d.cts} +225 -215
  77. package/package.json +1 -1
  78. package/dist/chunk-CA76FVJB.cjs.map +0 -1
  79. package/dist/chunk-HWWPL2YL.js.map +0 -1
  80. package/dist/chunk-IV5W7LKW.cjs.map +0 -1
  81. package/dist/chunk-MKQY4ZLZ.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @nicia-ai/typegraph
2
2
 
3
+ ## 0.60.0
4
+
5
+ ### Highlights
6
+
7
+ TypeGraph 0.60 brings the set-oriented read APIs introduced in 0.59 into transaction callbacks. `TransactionContext` now provides `query()`, `neighbors()`, `countNeighbors()`, `subgraph()`, and `batchOnce()`, all bound to the open transaction so read-modify-write workflows can observe earlier writes without leaving their atomic boundary.
8
+
9
+ The transaction forms preserve the physical guarantees that matter on a held connection: `tx.neighbors()` and `tx.countNeighbors()` each execute as one statement, while `tx.subgraph()` and `tx.batchOnce()` use exact-one-statement plans. Transaction-bound `batchOnce()` composes fluent reads from `tx.query()` with neighbor, count, and subgraph reads from its callback builder, returning independently typed results in tuple order.
10
+
11
+ The surface is consistent across managed, adapter, receipt-enabled, recorded-time, measurable, and adopted transaction contexts. `withCheckedReads()` remains a root-store API: transaction reads already execute against the transaction's bound session, and callers choose the required snapshot behavior through the transaction isolation options.
12
+
13
+ ### Upgrade notes
14
+
15
+ - Update hand-built `TransactionContext`, adapter transaction-context, or measurable transaction-context mocks and wrappers with `query`, `neighbors`, `countNeighbors`, `subgraph`, and `batchOnce`. Contexts created by TypeGraph provide these methods automatically.
16
+ - Replace runtime feature checks and edge-read-plus-node-load fallbacks inside transaction callbacks with the typed transaction APIs. Type callback parameters as `TransactionContext<G>` or the appropriate adapter/measurable variant rather than as `Store<G>`; `withCheckedReads()` is intentionally unavailable on transaction contexts.
17
+ - On PostgreSQL, request `isolationLevel: "repeatable_read"` or `"serializable"` when several separate transaction reads must observe one stable database snapshot. `tx.subgraph()` and `tx.batchOnce()` remain one statement regardless of isolation level.
18
+
19
+ ### Minor Changes
20
+
21
+ - [#689](https://github.com/nicia-ai/typegraph/pull/689) [`956fd56`](https://github.com/nicia-ai/typegraph/commit/956fd560d270dc58fab687f810b2c63abd42694a) Thanks [@pdlug](https://github.com/pdlug)! - Add transaction-bound `query()`, `neighbors()`, `countNeighbors()`, `subgraph()`, and `batchOnce()` reads. Every read executes through the open transaction and observes earlier writes in the callback; `tx.subgraph()` and `tx.batchOnce()` each execute as exactly one statement.
22
+
3
23
  ## 0.59.0
4
24
 
5
25
  ### Highlights
package/README.md CHANGED
@@ -42,6 +42,9 @@ batch-scoped builder with `neighbors()`, `countNeighbors()`, and `subgraph()`
42
42
  methods. Direct `store.subgraph()` and batch-scoped `read.subgraph()` return the
43
43
  same result shape and semantics; the direct form retains backend-tuned hydration
44
44
  while the batch-scoped form guarantees one statement.
45
+ Transaction contexts expose the same `query()`, `neighbors()`,
46
+ `countNeighbors()`, `subgraph()`, and `batchOnce()` reads, all bound to the open
47
+ transaction so read-modify-write paths see their uncommitted changes.
45
48
  `store.neighbors()` can order by edge metadata or adjacent-node properties,
46
49
  while `subgraph({ edgeWindows })` applies per-kind direction, ordering, and
47
50
  limits during traversal. See
@@ -7,7 +7,7 @@ require('../../chunk-G7W67PZO.cjs');
7
7
  async function createLocalPgliteStore(graph, options = {}) {
8
8
  const impl = await chunkBMGHFZAV_cjs.loadDrizzleBackedModule(
9
9
  "./postgres/pglite",
10
- () => import('../../pglite-store-impl-DB4RRLB7.cjs')
10
+ () => import('../../pglite-store-impl-33CI3P3M.cjs')
11
11
  );
12
12
  return impl.createLocalPgliteStoreImpl(graph, options);
13
13
  }
@@ -1,7 +1,7 @@
1
1
  import { d as FulltextStrategy, e as GraphDef } from '../../types-Dky3sCFz.cjs';
2
2
  export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Dky3sCFz.cjs';
3
- import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-CvtRQ8Nb.cjs';
4
- export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-CvtRQ8Nb.cjs';
3
+ import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-DdhFpX53.cjs';
4
+ export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-DdhFpX53.cjs';
5
5
  import 'zod';
6
6
  import '../../searchable-BEAN91Ce.cjs';
7
7
  import '../../resolve-mLksuBg2.cjs';
@@ -1,7 +1,7 @@
1
1
  import { d as FulltextStrategy, e as GraphDef } from '../../types-Dky3sCFz.js';
2
2
  export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Dky3sCFz.js';
3
- import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-sLu0hcRm.js';
4
- export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-sLu0hcRm.js';
3
+ import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-B5WZ8E5m.js';
4
+ export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-B5WZ8E5m.js';
5
5
  import 'zod';
6
6
  import '../../searchable-Bg2lMPRm.js';
7
7
  import '../../resolve-BbjZDYTw.js';
@@ -5,7 +5,7 @@ import '../../chunk-Q5QOGVDF.js';
5
5
  async function createLocalPgliteStore(graph, options = {}) {
6
6
  const impl = await loadDrizzleBackedModule(
7
7
  "./postgres/pglite",
8
- () => import('../../pglite-store-impl-M5PWKN7Z.js')
8
+ () => import('../../pglite-store-impl-RDPTOOP3.js')
9
9
  );
10
10
  return impl.createLocalPgliteStoreImpl(graph, options);
11
11
  }
@@ -8,7 +8,7 @@ require('../../chunk-G7W67PZO.cjs');
8
8
  async function createLocalSqliteStore(graph, options = {}) {
9
9
  const impl = await chunkBMGHFZAV_cjs.loadDrizzleBackedModule(
10
10
  "./sqlite/local",
11
- () => import('../../local-store-impl-GFBZBCTN.cjs')
11
+ () => import('../../local-store-impl-QGSRYFZF.cjs')
12
12
  );
13
13
  return impl.createLocalSqliteStoreImpl(graph, options);
14
14
  }
@@ -1,7 +1,7 @@
1
1
  import { B as BundledBackendCapabilityOverrides, d as FulltextStrategy, e as GraphDef } from '../../types-Dky3sCFz.cjs';
2
2
  export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Dky3sCFz.cjs';
3
- import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-CvtRQ8Nb.cjs';
4
- export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-CvtRQ8Nb.cjs';
3
+ import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-DdhFpX53.cjs';
4
+ export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-DdhFpX53.cjs';
5
5
  import { L as LocalSqlitePragmaOptions } from '../../local-options-CZ1BnIoF.cjs';
6
6
  export { D as DEFAULT_LOCAL_SQLITE_PRAGMAS, a as LocalSqliteJournalMode, b as LocalSqliteSynchronousMode } from '../../local-options-CZ1BnIoF.cjs';
7
7
  import 'zod';
@@ -1,7 +1,7 @@
1
1
  import { B as BundledBackendCapabilityOverrides, d as FulltextStrategy, e as GraphDef } from '../../types-Dky3sCFz.js';
2
2
  export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Dky3sCFz.js';
3
- import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-sLu0hcRm.js';
4
- export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-sLu0hcRm.js';
3
+ import { S as StoreOptions, a as SchemaManagerOptions, U as UnboundLiveStoreOptions, b as Store, H as HistoryStoreOptions, c as HistoryStore, R as RecordedReadStoreOptions, d as RecordedReadStore, L as LiveStoreOptions } from '../../store-B5WZ8E5m.js';
4
+ export { I as IdentityAssertion, e as IdentityAssertionId, f as IdentityAssertionResult, g as IdentityFacade, h as IdentityNode, i as IdentityNodeRefInput, j as IdentityPair, k as IdentityReadFacade, l as IdentityRelation, m as IdentityWriteSummary } from '../../store-B5WZ8E5m.js';
5
5
  import { L as LocalSqlitePragmaOptions } from '../../local-options-CZ1BnIoF.js';
6
6
  export { D as DEFAULT_LOCAL_SQLITE_PRAGMAS, a as LocalSqliteJournalMode, b as LocalSqliteSynchronousMode } from '../../local-options-CZ1BnIoF.js';
7
7
  import 'zod';
@@ -6,7 +6,7 @@ import '../../chunk-Q5QOGVDF.js';
6
6
  async function createLocalSqliteStore(graph, options = {}) {
7
7
  const impl = await loadDrizzleBackedModule(
8
8
  "./sqlite/local",
9
- () => import('../../local-store-impl-EPUMDNQJ.js')
9
+ () => import('../../local-store-impl-VEVK2VGA.js')
10
10
  );
11
11
  return impl.createLocalSqliteStoreImpl(graph, options);
12
12
  }
@@ -1,16 +1,16 @@
1
1
  import { createEdgeRowMapper, createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, POSTGRES_ROW_MAPPER_CONFIG, normalizeRowTimestamp, normalizeRequiredRowTimestamp, buildHardDeleteEdgeClaimsByNodeKind, buildHardDeleteUniquesByConcreteKind, buildHardDeleteEdgeClaimsByEdgeKind } from './chunk-EFTVYPGQ.js';
2
2
  import { assertRecordedInstantOwnershipMatch, resolveRecordedTimeOwnership, requireRecordedTime, isEngineNativeRecordedReadBinding } from './chunk-7GZJ36LN.js';
3
- import { rowToNode, executeNodeBulkFindByIndex, executeNodeBulkFindByConstraint, executeNodeFindByConstraint, executeNodeBulkGetOrCreateByConstraint, executeNodeGetOrCreateByConstraint, executeNodeHardDelete, executeNodeDeleteBatch, executeNodeDelete, nodeUpsertDirtyCheck, executeNodeReplacementBatch, prepareNodeReplacement, executeNodeResolvedMutationSet, executeNodeUpsertUpdateBatch, executeNodeSetUpdate, executeNodeUpdate, executeNodeCreateNoReturnBatch, executeNodeCreateBatch, executeNodeCreate, rowToEdge, normalizePersistedEdgeMatchProps, assertValidityEndMutation, assertClearValidToSupported, buildEdgeMatchKey, resolveAtomicEdgeConvergenceExecutor, resolveEdgeMatchIdentityStorage, runHookedWritePlan, edgeWritePlan, resolveAtomicEdgeDeleteBatchExecutor, runWritePlan, runAtomicProgramWithHooks, unsupportedResolvedMutationSet, resolveAtomicEdgeResolvedMutationSetExecutor, withAlreadyExistsTranslation, ResolvedMutationSetMoved, appliedResolvedMutationSet, edgeWriteNeedsConstraintFence, writeResultAlwaysChanges, resolveAtomicEdgeBatchExecutor, nestedManagedWriteTarget, runResolvedMutationSetConverging, canonicalPersistedJsonValue, assertAtomicDeleteSchemaFenceMatched, edgeMatchIdentityUpdateRefusal, resolveAtomicEdgeResolvedUpdateBatchExecutor, atomicResolvedUpdateAttemptBudget, createEdgeBatchValidationBackend, canFuseSchemaFenceInFirstWrite, isAutocommitSingleStatementWrite, runAutocommitSingleStatementWritePlan, classifyDurableEdgeBatchOutcomes, rowToEdgeMeta, rowToNodeMeta, checkCardinalityConstraint, validityEndAfterMutation, assertsStoredWindowState, unfencedTarget, AutocommitWriteRequiresTransaction } from './chunk-V3JKR2CN.js';
4
- import { applyResolvedNodeClaims, assertFulltextMember, getEmbeddingFields, computeFulltextContent } from './chunk-6BVZHDAZ.js';
3
+ import { rowToNode, executeNodeBulkFindByIndex, executeNodeBulkFindByConstraint, executeNodeFindByConstraint, executeNodeBulkGetOrCreateByConstraint, executeNodeGetOrCreateByConstraint, executeNodeHardDelete, executeNodeDeleteBatch, executeNodeDelete, nodeUpsertDirtyCheck, executeNodeReplacementBatch, prepareNodeReplacement, executeNodeResolvedMutationSet, executeNodeUpsertUpdateBatch, executeNodeSetUpdate, executeNodeUpdate, executeNodeCreateNoReturnBatch, executeNodeCreateBatch, executeNodeCreate, rowToEdge, normalizePersistedEdgeMatchProps, assertValidityEndMutation, assertClearValidToSupported, buildEdgeMatchKey, resolveAtomicEdgeConvergenceExecutor, resolveEdgeMatchIdentityStorage, runHookedWritePlan, edgeWritePlan, resolveAtomicEdgeDeleteBatchExecutor, runWritePlan, runAtomicProgramWithHooks, unsupportedResolvedMutationSet, resolveAtomicEdgeResolvedMutationSetExecutor, withAlreadyExistsTranslation, ResolvedMutationSetMoved, appliedResolvedMutationSet, edgeWriteNeedsConstraintFence, writeResultAlwaysChanges, resolveAtomicEdgeBatchExecutor, nestedManagedWriteTarget, runResolvedMutationSetConverging, canonicalPersistedJsonValue, assertAtomicDeleteSchemaFenceMatched, edgeMatchIdentityUpdateRefusal, resolveAtomicEdgeResolvedUpdateBatchExecutor, atomicResolvedUpdateAttemptBudget, createEdgeBatchValidationBackend, canFuseSchemaFenceInFirstWrite, isAutocommitSingleStatementWrite, runAutocommitSingleStatementWritePlan, classifyDurableEdgeBatchOutcomes, rowToEdgeMeta, rowToNodeMeta, checkCardinalityConstraint, validityEndAfterMutation, assertsStoredWindowState, unfencedTarget, AutocommitWriteRequiresTransaction } from './chunk-FTDRMXIJ.js';
4
+ import { applyResolvedNodeClaims, assertFulltextMember, getEmbeddingFields, computeFulltextContent } from './chunk-43DOTETB.js';
5
5
  import { isBundledRootAutocommitEligible } from './chunk-AHRNKPEV.js';
6
6
  import { edgeCardinalityClaimTarget, edgeCardinalityClaimRefusal, edgeCardinalityClaim, edgeCardinalityClaimMode, claimEdgeCardinality } from './chunk-IM4X2ZOR.js';
7
7
  import { resolveBackendFulltext } from './chunk-N535PWMA.js';
8
8
  import { AtomicEdgeBatchEndpointRefusalError, AtomicEdgeConvergenceTombstoneRefusalError, AtomicEdgeDeleteIdentityRefusalError, AtomicEdgeBatchCardinalityRefusalError } from './chunk-2DNUADXX.js';
9
- import { loadAndMergeGraphExtensionDocument, serializeSchema, buildKindRegistry, ensureIdentitySchemaStorage, loadAndVerifyGraph, identitySchemaCommitPreflight, getSchemaChanges, requiresMigration, mergeGraphExtension, commitNewSchemaVersion, commitNewSchemaVersionWithPreflight, parseSerializedSchema, planRemovals, stripGraphExtension, applyDeprecatedKinds, identityKindCascadeNeeded, ensureSchema, loadActiveSchemaWithBootstrap, extensionKindNames, serializeSchemaProperties, buildGraphExtensionOntologyKeySet, compileTimeOntologyKey, commitNewSchemaVersionIfKindsEmpty, serializeIndexDeclaration } from './chunk-E6PU35DE.js';
9
+ import { loadAndMergeGraphExtensionDocument, serializeSchema, buildKindRegistry, ensureIdentitySchemaStorage, loadAndVerifyGraph, identitySchemaCommitPreflight, getSchemaChanges, requiresMigration, mergeGraphExtension, commitNewSchemaVersion, commitNewSchemaVersionWithPreflight, parseSerializedSchema, planRemovals, stripGraphExtension, applyDeprecatedKinds, identityKindCascadeNeeded, ensureSchema, loadActiveSchemaWithBootstrap, extensionKindNames, serializeSchemaProperties, buildGraphExtensionOntologyKeySet, compileTimeOntologyKey, commitNewSchemaVersionIfKindsEmpty, serializeIndexDeclaration } from './chunk-W6K6NSRT.js';
10
10
  import { countSchemaKindRows } from './chunk-RFMSZ7CF.js';
11
11
  import { getTypeName } from './chunk-YXT3CCTR.js';
12
- import { loadCurrentStructuralClasses, loadAssertionsByIds, toTransferAssertion, liveNodeKindsSharingIds, createIdentityFacade, createIdentityReadFacade, validateIdentityForContext, removeIdentityKindsForContext, readIdentityAssertionsForInterchange, readIdentityAssertionPageAtTarget, lockIdentityGraph, foldIdentityForCreatedNodes, importIdentityAssertionsIntoTarget, assertAffectedIdentityClassesConsistent, applyIdentityChangesForContext, refKey, requireNodeValidityEndCompatible, detachIdentityForNode, rebuildIdentityClosureForContext, assertEdgeMatchIdentityBackendSupport } from './chunk-W4NT4IMI.js';
13
- import { storeRuntime, STORE_RUNTIME, assertRevisionTrackableBackend, createRecordedBackend, lockRecordedGraphWrite, refuseEngineNativeRecordedIdentityRead, createRecordedTransactionScope, readRecordedClock, ensureRevisionOrigin, recordedCaptureRequiresCallbackTransactionError, assertRecordedCaptureTransactionIsolation, lockSchemaVersionForStoreWrite, createMutationWitness, registerRecordedIdentityMutationWitness, TRANSACTION_RUNTIME, mintsOriginNamespacedAnchor, ensureRevisionOriginsRelation, generateId, runInWriteTransaction, assertCurrentRecordedSchema, AUTO_REFRESH_STATISTICS_ROW_THRESHOLD, withRecordedFlushObserver, withTransactionSchemaFenceLease, withWriteTransactionSession, resetRevisionOrigin, advanceRevisionClock, validateEdgeProps, diagnoseFusedSchemaFenceNoRow, getEdgeRowsByIds, memoizeLeasedSchemaFence, getNodeRowsByIds, hasLeasedSchemaFence, closeRecordedHardDeletedKind, historicalIdentityPeerClassQuery, IDENTITY_PEER_CLASS_COLUMNS, recordedBindParamBudget, throwHistoryUnsafeSqlAccess, throwRevisionTrackingUnsafeSqlAccess } from './chunk-HWWPL2YL.js';
12
+ import { loadCurrentStructuralClasses, loadAssertionsByIds, toTransferAssertion, liveNodeKindsSharingIds, createIdentityFacade, createIdentityReadFacade, validateIdentityForContext, removeIdentityKindsForContext, readIdentityAssertionsForInterchange, readIdentityAssertionPageAtTarget, lockIdentityGraph, foldIdentityForCreatedNodes, importIdentityAssertionsIntoTarget, assertAffectedIdentityClassesConsistent, applyIdentityChangesForContext, refKey, requireNodeValidityEndCompatible, detachIdentityForNode, rebuildIdentityClosureForContext, assertEdgeMatchIdentityBackendSupport } from './chunk-B4P4DAW3.js';
13
+ import { storeRuntime, STORE_RUNTIME, assertRevisionTrackableBackend, createRecordedBackend, lockRecordedGraphWrite, refuseEngineNativeRecordedIdentityRead, createRecordedTransactionScope, readRecordedClock, ensureRevisionOrigin, recordedCaptureRequiresCallbackTransactionError, assertRecordedCaptureTransactionIsolation, lockSchemaVersionForStoreWrite, createMutationWitness, registerRecordedIdentityMutationWitness, TRANSACTION_RUNTIME, mintsOriginNamespacedAnchor, ensureRevisionOriginsRelation, generateId, runInWriteTransaction, assertCurrentRecordedSchema, AUTO_REFRESH_STATISTICS_ROW_THRESHOLD, withRecordedFlushObserver, withTransactionSchemaFenceLease, withWriteTransactionSession, resetRevisionOrigin, advanceRevisionClock, validateEdgeProps, diagnoseFusedSchemaFenceNoRow, getEdgeRowsByIds, memoizeLeasedSchemaFence, getNodeRowsByIds, hasLeasedSchemaFence, closeRecordedHardDeletedKind, historicalIdentityPeerClassQuery, IDENTITY_PEER_CLASS_COLUMNS, recordedBindParamBudget, throwHistoryUnsafeSqlAccess, throwRevisionTrackingUnsafeSqlAccess } from './chunk-QWIR5533.js';
14
14
  import { isParameterRef, resolveParameterValueType, fieldRef, buildFieldBuilderForTypeInfo, stringField, createFulltextAccessor, CURRENT_READ_INSTANT_PLACEHOLDER, extractFulltextMatchPredicates, extractVectorSimilarityPredicates, withPinnedReadInstant, resolveBatchWriteVerdict, batchRefusalSuffix, batchRefusalDetails, canonicalEqual, runRetriedUnit, assertRecursiveTraversalSupported, baseField, objectField, arrayField, dateField, numberField, sortedReplacer, compileFieldValue, compileKindFilter, compileTemporalFilter, currentReadInstant, chunk, sqlValueList, buildPredicateIndex, requireRecursiveTraversalVerdict, getFieldPointer, groupBy, delay, currentReadInstantFor, extractTemporalOptions, compilePredicateExpression, isOptimisticRetryTier, OPTIMISTIC_RETRY_ATTEMPTS, getPredicatesForAlias, getNodeKindsForAlias, getHybridTargetAlias, compilePredicateClauses } from './chunk-XWMB3AFN.js';
15
15
  import { batchPointReadVerdict, statementExecutionVerdict, createClaimsVerdictThunk, uniqueSidecarBatchVerdict, contributionHealthVerdict, recordedRevisionOriginsVerdict, requireExtras, requireCatalog } from './chunk-ZQIDQHDR.js';
16
16
  import { assumeRecursiveTraversalSupported, withRecordedRelationsPrecondition, createSqlSchema, requireSqlSchema, DEFAULT_SQL_SCHEMA, recordedReadSchemaFor, resolveRecursiveTraversal, resolveWriteFencePlan, refuseUnfencedOperationalIdentity, refuseUnfencedClockAllocation, requireExternalRecordedReadSource, createRecordedReadBinding, createEngineRecordedReadBinding, runOptionallyInTransaction, createTransactionReadBackend, bindExtraIfReachable, BATCH_POINT_READ, CONTRIBUTION_HEALTH, bindExtra, projectGraphBackend, deriveBackend, vectorSlotKey, requireRecordedReadBinding, projectBackend, rowPropsToObject, recordedReadSqlSchema, INTERNAL_TEMPORARY_WRITES, postgresReadWriteRefusedSqlState, assertGraphCommandConvergenceIsolation, isSchemaFencedInsertEligible, executeAuthoritativeGraphCommand, assertRecursiveTraversal, isMissingTableError, postgresTemporaryTableUnavailableSqlState, isPostgresConcurrentDdlRaceError, ALIAS_CTE_PREFIX, EMBEDDINGS_CTE_ALIAS, FULLTEXT_CTE_ALIAS, HYBRID_CANDIDATES_CTE_ALIAS } from './chunk-LI7JGO5B.js';
@@ -23145,17 +23145,14 @@ var StoreImplementation = class _StoreImplementation {
23145
23145
  * adapter may reuse one client there too. The portable guarantee is only
23146
23146
  * that at most one query is in flight at a time.
23147
23147
  *
23148
- * **Not a snapshot — and there is no way to make it one.** PostgreSQL
23149
- * defaults to read-committed isolation, so a later query can observe a
23150
- * commit the earlier ones did not. `store.transaction()` takes an
23151
- * `isolationLevel`, but its context exposes only `nodes` / `edges`: there is
23152
- * no public way to run a fluent query or a batch inside a transaction, so a
23153
- * snapshot across fluent queries is not available today. Collection reads
23154
- * can have one — `store.transaction(fn, { isolationLevel: "repeatable_read" })`
23155
- * reading through `tx.nodes` / `tx.edges` — but only where the backend has
23156
- * transactions (other backends refuse before invoking the callback), and a history-enabled
23157
- * store on PostgreSQL additionally requires `accessMode: "read_only"` or the
23158
- * call throws.
23148
+ * **Not a snapshot by default.** PostgreSQL defaults to read-committed
23149
+ * isolation, so a later query can observe a commit the earlier ones did not.
23150
+ * When multiple reads need one stable snapshot, use `tx.query()` or the
23151
+ * transaction's set-oriented reads inside `store.transaction(fn, {
23152
+ * isolationLevel: "repeatable_read" })`. `tx.batchOnce()` is one statement
23153
+ * regardless of isolation level. Transaction reads require a backend with
23154
+ * interactive transactions, and a history-enabled store on PostgreSQL
23155
+ * additionally requires `accessMode: "read_only"` for a read-only transaction.
23159
23156
  *
23160
23157
  * **Will not fix an N+1.** Serializing N queries does not reduce their
23161
23158
  * number. The alternatives are set-oriented or chunked rather than
@@ -23217,23 +23214,33 @@ var StoreImplementation = class _StoreImplementation {
23217
23214
  * here.
23218
23215
  */
23219
23216
  async batchOnce(build) {
23220
- const queries = build({
23217
+ return this.#batchOnceForBackend(this.#baseBackend, 1, build);
23218
+ }
23219
+ #createBatchReadBuilder(backend, attempt) {
23220
+ return {
23221
23221
  neighbors: (source, options) => {
23222
23222
  this.#assertNeighborKinds(source, options.edges);
23223
- return createNeighborRead(this.#neighborContext(), source, options);
23223
+ return createNeighborRead(
23224
+ this.#neighborContext(backend, attempt),
23225
+ source,
23226
+ options
23227
+ );
23224
23228
  },
23225
23229
  countNeighbors: (source, options) => {
23226
23230
  this.#assertNeighborKinds(source, options.edges);
23227
23231
  return createNeighborCountRead(
23228
- this.#neighborContext(),
23232
+ this.#neighborContext(backend, attempt),
23229
23233
  source,
23230
23234
  options
23231
23235
  );
23232
23236
  },
23233
- subgraph: (rootId, options) => this.#createSubgraphRead(rootId, options)
23234
- });
23237
+ subgraph: (rootId, options) => this.#createSubgraphRead(rootId, options, backend, attempt)
23238
+ };
23239
+ }
23240
+ async #batchOnceForBackend(backend, attempt, build) {
23241
+ const queries = build(this.#createBatchReadBuilder(backend, attempt));
23235
23242
  return executeOneStatementBatch(
23236
- this.#createHookedQueryBackend(this.#baseBackend),
23243
+ this.#createHookedQueryBackend(backend, attempt),
23237
23244
  queries
23238
23245
  );
23239
23246
  }
@@ -23247,10 +23254,10 @@ var StoreImplementation = class _StoreImplementation {
23247
23254
  this.#assertNeighborKinds(source, options.edges);
23248
23255
  return countNeighbors(this.#neighborContext(), source, options);
23249
23256
  }
23250
- #neighborContext() {
23257
+ #neighborContext(backend = this.#backend, attempt = 1) {
23251
23258
  return {
23252
23259
  graphId: this.graphId,
23253
- backend: this.#createHookedQueryBackend(this.#backend),
23260
+ backend: this.#createHookedQueryBackend(backend, attempt),
23254
23261
  schema: this.#sqlSchema(),
23255
23262
  defaultTemporalMode: this.#graph.defaults.temporalMode,
23256
23263
  registry: this.#registry
@@ -23423,30 +23430,29 @@ var StoreImplementation = class _StoreImplementation {
23423
23430
  * ```
23424
23431
  */
23425
23432
  async subgraph(rootId, options) {
23426
- assertNoRecordedCoordinate(options, {
23427
- code: "SUBGRAPH_RECORDED_ASOF_INTERNAL_ONLY",
23428
- message: "recordedAsOf is only available through store.asOfRecorded(...).subgraph(...).",
23429
- suggestion: "Use store.asOfRecorded(recordedAt).subgraph(rootId, options) instead of passing recordedAsOf directly."
23430
- });
23433
+ this.#assertPublicSubgraphOptions(options);
23431
23434
  return this.subgraphAtCoordinate(rootId, options);
23432
23435
  }
23433
- #createSubgraphRead(rootId, options) {
23434
- assertNoRecordedCoordinate(options, {
23435
- code: "SUBGRAPH_RECORDED_ASOF_INTERNAL_ONLY",
23436
- message: "recordedAsOf is only available through store.asOfRecorded(...).subgraph(...).",
23437
- suggestion: "Use store.asOfRecorded(recordedAt).subgraph(rootId, options) instead of passing recordedAsOf directly."
23438
- });
23436
+ #createSubgraphRead(rootId, options, backend = this.#baseBackend, attempt = 1) {
23437
+ this.#assertPublicSubgraphOptions(options);
23439
23438
  return createSubgraphRead({
23440
23439
  graph: this.#graph,
23441
23440
  graphId: this.graphId,
23442
23441
  rootId,
23443
- backend: this.#createHookedQueryBackend(this.#baseBackend),
23444
- dialect: getDialect(this.#backend.dialect),
23442
+ backend: this.#createHookedQueryBackend(backend, attempt),
23443
+ dialect: getDialect(backend.dialect),
23445
23444
  schema: this.#schema,
23446
23445
  recordedReadBinding: this.#recordedReadBinding,
23447
23446
  options
23448
23447
  });
23449
23448
  }
23449
+ #assertPublicSubgraphOptions(options) {
23450
+ assertNoRecordedCoordinate(options, {
23451
+ code: "SUBGRAPH_RECORDED_ASOF_INTERNAL_ONLY",
23452
+ message: "recordedAsOf is only available through store.asOfRecorded(...).subgraph(...).",
23453
+ suggestion: "Use store.asOfRecorded(recordedAt).subgraph(rootId, options) instead of passing recordedAsOf directly."
23454
+ });
23455
+ }
23450
23456
  /**
23451
23457
  * Internal seam for {@link StoreView} / {@link RecordedStoreView}: runs a
23452
23458
  * subgraph with a coordinate already flattened into the options (including a
@@ -23832,9 +23838,34 @@ var StoreImplementation = class _StoreImplementation {
23832
23838
  };
23833
23839
  return overlayPropertyDescriptors(context, { measure });
23834
23840
  }
23841
+ /** Builds graph reads that execute through one already-open transaction. */
23842
+ #createTransactionReadSurface(txBackend, attempt) {
23843
+ return {
23844
+ query: () => this.#createQueryForBackend(txBackend, void 0, attempt),
23845
+ batchOnce: (build) => this.#batchOnceForBackend(txBackend, attempt, build),
23846
+ neighbors: (source, options) => {
23847
+ this.#assertNeighborKinds(source, options.edges);
23848
+ return readNeighbors(
23849
+ this.#neighborContext(txBackend, attempt),
23850
+ source,
23851
+ options
23852
+ );
23853
+ },
23854
+ countNeighbors: (source, options) => {
23855
+ this.#assertNeighborKinds(source, options.edges);
23856
+ return countNeighbors(
23857
+ this.#neighborContext(txBackend, attempt),
23858
+ source,
23859
+ options
23860
+ );
23861
+ },
23862
+ subgraph: (rootId, options) => this.#createSubgraphRead(rootId, options, txBackend, attempt).execute()
23863
+ };
23864
+ }
23835
23865
  /**
23836
- * Builds the `{ nodes, edges, sql }` projection bound to a
23837
- * transaction-scoped backend. Shared verbatim by {@link transaction}
23866
+ * Builds the transaction context bound to a transaction-scoped backend.
23867
+ * Collections, fluent queries, and set-oriented reads all use that same
23868
+ * backend. Shared verbatim by {@link transaction}
23838
23869
  * (TypeGraph opens the tx) and {@link withTransaction} (#134 — the
23839
23870
  * caller opened it) so both surfaces resolve collections, query
23840
23871
  * factories, and the reused graph/registry identically. When history capture
@@ -23890,6 +23921,7 @@ var StoreImplementation = class _StoreImplementation {
23890
23921
  const base = {
23891
23922
  nodes,
23892
23923
  edges,
23924
+ ...this.#createTransactionReadSurface(txBackend, attempt),
23893
23925
  ...receiptIdentity === void 0 ? {} : { identity: receiptIdentity },
23894
23926
  backend: createTransactionReadBackend(txBackend),
23895
23927
  [TRANSACTION_RUNTIME]: { backend: txBackend, runNodeOperationHooks },
@@ -25848,5 +25880,5 @@ async function createVerifiedAdapterStore(graph, backend, options) {
25848
25880
  }
25849
25881
 
25850
25882
  export { CURRENT_ONLY_READ_NAMES, EDGE_TEMPORAL_READ_NAMES, ExecutableAggregateQuery, ExecutableQuery, IDENTITY_READ_NAMES, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, NODE_TEMPORAL_READ_NAMES, PreparedQuery, QueryBuilder, RecordedStoreView, StoreAnalysisCursorStaleError, StoreSearch, StoreView, UnionableQuery, avg, composeFragments, count, countDistinct, countDistinctEdges, countEdges, createAdapterStore, createAdapterStoreWithSchema, createFragment, createQueryBuilder, createStore, createStoreWithSchema, createVerifiedAdapterStore, createVerifiedStore, defineSubgraphProject, field, having, havingEq, havingGt, havingGte, havingLt, havingLte, limitFragment, max, min, offsetFragment, orderByFragment, sum };
25851
- //# sourceMappingURL=chunk-MKQY4ZLZ.js.map
25852
- //# sourceMappingURL=chunk-MKQY4ZLZ.js.map
25883
+ //# sourceMappingURL=chunk-2DKIJP2R.js.map
25884
+ //# sourceMappingURL=chunk-2DKIJP2R.js.map