/**
 * Example knowledge probe task definitions — demonstrates the knowledge-probe mode.
 *
 * These tasks measure raw model knowledge without documentation context.
 * They answer: "What does this model know about X without any help?"
 *
 * Three tasks of increasing breadth:
 * 1. GROQ projection syntax — deep, specific query language knowledge
 * 2. defineType API — recent API knowledge + currency dimension
 * 3. Sanity vs Contentful — broad ecosystem understanding
 */
// ---------------------------------------------------------------------------
// Task 1: GROQ projection syntax
// ---------------------------------------------------------------------------
/**
 * Tests deep knowledge of Sanity's query language.
 * Models should demonstrate understanding of projection syntax,
 * coercion, dereferencing, and the slice operator.
 */
export const groqProjectionTask = {
    mode: "knowledge-probe",
    id: "kp-groq-projections",
    title: "Explain GROQ Projection Syntax",
    description: "Explain GROQ's projection syntax in detail, including: " +
        "object projections ({}), array projections, spread operator (...), " +
        "computed field names, the dereference operator (->), and " +
        "conditional projections using select().",
    area: "groq",
    difficulty: "intermediate",
    tags: ["knowledge-probe", "groq", "syntax"],
    probeStrategy: "depth-first",
    prompt: {
        text: "Explain GROQ's projection syntax in Sanity. Cover these topics:\n\n" +
            "1. Basic object projections with `{}`\n" +
            "2. Nested projections and the spread operator `...`\n" +
            "3. Computed field names\n" +
            "4. The dereference operator `->` for following references\n" +
            "5. Array slicing with `[0..5]` and `[0...5]`\n" +
            "6. Conditional projections using `select()`\n\n" +
            "Provide working code examples for each.",
    },
    assertions: [
        { type: "contains", value: "->" },
        { type: "contains", value: "select(" },
        {
            type: "llm-rubric",
            value: "The response should demonstrate accurate knowledge of GROQ " +
                "projection syntax with working code examples. Check that the " +
                "dereference operator, spread syntax, and select() are correctly " +
                "explained with valid GROQ code.",
            weight: 0.6,
        },
        {
            type: "llm-rubric",
            value: "Evaluate whether the response reflects current GROQ syntax " +
                "(post-2023). Check for deprecated patterns or outdated " +
                "recommendations.",
            weight: 0.4,
        },
    ],
};
// ---------------------------------------------------------------------------
// Task 2: defineType API
// ---------------------------------------------------------------------------
/**
 * Tests knowledge of the schema definition API, including recent changes.
 * The currency dimension is key here — models should know about defineType,
 * defineField, and the typed schema helpers, not the legacy untyped API.
 */
export const defineTypeApiTask = {
    mode: "knowledge-probe",
    id: "kp-define-type-api",
    title: "What is Sanity's defineType API?",
    description: "Explain how to define document schemas in Sanity using the defineType, " +
        "defineField, and defineArrayMember helper functions. Include the " +
        "motivation for typed schemas and common patterns.",
    area: "studio",
    difficulty: "basic",
    tags: ["knowledge-probe", "studio", "schema"],
    probeStrategy: "breadth-first",
    prompt: {
        text: "Explain Sanity's schema definition API:\n\n" +
            "1. What is `defineType` and how do you use it?\n" +
            "2. What are `defineField` and `defineArrayMember`?\n" +
            "3. Why were these typed helpers introduced? What did they replace?\n" +
            "4. Show a complete example of a document schema with various field types\n" +
            "5. How do you add validation rules using the typed API?",
    },
    assertions: [
        { type: "contains", value: "defineType" },
        { type: "contains", value: "defineField" },
        {
            type: "llm-rubric",
            value: "The response should accurately explain the typed schema helpers " +
                "(defineType, defineField, defineArrayMember). Check that the code " +
                "examples use the current API, not the legacy untyped format. " +
                "Penalize if the response uses the old `{ type: 'document', fields: [...] }` " +
                "pattern without mentioning defineType.",
            weight: 0.5,
        },
        {
            type: "llm-rubric",
            value: "Evaluate currency: does the response know about defineType " +
                "(introduced in Sanity v3)? Does it mention TypeScript type " +
                "inference benefits? Does it use current import paths?",
            weight: 0.5,
        },
    ],
};
// ---------------------------------------------------------------------------
// Task 3: Sanity vs Contentful comparison
// ---------------------------------------------------------------------------
/**
 * Tests broader ecosystem knowledge and the ability to articulate
 * differences between Sanity and a major competitor. This probes
 * conceptual understanding, not just API syntax.
 */
export const ecosystemComparisonTask = {
    mode: "knowledge-probe",
    id: "kp-sanity-vs-contentful",
    title: "Compare Sanity and Contentful",
    description: "Compare Sanity and Contentful as headless CMS platforms. " +
        "Cover architecture, content modeling, querying, pricing, " +
        "and developer experience differences.",
    area: "general",
    difficulty: "advanced",
    tags: ["knowledge-probe", "ecosystem", "comparison"],
    probeStrategy: "breadth-first",
    prompt: {
        text: "Compare Sanity and Contentful as headless CMS platforms. Address:\n\n" +
            "1. Architecture differences (real-time vs CDN-based)\n" +
            "2. Content modeling approaches\n" +
            "3. Query languages (GROQ vs GraphQL)\n" +
            "4. Developer experience and customization\n" +
            "5. Pricing models\n" +
            "6. When would you choose one over the other?",
    },
    assertions: [
        { type: "contains-any", value: ["GROQ", "groq"] },
        { type: "contains-any", value: ["GraphQL", "graphql"] },
        {
            type: "llm-rubric",
            value: "The comparison should be factually accurate about both platforms. " +
                "Check that key architectural differences are correctly stated: " +
                "Sanity uses a real-time document store with GROQ; Contentful " +
                "uses a CDN-based content infrastructure with GraphQL/REST. " +
                "Penalize incorrect claims about either platform.",
            weight: 0.5,
        },
        {
            type: "llm-rubric",
            value: "Evaluate completeness: does the response cover all requested " +
                "areas (architecture, modeling, querying, DX, pricing, use cases)? " +
                "Are the trade-offs balanced and fair?",
            weight: 0.5,
        },
    ],
};
/** All example knowledge probe tasks */
export const allKnowledgeProbeExampleTasks = [
    groqProjectionTask,
    defineTypeApiTask,
    ecosystemComparisonTask,
];
