@namzu/sdk 20.3.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +321 -0
- package/dist/bridge/sse/mapper.d.ts +19 -0
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +9 -1
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/contracts/schemas.d.ts +10 -10
- package/dist/manager/run/persistence.d.ts +26 -0
- package/dist/manager/run/persistence.d.ts.map +1 -1
- package/dist/manager/run/persistence.js +40 -0
- package/dist/manager/run/persistence.js.map +1 -1
- package/dist/public-runtime.d.ts +5 -0
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +21 -0
- package/dist/public-runtime.js.map +1 -1
- package/dist/run/drain.d.ts +194 -0
- package/dist/run/drain.d.ts.map +1 -0
- package/dist/run/drain.js +228 -0
- package/dist/run/drain.js.map +1 -0
- package/dist/run/index.d.ts +2 -0
- package/dist/run/index.d.ts.map +1 -1
- package/dist/run/index.js +1 -0
- package/dist/run/index.js.map +1 -1
- package/dist/runtime/query/checkpoint.d.ts +27 -1
- package/dist/runtime/query/checkpoint.d.ts.map +1 -1
- package/dist/runtime/query/checkpoint.js +34 -4
- package/dist/runtime/query/checkpoint.js.map +1 -1
- package/dist/runtime/query/events.d.ts +12 -0
- package/dist/runtime/query/events.d.ts.map +1 -1
- package/dist/runtime/query/events.js +61 -3
- package/dist/runtime/query/events.js.map +1 -1
- package/dist/runtime/query/index.d.ts +57 -1
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +36 -0
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/resume-run.d.ts +34 -1
- package/dist/runtime/query/resume-run.d.ts.map +1 -1
- package/dist/runtime/query/resume-run.js +16 -3
- package/dist/runtime/query/resume-run.js.map +1 -1
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +2 -2
- package/dist/store/index.js.map +1 -1
- package/dist/store/run/checkpoint-disk.d.ts +18 -2
- package/dist/store/run/checkpoint-disk.d.ts.map +1 -1
- package/dist/store/run/checkpoint-disk.js +50 -5
- package/dist/store/run/checkpoint-disk.js.map +1 -1
- package/dist/store/run/checkpoint-memory.d.ts +22 -2
- package/dist/store/run/checkpoint-memory.d.ts.map +1 -1
- package/dist/store/run/checkpoint-memory.js +99 -4
- package/dist/store/run/checkpoint-memory.js.map +1 -1
- package/dist/store/run/claim-disk.d.ts +130 -0
- package/dist/store/run/claim-disk.d.ts.map +1 -0
- package/dist/store/run/claim-disk.js +550 -0
- package/dist/store/run/claim-disk.js.map +1 -0
- package/dist/store/run/conformance.d.ts +159 -0
- package/dist/store/run/conformance.d.ts.map +1 -0
- package/dist/store/run/conformance.js +451 -0
- package/dist/store/run/conformance.js.map +1 -0
- package/dist/store/run/disk.d.ts +30 -2
- package/dist/store/run/disk.d.ts.map +1 -1
- package/dist/store/run/disk.js +101 -0
- package/dist/store/run/disk.js.map +1 -1
- package/dist/store/run/listing.d.ts +44 -1
- package/dist/store/run/listing.d.ts.map +1 -1
- package/dist/store/run/listing.js +92 -1
- package/dist/store/run/listing.js.map +1 -1
- package/dist/store/run/memory.d.ts +5 -4
- package/dist/store/run/memory.d.ts.map +1 -1
- package/dist/store/run/memory.js +30 -1
- package/dist/store/run/memory.js.map +1 -1
- package/dist/types/doctor/check.d.ts +28 -2
- package/dist/types/doctor/check.d.ts.map +1 -1
- package/dist/types/run/checkpoint-store.d.ts +178 -2
- package/dist/types/run/checkpoint-store.d.ts.map +1 -1
- package/dist/types/run/event-cursor.d.ts +90 -0
- package/dist/types/run/event-cursor.d.ts.map +1 -0
- package/dist/types/run/event-cursor.js +47 -0
- package/dist/types/run/event-cursor.js.map +1 -0
- package/dist/types/run/events.d.ts +71 -1
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/events.js.map +1 -1
- package/dist/types/run/index.d.ts +1 -0
- package/dist/types/run/index.d.ts.map +1 -1
- package/dist/types/run/index.js +1 -0
- package/dist/types/run/index.js.map +1 -1
- package/dist/types/run/store.d.ts +41 -1
- package/dist/types/run/store.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/bridge/sse/mapper.ts +28 -1
- package/src/manager/run/persistence.ts +43 -0
- package/src/public-runtime.ts +27 -0
- package/src/run/drain.ts +393 -0
- package/src/run/index.ts +3 -0
- package/src/runtime/query/checkpoint.ts +42 -5
- package/src/runtime/query/events.ts +68 -4
- package/src/runtime/query/index.ts +113 -1
- package/src/runtime/query/resume-run.ts +77 -12
- package/src/store/index.ts +5 -1
- package/src/store/run/checkpoint-disk.ts +70 -5
- package/src/store/run/checkpoint-memory.ts +118 -3
- package/src/store/run/claim-disk.ts +593 -0
- package/src/store/run/conformance.ts +705 -0
- package/src/store/run/disk.ts +106 -2
- package/src/store/run/listing.ts +116 -1
- package/src/store/run/memory.ts +35 -5
- package/src/types/doctor/check.ts +28 -2
- package/src/types/run/checkpoint-store.ts +189 -2
- package/src/types/run/event-cursor.ts +118 -0
- package/src/types/run/events.ts +80 -3
- package/src/types/run/index.ts +1 -0
- package/src/types/run/store.ts +43 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,326 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 21.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 8975cce: `namzu doctor` no longer exits 0 when a check could not answer
|
|
8
|
+
|
|
9
|
+
**What breaks.** `namzu doctor` gains a new exit code, `69`, and a new status
|
|
10
|
+
word, `skipped`.
|
|
11
|
+
|
|
12
|
+
- **A CI step running `namzu doctor` can now fail where it used to pass.** If a
|
|
13
|
+
check times out, is aborted, or the thing it reads throws, the command exits
|
|
14
|
+
`69` instead of `0`. Nothing is claimed to have failed — `1` still means that
|
|
15
|
+
— but the report is incomplete, and it used to say so only in text nothing
|
|
16
|
+
reads. If you need the old behaviour while you look into it, treat `69` as
|
|
17
|
+
success explicitly rather than by accident.
|
|
18
|
+
- **`DoctorStatus` gains `'skipped'`.** An exhaustive `switch` over it, or a
|
|
19
|
+
`Record<DoctorStatus, …>`, stops compiling. Handle `skipped` as "there was
|
|
20
|
+
nothing here to check" — an ordinary state of a healthy machine, not a
|
|
21
|
+
problem.
|
|
22
|
+
- **`DoctorReport['exit']` gains `69`**, and `DoctorReport['summary']` gains a
|
|
23
|
+
required `skipped: number`. Code that constructs a `DoctorReport` by hand must
|
|
24
|
+
add the field; code that reads the summary can now rely on the counts summing
|
|
25
|
+
to `total`, which they did not while `skipped` was hidden inside
|
|
26
|
+
`inconclusive`.
|
|
27
|
+
|
|
28
|
+
**Why.** "Healthy" and "did not manage to look" shared an exit code in the one
|
|
29
|
+
command whose entire job is to report state it read. Fixing that needed the
|
|
30
|
+
status vocabulary split first, because `inconclusive` was carrying two facts:
|
|
31
|
+
_there is nothing here to check_ — an optional package absent, a registry with
|
|
32
|
+
no auto-discovery, nothing configured yet — and _this check did not answer_.
|
|
33
|
+
Only the second is a gap worth an exit code; making both non-zero would have
|
|
34
|
+
turned `namzu doctor` red on every healthy machine.
|
|
35
|
+
|
|
36
|
+
So `vault.registered`, `providers.registered`, `providers.chain` with no
|
|
37
|
+
preferences file, and `telemetry.installed` with the package absent now report
|
|
38
|
+
`skipped`, and they still exit `0`.
|
|
39
|
+
|
|
40
|
+
**Also fixed:** `telemetry.installed` reported `not installed (optional
|
|
41
|
+
package)` for _any_ import failure, so a package that was present and threw on
|
|
42
|
+
load was reported as absent. Resolution and loading are now asked separately —
|
|
43
|
+
cannot resolve is `skipped`, resolves but throws is `fail`, with the reason.
|
|
44
|
+
|
|
45
|
+
**Why 69 and not 2.** `2` already means "no checks registered" here. `namzu
|
|
46
|
+
eval` spells the same idea `2`, which it can because it never spent that number
|
|
47
|
+
on anything else; giving one number two meanings inside one command is worse
|
|
48
|
+
than giving one meaning two numbers across two. `69` is sysexits
|
|
49
|
+
`EX_UNAVAILABLE`.
|
|
50
|
+
|
|
51
|
+
- 1582bdb: Run events carry a sequence, and the log can be read back
|
|
52
|
+
|
|
53
|
+
A consumer that loses its connection mid-run can now reconnect at a cursor and
|
|
54
|
+
receive every non-ephemeral event it missed — exactly once, in order, across a
|
|
55
|
+
process restart. Before this the event envelope carried no position at all, the
|
|
56
|
+
durable store had no read-back over the log, and a returning consumer had to
|
|
57
|
+
re-derive the whole run from scratch.
|
|
58
|
+
|
|
59
|
+
**Breaking, and it is one line if you implement `RunStore` yourself:** the
|
|
60
|
+
contract gains a required `readEvents(options?)`. Add it and you are done; both
|
|
61
|
+
shipped stores implement it. It is required rather than optional because a store
|
|
62
|
+
that records a transcript it cannot read back is write-only evidence, which is
|
|
63
|
+
the defect this contract exists to fix one level up — and optional would push a
|
|
64
|
+
capability hole into anything built on top of it.
|
|
65
|
+
|
|
66
|
+
**Nothing else breaks.** `seq` and `generation` are optional on the envelope, so
|
|
67
|
+
code that constructs `RunEvent` values still compiles. `RunEvent`'s
|
|
68
|
+
`schemaVersion` is deliberately NOT bumped: the version is for breaking envelope
|
|
69
|
+
changes, and a v4 stamp would imply `seq` is present when its absence is
|
|
70
|
+
meaningful.
|
|
71
|
+
|
|
72
|
+
What you get:
|
|
73
|
+
|
|
74
|
+
- **`seq` means the event is in the durable log.** The emitter takes a number,
|
|
75
|
+
appends the event stamped with it, and only a write that landed advances the
|
|
76
|
+
counter and reaches the live stream — so a cursor never points past the
|
|
77
|
+
evidence. Its absence is equally load-bearing: the high-frequency events that
|
|
78
|
+
are never persisted, an event whose durable write failed, and the delegation
|
|
79
|
+
lifecycle events the agent manager hands straight to your listener without
|
|
80
|
+
passing through the run's log. Never advance a cursor onto an event with no
|
|
81
|
+
`seq`.
|
|
82
|
+
- **`RunStore.readEvents({ sinceSeq })`**, exclusive on the cursor, oldest
|
|
83
|
+
first. Plus `readRunEventsIn(runDir)` for reading a run this process never
|
|
84
|
+
started — binding a `RunDiskStore` to read would create the run's directory.
|
|
85
|
+
- **`QueryParams.eventCursor` and `onEventReplay`**, and on `resumeRun` a
|
|
86
|
+
`listener` plus the verdict on its outcome. `resumeRun` previously drained the
|
|
87
|
+
run and discarded every event it produced, so the one API for continuing a run
|
|
88
|
+
another process started could not show anybody what the run was doing.
|
|
89
|
+
- **A typed verdict rather than a best effort.** `complete`, `replayed`, or
|
|
90
|
+
`unavailable` with `cursor_ahead`, `generation_changed` or `gap`. On any
|
|
91
|
+
refusal the run still resumes and nothing from the log is delivered, because a
|
|
92
|
+
consumer that receives a short catch-up folds a hole into its state and cannot
|
|
93
|
+
tell. `resolveRunEventReplay` is exported and pure.
|
|
94
|
+
- **`generation` is the claim fence**, so a takeover is ordered rather than
|
|
95
|
+
merely detectable. Absent on an unfenced run.
|
|
96
|
+
- **`MappedStreamEvent.id`** — `"<runId>:<seq>"`, keyed on the event's own run
|
|
97
|
+
because a parent's stream carries its children's events and each run numbers
|
|
98
|
+
its own log.
|
|
99
|
+
|
|
100
|
+
Three defects fixed on the way, each of which falsified the property:
|
|
101
|
+
|
|
102
|
+
- `resumeRun` dropped `parentRunId`, so a resumed **sub-run** bound
|
|
103
|
+
`<base>/<runId>` instead of `<base>/<parent>/children/<runId>` — a second,
|
|
104
|
+
empty transcript under a run id that already had one.
|
|
105
|
+
- `InMemoryRunStore.initRun` rebound to a new run id without clearing, so one
|
|
106
|
+
instance reused for a fork reported the previous run's evidence as this one's.
|
|
107
|
+
- A `transcript.jsonl` cut off mid-write merged its fragment with the **next**
|
|
108
|
+
whole event into one unparsable line, losing an event the emitter had counted
|
|
109
|
+
as durable. `initRun` now terminates a torn tail.
|
|
110
|
+
|
|
111
|
+
Not in scope, and stated because implying otherwise would be worse: streaming
|
|
112
|
+
deltas stay non-durable. What a late subscriber recovers is message-granular —
|
|
113
|
+
aggregated assistant text, tool results and the full lifecycle — not the
|
|
114
|
+
keystroke cadence that produced them. And the run store still takes no claim
|
|
115
|
+
fence, so monotonicity is a single-writer guarantee; `generation` is what makes
|
|
116
|
+
a second writer detectable rather than silent.
|
|
117
|
+
|
|
118
|
+
### Minor Changes
|
|
119
|
+
|
|
120
|
+
- 4df5cf1: `drainRuns` — the queue loop the cross-process claim shipped without
|
|
121
|
+
|
|
122
|
+
`claimRun`, `releaseRun`, the fenced `writeCheckpoint`, `listDurableRuns({ claimed: false })` and `resumeRun({ claimFence })` were all already here, and nothing outside the store's own tests called any of them. The two things the claim was built for — an approval inbox and a crash sweeper — still needed every host to write the same loop, including the two parts a host writes wrong: the release that belongs in a `finally` so a FAILED run goes back on the queue too, and the `null` claim that means "somebody got there first" rather than an error.
|
|
123
|
+
|
|
124
|
+
New: `drainRuns({ store, scope, holder, ttlMs, onRun, park?, signal?, maxConcurrent?, pageSize?, now? })`, plus the types `DrainRun`, `DrainRunsParams`, `DrainRunsResult`, `DrainFailure` and the constant `DEFAULT_DRAIN_PAGE_SIZE`. One bounded pass: list what nobody holds, claim it, hand it to your callback with its claim, release it. No timers, no processes, no `while (true)` — running it again is your scheduler's job.
|
|
125
|
+
|
|
126
|
+
**Read this before relying on "exactly once".** Two drainers never hold one run at the same time; that is absolute. Exactly-once over a pass is weaker and comes from the FILTER, not the claim: a listing is a snapshot, so between paging a row and claiming it another drainer can finish that run and release it. A claimed row is therefore re-read against `park` before any work starts, and one that no longer matches comes back as `stale`. An inbox drain (`park: ['outstanding']`) whose work answers the park is exactly-once. **With no park filter there is nothing to re-check and two drainers can both process one run** — a checkpoint store holds no run status by design, so "already done" is a fact only your own run records carry, and a crash sweep intersects with them inside `onRun`.
|
|
127
|
+
|
|
128
|
+
A store missing `listDurableRuns`, `claimRun` or `releaseRun` is refused with `capability_unavailable` **before anything is listed**, naming all three. It never degrades to "claimed by default", which would let every worker proceed on every run.
|
|
129
|
+
|
|
130
|
+
`@namzu/cli` gains `namzu drain --store <dir> --tenant <id> --project <id> --session <id>`, which claims each unheld run under that scope and continues it from its last checkpoint under that claim's fence. It is one pass and then exit: `namzu serve` still answers that namzu has no daemon, and this command is the shape that refusal implies — something your scheduler runs, not a service namzu owns. A run parked on a human decision is reported, never resumed past. Additive on both packages; nothing existing changes behaviour.
|
|
131
|
+
|
|
132
|
+
- 5dc8b82: Publish the checkpoint-store conformance suite at `@namzu/sdk/testing`
|
|
133
|
+
|
|
134
|
+
`CheckpointStore` is an interface a host is expected to implement, and the
|
|
135
|
+
in-memory store's source calls itself "the reference a host reads when writing a
|
|
136
|
+
backend of its own". That claim was unbacked. Two days before this change the
|
|
137
|
+
two shipped implementations disagreed at the enforcement point — the in-memory
|
|
138
|
+
one accepted a checkpoint from a worker that had been superseded and then
|
|
139
|
+
released around, the disk one refused it — and the class documented as the
|
|
140
|
+
reference was the one carrying the defect. Nothing threw, nothing logged, and a
|
|
141
|
+
completed worker's checkpoint was silently replaced by a dead worker's. A host
|
|
142
|
+
writing its own backend had no way to find that out.
|
|
143
|
+
|
|
144
|
+
New: a `./testing` subpath exporting `defineCheckpointStoreConformance` and
|
|
145
|
+
`CHECKPOINT_STORE_CONTRACT_VERSION`. Nothing existing changes; the package's one
|
|
146
|
+
existing export is untouched.
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
import { describe, expect, it } from "vitest";
|
|
150
|
+
import { defineCheckpointStoreConformance } from "@namzu/sdk/testing";
|
|
151
|
+
|
|
152
|
+
defineCheckpointStoreConformance({
|
|
153
|
+
describe,
|
|
154
|
+
it,
|
|
155
|
+
expect,
|
|
156
|
+
label: "my-backend",
|
|
157
|
+
contractVersion: 1,
|
|
158
|
+
capabilities: { claims: true, listing: true, multiTenant: true },
|
|
159
|
+
makeStore: async (binding) => ({ store: await MyStore.connect(binding) }),
|
|
160
|
+
});
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
The suite takes `describe`, `it` and `expect` as arguments, so it binds to no
|
|
164
|
+
test runner and installing `@namzu/sdk` pulls in no test dependency. It
|
|
165
|
+
covers the four rules the types cannot state and the two built-in stores
|
|
166
|
+
actually diverged on: claim exclusivity, claim expiry, refusal of a fenced-out
|
|
167
|
+
write, and listing scope isolation across tenants. `capabilities` names what
|
|
168
|
+
your backend can do so the suite asks only what it can answer.
|
|
169
|
+
|
|
170
|
+
**Take note before you wire it in.** Once you do, every assertion in the suite
|
|
171
|
+
is something your build fails on — so the suite's assertions are public API from
|
|
172
|
+
here, and tightening or adding one is a `major` for this package rather than a
|
|
173
|
+
`minor`, even though it adds no export. `contractVersion` is the seam that makes
|
|
174
|
+
such a bump legible: write the number as a literal (do **not** re-export the
|
|
175
|
+
constant, which makes the check unfailable), and a contract revision then fails
|
|
176
|
+
with `expected 'checkpoint-store contract v1' to be 'checkpoint-store contract
|
|
177
|
+
v2'` instead of a scatter of assertion failures whose common cause is not
|
|
178
|
+
obvious.
|
|
179
|
+
|
|
180
|
+
Documented at `docs/sdk/runtime/checkpoint-store-conformance.md`.
|
|
181
|
+
|
|
182
|
+
## 20.4.0
|
|
183
|
+
|
|
184
|
+
### Minor Changes
|
|
185
|
+
|
|
186
|
+
- 249e1e5: Parked runs can now go on a queue with more than one reader.
|
|
187
|
+
`CheckpointStore.claimRun` takes exclusive working possession of a run;
|
|
188
|
+
`releaseRun` gives it back; `writeCheckpoint` takes an optional fence and
|
|
189
|
+
refuses a write from a worker that has been superseded.
|
|
190
|
+
|
|
191
|
+
Without this the only safe deployment was one writer per run, enforced
|
|
192
|
+
outside the SDK. Two workers would restore the same checkpoint, both execute
|
|
193
|
+
its tools, and both write under one run id — each write minting a fresh
|
|
194
|
+
checkpoint id, so two divergent chains land in one list and the pending
|
|
195
|
+
lookup returns whichever wrote last. Half the work vanishes and nothing
|
|
196
|
+
reports an error.
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
import { claimRun, listDurableRuns, releaseRun } from "@namzu/sdk";
|
|
200
|
+
|
|
201
|
+
const page = await listDurableRuns(
|
|
202
|
+
store,
|
|
203
|
+
{ tenantId },
|
|
204
|
+
{
|
|
205
|
+
park: ["outstanding"],
|
|
206
|
+
claimed: false, // only what nobody is working on
|
|
207
|
+
orderBy: "createdAt", // oldest first
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
for (const entry of page.entries) {
|
|
212
|
+
const claim = await claimRun(store, entry, {
|
|
213
|
+
holder: "worker-3",
|
|
214
|
+
ttlMs: 60_000,
|
|
215
|
+
});
|
|
216
|
+
if (!claim) continue; // somebody else got there first — not an error
|
|
217
|
+
try {
|
|
218
|
+
await drainQuery({ ...params, claimFence: claim.fence });
|
|
219
|
+
} finally {
|
|
220
|
+
await releaseRun(store, entry, claim.fence);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## What the fence covers, and what it does not
|
|
226
|
+
|
|
227
|
+
**The fence protects checkpoints. It does not yet protect the rest of a run's
|
|
228
|
+
durable state.** Read this before you rely on it.
|
|
229
|
+
|
|
230
|
+
`writeCheckpoint` is the only write that takes a fence today. When a run
|
|
231
|
+
settles it also writes its run record, its full message history, its report
|
|
232
|
+
and its index row, and all four go through a different store that has no
|
|
233
|
+
fence parameter. So two workers that both took the same run — because one
|
|
234
|
+
stalled past its lease and the other reclaimed it — are stopped from
|
|
235
|
+
corrupting the checkpoint chain, and **still overwrite each other's run
|
|
236
|
+
record, transcript and report.**
|
|
237
|
+
|
|
238
|
+
That is a real bound, not a theoretical one. It means a claim today buys you
|
|
239
|
+
a coherent resume point, not a coherent run.
|
|
240
|
+
|
|
241
|
+
Closing it needs the run store to become injectable and fence-aware. It is now
|
|
242
|
+
injectable — `QueryParams.runStore` — and it is still not fence-aware: no
|
|
243
|
+
method on `RunStore` takes a fence, so injecting one does not close this. Until
|
|
244
|
+
it does, treat a claim as protecting the state a resume reads and assume the
|
|
245
|
+
settle-time artefacts are last-writer-wins. If that is not good enough for your
|
|
246
|
+
deployment, keep one writer per run.
|
|
247
|
+
|
|
248
|
+
**It is a lease, not a lock.** A lock held by a process that dies is held
|
|
249
|
+
forever and its runs need a human with a shell. Calling `claimRun` on a run
|
|
250
|
+
whose claim has expired succeeds and mints a higher fence; the dead holder is
|
|
251
|
+
not notified — it cannot be — it simply stops being able to write.
|
|
252
|
+
|
|
253
|
+
**That is what the fence is for.** A holder does not know it has expired: a
|
|
254
|
+
long pause, a suspended container and a partition all look from the inside
|
|
255
|
+
like time not passing, so it wakes and writes as though it still holds.
|
|
256
|
+
Liveness cannot be checked. What can be checked, at the write, is whether the
|
|
257
|
+
holding that write belongs to is still the current one — so `ClaimFence` is a
|
|
258
|
+
monotonically increasing number rather than a random token, because
|
|
259
|
+
randomness proves identity and cannot establish order.
|
|
260
|
+
|
|
261
|
+
**Nothing you have implemented breaks.** Both methods are optional on the
|
|
262
|
+
interface, so an existing custom `CheckpointStore` still satisfies it, and
|
|
263
|
+
`writeCheckpoint`'s new third parameter is optional. An unfenced write is
|
|
264
|
+
still accepted even on a claimed run — a host adopting claims on one worker
|
|
265
|
+
must not break the workers that have not adopted them yet.
|
|
266
|
+
|
|
267
|
+
Calling `claimRun` against a store that does not implement it raises
|
|
268
|
+
`capability_unavailable` rather than proceeding unclaimed. Skipping an absent
|
|
269
|
+
optional method is the natural thing to do here and the fatal one.
|
|
270
|
+
|
|
271
|
+
Also new: `claim` on `DurableRunEntry` and `claimed` on
|
|
272
|
+
`ListDurableRunsOptions`, so a queue reader can ask for the work nobody
|
|
273
|
+
holds. An **expired** claim counts as unheld — that is what expiry means, and
|
|
274
|
+
a reader that treated it as held would leave a dead worker's runs invisible
|
|
275
|
+
forever. New types: `RunClaim`, `ClaimFence`, `ClaimSummary`,
|
|
276
|
+
`ClaimRunOptions`. New helpers: `claimRun`, `releaseRun`, `toClaimSummary`,
|
|
277
|
+
`fencedOut`.
|
|
278
|
+
|
|
279
|
+
The built-in disk store keeps one file per holding, named for its fence, and
|
|
280
|
+
takes a run by exclusively creating the next number — so the kernel picks the
|
|
281
|
+
winner, the counter cannot rewind across a release, and a body nobody can
|
|
282
|
+
parse never hides the ordering.
|
|
283
|
+
|
|
284
|
+
It publishes that name with `link`: the body is written to a scratch name in
|
|
285
|
+
the same directory and the fence name is created as a second reference to it.
|
|
286
|
+
A plain exclusive create is open-then-write, so the winning name exists empty
|
|
287
|
+
for an instant, and a reader landing there reports a live holding as expired —
|
|
288
|
+
which puts a second worker on a running run, with both restoring it and
|
|
289
|
+
executing its tools before either is refused. Publishing through `link` means
|
|
290
|
+
the name never exists before the body under it.
|
|
291
|
+
|
|
292
|
+
**This needs a filesystem with hard links, and it says so rather than
|
|
293
|
+
guessing.** The scratch file must be in the same directory as its destination
|
|
294
|
+
(`link` across filesystems fails `EXDEV`), which the store handles. If the
|
|
295
|
+
volume supports no hard link at all — some network and removable volumes —
|
|
296
|
+
`claimRun` raises `capability_unavailable` naming the code the filesystem
|
|
297
|
+
returned. It refuses rather than falling back, because the only fallback is
|
|
298
|
+
the non-atomic create described above and a claim that silently stops being
|
|
299
|
+
exclusive is worse than one that will not start: the host cannot tell which it
|
|
300
|
+
got. Put the base directory on a filesystem with hard-link support, or run a
|
|
301
|
+
single writer per run. This case is unmeasured — no such volume was available
|
|
302
|
+
to test — and the error says so instead of implying a diagnosis.
|
|
303
|
+
|
|
304
|
+
**If you implement this yourself**, four properties the fence comparison
|
|
305
|
+
depends on and none of which the kernel can check: a fence must exceed every
|
|
306
|
+
fence ever issued for that run, including across a release; fences must be
|
|
307
|
+
unique, because the check is `<` and equality admits both holders; the check
|
|
308
|
+
must be atomic with the write; and `holder` must be unique per process, since
|
|
309
|
+
it is the only thing separating a renewal from a theft. They are on the
|
|
310
|
+
`claimRun` doc comment in full.
|
|
311
|
+
|
|
312
|
+
`InMemoryCheckpointStore` implements it too, and is single-process by
|
|
313
|
+
construction — use it for tests and single-writer hosts, not for two workers.
|
|
314
|
+
It enforces the fence against the same high-water mark it mints from, so the
|
|
315
|
+
two shipped stores refuse exactly the same writes. They did not, briefly, and
|
|
316
|
+
the divergence was worth naming: the in-memory store checked the _live_ claim,
|
|
317
|
+
which a release deletes, so a worker that stalled could still write after
|
|
318
|
+
another worker had reclaimed the run, finished it and released cleanly. That
|
|
319
|
+
is not a duplicate — it is a **silent loss**, because the stale write carries a
|
|
320
|
+
fresh timestamp and becomes what the next resume restores. A host writing its
|
|
321
|
+
own backend reads the in-memory store as the reference, so check the
|
|
322
|
+
high-water mark, not the current holding.
|
|
323
|
+
|
|
3
324
|
## 20.3.0
|
|
4
325
|
|
|
5
326
|
### Minor Changes
|
|
@@ -4,6 +4,25 @@ import type { RunEvent } from '../../types/run/events.js';
|
|
|
4
4
|
export interface MappedStreamEvent {
|
|
5
5
|
wire: StreamEventType;
|
|
6
6
|
data: Record<string, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* The cursor a client resubscribes at, as `<runId>:<seq>`.
|
|
9
|
+
*
|
|
10
|
+
* Not a bare number, and the reason is structural: a parent's stream also
|
|
11
|
+
* carries its children's events, each numbered in its OWN run's log, so one
|
|
12
|
+
* scalar over a mixed stream would compare positions from two different
|
|
13
|
+
* sequences. The run id is what makes the position addressable — a client
|
|
14
|
+
* keeps one cursor per run id and sends the right one back.
|
|
15
|
+
*
|
|
16
|
+
* This is what an SSE `id:` line should carry, which is why it sits beside
|
|
17
|
+
* the payload rather than inside it: a framer writes it without having to
|
|
18
|
+
* understand what kind of event it is.
|
|
19
|
+
*
|
|
20
|
+
* Absent when the event is not recoverable — every ephemeral event, every
|
|
21
|
+
* event whose durable write failed, and every delegation-lifecycle event
|
|
22
|
+
* that never passed through the run's log at all. A client must not advance
|
|
23
|
+
* its cursor on one, and the absence is how it knows.
|
|
24
|
+
*/
|
|
25
|
+
id?: string;
|
|
7
26
|
}
|
|
8
27
|
export declare function mapRunToStreamEvent(event: RunEvent, runId: RunId): MappedStreamEvent | null;
|
|
9
28
|
/** @deprecated Use mapRunToStreamEvent */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../src/bridge/sse/mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,eAAe,CAAA;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../src/bridge/sse/mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,eAAe,CAAA;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B;;;;;;;;;;;;;;;;;OAiBG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;CACX;AAufD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,iBAAiB,GAAG,IAAI,CA0B3F;AAED,0CAA0C;AAC1C,eAAO,MAAM,uBAAuB,4BAAsB,CAAA"}
|
|
@@ -454,7 +454,15 @@ export function mapRunToStreamEvent(event, runId) {
|
|
|
454
454
|
if ('parentTaskId' in annotated && annotated.parentTaskId) {
|
|
455
455
|
data.parent_task_id = annotated.parentTaskId;
|
|
456
456
|
}
|
|
457
|
-
|
|
457
|
+
// Keyed on the event's OWN run id, not the stream's. A child's event
|
|
458
|
+
// arriving on a parent's stream is numbered in the child's log, so stamping
|
|
459
|
+
// the enclosing run here would produce a cursor that addresses the wrong
|
|
460
|
+
// sequence — and it would look right.
|
|
461
|
+
return {
|
|
462
|
+
wire: mapping.wire,
|
|
463
|
+
data,
|
|
464
|
+
...(event.seq !== undefined ? { id: `${event.runId}:${event.seq}` } : {}),
|
|
465
|
+
};
|
|
458
466
|
}
|
|
459
467
|
/** @deprecated Use mapRunToStreamEvent */
|
|
460
468
|
export const mapSessionToStreamEvent = mapRunToStreamEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.js","sourceRoot":"","sources":["../../../src/bridge/sse/mapper.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,GAET;IACH,WAAW,EAAE;QACZ,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACzB,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,CAAC,CAAC,YAAY,IAAI,IAAI;SACrC,CAAC;KACF;IAED,iBAAiB,EAAE;QAClB,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;KACpE;IAED,mBAAmB,EAAE;QACpB,IAAI,EAAE,qBAAqB;QAC3B,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;KACpE;IAED,iBAAiB,EAAE;QAClB,IAAI,EAAE,mBAAmB;QACzB,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACzB,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,UAAU,EAAE,CAAC,CAAC,SAAS;YACvB,WAAW,EAAE,CAAC,CAAC,UAAU;YACzB,cAAc,EAAE,CAAC,CAAC,aAAa;SAC/B,CAAC;KACF;IAED,eAAe,EAAE;QAChB,IAAI,EAAE,iBAAiB;QACvB,SAAS,EA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S,IAAI,SAAS,CAAC,YAAY,EAAE,CAAC;QAC3D,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,YAAY,CAAA;IAC7C,CAAC;IAED,qEAAqE;IACrE,4EAA4E;IAC5E,yEAAyE;IACzE,sCAAsC;IACtC,OAAO;QACN,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI;QACJ,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAA;AACF,CAAC;AAED,0CAA0C;AAC1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAA"}
|
|
@@ -31,16 +31,16 @@ export declare const RunConfigSchema: z.ZodObject<{
|
|
|
31
31
|
temperature?: number | undefined;
|
|
32
32
|
tokenBudget?: number | undefined;
|
|
33
33
|
maxResponseTokens?: number | undefined;
|
|
34
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
35
34
|
systemPrompt?: string | undefined;
|
|
35
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
36
36
|
}, {
|
|
37
37
|
timeoutMs?: number | undefined;
|
|
38
38
|
model?: string | undefined;
|
|
39
39
|
temperature?: number | undefined;
|
|
40
40
|
tokenBudget?: number | undefined;
|
|
41
41
|
maxResponseTokens?: number | undefined;
|
|
42
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
43
42
|
systemPrompt?: string | undefined;
|
|
43
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
44
44
|
}>;
|
|
45
45
|
export declare const CreateMessageSchema: z.ZodObject<{
|
|
46
46
|
role: z.ZodLiteral<"user">;
|
|
@@ -71,16 +71,16 @@ export declare const CreateRunSchema: z.ZodObject<{
|
|
|
71
71
|
temperature?: number | undefined;
|
|
72
72
|
tokenBudget?: number | undefined;
|
|
73
73
|
maxResponseTokens?: number | undefined;
|
|
74
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
75
74
|
systemPrompt?: string | undefined;
|
|
75
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
76
76
|
}, {
|
|
77
77
|
timeoutMs?: number | undefined;
|
|
78
78
|
model?: string | undefined;
|
|
79
79
|
temperature?: number | undefined;
|
|
80
80
|
tokenBudget?: number | undefined;
|
|
81
81
|
maxResponseTokens?: number | undefined;
|
|
82
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
83
82
|
systemPrompt?: string | undefined;
|
|
83
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
84
84
|
}>;
|
|
85
85
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
86
86
|
stream: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -91,8 +91,8 @@ export declare const CreateRunSchema: z.ZodObject<{
|
|
|
91
91
|
temperature?: number | undefined;
|
|
92
92
|
tokenBudget?: number | undefined;
|
|
93
93
|
maxResponseTokens?: number | undefined;
|
|
94
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
95
94
|
systemPrompt?: string | undefined;
|
|
95
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
96
96
|
};
|
|
97
97
|
agent_id: string;
|
|
98
98
|
env?: Record<string, string> | undefined;
|
|
@@ -104,8 +104,8 @@ export declare const CreateRunSchema: z.ZodObject<{
|
|
|
104
104
|
temperature?: number | undefined;
|
|
105
105
|
tokenBudget?: number | undefined;
|
|
106
106
|
maxResponseTokens?: number | undefined;
|
|
107
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
108
107
|
systemPrompt?: string | undefined;
|
|
108
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
109
109
|
};
|
|
110
110
|
agent_id: string;
|
|
111
111
|
env?: Record<string, string> | undefined;
|
|
@@ -128,16 +128,16 @@ export declare const CreateStatelessRunSchema: z.ZodObject<{
|
|
|
128
128
|
temperature?: number | undefined;
|
|
129
129
|
tokenBudget?: number | undefined;
|
|
130
130
|
maxResponseTokens?: number | undefined;
|
|
131
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
132
131
|
systemPrompt?: string | undefined;
|
|
132
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
133
133
|
}, {
|
|
134
134
|
timeoutMs?: number | undefined;
|
|
135
135
|
model?: string | undefined;
|
|
136
136
|
temperature?: number | undefined;
|
|
137
137
|
tokenBudget?: number | undefined;
|
|
138
138
|
maxResponseTokens?: number | undefined;
|
|
139
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
140
139
|
systemPrompt?: string | undefined;
|
|
140
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
141
141
|
}>;
|
|
142
142
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
143
143
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -148,8 +148,8 @@ export declare const CreateStatelessRunSchema: z.ZodObject<{
|
|
|
148
148
|
temperature?: number | undefined;
|
|
149
149
|
tokenBudget?: number | undefined;
|
|
150
150
|
maxResponseTokens?: number | undefined;
|
|
151
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
152
151
|
systemPrompt?: string | undefined;
|
|
152
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
153
153
|
};
|
|
154
154
|
agent_id: string;
|
|
155
155
|
env?: Record<string, string> | undefined;
|
|
@@ -161,8 +161,8 @@ export declare const CreateStatelessRunSchema: z.ZodObject<{
|
|
|
161
161
|
temperature?: number | undefined;
|
|
162
162
|
tokenBudget?: number | undefined;
|
|
163
163
|
maxResponseTokens?: number | undefined;
|
|
164
|
-
permissionMode?: "plan" | "auto" | undefined;
|
|
165
164
|
systemPrompt?: string | undefined;
|
|
165
|
+
permissionMode?: "plan" | "auto" | undefined;
|
|
166
166
|
};
|
|
167
167
|
agent_id: string;
|
|
168
168
|
env?: Record<string, string> | undefined;
|
|
@@ -46,7 +46,33 @@ export declare class RunPersistence {
|
|
|
46
46
|
/** Full five-layer scope key for this run's checkpoint operations. */
|
|
47
47
|
getRunScope(): CheckpointRunScope;
|
|
48
48
|
getRunDir(): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Highest sequence already in this run's durable event log.
|
|
51
|
+
*
|
|
52
|
+
* Seeded by {@link init} and advanced by {@link commitEventSeq}. Held here
|
|
53
|
+
* rather than on the event translator because the translator is built
|
|
54
|
+
* before `init` has run and would need a second, forgettable hop to learn
|
|
55
|
+
* the seed — where `init` is already mandatory, already awaited, and
|
|
56
|
+
* already the thing that binds the store.
|
|
57
|
+
*/
|
|
58
|
+
private _lastEventSeq;
|
|
59
|
+
/** Highest sequence this run's log holds. Zero before anything is recorded. */
|
|
60
|
+
get lastEventSeq(): number;
|
|
49
61
|
init(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* The number the NEXT durable event would take. Not yet taken — see
|
|
64
|
+
* {@link commitEventSeq}.
|
|
65
|
+
*/
|
|
66
|
+
nextEventSeq(): number;
|
|
67
|
+
/**
|
|
68
|
+
* Take the candidate number, once its event is actually in the log.
|
|
69
|
+
*
|
|
70
|
+
* Split from {@link nextEventSeq} so a failed append consumes nothing: a
|
|
71
|
+
* `seq` is a claim that the event is recoverable, and advancing the counter
|
|
72
|
+
* before the write lands would leave a hole no event fills and hand a live
|
|
73
|
+
* consumer a cursor pointing at it.
|
|
74
|
+
*/
|
|
75
|
+
commitEventSeq(seq: number): void;
|
|
50
76
|
markRunning(): void;
|
|
51
77
|
markCompleted(stopReason?: StopReason): void;
|
|
52
78
|
markFailed(error: string, providerError?: ProviderErrorInfo): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../../src/manager/run/persistence.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAwB,MAAM,6BAA6B,CAAA;AAClG,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM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H,iBAAiB,IAAI,MAAM;IAK3B,gEAAgE;IAChE,OAAO,CAAC,gBAAgB,CAAQ;IAEhC,OAAO,CAAC,aAAa;IAuCrB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAchD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB9B"}
|
|
@@ -138,10 +138,50 @@ export class RunPersistence {
|
|
|
138
138
|
getRunDir() {
|
|
139
139
|
return this.runStore.getRunDir();
|
|
140
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Highest sequence already in this run's durable event log.
|
|
143
|
+
*
|
|
144
|
+
* Seeded by {@link init} and advanced by {@link commitEventSeq}. Held here
|
|
145
|
+
* rather than on the event translator because the translator is built
|
|
146
|
+
* before `init` has run and would need a second, forgettable hop to learn
|
|
147
|
+
* the seed — where `init` is already mandatory, already awaited, and
|
|
148
|
+
* already the thing that binds the store.
|
|
149
|
+
*/
|
|
150
|
+
_lastEventSeq = 0;
|
|
151
|
+
/** Highest sequence this run's log holds. Zero before anything is recorded. */
|
|
152
|
+
get lastEventSeq() {
|
|
153
|
+
return this._lastEventSeq;
|
|
154
|
+
}
|
|
141
155
|
async init() {
|
|
142
156
|
await this.runStore.initRun(this.run.id, this.run.parentRunId);
|
|
157
|
+
// A resume reuses the run id and therefore the same log, so the counter
|
|
158
|
+
// has to continue that log rather than start a second sequence inside
|
|
159
|
+
// it. Without this, a run recalled after a crash re-numbers from 1 and a
|
|
160
|
+
// consumer holding a cursor at 40 is told, truthfully and uselessly,
|
|
161
|
+
// that there is nothing above it.
|
|
162
|
+
const existing = await this.runStore.readEvents();
|
|
163
|
+
this._lastEventSeq = existing.at(-1)?.seq ?? 0;
|
|
143
164
|
await this.runStore.writeRunMeta(this.run);
|
|
144
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* The number the NEXT durable event would take. Not yet taken — see
|
|
168
|
+
* {@link commitEventSeq}.
|
|
169
|
+
*/
|
|
170
|
+
nextEventSeq() {
|
|
171
|
+
return this._lastEventSeq + 1;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Take the candidate number, once its event is actually in the log.
|
|
175
|
+
*
|
|
176
|
+
* Split from {@link nextEventSeq} so a failed append consumes nothing: a
|
|
177
|
+
* `seq` is a claim that the event is recoverable, and advancing the counter
|
|
178
|
+
* before the write lands would leave a hole no event fills and hand a live
|
|
179
|
+
* consumer a cursor pointing at it.
|
|
180
|
+
*/
|
|
181
|
+
commitEventSeq(seq) {
|
|
182
|
+
if (seq > this._lastEventSeq)
|
|
183
|
+
this._lastEventSeq = seq;
|
|
184
|
+
}
|
|
145
185
|
markRunning() {
|
|
146
186
|
this.run.status = 'running';
|
|
147
187
|
}
|