@voltro/runtime 0.32.0 → 0.33.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 +205 -0
- package/THIRD-PARTY-NOTICES.md +1 -29
- package/dist/index.d.ts +199 -23
- package/dist/index.js +1551 -1487
- package/package.json +16 -10
package/CHANGELOG.md
CHANGED
|
@@ -39,6 +39,211 @@ _Changes staged for the next release accumulate here (rolled up from
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
+
## [0.33.0] — 2026-08-11
|
|
43
|
+
|
|
44
|
+
### ⚠ BREAKING
|
|
45
|
+
|
|
46
|
+
- **@voltro/protocol, @voltro/runtime, @voltro/voltro** — `CoordinatedScheduleHandle` gained `wake()`, `currentIntervalMs()` and `isArmed()`.
|
|
47
|
+
|
|
48
|
+
The type change that carries the poller work in this release (see *A coordinated tick is a FLOOR*). Two of the three shapes it touches are NOT breaking and are listed here so the classification is checkable rather than asserted:
|
|
49
|
+
|
|
50
|
+
- the effect parameter was **widened** — it may now return a tick outcome, and an existing `() => Promise<void>` still satisfies it; - `Coordinator.tryClaim` gained an **optional** third parameter (the caller's bucket width), so an existing implementation still conforms.
|
|
51
|
+
|
|
52
|
+
(The plugin-facing `scheduleCoordinated` also gained an OPTIONAL fourth argument, `{ disarmWhenIdle }` — additive, and how a plugin opts its own task out of polling entirely.)
|
|
53
|
+
|
|
54
|
+
What breaks is code that **constructs** a handle rather than receiving one: a hand-written test double of `PluginBindContext`, which is the ordinary way to unit-test a plugin's `bindDataStore`. Four of the framework's own suites carried one, and three of those compiled only because the stub was cast — which is also why the two new members must be REQUIRED rather than optional. An optional `wake()` would let a caller subscribe a change channel to a handle that silently has none, and a poller that never wakes is the failure this release exists to remove, arriving quietly.
|
|
55
|
+
|
|
56
|
+
The codemod is `manual`: the object literal needing the two fields carries no importable symbol and usually sits behind an `as never`, so no transform can tell it apart from an unrelated literal in the same test file. It is gated on the app mentioning `scheduleCoordinated` at all.
|
|
57
|
+
- **@voltro/runtime** — `@effect/opentelemetry` is now an **optional peer** of `@voltro/runtime` instead of a dependency. **If you export traces or metrics, install it:**
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
pnpm add @effect/opentelemetry
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If you do not (no `FRAMEWORK_TRACING`, no `FRAMEWORK_METRICS`, no `OTEL_EXPORTER_OTLP_*`), nothing changes and your install gets 24 lines quieter.
|
|
64
|
+
|
|
65
|
+
It is reached from one dynamic `import()`, only when tracing is on, and it declares seven non-optional OpenTelemetry peers of which we supply five. So every `pnpm install` of every consumer ended with an unmet-peer block describing a condition that broke nothing. Declaring the two missing peers as real dependencies was the wrong direction — one of them is `@opentelemetry/sdk-trace-web`, the BROWSER tracer — and 0.64.0 is the current stable, so there is no upstream release marking them optional to wait for.
|
|
66
|
+
|
|
67
|
+
The reporting consumer's argument is what decided it: *"a check that is loud on every upgrade teaches people to skip the output, and the next warning in that block is the one that matters. We read past this one for four releases."*
|
|
68
|
+
|
|
69
|
+
A boot with tracing enabled and the package absent fails with a message naming this install line — a startup failure, not a silent loss of telemetry.
|
|
70
|
+
|
|
71
|
+
**`voltro update` carries you across this** — codemod `0.33.0/01_opentelemetry-optional-peer`.
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- **@voltro/cli** — `voltro agents-md` now reports which `@voltro/cli` it seeded from, and warns when that is not the one the project installs.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
seeded from @voltro/cli 0.31.0 (project has 0.32.0; whats-new describes 0.31.0;
|
|
79
|
+
modules COPIED into ./agent-docs)
|
|
80
|
+
WARN the `voltro` binary that ran is 0.31.0, but this project installs 0.32.0 —
|
|
81
|
+
everything just written describes the OLDER version.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
A consumer reported a freshly-seeded `agent-docs/whats-new.md` one release behind their installed version, twice. The published packages are correct (verified with `npm pack`), so the content came from a different `@voltro/cli` than the one they installed — the command reads its templates relative to the RUNNING binary, and a globally-installed `voltro`, a stale `dist`, or a parent workspace's copy all produce exactly that, with output that looked identical either way.
|
|
85
|
+
|
|
86
|
+
It does not refuse and does not pick a cli for you: running the workspace binary against a checkout is legitimate and common.
|
|
87
|
+
- **@voltro/cli** — `voltro db encrypt-column <table>.<column>` — the data migration `.encrypted()` always needed.
|
|
88
|
+
|
|
89
|
+
`.encrypted()` encrypts on WRITE, so adding it to a populated column converts nothing that is already there, and there was no supported way to convert it. A consumer carried three plaintext credential columns for months with no next step: *"`.encrypted()` braucht einen Cipher UND eine Datenmigration der bestehenden Zeilen; gemeldet, nicht behoben."*
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
voltro db encrypt-column integrations.webhookSecret --dry-run
|
|
93
|
+
voltro db encrypt-column integrations.webhookSecret employees.meilisearchKey --yes
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Five guards, each for a way a naive version succeeds and destroys data:
|
|
97
|
+
|
|
98
|
+
- **Idempotent** — an already-ciphertext value is skipped, so an interrupted run is resumed by running it again. Double encryption is unrecoverable without the key history. - **Round-trip verified before the write** — every value is decrypted back in-process first, so a broken cipher fails with nothing written. - **Key checked against what the column already holds** — a *different* key round-trips fine, so the check above cannot see it. Resuming with the wrong key would leave a column readable with neither key alone. - **Width pre-flight** — ciphertext is `49 + 4×ceil(bytes/3)` characters, so a 64-char key needs 137 and a `varchar(100)` fails partway. Refuses with both numbers and the `.maxLength()` to set. Measured in BYTES: `'ä'.repeat(10)` is 10 characters and 20 bytes. - **`--yes` required**, `--dry-run` shows the counts, and no value — plaintext or ciphertext — is ever printed.
|
|
99
|
+
|
|
100
|
+
Verified against a real postgres: the conversion, the re-run no-op, both refusals writing nothing, and a decrypt back to the original including multi-byte content.
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
|
|
104
|
+
- **@voltro/runtime** — `_voltro_schedule_claims` swaps its `(scheduleName, bucket)` index for `(scheduleName, claimedAt)`.
|
|
105
|
+
|
|
106
|
+
A consumer read `pg_stat_user_indexes` on their live table and measured, over its whole lifetime:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
_voltro_schedule_claims_pkey 348 978 scans
|
|
110
|
+
_voltro_schedule_claims_claimedAt_idx 3 949
|
|
111
|
+
_voltro_schedule_claims_scheduleName_bucket_idx 4
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Four. It was declared "for the case where you would rather ask by field", and nothing ever asks by field — every read of this table goes through the primary key, which *is* `<scheduleName>@<bucket>`. An index nothing uses is not free: it is written on every INSERT, into a table written once per tick per schedule.
|
|
115
|
+
|
|
116
|
+
`(scheduleName, claimedAt)` is the shape of a query that now exists — the per-schedule prune a winning claim runs (`WHERE scheduleName = ? AND claimedAt < ?`). The `claimedAt` index stays: the retention sweep's cutoff spans every schedule and needs it leading, which the composite cannot provide.
|
|
117
|
+
|
|
118
|
+
No codemod: a `_voltro_*` change rides the declarative differ on `voltro db apply` and on a `voltro dev` boot, on every dialect.
|
|
119
|
+
|
|
120
|
+
The same measurement corrected something the reporter had said in an earlier round and we had repeated back to them — that both indexes went unused. The primary key is used constantly. That makes the finding sharper rather than weaker: the ability to answer this question in one lookup is not merely available, it is demonstrably in use on the same table, and the one read path that needed it was the one not taking it.
|
|
121
|
+
|
|
122
|
+
### Fixed
|
|
123
|
+
|
|
124
|
+
- **@voltro/database** — A column ADDED with a `reference()` now gets its foreign key in the same plan.
|
|
125
|
+
|
|
126
|
+
`ADD COLUMN` emits no `REFERENCES` clause on any dialect, and the planner's FK branch lived only in the path for a column present on both sides — so adding a `reference()` column to an existing table planned an `add-column` and nothing else. The constraint appeared on the SECOND `voltro db apply`, when the column was live and the diff finally saw a live column with no FK.
|
|
127
|
+
|
|
128
|
+
Two applies converged, so the state was reachable, which is why this survived as a low-priority note for a long time. It is worse under `voltro dev`: the boot diff refuses to record a fingerprint while the re-plan is non-empty, so an app whose only pending change was such a column re-planned on every boot and never converged.
|
|
129
|
+
|
|
130
|
+
Both callers share one `addForeignKeyOps` builder now, and the existing dependency tiering already orders `add-column` before `add-foreign-key`.
|
|
131
|
+
- **@voltro/runtime, @voltro/protocol, @voltro/workflow, @voltro/cli** — A coordinated tick is a FLOOR now, and a claim no longer outlives its bucket.
|
|
132
|
+
|
|
133
|
+
A consumer's `_voltro_schedule_claims` reached **86 214 rows / 33 MB** on two days of uptime and took their deployment down: ten of a fifteen-slot pooler pinned on the claim read, an SSR render measured at **300 490 ms** behind them, every page in three frontends unusable, and a `rollout restart` that could not complete because the surge pod could not get a connection. Two hours of their own measurement produced the diagnosis, and both halves of it were right.
|
|
134
|
+
|
|
135
|
+
**Where the rows came from.** They declare one workflow, have never started it, use no flow control and no offloaded inference. Over one hour, with two replicas:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
voltro.ai.inference 1 259 rows/h (250 ms ticks) framework
|
|
139
|
+
voltro.workflow.admission 1 247 rows/h (1 s ticks) framework
|
|
140
|
+
their own eight schedules 18 rows/h
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
99.3 % of the ledger was the framework polling two structurally empty queues. A fixed interval has no way to learn that, so:
|
|
144
|
+
|
|
145
|
+
- **`scheduleCoordinated`'s effect may now REPORT its tick.** Return `{ idle: true }` and the runner backs off toward a ceiling; return `{ idle: true, nextDueInMs }` and it arms for that instant instead — which is what keeps a `debounce` window from being slept through. Returning nothing keeps the fixed interval, so every existing plugin task ticks exactly as before. - **Where an arrival is guaranteed to wake it, an idle task STOPS ENTIRELY** (`{ disarmWhenIdle: true }`). Both framework tasks do, on any deployment where a peer replica's write is visible locally — Postgres LISTEN/NOTIFY, or a broadcast broker. Measured against a real Postgres on a deployment that uses neither queue: **2 claim rows in five minutes**, one per task, both at boot. Where that guarantee does not hold, the ceiling (`VOLTRO_POLL_CEILING_MS`, default 30 s) is the correct behaviour and is what they get. - **`handle.wake()` runs a tick now.** Both framework queues are tables with the framework's own CDC triggers on them, so an enqueue already produces a change event on every replica; both dispatchers subscribe to it. The idle case gets ~120× cheaper and the busy case gets FASTER — work starts on the INSERT rather than up to a tick later. - The claim bucket stays floored by the BASE interval. Replicas do not share a backoff state, and two replicas computing different keys for one moment would both win.
|
|
146
|
+
|
|
147
|
+
**The cadence is declarable.** `scheduling: { admissionDrainMs, inferenceTickMs, cancelSweepMs, pollCeilingMs }` in `app.config.ts`, each with a matching `VOLTRO_*` env var that overrides it — the same ordering as `VOLTRO_TENANT_ISOLATION` over `tenancy.isolation`. They were internal constants, and a number the framework picks on a user's behalf belongs somewhere they can read it without reading our source. One resolver, called by both boot paths, so there is no second default to drift.
|
|
148
|
+
|
|
149
|
+
**Why the rows never left.** A claim answers one question about one bucket and was already answered the moment the bucket passed. A winning claim now deletes that schedule's own predecessors, so the table's size is a small multiple of the number of schedules rather than a function of uptime. How far back it prunes scales with the caller's bucket width — a cron keeps ~68 minutes of them (its firings carry their own instant, so a stalled one can re-present an old bucket), a 250 ms task ~1 minute (it recomputes its bucket at tick time, so an old one is unreachable). Deleting too early is a double fire; that grace is the whole safety argument. The 24-hour retention sweep stays as the backstop for a schedule that was renamed or deleted, which the per-schedule prune can never revisit.
|
|
150
|
+
|
|
151
|
+
Where reactivity is absent — a non-Postgres dialect with no broadcast broker — a remote replica's enqueue produces no local event and the ceiling is the whole latency budget. `VOLTRO_POLL_CEILING_MS` is there for that case and documented as such.
|
|
152
|
+
- **@voltro/logger** — The pretty log format now prints a nested `Error`'s `message`. It did not, and the JSON format did.
|
|
153
|
+
|
|
154
|
+
`Error.prototype.message` is non-enumerable, so `JSON.stringify(err)` emits the metadata and drops the message. `expandCauseForJson` has existed for a long time to solve exactly that — and it was wired into `jsonFormat` only. The section heading above it said "(JSON path)", which was literally accurate.
|
|
155
|
+
|
|
156
|
+
`voltro dev` prints the pretty format. What a consumer saw when their boot died on a saturated pooler:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
auto-migrate failed — aborting boot
|
|
160
|
+
err={"failure":{"cause":{"length":117,…,"code":"XX000"},"message":"PgClient: Failed to connect"}}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
`length: 117` is the length of a message that is not there. Recovered by hand, it was `(EMAXCONNSESSION) max clients reached in session mode - max clients are limited to pool_size: 15` — the whole diagnosis in one sentence, naming the fix.
|
|
164
|
+
|
|
165
|
+
Both the field tail and the plain-object cause branch expand now. The fix is in the formatter, not at the reporting call site: every `log.error('…', { err })` anywhere had the same hole.
|
|
166
|
+
- **@voltro/cli** — Every `@voltro/*` package now exports its own `package.json`, so `require('@voltro/cli/package.json').version` works.
|
|
167
|
+
|
|
168
|
+
It threw. Node has enforced this since 12: a package with an `exports` field exposes only what that field lists, and none of the 77 packages listed `"./package.json"`.
|
|
169
|
+
|
|
170
|
+
Reported by a consumer for whom it was the instruction WE gave for settling whether a security command had been running on stale code — so the verification step for a security question could not run at all. Both the workspace `exports` and the shipped `publishConfig.exports` are fixed, and a guard sweeps every package so a new one cannot ship without it.
|
|
171
|
+
- **@voltro/cli, @voltro/sql-postgres** — The `db pool:` boot line now counts the connections this process holds OUTSIDE the pool, and names them.
|
|
172
|
+
|
|
173
|
+
It reported `max × replicas` and called that the connection count. A consumer sizing a per-pod budget against a pooler measured the gap:
|
|
174
|
+
|
|
175
|
+
> `LISTEN` läuft außerhalb von `dbMaxConnections` (eine pro Pod, gemessen sogar > 3). Der echte Bedarf ist `dbMaxConnections + 1`.
|
|
176
|
+
|
|
177
|
+
Their measurement was right and their conclusion was one short. The framework opens a standalone connection in three places, and a full deployment holds all three:
|
|
178
|
+
|
|
179
|
+
| Process | Connection | When | |---|---|---| | api `voltro serve` | CDC `LISTEN` consumer | `changeStrategy: 'cdc'` | | web `voltro start` | ISR invalidator `LISTEN` | a page declares `cacheInvalidatesOn` | | web `voltro start` | postgres ISR cache client | `SSR_CACHE=postgres` |
|
|
180
|
+
|
|
181
|
+
The third is not a `LISTEN`, which is why counting `LISTEN` rows in `pg_stat_activity` undercounts, and why `+1` could not have been documented as a constant: the count is per PROCESS and only the process knows what it armed.
|
|
182
|
+
|
|
183
|
+
The line says `No connections outside the pool in this process` when there are none — silence about it is what made "counted, zero" indistinguishable from "not counted". The `maxConnections` docstring, which promised `+1` as if it were the deployment's number, is corrected. Production-hardening docs (both languages) gain the table plus the `maxSurge` arithmetic a rolling update needs.
|
|
184
|
+
- **@voltro/cli** — The retention sweep is registered on every dialect — it was postgres-only, and silently.
|
|
185
|
+
|
|
186
|
+
`wireRetentionSweep` opened with `if (dialect !== 'postgres') return`, so on mariadb, mysql, mssql and sqlite **none of its seven policies was registered, nothing was ever deleted, and the boot printed no armed-policies line** — so there was nothing to notice either. A consumer on MariaDB 11.8.8 measured it by reading the published bundle rather than their logs:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
_voltro_schedule_claims 109 520 rows 32.8 MB over 20 days
|
|
190
|
+
_voltro_schedule_runs 17 507 rows 7.4 MB
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Their seven `VOLTRO_*_TTL_HOURS` variables were inert — read only inside the branch that never ran — and two of them were already set in their Helm chart.
|
|
194
|
+
|
|
195
|
+
**The gate was aimed at the right thing and applied to the wrong scope.** What is postgres-specific is the fast DELETE (`"camelCase"` quoting, `DELETE … RETURNING`), which is one branch of one function that has always had a portable fallback beside it. Gating the REGISTRATION on it turned a performance choice into a feature that does not exist. The dialect check now sits on the branch it describes.
|
|
196
|
+
|
|
197
|
+
Two things came out with it:
|
|
198
|
+
|
|
199
|
+
- **The fallback deleted row by row.** Acceptable while the path was unreachable; against the reporter's backlog it is 20 000 round trips per sweep pass. It reads a bounded batch of ids and issues ONE set-based delete for them — still bounded, so the DELETE never grows to lock the whole backlog. - **Two tests asserted the defect as intended behaviour**, with reasoning that was internally consistent and rested on the premise that was itself the bug (*"the sweep is postgres-only, and announcing a delete that will not happen is the mirror image of the defect"*). Both are inverted now and run across all five dialects.
|
|
200
|
+
|
|
201
|
+
This is the third turn of the same screw, and the reporter's framing is the one to keep: we fixed *a standing delete that never introduces itself*, then shipped *one that introduces itself and does not run* — and beside both of those sat one that silently did not exist.
|
|
202
|
+
- **@voltro/cli** — `voltro db scan-credentials` no longer reports the framework's own redaction markers as credentials, and no longer claims a match was a *key*.
|
|
203
|
+
|
|
204
|
+
A consumer with correctly-redacting plugins got:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
✗ _voltro_row_history.data — 69 of 149 row(s) match a credential-shaped key
|
|
208
|
+
matched (rows per needle, may overlap): token (69)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
All 69 rows were `"_omitted": ["token"]` — `@voltro/plugin-versioning`'s record that a `.serverOnly().sensitive('secret')` column was deliberately left OUT of the snapshot. The scan matched the proof that nothing is stored there, called it a credential, and printed *purge them AND rotate the credentials* underneath.
|
|
212
|
+
|
|
213
|
+
Two changes. The headline says what the predicate does — it is a substring match over the whole serialized column, so it finds a credential-shaped **name** anywhere in the value, which it always did. And each hit is now EXPLAINED: a bounded second pass (500 matched rows per target) reads them back in-process and separates a JSON **key** from a **redaction marker** (`_omitted`, `__redacted`). Values are never printed and never logged.
|
|
214
|
+
|
|
215
|
+
A target whose every matched row is a marker reports as explained and exits `0`. The bar is deliberately high — every matched row examined, every one a marker and nothing else. A capped read-back, one real key, or one row that will not parse as JSON keeps the target a finding and still exits `1`.
|
|
216
|
+
|
|
217
|
+
The shape mattered more than the one key name: the more columns an app classifies correctly, the more markers it writes, and the redder the scan turned.
|
|
218
|
+
- **@voltro/runtime, @voltro/cli** — `advisoryLock` scheduling no longer reads the whole `_voltro_schedule_claims` table to answer whether one claim row exists, and that table is now swept on the scale it fills.
|
|
219
|
+
|
|
220
|
+
The existence check ran `SELECT "id" FROM "_voltro_schedule_claims"` with no `WHERE` and no `LIMIT`, then filtered in JavaScript — twice per claim attempt (the fast path, and the re-read that separates "lost the race" from "the claims table is broken"), on every replica, for every schedule firing. A consumer measured ten concurrent copies of that scan holding every connection of a 15-slot pooler, with an SSR render behind them at **300 490 ms**. It is a primary-key lookup bounded to one row now (`id` *is* the claim key).
|
|
221
|
+
|
|
222
|
+
The pool-acquire bound added in 0.32.0 turns that from a hang into an error; it does not stop the scan from filling the pool. Both are needed.
|
|
223
|
+
|
|
224
|
+
`VOLTRO_SCHEDULE_CLAIMS_TTL_HOURS` also defaults to **24 hours** instead of 30 days. The 30-day default was copied from the framework's history tables (`_voltro_schedule_runs` and friends), and a claim row is a lock ledger — it answers a question about one firing instant and nothing reads yesterday's. At the 1 557 rows/hour that consumer measured, a 30-day window reaches ~1.1 million rows before the first one ages out. Raise it deliberately if you need to; the number to reason about is the longest a replica may be paused and still be trusted not to re-fire a bucket it already lost.
|
|
225
|
+
|
|
226
|
+
The boot announcement can now express an age under a day (`older than 1h`); it previously rounded every TTL to whole days, so an operator setting one hour read their own policy back as `older than 0d`.
|
|
227
|
+
- **@voltro/runtime** — A coordinated periodic task armed below one second now runs at the interval it was given.
|
|
228
|
+
|
|
229
|
+
`scheduleCoordinated` floors the wall clock to its `intervalMs` and races on that instant; the claim key truncated it to second precision. A task at 250 ms therefore produced four bucket instants per second that collapsed to one key — the first tick won and the other three were dropped as "lost the claim". Measured: 1 of 4.
|
|
230
|
+
|
|
231
|
+
`voltro.ai.inference` is armed at 250 ms and was dispatching once per second, on every multi-replica deployment, with nothing above `warn` to say so.
|
|
232
|
+
|
|
233
|
+
This is the defect the coordinator's own comment describes at minute precision (6-field crons firing once a minute), one decimal place down; that comment was written before `scheduleCoordinated` existed, and `scheduleCoordinated` is the caller that goes below a second.
|
|
234
|
+
|
|
235
|
+
Milliseconds join the claim key only when non-zero, so every cron key is byte-identical to before — load-bearing during a rolling deploy, where old and new replicas computing different keys for one firing would both win and double-fire.
|
|
236
|
+
|
|
237
|
+
Note the consequence for table size: a sub-second task now writes claim rows at its true rate. Bounded by `VOLTRO_SCHEDULE_CLAIMS_TTL_HOURS` (24 h), and `ai.tickIntervalMs` raises the interval if you want fewer.
|
|
238
|
+
|
|
239
|
+
### Internal (no consumer-facing effect)
|
|
240
|
+
|
|
241
|
+
- **@voltro/cli** — No separate consumer-facing note on purpose: this refines the per-needle breakdown described in the UNRELEASED 0.32.0 section, and that section — which is what a reader will actually see — carries the correction. Documenting it twice would describe one change as two.
|
|
242
|
+
|
|
243
|
+
The refinement: the per-needle counts OVERLAP and do not sum to the hit count (a row holding both a token and a secret is counted by both). The output line says so now, because two numbers printed under a total invite being added up, and a reader who adds them and gets more than the total loses confidence in the whole report.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
42
247
|
## [0.32.0] — 2026-08-10
|
|
43
248
|
|
|
44
249
|
### ⚠ BREAKING
|
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -5,7 +5,7 @@ property of its respective copyright holders and is used under the terms of
|
|
|
5
5
|
its license. This file is provided for attribution; it grants no rights in
|
|
6
6
|
@voltro/runtime itself, which is proprietary (see LICENSE).
|
|
7
7
|
|
|
8
|
-
Generated from the resolved runtime dependency closure (
|
|
8
|
+
Generated from the resolved runtime dependency closure (51 packages).
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -37,34 +37,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
37
37
|
SOFTWARE.
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
## @effect/opentelemetry@0.64.0
|
|
41
|
-
|
|
42
|
-
License: MIT
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
MIT License
|
|
46
|
-
|
|
47
|
-
Copyright (c) 2020-present The Contributors
|
|
48
|
-
|
|
49
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
50
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
51
|
-
in the Software without restriction, including without limitation the rights
|
|
52
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
53
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
54
|
-
furnished to do so, subject to the following conditions:
|
|
55
|
-
|
|
56
|
-
The above copyright notice and this permission notice shall be included in all
|
|
57
|
-
copies or substantial portions of the Software.
|
|
58
|
-
|
|
59
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
60
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
61
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
62
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
63
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
64
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
65
|
-
SOFTWARE.
|
|
66
|
-
```
|
|
67
|
-
|
|
68
40
|
## @effect/platform-node@0.108.0
|
|
69
41
|
|
|
70
42
|
License: MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -1602,6 +1602,36 @@ declare const CircuitOpen_base: Schema.TaggedErrorClass<CircuitOpen, "CircuitOpe
|
|
|
1602
1602
|
|
|
1603
1603
|
export declare type CircuitState = 'closed' | 'open' | 'half-open';
|
|
1604
1604
|
|
|
1605
|
+
/** How many bucket widths of predecessors a won claim leaves behind. */
|
|
1606
|
+
export declare const CLAIM_RETENTION_BUCKETS = 64;
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* How long a claim row outlives its own bucket before the next winner deletes
|
|
1610
|
+
* it — and the reasoning is the whole safety argument, so read it before
|
|
1611
|
+
* shrinking the number.
|
|
1612
|
+
*
|
|
1613
|
+
* A claim answers ONE question ("has this bucket been taken"), and it is only
|
|
1614
|
+
* ever asked while some replica still has a timer pending for that bucket.
|
|
1615
|
+
* Delete it too early and a straggler re-claims a bucket that already fired,
|
|
1616
|
+
* which is a DOUBLE FIRE — the failure this table exists to prevent. So the
|
|
1617
|
+
* grace has to cover the longest a replica can plausibly be late.
|
|
1618
|
+
*
|
|
1619
|
+
* The two callers are late in different ways, which is why the width is a
|
|
1620
|
+
* parameter rather than a constant:
|
|
1621
|
+
*
|
|
1622
|
+
* - `scheduleCoordinated` computes its bucket from `Date.now()` AT TICK TIME.
|
|
1623
|
+
* A tick stalled by ten minutes therefore claims the CURRENT bucket, never
|
|
1624
|
+
* the one it was armed for — a stale bucket is unreachable by construction,
|
|
1625
|
+
* and 64 widths is generous past the point of paranoia.
|
|
1626
|
+
* - a CRON firing carries its own scheduled instant, so a stalled firing DOES
|
|
1627
|
+
* re-present an old bucket. It passes no width, so it gets 64 × 60 s ≈ 68
|
|
1628
|
+
* minutes of grace, and a cron fires at most once a minute, so that costs
|
|
1629
|
+
* ~68 rows.
|
|
1630
|
+
*
|
|
1631
|
+
* The floor keeps a sub-second task from computing a grace measured in seconds.
|
|
1632
|
+
*/
|
|
1633
|
+
export declare const claimGraceMs: (bucketWidthMs: number | undefined) => number;
|
|
1634
|
+
|
|
1605
1635
|
/**
|
|
1606
1636
|
* Decide whether a candidate matches a maintainable shape. Conservative by
|
|
1607
1637
|
* design — anything not provably maintainable is rejected (→ full recompute),
|
|
@@ -1852,6 +1882,8 @@ export declare interface ConnectionTokens {
|
|
|
1852
1882
|
readonly scopes: ReadonlyArray<string>;
|
|
1853
1883
|
}
|
|
1854
1884
|
|
|
1885
|
+
export declare type CoordinatedEffect = () => void | CoordinatedTickOutcome | Promise<void | CoordinatedTickOutcome>;
|
|
1886
|
+
|
|
1855
1887
|
export declare interface CoordinatedScheduleDeps {
|
|
1856
1888
|
/** The exactly-once gate. `singleCoordinator` for one-process
|
|
1857
1889
|
* deployments; `makeAdvisoryLockCoordinator(store, replicaId)` for
|
|
@@ -1861,6 +1893,31 @@ export declare interface CoordinatedScheduleDeps {
|
|
|
1861
1893
|
readonly log?: SchedulerLogger;
|
|
1862
1894
|
/** Stable id of this replica — recorded on the claim row it wins. */
|
|
1863
1895
|
readonly replicaId: string;
|
|
1896
|
+
/**
|
|
1897
|
+
* Ceiling for the idle backoff. Defaults to `VOLTRO_POLL_CEILING_MS` (see
|
|
1898
|
+
* {@link readPollCeilingMs}), else {@link DEFAULT_MAX_IDLE_INTERVAL_MS}.
|
|
1899
|
+
* Set it EQUAL to the base interval to
|
|
1900
|
+
* opt a task out of backing off entirely — which is the right call only for a
|
|
1901
|
+
* task whose work cannot announce itself.
|
|
1902
|
+
*/
|
|
1903
|
+
readonly maxIdleIntervalMs?: number;
|
|
1904
|
+
/**
|
|
1905
|
+
* **Stop ticking entirely** on an idle tick with no known deadline, and come
|
|
1906
|
+
* back only on `wake()`. Default `false`.
|
|
1907
|
+
*
|
|
1908
|
+
* This is the difference between "a poller that got cheaper" and "no poller".
|
|
1909
|
+
* A deployment that never uses the queue this task drains pays ONE tick at
|
|
1910
|
+
* boot — which is not optional, it is what finds work a previous process left
|
|
1911
|
+
* behind — and then nothing at all.
|
|
1912
|
+
*
|
|
1913
|
+
* **Only pass `true` when an arrival is GUARANTEED to produce a `wake()`.**
|
|
1914
|
+
* That is a claim about the deployment, not about the task: with Postgres
|
|
1915
|
+
* LISTEN/NOTIFY or a broadcast transport every replica sees every enqueue, so
|
|
1916
|
+
* it holds. Without either, a REMOTE replica's enqueue produces no local
|
|
1917
|
+
* event, and a disarmed task would sleep through it forever. The backoff
|
|
1918
|
+
* ceiling exists for exactly that case and is the correct choice there.
|
|
1919
|
+
*/
|
|
1920
|
+
readonly disarmWhenIdle?: boolean;
|
|
1864
1921
|
}
|
|
1865
1922
|
|
|
1866
1923
|
export declare interface CoordinatedScheduleHandle {
|
|
@@ -1868,6 +1925,52 @@ export declare interface CoordinatedScheduleHandle {
|
|
|
1868
1925
|
readonly stop: () => void;
|
|
1869
1926
|
/** The task name (for logging / dedup diagnostics). */
|
|
1870
1927
|
readonly name: string;
|
|
1928
|
+
/**
|
|
1929
|
+
* Run a tick now, because something arrived.
|
|
1930
|
+
*
|
|
1931
|
+
* Coalesced to at most one extra tick per BASE interval: a queue drain writes
|
|
1932
|
+
* to the very table whose change events trigger this, so an uncoalesced wake
|
|
1933
|
+
* is a loop that feeds itself. Safe to call from a change handler, from any
|
|
1934
|
+
* replica, at any rate.
|
|
1935
|
+
*/
|
|
1936
|
+
readonly wake: () => void;
|
|
1937
|
+
/** The delay the next tick is currently armed for. Exposed for tests and the
|
|
1938
|
+
* inspect surface — a task sitting at the idle ceiling and one hammering the
|
|
1939
|
+
* base interval look identical from outside otherwise. */
|
|
1940
|
+
readonly currentIntervalMs: () => number;
|
|
1941
|
+
/** `false` once the task has stopped ticking and is waiting for `wake()`
|
|
1942
|
+
* (see `disarmWhenIdle`). A disarmed task and a stopped one are the same
|
|
1943
|
+
* thing from outside otherwise, and only one of them comes back. */
|
|
1944
|
+
readonly isArmed: () => boolean;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
/** Per-task overrides a caller may pass alongside the effect. */
|
|
1948
|
+
export declare interface CoordinatedTaskOptions {
|
|
1949
|
+
/** See {@link CoordinatedScheduleDeps.disarmWhenIdle}. Per TASK rather than
|
|
1950
|
+
* per process, because whether an arrival wakes you is a property of the
|
|
1951
|
+
* queue you drain — one plugin may have a change channel on its table and
|
|
1952
|
+
* another none. */
|
|
1953
|
+
readonly disarmWhenIdle?: boolean;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
/** What a tick learned. Returning nothing means "assume there was work" —
|
|
1957
|
+
* the conservative reading, so a task that does not report cannot be backed
|
|
1958
|
+
* off into missing something. */
|
|
1959
|
+
export declare interface CoordinatedTickOutcome {
|
|
1960
|
+
/** `true` when the tick found nothing to do. Only an idle tick backs off. */
|
|
1961
|
+
readonly idle: boolean;
|
|
1962
|
+
/**
|
|
1963
|
+
* Milliseconds until the earliest thing this task already knows is coming —
|
|
1964
|
+
* a debounce window closing, a lease expiring. Caps the backoff, so a task
|
|
1965
|
+
* that is idle RIGHT NOW but has a deadline in 400 ms is armed for 400 ms
|
|
1966
|
+
* rather than for 30 s.
|
|
1967
|
+
*
|
|
1968
|
+
* This is the part a fixed interval cannot express and the part that makes
|
|
1969
|
+
* the backoff safe: without it, backing off is a bet that nothing time-based
|
|
1970
|
+
* is pending, and deferring controls are exactly the case where that bet is
|
|
1971
|
+
* wrong.
|
|
1972
|
+
*/
|
|
1973
|
+
readonly nextDueInMs?: number;
|
|
1871
1974
|
}
|
|
1872
1975
|
|
|
1873
1976
|
export declare type CoordinationOutcome = 'single' | 'wonLock' | 'lostLock' | 'external' | 'cluster';
|
|
@@ -1880,7 +1983,15 @@ export declare type CoordinationOutcome = 'single' | 'wonLock' | 'lostLock' | 'e
|
|
|
1880
1983
|
*/
|
|
1881
1984
|
export declare interface Coordinator {
|
|
1882
1985
|
readonly kind: 'single' | 'advisoryLock' | 'cluster';
|
|
1883
|
-
|
|
1986
|
+
/**
|
|
1987
|
+
* @param bucketWidthMs How far apart two consecutive buckets of THIS caller
|
|
1988
|
+
* are. Optional, and it is not used to decide the claim — it sizes how long
|
|
1989
|
+
* a won claim keeps its own predecessors around (see `claimGraceMs`). A cron
|
|
1990
|
+
* omits it and gets the conservative default; `scheduleCoordinated` passes
|
|
1991
|
+
* its interval, which is how a 250 ms task stops leaving a day of rows
|
|
1992
|
+
* behind.
|
|
1993
|
+
*/
|
|
1994
|
+
tryClaim(scheduleName: string, scheduledAt: Date, bucketWidthMs?: number): Promise<boolean>;
|
|
1884
1995
|
}
|
|
1885
1996
|
|
|
1886
1997
|
/**
|
|
@@ -2300,6 +2411,14 @@ export declare const dataStoreKvStore: (store: DataStore) => KvStoreShape;
|
|
|
2300
2411
|
* cipher is registered (a genuine ciphertext with a wrong key throws GCM). */
|
|
2301
2412
|
export declare const decryptField: (value: string) => string;
|
|
2302
2413
|
|
|
2414
|
+
/** Assumed distance between buckets when a caller passes none — the cron
|
|
2415
|
+
* engine's finest useful cadence. */
|
|
2416
|
+
export declare const DEFAULT_CLAIM_BUCKET_MS = 60000;
|
|
2417
|
+
|
|
2418
|
+
/** Ceiling the idle backoff climbs to. Deliberately short enough to be a
|
|
2419
|
+
* FLOOR under a missed wake rather than a substitute for one. */
|
|
2420
|
+
export declare const DEFAULT_MAX_IDLE_INTERVAL_MS = 30000;
|
|
2421
|
+
|
|
2303
2422
|
/** Default `POST /rpc` body cap: 8 MiB. Generous for any JSON rpc envelope,
|
|
2304
2423
|
* small enough to stop a pathological body being buffered into memory. */
|
|
2305
2424
|
export declare const DEFAULT_MAX_RPC_BODY_BYTES: number;
|
|
@@ -4516,9 +4635,21 @@ export declare const makeActionRunner: (deps: ActionRunnerDeps) => (action: Muta
|
|
|
4516
4635
|
* session-level `pg_advisory_lock` (which is tied to a connection
|
|
4517
4636
|
* that a pool may hand to another query before we unlock).
|
|
4518
4637
|
*
|
|
4519
|
-
* The
|
|
4520
|
-
* winner doesn't block the next firing (= next
|
|
4521
|
-
*
|
|
4638
|
+
* The bucket keying makes claims self-expiring as a DECISION: a crashed
|
|
4639
|
+
* winner doesn't block the next firing (= next bucket = new key). It did
|
|
4640
|
+
* not make them self-expiring as ROWS, and that distinction cost a consumer
|
|
4641
|
+
* their whole deployment — 86 214 rows / 33 MB over two days, read in full
|
|
4642
|
+
* on every claim check, ten of a fifteen-slot pooler pinned on the scan, an
|
|
4643
|
+
* SSR render behind them at 300 490 ms, and a `rollout restart` that could
|
|
4644
|
+
* not complete because the surge pod could not get a connection.
|
|
4645
|
+
*
|
|
4646
|
+
* **A won claim now deletes its own predecessors** (`claimGraceMs` above),
|
|
4647
|
+
* which is what bounds the table rather than merely slowing its growth. The
|
|
4648
|
+
* retention sweep both boot paths register (`wireRetentionSweep`,
|
|
4649
|
+
* `VOLTRO_SCHEDULE_CLAIMS_TTL_HOURS`) STAYS as the backstop, and it is not
|
|
4650
|
+
* redundant: this prune is per SCHEDULE NAME and only runs when that name wins
|
|
4651
|
+
* again, so the rows of a schedule that was renamed or deleted have nothing
|
|
4652
|
+
* left to clean them up.
|
|
4522
4653
|
*
|
|
4523
4654
|
* `scheduledAt` is the DETERMINISTIC cron instant (not `Date.now()`),
|
|
4524
4655
|
* so every replica computes the SAME bucket regardless of clock skew
|
|
@@ -4616,7 +4747,7 @@ export declare const makeConnectionsFacade: (deps: ConnectionsFacadeDeps) => Con
|
|
|
4616
4747
|
* handle is tracked by the caller (the CLI) so `onDeactivate` can stop
|
|
4617
4748
|
* every task a plugin armed.
|
|
4618
4749
|
*/
|
|
4619
|
-
export declare const makeCoordinatedScheduler: (deps: CoordinatedScheduleDeps) =>
|
|
4750
|
+
export declare const makeCoordinatedScheduler: (deps: CoordinatedScheduleDeps) => PluginScheduleCoordinated;
|
|
4620
4751
|
|
|
4621
4752
|
/**
|
|
4622
4753
|
* Build a request-scoped loader. One instance per AppContext — see the module
|
|
@@ -5121,6 +5252,18 @@ export declare interface MutationStore extends DataStore {
|
|
|
5121
5252
|
hardDelete(table: string, primaryKey: string): Promise<boolean>;
|
|
5122
5253
|
}
|
|
5123
5254
|
|
|
5255
|
+
/**
|
|
5256
|
+
* The backoff curve, extracted so it can be asserted directly — a schedule
|
|
5257
|
+
* that backs off wrongly is otherwise only visible as a latency an integration
|
|
5258
|
+
* test does not measure.
|
|
5259
|
+
*
|
|
5260
|
+
* Doubling rather than jumping to the ceiling: a queue that just went quiet is
|
|
5261
|
+
* the likeliest one to receive something next, and doubling keeps the first few
|
|
5262
|
+
* idle ticks cheap in latency while still reaching the ceiling in five steps
|
|
5263
|
+
* from 1 s.
|
|
5264
|
+
*/
|
|
5265
|
+
export declare const nextDelay: (outcome: void | CoordinatedTickOutcome, baseMs: number, currentMs: number, maxIdleMs: number, disarmWhenIdle?: boolean) => number | "disarm";
|
|
5266
|
+
|
|
5124
5267
|
/** Next firing strictly after `after` (default: now). */
|
|
5125
5268
|
export declare const nextFiring: (def: ScheduleDefinition, after?: Date) => Date;
|
|
5126
5269
|
|
|
@@ -5356,6 +5499,18 @@ export declare interface OrchestratorTickDeps {
|
|
|
5356
5499
|
readonly log?: WakeOrchestratorLogger;
|
|
5357
5500
|
}
|
|
5358
5501
|
|
|
5502
|
+
/**
|
|
5503
|
+
* Map an `import('@effect/opentelemetry')` rejection to what the reader needs.
|
|
5504
|
+
*
|
|
5505
|
+
* Exported so the branch is testable without uninstalling the package. Only a
|
|
5506
|
+
* module-NOT-FOUND becomes the install instruction: anything else is a real
|
|
5507
|
+
* load failure inside a package that IS present, and renaming that to "not
|
|
5508
|
+
* installed" sends the reader to reinstall something already there. A catch-all
|
|
5509
|
+
* that relabels every failure is how a diagnosis gets buried — the same reason
|
|
5510
|
+
* the serve bundle marks its deliberate refusals instead of swallowing throws.
|
|
5511
|
+
*/
|
|
5512
|
+
export declare const otelImportFailure: (cause: unknown) => Error;
|
|
5513
|
+
|
|
5359
5514
|
/**
|
|
5360
5515
|
* Retention, part 1 of 2 — the PER-ENTRY cap.
|
|
5361
5516
|
*
|
|
@@ -5544,8 +5699,8 @@ export declare interface PluginRefStore {
|
|
|
5544
5699
|
delete: (table: string, id: string) => Promise<unknown>;
|
|
5545
5700
|
}
|
|
5546
5701
|
|
|
5547
|
-
/** The
|
|
5548
|
-
export declare type PluginScheduleCoordinated = (name: string, intervalMs: number, effect:
|
|
5702
|
+
/** The signature a plugin sees on its bind-ctx. */
|
|
5703
|
+
export declare type PluginScheduleCoordinated = (name: string, intervalMs: number, effect: CoordinatedEffect, options?: CoordinatedTaskOptions) => CoordinatedScheduleHandle;
|
|
5549
5704
|
|
|
5550
5705
|
export declare const powerOfTwoSelector: (options?: P2COptions) => ReplicaSelector;
|
|
5551
5706
|
|
|
@@ -5879,6 +6034,29 @@ export declare type ReactiveReturn<D extends ExecutorDescriptor> = D extends {
|
|
|
5879
6034
|
readonly descriptor: QueryDescriptor;
|
|
5880
6035
|
} : never;
|
|
5881
6036
|
|
|
6037
|
+
/**
|
|
6038
|
+
* The ceiling, tunable per deployment via `VOLTRO_POLL_CEILING_MS`.
|
|
6039
|
+
*
|
|
6040
|
+
* This is the ONE number worth exposing, and the reason is what the ceiling
|
|
6041
|
+
* means: it is how long an arrival can wait when nothing woke the task. With
|
|
6042
|
+
* reactivity it is never reached. WITHOUT it — a dialect with no CDC and no
|
|
6043
|
+
* broadcast transport, where a remote replica's enqueue produces no local
|
|
6044
|
+
* event — it is the whole latency budget, and only the operator knows how much
|
|
6045
|
+
* of one they have.
|
|
6046
|
+
*
|
|
6047
|
+
* An env var rather than an `app.config.ts` field on purpose: it is an
|
|
6048
|
+
* operational number, it must be identical under `voltro dev` and `voltro
|
|
6049
|
+
* serve`, and a second source for one value is how the two boot paths come to
|
|
6050
|
+
* disagree. Read here, once, so neither path can supply its own.
|
|
6051
|
+
*
|
|
6052
|
+
* An unparseable or non-positive value is ignored rather than honoured — a
|
|
6053
|
+
* ceiling of 0 would turn every idle task into a spin, which is the exact
|
|
6054
|
+
* pathology the backoff exists to remove.
|
|
6055
|
+
*/
|
|
6056
|
+
export declare const readPollCeilingMs: (env?: {
|
|
6057
|
+
readonly VOLTRO_POLL_CEILING_MS?: string;
|
|
6058
|
+
}) => number;
|
|
6059
|
+
|
|
5882
6060
|
/** `admin:full` (mirrors `@voltro/protocol`'s ADMIN_SCOPE) bypasses ReBAC. */
|
|
5883
6061
|
export declare const REBAC_ADMIN_SCOPE = "admin:full";
|
|
5884
6062
|
|
|
@@ -7080,29 +7258,27 @@ export declare interface ScheduleContext {
|
|
|
7080
7258
|
}
|
|
7081
7259
|
|
|
7082
7260
|
/**
|
|
7083
|
-
* Run `effect`
|
|
7261
|
+
* Run `effect` on only ONE replica per tick, on a cadence that follows the
|
|
7262
|
+
* work rather than a fixed clock.
|
|
7084
7263
|
*
|
|
7085
|
-
*
|
|
7086
|
-
*
|
|
7087
|
-
*
|
|
7088
|
-
*
|
|
7089
|
-
*
|
|
7090
|
-
* the window and races on the identical claim key — the INSERT-wins
|
|
7091
|
-
* arbiter picks one.
|
|
7264
|
+
* Each tick floors the wall clock to an `intervalMs` bucket and asks the
|
|
7265
|
+
* coordinator to claim `(name, bucket)`. Only the replica that wins runs the
|
|
7266
|
+
* effect; the rest skip. Because the bucket comes from the shared wall clock
|
|
7267
|
+
* (not each replica's tick offset), every replica computes the same bucket
|
|
7268
|
+
* within the window and races on the identical claim key.
|
|
7092
7269
|
*
|
|
7093
|
-
* Non-dying: a throw inside `effect` is caught + logged
|
|
7094
|
-
* always re-armed. The timer is `unref`'d so it never keeps the process
|
|
7095
|
-
* alive on its own (mirrors the bare-`setInterval` behaviour it replaces).
|
|
7270
|
+
* Non-dying: a throw inside `effect` is caught + logged and the next tick is
|
|
7271
|
+
* always re-armed. The timer is `unref`'d so it never keeps the process alive.
|
|
7096
7272
|
*
|
|
7097
7273
|
* @param name Stable task name, namespaced by the caller (a plugin
|
|
7098
7274
|
* passes e.g. `presence.sweep`). Used as the claim key
|
|
7099
7275
|
* prefix + in logs.
|
|
7100
|
-
* @param intervalMs
|
|
7101
|
-
*
|
|
7102
|
-
*
|
|
7103
|
-
*
|
|
7276
|
+
* @param intervalMs The BASE period — the fastest this task ticks, the claim
|
|
7277
|
+
* bucket width, and the wake coalescing window.
|
|
7278
|
+
* @param effect The work. Return a {@link CoordinatedTickOutcome} to let
|
|
7279
|
+
* the runner back off when there is nothing to do.
|
|
7104
7280
|
*/
|
|
7105
|
-
export declare const scheduleCoordinated: (name: string, intervalMs: number, effect:
|
|
7281
|
+
export declare const scheduleCoordinated: (name: string, intervalMs: number, effect: CoordinatedEffect, deps: CoordinatedScheduleDeps) => CoordinatedScheduleHandle;
|
|
7106
7282
|
|
|
7107
7283
|
export declare interface ScheduleDefinition {
|
|
7108
7284
|
readonly name: string;
|