xytara 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.
- package/RELEASE_NOTES.md +23 -0
- package/index.js +12 -0
- package/lib/framework_provider_promotion.js +235 -0
- package/lib/operator_intelligence.js +104 -1
- package/lib/pricing_optimization_contract.js +221 -2
- package/lib/release_history.js +25 -0
- package/lib/treasury_destinations_contract.js +99 -1
- package/package.json +7 -2
- package/scripts/generate_treasury_destinations.js +195 -0
- package/scripts/registry_cli.js +275 -0
- package/scripts/verify_adapters.js +554 -0
- package/scripts/verify_all.js +4963 -0
- package/scripts/verify_examples.js +19 -0
- package/scripts/verify_framework_provider_promotion.js +152 -0
- package/scripts/verify_integrations.js +620 -0
- package/scripts/verify_operator_observability_boundary.js +83 -0
- package/scripts/verify_pricing_experiment_plan.js +124 -0
- package/scripts/verify_production_readiness.js +251 -0
- package/scripts/verify_release_candidate.js +59 -0
- package/scripts/verify_service.js +14845 -0
- package/scripts/verify_tooling.js +1404 -0
- package/scripts/verify_treasury_public_boundary.js +97 -0
- package/server.js +27 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
function runExample(scriptPath) {
|
|
7
|
+
const result = spawnSync(process.execPath, [scriptPath], {
|
|
8
|
+
stdio: "inherit"
|
|
9
|
+
});
|
|
10
|
+
if (result.status !== 0) {
|
|
11
|
+
process.exit(result.status || 1);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
runExample(path.join(__dirname, "..", "examples", "quickstart.js"));
|
|
16
|
+
runExample(path.join(__dirname, "..", "examples", "export_carried_handoff.js"));
|
|
17
|
+
runExample(path.join(__dirname, "..", "examples", "partner_launch_walkthrough.js"));
|
|
18
|
+
runExample(path.join(__dirname, "..", "examples", "funded_runtime_walkthrough.js"));
|
|
19
|
+
runExample(path.join(__dirname, "..", "examples", "adapter_review_walkthrough.js"));
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
});
|