@taifoon/jev 0.1.0

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 (56) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +222 -0
  3. package/bin/jev.mjs +37 -0
  4. package/dist/abi.d.ts +11 -0
  5. package/dist/abi.js +81 -0
  6. package/dist/ask.d.ts +27 -0
  7. package/dist/ask.js +47 -0
  8. package/dist/contracts.d.ts +37 -0
  9. package/dist/contracts.js +27 -0
  10. package/dist/evaluator/assurance-hook.d.ts +6 -0
  11. package/dist/evaluator/assurance-hook.js +15 -0
  12. package/dist/evaluator/bitagent-erc8183.d.ts +7 -0
  13. package/dist/evaluator/bitagent-erc8183.js +18 -0
  14. package/dist/evaluator/index.d.ts +12 -0
  15. package/dist/evaluator/index.js +20 -0
  16. package/dist/evaluator/judge-adapter.d.ts +5 -0
  17. package/dist/evaluator/judge-adapter.js +16 -0
  18. package/dist/evaluator/types.d.ts +27 -0
  19. package/dist/evaluator/types.js +6 -0
  20. package/dist/evaluator/virtuals-erc8183.d.ts +6 -0
  21. package/dist/evaluator/virtuals-erc8183.js +15 -0
  22. package/dist/evaluator/virtuals-memo-acp.d.ts +5 -0
  23. package/dist/evaluator/virtuals-memo-acp.js +15 -0
  24. package/dist/facts.d.ts +16 -0
  25. package/dist/facts.js +15 -0
  26. package/dist/grade.d.ts +32 -0
  27. package/dist/grade.js +33 -0
  28. package/dist/hash.d.ts +10 -0
  29. package/dist/hash.js +132 -0
  30. package/dist/index.d.ts +29 -0
  31. package/dist/index.js +20 -0
  32. package/dist/receipt.d.ts +68 -0
  33. package/dist/receipt.js +42 -0
  34. package/dist/record.d.ts +32 -0
  35. package/dist/record.js +41 -0
  36. package/dist/records.d.ts +78 -0
  37. package/dist/records.js +55 -0
  38. package/dist/rubric.d.ts +109 -0
  39. package/dist/rubric.js +91 -0
  40. package/dist/verify.d.ts +40 -0
  41. package/dist/verify.js +80 -0
  42. package/package.json +73 -0
  43. package/workflows/0.1.0/README.md +104 -0
  44. package/workflows/0.1.0/batch-judge.json +341 -0
  45. package/workflows/0.1.0/hire-judge-settle.json +767 -0
  46. package/workflows/0.1.0/jev-grader.json +433 -0
  47. package/workflows/0.1.0/manifest.json +151 -0
  48. package/workflows/0.1.0/schemas/answers.json +248 -0
  49. package/workflows/0.1.0/schemas/common.json +394 -0
  50. package/workflows/0.1.0/schemas/delivery.json +233 -0
  51. package/workflows/0.1.0/schemas/facts.json +225 -0
  52. package/workflows/0.1.0/schemas/hire.json +337 -0
  53. package/workflows/0.1.0/schemas/job.json +96 -0
  54. package/workflows/0.1.0/schemas/settlement.json +225 -0
  55. package/workflows/0.1.0/schemas/verdict.json +314 -0
  56. package/workflows/0.1.0/stamp-grade.json +175 -0
@@ -0,0 +1,233 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://www.taifoon.io/schemas/coordination/v1/delivery.json",
4
+ "title": "DELIVERY — what came back, and the digest that seals it",
5
+ "description": "The work product: the reply held off-chain (handshake dispatch) or the digest / memo the seller submitted on chain. digest.value is the evidenceDigest submit(jobId, evidenceDigest) seals — the reply the buyer read and the digest on chain are one thing.",
6
+ "type": "object",
7
+ "properties": {
8
+ "schema": {
9
+ "const": "taifoon.delivery.v1",
10
+ "x-stage": "L",
11
+ "x-source": "this contract",
12
+ "description": "which canonical entity this record is; fixed per schema"
13
+ },
14
+ "job": {
15
+ "$ref": "common.json#/$defs/job_ref",
16
+ "x-stage": "S1",
17
+ "x-source": "the hire it answers"
18
+ },
19
+ "handshake_id": {
20
+ "type": [
21
+ "string",
22
+ "null"
23
+ ],
24
+ "pattern": "^hs_[0-9a-f]{24}$",
25
+ "x-stage": "L",
26
+ "x-source": "coordd dlv:<hs>"
27
+ },
28
+ "delivered": {
29
+ "type": "boolean",
30
+ "x-stage": "S1",
31
+ "x-source": "a reply was held (status ready + digest) or JobSubmitted / memo phase EVALUATION / hook Submitted exists"
32
+ },
33
+ "transport": {
34
+ "enum": [
35
+ "mcp.tools/call",
36
+ "mcp.initialize",
37
+ "a2a.message/send",
38
+ "a2a.tasks/send",
39
+ "x402.wall",
40
+ "webhook",
41
+ "erc8183.submit",
42
+ "hook.submit",
43
+ "memo-acp.memo",
44
+ "olas.subgraph",
45
+ "grid.probe",
46
+ "none"
47
+ ],
48
+ "x-stage": "L",
49
+ "x-source": "wire-client protocol + tool; or the on-chain submit"
50
+ },
51
+ "status": {
52
+ "enum": [
53
+ "ready",
54
+ "x402",
55
+ "silent",
56
+ "unreachable",
57
+ "submitted",
58
+ "none"
59
+ ],
60
+ "x-stage": "L",
61
+ "x-source": "wire-client WireStatus; submitted = on-chain submission; none = nothing"
62
+ },
63
+ "digest": {
64
+ "type": "object",
65
+ "properties": {
66
+ "value": {
67
+ "anyOf": [
68
+ {
69
+ "$ref": "common.json#/$defs/bytes32"
70
+ },
71
+ {
72
+ "type": "null"
73
+ }
74
+ ]
75
+ },
76
+ "algo": {
77
+ "enum": [
78
+ "keccak256-utf8",
79
+ "bytes32-onchain",
80
+ "none"
81
+ ]
82
+ }
83
+ },
84
+ "required": [
85
+ "value",
86
+ "algo"
87
+ ],
88
+ "additionalProperties": false,
89
+ "x-stage": "S1",
90
+ "x-source": "keccak256(reply text) (wire-client replyDigest) = hook Submitted.evidenceDigest; ERC-8183 JobSubmitted.deliverable"
91
+ },
92
+ "content": {
93
+ "type": "object",
94
+ "properties": {
95
+ "head": {
96
+ "type": [
97
+ "string",
98
+ "null"
99
+ ]
100
+ },
101
+ "chars": {
102
+ "type": [
103
+ "integer",
104
+ "null"
105
+ ]
106
+ },
107
+ "url": {
108
+ "type": [
109
+ "string",
110
+ "null"
111
+ ]
112
+ },
113
+ "full_available": {
114
+ "type": "boolean"
115
+ }
116
+ },
117
+ "required": [
118
+ "head",
119
+ "chars",
120
+ "url",
121
+ "full_available"
122
+ ],
123
+ "additionalProperties": false,
124
+ "x-stage": "L",
125
+ "x-source": "reply_head (≤400) · reply_chars · memo deliverable URL (acpx memo-contents) · whether the full text is held (coordd, ≤100 kB)"
126
+ },
127
+ "tool": {
128
+ "type": [
129
+ "string",
130
+ "null"
131
+ ],
132
+ "x-stage": "L",
133
+ "x-source": "MCP tool called"
134
+ },
135
+ "reason": {
136
+ "type": [
137
+ "string",
138
+ "null"
139
+ ],
140
+ "x-stage": "L",
141
+ "x-source": "wire-client reason: why nothing came back, or a reply flag (the tool reported isError)"
142
+ },
143
+ "request": {
144
+ "type": [
145
+ "object",
146
+ "null"
147
+ ],
148
+ "x-stage": "L",
149
+ "x-source": "the request as sent: tool + args (MCP) or text (A2A)"
150
+ },
151
+ "submitted_at": {
152
+ "anyOf": [
153
+ {
154
+ "$ref": "common.json#/$defs/unix_s"
155
+ },
156
+ {
157
+ "type": "null"
158
+ }
159
+ ],
160
+ "x-stage": "S1",
161
+ "x-source": "JobSubmitted block ts / delivery at"
162
+ },
163
+ "latency_ms": {
164
+ "type": [
165
+ "integer",
166
+ "null"
167
+ ],
168
+ "x-stage": "L",
169
+ "x-source": "wire round trip"
170
+ },
171
+ "attestation": {
172
+ "type": [
173
+ "object",
174
+ "null"
175
+ ],
176
+ "properties": {
177
+ "required": {
178
+ "type": "boolean"
179
+ },
180
+ "served": {
181
+ "type": "boolean"
182
+ },
183
+ "verified": {
184
+ "type": "boolean"
185
+ },
186
+ "source": {
187
+ "type": "string"
188
+ }
189
+ },
190
+ "required": [
191
+ "required",
192
+ "served",
193
+ "verified",
194
+ "source"
195
+ ],
196
+ "additionalProperties": false,
197
+ "x-stage": "S8",
198
+ "x-source": "the seller enclave as the registry knew it at dispatch (Delivery.attestation)"
199
+ },
200
+ "anchors": {
201
+ "type": "array",
202
+ "items": {
203
+ "$ref": "common.json#/$defs/anchor"
204
+ },
205
+ "x-stage": "S1",
206
+ "x-source": "JobSubmitted / Submitted tx; coordd dlv:<hs>"
207
+ },
208
+ "source": {
209
+ "$ref": "common.json#/$defs/source",
210
+ "x-stage": "L",
211
+ "x-source": "the mapper"
212
+ }
213
+ },
214
+ "required": [
215
+ "schema",
216
+ "job",
217
+ "handshake_id",
218
+ "delivered",
219
+ "transport",
220
+ "status",
221
+ "digest",
222
+ "content",
223
+ "tool",
224
+ "reason",
225
+ "request",
226
+ "submitted_at",
227
+ "latency_ms",
228
+ "attestation",
229
+ "anchors",
230
+ "source"
231
+ ],
232
+ "additionalProperties": false
233
+ }
@@ -0,0 +1,225 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://www.taifoon.io/schemas/coordination/v1/facts.json",
4
+ "title": "FACTS — what code establishes before anyone is asked",
5
+ "description": "Deterministic: delivered or not, every check that could be made, the ending the events already decide, and the labelled facts + gaps of the evidence pack. A failed check is a hard fail — reject, and Jev is never asked (judge-compose.compose). GRADEABLE.md is the rule that turns HIRE + DELIVERY + FACTS into what Jev reads.",
6
+ "type": "object",
7
+ "properties": {
8
+ "schema": {
9
+ "const": "taifoon.facts.v1",
10
+ "x-stage": "L",
11
+ "x-source": "this contract",
12
+ "description": "which canonical entity this record is; fixed per schema"
13
+ },
14
+ "subject": {
15
+ "$ref": "common.json#/$defs/job_key",
16
+ "x-stage": "L",
17
+ "x-source": "what the facts are about: the job key (hs:… for a handshake subject)"
18
+ },
19
+ "job": {
20
+ "$ref": "common.json#/$defs/job_ref",
21
+ "x-stage": "S1",
22
+ "x-source": "the hire"
23
+ },
24
+ "delivered": {
25
+ "type": "boolean",
26
+ "x-stage": "S4",
27
+ "x-source": "judge-facts factsOf.delivered: reply digest held / JobSubmitted seen / Olas delivery"
28
+ },
29
+ "checks": {
30
+ "type": "object",
31
+ "additionalProperties": {
32
+ "type": [
33
+ "boolean",
34
+ "null"
35
+ ]
36
+ },
37
+ "x-stage": "S4",
38
+ "x-source": "judge-facts checks{}: reply_held, funded, submitted, inclusion (proof.verify.v5 DET), delivered; null = could not be checked"
39
+ },
40
+ "checks_ok": {
41
+ "type": [
42
+ "boolean",
43
+ "null"
44
+ ],
45
+ "x-stage": "S4",
46
+ "x-source": "every check made passed; null = none could be made"
47
+ },
48
+ "det": {
49
+ "type": [
50
+ "object",
51
+ "null"
52
+ ],
53
+ "properties": {
54
+ "class": {
55
+ "type": "string"
56
+ },
57
+ "why": {
58
+ "type": "string"
59
+ }
60
+ },
61
+ "required": [
62
+ "class",
63
+ "why"
64
+ ],
65
+ "additionalProperties": false,
66
+ "x-stage": "S4",
67
+ "x-source": "the class DET that ran (proof.verify.v5 inclusion)"
68
+ },
69
+ "ending": {
70
+ "anyOf": [
71
+ {
72
+ "$ref": "common.json#/$defs/ending"
73
+ },
74
+ {
75
+ "type": "null"
76
+ }
77
+ ],
78
+ "x-stage": "S2",
79
+ "x-source": "observatory ending when the subject is a job"
80
+ },
81
+ "det_value": {
82
+ "anyOf": [
83
+ {
84
+ "$ref": "common.json#/$defs/ref_value"
85
+ },
86
+ {
87
+ "type": "null"
88
+ }
89
+ ],
90
+ "x-stage": "S4",
91
+ "x-source": "DET from events (jev-pad detFromEvents): completed → delivered_as_specified · rejected+submitted → delivered_with_defects · no submission → not_delivered · expired+submitted → cannot_determine"
92
+ },
93
+ "verdict_class": {
94
+ "anyOf": [
95
+ {
96
+ "$ref": "common.json#/$defs/verdict_class"
97
+ },
98
+ {
99
+ "type": "null"
100
+ }
101
+ ],
102
+ "x-stage": "S2",
103
+ "x-source": "the seller-verdict rule on this job (trails.mjs verdictOf)"
104
+ },
105
+ "reason_on_chain": {
106
+ "type": [
107
+ "string",
108
+ "null"
109
+ ],
110
+ "x-stage": "S1",
111
+ "x-source": "JobRejected reason (ascii) ?? the rejecting memo — what a party SAID on chain, quoted, never inferred"
112
+ },
113
+ "pair": {
114
+ "type": [
115
+ "object",
116
+ "null"
117
+ ],
118
+ "properties": {
119
+ "jobs": {
120
+ "type": "integer"
121
+ },
122
+ "endings": {
123
+ "type": "object",
124
+ "additionalProperties": {
125
+ "type": "integer"
126
+ }
127
+ }
128
+ },
129
+ "required": [
130
+ "jobs",
131
+ "endings"
132
+ ],
133
+ "additionalProperties": false,
134
+ "x-stage": "S2",
135
+ "x-source": "every job between this buyer and this seller (observatory pair)"
136
+ },
137
+ "price_usdc": {
138
+ "type": [
139
+ "number",
140
+ "null"
141
+ ],
142
+ "x-stage": "S4",
143
+ "x-source": "the price when it is in USDC (auto-complete cap check)"
144
+ },
145
+ "pack": {
146
+ "type": [
147
+ "object",
148
+ "null"
149
+ ],
150
+ "properties": {
151
+ "facts": {
152
+ "type": "array",
153
+ "items": {
154
+ "type": "array",
155
+ "prefixItems": [
156
+ {
157
+ "type": "string"
158
+ },
159
+ {
160
+ "type": "string"
161
+ }
162
+ ],
163
+ "minItems": 2,
164
+ "maxItems": 2,
165
+ "items": {
166
+ "type": "string"
167
+ }
168
+ }
169
+ },
170
+ "gaps": {
171
+ "type": "array",
172
+ "items": {
173
+ "type": "string"
174
+ }
175
+ },
176
+ "state": {
177
+ "type": [
178
+ "string",
179
+ "null"
180
+ ]
181
+ }
182
+ },
183
+ "required": [
184
+ "facts",
185
+ "gaps",
186
+ "state"
187
+ ],
188
+ "additionalProperties": false,
189
+ "x-stage": "S4",
190
+ "x-source": "job-evidence buildEvidence / delivery-evidence buildDeliveryEvidence: [label, value][], gaps[], the state text"
191
+ },
192
+ "anchors": {
193
+ "type": "array",
194
+ "items": {
195
+ "$ref": "common.json#/$defs/anchor"
196
+ },
197
+ "x-stage": "S4",
198
+ "x-source": "the events the facts were read from; the evidence route"
199
+ },
200
+ "source": {
201
+ "$ref": "common.json#/$defs/source",
202
+ "x-stage": "L",
203
+ "x-source": "the mapper"
204
+ }
205
+ },
206
+ "required": [
207
+ "schema",
208
+ "subject",
209
+ "job",
210
+ "delivered",
211
+ "checks",
212
+ "checks_ok",
213
+ "det",
214
+ "ending",
215
+ "det_value",
216
+ "verdict_class",
217
+ "reason_on_chain",
218
+ "pair",
219
+ "price_usdc",
220
+ "pack",
221
+ "anchors",
222
+ "source"
223
+ ],
224
+ "additionalProperties": false
225
+ }