@owlmeans/resource 0.1.18-rc.26 → 0.1.18-rc.28

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 CHANGED
@@ -12,7 +12,7 @@ wants is the `resource-choice` decision.
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @owlmeans/resource@^0.1.18-rc.26
15
+ bun add @owlmeans/resource@^0.1.18-rc.28
16
16
  ```
17
17
 
18
18
  ## Concepts
@@ -403,7 +403,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
403
403
  your project's skill store (`.agents/skills/`):
404
404
 
405
405
  ```sh
406
- npx @owlmeans/agent-skills@^0.1.18-rc.27
406
+ npx @owlmeans/agent-skills@^0.1.18-rc.30
407
407
  ```
408
408
 
409
409
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/resource",
4
- "version": "0.1.18-rc.26",
5
- "generatedAt": "2026-09-15T13:29:05.423Z",
4
+ "version": "0.1.18-rc.28",
5
+ "generatedAt": "2026-09-19T13:42:56.236Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/resource
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/resource": "^0.1.18-rc.26"` in `dependencies`
11
+ **Install:** `"@owlmeans/resource": "^0.1.18-rc.28"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
@@ -142,10 +142,15 @@ When you do queue ([[queue]], driver [[redis-queue]]):
142
142
  successors: children complete before the parent runs and it reads their results through
143
143
  `children()`. Give the children of a cross-queue flow distinct ids.
144
144
 
145
- **There is no scheduler in the framework.** `JobOptions.delay` defers one job once; anything
146
- recurring — a nightly digest, an hourly reconciliation — is triggered from outside the process by
147
- a platform cron (a Kubernetes `CronJob` in a [[kluster]] deployment) that calls a normal entrypoint
148
- or enqueues a job. Do not simulate cron with a self-re-enqueueing job.
145
+ **Recurring work is a schedule.** `JobOptions.delay` defers one job once; anything recurring — a
146
+ nightly digest, an hourly reconciliation — is `declareSchedule(cfg, { id, queue, name, every |
147
+ pattern })` in the shared package plus a processor registered for that job name
148
+ ([[scheduled-jobs]]). Every worker that listens to the queue keeps the broker's schedulers in line
149
+ with the declarations, so adding, changing and deleting a schedule is a code change. A scheduled
150
+ run is a processor job, never a guarded entrypoint call. Reach for a platform cron (a Kubernetes
151
+ `CronJob` in a [[kluster]] deployment) calling an entrypoint only when no worker may be running:
152
+ the broker produces a schedule's next run only while a process consumes its queue. Never simulate
153
+ cron with a self-re-enqueueing job.
149
154
 
150
155
  ## Model-driven work
151
156
 
@@ -188,7 +193,7 @@ the matching `@owlmeans/*-resource` package, `state` and `config` the packages o
188
193
  | Settings / feature flags per organization entity | postgres | Few rows, read constantly, always by `entityId` — cache in Redis only after measuring, and only if a stale read is harmless. |
189
194
  | Search over the product's own records | postgres | Start with indexed columns and `jsonb` containment; move to a search engine when a measured query, not a guess, says so. |
190
195
  | Expensive aggregate on a dashboard | postgres, then redis | Compute it in SQL first. Cache in Redis with a TTL only once the measured query is genuinely slow — a miss must stay invisible. |
191
- | Analytics rollups | postgres + queue | The rollup is a scheduled batch write into its own table; the trigger is a platform cron, the work is a job because it survives restarts. |
196
+ | Analytics rollups | postgres + queue schedule | The rollup is a batch write into its own table; a declared schedule produces the run and a processor does it, surviving restarts. |
192
197
  | Leaderboard | postgres, redis if hot | A ranked query with an index is enough for most products; move the live top-N into a Redis counter set when it is read far more often than written. |
193
198
  | Invoice numbering | postgres | A gapless sequence is a transaction and a unique constraint, not a Redis counter — a lost increment is an accounting problem. |
194
199
  | Records the process was started with (plugins, seeded routes) | config | Already in `cfg`; reading them as a resource gives criteria and sorting without a second store, and every write is refused by design. |
@@ -237,10 +242,11 @@ the matching `@owlmeans/*-resource` package, `state` and `config` the packages o
237
242
  | Bulk email | queue | Thousands of provider calls, each retried independently; one bad address must not fail the batch. |
238
243
  | Transactional email (one recipient, one event) | inline | A single provider call inside the request; queue it only if the send is on a user's critical path and the provider is slow. |
239
244
  | Payment capture | queue with idempotent job ids | Retried against a third party, must survive a restart, must never double-charge — derive the job id from the payment. |
240
- | Third-party sync / reconciliation | queue, triggered by platform cron | Recurring, long, retried; the framework has no scheduler, so a `CronJob` enqueues it. |
245
+ | Third-party sync / reconciliation | queue schedule | Recurring, long, retried; a pattern schedule on a low-concurrency queue, and the processor re-reads the third party as the truth so a re-run is harmless. |
241
246
  | Webhook fan-out | queue, one job per subscriber | Per-endpoint retries and backoff; a slow subscriber must not delay the others. |
242
- | Scheduled digest | queue, triggered by platform cron | Same shape as any recurring batch — cron enqueues, the worker sends. |
243
- | Scheduled reminders | postgres row + cron sweep, or `JobOptions.delay` | Use `delay` for a one-shot minutes-away nudge; anything cancellable or far in the future is a row a periodic sweep picks up. |
247
+ | Scheduled digest | queue schedule | Same shape as any recurring batch — the schedule produces the run, the worker sends. |
248
+ | Scheduled reminders | postgres row + scheduled sweep, or `JobOptions.delay` | Use `delay` for a one-shot minutes-away nudge; anything cancellable or far in the future is a row a scheduled sweep picks up. |
249
+ | Recurring job where no worker process runs | platform `CronJob` calling an entrypoint | A schedule needs a consumer; a deployment with none triggers from outside and goes through the entrypoint's guards. |
244
250
  | Inbound webhook handling | inline ack, queue the work | Answer 2xx immediately, then process — a third party's retry policy is not a design input for your handler. |
245
251
  | Cache warmup after a deploy | queue, or nothing | Usually not worth it: let the first requests populate the cache unless a measured cold-start hurts. |
246
252
 
@@ -258,7 +264,8 @@ the matching `@owlmeans/*-resource` package, `state` and `config` the packages o
258
264
 
259
265
  - [[resource]] — the contract every option implements, and the criteria language they share
260
266
  - [[postgres-resource]], [[mongo-resource]], [[redis-resource]], [[static-resource]],
261
- [[state]], [[client-resource]], [[web-db]], [[config]], [[storage-resource]] — the backends
267
+ [[state]], [[client-resource]], [[web-db]], [[owlmeans-config]], [[storage-resource]] — the backends
262
268
  - [[queue]], [[redis-queue]] — job queues and the worker process
269
+ - [[scheduled-jobs]] — recurring work on a queue schedule
263
270
  - [[llm]], [[agent]] — model-driven work
264
271
  - [[reuse-code]] — find the `@owlmeans/*` package before designing anything new
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/resource",
3
- "version": "0.1.18-rc.26",
3
+ "version": "0.1.18-rc.28",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,8 +21,8 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/context": "^0.1.18-rc.24",
25
- "@owlmeans/error": "^0.1.18-rc.26"
24
+ "@owlmeans/context": "^0.1.18-rc.26",
25
+ "@owlmeans/error": "^0.1.18-rc.28"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "ajv": "*"