@agenticprimitives/orchestration 0.0.0-alpha.29 → 0.0.0-alpha.30
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/README.md +5 -0
- package/dist/approval.d.ts +20 -0
- package/dist/approval.d.ts.map +1 -0
- package/dist/approval.js +79 -0
- package/dist/approval.js.map +1 -0
- package/dist/authority.d.ts +137 -2
- package/dist/authority.d.ts.map +1 -1
- package/dist/derivation.d.ts +1 -1
- package/dist/derivation.d.ts.map +1 -1
- package/dist/derivation.js +14 -4
- package/dist/derivation.js.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +52 -0
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +15 -0
- package/dist/input.js.map +1 -1
- package/dist/loop.d.ts +18 -1
- package/dist/loop.d.ts.map +1 -1
- package/dist/loop.js +554 -125
- package/dist/loop.js.map +1 -1
- package/dist/plan-digest.d.ts +10 -0
- package/dist/plan-digest.d.ts.map +1 -1
- package/dist/plan-digest.js +18 -0
- package/dist/plan-digest.js.map +1 -1
- package/dist/planner.d.ts.map +1 -1
- package/dist/planner.js +2 -1
- package/dist/planner.js.map +1 -1
- package/dist/provenance.d.ts +37 -0
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +127 -0
- package/dist/provenance.js.map +1 -0
- package/dist/reconcile.d.ts +10 -3
- package/dist/reconcile.d.ts.map +1 -1
- package/dist/reconcile.js +3 -3
- package/dist/reconcile.js.map +1 -1
- package/dist/step-lifecycle.d.ts +303 -0
- package/dist/step-lifecycle.d.ts.map +1 -0
- package/dist/step-lifecycle.js +304 -0
- package/dist/step-lifecycle.js.map +1 -0
- package/dist/types.d.ts +72 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// THE STEP LIFECYCLE — spec 448 rule 4, as ONE state machine (design: `docs/step-lifecycle.md`).
|
|
2
|
+
//
|
|
3
|
+
// Everything that decides whether an effect may be invoked, recorded, released, handed over, parked or unwound lives
|
|
4
|
+
// here, as pure functions: (state, event) → (state, effects). The loop (forward steps and compensations), the mandate
|
|
5
|
+
// verifier's use ledger, the service host's run store and the hand-off path are INTERPRETERS of these functions — they
|
|
6
|
+
// perform the effects and feed back what happened; none of them carries a rule of its own.
|
|
7
|
+
//
|
|
8
|
+
// Three machines, one per place where state is durable:
|
|
9
|
+
//
|
|
10
|
+
// slotTransition the use ledger's slot for one signed step identity free → held(attempt) → done
|
|
11
|
+
// attemptTransition one runner's attempt to perform that step idle → acting | resolving → recorded | parked | …
|
|
12
|
+
// checkpointWrite the run's checkpoint in the host's store a fenced, strictly successive sequence of writes
|
|
13
|
+
// recordWrite the run's record a terminal record is final
|
|
14
|
+
//
|
|
15
|
+
// and one rule shared by the loop and the host: `answerBinds` — an answer is the answer to ONE prompt.
|
|
16
|
+
//
|
|
17
|
+
// The invariants these functions hold (the model test `step-lifecycle.model.test.ts` explores interleavings against them):
|
|
18
|
+
// I1 an effect is invoked at most once per signed step identity, unless the tool dedups by key AND a bound reader's
|
|
19
|
+
// fresh read says absent (once, under the SAME operation id), or the principal answered THIS uncertainty `absent`.
|
|
20
|
+
// I2 no step is held with no way forward: every non-terminal state names the event that resolves it.
|
|
21
|
+
// I3 a compensated step is never recorded completed; what must be unwound is durable run state, not a turn's.
|
|
22
|
+
// I4 a finished run is terminal: no later write reopens it.
|
|
23
|
+
// I5 a hand-off executes the parent's step under the parent's slot: parent and specialist never both perform it.
|
|
24
|
+
// I6 a confirmation or an uncertainty answer is valid only for the prompt it answers, from a verified voice, once.
|
|
25
|
+
/**
|
|
26
|
+
* The slot's compare-and-set. A durable ledger applies exactly this, atomically per slot.
|
|
27
|
+
* begin free ⇒ held by this attempt (`begun`). held ⇒ `held` (naming the holder) unless `retryOf` names the attempt
|
|
28
|
+
* that holds it: then the step is handed to this attempt, marked `retried` (`begun`). done ⇒ `done`.
|
|
29
|
+
* Asked again by the attempt that already holds it ⇒ `begun` again, nothing changed (a lost acknowledgement).
|
|
30
|
+
* complete ⇒ done, whoever asks: the effect exists is a fact about the step.
|
|
31
|
+
* release frees ONLY the named attempt, and only a first attempt: a retried attempt followed one that may have acted.
|
|
32
|
+
*/
|
|
33
|
+
export function slotTransition(slot, op) {
|
|
34
|
+
switch (op.op) {
|
|
35
|
+
case 'begin': {
|
|
36
|
+
if (slot.status === 'done')
|
|
37
|
+
return { slot, answer: { status: 'done' } };
|
|
38
|
+
const mine = (retried, operationId) => ({
|
|
39
|
+
status: 'held', attempt: op.attempt, retried,
|
|
40
|
+
...(operationId !== undefined ? { operationId } : {}), ...(op.holder !== undefined ? { holder: op.holder } : {}),
|
|
41
|
+
});
|
|
42
|
+
if (slot.status === 'free')
|
|
43
|
+
return { slot: mine(false, op.operationId), answer: { status: 'begun' } };
|
|
44
|
+
// The SAME attempt asking again (its first answer was lost on the way back): it holds the slot, and is told so.
|
|
45
|
+
// Idempotent — nothing changes, and no other attempt can name this token.
|
|
46
|
+
if (slot.attempt === op.attempt)
|
|
47
|
+
return { slot, answer: { status: 'begun' } };
|
|
48
|
+
if (op.retryOf !== undefined && op.retryOf === slot.attempt)
|
|
49
|
+
return { slot: mine(true, op.operationId ?? slot.operationId), answer: { status: 'begun' } };
|
|
50
|
+
return { slot, answer: { status: 'held', attempt: slot.attempt, retried: slot.retried, ...(slot.operationId !== undefined ? { operationId: slot.operationId } : {}), ...(slot.holder !== undefined ? { holder: slot.holder } : {}) } };
|
|
51
|
+
}
|
|
52
|
+
case 'complete':
|
|
53
|
+
return { slot: { status: 'done' } };
|
|
54
|
+
case 'release':
|
|
55
|
+
return slot.status === 'held' && !slot.retried && slot.attempt === op.attempt ? { slot: { status: 'free' } } : { slot };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const settled = (s) => s.phase === 'recorded' || s.phase === 'released' || s.phase === 'failed' || s.phase === 'parked';
|
|
59
|
+
/**
|
|
60
|
+
* One runner's attempt at one step. Total: an event that does not apply to the state changes nothing and asks for nothing
|
|
61
|
+
* (a duplicated or reordered delivery is inert — in particular it never yields a second `invoke`).
|
|
62
|
+
*/
|
|
63
|
+
export function attemptTransition(state, event, ctx) {
|
|
64
|
+
const stay = { state, effects: [] };
|
|
65
|
+
if (settled(state))
|
|
66
|
+
return stay;
|
|
67
|
+
/** The effect exists: tell the slot (when one holds this step), then record. */
|
|
68
|
+
const settle = (by, counted) => (counted ? { state: { phase: 'completing', by }, effects: [{ do: 'complete' }] } : { state: { phase: 'recorded', by }, effects: [{ do: 'record', by }] });
|
|
69
|
+
const park = (ledger, why, heldAttempt) => ({
|
|
70
|
+
state: { phase: 'parked', ledger, why, ...(heldAttempt !== undefined ? { heldAttempt } : {}) },
|
|
71
|
+
effects: [{ do: 'park', ledger, why, ...(heldAttempt !== undefined ? { heldAttempt } : {}) }],
|
|
72
|
+
});
|
|
73
|
+
switch (event.type) {
|
|
74
|
+
case 'slot-answered': {
|
|
75
|
+
if (state.phase === 'idle' && event.to === 'begin') {
|
|
76
|
+
if (event.answer.status === 'begun')
|
|
77
|
+
return { state: { phase: 'acting', retry: false, operationId: ctx.operationId, counted: ctx.counted && event.answer.slot !== 'none' }, effects: [{ do: 'invoke', operationId: ctx.operationId }] };
|
|
78
|
+
return { state: { phase: 'resolving', slot: event.answer }, effects: [{ do: 'gather-evidence', ...(event.answer.status === 'held' ? { about: event.answer.attempt } : {}) }] };
|
|
79
|
+
}
|
|
80
|
+
if (state.phase === 'handing-over' && event.to === 'hand-over') {
|
|
81
|
+
if (event.answer.status === 'begun')
|
|
82
|
+
return { state: { phase: 'acting', retry: true, operationId: state.operationId, counted: true }, effects: [{ do: 'invoke', operationId: state.operationId }] };
|
|
83
|
+
// Another attempt took the step between the read and the hand-over: it is theirs.
|
|
84
|
+
return park(event.answer.status === 'done' ? 'done' : 'held', 'lost-handover', event.answer.status === 'held' ? event.answer.attempt : undefined);
|
|
85
|
+
}
|
|
86
|
+
return stay;
|
|
87
|
+
}
|
|
88
|
+
case 'slot-unanswered': {
|
|
89
|
+
// The begin may have been stored under this attempt's token, and nothing was performed. Never a failure that ends
|
|
90
|
+
// the run holding the slot: a park, bound to that attempt, which the next runner's read of the slot settles.
|
|
91
|
+
if (state.phase === 'idle' && event.to === 'begin')
|
|
92
|
+
return park('held', 'ledger-unanswered', ctx.attempt);
|
|
93
|
+
if (state.phase === 'handing-over' && event.to === 'hand-over')
|
|
94
|
+
return park('held', 'lost-handover', state.from);
|
|
95
|
+
return stay;
|
|
96
|
+
}
|
|
97
|
+
case 'released':
|
|
98
|
+
case 'release-failed': {
|
|
99
|
+
if (state.phase !== 'releasing')
|
|
100
|
+
return stay;
|
|
101
|
+
if (state.question)
|
|
102
|
+
return { state: { phase: 'released', because: 'question' }, effects: [{ do: 'surface-question' }] };
|
|
103
|
+
if (event.type === 'released')
|
|
104
|
+
return { state: { phase: 'released', because: 'not-performed' }, effects: [{ do: 'fail' }] };
|
|
105
|
+
// The tool did not run, but the slot still names this attempt: the run does not end on it.
|
|
106
|
+
return park('held', 'release-failed', ctx.attempt);
|
|
107
|
+
}
|
|
108
|
+
case 'completed':
|
|
109
|
+
case 'complete-failed': {
|
|
110
|
+
if (state.phase !== 'completing')
|
|
111
|
+
return stay;
|
|
112
|
+
const unwritten = event.type === 'complete-failed' ? { ledgerUnwritten: true } : {};
|
|
113
|
+
return { state: { phase: 'recorded', by: state.by, ...unwritten }, effects: [{ do: 'record', by: state.by, ...unwritten }] };
|
|
114
|
+
}
|
|
115
|
+
case 'evidence': {
|
|
116
|
+
// A reader that finds the effect BEFORE any attempt began (the pre-act read): recorded, nothing is invoked.
|
|
117
|
+
if (state.phase === 'idle' && event.reader === 'present')
|
|
118
|
+
return settle('reader', ctx.counted);
|
|
119
|
+
if (state.phase !== 'resolving')
|
|
120
|
+
return stay;
|
|
121
|
+
const slot = state.slot;
|
|
122
|
+
// Is this evidence about the slot as this runner knows it? (A redelivered or stale event names another attempt.)
|
|
123
|
+
const current = slot.status === 'done' ? event.readAbout === undefined : event.readAbout === slot.attempt;
|
|
124
|
+
const said = current && event.principal && event.principal.answers === event.uncertainty ? event.principal.effect : undefined;
|
|
125
|
+
// The effect exists: a reader found it, or the principal answered this uncertainty. Recorded, never performed again.
|
|
126
|
+
if (event.reader === 'present')
|
|
127
|
+
return settle('reader', true);
|
|
128
|
+
if (said === 'present')
|
|
129
|
+
return settle('principal', true);
|
|
130
|
+
if (slot.status === 'done')
|
|
131
|
+
return park('done', 'ledger-done-no-result');
|
|
132
|
+
// The slot is held. Two ways past it, and only two.
|
|
133
|
+
const heldKey = slot.operationId;
|
|
134
|
+
// (A runner that already took the step over hands nothing over again: the next uncertainty is a new prompt.)
|
|
135
|
+
if (state.spent)
|
|
136
|
+
return park('held', said === 'absent' ? 'already-retried' : event.reader === 'no-reader' ? 'no-reader' : event.reader === 'unknown' ? 'reader-unknown' : 'already-retried', slot.attempt);
|
|
137
|
+
// (a) the principal said THIS uncertainty's effect does not exist: performed once more, under the held attempt's
|
|
138
|
+
// own key when the ledger knows it (so a late first attempt and this one are one operation downstream).
|
|
139
|
+
if (said === 'absent')
|
|
140
|
+
return { state: { phase: 'handing-over', from: slot.attempt, operationId: heldKey ?? ctx.operationId }, effects: [{ do: 'hand-over', retryOf: slot.attempt, as: ctx.retryAttempt, operationId: heldKey ?? ctx.operationId }] };
|
|
141
|
+
// (b) a bound reader, asked about THIS held attempt, says absent — and the tool dedups by key, the one hand-over
|
|
142
|
+
// was not used, and this runner would give the downstream the SAME key the held attempt gave it.
|
|
143
|
+
if (event.reader === 'no-reader')
|
|
144
|
+
return park('held', 'no-reader', slot.attempt);
|
|
145
|
+
if (event.reader === 'unknown')
|
|
146
|
+
return park('held', 'reader-unknown', slot.attempt);
|
|
147
|
+
if (event.readAbout !== slot.attempt)
|
|
148
|
+
return park('held', 'stale-read', slot.attempt);
|
|
149
|
+
if (!ctx.idempotentByKey)
|
|
150
|
+
return park('held', 'not-idempotent', slot.attempt);
|
|
151
|
+
if (slot.retried)
|
|
152
|
+
return park('held', 'already-retried', slot.attempt);
|
|
153
|
+
if (heldKey === undefined || heldKey !== ctx.operationId)
|
|
154
|
+
return park('held', 'other-operation-id', slot.attempt);
|
|
155
|
+
return { state: { phase: 'handing-over', from: slot.attempt, operationId: ctx.operationId }, effects: [{ do: 'hand-over', retryOf: slot.attempt, as: ctx.retryAttempt, operationId: ctx.operationId }] };
|
|
156
|
+
}
|
|
157
|
+
case 'returned': {
|
|
158
|
+
if (state.phase !== 'acting' || event.retry !== state.retry)
|
|
159
|
+
return stay;
|
|
160
|
+
return settle('tool', state.counted);
|
|
161
|
+
}
|
|
162
|
+
case 'not-performed': {
|
|
163
|
+
if (state.phase !== 'acting' || event.retry !== state.retry)
|
|
164
|
+
return stay;
|
|
165
|
+
if (!state.counted)
|
|
166
|
+
return event.question ? { state: { phase: 'released', because: 'question' }, effects: [{ do: 'surface-question' }] } : { state: { phase: 'failed' }, effects: [{ do: 'fail' }] };
|
|
167
|
+
// A first attempt that performed nothing frees the slot. A retry followed an attempt that may have acted: the slot
|
|
168
|
+
// stays held (the ledger would not free it), a question is still asked, and anything else is uncertain — never a
|
|
169
|
+
// failure that ends the run with the step held.
|
|
170
|
+
if (!state.retry)
|
|
171
|
+
return { state: { phase: 'releasing', question: event.question }, effects: [{ do: 'release' }] };
|
|
172
|
+
if (event.question)
|
|
173
|
+
return { state: { phase: 'released', because: 'question' }, effects: [{ do: 'surface-question' }] };
|
|
174
|
+
return park('held', 'retry-not-performed', ctx.retryAttempt);
|
|
175
|
+
}
|
|
176
|
+
case 'threw': {
|
|
177
|
+
if (state.phase !== 'acting' || event.retry !== state.retry)
|
|
178
|
+
return stay;
|
|
179
|
+
// A step no slot holds here (uncounted, or counted elsewhere — on chain, by the venue): a plain failure. Nothing
|
|
180
|
+
// in this machine ever re-invokes it, and no prompt is raised that an answer could turn into an invocation.
|
|
181
|
+
if (!state.counted)
|
|
182
|
+
return { state: { phase: 'failed' }, effects: [{ do: 'fail' }] };
|
|
183
|
+
// The response is lost and the effect may exist. The slot is held by THIS attempt: resolved like any held slot.
|
|
184
|
+
const holding = state.retry ? ctx.retryAttempt : ctx.attempt;
|
|
185
|
+
return { state: { phase: 'resolving', slot: { status: 'held', attempt: holding, retried: state.retry, operationId: state.operationId }, ...(state.retry ? { spent: true } : {}) }, effects: [{ do: 'gather-evidence', about: holding }] };
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/** I2 — the event that resolves each non-terminal attempt state, in words a host can show. */
|
|
190
|
+
export function wayForward(state) {
|
|
191
|
+
switch (state.phase) {
|
|
192
|
+
case 'idle': return 'the slot answers begin';
|
|
193
|
+
case 'releasing': return 'the slot acknowledges the release, or does not';
|
|
194
|
+
case 'completing': return 'the slot acknowledges the completion, or does not';
|
|
195
|
+
case 'acting': return 'the tool returns, says it did not run, or throws';
|
|
196
|
+
case 'resolving': return 'a bound reader or the principal says whether the effect exists';
|
|
197
|
+
case 'handing-over': return 'the slot answers the hand-over';
|
|
198
|
+
case 'parked': return state.ledger === 'done' ? 'the principal answers the effect-uncertain prompt: present' : 'the principal answers the effect-uncertain prompt: present or absent';
|
|
199
|
+
case 'released': return state.because === 'question' ? 'the person answers the question; the next attempt begins' : null;
|
|
200
|
+
case 'recorded':
|
|
201
|
+
case 'failed': return null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* May `incoming` be written over `stored`? (I4)
|
|
206
|
+
* • a FENCED write (one that names a generation) is refused once the run is `finished` (it has a TERMINAL record).
|
|
207
|
+
* • over nothing, a fenced write is accepted only as a run's first (generation 1).
|
|
208
|
+
* • over a stored checkpoint, only its IMMEDIATE SUCCESSOR is accepted (generation = stored + 1). A write at the stored
|
|
209
|
+
* generation or below is a duplicate, a redelivery or a turn that was overtaken — refused, whatever it contains: a
|
|
210
|
+
* redelivered claim can never put back the completed-step list the park after it replaced. Of two turns that
|
|
211
|
+
* loaded the same generation, one writes the successor and the other does not.
|
|
212
|
+
* • a write that names no generation is not a turn's (a host creating its own row): accepted as before, not fenced.
|
|
213
|
+
*/
|
|
214
|
+
export function checkpointWrite(stored, incoming, finished = false) {
|
|
215
|
+
if (incoming.generation === undefined)
|
|
216
|
+
return 'accept';
|
|
217
|
+
if (finished)
|
|
218
|
+
return 'superseded';
|
|
219
|
+
if (!stored)
|
|
220
|
+
return incoming.generation === 1 ? 'accept' : 'superseded';
|
|
221
|
+
return incoming.generation === (stored.generation ?? 0) + 1 ? 'accept' : 'superseded';
|
|
222
|
+
}
|
|
223
|
+
/** May the turn whose last write was `mine` finish the run (write its terminal record, drop its checkpoint)? Only while
|
|
224
|
+
* that write is still the stored one. A turn with no fence finished a run that never parked: no checkpoint to hold. */
|
|
225
|
+
export function checkpointFinish(stored, mine) {
|
|
226
|
+
if (!mine || mine.generation === undefined)
|
|
227
|
+
return 'accept';
|
|
228
|
+
if (!stored)
|
|
229
|
+
return 'superseded';
|
|
230
|
+
return (stored.generation ?? 0) === mine.generation ? 'accept' : 'superseded';
|
|
231
|
+
}
|
|
232
|
+
/** What a run record says about its run. Only a TERMINAL record is final: a `completed`, `failed` or `denied` outcome, or
|
|
233
|
+
* a cancel mark. A record of a run that is parked (`suspended`, `authority-required` — written when a park is exported)
|
|
234
|
+
* says where the run stood; the run goes on. */
|
|
235
|
+
export function recordKind(record) {
|
|
236
|
+
if (!record)
|
|
237
|
+
return 'none';
|
|
238
|
+
if (record.canceled)
|
|
239
|
+
return 'terminal';
|
|
240
|
+
return record.outcome === 'completed' || record.outcome === 'failed' || record.outcome === 'denied' ? 'terminal' : 'parked';
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* May `incoming` replace the stored record? A terminal record is FINAL: a parked record (a late export of an earlier
|
|
244
|
+
* park) never replaces it, and neither does a terminal record with another outcome. The same terminal record written
|
|
245
|
+
* again (with its export report, with a cancel mark) is accepted. Over a parked record, or nothing, anything is.
|
|
246
|
+
*/
|
|
247
|
+
export function recordWrite(stored, incoming) {
|
|
248
|
+
if (recordKind(stored) !== 'terminal')
|
|
249
|
+
return 'accept';
|
|
250
|
+
// A canceled run's record keeps its cancel mark whatever is written after (spec 398 §5.3 — the store carries the mark
|
|
251
|
+
// over); the run is finished either way.
|
|
252
|
+
if (stored.canceled)
|
|
253
|
+
return 'accept';
|
|
254
|
+
if (recordKind(incoming) !== 'terminal')
|
|
255
|
+
return 'final';
|
|
256
|
+
return stored.outcome === incoming.outcome ? 'accept' : 'final';
|
|
257
|
+
}
|
|
258
|
+
/** What an answer says it answers: `answers`, or — the outbound confirmation's established shape — `data.disclosure`. */
|
|
259
|
+
export function answerBinding(answer) {
|
|
260
|
+
const a = typeof answer.answers === 'string' && answer.answers ? answer.answers : undefined;
|
|
261
|
+
const d = typeof answer.data?.disclosure === 'string' && answer.data.disclosure ? answer.data.disclosure : undefined;
|
|
262
|
+
// ONE binding. An answer that names two different prompts names none: admission and the gate that dispatches read the
|
|
263
|
+
// same value, so they can never each validate a different disclosure.
|
|
264
|
+
if (a !== undefined && d !== undefined && a !== d)
|
|
265
|
+
return undefined;
|
|
266
|
+
return a ?? d;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Is an answer the host admitted on an earlier turn still kept? An answer that CARRIES its binding where its consumer
|
|
270
|
+
* checks it — an `effect` answer (the loop compares `answers` with the uncertainty), a confirmation with
|
|
271
|
+
* `data.disclosure` (the gate compares the disclosure) — stays the answer to that one prompt for the life of the run:
|
|
272
|
+
* a later park on ANOTHER prompt of the same step does not discard it, so a step with two confirmations converges, each
|
|
273
|
+
* answered once. A bare `confirmed` (bound only by the host, to the digest of the prompt shown) is kept only while the run
|
|
274
|
+
* still waits on that prompt.
|
|
275
|
+
*/
|
|
276
|
+
export function answerKeeps(awaiting, answer) {
|
|
277
|
+
if (answer.confirmed === undefined && answer.effect === undefined)
|
|
278
|
+
return true;
|
|
279
|
+
const binding = answerBinding(answer);
|
|
280
|
+
if (binding === undefined)
|
|
281
|
+
return false;
|
|
282
|
+
if (answer.effect !== undefined)
|
|
283
|
+
return true;
|
|
284
|
+
if (typeof answer.data?.disclosure === 'string' && answer.data.disclosure === binding)
|
|
285
|
+
return true;
|
|
286
|
+
return answerBinds(awaiting, answer, true);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Is this `confirmed` / `effect` answer the answer to the prompt the run is parked on? Only when the run waits on such a
|
|
290
|
+
* prompt, for that step, the answer names the digest that prompt was bound to, and the host verified the voice. A prompt
|
|
291
|
+
* recorded with no digest (a row written before prompts were bound) accepts nothing: the run asks again, bound.
|
|
292
|
+
*/
|
|
293
|
+
export function answerBinds(awaiting, answer, voice) {
|
|
294
|
+
if (!voice || !awaiting)
|
|
295
|
+
return false;
|
|
296
|
+
if (awaiting.kind !== 'confirmation' && awaiting.kind !== 'effect-uncertain')
|
|
297
|
+
return false;
|
|
298
|
+
if ((awaiting.kind === 'confirmation') !== (answer.confirmed !== undefined) || (awaiting.kind === 'effect-uncertain') !== (answer.effect !== undefined))
|
|
299
|
+
return false;
|
|
300
|
+
if (answer.stepRef !== awaiting.stepRef)
|
|
301
|
+
return false;
|
|
302
|
+
return typeof awaiting.digest === 'string' && awaiting.digest !== '' && answerBinding(answer) === awaiting.digest;
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=step-lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-lifecycle.js","sourceRoot":"","sources":["../src/step-lifecycle.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,EAAE;AACF,qHAAqH;AACrH,sHAAsH;AACtH,uHAAuH;AACvH,2FAA2F;AAC3F,EAAE;AACF,wDAAwD;AACxD,EAAE;AACF,2GAA2G;AAC3G,iIAAiI;AACjI,gIAAgI;AAChI,0GAA0G;AAC1G,EAAE;AACF,uGAAuG;AACvG,EAAE;AACF,2HAA2H;AAC3H,uHAA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package/dist/types.d.ts
CHANGED
|
@@ -27,6 +27,28 @@ export interface Intent {
|
|
|
27
27
|
holdWrites?: boolean;
|
|
28
28
|
source?: string;
|
|
29
29
|
} | Record<string, unknown>;
|
|
30
|
+
/** Spec 448 rule 5 (audit H-5) — WHO WROTE THE PARTS OF THIS INTENT. Absent ⇒ every part is the principal's own words,
|
|
31
|
+
* which ONLY the principal's own surface may assert (her Home's Ask, her own authenticated request). A host that puts
|
|
32
|
+
* text someone else wrote — a trigger's payload, a message, a mail, a webhook body, a plan step proposed by another
|
|
33
|
+
* participant — into `goal` or `context` and leaves it unmarked has a defect: the loop would read that text as her
|
|
34
|
+
* instruction. Build such an intent with `relayedIntent` / `markThirdParty`. A marked part starts the run as having
|
|
35
|
+
* read untrusted content (the outbound gate trips on it), reaches the planner framed as data, and is not "her words"
|
|
36
|
+
* to admission or to a receipt's derivation. */
|
|
37
|
+
provenance?: IntentProvenanceV1;
|
|
38
|
+
}
|
|
39
|
+
/** Where a third-party part of an intent came from. `from` names the author when the host knows it. */
|
|
40
|
+
export interface IntentSourceV1 {
|
|
41
|
+
kind: 'trigger' | 'message' | 'mail' | 'webhook' | 'plan-step' | 'agent' | (string & {});
|
|
42
|
+
from?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Spec 448 rule 5 — the provenance of an intent's parts. Only what is marked is third-party. */
|
|
45
|
+
export interface IntentProvenanceV1 {
|
|
46
|
+
/** Present when `goal` is NOT the principal's own words: who wrote it. */
|
|
47
|
+
goal?: IntentSourceV1;
|
|
48
|
+
/** The `context` keys whose values someone other than the principal wrote, and who. */
|
|
49
|
+
context?: Record<string, IntentSourceV1>;
|
|
50
|
+
/** Present when `constraints` is NOT the principal's own: who wrote it (audit H-5 fix-up 2). */
|
|
51
|
+
constraints?: IntentSourceV1;
|
|
30
52
|
}
|
|
31
53
|
/** Spec 445 decision 8 — was this intent asked by an evaluation (it carries a marker, of any shape)? */
|
|
32
54
|
export declare function isEvaluationIntent(intent: Pick<Intent, 'evaluation'> | null | undefined): boolean;
|
|
@@ -163,6 +185,15 @@ export interface ToolSpec {
|
|
|
163
185
|
* can tell an act authorized by a session from one authorized by a signature.
|
|
164
186
|
*/
|
|
165
187
|
selfAuthorized?: true;
|
|
188
|
+
/** Spec 448 rule 8 + §0 (audit H-8 / T3-2) — the callers OTHER than the agent itself to whom this self-acting tool is
|
|
189
|
+
* offered: an authenticated `party`, a `pairwise` pseudonym, `anonymous`. Absent ⇒ a host that admits other callers
|
|
190
|
+
* (`service-host`) offers it only to the agent itself: "the caller is the principal" is the precondition of
|
|
191
|
+
* `selfAuthorized`, and only the agent itself proved it. Declared on the built-in tool, per tool, in words. */
|
|
192
|
+
selfAuthorizedCallers?: ReadonlyArray<'party' | 'pairwise' | 'anonymous'>;
|
|
193
|
+
/** Spec 448 rule 5 (audit T4-3) — this tool's results are the principal's OWN records or values the agent produced:
|
|
194
|
+
* text in them is not a third party's, so only a value it labels `untrusted` marks the run. Absent ⇒ any text in a
|
|
195
|
+
* result is untrusted (it may be a page, a message, another agent's answer). Declared on the built-in tool only. */
|
|
196
|
+
firstPartyResult?: true;
|
|
166
197
|
/**
|
|
167
198
|
* Spec 426 — this tool is an EXECUTOR INVOKE: it has no built-in invoker; the one generic invoker reads this
|
|
168
199
|
* block, calls the resolved executor as the run's principal, and returns its receipt. Compiled from the
|
|
@@ -302,6 +333,29 @@ export interface StepObservation {
|
|
|
302
333
|
* `onMissingMandate: 'report'`; the default is still to throw). It is 401, never 403: no authority was
|
|
303
334
|
* judged, so this is not a denial and must never be reported as one. */
|
|
304
335
|
export type RunOutcome = 'completed' | 'failed' | 'denied' | 'suspended' | 'authority-required';
|
|
336
|
+
/** Spec 448 rule 4 (I3) — a run that was ending and parked while unwinding: the outcome it was ending with, why, and the
|
|
337
|
+
* compensations already settled as owed. Durable run state: a host keeps it with the checkpoint and hands it back on
|
|
338
|
+
* `resume.unwinding`. */
|
|
339
|
+
export interface UnwindingV1 {
|
|
340
|
+
outcome: 'denied' | 'failed';
|
|
341
|
+
error: string;
|
|
342
|
+
owed: NonNullable<RunResult['compensationsOwed']>;
|
|
343
|
+
}
|
|
344
|
+
/** Spec 448 rule 4 (I3) — one step that ran, declared a compensation and has not been unwound: what a parked run must
|
|
345
|
+
* carry so a later refusal can still undo it. The receipt vouches for the result the compensation's arguments come from. */
|
|
346
|
+
export interface ObligationV1 {
|
|
347
|
+
stepRef: string;
|
|
348
|
+
index: number;
|
|
349
|
+
toolId: string;
|
|
350
|
+
/** The compensation the tool DECLARED when the step ran. A resume compares it with what the tool declares now: tool
|
|
351
|
+
* declarations change across deploys while runs are parked. */
|
|
352
|
+
compensation?: {
|
|
353
|
+
toolId: string;
|
|
354
|
+
args: Record<string, unknown>;
|
|
355
|
+
};
|
|
356
|
+
result?: unknown;
|
|
357
|
+
receipt: import('./authority.js').StepReceipt;
|
|
358
|
+
}
|
|
305
359
|
/** The result of running an intent to completion (or fail-closed). */
|
|
306
360
|
export interface RunResult {
|
|
307
361
|
outcome: RunOutcome;
|
|
@@ -319,6 +373,12 @@ export interface RunResult {
|
|
|
319
373
|
receipts: import('./authority.js').StepReceipt[];
|
|
320
374
|
/** Set when `outcome === 'suspended'`: what to hand back to resume. */
|
|
321
375
|
resumeToken?: string;
|
|
376
|
+
/** Spec 448 rule 4 — set when the run parked (`suspended`, `authority-required`): the digest of `plan`, which a
|
|
377
|
+
* plan-bound mandate for the resume must carry. A signer binds THIS, never a digest of a plan it rebuilt. */
|
|
378
|
+
planDigest?: string;
|
|
379
|
+
/** Spec 448 rule 5 — set when the run parked after reading text its principal did not write. A resume passes it back
|
|
380
|
+
* as `resume.untrustedSeen` (the host's checkpoint, never the caller's word): what tainted the run may not replay. */
|
|
381
|
+
untrustedSeen?: true;
|
|
322
382
|
/** Set when `outcome === 'suspended'` because a tool asked the person for something (spec 350 §3.4).
|
|
323
383
|
* The surface renders it; the answers come back as `RunIntentOpts.supplied` on the resume. */
|
|
324
384
|
prompt?: import('./input.js').InputRequestV1;
|
|
@@ -348,6 +408,14 @@ export interface RunResult {
|
|
|
348
408
|
* stepRef `<step>:compensate`), so the caller can obtain the authority and perform it. Present on any outcome whose
|
|
349
409
|
* unwinding left something undone; absent when nothing is owed.
|
|
350
410
|
*/
|
|
411
|
+
/** @preview durable resume across turns is PREVIEW (docs/step-lifecycle.md, "Known issues").
|
|
412
|
+
* Set on a `suspended` result whose prompt is an effect-uncertain COMPENSATION: the run was ending and waits, mid-unwind,
|
|
413
|
+
* for the principal. The resume passes it back (`resume.unwinding`); no further step of the plan runs. */
|
|
414
|
+
unwinding?: UnwindingV1;
|
|
415
|
+
/** Set on a result that is not terminal: the steps that ran and must still be unwound if the run ends refused. Durable
|
|
416
|
+
* run state — a host keeps it with the checkpoint and hands it back on `resume.obligations`.
|
|
417
|
+
* @preview durable resume across turns is PREVIEW (docs/step-lifecycle.md, "Known issues"). */
|
|
418
|
+
obligations?: ObligationV1[];
|
|
351
419
|
compensationsOwed?: Array<{
|
|
352
420
|
/** `<forStepRef>:compensate` — the receipt that records it. */
|
|
353
421
|
stepRef: string;
|
|
@@ -364,12 +432,14 @@ export interface RunResult {
|
|
|
364
432
|
/** The compensation's resolved arguments (from the original tool's result — data, to be judged, not trusted). */
|
|
365
433
|
args: Record<string, unknown>;
|
|
366
434
|
/** Why it did not run. */
|
|
367
|
-
|
|
435
|
+
/** `declaration-changed`: the step ran under a compensation its tool no longer declares (or declares differently) — it
|
|
436
|
+
* cannot be discharged automatically any more. */
|
|
437
|
+
reason: 'no-mandate' | 'not-authorized' | 'approval-required' | 'tool-not-exposed' | 'failed' | 'declaration-changed';
|
|
368
438
|
detail: string;
|
|
369
439
|
}>;
|
|
370
440
|
}
|
|
371
441
|
/** Stable error codes the loop / planners raise (fail-closed; never a silent empty success). */
|
|
372
|
-
export type OrchestrationErrorCode = 'no_plan' | 'reconcile_indeterminate' | 'unknown_tool' | 'empty_plan' | 'max_steps' | 'planner_failed' | 'no_authority_port' | 'no_approval_port' | 'no_mandate_presented' | 'keyring_needs_selector' | 'fan_out_unbound' | 'fan_out_not_array' | 'fan_out_refused' | 'resume_integrity' | 'fan_out_over_limit';
|
|
442
|
+
export type OrchestrationErrorCode = 'no_plan' | 'reconcile_indeterminate' | 'unknown_tool' | 'empty_plan' | 'max_steps' | 'planner_failed' | 'no_authority_port' | 'no_approval_port' | 'no_policy_port' | 'no_approval_verifier' | 'no_mandate_presented' | 'keyring_needs_selector' | 'fan_out_unbound' | 'fan_out_not_array' | 'fan_out_refused' | 'resume_integrity' | 'effect_already_started' | 'fan_out_over_limit';
|
|
373
443
|
export declare class OrchestrationError extends Error {
|
|
374
444
|
readonly code: OrchestrationErrorCode;
|
|
375
445
|
constructor(code: OrchestrationErrorCode, message: string);
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,EAAG,kCAA2C,CAAC;AACxE,eAAO,MAAM,cAAc,EAAG,SAAkB,CAAC;AACjD,eAAO,MAAM,QAAQ,EAAG,gCAAyC,CAAC;AAElE,sGAAsG;AACtG,MAAM,WAAW,MAAM;IACrB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;qFAGiF;IACjF,QAAQ,CAAC,EAAE;QAAE,sBAAsB,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE;;;;mCAI+B;IAC/B,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EA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6GAA6G;AAC7G,+GAA+G;AAE/G,MAAM,CAAC,MAAM,YAAY,GAAG,kCAA2C,CAAC;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,EAAE;AACF,+FAA+F;AAC/F,2GAA2G;AAC3G,6GAA6G;AAC7G,6GAA6G;AAC7G,+GAA+G;AAE/G,MAAM,CAAC,MAAM,YAAY,GAAG,kCAA2C,CAAC;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAyC,CAAC;AA+ClE,wGAAwG;AACxG,MAAM,UAAU,kBAAkB,CAAC,MAAqD;IACtF,OAAO,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC;AACnF,CAAC;AA6OD,uEAAuE;AACvE;gEACgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAmJhD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAEzB;IADlB,YACkB,IAA4B,EAC5C,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAwB;QAI5C,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/orchestration",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.30",
|
|
4
4
|
"description": "The Ring-0 agentic orchestration core (ADR-0044): the intent→plan→execute→observe loop, the Planner + ToolInvoker ports, and a deterministic rule-based planner. A first-party app expresses a goal; the loop plans which tools compose to satisfy it and runs them through an injected invoker. Pure leaf — no transport, no LLM SDK, no chain; the concrete LLM binding lives behind the Planner port in orchestration-anthropic.",
|
|
5
5
|
"homepage": "https://agenticprimitives.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"agentic-trust"
|
|
52
52
|
],
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@agenticprimitives/tool-policy": "1.0.0-alpha.
|
|
54
|
+
"@agenticprimitives/tool-policy": "1.0.0-alpha.49"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsc -p tsconfig.build.json",
|