@skyramp/mcp 0.0.64-rc.13 → 0.0.64-rc.14
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.
|
@@ -6,9 +6,9 @@ export function buildDriftAnalysisPrompt(params) {
|
|
|
6
6
|
let diffSection = "";
|
|
7
7
|
if (parsedDiff) {
|
|
8
8
|
const lines = parsedDiff.split("\n");
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
newEndpointCount =
|
|
9
|
+
const newEndpointMatch = parsedDiff.match(/\*\*New Endpoints\*\*\s+\((\d+)\)/);
|
|
10
|
+
if (newEndpointMatch)
|
|
11
|
+
newEndpointCount = parseInt(newEndpointMatch[1], 10);
|
|
12
12
|
diffSection = `## Branch Diff
|
|
13
13
|
\`\`\`
|
|
14
14
|
${lines.slice(0, 200).join("\n")}
|
|
@@ -136,6 +136,12 @@ Execute every UPDATE, DELETE, and REGENERATE decision from Step 2 regardless of
|
|
|
136
136
|
### UPDATE
|
|
137
137
|
Edit the existing test file directly:
|
|
138
138
|
- Add missing assertions for new response fields (e.g. \`assert "archived" in resp\` or \`assert resp["archived"] >= 0\`).
|
|
139
|
+
- **Enhance assertions** for new response fields touched by the diff (integration and contract-provider tests — MANDATORY, no step exempt):
|
|
140
|
+
- **Every step**: assert non-null IDs, echo-back values, and value ranges. Echo-back must use the value sent in the *current* step's request — use the \`data_override\` source if set, otherwise the hardcoded literal. For example: if the request updated \`customer_email\` to \`"updated@mail.com"\`, assert \`get_response_value(response, "customer_email") == "updated@mail.com"\`; same for \`status\` (e.g. \`== "confirmed"\`) and \`discount_type\`/\`discount_value\` (e.g. \`== "percentage"\`, \`== 10.0\`).
|
|
141
|
+
- **Create/modify steps**: also assert computed/derived fields (e.g. \`total_amount\`, \`discount_amount\`) by tracing inputs through all prior responses. In integration tests, use dynamic chained values (e.g. \`get_response_value(product_response, "price") * quantity\`); in contract tests, use the hardcoded literals from the request body and expected response (e.g. \`assert total_amount == 19.99 * 2\`).
|
|
142
|
+
- **Read steps**: re-assert chained and computed fields — do not reduce to null-checks only.
|
|
143
|
+
- **Array fields**: only assert indices that exist in the recorded response body — never infer array length from the request or scenario name. Use the \`expected_response_body\` as the source of truth for which indices to assert. For example: if \`expected_response_body\` defines \`items[0]\` with \`product_id: 1\` and \`quantity: 3\`, assert \`get_response_value(response, "items.0.product_id") == 1\` and \`get_response_value(response, "items.0.quantity") == 3\` — do not assert \`items[1]\` if it does not exist in the expected response body.
|
|
144
|
+
- **Parity**: every assertion derivable from the request body or response (non-null, echo-back, value ranges, computed) must appear in both the contract test and the integration test independently.
|
|
139
145
|
- Fix path/method changes in the test.
|
|
140
146
|
- **When adding a new method to an existing resource:** Add the new method's test cases to the existing test file that covers that resource path (e.g. adding POST to a file that already tests GET /products). This applies to ALL existing test files for that resource — contract, integration, UI — not just the one the GENERATE plan names.
|
|
141
147
|
- **Happy path first (CRITICAL):** When adding a new HTTP method (PUT, PATCH, POST) to an existing test file, always include the happy path (2xx success) assertion. Do NOT add only an error-path test (e.g. 404, 422) for the new method — error cases may follow, but the happy path is mandatory.
|
|
@@ -215,10 +221,10 @@ Do NOT use \`page.waitForTimeout()\` with fixed delays — these are flaky in CI
|
|
|
215
221
|
**After generation, you MUST do exactly these steps — nothing more, nothing less:**
|
|
216
222
|
1. **Fix chaining**: replace hardcoded IDs with dynamic response values — path params like \`id = 'id'\` → \`skyramp.get_response_value(prev_response, "id")\`, and hardcoded IDs in request bodies → dynamic values from prior responses.
|
|
217
223
|
2. **Enhance assertions** (integration and contract tests — MANDATORY, no step exempt):
|
|
218
|
-
- **Every step**: assert non-null IDs, echo-back values, and value ranges. Echo-back must use the value sent in the *current* step's request — use the \`data_override\` source if set, otherwise the hardcoded literal.
|
|
224
|
+
- **Every step**: assert non-null IDs, echo-back values, and value ranges. Echo-back must use the value sent in the *current* step's request — use the \`data_override\` source if set, otherwise the hardcoded literal. For example: if the request set \`customer_email\` to \`"updated@mail.com"\`, assert \`get_response_value(response, "customer_email") == "updated@mail.com"\`; same for \`status\` (e.g. \`== "confirmed"\`) and \`discount_type\`/\`discount_value\` (e.g. \`== "percentage"\`, \`== 10.0\`).
|
|
219
225
|
- **Create/modify steps**: also assert computed/derived fields (e.g. \`total_amount\`, \`discount_amount\`) by tracing inputs through all prior responses. In integration tests, use dynamic chained values (e.g. \`get_response_value(product_response, "price") * quantity\`); in contract tests, use the hardcoded literals from the request body and expected response (e.g. \`assert total_amount == 19.99 * 2\`).
|
|
220
226
|
- **Read steps**: re-assert chained and computed fields — do not reduce to null-checks only.
|
|
221
|
-
- **Array fields**: only assert indices that exist in the recorded response body — never infer array length from the request or scenario name.
|
|
227
|
+
- **Array fields**: only assert indices that exist in the recorded response body — never infer array length from the request or scenario name. Use the \`expected_response_body\` as the source of truth for which indices to assert. For example: if \`expected_response_body\` defines \`items[0]\` with \`product_id: 1\` and \`quantity: 3\`, assert \`get_response_value(response, "items.0.product_id") == 1\` and \`get_response_value(response, "items.0.quantity") == 3\` — do not assert \`items[1]\` if it does not exist in the expected response body.
|
|
222
228
|
- **Parity**: every assertion derivable from the request body or response (non-null, echo-back, value ranges, computed) must appear in both the contract test and the integration test independently.
|
|
223
229
|
3. **Enhance UI test assertions**: for UI tests, refer back to your business logic analysis from Step 2 (code review) and the \`issuesFound\` you logged. Add assertions that catch real user-facing bugs:
|
|
224
230
|
- **Page renders after navigation**: after clicking a button that navigates (e.g. "Edit Order"), assert that the target page loaded its expected heading or key element. A blank page or missing heading means a rendering crash.
|