@ixo/decision-oracle 0.2.22 → 0.2.24
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 +1 -1
- package/dist/cron/openhands.d.ts +4 -2
- package/dist/cron/openhands.d.ts.map +1 -1
- package/dist/cron/openhands.js +21 -17
- package/dist/cron/openhands.js.map +1 -1
- package/dist/lib/claim-failure.d.ts +13 -0
- package/dist/lib/claim-failure.d.ts.map +1 -0
- package/dist/lib/claim-failure.js +21 -0
- package/dist/lib/claim-failure.js.map +1 -0
- package/dist/lib/ixo/blocksync/index.d.ts +17 -2
- package/dist/lib/ixo/blocksync/index.d.ts.map +1 -1
- package/dist/lib/ixo/blocksync/index.js +28 -2
- package/dist/lib/ixo/blocksync/index.js.map +1 -1
- package/dist/lib/ixo/blocksync/queries.d.ts +3 -1
- package/dist/lib/ixo/blocksync/queries.d.ts.map +1 -1
- package/dist/lib/ixo/blocksync/queries.js +28 -1
- package/dist/lib/ixo/blocksync/queries.js.map +1 -1
- package/dist/lib/ixo/blocksync/types.d.ts +11 -0
- package/dist/lib/ixo/blocksync/types.d.ts.map +1 -1
- package/dist/lib/ixo/blocksync/types.js +10 -0
- package/dist/lib/ixo/blocksync/types.js.map +1 -1
- package/dist/lib/openhands/backstop.d.ts +54 -28
- package/dist/lib/openhands/backstop.d.ts.map +1 -1
- package/dist/lib/openhands/backstop.js +147 -110
- package/dist/lib/openhands/backstop.js.map +1 -1
- package/dist/lib/openhands/chain.d.ts +2 -14
- package/dist/lib/openhands/chain.d.ts.map +1 -1
- package/dist/lib/openhands/chain.js +1 -34
- package/dist/lib/openhands/chain.js.map +1 -1
- package/dist/lib/openhands/store.d.ts +1 -0
- package/dist/lib/openhands/store.d.ts.map +1 -1
- package/dist/lib/openhands/store.js +1 -0
- package/dist/lib/openhands/store.js.map +1 -1
- package/dist/routes/v1/claims.d.ts +3 -2
- package/dist/routes/v1/claims.d.ts.map +1 -1
- package/dist/routes/v1/claims.js +11 -3
- package/dist/routes/v1/claims.js.map +1 -1
- package/dist/routes/v1/shared.d.ts.map +1 -1
- package/dist/routes/v1/shared.js +31 -4
- package/dist/routes/v1/shared.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +2 -0
- package/dist/runtime.js.map +1 -1
- package/docs/api.md +16 -9
- package/docs/guide.md +7 -2
- package/package.json +1 -1
- package/skills/add-openhands-support/SKILL.md +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/lib/openhands/store.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,6DAA6D;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AAEtC,yFAAyF;AACzF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAE,EAAE,CAAC,YAAY,YAAY,EAAE,CAAC;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAE,EAAE,CAAC,oBAAoB,YAAY,EAAE,CAAC;AAE9F;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAC/C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAE,EAAE,CAAC,GAAG,iBAAiB,GAAG,YAAY,EAAE,CAAC;AAC7F,qFAAqF;AACrF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CA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K,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;KAC/D,CAAC,CAAC;AACP,CAAC;AAED,oEAAoE;AACpE,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,EAAY,EACZ,GAAsB;IAEtB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAqB,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,MAAM,EAAE;aAClB,MAAM,CAAC;YACN,YAAY,EAAE,cAAc,CAAC,YAAY;YACzC,SAAS,EAAE,cAAc,CAAC,SAAS;YACnC,MAAM,EAAE,cAAc,CAAC,MAAM;SAC9B,CAAC;aACD,IAAI,CAAC,cAAc,CAAC;aACpB,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3E,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* (`decisions`), and any human answers (`claim_reviews`). UCAN-guarded like the rest of `/v1/*`;
|
|
4
4
|
* on top of that, READ access is the chain owner's or an evaluate-grant holder's (shared.ts
|
|
5
5
|
* `assertCanRead`), and one claim's record is also a live reviewer's of its collection (company
|
|
6
|
-
* authority D2: they answer from it) and its own submitter's (the claim's on-chain agent
|
|
7
|
-
* sees the decision and its public receipt, but
|
|
6
|
+
* authority D2: they answer from it) and its own submitter's (the claim's on-chain agent, or an
|
|
7
|
+
* account a live authz grant links to it) — who sees the decision and its public receipt, but
|
|
8
|
+
* never the review's answers.
|
|
8
9
|
* Responses are straight selects — the `decision` json IS the API shape (codes, scores,
|
|
9
10
|
* identifiers; the row never held answer values).
|
|
10
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/claims.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/claims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAgB5C,eAAO,MAAM,MAAM,qDAAqB,CAAC"}
|
package/dist/routes/v1/claims.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* (`decisions`), and any human answers (`claim_reviews`). UCAN-guarded like the rest of `/v1/*`;
|
|
4
4
|
* on top of that, READ access is the chain owner's or an evaluate-grant holder's (shared.ts
|
|
5
5
|
* `assertCanRead`), and one claim's record is also a live reviewer's of its collection (company
|
|
6
|
-
* authority D2: they answer from it) and its own submitter's (the claim's on-chain agent
|
|
7
|
-
* sees the decision and its public receipt, but
|
|
6
|
+
* authority D2: they answer from it) and its own submitter's (the claim's on-chain agent, or an
|
|
7
|
+
* account a live authz grant links to it) — who sees the decision and its public receipt, but
|
|
8
|
+
* never the review's answers.
|
|
8
9
|
* Responses are straight selects — the `decision` json IS the API shape (codes, scores,
|
|
9
10
|
* identifiers; the row never held answer values).
|
|
10
11
|
*
|
|
@@ -20,6 +21,7 @@ import { Hono } from "hono";
|
|
|
20
21
|
import { z } from "zod";
|
|
21
22
|
import { claimIngests, decisions } from "../../db/schema.js";
|
|
22
23
|
import { eraseChainClaim } from "../../lib/claim-erase.js";
|
|
24
|
+
import { claimFailureReason } from "../../lib/claim-failure.js";
|
|
23
25
|
import { decodeCursor, encodeCursor } from "../../lib/cursor.js";
|
|
24
26
|
import { AppError } from "../../lib/errors.js";
|
|
25
27
|
import { validate } from "../../lib/validator.js";
|
|
@@ -113,7 +115,13 @@ claims.get("/:claimId", validate("param", ClaimParam), async (c) => {
|
|
|
113
115
|
return c.json({
|
|
114
116
|
claimId,
|
|
115
117
|
collectionId: ingest.collectionId,
|
|
116
|
-
ingest
|
|
118
|
+
// A failed ingest still says why to the submitter — in a safe sentence, never the stored text.
|
|
119
|
+
ingest: asAgent
|
|
120
|
+
? {
|
|
121
|
+
...ingestView,
|
|
122
|
+
error: ingest.status === "failed" ? claimFailureReason(ingest.error) : null,
|
|
123
|
+
}
|
|
124
|
+
: ingestView,
|
|
117
125
|
decision: decisionView && asAgent
|
|
118
126
|
? { ...decisionView, chainError: null, erroredFacts: null }
|
|
119
127
|
: decisionView,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../../src/routes/v1/claims.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claims.js","sourceRoot":"","sources":["../../../src/routes/v1/claims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,C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,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IACtF,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3B,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/routes/v1/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EAEvB,MAAM,iBAAiB,CAAC;AAoBzB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CACjC,CAAC,EAAE,UAAU,EACb,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACnD,OAAO,CAAC,WAAW,GAAG;IAA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,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC;AAEnG,+DAA+D;AAC/D,wBAAgB,MAAM,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,iBAAiB,GAAG,cAAc,CAEzF;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc;mBAPuC,OAAO;;;;;;;;;;;;;;;;;;;;EAe/F;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW;IAEvC,MAAM;IACN,UAAU;IACV,KAAK;IACL,SAAS;IACT,SAAS;EAEZ;AAED,sGAAsG;AACtG;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO;;YAQ3C,IAAI;;;;;YAMJ,OAAO;;;YAM1B;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW;IAEzC,QAAQ;IACR,WAAW;IACX,OAAO;IACP,MAAM;IACN,YAAY;IACZ,UAAU;IACV,UAAU;IACV,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACR,WAAW;IACX,WAAW;IACX,MAAM;IACN,UAAU;IACV,gFAAgF;IAChF,YAAY;;;;IACZ,SAAS;IACT,SAAS;EAEZ;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW;IAEvC,OAAO;IACP,WAAW;IACX;;8DAE0D;IAC1D,MAAM;IACN,UAAU;IACV,QAAQ;IACR,8GAA8G;IAC9G,SAAS;EAEZ"}
|
package/dist/routes/v1/shared.js
CHANGED
|
@@ -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
|
-
|
|
140
|
-
|
|
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/routes/v1/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,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AAW,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";
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -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,UA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.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 ---------
|
package/dist/runtime.js.map
CHANGED
|
@@ -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,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G,+FAA+F;IAC/F,kEAAkE;IAClE,MAAM,MAAM,GAAG,UAAU,CAAC,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` |
|
|
@@ -448,11 +450,16 @@ id = the collection id):
|
|
|
448
450
|
re-registered (an operator's pause stands).
|
|
449
451
|
4. **scan** — the claims filed before the hire, started now.
|
|
450
452
|
|
|
451
|
-
A **
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
453
|
+
A **grants feed** runs every minute so a lost webhook never strands an ask: it reads the
|
|
454
|
+
meta-grants made to this oracle from Blocksync (`authzGrants`, oldest block first, from the height
|
|
455
|
+
it stopped at — one read when nothing is new) and hires each inviting admin's open, unwatched
|
|
456
|
+
collections, through `admit`. Its position (`openhands_state` row `grants`) moves only after a
|
|
457
|
+
page's hires started, so a failed hire is retried next minute; at most 5 pages of 100 grants a
|
|
458
|
+
minute. Its first run starts at height 0 — Blocksync keeps live grants only, so that is a one-off
|
|
459
|
+
sweep of the invitations that stand today — then follows the chain forward. A **backstop** runs
|
|
460
|
+
every five minutes: it re-mints a watched collection whose poster raised the ceiling or whose quota
|
|
461
|
+
fell below 50, and lifts an `engine-no-grant` pause once the chain shows quota again (at least
|
|
462
|
+
5 min after the last read — the engine's grant cache). Its window reads only the watched collections that can need it — never read, hired or claimed in the
|
|
456
463
|
last day, quota below a top-up, or not read for a week — so a quiet ask costs one read a week (a
|
|
457
464
|
raised ceiling on one arrives by the hire webhook, or within that week). Each
|
|
458
465
|
collection gets at most three hire reruns a day from the backstop and three from the webhook, on
|
|
@@ -1788,7 +1795,7 @@ check.**
|
|
|
1788
1795
|
| `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 |
|
|
1789
1796
|
| `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` |
|
|
1790
1797
|
| `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 |
|
|
1791
|
-
| `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 `
|
|
1798
|
+
| `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` |
|
|
1792
1799
|
| `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 |
|
|
1793
1800
|
| `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 |
|
|
1794
1801
|
| `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 |
|
|
@@ -1892,8 +1899,8 @@ collection entity's current chain owner (read off Blocksync, cached 5 min), or a
|
|
|
1892
1899
|
evaluate grant for it (cached 5 min) — the same permission surface as the portal's "Grant Role"
|
|
1893
1900
|
flow. The enroller passes only while it still holds a grant, and an owner who transferred the
|
|
1894
1901
|
entity reads nothing. A collection this oracle does not watch is a `404`. One claim's record also
|
|
1895
|
-
opens to that claim's submitter (its on-chain agent DID or agent address
|
|
1896
|
-
never the collection.
|
|
1902
|
+
opens to that claim's submitter (its on-chain agent DID or agent address, or an account a live
|
|
1903
|
+
authz grant links to that agent, either way round) — that claim only, never the collection.
|
|
1897
1904
|
|
|
1898
1905
|
There is deliberately **no claim-ingestion endpoint**: the chain is truth, so a pushed claimId adds
|
|
1899
1906
|
nothing worth trusting.
|
|
@@ -2410,7 +2417,7 @@ trigger is handled in its own `scheduled` before it delegates to the oracle's.
|
|
|
2410
2417
|
|
|
2411
2418
|
| Trigger | Tier | Jobs |
|
|
2412
2419
|
| --- | --- | --- |
|
|
2413
|
-
| `* * * * *` | minute | 1, 2, 4 (the resume) and 5 below; `claims-feed` (6) before the rotation `scan`; with `API_LANE` the lane's source resume, webhook deliveries and retries, review-batch emails and backlog gauges; with `openhands`, `openhands-scans` (the coalesced `/openhands/scan` calls and the scans that found nothing, three retries each, 50 a minute) |
|
|
2420
|
+
| `* * * * *` | minute | 1, 2, 4 (the resume) and 5 below; `claims-feed` (6) before the rotation `scan`; with `API_LANE` the lane's source resume, webhook deliveries and retries, review-batch emails and backlog gauges; with `openhands`, `openhands-scans` (the coalesced `/openhands/scan` calls and the scans that found nothing, three retries each, 50 a minute) and `openhands-grants-feed` (new meta-grants → hires) |
|
|
2414
2421
|
| `*/5 * * * *` | five | `ai-cost-backfill`; with a facilitator, `payments-reconcile` and `balance-watch`; with `openhands`, `openhands-backstop` ("The OpenHands add-on", §2) |
|
|
2415
2422
|
| `0 * * * *` | hour | `claims-replay` (6), 3 below; with `API_LANE` `retention` (housekeeping), `header-seal`, `review-billing-reminders`, `review-reminders`, `review-expiry`, `review-rooms`, `collection-links` |
|
|
2416
2423
|
|
package/docs/guide.md
CHANGED
|
@@ -1041,7 +1041,8 @@ Then you register nothing by hand. When a poster picks you, their posting transa
|
|
|
1041
1041
|
oracle the right to authorize itself on the new collection, and the app calls
|
|
1042
1042
|
`POST /openhands/hire/<collectionId>` on your host. The oracle checks that grant on chain, mints its
|
|
1043
1043
|
own evaluate grant under it, registers the collection through the same four gates above, and scans
|
|
1044
|
-
it. A
|
|
1044
|
+
it. A grants feed every minute catches a call that never arrived (it follows the meta-grants
|
|
1045
|
+
made to your oracle on Blocksync), and a backstop every five minutes keeps every hired ask
|
|
1045
1046
|
topped up. `GET /v1/info` lists the two webhooks under `openhands` — that is how the app knows
|
|
1046
1047
|
you are an OpenHands checker. (api.md §2, "The OpenHands add-on", has every step and answer.)
|
|
1047
1048
|
|
|
@@ -1184,7 +1185,11 @@ human review. Both are UCAN-guarded and gated to the collection's current chain
|
|
|
1184
1185
|
evaluate-grant holder — the registrant only while it still holds its grant — and the single-claim
|
|
1185
1186
|
read to the collection's live reviewers too, and to the claim's own submitter (its on-chain agent DID or
|
|
1186
1187
|
address, who sees the decision and its public receipt — which names who reviewed — but never the
|
|
1187
|
-
review's answers).
|
|
1188
|
+
review's answers). An agent key filing for a person is the claim's on-chain agent, so the submitter's
|
|
1189
|
+
read also opens to an account a live authz grant links to that agent, either way round — the person
|
|
1190
|
+
who granted it, or a key it granted. A failed ingest tells the submitter so in a safe sentence
|
|
1191
|
+
(`ingest.error`, never the stored text; `claimFailureReason` in `/runtime` gives your own "why"
|
|
1192
|
+
route the same words). `chainStatus` is `pending` / `submitted` / `owner_submitted` / `blocked` / `skipped`
|
|
1188
1193
|
(a decision nothing will ever sign: an engine `unusable`, or a `decided` review verdict with no review
|
|
1189
1194
|
held for a person), or
|
|
1190
1195
|
**`held`** when your own `policies.act` hook chose to keep a decided verdict back instead of signing
|
package/package.json
CHANGED
|
@@ -12,8 +12,9 @@ When a poster picks yours, their posting transaction grants your oracle a **meta
|
|
|
12
12
|
(the right to authorize itself on the new collection) and the app calls
|
|
13
13
|
`POST https://<your host>/openhands/hire/<collectionId>`. The package's **OpenHands add-on**
|
|
14
14
|
answers that call: it checks the grant on chain, mints the oracle's own evaluate grant under it,
|
|
15
|
-
registers the collection through the normal four gates and scans it —
|
|
16
|
-
|
|
15
|
+
registers the collection through the normal four gates and scans it — a grants feed every minute
|
|
16
|
+
catches a call that never arrived, and a backstop every five minutes keeps every hired ask
|
|
17
|
+
topped up. The engine still
|
|
17
18
|
decides; nothing here judges.
|
|
18
19
|
|
|
19
20
|
A checker judges asks on ITS OWN protocol: the poster's ask uses your protocol as it is — your
|