xoonya 1.9.0 → 1.11.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.
- package/README.md +4 -0
- package/package.json +1 -1
- package/proof_sdk.js +66 -0
- package/server.js +22 -0
package/README.md
CHANGED
|
@@ -130,7 +130,11 @@ Primary proof-model routes:
|
|
|
130
130
|
- `POST /v1/proof-center/transaction-handoff/run`
|
|
131
131
|
- `GET /v1/proof-center/result-package-handoff`
|
|
132
132
|
- `GET /v1/proof-center/result-package-handoff/summary`
|
|
133
|
+
- `POST /v1/proof-center/result-package-handoff/review`
|
|
134
|
+
- `POST /v1/proof-center/result-package-handoff/review/summary`
|
|
133
135
|
- `POST /v1/proof-center/result-package-handoff/run`
|
|
136
|
+
|
|
137
|
+
The result-package review surface now also returns a durability summary so the preserved execution, economic, and proof-facing context is easier to inspect before proof-native execution.
|
|
134
138
|
- `POST /v1/events/canonicalize`
|
|
135
139
|
- `POST /v1/events/hash`
|
|
136
140
|
- `POST /v1/receipts/emit`
|
package/package.json
CHANGED
package/proof_sdk.js
CHANGED
|
@@ -1299,6 +1299,70 @@ function summarizeInteractionResultPackageHandoff(bundle) {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
}
|
|
1301
1301
|
|
|
1302
|
+
function reviewInteractionResultPackageHandoff(input) {
|
|
1303
|
+
const handoff = canonicalizeInteractionResultPackageHandoff(input);
|
|
1304
|
+
const seamLayers = Array.isArray(handoff.seam_layers) ? handoff.seam_layers : [];
|
|
1305
|
+
const taskRefs = Array.isArray(handoff.task_refs) ? handoff.task_refs : [];
|
|
1306
|
+
return {
|
|
1307
|
+
ok: true,
|
|
1308
|
+
handoff_kind: "interaction_result_package",
|
|
1309
|
+
handoff,
|
|
1310
|
+
accepted: true,
|
|
1311
|
+
required_field_count: 5,
|
|
1312
|
+
optional_present_count: [
|
|
1313
|
+
handoff.committed_ref,
|
|
1314
|
+
handoff.precommit_pack_ref,
|
|
1315
|
+
handoff.payment_protocol,
|
|
1316
|
+
handoff.settlement_mode,
|
|
1317
|
+
handoff.treasury_destination_id,
|
|
1318
|
+
...taskRefs,
|
|
1319
|
+
...seamLayers
|
|
1320
|
+
].filter(Boolean).length,
|
|
1321
|
+
durability_summary: {
|
|
1322
|
+
review_ref: handoff.result_package_ref ? `review.${handoff.result_package_ref}` : null,
|
|
1323
|
+
preserved_context: {
|
|
1324
|
+
execution_result: {
|
|
1325
|
+
committed_ref: handoff.committed_ref || null,
|
|
1326
|
+
task_ref_count: taskRefs.length
|
|
1327
|
+
},
|
|
1328
|
+
economic_state: {
|
|
1329
|
+
payment_protocol: handoff.payment_protocol || null,
|
|
1330
|
+
settlement_mode: handoff.settlement_mode || null,
|
|
1331
|
+
treasury_destination_id: handoff.treasury_destination_id || null
|
|
1332
|
+
},
|
|
1333
|
+
proof_handoff: {
|
|
1334
|
+
source_ref: handoff.source_ref || null,
|
|
1335
|
+
seam_layer_count: seamLayers.length,
|
|
1336
|
+
seam_layers: seamLayers
|
|
1337
|
+
}
|
|
1338
|
+
},
|
|
1339
|
+
run_ready: Boolean(handoff.transaction_id && handoff.receipt_id && handoff.proof_ref),
|
|
1340
|
+
next_surface: "/v1/proof-center/result-package-handoff/run"
|
|
1341
|
+
},
|
|
1342
|
+
recommended_loop: "default.proof.bundle.loop",
|
|
1343
|
+
next_surface: "/v1/proof-center/result-package-handoff/run"
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
function summarizeReviewedInteractionResultPackageHandoff(input) {
|
|
1348
|
+
const review = reviewInteractionResultPackageHandoff(input);
|
|
1349
|
+
const durability = review.durability_summary && typeof review.durability_summary === "object"
|
|
1350
|
+
? review.durability_summary
|
|
1351
|
+
: {};
|
|
1352
|
+
const proofHandoff = durability.preserved_context && durability.preserved_context.proof_handoff
|
|
1353
|
+
? durability.preserved_context.proof_handoff
|
|
1354
|
+
: {};
|
|
1355
|
+
return {
|
|
1356
|
+
ok: review.ok === true,
|
|
1357
|
+
handoff_kind: review.handoff_kind || null,
|
|
1358
|
+
result_package_ref: review.handoff && review.handoff.result_package_ref ? review.handoff.result_package_ref : null,
|
|
1359
|
+
review_ref: durability.review_ref || null,
|
|
1360
|
+
run_ready: durability.run_ready === true,
|
|
1361
|
+
next_surface: durability.next_surface || review.next_surface || null,
|
|
1362
|
+
preserved_seam_layer_count: Number(proofHandoff.seam_layer_count || 0)
|
|
1363
|
+
};
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1302
1366
|
function runDefaultProofLoop(loopRef, input) {
|
|
1303
1367
|
const loop = getDefaultProofLoop(loopRef);
|
|
1304
1368
|
if (!loop) {
|
|
@@ -1353,6 +1417,8 @@ module.exports = {
|
|
|
1353
1417
|
getDefaultProofLoop,
|
|
1354
1418
|
canonicalizeTransactionProofHandoff,
|
|
1355
1419
|
runDefaultProofLoop,
|
|
1420
|
+
reviewInteractionResultPackageHandoff,
|
|
1421
|
+
summarizeReviewedInteractionResultPackageHandoff,
|
|
1356
1422
|
runInteractionResultPackageHandoff,
|
|
1357
1423
|
runInteractionSpineProofHandoff,
|
|
1358
1424
|
runTransactionProofHandoff,
|
package/server.js
CHANGED
|
@@ -182,6 +182,28 @@ async function routeRequest(req, res) {
|
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review') {
|
|
186
|
+
try {
|
|
187
|
+
const body = await readJsonBody(req);
|
|
188
|
+
const result = proofSdk.reviewInteractionResultPackageHandoff(body);
|
|
189
|
+
sendJson(res, 200, result);
|
|
190
|
+
} catch (error) {
|
|
191
|
+
sendJson(res, 400, { ok: false, reason: error.message });
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/summary') {
|
|
197
|
+
try {
|
|
198
|
+
const body = await readJsonBody(req);
|
|
199
|
+
const result = proofSdk.summarizeReviewedInteractionResultPackageHandoff(body);
|
|
200
|
+
sendJson(res, 200, result);
|
|
201
|
+
} catch (error) {
|
|
202
|
+
sendJson(res, 400, { ok: false, reason: error.message });
|
|
203
|
+
}
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
185
207
|
if (req.method === 'POST' && url.pathname === '/v1/receipts/verify') {
|
|
186
208
|
try {
|
|
187
209
|
const body = await readJsonBody(req);
|