xytara 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.
- package/README.md +120 -92
- package/RELEASE_NOTES.md +7 -3
- package/START_HERE.md +56 -224
- package/bin/xytara.js +21 -8
- package/client.js +79 -1
- package/lib/{delivery_receipt.js → delivery_receipt_verify.js} +14 -100
- package/package.json +25 -35
- package/scripts/verify_client.js +418 -0
- package/scripts/verify_release_candidate.js +146 -45
- package/.env.example +0 -173
- package/ADAPTER_START_HERE.md +0 -56
- package/BSV_TERANODE_PLATFORM_DISCONTINUITY_RUNBOOK.md +0 -126
- package/CARRIED_HANDOFF_DEMO.md +0 -60
- package/EXAMPLE_PATHS.md +0 -53
- package/FINAL_CONTRACT.md +0 -498
- package/PARTNER_READY_PATH.md +0 -71
- package/PUBLIC_DEMO_SCRIPT.md +0 -78
- package/REAL_PAYMENT_SETUP.md +0 -320
- package/SERVICE_CONTRACT.md +0 -419
- package/SUPABASE_RUNTIME_STATE_SETUP.md +0 -61
- package/TERMINOLOGY.md +0 -50
- package/WHY_XYTARA_XOONYA.md +0 -63
- package/XT1_EXECUTION_TRUTH_STANDARD.md +0 -78
- package/XYTARA_ADAPTER_PROTOCOL_TRUTH_MODEL.md +0 -75
- package/XYTARA_AUTONOMOUS_ENTRY_MODEL.md +0 -124
- package/XYTARA_DEFAULT_PATH_MODEL.md +0 -84
- package/XYTARA_EXECUTION_TRUTH_MODEL.md +0 -171
- package/XYTARA_PAYMENT_RAIL_TRUTH_MODEL.md +0 -68
- package/adapters/AUTHORING_GUIDE.md +0 -244
- package/adapters/ONBOARDING_POSTURE.md +0 -61
- package/adapters/THIRD_PARTY_SUBMISSION_PROCESS.md +0 -84
- package/adapters/adapter-manifest.schema.json +0 -283
- package/adapters/examples/example-execution-adapter.js +0 -61
- package/adapters/examples/example-execution-adapter.manifest.json +0 -81
- package/adapters/examples/example-settlement-adapter.js +0 -55
- package/adapters/examples/example-settlement-adapter.manifest.json +0 -78
- package/adapters/examples/example-third-party-acp-registration.submission-bundle.json +0 -124
- package/adapters/examples/example-third-party-erc8004-registration.submission-bundle.json +0 -121
- package/adapters/examples/example-third-party-identity-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-identity-registration.record.json +0 -26
- package/adapters/examples/example-third-party-identity-registration.submission-bundle.json +0 -126
- package/adapters/examples/example-third-party-langchain-registration.submission-bundle.json +0 -124
- package/adapters/examples/example-third-party-mpp-registration.submission-bundle.json +0 -120
- package/adapters/examples/example-third-party-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-registration.record.json +0 -28
- package/adapters/examples/example-third-party-registration.submission-bundle.json +0 -126
- package/adapters/examples/example-third-party-settlement-registration.certification-pack.json +0 -22
- package/adapters/examples/example-third-party-settlement-registration.record.json +0 -26
- package/adapters/examples/example-third-party-settlement-registration.submission-bundle.json +0 -127
- package/adapters/examples/langchain-reference-execution-adapter.js +0 -81
- package/adapters/examples/langchain-reference-execution-adapter.manifest.json +0 -79
- package/adapters/examples/langgraph-reference-execution-adapter.js +0 -81
- package/adapters/examples/langgraph-reference-execution-adapter.manifest.json +0 -79
- package/adapters/examples/minimal-third-party-execution-adapter.js +0 -61
- package/adapters/examples/minimal-third-party-execution-adapter.manifest.json +0 -79
- package/adapters/examples/minimal-third-party-execution-registration.record.json +0 -26
- package/adapters/examples/minimal-third-party-execution.certification-pack.json +0 -22
- package/adapters/examples/minimal-third-party-execution.submission-bundle.json +0 -126
- package/adapters/integration-certification-pack.schema.json +0 -82
- package/adapters/integration-registration-record.schema.json +0 -114
- package/adapters/integration-submission-bundle-set.schema.json +0 -39
- package/adapters/integration-submission-bundle.schema.json +0 -34
- package/adapters/interfaces.js +0 -56
- package/bin/xytara-release.js +0 -1429
- package/examples/_demo_env.js +0 -40
- package/examples/adapter_review_walkthrough.js +0 -54
- package/examples/export_carried_handoff.js +0 -81
- package/examples/funded_runtime_walkthrough.js +0 -71
- package/examples/partner_launch_walkthrough.js +0 -44
- package/examples/quickstart.js +0 -3256
- package/fixtures/catalog.js +0 -1156
- package/index.js +0 -395
- package/integrations/dispatch.js +0 -276
- package/integrations/registry-snapshot.schema.json +0 -36
- package/integrations/registry.js +0 -2261
- package/integrations/views.js +0 -28
- package/lib/a2a_lane_contract.js +0 -104
- package/lib/a2a_rpc.js +0 -287
- package/lib/a2c_lane_contract.js +0 -111
- package/lib/account_auth.js +0 -585
- package/lib/acp_lane_contract.js +0 -54
- package/lib/activity_audit_contract.js +0 -322
- package/lib/adapter_certification_contract.js +0 -130
- package/lib/adapter_depth_contract.js +0 -218
- package/lib/adapter_pack.js +0 -118
- package/lib/adapter_partner_pack.js +0 -89
- package/lib/adapter_promotion_pack.js +0 -89
- package/lib/adapter_protocol_truth_contract.js +0 -229
- package/lib/agent_identity.js +0 -162
- package/lib/announcement_pack.js +0 -61
- package/lib/artifact_distribution_lane_contract.js +0 -54
- package/lib/asyncapi_contract.js +0 -150
- package/lib/auth_interop_contract.js +0 -80
- package/lib/authority_binding_lifecycle_contract.js +0 -182
- package/lib/autonomous_entry_contract.js +0 -409
- package/lib/bolt_adapter.js +0 -187
- package/lib/bolt_lane_contract.js +0 -55
- package/lib/bolt_payment_front.js +0 -224
- package/lib/business_cockpit.js +0 -378
- package/lib/buyer_event_log.js +0 -230
- package/lib/buyer_safety_policy.js +0 -132
- package/lib/capability_execution_truth.js +0 -276
- package/lib/capability_registry.js +0 -633
- package/lib/catalog_contract.js +0 -966
- package/lib/catalog_family_model.js +0 -193
- package/lib/catalog_views.js +0 -55
- package/lib/cdp_jwt.js +0 -57
- package/lib/checkout_event_security.js +0 -142
- package/lib/checkout_processor_adapter.js +0 -217
- package/lib/cloudevents_contract.js +0 -80
- package/lib/command_flow.js +0 -911
- package/lib/commerce_artifacts.js +0 -591
- package/lib/commerce_authority.js +0 -449
- package/lib/commerce_bridge.js +0 -274
- package/lib/commerce_cases.js +0 -399
- package/lib/commerce_checkout.js +0 -509
- package/lib/commerce_coordination.js +0 -346
- package/lib/commerce_economics.js +0 -4017
- package/lib/commerce_identity.js +0 -578
- package/lib/commerce_quotes.js +0 -266
- package/lib/commerce_reports.js +0 -14461
- package/lib/commerce_runtime.js +0 -322
- package/lib/commerce_shell.js +0 -257
- package/lib/crypto_agility_matrix.js +0 -125
- package/lib/default_path_contract.js +0 -412
- package/lib/delivery_summary_contract.js +0 -95
- package/lib/ecosystem_entry.js +0 -64
- package/lib/erc8004_lane_contract.js +0 -65
- package/lib/event_system_lane_contract.js +0 -75
- package/lib/execution_dedupe.js +0 -86
- package/lib/execution_truth_contract.js +0 -234
- package/lib/external_credit_bridge.js +0 -142
- package/lib/external_execution_policy.js +0 -143
- package/lib/external_execution_runtime.js +0 -238
- package/lib/feature_control_lane_contract.js +0 -54
- package/lib/first_run_conversion_contract.js +0 -290
- package/lib/framework_lane_contract.js +0 -89
- package/lib/framework_provider_promotion.js +0 -235
- package/lib/full_catalog_contract.js +0 -525
- package/lib/go_live_operator_pack.js +0 -391
- package/lib/http_transport.js +0 -99
- package/lib/identity_auth.js +0 -175
- package/lib/identity_interop_contract.js +0 -82
- package/lib/integration_matrix_contract.js +0 -102
- package/lib/l402_adapter.js +0 -241
- package/lib/l402_lane_contract.js +0 -55
- package/lib/l402_payment_front.js +0 -265
- package/lib/launch_narrative.js +0 -53
- package/lib/lifecycle_continuity_contract.js +0 -115
- package/lib/machine_identity_registry_contract.js +0 -199
- package/lib/major_rails_lane_contract.js +0 -150
- package/lib/market_lane_contract.js +0 -467
- package/lib/market_lane_depth_contract.js +0 -182
- package/lib/market_lane_promotion_contract.js +0 -210
- package/lib/market_lane_trace_contract.js +0 -278
- package/lib/mcp_lane_contract.js +0 -137
- package/lib/mpp_adapter.js +0 -237
- package/lib/network_transport.js +0 -110
- package/lib/offline_verifiability_recovery_contract.js +0 -155
- package/lib/openapi_contract.js +0 -300
- package/lib/operational_receipt_contract.js +0 -165
- package/lib/operator_intelligence.js +0 -407
- package/lib/outreach_copy_pack.js +0 -51
- package/lib/outreach_message_pack.js +0 -71
- package/lib/outreach_proof.js +0 -71
- package/lib/outreach_target_pack.js +0 -60
- package/lib/partner_intelligence.js +0 -105
- package/lib/payment_config.js +0 -257
- package/lib/payment_front_registry.js +0 -53
- package/lib/payment_protocol_contract.js +0 -165
- package/lib/payment_rail_truth_contract.js +0 -324
- package/lib/payment_verification.js +0 -357
- package/lib/phase_10_closeout_pack.js +0 -45
- package/lib/phase_10_completion_pack.js +0 -76
- package/lib/phase_10_decision_record_pack.js +0 -54
- package/lib/phase_10_decision_resolution_pack.js +0 -53
- package/lib/phase_10_demand_signal_adapters_runtime_pack.js +0 -74
- package/lib/phase_10_ecosystem_backlog_triage_runtime_pack.js +0 -74
- package/lib/phase_10_freeze_baseline_pack.js +0 -67
- package/lib/phase_10_freeze_review_pack.js +0 -64
- package/lib/phase_10_gate_pack.js +0 -57
- package/lib/phase_10_long_tail_continuity_pack.js +0 -80
- package/lib/phase_10_long_tail_ecosystem_pack.js +0 -66
- package/lib/phase_10_niche_extension_registry_runtime_pack.js +0 -74
- package/lib/phase_1_claude_mcp_pack.js +0 -60
- package/lib/phase_1_claude_mcp_runtime_pack.js +0 -52
- package/lib/phase_1_ecosystem_pack.js +0 -67
- package/lib/phase_1_openai_codex_pack.js +0 -60
- package/lib/phase_1_openai_codex_runtime_pack.js +0 -52
- package/lib/phase_2_base_runtime_pack.js +0 -71
- package/lib/phase_2_base_usdc_runtime_pack.js +0 -72
- package/lib/phase_2_closeout_pack.js +0 -65
- package/lib/phase_2_completion_pack.js +0 -113
- package/lib/phase_2_decision_record_pack.js +0 -66
- package/lib/phase_2_decision_resolution_pack.js +0 -69
- package/lib/phase_2_eth_runtime_pack.js +0 -70
- package/lib/phase_2_evm_base_runtime_pack.js +0 -73
- package/lib/phase_2_evm_runtime_pack.js +0 -71
- package/lib/phase_2_flip_preview_pack.js +0 -60
- package/lib/phase_2_freeze_review_pack.js +0 -99
- package/lib/phase_2_gate_pack.js +0 -77
- package/lib/phase_2_payment_rails_pack.js +0 -71
- package/lib/phase_2_usdc_runtime_pack.js +0 -71
- package/lib/phase_3_brc_runtime_pack.js +0 -81
- package/lib/phase_3_bsv_teranode_runtime_pack.js +0 -83
- package/lib/phase_3_closeout_pack.js +0 -62
- package/lib/phase_3_completion_pack.js +0 -94
- package/lib/phase_3_decision_record_pack.js +0 -64
- package/lib/phase_3_decision_resolution_pack.js +0 -69
- package/lib/phase_3_freeze_baseline_pack.js +0 -67
- package/lib/phase_3_freeze_review_pack.js +0 -80
- package/lib/phase_3_gate_pack.js +0 -76
- package/lib/phase_3_metanet_runtime_pack.js +0 -81
- package/lib/phase_3_native_bsv_pack.js +0 -91
- package/lib/phase_3_native_continuity_pack.js +0 -82
- package/lib/phase_4_attestation_runtime_pack.js +0 -75
- package/lib/phase_4_closeout_pack.js +0 -45
- package/lib/phase_4_completion_pack.js +0 -94
- package/lib/phase_4_decision_record_pack.js +0 -54
- package/lib/phase_4_decision_resolution_pack.js +0 -45
- package/lib/phase_4_erc8004_runtime_pack.js +0 -76
- package/lib/phase_4_freeze_baseline_pack.js +0 -67
- package/lib/phase_4_freeze_review_pack.js +0 -68
- package/lib/phase_4_gate_pack.js +0 -58
- package/lib/phase_4_identity_registry_runtime_pack.js +0 -75
- package/lib/phase_4_identity_trust_pack.js +0 -73
- package/lib/phase_4_trust_continuity_pack.js +0 -86
- package/lib/phase_5_antelope_runtime_pack.js +0 -76
- package/lib/phase_5_closeout_pack.js +0 -44
- package/lib/phase_5_completion_pack.js +0 -82
- package/lib/phase_5_constellation_dag_runtime_pack.js +0 -76
- package/lib/phase_5_decision_record_pack.js +0 -54
- package/lib/phase_5_decision_resolution_pack.js +0 -45
- package/lib/phase_5_digibyte_dgb_runtime_pack.js +0 -76
- package/lib/phase_5_freeze_baseline_pack.js +0 -67
- package/lib/phase_5_freeze_review_pack.js +0 -68
- package/lib/phase_5_gate_pack.js +0 -58
- package/lib/phase_5_hedera_hbar_runtime_pack.js +0 -76
- package/lib/phase_5_kaspa_kas_runtime_pack.js +0 -76
- package/lib/phase_5_major_rails_continuity_pack.js +0 -86
- package/lib/phase_5_major_rails_pack.js +0 -110
- package/lib/phase_5_metal_runtime_pack.js +0 -76
- package/lib/phase_5_polkadot_dot_runtime_pack.js +0 -76
- package/lib/phase_5_proton_xpr_runtime_pack.js +0 -76
- package/lib/phase_5_solana_runtime_pack.js +0 -76
- package/lib/phase_6_autogen_runtime_pack.js +0 -72
- package/lib/phase_6_closeout_pack.js +0 -46
- package/lib/phase_6_completion_pack.js +0 -77
- package/lib/phase_6_decision_record_pack.js +0 -54
- package/lib/phase_6_decision_resolution_pack.js +0 -53
- package/lib/phase_6_framework_continuity_pack.js +0 -81
- package/lib/phase_6_framework_runtime_pack.js +0 -68
- package/lib/phase_6_freeze_baseline_pack.js +0 -68
- package/lib/phase_6_freeze_review_pack.js +0 -65
- package/lib/phase_6_gate_pack.js +0 -59
- package/lib/phase_6_langchain_runtime_pack.js +0 -72
- package/lib/phase_6_langgraph_runtime_pack.js +0 -72
- package/lib/phase_6_semantic_kernel_runtime_pack.js +0 -72
- package/lib/phase_7_closeout_pack.js +0 -45
- package/lib/phase_7_completion_pack.js +0 -85
- package/lib/phase_7_decision_record_pack.js +0 -53
- package/lib/phase_7_decision_resolution_pack.js +0 -53
- package/lib/phase_7_event_system_continuity_pack.js +0 -89
- package/lib/phase_7_event_system_pack.js +0 -76
- package/lib/phase_7_freeze_baseline_pack.js +0 -74
- package/lib/phase_7_freeze_review_pack.js +0 -65
- package/lib/phase_7_gate_pack.js +0 -58
- package/lib/phase_7_kafka_runtime_pack.js +0 -74
- package/lib/phase_7_mqtt_runtime_pack.js +0 -74
- package/lib/phase_7_nats_runtime_pack.js +0 -74
- package/lib/phase_7_webhook_event_bus_runtime_pack.js +0 -74
- package/lib/phase_8_closeout_pack.js +0 -46
- package/lib/phase_8_completion_pack.js +0 -82
- package/lib/phase_8_decision_record_pack.js +0 -54
- package/lib/phase_8_decision_resolution_pack.js +0 -53
- package/lib/phase_8_external_receipt_import_runtime_pack.js +0 -74
- package/lib/phase_8_external_result_import_runtime_pack.js +0 -74
- package/lib/phase_8_freeze_baseline_pack.js +0 -71
- package/lib/phase_8_freeze_review_pack.js +0 -64
- package/lib/phase_8_gate_pack.js +0 -58
- package/lib/phase_8_proof_bridge_continuity_pack.js +0 -86
- package/lib/phase_8_proof_bridges_pack.js +0 -72
- package/lib/phase_8_proof_bundle_normalization_runtime_pack.js +0 -74
- package/lib/phase_9_closeout_pack.js +0 -46
- package/lib/phase_9_completion_pack.js +0 -82
- package/lib/phase_9_custody_refs_runtime_pack.js +0 -74
- package/lib/phase_9_decision_record_pack.js +0 -54
- package/lib/phase_9_decision_resolution_pack.js +0 -53
- package/lib/phase_9_freeze_baseline_pack.js +0 -71
- package/lib/phase_9_freeze_review_pack.js +0 -64
- package/lib/phase_9_gate_pack.js +0 -58
- package/lib/phase_9_operator_accounting_bridges_runtime_pack.js +0 -74
- package/lib/phase_9_treasury_connectivity_pack.js +0 -72
- package/lib/phase_9_treasury_continuity_pack.js +0 -86
- package/lib/phase_9_treasury_destinations_runtime_pack.js +0 -74
- package/lib/phase_program_pack.js +0 -120
- package/lib/pricing_optimization_contract.js +0 -775
- package/lib/protocol_lane_contract.js +0 -117
- package/lib/provenance_lane_contract.js +0 -54
- package/lib/provider_lane_contract.js +0 -240
- package/lib/provider_network_contract.js +0 -149
- package/lib/provider_payout_execution.js +0 -155
- package/lib/provider_registry.js +0 -852
- package/lib/provider_runtime_journey_contract.js +0 -183
- package/lib/public_surface_policy_contract.js +0 -111
- package/lib/publish_plan.js +0 -51
- package/lib/rate_limiter.js +0 -81
- package/lib/record_queries.js +0 -48
- package/lib/release_candidate.js +0 -50
- package/lib/release_center.js +0 -1093
- package/lib/release_history.js +0 -205
- package/lib/release_manifest.js +0 -113
- package/lib/release_pack.js +0 -453
- package/lib/request_rate_limit.js +0 -144
- package/lib/resource_views.js +0 -31
- package/lib/revenue_launch_path_contract.js +0 -326
- package/lib/route_matchers.js +0 -34
- package/lib/route_params.js +0 -19
- package/lib/runtime_bridge.js +0 -124
- package/lib/runtime_operations_worker.js +0 -282
- package/lib/runtime_state_store.js +0 -495
- package/lib/settlement_bsv_live.js +0 -600
- package/lib/settlement_bsv_teranode.js +0 -117
- package/lib/settlement_lane_contract.js +0 -111
- package/lib/shared_signals_lane_contract.js +0 -54
- package/lib/signed_audit_provenance_contract.js +0 -83
- package/lib/soft_launch_pack.js +0 -78
- package/lib/stablecoin_lane_contract.js +0 -76
- package/lib/stripe_mpp_lane_contract.js +0 -96
- package/lib/stripe_mpp_payment_front.js +0 -258
- package/lib/telemetry_lane_contract.js +0 -54
- package/lib/treasury_destinations_contract.js +0 -764
- package/lib/treasury_egress_policy_contract.js +0 -91
- package/lib/treasury_lane_contract.js +0 -84
- package/lib/trust_portability_boundary_contract.js +0 -72
- package/lib/x402_facilitator.js +0 -198
- package/lib/x402_lane_contract.js +0 -136
- package/lib/x402_settlement_recovery.js +0 -175
- package/scripts/buyer_events_daily_report.js +0 -79
- package/scripts/registry_cli.js +0 -275
- package/scripts/state_backup_offsite.js +0 -196
- package/scripts/verify_a2a_rpc.js +0 -131
- package/scripts/verify_adapters.js +0 -554
- package/scripts/verify_agent_identity.js +0 -153
- package/scripts/verify_all.js +0 -4963
- package/scripts/verify_bolt_adapter.js +0 -128
- package/scripts/verify_buyer_event_log.js +0 -128
- package/scripts/verify_buyer_safety.js +0 -141
- package/scripts/verify_cdp_facilitator.js +0 -110
- package/scripts/verify_checkout_processor.js +0 -109
- package/scripts/verify_commerce_bridge.js +0 -177
- package/scripts/verify_control_plane_contracts.js +0 -34
- package/scripts/verify_control_plane_routes.js +0 -70
- package/scripts/verify_delivery_summary.js +0 -112
- package/scripts/verify_examples.js +0 -19
- package/scripts/verify_execution_dedupe.js +0 -189
- package/scripts/verify_execution_surfacing.js +0 -76
- package/scripts/verify_external_execution_retry.js +0 -140
- package/scripts/verify_final_activation.js +0 -191
- package/scripts/verify_first_run_conversions.js +0 -81
- package/scripts/verify_framework_provider_promotion.js +0 -152
- package/scripts/verify_full_catalog.js +0 -174
- package/scripts/verify_integrations.js +0 -620
- package/scripts/verify_l402_adapter.js +0 -86
- package/scripts/verify_lifecycle_continuity.js +0 -96
- package/scripts/verify_lifecycle_spend_binding.js +0 -88
- package/scripts/verify_market_lane_depth.js +0 -94
- package/scripts/verify_market_lane_promotion.js +0 -103
- package/scripts/verify_market_lane_traces.js +0 -98
- package/scripts/verify_market_lanes.js +0 -102
- package/scripts/verify_mpp_adapter.js +0 -128
- package/scripts/verify_operator_observability_boundary.js +0 -83
- package/scripts/verify_pricing_experiment_plan.js +0 -124
- package/scripts/verify_production_readiness.js +0 -268
- package/scripts/verify_provider_network.js +0 -819
- package/scripts/verify_provider_runtime_breadth.js +0 -109
- package/scripts/verify_provider_runtime_journeys.js +0 -111
- package/scripts/verify_rate_limiter.js +0 -52
- package/scripts/verify_refund_credit.js +0 -106
- package/scripts/verify_revenue_launch_paths.js +0 -105
- package/scripts/verify_runtime_durability.js +0 -52
- package/scripts/verify_runtime_state_guard.js +0 -117
- package/scripts/verify_service.js +0 -15421
- package/scripts/verify_settlement.js +0 -116
- package/scripts/verify_tooling.js +0 -1412
- package/scripts/verify_treasury_public_boundary.js +0 -97
- package/scripts/verify_verify_execute_settle.js +0 -209
- package/scripts/verify_x402_facilitator.js +0 -307
- package/scripts/verify_x402_settlement_recovery.js +0 -153
- package/server.js +0 -12245
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Verifies that when a real execution target runs, its actual output is surfaced
|
|
4
|
-
// into the buyer-facing artifacts (command.deliverables + execution.results_by_task_id)
|
|
5
|
-
// — provider-agnostically across the target response shapes — and that the
|
|
6
|
-
// synthetic ("simulated") path is unchanged when no target runs.
|
|
7
|
-
|
|
8
|
-
const assert = require("assert");
|
|
9
|
-
const { createCommandArtifacts } = require("../lib/commerce_artifacts");
|
|
10
|
-
|
|
11
|
-
const basePayload = {
|
|
12
|
-
command: "command.execute",
|
|
13
|
-
tasks: [{ task_id: "t1", task_ref: "adapter.mcp.invoke" }],
|
|
14
|
-
body: { tool_name: "keccak256" }
|
|
15
|
-
};
|
|
16
|
-
const baseQuote = {
|
|
17
|
-
quote_id: "quote_test1",
|
|
18
|
-
account_id: "acct_test",
|
|
19
|
-
amount_minor: 5,
|
|
20
|
-
currency: "USD_CENTS",
|
|
21
|
-
settlement_mode: null,
|
|
22
|
-
integration_ids: [],
|
|
23
|
-
protocols: ["mcp"],
|
|
24
|
-
capabilities: [],
|
|
25
|
-
adapters: ["http"],
|
|
26
|
-
execution_integration_ids: [],
|
|
27
|
-
payment_scheme: "exact",
|
|
28
|
-
payment_protocol: "x402"
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
function run(label, opts, check) {
|
|
32
|
-
const out = createCommandArtifacts(basePayload, baseQuote, opts);
|
|
33
|
-
check({
|
|
34
|
-
out,
|
|
35
|
-
deliv: out.command.deliverables[0],
|
|
36
|
-
taskResult: out.transaction.execution.results_by_task_id.t1
|
|
37
|
-
});
|
|
38
|
-
console.log(" ok:", label);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// 1. Nested MCP-executor shape: { result: { output: <real> } }
|
|
42
|
-
run("nested result.output (MCP executor shape)",
|
|
43
|
-
{ externalExecution: { provider: "mcp", target_id: "tg1", target_response: { ok: true, result: { output: { digest: "0xdeadbeef", length: 8 } }, provider_status: "completed" } } },
|
|
44
|
-
({ deliv, taskResult }) => {
|
|
45
|
-
assert.deepStrictEqual(deliv.output_payload, { digest: "0xdeadbeef", length: 8 }, "deliverable carries real output");
|
|
46
|
-
assert.strictEqual(deliv.invocation_status, "provider_completed");
|
|
47
|
-
assert.strictEqual(deliv.execution_provider, "mcp");
|
|
48
|
-
assert.deepStrictEqual(taskResult.output_payload, { digest: "0xdeadbeef", length: 8 }, "task result carries real output");
|
|
49
|
-
assert.strictEqual(taskResult.invocation_status, "provider_completed");
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// 2. Contract-conformant shape: { output_payload, output_ref, provider_status }
|
|
53
|
-
run("conformant output_payload + output_ref",
|
|
54
|
-
{ externalExecution: { provider: "p", target_id: "tg2", target_response: { output_payload: { answer: 42 }, output_ref: "ref_xyz", provider_status: "ok" } } },
|
|
55
|
-
({ deliv, taskResult }) => {
|
|
56
|
-
assert.deepStrictEqual(deliv.output_payload, { answer: 42 });
|
|
57
|
-
assert.strictEqual(deliv.output_ref, "ref_xyz");
|
|
58
|
-
assert.strictEqual(deliv.provider_status, "ok");
|
|
59
|
-
assert.strictEqual(taskResult.output_ref, "ref_xyz");
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// 3. Bare output field
|
|
63
|
-
run("bare output field",
|
|
64
|
-
{ externalExecution: { provider: "p", target_id: "tg3", target_response: { output: "hello" } } },
|
|
65
|
-
({ deliv }) => assert.strictEqual(deliv.output_payload, "hello"));
|
|
66
|
-
|
|
67
|
-
// 4. No external target -> synthetic path unchanged
|
|
68
|
-
run("no target -> simulated, no output_payload",
|
|
69
|
-
{},
|
|
70
|
-
({ deliv, taskResult }) => {
|
|
71
|
-
assert.strictEqual(deliv.output_payload, undefined, "no payload when synthetic");
|
|
72
|
-
assert.strictEqual(taskResult.invocation_status, "simulated");
|
|
73
|
-
assert.ok(String(deliv.ref).startsWith("deliverable_"), "placeholder ref preserved");
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
console.log("verify_execution_surfacing: all execution output-surfacing checks passed");
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Verifies the transient-retry behavior of executeExternalTarget (lib/external_execution_runtime.js):
|
|
4
|
-
// a provider-rejected status (429/503/408) is retried with backoff, but ambiguous gateway errors
|
|
5
|
-
// (502/504) and network failures are NOT retried — so a retry can never double-execute a
|
|
6
|
-
// side-effectful provider on the open network. Deferred settlement means a non-retried failure
|
|
7
|
-
// simply does not charge.
|
|
8
|
-
|
|
9
|
-
const assert = require("assert");
|
|
10
|
-
|
|
11
|
-
function fakeResponse({ ok, status, body, retryAfter }) {
|
|
12
|
-
return {
|
|
13
|
-
ok,
|
|
14
|
-
status,
|
|
15
|
-
headers: { get: (h) => (String(h).toLowerCase() === "retry-after" && retryAfter != null ? String(retryAfter) : null) },
|
|
16
|
-
text: async () => (typeof body === "string" ? body : JSON.stringify(body || {}))
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function withFetch(sequence, fn) {
|
|
21
|
-
const orig = global.fetch;
|
|
22
|
-
let i = 0;
|
|
23
|
-
const calls = [];
|
|
24
|
-
global.fetch = async (url, opts) => {
|
|
25
|
-
calls.push({ url, opts });
|
|
26
|
-
const next = sequence[Math.min(i, sequence.length - 1)];
|
|
27
|
-
i += 1;
|
|
28
|
-
if (next instanceof Error) throw next;
|
|
29
|
-
return fakeResponse(next);
|
|
30
|
-
};
|
|
31
|
-
try { return await fn(calls); } finally { global.fetch = orig; }
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async function main() {
|
|
35
|
-
const prev = process.env.XYTARA_EXTERNAL_EXECUTION_MAX_RETRIES;
|
|
36
|
-
process.env.XYTARA_EXTERNAL_EXECUTION_MAX_RETRIES = "2";
|
|
37
|
-
delete require.cache[require.resolve("../lib/external_execution_runtime")];
|
|
38
|
-
const { executeExternalTarget } = require("../lib/external_execution_runtime");
|
|
39
|
-
const target = { endpoint_url: "https://p.example/execute", timeout_ms: 2000, provider: "p", target_id: "t", auth_token: "tok" };
|
|
40
|
-
const payload = { command: "x", task_ref: "adapter.demo.invoke", body: {} };
|
|
41
|
-
|
|
42
|
-
try {
|
|
43
|
-
// 1. 429 then 200 -> retried once, succeeds.
|
|
44
|
-
await withFetch([
|
|
45
|
-
{ ok: false, status: 429, body: "Too Many Requests\n", retryAfter: 0 },
|
|
46
|
-
{ ok: true, status: 200, body: { result: { output: { hash: "0xabc" } } } }
|
|
47
|
-
], async (calls) => {
|
|
48
|
-
const r = await executeExternalTarget(target, payload, {});
|
|
49
|
-
assert.strictEqual(r.ok, true, "429-then-200 succeeds after retry");
|
|
50
|
-
assert.ok(r.target_response, "carries target_response");
|
|
51
|
-
assert.strictEqual(calls.length, 2, "exactly one retry (2 calls)");
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// 2. 429 persistently -> exhausted (1 + 2 retries = 3 attempts) -> rejected, surfaced.
|
|
55
|
-
await withFetch([{ ok: false, status: 429, body: "Too Many Requests\n", retryAfter: 0 }], async (calls) => {
|
|
56
|
-
const r = await executeExternalTarget(target, payload, {});
|
|
57
|
-
assert.strictEqual(r.ok, false, "exhausted 429 fails");
|
|
58
|
-
assert.strictEqual(r.reason, "external_execution_target_rejected", "reject reason");
|
|
59
|
-
assert.strictEqual(r.upstream_status, 429, "upstream 429 surfaced");
|
|
60
|
-
assert.strictEqual(r.attempts, 3, "3 attempts");
|
|
61
|
-
assert.strictEqual(calls.length, 3, "3 fetch calls");
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// 3. 503 is retryable too.
|
|
65
|
-
await withFetch([
|
|
66
|
-
{ ok: false, status: 503, body: "unavailable", retryAfter: 0 },
|
|
67
|
-
{ ok: true, status: 200, body: { result: { output: {} } } }
|
|
68
|
-
], async (calls) => {
|
|
69
|
-
const r = await executeExternalTarget(target, payload, {});
|
|
70
|
-
assert.strictEqual(r.ok, true, "503-then-200 succeeds");
|
|
71
|
-
assert.strictEqual(calls.length, 2, "retried once");
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// 4. 502 is NOT retried (ambiguous gateway error; provider may already have executed).
|
|
75
|
-
await withFetch([{ ok: false, status: 502, body: "bad gateway" }], async (calls) => {
|
|
76
|
-
const r = await executeExternalTarget(target, payload, {});
|
|
77
|
-
assert.strictEqual(r.ok, false, "502 fails");
|
|
78
|
-
assert.strictEqual(r.attempts, 1, "502 NOT retried (single attempt)");
|
|
79
|
-
assert.strictEqual(calls.length, 1, "one fetch call");
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// 5. Network error is NOT retried (provider may already have executed).
|
|
83
|
-
await withFetch([new Error("socket hang up")], async (calls) => {
|
|
84
|
-
const r = await executeExternalTarget(target, payload, {});
|
|
85
|
-
assert.strictEqual(r.ok, false, "network error fails");
|
|
86
|
-
assert.strictEqual(r.reason, "external_execution_failed", "failed reason");
|
|
87
|
-
assert.strictEqual(calls.length, 1, "network error NOT retried");
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// 6. First-try success -> no retry.
|
|
91
|
-
await withFetch([{ ok: true, status: 200, body: { result: { output: {} } } }], async (calls) => {
|
|
92
|
-
const r = await executeExternalTarget(target, payload, {});
|
|
93
|
-
assert.strictEqual(r.ok, true, "200 ok");
|
|
94
|
-
assert.strictEqual(calls.length, 1, "no retry on success");
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// 7. Retries disabled (max=0) -> a 429 fails on the first attempt.
|
|
98
|
-
process.env.XYTARA_EXTERNAL_EXECUTION_MAX_RETRIES = "0";
|
|
99
|
-
delete require.cache[require.resolve("../lib/external_execution_runtime")];
|
|
100
|
-
const mod0 = require("../lib/external_execution_runtime");
|
|
101
|
-
await withFetch([{ ok: false, status: 429, body: "x", retryAfter: 0 }], async (calls) => {
|
|
102
|
-
const r = await mod0.executeExternalTarget(target, payload, {});
|
|
103
|
-
assert.strictEqual(r.ok, false, "max=0: 429 fails immediately");
|
|
104
|
-
assert.strictEqual(calls.length, 1, "max=0: no retry");
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// 8. COLD-START RIDE-OUT (default retries): several 429s then 200 -> rides out within the window.
|
|
108
|
-
delete process.env.XYTARA_EXTERNAL_EXECUTION_MAX_RETRIES;
|
|
109
|
-
delete require.cache[require.resolve("../lib/external_execution_runtime")];
|
|
110
|
-
const modRide = require("../lib/external_execution_runtime");
|
|
111
|
-
await withFetch([
|
|
112
|
-
{ ok: false, status: 429, body: "x", retryAfter: 0 }, { ok: false, status: 429, body: "x", retryAfter: 0 },
|
|
113
|
-
{ ok: false, status: 429, body: "x", retryAfter: 0 }, { ok: false, status: 429, body: "x", retryAfter: 0 },
|
|
114
|
-
{ ok: false, status: 429, body: "x", retryAfter: 0 }, { ok: false, status: 429, body: "x", retryAfter: 0 },
|
|
115
|
-
{ ok: true, status: 200, body: { result: { output: {} } } }
|
|
116
|
-
], async (calls) => {
|
|
117
|
-
const r = await modRide.executeExternalTarget(target, payload, {});
|
|
118
|
-
assert.strictEqual(r.ok, true, "ride-out: 6x429 then 200 succeeds (cold start ridden out)");
|
|
119
|
-
assert.strictEqual(calls.length, 7, "ride-out retried through the cold start");
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// 9. Time window exhausted (RETRY_WINDOW_MS=0) -> no ride-out even on a 429.
|
|
123
|
-
process.env.XYTARA_EXTERNAL_EXECUTION_RETRY_WINDOW_MS = "0";
|
|
124
|
-
delete require.cache[require.resolve("../lib/external_execution_runtime")];
|
|
125
|
-
const modNoWin = require("../lib/external_execution_runtime");
|
|
126
|
-
await withFetch([{ ok: false, status: 429, body: "x", retryAfter: 0 }], async (calls) => {
|
|
127
|
-
const r = await modNoWin.executeExternalTarget(target, payload, {});
|
|
128
|
-
assert.strictEqual(r.ok, false, "window=0: 429 fails immediately");
|
|
129
|
-
assert.strictEqual(calls.length, 1, "window=0: no retry");
|
|
130
|
-
});
|
|
131
|
-
delete process.env.XYTARA_EXTERNAL_EXECUTION_RETRY_WINDOW_MS;
|
|
132
|
-
|
|
133
|
-
console.log("xytara verify:external-execution-retry passed");
|
|
134
|
-
} finally {
|
|
135
|
-
if (prev === undefined) delete process.env.XYTARA_EXTERNAL_EXECUTION_MAX_RETRIES; else process.env.XYTARA_EXTERNAL_EXECUTION_MAX_RETRIES = prev;
|
|
136
|
-
delete process.env.XYTARA_EXTERNAL_EXECUTION_RETRY_WINDOW_MS;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
main().catch((e) => { console.error(e && e.message ? e.message : e); process.exitCode = 1; });
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const assert = require("assert");
|
|
4
|
-
|
|
5
|
-
function parseCsvEnv(value) {
|
|
6
|
-
if (!value) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
return value
|
|
10
|
-
.split(",")
|
|
11
|
-
.map((entry) => entry.trim())
|
|
12
|
-
.filter(Boolean);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async function getJson(baseUrl, path, headers) {
|
|
16
|
-
const response = await fetch(`${baseUrl}${path}`, {
|
|
17
|
-
headers: headers || {}
|
|
18
|
-
});
|
|
19
|
-
const json = await response.json();
|
|
20
|
-
return {
|
|
21
|
-
status: response.status,
|
|
22
|
-
json
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function assertContainsAll(actual, expected, label) {
|
|
27
|
-
for (const entry of expected) {
|
|
28
|
-
assert.strictEqual(
|
|
29
|
-
actual.includes(entry),
|
|
30
|
-
true,
|
|
31
|
-
`${label} missing expected entry: ${entry}`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async function main() {
|
|
37
|
-
const baseUrl = process.env.XYTARA_VERIFY_BASE_URL || "https://xytara.onrender.com";
|
|
38
|
-
const expectedLiveRails = parseCsvEnv(process.env.XYTARA_EXPECTED_LIVE_RAILS);
|
|
39
|
-
const expectedReadinessOnlyRails = parseCsvEnv(process.env.XYTARA_EXPECTED_READINESS_ONLY_RAILS);
|
|
40
|
-
const expectedBsvRuntimeMode = process.env.XYTARA_EXPECTED_BSV_RUNTIME_MODE || "arc";
|
|
41
|
-
const operatorAccountId = process.env.XYTARA_VERIFY_ACCOUNT_ID || process.env.XYTARA_TREASURY_ACCOUNT_ID || "";
|
|
42
|
-
const operatorBearerToken = process.env.XYTARA_ACCOUNT_AUTH_BEARER_TOKEN || "";
|
|
43
|
-
const operatorHeaders = operatorBearerToken
|
|
44
|
-
? { authorization: `Bearer ${operatorBearerToken}` }
|
|
45
|
-
: null;
|
|
46
|
-
|
|
47
|
-
const treasurySummary = await getJson(baseUrl, "/v1/treasury-destinations/summary");
|
|
48
|
-
assert.strictEqual(treasurySummary.status, 200, "treasury destinations summary route failed");
|
|
49
|
-
assert.strictEqual(
|
|
50
|
-
treasurySummary.json.category,
|
|
51
|
-
"machine-commerce-treasury-destinations-pack-summary",
|
|
52
|
-
"treasury destinations summary category mismatch"
|
|
53
|
-
);
|
|
54
|
-
assert.strictEqual(
|
|
55
|
-
treasurySummary.json.public_claimable_profile_count > 0,
|
|
56
|
-
true,
|
|
57
|
-
"public claimable treasury profile count must be positive"
|
|
58
|
-
);
|
|
59
|
-
assert.strictEqual(
|
|
60
|
-
Array.isArray(treasurySummary.json.public_claim_boundary.live_claimable_rails),
|
|
61
|
-
true,
|
|
62
|
-
"treasury summary live claimable rails missing"
|
|
63
|
-
);
|
|
64
|
-
assert.strictEqual(
|
|
65
|
-
Array.isArray(treasurySummary.json.public_claim_boundary.readiness_only_rails),
|
|
66
|
-
true,
|
|
67
|
-
"treasury summary readiness-only rails missing"
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const paymentRailTruthSummary = await getJson(baseUrl, "/v1/payment-rail-truth/summary");
|
|
71
|
-
assert.strictEqual(paymentRailTruthSummary.status, 200, "payment rail truth summary route failed");
|
|
72
|
-
assert.strictEqual(
|
|
73
|
-
paymentRailTruthSummary.json.category,
|
|
74
|
-
"machine-commerce-payment-rail-truth-model",
|
|
75
|
-
"payment rail truth summary category mismatch"
|
|
76
|
-
);
|
|
77
|
-
assert.strictEqual(
|
|
78
|
-
paymentRailTruthSummary.json.public_live_landing_rail_count > 0,
|
|
79
|
-
true,
|
|
80
|
-
"public live landing rail count must be positive"
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
const autonomousEntrySummary = await getJson(baseUrl, "/v1/autonomous-entry/summary");
|
|
84
|
-
assert.strictEqual(autonomousEntrySummary.status, 200, "autonomous entry summary route failed");
|
|
85
|
-
assert.strictEqual(
|
|
86
|
-
autonomousEntrySummary.json.category,
|
|
87
|
-
"machine-commerce-autonomous-entry-pack-summary",
|
|
88
|
-
"autonomous entry summary category mismatch"
|
|
89
|
-
);
|
|
90
|
-
assert.strictEqual(
|
|
91
|
-
autonomousEntrySummary.json.public_live_landing_rail_count > 0,
|
|
92
|
-
true,
|
|
93
|
-
"autonomous entry live landing rail count must be positive"
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const bsvReadiness = await getJson(baseUrl, "/v1/settlement/bsv-teranode/readiness");
|
|
97
|
-
assert.strictEqual(bsvReadiness.status, 200, "BSV readiness route failed");
|
|
98
|
-
assert.strictEqual(bsvReadiness.json.rail, "bsv_teranode", "BSV readiness rail mismatch");
|
|
99
|
-
assert.strictEqual(bsvReadiness.json.ready, true, "BSV readiness must be true");
|
|
100
|
-
assert.strictEqual(
|
|
101
|
-
bsvReadiness.json.runtime_mode,
|
|
102
|
-
expectedBsvRuntimeMode,
|
|
103
|
-
`BSV readiness runtime mode must be ${expectedBsvRuntimeMode}`
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
if (expectedLiveRails.length > 0) {
|
|
107
|
-
assertContainsAll(
|
|
108
|
-
treasurySummary.json.public_claim_boundary.live_claimable_rails,
|
|
109
|
-
expectedLiveRails,
|
|
110
|
-
"live claimable rails"
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (expectedReadinessOnlyRails.length > 0) {
|
|
115
|
-
assertContainsAll(
|
|
116
|
-
treasurySummary.json.public_claim_boundary.readiness_only_rails,
|
|
117
|
-
expectedReadinessOnlyRails,
|
|
118
|
-
"readiness-only rails"
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
let operatorChecks = {
|
|
123
|
-
attempted: false
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
if (operatorHeaders && operatorAccountId) {
|
|
127
|
-
operatorChecks = {
|
|
128
|
-
attempted: true
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const paymentLedger = await getJson(baseUrl, "/v1/payment-ledger", operatorHeaders);
|
|
132
|
-
assert.strictEqual(paymentLedger.status, 200, "payment ledger route failed");
|
|
133
|
-
|
|
134
|
-
const activityLedger = await getJson(baseUrl, "/v1/activity-ledger", operatorHeaders);
|
|
135
|
-
assert.strictEqual(activityLedger.status, 200, "activity ledger route failed");
|
|
136
|
-
|
|
137
|
-
const treasurySummaryRoute = await getJson(
|
|
138
|
-
baseUrl,
|
|
139
|
-
`/v1/economics/accounts/${encodeURIComponent(operatorAccountId)}/treasury-summary`,
|
|
140
|
-
operatorHeaders
|
|
141
|
-
);
|
|
142
|
-
assert.strictEqual(treasurySummaryRoute.status, 200, "account treasury summary route failed");
|
|
143
|
-
|
|
144
|
-
const railSummaryRoute = await getJson(
|
|
145
|
-
baseUrl,
|
|
146
|
-
`/v1/economics/accounts/${encodeURIComponent(operatorAccountId)}/rail-summary`,
|
|
147
|
-
operatorHeaders
|
|
148
|
-
);
|
|
149
|
-
assert.strictEqual(railSummaryRoute.status, 200, "account rail summary route failed");
|
|
150
|
-
|
|
151
|
-
const reconciliationReport = await getJson(baseUrl, "/v1/reconciliation-report", operatorHeaders);
|
|
152
|
-
assert.strictEqual(reconciliationReport.status, 200, "reconciliation report route failed");
|
|
153
|
-
|
|
154
|
-
operatorChecks.payment_ledger_count = Array.isArray(paymentLedger.json.entries)
|
|
155
|
-
? paymentLedger.json.entries.length
|
|
156
|
-
: Array.isArray(paymentLedger.json.payments)
|
|
157
|
-
? paymentLedger.json.payments.length
|
|
158
|
-
: null;
|
|
159
|
-
operatorChecks.activity_ledger_count = Array.isArray(activityLedger.json.entries)
|
|
160
|
-
? activityLedger.json.entries.length
|
|
161
|
-
: Array.isArray(activityLedger.json.activities)
|
|
162
|
-
? activityLedger.json.activities.length
|
|
163
|
-
: null;
|
|
164
|
-
operatorChecks.account_id = operatorAccountId;
|
|
165
|
-
operatorChecks.reconciliation_category = reconciliationReport.json.category || null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const output = {
|
|
169
|
-
ok: true,
|
|
170
|
-
product: "xytara",
|
|
171
|
-
category: "xytara-final-activation-verification",
|
|
172
|
-
base_url: baseUrl,
|
|
173
|
-
expected_bsv_runtime_mode: expectedBsvRuntimeMode,
|
|
174
|
-
live_claimable_rails: treasurySummary.json.public_claim_boundary.live_claimable_rails,
|
|
175
|
-
readiness_only_rails: treasurySummary.json.public_claim_boundary.readiness_only_rails,
|
|
176
|
-
public_claimable_profile_count: treasurySummary.json.public_claimable_profile_count,
|
|
177
|
-
public_live_landing_rail_count: paymentRailTruthSummary.json.public_live_landing_rail_count,
|
|
178
|
-
autonomous_entry_live_landing_rail_count: autonomousEntrySummary.json.public_live_landing_rail_count,
|
|
179
|
-
bsv_ready: bsvReadiness.json.ready,
|
|
180
|
-
bsv_runtime_mode: bsvReadiness.json.runtime_mode,
|
|
181
|
-
operator_checks: operatorChecks,
|
|
182
|
-
boundary: "launch_activation_truth_must_match_live_treasury_payment_autonomous_entry_and_bsv_readiness_surfaces"
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
main().catch((error) => {
|
|
189
|
-
process.stderr.write(`${error.stack || error.message}\n`);
|
|
190
|
-
process.exit(1);
|
|
191
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const assert = require("assert");
|
|
4
|
-
const { createServer } = require("../server");
|
|
5
|
-
const {
|
|
6
|
-
buildFirstRunConversionPack,
|
|
7
|
-
summarizeFirstRunConversionPack,
|
|
8
|
-
getFirstRunConversionDetail
|
|
9
|
-
} = require("../lib/first_run_conversion_contract");
|
|
10
|
-
|
|
11
|
-
async function getJson(baseUrl, routePath) {
|
|
12
|
-
const response = await fetch(`${baseUrl}${routePath}`);
|
|
13
|
-
return {
|
|
14
|
-
status: response.status,
|
|
15
|
-
json: await response.json()
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async function main() {
|
|
20
|
-
const pack = buildFirstRunConversionPack();
|
|
21
|
-
const summary = summarizeFirstRunConversionPack();
|
|
22
|
-
|
|
23
|
-
assert.strictEqual(pack.ok, true, "first-run conversion pack ok missing");
|
|
24
|
-
assert.strictEqual(summary.conversion_count >= 3, true, "first-run conversion count missing");
|
|
25
|
-
assert.strictEqual(summary.public_first_contact_ready_count >= 2, true, "public first-contact conversion count missing");
|
|
26
|
-
assert.strictEqual(summary.revenue_ready_conversion_count >= 2, true, "revenue-ready conversion count missing");
|
|
27
|
-
assert.strictEqual(summary.proof_ready_conversion_count >= 3, true, "proof-ready conversion count missing");
|
|
28
|
-
assert.strictEqual(summary.operator_inspection_ready_count >= 3, true, "operator inspection conversion count missing");
|
|
29
|
-
assert.strictEqual(Boolean(getFirstRunConversionDetail("direct_x402_paid_proof")), true, "direct x402 conversion missing");
|
|
30
|
-
assert.strictEqual(Boolean(getFirstRunConversionDetail("credits_first_paid_proof")), true, "credits-first conversion missing");
|
|
31
|
-
assert.strictEqual(Boolean(getFirstRunConversionDetail("result_package_proof_pickup")), true, "result-package proof pickup conversion missing");
|
|
32
|
-
|
|
33
|
-
const server = createServer();
|
|
34
|
-
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
35
|
-
const address = server.address();
|
|
36
|
-
const baseUrl = `http://127.0.0.1:${address.port}`;
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
const packResponse = await getJson(baseUrl, "/v1/first-run/conversions");
|
|
40
|
-
assert.strictEqual(packResponse.status, 200, "first-run conversions route failed");
|
|
41
|
-
assert.strictEqual(packResponse.json.conversion_count >= 3, true, "first-run conversions route count missing");
|
|
42
|
-
|
|
43
|
-
const summaryResponse = await getJson(baseUrl, "/v1/first-run/conversions/summary");
|
|
44
|
-
assert.strictEqual(summaryResponse.status, 200, "first-run conversions summary route failed");
|
|
45
|
-
assert.strictEqual(summaryResponse.json.revenue_ready_conversion_count >= 2, true, "first-run conversions summary revenue count missing");
|
|
46
|
-
|
|
47
|
-
const directPayResponse = await getJson(baseUrl, "/v1/first-run/conversions/direct_x402_paid_proof");
|
|
48
|
-
assert.strictEqual(directPayResponse.status, 200, "direct x402 first-run conversion detail route failed");
|
|
49
|
-
assert.strictEqual(directPayResponse.json.conversion.revenue_ready, true, "direct x402 first-run conversion revenue missing");
|
|
50
|
-
|
|
51
|
-
const creditsResponse = await getJson(baseUrl, "/v1/first-run/conversions/credits_first_paid_proof");
|
|
52
|
-
assert.strictEqual(creditsResponse.status, 200, "credits-first first-run conversion detail route failed");
|
|
53
|
-
assert.strictEqual(creditsResponse.json.conversion.operator_inspection_ready, true, "credits-first conversion inspection missing");
|
|
54
|
-
|
|
55
|
-
const proofPickupResponse = await getJson(baseUrl, "/v1/first-run/conversions/result_package_proof_pickup");
|
|
56
|
-
assert.strictEqual(proofPickupResponse.status, 200, "proof pickup first-run conversion detail route failed");
|
|
57
|
-
assert.strictEqual(proofPickupResponse.json.conversion.proof_ready, true, "proof pickup conversion proof readiness missing");
|
|
58
|
-
|
|
59
|
-
console.log(JSON.stringify({
|
|
60
|
-
ok: true,
|
|
61
|
-
product: "xytara",
|
|
62
|
-
category: "machine-commerce-first-run-conversion-verification",
|
|
63
|
-
verification_version: "xytara-first-run-conversion-verification-v1",
|
|
64
|
-
conversion_count: summary.conversion_count,
|
|
65
|
-
public_first_contact_ready_count: summary.public_first_contact_ready_count,
|
|
66
|
-
revenue_ready_conversion_count: summary.revenue_ready_conversion_count,
|
|
67
|
-
proof_ready_conversion_count: summary.proof_ready_conversion_count,
|
|
68
|
-
operator_inspection_ready_count: summary.operator_inspection_ready_count,
|
|
69
|
-
boundary: "launch_grade_first_run_claims_require_public_quote_fund_execute_proof_and_inspection_paths"
|
|
70
|
-
}, null, 2));
|
|
71
|
-
} finally {
|
|
72
|
-
await new Promise((resolve, reject) => {
|
|
73
|
-
server.close((error) => (error ? reject(error) : resolve()));
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
main().catch((error) => {
|
|
79
|
-
console.error(error);
|
|
80
|
-
process.exitCode = 1;
|
|
81
|
-
});
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const assert = require("assert");
|
|
4
|
-
const {
|
|
5
|
-
FRAMEWORK_PROVIDER_CANDIDATES,
|
|
6
|
-
buildFrameworkProviderPromotionPack,
|
|
7
|
-
summarizeFrameworkProviderPromotionPack,
|
|
8
|
-
validateFrameworkProviderPromotionEvidence
|
|
9
|
-
} = require("../lib/framework_provider_promotion");
|
|
10
|
-
|
|
11
|
-
function normalizeUrl(baseUrl, healthPath) {
|
|
12
|
-
const url = new URL(baseUrl);
|
|
13
|
-
const normalizedPath = String(healthPath || "/health").startsWith("/")
|
|
14
|
-
? String(healthPath || "/health")
|
|
15
|
-
: `/${healthPath}`;
|
|
16
|
-
url.pathname = normalizedPath;
|
|
17
|
-
return url.toString();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function checkHealth(candidate, env) {
|
|
21
|
-
const endpoint = env[candidate.endpoint_env];
|
|
22
|
-
const token = env[candidate.auth_env];
|
|
23
|
-
const healthPath = env[candidate.health_path_env] || "/health";
|
|
24
|
-
const started = Date.now();
|
|
25
|
-
const response = await fetch(normalizeUrl(endpoint, healthPath), {
|
|
26
|
-
method: "GET",
|
|
27
|
-
headers: {
|
|
28
|
-
Authorization: `Bearer ${token}`,
|
|
29
|
-
Accept: "application/json"
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const latencyMs = Date.now() - started;
|
|
33
|
-
let body = null;
|
|
34
|
-
try {
|
|
35
|
-
body = await response.json();
|
|
36
|
-
} catch (_error) {
|
|
37
|
-
body = null;
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
framework_id: candidate.framework_id,
|
|
41
|
-
adapter_id: candidate.adapter_id,
|
|
42
|
-
status_code: response.status,
|
|
43
|
-
latency_ms: latencyMs,
|
|
44
|
-
health_ok: response.ok && (!body || ["ok", "ready", "auth_required"].includes(String(body.status || body.readiness || "ok"))),
|
|
45
|
-
body_status: body && (body.status || body.readiness || null)
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function buildValidPromotionEvidence(candidateSummary) {
|
|
50
|
-
return {
|
|
51
|
-
framework_id: candidateSummary.framework_id,
|
|
52
|
-
adapter_id: candidateSummary.adapter_id,
|
|
53
|
-
task_ref: candidateSummary.task_ref,
|
|
54
|
-
operator_evidence_ref: `ops.framework_provider.${candidateSummary.framework_id}.2026-04-22`,
|
|
55
|
-
auth_boundary_ref: `ops.framework_provider.auth_boundary.${candidateSummary.framework_id}.2026-04-22`,
|
|
56
|
-
health_check: {
|
|
57
|
-
status_code: 200,
|
|
58
|
-
health_ok: true
|
|
59
|
-
},
|
|
60
|
-
latency_ms: 250,
|
|
61
|
-
latency_budget_ms: 2000,
|
|
62
|
-
failure_behavior_ref: `ops.framework_provider.failure_behavior.${candidateSummary.framework_id}.2026-04-22`,
|
|
63
|
-
proof_fact_shape_ref: `ops.framework_provider.proof_facts.${candidateSummary.framework_id}.2026-04-22`
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function assertRejected(pack, evidence, expectedCode) {
|
|
68
|
-
const validation = validateFrameworkProviderPromotionEvidence(pack, evidence);
|
|
69
|
-
assert.strictEqual(validation.promotion_allowed, false, `expected ${expectedCode} to block framework provider promotion`);
|
|
70
|
-
assert.strictEqual(
|
|
71
|
-
validation.rejection_codes.includes(expectedCode),
|
|
72
|
-
true,
|
|
73
|
-
`missing deterministic rejection code ${expectedCode}`
|
|
74
|
-
);
|
|
75
|
-
return validation;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function main() {
|
|
79
|
-
const pack = buildFrameworkProviderPromotionPack();
|
|
80
|
-
const summary = summarizeFrameworkProviderPromotionPack();
|
|
81
|
-
assert.strictEqual(pack.ok, true, "framework provider promotion pack failed");
|
|
82
|
-
assert.strictEqual(summary.framework_candidate_count, FRAMEWORK_PROVIDER_CANDIDATES.length, "framework candidate count mismatch");
|
|
83
|
-
assert.strictEqual(pack.promoted_provider_count, 0, "promotion pack must not auto-promote providers");
|
|
84
|
-
assert.strictEqual(pack.deterministic_rejection_codes.length >= 13, true, "framework promotion rejection codes missing");
|
|
85
|
-
assert.strictEqual(summary.deterministic_rejection_code_count, pack.deterministic_rejection_codes.length, "framework promotion summary rejection code count mismatch");
|
|
86
|
-
assert.strictEqual(
|
|
87
|
-
pack.strict_boundaries.includes("reference_framework_adapters_do_not_equal_live_provider_integrations"),
|
|
88
|
-
true,
|
|
89
|
-
"framework reference boundary missing"
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
assertRejected(pack, buildValidPromotionEvidence(pack.candidates[0]), "candidate_not_live_check_ready");
|
|
93
|
-
assertRejected(pack, { framework_id: "unknown_framework" }, "framework_not_registered");
|
|
94
|
-
|
|
95
|
-
const syntheticEnv = {
|
|
96
|
-
XYTARA_LANGGRAPH_PROVIDER_URL: "https://provider.example.test",
|
|
97
|
-
XYTARA_LANGGRAPH_PROVIDER_TOKEN: "configured-token-placeholder",
|
|
98
|
-
XYTARA_LANGGRAPH_PROVIDER_HEALTH_PATH: "/health"
|
|
99
|
-
};
|
|
100
|
-
const promotablePack = buildFrameworkProviderPromotionPack({ env: syntheticEnv });
|
|
101
|
-
const promotableCandidate = promotablePack.candidates.find((candidate) => candidate.framework_id === "langgraph");
|
|
102
|
-
const validEvidence = buildValidPromotionEvidence(promotableCandidate);
|
|
103
|
-
const validValidation = validateFrameworkProviderPromotionEvidence(promotablePack, validEvidence);
|
|
104
|
-
assert.strictEqual(promotableCandidate.state, "live_check_ready", "synthetic provider should be live-check ready");
|
|
105
|
-
assert.strictEqual(validValidation.promotion_allowed, true, "complete synthetic evidence should validate");
|
|
106
|
-
assert.deepStrictEqual(validValidation.rejection_codes, [], "complete synthetic evidence should not carry rejections");
|
|
107
|
-
|
|
108
|
-
assertRejected(promotablePack, { ...validEvidence, adapter_id: "wrong.adapter" }, "adapter_id_mismatch");
|
|
109
|
-
assertRejected(promotablePack, { ...validEvidence, task_ref: "wrong.task" }, "task_ref_mismatch");
|
|
110
|
-
assertRejected(promotablePack, { ...validEvidence, operator_evidence_ref: null }, "operator_evidence_missing");
|
|
111
|
-
assertRejected(promotablePack, { ...validEvidence, auth_boundary_ref: null }, "auth_boundary_evidence_missing");
|
|
112
|
-
assertRejected(promotablePack, { ...validEvidence, health_check: null }, "health_check_missing");
|
|
113
|
-
assertRejected(promotablePack, { ...validEvidence, health_check: { status_code: 503, health_ok: false } }, "health_check_failed");
|
|
114
|
-
assertRejected(promotablePack, { ...validEvidence, latency_ms: null }, "latency_measurement_missing");
|
|
115
|
-
assertRejected(promotablePack, { ...validEvidence, latency_ms: 3000, latency_budget_ms: 1000 }, "latency_budget_exceeded");
|
|
116
|
-
assertRejected(promotablePack, { ...validEvidence, failure_behavior_ref: null }, "failure_behavior_evidence_missing");
|
|
117
|
-
assertRejected(promotablePack, { ...validEvidence, proof_fact_shape_ref: null }, "proof_fact_shape_evidence_missing");
|
|
118
|
-
assertRejected(promotablePack, { ...validEvidence, provider_token: "sk_live_accidental_secret" }, "secret_material_forbidden");
|
|
119
|
-
|
|
120
|
-
const readyCandidates = pack.candidates.filter((candidate) => candidate.state === "live_check_ready");
|
|
121
|
-
if (pack.require_live) {
|
|
122
|
-
assert.strictEqual(readyCandidates.length > 0, true, "live provider promotion required but no endpoint/auth pair is configured");
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const live_checks = [];
|
|
126
|
-
for (const candidate of FRAMEWORK_PROVIDER_CANDIDATES) {
|
|
127
|
-
const candidateSummary = pack.candidates.find((entry) => entry.framework_id === candidate.framework_id);
|
|
128
|
-
if (!candidateSummary || candidateSummary.state !== "live_check_ready") continue;
|
|
129
|
-
const result = await checkHealth(candidate, process.env);
|
|
130
|
-
assert.strictEqual(result.health_ok, true, `${candidate.framework_id} live health check failed`);
|
|
131
|
-
live_checks.push(result);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const result = {
|
|
135
|
-
ok: true,
|
|
136
|
-
product: "xytara",
|
|
137
|
-
category: "xytara-framework-provider-promotion-verification",
|
|
138
|
-
status: live_checks.length > 0 ? "live_provider_health_checks_passed" : "no_live_provider_evidence_configured",
|
|
139
|
-
live_check_count: live_checks.length,
|
|
140
|
-
promotion_allowed: false,
|
|
141
|
-
deterministic_rejection_code_count: pack.deterministic_rejection_codes.length,
|
|
142
|
-
adversarial_case_count: 13,
|
|
143
|
-
live_checks,
|
|
144
|
-
boundary: "this_verifier_checks_promotion_evidence_but_does_not_promote_reference_adapters_to_live_provider_claims"
|
|
145
|
-
};
|
|
146
|
-
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
main().catch((error) => {
|
|
150
|
-
console.error(error && error.stack ? error.stack : error);
|
|
151
|
-
process.exit(1);
|
|
152
|
-
});
|