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
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
# xytara 2.8.0 Release Notes
|
|
2
|
+
|
|
3
|
+
`xytara` 2.8.0 is the release-boundary hardening line for live-provider promotion discipline, treasury/operator public-claim safety, and pricing experiment guardrails.
|
|
4
|
+
|
|
5
|
+
Highlights:
|
|
6
|
+
|
|
7
|
+
- adds framework-provider promotion evidence gates so LangGraph/LangChain style claims stay reference-contract until endpoint, auth, health, latency, failure, and proof-fact evidence exists
|
|
8
|
+
- hardens pricing experiment planning and launch gates so optimization remains sample-maturity and operator-review gated
|
|
9
|
+
- hardens treasury public claim boundaries so public surfaces do not leak landing/custody/provider refs or promote readiness-only/internal rails as live
|
|
10
|
+
- hardens operator observability boundaries so read-only views cannot drift into mutation, settlement submission, fund movement, unsafe attention actions, or secret-bearing control behavior
|
|
11
|
+
- keeps the 2.7.0 clean-consumer packaging and release-smoke posture intact while making expansion claims more defensible
|
|
12
|
+
|
|
13
|
+
# xytara 2.7.0 Release Notes
|
|
14
|
+
|
|
15
|
+
`xytara` 2.7.0 is the expansion-closeout release line for package-hardening, clean-consumer release smoke testing, and disciplined adapter/product claim boundaries.
|
|
16
|
+
|
|
17
|
+
Highlights:
|
|
18
|
+
|
|
19
|
+
- ships `scripts/` in the npm artifact so packaged verification commands are available to consumers
|
|
20
|
+
- adds release-candidate guards that fail if required verifier scripts are missing from `npm pack`
|
|
21
|
+
- participates in the Naxytra release-smoke harness that installs packed tarballs into a clean consumer project before synchronized release
|
|
22
|
+
- keeps the 2.6.0 expansion capabilities and adapter surfaces intact while closing the packaging reliability gap
|
|
23
|
+
|
|
1
24
|
# xytara 2.6.0 Release Notes
|
|
2
25
|
|
|
3
26
|
`xytara` 2.6.0 is the expansion release line for first-run execution polish, provider-backed adapter depth, and framework reference adapters while preserving the existing machine-commerce, settlement, observability, and release surfaces.
|
package/index.js
CHANGED
|
@@ -35,6 +35,14 @@ const {
|
|
|
35
35
|
buildAdapterPack,
|
|
36
36
|
summarizeAdapterPack
|
|
37
37
|
} = require("./lib/adapter_pack");
|
|
38
|
+
const {
|
|
39
|
+
buildFrameworkProviderPromotionPack,
|
|
40
|
+
summarizeFrameworkProviderPromotionPack
|
|
41
|
+
} = require("./lib/framework_provider_promotion");
|
|
42
|
+
const {
|
|
43
|
+
buildPricingExperimentPlan,
|
|
44
|
+
summarizePricingExperimentPlan
|
|
45
|
+
} = require("./lib/pricing_optimization_contract");
|
|
38
46
|
const {
|
|
39
47
|
buildPublishPlan,
|
|
40
48
|
summarizePublishPlan
|
|
@@ -159,6 +167,10 @@ module.exports = {
|
|
|
159
167
|
summarizeReleaseHistory,
|
|
160
168
|
buildAdapterPack,
|
|
161
169
|
summarizeAdapterPack,
|
|
170
|
+
buildFrameworkProviderPromotionPack,
|
|
171
|
+
summarizeFrameworkProviderPromotionPack,
|
|
172
|
+
buildPricingExperimentPlan,
|
|
173
|
+
summarizePricingExperimentPlan,
|
|
162
174
|
buildPublishPlan,
|
|
163
175
|
summarizePublishPlan,
|
|
164
176
|
buildEcosystemEntryPack,
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const packageJson = require("../package.json");
|
|
4
|
+
|
|
5
|
+
const FRAMEWORK_PROVIDER_CANDIDATES = Object.freeze([
|
|
6
|
+
Object.freeze({
|
|
7
|
+
framework_id: "langgraph",
|
|
8
|
+
adapter_id: "reference.framework.langgraph",
|
|
9
|
+
task_ref: "framework.langgraph.execute",
|
|
10
|
+
endpoint_env: "XYTARA_LANGGRAPH_PROVIDER_URL",
|
|
11
|
+
auth_env: "XYTARA_LANGGRAPH_PROVIDER_TOKEN",
|
|
12
|
+
health_path_env: "XYTARA_LANGGRAPH_PROVIDER_HEALTH_PATH"
|
|
13
|
+
}),
|
|
14
|
+
Object.freeze({
|
|
15
|
+
framework_id: "langchain",
|
|
16
|
+
adapter_id: "reference.framework.langchain",
|
|
17
|
+
task_ref: "framework.langchain.execute",
|
|
18
|
+
endpoint_env: "XYTARA_LANGCHAIN_PROVIDER_URL",
|
|
19
|
+
auth_env: "XYTARA_LANGCHAIN_PROVIDER_TOKEN",
|
|
20
|
+
health_path_env: "XYTARA_LANGCHAIN_PROVIDER_HEALTH_PATH"
|
|
21
|
+
})
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
const FRAMEWORK_PROVIDER_PROMOTION_REQUIREMENTS = Object.freeze([
|
|
25
|
+
"endpoint_configured",
|
|
26
|
+
"auth_configured",
|
|
27
|
+
"health_check_passes",
|
|
28
|
+
"latency_observed",
|
|
29
|
+
"failure_behavior_bounded",
|
|
30
|
+
"proof_fact_shape_preserved",
|
|
31
|
+
"operator_evidence_recorded"
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
const FRAMEWORK_PROVIDER_PROMOTION_REJECTION_CODES = Object.freeze([
|
|
35
|
+
"framework_not_registered",
|
|
36
|
+
"candidate_not_live_check_ready",
|
|
37
|
+
"adapter_id_mismatch",
|
|
38
|
+
"task_ref_mismatch",
|
|
39
|
+
"operator_evidence_missing",
|
|
40
|
+
"auth_boundary_evidence_missing",
|
|
41
|
+
"health_check_missing",
|
|
42
|
+
"health_check_failed",
|
|
43
|
+
"latency_measurement_missing",
|
|
44
|
+
"latency_budget_exceeded",
|
|
45
|
+
"failure_behavior_evidence_missing",
|
|
46
|
+
"proof_fact_shape_evidence_missing",
|
|
47
|
+
"secret_material_forbidden"
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
function normalizeString(value) {
|
|
51
|
+
return typeof value === "string" ? value.trim() : "";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function containsSecretMaterial(value) {
|
|
55
|
+
if (!value || typeof value !== "object") return false;
|
|
56
|
+
const secretishKey = /(secret|token|credential|password|private[_-]?key|authorization)/i;
|
|
57
|
+
const secretishValue = /(bearer\s+[a-z0-9._-]{8,}|sk_live_|npm_[a-z0-9]|ghp_[a-z0-9]|xox[baprs]-)/i;
|
|
58
|
+
const stack = [value];
|
|
59
|
+
while (stack.length > 0) {
|
|
60
|
+
const current = stack.pop();
|
|
61
|
+
if (!current || typeof current !== "object") continue;
|
|
62
|
+
for (const [key, entry] of Object.entries(current)) {
|
|
63
|
+
if (secretishKey.test(String(key))) return true;
|
|
64
|
+
if (typeof entry === "string" && secretishValue.test(entry)) return true;
|
|
65
|
+
if (entry && typeof entry === "object") stack.push(entry);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function boolFromEnv(value) {
|
|
72
|
+
const normalized = normalizeString(value).toLowerCase();
|
|
73
|
+
return ["1", "true", "yes", "on"].includes(normalized);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function summarizeCandidate(candidate, env = process.env) {
|
|
77
|
+
const endpoint = normalizeString(env[candidate.endpoint_env]);
|
|
78
|
+
const authToken = normalizeString(env[candidate.auth_env]);
|
|
79
|
+
const healthPath = normalizeString(env[candidate.health_path_env]) || "/health";
|
|
80
|
+
const endpointConfigured = Boolean(endpoint);
|
|
81
|
+
const authConfigured = Boolean(authToken);
|
|
82
|
+
const liveCheckReady = endpointConfigured && authConfigured;
|
|
83
|
+
return {
|
|
84
|
+
framework_id: candidate.framework_id,
|
|
85
|
+
adapter_id: candidate.adapter_id,
|
|
86
|
+
task_ref: candidate.task_ref,
|
|
87
|
+
state: liveCheckReady ? "live_check_ready" : "reference_contract_only",
|
|
88
|
+
endpoint_configured: endpointConfigured,
|
|
89
|
+
auth_configured: authConfigured,
|
|
90
|
+
health_path: healthPath,
|
|
91
|
+
endpoint_env: candidate.endpoint_env,
|
|
92
|
+
auth_env: candidate.auth_env,
|
|
93
|
+
health_path_env: candidate.health_path_env,
|
|
94
|
+
promotion_evidence_template: {
|
|
95
|
+
framework_id: candidate.framework_id,
|
|
96
|
+
adapter_id: candidate.adapter_id,
|
|
97
|
+
task_ref: candidate.task_ref,
|
|
98
|
+
operator_evidence_ref: "ops.framework_provider.<framework_id>.<date>",
|
|
99
|
+
auth_boundary_ref: "ops.framework_provider.auth_boundary.<framework_id>.<date>",
|
|
100
|
+
health_check: {
|
|
101
|
+
status_code: 200,
|
|
102
|
+
health_ok: true
|
|
103
|
+
},
|
|
104
|
+
latency_ms: 250,
|
|
105
|
+
latency_budget_ms: 2000,
|
|
106
|
+
failure_behavior_ref: "ops.framework_provider.failure_behavior.<framework_id>.<date>",
|
|
107
|
+
proof_fact_shape_ref: "ops.framework_provider.proof_facts.<framework_id>.<date>"
|
|
108
|
+
},
|
|
109
|
+
required_live_evidence: [
|
|
110
|
+
"real_external_endpoint",
|
|
111
|
+
"auth_or_access_boundary",
|
|
112
|
+
"health_check_response",
|
|
113
|
+
"bounded_latency_measurement",
|
|
114
|
+
"failure_behavior_observed",
|
|
115
|
+
"proof_fact_shape_preserved"
|
|
116
|
+
],
|
|
117
|
+
claim_boundary: liveCheckReady
|
|
118
|
+
? "may_run_live_promotion_check_but_must_not_claim_provider_live_until_check_evidence_is_recorded"
|
|
119
|
+
: "reference_adapter_only_no_live_external_provider_claim"
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function buildFrameworkProviderPromotionPack(options = {}) {
|
|
124
|
+
const env = options.env || process.env;
|
|
125
|
+
const candidates = FRAMEWORK_PROVIDER_CANDIDATES.map((candidate) => summarizeCandidate(candidate, env));
|
|
126
|
+
const liveReadyCandidates = candidates.filter((candidate) => candidate.state === "live_check_ready");
|
|
127
|
+
const requireLive = boolFromEnv(env.XYTARA_FRAMEWORK_PROMOTION_REQUIRE_LIVE);
|
|
128
|
+
return {
|
|
129
|
+
ok: true,
|
|
130
|
+
product: packageJson.name,
|
|
131
|
+
category: "machine-commerce-framework-provider-promotion-pack",
|
|
132
|
+
pack_version: "xytara-framework-provider-promotion-pack-v1",
|
|
133
|
+
posture: "reference_framework_adapters_promote_only_with_external_endpoint_evidence",
|
|
134
|
+
promotion_state: liveReadyCandidates.length > 0 ? "live_check_ready" : "no_live_provider_evidence_configured",
|
|
135
|
+
require_live: requireLive,
|
|
136
|
+
framework_candidate_count: candidates.length,
|
|
137
|
+
live_check_ready_count: liveReadyCandidates.length,
|
|
138
|
+
promoted_provider_count: 0,
|
|
139
|
+
candidates,
|
|
140
|
+
promotion_requirements: FRAMEWORK_PROVIDER_PROMOTION_REQUIREMENTS.slice(),
|
|
141
|
+
deterministic_rejection_codes: FRAMEWORK_PROVIDER_PROMOTION_REJECTION_CODES.slice(),
|
|
142
|
+
strict_boundaries: [
|
|
143
|
+
"reference_framework_adapters_do_not_equal_live_provider_integrations",
|
|
144
|
+
"do_not_claim_langgraph_or_langchain_live_provider_without_endpoint_auth_health_and_latency_evidence",
|
|
145
|
+
"failed_or_missing_live_checks_keep_frameworks_in_reference_contract_state",
|
|
146
|
+
"live_provider_promotion_does_not_change_adapter_claims_for_unchecked_frameworks"
|
|
147
|
+
],
|
|
148
|
+
linked_surfaces: {
|
|
149
|
+
framework_lane_ref: "/v1/frameworks",
|
|
150
|
+
framework_provider_promotion_ref: "/v1/framework-provider-promotion",
|
|
151
|
+
framework_provider_promotion_summary_ref: "/v1/framework-provider-promotion/summary",
|
|
152
|
+
adapter_depth_ref: "/v1/adapter-depth/summary",
|
|
153
|
+
integrations_ref: "/v1/integrations"
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function validateFrameworkProviderPromotionEvidence(pack, evidence) {
|
|
159
|
+
const promotionPack = pack || {};
|
|
160
|
+
const evidencePacket = evidence || {};
|
|
161
|
+
const candidates = Array.isArray(promotionPack.candidates) ? promotionPack.candidates : [];
|
|
162
|
+
const frameworkId = normalizeString(evidencePacket.framework_id);
|
|
163
|
+
const candidate = candidates.find((entry) => entry && entry.framework_id === frameworkId) || null;
|
|
164
|
+
const healthCheck = evidencePacket.health_check || null;
|
|
165
|
+
const latencyValue = evidencePacket.latency_ms;
|
|
166
|
+
const latencyMs = Number(latencyValue);
|
|
167
|
+
const latencyBudgetMs = Number(evidencePacket.latency_budget_ms || 2000);
|
|
168
|
+
const rejectionCodes = [];
|
|
169
|
+
|
|
170
|
+
if (!candidate) {
|
|
171
|
+
rejectionCodes.push("framework_not_registered");
|
|
172
|
+
} else {
|
|
173
|
+
if (candidate.state !== "live_check_ready" || !candidate.endpoint_configured || !candidate.auth_configured) {
|
|
174
|
+
rejectionCodes.push("candidate_not_live_check_ready");
|
|
175
|
+
}
|
|
176
|
+
if (normalizeString(evidencePacket.adapter_id) && normalizeString(evidencePacket.adapter_id) !== candidate.adapter_id) {
|
|
177
|
+
rejectionCodes.push("adapter_id_mismatch");
|
|
178
|
+
}
|
|
179
|
+
if (normalizeString(evidencePacket.task_ref) && normalizeString(evidencePacket.task_ref) !== candidate.task_ref) {
|
|
180
|
+
rejectionCodes.push("task_ref_mismatch");
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (!normalizeString(evidencePacket.operator_evidence_ref)) rejectionCodes.push("operator_evidence_missing");
|
|
184
|
+
if (!normalizeString(evidencePacket.auth_boundary_ref)) rejectionCodes.push("auth_boundary_evidence_missing");
|
|
185
|
+
if (!healthCheck || typeof healthCheck !== "object") {
|
|
186
|
+
rejectionCodes.push("health_check_missing");
|
|
187
|
+
} else if (healthCheck.health_ok !== true || Number(healthCheck.status_code || 0) < 200 || Number(healthCheck.status_code || 0) >= 300) {
|
|
188
|
+
rejectionCodes.push("health_check_failed");
|
|
189
|
+
}
|
|
190
|
+
if (latencyValue === null || latencyValue === undefined || latencyValue === "" || !Number.isFinite(latencyMs) || latencyMs < 0) {
|
|
191
|
+
rejectionCodes.push("latency_measurement_missing");
|
|
192
|
+
} else if (Number.isFinite(latencyBudgetMs) && latencyBudgetMs > 0 && latencyMs > latencyBudgetMs) {
|
|
193
|
+
rejectionCodes.push("latency_budget_exceeded");
|
|
194
|
+
}
|
|
195
|
+
if (!normalizeString(evidencePacket.failure_behavior_ref)) rejectionCodes.push("failure_behavior_evidence_missing");
|
|
196
|
+
if (!normalizeString(evidencePacket.proof_fact_shape_ref)) rejectionCodes.push("proof_fact_shape_evidence_missing");
|
|
197
|
+
if (containsSecretMaterial(evidencePacket)) rejectionCodes.push("secret_material_forbidden");
|
|
198
|
+
|
|
199
|
+
return {
|
|
200
|
+
validation_version: "xytara-framework-provider-promotion-evidence-validation-v1",
|
|
201
|
+
promotion_allowed: rejectionCodes.length === 0,
|
|
202
|
+
framework_id: frameworkId || null,
|
|
203
|
+
rejection_codes: Array.from(new Set(rejectionCodes)),
|
|
204
|
+
required_requirements: FRAMEWORK_PROVIDER_PROMOTION_REQUIREMENTS.slice(),
|
|
205
|
+
boundary: "framework_provider_promotion_requires_endpoint_auth_health_latency_failure_and_proof_fact_evidence_without_secret_material"
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function summarizeFrameworkProviderPromotionPack(options = {}) {
|
|
210
|
+
const pack = buildFrameworkProviderPromotionPack(options);
|
|
211
|
+
return {
|
|
212
|
+
ok: true,
|
|
213
|
+
product: pack.product,
|
|
214
|
+
category: "machine-commerce-framework-provider-promotion-summary",
|
|
215
|
+
summary_version: "xytara-framework-provider-promotion-summary-v1",
|
|
216
|
+
posture: pack.posture,
|
|
217
|
+
promotion_state: pack.promotion_state,
|
|
218
|
+
require_live: pack.require_live,
|
|
219
|
+
framework_candidate_count: pack.framework_candidate_count,
|
|
220
|
+
live_check_ready_count: pack.live_check_ready_count,
|
|
221
|
+
promoted_provider_count: pack.promoted_provider_count,
|
|
222
|
+
promotion_requirement_count: pack.promotion_requirements.length,
|
|
223
|
+
deterministic_rejection_code_count: pack.deterministic_rejection_codes.length,
|
|
224
|
+
boundary_count: pack.strict_boundaries.length,
|
|
225
|
+
linked_surfaces: pack.linked_surfaces
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
module.exports = {
|
|
230
|
+
FRAMEWORK_PROVIDER_CANDIDATES,
|
|
231
|
+
FRAMEWORK_PROVIDER_PROMOTION_REJECTION_CODES,
|
|
232
|
+
buildFrameworkProviderPromotionPack,
|
|
233
|
+
summarizeFrameworkProviderPromotionPack,
|
|
234
|
+
validateFrameworkProviderPromotionEvidence
|
|
235
|
+
};
|
|
@@ -5,12 +5,71 @@ const { buildEconomicsIntelligenceSummary } = require("./commerce_economics");
|
|
|
5
5
|
const { buildPartnerIntelligencePack } = require("./partner_intelligence");
|
|
6
6
|
const { buildRevenueSignalSummary } = require("./pricing_optimization_contract");
|
|
7
7
|
|
|
8
|
+
const OPERATOR_OBSERVABILITY_REJECTION_CODES = [
|
|
9
|
+
"boundary_missing",
|
|
10
|
+
"missing_linked_surface",
|
|
11
|
+
"mutation_surface_linked",
|
|
12
|
+
"settlement_submission_surface_linked",
|
|
13
|
+
"fund_movement_surface_linked",
|
|
14
|
+
"unsafe_attention_action",
|
|
15
|
+
"secret_material_forbidden",
|
|
16
|
+
"count_not_number"
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const OPERATOR_OBSERVABILITY_REQUIRED_SURFACES = [
|
|
20
|
+
"activity_ledger_ref",
|
|
21
|
+
"payment_ledger_ref",
|
|
22
|
+
"reconciliation_report_ref",
|
|
23
|
+
"deliveries_ref",
|
|
24
|
+
"settlement_ref",
|
|
25
|
+
"adapter_depth_ref",
|
|
26
|
+
"pricing_revenue_signal_ref",
|
|
27
|
+
"operator_intelligence_ref"
|
|
28
|
+
];
|
|
29
|
+
|
|
8
30
|
function valuesFromCollection(collection) {
|
|
9
31
|
if (!collection) return [];
|
|
10
32
|
if (collection instanceof Map) return Array.from(collection.values());
|
|
11
33
|
return Array.isArray(collection) ? collection : [];
|
|
12
34
|
}
|
|
13
35
|
|
|
36
|
+
function containsSecretMaterial(value) {
|
|
37
|
+
if (!value || typeof value !== "object") return false;
|
|
38
|
+
const secretishKey = /(secret|token|credential|password|private[_-]?key|authorization|api[_-]?key)/i;
|
|
39
|
+
const secretishValue = /(bearer\s+[a-z0-9._-]{8,}|sk_live_|npm_[a-z0-9]|ghp_[a-z0-9]|xox[baprs]-)/i;
|
|
40
|
+
const stack = [value];
|
|
41
|
+
while (stack.length > 0) {
|
|
42
|
+
const current = stack.pop();
|
|
43
|
+
if (!current || typeof current !== "object") continue;
|
|
44
|
+
for (const [key, entry] of Object.entries(current)) {
|
|
45
|
+
if (secretishKey.test(String(key))) return true;
|
|
46
|
+
if (typeof entry === "string" && secretishValue.test(entry)) return true;
|
|
47
|
+
if (entry && typeof entry === "object") stack.push(entry);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isUnsafeLinkedSurface(value) {
|
|
54
|
+
const normalized = String(value || "").toLowerCase();
|
|
55
|
+
return /\/(submit|refund|grant|release|rotate|delete|mutate|write|webhook|checkout)(\/|$)|submission|fund-movement|fund_movement/.test(normalized);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function isSettlementSubmissionSurface(value) {
|
|
59
|
+
const normalized = String(value || "").toLowerCase();
|
|
60
|
+
return /settlement.*(submit|submission|broadcast|raw_tx)|\/submit(\/|$)/.test(normalized);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function isFundMovementSurface(value) {
|
|
64
|
+
const normalized = String(value || "").toLowerCase();
|
|
65
|
+
return /(fund|treasury|credit).*(release|transfer|withdraw|grant|refund|disburse)|external-credit-grants/.test(normalized);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function isUnsafeAttentionAction(action) {
|
|
69
|
+
const normalized = String(action || "").toLowerCase();
|
|
70
|
+
return /^(submit|grant|refund|release|rotate|delete|write|mutate|broadcast|withdraw|transfer|disburse)_/.test(normalized);
|
|
71
|
+
}
|
|
72
|
+
|
|
14
73
|
function unwrapTransaction(entry) {
|
|
15
74
|
if (entry && entry.transaction) return entry.transaction;
|
|
16
75
|
return entry || null;
|
|
@@ -269,10 +328,52 @@ function buildOperatorObservabilityPack(state, input) {
|
|
|
269
328
|
pricing_revenue_signal_ref: "/v1/pricing-optimization/revenue-signal-summary",
|
|
270
329
|
operator_intelligence_ref: "/v1/operator-intelligence"
|
|
271
330
|
},
|
|
331
|
+
deterministic_rejection_codes: OPERATOR_OBSERVABILITY_REJECTION_CODES.slice(),
|
|
272
332
|
boundary: "read_only_operator_visibility_no_fund_movement_no_settlement_submission_no_secret_material"
|
|
273
333
|
};
|
|
274
334
|
}
|
|
275
335
|
|
|
336
|
+
function validateOperatorObservabilityBoundary(packInput) {
|
|
337
|
+
const pack = packInput || {};
|
|
338
|
+
const rejectionCodes = [];
|
|
339
|
+
const linkedSurfaces = pack.linked_surfaces || {};
|
|
340
|
+
const counts = pack.counts || {};
|
|
341
|
+
if (pack.boundary !== "read_only_operator_visibility_no_fund_movement_no_settlement_submission_no_secret_material") {
|
|
342
|
+
rejectionCodes.push("boundary_missing");
|
|
343
|
+
}
|
|
344
|
+
for (const surfaceName of OPERATOR_OBSERVABILITY_REQUIRED_SURFACES) {
|
|
345
|
+
if (!linkedSurfaces[surfaceName]) {
|
|
346
|
+
rejectionCodes.push("missing_linked_surface");
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
for (const surfaceRef of Object.values(linkedSurfaces)) {
|
|
350
|
+
if (isUnsafeLinkedSurface(surfaceRef)) rejectionCodes.push("mutation_surface_linked");
|
|
351
|
+
if (isSettlementSubmissionSurface(surfaceRef)) rejectionCodes.push("settlement_submission_surface_linked");
|
|
352
|
+
if (isFundMovementSurface(surfaceRef)) rejectionCodes.push("fund_movement_surface_linked");
|
|
353
|
+
}
|
|
354
|
+
const attentionQueue = Array.isArray(pack.attention_queue) ? pack.attention_queue : [];
|
|
355
|
+
for (const item of attentionQueue) {
|
|
356
|
+
if (item && isUnsafeAttentionAction(item.action)) {
|
|
357
|
+
rejectionCodes.push("unsafe_attention_action");
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
for (const [key, value] of Object.entries(counts)) {
|
|
361
|
+
if (key.endsWith("_count") && typeof value !== "number") {
|
|
362
|
+
rejectionCodes.push("count_not_number");
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (containsSecretMaterial(pack)) {
|
|
366
|
+
rejectionCodes.push("secret_material_forbidden");
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
validation_version: "xytara-operator-observability-boundary-validation-v1",
|
|
370
|
+
observability_boundary_valid: rejectionCodes.length === 0,
|
|
371
|
+
rejection_codes: Array.from(new Set(rejectionCodes)),
|
|
372
|
+
deterministic_rejection_codes: OPERATOR_OBSERVABILITY_REJECTION_CODES.slice(),
|
|
373
|
+
boundary: "operator_observability_must_remain_read_only_without_secret_material_mutation_links_or_fund_movement_actions"
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
|
|
276
377
|
function summarizeOperatorObservabilityPack(state, input) {
|
|
277
378
|
const pack = buildOperatorObservabilityPack(state, input);
|
|
278
379
|
return {
|
|
@@ -292,6 +393,7 @@ function summarizeOperatorObservabilityPack(state, input) {
|
|
|
292
393
|
adapter_failure_count: pack.counts.adapter_failure_count,
|
|
293
394
|
pricing_sample_maturity: pack.pricing_telemetry_summary.sample_maturity,
|
|
294
395
|
attention_item_count: pack.attention_queue.length,
|
|
396
|
+
deterministic_rejection_code_count: pack.deterministic_rejection_codes.length,
|
|
295
397
|
linked_surfaces: pack.linked_surfaces
|
|
296
398
|
};
|
|
297
399
|
}
|
|
@@ -300,5 +402,6 @@ module.exports = {
|
|
|
300
402
|
buildOperatorIntelligencePack,
|
|
301
403
|
summarizeOperatorIntelligencePack,
|
|
302
404
|
buildOperatorObservabilityPack,
|
|
303
|
-
summarizeOperatorObservabilityPack
|
|
405
|
+
summarizeOperatorObservabilityPack,
|
|
406
|
+
validateOperatorObservabilityBoundary
|
|
304
407
|
};
|