xoonya 3.1.16 → 3.2.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 (240) hide show
  1. package/README.md +97 -74
  2. package/RELEASE_NOTES.md +7 -1
  3. package/START_HERE.md +38 -134
  4. package/bin/xoonya-first-run.js +22 -10
  5. package/bin/xoonya.js +61 -29
  6. package/lib/native_verify.js +1918 -0
  7. package/package.json +19 -42
  8. package/scripts/verify_release_candidate.js +243 -116
  9. package/scripts/verify_vectors.js +351 -104
  10. package/verify.js +95 -0
  11. package/.env.example +0 -10
  12. package/CARRIED_HANDOFF_DEMO.md +0 -60
  13. package/COMPATIBILITY_NOTE.md +0 -27
  14. package/CROSS_RUNTIME_POSTURE.md +0 -77
  15. package/EXAMPLE_PATHS.md +0 -53
  16. package/FINAL_CONTRACT.md +0 -445
  17. package/PARTNER_READY_PATH.md +0 -67
  18. package/PUBLIC_DEMO_SCRIPT.md +0 -79
  19. package/SERVICE_CONTRACT.md +0 -207
  20. package/TERMINOLOGY.md +0 -55
  21. package/WHY_XYTARA_XOONYA.md +0 -43
  22. package/XNYA_CONFORMANCE_MARK.md +0 -78
  23. package/XNYA_REFERENCE_IMPLEMENTATIONS.md +0 -157
  24. package/XOONYA_DEFAULT_PATH_MODEL.md +0 -63
  25. package/XOONYA_FOLLOWTHROUGH_TRUTH_MODEL.md +0 -63
  26. package/XOONYA_NATIVE_ATOM_SPEC.md +0 -184
  27. package/XOONYA_NATIVE_PROOF_FORMAT.md +0 -570
  28. package/XOONYA_NATIVE_STANDARD_GOVERNANCE.md +0 -119
  29. package/XOONYA_PROOF_TRUTH_MODEL.md +0 -58
  30. package/bin/xoonya-release.js +0 -1367
  31. package/bin/xoonya-review.js +0 -70
  32. package/examples/integration_boundary_walkthrough.js +0 -37
  33. package/examples/package_quickstart.js +0 -1007
  34. package/examples/partner_proof_walkthrough.js +0 -68
  35. package/examples/proof_review_walkthrough.js +0 -66
  36. package/examples/review_carried_handoff.js +0 -72
  37. package/index.js +0 -31
  38. package/integrations/PROOF_INTEGRATION_PROCESS.md +0 -45
  39. package/integrations/examples/example-third-party-verifier-registration.record.json +0 -22
  40. package/integrations/registration-record.schema.json +0 -99
  41. package/integrations/registry-snapshot.schema.json +0 -36
  42. package/integrations/registry.js +0 -636
  43. package/integrations/views.js +0 -36
  44. package/lib/adapter_certification_contract.js +0 -90
  45. package/lib/announcement_pack.js +0 -61
  46. package/lib/artifact_distribution_lane_contract.js +0 -54
  47. package/lib/asyncapi_contract.js +0 -135
  48. package/lib/auth_interop_contract.js +0 -69
  49. package/lib/authority_binding_lifecycle_contract.js +0 -182
  50. package/lib/bridge_intelligence.js +0 -102
  51. package/lib/cloudevents_contract.js +0 -79
  52. package/lib/crypto_agility_matrix.js +0 -131
  53. package/lib/default_path_contract.js +0 -380
  54. package/lib/ecosystem_entry.js +0 -64
  55. package/lib/erc8004_proof_lane_contract.js +0 -64
  56. package/lib/event_system_lane_contract.js +0 -76
  57. package/lib/external_proof_import_lane_contract.js +0 -87
  58. package/lib/feature_control_lane_contract.js +0 -54
  59. package/lib/followthrough_truth_contract.js +0 -214
  60. package/lib/framework_lane_contract.js +0 -76
  61. package/lib/governance_disputes_summary.js +0 -36
  62. package/lib/governance_intelligence.js +0 -108
  63. package/lib/identity_interop_contract.js +0 -83
  64. package/lib/integration_matrix_contract.js +0 -81
  65. package/lib/launch_narrative.js +0 -53
  66. package/lib/machine_identity_registry_contract.js +0 -199
  67. package/lib/major_rails_proof_lane_contract.js +0 -87
  68. package/lib/offline_verifiability_recovery_contract.js +0 -155
  69. package/lib/openapi_contract.js +0 -227
  70. package/lib/operational_receipt_contract.js +0 -165
  71. package/lib/outreach_proof.js +0 -71
  72. package/lib/phase_10_closeout_pack.js +0 -45
  73. package/lib/phase_10_completion_pack.js +0 -76
  74. package/lib/phase_10_decision_record_pack.js +0 -54
  75. package/lib/phase_10_decision_resolution_pack.js +0 -53
  76. package/lib/phase_10_demand_signal_adapters_proof_pack.js +0 -74
  77. package/lib/phase_10_ecosystem_backlog_triage_proof_pack.js +0 -74
  78. package/lib/phase_10_freeze_baseline_pack.js +0 -67
  79. package/lib/phase_10_freeze_review_pack.js +0 -64
  80. package/lib/phase_10_gate_pack.js +0 -57
  81. package/lib/phase_10_long_tail_continuity_pack.js +0 -80
  82. package/lib/phase_10_long_tail_ecosystem_pack.js +0 -68
  83. package/lib/phase_10_niche_extension_registry_proof_pack.js +0 -74
  84. package/lib/phase_1_claude_mcp_pack.js +0 -60
  85. package/lib/phase_1_claude_mcp_proof_pack.js +0 -57
  86. package/lib/phase_1_ecosystem_pack.js +0 -51
  87. package/lib/phase_1_openai_codex_pack.js +0 -60
  88. package/lib/phase_1_openai_codex_proof_pack.js +0 -57
  89. package/lib/phase_2_base_proof_pack.js +0 -71
  90. package/lib/phase_2_base_usdc_proof_pack.js +0 -72
  91. package/lib/phase_2_closeout_pack.js +0 -65
  92. package/lib/phase_2_completion_pack.js +0 -113
  93. package/lib/phase_2_decision_record_pack.js +0 -66
  94. package/lib/phase_2_decision_resolution_pack.js +0 -69
  95. package/lib/phase_2_eth_proof_pack.js +0 -70
  96. package/lib/phase_2_evm_base_proof_pack.js +0 -73
  97. package/lib/phase_2_evm_proof_pack.js +0 -71
  98. package/lib/phase_2_flip_preview_pack.js +0 -60
  99. package/lib/phase_2_freeze_review_pack.js +0 -99
  100. package/lib/phase_2_gate_pack.js +0 -77
  101. package/lib/phase_2_payment_rails_pack.js +0 -71
  102. package/lib/phase_2_usdc_proof_pack.js +0 -71
  103. package/lib/phase_3_brc_proof_pack.js +0 -81
  104. package/lib/phase_3_bsv_teranode_proof_pack.js +0 -81
  105. package/lib/phase_3_closeout_pack.js +0 -62
  106. package/lib/phase_3_completion_pack.js +0 -92
  107. package/lib/phase_3_decision_record_pack.js +0 -64
  108. package/lib/phase_3_decision_resolution_pack.js +0 -69
  109. package/lib/phase_3_freeze_baseline_pack.js +0 -67
  110. package/lib/phase_3_freeze_review_pack.js +0 -80
  111. package/lib/phase_3_gate_pack.js +0 -76
  112. package/lib/phase_3_metanet_proof_pack.js +0 -81
  113. package/lib/phase_3_native_bsv_pack.js +0 -89
  114. package/lib/phase_3_native_continuity_pack.js +0 -82
  115. package/lib/phase_4_attestation_proof_pack.js +0 -75
  116. package/lib/phase_4_closeout_pack.js +0 -45
  117. package/lib/phase_4_completion_pack.js +0 -82
  118. package/lib/phase_4_decision_record_pack.js +0 -54
  119. package/lib/phase_4_decision_resolution_pack.js +0 -45
  120. package/lib/phase_4_erc8004_proof_pack.js +0 -76
  121. package/lib/phase_4_freeze_baseline_pack.js +0 -67
  122. package/lib/phase_4_freeze_review_pack.js +0 -68
  123. package/lib/phase_4_gate_pack.js +0 -58
  124. package/lib/phase_4_identity_registry_proof_pack.js +0 -75
  125. package/lib/phase_4_identity_trust_pack.js +0 -73
  126. package/lib/phase_4_trust_continuity_pack.js +0 -86
  127. package/lib/phase_5_antelope_proof_pack.js +0 -76
  128. package/lib/phase_5_closeout_pack.js +0 -44
  129. package/lib/phase_5_completion_pack.js +0 -82
  130. package/lib/phase_5_decision_record_pack.js +0 -54
  131. package/lib/phase_5_decision_resolution_pack.js +0 -45
  132. package/lib/phase_5_freeze_baseline_pack.js +0 -67
  133. package/lib/phase_5_freeze_review_pack.js +0 -68
  134. package/lib/phase_5_gate_pack.js +0 -58
  135. package/lib/phase_5_major_rails_continuity_pack.js +0 -86
  136. package/lib/phase_5_major_rails_pack.js +0 -74
  137. package/lib/phase_5_proton_xpr_proof_pack.js +0 -76
  138. package/lib/phase_5_solana_proof_pack.js +0 -76
  139. package/lib/phase_6_autogen_proof_pack.js +0 -74
  140. package/lib/phase_6_closeout_pack.js +0 -46
  141. package/lib/phase_6_completion_pack.js +0 -77
  142. package/lib/phase_6_decision_record_pack.js +0 -54
  143. package/lib/phase_6_decision_resolution_pack.js +0 -53
  144. package/lib/phase_6_framework_continuity_pack.js +0 -81
  145. package/lib/phase_6_framework_runtime_pack.js +0 -68
  146. package/lib/phase_6_freeze_baseline_pack.js +0 -68
  147. package/lib/phase_6_freeze_review_pack.js +0 -65
  148. package/lib/phase_6_gate_pack.js +0 -59
  149. package/lib/phase_6_langchain_proof_pack.js +0 -74
  150. package/lib/phase_6_langgraph_proof_pack.js +0 -74
  151. package/lib/phase_6_semantic_kernel_proof_pack.js +0 -74
  152. package/lib/phase_7_closeout_pack.js +0 -45
  153. package/lib/phase_7_completion_pack.js +0 -85
  154. package/lib/phase_7_decision_record_pack.js +0 -53
  155. package/lib/phase_7_decision_resolution_pack.js +0 -53
  156. package/lib/phase_7_event_system_continuity_pack.js +0 -89
  157. package/lib/phase_7_event_system_pack.js +0 -76
  158. package/lib/phase_7_freeze_baseline_pack.js +0 -74
  159. package/lib/phase_7_freeze_review_pack.js +0 -65
  160. package/lib/phase_7_gate_pack.js +0 -58
  161. package/lib/phase_7_kafka_proof_pack.js +0 -76
  162. package/lib/phase_7_mqtt_proof_pack.js +0 -76
  163. package/lib/phase_7_nats_proof_pack.js +0 -76
  164. package/lib/phase_7_webhook_event_bus_proof_pack.js +0 -76
  165. package/lib/phase_8_closeout_pack.js +0 -46
  166. package/lib/phase_8_completion_pack.js +0 -82
  167. package/lib/phase_8_decision_record_pack.js +0 -54
  168. package/lib/phase_8_decision_resolution_pack.js +0 -53
  169. package/lib/phase_8_external_receipt_import_proof_pack.js +0 -74
  170. package/lib/phase_8_external_result_import_proof_pack.js +0 -74
  171. package/lib/phase_8_freeze_baseline_pack.js +0 -71
  172. package/lib/phase_8_freeze_review_pack.js +0 -64
  173. package/lib/phase_8_gate_pack.js +0 -58
  174. package/lib/phase_8_proof_bridge_continuity_pack.js +0 -86
  175. package/lib/phase_8_proof_bridges_pack.js +0 -72
  176. package/lib/phase_8_proof_bundle_normalization_proof_pack.js +0 -74
  177. package/lib/phase_9_closeout_pack.js +0 -46
  178. package/lib/phase_9_completion_pack.js +0 -82
  179. package/lib/phase_9_custody_refs_proof_pack.js +0 -74
  180. package/lib/phase_9_decision_record_pack.js +0 -54
  181. package/lib/phase_9_decision_resolution_pack.js +0 -53
  182. package/lib/phase_9_freeze_baseline_pack.js +0 -71
  183. package/lib/phase_9_freeze_review_pack.js +0 -64
  184. package/lib/phase_9_gate_pack.js +0 -58
  185. package/lib/phase_9_operator_accounting_bridges_proof_pack.js +0 -74
  186. package/lib/phase_9_treasury_connectivity_pack.js +0 -72
  187. package/lib/phase_9_treasury_continuity_pack.js +0 -86
  188. package/lib/phase_9_treasury_destinations_proof_pack.js +0 -74
  189. package/lib/phase_program_pack.js +0 -47
  190. package/lib/proof_bridge_lane_contract.js +0 -82
  191. package/lib/proof_truth_contract.js +0 -224
  192. package/lib/provenance_lane_contract.js +0 -54
  193. package/lib/provider_lane_contract.js +0 -67
  194. package/lib/public_surface_policy_contract.js +0 -111
  195. package/lib/publish_plan.js +0 -51
  196. package/lib/release_candidate.js +0 -50
  197. package/lib/release_center.js +0 -1037
  198. package/lib/release_history.js +0 -206
  199. package/lib/release_manifest.js +0 -114
  200. package/lib/release_pack.js +0 -391
  201. package/lib/result_package_trust_lane_contract.js +0 -74
  202. package/lib/review_intelligence.js +0 -100
  203. package/lib/role_freeze.js +0 -436
  204. package/lib/shared_signals_lane_contract.js +0 -54
  205. package/lib/signed_audit_provenance_contract.js +0 -93
  206. package/lib/telemetry_lane_contract.js +0 -54
  207. package/lib/treasury_proof_lane_contract.js +0 -83
  208. package/lib/trust_intelligence.js +0 -106
  209. package/lib/trust_portability_boundary_contract.js +0 -66
  210. package/lib/trust_portability_pack.js +0 -224
  211. package/lib/verification_service_pack.js +0 -149
  212. package/proof_sdk.js +0 -6692
  213. package/reference/python/README.md +0 -35
  214. package/reference/python/requirements-optional.txt +0 -1
  215. package/reference/python/verify_vectors.py +0 -223
  216. package/reference/python/xnya_reference.py +0 -810
  217. package/reference/rust/Cargo.toml +0 -11
  218. package/reference/rust/README.md +0 -28
  219. package/reference/rust/src/lib.rs +0 -87
  220. package/scripts/registry_cli.js +0 -157
  221. package/scripts/verify_all.js +0 -603
  222. package/scripts/verify_control_plane_contracts.js +0 -34
  223. package/scripts/verify_control_plane_routes.js +0 -70
  224. package/scripts/verify_examples.js +0 -19
  225. package/scripts/verify_external_proof_import_gate.js +0 -84
  226. package/scripts/verify_external_proof_signature.js +0 -142
  227. package/scripts/verify_forgery_resistance.js +0 -281
  228. package/scripts/verify_integrations.js +0 -170
  229. package/scripts/verify_native_hybrid_design_gate.js +0 -114
  230. package/scripts/verify_paid_execute.js +0 -133
  231. package/scripts/verify_paywall_flag.js +0 -86
  232. package/scripts/verify_reference_promotion_gate.js +0 -74
  233. package/scripts/verify_reference_python.js +0 -49
  234. package/scripts/verify_reference_python_crypto.js +0 -87
  235. package/scripts/verify_reference_rust_scaffold.js +0 -50
  236. package/scripts/verify_service.js +0 -3038
  237. package/scripts/verify_tooling.js +0 -1251
  238. package/scripts/verify_trust_portability.js +0 -56
  239. package/scripts/verify_verification_services.js +0 -56
  240. package/server.js +0 -4430
package/server.js DELETED
@@ -1,4430 +0,0 @@
1
- const http = require('http');
2
- const crypto = require('crypto');
3
- const { URL } = require('url');
4
- const proofSdk = require('./index.js');
5
- const {
6
- getIntegration,
7
- listIntegrations,
8
- exportIntegrationRegistrySnapshot,
9
- summarizeIntegrationPromotionWorkflow,
10
- summarizeIntegrationPromotionWorkflowList,
11
- summarizeIntegrationPromotionReadiness,
12
- summarizeIntegrations
13
- } = require('./integrations/registry');
14
- const {
15
- buildIntegrationDetailResponse,
16
- buildIntegrationListResponse
17
- } = require('./integrations/views');
18
- const {
19
- buildReleasePack,
20
- summarizeReleasePack,
21
- buildComparisonPack,
22
- summarizeComparisonPack,
23
- buildAdoptionPack,
24
- summarizeAdoptionPack,
25
- buildScenarioPack,
26
- summarizeScenarioPack,
27
- buildLaunchPack,
28
- summarizeLaunchPack
29
- } = require('./lib/release_pack');
30
- const {
31
- buildReleaseManifest,
32
- summarizeReleaseManifest,
33
- buildLaunchNotes,
34
- summarizeLaunchNotes
35
- } = require('./lib/release_manifest');
36
- const {
37
- buildReleaseCenter,
38
- summarizeReleaseCenter
39
- } = require('./lib/release_center');
40
- const {
41
- buildReleaseHistory,
42
- summarizeReleaseHistory
43
- } = require('./lib/release_history');
44
- const {
45
- buildPublishPlan,
46
- summarizePublishPlan
47
- } = require('./lib/publish_plan');
48
- const {
49
- buildEcosystemEntryPack,
50
- summarizeEcosystemEntryPack
51
- } = require('./lib/ecosystem_entry');
52
- const {
53
- buildLaunchNarrativePack,
54
- summarizeLaunchNarrativePack
55
- } = require('./lib/launch_narrative');
56
- const {
57
- buildOutreachProofPack,
58
- summarizeOutreachProofPack
59
- } = require('./lib/outreach_proof');
60
- const {
61
- buildAnnouncementPack,
62
- summarizeAnnouncementPack
63
- } = require('./lib/announcement_pack');
64
- const {
65
- buildTrustIntelligencePack,
66
- summarizeTrustIntelligencePack
67
- } = require('./lib/trust_intelligence');
68
- const {
69
- buildReviewIntelligencePack,
70
- summarizeReviewIntelligencePack
71
- } = require('./lib/review_intelligence');
72
- const {
73
- buildGovernanceIntelligencePack,
74
- summarizeGovernanceIntelligencePack
75
- } = require('./lib/governance_intelligence');
76
- const {
77
- buildBridgeIntelligencePack,
78
- summarizeBridgeIntelligencePack
79
- } = require('./lib/bridge_intelligence');
80
- const {
81
- buildVerificationServicesPack,
82
- summarizeVerificationServicesPack
83
- } = require('./lib/verification_service_pack');
84
- const {
85
- buildTrustPortabilityPack,
86
- getTrustPortabilityProfile,
87
- summarizeTrustPortabilityPack
88
- } = require('./lib/trust_portability_pack');
89
- const {
90
- buildAdapterCertificationContractPack,
91
- summarizeAdapterCertificationContractPack,
92
- getAdapterCertificationFrontDetail
93
- } = require('./lib/adapter_certification_contract');
94
- const {
95
- buildTrustPortabilityBoundaryContractPack,
96
- summarizeTrustPortabilityBoundaryContractPack,
97
- getTrustPortabilityAxisDetail
98
- } = require('./lib/trust_portability_boundary_contract');
99
- const {
100
- buildSignedAuditProvenanceContractPack,
101
- summarizeSignedAuditProvenanceContractPack,
102
- getSignedAuditProvenanceSurfaceDetail
103
- } = require('./lib/signed_audit_provenance_contract');
104
- const {
105
- buildProofTruthModelPack,
106
- summarizeProofTruthModelPack,
107
- getProofTruthObjectDetail
108
- } = require('./lib/proof_truth_contract');
109
- const {
110
- buildDefaultPathPack,
111
- summarizeDefaultPathPack,
112
- getDefaultPathSurfaceDetail
113
- } = require('./lib/default_path_contract');
114
- const {
115
- buildFollowthroughTruthPack,
116
- summarizeFollowthroughTruthPack,
117
- getFollowthroughTruthProfileDetail
118
- } = require('./lib/followthrough_truth_contract');
119
- const {
120
- buildOpenApiDocument,
121
- summarizeOpenApiDocument,
122
- } = require('./lib/openapi_contract');
123
- const {
124
- buildAsyncApiDocument,
125
- summarizeAsyncApiDocument,
126
- } = require('./lib/asyncapi_contract');
127
- const {
128
- buildCloudEventsContract,
129
- summarizeCloudEventsContract,
130
- } = require('./lib/cloudevents_contract');
131
- const {
132
- buildAuthInteropContract,
133
- summarizeAuthInteropContract,
134
- } = require('./lib/auth_interop_contract');
135
- const {
136
- buildIdentityInteropContract,
137
- summarizeIdentityInteropContract,
138
- } = require('./lib/identity_interop_contract');
139
- const {
140
- buildProviderLanePack,
141
- summarizeProviderLanePack,
142
- } = require('./lib/provider_lane_contract');
143
- const {
144
- buildFrameworkLanePack,
145
- summarizeFrameworkLanePack,
146
- } = require('./lib/framework_lane_contract');
147
- const {
148
- buildIntegrationMatrixPack,
149
- summarizeIntegrationMatrixPack,
150
- } = require('./lib/integration_matrix_contract');
151
- const {
152
- buildMajorRailsProofLanePack,
153
- summarizeMajorRailsProofLanePack,
154
- } = require('./lib/major_rails_proof_lane_contract');
155
- const {
156
- buildTreasuryProofLanePack,
157
- summarizeTreasuryProofLanePack,
158
- } = require('./lib/treasury_proof_lane_contract');
159
- const {
160
- buildErc8004ProofLanePack,
161
- summarizeErc8004ProofLanePack,
162
- } = require('./lib/erc8004_proof_lane_contract');
163
- const {
164
- buildProofBridgeLanePack,
165
- summarizeProofBridgeLanePack,
166
- } = require('./lib/proof_bridge_lane_contract');
167
- const {
168
- buildExternalProofImportLanePack,
169
- summarizeExternalProofImportLanePack,
170
- } = require('./lib/external_proof_import_lane_contract');
171
- const {
172
- buildResultPackageTrustLanePack,
173
- summarizeResultPackageTrustLanePack,
174
- } = require('./lib/result_package_trust_lane_contract');
175
- const {
176
- buildEventSystemLanePack,
177
- summarizeEventSystemLanePack,
178
- } = require('./lib/event_system_lane_contract');
179
- const {
180
- buildTelemetryLanePack,
181
- summarizeTelemetryLanePack,
182
- } = require('./lib/telemetry_lane_contract');
183
- const {
184
- buildProvenanceLanePack,
185
- summarizeProvenanceLanePack,
186
- } = require('./lib/provenance_lane_contract');
187
- const {
188
- buildArtifactDistributionLanePack,
189
- summarizeArtifactDistributionLanePack,
190
- } = require('./lib/artifact_distribution_lane_contract');
191
- const {
192
- buildSharedSignalsLanePack,
193
- summarizeSharedSignalsLanePack,
194
- } = require('./lib/shared_signals_lane_contract');
195
- const {
196
- buildFeatureControlLanePack,
197
- summarizeFeatureControlLanePack,
198
- } = require('./lib/feature_control_lane_contract');
199
- const {
200
- buildRoleFreezePack,
201
- summarizeRoleFreezePack,
202
- buildRoleFreezeOperatorBundle,
203
- summarizeRoleFreezeOperatorBundle,
204
- buildRoleFreezePolicyPack,
205
- summarizeRoleFreezePolicyPack,
206
- buildRoleFreezePolicyApplicationSummary,
207
- buildRoleFreezePackage,
208
- summarizeRoleFreezePackage,
209
- buildRoleTransitionPack,
210
- summarizeRoleTransitionPack,
211
- buildCapabilityRegistryHomePack,
212
- summarizeCapabilityRegistryHomePack
213
- } = require('./lib/role_freeze');
214
- const {
215
- buildReleaseCandidatePack,
216
- summarizeReleaseCandidatePack
217
- } = require('./lib/release_candidate');
218
- const {
219
- buildPhaseProgramPack,
220
- summarizePhaseProgramPack
221
- } = require('./lib/phase_program_pack');
222
- const {
223
- buildPhase1EcosystemPack,
224
- summarizePhase1EcosystemPack
225
- } = require('./lib/phase_1_ecosystem_pack');
226
- const {
227
- buildPhase1OpenaiCodexPack,
228
- summarizePhase1OpenaiCodexPack
229
- } = require('./lib/phase_1_openai_codex_pack');
230
- const {
231
- buildPhase1ClaudeMcpPack,
232
- summarizePhase1ClaudeMcpPack
233
- } = require('./lib/phase_1_claude_mcp_pack');
234
- const {
235
- buildPhase1OpenaiCodexProofPack,
236
- summarizePhase1OpenaiCodexProofPack
237
- } = require('./lib/phase_1_openai_codex_proof_pack');
238
- const {
239
- buildPhase1ClaudeMcpProofPack,
240
- summarizePhase1ClaudeMcpProofPack
241
- } = require('./lib/phase_1_claude_mcp_proof_pack');
242
- const {
243
- buildPhase2PaymentRailsPack,
244
- summarizePhase2PaymentRailsPack
245
- } = require('./lib/phase_2_payment_rails_pack');
246
- const {
247
- buildPhase2EvmBaseProofPack,
248
- summarizePhase2EvmBaseProofPack
249
- } = require('./lib/phase_2_evm_base_proof_pack');
250
- const {
251
- buildPhase2BaseUsdcProofPack,
252
- summarizePhase2BaseUsdcProofPack
253
- } = require('./lib/phase_2_base_usdc_proof_pack');
254
- const {
255
- buildPhase2EthProofPack,
256
- summarizePhase2EthProofPack
257
- } = require('./lib/phase_2_eth_proof_pack');
258
- const {
259
- buildPhase2EvmProofPack,
260
- summarizePhase2EvmProofPack
261
- } = require('./lib/phase_2_evm_proof_pack');
262
- const {
263
- buildPhase2BaseProofPack,
264
- summarizePhase2BaseProofPack
265
- } = require('./lib/phase_2_base_proof_pack');
266
- const {
267
- buildPhase2UsdcProofPack,
268
- summarizePhase2UsdcProofPack
269
- } = require('./lib/phase_2_usdc_proof_pack');
270
- const {
271
- buildPhase2CompletionPack,
272
- summarizePhase2CompletionPack
273
- } = require('./lib/phase_2_completion_pack');
274
- const {
275
- buildPhase2FreezeReviewPack,
276
- summarizePhase2FreezeReviewPack
277
- } = require('./lib/phase_2_freeze_review_pack');
278
- const {
279
- buildPhase2GatePack,
280
- summarizePhase2GatePack
281
- } = require('./lib/phase_2_gate_pack');
282
- const {
283
- buildPhase2CloseoutPack,
284
- summarizePhase2CloseoutPack
285
- } = require('./lib/phase_2_closeout_pack');
286
- const {
287
- buildPhase2DecisionRecordPack,
288
- summarizePhase2DecisionRecordPack
289
- } = require('./lib/phase_2_decision_record_pack');
290
- const {
291
- buildPhase2DecisionResolutionPack,
292
- summarizePhase2DecisionResolutionPack
293
- } = require('./lib/phase_2_decision_resolution_pack');
294
- const {
295
- buildPhase2FlipPreviewPack,
296
- summarizePhase2FlipPreviewPack
297
- } = require('./lib/phase_2_flip_preview_pack');
298
- const {
299
- buildPhase3NativeBsvPack,
300
- summarizePhase3NativeBsvPack
301
- } = require('./lib/phase_3_native_bsv_pack');
302
- const {
303
- buildPhase3BsvTeranodeProofPack,
304
- summarizePhase3BsvTeranodeProofPack
305
- } = require('./lib/phase_3_bsv_teranode_proof_pack');
306
- const {
307
- buildPhase3MetanetProofPack,
308
- summarizePhase3MetanetProofPack
309
- } = require('./lib/phase_3_metanet_proof_pack');
310
- const {
311
- buildPhase3BrcProofPack,
312
- summarizePhase3BrcProofPack
313
- } = require('./lib/phase_3_brc_proof_pack');
314
- const {
315
- buildPhase3NativeContinuityPack,
316
- summarizePhase3NativeContinuityPack
317
- } = require('./lib/phase_3_native_continuity_pack');
318
- const {
319
- buildPhase3FreezeBaselinePack,
320
- summarizePhase3FreezeBaselinePack
321
- } = require('./lib/phase_3_freeze_baseline_pack');
322
- const {
323
- buildPhase4IdentityTrustPack,
324
- summarizePhase4IdentityTrustPack
325
- } = require('./lib/phase_4_identity_trust_pack');
326
- const {
327
- buildPhase4Erc8004ProofPack,
328
- summarizePhase4Erc8004ProofPack
329
- } = require('./lib/phase_4_erc8004_proof_pack');
330
- const {
331
- buildPhase4IdentityRegistryProofPack,
332
- summarizePhase4IdentityRegistryProofPack
333
- } = require('./lib/phase_4_identity_registry_proof_pack');
334
- const {
335
- buildPhase4AttestationProofPack,
336
- summarizePhase4AttestationProofPack
337
- } = require('./lib/phase_4_attestation_proof_pack');
338
- const {
339
- buildPhase4TrustContinuityPack,
340
- summarizePhase4TrustContinuityPack
341
- } = require('./lib/phase_4_trust_continuity_pack');
342
- const {
343
- buildPhase4CompletionPack,
344
- summarizePhase4CompletionPack
345
- } = require('./lib/phase_4_completion_pack');
346
- const {
347
- buildPhase4FreezeReviewPack,
348
- summarizePhase4FreezeReviewPack
349
- } = require('./lib/phase_4_freeze_review_pack');
350
- const {
351
- buildPhase4FreezeBaselinePack,
352
- summarizePhase4FreezeBaselinePack
353
- } = require('./lib/phase_4_freeze_baseline_pack');
354
- const {
355
- buildPhase4GatePack,
356
- summarizePhase4GatePack
357
- } = require('./lib/phase_4_gate_pack');
358
- const {
359
- buildPhase4CloseoutPack,
360
- summarizePhase4CloseoutPack
361
- } = require('./lib/phase_4_closeout_pack');
362
- const {
363
- buildPhase4DecisionRecordPack,
364
- summarizePhase4DecisionRecordPack
365
- } = require('./lib/phase_4_decision_record_pack');
366
- const {
367
- buildPhase4DecisionResolutionPack,
368
- summarizePhase4DecisionResolutionPack
369
- } = require('./lib/phase_4_decision_resolution_pack');
370
- const {
371
- buildPhase5MajorRailsPack,
372
- summarizePhase5MajorRailsPack
373
- } = require('./lib/phase_5_major_rails_pack');
374
- const {
375
- buildPhase5MajorRailsContinuityPack,
376
- summarizePhase5MajorRailsContinuityPack
377
- } = require('./lib/phase_5_major_rails_continuity_pack');
378
- const {
379
- buildPhase5CompletionPack,
380
- summarizePhase5CompletionPack
381
- } = require('./lib/phase_5_completion_pack');
382
- const {
383
- buildPhase5FreezeReviewPack,
384
- summarizePhase5FreezeReviewPack
385
- } = require('./lib/phase_5_freeze_review_pack');
386
- const {
387
- buildPhase5FreezeBaselinePack,
388
- summarizePhase5FreezeBaselinePack
389
- } = require('./lib/phase_5_freeze_baseline_pack');
390
- const {
391
- buildPhase5GatePack,
392
- summarizePhase5GatePack
393
- } = require('./lib/phase_5_gate_pack');
394
- const {
395
- buildPhase5CloseoutPack,
396
- summarizePhase5CloseoutPack
397
- } = require('./lib/phase_5_closeout_pack');
398
- const {
399
- buildPhase5DecisionRecordPack,
400
- summarizePhase5DecisionRecordPack
401
- } = require('./lib/phase_5_decision_record_pack');
402
- const {
403
- buildPhase5DecisionResolutionPack,
404
- summarizePhase5DecisionResolutionPack
405
- } = require('./lib/phase_5_decision_resolution_pack');
406
- const {
407
- buildPhase5SolanaProofPack,
408
- summarizePhase5SolanaProofPack
409
- } = require('./lib/phase_5_solana_proof_pack');
410
- const {
411
- buildPhase5AntelopeProofPack,
412
- summarizePhase5AntelopeProofPack
413
- } = require('./lib/phase_5_antelope_proof_pack');
414
- const {
415
- buildPhase5ProtonXprProofPack,
416
- summarizePhase5ProtonXprProofPack
417
- } = require('./lib/phase_5_proton_xpr_proof_pack');
418
- const {
419
- buildPhase6FrameworkRuntimePack,
420
- summarizePhase6FrameworkRuntimePack
421
- } = require('./lib/phase_6_framework_runtime_pack');
422
- const {
423
- buildPhase6LanggraphProofPack,
424
- summarizePhase6LanggraphProofPack
425
- } = require('./lib/phase_6_langgraph_proof_pack');
426
- const {
427
- buildPhase6LangchainProofPack,
428
- summarizePhase6LangchainProofPack
429
- } = require('./lib/phase_6_langchain_proof_pack');
430
- const {
431
- buildPhase6AutogenProofPack,
432
- summarizePhase6AutogenProofPack
433
- } = require('./lib/phase_6_autogen_proof_pack');
434
- const {
435
- buildPhase6SemanticKernelProofPack,
436
- summarizePhase6SemanticKernelProofPack
437
- } = require('./lib/phase_6_semantic_kernel_proof_pack');
438
- const {
439
- buildPhase6FrameworkContinuityPack,
440
- summarizePhase6FrameworkContinuityPack
441
- } = require('./lib/phase_6_framework_continuity_pack');
442
- const {
443
- buildPhase6CompletionPack,
444
- summarizePhase6CompletionPack
445
- } = require('./lib/phase_6_completion_pack');
446
- const {
447
- buildPhase6FreezeReviewPack,
448
- summarizePhase6FreezeReviewPack
449
- } = require('./lib/phase_6_freeze_review_pack');
450
- const {
451
- buildPhase6FreezeBaselinePack,
452
- summarizePhase6FreezeBaselinePack
453
- } = require('./lib/phase_6_freeze_baseline_pack');
454
- const {
455
- buildPhase6GatePack,
456
- summarizePhase6GatePack
457
- } = require('./lib/phase_6_gate_pack');
458
- const {
459
- buildPhase6CloseoutPack,
460
- summarizePhase6CloseoutPack
461
- } = require('./lib/phase_6_closeout_pack');
462
- const {
463
- buildPhase6DecisionRecordPack,
464
- summarizePhase6DecisionRecordPack
465
- } = require('./lib/phase_6_decision_record_pack');
466
- const {
467
- buildPhase6DecisionResolutionPack,
468
- summarizePhase6DecisionResolutionPack
469
- } = require('./lib/phase_6_decision_resolution_pack');
470
- const {
471
- buildPhase7EventSystemPack,
472
- summarizePhase7EventSystemPack
473
- } = require('./lib/phase_7_event_system_pack');
474
- const {
475
- buildPhase7KafkaProofPack,
476
- summarizePhase7KafkaProofPack
477
- } = require('./lib/phase_7_kafka_proof_pack');
478
- const {
479
- buildPhase7NatsProofPack,
480
- summarizePhase7NatsProofPack
481
- } = require('./lib/phase_7_nats_proof_pack');
482
- const {
483
- buildPhase7MqttProofPack,
484
- summarizePhase7MqttProofPack
485
- } = require('./lib/phase_7_mqtt_proof_pack');
486
- const {
487
- buildPhase7WebhookEventBusProofPack,
488
- summarizePhase7WebhookEventBusProofPack
489
- } = require('./lib/phase_7_webhook_event_bus_proof_pack');
490
- const {
491
- buildPhase7EventSystemContinuityPack,
492
- summarizePhase7EventSystemContinuityPack
493
- } = require('./lib/phase_7_event_system_continuity_pack');
494
- const {
495
- buildPhase7CompletionPack,
496
- summarizePhase7CompletionPack
497
- } = require('./lib/phase_7_completion_pack');
498
- const {
499
- buildPhase7FreezeBaselinePack,
500
- summarizePhase7FreezeBaselinePack
501
- } = require('./lib/phase_7_freeze_baseline_pack');
502
- const {
503
- buildPhase7FreezeReviewPack,
504
- summarizePhase7FreezeReviewPack
505
- } = require('./lib/phase_7_freeze_review_pack');
506
- const {
507
- buildPhase7GatePack,
508
- summarizePhase7GatePack
509
- } = require('./lib/phase_7_gate_pack');
510
- const {
511
- buildPhase7CloseoutPack,
512
- summarizePhase7CloseoutPack
513
- } = require('./lib/phase_7_closeout_pack');
514
- const {
515
- buildPhase7DecisionRecordPack,
516
- summarizePhase7DecisionRecordPack
517
- } = require('./lib/phase_7_decision_record_pack');
518
- const {
519
- buildPhase7DecisionResolutionPack,
520
- summarizePhase7DecisionResolutionPack
521
- } = require('./lib/phase_7_decision_resolution_pack');
522
- const {
523
- buildPhase8ProofBridgesPack,
524
- summarizePhase8ProofBridgesPack
525
- } = require('./lib/phase_8_proof_bridges_pack');
526
- const {
527
- buildPhase8ProofBridgeContinuityPack,
528
- summarizePhase8ProofBridgeContinuityPack
529
- } = require('./lib/phase_8_proof_bridge_continuity_pack');
530
- const {
531
- buildPhase8CompletionPack,
532
- summarizePhase8CompletionPack
533
- } = require('./lib/phase_8_completion_pack');
534
- const {
535
- buildPhase8FreezeBaselinePack,
536
- summarizePhase8FreezeBaselinePack
537
- } = require('./lib/phase_8_freeze_baseline_pack');
538
- const {
539
- buildPhase8FreezeReviewPack,
540
- summarizePhase8FreezeReviewPack
541
- } = require('./lib/phase_8_freeze_review_pack');
542
- const {
543
- buildPhase8GatePack,
544
- summarizePhase8GatePack
545
- } = require('./lib/phase_8_gate_pack');
546
- const {
547
- buildPhase8CloseoutPack,
548
- summarizePhase8CloseoutPack
549
- } = require('./lib/phase_8_closeout_pack');
550
- const {
551
- buildPhase8DecisionRecordPack,
552
- summarizePhase8DecisionRecordPack
553
- } = require('./lib/phase_8_decision_record_pack');
554
- const {
555
- buildPhase8DecisionResolutionPack,
556
- summarizePhase8DecisionResolutionPack
557
- } = require('./lib/phase_8_decision_resolution_pack');
558
- const {
559
- buildPhase8ExternalResultImportProofPack,
560
- summarizePhase8ExternalResultImportProofPack
561
- } = require('./lib/phase_8_external_result_import_proof_pack');
562
- const {
563
- buildPhase8ExternalReceiptImportProofPack,
564
- summarizePhase8ExternalReceiptImportProofPack
565
- } = require('./lib/phase_8_external_receipt_import_proof_pack');
566
- const {
567
- buildPhase8ProofBundleNormalizationProofPack,
568
- summarizePhase8ProofBundleNormalizationProofPack
569
- } = require('./lib/phase_8_proof_bundle_normalization_proof_pack');
570
- const {
571
- buildPhase9TreasuryConnectivityPack,
572
- summarizePhase9TreasuryConnectivityPack
573
- } = require('./lib/phase_9_treasury_connectivity_pack');
574
- const {
575
- buildPhase9TreasuryContinuityPack,
576
- summarizePhase9TreasuryContinuityPack
577
- } = require('./lib/phase_9_treasury_continuity_pack');
578
- const {
579
- buildPhase9CompletionPack,
580
- summarizePhase9CompletionPack
581
- } = require('./lib/phase_9_completion_pack');
582
- const {
583
- buildPhase9FreezeBaselinePack,
584
- summarizePhase9FreezeBaselinePack
585
- } = require('./lib/phase_9_freeze_baseline_pack');
586
- const {
587
- buildPhase9FreezeReviewPack,
588
- summarizePhase9FreezeReviewPack
589
- } = require('./lib/phase_9_freeze_review_pack');
590
- const {
591
- buildPhase9GatePack,
592
- summarizePhase9GatePack
593
- } = require('./lib/phase_9_gate_pack');
594
- const {
595
- buildPhase9CloseoutPack,
596
- summarizePhase9CloseoutPack
597
- } = require('./lib/phase_9_closeout_pack');
598
- const {
599
- buildPhase9DecisionRecordPack,
600
- summarizePhase9DecisionRecordPack
601
- } = require('./lib/phase_9_decision_record_pack');
602
- const {
603
- buildPhase9DecisionResolutionPack,
604
- summarizePhase9DecisionResolutionPack
605
- } = require('./lib/phase_9_decision_resolution_pack');
606
- const {
607
- buildPhase9TreasuryDestinationsProofPack,
608
- summarizePhase9TreasuryDestinationsProofPack
609
- } = require('./lib/phase_9_treasury_destinations_proof_pack');
610
- const {
611
- buildPhase9CustodyRefsProofPack,
612
- summarizePhase9CustodyRefsProofPack
613
- } = require('./lib/phase_9_custody_refs_proof_pack');
614
- const {
615
- buildPhase9OperatorAccountingBridgesProofPack,
616
- summarizePhase9OperatorAccountingBridgesProofPack
617
- } = require('./lib/phase_9_operator_accounting_bridges_proof_pack');
618
- const {
619
- buildPhase10LongTailEcosystemPack,
620
- summarizePhase10LongTailEcosystemPack
621
- } = require('./lib/phase_10_long_tail_ecosystem_pack');
622
- const {
623
- buildPhase10LongTailContinuityPack,
624
- summarizePhase10LongTailContinuityPack
625
- } = require('./lib/phase_10_long_tail_continuity_pack');
626
- const {
627
- buildPhase10CompletionPack,
628
- summarizePhase10CompletionPack
629
- } = require('./lib/phase_10_completion_pack');
630
- const {
631
- buildPhase10FreezeReviewPack,
632
- summarizePhase10FreezeReviewPack
633
- } = require('./lib/phase_10_freeze_review_pack');
634
- const {
635
- buildPhase10FreezeBaselinePack,
636
- summarizePhase10FreezeBaselinePack
637
- } = require('./lib/phase_10_freeze_baseline_pack');
638
- const {
639
- buildPhase10GatePack,
640
- summarizePhase10GatePack
641
- } = require('./lib/phase_10_gate_pack');
642
- const {
643
- buildPhase10CloseoutPack,
644
- summarizePhase10CloseoutPack
645
- } = require('./lib/phase_10_closeout_pack');
646
- const {
647
- buildPhase10DecisionRecordPack,
648
- summarizePhase10DecisionRecordPack
649
- } = require('./lib/phase_10_decision_record_pack');
650
- const {
651
- buildPhase10DecisionResolutionPack,
652
- summarizePhase10DecisionResolutionPack
653
- } = require('./lib/phase_10_decision_resolution_pack');
654
- const {
655
- buildPhase10DemandSignalAdaptersProofPack,
656
- summarizePhase10DemandSignalAdaptersProofPack
657
- } = require('./lib/phase_10_demand_signal_adapters_proof_pack');
658
- const {
659
- buildPhase10NicheExtensionRegistryProofPack,
660
- summarizePhase10NicheExtensionRegistryProofPack
661
- } = require('./lib/phase_10_niche_extension_registry_proof_pack');
662
- const {
663
- buildPhase10EcosystemBacklogTriageProofPack,
664
- summarizePhase10EcosystemBacklogTriageProofPack
665
- } = require('./lib/phase_10_ecosystem_backlog_triage_proof_pack');
666
- const {
667
- buildPhase3CompletionPack,
668
- summarizePhase3CompletionPack
669
- } = require('./lib/phase_3_completion_pack');
670
- const {
671
- buildPhase3FreezeReviewPack,
672
- summarizePhase3FreezeReviewPack
673
- } = require('./lib/phase_3_freeze_review_pack');
674
- const {
675
- buildPhase3GatePack,
676
- summarizePhase3GatePack
677
- } = require('./lib/phase_3_gate_pack');
678
- const {
679
- buildPhase3CloseoutPack,
680
- summarizePhase3CloseoutPack
681
- } = require('./lib/phase_3_closeout_pack');
682
- const {
683
- buildPhase3DecisionRecordPack,
684
- summarizePhase3DecisionRecordPack
685
- } = require('./lib/phase_3_decision_record_pack');
686
- const {
687
- buildPhase3DecisionResolutionPack,
688
- summarizePhase3DecisionResolutionPack
689
- } = require('./lib/phase_3_decision_resolution_pack');
690
-
691
- const MAX_JSON_BODY_BYTES = 1024 * 1024;
692
- const REQUEST_TIMEOUT_MS = 30000;
693
- const HEADERS_TIMEOUT_MS = 15000;
694
- const PRIVATE_KEY_FIELD_PATTERN = /private_key/i;
695
- const PRIVATE_KEY_MATERIAL_ENV = 'XOONYA_ACCEPT_PRIVATE_KEY_MATERIAL';
696
-
697
- function readJsonBody(req) {
698
- return new Promise((resolve, reject) => {
699
- const declaredLength = Number(req.headers['content-length']);
700
- if (Number.isFinite(declaredLength) && declaredLength > MAX_JSON_BODY_BYTES) {
701
- reject(new Error('request body too large'));
702
- req.resume();
703
- return;
704
- }
705
- const chunks = [];
706
- let receivedBytes = 0;
707
- let settled = false;
708
- req.on('data', (chunk) => {
709
- if (settled) return;
710
- const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
711
- receivedBytes += buffer.length;
712
- if (receivedBytes > MAX_JSON_BODY_BYTES) {
713
- settled = true;
714
- reject(new Error('request body too large'));
715
- req.destroy();
716
- return;
717
- }
718
- chunks.push(buffer);
719
- });
720
- req.on('end', () => {
721
- if (settled) return;
722
- settled = true;
723
- if (receivedBytes === 0) {
724
- resolve({});
725
- return;
726
- }
727
- try {
728
- resolve(JSON.parse(Buffer.concat(chunks, receivedBytes).toString('utf8')));
729
- } catch (error) {
730
- reject(new Error('body must be valid JSON'));
731
- }
732
- });
733
- req.on('error', (error) => {
734
- if (settled) return;
735
- settled = true;
736
- reject(error);
737
- });
738
- });
739
- }
740
-
741
- function sendJson(res, statusCode, payload) {
742
- const json = JSON.stringify(payload);
743
- const method = res.req && res.req.method ? res.req.method : 'GET';
744
- const headers = {
745
- 'content-type': 'application/json; charset=utf-8',
746
- 'content-length': Buffer.byteLength(json),
747
- 'x-content-type-options': 'nosniff',
748
- };
749
- if (method !== 'GET' && method !== 'HEAD') {
750
- headers['cache-control'] = 'no-store';
751
- }
752
- res.writeHead(statusCode, headers);
753
- res.end(json);
754
- }
755
-
756
- function acceptsPrivateKeyMaterial() {
757
- const raw = String(process.env[PRIVATE_KEY_MATERIAL_ENV] || '').trim().toLowerCase();
758
- if (raw === 'false' || raw === '0' || raw === 'no') return false;
759
- if (raw === 'true' || raw === '1' || raw === 'yes') return true;
760
- return !process.env.RENDER;
761
- }
762
-
763
- function looksLikePrivateJwk(obj) {
764
- if (!obj || typeof obj !== 'object' || Array.isArray(obj)) return false;
765
- if (typeof obj.kty !== 'string') return false;
766
- return typeof obj.d === 'string' || typeof obj.p === 'string' || typeof obj.q === 'string';
767
- }
768
-
769
- function findPrivateKeyMaterialPath(value, trail = '', depth = 0) {
770
- if (depth > 16) return null;
771
- // PEM private key material embedded in a string value.
772
- if (typeof value === 'string') {
773
- return /BEGIN (EC |RSA |DSA |OPENSSH |PGP )?PRIVATE KEY/.test(value) ? (trail || '(root)') : null;
774
- }
775
- if (!value || typeof value !== 'object') return null;
776
- // A private JWK (has kty + d/p/q) — the field name is not "private_key".
777
- if (looksLikePrivateJwk(value)) return trail || '(root)';
778
- const entries = Array.isArray(value)
779
- ? value.map((item, index) => [String(index), item])
780
- : Object.entries(value);
781
- for (const [key, child] of entries) {
782
- const path = trail ? `${trail}.${key}` : key;
783
- if (!Array.isArray(value) && PRIVATE_KEY_FIELD_PATTERN.test(key)) return path;
784
- const nested = findPrivateKeyMaterialPath(child, path, depth + 1);
785
- if (nested) return nested;
786
- }
787
- return null;
788
- }
789
-
790
- function rejectPrivateKeyMaterial(res, body) {
791
- if (acceptsPrivateKeyMaterial()) return false;
792
- const fieldPath = findPrivateKeyMaterialPath(body);
793
- if (!fieldPath) return false;
794
- sendJson(res, 400, {
795
- ok: false,
796
- valid: false,
797
- reason: 'private_key_material_not_accepted',
798
- field: fieldPath,
799
- detail: 'This deployment does not accept private key material over HTTP. Sign locally with the xoonya SDK (emitReceipt / buildProofBundle) or the xoonya CLI and submit the signed receipt or bundle instead.',
800
- sdk_ref: 'npm:xoonya#emitReceipt',
801
- cli_ref: 'xoonya --help',
802
- policy_env: PRIVATE_KEY_MATERIAL_ENV,
803
- });
804
- return true;
805
- }
806
-
807
- // --- Paid execution backend -------------------------------------------------
808
- // xoonya's real proof-verification is exposed, pay-per-call, through the proven
809
- // xytara x402 commerce spine rather than a second money path: the xytara runtime
810
- // settles the x402 payment and then calls this bearer-authed /execute as an
811
- // external execution target (the same contract as the MCP executor's /execute),
812
- // so verify->execute->settle, the dedupe guard, and don't-charge-on-failure all
813
- // apply unchanged. This file adds NO payment code.
814
- const EXECUTOR_BEARER_ENV = 'XOONYA_EXECUTOR_BEARER_TOKEN';
815
-
816
- function timingSafeEqualString(a, b) {
817
- const ab = Buffer.from(String(a), 'utf8');
818
- const bb = Buffer.from(String(b), 'utf8');
819
- if (ab.length !== bb.length) return false;
820
- try {
821
- return crypto.timingSafeEqual(ab, bb);
822
- } catch (_) {
823
- return false;
824
- }
825
- }
826
-
827
- // Fail-closed bearer gate. The caller (xytara runtime) presents
828
- // Authorization: Bearer <XOONYA_EXECUTOR_BEARER_TOKEN>. When the token is unset the
829
- // backend stays closed (503, never runs unauthenticated); a missing/wrong token is 401.
830
- function authorizeExecutor(req) {
831
- const expected = String(process.env[EXECUTOR_BEARER_ENV] || '').trim();
832
- if (!expected) return { ok: false, status: 503, reason: 'executor_not_configured' };
833
- const header = String((req.headers && req.headers.authorization) || '');
834
- const match = /^Bearer\s+(.+)$/i.exec(header);
835
- const presented = match ? match[1].trim() : '';
836
- if (!presented || !timingSafeEqualString(presented, expected)) {
837
- return { ok: false, status: 401, reason: 'unauthorized' };
838
- }
839
- return { ok: true };
840
- }
841
-
842
- // Priced tools: each runs REAL cryptographic verification via the proof SDK and
843
- // returns its verdict object. The verdict (signature_valid / valid true|false) is a
844
- // genuine, billable result; a result the SDK marks ok:false, a thrown error, an
845
- // unknown tool, or rejected private-key material are caller-side failures surfaced as
846
- // non-2xx so the paid runtime never settles for a call that produced no verification.
847
- const EXECUTOR_TOOLS = {
848
- 'proof.verify-signature': (args) => proofSdk.verifyExternalProofSignature(args || {}),
849
- 'proof.verify-bundle': (args) => proofSdk.verifyProofBundle(
850
- args && args.bundle,
851
- args && args.options && typeof args.options === 'object' && !Array.isArray(args.options) ? args.options : {}
852
- ),
853
- 'proof.verify-envelope': (args) => proofSdk.verifyProofEnvelopeV1(args && args.envelope),
854
- 'proof.verify-receipt': (args) => proofSdk.verifyReceipt(String((args && args.opreturn_hex) || ''), payloadBufferFromBody(args || {}))
855
- };
856
-
857
- // Tools that accept caller-supplied key/material and must refuse private keys.
858
- const EXECUTOR_TOOLS_REJECT_PRIVATE_KEY = new Set(['proof.verify-signature', 'proof.verify-bundle']);
859
-
860
- function listExecutorTools() {
861
- return Object.keys(EXECUTOR_TOOLS);
862
- }
863
-
864
- // Optional paywall for the FREE direct verification routes. Default OFF — unset behaves
865
- // byte-for-byte as before (the routes stay free). When XOONYA_REQUIRE_PAID_VERIFICATION
866
- // is truthy, the direct crypto-verify routes that have a metered paid equivalent return
867
- // 402 pointing agents to the paid x402 lane (pay the xytara runtime for adapter.xoonya.invoke,
868
- // which routes here to /execute), so the free HTTP path cannot undercut the paid product.
869
- // Descriptor/summary GETs, import/review, profile verifies, /execute and /health stay free.
870
- const PAID_VERIFICATION_ENV = 'XOONYA_REQUIRE_PAID_VERIFICATION';
871
-
872
- function paidVerificationRequired() {
873
- const raw = String(process.env[PAID_VERIFICATION_ENV] || '').trim().toLowerCase();
874
- return raw === 'true' || raw === '1' || raw === 'yes' || raw === 'on';
875
- }
876
-
877
- function enforcePaidVerification(res, toolName) {
878
- if (!paidVerificationRequired()) return false;
879
- sendJson(res, 402, {
880
- ok: false,
881
- reason: 'direct_verification_paywalled',
882
- detail: 'free direct proof verification is disabled on this deployment; use the metered paid lane',
883
- paid_lane: {
884
- runtime: 'https://xytara.onrender.com/x402/commands/execute',
885
- task_ref: 'adapter.xoonya.invoke',
886
- tool_name: toolName || null,
887
- body_example: { command: 'xoonya proof verify', task_ref: 'adapter.xoonya.invoke', body: { tool_name: toolName || 'proof.verify-signature', arguments: {} } }
888
- }
889
- });
890
- return true;
891
- }
892
-
893
- function payloadBufferFromBody(body) {
894
- if (typeof body.payload_bytes_ascii === 'string') {
895
- return Buffer.from(body.payload_bytes_ascii, 'ascii');
896
- }
897
- if (typeof body.payload_base64 === 'string' && body.payload_base64.trim()) {
898
- return Buffer.from(body.payload_base64, 'base64');
899
- }
900
- if (typeof body.payload_utf8 === 'string') {
901
- return Buffer.from(body.payload_utf8, 'utf8');
902
- }
903
- return Buffer.alloc(0);
904
- }
905
-
906
- function canonicalEventFromBody(body) {
907
- return proofSdk.canonicalizeEvent(body.event || body.ceb);
908
- }
909
-
910
- async function routeRequest(req, res) {
911
- const url = new URL(req.url, 'http://127.0.0.1');
912
-
913
- if (req.method === 'OPTIONS') {
914
- res.writeHead(204, {
915
- allow: 'GET, HEAD, POST, OPTIONS',
916
- 'x-content-type-options': 'nosniff',
917
- 'cache-control': 'no-store',
918
- });
919
- res.end();
920
- return;
921
- }
922
- if (req.method === 'HEAD') {
923
- // Route HEAD exactly like GET; Node already suppresses the response body for HEAD requests.
924
- req.method = 'GET';
925
- }
926
-
927
- if (req.method === 'GET' && url.pathname === '/health') {
928
- sendJson(res, 200, {
929
- status: 'ok',
930
- service: 'xoonya',
931
- readiness: 'ready',
932
- });
933
- return;
934
- }
935
-
936
- if (req.method === 'GET' && (url.pathname === '/openapi.json' || url.pathname === '/v1/openapi')) {
937
- sendJson(res, 200, buildOpenApiDocument());
938
- return;
939
- }
940
-
941
- if (req.method === 'GET' && url.pathname === '/v1/openapi/summary') {
942
- sendJson(res, 200, summarizeOpenApiDocument());
943
- return;
944
- }
945
-
946
- if (req.method === 'GET' && (url.pathname === '/asyncapi.json' || url.pathname === '/v1/asyncapi')) {
947
- sendJson(res, 200, buildAsyncApiDocument());
948
- return;
949
- }
950
-
951
- if (req.method === 'GET' && url.pathname === '/v1/asyncapi/summary') {
952
- sendJson(res, 200, summarizeAsyncApiDocument());
953
- return;
954
- }
955
-
956
- if (req.method === 'GET' && (url.pathname === '/cloudevents.json' || url.pathname === '/v1/cloudevents')) {
957
- sendJson(res, 200, buildCloudEventsContract());
958
- return;
959
- }
960
-
961
- if (req.method === 'GET' && url.pathname === '/v1/cloudevents/summary') {
962
- sendJson(res, 200, summarizeCloudEventsContract());
963
- return;
964
- }
965
-
966
- if (req.method === 'GET' && (url.pathname === '/v1/auth-profiles' || url.pathname === '/v1/auth-interop')) {
967
- sendJson(res, 200, buildAuthInteropContract());
968
- return;
969
- }
970
-
971
- if (req.method === 'GET' && (url.pathname === '/v1/auth-profiles/summary' || url.pathname === '/v1/auth-interop/summary')) {
972
- sendJson(res, 200, summarizeAuthInteropContract());
973
- return;
974
- }
975
-
976
- if (req.method === 'GET' && (url.pathname === '/v1/identity-interop' || url.pathname === '/v1/credential-interop')) {
977
- sendJson(res, 200, buildIdentityInteropContract());
978
- return;
979
- }
980
-
981
- if (req.method === 'GET' && (url.pathname === '/v1/identity-interop/summary' || url.pathname === '/v1/credential-interop/summary')) {
982
- sendJson(res, 200, summarizeIdentityInteropContract());
983
- return;
984
- }
985
-
986
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/trust-portability') {
987
- sendJson(res, 200, buildTrustPortabilityPack());
988
- return;
989
- }
990
-
991
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/trust-portability/summary') {
992
- sendJson(res, 200, summarizeTrustPortabilityPack());
993
- return;
994
- }
995
-
996
- if (req.method === 'GET' && url.pathname.startsWith('/v1/proof-center/trust-portability/')) {
997
- const profileId = url.pathname.slice('/v1/proof-center/trust-portability/'.length);
998
- const profile = getTrustPortabilityProfile(profileId);
999
- if (!profile) {
1000
- sendJson(res, 404, { ok: false, error: 'trust_portability_profile_not_found' });
1001
- return;
1002
- }
1003
- sendJson(res, 200, {
1004
- ok: true,
1005
- product: 'xoonya',
1006
- category: 'xoonya-trust-portability-detail',
1007
- profile
1008
- });
1009
- return;
1010
- }
1011
-
1012
- if (req.method === 'GET' && url.pathname === '/v1/adapter-certification') {
1013
- sendJson(res, 200, buildAdapterCertificationContractPack());
1014
- return;
1015
- }
1016
-
1017
- if (req.method === 'GET' && url.pathname === '/v1/adapter-certification/summary') {
1018
- sendJson(res, 200, summarizeAdapterCertificationContractPack());
1019
- return;
1020
- }
1021
-
1022
- if (req.method === 'GET' && url.pathname.startsWith('/v1/adapter-certification/')) {
1023
- const frontId = decodeURIComponent(url.pathname.slice('/v1/adapter-certification/'.length));
1024
- if (frontId && frontId !== 'summary') {
1025
- const front = getAdapterCertificationFrontDetail(frontId);
1026
- if (!front) {
1027
- sendJson(res, 404, { ok: false, error: 'adapter_certification_front_not_found' });
1028
- return;
1029
- }
1030
- sendJson(res, 200, {
1031
- ok: true,
1032
- product: 'xoonya',
1033
- category: 'naxytra-adapter-certification-detail',
1034
- front
1035
- });
1036
- return;
1037
- }
1038
- }
1039
-
1040
- if (req.method === 'GET' && url.pathname === '/v1/trust-portability-boundary') {
1041
- sendJson(res, 200, buildTrustPortabilityBoundaryContractPack());
1042
- return;
1043
- }
1044
-
1045
- if (req.method === 'GET' && url.pathname === '/v1/trust-portability-boundary/summary') {
1046
- sendJson(res, 200, summarizeTrustPortabilityBoundaryContractPack());
1047
- return;
1048
- }
1049
-
1050
- if (req.method === 'GET' && url.pathname.startsWith('/v1/trust-portability-boundary/')) {
1051
- const axisId = decodeURIComponent(url.pathname.slice('/v1/trust-portability-boundary/'.length));
1052
- if (axisId && axisId !== 'summary') {
1053
- const axis = getTrustPortabilityAxisDetail(axisId);
1054
- if (!axis) {
1055
- sendJson(res, 404, { ok: false, error: 'trust_portability_axis_not_found' });
1056
- return;
1057
- }
1058
- sendJson(res, 200, {
1059
- ok: true,
1060
- product: 'xoonya',
1061
- category: 'naxytra-trust-portability-boundary-detail',
1062
- axis: {
1063
- ...axis,
1064
- axis_id: axis.axis_id || axis.profile_id || axis.portability_axis || null
1065
- }
1066
- });
1067
- return;
1068
- }
1069
- }
1070
-
1071
- if (req.method === 'GET' && url.pathname === '/v1/signed-audit-provenance') {
1072
- sendJson(res, 200, buildSignedAuditProvenanceContractPack());
1073
- return;
1074
- }
1075
-
1076
- if (req.method === 'GET' && url.pathname === '/v1/signed-audit-provenance/summary') {
1077
- sendJson(res, 200, summarizeSignedAuditProvenanceContractPack());
1078
- return;
1079
- }
1080
-
1081
- if (req.method === 'GET' && url.pathname.startsWith('/v1/signed-audit-provenance/')) {
1082
- const surfaceId = decodeURIComponent(url.pathname.slice('/v1/signed-audit-provenance/'.length));
1083
- if (surfaceId && surfaceId !== 'summary') {
1084
- const surface = getSignedAuditProvenanceSurfaceDetail(surfaceId);
1085
- if (!surface) {
1086
- sendJson(res, 404, { ok: false, error: 'signed_audit_provenance_surface_not_found' });
1087
- return;
1088
- }
1089
- sendJson(res, 200, {
1090
- ok: true,
1091
- product: 'xoonya',
1092
- category: 'naxytra-signed-audit-provenance-detail',
1093
- surface
1094
- });
1095
- return;
1096
- }
1097
- }
1098
-
1099
- if (req.method === 'GET' && url.pathname === '/v1/proof-truth') {
1100
- sendJson(res, 200, buildProofTruthModelPack());
1101
- return;
1102
- }
1103
-
1104
- if (req.method === 'GET' && url.pathname === '/v1/proof-truth/summary') {
1105
- sendJson(res, 200, summarizeProofTruthModelPack());
1106
- return;
1107
- }
1108
-
1109
- if (req.method === 'GET' && url.pathname.startsWith('/v1/proof-truth/')) {
1110
- const suffix = decodeURIComponent(url.pathname.slice('/v1/proof-truth/'.length));
1111
- if (suffix && suffix !== 'summary') {
1112
- const objectDetail = getProofTruthObjectDetail(suffix);
1113
- if (!objectDetail) {
1114
- sendJson(res, 404, { ok: false, error: 'proof_truth_object_not_found' });
1115
- return;
1116
- }
1117
- sendJson(res, 200, {
1118
- ok: true,
1119
- product: 'xoonya',
1120
- category: 'xoonya-proof-truth-detail',
1121
- object: objectDetail
1122
- });
1123
- return;
1124
- }
1125
- }
1126
-
1127
- if (req.method === 'GET' && url.pathname === '/v1/default-path') {
1128
- sendJson(res, 200, buildDefaultPathPack());
1129
- return;
1130
- }
1131
-
1132
- if (req.method === 'GET' && url.pathname === '/v1/default-path/summary') {
1133
- sendJson(res, 200, summarizeDefaultPathPack());
1134
- return;
1135
- }
1136
-
1137
- if (req.method === 'GET' && url.pathname.startsWith('/v1/default-path/')) {
1138
- const suffix = decodeURIComponent(url.pathname.slice('/v1/default-path/'.length));
1139
- if (suffix && suffix !== 'summary') {
1140
- const surface = getDefaultPathSurfaceDetail(suffix);
1141
- if (!surface) {
1142
- sendJson(res, 404, { ok: false, error: 'default_path_surface_not_found' });
1143
- return;
1144
- }
1145
- sendJson(res, 200, {
1146
- ok: true,
1147
- product: 'xoonya',
1148
- category: 'xoonya-default-path-surface-detail',
1149
- surface
1150
- });
1151
- return;
1152
- }
1153
- }
1154
-
1155
- if (req.method === 'GET' && url.pathname === '/v1/followthrough-truth') {
1156
- sendJson(res, 200, buildFollowthroughTruthPack());
1157
- return;
1158
- }
1159
-
1160
- if (req.method === 'GET' && url.pathname === '/v1/followthrough-truth/summary') {
1161
- sendJson(res, 200, summarizeFollowthroughTruthPack());
1162
- return;
1163
- }
1164
-
1165
- if (req.method === 'GET' && url.pathname.startsWith('/v1/followthrough-truth/')) {
1166
- const suffix = decodeURIComponent(url.pathname.slice('/v1/followthrough-truth/'.length));
1167
- if (suffix && suffix !== 'summary') {
1168
- const profile = getFollowthroughTruthProfileDetail(suffix);
1169
- if (!profile) {
1170
- sendJson(res, 404, { ok: false, error: 'followthrough_truth_profile_not_found' });
1171
- return;
1172
- }
1173
- sendJson(res, 200, {
1174
- ok: true,
1175
- product: 'xoonya',
1176
- category: 'xoonya-followthrough-truth-profile-detail',
1177
- profile
1178
- });
1179
- return;
1180
- }
1181
- }
1182
-
1183
- if (req.method === 'GET' && url.pathname === '/v1/providers') {
1184
- sendJson(res, 200, buildProviderLanePack());
1185
- return;
1186
- }
1187
-
1188
- if (req.method === 'GET' && url.pathname === '/v1/providers/summary') {
1189
- sendJson(res, 200, summarizeProviderLanePack());
1190
- return;
1191
- }
1192
-
1193
- if (req.method === 'GET' && url.pathname === '/v1/frameworks') {
1194
- sendJson(res, 200, buildFrameworkLanePack());
1195
- return;
1196
- }
1197
-
1198
- if (req.method === 'GET' && url.pathname === '/v1/frameworks/summary') {
1199
- sendJson(res, 200, summarizeFrameworkLanePack());
1200
- return;
1201
- }
1202
-
1203
- if (req.method === 'GET' && url.pathname === '/v1/integration-matrix') {
1204
- sendJson(res, 200, buildIntegrationMatrixPack(listIntegrations()));
1205
- return;
1206
- }
1207
-
1208
- if (req.method === 'GET' && url.pathname === '/v1/integration-matrix/summary') {
1209
- sendJson(res, 200, summarizeIntegrationMatrixPack(listIntegrations()));
1210
- return;
1211
- }
1212
-
1213
- if (req.method === 'GET' && url.pathname === '/v1/major-rails') {
1214
- sendJson(res, 200, buildMajorRailsProofLanePack());
1215
- return;
1216
- }
1217
-
1218
- if (req.method === 'GET' && url.pathname === '/v1/major-rails/summary') {
1219
- sendJson(res, 200, summarizeMajorRailsProofLanePack());
1220
- return;
1221
- }
1222
-
1223
- if (req.method === 'GET' && url.pathname === '/v1/treasury') {
1224
- sendJson(res, 200, buildTreasuryProofLanePack());
1225
- return;
1226
- }
1227
-
1228
- if (req.method === 'GET' && url.pathname === '/v1/treasury/summary') {
1229
- sendJson(res, 200, summarizeTreasuryProofLanePack());
1230
- return;
1231
- }
1232
-
1233
- if (req.method === 'GET' && url.pathname === '/v1/erc8004') {
1234
- sendJson(res, 200, buildErc8004ProofLanePack());
1235
- return;
1236
- }
1237
-
1238
- if (req.method === 'GET' && url.pathname === '/v1/erc8004/summary') {
1239
- sendJson(res, 200, summarizeErc8004ProofLanePack());
1240
- return;
1241
- }
1242
-
1243
- if (req.method === 'GET' && url.pathname === '/v1/proof-bridge') {
1244
- sendJson(res, 200, buildProofBridgeLanePack());
1245
- return;
1246
- }
1247
-
1248
- if (req.method === 'GET' && url.pathname === '/v1/proof-bridge/summary') {
1249
- sendJson(res, 200, summarizeProofBridgeLanePack());
1250
- return;
1251
- }
1252
-
1253
- if (req.method === 'GET' && url.pathname === '/v1/external-proof-import') {
1254
- sendJson(res, 200, buildExternalProofImportLanePack());
1255
- return;
1256
- }
1257
-
1258
- if (req.method === 'GET' && url.pathname === '/v1/external-proof-import/summary') {
1259
- sendJson(res, 200, summarizeExternalProofImportLanePack());
1260
- return;
1261
- }
1262
-
1263
- if (req.method === 'GET' && url.pathname === '/v1/result-package-trust') {
1264
- sendJson(res, 200, buildResultPackageTrustLanePack());
1265
- return;
1266
- }
1267
-
1268
- if (req.method === 'GET' && url.pathname === '/v1/result-package-trust/summary') {
1269
- sendJson(res, 200, summarizeResultPackageTrustLanePack());
1270
- return;
1271
- }
1272
-
1273
- if (req.method === 'GET' && url.pathname === '/v1/event-systems') {
1274
- sendJson(res, 200, buildEventSystemLanePack());
1275
- return;
1276
- }
1277
-
1278
- if (req.method === 'GET' && url.pathname === '/v1/event-systems/summary') {
1279
- sendJson(res, 200, summarizeEventSystemLanePack());
1280
- return;
1281
- }
1282
-
1283
- if (req.method === 'GET' && url.pathname === '/v1/telemetry') {
1284
- sendJson(res, 200, buildTelemetryLanePack());
1285
- return;
1286
- }
1287
-
1288
- if (req.method === 'GET' && url.pathname === '/v1/telemetry/summary') {
1289
- sendJson(res, 200, summarizeTelemetryLanePack());
1290
- return;
1291
- }
1292
-
1293
- if (req.method === 'GET' && url.pathname === '/v1/provenance') {
1294
- sendJson(res, 200, buildProvenanceLanePack());
1295
- return;
1296
- }
1297
-
1298
- if (req.method === 'GET' && url.pathname === '/v1/provenance/summary') {
1299
- sendJson(res, 200, summarizeProvenanceLanePack());
1300
- return;
1301
- }
1302
-
1303
- if (req.method === 'GET' && url.pathname === '/v1/artifact-distribution') {
1304
- sendJson(res, 200, buildArtifactDistributionLanePack());
1305
- return;
1306
- }
1307
-
1308
- if (req.method === 'GET' && url.pathname === '/v1/artifact-distribution/summary') {
1309
- sendJson(res, 200, summarizeArtifactDistributionLanePack());
1310
- return;
1311
- }
1312
-
1313
- if (req.method === 'GET' && url.pathname === '/v1/shared-signals') {
1314
- sendJson(res, 200, buildSharedSignalsLanePack());
1315
- return;
1316
- }
1317
-
1318
- if (req.method === 'GET' && url.pathname === '/v1/shared-signals/summary') {
1319
- sendJson(res, 200, summarizeSharedSignalsLanePack());
1320
- return;
1321
- }
1322
-
1323
- if (req.method === 'GET' && url.pathname === '/v1/feature-control') {
1324
- sendJson(res, 200, buildFeatureControlLanePack());
1325
- return;
1326
- }
1327
-
1328
- if (req.method === 'GET' && url.pathname === '/v1/feature-control/summary') {
1329
- sendJson(res, 200, summarizeFeatureControlLanePack());
1330
- return;
1331
- }
1332
-
1333
- if (req.method === 'GET' && url.pathname === '/v1/release-pack') {
1334
- sendJson(res, 200, buildReleasePack());
1335
- return;
1336
- }
1337
-
1338
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/summary') {
1339
- sendJson(res, 200, summarizeReleasePack());
1340
- return;
1341
- }
1342
-
1343
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/comparison') {
1344
- sendJson(res, 200, buildComparisonPack());
1345
- return;
1346
- }
1347
-
1348
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/comparison/summary') {
1349
- sendJson(res, 200, summarizeComparisonPack());
1350
- return;
1351
- }
1352
-
1353
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/adoption') {
1354
- sendJson(res, 200, buildAdoptionPack());
1355
- return;
1356
- }
1357
-
1358
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/adoption/summary') {
1359
- sendJson(res, 200, summarizeAdoptionPack());
1360
- return;
1361
- }
1362
-
1363
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/scenarios') {
1364
- sendJson(res, 200, buildScenarioPack());
1365
- return;
1366
- }
1367
-
1368
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/scenarios/summary') {
1369
- sendJson(res, 200, summarizeScenarioPack());
1370
- return;
1371
- }
1372
-
1373
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/launch') {
1374
- sendJson(res, 200, buildLaunchPack());
1375
- return;
1376
- }
1377
-
1378
- if (req.method === 'GET' && url.pathname === '/v1/release-pack/launch/summary') {
1379
- sendJson(res, 200, summarizeLaunchPack());
1380
- return;
1381
- }
1382
-
1383
- if (req.method === 'GET' && url.pathname === '/v1/release-manifest') {
1384
- sendJson(res, 200, buildReleaseManifest());
1385
- return;
1386
- }
1387
-
1388
- if (req.method === 'GET' && url.pathname === '/v1/release-manifest/summary') {
1389
- sendJson(res, 200, summarizeReleaseManifest());
1390
- return;
1391
- }
1392
-
1393
- if (req.method === 'GET' && url.pathname === '/v1/release-notes') {
1394
- sendJson(res, 200, buildLaunchNotes());
1395
- return;
1396
- }
1397
-
1398
- if (req.method === 'GET' && url.pathname === '/v1/release-notes/summary') {
1399
- sendJson(res, 200, summarizeLaunchNotes());
1400
- return;
1401
- }
1402
-
1403
- if (req.method === 'GET' && url.pathname === '/v1/release-center') {
1404
- sendJson(res, 200, buildReleaseCenter());
1405
- return;
1406
- }
1407
-
1408
- if (req.method === 'GET' && url.pathname === '/v1/release-center/summary') {
1409
- sendJson(res, 200, summarizeReleaseCenter());
1410
- return;
1411
- }
1412
-
1413
- if (req.method === 'GET' && url.pathname === '/v1/release-history') {
1414
- sendJson(res, 200, buildReleaseHistory());
1415
- return;
1416
- }
1417
-
1418
- if (req.method === 'GET' && url.pathname === '/v1/release-history/summary') {
1419
- sendJson(res, 200, summarizeReleaseHistory());
1420
- return;
1421
- }
1422
-
1423
- if (req.method === 'GET' && url.pathname === '/v1/phases') {
1424
- sendJson(res, 200, buildPhaseProgramPack());
1425
- return;
1426
- }
1427
-
1428
- if (req.method === 'GET' && url.pathname === '/v1/phases/summary') {
1429
- sendJson(res, 200, summarizePhaseProgramPack());
1430
- return;
1431
- }
1432
-
1433
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1') {
1434
- sendJson(res, 200, buildPhase1EcosystemPack());
1435
- return;
1436
- }
1437
-
1438
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/summary') {
1439
- sendJson(res, 200, summarizePhase1EcosystemPack());
1440
- return;
1441
- }
1442
-
1443
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/openai-codex') {
1444
- sendJson(res, 200, buildPhase1OpenaiCodexPack());
1445
- return;
1446
- }
1447
-
1448
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/openai-codex/summary') {
1449
- sendJson(res, 200, summarizePhase1OpenaiCodexPack());
1450
- return;
1451
- }
1452
-
1453
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/openai-codex/proof') {
1454
- sendJson(res, 200, buildPhase1OpenaiCodexProofPack());
1455
- return;
1456
- }
1457
-
1458
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/openai-codex/proof/summary') {
1459
- sendJson(res, 200, summarizePhase1OpenaiCodexProofPack());
1460
- return;
1461
- }
1462
-
1463
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/claude-mcp') {
1464
- sendJson(res, 200, buildPhase1ClaudeMcpPack());
1465
- return;
1466
- }
1467
-
1468
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/claude-mcp/summary') {
1469
- sendJson(res, 200, summarizePhase1ClaudeMcpPack());
1470
- return;
1471
- }
1472
-
1473
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/claude-mcp/proof') {
1474
- sendJson(res, 200, buildPhase1ClaudeMcpProofPack());
1475
- return;
1476
- }
1477
-
1478
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-1/claude-mcp/proof/summary') {
1479
- sendJson(res, 200, summarizePhase1ClaudeMcpProofPack());
1480
- return;
1481
- }
1482
-
1483
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2') {
1484
- sendJson(res, 200, buildPhase2PaymentRailsPack());
1485
- return;
1486
- }
1487
-
1488
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/summary') {
1489
- sendJson(res, 200, summarizePhase2PaymentRailsPack());
1490
- return;
1491
- }
1492
-
1493
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/completion') {
1494
- sendJson(res, 200, buildPhase2CompletionPack());
1495
- return;
1496
- }
1497
-
1498
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/completion/summary') {
1499
- sendJson(res, 200, summarizePhase2CompletionPack());
1500
- return;
1501
- }
1502
-
1503
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/freeze-review') {
1504
- sendJson(res, 200, buildPhase2FreezeReviewPack());
1505
- return;
1506
- }
1507
-
1508
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/freeze-review/summary') {
1509
- sendJson(res, 200, summarizePhase2FreezeReviewPack());
1510
- return;
1511
- }
1512
-
1513
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/gate') {
1514
- sendJson(res, 200, buildPhase2GatePack());
1515
- return;
1516
- }
1517
-
1518
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/gate/summary') {
1519
- sendJson(res, 200, summarizePhase2GatePack());
1520
- return;
1521
- }
1522
-
1523
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/closeout') {
1524
- sendJson(res, 200, buildPhase2CloseoutPack());
1525
- return;
1526
- }
1527
-
1528
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/closeout/summary') {
1529
- sendJson(res, 200, summarizePhase2CloseoutPack());
1530
- return;
1531
- }
1532
-
1533
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/decision-record') {
1534
- sendJson(res, 200, buildPhase2DecisionRecordPack());
1535
- return;
1536
- }
1537
-
1538
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/decision-record/summary') {
1539
- sendJson(res, 200, summarizePhase2DecisionRecordPack());
1540
- return;
1541
- }
1542
-
1543
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/decision-resolution') {
1544
- sendJson(res, 200, buildPhase2DecisionResolutionPack());
1545
- return;
1546
- }
1547
-
1548
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/decision-resolution/summary') {
1549
- sendJson(res, 200, summarizePhase2DecisionResolutionPack());
1550
- return;
1551
- }
1552
-
1553
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/flip-preview') {
1554
- sendJson(res, 200, buildPhase2FlipPreviewPack());
1555
- return;
1556
- }
1557
-
1558
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/flip-preview/summary') {
1559
- sendJson(res, 200, summarizePhase2FlipPreviewPack());
1560
- return;
1561
- }
1562
-
1563
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/evm-base/proof') {
1564
- sendJson(res, 200, buildPhase2EvmBaseProofPack());
1565
- return;
1566
- }
1567
-
1568
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/evm-base/proof/summary') {
1569
- sendJson(res, 200, summarizePhase2EvmBaseProofPack());
1570
- return;
1571
- }
1572
-
1573
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/base-usdc/proof') {
1574
- sendJson(res, 200, buildPhase2BaseUsdcProofPack());
1575
- return;
1576
- }
1577
-
1578
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/base-usdc/proof/summary') {
1579
- sendJson(res, 200, summarizePhase2BaseUsdcProofPack());
1580
- return;
1581
- }
1582
-
1583
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/eth/proof') {
1584
- sendJson(res, 200, buildPhase2EthProofPack());
1585
- return;
1586
- }
1587
-
1588
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/eth/proof/summary') {
1589
- sendJson(res, 200, summarizePhase2EthProofPack());
1590
- return;
1591
- }
1592
-
1593
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3') {
1594
- sendJson(res, 200, buildPhase3NativeBsvPack());
1595
- return;
1596
- }
1597
-
1598
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/summary') {
1599
- sendJson(res, 200, summarizePhase3NativeBsvPack());
1600
- return;
1601
- }
1602
-
1603
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/native-continuity') {
1604
- sendJson(res, 200, buildPhase3NativeContinuityPack());
1605
- return;
1606
- }
1607
-
1608
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/native-continuity/summary') {
1609
- sendJson(res, 200, summarizePhase3NativeContinuityPack());
1610
- return;
1611
- }
1612
-
1613
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/freeze-baseline') {
1614
- sendJson(res, 200, buildPhase3FreezeBaselinePack());
1615
- return;
1616
- }
1617
-
1618
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/freeze-baseline/summary') {
1619
- sendJson(res, 200, summarizePhase3FreezeBaselinePack());
1620
- return;
1621
- }
1622
-
1623
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/completion') {
1624
- sendJson(res, 200, buildPhase3CompletionPack());
1625
- return;
1626
- }
1627
-
1628
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/completion/summary') {
1629
- sendJson(res, 200, summarizePhase3CompletionPack());
1630
- return;
1631
- }
1632
-
1633
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/freeze-review') {
1634
- sendJson(res, 200, buildPhase3FreezeReviewPack());
1635
- return;
1636
- }
1637
-
1638
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/freeze-review/summary') {
1639
- sendJson(res, 200, summarizePhase3FreezeReviewPack());
1640
- return;
1641
- }
1642
-
1643
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/gate') {
1644
- sendJson(res, 200, buildPhase3GatePack());
1645
- return;
1646
- }
1647
-
1648
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/gate/summary') {
1649
- sendJson(res, 200, summarizePhase3GatePack());
1650
- return;
1651
- }
1652
-
1653
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/closeout') {
1654
- sendJson(res, 200, buildPhase3CloseoutPack());
1655
- return;
1656
- }
1657
-
1658
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/closeout/summary') {
1659
- sendJson(res, 200, summarizePhase3CloseoutPack());
1660
- return;
1661
- }
1662
-
1663
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/decision-record') {
1664
- sendJson(res, 200, buildPhase3DecisionRecordPack());
1665
- return;
1666
- }
1667
-
1668
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/decision-record/summary') {
1669
- sendJson(res, 200, summarizePhase3DecisionRecordPack());
1670
- return;
1671
- }
1672
-
1673
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/decision-resolution') {
1674
- sendJson(res, 200, buildPhase3DecisionResolutionPack());
1675
- return;
1676
- }
1677
-
1678
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/decision-resolution/summary') {
1679
- sendJson(res, 200, summarizePhase3DecisionResolutionPack());
1680
- return;
1681
- }
1682
-
1683
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/bsv-teranode/proof') {
1684
- sendJson(res, 200, buildPhase3BsvTeranodeProofPack());
1685
- return;
1686
- }
1687
-
1688
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/bsv-teranode/proof/summary') {
1689
- sendJson(res, 200, summarizePhase3BsvTeranodeProofPack());
1690
- return;
1691
- }
1692
-
1693
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/metanet/proof') {
1694
- sendJson(res, 200, buildPhase3MetanetProofPack());
1695
- return;
1696
- }
1697
-
1698
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/metanet/proof/summary') {
1699
- sendJson(res, 200, summarizePhase3MetanetProofPack());
1700
- return;
1701
- }
1702
-
1703
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/brc/proof') {
1704
- sendJson(res, 200, buildPhase3BrcProofPack());
1705
- return;
1706
- }
1707
-
1708
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-3/brc/proof/summary') {
1709
- sendJson(res, 200, summarizePhase3BrcProofPack());
1710
- return;
1711
- }
1712
-
1713
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4') {
1714
- sendJson(res, 200, buildPhase4IdentityTrustPack());
1715
- return;
1716
- }
1717
-
1718
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/summary') {
1719
- sendJson(res, 200, summarizePhase4IdentityTrustPack());
1720
- return;
1721
- }
1722
-
1723
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/erc8004/proof') {
1724
- sendJson(res, 200, buildPhase4Erc8004ProofPack());
1725
- return;
1726
- }
1727
-
1728
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/erc8004/proof/summary') {
1729
- sendJson(res, 200, summarizePhase4Erc8004ProofPack());
1730
- return;
1731
- }
1732
-
1733
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/identity-registry/proof') {
1734
- sendJson(res, 200, buildPhase4IdentityRegistryProofPack());
1735
- return;
1736
- }
1737
-
1738
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/identity-registry/proof/summary') {
1739
- sendJson(res, 200, summarizePhase4IdentityRegistryProofPack());
1740
- return;
1741
- }
1742
-
1743
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/attestation/proof') {
1744
- sendJson(res, 200, buildPhase4AttestationProofPack());
1745
- return;
1746
- }
1747
-
1748
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/attestation/proof/summary') {
1749
- sendJson(res, 200, summarizePhase4AttestationProofPack());
1750
- return;
1751
- }
1752
-
1753
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/trust-continuity') {
1754
- sendJson(res, 200, buildPhase4TrustContinuityPack());
1755
- return;
1756
- }
1757
-
1758
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/trust-continuity/summary') {
1759
- sendJson(res, 200, summarizePhase4TrustContinuityPack());
1760
- return;
1761
- }
1762
-
1763
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/completion') {
1764
- sendJson(res, 200, buildPhase4CompletionPack());
1765
- return;
1766
- }
1767
-
1768
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/completion/summary') {
1769
- sendJson(res, 200, summarizePhase4CompletionPack());
1770
- return;
1771
- }
1772
-
1773
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/freeze-review') {
1774
- sendJson(res, 200, buildPhase4FreezeReviewPack());
1775
- return;
1776
- }
1777
-
1778
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/freeze-baseline') {
1779
- sendJson(res, 200, buildPhase4FreezeBaselinePack());
1780
- return;
1781
- }
1782
-
1783
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/freeze-baseline/summary') {
1784
- sendJson(res, 200, summarizePhase4FreezeBaselinePack());
1785
- return;
1786
- }
1787
-
1788
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/freeze-review/summary') {
1789
- sendJson(res, 200, summarizePhase4FreezeReviewPack());
1790
- return;
1791
- }
1792
-
1793
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/gate') {
1794
- sendJson(res, 200, buildPhase4GatePack());
1795
- return;
1796
- }
1797
-
1798
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/gate/summary') {
1799
- sendJson(res, 200, summarizePhase4GatePack());
1800
- return;
1801
- }
1802
-
1803
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/closeout') {
1804
- sendJson(res, 200, buildPhase4CloseoutPack());
1805
- return;
1806
- }
1807
-
1808
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/closeout/summary') {
1809
- sendJson(res, 200, summarizePhase4CloseoutPack());
1810
- return;
1811
- }
1812
-
1813
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/decision-record') {
1814
- sendJson(res, 200, buildPhase4DecisionRecordPack());
1815
- return;
1816
- }
1817
-
1818
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/decision-record/summary') {
1819
- sendJson(res, 200, summarizePhase4DecisionRecordPack());
1820
- return;
1821
- }
1822
-
1823
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/decision-resolution') {
1824
- sendJson(res, 200, buildPhase4DecisionResolutionPack());
1825
- return;
1826
- }
1827
-
1828
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-4/decision-resolution/summary') {
1829
- sendJson(res, 200, summarizePhase4DecisionResolutionPack());
1830
- return;
1831
- }
1832
-
1833
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5') {
1834
- sendJson(res, 200, buildPhase5MajorRailsPack());
1835
- return;
1836
- }
1837
-
1838
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/summary') {
1839
- sendJson(res, 200, summarizePhase5MajorRailsPack());
1840
- return;
1841
- }
1842
-
1843
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/major-rails-continuity') {
1844
- sendJson(res, 200, buildPhase5MajorRailsContinuityPack());
1845
- return;
1846
- }
1847
-
1848
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/major-rails-continuity/summary') {
1849
- sendJson(res, 200, summarizePhase5MajorRailsContinuityPack());
1850
- return;
1851
- }
1852
-
1853
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/completion') {
1854
- sendJson(res, 200, buildPhase5CompletionPack());
1855
- return;
1856
- }
1857
-
1858
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/completion/summary') {
1859
- sendJson(res, 200, summarizePhase5CompletionPack());
1860
- return;
1861
- }
1862
-
1863
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/freeze-review') {
1864
- sendJson(res, 200, buildPhase5FreezeReviewPack());
1865
- return;
1866
- }
1867
-
1868
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/freeze-review/summary') {
1869
- sendJson(res, 200, summarizePhase5FreezeReviewPack());
1870
- return;
1871
- }
1872
-
1873
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/freeze-baseline') {
1874
- sendJson(res, 200, buildPhase5FreezeBaselinePack());
1875
- return;
1876
- }
1877
-
1878
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/freeze-baseline/summary') {
1879
- sendJson(res, 200, summarizePhase5FreezeBaselinePack());
1880
- return;
1881
- }
1882
-
1883
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/gate') {
1884
- sendJson(res, 200, buildPhase5GatePack());
1885
- return;
1886
- }
1887
-
1888
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/gate/summary') {
1889
- sendJson(res, 200, summarizePhase5GatePack());
1890
- return;
1891
- }
1892
-
1893
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/closeout') {
1894
- sendJson(res, 200, buildPhase5CloseoutPack());
1895
- return;
1896
- }
1897
-
1898
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/closeout/summary') {
1899
- sendJson(res, 200, summarizePhase5CloseoutPack());
1900
- return;
1901
- }
1902
-
1903
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/decision-record') {
1904
- sendJson(res, 200, buildPhase5DecisionRecordPack());
1905
- return;
1906
- }
1907
-
1908
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/decision-record/summary') {
1909
- sendJson(res, 200, summarizePhase5DecisionRecordPack());
1910
- return;
1911
- }
1912
-
1913
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/decision-resolution') {
1914
- sendJson(res, 200, buildPhase5DecisionResolutionPack());
1915
- return;
1916
- }
1917
-
1918
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/decision-resolution/summary') {
1919
- sendJson(res, 200, summarizePhase5DecisionResolutionPack());
1920
- return;
1921
- }
1922
-
1923
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/solana/proof') {
1924
- sendJson(res, 200, buildPhase5SolanaProofPack());
1925
- return;
1926
- }
1927
-
1928
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/solana/proof/summary') {
1929
- sendJson(res, 200, summarizePhase5SolanaProofPack());
1930
- return;
1931
- }
1932
-
1933
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/antelope/proof') {
1934
- sendJson(res, 200, buildPhase5AntelopeProofPack());
1935
- return;
1936
- }
1937
-
1938
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/antelope/proof/summary') {
1939
- sendJson(res, 200, summarizePhase5AntelopeProofPack());
1940
- return;
1941
- }
1942
-
1943
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/proton-xpr/proof') {
1944
- sendJson(res, 200, buildPhase5ProtonXprProofPack());
1945
- return;
1946
- }
1947
-
1948
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-5/proton-xpr/proof/summary') {
1949
- sendJson(res, 200, summarizePhase5ProtonXprProofPack());
1950
- return;
1951
- }
1952
-
1953
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6') {
1954
- sendJson(res, 200, buildPhase6FrameworkRuntimePack());
1955
- return;
1956
- }
1957
-
1958
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/summary') {
1959
- sendJson(res, 200, summarizePhase6FrameworkRuntimePack());
1960
- return;
1961
- }
1962
-
1963
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/langgraph/proof') {
1964
- sendJson(res, 200, buildPhase6LanggraphProofPack());
1965
- return;
1966
- }
1967
-
1968
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/langgraph/proof/summary') {
1969
- sendJson(res, 200, summarizePhase6LanggraphProofPack());
1970
- return;
1971
- }
1972
-
1973
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/langchain/proof') {
1974
- sendJson(res, 200, buildPhase6LangchainProofPack());
1975
- return;
1976
- }
1977
-
1978
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/langchain/proof/summary') {
1979
- sendJson(res, 200, summarizePhase6LangchainProofPack());
1980
- return;
1981
- }
1982
-
1983
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/autogen/proof') {
1984
- sendJson(res, 200, buildPhase6AutogenProofPack());
1985
- return;
1986
- }
1987
-
1988
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/autogen/proof/summary') {
1989
- sendJson(res, 200, summarizePhase6AutogenProofPack());
1990
- return;
1991
- }
1992
-
1993
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/semantic-kernel/proof') {
1994
- sendJson(res, 200, buildPhase6SemanticKernelProofPack());
1995
- return;
1996
- }
1997
-
1998
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/semantic-kernel/proof/summary') {
1999
- sendJson(res, 200, summarizePhase6SemanticKernelProofPack());
2000
- return;
2001
- }
2002
-
2003
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/framework-continuity') {
2004
- sendJson(res, 200, buildPhase6FrameworkContinuityPack());
2005
- return;
2006
- }
2007
-
2008
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/framework-continuity/summary') {
2009
- sendJson(res, 200, summarizePhase6FrameworkContinuityPack());
2010
- return;
2011
- }
2012
-
2013
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/completion') {
2014
- sendJson(res, 200, buildPhase6CompletionPack());
2015
- return;
2016
- }
2017
-
2018
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/completion/summary') {
2019
- sendJson(res, 200, summarizePhase6CompletionPack());
2020
- return;
2021
- }
2022
-
2023
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/freeze-review') {
2024
- sendJson(res, 200, buildPhase6FreezeReviewPack());
2025
- return;
2026
- }
2027
-
2028
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/freeze-review/summary') {
2029
- sendJson(res, 200, summarizePhase6FreezeReviewPack());
2030
- return;
2031
- }
2032
-
2033
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/freeze-baseline') {
2034
- sendJson(res, 200, buildPhase6FreezeBaselinePack());
2035
- return;
2036
- }
2037
-
2038
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/freeze-baseline/summary') {
2039
- sendJson(res, 200, summarizePhase6FreezeBaselinePack());
2040
- return;
2041
- }
2042
-
2043
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/gate') {
2044
- sendJson(res, 200, buildPhase6GatePack());
2045
- return;
2046
- }
2047
-
2048
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/gate/summary') {
2049
- sendJson(res, 200, summarizePhase6GatePack());
2050
- return;
2051
- }
2052
-
2053
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/closeout') {
2054
- sendJson(res, 200, buildPhase6CloseoutPack());
2055
- return;
2056
- }
2057
-
2058
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/closeout/summary') {
2059
- sendJson(res, 200, summarizePhase6CloseoutPack());
2060
- return;
2061
- }
2062
-
2063
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/decision-record') {
2064
- sendJson(res, 200, buildPhase6DecisionRecordPack());
2065
- return;
2066
- }
2067
-
2068
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/decision-record/summary') {
2069
- sendJson(res, 200, summarizePhase6DecisionRecordPack());
2070
- return;
2071
- }
2072
-
2073
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/decision-resolution') {
2074
- sendJson(res, 200, buildPhase6DecisionResolutionPack());
2075
- return;
2076
- }
2077
-
2078
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-6/decision-resolution/summary') {
2079
- sendJson(res, 200, summarizePhase6DecisionResolutionPack());
2080
- return;
2081
- }
2082
-
2083
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7') {
2084
- sendJson(res, 200, buildPhase7EventSystemPack());
2085
- return;
2086
- }
2087
-
2088
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/summary') {
2089
- sendJson(res, 200, summarizePhase7EventSystemPack());
2090
- return;
2091
- }
2092
-
2093
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/kafka/proof') {
2094
- sendJson(res, 200, buildPhase7KafkaProofPack());
2095
- return;
2096
- }
2097
-
2098
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/kafka/proof/summary') {
2099
- sendJson(res, 200, summarizePhase7KafkaProofPack());
2100
- return;
2101
- }
2102
-
2103
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/nats/proof') {
2104
- sendJson(res, 200, buildPhase7NatsProofPack());
2105
- return;
2106
- }
2107
-
2108
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/nats/proof/summary') {
2109
- sendJson(res, 200, summarizePhase7NatsProofPack());
2110
- return;
2111
- }
2112
-
2113
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/mqtt/proof') {
2114
- sendJson(res, 200, buildPhase7MqttProofPack());
2115
- return;
2116
- }
2117
-
2118
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/mqtt/proof/summary') {
2119
- sendJson(res, 200, summarizePhase7MqttProofPack());
2120
- return;
2121
- }
2122
-
2123
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/webhook-event-bus/proof') {
2124
- sendJson(res, 200, buildPhase7WebhookEventBusProofPack());
2125
- return;
2126
- }
2127
-
2128
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/webhook-event-bus/proof/summary') {
2129
- sendJson(res, 200, summarizePhase7WebhookEventBusProofPack());
2130
- return;
2131
- }
2132
-
2133
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/event-system-continuity') {
2134
- sendJson(res, 200, buildPhase7EventSystemContinuityPack());
2135
- return;
2136
- }
2137
-
2138
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/event-system-continuity/summary') {
2139
- sendJson(res, 200, summarizePhase7EventSystemContinuityPack());
2140
- return;
2141
- }
2142
-
2143
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/completion') {
2144
- sendJson(res, 200, buildPhase7CompletionPack());
2145
- return;
2146
- }
2147
-
2148
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/completion/summary') {
2149
- sendJson(res, 200, summarizePhase7CompletionPack());
2150
- return;
2151
- }
2152
-
2153
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/freeze-review') {
2154
- sendJson(res, 200, buildPhase7FreezeReviewPack());
2155
- return;
2156
- }
2157
-
2158
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/freeze-baseline') {
2159
- sendJson(res, 200, buildPhase7FreezeBaselinePack());
2160
- return;
2161
- }
2162
-
2163
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/freeze-baseline/summary') {
2164
- sendJson(res, 200, summarizePhase7FreezeBaselinePack());
2165
- return;
2166
- }
2167
-
2168
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/freeze-review/summary') {
2169
- sendJson(res, 200, summarizePhase7FreezeReviewPack());
2170
- return;
2171
- }
2172
-
2173
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/gate') {
2174
- sendJson(res, 200, buildPhase7GatePack());
2175
- return;
2176
- }
2177
-
2178
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/gate/summary') {
2179
- sendJson(res, 200, summarizePhase7GatePack());
2180
- return;
2181
- }
2182
-
2183
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/closeout') {
2184
- sendJson(res, 200, buildPhase7CloseoutPack());
2185
- return;
2186
- }
2187
-
2188
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/closeout/summary') {
2189
- sendJson(res, 200, summarizePhase7CloseoutPack());
2190
- return;
2191
- }
2192
-
2193
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/decision-record') {
2194
- sendJson(res, 200, buildPhase7DecisionRecordPack());
2195
- return;
2196
- }
2197
-
2198
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/decision-record/summary') {
2199
- sendJson(res, 200, summarizePhase7DecisionRecordPack());
2200
- return;
2201
- }
2202
-
2203
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/decision-resolution') {
2204
- sendJson(res, 200, buildPhase7DecisionResolutionPack());
2205
- return;
2206
- }
2207
-
2208
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-7/decision-resolution/summary') {
2209
- sendJson(res, 200, summarizePhase7DecisionResolutionPack());
2210
- return;
2211
- }
2212
-
2213
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8') {
2214
- sendJson(res, 200, buildPhase8ProofBridgesPack());
2215
- return;
2216
- }
2217
-
2218
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/summary') {
2219
- sendJson(res, 200, summarizePhase8ProofBridgesPack());
2220
- return;
2221
- }
2222
-
2223
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/proof-bridge-continuity') {
2224
- sendJson(res, 200, buildPhase8ProofBridgeContinuityPack());
2225
- return;
2226
- }
2227
-
2228
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/proof-bridge-continuity/summary') {
2229
- sendJson(res, 200, summarizePhase8ProofBridgeContinuityPack());
2230
- return;
2231
- }
2232
-
2233
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/completion') {
2234
- sendJson(res, 200, buildPhase8CompletionPack());
2235
- return;
2236
- }
2237
-
2238
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/completion/summary') {
2239
- sendJson(res, 200, summarizePhase8CompletionPack());
2240
- return;
2241
- }
2242
-
2243
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/freeze-baseline') {
2244
- sendJson(res, 200, buildPhase8FreezeBaselinePack());
2245
- return;
2246
- }
2247
-
2248
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/freeze-baseline/summary') {
2249
- sendJson(res, 200, summarizePhase8FreezeBaselinePack());
2250
- return;
2251
- }
2252
-
2253
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/freeze-review') {
2254
- sendJson(res, 200, buildPhase8FreezeReviewPack());
2255
- return;
2256
- }
2257
-
2258
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/freeze-review/summary') {
2259
- sendJson(res, 200, summarizePhase8FreezeReviewPack());
2260
- return;
2261
- }
2262
-
2263
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/gate') {
2264
- sendJson(res, 200, buildPhase8GatePack());
2265
- return;
2266
- }
2267
-
2268
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/gate/summary') {
2269
- sendJson(res, 200, summarizePhase8GatePack());
2270
- return;
2271
- }
2272
-
2273
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/closeout') {
2274
- sendJson(res, 200, buildPhase8CloseoutPack());
2275
- return;
2276
- }
2277
-
2278
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/closeout/summary') {
2279
- sendJson(res, 200, summarizePhase8CloseoutPack());
2280
- return;
2281
- }
2282
-
2283
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/decision-record') {
2284
- sendJson(res, 200, buildPhase8DecisionRecordPack());
2285
- return;
2286
- }
2287
-
2288
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/decision-record/summary') {
2289
- sendJson(res, 200, summarizePhase8DecisionRecordPack());
2290
- return;
2291
- }
2292
-
2293
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/decision-resolution') {
2294
- sendJson(res, 200, buildPhase8DecisionResolutionPack());
2295
- return;
2296
- }
2297
-
2298
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/decision-resolution/summary') {
2299
- sendJson(res, 200, summarizePhase8DecisionResolutionPack());
2300
- return;
2301
- }
2302
-
2303
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/external-result-import/proof') {
2304
- sendJson(res, 200, buildPhase8ExternalResultImportProofPack());
2305
- return;
2306
- }
2307
-
2308
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/external-result-import/proof/summary') {
2309
- sendJson(res, 200, summarizePhase8ExternalResultImportProofPack());
2310
- return;
2311
- }
2312
-
2313
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/external-receipt-import/proof') {
2314
- sendJson(res, 200, buildPhase8ExternalReceiptImportProofPack());
2315
- return;
2316
- }
2317
-
2318
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/external-receipt-import/proof/summary') {
2319
- sendJson(res, 200, summarizePhase8ExternalReceiptImportProofPack());
2320
- return;
2321
- }
2322
-
2323
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/proof-bundle-normalization/proof') {
2324
- sendJson(res, 200, buildPhase8ProofBundleNormalizationProofPack());
2325
- return;
2326
- }
2327
-
2328
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-8/proof-bundle-normalization/proof/summary') {
2329
- sendJson(res, 200, summarizePhase8ProofBundleNormalizationProofPack());
2330
- return;
2331
- }
2332
-
2333
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9') {
2334
- sendJson(res, 200, buildPhase9TreasuryConnectivityPack());
2335
- return;
2336
- }
2337
-
2338
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/summary') {
2339
- sendJson(res, 200, summarizePhase9TreasuryConnectivityPack());
2340
- return;
2341
- }
2342
-
2343
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/treasury-continuity') {
2344
- sendJson(res, 200, buildPhase9TreasuryContinuityPack());
2345
- return;
2346
- }
2347
-
2348
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/treasury-continuity/summary') {
2349
- sendJson(res, 200, summarizePhase9TreasuryContinuityPack());
2350
- return;
2351
- }
2352
-
2353
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/completion') {
2354
- sendJson(res, 200, buildPhase9CompletionPack());
2355
- return;
2356
- }
2357
-
2358
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/completion/summary') {
2359
- sendJson(res, 200, summarizePhase9CompletionPack());
2360
- return;
2361
- }
2362
-
2363
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/freeze-baseline') {
2364
- sendJson(res, 200, buildPhase9FreezeBaselinePack());
2365
- return;
2366
- }
2367
-
2368
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/freeze-baseline/summary') {
2369
- sendJson(res, 200, summarizePhase9FreezeBaselinePack());
2370
- return;
2371
- }
2372
-
2373
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/freeze-review') {
2374
- sendJson(res, 200, buildPhase9FreezeReviewPack());
2375
- return;
2376
- }
2377
-
2378
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/freeze-review/summary') {
2379
- sendJson(res, 200, summarizePhase9FreezeReviewPack());
2380
- return;
2381
- }
2382
-
2383
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/gate') {
2384
- sendJson(res, 200, buildPhase9GatePack());
2385
- return;
2386
- }
2387
-
2388
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/gate/summary') {
2389
- sendJson(res, 200, summarizePhase9GatePack());
2390
- return;
2391
- }
2392
-
2393
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/closeout') {
2394
- sendJson(res, 200, buildPhase9CloseoutPack());
2395
- return;
2396
- }
2397
-
2398
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/closeout/summary') {
2399
- sendJson(res, 200, summarizePhase9CloseoutPack());
2400
- return;
2401
- }
2402
-
2403
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/decision-record') {
2404
- sendJson(res, 200, buildPhase9DecisionRecordPack());
2405
- return;
2406
- }
2407
-
2408
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/decision-record/summary') {
2409
- sendJson(res, 200, summarizePhase9DecisionRecordPack());
2410
- return;
2411
- }
2412
-
2413
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/decision-resolution') {
2414
- sendJson(res, 200, buildPhase9DecisionResolutionPack());
2415
- return;
2416
- }
2417
-
2418
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/decision-resolution/summary') {
2419
- sendJson(res, 200, summarizePhase9DecisionResolutionPack());
2420
- return;
2421
- }
2422
-
2423
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/treasury-destinations/proof') {
2424
- sendJson(res, 200, buildPhase9TreasuryDestinationsProofPack());
2425
- return;
2426
- }
2427
-
2428
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/treasury-destinations/proof/summary') {
2429
- sendJson(res, 200, summarizePhase9TreasuryDestinationsProofPack());
2430
- return;
2431
- }
2432
-
2433
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/custody-refs/proof') {
2434
- sendJson(res, 200, buildPhase9CustodyRefsProofPack());
2435
- return;
2436
- }
2437
-
2438
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/custody-refs/proof/summary') {
2439
- sendJson(res, 200, summarizePhase9CustodyRefsProofPack());
2440
- return;
2441
- }
2442
-
2443
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/operator-accounting-bridges/proof') {
2444
- sendJson(res, 200, buildPhase9OperatorAccountingBridgesProofPack());
2445
- return;
2446
- }
2447
-
2448
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-9/operator-accounting-bridges/proof/summary') {
2449
- sendJson(res, 200, summarizePhase9OperatorAccountingBridgesProofPack());
2450
- return;
2451
- }
2452
-
2453
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10') {
2454
- sendJson(res, 200, buildPhase10LongTailEcosystemPack());
2455
- return;
2456
- }
2457
-
2458
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/summary') {
2459
- sendJson(res, 200, summarizePhase10LongTailEcosystemPack());
2460
- return;
2461
- }
2462
-
2463
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/long-tail-continuity') {
2464
- sendJson(res, 200, buildPhase10LongTailContinuityPack());
2465
- return;
2466
- }
2467
-
2468
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/long-tail-continuity/summary') {
2469
- sendJson(res, 200, summarizePhase10LongTailContinuityPack());
2470
- return;
2471
- }
2472
-
2473
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/completion') {
2474
- sendJson(res, 200, buildPhase10CompletionPack());
2475
- return;
2476
- }
2477
-
2478
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/completion/summary') {
2479
- sendJson(res, 200, summarizePhase10CompletionPack());
2480
- return;
2481
- }
2482
-
2483
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/freeze-review') {
2484
- sendJson(res, 200, buildPhase10FreezeReviewPack());
2485
- return;
2486
- }
2487
-
2488
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/freeze-review/summary') {
2489
- sendJson(res, 200, summarizePhase10FreezeReviewPack());
2490
- return;
2491
- }
2492
-
2493
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/freeze-baseline') {
2494
- sendJson(res, 200, buildPhase10FreezeBaselinePack());
2495
- return;
2496
- }
2497
-
2498
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/freeze-baseline/summary') {
2499
- sendJson(res, 200, summarizePhase10FreezeBaselinePack());
2500
- return;
2501
- }
2502
-
2503
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/gate') {
2504
- sendJson(res, 200, buildPhase10GatePack());
2505
- return;
2506
- }
2507
-
2508
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/gate/summary') {
2509
- sendJson(res, 200, summarizePhase10GatePack());
2510
- return;
2511
- }
2512
-
2513
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/closeout') {
2514
- sendJson(res, 200, buildPhase10CloseoutPack());
2515
- return;
2516
- }
2517
-
2518
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/closeout/summary') {
2519
- sendJson(res, 200, summarizePhase10CloseoutPack());
2520
- return;
2521
- }
2522
-
2523
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/decision-record') {
2524
- sendJson(res, 200, buildPhase10DecisionRecordPack());
2525
- return;
2526
- }
2527
-
2528
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/decision-record/summary') {
2529
- sendJson(res, 200, summarizePhase10DecisionRecordPack());
2530
- return;
2531
- }
2532
-
2533
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/decision-resolution') {
2534
- sendJson(res, 200, buildPhase10DecisionResolutionPack());
2535
- return;
2536
- }
2537
-
2538
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/decision-resolution/summary') {
2539
- sendJson(res, 200, summarizePhase10DecisionResolutionPack());
2540
- return;
2541
- }
2542
-
2543
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/demand-signal-adapters/proof') {
2544
- sendJson(res, 200, buildPhase10DemandSignalAdaptersProofPack());
2545
- return;
2546
- }
2547
-
2548
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/demand-signal-adapters/proof/summary') {
2549
- sendJson(res, 200, summarizePhase10DemandSignalAdaptersProofPack());
2550
- return;
2551
- }
2552
-
2553
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/niche-extension-registry/proof') {
2554
- sendJson(res, 200, buildPhase10NicheExtensionRegistryProofPack());
2555
- return;
2556
- }
2557
-
2558
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/niche-extension-registry/proof/summary') {
2559
- sendJson(res, 200, summarizePhase10NicheExtensionRegistryProofPack());
2560
- return;
2561
- }
2562
-
2563
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/ecosystem-backlog-triage/proof') {
2564
- sendJson(res, 200, buildPhase10EcosystemBacklogTriageProofPack());
2565
- return;
2566
- }
2567
-
2568
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-10/ecosystem-backlog-triage/proof/summary') {
2569
- sendJson(res, 200, summarizePhase10EcosystemBacklogTriageProofPack());
2570
- return;
2571
- }
2572
-
2573
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/evm/proof') {
2574
- sendJson(res, 200, buildPhase2EvmProofPack());
2575
- return;
2576
- }
2577
-
2578
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/evm/proof/summary') {
2579
- sendJson(res, 200, summarizePhase2EvmProofPack());
2580
- return;
2581
- }
2582
-
2583
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/base/proof') {
2584
- sendJson(res, 200, buildPhase2BaseProofPack());
2585
- return;
2586
- }
2587
-
2588
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/base/proof/summary') {
2589
- sendJson(res, 200, summarizePhase2BaseProofPack());
2590
- return;
2591
- }
2592
-
2593
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/usdc/proof') {
2594
- sendJson(res, 200, buildPhase2UsdcProofPack());
2595
- return;
2596
- }
2597
-
2598
- if (req.method === 'GET' && url.pathname === '/v1/phases/phase-2/usdc/proof/summary') {
2599
- sendJson(res, 200, summarizePhase2UsdcProofPack());
2600
- return;
2601
- }
2602
-
2603
- if (req.method === 'GET' && url.pathname === '/v1/publish-plan') {
2604
- sendJson(res, 200, buildPublishPlan());
2605
- return;
2606
- }
2607
-
2608
- if (req.method === 'GET' && url.pathname === '/v1/publish-plan/summary') {
2609
- sendJson(res, 200, summarizePublishPlan());
2610
- return;
2611
- }
2612
-
2613
- if (req.method === 'GET' && url.pathname === '/v1/ecosystem-entry') {
2614
- sendJson(res, 200, buildEcosystemEntryPack());
2615
- return;
2616
- }
2617
-
2618
- if (req.method === 'GET' && url.pathname === '/v1/ecosystem-entry/summary') {
2619
- sendJson(res, 200, summarizeEcosystemEntryPack());
2620
- return;
2621
- }
2622
-
2623
- if (req.method === 'GET' && url.pathname === '/v1/launch-narrative') {
2624
- sendJson(res, 200, buildLaunchNarrativePack());
2625
- return;
2626
- }
2627
-
2628
- if (req.method === 'GET' && url.pathname === '/v1/launch-narrative/summary') {
2629
- sendJson(res, 200, summarizeLaunchNarrativePack());
2630
- return;
2631
- }
2632
-
2633
- if (req.method === 'GET' && url.pathname === '/v1/outreach-proof') {
2634
- sendJson(res, 200, buildOutreachProofPack());
2635
- return;
2636
- }
2637
-
2638
- if (req.method === 'GET' && url.pathname === '/v1/outreach-proof/summary') {
2639
- sendJson(res, 200, summarizeOutreachProofPack());
2640
- return;
2641
- }
2642
-
2643
- if (req.method === 'GET' && url.pathname === '/v1/announcement-pack') {
2644
- sendJson(res, 200, buildAnnouncementPack());
2645
- return;
2646
- }
2647
-
2648
- if (req.method === 'GET' && url.pathname === '/v1/announcement-pack/summary') {
2649
- sendJson(res, 200, summarizeAnnouncementPack());
2650
- return;
2651
- }
2652
-
2653
- if (req.method === 'GET' && url.pathname === '/v1/release-candidate') {
2654
- sendJson(res, 200, buildReleaseCandidatePack());
2655
- return;
2656
- }
2657
-
2658
- if (req.method === 'GET' && url.pathname === '/v1/release-candidate/summary') {
2659
- sendJson(res, 200, summarizeReleaseCandidatePack());
2660
- return;
2661
- }
2662
-
2663
- if (req.method === 'GET' && url.pathname === '/v1/trust-intelligence') {
2664
- sendJson(res, 200, buildTrustIntelligencePack());
2665
- return;
2666
- }
2667
-
2668
- if (req.method === 'GET' && url.pathname === '/v1/trust-intelligence/summary') {
2669
- sendJson(res, 200, summarizeTrustIntelligencePack());
2670
- return;
2671
- }
2672
-
2673
- if (req.method === 'GET' && url.pathname === '/v1/review-intelligence') {
2674
- sendJson(res, 200, buildReviewIntelligencePack());
2675
- return;
2676
- }
2677
-
2678
- if (req.method === 'GET' && url.pathname === '/v1/review-intelligence/summary') {
2679
- sendJson(res, 200, summarizeReviewIntelligencePack());
2680
- return;
2681
- }
2682
-
2683
- if (req.method === 'GET' && url.pathname === '/v1/governance-intelligence') {
2684
- sendJson(res, 200, buildGovernanceIntelligencePack());
2685
- return;
2686
- }
2687
-
2688
- if (req.method === 'GET' && url.pathname === '/v1/governance-intelligence/summary') {
2689
- sendJson(res, 200, summarizeGovernanceIntelligencePack());
2690
- return;
2691
- }
2692
-
2693
- if (req.method === 'GET' && url.pathname === '/v1/bridge-intelligence') {
2694
- sendJson(res, 200, buildBridgeIntelligencePack());
2695
- return;
2696
- }
2697
-
2698
- if (req.method === 'GET' && url.pathname === '/v1/bridge-intelligence/summary') {
2699
- sendJson(res, 200, summarizeBridgeIntelligencePack());
2700
- return;
2701
- }
2702
-
2703
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze') {
2704
- sendJson(res, 200, buildRoleFreezePack());
2705
- return;
2706
- }
2707
-
2708
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/summary') {
2709
- sendJson(res, 200, summarizeRoleFreezePack());
2710
- return;
2711
- }
2712
-
2713
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/operator-bundle') {
2714
- sendJson(res, 200, buildRoleFreezeOperatorBundle());
2715
- return;
2716
- }
2717
-
2718
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/operator-bundle/summary') {
2719
- sendJson(res, 200, summarizeRoleFreezeOperatorBundle());
2720
- return;
2721
- }
2722
-
2723
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/policy-pack') {
2724
- sendJson(res, 200, buildRoleFreezePolicyPack());
2725
- return;
2726
- }
2727
-
2728
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/policy-pack/summary') {
2729
- sendJson(res, 200, summarizeRoleFreezePolicyPack());
2730
- return;
2731
- }
2732
-
2733
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/policy-application-summary') {
2734
- sendJson(res, 200, buildRoleFreezePolicyApplicationSummary(url.searchParams.get('template_id')));
2735
- return;
2736
- }
2737
-
2738
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/package') {
2739
- sendJson(res, 200, buildRoleFreezePackage());
2740
- return;
2741
- }
2742
-
2743
- if (req.method === 'GET' && url.pathname === '/v1/role-freeze/package/summary') {
2744
- sendJson(res, 200, summarizeRoleFreezePackage());
2745
- return;
2746
- }
2747
-
2748
- if (req.method === 'GET' && url.pathname === '/v1/role-transition') {
2749
- sendJson(res, 200, buildRoleTransitionPack());
2750
- return;
2751
- }
2752
-
2753
- if (req.method === 'GET' && url.pathname === '/v1/role-transition/summary') {
2754
- sendJson(res, 200, summarizeRoleTransitionPack());
2755
- return;
2756
- }
2757
-
2758
- if (req.method === 'GET' && url.pathname === '/v1/capability-registry-home') {
2759
- sendJson(res, 200, buildCapabilityRegistryHomePack());
2760
- return;
2761
- }
2762
-
2763
- if (req.method === 'GET' && url.pathname === '/v1/capability-registry-home/summary') {
2764
- sendJson(res, 200, summarizeCapabilityRegistryHomePack());
2765
- return;
2766
- }
2767
-
2768
- if (req.method === 'GET' && url.pathname === '/v1/proof-center') {
2769
- sendJson(res, 200, proofSdk.buildDefaultProofCenter());
2770
- return;
2771
- }
2772
-
2773
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/summary') {
2774
- sendJson(res, 200, proofSdk.summarizeDefaultProofCenter());
2775
- return;
2776
- }
2777
-
2778
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-standard') {
2779
- sendJson(res, 200, proofSdk.buildxoonyaNativeProofStandard());
2780
- return;
2781
- }
2782
-
2783
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-standard/summary') {
2784
- sendJson(res, 200, proofSdk.summarizexoonyaNativeProofStandard());
2785
- return;
2786
- }
2787
-
2788
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-hybrid-readiness') {
2789
- sendJson(res, 200, proofSdk.buildxoonyaNativeHybridReadinessPack());
2790
- return;
2791
- }
2792
-
2793
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-hybrid-readiness/summary') {
2794
- sendJson(res, 200, proofSdk.summarizexoonyaNativeHybridReadinessPack());
2795
- return;
2796
- }
2797
-
2798
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-standardization') {
2799
- sendJson(res, 200, proofSdk.buildxoonyaNativeStandardizationPack());
2800
- return;
2801
- }
2802
-
2803
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-standardization/summary') {
2804
- sendJson(res, 200, proofSdk.summarizexoonyaNativeStandardizationPack());
2805
- return;
2806
- }
2807
-
2808
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-conformance-mark') {
2809
- sendJson(res, 200, proofSdk.buildxoonyaNativeConformanceMarkPack());
2810
- return;
2811
- }
2812
-
2813
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-conformance-mark/summary') {
2814
- sendJson(res, 200, proofSdk.summarizexoonyaNativeConformanceMarkPack());
2815
- return;
2816
- }
2817
-
2818
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-reference-implementations') {
2819
- sendJson(res, 200, proofSdk.buildxoonyaNativeReferenceImplementationPack());
2820
- return;
2821
- }
2822
-
2823
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-reference-implementations/summary') {
2824
- sendJson(res, 200, proofSdk.summarizexoonyaNativeReferenceImplementationPack());
2825
- return;
2826
- }
2827
-
2828
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-payload-profile') {
2829
- sendJson(res, 200, proofSdk.buildxoonyaNativePayloadProfilePack());
2830
- return;
2831
- }
2832
-
2833
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-payload-profile/summary') {
2834
- sendJson(res, 200, proofSdk.summarizexoonyaNativePayloadProfilePack());
2835
- return;
2836
- }
2837
-
2838
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-line-rate-frame') {
2839
- sendJson(res, 200, proofSdk.buildxoonyaNativeLineRateFramePack());
2840
- return;
2841
- }
2842
-
2843
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-line-rate-frame/summary') {
2844
- sendJson(res, 200, proofSdk.summarizexoonyaNativeLineRateFramePack());
2845
- return;
2846
- }
2847
-
2848
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-atom-spec') {
2849
- sendJson(res, 200, proofSdk.buildxoonyaNativeAtomSpec());
2850
- return;
2851
- }
2852
-
2853
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-atom-spec/summary') {
2854
- sendJson(res, 200, proofSdk.summarizexoonyaNativeAtomSpec());
2855
- return;
2856
- }
2857
-
2858
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-atom-conformance') {
2859
- sendJson(res, 200, proofSdk.buildxoonyaNativeAtomConformancePack());
2860
- return;
2861
- }
2862
-
2863
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-atom-conformance/summary') {
2864
- sendJson(res, 200, proofSdk.summarizexoonyaNativeAtomConformancePack());
2865
- return;
2866
- }
2867
-
2868
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-anchor-profile') {
2869
- sendJson(res, 200, proofSdk.buildxoonyaNativeAnchorProfile());
2870
- return;
2871
- }
2872
-
2873
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/native-anchor-profile/summary') {
2874
- sendJson(res, 200, proofSdk.summarizexoonyaNativeAnchorProfile());
2875
- return;
2876
- }
2877
-
2878
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/import-adapter') {
2879
- sendJson(res, 200, proofSdk.buildExternalProofImportAdapterPack());
2880
- return;
2881
- }
2882
-
2883
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/import-adapter/summary') {
2884
- sendJson(res, 200, proofSdk.summarizeExternalProofImportAdapterPack());
2885
- return;
2886
- }
2887
-
2888
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/default-loops') {
2889
- sendJson(res, 200, proofSdk.buildDefaultProofLoopCatalog());
2890
- return;
2891
- }
2892
-
2893
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/default-loops/summary') {
2894
- sendJson(res, 200, proofSdk.summarizeDefaultProofLoops());
2895
- return;
2896
- }
2897
-
2898
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/transaction-handoff') {
2899
- sendJson(res, 200, proofSdk.buildTransactionProofHandoffCenter());
2900
- return;
2901
- }
2902
-
2903
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/transaction-handoff/summary') {
2904
- sendJson(res, 200, proofSdk.summarizeTransactionProofHandoffCenter());
2905
- return;
2906
- }
2907
-
2908
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/interaction-spine-handoff') {
2909
- sendJson(res, 200, proofSdk.buildInteractionSpineProofHandoffCenter());
2910
- return;
2911
- }
2912
-
2913
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/interaction-spine-handoff/summary') {
2914
- sendJson(res, 200, proofSdk.summarizeInteractionSpineProofHandoffCenter());
2915
- return;
2916
- }
2917
-
2918
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/result-package-handoff') {
2919
- sendJson(res, 200, proofSdk.buildInteractionResultPackageHandoffCenter());
2920
- return;
2921
- }
2922
-
2923
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/result-package-handoff/summary') {
2924
- sendJson(res, 200, proofSdk.summarizeInteractionResultPackageHandoffCenter());
2925
- return;
2926
- }
2927
-
2928
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/governance') {
2929
- sendJson(res, 200, proofSdk.buildGovernanceCenter());
2930
- return;
2931
- }
2932
-
2933
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/governance/summary') {
2934
- sendJson(res, 200, proofSdk.summarizeGovernanceCenter());
2935
- return;
2936
- }
2937
-
2938
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/bridge') {
2939
- sendJson(res, 200, proofSdk.buildBridgeCenter());
2940
- return;
2941
- }
2942
-
2943
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/bridge/summary') {
2944
- sendJson(res, 200, proofSdk.summarizeBridgeCenter());
2945
- return;
2946
- }
2947
-
2948
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/verification-services') {
2949
- sendJson(res, 200, buildVerificationServicesPack());
2950
- return;
2951
- }
2952
-
2953
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/verification-services/summary') {
2954
- sendJson(res, 200, summarizeVerificationServicesPack());
2955
- return;
2956
- }
2957
-
2958
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/bridge/profile-support') {
2959
- sendJson(res, 200, proofSdk.buildBridgeProfileSupport());
2960
- return;
2961
- }
2962
-
2963
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/default-loop') {
2964
- const loop = proofSdk.getDefaultProofLoop(url.searchParams.get('ref'));
2965
- if (!loop) {
2966
- sendJson(res, 404, { ok: false, error: 'default_proof_loop_not_found' });
2967
- return;
2968
- }
2969
- sendJson(res, 200, { ok: true, loop });
2970
- return;
2971
- }
2972
-
2973
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/default-loops/run') {
2974
- try {
2975
- const body = await readJsonBody(req);
2976
- if (rejectPrivateKeyMaterial(res, body)) return;
2977
- const loopRef = String(body.loop_ref || '').trim();
2978
- const result = proofSdk.runDefaultProofLoop(loopRef, body);
2979
- sendJson(res, 200, result);
2980
- } catch (error) {
2981
- sendJson(res, error.message === 'default_proof_loop_not_found' ? 404 : 400, { ok: false, reason: error.message });
2982
- }
2983
- return;
2984
- }
2985
-
2986
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/import-adapter/review') {
2987
- try {
2988
- const body = await readJsonBody(req);
2989
- const result = proofSdk.reviewExternalProofImport(body);
2990
- sendJson(res, 200, result);
2991
- } catch (error) {
2992
- sendJson(res, 400, { ok: false, reason: error.message });
2993
- }
2994
- return;
2995
- }
2996
-
2997
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/import-adapter/review/summary') {
2998
- try {
2999
- const body = await readJsonBody(req);
3000
- const result = proofSdk.summarizeExternalProofImportReview(body);
3001
- sendJson(res, 200, result);
3002
- } catch (error) {
3003
- sendJson(res, 400, { ok: false, reason: error.message });
3004
- }
3005
- return;
3006
- }
3007
-
3008
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/import-adapter/run') {
3009
- try {
3010
- const body = await readJsonBody(req);
3011
- const result = proofSdk.runExternalProofImport(body);
3012
- sendJson(res, 200, result);
3013
- } catch (error) {
3014
- sendJson(res, 400, { ok: false, reason: error.message });
3015
- }
3016
- return;
3017
- }
3018
-
3019
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/import-adapter/verify-signature') {
3020
- if (enforcePaidVerification(res, 'proof.verify-signature')) return;
3021
- try {
3022
- const body = await readJsonBody(req);
3023
- if (rejectPrivateKeyMaterial(res, body)) return;
3024
- const result = proofSdk.verifyExternalProofSignature(body);
3025
- sendJson(res, 200, result);
3026
- } catch (error) {
3027
- sendJson(res, 400, { ok: false, reason: error.message });
3028
- }
3029
- return;
3030
- }
3031
-
3032
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/transaction-handoff/run') {
3033
- try {
3034
- const body = await readJsonBody(req);
3035
- if (rejectPrivateKeyMaterial(res, body)) return;
3036
- const result = proofSdk.runTransactionProofHandoff(body);
3037
- sendJson(res, 200, result);
3038
- } catch (error) {
3039
- sendJson(res, 400, { ok: false, reason: error.message });
3040
- }
3041
- return;
3042
- }
3043
-
3044
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/interaction-spine-handoff/run') {
3045
- try {
3046
- const body = await readJsonBody(req);
3047
- if (rejectPrivateKeyMaterial(res, body)) return;
3048
- const result = proofSdk.runInteractionSpineProofHandoff(body);
3049
- sendJson(res, 200, result);
3050
- } catch (error) {
3051
- sendJson(res, 400, { ok: false, reason: error.message });
3052
- }
3053
- return;
3054
- }
3055
-
3056
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/run') {
3057
- try {
3058
- const body = await readJsonBody(req);
3059
- if (rejectPrivateKeyMaterial(res, body)) return;
3060
- const result = proofSdk.runInteractionResultPackageHandoff(body);
3061
- sendJson(res, 200, result);
3062
- } catch (error) {
3063
- sendJson(res, 400, { ok: false, reason: error.message });
3064
- }
3065
- return;
3066
- }
3067
-
3068
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review') {
3069
- try {
3070
- const body = await readJsonBody(req);
3071
- const result = proofSdk.reviewInteractionResultPackageHandoff(body);
3072
- sendJson(res, 200, result);
3073
- } catch (error) {
3074
- sendJson(res, 400, { ok: false, reason: error.message });
3075
- }
3076
- return;
3077
- }
3078
-
3079
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/summary') {
3080
- try {
3081
- const body = await readJsonBody(req);
3082
- const result = proofSdk.summarizeReviewedInteractionResultPackageHandoff(body);
3083
- sendJson(res, 200, result);
3084
- } catch (error) {
3085
- sendJson(res, 400, { ok: false, reason: error.message });
3086
- }
3087
- return;
3088
- }
3089
-
3090
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/extension-readiness') {
3091
- try {
3092
- const body = await readJsonBody(req);
3093
- const result = proofSdk.summarizeReviewExtensionReadiness(body);
3094
- sendJson(res, 200, result);
3095
- } catch (error) {
3096
- sendJson(res, 400, { ok: false, reason: error.message });
3097
- }
3098
- return;
3099
- }
3100
-
3101
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/extension-boundary') {
3102
- try {
3103
- const body = await readJsonBody(req);
3104
- const result = proofSdk.summarizeReviewExtensionBoundary(body);
3105
- sendJson(res, 200, result);
3106
- } catch (error) {
3107
- sendJson(res, 400, { ok: false, reason: error.message });
3108
- }
3109
- return;
3110
- }
3111
-
3112
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/default-continuation') {
3113
- try {
3114
- const body = await readJsonBody(req);
3115
- const result = proofSdk.summarizeReviewReusableDefaultContinuation(body);
3116
- sendJson(res, 200, result);
3117
- } catch (error) {
3118
- sendJson(res, 400, { ok: false, reason: error.message });
3119
- }
3120
- return;
3121
- }
3122
-
3123
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/default-boundary') {
3124
- try {
3125
- const body = await readJsonBody(req);
3126
- const result = proofSdk.summarizeReviewReusableDefaultBoundary(body);
3127
- sendJson(res, 200, result);
3128
- } catch (error) {
3129
- sendJson(res, 400, { ok: false, reason: error.message });
3130
- }
3131
- return;
3132
- }
3133
-
3134
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/contract-summary') {
3135
- try {
3136
- const body = await readJsonBody(req);
3137
- const result = proofSdk.summarizeReviewCompositionContract(body);
3138
- sendJson(res, 200, result);
3139
- } catch (error) {
3140
- sendJson(res, 400, { ok: false, reason: error.message });
3141
- }
3142
- return;
3143
- }
3144
-
3145
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/contract-boundary') {
3146
- try {
3147
- const body = await readJsonBody(req);
3148
- const result = proofSdk.summarizeReviewCompositionContractBoundary(body);
3149
- sendJson(res, 200, result);
3150
- } catch (error) {
3151
- sendJson(res, 400, { ok: false, reason: error.message });
3152
- }
3153
- return;
3154
- }
3155
-
3156
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/contract-carry') {
3157
- try {
3158
- const body = await readJsonBody(req);
3159
- const result = proofSdk.summarizeReviewCompositionContractCarry(body);
3160
- sendJson(res, 200, result);
3161
- } catch (error) {
3162
- sendJson(res, 400, { ok: false, reason: error.message });
3163
- }
3164
- return;
3165
- }
3166
-
3167
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/bridge-summary') {
3168
- try {
3169
- const body = await readJsonBody(req);
3170
- const result = proofSdk.summarizeReviewBridgeSummary(body);
3171
- sendJson(res, 200, result);
3172
- } catch (error) {
3173
- sendJson(res, 400, { ok: false, reason: error.message });
3174
- }
3175
- return;
3176
- }
3177
-
3178
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/bridge-boundary') {
3179
- try {
3180
- const body = await readJsonBody(req);
3181
- const result = proofSdk.summarizeReviewBridgeBoundary(body);
3182
- sendJson(res, 200, result);
3183
- } catch (error) {
3184
- sendJson(res, 400, { ok: false, reason: error.message });
3185
- }
3186
- return;
3187
- }
3188
-
3189
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/bridge-carry') {
3190
- try {
3191
- const body = await readJsonBody(req);
3192
- const result = proofSdk.summarizeReviewBridgeCarry(body);
3193
- sendJson(res, 200, result);
3194
- } catch (error) {
3195
- sendJson(res, 400, { ok: false, reason: error.message });
3196
- }
3197
- return;
3198
- }
3199
-
3200
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/bridge-run') {
3201
- try {
3202
- const body = await readJsonBody(req);
3203
- const result = proofSdk.summarizeReviewBridgeRun(body);
3204
- sendJson(res, 200, result);
3205
- } catch (error) {
3206
- sendJson(res, 400, { ok: false, reason: error.message });
3207
- }
3208
- return;
3209
- }
3210
-
3211
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-continuity') {
3212
- try {
3213
- const body = await readJsonBody(req);
3214
- const result = proofSdk.summarizeReviewHandoffContinuity(body);
3215
- sendJson(res, 200, result);
3216
- } catch (error) {
3217
- sendJson(res, 400, { ok: false, reason: error.message });
3218
- }
3219
- return;
3220
- }
3221
-
3222
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-intake') {
3223
- try {
3224
- const body = await readJsonBody(req);
3225
- const result = proofSdk.summarizeReviewHandoffIntake(body);
3226
- sendJson(res, 200, result);
3227
- } catch (error) {
3228
- sendJson(res, 400, { ok: false, reason: error.message });
3229
- }
3230
- return;
3231
- }
3232
-
3233
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-intake-boundary') {
3234
- try {
3235
- const body = await readJsonBody(req);
3236
- const result = proofSdk.summarizeReviewHandoffIntakeBoundary(body);
3237
- sendJson(res, 200, result);
3238
- } catch (error) {
3239
- sendJson(res, 400, { ok: false, reason: error.message });
3240
- }
3241
- return;
3242
- }
3243
-
3244
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-intake-carry') {
3245
- try {
3246
- const body = await readJsonBody(req);
3247
- const result = proofSdk.summarizeReviewHandoffIntakeCarry(body);
3248
- sendJson(res, 200, result);
3249
- } catch (error) {
3250
- sendJson(res, 400, { ok: false, reason: error.message });
3251
- }
3252
- return;
3253
- }
3254
-
3255
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-package-intake') {
3256
- try {
3257
- const body = await readJsonBody(req);
3258
- const result = proofSdk.summarizeReviewHandoffPackageIntake(body);
3259
- sendJson(res, 200, result);
3260
- } catch (error) {
3261
- sendJson(res, 400, { ok: false, reason: error.message });
3262
- }
3263
- return;
3264
- }
3265
-
3266
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-package-carry') {
3267
- try {
3268
- const body = await readJsonBody(req);
3269
- const result = proofSdk.summarizeReviewHandoffPackageCarry(body);
3270
- sendJson(res, 200, result);
3271
- } catch (error) {
3272
- sendJson(res, 400, { ok: false, reason: error.message });
3273
- }
3274
- return;
3275
- }
3276
-
3277
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-package-run') {
3278
- try {
3279
- const body = await readJsonBody(req);
3280
- const result = proofSdk.summarizeReviewHandoffPackageRun(body);
3281
- sendJson(res, 200, result);
3282
- } catch (error) {
3283
- sendJson(res, 400, { ok: false, reason: error.message });
3284
- }
3285
- return;
3286
- }
3287
-
3288
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/execution-package') {
3289
- try {
3290
- const body = await readJsonBody(req);
3291
- const result = proofSdk.summarizeReviewExecutionPackage(body);
3292
- sendJson(res, 200, result);
3293
- } catch (error) {
3294
- sendJson(res, 400, { ok: false, reason: error.message });
3295
- }
3296
- return;
3297
- }
3298
-
3299
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/execution-package-carry') {
3300
- try {
3301
- const body = await readJsonBody(req);
3302
- const result = proofSdk.summarizeReviewExecutionPackageCarry(body);
3303
- sendJson(res, 200, result);
3304
- } catch (error) {
3305
- sendJson(res, 400, { ok: false, reason: error.message });
3306
- }
3307
- return;
3308
- }
3309
-
3310
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/execution-package-run') {
3311
- try {
3312
- const body = await readJsonBody(req);
3313
- const result = proofSdk.summarizeReviewExecutionPackageRun(body);
3314
- sendJson(res, 200, result);
3315
- } catch (error) {
3316
- sendJson(res, 400, { ok: false, reason: error.message });
3317
- }
3318
- return;
3319
- }
3320
-
3321
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/execution-contract') {
3322
- try {
3323
- const body = await readJsonBody(req);
3324
- const result = proofSdk.summarizeReviewExecutionContract(body);
3325
- sendJson(res, 200, result);
3326
- } catch (error) {
3327
- sendJson(res, 400, { ok: false, reason: error.message });
3328
- }
3329
- return;
3330
- }
3331
-
3332
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/execution-contract-carry') {
3333
- try {
3334
- const body = await readJsonBody(req);
3335
- const result = proofSdk.summarizeReviewExecutionContractCarry(body);
3336
- sendJson(res, 200, result);
3337
- } catch (error) {
3338
- sendJson(res, 400, { ok: false, reason: error.message });
3339
- }
3340
- return;
3341
- }
3342
-
3343
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/execution-contract-run') {
3344
- try {
3345
- const body = await readJsonBody(req);
3346
- const result = proofSdk.summarizeReviewExecutionContractRun(body);
3347
- sendJson(res, 200, result);
3348
- } catch (error) {
3349
- sendJson(res, 400, { ok: false, reason: error.message });
3350
- }
3351
- return;
3352
- }
3353
-
3354
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-contract') {
3355
- try {
3356
- const body = await readJsonBody(req);
3357
- const result = proofSdk.summarizeReviewOperatingContract(body);
3358
- sendJson(res, 200, result);
3359
- } catch (error) {
3360
- sendJson(res, 400, { ok: false, reason: error.message });
3361
- }
3362
- return;
3363
- }
3364
-
3365
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-contract-carry') {
3366
- try {
3367
- const body = await readJsonBody(req);
3368
- const result = proofSdk.summarizeReviewOperatingContractCarry(body);
3369
- sendJson(res, 200, result);
3370
- } catch (error) {
3371
- sendJson(res, 400, { ok: false, reason: error.message });
3372
- }
3373
- return;
3374
- }
3375
-
3376
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-contract-run') {
3377
- try {
3378
- const body = await readJsonBody(req);
3379
- const result = proofSdk.summarizeReviewOperatingContractRun(body);
3380
- sendJson(res, 200, result);
3381
- } catch (error) {
3382
- sendJson(res, 400, { ok: false, reason: error.message });
3383
- }
3384
- return;
3385
- }
3386
-
3387
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-interface') {
3388
- try {
3389
- const body = await readJsonBody(req);
3390
- const result = proofSdk.summarizeReviewOperatingInterface(body);
3391
- sendJson(res, 200, result);
3392
- } catch (error) {
3393
- sendJson(res, 400, { ok: false, reason: error.message });
3394
- }
3395
- return;
3396
- }
3397
-
3398
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-interface-carry') {
3399
- try {
3400
- const body = await readJsonBody(req);
3401
- const result = proofSdk.summarizeReviewOperatingInterfaceCarry(body);
3402
- sendJson(res, 200, result);
3403
- } catch (error) {
3404
- sendJson(res, 400, { ok: false, reason: error.message });
3405
- }
3406
- return;
3407
- }
3408
-
3409
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-interface-run') {
3410
- try {
3411
- const body = await readJsonBody(req);
3412
- const result = proofSdk.summarizeReviewOperatingInterfaceRun(body);
3413
- sendJson(res, 200, result);
3414
- } catch (error) {
3415
- sendJson(res, 400, { ok: false, reason: error.message });
3416
- }
3417
- return;
3418
- }
3419
-
3420
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-integration') {
3421
- try {
3422
- const body = await readJsonBody(req);
3423
- const result = proofSdk.summarizeReviewOperatingIntegration(body);
3424
- sendJson(res, 200, result);
3425
- } catch (error) {
3426
- sendJson(res, 400, { ok: false, reason: error.message });
3427
- }
3428
- return;
3429
- }
3430
-
3431
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-integration-carry') {
3432
- try {
3433
- const body = await readJsonBody(req);
3434
- const result = proofSdk.summarizeReviewOperatingIntegrationCarry(body);
3435
- sendJson(res, 200, result);
3436
- } catch (error) {
3437
- sendJson(res, 400, { ok: false, reason: error.message });
3438
- }
3439
- return;
3440
- }
3441
-
3442
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-integration-run') {
3443
- try {
3444
- const body = await readJsonBody(req);
3445
- const result = proofSdk.summarizeReviewOperatingIntegrationRun(body);
3446
- sendJson(res, 200, result);
3447
- } catch (error) {
3448
- sendJson(res, 400, { ok: false, reason: error.message });
3449
- }
3450
- return;
3451
- }
3452
-
3453
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-path') {
3454
- try {
3455
- const body = await readJsonBody(req);
3456
- const result = proofSdk.summarizeReviewOperatingPath(body);
3457
- sendJson(res, 200, result);
3458
- } catch (error) {
3459
- sendJson(res, 400, { ok: false, reason: error.message });
3460
- }
3461
- return;
3462
- }
3463
-
3464
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-path-carry') {
3465
- try {
3466
- const body = await readJsonBody(req);
3467
- const result = proofSdk.summarizeReviewOperatingPathCarry(body);
3468
- sendJson(res, 200, result);
3469
- } catch (error) {
3470
- sendJson(res, 400, { ok: false, reason: error.message });
3471
- }
3472
- return;
3473
- }
3474
-
3475
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/operating-path-run') {
3476
- try {
3477
- const body = await readJsonBody(req);
3478
- const result = proofSdk.summarizeReviewOperatingPathRun(body);
3479
- sendJson(res, 200, result);
3480
- } catch (error) {
3481
- sendJson(res, 400, { ok: false, reason: error.message });
3482
- }
3483
- return;
3484
- }
3485
-
3486
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/complete-default-path') {
3487
- try {
3488
- const body = await readJsonBody(req);
3489
- const result = proofSdk.summarizeReviewCompleteDefaultPath(body);
3490
- sendJson(res, 200, result);
3491
- } catch (error) {
3492
- sendJson(res, 400, { ok: false, reason: error.message });
3493
- }
3494
- return;
3495
- }
3496
-
3497
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/complete-default-path-carry') {
3498
- try {
3499
- const body = await readJsonBody(req);
3500
- const result = proofSdk.summarizeReviewCompleteDefaultPathCarry(body);
3501
- sendJson(res, 200, result);
3502
- } catch (error) {
3503
- sendJson(res, 400, { ok: false, reason: error.message });
3504
- }
3505
- return;
3506
- }
3507
-
3508
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/complete-default-path-run') {
3509
- try {
3510
- const body = await readJsonBody(req);
3511
- const result = proofSdk.summarizeReviewCompleteDefaultPathRun(body);
3512
- sendJson(res, 200, result);
3513
- } catch (error) {
3514
- sendJson(res, 400, { ok: false, reason: error.message });
3515
- }
3516
- return;
3517
- }
3518
-
3519
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/result-package-handoff/review/handoff-run') {
3520
- try {
3521
- const body = await readJsonBody(req);
3522
- const result = proofSdk.summarizeReviewHandoffRun(body);
3523
- sendJson(res, 200, result);
3524
- } catch (error) {
3525
- sendJson(res, 400, { ok: false, reason: error.message });
3526
- }
3527
- return;
3528
- }
3529
-
3530
- if (req.method === 'POST' && url.pathname === '/v1/receipts/verify') {
3531
- if (enforcePaidVerification(res, 'proof.verify-receipt')) return;
3532
- try {
3533
- const body = await readJsonBody(req);
3534
- const payloadBuffer = payloadBufferFromBody(body);
3535
- const opreturnHex = String(body.opreturn_hex || '');
3536
- const requestedVersion = String(body.spec_version || '').trim().toLowerCase();
3537
- const result = requestedVersion === 'v2'
3538
- ? proofSdk.verifyReceiptV2(opreturnHex, payloadBuffer)
3539
- : proofSdk.verifyReceipt(opreturnHex, payloadBuffer);
3540
- sendJson(res, 200, result);
3541
- } catch (error) {
3542
- sendJson(res, 400, { valid: false, reason: error.message });
3543
- }
3544
- return;
3545
- }
3546
-
3547
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/interpretation-validate') {
3548
- try {
3549
- const body = await readJsonBody(req);
3550
- const result = proofSdk.validateGovernanceInterpretation(body);
3551
- sendJson(res, 200, result);
3552
- } catch (error) {
3553
- sendJson(res, 400, { ok: false, reason: error.message });
3554
- }
3555
- return;
3556
- }
3557
-
3558
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/coordination') {
3559
- try {
3560
- const body = await readJsonBody(req);
3561
- const result = proofSdk.emitGovernanceCoordination(body);
3562
- sendJson(res, 200, result);
3563
- } catch (error) {
3564
- sendJson(res, 400, { ok: false, reason: error.message });
3565
- }
3566
- return;
3567
- }
3568
-
3569
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/dashboard') {
3570
- try {
3571
- const body = await readJsonBody(req);
3572
- const result = proofSdk.summarizeGovernanceDashboard(body);
3573
- sendJson(res, 200, result);
3574
- } catch (error) {
3575
- sendJson(res, 400, { ok: false, reason: error.message });
3576
- }
3577
- return;
3578
- }
3579
-
3580
- if (req.method === 'POST' && url.pathname === '/v1/review-intelligence') {
3581
- try {
3582
- const body = await readJsonBody(req);
3583
- const result = buildReviewIntelligencePack(body);
3584
- sendJson(res, 200, result);
3585
- } catch (error) {
3586
- sendJson(res, 400, { ok: false, reason: error.message });
3587
- }
3588
- return;
3589
- }
3590
-
3591
- if (req.method === 'POST' && url.pathname === '/v1/review-intelligence/summary') {
3592
- try {
3593
- const body = await readJsonBody(req);
3594
- const result = summarizeReviewIntelligencePack(body);
3595
- sendJson(res, 200, result);
3596
- } catch (error) {
3597
- sendJson(res, 400, { ok: false, reason: error.message });
3598
- }
3599
- return;
3600
- }
3601
-
3602
- if (req.method === 'POST' && url.pathname === '/v1/governance-intelligence') {
3603
- try {
3604
- const body = await readJsonBody(req);
3605
- const result = buildGovernanceIntelligencePack(body);
3606
- sendJson(res, 200, result);
3607
- } catch (error) {
3608
- sendJson(res, 400, { ok: false, reason: error.message });
3609
- }
3610
- return;
3611
- }
3612
-
3613
- if (req.method === 'POST' && url.pathname === '/v1/governance-intelligence/summary') {
3614
- try {
3615
- const body = await readJsonBody(req);
3616
- const result = summarizeGovernanceIntelligencePack(body);
3617
- sendJson(res, 200, result);
3618
- } catch (error) {
3619
- sendJson(res, 400, { ok: false, reason: error.message });
3620
- }
3621
- return;
3622
- }
3623
-
3624
- if (req.method === 'POST' && url.pathname === '/v1/bridge-intelligence') {
3625
- try {
3626
- const body = await readJsonBody(req);
3627
- const result = buildBridgeIntelligencePack(body);
3628
- sendJson(res, 200, result);
3629
- } catch (error) {
3630
- sendJson(res, 400, { ok: false, reason: error.message });
3631
- }
3632
- return;
3633
- }
3634
-
3635
- if (req.method === 'POST' && url.pathname === '/v1/bridge-intelligence/summary') {
3636
- try {
3637
- const body = await readJsonBody(req);
3638
- const result = summarizeBridgeIntelligencePack(body);
3639
- sendJson(res, 200, result);
3640
- } catch (error) {
3641
- sendJson(res, 400, { ok: false, reason: error.message });
3642
- }
3643
- return;
3644
- }
3645
-
3646
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze') {
3647
- try {
3648
- await readJsonBody(req);
3649
- const result = buildRoleFreezePack();
3650
- sendJson(res, 200, result);
3651
- } catch (error) {
3652
- sendJson(res, 400, { ok: false, reason: error.message });
3653
- }
3654
- return;
3655
- }
3656
-
3657
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/summary') {
3658
- try {
3659
- await readJsonBody(req);
3660
- const result = summarizeRoleFreezePack();
3661
- sendJson(res, 200, result);
3662
- } catch (error) {
3663
- sendJson(res, 400, { ok: false, reason: error.message });
3664
- }
3665
- return;
3666
- }
3667
-
3668
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/operator-bundle') {
3669
- try {
3670
- await readJsonBody(req);
3671
- const result = buildRoleFreezeOperatorBundle();
3672
- sendJson(res, 200, result);
3673
- } catch (error) {
3674
- sendJson(res, 400, { ok: false, reason: error.message });
3675
- }
3676
- return;
3677
- }
3678
-
3679
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/operator-bundle/summary') {
3680
- try {
3681
- await readJsonBody(req);
3682
- const result = summarizeRoleFreezeOperatorBundle();
3683
- sendJson(res, 200, result);
3684
- } catch (error) {
3685
- sendJson(res, 400, { ok: false, reason: error.message });
3686
- }
3687
- return;
3688
- }
3689
-
3690
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/policy-pack') {
3691
- try {
3692
- await readJsonBody(req);
3693
- const result = buildRoleFreezePolicyPack();
3694
- sendJson(res, 200, result);
3695
- } catch (error) {
3696
- sendJson(res, 400, { ok: false, reason: error.message });
3697
- }
3698
- return;
3699
- }
3700
-
3701
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/policy-pack/summary') {
3702
- try {
3703
- await readJsonBody(req);
3704
- const result = summarizeRoleFreezePolicyPack();
3705
- sendJson(res, 200, result);
3706
- } catch (error) {
3707
- sendJson(res, 400, { ok: false, reason: error.message });
3708
- }
3709
- return;
3710
- }
3711
-
3712
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/policy-application-summary') {
3713
- try {
3714
- const body = await readJsonBody(req);
3715
- const result = buildRoleFreezePolicyApplicationSummary(body && body.template_id ? body.template_id : null);
3716
- sendJson(res, 200, result);
3717
- } catch (error) {
3718
- sendJson(res, 400, { ok: false, reason: error.message });
3719
- }
3720
- return;
3721
- }
3722
-
3723
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/package') {
3724
- try {
3725
- await readJsonBody(req);
3726
- const result = buildRoleFreezePackage();
3727
- sendJson(res, 200, result);
3728
- } catch (error) {
3729
- sendJson(res, 400, { ok: false, reason: error.message });
3730
- }
3731
- return;
3732
- }
3733
-
3734
- if (req.method === 'POST' && url.pathname === '/v1/role-freeze/package/summary') {
3735
- try {
3736
- await readJsonBody(req);
3737
- const result = summarizeRoleFreezePackage();
3738
- sendJson(res, 200, result);
3739
- } catch (error) {
3740
- sendJson(res, 400, { ok: false, reason: error.message });
3741
- }
3742
- return;
3743
- }
3744
-
3745
- if (req.method === 'POST' && url.pathname === '/v1/role-transition') {
3746
- try {
3747
- await readJsonBody(req);
3748
- const result = buildRoleTransitionPack();
3749
- sendJson(res, 200, result);
3750
- } catch (error) {
3751
- sendJson(res, 400, { ok: false, reason: error.message });
3752
- }
3753
- return;
3754
- }
3755
-
3756
- if (req.method === 'POST' && url.pathname === '/v1/role-transition/summary') {
3757
- try {
3758
- await readJsonBody(req);
3759
- const result = summarizeRoleTransitionPack();
3760
- sendJson(res, 200, result);
3761
- } catch (error) {
3762
- sendJson(res, 400, { ok: false, reason: error.message });
3763
- }
3764
- return;
3765
- }
3766
-
3767
- if (req.method === 'POST' && url.pathname === '/v1/capability-registry-home') {
3768
- try {
3769
- await readJsonBody(req);
3770
- const result = buildCapabilityRegistryHomePack();
3771
- sendJson(res, 200, result);
3772
- } catch (error) {
3773
- sendJson(res, 400, { ok: false, reason: error.message });
3774
- }
3775
- return;
3776
- }
3777
-
3778
- if (req.method === 'POST' && url.pathname === '/v1/capability-registry-home/summary') {
3779
- try {
3780
- await readJsonBody(req);
3781
- const result = summarizeCapabilityRegistryHomePack();
3782
- sendJson(res, 200, result);
3783
- } catch (error) {
3784
- sendJson(res, 400, { ok: false, reason: error.message });
3785
- }
3786
- return;
3787
- }
3788
-
3789
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/operator-view') {
3790
- try {
3791
- const body = await readJsonBody(req);
3792
- const result = proofSdk.summarizeGovernanceOperatorView(body);
3793
- sendJson(res, 200, result);
3794
- } catch (error) {
3795
- sendJson(res, 400, { ok: false, reason: error.message });
3796
- }
3797
- return;
3798
- }
3799
-
3800
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/admin-view') {
3801
- try {
3802
- const body = await readJsonBody(req);
3803
- const result = proofSdk.summarizeGovernanceAdminView(body);
3804
- sendJson(res, 200, result);
3805
- } catch (error) {
3806
- sendJson(res, 400, { ok: false, reason: error.message });
3807
- }
3808
- return;
3809
- }
3810
-
3811
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/dashboard-pack') {
3812
- try {
3813
- const body = await readJsonBody(req);
3814
- const result = proofSdk.buildGovernanceDashboardPack(body);
3815
- sendJson(res, 200, result);
3816
- } catch (error) {
3817
- sendJson(res, 400, { ok: false, reason: error.message });
3818
- }
3819
- return;
3820
- }
3821
-
3822
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/workflow-pack') {
3823
- try {
3824
- const body = await readJsonBody(req);
3825
- const result = proofSdk.buildGovernanceWorkflowPack(body);
3826
- sendJson(res, 200, result);
3827
- } catch (error) {
3828
- sendJson(res, 400, { ok: false, reason: error.message });
3829
- }
3830
- return;
3831
- }
3832
-
3833
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/signoff-pack') {
3834
- try {
3835
- const body = await readJsonBody(req);
3836
- const result = proofSdk.buildGovernanceSignoffPack(body);
3837
- sendJson(res, 200, result);
3838
- } catch (error) {
3839
- sendJson(res, 400, { ok: false, reason: error.message });
3840
- }
3841
- return;
3842
- }
3843
-
3844
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/summary') {
3845
- try {
3846
- const body = await readJsonBody(req);
3847
- const result = proofSdk.summarizeGovernanceDisputes(body);
3848
- sendJson(res, 200, result);
3849
- } catch (error) {
3850
- sendJson(res, 400, { ok: false, reason: error.message });
3851
- }
3852
- return;
3853
- }
3854
-
3855
- if (req.method === 'GET' && url.pathname === '/v1/proof-center/governance/disputes/summary') {
3856
- try {
3857
- const result = proofSdk.summarizeGovernanceDisputes({});
3858
- sendJson(res, 200, result);
3859
- } catch (error) {
3860
- sendJson(res, 400, { ok: false, reason: error.message });
3861
- }
3862
- return;
3863
- }
3864
-
3865
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/case-review') {
3866
- try {
3867
- const body = await readJsonBody(req);
3868
- const result = proofSdk.reviewGovernanceCase(body);
3869
- sendJson(res, 200, result);
3870
- } catch (error) {
3871
- sendJson(res, 400, { ok: false, reason: error.message });
3872
- }
3873
- return;
3874
- }
3875
-
3876
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/action') {
3877
- try {
3878
- const body = await readJsonBody(req);
3879
- const result = proofSdk.summarizeGovernanceDisputeAction(body);
3880
- sendJson(res, 200, result);
3881
- } catch (error) {
3882
- sendJson(res, 400, { ok: false, reason: error.message });
3883
- }
3884
- return;
3885
- }
3886
-
3887
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/case-bundle') {
3888
- try {
3889
- const body = await readJsonBody(req);
3890
- const result = proofSdk.buildGovernanceCaseBundle(body);
3891
- sendJson(res, 200, result);
3892
- } catch (error) {
3893
- sendJson(res, 400, { ok: false, reason: error.message });
3894
- }
3895
- return;
3896
- }
3897
-
3898
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/disputes/resolution-pack') {
3899
- try {
3900
- const body = await readJsonBody(req);
3901
- const result = proofSdk.buildGovernanceResolutionPack(body);
3902
- sendJson(res, 200, result);
3903
- } catch (error) {
3904
- sendJson(res, 400, { ok: false, reason: error.message });
3905
- }
3906
- return;
3907
- }
3908
-
3909
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/console-pack') {
3910
- try {
3911
- const body = await readJsonBody(req);
3912
- const result = proofSdk.buildGovernanceConsolePack(body);
3913
- sendJson(res, 200, result);
3914
- } catch (error) {
3915
- sendJson(res, 400, { ok: false, reason: error.message });
3916
- }
3917
- return;
3918
- }
3919
-
3920
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/handoff-bundle') {
3921
- try {
3922
- const body = await readJsonBody(req);
3923
- const result = proofSdk.buildGovernanceHandoffBundle(body);
3924
- sendJson(res, 200, result);
3925
- } catch (error) {
3926
- sendJson(res, 400, { ok: false, reason: error.message });
3927
- }
3928
- return;
3929
- }
3930
-
3931
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/governance/review-link') {
3932
- try {
3933
- const body = await readJsonBody(req);
3934
- const result = proofSdk.summarizeGovernanceReviewLink(body);
3935
- sendJson(res, 200, result);
3936
- } catch (error) {
3937
- sendJson(res, 400, { ok: false, reason: error.message });
3938
- }
3939
- return;
3940
- }
3941
-
3942
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/receipt-wrap') {
3943
- try {
3944
- const body = await readJsonBody(req);
3945
- const result = proofSdk.buildBridgeReceiptWrap(body);
3946
- sendJson(res, 200, result);
3947
- } catch (error) {
3948
- sendJson(res, 400, { ok: false, reason: error.message });
3949
- }
3950
- return;
3951
- }
3952
-
3953
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/validator-verify') {
3954
- try {
3955
- const body = await readJsonBody(req);
3956
- const result = proofSdk.summarizeBridgeValidatorVerify(body);
3957
- sendJson(res, 200, result);
3958
- } catch (error) {
3959
- sendJson(res, 400, { valid: false, reason: error.message });
3960
- }
3961
- return;
3962
- }
3963
-
3964
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/receipt-ledger-handoff') {
3965
- try {
3966
- const body = await readJsonBody(req);
3967
- const result = proofSdk.buildReceiptLedgerBridgeHandoff(body);
3968
- sendJson(res, 200, result);
3969
- } catch (error) {
3970
- sendJson(res, 400, { ok: false, reason: error.message });
3971
- }
3972
- return;
3973
- }
3974
-
3975
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/economic-handoff') {
3976
- try {
3977
- const body = await readJsonBody(req);
3978
- const result = proofSdk.buildEconomicConsequenceBridgeHandoff(body);
3979
- sendJson(res, 200, result);
3980
- } catch (error) {
3981
- sendJson(res, 400, { ok: false, reason: error.message });
3982
- }
3983
- return;
3984
- }
3985
-
3986
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/economic-conformance-pack') {
3987
- try {
3988
- const body = await readJsonBody(req);
3989
- const result = proofSdk.buildEconomicConsequenceConformancePack(body);
3990
- sendJson(res, 200, result);
3991
- } catch (error) {
3992
- sendJson(res, 400, { ok: false, reason: error.message });
3993
- }
3994
- return;
3995
- }
3996
-
3997
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/operator-review-pack') {
3998
- try {
3999
- const body = await readJsonBody(req);
4000
- const result = proofSdk.buildBridgeOperatorReviewPack(body);
4001
- sendJson(res, 200, result);
4002
- } catch (error) {
4003
- sendJson(res, 400, { ok: false, reason: error.message });
4004
- }
4005
- return;
4006
- }
4007
-
4008
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/compatibility-pack') {
4009
- try {
4010
- const body = await readJsonBody(req);
4011
- const result = proofSdk.buildBridgeCompatibilityPack(body);
4012
- sendJson(res, 200, result);
4013
- } catch (error) {
4014
- sendJson(res, 400, { ok: false, reason: error.message });
4015
- }
4016
- return;
4017
- }
4018
-
4019
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/workflow-pack') {
4020
- try {
4021
- const body = await readJsonBody(req);
4022
- const result = proofSdk.buildBridgeWorkflowPack(body);
4023
- sendJson(res, 200, result);
4024
- } catch (error) {
4025
- sendJson(res, 400, { ok: false, reason: error.message });
4026
- }
4027
- return;
4028
- }
4029
-
4030
- if (req.method === 'POST' && url.pathname === '/v1/proof-center/bridge/admin-pack') {
4031
- try {
4032
- const body = await readJsonBody(req);
4033
- const result = proofSdk.buildBridgeAdminPack(body);
4034
- sendJson(res, 200, result);
4035
- } catch (error) {
4036
- sendJson(res, 400, { ok: false, reason: error.message });
4037
- }
4038
- return;
4039
- }
4040
-
4041
- if (req.method === 'GET' && url.pathname === '/v1/integrations') {
4042
- const response = buildIntegrationListResponse({
4043
- ok: true,
4044
- integrations: proofSdk.listIntegrations({
4045
- integration_class: url.searchParams.get('class'),
4046
- capability: url.searchParams.get('capability'),
4047
- surface: url.searchParams.get('surface'),
4048
- source: url.searchParams.get('source'),
4049
- certification_state: url.searchParams.get('certification_state'),
4050
- integration_maturity: url.searchParams.get('integration_maturity'),
4051
- bundled: url.searchParams.get('bundled')
4052
- })
4053
- });
4054
- sendJson(res, response.status, response.payload);
4055
- return;
4056
- }
4057
-
4058
- if (req.method === 'GET' && url.pathname === '/v1/integrations/summary') {
4059
- const response = buildIntegrationListResponse(summarizeIntegrations({
4060
- integration_class: url.searchParams.get('class'),
4061
- capability: url.searchParams.get('capability'),
4062
- surface: url.searchParams.get('surface'),
4063
- source: url.searchParams.get('source'),
4064
- certification_state: url.searchParams.get('certification_state'),
4065
- integration_maturity: url.searchParams.get('integration_maturity'),
4066
- bundled: url.searchParams.get('bundled')
4067
- }));
4068
- sendJson(res, response.status, response.payload);
4069
- return;
4070
- }
4071
-
4072
- if (req.method === 'GET' && url.pathname === '/v1/integrations/snapshot') {
4073
- const response = buildIntegrationListResponse(exportIntegrationRegistrySnapshot({
4074
- integration_class: url.searchParams.get('class'),
4075
- capability: url.searchParams.get('capability'),
4076
- surface: url.searchParams.get('surface'),
4077
- source: url.searchParams.get('source'),
4078
- certification_state: url.searchParams.get('certification_state'),
4079
- integration_maturity: url.searchParams.get('integration_maturity'),
4080
- registration_state: url.searchParams.get('registration_state'),
4081
- proof_scope: url.searchParams.get('proof_scope'),
4082
- bundled: url.searchParams.get('bundled')
4083
- }));
4084
- sendJson(res, response.status, response.payload);
4085
- return;
4086
- }
4087
-
4088
- if (req.method === 'GET' && url.pathname === '/v1/integrations/promotion-readiness') {
4089
- const response = buildIntegrationListResponse({
4090
- ok: true,
4091
- integrations: proofSdk.listIntegrations({
4092
- integration_class: url.searchParams.get('class'),
4093
- capability: url.searchParams.get('capability'),
4094
- surface: url.searchParams.get('surface'),
4095
- source: url.searchParams.get('source'),
4096
- certification_state: url.searchParams.get('certification_state'),
4097
- integration_maturity: url.searchParams.get('integration_maturity'),
4098
- registration_state: url.searchParams.get('registration_state'),
4099
- proof_scope: url.searchParams.get('proof_scope'),
4100
- bundled: url.searchParams.get('bundled')
4101
- }).map((integration) => summarizeIntegrationPromotionReadiness(integration))
4102
- });
4103
- sendJson(res, response.status, response.payload);
4104
- return;
4105
- }
4106
-
4107
- if (req.method === 'GET' && url.pathname === '/v1/integrations/promotion-workflow') {
4108
- const response = buildIntegrationListResponse(summarizeIntegrationPromotionWorkflowList({
4109
- integration_class: url.searchParams.get('class'),
4110
- capability: url.searchParams.get('capability'),
4111
- surface: url.searchParams.get('surface'),
4112
- source: url.searchParams.get('source'),
4113
- certification_state: url.searchParams.get('certification_state'),
4114
- integration_maturity: url.searchParams.get('integration_maturity'),
4115
- registration_state: url.searchParams.get('registration_state'),
4116
- proof_scope: url.searchParams.get('proof_scope'),
4117
- bundled: url.searchParams.get('bundled')
4118
- }));
4119
- sendJson(res, response.status, response.payload);
4120
- return;
4121
- }
4122
-
4123
- if (req.method === 'GET' && url.pathname.startsWith('/v1/integrations/') && url.pathname.endsWith('/promotion-readiness')) {
4124
- const integrationId = decodeURIComponent(
4125
- url.pathname
4126
- .slice('/v1/integrations/'.length, -'/promotion-readiness'.length)
4127
- .replace(/\/$/, '')
4128
- );
4129
- const response = buildIntegrationListResponse(summarizeIntegrationPromotionReadiness(integrationId));
4130
- sendJson(res, response.status || 200, response.payload || response);
4131
- return;
4132
- }
4133
-
4134
- if (req.method === 'GET' && url.pathname.startsWith('/v1/integrations/') && url.pathname.endsWith('/promotion-workflow')) {
4135
- const integrationId = decodeURIComponent(
4136
- url.pathname
4137
- .slice('/v1/integrations/'.length, -'/promotion-workflow'.length)
4138
- .replace(/\/$/, '')
4139
- );
4140
- const response = buildIntegrationListResponse(summarizeIntegrationPromotionWorkflow(integrationId));
4141
- sendJson(res, response.status || 200, response.payload || response);
4142
- return;
4143
- }
4144
-
4145
- if (req.method === 'GET' && url.pathname.startsWith('/v1/integrations/')) {
4146
- const integrationId = decodeURIComponent(url.pathname.slice('/v1/integrations/'.length));
4147
- const response = buildIntegrationDetailResponse(getIntegration(integrationId));
4148
- sendJson(res, response.status, response.payload);
4149
- return;
4150
- }
4151
-
4152
- if (req.method === 'POST' && url.pathname === '/v1/events/canonicalize') {
4153
- try {
4154
- const body = await readJsonBody(req);
4155
- const event = canonicalEventFromBody(body);
4156
- sendJson(res, 200, event);
4157
- } catch (error) {
4158
- sendJson(res, 400, { valid: false, reason: error.message });
4159
- }
4160
- return;
4161
- }
4162
-
4163
- if (req.method === 'POST' && url.pathname === '/v1/events/hash') {
4164
- try {
4165
- const body = await readJsonBody(req);
4166
- const event = canonicalEventFromBody(body);
4167
- sendJson(res, 200, {
4168
- version: event.version,
4169
- event_commitment: proofSdk.hashEvent(event),
4170
- });
4171
- } catch (error) {
4172
- sendJson(res, 400, { valid: false, reason: error.message });
4173
- }
4174
- return;
4175
- }
4176
-
4177
- if (req.method === 'POST' && url.pathname === '/v1/receipts/emit') {
4178
- try {
4179
- const body = await readJsonBody(req);
4180
- if (rejectPrivateKeyMaterial(res, body)) return;
4181
- const event = canonicalEventFromBody(body);
4182
- const receipt = proofSdk.emitReceipt(event, body.options || {});
4183
- sendJson(res, 200, receipt);
4184
- } catch (error) {
4185
- sendJson(res, 400, { valid: false, reason: error.message });
4186
- }
4187
- return;
4188
- }
4189
-
4190
- if (req.method === 'POST' && url.pathname === '/validate') {
4191
- if (enforcePaidVerification(res, 'proof.verify-receipt')) return;
4192
- try {
4193
- const body = await readJsonBody(req);
4194
- const payloadBuffer = payloadBufferFromBody(body);
4195
- const result = proofSdk.verifyReceipt(String(body.opreturn_hex || ''), payloadBuffer);
4196
- sendJson(res, 200, result);
4197
- } catch (error) {
4198
- sendJson(res, 400, { valid: false, reason: error.message });
4199
- }
4200
- return;
4201
- }
4202
-
4203
- if (req.method === 'POST' && url.pathname === '/v1/proofs/verify') {
4204
- if (enforcePaidVerification(res, 'proof.verify-envelope')) return;
4205
- try {
4206
- const body = await readJsonBody(req);
4207
- const result = proofSdk.verifyProofEnvelopeV1(body.envelope);
4208
- sendJson(res, 200, result);
4209
- } catch (error) {
4210
- sendJson(res, 400, { valid: false, reason: error.message });
4211
- }
4212
- return;
4213
- }
4214
-
4215
- if (req.method === 'POST' && url.pathname === '/v1/proof-bundles/build') {
4216
- try {
4217
- const body = await readJsonBody(req);
4218
- if (rejectPrivateKeyMaterial(res, body)) return;
4219
- const bundle = proofSdk.buildProofBundle(body);
4220
- sendJson(res, 200, bundle);
4221
- } catch (error) {
4222
- sendJson(res, 400, { valid: false, reason: error.message });
4223
- }
4224
- return;
4225
- }
4226
-
4227
- if (req.method === 'POST' && url.pathname === '/v1/proof-bundles/verify') {
4228
- if (enforcePaidVerification(res, 'proof.verify-bundle')) return;
4229
- try {
4230
- const body = await readJsonBody(req);
4231
- const verifyOptions = body.options && typeof body.options === 'object' && !Array.isArray(body.options)
4232
- ? body.options
4233
- : {};
4234
- const result = proofSdk.verifyProofBundle(body.bundle, verifyOptions);
4235
- sendJson(res, 200, result);
4236
- } catch (error) {
4237
- sendJson(res, 400, { valid: false, reason: error.message });
4238
- }
4239
- return;
4240
- }
4241
-
4242
- if (req.method === 'POST' && url.pathname === '/v1/profiles/economic/verify') {
4243
- try {
4244
- const body = await readJsonBody(req);
4245
- const result = proofSdk.verifyEconomicReceiptProfileV1(body.profile);
4246
- sendJson(res, 200, result);
4247
- } catch (error) {
4248
- sendJson(res, 400, { valid: false, reason: error.message });
4249
- }
4250
- return;
4251
- }
4252
-
4253
- if (req.method === 'POST' && url.pathname === '/v1/profiles/registry/verify') {
4254
- try {
4255
- const body = await readJsonBody(req);
4256
- const result = proofSdk.verifyRegistryProfileV1(body.profile);
4257
- sendJson(res, 200, result);
4258
- } catch (error) {
4259
- sendJson(res, 400, { valid: false, reason: error.message });
4260
- }
4261
- return;
4262
- }
4263
-
4264
- if (req.method === 'POST' && url.pathname === '/v1/receipts/inspect') {
4265
- try {
4266
- const body = await readJsonBody(req);
4267
- const parsed = proofSdk.parseReceipt
4268
- ? proofSdk.parseReceipt(String(body.opreturn_hex || ''))
4269
- : null;
4270
- if (!parsed) {
4271
- throw new Error('receipt inspection unavailable');
4272
- }
4273
- sendJson(res, 200, parsed);
4274
- } catch (error) {
4275
- sendJson(res, 400, { valid: false, reason: error.message });
4276
- }
4277
- return;
4278
- }
4279
-
4280
- if (req.method === 'POST' && url.pathname === '/execute') {
4281
- const auth = authorizeExecutor(req);
4282
- if (!auth.ok) {
4283
- sendJson(res, auth.status, { ok: false, reason: auth.reason });
4284
- return;
4285
- }
4286
- let payload;
4287
- try {
4288
- payload = await readJsonBody(req);
4289
- } catch (error) {
4290
- sendJson(res, 400, { ok: false, reason: 'invalid_json', detail: error.message });
4291
- return;
4292
- }
4293
- const taskRef = payload && typeof payload.task_ref === 'string' ? payload.task_ref : null;
4294
- const execBody = payload && typeof payload.body === 'object' && payload.body && !Array.isArray(payload.body) ? payload.body : {};
4295
- const toolName = typeof execBody.tool_name === 'string' ? execBody.tool_name.trim() : '';
4296
- const toolArgs = execBody && typeof execBody.arguments === 'object' && execBody.arguments && !Array.isArray(execBody.arguments) ? execBody.arguments : {};
4297
- const startedAtIso = new Date().toISOString();
4298
- const fail = (status, reason, extra) => sendJson(res, status, Object.assign({
4299
- ok: false,
4300
- status: 'failed',
4301
- adapter_id: 'xoonya.provider.proof_verification',
4302
- tool_name: toolName || null,
4303
- reason,
4304
- started_at_iso: startedAtIso,
4305
- finished_at_iso: new Date().toISOString()
4306
- }, extra || {}));
4307
-
4308
- if (!Object.prototype.hasOwnProperty.call(EXECUTOR_TOOLS, toolName)) {
4309
- fail(422, 'unknown_tool', { enabled_tools: listExecutorTools() });
4310
- return;
4311
- }
4312
- if (EXECUTOR_TOOLS_REJECT_PRIVATE_KEY.has(toolName) && !acceptsPrivateKeyMaterial()) {
4313
- const field = findPrivateKeyMaterialPath(toolArgs);
4314
- if (field) {
4315
- fail(422, 'private_key_material_not_accepted', { field });
4316
- return;
4317
- }
4318
- }
4319
- let result;
4320
- try {
4321
- result = EXECUTOR_TOOLS[toolName](toolArgs);
4322
- } catch (error) {
4323
- fail(422, 'verification_failed', { detail: error && error.message ? error.message : 'verification error' });
4324
- return;
4325
- }
4326
- // Bill (200) ONLY when verification positively SUCCEEDED (a definitive valid
4327
- // result). Unprocessable input, a structural reject, and a negative/invalid verdict
4328
- // are all returned non-2xx so the x402 runtime never settles for them — the
4329
- // money-safety rule (err toward not charging), applied uniformly across tools whose
4330
- // SDK result shapes differ: signatures carry ok + signature_valid; bundles/
4331
- // envelopes/receipts carry valid (true only after a clean, fully verified run) and
4332
- // expose a structural-reject reason that is indistinguishable from a negative verdict.
4333
- // A non-successful result still surfaces its verdict so the caller learns the outcome,
4334
- // just without being charged.
4335
- const verified = toolName === 'proof.verify-signature'
4336
- ? !!(result && result.ok === true && result.signature_valid === true)
4337
- : !!(result && result.valid === true);
4338
- if (!verified) {
4339
- const reason = (result && result.reason)
4340
- || (result && result.ok === false ? 'unprocessable_input' : 'verification_not_successful');
4341
- const verdict = {};
4342
- if (result && typeof result.valid === 'boolean') verdict.valid = result.valid;
4343
- if (result && typeof result.signature_valid === 'boolean') verdict.signature_valid = result.signature_valid;
4344
- if (result && result.trust_anchored !== undefined) verdict.trust_anchored = result.trust_anchored;
4345
- fail(422, reason, Object.keys(verdict).length ? { verdict } : undefined);
4346
- return;
4347
- }
4348
- const finishedAtIso = new Date().toISOString();
4349
- const jobId = crypto.createHash('sha256').update(JSON.stringify({ t: toolName, a: toolArgs })).digest('hex').slice(0, 24);
4350
- sendJson(res, 200, {
4351
- ok: true,
4352
- status: 'completed',
4353
- adapter_id: 'xoonya.provider.proof_verification',
4354
- tool_name: toolName,
4355
- started_at_iso: startedAtIso,
4356
- finished_at_iso: finishedAtIso,
4357
- output_payload: result,
4358
- output_ref: 'xoonya:' + toolName + ':' + jobId,
4359
- provider_status: 'completed',
4360
- provider_job_id: jobId,
4361
- result: {
4362
- task_ref: taskRef,
4363
- tool_name: toolName,
4364
- output: result
4365
- }
4366
- });
4367
- return;
4368
- }
4369
-
4370
- sendJson(res, 404, {
4371
- status: 'not_found',
4372
- path: url.pathname,
4373
- });
4374
- }
4375
-
4376
- function handleRouteError(req, res, error) {
4377
- if (res.headersSent) {
4378
- res.destroy();
4379
- return;
4380
- }
4381
- if (error instanceof URIError) {
4382
- sendJson(res, 400, { ok: false, reason: 'invalid_path_encoding' });
4383
- return;
4384
- }
4385
- if (error && error.code === 'ERR_INVALID_URL') {
4386
- sendJson(res, 400, { ok: false, reason: 'invalid_path' });
4387
- return;
4388
- }
4389
- console.error(`[xoonya] internal_error ${req.method} ${req.url}\n${error && error.stack ? error.stack : error}`);
4390
- sendJson(res, 500, { ok: false, reason: 'internal_error' });
4391
- }
4392
-
4393
- function createServer() {
4394
- const server = http.createServer((req, res) => {
4395
- let routed;
4396
- try {
4397
- routed = routeRequest(req, res);
4398
- } catch (error) {
4399
- handleRouteError(req, res, error);
4400
- return;
4401
- }
4402
- routed.catch((error) => handleRouteError(req, res, error));
4403
- });
4404
- server.requestTimeout = REQUEST_TIMEOUT_MS;
4405
- server.headersTimeout = HEADERS_TIMEOUT_MS;
4406
- return server;
4407
- }
4408
-
4409
- if (require.main === module) {
4410
- const port = Number(process.env.PORT || process.env.XOONYA_PORT || 4310);
4411
- const host = process.env.XOONYA_HOST || (process.env.RENDER ? '0.0.0.0' : '127.0.0.1');
4412
- const server = createServer();
4413
- process.on('unhandledRejection', (reason) => {
4414
- console.error(`[xoonya] unhandledRejection\n${reason && reason.stack ? reason.stack : reason}`);
4415
- });
4416
- process.on('uncaughtException', (error) => {
4417
- console.error(`[xoonya] uncaughtException, shutting down\n${error && error.stack ? error.stack : error}`);
4418
- const forceExit = setTimeout(() => process.exit(1), 5000);
4419
- forceExit.unref();
4420
- server.close(() => process.exit(1));
4421
- });
4422
- server.listen(port, host, () => {
4423
- console.log(`xoonya listening on http://${host}:${port}`);
4424
- console.log(`xoonya private key material over HTTP: ${acceptsPrivateKeyMaterial() ? 'accepted' : 'rejected'} (${PRIVATE_KEY_MATERIAL_ENV})`);
4425
- });
4426
- }
4427
-
4428
- module.exports = {
4429
- createServer,
4430
- };