fetchsandbox-mcp 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -20
- package/dist/client.js +9 -2
- package/dist/client.js.map +1 -1
- package/dist/http.js +35 -4
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +528 -0
- package/dist/index.js +91 -22
- package/dist/index.js.map +1 -1
- package/dist/request_context.d.ts +9 -1
- package/dist/request_context.js +4 -2
- package/dist/request_context.js.map +1 -1
- package/dist/tools/coach.js +15 -2
- package/dist/tools/coach.js.map +1 -1
- package/dist/tools/guide.js +7 -6
- package/dist/tools/guide.js.map +1 -1
- package/dist/tools/validate_integration.d.ts +100 -0
- package/dist/tools/validate_integration.js +153 -8
- package/dist/tools/validate_integration.js.map +1 -1
- package/dist/tools/verify_behavior.d.ts +17 -2
- package/dist/tools/verify_behavior.js +37 -7
- package/dist/tools/verify_behavior.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,9 @@ export const verifyBehaviorTool = {
|
|
|
12
12
|
"flow_run_id from the run so the diff is saved onto that run's receipt " +
|
|
13
13
|
"URL. bug_pattern_id comes from guide's matched_bug_pattern. The buggy/" +
|
|
14
14
|
"fixed handlers are FetchSandbox reference implementations, NOT the user's " +
|
|
15
|
-
"code
|
|
15
|
+
"code. A confirmed reference result does not verify the user's app or show " +
|
|
16
|
+
"that it is ready to ship. Keep the returned provider and evidence scope " +
|
|
17
|
+
"with any reported result.",
|
|
16
18
|
inputSchema: {
|
|
17
19
|
type: "object",
|
|
18
20
|
properties: {
|
|
@@ -30,7 +32,8 @@ export const verifyBehaviorTool = {
|
|
|
30
32
|
sandbox_id: {
|
|
31
33
|
type: "string",
|
|
32
34
|
description: "OPTIONAL. The sandbox from the run. Pass with flow_run_id to save " +
|
|
33
|
-
"the diff onto that run's receipt."
|
|
35
|
+
"the diff onto that run's receipt. This binds the pattern to that " +
|
|
36
|
+
"sandbox's provider; provide it when verifying a provider integration.",
|
|
34
37
|
},
|
|
35
38
|
flow_run_id: {
|
|
36
39
|
type: "string",
|
|
@@ -84,6 +87,9 @@ export async function runVerifyBehavior(input) {
|
|
|
84
87
|
maxMs: 10 * 60_000,
|
|
85
88
|
})
|
|
86
89
|
: start);
|
|
90
|
+
return normalizeVerifyResult(raw);
|
|
91
|
+
}
|
|
92
|
+
function normalizeVerifyResult(raw) {
|
|
87
93
|
const probes = (raw.probes ?? []).map((p) => {
|
|
88
94
|
const buggy_status = p.buggy_response?.status;
|
|
89
95
|
const fixed_status = p.fixed_response?.status;
|
|
@@ -98,8 +104,35 @@ export async function runVerifyBehavior(input) {
|
|
|
98
104
|
verdict: p.verdict,
|
|
99
105
|
};
|
|
100
106
|
});
|
|
107
|
+
const simulations = raw.simulations?.map(normalizeVerifyResult);
|
|
108
|
+
const providerMismatch = simulations?.some((card) => raw.provider && card.provider && raw.provider !== card.provider);
|
|
109
|
+
const error = raw.error || (raw.status === "error"
|
|
110
|
+
? "Reference simulation job failed."
|
|
111
|
+
: providerMismatch
|
|
112
|
+
? "Reference simulation provider does not match its parent result."
|
|
113
|
+
: undefined);
|
|
114
|
+
const probeError = (raw.probes ?? []).some((p) => p.buggy_response?.error || p.fixed_response?.error);
|
|
115
|
+
// Every selected card must complete. An error, empty card, or provider
|
|
116
|
+
// mismatch cannot be turned into confirmation by positive partial evidence.
|
|
117
|
+
// A server refusal also vetoes the result: only it can know which configured
|
|
118
|
+
// probes are missing. Older backends omit this field and retain these checks.
|
|
119
|
+
const confirmed = raw.confirmed !== false && !error && !probeError && (simulations
|
|
120
|
+
? simulations.length > 0 && simulations.every((card) => card.confirmed)
|
|
121
|
+
: raw.order_fuzz
|
|
122
|
+
? raw.order_fuzz.confirmed === true
|
|
123
|
+
: probes.length > 0 &&
|
|
124
|
+
probes.every((p) => p.matched_expectation) &&
|
|
125
|
+
probes.some((p) => p.divergent));
|
|
101
126
|
return {
|
|
102
127
|
pattern_id: raw.pattern_id,
|
|
128
|
+
provider: raw.provider,
|
|
129
|
+
// This tool always executes reference handlers, including on old backends
|
|
130
|
+
// that did not annotate the result. It cannot attest to the user's app.
|
|
131
|
+
evidence_scope: "reference_handlers",
|
|
132
|
+
app_verified: false,
|
|
133
|
+
error,
|
|
134
|
+
classification: raw.classification,
|
|
135
|
+
simulations,
|
|
103
136
|
// Forward the server's typed next step. These clients whitelist fields, so
|
|
104
137
|
// a server-side addition is invisible here unless it is named — which is
|
|
105
138
|
// how find_bugs shipped for a month as "the first step of an
|
|
@@ -130,11 +163,8 @@ export async function runVerifyBehavior(input) {
|
|
|
130
163
|
// probes (buggy == fixed everywhere) matches expectations but proves
|
|
131
164
|
// nothing, so it must NOT count as a confirmation. That rule is about
|
|
132
165
|
// PROBES, so it applies only where probes exist.
|
|
133
|
-
confirmed
|
|
134
|
-
|
|
135
|
-
: probes.length > 0 &&
|
|
136
|
-
probes.every((p) => p.matched_expectation) &&
|
|
137
|
-
probes.some((p) => p.divergent),
|
|
166
|
+
confirmed,
|
|
167
|
+
receipt_attached: raw.receipt_attached,
|
|
138
168
|
// Which property the fuzzer actually flipped — order independence,
|
|
139
169
|
// terminal safety, idempotency. Never let a receipt claim a property this
|
|
140
170
|
// run did not prove.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify_behavior.js","sourceRoot":"","sources":["../../src/tools/verify_behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"verify_behavior.js","sourceRoot":"","sources":["../../src/tools/verify_behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyGpC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,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AAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fetchsandbox-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"mcpName": "io.github.fetchsandbox/mcp",
|
|
5
5
|
"description": "A deterministic verification engine for agents. Fires the edge cases your sandbox never sends, then proves a fix: the same scenario fails on the old code and passes on the new.",
|
|
6
6
|
"license": "MIT",
|