xoonya 2.1.0 → 2.3.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 (146) hide show
  1. package/CARRIED_HANDOFF_DEMO.md +60 -0
  2. package/EXAMPLE_PATHS.md +53 -0
  3. package/OPERATIONS_RUNBOOK.md +50 -0
  4. package/OPERATOR_START_HERE.md +67 -0
  5. package/PARTNER_READY_PATH.md +67 -0
  6. package/PROGRAM_COMPLETE_RELEASE.md +52 -0
  7. package/PROGRAM_STATUS.md +57 -0
  8. package/PUBLIC_DEMO_SCRIPT.md +79 -0
  9. package/PUBLISH_PLAN.md +7 -5
  10. package/README.md +27 -0
  11. package/RELEASE_CHECKLIST.md +8 -2
  12. package/RELEASE_NOTES.md +18 -8
  13. package/START_HERE.md +28 -0
  14. package/WHY_XYTARA_XOONYA.md +43 -0
  15. package/bin/xoonya-release.js +1181 -1
  16. package/examples/integration_boundary_walkthrough.js +37 -0
  17. package/examples/package_quickstart.js +1007 -0
  18. package/examples/partner_proof_walkthrough.js +68 -0
  19. package/examples/proof_review_walkthrough.js +66 -0
  20. package/examples/review_carried_handoff.js +72 -0
  21. package/lib/bridge_intelligence.js +102 -0
  22. package/lib/governance_intelligence.js +108 -0
  23. package/lib/phase_10_closeout_pack.js +45 -0
  24. package/lib/phase_10_completion_pack.js +76 -0
  25. package/lib/phase_10_decision_record_pack.js +54 -0
  26. package/lib/phase_10_decision_resolution_pack.js +53 -0
  27. package/lib/phase_10_demand_signal_adapters_proof_pack.js +74 -0
  28. package/lib/phase_10_ecosystem_backlog_triage_proof_pack.js +74 -0
  29. package/lib/phase_10_freeze_baseline_pack.js +67 -0
  30. package/lib/phase_10_freeze_review_pack.js +64 -0
  31. package/lib/phase_10_gate_pack.js +57 -0
  32. package/lib/phase_10_long_tail_continuity_pack.js +80 -0
  33. package/lib/phase_10_long_tail_ecosystem_pack.js +68 -0
  34. package/lib/phase_10_niche_extension_registry_proof_pack.js +74 -0
  35. package/lib/phase_1_claude_mcp_pack.js +60 -0
  36. package/lib/phase_1_claude_mcp_proof_pack.js +57 -0
  37. package/lib/phase_1_ecosystem_pack.js +51 -0
  38. package/lib/phase_1_openai_codex_pack.js +60 -0
  39. package/lib/phase_1_openai_codex_proof_pack.js +57 -0
  40. package/lib/phase_2_base_proof_pack.js +71 -0
  41. package/lib/phase_2_base_usdc_proof_pack.js +72 -0
  42. package/lib/phase_2_closeout_pack.js +65 -0
  43. package/lib/phase_2_completion_pack.js +113 -0
  44. package/lib/phase_2_decision_record_pack.js +66 -0
  45. package/lib/phase_2_decision_resolution_pack.js +69 -0
  46. package/lib/phase_2_eth_proof_pack.js +70 -0
  47. package/lib/phase_2_evm_base_proof_pack.js +73 -0
  48. package/lib/phase_2_evm_proof_pack.js +71 -0
  49. package/lib/phase_2_flip_preview_pack.js +60 -0
  50. package/lib/phase_2_freeze_review_pack.js +99 -0
  51. package/lib/phase_2_gate_pack.js +77 -0
  52. package/lib/phase_2_payment_rails_pack.js +71 -0
  53. package/lib/phase_2_usdc_proof_pack.js +71 -0
  54. package/lib/phase_3_brc_proof_pack.js +81 -0
  55. package/lib/phase_3_bsv_teranode_proof_pack.js +81 -0
  56. package/lib/phase_3_closeout_pack.js +62 -0
  57. package/lib/phase_3_completion_pack.js +92 -0
  58. package/lib/phase_3_decision_record_pack.js +64 -0
  59. package/lib/phase_3_decision_resolution_pack.js +69 -0
  60. package/lib/phase_3_freeze_baseline_pack.js +67 -0
  61. package/lib/phase_3_freeze_review_pack.js +80 -0
  62. package/lib/phase_3_gate_pack.js +76 -0
  63. package/lib/phase_3_metanet_proof_pack.js +81 -0
  64. package/lib/phase_3_native_bsv_pack.js +89 -0
  65. package/lib/phase_3_native_continuity_pack.js +82 -0
  66. package/lib/phase_4_attestation_proof_pack.js +75 -0
  67. package/lib/phase_4_closeout_pack.js +45 -0
  68. package/lib/phase_4_completion_pack.js +82 -0
  69. package/lib/phase_4_decision_record_pack.js +54 -0
  70. package/lib/phase_4_decision_resolution_pack.js +45 -0
  71. package/lib/phase_4_erc8004_proof_pack.js +76 -0
  72. package/lib/phase_4_freeze_baseline_pack.js +67 -0
  73. package/lib/phase_4_freeze_review_pack.js +68 -0
  74. package/lib/phase_4_gate_pack.js +58 -0
  75. package/lib/phase_4_identity_registry_proof_pack.js +75 -0
  76. package/lib/phase_4_identity_trust_pack.js +73 -0
  77. package/lib/phase_4_trust_continuity_pack.js +86 -0
  78. package/lib/phase_5_antelope_proof_pack.js +76 -0
  79. package/lib/phase_5_closeout_pack.js +44 -0
  80. package/lib/phase_5_completion_pack.js +82 -0
  81. package/lib/phase_5_decision_record_pack.js +54 -0
  82. package/lib/phase_5_decision_resolution_pack.js +45 -0
  83. package/lib/phase_5_freeze_baseline_pack.js +67 -0
  84. package/lib/phase_5_freeze_review_pack.js +68 -0
  85. package/lib/phase_5_gate_pack.js +58 -0
  86. package/lib/phase_5_major_rails_continuity_pack.js +86 -0
  87. package/lib/phase_5_major_rails_pack.js +74 -0
  88. package/lib/phase_5_proton_xpr_proof_pack.js +76 -0
  89. package/lib/phase_5_solana_proof_pack.js +76 -0
  90. package/lib/phase_6_autogen_proof_pack.js +74 -0
  91. package/lib/phase_6_closeout_pack.js +46 -0
  92. package/lib/phase_6_completion_pack.js +77 -0
  93. package/lib/phase_6_decision_record_pack.js +54 -0
  94. package/lib/phase_6_decision_resolution_pack.js +53 -0
  95. package/lib/phase_6_framework_continuity_pack.js +81 -0
  96. package/lib/phase_6_framework_runtime_pack.js +68 -0
  97. package/lib/phase_6_freeze_baseline_pack.js +68 -0
  98. package/lib/phase_6_freeze_review_pack.js +65 -0
  99. package/lib/phase_6_gate_pack.js +59 -0
  100. package/lib/phase_6_langchain_proof_pack.js +74 -0
  101. package/lib/phase_6_langgraph_proof_pack.js +74 -0
  102. package/lib/phase_6_semantic_kernel_proof_pack.js +74 -0
  103. package/lib/phase_7_closeout_pack.js +45 -0
  104. package/lib/phase_7_completion_pack.js +85 -0
  105. package/lib/phase_7_decision_record_pack.js +53 -0
  106. package/lib/phase_7_decision_resolution_pack.js +53 -0
  107. package/lib/phase_7_event_system_continuity_pack.js +89 -0
  108. package/lib/phase_7_event_system_pack.js +76 -0
  109. package/lib/phase_7_freeze_baseline_pack.js +74 -0
  110. package/lib/phase_7_freeze_review_pack.js +65 -0
  111. package/lib/phase_7_gate_pack.js +58 -0
  112. package/lib/phase_7_kafka_proof_pack.js +76 -0
  113. package/lib/phase_7_mqtt_proof_pack.js +76 -0
  114. package/lib/phase_7_nats_proof_pack.js +76 -0
  115. package/lib/phase_7_webhook_event_bus_proof_pack.js +76 -0
  116. package/lib/phase_8_closeout_pack.js +46 -0
  117. package/lib/phase_8_completion_pack.js +82 -0
  118. package/lib/phase_8_decision_record_pack.js +54 -0
  119. package/lib/phase_8_decision_resolution_pack.js +53 -0
  120. package/lib/phase_8_external_receipt_import_proof_pack.js +74 -0
  121. package/lib/phase_8_external_result_import_proof_pack.js +74 -0
  122. package/lib/phase_8_freeze_baseline_pack.js +71 -0
  123. package/lib/phase_8_freeze_review_pack.js +64 -0
  124. package/lib/phase_8_gate_pack.js +58 -0
  125. package/lib/phase_8_proof_bridge_continuity_pack.js +86 -0
  126. package/lib/phase_8_proof_bridges_pack.js +72 -0
  127. package/lib/phase_8_proof_bundle_normalization_proof_pack.js +74 -0
  128. package/lib/phase_9_closeout_pack.js +46 -0
  129. package/lib/phase_9_completion_pack.js +82 -0
  130. package/lib/phase_9_custody_refs_proof_pack.js +74 -0
  131. package/lib/phase_9_decision_record_pack.js +54 -0
  132. package/lib/phase_9_decision_resolution_pack.js +53 -0
  133. package/lib/phase_9_freeze_baseline_pack.js +71 -0
  134. package/lib/phase_9_freeze_review_pack.js +64 -0
  135. package/lib/phase_9_gate_pack.js +58 -0
  136. package/lib/phase_9_operator_accounting_bridges_proof_pack.js +74 -0
  137. package/lib/phase_9_treasury_connectivity_pack.js +72 -0
  138. package/lib/phase_9_treasury_continuity_pack.js +86 -0
  139. package/lib/phase_9_treasury_destinations_proof_pack.js +74 -0
  140. package/lib/phase_program_pack.js +47 -0
  141. package/lib/release_center.js +924 -0
  142. package/lib/release_history.js +1 -1
  143. package/lib/review_intelligence.js +100 -0
  144. package/lib/trust_intelligence.js +106 -0
  145. package/package.json +11 -1
  146. package/server.js +1862 -88
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const { createServer } = require("../server");
5
+
6
+ async function fetchJson(url, options) {
7
+ const response = await fetch(url, options);
8
+ assert.strictEqual(response.ok, true, `request failed: ${url}`);
9
+ return response.json();
10
+ }
11
+
12
+ async function postJson(url, body) {
13
+ return fetchJson(url, {
14
+ method: "POST",
15
+ headers: {
16
+ "content-type": "application/json"
17
+ },
18
+ body: JSON.stringify(body)
19
+ });
20
+ }
21
+
22
+ async function main() {
23
+ const server = createServer();
24
+ await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
25
+ const address = server.address();
26
+ const baseUrl = `http://127.0.0.1:${address.port}`;
27
+
28
+ try {
29
+ const releaseCenterSummary = await fetchJson(`${baseUrl}/v1/release-center/summary`);
30
+ assert.strictEqual(typeof releaseCenterSummary.category, "string", "release-center summary category missing");
31
+
32
+ const proofCenterSummary = await fetchJson(`${baseUrl}/v1/proof-center/summary`);
33
+ assert.strictEqual(typeof proofCenterSummary.proof_bundle_version, "string", "proof-center summary missing");
34
+
35
+ const handoffReview = await postJson(`${baseUrl}/v1/proof-center/result-package-handoff/review/summary`, {
36
+ handoff_bundle: {
37
+ result_package_ref: "result.spine.job.commitment",
38
+ source_ref: "spine.job.commitment",
39
+ transaction_id: "txn-partner-proof-1",
40
+ receipt_id: "rcpt-partner-proof-1",
41
+ proof_ref: "memory://partner-proof-1",
42
+ committed_ref: "transaction.job.commitment",
43
+ precommit_pack_ref: "precommit.job.commitment.readiness",
44
+ payment_protocol: "x402",
45
+ settlement_mode: "evm_payment",
46
+ treasury_destination_id: "treasury_acct_demo",
47
+ task_refs: ["jobs.quote", "admission.preview", "jobs.reserve", "jobs.commit"],
48
+ seam_layers: ["execution_consequence", "payment_settlement_treasury", "proof_handoff"]
49
+ }
50
+ });
51
+ assert.strictEqual(typeof handoffReview.review_ref, "string", "handoff review ref missing");
52
+ assert.strictEqual(handoffReview.run_ready, true, "handoff review run readiness missing");
53
+
54
+ const integrationReadiness = await fetchJson(`${baseUrl}/v1/integrations/promotion-readiness`);
55
+ assert.strictEqual(integrationReadiness.ok, true, "integration readiness summary missing");
56
+
57
+ console.log("xoonya partner proof walkthrough passed");
58
+ } finally {
59
+ await new Promise((resolve, reject) => {
60
+ server.close((error) => (error ? reject(error) : resolve()));
61
+ });
62
+ }
63
+ }
64
+
65
+ main().catch((error) => {
66
+ console.error(error);
67
+ process.exitCode = 1;
68
+ });
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const { createServer } = require("../server");
5
+
6
+ async function fetchJson(url, options) {
7
+ const response = await fetch(url, options);
8
+ assert.strictEqual(response.ok, true, `request failed: ${url}`);
9
+ return response.json();
10
+ }
11
+
12
+ async function postJson(url, body) {
13
+ return fetchJson(url, {
14
+ method: "POST",
15
+ headers: {
16
+ "content-type": "application/json"
17
+ },
18
+ body: JSON.stringify(body)
19
+ });
20
+ }
21
+
22
+ function createHandoffBundle() {
23
+ return {
24
+ result_package_ref: "result.spine.job.commitment",
25
+ source_ref: "spine.job.commitment",
26
+ transaction_id: "txn-proof-review-demo-1",
27
+ receipt_id: "rcpt-proof-review-demo-1",
28
+ proof_ref: "memory://proof-review-demo-1",
29
+ committed_ref: "transaction.job.commitment",
30
+ precommit_pack_ref: "precommit.job.commitment.readiness",
31
+ payment_protocol: "x402",
32
+ settlement_mode: "evm_payment",
33
+ treasury_destination_id: "treasury_acct_demo",
34
+ task_refs: ["jobs.quote", "admission.preview", "jobs.reserve", "jobs.commit"],
35
+ seam_layers: ["execution_consequence", "payment_settlement_treasury", "proof_handoff"]
36
+ };
37
+ }
38
+
39
+ async function main() {
40
+ const server = createServer();
41
+ await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
42
+ const { port } = server.address();
43
+ const baseUrl = `http://127.0.0.1:${port}`;
44
+
45
+ try {
46
+ const review = await postJson(`${baseUrl}/v1/proof-center/result-package-handoff/review/summary`, {
47
+ handoff_bundle: createHandoffBundle()
48
+ });
49
+ assert.strictEqual(typeof review.review_ref, "string", "review summary missing");
50
+ assert.strictEqual(review.run_ready, true, "review should be run-ready");
51
+
52
+ const bridgeSummary = await postJson(`${baseUrl}/v1/proof-center/result-package-handoff/review/bridge-summary`, {
53
+ handoff_bundle: createHandoffBundle()
54
+ });
55
+ assert.strictEqual(typeof bridgeSummary.adapter_bridge_ref, "string", "bridge summary missing");
56
+
57
+ console.log("xoonya proof review walkthrough passed");
58
+ } finally {
59
+ await new Promise((resolve, reject) => server.close((error) => (error ? reject(error) : resolve())));
60
+ }
61
+ }
62
+
63
+ main().catch((error) => {
64
+ console.error(error);
65
+ process.exitCode = 1;
66
+ });
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const proof = require("../index.js");
7
+
8
+ function parseInputPath(argv) {
9
+ const args = Array.isArray(argv) ? argv : [];
10
+ for (let index = 0; index < args.length; index += 1) {
11
+ if (args[index] === "--file" && args[index + 1]) {
12
+ return path.resolve(process.cwd(), args[index + 1]);
13
+ }
14
+ }
15
+ return null;
16
+ }
17
+
18
+ function buildDefaultInput() {
19
+ return {
20
+ handoff_bundle: {
21
+ result_package_ref: "result.spine.job.commitment",
22
+ source_ref: "spine.job.commitment",
23
+ transaction_id: "txn-carried-handoff-demo-1",
24
+ receipt_id: "txn-carried-handoff-demo-receipt-1",
25
+ proof_ref: "memory://proof-demo/carried-handoff",
26
+ committed_ref: "transaction.job.commitment",
27
+ precommit_pack_ref: "precommit.job.commitment.readiness",
28
+ payment_protocol: "x402",
29
+ settlement_mode: "bsv_teranode",
30
+ treasury_destination_id: "treasury_acct_demo",
31
+ task_refs: ["jobs.quote", "admission.preview", "jobs.reserve", "jobs.commit"],
32
+ seam_layers: ["execution_consequence", "payment_settlement_treasury", "proof_handoff"]
33
+ }
34
+ };
35
+ }
36
+
37
+ function loadInput(inputPath) {
38
+ if (!inputPath) {
39
+ return buildDefaultInput();
40
+ }
41
+ return JSON.parse(fs.readFileSync(inputPath, "utf8"));
42
+ }
43
+
44
+ function main() {
45
+ const inputPath = parseInputPath(process.argv.slice(2));
46
+ const input = loadInput(inputPath);
47
+ const reviewSummary = proof.summarizeReviewedInteractionResultPackageHandoff(input);
48
+ const runResult = proof.runInteractionResultPackageHandoff({
49
+ ...input,
50
+ options: {
51
+ legacy_identity_material_hex: "aa11bb22cc33dd44"
52
+ }
53
+ });
54
+
55
+ assert.strictEqual(reviewSummary.ok, true, "review summary missing");
56
+ assert.strictEqual(reviewSummary.run_ready, true, "review summary should be run-ready");
57
+ assert.strictEqual(runResult.ok, true, "proof run missing");
58
+ assert.strictEqual(runResult.bundle_verification.valid, true, "proof bundle verification failed");
59
+
60
+ process.stdout.write(JSON.stringify({
61
+ ok: true,
62
+ input_file: inputPath,
63
+ result_package_ref: reviewSummary.result_package_ref,
64
+ review_ref: reviewSummary.review_ref,
65
+ run_ready: reviewSummary.run_ready,
66
+ next_surface: reviewSummary.next_surface,
67
+ proof_bundle_version: runResult.proof_bundle.proof_bundle_version,
68
+ bundle_valid: runResult.bundle_verification.valid
69
+ }, null, 2));
70
+ }
71
+
72
+ main();
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+
3
+ const packageJson = require("../package.json");
4
+ const proofSdk = require("../proof_sdk");
5
+
6
+ function classifyBridgeCoverageState(bridgeSummary) {
7
+ if (bridgeSummary.capability_count >= 8 && bridgeSummary.profile_count >= 3) return "broad";
8
+ if (bridgeSummary.capability_count >= 4 && bridgeSummary.profile_count >= 2) return "working";
9
+ return "thin";
10
+ }
11
+
12
+ function classifyCompatibilityStrengthState(compatibilityPack) {
13
+ const preservedRouteCount = Array.isArray(compatibilityPack.preserved_routes)
14
+ ? compatibilityPack.preserved_routes.length
15
+ : 0;
16
+ const preservedHelperCount = Array.isArray(compatibilityPack.preserved_helpers)
17
+ ? compatibilityPack.preserved_helpers.length
18
+ : 0;
19
+ if (preservedRouteCount >= 5 && preservedHelperCount >= 8) return "strong";
20
+ if (preservedRouteCount >= 3 && preservedHelperCount >= 5) return "working";
21
+ return "thin";
22
+ }
23
+
24
+ function classifyHandoffDependencyState(operatorReviewPack, handoffCenterSummary) {
25
+ const includedSectionCount = Array.isArray(operatorReviewPack.included_sections)
26
+ ? operatorReviewPack.included_sections.length
27
+ : 0;
28
+ if (includedSectionCount >= 6 && handoffCenterSummary.source_ref_count >= 3) return "strong";
29
+ if (includedSectionCount >= 4 && handoffCenterSummary.source_ref_count >= 2) return "working";
30
+ return "thin";
31
+ }
32
+
33
+ function buildBridgeIntelligencePack(input) {
34
+ const payload = input && typeof input === "object" && !Array.isArray(input) ? input : {};
35
+ const bridgeSummary = proofSdk.summarizeBridgeCenter();
36
+ const compatibilityPack = proofSdk.buildBridgeCompatibilityPack(payload);
37
+ const operatorReviewPack = proofSdk.buildBridgeOperatorReviewPack(payload);
38
+ const handoffCenterSummary = proofSdk.summarizeInteractionResultPackageHandoffCenter();
39
+
40
+ const bridgeCoverageState = classifyBridgeCoverageState(bridgeSummary);
41
+ const compatibilityStrengthState = classifyCompatibilityStrengthState(compatibilityPack);
42
+ const handoffDependencyState = classifyHandoffDependencyState(operatorReviewPack, handoffCenterSummary);
43
+
44
+ let nextBestAction = "continue_bridge_review_motion";
45
+ if (bridgeCoverageState === "thin") {
46
+ nextBestAction = "strengthen_bridge_coverage";
47
+ } else if (compatibilityStrengthState === "thin") {
48
+ nextBestAction = "strengthen_compatibility_posture";
49
+ } else if (handoffDependencyState !== "strong") {
50
+ nextBestAction = "strengthen_bridge_handoff_continuity";
51
+ } else if (compatibilityStrengthState === "working" || handoffDependencyState === "working") {
52
+ nextBestAction = "inspect_bridge_operator_pack";
53
+ }
54
+
55
+ return {
56
+ ok: true,
57
+ product: packageJson.name,
58
+ category: "proof-bridge-intelligence-pack",
59
+ bridge_coverage_state: bridgeCoverageState,
60
+ compatibility_strength_state: compatibilityStrengthState,
61
+ handoff_dependency_state: handoffDependencyState,
62
+ recommended_bridge_motion: "bridge_operator_review_and_handoff_followthrough",
63
+ next_best_action: nextBestAction,
64
+ explanation_signals: {
65
+ bridge_capability_count: bridgeSummary.capability_count,
66
+ bridge_profile_count: bridgeSummary.profile_count,
67
+ compatibility_route_count: Array.isArray(compatibilityPack.preserved_routes) ? compatibilityPack.preserved_routes.length : 0,
68
+ compatibility_helper_count: Array.isArray(compatibilityPack.preserved_helpers) ? compatibilityPack.preserved_helpers.length : 0,
69
+ compatibility_profile_version_count: Array.isArray(compatibilityPack.profile_versions) ? compatibilityPack.profile_versions.length : 0,
70
+ operator_pack_section_count: Array.isArray(operatorReviewPack.included_sections) ? operatorReviewPack.included_sections.length : 0,
71
+ handoff_source_ref_count: handoffCenterSummary.source_ref_count,
72
+ handoff_mode_count: handoffCenterSummary.handoff_mode_count
73
+ },
74
+ linked_surfaces: {
75
+ bridge_summary_ref: "/v1/proof-center/bridge/summary",
76
+ bridge_operator_review_pack_ref: "/v1/proof-center/bridge/operator-review-pack",
77
+ bridge_compatibility_pack_ref: "/v1/proof-center/bridge/compatibility-pack",
78
+ bridge_workflow_pack_ref: "/v1/proof-center/bridge/workflow-pack",
79
+ result_package_handoff_summary_ref: "/v1/proof-center/result-package-handoff/summary",
80
+ result_package_handoff_run_ref: "/v1/proof-center/result-package-handoff/run"
81
+ }
82
+ };
83
+ }
84
+
85
+ function summarizeBridgeIntelligencePack(input) {
86
+ const pack = buildBridgeIntelligencePack(input);
87
+ return {
88
+ ok: true,
89
+ product: pack.product,
90
+ category: pack.category,
91
+ bridge_coverage_state: pack.bridge_coverage_state,
92
+ compatibility_strength_state: pack.compatibility_strength_state,
93
+ handoff_dependency_state: pack.handoff_dependency_state,
94
+ next_best_action: pack.next_best_action,
95
+ signal_count: Object.keys(pack.explanation_signals).length
96
+ };
97
+ }
98
+
99
+ module.exports = {
100
+ buildBridgeIntelligencePack,
101
+ summarizeBridgeIntelligencePack
102
+ };
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ const packageJson = require("../package.json");
4
+ const proofSdk = require("../proof_sdk");
5
+
6
+ function classifyEscalationReadinessState(adminView, disputesSummary) {
7
+ const escalationReadyCount = Number(adminView.oversight_summary?.escalation_ready_count || 0);
8
+ const openCaseCount = Number(disputesSummary.open_case_count || 0);
9
+ if (escalationReadyCount >= 1 && openCaseCount >= 2) return "active";
10
+ if (escalationReadyCount >= 1 || openCaseCount >= 1) return "watch";
11
+ return "quiet";
12
+ }
13
+
14
+ function classifySignoffMotionState(dashboard, signoffPack) {
15
+ const signoffReadyCount = Number(dashboard.queue_summary?.signoff_ready_count || 0);
16
+ if (signoffPack.signoff_status === "review_ready" && signoffReadyCount >= 1) return "review_ready";
17
+ if (signoffReadyCount >= 1) return "forming";
18
+ return "early";
19
+ }
20
+
21
+ function classifyHandoffContinuityState(handoffBundle) {
22
+ const includedSectionCount = Array.isArray(handoffBundle.included_sections)
23
+ ? handoffBundle.included_sections.length
24
+ : 0;
25
+ if (
26
+ includedSectionCount >= 4
27
+ && handoffBundle.review_summary_surface
28
+ && handoffBundle.handoff_run_surface
29
+ ) {
30
+ return "strong";
31
+ }
32
+ if (includedSectionCount >= 2) return "working";
33
+ return "thin";
34
+ }
35
+
36
+ function buildGovernanceIntelligencePack(input) {
37
+ const payload = input && typeof input === "object" && !Array.isArray(input) ? input : {};
38
+ const dashboard = proofSdk.summarizeGovernanceDashboard(payload);
39
+ const adminView = proofSdk.summarizeGovernanceAdminView(payload);
40
+ const disputesSummary = proofSdk.summarizeGovernanceDisputes(payload);
41
+ const signoffPack = proofSdk.buildGovernanceSignoffPack(payload);
42
+ const consolePack = proofSdk.buildGovernanceConsolePack(payload);
43
+ const handoffBundle = proofSdk.buildGovernanceHandoffBundle(payload);
44
+
45
+ const escalationReadinessState = classifyEscalationReadinessState(adminView, disputesSummary);
46
+ const signoffMotionState = classifySignoffMotionState(dashboard, signoffPack);
47
+ const handoffContinuityState = classifyHandoffContinuityState(handoffBundle);
48
+
49
+ let nextBestAction = "continue_governance_flow";
50
+ if (escalationReadinessState === "active") {
51
+ nextBestAction = "escalate_governance_attention";
52
+ } else if (signoffMotionState === "review_ready") {
53
+ nextBestAction = "advance_signoff_motion";
54
+ } else if (handoffContinuityState !== "strong") {
55
+ nextBestAction = "strengthen_handoff_continuity";
56
+ } else if (escalationReadinessState === "watch") {
57
+ nextBestAction = "inspect_governance_console";
58
+ }
59
+
60
+ return {
61
+ ok: true,
62
+ product: packageJson.name,
63
+ category: "proof-governance-intelligence-pack",
64
+ escalation_readiness_state: escalationReadinessState,
65
+ signoff_motion_state: signoffMotionState,
66
+ handoff_continuity_state: handoffContinuityState,
67
+ recommended_governance_motion: "governance_console_and_signoff_followthrough",
68
+ next_best_action: nextBestAction,
69
+ explanation_signals: {
70
+ review_count: Number(dashboard.queue_summary?.review_count || 0),
71
+ dispute_count: Number(dashboard.queue_summary?.dispute_count || 0),
72
+ signoff_ready_count: Number(dashboard.queue_summary?.signoff_ready_count || 0),
73
+ escalation_ready_count: Number(adminView.oversight_summary?.escalation_ready_count || 0),
74
+ oversight_queue_count: Number(adminView.oversight_summary?.queue_count || 0),
75
+ open_case_count: Number(disputesSummary.open_case_count || 0),
76
+ case_count: Number(disputesSummary.case_count || 0),
77
+ console_section_count: Array.isArray(consolePack.included_sections) ? consolePack.included_sections.length : 0,
78
+ handoff_section_count: Array.isArray(handoffBundle.included_sections) ? handoffBundle.included_sections.length : 0
79
+ },
80
+ linked_surfaces: {
81
+ governance_dashboard_ref: "/v1/proof-center/governance/dashboard",
82
+ governance_admin_view_ref: "/v1/proof-center/governance/admin-view",
83
+ governance_signoff_pack_ref: "/v1/proof-center/governance/signoff-pack",
84
+ governance_console_pack_ref: "/v1/proof-center/governance/console-pack",
85
+ governance_handoff_bundle_ref: "/v1/proof-center/governance/handoff-bundle",
86
+ governance_disputes_summary_ref: "/v1/proof-center/governance/disputes/summary"
87
+ }
88
+ };
89
+ }
90
+
91
+ function summarizeGovernanceIntelligencePack(input) {
92
+ const pack = buildGovernanceIntelligencePack(input);
93
+ return {
94
+ ok: true,
95
+ product: pack.product,
96
+ category: pack.category,
97
+ escalation_readiness_state: pack.escalation_readiness_state,
98
+ signoff_motion_state: pack.signoff_motion_state,
99
+ handoff_continuity_state: pack.handoff_continuity_state,
100
+ next_best_action: pack.next_best_action,
101
+ signal_count: Object.keys(pack.explanation_signals).length
102
+ };
103
+ }
104
+
105
+ module.exports = {
106
+ buildGovernanceIntelligencePack,
107
+ summarizeGovernanceIntelligencePack
108
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ const packageJson = require("../package.json");
4
+
5
+ function buildPhase10CloseoutPack() {
6
+ return {
7
+ ok: true,
8
+ product: packageJson.name,
9
+ category: "proof-phase-10-closeout-pack",
10
+ phase_ref: "phase_10",
11
+ posture: "closeout_plan",
12
+ current_decision: "ready_for_program_closeout",
13
+ blocking_actions: [],
14
+ action_steps: [
15
+ "confirm the current long-tail proof lane family is the intended final Phase 10 shape",
16
+ "record the terminal program closeout review",
17
+ "recheck phase-10 gate summary for zero unsatisfied conditions",
18
+ "advance only once phase-10 gate resolves to ready_for_program_closeout"
19
+ ],
20
+ completion_signals: [
21
+ "phase-10 completion shows no remaining focus",
22
+ "phase-10 decision record shows no pending records",
23
+ "phase-10 gate resolves to ready_for_program_closeout"
24
+ ]
25
+ };
26
+ }
27
+
28
+ function summarizePhase10CloseoutPack() {
29
+ const pack = buildPhase10CloseoutPack();
30
+ return {
31
+ ok: true,
32
+ product: pack.product,
33
+ category: pack.category,
34
+ phase_ref: pack.phase_ref,
35
+ blocking_action_count: pack.blocking_actions.length,
36
+ action_step_count: pack.action_steps.length,
37
+ completion_signal_count: pack.completion_signals.length,
38
+ current_decision: pack.current_decision
39
+ };
40
+ }
41
+
42
+ module.exports = {
43
+ buildPhase10CloseoutPack,
44
+ summarizePhase10CloseoutPack
45
+ };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ const packageJson = require("../package.json");
4
+
5
+ function buildPhase10CompletionPack() {
6
+ return {
7
+ ok: true,
8
+ product: packageJson.name,
9
+ category: "proof-phase-10-completion-pack",
10
+ phase_ref: "phase_10",
11
+ posture: "completion_review",
12
+ coverage: {
13
+ ecosystem_refs: ["demand_signal_adapters", "niche_extension_registry", "ecosystem_backlog_triage"],
14
+ lane_refs: [
15
+ "/v1/phases/phase-10/demand-signal-adapters/proof/summary",
16
+ "/v1/phases/phase-10/niche-extension-registry/proof/summary",
17
+ "/v1/phases/phase-10/ecosystem-backlog-triage/proof/summary"
18
+ ],
19
+ proof_modes: ["demand_signal_capture", "extension_registry_mapping", "backlog_triage"],
20
+ demand_modes: ["partner_signal_flow", "extension_fit_flow", "queue_handoff_flow"],
21
+ proof_artifacts: ["demand_signal_bundle", "extension_registry_bundle", "triage_queue_bundle"],
22
+ proof_surfaces: [
23
+ "/v1/proof-center/bridge/summary",
24
+ "/v1/release-center/summary",
25
+ "/v1/phases/phase-10/long-tail-continuity/summary"
26
+ ]
27
+ },
28
+ completion: {
29
+ checks: [
30
+ "broad Phase 10 long-tail ecosystem pack is public and inspectable",
31
+ "all current Phase 10 long-tail proof lanes are public and inspectable",
32
+ "extension posture is visible at phase level",
33
+ "long-tail continuity is explicit across the proof lane family",
34
+ "release-center summary reflects Phase 10 breadth and proof-lane coverage",
35
+ "Phase 10 closeout criteria are explicit before final program closeout"
36
+ ],
37
+ readiness_criteria: [
38
+ { ref: "criterion.phase_surface_public", label: "Phase 10 broad summary is live and inspectable", satisfied: true },
39
+ { ref: "criterion.long_tail_lane_coverage", label: "All current long-tail proof lanes are live and inspectable", satisfied: true },
40
+ { ref: "criterion.long_tail_continuity_visible", label: "Long-tail continuity is visible at phase level", satisfied: true },
41
+ { ref: "criterion.proof_surfaces_attached", label: "Proof surfaces remain attached to the long-tail family", satisfied: true },
42
+ { ref: "criterion.freeze_shape_confirmed", label: "The final Phase 10 long-tail lane shape is explicitly frozen", satisfied: true },
43
+ { ref: "criterion.program_closeout_reviewed", label: "A final program closeout review has been recorded", satisfied: true }
44
+ ],
45
+ ready_for_next_phase: false,
46
+ remaining_focus: []
47
+ }
48
+ };
49
+ }
50
+
51
+ function summarizePhase10CompletionPack() {
52
+ const pack = buildPhase10CompletionPack();
53
+ return {
54
+ ok: true,
55
+ product: pack.product,
56
+ category: pack.category,
57
+ phase_ref: pack.phase_ref,
58
+ ecosystem_count: pack.coverage.ecosystem_refs.length,
59
+ lane_count: pack.coverage.lane_refs.length,
60
+ proof_mode_count: pack.coverage.proof_modes.length,
61
+ demand_mode_count: pack.coverage.demand_modes.length,
62
+ proof_artifact_count: pack.coverage.proof_artifacts.length,
63
+ proof_surface_count: pack.coverage.proof_surfaces.length,
64
+ completion_check_count: pack.completion.checks.length,
65
+ readiness_criteria_count: pack.completion.readiness_criteria.length,
66
+ satisfied_criteria_count: pack.completion.readiness_criteria.filter((criterion) => criterion.satisfied === true).length,
67
+ unsatisfied_criteria_count: pack.completion.readiness_criteria.filter((criterion) => criterion.satisfied !== true).length,
68
+ remaining_focus_count: pack.completion.remaining_focus.length,
69
+ ready_for_next_phase: pack.completion.ready_for_next_phase
70
+ };
71
+ }
72
+
73
+ module.exports = {
74
+ buildPhase10CompletionPack,
75
+ summarizePhase10CompletionPack
76
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ const packageJson = require("../package.json");
4
+
5
+ function buildPhase10DecisionRecordPack() {
6
+ return {
7
+ ok: true,
8
+ product: packageJson.name,
9
+ category: "proof-phase-10-decision-record-pack",
10
+ phase_ref: "phase_10",
11
+ posture: "decision_record",
12
+ records: {
13
+ freeze_decision: {
14
+ status: "recorded",
15
+ description: "record the final long-tail proof lane shape as the frozen Phase 10 baseline"
16
+ },
17
+ program_closeout_review: {
18
+ status: "recorded",
19
+ description: "record the final review that authorizes terminal program closeout"
20
+ }
21
+ },
22
+ record_steps: [
23
+ "confirm the current long-tail proof lane family matches the intended final Phase 10 shape",
24
+ "record the freeze decision outcome",
25
+ "record the program closeout review outcome",
26
+ "recheck phase-10 gate summary for the remaining terminal blockers"
27
+ ],
28
+ outputs: [
29
+ "freeze decision status is recorded and inspectable",
30
+ "program closeout review status is recorded and inspectable",
31
+ "phase-10 terminal gate can be flipped deliberately"
32
+ ]
33
+ };
34
+ }
35
+
36
+ function summarizePhase10DecisionRecordPack() {
37
+ const pack = buildPhase10DecisionRecordPack();
38
+ return {
39
+ ok: true,
40
+ product: pack.product,
41
+ category: pack.category,
42
+ phase_ref: pack.phase_ref,
43
+ pending_record_count: Object.values(pack.records).filter((record) => record.status === "pending_record").length,
44
+ record_step_count: pack.record_steps.length,
45
+ output_count: pack.outputs.length,
46
+ freeze_decision_status: pack.records.freeze_decision.status,
47
+ program_closeout_review_status: pack.records.program_closeout_review.status
48
+ };
49
+ }
50
+
51
+ module.exports = {
52
+ buildPhase10DecisionRecordPack,
53
+ summarizePhase10DecisionRecordPack
54
+ };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ const packageJson = require("../package.json");
4
+
5
+ function buildPhase10DecisionResolutionPack() {
6
+ return {
7
+ ok: true,
8
+ product: packageJson.name,
9
+ category: "proof-phase-10-decision-resolution-pack",
10
+ phase_ref: "phase_10",
11
+ posture: "decision_resolution",
12
+ transitions: [
13
+ {
14
+ ref: "freeze_decision",
15
+ from: "pending_record",
16
+ to: "recorded"
17
+ },
18
+ {
19
+ ref: "program_closeout_review",
20
+ from: "pending_record",
21
+ to: "recorded"
22
+ }
23
+ ],
24
+ resolution_steps: [
25
+ "confirm the long-tail proof lane family is the intended final Phase 10 shape",
26
+ "record the freeze decision outcome",
27
+ "record the terminal program closeout review outcome",
28
+ "recheck phase-10 completion and freeze-review summaries",
29
+ "confirm phase-10 gate resolves to ready_for_program_closeout"
30
+ ],
31
+ target_gate_decision: "ready_for_program_closeout",
32
+ target_ready_for_next_phase: false
33
+ };
34
+ }
35
+
36
+ function summarizePhase10DecisionResolutionPack() {
37
+ const pack = buildPhase10DecisionResolutionPack();
38
+ return {
39
+ ok: true,
40
+ product: pack.product,
41
+ category: pack.category,
42
+ phase_ref: pack.phase_ref,
43
+ transition_count: pack.transitions.length,
44
+ resolution_step_count: pack.resolution_steps.length,
45
+ target_gate_decision: pack.target_gate_decision,
46
+ target_ready_for_next_phase: pack.target_ready_for_next_phase
47
+ };
48
+ }
49
+
50
+ module.exports = {
51
+ buildPhase10DecisionResolutionPack,
52
+ summarizePhase10DecisionResolutionPack
53
+ };