xoonya 1.10.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 CHANGED
@@ -131,7 +131,10 @@ 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`
134
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.
135
138
  - `POST /v1/events/canonicalize`
136
139
  - `POST /v1/events/hash`
137
140
  - `POST /v1/receipts/emit`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xoonya",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "Deterministic proof SDK for canonical events, receipts, proof bundles, and verification.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
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,54 @@ function reviewInteractionResultPackageHandoff(input) {
1313
1315
  handoff.payment_protocol,
1314
1316
  handoff.settlement_mode,
1315
1317
  handoff.treasury_destination_id,
1316
- ...(Array.isArray(handoff.task_refs) ? handoff.task_refs : []),
1317
- ...(Array.isArray(handoff.seam_layers) ? handoff.seam_layers : [])
1318
- ].filter(Boolean).length,
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
+
1324
1366
  function runDefaultProofLoop(loopRef, input) {
1325
1367
  const loop = getDefaultProofLoop(loopRef);
1326
1368
  if (!loop) {
@@ -1376,6 +1418,7 @@ module.exports = {
1376
1418
  canonicalizeTransactionProofHandoff,
1377
1419
  runDefaultProofLoop,
1378
1420
  reviewInteractionResultPackageHandoff,
1421
+ summarizeReviewedInteractionResultPackageHandoff,
1379
1422
  runInteractionResultPackageHandoff,
1380
1423
  runInteractionSpineProofHandoff,
1381
1424
  runTransactionProofHandoff,
package/server.js CHANGED
@@ -193,6 +193,17 @@ 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
+
196
207
  if (req.method === 'POST' && url.pathname === '/v1/receipts/verify') {
197
208
  try {
198
209
  const body = await readJsonBody(req);