xoonya 2.6.0 → 2.8.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 (36) hide show
  1. package/CROSS_RUNTIME_POSTURE.md +32 -2
  2. package/README.md +14 -1
  3. package/RELEASE_NOTES.md +25 -0
  4. package/SERVICE_CONTRACT.md +4 -0
  5. package/XNYA_CONFORMANCE_MARK.md +78 -0
  6. package/XNYA_REFERENCE_IMPLEMENTATIONS.md +157 -0
  7. package/XOONYA_NATIVE_PROOF_FORMAT.md +2 -0
  8. package/XOONYA_NATIVE_STANDARD_GOVERNANCE.md +4 -1
  9. package/bin/xoonya-release.js +19 -1
  10. package/bin/xoonya.js +1 -0
  11. package/lib/release_history.js +27 -0
  12. package/package.json +12 -2
  13. package/proof_sdk.js +605 -2
  14. package/reference/python/README.md +35 -0
  15. package/reference/python/requirements-optional.txt +1 -0
  16. package/reference/python/verify_vectors.py +209 -0
  17. package/reference/python/xnya_reference.py +810 -0
  18. package/reference/rust/Cargo.toml +11 -0
  19. package/reference/rust/README.md +28 -0
  20. package/reference/rust/src/lib.rs +87 -0
  21. package/scripts/registry_cli.js +157 -0
  22. package/scripts/verify_all.js +593 -0
  23. package/scripts/verify_examples.js +19 -0
  24. package/scripts/verify_external_proof_import_gate.js +84 -0
  25. package/scripts/verify_integrations.js +170 -0
  26. package/scripts/verify_native_hybrid_design_gate.js +108 -0
  27. package/scripts/verify_reference_promotion_gate.js +74 -0
  28. package/scripts/verify_reference_python.js +49 -0
  29. package/scripts/verify_reference_python_crypto.js +87 -0
  30. package/scripts/verify_reference_rust_scaffold.js +50 -0
  31. package/scripts/verify_release_candidate.js +106 -0
  32. package/scripts/verify_service.js +2849 -0
  33. package/scripts/verify_tooling.js +1251 -0
  34. package/scripts/verify_vectors.js +164 -0
  35. package/server.js +20 -0
  36. package/vectors/adversarial-vectors.json +27 -0
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const {
5
+ buildExternalProofImportAdapterPack,
6
+ validateExternalProofImportEvidence
7
+ } = require("../proof_sdk");
8
+
9
+ function validImport() {
10
+ return {
11
+ method: "jwt-assertion-v1",
12
+ import_ref: "external-import-gate-demo",
13
+ issuer_ref: "did:example:issuer",
14
+ subject_ref: "txn:xytara:demo",
15
+ external_proof: "eyJhbGciOiJFZERTQSJ9.eyJzdWIiOiJ0eG4teHl0YXJhLWRlbW8ifQ.signature",
16
+ evidence_refs: ["memory://external/import-gate-demo"]
17
+ };
18
+ }
19
+
20
+ function assertRejected(input, expectedCode) {
21
+ const validation = validateExternalProofImportEvidence(input);
22
+ assert.strictEqual(validation.import_allowed, false, `expected ${expectedCode} to block external proof import`);
23
+ assert.strictEqual(
24
+ validation.rejection_codes.includes(expectedCode),
25
+ true,
26
+ `missing deterministic rejection code ${expectedCode}`
27
+ );
28
+ return validation;
29
+ }
30
+
31
+ function main() {
32
+ const pack = buildExternalProofImportAdapterPack();
33
+ const validValidation = validateExternalProofImportEvidence(validImport());
34
+
35
+ assert.strictEqual(pack.category, "xoonya-external-proof-import-adapter", "external import adapter category mismatch");
36
+ assert.strictEqual(pack.deterministic_rejection_codes.length >= 11, true, "external import rejection code count missing");
37
+ assert.strictEqual(validValidation.import_allowed, true, "valid structural external import should pass");
38
+ assert.deepStrictEqual(validValidation.rejection_codes, [], "valid structural external import should not carry rejection codes");
39
+
40
+ assertRejected({ ...validImport(), method: "" }, "verification_method_required");
41
+ assertRejected({ ...validImport(), method: "unknown-method-v1" }, "verification_method_unsupported");
42
+ assertRejected({ ...validImport(), method: "xoonya-native-sha256-v1" }, "verification_method_not_external_importable");
43
+ assertRejected({ method: "jwt-assertion-v1" }, "external_proof_material_required");
44
+ assertRejected({ ...validImport(), external_proof: " " }, "external_proof_material_empty");
45
+ assertRejected({ ...validImport(), declared_hash_sha256: "00".repeat(32) }, "external_proof_hash_mismatch");
46
+ assertRejected({ ...validImport(), claim_external_issuer_truth: true }, "external_issuer_truth_claim_requires_external_verifier");
47
+ assertRejected({ ...validImport(), claim_external_signature_truth: true }, "external_signature_truth_claim_requires_external_verifier");
48
+ assertRejected({ ...validImport(), claim_external_revocation_status: true }, "external_revocation_status_claim_requires_external_verifier");
49
+ assertRejected({ ...validImport(), method: "did-vc-v1", claim_did_resolution_truth: true }, "did_resolution_truth_claim_requires_external_verifier");
50
+ assertRejected({ ...validImport(), external_verifier_api_key: "sk_live_accidental_secret" }, "secret_material_forbidden");
51
+
52
+ const externallyVerified = validateExternalProofImportEvidence({
53
+ ...validImport(),
54
+ method: "did-vc-v1",
55
+ external_proof: {
56
+ "@context": ["https://www.w3.org/ns/credentials/v2"],
57
+ type: ["VerifiableCredential"],
58
+ issuer: "did:example:issuer",
59
+ credentialSubject: { id: "did:example:agent" }
60
+ },
61
+ claim_external_issuer_truth: true,
62
+ claim_external_signature_truth: true,
63
+ claim_external_revocation_status: true,
64
+ claim_did_resolution_truth: true,
65
+ external_issuer_verifier_ref: "external.verifier.issuer.did-vc.2026-04-22",
66
+ external_signature_verifier_ref: "external.verifier.signature.did-vc.2026-04-22",
67
+ external_revocation_verifier_ref: "external.verifier.revocation.did-vc.2026-04-22",
68
+ did_resolution_verifier_ref: "external.verifier.did_resolution.did-vc.2026-04-22"
69
+ });
70
+ assert.strictEqual(externallyVerified.import_allowed, true, "external verifier-backed truth claims should pass structural validation");
71
+
72
+ const output = {
73
+ ok: true,
74
+ product: "xoonya",
75
+ category: "xoonya-external-proof-import-gate-verification",
76
+ status: "external_import_binds_evidence_without_claiming_external_truth_unless_external_verifier_refs_exist",
77
+ deterministic_rejection_code_count: pack.deterministic_rejection_codes.length,
78
+ adversarial_case_count: 11,
79
+ boundary: "xoonya_imports_external_evidence_but_external_issuer_signature_revocation_and_did_truth_stay_with_external_verifiers"
80
+ };
81
+ process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
82
+ }
83
+
84
+ main();
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const stagedPartnerVerifierRegistrationRecord = require("../integrations/examples/example-third-party-verifier-registration.record.json");
5
+ const root = require("../index.js");
6
+
7
+ async function main() {
8
+ const integrations = root.listIntegrations();
9
+ assert.ok(Array.isArray(integrations), "proof integrations list missing");
10
+ assert.ok(integrations.length >= 4, "proof integration breadth missing");
11
+ assert.ok(integrations.some((integration) => integration.integration_id === "builtin.identity.legacy_material"), "legacy identity integration missing");
12
+ assert.ok(integrations.some((integration) => integration.integration_id === "builtin.verifier.registry_profile"), "registry verifier integration missing");
13
+ assert.ok(integrations.some((integration) => integration.integration_id === stagedPartnerVerifierRegistrationRecord.integration_id), "staged proof verifier integration missing");
14
+ assert.ok(integrations.some((integration) => integration.certification_state === "certified"), "proof integration certification metadata missing");
15
+
16
+ const summary = root.summarizeIntegrations();
17
+ assert.strictEqual(summary.ok, true, "proof integration summary ok mismatch");
18
+ assert.ok(summary.integration_count >= integrations.length, "proof integration count mismatch");
19
+ assert.strictEqual(summary.certified_integration_count >= 5, true, "proof integration certified count mismatch");
20
+ assert.strictEqual(summary.production_default_count >= 5, true, "proof integration production-default count mismatch");
21
+ assert.strictEqual(summary.staged_registration_count >= 1, true, "proof integration staged registration count mismatch");
22
+
23
+ const detail = root.getIntegration("builtin.verifier.economic_profile");
24
+ assert.ok(detail, "proof integration detail missing");
25
+ assert.strictEqual(detail.integration_class, "verification_helper_adapter", "proof integration class mismatch");
26
+ assert.strictEqual(detail.integration_maturity, "production_default", "proof integration maturity mismatch");
27
+
28
+ const bundledFiltered = root.listIntegrations({
29
+ source: "builtin",
30
+ certification_state: "certified",
31
+ integration_maturity: "production_default",
32
+ bundled: "true"
33
+ });
34
+ assert.ok(bundledFiltered.length >= 5, "proof builtin integration filtering mismatch");
35
+
36
+ const stagedFiltered = root.listIntegrations({
37
+ source: "third_party_example",
38
+ registration_state: "staging_registered",
39
+ proof_scope: "profile_verification",
40
+ bundled: "false"
41
+ });
42
+ assert.strictEqual(stagedFiltered.length, 1, "proof staged integration filtering mismatch");
43
+ assert.strictEqual(stagedFiltered[0].registration.requires_explicit_selection, true, "proof staged integration explicit-selection mismatch");
44
+
45
+ const validation = root.validateIntegrationRegistration({
46
+ integration_id: stagedPartnerVerifierRegistrationRecord.integration_id,
47
+ integration_class: stagedPartnerVerifierRegistrationRecord.integration_class,
48
+ proof_scope: stagedPartnerVerifierRegistrationRecord.proof_scope
49
+ }, stagedPartnerVerifierRegistrationRecord);
50
+ assert.strictEqual(validation.ok, true, "proof integration registration validation failed");
51
+
52
+ const imported = root.importRegisteredIntegration({
53
+ integration_id: "partner.verifier.memory_canary",
54
+ integration_class: "verification_helper_adapter",
55
+ display_name: "Memory Canary Verifier",
56
+ description: "Imported proof-side verifier used to validate normalization.",
57
+ proof_scope: "profile_verification",
58
+ capabilities: ["memory_canary.verify"],
59
+ public_surfaces: ["sdk"],
60
+ required_inputs: ["profile"],
61
+ emitted_artifacts: [],
62
+ verification_targets: ["memory_canary_profile"]
63
+ }, {
64
+ integration_id: "partner.verifier.memory_canary",
65
+ integration_class: "verification_helper_adapter",
66
+ proof_scope: "profile_verification",
67
+ registration_state: "local_only",
68
+ integration_maturity: "reference_example",
69
+ certification_state: "reference_example",
70
+ bundled: false,
71
+ default_selection_enabled: false,
72
+ requires_explicit_selection: true,
73
+ registered_at: "2026-03-20T00:00:00Z"
74
+ }, {
75
+ source: "verification_import_test",
76
+ certification_scope: ["contract_shape"],
77
+ operational_readiness: "reference"
78
+ });
79
+ assert.strictEqual(imported.integration_id, "partner.verifier.memory_canary", "proof imported integration id mismatch");
80
+ assert.strictEqual(imported.registration.registration_state, "local_only", "proof imported integration registration state mismatch");
81
+
82
+ const snapshot = root.exportIntegrationRegistrySnapshot({
83
+ registration_state: "staging_registered"
84
+ });
85
+ assert.strictEqual(snapshot.integration_count >= 1, true, "proof integration snapshot count mismatch");
86
+ assert.strictEqual(root.validateIntegrationRegistrySnapshot(snapshot).ok, true, "proof integration snapshot validation mismatch");
87
+
88
+ const builtinPromotion = root.summarizeIntegrationPromotionReadiness("builtin.verifier.registry_profile");
89
+ assert.strictEqual(builtinPromotion.ok, true, "proof builtin promotion readiness mismatch");
90
+ assert.strictEqual(builtinPromotion.promotion_readiness.default_eligible, true, "proof builtin default eligibility mismatch");
91
+ assert.strictEqual(builtinPromotion.promotion_readiness.production_default_ready, true, "proof builtin production-default readiness mismatch");
92
+
93
+ const stagedPromotion = root.summarizeIntegrationPromotionReadiness("partner.verifier.lattice_notary");
94
+ assert.strictEqual(stagedPromotion.ok, true, "proof staged promotion readiness mismatch");
95
+ assert.strictEqual(stagedPromotion.promotion_readiness.review_ready, true, "proof staged review-ready mismatch");
96
+ assert.strictEqual(stagedPromotion.promotion_readiness.default_eligible, false, "proof staged default eligibility mismatch");
97
+ assert.strictEqual(stagedPromotion.promotion_readiness.production_default_ready, false, "proof staged production-default readiness mismatch");
98
+ assert.ok(stagedPromotion.promotion_readiness.blockers.includes("not_certified"), "proof staged certification blocker missing");
99
+
100
+ const builtinPromotionWorkflow = root.summarizeIntegrationPromotionWorkflow("builtin.verifier.registry_profile");
101
+ assert.strictEqual(builtinPromotionWorkflow.ok, true, "proof builtin promotion workflow mismatch");
102
+ assert.strictEqual(
103
+ builtinPromotionWorkflow.next_transition.action,
104
+ "maintain_production_default",
105
+ "proof builtin promotion workflow next-transition mismatch"
106
+ );
107
+ assert.strictEqual(
108
+ builtinPromotionWorkflow.promotion_recommendation.recommendation,
109
+ "eligible_for_production_default",
110
+ "proof builtin promotion workflow recommendation mismatch"
111
+ );
112
+
113
+ const stagedPromotionWorkflow = root.summarizeIntegrationPromotionWorkflow("partner.verifier.lattice_notary");
114
+ assert.strictEqual(stagedPromotionWorkflow.ok, true, "proof staged promotion workflow mismatch");
115
+ assert.strictEqual(
116
+ stagedPromotionWorkflow.next_transition.action,
117
+ "complete_certification",
118
+ "proof staged promotion workflow next-transition mismatch"
119
+ );
120
+ assert.strictEqual(
121
+ stagedPromotionWorkflow.next_transition.later_actions.includes("promote_maturity"),
122
+ true,
123
+ "proof staged promotion workflow later-actions mismatch"
124
+ );
125
+ assert.strictEqual(
126
+ stagedPromotionWorkflow.promotion_recommendation.recommendation,
127
+ "keep_staged_until_requirements_clear",
128
+ "proof staged promotion workflow recommendation mismatch"
129
+ );
130
+ assert.strictEqual(
131
+ stagedPromotionWorkflow.certification_gaps.missing_requirements.includes("certification_state"),
132
+ true,
133
+ "proof staged promotion workflow certification gap mismatch"
134
+ );
135
+ assert.strictEqual(
136
+ stagedPromotionWorkflow.blocker_categories.some((entry) => entry.category === "certification"),
137
+ true,
138
+ "proof staged promotion workflow blocker-category mismatch"
139
+ );
140
+
141
+ const promotionWorkflowList = root.summarizeIntegrationPromotionWorkflowList({
142
+ source: "third_party_example",
143
+ registration_state: "staging_registered",
144
+ bundled: "false"
145
+ });
146
+ assert.strictEqual(promotionWorkflowList.ok, true, "proof promotion workflow list mismatch");
147
+ assert.strictEqual(promotionWorkflowList.integration_count >= 1, true, "proof promotion workflow list breadth mismatch");
148
+ assert.strictEqual(
149
+ promotionWorkflowList.next_actions.some((entry) => entry.action === "complete_certification"),
150
+ true,
151
+ "proof promotion workflow list next-action mismatch"
152
+ );
153
+ assert.strictEqual(
154
+ promotionWorkflowList.recommendations.some((entry) => entry.recommendation === "keep_staged_until_requirements_clear"),
155
+ true,
156
+ "proof promotion workflow list recommendation mismatch"
157
+ );
158
+ assert.strictEqual(
159
+ promotionWorkflowList.blocker_categories.some((entry) => entry.category === "certification"),
160
+ true,
161
+ "proof promotion workflow list blocker-category mismatch"
162
+ );
163
+
164
+ console.log("xoonya verify:integrations passed");
165
+ }
166
+
167
+ main().catch((error) => {
168
+ console.error(error);
169
+ process.exit(1);
170
+ });
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const sdk = require("..");
5
+
6
+ function buildHybridAttemptBundle() {
7
+ const event = sdk.canonicalizeEvent({
8
+ version: "canonical-event-bundle/v1",
9
+ domain_id: "hybrid.gate",
10
+ sequence: "1",
11
+ actor_id: "agent-hybrid",
12
+ adapter_source: "verify_native_hybrid_design_gate",
13
+ event_type: "native.hybrid.attempt",
14
+ event_hash: "89".repeat(32)
15
+ });
16
+ const receipt = sdk.emitReceipt(event, {
17
+ agent_identity: "agent-hybrid-signing",
18
+ algorithm: "xoonya-native-sha256-v1"
19
+ });
20
+ return sdk.buildProofBundle({
21
+ ceb: event,
22
+ receipt: {
23
+ ...receipt,
24
+ algorithm: "xoonya-native-hybrid-v1",
25
+ signature: "xoonya-native-hybrid-v1:design-gated-placeholder"
26
+ }
27
+ });
28
+ }
29
+
30
+ function runNativeHybridDesignGateVerification() {
31
+ const readiness = sdk.summarizeXoonyaNativeHybridReadinessPack();
32
+ assert.strictEqual(readiness.status, "design_gated", "hybrid readiness must stay design gated");
33
+ assert.strictEqual(
34
+ readiness.current_decision.includes("do_not_claim_pqc"),
35
+ true,
36
+ "hybrid readiness must forbid premature PQ claims"
37
+ );
38
+
39
+ const verification = sdk.verifyProofBundle(buildHybridAttemptBundle());
40
+ assert.strictEqual(verification.valid, false, "hybrid method must not verify before validators exist");
41
+ assert.strictEqual(
42
+ verification.reason,
43
+ "native_hybrid_design_gated",
44
+ "hybrid method must fail with deterministic design-gate reason"
45
+ );
46
+
47
+ const downgradeEvent = sdk.canonicalizeEvent({
48
+ version: "canonical-event-bundle/v1",
49
+ domain_id: "hybrid.downgrade",
50
+ sequence: "1",
51
+ actor_id: "agent-hybrid",
52
+ adapter_source: "verify_native_hybrid_design_gate",
53
+ event_type: "native.hybrid.downgrade",
54
+ event_hash: "90".repeat(32)
55
+ });
56
+ const detachedReceipt = sdk.emitReceipt(downgradeEvent, {
57
+ agent_identity: "agent-hybrid-signing",
58
+ algorithm: "detached-assertion-v1",
59
+ signature: "xoonya-native-hybrid-v1:attempted-downgrade"
60
+ });
61
+ const downgradeVerification = sdk.verifyProofBundle(sdk.buildProofBundle({
62
+ ceb: downgradeEvent,
63
+ receipt: detachedReceipt
64
+ }));
65
+ assert.strictEqual(downgradeVerification.valid, false, "hybrid-looking signature must not verify as detached");
66
+ assert.strictEqual(
67
+ downgradeVerification.reason,
68
+ "signature_method_mismatch",
69
+ "hybrid-looking external signature must fail as method mismatch"
70
+ );
71
+
72
+ return {
73
+ ok: true,
74
+ product: "xoonya",
75
+ category: "xoonya-native-hybrid-design-gate-verification",
76
+ method: "xoonya-native-hybrid-v1",
77
+ readiness_status: readiness.status,
78
+ deterministic_reject_reason: verification.reason,
79
+ downgrade_reject_reason: downgradeVerification.reason,
80
+ boundary: "pq_or_hybrid_verification_is_not_claimed_until_real_validators_vectors_and_error_codes_exist"
81
+ };
82
+ }
83
+
84
+ function main() {
85
+ const json = process.argv.includes("--json");
86
+ const summary = runNativeHybridDesignGateVerification();
87
+ if (json) {
88
+ process.stdout.write(`${JSON.stringify(summary, null, 2)}\n`);
89
+ return;
90
+ }
91
+ process.stdout.write(
92
+ [
93
+ "xoonya verify:native-hybrid-gate passed",
94
+ `method: ${summary.method}`,
95
+ `readiness: ${summary.readiness_status}`,
96
+ `deterministic reject: ${summary.deterministic_reject_reason}`,
97
+ `downgrade reject: ${summary.downgrade_reject_reason}`
98
+ ].join("\n") + "\n"
99
+ );
100
+ }
101
+
102
+ if (require.main === module) {
103
+ main();
104
+ }
105
+
106
+ module.exports = {
107
+ runNativeHybridDesignGateVerification
108
+ };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const {
5
+ buildXoonyaNativeReferenceImplementationPack,
6
+ summarizeXoonyaNativeReferenceImplementationPack,
7
+ validateXoonyaNativeReferencePromotionEvidence
8
+ } = require("../proof_sdk");
9
+
10
+ function buildValidPromotionEvidence(pack, language = "python") {
11
+ return {
12
+ language,
13
+ candidate_repository_ref: `xoonya-native-${language}@candidate`,
14
+ vector_sets_passed: pack.required_vector_sets.slice(),
15
+ deterministic_error_code_parity_ref: `xnya.reference.error_codes.${language}.2026-04-22`,
16
+ independent_parser_ref: `xnya.reference.parser.${language}.2026-04-22`,
17
+ signature_crypto_parity_ref: `xnya.reference.crypto.${language}.2026-04-22`,
18
+ round_trip_ref: `xnya.reference.round_trip.${language}.2026-04-22`,
19
+ conformance_mark_review_ref: `xnya.reference.conformance_mark.${language}.2026-04-22`,
20
+ forbidden_claim_review_ref: `xnya.reference.claim_boundary.${language}.2026-04-22`,
21
+ wraps_javascript_runtime: false
22
+ };
23
+ }
24
+
25
+ function assertRejected(pack, evidence, expectedCode) {
26
+ const validation = validateXoonyaNativeReferencePromotionEvidence(pack, evidence);
27
+ assert.strictEqual(validation.promotion_allowed, false, `expected ${expectedCode} to block reference promotion`);
28
+ assert.strictEqual(
29
+ validation.rejection_codes.includes(expectedCode),
30
+ true,
31
+ `missing deterministic rejection code ${expectedCode}`
32
+ );
33
+ return validation;
34
+ }
35
+
36
+ function main() {
37
+ const pack = buildXoonyaNativeReferenceImplementationPack();
38
+ const summary = summarizeXoonyaNativeReferenceImplementationPack();
39
+ const validPythonEvidence = buildValidPromotionEvidence(pack, "python");
40
+ const validPythonPromotion = validateXoonyaNativeReferencePromotionEvidence(pack, validPythonEvidence);
41
+
42
+ assert.strictEqual(pack.category, "xoonya-native-reference-implementation-pack", "native reference pack category mismatch");
43
+ assert.strictEqual(summary.category, "xoonya-native-reference-implementation-summary", "native reference summary category mismatch");
44
+ assert.strictEqual(pack.implemented_reference_implementations.length, 1, "only JavaScript should be implemented today");
45
+ assert.strictEqual(pack.deterministic_rejection_codes.length >= 11, true, "reference promotion rejection codes missing");
46
+ assert.strictEqual(summary.deterministic_rejection_code_count, pack.deterministic_rejection_codes.length, "summary rejection code count mismatch");
47
+ assert.strictEqual(validPythonPromotion.promotion_allowed, true, "complete Python promotion evidence should pass validation");
48
+ assert.deepStrictEqual(validPythonPromotion.rejection_codes, [], "complete Python evidence should not carry rejection codes");
49
+
50
+ assertRejected(pack, buildValidPromotionEvidence(pack, "javascript"), "reference_language_not_registered");
51
+ assertRejected(pack, { ...validPythonEvidence, candidate_repository_ref: null }, "candidate_repository_missing");
52
+ assertRejected(pack, { ...validPythonEvidence, vector_sets_passed: pack.required_vector_sets.slice(0, 1) }, "required_vector_set_missing");
53
+ assertRejected(pack, { ...validPythonEvidence, deterministic_error_code_parity_ref: null }, "deterministic_error_code_parity_missing");
54
+ assertRejected(pack, { ...validPythonEvidence, independent_parser_ref: null }, "independent_parser_evidence_missing");
55
+ assertRejected(pack, { ...validPythonEvidence, signature_crypto_parity_ref: null }, "signature_crypto_parity_missing");
56
+ assertRejected(pack, { ...validPythonEvidence, round_trip_ref: null }, "round_trip_evidence_missing");
57
+ assertRejected(pack, { ...validPythonEvidence, conformance_mark_review_ref: null }, "conformance_mark_review_missing");
58
+ assertRejected(pack, { ...validPythonEvidence, forbidden_claim_review_ref: null }, "forbidden_claim_review_missing");
59
+ assertRejected(pack, { ...validPythonEvidence, wraps_javascript_runtime: true }, "javascript_wrapper_forbidden");
60
+ assertRejected(pack, { ...validPythonEvidence, npm_token: "npm_accidental_secret" }, "secret_material_forbidden");
61
+
62
+ const output = {
63
+ ok: true,
64
+ product: "xoonya",
65
+ category: "xoonya-native-reference-promotion-gate-verification",
66
+ status: "reference_promotion_requires_independent_vector_crypto_round_trip_and_mark_evidence",
67
+ deterministic_rejection_code_count: pack.deterministic_rejection_codes.length,
68
+ adversarial_case_count: 11,
69
+ boundary: "python_and_rust_reference_claims_remain_gated_until_independent_promotion_evidence_is_complete"
70
+ };
71
+ process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
72
+ }
73
+
74
+ main();
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const path = require("path");
5
+ const { spawnSync } = require("child_process");
6
+
7
+ function runPython(command, args) {
8
+ return spawnSync(command, args, {
9
+ cwd: path.resolve(__dirname, ".."),
10
+ encoding: "utf8"
11
+ });
12
+ }
13
+
14
+ function main() {
15
+ const script = path.resolve(__dirname, "..", "reference", "python", "verify_vectors.py");
16
+ let result = runPython("python", [script]);
17
+ if (result.error && result.error.code === "ENOENT") {
18
+ result = runPython("py", ["-3", script]);
19
+ }
20
+ if (result.error) {
21
+ throw result.error;
22
+ }
23
+ if (result.status !== 0) {
24
+ process.stderr.write(result.stdout || "");
25
+ process.stderr.write(result.stderr || "");
26
+ throw new Error("Python XNYA reference vector verification failed");
27
+ }
28
+ const summary = JSON.parse(result.stdout);
29
+ assert.strictEqual(summary.ok, true, "Python XNYA reference summary did not pass");
30
+ assert.strictEqual(summary.category, "xnya-python-reference-vector-parity", "Python XNYA reference category mismatch");
31
+ assert.strictEqual(summary.atom_vector_count >= 4, true, "Python XNYA atom vectors missing");
32
+ assert.strictEqual(summary.atom_adversarial_count >= 9, true, "Python XNYA adversarial vectors missing");
33
+ assert.strictEqual(summary.payload_profile_vector_count, 1, "Python XNYP payload vector missing");
34
+ assert.strictEqual(summary.proof_bundle_vector_count >= 10, true, "Python proof bundle vectors missing");
35
+ assert.strictEqual(summary.proof_bundle_verified_vector_count >= 9, true, "Python proof bundle verified vectors missing");
36
+ assert.strictEqual(
37
+ summary.native_signed_crypto_gated_vector_count + summary.native_signed_crypto_verified_vector_count,
38
+ 1,
39
+ "Python native signed crypto vector accounting mismatch"
40
+ );
41
+ assert.strictEqual(
42
+ summary.verified_signature_suite_count === 0 || summary.verified_signature_suite_count === 1,
43
+ true,
44
+ "Python verified signature suite count mismatch"
45
+ );
46
+ process.stdout.write("xoonya verify:reference-python passed\n");
47
+ }
48
+
49
+ main();
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const fs = require("fs");
5
+ const os = require("os");
6
+ const path = require("path");
7
+ const { spawnSync } = require("child_process");
8
+
9
+ const rootDir = path.resolve(__dirname, "..");
10
+
11
+ function run(command, args, options = {}) {
12
+ return spawnSync(command, args, {
13
+ cwd: rootDir,
14
+ encoding: "utf8",
15
+ ...options
16
+ });
17
+ }
18
+
19
+ function findPython() {
20
+ const direct = run("python", ["--version"]);
21
+ if (!direct.error && direct.status === 0) {
22
+ return { command: "python", prefixArgs: [] };
23
+ }
24
+ const launcher = run("py", ["-3", "--version"]);
25
+ if (!launcher.error && launcher.status === 0) {
26
+ return { command: "py", prefixArgs: ["-3"] };
27
+ }
28
+ throw new Error("Python 3 is required for the XNYA Python crypto reference check");
29
+ }
30
+
31
+ function venvPythonPath(venvDir) {
32
+ return process.platform === "win32"
33
+ ? path.join(venvDir, "Scripts", "python.exe")
34
+ : path.join(venvDir, "bin", "python");
35
+ }
36
+
37
+ function assertOk(result, label) {
38
+ if (result.error) {
39
+ throw result.error;
40
+ }
41
+ if (result.status !== 0) {
42
+ process.stderr.write(result.stdout || "");
43
+ process.stderr.write(result.stderr || "");
44
+ throw new Error(`${label} failed`);
45
+ }
46
+ }
47
+
48
+ function main() {
49
+ const python = findPython();
50
+ const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "xoonya-python-crypto-"));
51
+ const keepVenv = process.env.XOONYA_KEEP_REFERENCE_PYTHON_CRYPTO_VENV === "1";
52
+ try {
53
+ const venvDir = path.join(tempDir, "venv");
54
+ assertOk(
55
+ run(python.command, [...python.prefixArgs, "-m", "venv", venvDir]),
56
+ "Python venv creation"
57
+ );
58
+ const venvPython = venvPythonPath(venvDir);
59
+ assertOk(
60
+ run(venvPython, [
61
+ "-m",
62
+ "pip",
63
+ "install",
64
+ "--disable-pip-version-check",
65
+ "-r",
66
+ path.join(rootDir, "reference", "python", "requirements-optional.txt")
67
+ ]),
68
+ "Python optional crypto dependency install"
69
+ );
70
+ const result = run(venvPython, [path.join(rootDir, "reference", "python", "verify_vectors.py")]);
71
+ assertOk(result, "Python crypto-enabled XNYA vector verification");
72
+ const summary = JSON.parse(result.stdout);
73
+ assert.strictEqual(summary.ok, true, "Python crypto-enabled XNYA summary did not pass");
74
+ assert.strictEqual(summary.native_signed_crypto_verified_vector_count, 1, "Python Ed25519 vector was not verified");
75
+ assert.strictEqual(summary.verified_signature_suite_count, 1, "Python verified signature suite count mismatch");
76
+ assert.strictEqual(summary.native_signature_crypto_dependency_missing_count, 0, "Python crypto dependency should be present in isolated venv");
77
+ process.stdout.write("xoonya verify:reference-python-crypto passed\n");
78
+ } finally {
79
+ if (!keepVenv) {
80
+ fs.rmSync(tempDir, { recursive: true, force: true });
81
+ } else {
82
+ process.stdout.write(`kept Python crypto venv at ${tempDir}\n`);
83
+ }
84
+ }
85
+ }
86
+
87
+ main();
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ const assert = require("assert");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+
7
+ const root = path.resolve(__dirname, "..");
8
+
9
+ function read(relativePath) {
10
+ return fs.readFileSync(path.join(root, relativePath), "utf8");
11
+ }
12
+
13
+ function ensureContains(body, pattern, label) {
14
+ assert.strictEqual(body.includes(pattern), true, `${label} missing ${pattern}`);
15
+ }
16
+
17
+ function main() {
18
+ const readme = read("reference/rust/README.md");
19
+ const cargo = read("reference/rust/Cargo.toml");
20
+ const lib = read("reference/rust/src/lib.rs");
21
+
22
+ ensureContains(readme, "not a full XNYA-compatible reference implementation yet", "rust readme boundary");
23
+ ensureContains(readme, "Future promotion requires a real Rust toolchain check", "rust readme promotion gate");
24
+ ensureContains(cargo, "publish = false", "rust cargo publish boundary");
25
+ ensureContains(cargo, "name = \"xoonya-native-rust\"", "rust cargo name");
26
+ ensureContains(lib, "pub const XNYA_MAGIC: [u8; 4] = *b\"XNYA\";", "rust magic constant");
27
+ ensureContains(lib, "pub const ATOM_V1_LEN: usize = 58;", "rust atom v1 length");
28
+ ensureContains(lib, "pub const ATOM_V2_LEN: usize = 70;", "rust atom v2 length");
29
+ ensureContains(lib, "atom_bad_magic", "rust deterministic error code");
30
+ ensureContains(lib, "atom_unsupported_length", "rust deterministic error code");
31
+ ensureContains(lib, "atom_unsupported_record_type", "rust deterministic error code");
32
+ ensureContains(lib, "atom_version_length_mismatch", "rust deterministic error code");
33
+
34
+ const summary = {
35
+ ok: true,
36
+ product: "xoonya",
37
+ category: "xnya-rust-reference-scaffold-check",
38
+ status: "source_scaffold_packaged_not_vector_verified",
39
+ checked_files: [
40
+ "reference/rust/README.md",
41
+ "reference/rust/Cargo.toml",
42
+ "reference/rust/src/lib.rs"
43
+ ],
44
+ boundary: "rust_candidate_is_source_only_until_cargo_vector_parity_and_round_trip_checks_exist"
45
+ };
46
+ process.stdout.write(`${JSON.stringify(summary, null, 2)}\n`);
47
+ }
48
+
49
+ main();
50
+