@spine-event-engine/storage-datastore 2.0.0-snapshot.23 → 2.0.0-snapshot.25

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 (51) hide show
  1. package/README.md +25 -10
  2. package/REFERENCE.md +66 -50
  3. package/dist/datastore/agent-history.d.ts +36 -6
  4. package/dist/datastore/agent-history.d.ts.map +1 -1
  5. package/dist/datastore/agent-history.js +92 -6
  6. package/dist/datastore/agent-history.js.map +1 -1
  7. package/dist/datastore/column-mapping.d.ts.map +1 -1
  8. package/dist/datastore/column-mapping.js +6 -3
  9. package/dist/datastore/column-mapping.js.map +1 -1
  10. package/dist/datastore/entity-history.d.ts +206 -55
  11. package/dist/datastore/entity-history.d.ts.map +1 -1
  12. package/dist/datastore/entity-history.js +556 -239
  13. package/dist/datastore/entity-history.js.map +1 -1
  14. package/dist/datastore/id-column.d.ts +7 -0
  15. package/dist/datastore/id-column.d.ts.map +1 -1
  16. package/dist/datastore/id-column.js +27 -3
  17. package/dist/datastore/id-column.js.map +1 -1
  18. package/dist/datastore/record-kind.d.ts +8 -0
  19. package/dist/datastore/record-kind.d.ts.map +1 -0
  20. package/dist/datastore/record-kind.js +26 -0
  21. package/dist/datastore/record-kind.js.map +1 -0
  22. package/dist/datastore/record-storage.d.ts +11 -10
  23. package/dist/datastore/record-storage.d.ts.map +1 -1
  24. package/dist/datastore/record-storage.js +31 -32
  25. package/dist/datastore/record-storage.js.map +1 -1
  26. package/dist/datastore/storage-factory.d.ts +293 -89
  27. package/dist/datastore/storage-factory.d.ts.map +1 -1
  28. package/dist/datastore/storage-factory.js +734 -222
  29. package/dist/datastore/storage-factory.js.map +1 -1
  30. package/dist/datastore/tenant-catalog.d.ts +12 -25
  31. package/dist/datastore/tenant-catalog.d.ts.map +1 -1
  32. package/dist/datastore/tenant-catalog.js +43 -121
  33. package/dist/datastore/tenant-catalog.js.map +1 -1
  34. package/dist/datastore/transaction-rows.d.ts +30 -0
  35. package/dist/datastore/transaction-rows.d.ts.map +1 -0
  36. package/dist/datastore/transaction-rows.js +43 -0
  37. package/dist/datastore/transaction-rows.js.map +1 -0
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/index.yaml +0 -9
  43. package/package.json +5 -5
  44. package/dist/datastore/agent-execution.d.ts +0 -337
  45. package/dist/datastore/agent-execution.d.ts.map +0 -1
  46. package/dist/datastore/agent-execution.js +0 -789
  47. package/dist/datastore/agent-execution.js.map +0 -1
  48. package/dist/datastore/delivery-cleanup.d.ts +0 -31
  49. package/dist/datastore/delivery-cleanup.d.ts.map +0 -1
  50. package/dist/datastore/delivery-cleanup.js +0 -111
  51. package/dist/datastore/delivery-cleanup.js.map +0 -1
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Google Cloud Datastore storage for Spine TS
2
2
 
3
+ See [storage layout and database preparation](https://github.com/SpineEventEngine/spine-ts/blob/master/docs/STORAGE_LAYOUT.md) for
4
+ physical structures, tenant placement, prerequisites, and customization.
5
+
3
6
  `@spine-event-engine/storage-datastore` stores Spine TS records in Google Cloud
4
7
  Datastore, including Firestore in Datastore mode. It implements the storage
5
8
  contract from `@spine-event-engine/storage`; it does not use Firestore Native
@@ -11,10 +14,10 @@ record schemas, and a configured Google Datastore client.
11
14
  For exact query limits, entity-storage behavior, and failure handling, see
12
15
  [REFERENCE documentation for agents](REFERENCE.md).
13
16
 
14
- For an application using Agents, this provider keeps the Agent's accepted
15
- work and recorded interactions across restarts. Deploy the supplied `index.yaml`
16
- for Agent history and execution queries; see the [coding-agent reference](REFERENCE.md)
17
- for provider requirements.
17
+ For an application using Agents, this provider keeps typed admission receipts,
18
+ Entity state, and recorded interactions across restarts. An interrupted handler
19
+ does not resume. Deploy the supplied `index.yaml` for Agent history queries;
20
+ see the [coding-agent reference](REFERENCE.md) for provider requirements.
18
21
 
19
22
  ## 💡 Why use it?
20
23
 
@@ -73,15 +76,23 @@ try {
73
76
  if (stored?.value !== "task-42") throw new Error("The record was not stored.");
74
77
  } finally {
75
78
  await records.close();
76
- factory.close();
79
+ await factory.close();
77
80
  }
78
81
  ```
79
82
 
80
83
  The builder always uses a client supplied by the caller. Its fixed finite reconciliation
81
84
  bound is 1,000 records. Pass the factory to the server or create record storage
82
- through the normal storage API. When application values contain `Any`, configure
83
- a `StringifierRegistry` with that application's `TypeRegistry` before building;
84
- the layout section below explains why that mapping must remain reversible.
85
+ through the normal storage API. Generated model modules register descriptors
86
+ on import, allowing the shared default stringifier to convert `Any` values.
87
+ An explicitly supplied `StringifierRegistry` can use the application's
88
+ `TypeRegistry`; the layout section below explains why that mapping must remain reversible.
89
+
90
+ `build()` is synchronous and does not contact Datastore. `await factory.checkConnection()`
91
+ performs a read-only, keys-only query for the exact shared `__namespace__` metadata
92
+ key. It remembers success and permits retry after failure; the supplied client stays
93
+ open after factory closure. The diagnostic requires `datastore.namespaces.get` and
94
+ `datastore.namespaces.list` permissions. It checks metadata read access, not Entity
95
+ read/write permissions or deployed composite indexes. An unused namespace is valid.
85
96
 
86
97
  ## Build it in this workspace
87
98
 
@@ -223,8 +234,12 @@ Provider filters and ordering are pushed down; public query offsets and mixed
223
234
  local/provider limits are reconciled locally within that finite bound.
224
235
 
225
236
  Ordinary `write()` and `writeAll()` calls are independent provider writes. Use
226
- compare-and-set for an atomic conditional record update, or an Entity commit
227
- for one atomic current-state/history/event mutation.
237
+ compare-and-set for an atomic conditional record update. An Entity commit
238
+ writes history, diagnostic Events, delivery Events, and current state in order;
239
+ a later failure can leave the completed prefix.
240
+ The provider-only live Agent commit uses one native Datastore transaction to
241
+ check the initial Entity version and complete model preferences, then commit
242
+ any changed state, final audit, and preferences together.
228
243
 
229
244
  ## 🧪 Verify with a local emulator
230
245
 
package/REFERENCE.md CHANGED
@@ -6,12 +6,21 @@ This reference is for coding agents configuring the Google Cloud Datastore adapt
6
6
 
7
7
  Import `DatastoreStorageFactory`, `DatastoreStorageFactoryBuilder`,
8
8
  `RecordLayout`, `CreateRecordStorage`, `CreateEntityStorage`,
9
+ `PrepareDatastoreRecordStorage`, `PrepareDatastoreEntityStorage`,
9
10
  `NamespaceConverter`, `DefaultNamespaceConverter`, `DatastoreIdColumn`,
10
11
  `DatastoreColumnMapping`, and `DatastoreQueryLimitError` from
11
12
  `@spine-event-engine/storage-datastore`.
12
13
  Create a factory with `DatastoreStorageFactory.newBuilder().setClient(client)`.
13
14
  The adapter never closes that client.
14
15
 
16
+ `build()` is offline. `checkConnection()` runs one read-only exact-key,
17
+ keys-only query against shared `__namespace__` metadata and remembers a
18
+ successful result. It retries failures and drains admitted checks on close.
19
+ An empty result is valid for an unused namespace. The diagnostic needs
20
+ `datastore.namespaces.get` and `datastore.namespaces.list`; it does not prove
21
+ ordinary Entity read/write permissions, deployed composite indexes, or every
22
+ query shape. The caller-supplied client remains open.
23
+
15
24
  The builder is mutable until `build()` and the built factory receives a
16
25
  snapshot. The last registration for the same identity wins. Record resolution
17
26
  uses this precedence:
@@ -23,9 +32,12 @@ uses this precedence:
23
32
  5. the default kind.
24
33
 
25
34
  `setNamespaceConverter(...)` replaces complete `TenantId`/native namespace
26
- conversion. `setStringifierRegistry(...)` supplies reversible mappings for
27
- message-valued IDs and ordinary message columns. The stringifier registry is
28
- snapshotted by `build()`; a custom namespace converter is retained and must
35
+ conversion. The default shared registry maps message-valued IDs and ordinary
36
+ message columns using generated descriptors registered on module import.
37
+ `setStringifierRegistry(...)` accepts a custom registry, snapshotted by
38
+ `build()`. `setEventStoreKind(contextName, kind, role?)` selects one native kind
39
+ for the exact bounded-context name and domain or system role. A custom
40
+ namespace converter is retained and must
29
41
  remain behaviorally immutable for the factory lifetime. `organizeRecords(...)`
30
42
  changes a kind. `useRecordStorage(...)` replaces a record-family provider.
31
43
  `Identifiers` select the key representation, and the same configured
@@ -37,8 +49,28 @@ a provider string or infer shared filter/sort-name validation.
37
49
  `useEntityStorage(...)` replaces the complete coherent Entity handle, including
38
50
  its commit capability. Custom providers receive the storage context, record or
39
51
  Entity contract, and caller-supplied client, but not the built-in converter or
40
- stringifier registry; they must provide equivalent tenant, ID, and column mapping. The
41
- built-in Entity provider does not mix custom record creators into one transaction.
52
+ stringifier registry; they must provide equivalent tenant, ID, and column mapping.
53
+ For model preparation, the existing `StoragePreparations` provider port checks
54
+ declarative current, enabled history, and surviving Agent audit families without
55
+ opening storage handles or writing records. Native `create` and `check` establish
56
+ the same narrow kind, namespace, ID, and column compatibility plus metadata-read
57
+ facts; missing kinds are valid. Applications must deploy the required indexes,
58
+ including the three Agent audit indexes. A selected custom creator requires an
59
+ optional trailing preparation callback on `useRecordStorage(...)` or
60
+ `useEntityStorage(...)`; preparation rejects before invoking a creator when that
61
+ callback is absent. Custom callbacks receive the declarative input, caller client,
62
+ and `create` or read-only `check` mode, and must establish matching guarantees.
63
+ The callback and creator must share application-managed readiness: after a
64
+ successful `check`, later ordinary use must not auto-create the checked
65
+ structures. A `create` callback verifies its result. Each callback cleans up
66
+ resources it partially acquires if preparation fails.
67
+ The built-in Entity provider writes its record families independently; custom
68
+ record creators do not join a combined Entity transaction.
69
+ Custom Entity bundles return a `Promise<void>` from `close()` and provide synchronous
70
+ `closeIdle()` for internal assembly rollback. Their close fences new commits immediately,
71
+ waits for admitted work, and releases every resource acquired by the custom creator.
72
+ The factory tracks each bundle as one disposal unit and awaits its close before
73
+ closing the native tenant catalog.
42
74
 
43
75
  ## Physical layout
44
76
 
@@ -67,11 +99,10 @@ numbers, and integers outside their declared/provider range fail before an
67
99
  RPC. Stored `bytes` remain authoritative; declared properties are rematerialized
68
100
  after decoding.
69
101
 
70
- `keep()` bridges native `__namespace__` metadata lag without storing a tenant
71
- record. Its early-admission cache retains at most 1,000 tenants for at most 60
72
- seconds and removes an entry sooner when native metadata becomes visible. A
73
- full cache fails closed; applications can retry after metadata appears or an
74
- entry expires.
102
+ `contains()` checks the exact native `__namespace__` metadata key without
103
+ writing records or scanning the catalog. `keep()` confirms an existing
104
+ namespace and rejects a missing one. Applications needing registration before
105
+ the first Datastore entity exists supply their own tenant index.
75
106
 
76
107
  Declared string and boolean columns use native values. Integer columns use
77
108
  Datastore int values, float/double columns use Datastore double values, bytes
@@ -109,14 +140,15 @@ This is deliberately the overlap, not MySQL parity: nested or disjunctive
109
140
  predicates and provider-illegal inequality/order shapes reject before provider
110
141
  access. Normalized plans have no offset; `RecordQuery.offset` is separate.
111
142
 
112
- The provider Entity commit writes the supplied current record, enabled histories,
113
- and delivery events in one Datastore transaction. It does not compare current
114
- state with an expected previous record. The operation rejects more than 25
115
- entity groups, 500 mutations, or its conservative transaction-size limit before
116
- opening the transaction. Success resolves without a value. Identical immutable
117
- retries remain accepted; divergent immutable content fails. Associated records
118
- are still completed when the current record already matches the supplied value.
119
- Only ABORTED provider failures retry, for at most three attempts.
143
+ The provider Entity commit writes state history, diagnostic Events, delivery
144
+ Events, and current state as independent records in that order. A later failure
145
+ can leave the completed prefix. It does not compare current state with an
146
+ expected previous record. Success resolves without a value. Identical
147
+ immutable retries remain accepted; divergent immutable content fails. A
148
+ captured prepared input is retried once after an `ABORTED` provider failure,
149
+ with the same record bytes, versions, and Event IDs; the application handler
150
+ does not run again. Event presence alone does not prove the current record was
151
+ written. Separate saves can interleave, including current-state writes.
120
152
 
121
153
  History reads use stable finite keyset pages. State history provides backward,
122
154
  state-at-time, trim, and truncate behavior; event history provides backward and
@@ -139,10 +171,9 @@ of at most 128 rows and sum serialized entry bytes. A fetched chunk can be
139
171
  larger than the returned byte budget.
140
172
 
141
173
  The factory has one tenant catalog. It reads native `__namespace__` metadata,
142
- converts only namespaces recognized by its `NamespaceConverter`, and keeps an early
143
- in-memory cache for newly admitted tenants. `keep()` stores no `TenantId` row or
144
- other discovery record; Datastore exposes native metadata after an application
145
- entity is written in that namespace.
174
+ converts only namespaces recognized by its `NamespaceConverter`. `keep()`
175
+ stores no `TenantId` row or other discovery record; Datastore exposes native
176
+ metadata after an application entity is written in that namespace.
146
177
 
147
178
  Before deployment to an existing project, run `pnpm --dir
148
179
  packages/storage-datastore inventory:legacy -- --project <project-id>`. It
@@ -151,31 +182,16 @@ an old `_scope` property, or a scope-derived key name. Passing the inventory is
151
182
  a startup prerequisite; the application performs migration offline, with no
152
183
  dual-layout reads or automatic conflict winner.
153
184
 
154
- ## Agent execution
155
-
156
- Agent execution uses `spine_agent_execution` and `spine_agent_execution_head` in
157
- the selected tenant namespace. Deploy the execution indexes in this package's
158
- `index.yaml` together with its Agent history indexes. Pending queries select one
159
- entry per instance by its complete eligibility-time key.
160
-
161
- The database must support the adapter's non-ancestor query inside a transaction.
162
- The `OPTIMISTIC_WITH_ENTITY_GROUPS` concurrency mode requires ancestor queries
163
- and is therefore incompatible with Agent execution in this adapter. See
164
- [Datastore transaction modes](https://docs.cloud.google.com/datastore/docs/concepts/transactions).
165
- Admission probes that query and the indexed pending query before saving work.
166
- A database mode that forbids it is rejected; the adapter does not fall back to
167
- a scan or a query outside the transaction. The local Agent execution conformance suite uses the Firestore emulator in
168
- Datastore mode, distributed with Google Cloud CLI 578.0.0. This tests the
169
- transactional query capability; it does not validate a production project's
170
- configuration.
171
-
172
- Conditional completion reads the current Entity Version and pending work before
173
- queuing writes. State, mandatory history, preferences, execution completion and
174
- outgoing signals are saved in the same transaction. Datastore entity, index and
175
- transaction limits still apply: execution, per-instance and Agent history
176
- payloads are limited to 1,000,000 encoded bytes each, and the adapter limits a staged transaction to
177
- 9 MiB. Response reservations must account for the complete stored records before
178
- inference. No transaction remains open during a model call.
185
+ ## Agent live persistence
186
+
187
+ `AgentHistoryStorage.appendAll()` saves one complete immutable audit group
188
+ atomically. The live `EntityCommitStorage.commitAgent()` compares exact Entity
189
+ state and model preferences before it writes accepted state, preferences, and
190
+ history in one Datastore transaction. A no-op or preference-only turn can leave
191
+ the Entity Version unchanged. Typed admission receipts persist separately and
192
+ do not make an interrupted Agent handler replayable. Datastore entity, index,
193
+ and transaction limits still apply, including the adapter's 9 MiB staged
194
+ transaction payload ceiling. No transaction remains open during a model call.
179
195
 
180
196
  ## Operations and errors
181
197
 
@@ -184,6 +200,6 @@ errors are surfaced without payload data. The emulator suite is required for
184
200
  provider acceptance; cloud smoke remains credential-gated.
185
201
 
186
202
  `build()` and storage-handle creation issue no request. Closing the factory is
187
- idempotent and prevents creation of another handle without closing the
188
- caller-supplied client or already-created handles. Each record, Entity, and commit
189
- handle has an independent idempotent lifecycle and rejects work after it is closed.
203
+ idempotent, prevents creation of another handle, and drains tracked Entity bundles
204
+ and commit handles. It leaves ordinary independent record handles and the
205
+ caller-supplied client open. Each handle rejects work after it is closed.
@@ -1,6 +1,6 @@
1
1
  import type { AgentHistoryEntry } from "@spine-event-engine/proto/agent";
2
2
  import type { AgentHistoryRecord } from "@spine-event-engine/proto/generated/spine/server/agent/history_record_pb.js";
3
- import { type AgentHistoryPage, type AgentHistoryRead, type AgentHistoryStorage, type AgentHistoryStorageInput } from "@spine-event-engine/storage/provider";
3
+ import { type AgentHistoryCapacity, type AgentHistoryPage, type AgentHistoryRead, type AgentHistoryStorage, type AgentHistoryStorageInput } from "@spine-event-engine/storage/provider";
4
4
  import { DatastoreRecordStorage } from "./record-storage.js";
5
5
  /**
6
6
  * Hashes complete identities into bounded physical IDs and indexed scope keys.
@@ -23,13 +23,47 @@ export declare class DatastoreAgentHistory<Id> implements AgentHistoryStorage<Id
23
23
  #private;
24
24
  private readonly input;
25
25
  private readonly records;
26
+ private readonly onAdmit;
27
+ /**
28
+ * Native Datastore Agent history transaction capacity declaration.
29
+ */
30
+ readonly capacity: AgentHistoryCapacity;
26
31
  /**
27
32
  * Binds one typed Agent repository to the provider record handle.
28
33
  *
29
34
  * @param input Repository and complete tenant scope.
30
35
  * @param records Native record-family storage.
36
+ * @param onAdmit Tracks a complete public batch through factory shutdown.
37
+ */
38
+ constructor(input: AgentHistoryStorageInput<Id>, records: DatastoreRecordStorage<string, AgentHistoryRecord>, onAdmit?: (work: () => Promise<void>) => Promise<void>);
39
+ /**
40
+ * Writes atomically appends one captured immutable audit group.
41
+ * @param entityId Typed Agent identifier.
42
+ * @param entries Original Agent audit entries.
43
+ * @returns Completion after all rows commit or the group rolls back.
44
+ */
45
+ appendAll(entityId: Id, entries: readonly AgentHistoryEntry[]): Promise<void>;
46
+ /**
47
+ * Performs an admitted native transaction for the complete audit group.
48
+ *
49
+ * @param entityId Typed Entity identifier.
50
+ * @param entries Complete immutable history group.
51
+ * @returns Completion after the complete immutable audit group commits atomically.
52
+ */
53
+ private appendAllAdmitted;
54
+ /**
55
+ * Checks immutable rows and stages missing rows in one native transaction.
56
+ *
57
+ * @param records Complete persisted record group.
58
+ * @returns Completion after immutable rows commit in one native transaction.
59
+ */
60
+ private commitGroup;
61
+ /**
62
+ * Checks native entity-group and serialized payload limits before writing.
63
+ *
64
+ * @param rows Complete provider rows for this operation.
31
65
  */
32
- constructor(input: AgentHistoryStorageInput<Id>, records: DatastoreRecordStorage<string, AgentHistoryRecord>);
66
+ private validateNativeGroup;
33
67
  /**
34
68
  * Writes one original entry or confirms byte-identical content.
35
69
  *
@@ -46,9 +80,7 @@ export declare class DatastoreAgentHistory<Id> implements AgentHistoryStorage<Id
46
80
  */
47
81
  read(request: AgentHistoryRead<Id>): Promise<AgentHistoryPage>;
48
82
  /**
49
-
50
83
  * Closes this handle without deleting stored records.
51
-
52
84
  */
53
85
  close(): void;
54
86
  /**
@@ -91,9 +123,7 @@ export declare class DatastoreAgentHistory<Id> implements AgentHistoryStorage<Id
91
123
  */
92
124
  private key;
93
125
  /**
94
-
95
126
  * Rejects calls after this handle closes.
96
-
97
127
  */
98
128
  private requireOpen;
99
129
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"agent-history.d.ts","sourceRoot":"","sources":["../../src/datastore/agent-history.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6EAA6E,CAAC;AACtH,OA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B,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWpE;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;;;;;;;OAQG;YACW,KAAK;IA+BnB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAcrB;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;IAgBnB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;;OAKG;IACH,OAAO,CAAC,GAAG;IAMX;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;CAKnB"}
@@ -12,7 +12,7 @@
12
12
  * the License.
13
13
  */
14
14
  import { createHash } from "node:crypto";
15
- import { toBinary } from "@bufbuild/protobuf";
15
+ import { clone, toBinary } from "@bufbuild/protobuf";
16
16
  import { AgentHistoryRecordSchema } from "@spine-event-engine/proto/generated/spine/server/agent/history_record_pb.js";
17
17
  import { AgentHistoryKeys, AgentHistoryPages, } from "@spine-event-engine/storage/provider";
18
18
  import { AgentHistoryRecords } from "@spine-event-engine/storage/provider";
@@ -39,6 +39,14 @@ export const AgentHistoryHash = {
39
39
  export class DatastoreAgentHistory {
40
40
  input;
41
41
  records;
42
+ onAdmit;
43
+ /**
44
+ * Native Datastore Agent history transaction capacity declaration.
45
+ */
46
+ capacity = Object.freeze({
47
+ historyRecordBytes: 1_000_000,
48
+ transactionPayloadBytes: 9 * 1024 * 1024,
49
+ });
42
50
  /**
43
51
  * Records whether this handle accepts calls.
44
52
  */
@@ -48,10 +56,92 @@ export class DatastoreAgentHistory {
48
56
  *
49
57
  * @param input Repository and complete tenant scope.
50
58
  * @param records Native record-family storage.
59
+ * @param onAdmit Tracks a complete public batch through factory shutdown.
51
60
  */
52
- constructor(input, records) {
61
+ constructor(input, records, onAdmit = (work) => work()) {
53
62
  this.input = input;
54
63
  this.records = records;
64
+ this.onAdmit = onAdmit;
65
+ }
66
+ /**
67
+ * Writes atomically appends one captured immutable audit group.
68
+ * @param entityId Typed Agent identifier.
69
+ * @param entries Original Agent audit entries.
70
+ * @returns Completion after all rows commit or the group rolls back.
71
+ */
72
+ appendAll(entityId, entries) {
73
+ return this.onAdmit(() => this.appendAllAdmitted(entityId, entries));
74
+ }
75
+ /**
76
+ * Performs an admitted native transaction for the complete audit group.
77
+ *
78
+ * @param entityId Typed Entity identifier.
79
+ * @param entries Complete immutable history group.
80
+ * @returns Completion after the complete immutable audit group commits atomically.
81
+ */
82
+ async appendAllAdmitted(entityId, entries) {
83
+ this.requireOpen();
84
+ const key = this.key(entityId);
85
+ const unique = new Map();
86
+ for (const entry of entries) {
87
+ if (AgentHistoryKeys.indexValue(AgentHistoryKeys.fromEntry(entry)).length > 1500)
88
+ throw new RangeError("Agent history ordering key exceeds the Datastore indexed-value limit.");
89
+ const record = clone(AgentHistoryRecordSchema, AgentHistoryRecords.record(this.input.stateType, key, entry));
90
+ if (toBinary(AgentHistoryRecordSchema, record).length > 1_000_000)
91
+ throw new RangeError("Agent history record exceeds the Datastore entity limit.");
92
+ const slot = AgentHistoryRecords.slot(record);
93
+ const prior = unique.get(slot);
94
+ if (prior !== undefined && !this.sameRecord(prior, record))
95
+ throw new Error("Datastore Agent history record ID conflicts with immutable content.");
96
+ unique.set(slot, record);
97
+ }
98
+ if (unique.size === 0)
99
+ return;
100
+ await this.commitGroup([...unique.values()]);
101
+ }
102
+ /**
103
+ * Checks immutable rows and stages missing rows in one native transaction.
104
+ *
105
+ * @param records Complete persisted record group.
106
+ * @returns Completion after immutable rows commit in one native transaction.
107
+ */
108
+ async commitGroup(records) {
109
+ const rows = records.map((record) => this.records.transactionEntity(record));
110
+ this.validateNativeGroup(rows);
111
+ const tx = this.records.transaction();
112
+ try {
113
+ await tx.run();
114
+ for (let index = 0; index < rows.length; index += 1) {
115
+ const row = rows[index];
116
+ const record = records[index];
117
+ if (row === undefined || record === undefined)
118
+ throw new Error("Missing Agent audit row.");
119
+ const value = await tx.get(row.key, { wrapNumbers: true });
120
+ const raw = (Array.isArray(value) ? value[0] : value);
121
+ if (raw === undefined)
122
+ tx.save(row);
123
+ else if (!this.records.matchesTransactionEntity(raw, record))
124
+ throw new Error("Datastore Agent history record ID conflicts with immutable content.");
125
+ }
126
+ await tx.commit();
127
+ }
128
+ catch (error) {
129
+ await tx.rollback().catch(() => undefined);
130
+ throw error;
131
+ }
132
+ }
133
+ /**
134
+ * Checks native entity-group and serialized payload limits before writing.
135
+ *
136
+ * @param rows Complete provider rows for this operation.
137
+ */
138
+ validateNativeGroup(rows) {
139
+ if (rows.length > 25)
140
+ throw new RangeError("Agent history group exceeds the Datastore transaction entity-group limit.");
141
+ const bytes = rows.reduce((sum, row) => sum +
142
+ Buffer.byteLength(JSON.stringify(row.data, (_key, value) => value instanceof Uint8Array ? Buffer.from(value).toString("base64") : value), "utf8"), 0);
143
+ if (bytes > 9 * 1024 * 1024)
144
+ throw new RangeError("Agent history group exceeds the Datastore transaction payload limit.");
55
145
  }
56
146
  /**
57
147
  * Writes one original entry or confirms byte-identical content.
@@ -87,9 +177,7 @@ export class DatastoreAgentHistory {
87
177
  return AgentHistoryPages.read(request, after, (cursor, limit) => this.fetch(agentKey, request, cursor, limit));
88
178
  }
89
179
  /**
90
-
91
180
  * Closes this handle without deleting stored records.
92
-
93
181
  */
94
182
  close() {
95
183
  if (!this.#open)
@@ -195,9 +283,7 @@ export class DatastoreAgentHistory {
195
283
  return key;
196
284
  }
197
285
  /**
198
-
199
286
  * Rejects calls after this handle closes.
200
-
201
287
  */
202
288
  requireOpen() {
203
289
  if (!this.#open)
@@ -1 +1 @@
1
- {"version":3,"file":"agent-history.js","sourceRoot":"","sources":["../../src/datastore/agent-history.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6EAA6E,CAAC;AAGvH,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OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAKrC;;GAEG;AACH,qBAAa,sBAAuB,YAAW,aAAa,CAAC,OAAO,CAAC;;IAGnE;;;;OAIG;gBACS,YAAY,GAAE,mBAA+C;IAIzE;;;;;;OAMG;IACH,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,OAAO,CAAC;IAkB/D;;;;OAIG;IACH,MAAM,IAAI,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC;CAG3C"}
1
+ {"version":3,"file":"column-mapping.d.ts","sourceRoot":"","sources":["../../src/datastore/column-mapping.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA8B,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAKrC;;GAEG;AACH,qBAAa,sBAAuB,YAAW,aAAa,CAAC,OAAO,CAAC;;IAGnE;;;;OAIG;gBACS,YAAY,GAAE,mBAAgD;IAO1E;;;;;;OAMG;IACH,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,OAAO,CAAC;IAkB/D;;;;OAIG;IACH,MAAM,IAAI,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC;CAG3C"}
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { ScalarType } from "@bufbuild/protobuf";
15
15
  import { Datastore } from "@google-cloud/datastore";
16
- import { StringifierRegistry } from "@spine-event-engine/core";
16
+ import { defaultStringifierRegistry, StringifierRegistry } from "@spine-event-engine/core";
17
17
  const timestampType = "google.protobuf.Timestamp";
18
18
  const versionType = "spine.core.Version";
19
19
  /**
@@ -26,8 +26,11 @@ export class DatastoreColumnMapping {
26
26
  *
27
27
  * @param stringifiers The schema-bound message stringifiers.
28
28
  */
29
- constructor(stringifiers = new StringifierRegistry()) {
30
- this.#stringifiers = new StringifierRegistry(stringifiers);
29
+ constructor(stringifiers = defaultStringifierRegistry) {
30
+ this.#stringifiers =
31
+ stringifiers === defaultStringifierRegistry
32
+ ? stringifiers
33
+ : new StringifierRegistry(stringifiers);
31
34
  }
32
35
  /**
33
36
  * Returns the conversion for one generated column type.
@@ -1 +1 @@
1
- {"version":3,"file":"column-mapping.js","sourceRoot":"","sources":["../../src/datastore/column-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAgB,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAO/D,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAClD,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEzC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACxB,aAAa,CAAsB;IAE5C;;;;OAIG;IACH,YAAY,eAAoC,IAAI,mBAAmB,EAAE;QACvE,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,EAAE,CAAI,IAAyB;QAC7B,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,QAAQ;gBACX,OAAO,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/C,KAAK,MAAM;gBACT,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACjD,KAAK,SAAS;gBACZ,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,a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