@ixo/decision-oracle 0.2.19 → 0.2.20

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
@@ -410,6 +410,7 @@ re-decides itself against live state, so re-running it is always safe.
410
410
  | `scan --collection <id> [--kit <url>]` | makes the oracle discover and start claims now instead of at the next cron tick | testing, or catching up after a pause |
411
411
  | `relink [--collection <id>]… [--kit <url>]` | as an operator (your DID in `ORACLE_ADMIN_DIDS`), links watched collections — every one, or those named — to the `active` Decision API sources of their company, exactly as `register` now does (`POST /v1/admin/collections/relink`); prints each collection's outcome. Idempotent | once, for collections registered before register linked them |
412
412
  | `reviewer-note <claimId> [--kit <url>]` | as an operator (your DID in `ORACLE_ADMIN_DIDS`), (re)makes the plain-words reviewer note for a claim held for a person (`POST /v1/admin/claims/:claimId/reviewer-note`): the oracle re-pulls the body and spends one model call; the note is read on `GET /v1/reviews/:claimId` | a claim held before `policies.reviewerNote` was on, or one whose note failed |
413
+ | `redeliver <claimId> [--yes] [--kit <url>]` | as an operator (your DID in `ORACLE_ADMIN_DIDS`), releases a decided approve/reject whose chain delivery is parked without facts (`POST /v1/admin/claims/:claimId/redeliver`): the oracle re-pulls the body, rebuilds the facts its act policy reads (the engine's decision and receipt stay as recorded), stores them and signs `MsgEvaluateClaim`. Dry run without `--yes`; idempotent once delivered | a `blocked` claim whose `chainError` says its facts could not be rebuilt |
413
414
  | `erase (<claimId>… \| --collection <id>) [--kit <url>] [--yes]` | as the collection's current chain owner, erases claims' transcripts and registry text (`DELETE /v1/claims/:claimId/body` per claim; `--collection` = every claim this oracle has seen, skipping and listing those still being decided; a `429` waits its `Retry-After`). Dry run without `--yes` | when the organisation deletes its data — the oracle never does it on its own |
414
415
  | `oracle init --protocol <did> --kit-url <url> [--logo <url|file>] [--openhands [--price-pay <n>]] [--only <step>] [--relogin] [--yes]` | provisions the whole oracle in thirteen idempotent steps — `fund` tops the wallet up to 1 IXO for gas, `iid` its IID document, `key` the Ed25519 verification method, `matrix` its bot account (the access token is written into `.dev.vars`), `entity`, `orz`, `profile`, `domain` (the `#dmn` domain card), `acard` (the `#acard` Agent Card), `linked`, `service` (the `#eval` endpoint, re-pointed when it moved), `backlink`, `index` — `--logo` is optional but recommended (without it the portal and the console show a placeholder); `--openhands` (or an oracle whose `/v1/info` names its `openhands` webhooks — one built with `init --openhands`) adds `check-openhands` (the OpenHands app's checker marker), priced in PAY from `/v1/info`'s `pricing.api` (else `--price-pay <n>`, else the protocol's evaluation fee when it is in `upay`; 1 PAY = 1 USD); each deciding `do` or `skip` against live state, so a re-run is always safe. Dry run without `--yes`; `--only <step>` runs exactly one, `--relogin` forces a fresh Matrix token. Only `iid`, `key` and `matrix` need the oracle's own `ORACLE_SECP_MNEMONIC` / `SERVICE_ED25519_MNEMONIC` (a step that does names the missing one); every other step runs on the AuthHub session alone, so a deployed oracle whose keys are only worker secrets can still `--only orz|profile|domain|acard` ([what each step does](#declaring-yourself-on-chain)) | once per network, and again after a deploy that changes your host |
415
416
 
@@ -712,6 +713,7 @@ chain owner, or any holder of a live evaluate grant on it (the enroller only whi
712
713
  | `GET /v1/reviews/:claimId` | read gate, or a live reviewer | pending tasks, stored answers, why a fold failed |
713
714
  | `GET /v1/admin/status` | `ORACLE_ADMIN_DIDS` or `STATUS_READER_DIDS` | readiness per check, the backlog, the engine's billing status |
714
715
  | `POST /v1/admin/collections/relink` | `ORACLE_ADMIN_DIDS` | `{ collectionIds? }` — link watched collections to their company's Decision API sources, as register does |
716
+ | `POST /v1/admin/claims/:claimId/redeliver` | `ORACLE_ADMIN_DIDS` | rebuild a parked decided claim's facts (act-policy inputs only) and deliver it to the chain |
715
717
 
716
718
  The claim reads are operator plumbing. The oracle dashboard — billing status, fees, usage,
717
719
  decisions, earnings — is hosted by the decision engine, not by this package.
@@ -782,6 +784,6 @@ symlinks are not packed). CI diffs them — change one, copy it to the other.
782
784
 
783
785
  ## Status
784
786
 
785
- Published on npm: `@ixo/decision-oracle` 0.2.19 and `@ixo/decision-oracle-client` 0.1.1.
787
+ Published on npm: `@ixo/decision-oracle` 0.2.20 and `@ixo/decision-oracle-client` 0.1.1.
786
788
 
787
789
  Apache License 2.0: `LICENSE` at the repo root and in each package.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `decision-oracle redeliver <claimId>` — the operator's release of one decided claim whose chain
3
+ * delivery is parked without facts (`POST /v1/admin/claims/:claimId/redeliver`): the oracle re-pulls
4
+ * the body, rebuilds the facts its act policy reads (the engine's decision and receipt stay as
5
+ * recorded), stores them, and signs `MsgEvaluateClaim` with ITS chain key — hence the `--yes` gate.
6
+ * Signed as the AuthHub session `decision-oracle login` saved, whose DID must be in the oracle's
7
+ * `ORACLE_ADMIN_DIDS`.
8
+ *
9
+ * decision-oracle redeliver <claimId> [--yes] [--network devnet|testnet|mainnet] [--kit <url>] [--env-file <path>]
10
+ */
11
+ export declare function run(argv: string[]): Promise<number>;
12
+ //# sourceMappingURL=redeliver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redeliver.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/redeliver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAiCzD"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * `decision-oracle redeliver <claimId>` — the operator's release of one decided claim whose chain
3
+ * delivery is parked without facts (`POST /v1/admin/claims/:claimId/redeliver`): the oracle re-pulls
4
+ * the body, rebuilds the facts its act policy reads (the engine's decision and receipt stay as
5
+ * recorded), stores them, and signs `MsgEvaluateClaim` with ITS chain key — hence the `--yes` gate.
6
+ * Signed as the AuthHub session `decision-oracle login` saved, whose DID must be in the oracle's
7
+ * `ORACLE_ADMIN_DIDS`.
8
+ *
9
+ * decision-oracle redeliver <claimId> [--yes] [--network devnet|testnet|mainnet] [--kit <url>] [--env-file <path>]
10
+ */
11
+ import { parse, UsageError } from "../lib/args.js";
12
+ import { confirm, resolveNetwork } from "../lib/chain.js";
13
+ import { oracleUrlFor, tryProjectConfig } from "../lib/devvars.js";
14
+ import { kitFetch, loadSession } from "../lib/session.js";
15
+ export async function run(argv) {
16
+ const { values, positionals } = parse(argv, {
17
+ options: {
18
+ yes: { type: "boolean" },
19
+ network: { type: "string" },
20
+ kit: { type: "string" },
21
+ "env-file": { type: "string" },
22
+ },
23
+ });
24
+ const claimId = positionals[0];
25
+ if (!claimId)
26
+ throw new UsageError("redeliver needs a claim id");
27
+ const network = resolveNetwork(values.network);
28
+ const kitUrl = oracleUrlFor({
29
+ kit: values.kit,
30
+ devVars: tryProjectConfig({ envFile: values["env-file"] }),
31
+ });
32
+ const session = await loadSession(network);
33
+ const path = `/v1/admin/claims/${encodeURIComponent(claimId)}/redeliver`;
34
+ confirm({
35
+ network,
36
+ signer: session.did,
37
+ action: "release a parked decision to the chain — the oracle signs MsgEvaluateClaim",
38
+ lines: [`oracle : ${kitUrl}`, `claim : ${claimId}`],
39
+ }, values.yes === true, { proceeding: "asking the oracle to deliver…" });
40
+ const { res, did } = await kitFetch(session, kitUrl, path, { body: "{}" });
41
+ console.log(`redeliver as ${did} → ${kitUrl}${path}`);
42
+ console.log(`${res.status} ${await res.text()}`);
43
+ return res.ok ? 0 : 1;
44
+ }
45
+ //# sourceMappingURL=redeliver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redeliver.js","sourceRoot":"","sources":["../../../src/cli/commands/redeliver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE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AAE,IAAI,EAAE,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACjD,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC"}
package/dist/cli/index.js CHANGED
@@ -100,6 +100,8 @@ async function main(argv) {
100
100
  return (await import("./commands/relink.js")).run(rest);
101
101
  case "reviewer-note":
102
102
  return (await import("./commands/reviewer-note.js")).run(rest);
103
+ case "redeliver":
104
+ return (await import("./commands/redeliver.js")).run(rest);
103
105
  case "erase":
104
106
  return (await import("./commands/erase.js")).run(rest);
105
107
  case "manifest":
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AAEH,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9C,2EAA2E;AAC3E,SAAS,UAAU,CAAC,KAAa,EAAE,IAAc,EAAE,KAAe;IAChE,MAAM,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,IAAI,UAAU,CAAC,GAAG,KAAK,wBAAwB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjG,IAAI,CAAC,KAAK,CAAC,Q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C;QAChE,CAAC;QAED,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM;YACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,CAAC;QAEX;YACE,MAAM,IAAI,UAAU,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC;AAED,IAAI,CAAC;IACH,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACb,IAAI,GAAG,YAAY,UAAU,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The CLI's usage text, and one command's slice of it for `decision-oracle <command> --help`.
3
3
  */
4
- export declare const USAGE = "usage: decision-oracle <command> [options]\n\nproject\n init <dir> [--name <project-name>] [--openhands] generate a new oracle project (never installs for you);\n --openhands makes it an OpenHands checker\n skills sync [--dir <path>] refresh the package's Claude skills (default .claude/skills)\n\nidentity\n derive (\"<mnemonic>\" | --new) [--write <file> [--as <VAR>]]\n the ORACLE_* lines for .dev.vars, from a chain mnemonic;\n --write appends the key to that file (0600) instead of\n printing it, under --as (default ORACLE_SECP_MNEMONIC)\n login sign in to ixo AuthHub \u2014 once per network\n login --session-file <json> [--yes] no browser: save a session obtained elsewhere (a service or\n test account); --yes replaces an existing one\n logout forget that network's saved session ({ removed, path })\n delegation --audience <did> --out <file> mint an owner\u2192oracle claim-bot delegation CAR\n (--for engine mints the billing one instead)\n\nchain (needs a login; nothing is signed without --yes)\n oracle init --protocol <did> --kit-url <url> [--logo <url|file>] [--openhands]\n provision this oracle (13 steps): fund its wallet,\n its IID + Ed25519 key, its Matrix account, its\n entity + profile + domain card + agent card\n publish-protocol --rubric <file> --form <file> publish a protocol entity + its #vct and #rub\n [--name <text> [--description <text>]] \u2026 and its #pro profile, so apps show its name\n publish-protocol --phase rub --protocol <did> --rubric <file> --form <file>\n anchor/replace #rub alone on a protocol that\n already has its form\n create-deed --protocol <did> --title <name> create a deed linked to that protocol\n create-collection --entity <deed> --protocol <did> --eval-amount <uixo>\n create/fund/grant a claim collection\n submit-claim --collection <id> --answers <file> submit a test claim as the logged-in wallet\n org create --name <name> [--logo <url>] create an organisation (a dao entity) your login\n controls \u2014 or print the one it owns by that name\n org balance --entity <did> an organisation's admin account and its balances\n org fund --entity <did> --amount <n> [--coin ixo|usdc]\n send coins from your wallet to that admin account\n\nthis oracle\n register --collection <id> enrol a collection with this oracle, as its owner\n scan --collection <id> make this oracle scan an enrolled collection now\n relink [--collection <id>]\u2026 operator: link watched collections to their company's\n Decision API sources, as register does (ORACLE_ADMIN_DIDS)\n reviewer-note <claimId> operator: (re)make a held claim's reviewer note (ORACLE_ADMIN_DIDS)\n erase (<claimId>\u2026 | --collection <id>) [--yes]\n as the collection's owner, erase claims' transcripts and\n registry text (the oracle never deletes them on its own)\n manifest <protocol did> the engine's work order for a protocol's rubric\n engine register [--env <name>] [--env-file <path>] [--yes]\n register this oracle with the engine now (payable at the\n Standard plan at once), not lazily at the first decide\n\nthe Decision API (API_LANE on; signed as your login, --kit <url> or .dev.vars' host)\n api source create --name <n> --contact <email> --entity <did>\n add this oracle to your organisation \u2014 its\n webhook secret shown ONCE; pending-link\n api source link <sourceId> sign the organisation's link at the engine and\n sync it: pending-link \u2192 active\n api sources the sources your login belongs to\n api key create --source <id> --scopes <s,\u2026> [--name <n>] [--max-spend-cents <n>]\n mint an API key \u2014 shown ONCE\n api keys --source <id> a source's keys, masked\n api key revoke --source <id> <prefix|masked key> [--grace-days <n>]\n api admin sources every source (your DID in ORACLE_ADMIN_DIDS)\n api admin pause <sourceId> [--note <text>]\n api admin resume <sourceId>\n api admin protocols <sourceId> <did,\u2026>|--none replace a source's allowed protocols\n api admin billing-mode <sourceId> x402|none\n (a source link, a key revoke and every admin change is a dry run without --yes; --json prints the raw answer;\n api --help for the flags)\n\nyour handlers\n protocol review <protocol did> what a protocol's rubric asks your oracle to produce\n facts scaffold <protocol did> [--all] a stub handler + a test per name needing one\n facts run --protocol <did> --claim <file> [--preview] [--no-ai]\n run your handlers against a claim file (its answers, or\n { answers, attachments }) \u2014 no chain, no credits; a rubric's\n dup lane needs D1, so here it stands in as \"review\"\n\nrubric authoring\n rubric fetch-form --protocol <did> --out <file> download a protocol's live claim form (#vct)\n rubric validate --rubric <file> --form <file> check a rubric with the engine's own binder\n\nevery network-facing command takes --network devnet|testnet|mainnet (default devnet); every\nengine-facing one takes --engine-url <url>.\n";
4
+ export declare const USAGE = "usage: decision-oracle <command> [options]\n\nproject\n init <dir> [--name <project-name>] [--openhands] generate a new oracle project (never installs for you);\n --openhands makes it an OpenHands checker\n skills sync [--dir <path>] refresh the package's Claude skills (default .claude/skills)\n\nidentity\n derive (\"<mnemonic>\" | --new) [--write <file> [--as <VAR>]]\n the ORACLE_* lines for .dev.vars, from a chain mnemonic;\n --write appends the key to that file (0600) instead of\n printing it, under --as (default ORACLE_SECP_MNEMONIC)\n login sign in to ixo AuthHub \u2014 once per network\n login --session-file <json> [--yes] no browser: save a session obtained elsewhere (a service or\n test account); --yes replaces an existing one\n logout forget that network's saved session ({ removed, path })\n delegation --audience <did> --out <file> mint an owner\u2192oracle claim-bot delegation CAR\n (--for engine mints the billing one instead)\n\nchain (needs a login; nothing is signed without --yes)\n oracle init --protocol <did> --kit-url <url> [--logo <url|file>] [--openhands]\n provision this oracle (13 steps): fund its wallet,\n its IID + Ed25519 key, its Matrix account, its\n entity + profile + domain card + agent card\n publish-protocol --rubric <file> --form <file> publish a protocol entity + its #vct and #rub\n [--name <text> [--description <text>]] \u2026 and its #pro profile, so apps show its name\n publish-protocol --phase rub --protocol <did> --rubric <file> --form <file>\n anchor/replace #rub alone on a protocol that\n already has its form\n create-deed --protocol <did> --title <name> create a deed linked to that protocol\n create-collection --entity <deed> --protocol <did> --eval-amount <uixo>\n create/fund/grant a claim collection\n submit-claim --collection <id> --answers <file> submit a test claim as the logged-in wallet\n org create --name <name> [--logo <url>] create an organisation (a dao entity) your login\n controls \u2014 or print the one it owns by that name\n org balance --entity <did> an organisation's admin account and its balances\n org fund --entity <did> --amount <n> [--coin ixo|usdc]\n send coins from your wallet to that admin account\n\nthis oracle\n register --collection <id> enrol a collection with this oracle, as its owner\n scan --collection <id> make this oracle scan an enrolled collection now\n relink [--collection <id>]\u2026 operator: link watched collections to their company's\n Decision API sources, as register does (ORACLE_ADMIN_DIDS)\n reviewer-note <claimId> operator: (re)make a held claim's reviewer note (ORACLE_ADMIN_DIDS)\n redeliver <claimId> [--yes] operator: rebuild the facts of a decided claim parked without\n them and sign its evaluation on chain (ORACLE_ADMIN_DIDS)\n erase (<claimId>\u2026 | --collection <id>) [--yes]\n as the collection's owner, erase claims' transcripts and\n registry text (the oracle never deletes them on its own)\n manifest <protocol did> the engine's work order for a protocol's rubric\n engine register [--env <name>] [--env-file <path>] [--yes]\n register this oracle with the engine now (payable at the\n Standard plan at once), not lazily at the first decide\n\nthe Decision API (API_LANE on; signed as your login, --kit <url> or .dev.vars' host)\n api source create --name <n> --contact <email> --entity <did>\n add this oracle to your organisation \u2014 its\n webhook secret shown ONCE; pending-link\n api source link <sourceId> sign the organisation's link at the engine and\n sync it: pending-link \u2192 active\n api sources the sources your login belongs to\n api key create --source <id> --scopes <s,\u2026> [--name <n>] [--max-spend-cents <n>]\n mint an API key \u2014 shown ONCE\n api keys --source <id> a source's keys, masked\n api key revoke --source <id> <prefix|masked key> [--grace-days <n>]\n api admin sources every source (your DID in ORACLE_ADMIN_DIDS)\n api admin pause <sourceId> [--note <text>]\n api admin resume <sourceId>\n api admin protocols <sourceId> <did,\u2026>|--none replace a source's allowed protocols\n api admin billing-mode <sourceId> x402|none\n (a source link, a key revoke and every admin change is a dry run without --yes; --json prints the raw answer;\n api --help for the flags)\n\nyour handlers\n protocol review <protocol did> what a protocol's rubric asks your oracle to produce\n facts scaffold <protocol did> [--all] a stub handler + a test per name needing one\n facts run --protocol <did> --claim <file> [--preview] [--no-ai]\n run your handlers against a claim file (its answers, or\n { answers, attachments }) \u2014 no chain, no credits; a rubric's\n dup lane needs D1, so here it stands in as \"review\"\n\nrubric authoring\n rubric fetch-form --protocol <did> --out <file> download a protocol's live claim form (#vct)\n rubric validate --rubric <file> --form <file> check a rubric with the engine's own binder\n\nevery network-facing command takes --network devnet|testnet|mainnet (default devnet); every\nengine-facing one takes --engine-url <url>.\n";
5
5
  /**
6
6
  * The usage lines for one command — every entry whose text starts with it (`engine` → `engine
7
7
  * register …`), each with its continuation lines — or null when none does. An entry is a line
@@ -1 +1 @@
1
- {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/usage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,KAAK,4tMAsFjB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgBvD"}
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/usage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,KAAK,o6MAwFjB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgBvD"}
@@ -46,6 +46,8 @@ this oracle
46
46
  relink [--collection <id>]… operator: link watched collections to their company's
47
47
  Decision API sources, as register does (ORACLE_ADMIN_DIDS)
48
48
  reviewer-note <claimId> operator: (re)make a held claim's reviewer note (ORACLE_ADMIN_DIDS)
49
+ redeliver <claimId> [--yes] operator: rebuild the facts of a decided claim parked without
50
+ them and sign its evaluation on chain (ORACLE_ADMIN_DIDS)
49
51
  erase (<claimId>… | --collection <id>) [--yes]
50
52
  as the collection's owner, erase claims' transcripts and
51
53
  registry text (the oracle never deletes them on its own)
@@ -1 +1 @@
1
- {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/cli/lib/usage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe;IACtC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACf,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,GAAG,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;YAC5D,IAAI,MAAM;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CA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AAC;YACN,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,0BAA0B,OAAO,SAAS,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5F,CAAC"}
@@ -13,7 +13,7 @@ import type { AppEnv } from "../context.js";
13
13
  /** Until the strict step: an invocation still minting `{ can: "*" }` keeps working. */
14
14
  export declare const ACCEPT_WILDCARD = true;
15
15
  /** [method, path pattern (`:param` = one segment), the one action it accepts]. */
16
- export declare const ROUTE_ACTIONS: readonly [readonly ["POST", "/v1/collections/register", "collections/register"], readonly ["GET", "/v1/collections", "collections/read"], readonly ["POST", "/v1/collections/:collectionId/pause", "collections/pause"], readonly ["POST", "/v1/collections/:collectionId/resume", "collections/resume"], readonly ["POST", "/v1/collections/:collectionId/scan", "collections/scan"], readonly ["PATCH", "/v1/collections/:collectionId/settings", "collections/settings"], readonly ["GET", "/v1/collections/:collectionId/settings", "collections/settings-read"], readonly ["POST", "/v1/collections/:collectionId/reviewers", "collections/reviewers-grant"], readonly ["GET", "/v1/collections/:collectionId/reviewers", "collections/reviewers-read"], readonly ["POST", "/v1/collections/:collectionId/reviewers/:delegationCid/revoke", "collections/reviewers-revoke"], readonly ["GET", "/v1/claims", "claims/read"], readonly ["GET", "/v1/claims/:claimId", "claims/read"], readonly ["DELETE", "/v1/claims/:claimId/body", "claims/erase"], readonly ["GET", "/v1/reviews/:claimId", "reviews/read"], readonly ["POST", "/v1/reviews/:claimId", "reviews/submit"], readonly ["GET", "/v1/admin/status", "admin/status"], readonly ["POST", "/v1/admin/collections/relink", "admin/collections-relink"], readonly ["POST", "/v1/admin/claims/:claimId/reviewer-note", "admin/reviewer-note"], readonly ["GET", "/v1/oauth/approvals/:approvalId", "oauth/approval/read"], readonly ["POST", "/v1/oauth/approvals/:approvalId", "oauth/approval/approve"], readonly ["GET", "/v1/oauth/standing/:grantId", "oauth/standing/read"], readonly ["PUT", "/v1/oauth/standing/:grantId", "oauth/standing/set"], readonly ["DELETE", "/v1/oauth/standing/:grantId", "oauth/standing/revoke"]];
16
+ export declare const ROUTE_ACTIONS: readonly [readonly ["POST", "/v1/collections/register", "collections/register"], readonly ["GET", "/v1/collections", "collections/read"], readonly ["POST", "/v1/collections/:collectionId/pause", "collections/pause"], readonly ["POST", "/v1/collections/:collectionId/resume", "collections/resume"], readonly ["POST", "/v1/collections/:collectionId/scan", "collections/scan"], readonly ["PATCH", "/v1/collections/:collectionId/settings", "collections/settings"], readonly ["GET", "/v1/collections/:collectionId/settings", "collections/settings-read"], readonly ["POST", "/v1/collections/:collectionId/reviewers", "collections/reviewers-grant"], readonly ["GET", "/v1/collections/:collectionId/reviewers", "collections/reviewers-read"], readonly ["POST", "/v1/collections/:collectionId/reviewers/:delegationCid/revoke", "collections/reviewers-revoke"], readonly ["GET", "/v1/claims", "claims/read"], readonly ["GET", "/v1/claims/:claimId", "claims/read"], readonly ["DELETE", "/v1/claims/:claimId/body", "claims/erase"], readonly ["GET", "/v1/reviews/:claimId", "reviews/read"], readonly ["POST", "/v1/reviews/:claimId", "reviews/submit"], readonly ["GET", "/v1/admin/status", "admin/status"], readonly ["POST", "/v1/admin/collections/relink", "admin/collections-relink"], readonly ["POST", "/v1/admin/claims/:claimId/reviewer-note", "admin/reviewer-note"], readonly ["POST", "/v1/admin/claims/:claimId/redeliver", "admin/redeliver"], readonly ["GET", "/v1/oauth/approvals/:approvalId", "oauth/approval/read"], readonly ["POST", "/v1/oauth/approvals/:approvalId", "oauth/approval/approve"], readonly ["GET", "/v1/oauth/standing/:grantId", "oauth/standing/read"], readonly ["PUT", "/v1/oauth/standing/:grantId", "oauth/standing/set"], readonly ["DELETE", "/v1/oauth/standing/:grantId", "oauth/standing/revoke"]];
17
17
  export type OracleAction = (typeof ROUTE_ACTIONS)[number][2];
18
18
  /** Actions the legacy `*` NEVER stands in for, whatever `ACCEPT_WILDCARD` says (S3 review §3). */
19
19
  export declare const STRICT_ACTIONS: ReadonlySet<OracleAction>;
@@ -1 +1 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/middleware/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,uFAAuF;AACvF,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,kFAAkF;AAClF,eAAO,MAAM,aAAa,sBACvB,MAAM,EAAE,0BAA0B,EAAE,sBAAsB,aAC1D,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,aAC5C,MAAM,EAAE,qCAAqC,EAAE,mBAAmB,aAClE,MAAM,EAAE,sCAAsC,EAAE,oBAAoB,aACpE,MAAM,EAAE,oCAAoC,EAAE,kBAAkB,aAEhE,OAAO,EAAE,wCAAwC,EAAE,sBAAsB,aACzE,KAAK,EAAE,wCAAwC,EAAE,2BAA2B,aAE5E,MAAM,EAAE,yCAAyC,EAAE,6BAA6B,aAChF,KAAK,EAAE,yCAAyC,EAAE,4BAA4B,aAE7E,MAAM,EACN,+DAA+D,EAC/D,8BAA8B,aAE/B,KAAK,EAAE,YAAY,EAAE,aAAa,aAClC,KAAK,EAAE,qBAAqB,EAAE,aAAa,aAE3C,QAAQ,EAAE,0BAA0B,EAAE,cAAc,aACpD,KAAK,EAAE,sBAAsB,EAAE,cAAc,aAC7C,MAAM,EAAE,sBAAsB,EAAE,gBAAgB,aAChD,KAAK,EAAE,kBAAkB,EAAE,cAAc,aAEzC,MAAM,EAAE,8BAA8B,EAAE,0BAA0B,aAElE,MAAM,EAAE,yCAAyC,EAAE,qBAAqB,aAExE,KAAK,EAAE,iCAAiC,EAAE,qBAAqB,aAC/D,MAAM,EAAE,iCAAiC,EAAE,wBAAwB,aAEnE,KAAK,EAAE,6BAA6B,EAAE,qBAAqB,aAC3D,KAAK,EAAE,6BAA6B,EAAE,oBAAoB,aAC1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AE,qBAAqB,EAAE,aAAa,aAE3C,QAAQ,EAAE,0BAA0B,EAAE,cAAc,aACpD,KAAK,EAAE,sBAAsB,EAAE,cAAc,aAC7C,MAAM,EAAE,sBAAsB,EAAE,gBAAgB,aAChD,KAAK,EAAE,kBAAkB,EAAE,cAAc,aAEzC,MAAM,EAAE,8BAA8B,EAAE,0BAA0B,aAElE,MAAM,EAAE,yCAAyC,EAAE,qBAAqB,aAExE,MAAM,EAAE,qCAAqC,EAAE,iBAAiB,aAEhE,KAAK,EAAE,iCAAiC,EAAE,qBAAqB,aAC/D,MAAM,EAAE,iCAAiC,EAAE,wBAAwB,aAEnE,KAAK,EAAE,6BAA6B,EAAE,qBAAqB,aAC3D,KAAK,EAAE,6BAA6B,EAAE,oBAAoB,aAC1D,QAAQ,EAAE,6BAA6B,EAAE,uBAAuB,EACzD,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7D,kGAAkG;AAClG,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,YAAY,CAoBnD,CAAC;AAEH,uGAAuG;AACvG,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAK1C,CAAC;AAUF;sFACsF;AACtF,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,CAIlD;AAED;;gCAEgC;AAChC,eAAO,MAAM,aAAa,gEAuBxB,CAAC"}
@@ -42,6 +42,8 @@ export const ROUTE_ACTIONS = [
42
42
  ["POST", "/v1/admin/collections/relink", "admin/collections-relink"],
43
43
  // The operator's reviewer-note (re)make for a held claim (lib/review/reviewer-note.ts) — strict.
44
44
  ["POST", "/v1/admin/claims/:claimId/reviewer-note", "admin/reviewer-note"],
45
+ // The operator's release of a decided claim parked without facts (routes/v1/admin.ts) — strict.
46
+ ["POST", "/v1/admin/claims/:claimId/redeliver", "admin/redeliver"],
45
47
  // AuthHub's approvals back-channel (MCP over OAuth, S7) — strict from day one, below.
46
48
  ["GET", "/v1/oauth/approvals/:approvalId", "oauth/approval/read"],
47
49
  ["POST", "/v1/oauth/approvals/:approvalId", "oauth/approval/approve"],
@@ -64,6 +66,8 @@ export const STRICT_ACTIONS = new Set([
64
66
  "admin/collections-relink",
65
67
  // It spends a model call and re-reads a claim body: only a token minted for it.
66
68
  "admin/reviewer-note",
69
+ // It signs a chain tx: only a token minted for it.
70
+ "admin/redeliver",
67
71
  "oauth/approval/read",
68
72
  "oauth/approval/approve",
69
73
  "oauth/standing/read",
@@ -1 +1 @@
1
- {"version":3,"file":"capability.js","sourceRoot":"","sources":["../../src/middleware/capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,uFAAuF;AACvF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,CAAC,MAAM,EAAE,0BAA0B,EAAE,sBAAsB,CAAC;IAC5D,CAAC,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;IAC9C,CAAC,MAAM,EAAE,qCAAqC,EAAE,mBAAmB,CAAC;IACpE,CAAC,MAAM,EAAE,sCAAsC,EAAE,oBAAoB,CAAC;IACtE,CAAC,MAAM,EAAE,oCAAoC,EAAE,kBAAkB,CAAC;IAClE,4EAA4E;IAC5E,CAAC,OAAO,EAAE,wCAAwC,EAAE,sBAAsB,CAAC;IAC3E,CAAC,KAAK,EAAE,wCAAwC,EAAE,2BAA2B,CAAC;IAC9E,+EAA+E;IAC/E,CAAC,MAAM,EAAE,yCAAyC,EAAE,6BAA6B,CAAC;IAClF,CAAC,KA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C,CAAC,GAAG,CAAC,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACnD,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;YACzF,kEAAkE;YAClE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,QAAQ,CAAC,SAAS,CACtB,uBAAuB,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,yBAAyB,SAAS,CAAC,GAAG,IAAI,CAC5F,CAAC;IACJ,CAAC;IACD,IAAI,SAAS,CAAC,GAAG,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QACnC,MAAM,QAAQ,CAAC,SAAS,CACtB,gCAAgC,KAAK,CAAC,MAAM,yCAAyC,SAAS,CAAC,GAAG,IAAI,CACvG,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC,CAAC,CAAC"}
@@ -11,6 +11,9 @@
11
11
  * `POST /v1/admin/collections/relink` — the operator's backfill of register's company links
12
12
  * (`lib/register.ts` `relinkCollections`): collections watched before register linked them to their
13
13
  * company's Decision API sources get the same links now. `ORACLE_ADMIN_DIDS` only — it writes.
14
+ *
15
+ * `POST /v1/admin/claims/:claimId/redeliver` — the operator's release of a decided claim parked
16
+ * without facts (below). `ORACLE_ADMIN_DIDS` only — it signs.
14
17
  */
15
18
  import { Hono } from "hono";
16
19
  import type { AppEnv } from "../../context.js";
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/admin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAa5C,eAAO,MAAM,KAAK,qDAAqB,CAAC"}
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/admin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAiB5C,eAAO,MAAM,KAAK,qDAAqB,CAAC"}
@@ -11,14 +11,22 @@
11
11
  * `POST /v1/admin/collections/relink` — the operator's backfill of register's company links
12
12
  * (`lib/register.ts` `relinkCollections`): collections watched before register linked them to their
13
13
  * company's Decision API sources get the same links now. `ORACLE_ADMIN_DIDS` only — it writes.
14
+ *
15
+ * `POST /v1/admin/claims/:claimId/redeliver` — the operator's release of a decided claim parked
16
+ * without facts (below). `ORACLE_ADMIN_DIDS` only — it signs.
14
17
  */
18
+ import { and, eq, isNull } from "drizzle-orm";
15
19
  import { Hono } from "hono";
16
20
  import { z } from "zod";
17
21
  import { CollectionId } from "../../contracts/index.js";
18
22
  import { readApiBacklog, readChainBacklog } from "../../cron/backlog.js";
23
+ import { decisions } from "../../db/schema.js";
19
24
  import { createEngineClient } from "../../lib/engine/client.js";
20
25
  import { AppError } from "../../lib/errors.js";
26
+ import { buildFacts, factDeps } from "../../lib/facts/builder.js";
27
+ import { factsDigest } from "../../lib/facts/factset.js";
21
28
  import { depsFromEnv } from "../../lib/ixo/index.js";
29
+ import { deliverChainEvaluation } from "../../lib/ixo/chain-write.js";
22
30
  import { readiness } from "../../lib/readiness.js";
23
31
  import { RELINK_CAP, relinkCollections } from "../../lib/register.js";
24
32
  import { writeReviewerNote } from "../../lib/review/reviewer-note.js";
@@ -157,4 +165,98 @@ admin.post("/claims/:claimId/reviewer-note", validate("param", ClaimParam), asyn
157
165
  });
158
166
  return c.json({ claimId, written: note !== null }, note ? 200 : 503);
159
167
  });
168
+ /**
169
+ * Release a decided claim whose chain delivery is stuck on missing facts: an approve/reject the
170
+ * engine decided and receipted, parked `blocked` because the evaluate step's recovery path
171
+ * (claim-ingest.ts `recordRecovered`) could not freeze the facts the act policy reads. Nothing
172
+ * retries those rows by itself — a workflow rerun finds the decision and returns it untouched.
173
+ * Operators only (ORACLE_ADMIN_DIDS); it signs a chain tx.
174
+ *
175
+ * One request, like the reviewer note: the pull and the build are what one evaluate attempt runs
176
+ * (the fact cache keeps a crashed attempt's paid answers), and a fresh ClaimIngest could not do it
177
+ * — its instance id is the claim's, and its evaluate step returns the recorded row as it is. The
178
+ * rebuilt facts are the act policy's inputs ONLY: never sent to the engine, whose decision and
179
+ * receipt stay exactly as recorded. A build for another rubric than the decision's is refused
180
+ * (those are not the facts it was decided on); a digest that differs from the engine's — an AI
181
+ * fact that answered differently this time — is stored and said (`factsDigestMatches`), the
182
+ * operator's call. A deterministic facts-lane failure is a 409 with no write; transient trouble
183
+ * throws and the operator runs it again. A row that already has facts goes straight to the
184
+ * idempotent delivery.
185
+ */
186
+ admin.post("/claims/:claimId/redeliver", validate("param", ClaimParam), async (c) => {
187
+ const config = c.get("config");
188
+ if (!config.ORACLE_ADMIN_DIDS.includes(c.get("principal").did)) {
189
+ throw AppError.forbidden("Operators only (ORACLE_ADMIN_DIDS)");
190
+ }
191
+ const { claimId } = c.req.valid("param");
192
+ const db = await c.var.db();
193
+ const [decision, ingest] = await Promise.all([
194
+ db.query.decisions.findFirst({ where: (t, { eq }) => eq(t.claimId, claimId) }),
195
+ db.query.claimIngests.findFirst({ where: (t, { eq }) => eq(t.claimId, claimId) }),
196
+ ]);
197
+ if (!decision)
198
+ throw AppError.notFound(`No decision for claim ${claimId}`);
199
+ const evaluationStatus = decision.decision?.evaluationStatus;
200
+ if (decision.status !== "decided" ||
201
+ (evaluationStatus !== 1 && evaluationStatus !== 2) ||
202
+ !decision.receiptCid ||
203
+ (decision.chainStatus !== "pending" && decision.chainStatus !== "blocked")) {
204
+ throw AppError.conflict(`Claim ${claimId} is not a receipted approve/reject waiting for the chain (${decision.status} / ${decision.verdict ?? "none"} / ${decision.chainStatus})`);
205
+ }
206
+ const deps = depsFromEnv(c.env, { claimId });
207
+ let factsDigestMatches = null;
208
+ if (!decision.facts) {
209
+ const source = sourceFor(ingest?.lane ?? "chain", c.env, deps);
210
+ const engine = createEngineClient({
211
+ config,
212
+ logger: deps.logger,
213
+ trace: deps.trace,
214
+ cache: c.env.CACHE_KV,
215
+ });
216
+ // Nothing is sent, so the content is dropped with the pull (as in `recordRecovered`).
217
+ const { content: _content, ...claim } = await source.pull(claimId);
218
+ const built = await buildFacts(factDeps(deps, claim.media, engine, db, c.env, source), {
219
+ claim,
220
+ protocolDid: await source.protocolDid(decision.collectionId),
221
+ });
222
+ if (!built.ok) {
223
+ throw AppError.conflict(`Facts could not be rebuilt for ${claimId}: ${built.reason}`, {
224
+ reason: built.reason,
225
+ issues: built.issues,
226
+ });
227
+ }
228
+ if (decision.rubricId && built.rubricId !== decision.rubricId) {
229
+ throw AppError.conflict(`Claim ${claimId} was decided on rubric ${decision.rubricId}; the protocol now pins ${built.rubricId}`);
230
+ }
231
+ factsDigestMatches = (await factsDigest(built.facts)) === decision.factsDigest;
232
+ // One statement, and only onto a row still without facts. The park WAS the missing facts, so
233
+ // it is lifted with them; the delivery below writes whatever comes next.
234
+ await db
235
+ .update(decisions)
236
+ .set({
237
+ facts: { ext: built.facts.ext, ai: built.facts.ai },
238
+ chainStatus: "pending",
239
+ chainError: null,
240
+ })
241
+ .where(and(eq(decisions.claimId, claimId), isNull(decisions.facts)));
242
+ deps.logger.info("admin.redeliver.facts-stored", { claimId, factsDigestMatches });
243
+ }
244
+ const outcome = await deliverChainEvaluation({
245
+ config,
246
+ logger: deps.logger,
247
+ metrics: deps.metrics,
248
+ trace: deps.trace,
249
+ db,
250
+ sequenceManager: c.env.SEQUENCE_MANAGER,
251
+ cache: c.env.CACHE_KV,
252
+ email: c.env.EMAIL,
253
+ // What the act policy is handed (lib/ixo/chain-write.ts `ChainWriteDeps`).
254
+ env: c.env,
255
+ }, claimId);
256
+ const after = await db.query.decisions.findFirst({
257
+ where: (t, { eq }) => eq(t.claimId, claimId),
258
+ columns: { chainStatus: true, chainError: true, txHash: true },
259
+ });
260
+ return c.json({ claimId, outcome, factsDigestMatches, ...after });
261
+ });
160
262
  //# sourceMappingURL=admin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../../src/routes/v1/admin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAU,CAAC;AAExC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,IAAI,CAA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yone, 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 |
1790
1790
  | `POST /v1/admin/collections/relink` | UCAN `admin/collections-relink` (strict: never `*`) + `ORACLE_ADMIN_DIDS` (`403` otherwise) | The operator's backfill of register's company links. Body `{ collectionIds?: string[] }` (1–100 ids); absent ⇒ every watched collection, lowest id first, up to 100 (`truncated: true` says more exist — name them). Per collection, the same engine read and the same link register makes (no `active` source left unlinked ⇒ `unchanged`, no engine call) → `{ items: [{ collectionId, outcome: "linked" \| "unchanged" \| "no-company" \| "disputed" \| "unavailable" \| "not-watched", linkedSources }], truncated }`. Idempotent. CLI: `decision-oracle relink [--collection <id>]…`. Outside the `/v1/api` contract |
1791
1791
  | `POST /v1/admin/claims/:claimId/reviewer-note` | UCAN `admin/reviewer-note` (strict: never `*`) + `ORACLE_ADMIN_DIDS` (`403` otherwise) | (Re)makes the reviewer note for a claim held for a person — one decided before the oracle made notes, or one whose note failed. Re-pulls the body through the claim's own lane, spends one model call, stores the note. `200 { claimId, written: true }`, `503 { written: false }` when the model gave none, `404` no decision, `409` not `pending_review`. The note itself is read on `GET /v1/reviews/:claimId`. CLI: `decision-oracle reviewer-note <claimId>`. Outside the `/v1/api` contract |
1792
+ | `POST /v1/admin/claims/:claimId/redeliver` | UCAN `admin/redeliver` (strict: never `*`) + `ORACLE_ADMIN_DIDS` (`403` otherwise) | Releases a decided approve/reject with a receipt whose delivery is `pending`/`blocked` — made for the row the evaluate step's recovery parked without facts. With `facts` null it re-pulls the body through the claim's own lane, rebuilds the facts (`buildFacts`, the collection's protocol) and stores their `ext`/`ai` on the row with `chainStatus: pending` in one statement — the act policy's inputs only, never sent to the engine, whose decision and receipt stay as recorded — then runs the idempotent `deliverChainEvaluation`. `200 { claimId, outcome, factsDigestMatches, chainStatus, chainError, txHash }` (`factsDigestMatches` null when the row had facts already, `false` when the rebuild differs from the engine's `factsDigest`, e.g. an AI fact answering differently — stored anyway); `404` no decision; `409` not a receipted approve/reject waiting for the chain, a rubric-unusable / invalid-facts rebuild (`details.reason`, `details.issues`; nothing written), or a protocol now pinned to another rubric than the decision's; transient trouble is a `503` to run again. CLI: `decision-oracle redeliver <claimId> --yes`. Outside the `/v1/api` contract |
1792
1793
  | `GET /v1/oauth/approvals/:approvalId` | UCAN `oauth/approval/read`, invoker AuthHub's `did:web` only (`403` otherwise; `*` is never accepted here); no `X-Auth-Type` needed | What AuthHub's approve page shows: `{ did, grantId, clientName, protocol: { did, name \| null }, price: { display, maxAmountUpay }, billingMode: "x402" \| "none", status, expiresAt }` (`expiresAt` in unix seconds). `404` unless the approval exists, is `pending` and has not expired. Never the delegation. `404` without `API_LANE`. Outside the `/v1/api` contract |
1793
1794
  | `POST /v1/oauth/approvals/:approvalId` | UCAN `oauth/approval/approve`, same invoker rule | `{ decision: "approve", did, delegation: string \| null }` or `{ decision: "decline", did }` → `{ status: "approved" \| "declined" }`. `404` unless pending and `did` is the approval's. For billing `x402` the delegation must be a payment delegation (`parsePaymentDelegation`) whose root issuer is `did`, whose `oracles` name this oracle's did:web, whose audience is this oracle's facilitator (`X402_FACILITATOR_URL`'s did.json), whose `maxAmount` is exactly `maxAmountUpay` (a total across rails: more would be standing authority), and which has not expired — else `400 VALIDATION` with `details.reason` one of `invalid_delegation`, `issuer_mismatch`, `oracle_mismatch`, `facilitator_mismatch` (also logged `oauth.approval.facilitator_mismatch` with both DIDs: AuthHub and this oracle name different facilitators), `amount_mismatch`, `expired`, and the approval stays pending. `price.display` is informational; AuthHub computes what it shows from `maxAmountUpay`. For `none` nothing is kept. Approving gives the app 15 minutes to use it. Audited as `oauth.approval_approved` / `oauth.approval_declined` (actor kind `oauth`). Outside the `/v1/api` contract |
1794
1795
  | `GET /v1/oauth/standing/:grantId` | UCAN `oauth/standing/read`, AuthHub's `did:web` only, never `*` | A grant's auto-approve: `{ perClaimUpay, totalUpay, spentUpay, until }` (upay strings, unix seconds), never the delegation. `404` when there is none, it is revoked, `until` has passed, or `policies.allowStandingApprovals` is off |
package/docs/guide.md CHANGED
@@ -1563,7 +1563,7 @@ own retries, and a terminal failure clears it.
1563
1563
  | A wasm / bundle error on `deploy` or `dev` | Usually a stale `worker-configuration.d.ts`, or the package's wasm not copied after an install | `bun run cf-typegen`, then reinstall. `wrangler deploy --dry-run` (`bun run build`) reproduces a bundle failure without shipping |
1564
1564
  | `facts run` says a handler is `handler-unused` | The name in your table is not a name the manifest declares | Copy the name from `protocol review`, exactly |
1565
1565
  | `facts run --preview` says to start `bun run dev` | The engine resolves your `did:web` from `ORACLE_HOSTNAME` and found nothing there | Start the dev server (or point `ORACLE_HOSTNAME` at a reachable host) |
1566
- | A decision is `decided` but never lands on chain | `policies.autoSign` or `AUTO_SIGN` is off · `ORACLE_SECP_MNEMONIC` is unset · `chainStatus` is `blocked` (no grant, no receipt CID, or an unfunded admin account) · `chainStatus` is `held` (your own `policies.act` hook parked it on purpose) | Read `chainStatus` / `chainError` on `GET /v1/claims/:claimId`. An unfunded admin account resumes and re-delivers by itself once topped up; a `held` row waits for your own `signEvaluation(env, claimId, amount?)` call |
1566
+ | A decision is `decided` but never lands on chain | `policies.autoSign` or `AUTO_SIGN` is off · `ORACLE_SECP_MNEMONIC` is unset · `chainStatus` is `blocked` (no grant, no receipt CID, or an unfunded admin account) · `chainStatus` is `held` (your own `policies.act` hook parked it on purpose) | Read `chainStatus` / `chainError` on `GET /v1/claims/:claimId`. An unfunded admin account resumes and re-delivers by itself once topped up; a `held` row waits for your own `signEvaluation(env, claimId, amount?)` call; a `blocked` row whose `chainError` says its facts could not be rebuilt (a decision recovered after a crash) is released by `decision-oracle redeliver <claimId> --yes`, which rebuilds the facts your act policy reads and signs — the engine's decision and receipt stay as recorded |
1567
1567
 
1568
1568
  ---
1569
1569
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/decision-oracle",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
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": [