@ixo/decision-oracle 0.2.23 → 0.2.25

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 (45) hide show
  1. package/README.md +1 -1
  2. package/dist/define-oracle.d.ts.map +1 -1
  3. package/dist/define-oracle.js +4 -2
  4. package/dist/define-oracle.js.map +1 -1
  5. package/dist/lib/claim-failure.d.ts +13 -0
  6. package/dist/lib/claim-failure.d.ts.map +1 -0
  7. package/dist/lib/claim-failure.js +21 -0
  8. package/dist/lib/claim-failure.js.map +1 -0
  9. package/dist/lib/ixo/blocksync/index.d.ts +6 -0
  10. package/dist/lib/ixo/blocksync/index.d.ts.map +1 -1
  11. package/dist/lib/ixo/blocksync/index.js +12 -1
  12. package/dist/lib/ixo/blocksync/index.js.map +1 -1
  13. package/dist/lib/ixo/blocksync/queries.d.ts +1 -0
  14. package/dist/lib/ixo/blocksync/queries.d.ts.map +1 -1
  15. package/dist/lib/ixo/blocksync/queries.js +9 -0
  16. package/dist/lib/ixo/blocksync/queries.js.map +1 -1
  17. package/dist/lib/openhands/explain.d.ts +85 -0
  18. package/dist/lib/openhands/explain.d.ts.map +1 -0
  19. package/dist/lib/openhands/explain.js +499 -0
  20. package/dist/lib/openhands/explain.js.map +1 -0
  21. package/dist/lib/openhands/routes.d.ts +5 -0
  22. package/dist/lib/openhands/routes.d.ts.map +1 -1
  23. package/dist/lib/openhands/routes.js +4 -1
  24. package/dist/lib/openhands/routes.js.map +1 -1
  25. package/dist/lib/openhands/why.d.ts +74 -0
  26. package/dist/lib/openhands/why.d.ts.map +1 -0
  27. package/dist/lib/openhands/why.js +244 -0
  28. package/dist/lib/openhands/why.js.map +1 -0
  29. package/dist/routes/v1/claims.d.ts +3 -2
  30. package/dist/routes/v1/claims.d.ts.map +1 -1
  31. package/dist/routes/v1/claims.js +11 -3
  32. package/dist/routes/v1/claims.js.map +1 -1
  33. package/dist/routes/v1/info.d.ts.map +1 -1
  34. package/dist/routes/v1/info.js +4 -2
  35. package/dist/routes/v1/info.js.map +1 -1
  36. package/dist/routes/v1/shared.d.ts.map +1 -1
  37. package/dist/routes/v1/shared.js +31 -4
  38. package/dist/routes/v1/shared.js.map +1 -1
  39. package/dist/runtime.d.ts +1 -0
  40. package/dist/runtime.d.ts.map +1 -1
  41. package/dist/runtime.js +2 -0
  42. package/dist/runtime.js.map +1 -1
  43. package/docs/api.md +14 -8
  44. package/docs/guide.md +12 -2
  45. package/package.json +1 -1
@@ -5,8 +5,8 @@
5
5
  import { eq, getTableColumns, sql } from "drizzle-orm";
6
6
  import { watchedCollections, } from "../../db/schema.js";
7
7
  import { AppError } from "../../lib/errors.js";
8
- import { hasEvaluateGrant } from "../../lib/ixo/authz.js";
9
- import { getClaimById, getCollection, getEntityOwner } from "../../lib/ixo/blocksync/index.js";
8
+ import { hasEvaluateGrant, isIxoAccountAddress } from "../../lib/ixo/authz.js";
9
+ import { getClaimById, getCollection, getEntityOwner, hasLiveGrantBetween, } from "../../lib/ixo/blocksync/index.js";
10
10
  import { readCache } from "../../lib/metrics.js";
11
11
  import { liveReviewerGrants } from "../../lib/review/reviewer-grant.js";
12
12
  import { sanitise } from "../../lib/sanitise.js";
@@ -14,6 +14,8 @@ import { sanitise } from "../../lib/sanitise.js";
14
14
  const OWNER_CACHE_TTL_SEC = 300;
15
15
  /** A claim's submitter never changes on chain, so its read is cached long (a portal polls it). */
16
16
  const AGENT_CACHE_TTL_SEC = 86_400;
17
+ /** An authz link between two accounts can be revoked, so it is trusted like the grant read. */
18
+ const LINK_CACHE_TTL_SEC = 300;
17
19
  /**
18
20
  * Who may READ (and scan) a watched collection — the same surface that may register it, as the
19
21
  * chain says it is NOW (ownership review F2): the current chain owner (who pays the fees), or any
@@ -121,6 +123,9 @@ async function assertReader(c, watched, { reviewers, agentOf }) {
121
123
  * Blocksync read, KV-cached by claim since the submitter is immutable. The cache holds the claim's
122
124
  * own collection, compared here at read time, so it never depends on the request that filled it. A
123
125
  * claim Blocksync does not know is not cached: it may just not be indexed yet.
126
+ * An agent key that files for a person is the claim's on-chain agent, not the person: so the
127
+ * submitter is also anyone a LIVE authz grant links to that agent, either way round (the person who
128
+ * granted the agent, or a key the agent granted) — `isAgentLinked`.
124
129
  */
125
130
  async function isClaimAgent(c, claimId, collectionId) {
126
131
  const key = `claim-agent:${claimId}`;
@@ -136,8 +141,30 @@ async function isClaimAgent(c, claimId, collectionId) {
136
141
  }).catch(() => { });
137
142
  }
138
143
  const { did, address } = c.get("principal");
139
- return (agent.collectionId === collectionId &&
140
- ((!!agent.did && agent.did === did) || (!!agent.address && agent.address === address)));
144
+ if (agent.collectionId !== collectionId)
145
+ return false;
146
+ if ((!!agent.did && agent.did === did) || (!!agent.address && agent.address === address)) {
147
+ return true;
148
+ }
149
+ return !!agent.address && (await isAgentLinked(c, address, agent.address));
150
+ }
151
+ /**
152
+ * A live authz grant links `address` and `agentAddress`, either direction, any message type —
153
+ * Blocksync's `authzGrants` (live rows only), KV-cached `LINK_CACHE_TTL_SEC` per pair, both
154
+ * answers: a revoked grant closes the door within the TTL. Not an account (a did:key, a group
155
+ * DID's "wasm") means no link, decided without a read.
156
+ */
157
+ async function isAgentLinked(c, address, agentAddress) {
158
+ if (!isIxoAccountAddress(address) || !isIxoAccountAddress(agentAddress))
159
+ return false;
160
+ const key = `agent-link:${address}:${agentAddress}`;
161
+ const cached = await readCache("agent-link", () => c.env.CACHE_KV.get(key));
162
+ if (cached !== null)
163
+ return cached === "1";
164
+ const deps = { config: c.get("config"), trace: c.get("trace") };
165
+ const linked = await hasLiveGrantBetween(deps, address, agentAddress);
166
+ await c.env.CACHE_KV.put(key, linked ? "1" : "0", { expirationTtl: LINK_CACHE_TTL_SEC }).catch(() => { });
167
+ return linked;
141
168
  }
142
169
  /** The collection entity's owner address on chain, cached `OWNER_CACHE_TTL_SEC`; null = none. */
143
170
  async function liveOwner(c, collectionId) {
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/rout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,CAAC,SAAS,CAAC,WAAW,EAAE;KACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAgB;IACzC,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B;;kEAE0D;QAC1D,MAAM,EAAE,GAAG,CAAC,cAAc,KAAK,IAAI;QACnC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,WAAW,EAAE;QACxC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,IAAI;QAC7C,8GAA8G;QAC9G,SAAS,EAAE,GAAG,CAAC,SAAS;KACzB,CAAC;AACJ,CAAC"}
package/dist/runtime.d.ts CHANGED
@@ -38,6 +38,7 @@ export type { Database } from "./db/client.js";
38
38
  export { getDb } from "./db/client.js";
39
39
  export type { DecisionRow, WatchedCollection } from "./db/schema.js";
40
40
  export { decisions, watchedCollections } from "./db/schema.js";
41
+ export { claimFailureReason } from "./lib/claim-failure.js";
41
42
  export { AppError } from "./lib/errors.js";
42
43
  export type { BlocksyncDeps, CollectionNode } from "./lib/ixo/blocksync/index.js";
43
44
  export { getCollection } from "./lib/ixo/blocksync/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AAIxB,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAA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from "./oracle.js";
43
43
  export { loadConfig } from "./config.js";
44
44
  export { getDb } from "./db/client.js";
45
45
  export { decisions, watchedCollections } from "./db/schema.js";
46
+ // A failed ingest's claimant-safe sentence — what the claim read says, for a provider's own "why".
47
+ export { claimFailureReason } from "./lib/claim-failure.js";
46
48
  export { AppError } from "./lib/errors.js";
47
49
  export { getCollection } from "./lib/ixo/blocksync/index.js";
48
50
  // --- plumbing, verbatim from the modules that assemble it, for a provider's own Workflow ---------
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAEL,cAAc,IAAI,sBAAsB,GACzC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAEL,kBAAkB,IAAI,0BAA0B,GACjD,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE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AAC,GAAG,CAAC,CAAC;IAC/B,OAAO,0BAA0B,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;AACpG,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAc,EACd,YAAoB;IAEpB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;IAChE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAC5D,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAc,EACd,IAAoD,EACpD,IAAa;IAEb,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACjC,MAAM,QAAQ,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACnE,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
package/docs/api.md CHANGED
@@ -218,6 +218,7 @@ import type {
218
218
  import {
219
219
  AppError,
220
220
  broadcastAsOracle,
221
+ claimFailureReason,
221
222
  decisions,
222
223
  getCollection,
223
224
  getDb,
@@ -257,6 +258,7 @@ and the database handle from it exactly as the cron does (`cron/scan.ts`'s `cron
257
258
  | `registerCollection` | function | `(env, input: RegisterInput) => Promise<WatchedCollection>` — the SAME four gates (WHO/HIRED/PROTOCOL/PAID), delegation resolution, upsert and paused→active notice `POST /v1/collections/register` runs (`lib/register.ts`), as a function. `input.cursor` is the one thing the HTTP body schema never exposes: applied on FIRST registration only — a re-register can never rewind it (it is not in the upsert's conflict `set`). `null` scans the collection from claim zero (the existing NULL-cursor path, blocksync `CLAIMS_FROM_START`) for a collection whose claims may predate this oracle's registration; absent seeds the cursor to now, the HTTP route's own behaviour, unchanged | Your own Workflow registering a collection AS the oracle's own principal, after minting its own evaluate grant — there is no inbound request to authenticate or a body to validate |
258
259
  | `broadcastAsOracle` | function | `(env, msgs, memo?) => Promise<{ code, transactionHash, rawLog? }>` — signs and broadcasts arbitrary messages as THIS oracle's account, the same sequence-managed signer the act lane uses (`getOracleSigner`, `lib/ixo/chain.ts`). Memo defaults to your oracle's own `name`. Does **not** inspect `res.code` — unlike `signEvaluation` this is a raw broadcast primitive, not a decision lane, so a non-zero code is yours to interpret. Throws `AppError.unavailable` when `ORACLE_SECP_MNEMONIC` is unset, before the signer is ever built | Composing your own `MsgExec` around kit-issued messages |
259
260
  | `rehireOpenhands` | function | `(env, collectionId) => Promise<"started" \| "existing" \| "restarted" \| "throttled" \| "failed">` — starts the OpenHands hire for a collection, or reruns its ended instance (spending the collection's backstop restart budget: three a day). A rerun mints only when the chain says the grant is stale or below 50 verdicts | `openhands` on, and your own `act` policy counts verdicts and sees an ask running low before the backstop's next visit |
261
+ | `claimFailureReason` | function | `(error: string \| null) => string` — a failed ingest (`claim_ingests.status = "failed"`) in a sentence a claimant may read, from its stored `error`: an owner-billing cause (`OWNER_DELEGATION_CAR` unset, the owner's delegation refused, no IXO subscription) is "The oracle isn't set up to bill this check yet — the operator has been told.", anything else "The check couldn't run; the operator has been told." Never the stored text itself (env var names, RPC detail) | Your own claimant-facing "why" route, so a failed claim says failed — the same words `GET /v1/claims/:claimId` gives its submitter |
260
262
  | `AppError` | class | The kit's typed error — `.notFound()`, `.forbidden()`, `.conflict()`, `.unavailable()`, `.internal()`, … (§13) | Catching/rethrowing what the four functions above throw, in your own error handling |
261
263
  | `ChainWriteOutcome` | type | `"submitted" \| "skipped" \| "blocked" \| "held" \| "owner_submitted"` — what `signEvaluation` resolves to, and (alongside `"pending"`, the row's initial state before any write is attempted) the full `decisions.chainStatus` enum. A decision the act lane can never sign (an engine `unusable`, a `decided` review verdict) starts `"skipped"` instead; a `pending_review` starts `"pending"` and its fold acts | Branching on the result, or reading `chainStatus` off `GET /v1/claims/:claimId` |
262
264
  | `RegisterInput` | type | `{ collectionId, principal: { did, address }, contactEmail?, delegationCar?, cursor? }`. No `contactEmail` sent and none stored ⇒ the row takes the `contactEmail` of the oldest-activated `active` Decision API source whose `companyEntityDid` is the collection's COMPANY as the engine derives it (`GET /v1/collections/:id/company`, UCAN `collection/company-read`: the collection's entity, or the org a deed is linked to both ways); a `disputed` company, a collection the engine does not know, or none such source ⇒ stays empty. Its `503` or any other failure never fails the register (logged `register.company-unavailable`, the row stays empty for a later register to fill). An explicit or stored contact is never overwritten. The SAME answer (one engine read per register) also links the collection to every `active` source of that company (`api_source_collections`, `linkedBy` = the company's entity DID, audit `source.collection_linked` by `system:company-link`; idempotent — an existing link is left alone); only the engine's `ok` links. The engine is asked only when no contact is sent or stored, or an `active` source is not yet linked to the collection. | Building the input to `registerCollection` |
@@ -464,8 +466,11 @@ collection gets at most three hire reruns a day from the backstop and three from
464
466
  separate budgets. `POST /openhands/scan/<collectionId>` scans a watched collection at once (at
465
467
  most once a minute; extra calls are scanned on the next minute tick). A scan that starts nothing —
466
468
  usually because Blocksync has not indexed the claim yet — is looked at again on each of the next
467
- three minute ticks, and no webhook scan moves the collection's place in the rotation. `GET /v1/info` advertises
468
- both paths under `openhands`, which is how the OpenHands app tells a checker from any other oracle.
469
+ three minute ticks, and no webhook scan moves the collection's place in the rotation. The third
470
+ route, `GET /openhands/claims/<claimId>/why`, tells the claim's own submitter why it was decided
471
+ the way it was — the per-check reasons the public receipt leaves out (§7 has its auth and body);
472
+ the OpenHands app shows it beside the receipt. `GET /v1/info` advertises the three paths under
473
+ `openhands` (`hire`, `scan`, `why`), which is how the OpenHands app tells a checker from any other oracle.
469
474
 
470
475
  `OpenhandsOptions` (all optional):
471
476
 
@@ -477,7 +482,7 @@ both paths under `openhands`, which is how the OpenHands app tells a checker fro
477
482
 
478
483
  Bindings, with `openhands` on: the `HIRE_WORKFLOW` workflow (class `OpenhandsHire`) and, outside
479
484
  `ENVIRONMENT=development`, the `OPENHANDS_RATE_LIMITER` ratelimit — unbound there, both webhooks
480
- answer `503` (fail closed). `decision-oracle init --openhands` writes both. State lives in two
485
+ answer `503` and the why route `429` (fail closed). `decision-oracle init --openhands` writes both. State lives in two
481
486
  tables of your `DB` (`openhands_state`, `openhands_hires`, shipped migration `0025_openhands`).
482
487
 
483
488
  ### The whole-producer escape hatch
@@ -1602,7 +1607,7 @@ it("bands a vendor score against the rule's own thresholds", async () => {
1602
1607
  | `CLAIM_WORKFLOW` | `Workflow` | `ClaimIngest` — one instance per claim |
1603
1608
  | `REVIEW_WORKFLOW` | `Workflow` | `ReviewComplete` — the review fold |
1604
1609
  | `HIRE_WORKFLOW` | `Workflow` (optional) | `OpenhandsHire` — one instance per hired OpenHands collection. Required with `openhands` on |
1605
- | `OPENHANDS_RATE_LIMITER` | `RateLimit` (optional) | The OpenHands webhooks' limit, spent per caller address (an IPv6 caller by its /64) and per collection. Required with `openhands` on outside `ENVIRONMENT=development` (unbound ⇒ `503`) |
1610
+ | `OPENHANDS_RATE_LIMITER` | `RateLimit` (optional) | The OpenHands routes' limit, spent per caller address (an IPv6 caller by its /64) and per collection (the webhooks) or per issuer (the why route). Required with `openhands` on outside `ENVIRONMENT=development` (unbound ⇒ `503`) |
1606
1611
  | `SEQUENCE_MANAGER` | `DurableObjectNamespace` | The SDK's `SequenceManagerDO`: one instance per signer, allocating account sequence numbers so concurrent chain writes never race |
1607
1612
 
1608
1613
  Your own bindings ride alongside — the type is open (`OracleEnv & YourEnv`); only the names above
@@ -1779,9 +1784,10 @@ check.**
1779
1784
  | `GET /health/ready` | public, **rate-limited** (per IP) | `{ ok }` only — `200` when every critical check passes, `503` otherwise. Checks `d1`, `kv`, `engine` (its `/.well-known/did.json`) and, with `API_LANE` and `API_PAYMENTS` on, `facilitator` (`X402_FACILITATOR_URL/supported`), in parallel, 2 s each, plus `identity` (a config read: fails when `ORACLE_ENTITY_DID` is unset on a non-local `ORACLE_HOSTNAME`) and `owner-delegation` (fails when `OWNER_DELEGATION_CAR` is set but is not a UCAN delegation; unset passes); the settled answer is cached per isolate for 15 s. A failure before the route runs (a config that does not load) is also `503 { ok: false }`. Names no check — the detail is `/v1/admin/status`'s |
1780
1785
  | `GET /.well-known/did.json` | public, rate-limit exempt | Needs `SERVICE_ED25519_MNEMONIC` |
1781
1786
  | `GET /.well-known/oauth-protected-resource/v1/mcp` | public, rate-limit exempt, `Access-Control-Allow-Origin: *`, `cache-control: public, max-age=300` | RFC 9728 metadata for the MCP server: `{ resource: "https://<ORACLE_HOSTNAME>/v1/mcp", authorization_servers: [AUTH_HUB_URL], scopes_supported: ["claims:write", "claims:read"], bearer_methods_supported: ["header"] }`. `404` unless `API_LANE` is on. Outside the `/v1/api` contract |
1782
- | `GET /v1/info` | **public** (the only public `/v1` path) | —. The marketplace listing: `name`, `description`, `did`, `address`, `entityDid` (the on-chain oracle entity from `ORACLE_ENTITY_DID`, `null` when unset), `serviceDid`, `supportedProtocols`, `protocols` (the same list readably: `[{ did, name, fee }]` — `name` the protocol's `#pro` profile name, else its claim form's title, cached 1 h, `null` when neither reads; `fee` the `{ denom, minAmount }` register charges for it), `pricing`, `policies`, `earnings: { address, baseWallet }` (the operator's `EARNINGS_ADDRESS` / `EARNINGS_BASE_WALLET`, `null` when unset — read-only, set in the oracle's config), `payouts: { decisionToPay, operatorAmount }` — how a payout amount is chosen, for a portal to show before a company opts in: `decisionToPay` is the config's `payouts` map verbatim (per protocol DID, `{ amount: <answer path>, currency: <ISO 4217 code> | { path } | { asset, decimals } }`; `{}` when none, and a protocol absent from it gets no decision to pay), `operatorAmount` is `{ summary }` from `policies.actSummary` when an `act` policy is configured, else `null` (`actSummary` is served only here, never under `policies`), and `reviewBilling: { mode, pricePerReview }` — how a collection pays for its reviews: `mode: "x402"` (per-review billing ACTIVE: IXO's plan for the oracle allows it — the engine's `GET /v1/oracles/me` `reviewBilling`, KV-cached 5 min — on an oracle running `API_LANE`: per review from the company's credits, an empty evaluation leg) with `pricePerReview: { denom: "upay", amount }` the published per-review price (the one the supported protocols share, else `pricing.api.amountMicroUsd` / `API_PRICE_USD_CENTS`; `null` when none is published), or `mode: "escrow"` (the collection's on-chain evaluation payment, `pricing`) with `pricePerReview: null`. `cache-control: public, max-age=300`. With `openhands` set, also `openhands: { hire: "/openhands/hire/:collectionId", scan: "/openhands/scan/:collectionId" }` — absent on any other oracle. A portal is built against these exact field names |
1787
+ | `GET /v1/info` | **public** (the only public `/v1` path) | —. The marketplace listing: `name`, `description`, `did`, `address`, `entityDid` (the on-chain oracle entity from `ORACLE_ENTITY_DID`, `null` when unset), `serviceDid`, `supportedProtocols`, `protocols` (the same list readably: `[{ did, name, fee }]` — `name` the protocol's `#pro` profile name, else its claim form's title, cached 1 h, `null` when neither reads; `fee` the `{ denom, minAmount }` register charges for it), `pricing`, `policies`, `earnings: { address, baseWallet }` (the operator's `EARNINGS_ADDRESS` / `EARNINGS_BASE_WALLET`, `null` when unset — read-only, set in the oracle's config), `payouts: { decisionToPay, operatorAmount }` — how a payout amount is chosen, for a portal to show before a company opts in: `decisionToPay` is the config's `payouts` map verbatim (per protocol DID, `{ amount: <answer path>, currency: <ISO 4217 code> | { path } | { asset, decimals } }`; `{}` when none, and a protocol absent from it gets no decision to pay), `operatorAmount` is `{ summary }` from `policies.actSummary` when an `act` policy is configured, else `null` (`actSummary` is served only here, never under `policies`), and `reviewBilling: { mode, pricePerReview }` — how a collection pays for its reviews: `mode: "x402"` (per-review billing ACTIVE: IXO's plan for the oracle allows it — the engine's `GET /v1/oracles/me` `reviewBilling`, KV-cached 5 min — on an oracle running `API_LANE`: per review from the company's credits, an empty evaluation leg) with `pricePerReview: { denom: "upay", amount }` the published per-review price (the one the supported protocols share, else `pricing.api.amountMicroUsd` / `API_PRICE_USD_CENTS`; `null` when none is published), or `mode: "escrow"` (the collection's on-chain evaluation payment, `pricing`) with `pricePerReview: null`. `cache-control: public, max-age=300`. With `openhands` set, also `openhands: { hire: "/openhands/hire/:collectionId", scan: "/openhands/scan/:collectionId", why: "/openhands/claims/:claimId/why" }` — absent on any other oracle. A portal is built against these exact field names |
1783
1788
  | `POST /openhands/hire/:collectionId` | public, **`OPENHANDS_RATE_LIMITER`** (per caller and per collection; unbound outside development ⇒ `503`), `openhands` on only | Starts the collection's hire (`202 { started: true }`) after reading that it exists and its admin granted this oracle a live meta-grant: `404` no such collection (not cached), `409` no meta-grant (cached 10 min). A hire in flight, or an ended one the chain says is healthy, is `200 { existing: true }` (the healthy answer cached 1 min); an ended one the chain says is stale or low is rerun from the webhook's own budget (`200 { restarted: true, reason }`, three a day, then `{ throttled: true }`). `400` a malformed id, `405` not POST, `503` when the chain or Blocksync cannot answer |
1784
1789
  | `POST /openhands/scan/:collectionId` | public, **`OPENHANDS_RATE_LIMITER`**, `openhands` on only | Scans one watched collection now: `200 { started }`, `202 { coalesced: true }` within a minute of the last (scanned on the next minute tick), `404` not watched, `409` paused. A `200 { started: 0 }` (or a failed scan) is retried on the next three minute ticks |
1790
+ | `GET /openhands/claims/:claimId/why` | **the claim's own submitter**: a UCAN invocation (`Authorization: Bearer <token>`, `X-Auth-Type: ucan`) carrying exactly `{ can: "claims/why", with: "ixo:claim:<claimId>" }`, addressed to this oracle's did:web, self-issued (no delegation), expiring at most 10 min out, whose issuer is the claim's on-chain `agentDid`. **`OPENHANDS_RATE_LIMITER`** per caller address before the token is checked and per issuer after (`429`; unbound outside development ⇒ `429`). `openhands` on only | Why the claim was decided: `200 { outcome, summary, reasons[], evidenceGrade?, reviewNote?, receiptCid? }` — `outcome` is `approved` (approve or partial) / `rejected` / `review` (held for a person) / `pending`; each reason is `{ code, label, result: pass \| fail \| error \| review, detail, value?, threshold?, unit? }`, one per gate or criterion, explained through the one fact it reads and labelled by the pinned rubric (`#rub`, read for its public sentences only, hash-checked, cached 7 days; unreadable ⇒ codes without labels). An `ext` fact's reason is never echoed (only the stock geo handlers' distances and evidence grade), an AI sentence only scrubbed of identifiers, and no AI instruction is ever read. A claim queued, or on a watched collection and not yet seen, is `pending`; a **failed ingest** is `pending` with a fixed sentence (`claimFailureReason`) — never the stored error. Anyone but the agent, or a claim this oracle never saw, gets the same `404 NOT_FOUND`; `401` no or a bad token, `400` a malformed id, `405` not GET, `503` when Blocksync or the DID resolver cannot answer |
1785
1791
  | `POST /v1/collections/register` | UCAN `collections/register` | The four gates, in order: **who** (the collection entity's chain owner, or a holder of an active on-chain `EvaluateClaimAuthorization` — read uncached) · **hired** (this oracle's `ORACLE_ADDRESS` holds that grant too, else `409`) · **protocol** (in `supportedProtocols`, else `409` — checked before payment) · **paid** (`Payments.evaluation` matches `pricing`, else `402`; while per-review billing is active (IXO's plan), the collection's company — ONE engine read, `GET /v1/collections/:id/company`, its blip or a `disputed` company `503 company_unavailable` — holding a live review-billing delegation on its Decision API source, still signed by the organisation's current chain owner, with a published price and cap left, registers with an EMPTY evaluation leg (`billingSourceId` set, never billed twice) once the payer's credits cover one review: `GET /v1/balances` with the stored delegation in `X-Payment-Delegation`, both `available` and `delegationRemaining` ≥ the price, else `402 insufficient_credits` (`details.price`, `details.fundingUrl`), an unreadable answer `503 credits_unavailable`; no usable delegation ⇒ the escrow gate as before, its refusal `402 no_review_billing` naming both ways in). Body: `{ collectionId, delegationCar?, contactEmail? }`. No `contactEmail` sent and none stored ⇒ the row takes the `contactEmail` of the oldest-activated `active` Decision API source whose `companyEntityDid` is the collection's COMPANY as the engine derives it (`GET /v1/collections/:id/company`, UCAN `collection/company-read`: the collection's entity, or the org a deed is linked to both ways); a `disputed` company, a collection the engine does not know, or none such source ⇒ stays empty. Its `503` or any other failure never fails the register (logged `register.company-unavailable`, the row stays empty for a later register to fill). An explicit or stored contact is never overwritten. The SAME answer (one engine read per register) links the collection to every `active` Decision API source of that company, so its chain claims read with the source's (contracts 1.21.0: `LinkedCollection.linkedBy` = the company's entity DID, audit `source.collection_linked` by `system:company-link`, re-checked hourly against the engine and dropped `not_company` when it names another company or `disputed`; only such a positive finding hides a link — an unreachable engine keeps it in the reads, contracts 1.23.0); idempotent, and only the engine's `ok` links. The engine is asked only when no contact is sent or stored, or an `active` source is not yet linked to the collection. Every refusal carries a stable machine code in `details.reason` beside the human message: `404 collection_not_found`, `403 owner_unresolvable` · `not_owner_or_grantee` · `contact_change_forbidden` · `resume_forbidden`, `409 not_hired` · `unsupported_protocol`, `402 evaluation_underpaid` · `no_review_billing` · `insufficient_credits`, `503 company_unavailable` · `credits_unavailable`. |
1786
1792
  | `GET /v1/collections` | UCAN `collections/read` | The rows the caller owns or enrolled |
1787
1793
  | `POST /v1/collections/:id/pause` | UCAN `collections/pause` + read gate + owner, enroller (while it holds a live grant) or `ORACLE_ADMIN_DIDS` (a plain grant holder is `403`) | Sets `status: paused`, clears the reason — the cron enqueues nothing |
@@ -1793,7 +1799,7 @@ check.**
1793
1799
  | `POST /v1/collections/:id/reviewers` | UCAN `collections/reviewers-grant` (never `*`) + a **current controller** of the collection's entity (read live off Blocksync), who must be the grant's issuer | `{ delegation }` — a base64 CAR the controller signed: a reviewer grant (below). Checked as the review gate checks it (no revocation step), then filed in `collection_reviewers`. A controller may name **themselves**, and a grant to the collection's owner is filed like any other: one person may post an ask and review it (the owner's seat in the review room only lets them see reviews; answering always takes a grant). `201` + the grant row (`memberDid`, `rootDid`, `delegationCid`, `delegation`, `expiresAt`, `revokedAt`, `createdAt`). The same CAR again answers the same row; a revoked one is `409` (sign a new one). `400 REVIEWER_GRANT_INVALID` / `403 REVIEWER_NOT_AUTHORIZED` as the gate, `404` unwatched |
1794
1800
  | `GET /v1/collections/:id/reviewers` | UCAN `collections/reviewers-read` (never `*`) | A current controller: `{ reviewers: [...] }`, every grant on the collection; a reviewer: only their own, CAR included (the Portal sends it with an answer); anyone else `403` |
1795
1801
  | `POST /v1/collections/:id/reviewers/:delegationCid/revoke` | UCAN `collections/reviewers-revoke` (never `*`) + a current controller | Stamps `revokedAt` (once) and kicks the reviewer from the collection's review room. Every later answer and every pending fold under that grant is refused. `404` for an unknown grant |
1796
- | `GET /v1/claims/:claimId` | UCAN `claims/read` + read gate, or a live reviewer of the claim's collection (a filed, unrevoked grant inside its window whose root is still a controller — read live, so Blocksync down is `503`), or the claim's own submitter (matched by EITHER the claim's on-chain agent DID or its agent address, invoking as themselves; one Blocksync claim read, cached a day — a claim Blocksync does not know yet is not cached — tried only after the other doors; Blocksync down is `503`) | The full record: ingest ⟕ decision ⟕ review. The submitter sees the decision and its public receipt (which names who reviewed), but never the review's answers: `review.answers` and `review.reviewerDid` come back `null`, and so do the internal failure texts `ingest.error`, `decision.chainError` and `decision.erroredFacts`. `404` when this oracle has not seen the claim. The submitter gets no other read: not the list, not `/v1/reviews`, not another claim. Plus `checks` — the breakdown: every check the decision was made on, `[{ name, status, value, reason }]` (`reason` the checker's own words, a passed AI check's included; an error's detail), never a transcript or a prompt, `null` when the claim has no decision or its row has no facts. The submitter's copy is **cleaned**: URLs, emails, DIDs, CIDs and other identifiers, exact coordinates, phone-shaped and long numbers, plate-shaped tokens and long quotes become `[hidden]`, capped at 280 characters — they read why, not another claim's ids or someone's details. Plus `reviewerNote` (`policies.reviewerNote`) for every reader but the submitter, who gets `null` |
1802
+ | `GET /v1/claims/:claimId` | UCAN `claims/read` + read gate, or a live reviewer of the claim's collection (a filed, unrevoked grant inside its window whose root is still a controller — read live, so Blocksync down is `503`), or the claim's own submitter (matched by EITHER the claim's on-chain agent DID or its agent address, invoking as themselves; one Blocksync claim read, cached a day — a claim Blocksync does not know yet is not cached — tried only after the other doors; Blocksync down is `503`), or an account a LIVE on-chain authz grant links to that agent, either direction and any message type (the person who granted an agent key that files for them, or a key the agent granted; both `ixo1…` accounts; one Blocksync `authzGrants` read, cached 5 min per pair, yes or no) — read as the submitter | The full record: ingest ⟕ decision ⟕ review. The submitter sees the decision and its public receipt (which names who reviewed), but never the review's answers: `review.answers` and `review.reviewerDid` come back `null`, and so do the internal failure texts `decision.chainError` and `decision.erroredFacts`. `ingest.error` is `null` too, except on a failed ingest (`ingest.status: "failed"`), where it is a safe sentence instead of the stored text (`claimFailureReason`, `/runtime`): "The oracle isn't set up to bill this check yet — the operator has been told." for an owner-billing cause, else "The check couldn't run; the operator has been told." `404` when this oracle has not seen the claim. The submitter gets no other read: not the list, not `/v1/reviews`, not another claim. Plus `checks` — the breakdown: every check the decision was made on, `[{ name, status, value, reason }]` (`reason` the checker's own words, a passed AI check's included; an error's detail), never a transcript or a prompt, `null` when the claim has no decision or its row has no facts. The submitter's copy is **cleaned**: URLs, emails, DIDs, CIDs and other identifiers, exact coordinates, phone-shaped and long numbers, plate-shaped tokens and long quotes become `[hidden]`, capped at 280 characters — they read why, not another claim's ids or someone's details. Plus `reviewerNote` (`policies.reviewerNote`) for every reader but the submitter, who gets `null` |
1797
1803
  | `DELETE /v1/claims/:claimId/body` | UCAN `claims/erase` (never `*`) + the collection's **current** chain owner (read live off Blocksync; the enroller, grant holders and `ORACLE_ADMIN_DIDS` are `403`) — `404` when this oracle has not seen the claim or it is a Decision API claim, `503` on chain trouble | `204`; `409 CONFLICT` while the claim is still `queued` or `processing` (erase it once it is decided). Erases the claim's answer copies now: strips every `transcript` from `decisions.facts` (the AI prompts and HTTP payloads; the fact values stay), nulls the duplicate registry's `normalizedText`, drops its fact-cache rows, and stamps `claim_ingests.erasedAt`. The decision, its receipt and the registry digests stay, so the receipt still verifies and duplicates are still caught. Idempotent: `204` again, the first `erasedAt` kept. Logged `claims.erased`, counted `claims.erased` (`op: chain`). The CLI's `decision-oracle erase` loops over it The reviewer note (`reviewerNote`) is erased with them |
1798
1804
  | `GET /v1/reviews/:claimId` | UCAN `reviews/read` + read gate, or a live reviewer of the claim's collection | The pending tasks, the stored answers, why a fold failed, `erroredFacts` (below; null when none errored), and `checks` — every frozen `ext` / `ai` fact the decision was made on, `[{ name: "ai.judge", status: "ok" \| "error", value, reason }]`, `reason` the checker's own words (a passed AI check's reasoning included; an error's `detail`), never a transcript or a prompt; `null` on a row with no facts (a facts-lane outcome). What a reviewer reads before deciding (the same list `GET /v1/claims/:claimId` serves). Plus `reviewerNote` — `{ says, checkThese[], model, createdAt }` (`policies.reviewerNote`), `null` when none was made |
1799
1805
  | `GET /v1/admin/status` | UCAN `admin/status` + `ORACLE_ADMIN_DIDS` or `STATUS_READER_DIDS` (`403` otherwise — everyone, while both are unset) | `{ readiness: { ok, checks: { <name>: { ok, ms, critical, detail? } } }, backlog: { review: { pending }, collections: { paused: { total, <reason>: n } }, sources?: { paused }, webhooks?: { due, oldestAgeS } }, engine: { billingStatus, manageSubscriptionUrl } \| null }` — `sources`/`webhooks` only with `API_LANE` on; `engine` is the engine's `GET /v1/oracles/me`, `null` when it did not answer within 2 s; `detail` is set only on a failed `identity` or `owner-delegation` check and names the command to run. Outside the `/v1/api` contract |
@@ -1897,8 +1903,8 @@ collection entity's current chain owner (read off Blocksync, cached 5 min), or a
1897
1903
  evaluate grant for it (cached 5 min) — the same permission surface as the portal's "Grant Role"
1898
1904
  flow. The enroller passes only while it still holds a grant, and an owner who transferred the
1899
1905
  entity reads nothing. A collection this oracle does not watch is a `404`. One claim's record also
1900
- opens to that claim's submitter (its on-chain agent DID or agent address) — that claim only,
1901
- never the collection.
1906
+ opens to that claim's submitter (its on-chain agent DID or agent address, or an account a live
1907
+ authz grant links to that agent, either way round) — that claim only, never the collection.
1902
1908
 
1903
1909
  There is deliberately **no claim-ingestion endpoint**: the chain is truth, so a pushed claimId adds
1904
1910
  nothing worth trusting.
package/docs/guide.md CHANGED
@@ -1043,9 +1043,15 @@ oracle the right to authorize itself on the new collection, and the app calls
1043
1043
  own evaluate grant under it, registers the collection through the same four gates above, and scans
1044
1044
  it. A grants feed every minute catches a call that never arrived (it follows the meta-grants
1045
1045
  made to your oracle on Blocksync), and a backstop every five minutes keeps every hired ask
1046
- topped up. `GET /v1/info` lists the two webhooks under `openhands` — that is how the app knows
1046
+ topped up. `GET /v1/info` lists the two webhooks (and the why route below) under `openhands` — that is how the app knows
1047
1047
  you are an OpenHands checker. (api.md §2, "The OpenHands add-on", has every step and answer.)
1048
1048
 
1049
+ The add-on also answers the people who submit: `GET /openhands/claims/<claimId>/why` tells a
1050
+ claim's own submitter (a UCAN their app signs as the claim's on-chain agent) which checks passed,
1051
+ which failed and why, in the rubric's words — the reasons the public receipt leaves out — and the
1052
+ OpenHands app shows it on the claim. A claim still running, or one whose check could not run, reads
1053
+ "pending"; the second with a fixed sentence, never your logs' error text. Nothing to configure.
1054
+
1049
1055
  Three things to decide:
1050
1056
 
1051
1057
  - **Your protocols.** With `supportedProtocols` set, the app offers your oracle for asks on those
@@ -1185,7 +1191,11 @@ human review. Both are UCAN-guarded and gated to the collection's current chain
1185
1191
  evaluate-grant holder — the registrant only while it still holds its grant — and the single-claim
1186
1192
  read to the collection's live reviewers too, and to the claim's own submitter (its on-chain agent DID or
1187
1193
  address, who sees the decision and its public receipt — which names who reviewed — but never the
1188
- review's answers). `chainStatus` is `pending` / `submitted` / `owner_submitted` / `blocked` / `skipped`
1194
+ review's answers). An agent key filing for a person is the claim's on-chain agent, so the submitter's
1195
+ read also opens to an account a live authz grant links to that agent, either way round — the person
1196
+ who granted it, or a key it granted. A failed ingest tells the submitter so in a safe sentence
1197
+ (`ingest.error`, never the stored text; `claimFailureReason` in `/runtime` gives your own "why"
1198
+ route the same words). `chainStatus` is `pending` / `submitted` / `owner_submitted` / `blocked` / `skipped`
1189
1199
  (a decision nothing will ever sign: an engine `unusable`, or a `decided` review verdict with no review
1190
1200
  held for a person), or
1191
1201
  **`held`** when your own `policies.act` hook chose to keep a decided verdict back instead of signing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/decision-oracle",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Run an IXO evaluation oracle: pull claims, produce facts with your handlers, let the decision engine decide, sign on chain",
6
6
  "keywords": [