xoonya 3.1.17 → 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/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "xoonya",
3
- "version": "3.1.17",
4
- "description": "Deterministic proof and review engine with post-quantum verification (Ed25519 + ML-DSA-65 hybrid) for receipts, handoffs, governance, and the native XNYA machine-evidence format. Verified live via the paid x402 lane.",
5
- "main": "index.js",
3
+ "version": "3.2.0",
4
+ "description": "Verifier for xoonya proofs and naxytra delivery evidence: deterministic verification of xoonya native proof bundles (replayable digest, Ed25519/secp256k1/P-256 signed, Ed25519 + ML-DSA-65 post-quantum hybrid, anchored), XNYA machine-evidence atoms, and detached signatures (Ed25519, ECDSA, RSA, ML-DSA). The proof engine and server are a hosted service and are not distributed.",
5
+ "main": "verify.js",
6
6
  "bin": {
7
- "xoonya": "bin/xoonya.js",
8
- "xoonya-review": "bin/xoonya-review.js",
9
- "xoonya-release": "bin/xoonya-release.js"
7
+ "xoonya": "bin/xoonya.js"
10
8
  },
11
9
  "type": "commonjs",
12
10
  "license": "Apache-2.0",
@@ -19,38 +17,20 @@
19
17
  "node": ">=24"
20
18
  },
21
19
  "files": [
22
- "index.js",
23
- "proof_sdk.js",
24
- "server.js",
25
- "bin/",
26
- "scripts/",
27
- "lib/",
28
- "integrations/",
29
- "reference/",
30
- "vectors/",
31
- "RELEASE_NOTES.md",
32
- ".env.example",
20
+ "verify.js",
21
+ "lib/native_verify.js",
22
+ "lib/external_proof_verify.js",
23
+ "bin/xoonya.js",
24
+ "bin/xoonya-first-run.js",
25
+ "scripts/verify_vectors.js",
26
+ "scripts/verify_release_candidate.js",
27
+ "vectors/conformance-vectors.json",
28
+ "vectors/adversarial-vectors.json",
29
+ "vectors/native-atom-vectors.json",
30
+ "vectors/native-payload-profile-vectors.json",
33
31
  "README.md",
34
- "XOONYA_PROOF_TRUTH_MODEL.md",
35
- "XOONYA_DEFAULT_PATH_MODEL.md",
36
- "XOONYA_FOLLOWTHROUGH_TRUTH_MODEL.md",
37
- "XOONYA_NATIVE_PROOF_FORMAT.md",
38
- "XOONYA_NATIVE_ATOM_SPEC.md",
39
- "XOONYA_NATIVE_STANDARD_GOVERNANCE.md",
40
- "XNYA_CONFORMANCE_MARK.md",
41
- "XNYA_REFERENCE_IMPLEMENTATIONS.md",
42
- "WHY_XYTARA_XOONYA.md",
43
- "CARRIED_HANDOFF_DEMO.md",
44
- "PARTNER_READY_PATH.md",
45
- "EXAMPLE_PATHS.md",
46
- "PUBLIC_DEMO_SCRIPT.md",
47
32
  "START_HERE.md",
48
- "examples/",
49
- "FINAL_CONTRACT.md",
50
- "SERVICE_CONTRACT.md",
51
- "TERMINOLOGY.md",
52
- "CROSS_RUNTIME_POSTURE.md",
53
- "COMPATIBILITY_NOTE.md",
33
+ "RELEASE_NOTES.md",
54
34
  "LICENSE",
55
35
  "NOTICE"
56
36
  ],
@@ -60,22 +40,19 @@
60
40
  },
61
41
  "keywords": [
62
42
  "proof",
63
- "review",
64
- "handoff",
65
- "governance",
66
- "audit",
43
+ "verifier",
44
+ "verification",
67
45
  "receipt",
68
- "canonical-events",
69
46
  "proof-bundle",
70
47
  "deterministic",
71
48
  "machine",
72
49
  "evidence",
73
50
  "post-quantum",
74
51
  "ml-dsa",
75
- "slh-dsa",
76
52
  "pqc",
77
53
  "xnya",
78
54
  "ed25519",
55
+ "jws",
79
56
  "x402"
80
57
  ],
81
58
  "scripts": {
@@ -1,131 +1,258 @@
1
1
  "use strict";
2
2
 
3
+ // Release-candidate gate for the xoonya verifier package. Node built-ins only.
4
+ //
5
+ // Source checkout (proof_sdk.js present): the `npm pack --dry-run` file list must
6
+ // equal the publish allowlist exactly, the vectors must pass on the standalone
7
+ // verifier AND the engine-parity cross-check must run, and the CLI surface must
8
+ // behave as documented.
9
+ //
10
+ // Installed package (no proof_sdk.js): the engine, server and operator tooling
11
+ // must be absent, and the vectors must pass on the standalone verifier.
12
+
3
13
  const assert = require("assert");
4
14
  const fs = require("fs");
5
15
  const path = require("path");
6
- const { execFileSync, execSync } = require("child_process");
7
- const packageJson = require("../package.json");
8
-
9
- function parsePackDryRun() {
10
- const output = execSync("npm pack --dry-run --json", {
11
- cwd: path.resolve(__dirname, ".."),
12
- encoding: "utf8"
13
- });
14
- const parsed = JSON.parse(output);
15
- return Array.isArray(parsed) ? parsed[0] : parsed;
16
+ const { execFileSync, execSync, spawnSync } = require("child_process");
17
+
18
+ const ROOT = path.resolve(__dirname, "..");
19
+ const packageJson = JSON.parse(fs.readFileSync(path.join(ROOT, "package.json"), "utf8"));
20
+
21
+ const PUBLISHED_FILES = Object.freeze([
22
+ "LICENSE",
23
+ "NOTICE",
24
+ "README.md",
25
+ "RELEASE_NOTES.md",
26
+ "START_HERE.md",
27
+ "bin/xoonya-first-run.js",
28
+ "bin/xoonya.js",
29
+ "lib/external_proof_verify.js",
30
+ "lib/native_verify.js",
31
+ "package.json",
32
+ "scripts/verify_release_candidate.js",
33
+ "scripts/verify_vectors.js",
34
+ "vectors/adversarial-vectors.json",
35
+ "vectors/conformance-vectors.json",
36
+ "vectors/native-atom-vectors.json",
37
+ "vectors/native-payload-profile-vectors.json",
38
+ "verify.js"
39
+ ]);
40
+
41
+ // Never published. Checked against the pack list in the source checkout and
42
+ // against the filesystem in an installed package.
43
+ const FORBIDDEN_PATHS = Object.freeze([
44
+ "proof_sdk.js",
45
+ "server.js",
46
+ "index.js",
47
+ ".env.example",
48
+ "integrations",
49
+ "reference",
50
+ "examples",
51
+ "bin/xoonya-release.js",
52
+ "bin/xoonya-review.js",
53
+ "scripts/verify_all.js",
54
+ "scripts/verify_service.js",
55
+ "scripts/verify_tooling.js",
56
+ "lib/release_center.js",
57
+ "lib/release_pack.js",
58
+ "lib/review_intelligence.js",
59
+ "lib/governance_intelligence.js",
60
+ "lib/bridge_intelligence.js"
61
+ ]);
62
+
63
+ const REQUIRED_NATIVE_METHODS = Object.freeze([
64
+ "xoonya-native-sha256-v1",
65
+ "xoonya-native-signed-v1",
66
+ "xoonya-native-anchored-v1"
67
+ ]);
68
+
69
+ const checks = [];
70
+ function check(name, condition, detail) {
71
+ assert.strictEqual(Boolean(condition), true, detail ? `${name}: ${detail}` : name);
72
+ checks.push(name);
73
+ }
74
+
75
+ function runNode(args, options = {}) {
76
+ return execFileSync(process.execPath, args, { cwd: ROOT, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], ...options });
77
+ }
78
+
79
+ function verifyPackageManifest() {
80
+ check("package name", packageJson.name === "xoonya");
81
+ check("package main is verify.js", packageJson.main === "verify.js");
82
+ check("package bin is xoonya only", JSON.stringify(packageJson.bin) === JSON.stringify({ xoonya: "bin/xoonya.js" }));
83
+ check("package license Apache-2.0", packageJson.license === "Apache-2.0");
84
+ check("package publish access public", packageJson.publishConfig && packageJson.publishConfig.access === "public");
85
+ check("package prepublishOnly runs the gate", packageJson.scripts && packageJson.scripts.prepublishOnly === "npm run verify:release-candidate");
86
+ check("package files allowlist declared", Array.isArray(packageJson.files) && packageJson.files.length > 0);
87
+ for (const forbidden of FORBIDDEN_PATHS) {
88
+ check(`package files excludes ${forbidden}`, !packageJson.files.some((entry) => entry === forbidden || entry === `${forbidden}/` || entry.startsWith(`${forbidden}/`)));
89
+ }
90
+ check("package description names the verifier role", /verif/i.test(packageJson.description || ""));
16
91
  }
17
92
 
18
93
  function verifyReleaseNotes() {
19
- const notesPath = path.resolve(__dirname, "..", "RELEASE_NOTES.md");
20
- const notes = fs.readFileSync(notesPath, "utf8");
21
- assert.strictEqual(
22
- /^#\s+xoonya\s+\d+\.\d+\.\d+\s+Release Notes\s*$/m.test(notes),
23
- false,
24
- "RELEASE_NOTES.md must not duplicate the GitHub release title as a heading"
25
- );
26
- assert.strictEqual(
27
- notes.includes(`xoonya\` ${packageJson.version}`),
28
- true,
29
- "RELEASE_NOTES.md must mention the current package version"
30
- );
31
- const mentionedVersions = notes.match(/\b\d+\.\d+\.\d+\b/g) || [];
32
- assert.strictEqual(
33
- mentionedVersions.every((version) => version === packageJson.version),
34
- true,
35
- "RELEASE_NOTES.md must not mention prior package versions"
36
- );
94
+ const notes = fs.readFileSync(path.join(ROOT, "RELEASE_NOTES.md"), "utf8");
95
+ check("release notes do not duplicate the release title heading", !/^#\s+xoonya\s+\d+\.\d+\.\d+\s+Release Notes\s*$/m.test(notes));
96
+ check("release notes mention the package version", notes.includes(`\`xoonya\` ${packageJson.version}`), `expected \`xoonya\` ${packageJson.version}`);
97
+ const mentioned = notes.match(/\b\d+\.\d+\.\d+\b/g) || [];
98
+ check("release notes mention no other version", mentioned.every((version) => version === packageJson.version), `found ${JSON.stringify(Array.from(new Set(mentioned)))}`);
99
+ }
100
+
101
+ // Every shipped JS file may require only Node built-ins or other shipped files.
102
+ function verifyShippedRequires() {
103
+ const builtins = new Set(require("module").builtinModules);
104
+ const shippedJs = PUBLISHED_FILES.filter((entry) => entry.endsWith(".js"));
105
+ for (const file of shippedJs) {
106
+ const source = fs.readFileSync(path.join(ROOT, file), "utf8");
107
+ const pattern = /require\(\s*["']([^"']+)["']\s*\)/g;
108
+ let match;
109
+ while ((match = pattern.exec(source)) !== null) {
110
+ const target = match[1];
111
+ if (target.startsWith(".")) {
112
+ const resolved = path.relative(ROOT, path.resolve(ROOT, path.dirname(file), target)).replace(/\\/g, "/");
113
+ const candidates = [resolved, `${resolved}.js`, `${resolved}.json`];
114
+ check(`${file} requires shipped ${target}`, candidates.some((candidate) => PUBLISHED_FILES.includes(candidate)), `resolved to ${resolved}`);
115
+ } else {
116
+ check(`${file} requires built-in ${target}`, builtins.has(target.replace(/^node:/, "")));
117
+ }
118
+ }
119
+ }
120
+ }
121
+
122
+ function verifyPackList() {
123
+ const output = execSync("npm pack --dry-run --json", { cwd: ROOT, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
124
+ const parsed = JSON.parse(output);
125
+ const dryRun = Array.isArray(parsed) ? parsed[0] : parsed;
126
+ check("npm pack name", dryRun.name === packageJson.name);
127
+ check("npm pack version", dryRun.version === packageJson.version);
128
+ const packed = dryRun.files.map((entry) => entry.path).sort();
129
+ const expected = PUBLISHED_FILES.slice().sort();
130
+ const extra = packed.filter((entry) => !expected.includes(entry));
131
+ const missing = expected.filter((entry) => !packed.includes(entry));
132
+ check("npm pack file list equals the publish allowlist", extra.length === 0 && missing.length === 0, `extra=${JSON.stringify(extra)} missing=${JSON.stringify(missing)}`);
133
+ for (const forbidden of FORBIDDEN_PATHS) {
134
+ check(`npm pack excludes ${forbidden}`, !packed.some((entry) => entry === forbidden || entry.startsWith(`${forbidden}/`)));
135
+ }
136
+ return packed.length;
137
+ }
138
+
139
+ function verifyInstalledLayout() {
140
+ for (const forbidden of FORBIDDEN_PATHS) {
141
+ check(`installed package has no ${forbidden}`, !fs.existsSync(path.join(ROOT, forbidden)));
142
+ }
143
+ const libFiles = fs.readdirSync(path.join(ROOT, "lib")).sort();
144
+ check("installed lib/ holds only the two verifier modules", JSON.stringify(libFiles) === JSON.stringify(["external_proof_verify.js", "native_verify.js"]), JSON.stringify(libFiles));
145
+ const scriptFiles = fs.readdirSync(path.join(ROOT, "scripts")).sort();
146
+ check("installed scripts/ holds only the two shipped scripts", JSON.stringify(scriptFiles) === JSON.stringify(["verify_release_candidate.js", "verify_vectors.js"]), JSON.stringify(scriptFiles));
147
+ const binFiles = fs.readdirSync(path.join(ROOT, "bin")).sort();
148
+ check("installed bin/ holds only the dispatcher and first-run", JSON.stringify(binFiles) === JSON.stringify(["xoonya-first-run.js", "xoonya.js"]), JSON.stringify(binFiles));
149
+ for (const file of PUBLISHED_FILES) {
150
+ check(`installed package has ${file}`, fs.existsSync(path.join(ROOT, file)));
151
+ }
152
+ return PUBLISHED_FILES.length;
153
+ }
154
+
155
+ function verifyVectors(inRepo) {
156
+ const args = [path.join(ROOT, "scripts", "verify_vectors.js"), "--json"];
157
+ if (inRepo) args.push("--require-engine-parity");
158
+ const summary = JSON.parse(runNode(args));
159
+ check("vectors ok", summary.ok === true);
160
+ check("conformance vector count", summary.conformance_count >= 8, String(summary.conformance_count));
161
+ check("adversarial vector count", summary.adversarial_count >= 8, String(summary.adversarial_count));
162
+ check("native atom vectors", summary.native_atom_vector_count >= 1 && summary.native_atom_adversarial_count >= 1);
163
+ for (const method of REQUIRED_NATIVE_METHODS) {
164
+ check(`verification methods include ${method}`, summary.verification_methods.includes(method));
165
+ }
166
+ check("verification methods include xoonya-native-hybrid-v1", summary.verification_methods.includes("xoonya-native-hybrid-v1"));
167
+ check("adversarial reasons include native_hybrid_pq_signature_invalid", summary.adversarial_reasons.includes("native_hybrid_pq_signature_invalid"));
168
+ check("external signature self-test Ed25519", summary.external_signature_checks.EdDSA === true);
169
+ check("external signature self-test ML-DSA-65", summary.external_signature_checks["ML-DSA-65"] === true);
170
+ if (inRepo) {
171
+ check("engine parity checked", summary.engine_parity.checked === true);
172
+ check("engine parity comparisons", summary.engine_parity.comparisons >= 100, String(summary.engine_parity.comparisons));
173
+ } else {
174
+ check("engine not present", summary.engine_parity.checked === false && summary.engine_parity.reason === "engine_not_present");
175
+ }
176
+ return summary;
177
+ }
178
+
179
+ function verifyCli() {
180
+ const cli = path.join(ROOT, "bin", "xoonya.js");
181
+ const startHere = runNode([cli, "start-here"]);
182
+ check("start-here names the anchored method", startHere.includes("xoonya-native-anchored-v1"));
183
+ check("start-here links the first-run kit", startHere.includes("https://www.naxytra.com/v1/first-run-kit"));
184
+ check("start-here states the verifier role", startHere.includes("this package is the verifier"));
185
+
186
+ const firstRun = JSON.parse(runNode([cli, "first-run", "--verify-native", "--pretty"]));
187
+ check("first-run --verify-native ok", firstRun.ok === true);
188
+ check("first-run required native methods present", firstRun.required_native_methods_present === true);
189
+
190
+ const guide = JSON.parse(runNode([cli, "first-run", "--json", "--offline"]));
191
+ check("first-run guide category", guide.category === "xoonya-first-run-proof-guide");
192
+
193
+ const conformance = JSON.parse(runNode([cli, "conformance", "--json"]));
194
+ check("conformance --json ok", conformance.ok === true);
195
+ check("conformance --json includes anchored method", conformance.verification_methods.includes("xoonya-native-anchored-v1"));
196
+
197
+ for (const command of ["release", "review"]) {
198
+ const result = spawnSync(process.execPath, [cli, command, "--summary"], { cwd: ROOT, encoding: "utf8" });
199
+ check(`${command} command exits 2`, result.status === 2, String(result.status));
200
+ check(`${command} command points to the website`, `${result.stdout}${result.stderr}`.includes("Operator tooling is not part of the xoonya verifier package. See https://www.naxytra.com/xoonya"));
201
+ }
202
+
203
+ const vectors = JSON.parse(fs.readFileSync(path.join(ROOT, "vectors", "conformance-vectors.json"), "utf8"));
204
+ const anchored = vectors.vectors.find((vector) => vector.expected.receipt.algorithm === "xoonya-native-anchored-v1");
205
+ const bundleFile = path.join(require("os").tmpdir(), `xoonya-rc-bundle-${process.pid}.json`);
206
+ fs.writeFileSync(bundleFile, JSON.stringify({
207
+ version: anchored.expected.proof_bundle_version,
208
+ ceb: anchored.event,
209
+ receipt: anchored.expected.receipt,
210
+ anchors: anchored.anchors
211
+ }));
212
+ try {
213
+ const verified = JSON.parse(runNode([cli, "verify", bundleFile]));
214
+ check("verify <bundle> accepts the anchored vector", verified.valid === true && verified.verification_method === "xoonya-native-anchored-v1");
215
+ const strict = spawnSync(process.execPath, [cli, "verify", bundleFile, "--strict"], { cwd: ROOT, encoding: "utf8" });
216
+ check("verify --strict rejects the digest-class bundle with exit 1", strict.status === 1 && JSON.parse(strict.stdout).reason === "digest_only_not_cryptographically_verified");
217
+ } finally {
218
+ fs.unlinkSync(bundleFile);
219
+ }
220
+ }
221
+
222
+ function verifyEntry() {
223
+ const entry = require(path.join(ROOT, "verify.js"));
224
+ for (const name of ["verifyNativeProof", "verifyNativeBundle", "verifyProofBundle", "verifyDetachedSignature", "verifyJws", "verifyExternalProofSignature", "verifyxoonyaNativeAtom", "verifyVectors", "canonicalizeEvent", "hashEvent"]) {
225
+ check(`entry exports ${name}`, typeof entry[name] === "function");
226
+ }
227
+ for (const name of ["emitReceipt", "buildProofBundle", "buildNativeSignedReceiptProof", "buildNativeHybridReceiptProof", "createReceipt", "reviewGovernanceCase", "buildBridgeCenter"]) {
228
+ check(`entry does not export engine function ${name}`, entry[name] === undefined);
229
+ }
230
+ check("entry version equals package version", entry.version === packageJson.version);
231
+ check("entry endpoints", entry.endpoints.hosted_service === "https://xoonya.onrender.com" && entry.endpoints.website === "https://www.naxytra.com");
37
232
  }
38
233
 
39
234
  function main() {
40
- const releaseOutput = execFileSync(process.execPath, [
41
- path.resolve(__dirname, "..", "bin", "xoonya-release.js"),
42
- "--candidate",
43
- "--summary"
44
- ], {
45
- cwd: path.resolve(__dirname, ".."),
46
- encoding: "utf8"
47
- });
48
- const releaseCandidate = JSON.parse(releaseOutput);
49
- assert.strictEqual(releaseCandidate.product, "xoonya", "release candidate product mismatch");
50
- assert.strictEqual(releaseCandidate.publish_access, "public", "release candidate publish access mismatch");
51
- assert.strictEqual(releaseCandidate.checklist_count >= 5, true, "release candidate checklist count mismatch");
235
+ const inRepo = fs.existsSync(path.join(ROOT, "proof_sdk.js"));
236
+ verifyPackageManifest();
52
237
  verifyReleaseNotes();
53
-
54
- const conformanceOutput = execFileSync(process.execPath, [
55
- path.resolve(__dirname, "..", "bin", "xoonya.js"),
56
- "conformance",
57
- "--json"
58
- ], {
59
- cwd: path.resolve(__dirname, ".."),
60
- encoding: "utf8"
61
- });
62
- const conformanceSummary = JSON.parse(conformanceOutput);
63
- assert.strictEqual(conformanceSummary.ok, true, "conformance command did not pass");
64
- assert.strictEqual(conformanceSummary.conformance_count >= 8, true, "conformance vector count too small");
65
- assert.strictEqual(conformanceSummary.adversarial_count >= 8, true, "adversarial vector count too small");
66
- assert.strictEqual(
67
- conformanceSummary.adversarial_reasons.includes("native_hybrid_pq_signature_invalid"),
68
- true,
69
- "native hybrid adversarial reason missing"
70
- );
71
- assert.deepStrictEqual(
72
- conformanceSummary.verification_methods,
73
- [
74
- "detached-assertion-v1",
75
- "did-vc-v1",
76
- "jwt-assertion-v1",
77
- "legacy-opreturn-v1",
78
- "partner-proof-envelope-v1",
79
- "sd-jwt-vc-v1",
80
- "signed-envelope-v1",
81
- "xoonya-native-anchored-v1",
82
- "xoonya-native-hybrid-v1",
83
- "xoonya-native-sha256-v1",
84
- "xoonya-native-signed-v1"
85
- ],
86
- "conformance methods mismatch"
87
- );
88
-
89
- const dryRun = parsePackDryRun();
90
- assert.strictEqual(dryRun.name, packageJson.name, "npm pack dry-run name mismatch");
91
- assert.strictEqual(dryRun.version, packageJson.version, "npm pack dry-run version mismatch");
92
- assert.strictEqual(Array.isArray(dryRun.files), true, "npm pack dry-run file list missing");
93
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "bin/xoonya.js"), true, "npm pack dry-run missing xoonya cli");
94
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "bin/xoonya-first-run.js"), true, "npm pack dry-run missing xoonya-first-run");
95
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "bin/xoonya-review.js"), true, "npm pack dry-run missing xoonya-review");
96
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "bin/xoonya-release.js"), true, "npm pack dry-run missing xoonya-release");
97
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_external_proof_import_gate.js"), true, "npm pack dry-run missing external proof import gate verifier script");
98
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_vectors.js"), true, "npm pack dry-run missing conformance verifier script");
99
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_reference_python.js"), true, "npm pack dry-run missing Python reference verifier script");
100
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_reference_python_crypto.js"), true, "npm pack dry-run missing Python crypto reference verifier script");
101
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_reference_promotion_gate.js"), true, "npm pack dry-run missing reference promotion gate verifier script");
102
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_reference_rust_scaffold.js"), true, "npm pack dry-run missing Rust reference scaffold verifier script");
103
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_native_hybrid_design_gate.js"), true, "npm pack dry-run missing native hybrid verifier script");
104
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_verification_services.js"), true, "npm pack dry-run missing verification services verifier script");
105
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "scripts/verify_all.js"), true, "npm pack dry-run missing package verifier script");
106
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "vectors/conformance-vectors.json"), true, "npm pack dry-run missing conformance vectors");
107
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "vectors/adversarial-vectors.json"), true, "npm pack dry-run missing adversarial vectors");
108
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "vectors/native-atom-vectors.json"), true, "npm pack dry-run missing native atom vectors");
109
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "README.md"), true, "npm pack dry-run missing README");
110
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "XOONYA_NATIVE_ATOM_SPEC.md"), true, "npm pack dry-run missing native atom spec");
111
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "XOONYA_NATIVE_STANDARD_GOVERNANCE.md"), true, "npm pack dry-run missing native governance doc");
112
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "XNYA_CONFORMANCE_MARK.md"), true, "npm pack dry-run missing XNYA conformance mark doc");
113
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "XNYA_REFERENCE_IMPLEMENTATIONS.md"), true, "npm pack dry-run missing XNYA reference implementations doc");
114
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "reference/python/xnya_reference.py"), true, "npm pack dry-run missing Python XNYA candidate reference");
115
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "reference/python/verify_vectors.py"), true, "npm pack dry-run missing Python XNYA vector verifier");
116
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "reference/python/requirements-optional.txt"), true, "npm pack dry-run missing Python optional requirements");
117
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "reference/rust/Cargo.toml"), true, "npm pack dry-run missing Rust candidate Cargo manifest");
118
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "reference/rust/src/lib.rs"), true, "npm pack dry-run missing Rust candidate source");
119
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "reference/rust/README.md"), true, "npm pack dry-run missing Rust candidate boundary doc");
120
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "RELEASE_NOTES.md"), true, "npm pack dry-run missing release notes");
121
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "START_HERE.md"), true, "npm pack dry-run missing start-here");
122
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "SERVICE_CONTRACT.md"), true, "npm pack dry-run missing service contract");
123
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "OPERATOR_START_HERE.md"), false, "npm pack dry-run should not ship operator start-here");
124
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "OPERATIONS_RUNBOOK.md"), false, "npm pack dry-run should not ship operations runbook");
125
- assert.strictEqual(dryRun.files.some((entry) => entry.path === "PUBLISH_PLAN.md"), false, "npm pack dry-run should not ship publish plan");
126
- assert.strictEqual(dryRun.files.length >= 10, true, "npm pack dry-run file count too small");
127
-
128
- console.log("xoonya verify:release-candidate passed");
238
+ verifyShippedRequires();
239
+ const publishedFileCount = inRepo ? verifyPackList() : verifyInstalledLayout();
240
+ const summary = verifyVectors(inRepo);
241
+ verifyCli();
242
+ verifyEntry();
243
+ process.stdout.write(`${JSON.stringify({
244
+ ok: true,
245
+ product: "xoonya",
246
+ category: "xoonya-verifier-release-candidate",
247
+ mode: inRepo ? "source_checkout" : "installed_package",
248
+ version: packageJson.version,
249
+ published_file_count: publishedFileCount,
250
+ conformance_count: summary.conformance_count,
251
+ adversarial_count: summary.adversarial_count,
252
+ verification_method_count: summary.verification_methods.length,
253
+ engine_parity_comparisons: summary.engine_parity.checked ? summary.engine_parity.comparisons : null,
254
+ check_count: checks.length
255
+ })}\n`);
129
256
  }
130
257
 
131
258
  main();