@ixo/decision-oracle 0.2.16 → 0.2.18

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.
Files changed (57) hide show
  1. package/README.md +2 -1
  2. package/dist/config.d.ts +7 -0
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/config.js +6 -0
  5. package/dist/config.js.map +1 -1
  6. package/dist/cron/collection.d.ts +16 -3
  7. package/dist/cron/collection.d.ts.map +1 -1
  8. package/dist/cron/collection.js +22 -12
  9. package/dist/cron/collection.js.map +1 -1
  10. package/dist/cron/feed.d.ts +49 -0
  11. package/dist/cron/feed.d.ts.map +1 -0
  12. package/dist/cron/feed.js +159 -0
  13. package/dist/cron/feed.js.map +1 -0
  14. package/dist/cron/scan.d.ts.map +1 -1
  15. package/dist/cron/scan.js +21 -1
  16. package/dist/cron/scan.js.map +1 -1
  17. package/dist/db/schema.d.ts +51 -0
  18. package/dist/db/schema.d.ts.map +1 -1
  19. package/dist/db/schema.js +10 -0
  20. package/dist/db/schema.js.map +1 -1
  21. package/dist/env.d.ts +1 -0
  22. package/dist/env.d.ts.map +1 -1
  23. package/dist/lib/facts/stock/ai-check.d.ts +10 -1
  24. package/dist/lib/facts/stock/ai-check.d.ts.map +1 -1
  25. package/dist/lib/facts/stock/ai-check.js +12 -4
  26. package/dist/lib/facts/stock/ai-check.js.map +1 -1
  27. package/dist/lib/facts/stock/ai-provider.d.ts.map +1 -1
  28. package/dist/lib/facts/stock/ai-provider.js +2 -3
  29. package/dist/lib/facts/stock/ai-provider.js.map +1 -1
  30. package/dist/lib/ixo/blocksync/index.d.ts +12 -2
  31. package/dist/lib/ixo/blocksync/index.d.ts.map +1 -1
  32. package/dist/lib/ixo/blocksync/index.js +17 -2
  33. package/dist/lib/ixo/blocksync/index.js.map +1 -1
  34. package/dist/lib/ixo/blocksync/queries.d.ts +1 -0
  35. package/dist/lib/ixo/blocksync/queries.d.ts.map +1 -1
  36. package/dist/lib/ixo/blocksync/queries.js +16 -0
  37. package/dist/lib/ixo/blocksync/queries.js.map +1 -1
  38. package/dist/lib/ixo/blocksync/types.d.ts +8 -0
  39. package/dist/lib/ixo/blocksync/types.d.ts.map +1 -1
  40. package/dist/lib/ixo/blocksync/types.js +2 -0
  41. package/dist/lib/ixo/blocksync/types.js.map +1 -1
  42. package/dist/lib/openhands/routes.d.ts +6 -5
  43. package/dist/lib/openhands/routes.d.ts.map +1 -1
  44. package/dist/lib/openhands/routes.js +26 -13
  45. package/dist/lib/openhands/routes.js.map +1 -1
  46. package/dist/lib/openhands/store.d.ts +12 -1
  47. package/dist/lib/openhands/store.d.ts.map +1 -1
  48. package/dist/lib/openhands/store.js +20 -1
  49. package/dist/lib/openhands/store.js.map +1 -1
  50. package/docs/api.md +23 -8
  51. package/docs/guide.md +13 -1
  52. package/migrations/0027_cron_state.sql +4 -0
  53. package/migrations/meta/0027_snapshot.json +3007 -0
  54. package/migrations/meta/_journal.json +7 -0
  55. package/package.json +1 -1
  56. package/templates/project/.dev.vars.example +1 -0
  57. package/templates/project/wrangler.jsonc +4 -0
package/docs/guide.md CHANGED
@@ -427,6 +427,11 @@ generated image gives itself away only in fine detail (moiré, a pixel grid, gar
427
427
  downsamples out. `high` costs more image tokens per check; drop to `low` only for an oracle whose
428
428
  rules never turn on it.
429
429
 
430
+ The judge thinks at `AI_REASONING_EFFORT` — `low` by default, the measured balance: no thinking
431
+ loses quality on rule-by-rule judgment, and `medium` / `high` answer slower with more output tokens.
432
+ Measure latency and cost on your own claims before raising it. Each attempt has 60 s (3 minutes
433
+ when a PDF, video or audio input rides along), three attempts per call.
434
+
430
435
  ### Reading attachments, and image provenance
431
436
 
432
437
  Attachments arrive as **descriptors** — the bytes stay in Matrix, content-addressed. Ask for them by
@@ -1151,13 +1156,20 @@ keep all three, or that tier's jobs never run:
1151
1156
  An unknown cron string is a `cron.unknown` log line and runs nothing. A provider that adds a
1152
1157
  trigger of its own handles it in its own `scheduled` before delegating the rest to the oracle's.
1153
1158
 
1159
+ **The claims feed.** Every minute the oracle reads the chain's new claims ONCE, chain-wide, and
1160
+ starts the ones in collections it watches (`claims-feed`, [api.md](./api.md#cron-three-triggers)):
1161
+ a claim is usually picked up within a minute or two of landing, however many collections you
1162
+ watch. An hourly replay re-reads what turned 24 h old, for a claim Blocksync indexed late.
1163
+
1154
1164
  **The cron tick.** `CRON_COLLECTIONS_PER_TICK` (default `25`, see [api.md §11](./api.md#11-configuration))
1155
1165
  bounds how many watched collections one tick visits; a fleet larger than that rotates in over later
1156
1166
  ticks, least-recently-scanned first. Raise it for a large fleet. To act on one collection sooner
1157
1167
  than the next tick — e.g. the instant your own webhook sees a submission — call
1158
1168
  `scanCollection(env, collectionId)` from `@ixo/decision-oracle/runtime`, or hit
1159
1169
  `POST /v1/collections/:collectionId/scan`; both run the exact same discover-and-start pass the tick
1160
- does, so a webhook and the cron racing on one claim can never double-start it.
1170
+ does, so a webhook and the cron racing on one claim can never double-start it. Only the tick's own
1171
+ visit moves a collection to the back of the rotation: an early webhook scan that finds nothing
1172
+ leaves it where it was.
1161
1173
 
1162
1174
  **Watching a claim.** `GET /v1/claims?collectionId=<id>` lists newest-first with a keyset cursor;
1163
1175
  `GET /v1/claims/:claimId` is the full record — the ingest row, the decision (codes, scores,
@@ -0,0 +1,4 @@
1
+ CREATE TABLE `cron_state` (
2
+ `name` text PRIMARY KEY NOT NULL,
3
+ `value` text NOT NULL
4
+ );