@spine-event-engine/storage 2.0.0-snapshot.24 → 2.0.0-snapshot.26

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 (100) hide show
  1. package/README.md +12 -3
  2. package/REFERENCE.md +76 -68
  3. package/dist/entity/agent-history-record-spec.d.ts +8 -0
  4. package/dist/entity/agent-history-record-spec.d.ts.map +1 -1
  5. package/dist/entity/agent-history-record-spec.js +12 -1
  6. package/dist/entity/agent-history-record-spec.js.map +1 -1
  7. package/dist/entity/agent-history.d.ts +25 -0
  8. package/dist/entity/agent-history.d.ts.map +1 -1
  9. package/dist/entity/agent-history.js.map +1 -1
  10. package/dist/entity/history-conformance.d.ts +38 -8
  11. package/dist/entity/history-conformance.d.ts.map +1 -1
  12. package/dist/entity/history-conformance.js +103 -58
  13. package/dist/entity/history-conformance.js.map +1 -1
  14. package/dist/event/event-store.d.ts +51 -3
  15. package/dist/event/event-store.d.ts.map +1 -1
  16. package/dist/event/event-store.js +171 -27
  17. package/dist/event/event-store.js.map +1 -1
  18. package/dist/internal/agent-model-preferences.d.ts +76 -0
  19. package/dist/internal/agent-model-preferences.d.ts.map +1 -0
  20. package/dist/internal/agent-model-preferences.js +133 -0
  21. package/dist/internal/agent-model-preferences.js.map +1 -0
  22. package/dist/internal/entity-commit.d.ts +64 -8
  23. package/dist/internal/entity-commit.d.ts.map +1 -1
  24. package/dist/internal/entity-commit.js.map +1 -1
  25. package/dist/internal/entity-history.d.ts +1 -7
  26. package/dist/internal/entity-history.d.ts.map +1 -1
  27. package/dist/internal/entity-history.js +0 -5
  28. package/dist/internal/entity-history.js.map +1 -1
  29. package/dist/internal/event-store.d.ts +1 -1
  30. package/dist/internal/event-store.d.ts.map +1 -1
  31. package/dist/internal/event-store.js +1 -1
  32. package/dist/internal/event-store.js.map +1 -1
  33. package/dist/internal/storage-preparation.d.ts +88 -0
  34. package/dist/internal/storage-preparation.d.ts.map +1 -0
  35. package/dist/internal/storage-preparation.js +41 -0
  36. package/dist/internal/storage-preparation.js.map +1 -0
  37. package/dist/internal/tenancy.d.ts +7 -0
  38. package/dist/internal/tenancy.d.ts.map +1 -1
  39. package/dist/memory/in-memory-agent-history.d.ts.map +1 -1
  40. package/dist/memory/in-memory-agent-history.js +22 -7
  41. package/dist/memory/in-memory-agent-history.js.map +1 -1
  42. package/dist/memory/in-memory-entity-commit.d.ts +154 -21
  43. package/dist/memory/in-memory-entity-commit.d.ts.map +1 -1
  44. package/dist/memory/in-memory-entity-commit.js +396 -60
  45. package/dist/memory/in-memory-entity-commit.js.map +1 -1
  46. package/dist/memory/in-memory-entity-history.d.ts.map +1 -1
  47. package/dist/memory/in-memory-entity-history.js +4 -3
  48. package/dist/memory/in-memory-entity-history.js.map +1 -1
  49. package/dist/memory/in-memory-storage-backend.d.ts +33 -1
  50. package/dist/memory/in-memory-storage-backend.d.ts.map +1 -1
  51. package/dist/memory/in-memory-storage-backend.js +118 -1
  52. package/dist/memory/in-memory-storage-backend.js.map +1 -1
  53. package/dist/memory/in-memory-storage-factory.d.ts +71 -12
  54. package/dist/memory/in-memory-storage-factory.d.ts.map +1 -1
  55. package/dist/memory/in-memory-storage-factory.js +199 -25
  56. package/dist/memory/in-memory-storage-factory.js.map +1 -1
  57. package/dist/provider.d.ts +2 -0
  58. package/dist/provider.d.ts.map +1 -1
  59. package/dist/provider.js +2 -0
  60. package/dist/provider.js.map +1 -1
  61. package/dist/storage/storage-factory.d.ts +27 -4
  62. package/dist/storage/storage-factory.d.ts.map +1 -1
  63. package/dist/storage/storage-factory.js +30 -1
  64. package/dist/storage/storage-factory.js.map +1 -1
  65. package/dist/storage/storage.d.ts +2 -1
  66. package/dist/storage/storage.d.ts.map +1 -1
  67. package/dist/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +3 -3
  69. package/dist/entity/agent-execution-record-spec.d.ts +0 -87
  70. package/dist/entity/agent-execution-record-spec.d.ts.map +0 -1
  71. package/dist/entity/agent-execution-record-spec.js +0 -230
  72. package/dist/entity/agent-execution-record-spec.js.map +0 -1
  73. package/dist/entity/agent-execution-sizes.d.ts +0 -30
  74. package/dist/entity/agent-execution-sizes.d.ts.map +0 -1
  75. package/dist/entity/agent-execution-sizes.js +0 -51
  76. package/dist/entity/agent-execution-sizes.js.map +0 -1
  77. package/dist/entity/agent-execution-transitions.d.ts +0 -72
  78. package/dist/entity/agent-execution-transitions.d.ts.map +0 -1
  79. package/dist/entity/agent-execution-transitions.js +0 -165
  80. package/dist/entity/agent-execution-transitions.js.map +0 -1
  81. package/dist/entity/agent-execution-values.d.ts +0 -143
  82. package/dist/entity/agent-execution-values.d.ts.map +0 -1
  83. package/dist/entity/agent-execution-values.js +0 -251
  84. package/dist/entity/agent-execution-values.js.map +0 -1
  85. package/dist/entity/agent-execution.d.ts +0 -235
  86. package/dist/entity/agent-execution.d.ts.map +0 -1
  87. package/dist/entity/agent-execution.js +0 -15
  88. package/dist/entity/agent-execution.js.map +0 -1
  89. package/dist/internal/agent-execution.d.ts +0 -51
  90. package/dist/internal/agent-execution.d.ts.map +0 -1
  91. package/dist/internal/agent-execution.js +0 -53
  92. package/dist/internal/agent-execution.js.map +0 -1
  93. package/dist/memory/agent-execution-head-index.d.ts +0 -52
  94. package/dist/memory/agent-execution-head-index.d.ts.map +0 -1
  95. package/dist/memory/agent-execution-head-index.js +0 -91
  96. package/dist/memory/agent-execution-head-index.js.map +0 -1
  97. package/dist/memory/in-memory-agent-execution.d.ts +0 -21
  98. package/dist/memory/in-memory-agent-execution.d.ts.map +0 -1
  99. package/dist/memory/in-memory-agent-execution.js +0 -587
  100. package/dist/memory/in-memory-agent-execution.js.map +0 -1
package/README.md CHANGED
@@ -1,13 +1,17 @@
1
1
  # Storage API and in-memory 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` defines the storage API used by Spine TS and
4
7
  includes an in-memory implementation for local development and tests. Use it
5
8
  when an application needs a small record store, or when an adapter needs to
6
9
  implement the same storage contract for a durable provider.
7
10
 
8
- Agents use the configured storage provider to retain accepted work and the
9
- recorded model interaction. The in-memory factory keeps these records only while
10
- the process runs; choose a database provider when they must survive a restart.
11
+ Agents use the configured storage provider to retain typed admission receipts,
12
+ Entity state, and recorded model interactions. The in-memory factory keeps
13
+ these records only while the process runs; choose a database provider when the
14
+ records must survive a restart. An interrupted handler does not resume from them.
11
15
  Applications read an Agent's history through its repository, as shown in the
12
16
  [support example](https://github.com/SpineEventEngine/spine-ts/blob/master/examples/support/README.md). Adapter implementation
13
17
  details are in the [coding-agent reference](REFERENCE.md#provider-spi).
@@ -128,6 +132,11 @@ to filter names and values: MySQL checks declared columns, while other adapters
128
132
  can support different query shapes. A provider can push down supported ID and
129
133
  declared-column query parts while preserving the common result semantics.
130
134
 
135
+ `await factory.checkConnection()` checks the configured shared destination. The
136
+ in-memory factory validates this locally without admitting a tenant or creating
137
+ records. Other adapters must implement the diagnostic explicitly; the base
138
+ factory rejects an unsupported check.
139
+
131
140
  The storage API clones data at its boundaries. For the base factory and the
132
141
  in-memory implementation, closing a factory prevents new record handles while
133
142
  existing handles remain usable. Closing a record handle invalidates that
package/REFERENCE.md CHANGED
@@ -19,6 +19,22 @@ history and Entity commit contracts, query values, tenant boundaries/catalogs,
19
19
  and record access. The storage root intentionally does not export
20
20
  these provider seams; application code uses its root storage contracts instead.
21
21
 
22
+ `StorageFactory.close()` synchronously rejects new handles and returns a Promise
23
+ for admitted provider work and cleanup. Await it to observe cleanup failures;
24
+ repeated calls return the same completion. Provider-only Entity commit handles
25
+ also await admitted commits before releasing retained records. Ordinary
26
+ `RecordStorage.close()` remains synchronous.
27
+
28
+ `StorageFactory.checkConnection()` is a public read-only diagnostic for the
29
+ configured shared destination. The base factory rejects unsupported checks and
30
+ closed factories reject them. The memory factory succeeds locally while open;
31
+ this does not admit a tenant or create records. For model preparation, provider
32
+ adapters register through the provider-only `StoragePreparations` registry. Its `prepareRecord`,
33
+ `prepareEntity`, and `prepareAgentHistory` methods accept declarative definitions
34
+ and a `"create"` or `"check"` mode without constructing Storage. Memory validates
35
+ record-family layouts and the Agent audit tenant boundary and state type locally. An unregistered provider
36
+ rejects preparation rather than reporting success.
37
+
22
38
  The provider entry point also exports `AgentHistoryStorage`,
23
39
  `AgentHistoryStorageFactories`, `AgentHistoryKeys`, and
24
40
  `AgentHistoryConformance`. Calling `AgentHistoryStorageFactories.create()` to
@@ -68,65 +84,40 @@ still have more candidates. Continue until `hasMore` is false, rather than
68
84
  stopping at the first empty page. Repeating a valid continuation may repeat the
69
85
  page. A fresh sweep starts without a continuation.
70
86
 
71
- Memory pages use an admission-time index and capture its length for that sweep;
87
+ Memory pages use an explicit-registration index and capture its length for that sweep;
72
88
  PostgreSQL and MySQL page their configured tenant collections. Datastore pages
73
- its bounded early-admission cache and then native namespace metadata using a
74
- query limit and native cursor. A tenant can appear in both phases. Existing
75
- Agent claims prevent that duplicate discovery from running the same accepted
76
- invocation concurrently. An empty native `MORE_RESULTS_AFTER_LIMIT` tail that repeats its cursor ends
89
+ native namespace metadata using a query limit and native cursor. An empty native
90
+ `MORE_RESULTS_AFTER_LIMIT` tail that repeats its cursor ends
77
91
  that sweep; other continuing pages must advance. Datastore destroys its query
78
92
  stream when the caller cancels the read.
79
93
 
80
94
  Catalogs check cancellation before starting work and before returning a result.
81
95
  Paging is a finite traversal, not an atomic catalog snapshot: a concurrent
82
- admission can appear in the current or next sweep. Agent recovery uses this
83
- paged contract; the separate `all()` operation remains available for existing
84
- callers that require the complete catalog.
85
-
86
- ## Agent execution storage
87
-
88
- `AgentExecutionStorageFactories` opens the provider-only execution handle for an
89
- Agent repository and tenant. `supports()` checks factory registration without
90
- opening a tenant. It does not replace the provider checks made when admitting
91
- work. Application code configures a storage factory; it does not claim or poll
92
- these records directly.
93
-
94
- The handle's `capacity` reports encoded execution, per-instance and history-record
95
- limits plus a transaction payload limit where the provider enforces one.
96
- `AgentExecutionSizes` measures the full internal Protobuf wrappers, including
97
- scope and metadata. The runtime must allow for the bounded response and complete
98
- record overhead before dispatch; a payload limit is not a history retention rule.
99
-
100
- `admit()` stores the original signal, typed recipient and selected handlers once.
101
- `claim()` permits one execution at a time for an Agent instance. `renew()`,
102
- `update()`, `complete()` and `markDelivered()` check the current claim token.
103
- Updates also compare the exact previously read record. Completion compares the
104
- initial Entity Version and stores the Entity changes, mandatory histories, model
105
- preferences and original outgoing Command obligations in one provider operation. Emitted
106
- domain Events are retained in immutable Agent history and handed to the normal
107
- EventBus after completion; they are not saved delivery obligations. This includes
108
- handlers that change no state or produce only a Command.
109
-
110
- Pending queries read one pending invocation per Agent instance from an index. A page
111
- carries its original time cutoff and the provider-observed continuation, so the
112
- caller can continue even when another execution claims a returned invocation.
113
- These internal pages are separate from application history pages. Eligibility
114
- and claim expiry use Spine `Time`; original Inbox order determines which signal
115
- runs next within an instance.
116
-
117
- Each saved outgoing Command can receive one dispatch plan before transport
118
- begins. The plan and original Command envelope cannot be replaced.
119
- `markDelivered()` requires that plan and a current claim. Command retries must
120
- still visit every saved recipient; these records do not make downstream
121
- application callbacks execute exactly once. Independently, the framework's
122
- internal EventStore retry operation accepts an identical existing envelope;
123
- ordinary public EventStore append still rejects duplicate IDs. EventStore
124
- history is not an Agent Event delivery queue.
125
-
126
- The memory implementation coordinates changes only within a shared in-process
127
- backend. PostgreSQL, transactional MySQL and Datastore use native transactions.
128
- Database query, index and payload requirements are documented in each provider's
129
- reference. No execution-storage operation trims the Agent's history.
96
+ registration can appear in the current or next sweep. The separate `all()`
97
+ operation remains available to callers requiring the complete catalog.
98
+
99
+ ## Agent live persistence and history
100
+
101
+ Providers retain indexed Agent history separately from Entity state. The
102
+ provider-only `AgentHistoryStorage.appendAll()` commits one immutable audit
103
+ batch; reads use the same scoped indexes and finite cursors as individual
104
+ appends. A complete System audit group is saved before its original Event is
105
+ published. Its failure remains observable and does not create a replacement
106
+ application Event.
107
+
108
+ A typed receipt records live admission without a replayable execution record.
109
+ `EntityCommitStorage.commitAgent()` atomically compares an exact Entity image
110
+ and model preferences, then writes the accepted state, preference and history
111
+ changes. An unchanged-state or preference-only turn can succeed without
112
+ increasing the Entity Version. Failed comparisons write no prefix. The ordinary
113
+ `commit()` contract below remains separate and can retain prefix writes after
114
+ an error. Built-in providers implement the live Agent operation with their
115
+ native transaction semantics; custom providers must explicitly support it.
116
+
117
+ Memory coordinates these changes within a shared in-process backend;
118
+ PostgreSQL, transactional MySQL/MariaDB, and Datastore use their native atomic
119
+ storage operations. Closing a factory drains admitted work before releasing
120
+ retained private handles.
130
121
 
131
122
  ## Record storage
132
123
 
@@ -197,14 +188,17 @@ that stated overlap. See each provider reference for mappings and index needs.
197
188
 
198
189
  ## Lifecycle
199
190
 
200
- The base `StorageFactory.close()` prevents later record-storage creation. The
201
- in-memory factory follows that behavior and leaves existing record handles open
202
- until each handle closes. `RecordStorage.close()` rejects that handle's later
203
- operations. Datastore follows the base factory behavior. Adapters can define a
204
- stronger shutdown lifecycle: the MySQL factory closes live handles while it
205
- drains its pool. Read the [Datastore reference](../storage-datastore/REFERENCE.md)
206
- and [MySQL reference](../storage-mysql/REFERENCE.md) or [PostgreSQL reference](../storage-postgres/REFERENCE.md) before relying on shutdown
207
- behavior. The in-memory backend is ephemeral and process-local. Passing one
191
+ `StorageFactory.close()` fences new storage creation immediately and returns a
192
+ promise that settles after its retained commit work and provider resources close.
193
+ The in-memory factory drains retained commits and closes its tenant catalog;
194
+ independent record handles remain open until their own synchronous
195
+ `RecordStorage.close()`. PostgreSQL and MySQL also close their live record
196
+ handles and connection pools. Datastore closes retained Entity bundles and its
197
+ tenant catalog. Cleanup failures reject the factory close promise. Read the
198
+ [Datastore reference](../storage-datastore/REFERENCE.md),
199
+ [MySQL reference](../storage-mysql/REFERENCE.md), and
200
+ [PostgreSQL reference](../storage-postgres/REFERENCE.md) for provider details.
201
+ The in-memory backend is ephemeral and process-local. Passing one
208
202
  `InMemoryStorageBackend` to multiple in-memory factories deliberately shares
209
203
  its scoped rows.
210
204
 
@@ -229,6 +223,14 @@ runs its callback, then inserts with an atomic absent-slot condition. Competing
229
223
  callbacks may both run and may each have effects, but at most one Event is stored.
230
224
  The framework EventBus dispatches only after strict insertion succeeds.
231
225
 
226
+ An `EventStore` retains its RecordStorage objects for reuse by the corresponding
227
+ tenants. Always await `eventStore.close()` before closing its factory. Closing
228
+ rejects new storage operations, waits for an already admitted query or insertion
229
+ batch to settle, and then closes every retained store. It leaves the factory open;
230
+ cleanup failures reject the close promise. Repeated calls return the same outcome.
231
+ The callback in `acceptThenAppend()` runs between storage operations: closing from
232
+ that callback completes, and the later insertion rejects because the store is closed.
233
+
232
234
  History ports are lazy. When a history is disabled, the in-memory provider does
233
235
  not open or allocate its grouped records. Current Entity loading always uses
234
236
  the current record, never retained history. Event history is diagnostic data,
@@ -243,10 +245,16 @@ record layouts are unchanged.
243
245
 
244
246
  The built-in providers capture prepared input before I/O and write state history,
245
247
  diagnostic Events, delivery Events, then current state as independent records.
246
- SQL and Datastore providers automatically retry one classified transient Entity
247
- persistence failure using that captured input. In memory, a caller retry must
248
- reuse the same versions and Event IDs without rerunning the handler. A later
249
- failure leaves completed writes in place. The presence of a delivery Event
250
- alone does not prove the entire Entity save completed. Concurrent saves may
251
- interleave, including current-state writes. Automatic Entity versions,
252
- single-record atomic compare-and-set, and immutable-record checks remain.
248
+ For ordinary Entity `commit()`, SQL and Datastore providers automatically retry
249
+ one classified transient persistence failure using the captured input. In
250
+ memory, a caller retry must reuse the same versions and Event IDs without
251
+ rerunning the handler. A later failure leaves completed writes in place. The
252
+ presence of a delivery Event alone does not prove the entire Entity save
253
+ completed. Concurrent ordinary saves may interleave, including current-state
254
+ writes. Automatic Entity versions, single-record atomic compare-and-set, and
255
+ immutable-record checks remain.
256
+
257
+ The provider-only `commitAgent()` instead checks the initial Entity version and
258
+ complete model-preference image, then atomically commits any changed Entity
259
+ record, final Agent audit, and replacement preferences. It also checks the
260
+ initial Entity version when the turn has no state change.
@@ -20,6 +20,14 @@ interface AgentHistoryRecordLayout {
20
20
  * @returns Internal storage envelope.
21
21
  */
22
22
  record(stateType: string, agentKey: string, entry: AgentHistoryEntry): AgentHistoryRecord;
23
+ /**
24
+ * Calculates one complete persisted Agent audit envelope.
25
+ * @param stateType Generated Agent state type.
26
+ * @param agentKey Canonical Agent identifier.
27
+ * @param entry Original typed audit entry.
28
+ * @returns Full encoded AgentHistoryRecord bytes.
29
+ */
30
+ bytes(stateType: string, agentKey: string, entry: AgentHistoryEntry): number;
23
31
  /**
24
32
  * Encodes the immutable logical record identity.
25
33
  *
@@ -1 +1 @@
1
- {"version":3,"file":"agent-history-record-spec.d.ts","sourceRoot":"","sources":["../../src/entity/agent-history-record-spec.ts"],"names":[],"mappings":"AAeA,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,6EAA6E,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAQ1D;;GAEG;AACH,UAAU,wBAAwB;IAChC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAE7B;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IAE1F;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAEzC;;;;;;OAMG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAEnD;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,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AAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAE7E;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAEzC;;;;;;OAMG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAEnD;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAEhF;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEpF;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,CAAC;IAE7D;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,YAAY,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAEpF;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,YAAY,CAAC,kBAAkB,CAAC,EAAE,CAAC;CACrF;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,wBAkKjC,CAAC"}
@@ -11,7 +11,7 @@
11
11
  * or implied. See the License for the specific language governing permissions and limitations under
12
12
  * the License.
13
13
  */
14
- import { create, ScalarType } from "@bufbuild/protobuf";
14
+ import { create, ScalarType, toBinary } from "@bufbuild/protobuf";
15
15
  import { AgentHistoryEntrySchema } from "@spine-event-engine/proto/agent";
16
16
  import { AgentHistoryRecordSchema, AgentHistoryStorageKeySchema as AgentStorageKeySchema, } from "@spine-event-engine/proto/generated/spine/server/agent/history_record_pb.js";
17
17
  import { RecordColumn } from "../record/record-column.js";
@@ -48,6 +48,17 @@ export const AgentHistoryRecords = {
48
48
  entry,
49
49
  });
50
50
  },
51
+ /**
52
+ * Calculates the byte size of a complete stored row including its scope and original entry.
53
+ *
54
+ * @param stateType Declared Agent state type.
55
+ * @param agentKey Canonical typed Agent identifier key.
56
+ * @param entry Complete original audit entry.
57
+ * @returns Serialized byte count of the full stored history row.
58
+ */
59
+ bytes(stateType, agentKey, entry) {
60
+ return toBinary(AgentHistoryRecordSchema, this.record(stateType, agentKey, entry)).length;
61
+ },
51
62
  /**
52
63
  * Builds the full logical identity hashed into a provider physical ID.
53
64
  *
@@ -1 +1 @@
1
- {"version":3,"file":"agent-history-record-spec.js","sourceRoot":"","sources":["../../src/entity/agent-history-record-spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAA0B,MAAM,iCAAiC,CAAC;AAClG,OAAO,EACL,wBAAwB,EACxB,4BAA4B,IAAI,qBAAqB,GAEtD,MAAM,6EAA6E,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,iBAAiB,GAAiB,IAAI,YAAY,CAAC,eAAe,CAAC,CAAC;AA+E1E;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA6B;IAC3D;;OAEG;IACH,KAAK,EAAE,iBAAiB;IAExB;;;;;;;OAOG;IACH,MAAM,CAAC,SAAiB,EAAE,QAAgB,EAAE,KAAwB;QAClE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,C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EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;YACzF,IAAI,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAC/C,gBAAgB,CAAC,UAAU,CACzB,gBAAgB,CAAC,SAAS,CAAC,mBAAmB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CACtE,CACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -135,12 +135,29 @@ export interface AgentHistoryPage {
135
135
  */
136
136
  readonly hasMore: boolean;
137
137
  }
138
+ /**
139
+ * Provider bounds for complete stored Agent audit rows and one atomic group.
140
+ */
141
+ export interface AgentHistoryCapacity {
142
+ /**
143
+ * Maximum encoded AgentHistoryRecord bytes, when the provider imposes one.
144
+ */
145
+ readonly historyRecordBytes?: number;
146
+ /**
147
+ * Maximum native transaction payload bytes, when the provider imposes one.
148
+ */
149
+ readonly transactionPayloadBytes?: number;
150
+ }
138
151
  /**
139
152
  * Provider handle for one repository state type and tenant boundary.
140
153
  *
141
154
  * @typeParam Id Typed Agent identifier.
142
155
  */
143
156
  export interface AgentHistoryStorage<Id> {
157
+ /**
158
+ * Physical bounds used to preflight live Agent audit writes.
159
+ */
160
+ readonly capacity: AgentHistoryCapacity;
144
161
  /**
145
162
  * Adds one immutable occurrence, or accepts an identical repeated append.
146
163
  *
@@ -149,6 +166,14 @@ export interface AgentHistoryStorage<Id> {
149
166
  * @returns Resolves after the occurrence is recorded.
150
167
  */
151
168
  append(entityId: Id, entry: AgentHistoryEntry): Promise<void>;
169
+ /**
170
+ * Writes atomically adds one immutable group of conversation and System audit rows.
171
+ *
172
+ * @param entityId Typed Agent identifier.
173
+ * @param entries Complete rows, or an empty no-op group.
174
+ * @returns Completion after all rows and indexes are committed together.
175
+ */
176
+ appendAll(entityId: Id, entries: readonly AgentHistoryEntry[]): Promise<void>;
152
177
  /**
153
178
  * Reads a bounded live continuation from one indexed view.
154
179
  *
@@ -1 +1 @@
1
- {"version":3,"file":"agent-history.d.ts","sourceRoot":"","sources":["../../src/entity/agent-history.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;GAIG;AACH,UAAU,mBAAmB,CAAC,EAAE;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAExD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,oBAAoB,GACpB,4BAA4B,GAC5B,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B;;GAEG;AACH,UAAU,oBAAoB;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,UAAU,4BAA4B;IACpC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC;CACvC;AAED;;GAEG;AACH,UAAU,sBAAsB;IAC9B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED;;GAEG;AACH,UAAU,sBAAsB;IAC9B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED;;;;GAI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C/F,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,KAAgB;QACxB,IACE,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;YACjC,KAAK,CAAC,OAAO,GAAG,UAAU;YAC1B,KAAK,CAAC,OAAO,GAAG,UAAU;YAE1B,MAAM,IAAI,UAAU,CAAC,iEAAiE,CAAC,CAAC;QAC1F,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,SAAS;YAC9E,MAAM,IAAI,UAAU,CAAC,qEAAqE,CAAC,CAAC;IAChG,CAAC;CACF,CAAC,CAAC"}
@@ -1,10 +1,12 @@
1
1
  import { type Message } from "@bufbuild/protobuf";
2
- import { type StringValue } from "@bufbuild/protobuf/wkt";
2
+ import type { GenMessage } from "@bufbuild/protobuf/codegenv2";
3
3
  import type { EntityEventHistoryPort, EntityStateHistoryPort } from "./entity-history-storage.js";
4
4
  import type { EntityRecordStorage } from "./entity-record.js";
5
5
  import type { EntityStorageInput } from "../memory/in-memory-entity-history.js";
6
6
  /**
7
7
  * Provides the current-record and state-history handles used by adapter conformance checks.
8
+ * @typeParam I Entity identifier type.
9
+ * @typeParam S Generated Entity state type.
8
10
  */
9
11
  export interface EntityStorageConformance<I, S extends Message> {
10
12
  /**
@@ -26,26 +28,54 @@ export interface EntityStorageConformance<I, S extends Message> {
26
28
  }
27
29
  /**
28
30
  * Creates a provider handle for the reusable current-record and state-history checks.
31
+ * @typeParam S Generated Entity state type.
29
32
  */
30
- export interface EntityHistoryConformanceAdapter {
33
+ export interface EntityHistoryConformanceAdapter<S extends Message> {
34
+ /**
35
+ * Generated descriptor for the test Entity state.
36
+ */
37
+ readonly stateSchema: GenMessage<S>;
38
+ /**
39
+ * Creates one domain-correct Entity state fixture.
40
+ * @param id Entity identifier.
41
+ * @param value State title.
42
+ * @returns Generated Entity state.
43
+ */
44
+ state(id: string, value: string): S;
45
+ /**
46
+ * Reads the title used in conformance assertions.
47
+ * @param state Generated Entity state.
48
+ * @returns State title.
49
+ */
50
+ value(state: S): string;
31
51
  /**
32
52
  * Creates storage for the supplied Entity shape.
33
- *
34
53
  * @param input Defines the Entity storage scope and schemas.
35
54
  * @returns The provider handle.
36
55
  */
37
- readonly create: (input: EntityStorageInput<string, StringValue>) => EntityStorageConformance<string, StringValue>;
56
+ create(input: EntityStorageInput<string, S>): EntityStorageConformance<string, S>;
38
57
  /**
39
58
  * Creates a reopened handle for the same Entity shape.
40
- *
41
59
  * @param input Defines the Entity storage scope and schemas.
42
60
  * @returns The reopened provider handle.
43
61
  */
44
- readonly reopen: (input: EntityStorageInput<string, StringValue>) => EntityStorageConformance<string, StringValue>;
62
+ reopen(input: EntityStorageInput<string, S>): EntityStorageConformance<string, S>;
45
63
  }
46
64
  interface EntityHistoryConformanceChecks {
47
- readonly checkCurrentQueries: (adapter: EntityHistoryConformanceAdapter) => Promise<void>;
48
- readonly check: (adapter: EntityHistoryConformanceAdapter) => Promise<void>;
65
+ /**
66
+ * Checks current-record querying with the supplied generated state.
67
+ * @typeParam S Generated Entity state type.
68
+ * @param adapter Provider and state fixture.
69
+ * @returns Completion after current-record assertions.
70
+ */
71
+ checkCurrentQueries<S extends Message>(adapter: EntityHistoryConformanceAdapter<S>): Promise<void>;
72
+ /**
73
+ * Checks current-record and state-history behavior.
74
+ * @typeParam S Generated Entity state type.
75
+ * @param adapter Provider and state fixture.
76
+ * @returns Completion after conformance assertions.
77
+ */
78
+ check<S extends Message>(adapter: EntityHistoryConformanceAdapter<S>): Promise<void>;
49
79
  }
50
80
  /**
51
81
  * Runs provider-neutral current-record and generated state-history checks.
@@ -1 +1 @@
1
- {"version":3,"file":"history-conformance.d.ts","sourceRoot":"","sources":["../../src/entity/history-conformance.ts"],"names":[],"mappings":"AAcA,OAAO,EAA4C,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAKL,KAAK,W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