xoonya 1.10.0 → 1.12.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 +6 -0
- package/package.json +1 -1
- package/proof_sdk.js +91 -3
- package/server.js +33 -0
package/README.md
CHANGED
|
@@ -131,7 +131,13 @@ Primary proof-model routes:
|
|
|
131
131
|
- `GET /v1/proof-center/result-package-handoff`
|
|
132
132
|
- `GET /v1/proof-center/result-package-handoff/summary`
|
|
133
133
|
- `POST /v1/proof-center/result-package-handoff/review`
|
|
134
|
+
- `POST /v1/proof-center/result-package-handoff/review/summary`
|
|
135
|
+
- `POST /v1/proof-center/result-package-handoff/review/extension-readiness`
|
|
136
|
+
- `POST /v1/proof-center/result-package-handoff/review/extension-boundary`
|
|
134
137
|
- `POST /v1/proof-center/result-package-handoff/run`
|
|
138
|
+
|
|
139
|
+
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.
|
|
140
|
+
It also now exposes an extension-readiness summary so the stable post-review proof boundary is easier to treat as a reusable seam.
|
|
135
141
|
- `POST /v1/events/canonicalize`
|
|
136
142
|
- `POST /v1/events/hash`
|
|
137
143
|
- `POST /v1/receipts/emit`
|
package/package.json
CHANGED
package/proof_sdk.js
CHANGED
|
@@ -1301,6 +1301,8 @@ function summarizeInteractionResultPackageHandoff(bundle) {
|
|
|
1301
1301
|
|
|
1302
1302
|
function reviewInteractionResultPackageHandoff(input) {
|
|
1303
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 : [];
|
|
1304
1306
|
return {
|
|
1305
1307
|
ok: true,
|
|
1306
1308
|
handoff_kind: "interaction_result_package",
|
|
@@ -1313,14 +1315,97 @@ function reviewInteractionResultPackageHandoff(input) {
|
|
|
1313
1315
|
handoff.payment_protocol,
|
|
1314
1316
|
handoff.settlement_mode,
|
|
1315
1317
|
handoff.treasury_destination_id,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
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
|
+
},
|
|
1319
1342
|
recommended_loop: "default.proof.bundle.loop",
|
|
1320
1343
|
next_surface: "/v1/proof-center/result-package-handoff/run"
|
|
1321
1344
|
};
|
|
1322
1345
|
}
|
|
1323
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
|
+
|
|
1366
|
+
function summarizeReviewExtensionReadiness(input) {
|
|
1367
|
+
const review = reviewInteractionResultPackageHandoff(input);
|
|
1368
|
+
const durability = review.durability_summary && typeof review.durability_summary === "object"
|
|
1369
|
+
? review.durability_summary
|
|
1370
|
+
: {};
|
|
1371
|
+
const preserved = durability.preserved_context && typeof durability.preserved_context === "object"
|
|
1372
|
+
? durability.preserved_context
|
|
1373
|
+
: {};
|
|
1374
|
+
return {
|
|
1375
|
+
ok: review.ok === true,
|
|
1376
|
+
handoff_kind: review.handoff_kind || null,
|
|
1377
|
+
result_package_ref: review.handoff && review.handoff.result_package_ref ? review.handoff.result_package_ref : null,
|
|
1378
|
+
review_ref: durability.review_ref || null,
|
|
1379
|
+
extension_ready_ref: durability.review_ref ? `extension.${durability.review_ref}` : null,
|
|
1380
|
+
stable_post_review_context: {
|
|
1381
|
+
execution_context_ready: Boolean(preserved.execution_result && preserved.execution_result.committed_ref),
|
|
1382
|
+
economic_context_ready: Boolean(
|
|
1383
|
+
preserved.economic_state &&
|
|
1384
|
+
(preserved.economic_state.payment_protocol || preserved.economic_state.settlement_mode || preserved.economic_state.treasury_destination_id)
|
|
1385
|
+
),
|
|
1386
|
+
proof_context_ready: Boolean(preserved.proof_handoff && preserved.proof_handoff.source_ref)
|
|
1387
|
+
},
|
|
1388
|
+
proof_extension_ready: durability.run_ready === true,
|
|
1389
|
+
next_surface: durability.next_surface || review.next_surface || null
|
|
1390
|
+
};
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
function summarizeReviewExtensionBoundary(input) {
|
|
1394
|
+
const readiness = summarizeReviewExtensionReadiness(input);
|
|
1395
|
+
return {
|
|
1396
|
+
ok: readiness.ok === true,
|
|
1397
|
+
handoff_kind: readiness.handoff_kind || null,
|
|
1398
|
+
result_package_ref: readiness.result_package_ref || null,
|
|
1399
|
+
extension_ready_ref: readiness.extension_ready_ref || null,
|
|
1400
|
+
stable_boundary_ids: [
|
|
1401
|
+
"review_extension_readiness",
|
|
1402
|
+
"proof_run"
|
|
1403
|
+
],
|
|
1404
|
+
proof_extension_ready: readiness.proof_extension_ready === true,
|
|
1405
|
+
next_surface: readiness.next_surface || null
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1324
1409
|
function runDefaultProofLoop(loopRef, input) {
|
|
1325
1410
|
const loop = getDefaultProofLoop(loopRef);
|
|
1326
1411
|
if (!loop) {
|
|
@@ -1376,6 +1461,9 @@ module.exports = {
|
|
|
1376
1461
|
canonicalizeTransactionProofHandoff,
|
|
1377
1462
|
runDefaultProofLoop,
|
|
1378
1463
|
reviewInteractionResultPackageHandoff,
|
|
1464
|
+
summarizeReviewedInteractionResultPackageHandoff,
|
|
1465
|
+
summarizeReviewExtensionReadiness,
|
|
1466
|
+
summarizeReviewExtensionBoundary,
|
|
1379
1467
|
runInteractionResultPackageHandoff,
|
|
1380
1468
|
runInteractionSpineProofHandoff,
|
|
1381
1469
|
runTransactionProofHandoff,
|
package/server.js
CHANGED
|
@@ -193,6 +193,39 @@ async function routeRequest(req, res) {
|
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
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
|
+
|
|
207
|
+
if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/extension-readiness') {
|
|
208
|
+
try {
|
|
209
|
+
const body = await readJsonBody(req);
|
|
210
|
+
const result = proofSdk.summarizeReviewExtensionReadiness(body);
|
|
211
|
+
sendJson(res, 200, result);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
sendJson(res, 400, { ok: false, reason: error.message });
|
|
214
|
+
}
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/extension-boundary') {
|
|
219
|
+
try {
|
|
220
|
+
const body = await readJsonBody(req);
|
|
221
|
+
const result = proofSdk.summarizeReviewExtensionBoundary(body);
|
|
222
|
+
sendJson(res, 200, result);
|
|
223
|
+
} catch (error) {
|
|
224
|
+
sendJson(res, 400, { ok: false, reason: error.message });
|
|
225
|
+
}
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
196
229
|
if (req.method === 'POST' && url.pathname === '/v1/receipts/verify') {
|
|
197
230
|
try {
|
|
198
231
|
const body = await readJsonBody(req);
|