@spine-event-engine/storage 2.0.0-snapshot.23 → 2.0.0-snapshot.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/REFERENCE.md +32 -13
- package/dist/entity/agent-execution-transitions.d.ts +14 -13
- package/dist/entity/agent-execution-transitions.d.ts.map +1 -1
- package/dist/entity/agent-execution-transitions.js +20 -37
- package/dist/entity/agent-execution-transitions.js.map +1 -1
- package/dist/entity/agent-execution-values.d.ts +4 -3
- package/dist/entity/agent-execution-values.d.ts.map +1 -1
- package/dist/entity/agent-execution-values.js +13 -12
- package/dist/entity/agent-execution-values.js.map +1 -1
- package/dist/entity/agent-execution.d.ts +6 -5
- package/dist/entity/agent-execution.d.ts.map +1 -1
- package/dist/event/event-store.d.ts +30 -72
- package/dist/event/event-store.d.ts.map +1 -1
- package/dist/event/event-store.js +124 -268
- package/dist/event/event-store.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/entity-commit.d.ts +30 -11
- package/dist/internal/entity-commit.d.ts.map +1 -1
- package/dist/internal/entity-commit.js +45 -2
- package/dist/internal/entity-commit.js.map +1 -1
- package/dist/internal/event-store.d.ts +1 -1
- package/dist/internal/event-store.d.ts.map +1 -1
- package/dist/internal/event-store.js +1 -1
- package/dist/internal/event-store.js.map +1 -1
- package/dist/memory/in-memory-agent-execution.d.ts.map +1 -1
- package/dist/memory/in-memory-agent-execution.js +3 -3
- package/dist/memory/in-memory-agent-execution.js.map +1 -1
- package/dist/memory/in-memory-entity-commit.d.ts +100 -38
- package/dist/memory/in-memory-entity-commit.d.ts.map +1 -1
- package/dist/memory/in-memory-entity-commit.js +191 -323
- package/dist/memory/in-memory-entity-commit.js.map +1 -1
- package/dist/memory/in-memory-storage-factory.d.ts +1 -1
- package/dist/memory/in-memory-storage-factory.d.ts.map +1 -1
- package/dist/memory/in-memory-storage-factory.js +2 -7
- package/dist/memory/in-memory-storage-factory.js.map +1 -1
- package/dist/memory/tenant-records.d.ts +1 -1
- package/dist/memory/tenant-records.d.ts.map +1 -1
- package/dist/memory/tenant-records.js +3 -2
- package/dist/memory/tenant-records.js.map +1 -1
- package/dist/provider.d.ts +0 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +0 -1
- package/dist/provider.js.map +1 -1
- package/dist/record/record-query.d.ts +10 -2
- package/dist/record/record-query.d.ts.map +1 -1
- package/dist/record/record-query.js +9 -0
- package/dist/record/record-query.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/internal/delivery-cleanup.d.ts +0 -99
- package/dist/internal/delivery-cleanup.d.ts.map +0 -1
- package/dist/internal/delivery-cleanup.js +0 -38
- package/dist/internal/delivery-cleanup.js.map +0 -1
- package/dist/memory/memory-delivery-cleanup.d.ts +0 -32
- package/dist/memory/memory-delivery-cleanup.d.ts.map +0 -1
- package/dist/memory/memory-delivery-cleanup.js +0 -61
- package/dist/memory/memory-delivery-cleanup.js.map +0 -1
package/REFERENCE.md
CHANGED
|
@@ -16,7 +16,7 @@ types, and entity history interfaces.
|
|
|
16
16
|
Storage-adapter implementers import the complete provider-only contract set from
|
|
17
17
|
`@spine-event-engine/storage/provider`: Event Store record access, Entity
|
|
18
18
|
history and Entity commit contracts, query values, tenant boundaries/catalogs,
|
|
19
|
-
and
|
|
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
22
|
The provider entry point also exports `AgentHistoryStorage`,
|
|
@@ -102,7 +102,9 @@ record overhead before dispatch; a payload limit is not a history retention rule
|
|
|
102
102
|
`update()`, `complete()` and `markDelivered()` check the current claim token.
|
|
103
103
|
Updates also compare the exact previously read record. Completion compares the
|
|
104
104
|
initial Entity Version and stores the Entity changes, mandatory histories, model
|
|
105
|
-
preferences and original outgoing
|
|
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
|
|
106
108
|
handlers that change no state or produce only a Command.
|
|
107
109
|
|
|
108
110
|
Pending queries read one pending invocation per Agent instance from an index. A page
|
|
@@ -112,12 +114,14 @@ These internal pages are separate from application history pages. Eligibility
|
|
|
112
114
|
and claim expiry use Spine `Time`; original Inbox order determines which signal
|
|
113
115
|
runs next within an instance.
|
|
114
116
|
|
|
115
|
-
Each saved
|
|
116
|
-
plan and original envelope cannot be replaced.
|
|
117
|
-
plan and a current claim.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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.
|
|
121
125
|
|
|
122
126
|
The memory implementation coordinates changes only within a shared in-process
|
|
123
127
|
backend. PostgreSQL, transactional MySQL and Datastore use native transactions.
|
|
@@ -214,6 +218,17 @@ history stores generated `EventId`/`Event` rows in that same state-type-named
|
|
|
214
218
|
group. The framework Event Store is a separate, ungrouped `EventId`/`Event`
|
|
215
219
|
record family.
|
|
216
220
|
|
|
221
|
+
`EventStore.append()` and `appendAll()` store immutable complete Events. An
|
|
222
|
+
identical Event ID and envelope is a successful retry without rewriting; a
|
|
223
|
+
conflicting envelope is rejected. Batch append validates the supplied IDs and
|
|
224
|
+
tenant before writing, then leaves any completed prefix when a later write
|
|
225
|
+
fails. Retrying the same input continues with those IDs. `accept()` and
|
|
226
|
+
`acceptThenAppend()` are strict new-admission operations: an existing ID is
|
|
227
|
+
rejected even when its Event is identical. `acceptThenAppend()` checks absence,
|
|
228
|
+
runs its callback, then inserts with an atomic absent-slot condition. Competing
|
|
229
|
+
callbacks may both run and may each have effects, but at most one Event is stored.
|
|
230
|
+
The framework EventBus dispatches only after strict insertion succeeds.
|
|
231
|
+
|
|
217
232
|
History ports are lazy. When a history is disabled, the in-memory provider does
|
|
218
233
|
not open or allocate its grouped records. Current Entity loading always uses
|
|
219
234
|
the current record, never retained history. Event history is diagnostic data,
|
|
@@ -226,8 +241,12 @@ errors reject. There is no Entity conflict result. This changes the published
|
|
|
226
241
|
`storage/provider` types for custom adapters; application APIs and persisted
|
|
227
242
|
record layouts are unchanged.
|
|
228
243
|
|
|
229
|
-
The in
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
244
|
+
The built-in providers capture prepared input before I/O and write state history,
|
|
245
|
+
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.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { CommandId } from "@spine-event-engine/proto";
|
|
2
|
+
import { type AgentExecutionRecord, type AgentOutgoingCommand, type AgentSavedDispatchTarget } from "@spine-event-engine/proto/generated/spine/server/agent/execution_record_pb.js";
|
|
2
3
|
/**
|
|
3
4
|
* Enforces immutable saved output envelopes and one-time route preparation.
|
|
4
5
|
*/
|
|
@@ -12,10 +13,10 @@ export declare const AgentExecutionTransitions: {
|
|
|
12
13
|
/**
|
|
13
14
|
* Reads the complete typed ID of one original outgoing envelope.
|
|
14
15
|
*
|
|
15
|
-
* @param output Original
|
|
16
|
+
* @param output Original outgoing Command envelope.
|
|
16
17
|
* @returns Kind and nonempty source ID.
|
|
17
18
|
*/
|
|
18
|
-
originalId(output:
|
|
19
|
+
originalId(output: AgentOutgoingCommand): string;
|
|
19
20
|
/**
|
|
20
21
|
* Accepts only absent-to-present saved-plan installation after completion.
|
|
21
22
|
*
|
|
@@ -27,22 +28,22 @@ export declare const AgentExecutionTransitions: {
|
|
|
27
28
|
* Validates a persisted plan before acknowledging each selected original ID.
|
|
28
29
|
*
|
|
29
30
|
* @param record Persisted Agent execution record.
|
|
30
|
-
* @param signals Original outgoing
|
|
31
|
+
* @param signals Original outgoing Command identities.
|
|
31
32
|
*/
|
|
32
|
-
assertDelivery(record: AgentExecutionRecord, signals: readonly
|
|
33
|
+
assertDelivery(record: AgentExecutionRecord, signals: readonly CommandId[]): void;
|
|
33
34
|
/**
|
|
34
35
|
* Checks complete binding identities and typed repository recipients.
|
|
35
36
|
*
|
|
36
37
|
* @param output Saved outgoing signal.
|
|
37
38
|
*/
|
|
38
|
-
validatePlan(output:
|
|
39
|
+
validatePlan(output: AgentOutgoingCommand): void;
|
|
39
40
|
/**
|
|
40
41
|
* Rejects a target that cannot be rebound to the original output kind.
|
|
41
42
|
*
|
|
42
43
|
* @param output Saved outgoing signal.
|
|
43
44
|
* @param target Prepared delivery target.
|
|
44
45
|
*/
|
|
45
|
-
validateTarget(output:
|
|
46
|
+
validateTarget(output: AgentOutgoingCommand, target: AgentSavedDispatchTarget): void;
|
|
46
47
|
/**
|
|
47
48
|
* Compares complete original plan bytes after installation.
|
|
48
49
|
*
|
|
@@ -50,7 +51,7 @@ export declare const AgentExecutionTransitions: {
|
|
|
50
51
|
* @param right Second value in the comparison.
|
|
51
52
|
* @returns Whether both saved dispatch plans have identical bytes.
|
|
52
53
|
*/
|
|
53
|
-
samePlan(left:
|
|
54
|
+
samePlan(left: AgentOutgoingCommand, right: AgentOutgoingCommand): boolean;
|
|
54
55
|
/**
|
|
55
56
|
* Compares every execution field after masking the newly installed plans.
|
|
56
57
|
*
|
|
@@ -60,12 +61,12 @@ export declare const AgentExecutionTransitions: {
|
|
|
60
61
|
*/
|
|
61
62
|
sameRecord(left: AgentExecutionRecord, right: AgentExecutionRecord): boolean;
|
|
62
63
|
/**
|
|
63
|
-
* Matches a selected typed original
|
|
64
|
+
* Matches a selected typed original Command ID.
|
|
64
65
|
*
|
|
65
|
-
* @param output Saved outgoing
|
|
66
|
-
* @param signal Original
|
|
67
|
-
* @returns Whether the saved output has the original
|
|
66
|
+
* @param output Saved outgoing Command.
|
|
67
|
+
* @param signal Original Command identity.
|
|
68
|
+
* @returns Whether the saved output has the original Command identity.
|
|
68
69
|
*/
|
|
69
|
-
matches(output:
|
|
70
|
+
matches(output: AgentOutgoingCommand, signal: CommandId): boolean;
|
|
70
71
|
};
|
|
71
72
|
//# sourceMappingURL=agent-execution-transitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution-transitions.d.ts","sourceRoot":"","sources":["../../src/entity/agent-execution-transitions.ts"],"names":[],"mappings":"AAeA,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,
|
|
1
|
+
{"version":3,"file":"agent-execution-transitions.d.ts","sourceRoot":"","sources":["../../src/entity/agent-execution-transitions.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,+EAA+E,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,yBAAyB;IACpC;;;;OAIG;6BACsB,oBAAoB,GAAG,IAAI;IAYpD;;;;;OAKG;uBACgB,oBAAoB,GAAG,MAAM;IAMhD;;;;;OAKG;wBACiB,oBAAoB,QAAQ,oBAAoB,GAAG,IAAI;IA6B3E;;;;;OAKG;2BACoB,oBAAoB,WAAW,SAAS,SAAS,EAAE,GAAG,IAAI;IAQjF;;;;OAIG;yBACkB,oBAAoB,GAAG,IAAI;IAKhD;;;;;OAKG;2BACoB,oBAAoB,UAAU,wBAAwB,GAAG,IAAI;IAqBpF;;;;;;OAMG;mBACY,oBAAoB,SAAS,oBAAoB,GAAG,OAAO;IAO1E;;;;;;OAMG;qBACc,oBAAoB,SAAS,oBAAoB,GAAG,OAAO;IAM5E;;;;;;OAMG;oBACa,oBAAoB,UAAU,SAAS,GAAG,OAAO;CAGlE,CAAC"}
|
|
@@ -24,8 +24,8 @@ export const AgentExecutionTransitions = {
|
|
|
24
24
|
*/
|
|
25
25
|
assertCompletion(record) {
|
|
26
26
|
const originalIds = new Set();
|
|
27
|
-
for (const output of record.completion?.
|
|
28
|
-
if (output.
|
|
27
|
+
for (const output of record.completion?.commands ?? []) {
|
|
28
|
+
if (output.command === undefined || output.delivered || output.plan !== undefined)
|
|
29
29
|
throw new Error("Agent completion requires an undelivered original output without a plan.");
|
|
30
30
|
const original = this.originalId(output);
|
|
31
31
|
if (originalIds.has(original))
|
|
@@ -36,21 +36,14 @@ export const AgentExecutionTransitions = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Reads the complete typed ID of one original outgoing envelope.
|
|
38
38
|
*
|
|
39
|
-
* @param output Original
|
|
39
|
+
* @param output Original outgoing Command envelope.
|
|
40
40
|
* @returns Kind and nonempty source ID.
|
|
41
41
|
*/
|
|
42
42
|
originalId(output) {
|
|
43
|
-
const
|
|
44
|
-
const id = kind === "event"
|
|
45
|
-
? output.signal.value.id?.value
|
|
46
|
-
: kind === "command"
|
|
47
|
-
? output.signal.value.id?.uuid
|
|
48
|
-
: undefined;
|
|
43
|
+
const id = output.command?.id?.uuid;
|
|
49
44
|
if (!id?.trim())
|
|
50
45
|
throw new Error("Agent outgoing original ID must be nonempty.");
|
|
51
|
-
|
|
52
|
-
throw new Error("Agent outgoing signal must have a typed kind.");
|
|
53
|
-
return `${kind}:${id}`;
|
|
46
|
+
return `command:${id}`;
|
|
54
47
|
},
|
|
55
48
|
/**
|
|
56
49
|
* Accepts only absent-to-present saved-plan installation after completion.
|
|
@@ -64,17 +57,17 @@ export const AgentExecutionTransitions = {
|
|
|
64
57
|
throw new Error("Agent execution update cannot install completion outside conditional commit.");
|
|
65
58
|
return;
|
|
66
59
|
}
|
|
67
|
-
if (next.completion?.
|
|
60
|
+
if (next.completion?.commands.length !== prior.completion.commands.length)
|
|
68
61
|
throw new Error("Agent saved outputs cannot be replaced.");
|
|
69
62
|
const masked = clone(AgentExecutionRecordSchema, next);
|
|
70
63
|
const priorCompletion = prior.completion;
|
|
71
64
|
const maskedCompletion = masked.completion;
|
|
72
65
|
if (maskedCompletion === undefined)
|
|
73
66
|
throw new Error("Agent completion is missing.");
|
|
74
|
-
for (let i = 0; i < prior.completion.
|
|
75
|
-
const old = priorCompletion.
|
|
76
|
-
const current = next.completion.
|
|
77
|
-
const maskedOutput = maskedCompletion.
|
|
67
|
+
for (let i = 0; i < prior.completion.commands.length; i += 1) {
|
|
68
|
+
const old = priorCompletion.commands[i];
|
|
69
|
+
const current = next.completion.commands[i];
|
|
70
|
+
const maskedOutput = maskedCompletion.commands[i];
|
|
78
71
|
if (old === undefined || current === undefined || maskedOutput === undefined)
|
|
79
72
|
throw new Error("Agent saved output is missing.");
|
|
80
73
|
if (old.plan !== undefined && !this.samePlan(old, current))
|
|
@@ -90,11 +83,11 @@ export const AgentExecutionTransitions = {
|
|
|
90
83
|
* Validates a persisted plan before acknowledging each selected original ID.
|
|
91
84
|
*
|
|
92
85
|
* @param record Persisted Agent execution record.
|
|
93
|
-
* @param signals Original outgoing
|
|
86
|
+
* @param signals Original outgoing Command identities.
|
|
94
87
|
*/
|
|
95
88
|
assertDelivery(record, signals) {
|
|
96
89
|
for (const signal of signals) {
|
|
97
|
-
const output = record.completion?.
|
|
90
|
+
const output = record.completion?.commands.find((item) => this.matches(item, signal));
|
|
98
91
|
if (output?.plan === undefined)
|
|
99
92
|
throw new Error("Agent output cannot be acknowledged before its saved plan exists.");
|
|
100
93
|
}
|
|
@@ -117,16 +110,11 @@ export const AgentExecutionTransitions = {
|
|
|
117
110
|
* @param target Prepared delivery target.
|
|
118
111
|
*/
|
|
119
112
|
validateTarget(output, target) {
|
|
120
|
-
const
|
|
121
|
-
const repository = target.kind === AgentSavedTargetKind.AGENT_SAVED_REPOSITORY_EVENT ||
|
|
122
|
-
target.kind === AgentSavedTargetKind.AGENT_SAVED_REPOSITORY_COMMAND;
|
|
113
|
+
const repository = target.kind === AgentSavedTargetKind.AGENT_SAVED_REPOSITORY_COMMAND;
|
|
123
114
|
if (!target.signalType.trim() ||
|
|
124
115
|
!target.bindingFingerprint.trim() ||
|
|
125
|
-
(
|
|
126
|
-
|
|
127
|
-
target.kind !== AgentSavedTargetKind.AGENT_SAVED_STANDALONE_EVENT
|
|
128
|
-
: target.kind !== AgentSavedTargetKind.AGENT_SAVED_REPOSITORY_COMMAND &&
|
|
129
|
-
target.kind !== AgentSavedTargetKind.AGENT_SAVED_STANDALONE_COMMAND))
|
|
116
|
+
(target.kind !== AgentSavedTargetKind.AGENT_SAVED_REPOSITORY_COMMAND &&
|
|
117
|
+
target.kind !== AgentSavedTargetKind.AGENT_SAVED_STANDALONE_COMMAND))
|
|
130
118
|
throw new Error("Agent saved dispatcher does not match the original output.");
|
|
131
119
|
if (repository
|
|
132
120
|
? !target.receiverStateType.trim() ||
|
|
@@ -164,19 +152,14 @@ export const AgentExecutionTransitions = {
|
|
|
164
152
|
return a.length === b.length && a.every((byte, index) => byte === b[index]);
|
|
165
153
|
},
|
|
166
154
|
/**
|
|
167
|
-
* Matches a selected typed original
|
|
155
|
+
* Matches a selected typed original Command ID.
|
|
168
156
|
*
|
|
169
|
-
* @param output Saved outgoing
|
|
170
|
-
* @param signal Original
|
|
171
|
-
* @returns Whether the saved output has the original
|
|
157
|
+
* @param output Saved outgoing Command.
|
|
158
|
+
* @param signal Original Command identity.
|
|
159
|
+
* @returns Whether the saved output has the original Command identity.
|
|
172
160
|
*/
|
|
173
161
|
matches(output, signal) {
|
|
174
|
-
return
|
|
175
|
-
output.signal.case === "event" &&
|
|
176
|
-
output.signal.value.id?.value === signal.id.value.value) ||
|
|
177
|
-
(signal.id.case === "command" &&
|
|
178
|
-
output.signal.case === "command" &&
|
|
179
|
-
output.signal.value.id?.uuid === signal.id.value.uuid));
|
|
162
|
+
return output.command?.id?.uuid === signal.uuid;
|
|
180
163
|
},
|
|
181
164
|
};
|
|
182
165
|
//# sourceMappingURL=agent-execution-transitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution-transitions.js","sourceRoot":"","sources":["../../src/entity/agent-execution-transitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-execution-transitions.js","sourceRoot":"","sources":["../../src/entity/agent-execution-transitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,IAAI,uBAAuB,EACvD,oBAAoB,EACpB,0BAA0B,GAI3B,MAAM,+EAA+E,CAAC;AAEvF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,MAA4B;QAC3C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;QACtC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,UAAU,EAAE,QAAQ,IAAI,EAAE,EAAE,CAAC;YACvD,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;gBAC/E,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;YAC9F,MAAM,QAAQ,G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AAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC;QACzF,MAAM,CAAC,GAAG,QAAQ,CAAC,uBAAuB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,CAAC,GAAG,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAAC,IAA0B,EAAE,KAA2B;QAChE,MAAM,CAAC,GAAG,QAAQ,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAC;QACrD,MAAM,CAAC,GAAG,QAAQ,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,MAA4B,EAAE,MAAiB;QACrD,OAAO,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;IAClD,CAAC;CACF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
2
|
-
import
|
|
2
|
+
import type { CommandId } from "@spine-event-engine/proto";
|
|
3
|
+
import { type AgentAcceptedInvocation, type AgentExecutionCompletion, type AgentExecutionHead, type AgentExecutionRecord, type AgentExecutionScope, type AgentInboxOrder, type AgentInvocationKey } from "@spine-event-engine/proto/generated/spine/server/agent/execution_record_pb.js";
|
|
3
4
|
/**
|
|
4
5
|
* Reads and compares original Agent execution values across storage providers.
|
|
5
6
|
*/
|
|
@@ -135,8 +136,8 @@ export declare const AgentExecutionValues: {
|
|
|
135
136
|
* Marks one original recorded outgoing ID delivered.
|
|
136
137
|
*
|
|
137
138
|
* @param record Completion carrying original outputs.
|
|
138
|
-
* @param signal Typed
|
|
139
|
+
* @param signal Typed outgoing Command ID.
|
|
139
140
|
*/
|
|
140
|
-
markSignal(record: AgentExecutionCompletion, signal:
|
|
141
|
+
markSignal(record: AgentExecutionCompletion, signal: CommandId): void;
|
|
141
142
|
};
|
|
142
143
|
//# sourceMappingURL=agent-execution-values.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution-values.d.ts","sourceRoot":"","sources":["../../src/entity/agent-execution-values.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"agent-execution-values.d.ts","sourceRoot":"","sources":["../../src/entity/agent-execution-values.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,+EAA+E,CAAC;AAIvF;;GAEG;AACH,eAAO,MAAM,oBAAoB;IAC/B;;;;;;OAMG;YACK,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC;IAKnC;;;;;;OAMG;qBACc,kBAAkB,GAAG,SAAS,aAAa,MAAM,GAAG,kBAAkB;IAavF;;;;;OAKG;6BACsB,oBAAoB,GAAG,uBAAuB;IAMvE;;;;;OAKG;+BACwB,oBAAoB,GAAG,kBAAkB;IAMpE;;;;;OAKG;uBACgB,kBAAkB,GAAG,SAAS,GAAG,mBAAmB;IAKvE;;;;;OAKG;4BACqB,kBAAkB,GAAG,mBAAmB;IAKhE;;;;;OAKG;0BACmB,oBAAoB,GAAG,eAAe;IAM5D;;;;;OAKG;+BACwB,oBAAoB,GAAG,wBAAwB;IAK1E;;;;;;OAMG;sBACe,MAAM,SAAS,MAAM,GAAG,MAAM;IAIhD;;;;;;OAMG;uBAEK,uBAAuB,GAAG,SAAS,SAClC,uBAAuB,GAAG,SAAS,GACzC,OAAO;IAcV;;;;;;OAMG;oBACa,UAAU,SAAS,UAAU,GAAG,OAAO;IAIvD;;;;;OAKG;wBACiB,oBAAoB,GAAG,oBAAoB;IAI/D;;;;;;OAMG;sBACe,SAAS,SAAS,SAAS,GAAG,MAAM;IAQtD;;;;;;OAMG;sBACe,oBAAoB,OAAO,SAAS,GAAG,OAAO;IAahE;;;;;OAKG;kBACW,kBAAkB,SAAS,eAAe,GAAG,IAAI;IAO/D;;;;;OAKG;yBACkB,kBAAkB,UAAU,oBAAoB,GAAG,IAAI;IAc5E;;;;;;OAMG;2BAEK,kBAAkB,SACjB,eAAe,QAChB,oBAAoB,GAAG,SAAS,GACrC,IAAI;IAOP;;;;;OAKG;uBACgB,wBAAwB,UAAU,SAAS,GAAG,IAAI;CAKtE,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 { fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
14
|
+
import { clone, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
15
15
|
import { Time } from "@spine-event-engine/core";
|
|
16
16
|
import { AgentAcceptedInvocationSchema, AgentExecutionRecordSchema, AgentInvocationStatus, } from "@spine-event-engine/proto/generated/spine/server/agent/execution_record_pb.js";
|
|
17
17
|
import { AgentExecutionRecords } from "./agent-execution-record-spec.js";
|
|
@@ -132,9 +132,15 @@ export const AgentExecutionValues = {
|
|
|
132
132
|
* @returns Whether all original bytes match.
|
|
133
133
|
*/
|
|
134
134
|
sameAccepted(left, right) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
if (left === undefined || right === undefined)
|
|
136
|
+
return false;
|
|
137
|
+
const original = clone(AgentAcceptedInvocationSchema, left);
|
|
138
|
+
const repeated = clone(AgentAcceptedInvocationSchema, right);
|
|
139
|
+
// A retry may arrive in a new Inbox row after receipt retention expires.
|
|
140
|
+
// Keep the first order while requiring every source and binding fact to match.
|
|
141
|
+
original.order = undefined;
|
|
142
|
+
repeated.order = undefined;
|
|
143
|
+
return this.sameBytes(toBinary(AgentAcceptedInvocationSchema, original), toBinary(AgentAcceptedInvocationSchema, repeated));
|
|
138
144
|
},
|
|
139
145
|
/**
|
|
140
146
|
* Compares exact binary images without integer conversion.
|
|
@@ -178,7 +184,7 @@ export const AgentExecutionValues = {
|
|
|
178
184
|
*/
|
|
179
185
|
isPending(record, now) {
|
|
180
186
|
if (record.status === AgentInvocationStatus.AGENT_INVOCATION_ACCEPTED ||
|
|
181
|
-
record.status === AgentInvocationStatus.
|
|
187
|
+
record.status === AgentInvocationStatus.AGENT_INVOCATION_COMPLETED_PENDING_COMMANDS)
|
|
182
188
|
return true;
|
|
183
189
|
return (record.status === AgentInvocationStatus.AGENT_INVOCATION_ACTIVE &&
|
|
184
190
|
record.claimExpiresAt !== undefined &&
|
|
@@ -233,15 +239,10 @@ export const AgentExecutionValues = {
|
|
|
233
239
|
* Marks one original recorded outgoing ID delivered.
|
|
234
240
|
*
|
|
235
241
|
* @param record Completion carrying original outputs.
|
|
236
|
-
* @param signal Typed
|
|
242
|
+
* @param signal Typed outgoing Command ID.
|
|
237
243
|
*/
|
|
238
244
|
markSignal(record, signal) {
|
|
239
|
-
const outgoing = record.
|
|
240
|
-
item.signal.case === "event" &&
|
|
241
|
-
item.signal.value.id?.value === signal.id.value.value) ||
|
|
242
|
-
(signal.id.case === "command" &&
|
|
243
|
-
item.signal.case === "command" &&
|
|
244
|
-
item.signal.value.id?.uuid === signal.id.value.uuid));
|
|
245
|
+
const outgoing = record.commands.find((item) => item.command?.id?.uuid === signal.uuid);
|
|
245
246
|
if (outgoing === undefined)
|
|
246
247
|
throw new Error("Agent outgoing signal ID was not recorded.");
|
|
247
248
|
outgoing.delivered = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution-values.js","sourceRoot":"","sources":["../../src/entity/agent-execution-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-execution-values.js","sourceRoot":"","sources":["../../src/entity/agent-execution-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,qBAAqB,GAQtB,MAAM,+EAA+E,CAAC;AAEvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC;;;;;;OAMG;IACH,OAAO,CAAI,KAAoB;QAC7B,IAAI,KAAK,KAAK,SAAS;YAAE,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;QAClF,OAAO,KAAK,CAAC;IACf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,MAAiB;QAC5D,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;QACxF,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC1F,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC;IAC5B,CAAC;CACF,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Message } from "@bufbuild/protobuf";
|
|
2
2
|
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import type { CommandId } from "@spine-event-engine/proto";
|
|
3
4
|
import type { AgentHistoryEntry, ModelPreference } from "@spine-event-engine/proto/agent";
|
|
4
|
-
import type { AgentAcceptedInvocation, AgentExecutionRecord, AgentExecutionScope, AgentInvocationKey
|
|
5
|
+
import type { AgentAcceptedInvocation, AgentExecutionRecord, AgentExecutionScope, AgentInvocationKey } from "@spine-event-engine/proto/generated/spine/server/agent/execution_record_pb.js";
|
|
5
6
|
import type { EntityCommitInput } from "../internal/entity-commit.js";
|
|
6
7
|
import type { EntityStorageInput } from "../internal/entity-history.js";
|
|
7
8
|
/**
|
|
@@ -217,15 +218,15 @@ export interface AgentExecutionStorage<I, S extends Message> {
|
|
|
217
218
|
*/
|
|
218
219
|
complete(input: AgentExecutionComplete<I, S>): Promise<void>;
|
|
219
220
|
/**
|
|
220
|
-
* Marks
|
|
221
|
+
* Marks outgoing Command IDs accepted by normal delivery without rerunning handlers.
|
|
221
222
|
*
|
|
222
223
|
* @param key Exact source and Agent instance identity.
|
|
223
224
|
* @param token Current exclusive token.
|
|
224
225
|
* @param expectedRecordBytes Exact binary image before acknowledgement.
|
|
225
|
-
* @param signals Original IDs accepted by delivery.
|
|
226
|
-
* @returns Completion after original
|
|
226
|
+
* @param signals Original Command IDs accepted by delivery.
|
|
227
|
+
* @returns Completion after original Commands are marked delivered.
|
|
227
228
|
*/
|
|
228
|
-
markDelivered(key: AgentInvocationKey, token: string, expectedRecordBytes: Uint8Array, signals: readonly
|
|
229
|
+
markDelivered(key: AgentInvocationKey, token: string, expectedRecordBytes: Uint8Array, signals: readonly CommandId[]): Promise<void>;
|
|
229
230
|
/**
|
|
230
231
|
* Closes this handle without deleting any persisted work.
|
|
231
232
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-execution.d.ts","sourceRoot":"","sources":["../../src/entity/agent-execution.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"agent-execution.d.ts","sourceRoot":"","sources":["../../src/entity/agent-execution.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,+EAA+E,CAAC;AAEvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE;;;;;GAKG;AACH,MAAM,WAAW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