import { getAssertionsPrompt, } from "./sharedAssertionRules.js";
const specificRules = [
    {
        title: "Chained values across steps — chain, never hardcode",
        description: "Every ID used in a later step must come from a prior step's response using the SDK helper — never hardcode an ID or declare it as a constant before the response that provides it.",
        subPoints: [
            "After a POST creates a resource, GET and PATCH steps should assert that the returned ID matches the one from the POST response.",
            "When a non-ID response value (such as a collection name, slug, or timestamp) is reused in a later request, extract it from the prior response instead of hardcoding it.",
            "After any POST, PATCH, DELETE, sort, reorder, or bulk operation, re-assert the chained, stable, and computed values on the follow-up read step: a follow-up GET after DELETE should return 404 or show the item absent; a follow-up GET after PATCH should assert the new value; a follow-up GET after sort/reorder should confirm the new ordering with chained IDs.",
            "After a POST creates a resource and a GET retrieves the collection, assert that the created item appears in the list by its chained ID with its exact stable fields — do not stop at a null-check on the array or the id alone.",
            "When one response field describes a count or summary of a collection returned by a related endpoint (for example, `active_session_count` from `/users/me` and the array length from `/users/me/sessions`), assert that relationship by comparing both extracted values — never hardcode the same number in two places.",
            "Every assertion that can be derived from the request and response must appear in this file. If a test name claims a state change (such as \"Updates X\" or \"Increments Y\"), include an assertion that proves that state change across the relevant calls — do not rely on the contract test to cover it.",
        ],
        examples: [
            {
                language: "javascript",
                code: `expect(getResponseValue(productGetResponse, "id"), 'id').toBe(getResponseValue(productsPostResponse, "id"));
const collection = getValue(collectionsPostResponse, "data.collection");
expect(getValue(sessionsResponse, "data").length).toBe(getValue(meResponse, "data.active_session_count"));`,
            },
            {
                language: "javascript",
                code: `const orderId = getResponseValue(ordersPostResponse, "id");
await skyramp.sendRequest(\`/orders/\${orderId}\`);`,
            },
        ],
    },
];
const SCOPE = `### Scope
- Apply to every \`send_request\` / \`sendRequest\` call that returns a body.
- Only add assertions clearly supported by the request body, prior response values, field names, codebase evidence, or the test generation recommendations received for this test. Do not invent constraints.
- Add new assertions immediately after the existing status-code assertion — do not move or remove anything.`;
export function getIntegrationAssertionsPrompt(testFile, enhanceType) {
    return getAssertionsPrompt(specificRules, SCOPE, testFile, enhanceType);
}
