@sanity/ailf 6.1.2 → 7.0.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/dist/_vendor/ailf-core/constants.d.ts +12 -0
- package/dist/_vendor/ailf-core/constants.js +12 -0
- package/dist/_vendor/ailf-core/examples/index.d.ts +3 -3
- package/dist/_vendor/ailf-core/examples/index.js +3 -3
- package/dist/_vendor/ailf-shared/gcs-defaults.d.ts +16 -0
- package/dist/_vendor/ailf-shared/gcs-defaults.js +16 -0
- package/dist/_vendor/ailf-shared/generated/help-content.d.ts +2 -0
- package/dist/_vendor/ailf-shared/generated/help-content.js +140 -0
- package/dist/_vendor/ailf-shared/glossary.d.ts +318 -0
- package/dist/_vendor/ailf-shared/glossary.js +330 -0
- package/dist/_vendor/ailf-shared/help-content.d.ts +10 -0
- package/dist/_vendor/ailf-shared/help-content.js +10 -0
- package/dist/_vendor/ailf-shared/help-topics.d.ts +26 -0
- package/dist/_vendor/ailf-shared/help-topics.js +1 -0
- package/dist/_vendor/ailf-shared/index.d.ts +4 -0
- package/dist/_vendor/ailf-shared/index.js +3 -0
- package/dist/composition-root.js +7 -5
- package/dist/pipeline/cache-hit-restore.d.ts +16 -4
- package/dist/pipeline/cache-hit-restore.js +19 -6
- package/dist/webhook/eval-request-handler.d.ts +32 -29
- package/dist/webhook/eval-request-handler.js +90 -50
- package/package.json +1 -1
|
@@ -20,3 +20,15 @@
|
|
|
20
20
|
* @see packages/eval/src/adapters/api-client/build-request.ts — drops on the wire
|
|
21
21
|
*/
|
|
22
22
|
export declare const PLACEHOLDER_OWNER_TEAM = "<REPLACE-WITH-YOUR-TEAM-SLUG>";
|
|
23
|
+
/**
|
|
24
|
+
* Canonical default GCS bucket for AILF run artifacts. Re-exported from
|
|
25
|
+
* `@sanity/ailf-shared` so that the API gateway (which is forbidden from
|
|
26
|
+
* depending on `-shared` directly per the architectural dep graph in
|
|
27
|
+
* `scripts/check-docs.js`) can still read the canonical default through
|
|
28
|
+
* `@sanity/ailf-core`. Producers and consumers must all read the same
|
|
29
|
+
* value — alternate bucket names require reconfiguring the gateway
|
|
30
|
+
* service-account credentials.
|
|
31
|
+
*
|
|
32
|
+
* @see packages/shared/src/gcs-defaults.ts — the canonical source
|
|
33
|
+
*/
|
|
34
|
+
export { DEFAULT_GCS_ARTIFACT_BUCKET } from "../ailf-shared/index.d.ts";
|
|
@@ -20,3 +20,15 @@
|
|
|
20
20
|
* @see packages/eval/src/adapters/api-client/build-request.ts — drops on the wire
|
|
21
21
|
*/
|
|
22
22
|
export const PLACEHOLDER_OWNER_TEAM = "<REPLACE-WITH-YOUR-TEAM-SLUG>";
|
|
23
|
+
/**
|
|
24
|
+
* Canonical default GCS bucket for AILF run artifacts. Re-exported from
|
|
25
|
+
* `@sanity/ailf-shared` so that the API gateway (which is forbidden from
|
|
26
|
+
* depending on `-shared` directly per the architectural dep graph in
|
|
27
|
+
* `scripts/check-docs.js`) can still read the canonical default through
|
|
28
|
+
* `@sanity/ailf-core`. Producers and consumers must all read the same
|
|
29
|
+
* value — alternate bucket names require reconfiguring the gateway
|
|
30
|
+
* service-account credentials.
|
|
31
|
+
*
|
|
32
|
+
* @see packages/shared/src/gcs-defaults.ts — the canonical source
|
|
33
|
+
*/
|
|
34
|
+
export { DEFAULT_GCS_ARTIFACT_BUCKET } from "../ailf-shared/index.js";
|
|
@@ -123,7 +123,7 @@ export declare const exampleAgentAddSchemaData: readonly [{
|
|
|
123
123
|
readonly type: "tempdir";
|
|
124
124
|
};
|
|
125
125
|
readonly tools: readonly ["coding"];
|
|
126
|
-
readonly fixtures: readonly ["file://apps/
|
|
126
|
+
readonly fixtures: readonly ["file://apps/editor"];
|
|
127
127
|
readonly prompt: {
|
|
128
128
|
readonly text: "You have a Sanity Studio project with an existing article schema.\nAdd a new \"post\" document type with the following fields:\n1. title (string, required)\n2. slug (slug, sourced from title, required)\n3. author (string)\n4. publishedAt (datetime)\n5. body (array of block content)\n\nCreate the schema file at schemas/post.ts using defineType() and defineField().\nRegister it in schemas/index.ts alongside the existing article schema.";
|
|
129
129
|
};
|
|
@@ -158,9 +158,9 @@ export declare const exampleAgentAddSchemaData: readonly [{
|
|
|
158
158
|
readonly status: "draft";
|
|
159
159
|
}];
|
|
160
160
|
/** TypeScript task template for example-agent-add-schema */
|
|
161
|
-
export declare const exampleAgentAddSchemaTs = "/**\n * Example Task: Agent harness \u2014 add a schema to a Sanity Studio project.\n *\n * This is a starter template for agent-harness evaluations. It tests whether\n * an autonomous coding agent can modify a real project in a sandboxed\n * environment using file system tools.\n *\n * Unlike literacy or knowledge-probe tasks that evaluate text responses,\n * agent-harness tasks evaluate *side-effects*: files created, code modified,\n * commands executed. The agent gets a working directory with real files and\n * tools (Bash, Read, Write, Edit, etc.) and is graded on what it produces.\n *\n * This task is a DRAFT \u2014 it won't run unless activated or explicitly targeted.\n * To activate: change status to \"active\" or remove the status field.\n *\n * @see https://github.com/sanity-labs/ai-literacy-framework/blob/main/docs/modes.md#agent-harness\n */\n\nimport { defineTask } from \"@sanity/ailf\"\n\nexport default defineTask({\n // \u2500\u2500 Mode \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // \"agent-harness\" runs a real coding agent (Claude Agent SDK) with\n // filesystem tools in an isolated sandbox. The agent can read, write,\n // edit files and run shell commands \u2014 then assertions verify the results.\n //\n // Other modes: \"literacy\" (text Q&A), \"mcp-server\" (tool use),\n // \"knowledge-probe\" (baseline knowledge).\n mode: \"agent-harness\",\n\n id: \"example-agent-add-schema\",\n title: \"Add a document schema to a Sanity Studio project\",\n description:\n \"Example \u2014 tests whether an agent can create a schema file and \" +\n \"register it in an existing Sanity Studio project\",\n\n // Area groups tasks for scoring. All agent-harness tasks in the same\n // area are aggregated together in the score report.\n area: \"studio\",\n\n // \u2500\u2500 Sandbox \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // The sandbox isolates the agent's file operations from your real repo.\n // Currently only \"tempdir\" is implemented (creates a temporary directory).\n // The pipeline creates the sandbox dir at config-generation time, copies\n // fixtures into it before the agent starts, and the agent's working_dir\n // is set to the sandbox path.\n //\n // See: docs/modes.md#sandbox-lifecycle\n sandbox: { type: \"tempdir\" },\n\n // \u2500\u2500 Tools \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Tool presets control which Claude Agent SDK tools the agent can use:\n // \"coding\" \u2192 Bash, Read, Write, Edit, Glob, Grep\n // \"full-access\" \u2192 coding + WebSearch, WebFetch, TodoRead, TodoWrite\n // \"read-only\" \u2192 Read, Glob, Grep, WebSearch\n //\n // You can also mix presets with explicit tool names:\n // tools: [\"coding\", \"WebFetch\"]\n tools: [\"coding\"],\n\n // \u2500\u2500 Fixtures \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Fixtures are files or directories copied into the sandbox before the\n // agent starts. Paths use the file:// prefix and resolve relative to\n // the directory where you run the pipeline (typically your repo root).\n //\n // The agent sees these files in its working directory as if they were\n // a real project. For example, \"file://apps/
|
|
161
|
+
export declare const exampleAgentAddSchemaTs = "/**\n * Example Task: Agent harness \u2014 add a schema to a Sanity Studio project.\n *\n * This is a starter template for agent-harness evaluations. It tests whether\n * an autonomous coding agent can modify a real project in a sandboxed\n * environment using file system tools.\n *\n * Unlike literacy or knowledge-probe tasks that evaluate text responses,\n * agent-harness tasks evaluate *side-effects*: files created, code modified,\n * commands executed. The agent gets a working directory with real files and\n * tools (Bash, Read, Write, Edit, etc.) and is graded on what it produces.\n *\n * This task is a DRAFT \u2014 it won't run unless activated or explicitly targeted.\n * To activate: change status to \"active\" or remove the status field.\n *\n * @see https://github.com/sanity-labs/ai-literacy-framework/blob/main/docs/modes.md#agent-harness\n */\n\nimport { defineTask } from \"@sanity/ailf\"\n\nexport default defineTask({\n // \u2500\u2500 Mode \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // \"agent-harness\" runs a real coding agent (Claude Agent SDK) with\n // filesystem tools in an isolated sandbox. The agent can read, write,\n // edit files and run shell commands \u2014 then assertions verify the results.\n //\n // Other modes: \"literacy\" (text Q&A), \"mcp-server\" (tool use),\n // \"knowledge-probe\" (baseline knowledge).\n mode: \"agent-harness\",\n\n id: \"example-agent-add-schema\",\n title: \"Add a document schema to a Sanity Studio project\",\n description:\n \"Example \u2014 tests whether an agent can create a schema file and \" +\n \"register it in an existing Sanity Studio project\",\n\n // Area groups tasks for scoring. All agent-harness tasks in the same\n // area are aggregated together in the score report.\n area: \"studio\",\n\n // \u2500\u2500 Sandbox \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // The sandbox isolates the agent's file operations from your real repo.\n // Currently only \"tempdir\" is implemented (creates a temporary directory).\n // The pipeline creates the sandbox dir at config-generation time, copies\n // fixtures into it before the agent starts, and the agent's working_dir\n // is set to the sandbox path.\n //\n // See: docs/modes.md#sandbox-lifecycle\n sandbox: { type: \"tempdir\" },\n\n // \u2500\u2500 Tools \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Tool presets control which Claude Agent SDK tools the agent can use:\n // \"coding\" \u2192 Bash, Read, Write, Edit, Glob, Grep\n // \"full-access\" \u2192 coding + WebSearch, WebFetch, TodoRead, TodoWrite\n // \"read-only\" \u2192 Read, Glob, Grep, WebSearch\n //\n // You can also mix presets with explicit tool names:\n // tools: [\"coding\", \"WebFetch\"]\n tools: [\"coding\"],\n\n // \u2500\u2500 Fixtures \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Fixtures are files or directories copied into the sandbox before the\n // agent starts. Paths use the file:// prefix and resolve relative to\n // the directory where you run the pipeline (typically your repo root).\n //\n // The agent sees these files in its working directory as if they were\n // a real project. For example, \"file://apps/editor\" copies the entire\n // editor Studio app into the sandbox root.\n //\n // If you don't have fixture projects, you can omit this field and the\n // agent starts with an empty directory.\n fixtures: [\"file://apps/editor\"],\n\n // \u2500\u2500 Prompt \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // The task instructions sent to the agent. Be specific about expected\n // file paths and patterns \u2014 the assertions check for exact paths.\n prompt: {\n text: `You have a Sanity Studio project with an existing article schema.\nAdd a new \"post\" document type with the following fields:\n1. title (string, required)\n2. slug (slug, sourced from title, required)\n3. author (string)\n4. publishedAt (datetime)\n5. body (array of block content)\n\nCreate the schema file at schemas/post.ts using defineType() and defineField().\nRegister it in schemas/index.ts alongside the existing article schema.`,\n },\n\n // \u2500\u2500 Assertions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n // Agent-harness assertions verify the sandbox state after the agent runs.\n // They execute in a full Node.js context (not eval()) so they can use\n // fs, child_process, etc. All file paths resolve relative to the sandbox.\n //\n // Available assertion types:\n // file-exists \u2014 check a file was created\n // file-contains \u2014 check a file contains a substring\n // command-succeeds \u2014 run a shell command (exit 0 = pass)\n // diff-matches \u2014 check git diff contains a pattern\n // llm-rubric \u2014 LLM grades the agent's text output\n assertions: [\n // Verify the agent created the new schema file\n { type: \"file-exists\", value: \"schemas/post.ts\" },\n\n // Verify it uses the modern Sanity schema API\n {\n type: \"file-contains\",\n value: { path: \"schemas/post.ts\", content: \"defineType\" },\n },\n {\n type: \"file-contains\",\n value: { path: \"schemas/post.ts\", content: \"defineField\" },\n },\n\n // Verify the schema was registered in the barrel export\n {\n type: \"file-contains\",\n value: { path: \"schemas/index.ts\", content: \"post\" },\n },\n\n // Verify the existing config is still intact\n {\n type: \"file-contains\",\n value: { path: \"sanity.config.ts\", content: \"defineConfig\" },\n },\n ],\n\n status: \"draft\",\n})\n";
|
|
162
162
|
/** Generated YAML for example-agent-add-schema (from parsed TS data) */
|
|
163
|
-
export declare const exampleAgentAddSchemaYaml = "- mode: agent-harness\n id: example-agent-add-schema\n title: Add a document schema to a Sanity Studio project\n description: Example \u2014 tests whether an agent can create a schema file and register it in an existing Sanity Studio project\n area: studio\n sandbox:\n type: tempdir\n tools:\n - coding\n fixtures:\n - file://apps/
|
|
163
|
+
export declare const exampleAgentAddSchemaYaml = "- mode: agent-harness\n id: example-agent-add-schema\n title: Add a document schema to a Sanity Studio project\n description: Example \u2014 tests whether an agent can create a schema file and register it in an existing Sanity Studio project\n area: studio\n sandbox:\n type: tempdir\n tools:\n - coding\n fixtures:\n - file://apps/editor\n prompt:\n text: |-\n You have a Sanity Studio project with an existing article schema.\n Add a new \"post\" document type with the following fields:\n 1. title (string, required)\n 2. slug (slug, sourced from title, required)\n 3. author (string)\n 4. publishedAt (datetime)\n 5. body (array of block content)\n\n Create the schema file at schemas/post.ts using defineType() and defineField().\n Register it in schemas/index.ts alongside the existing article schema.\n assertions:\n - type: file-exists\n value: schemas/post.ts\n - type: file-contains\n value:\n path: schemas/post.ts\n content: defineType\n - type: file-contains\n value:\n path: schemas/post.ts\n content: defineField\n - type: file-contains\n value:\n path: schemas/index.ts\n content: post\n - type: file-contains\n value:\n path: sanity.config.ts\n content: defineConfig\n status: draft\n";
|
|
164
164
|
/** Parsed task data for example-groq-blog-listing (JSON-safe) */
|
|
165
165
|
export declare const exampleGroqBlogListingData: readonly [{
|
|
166
166
|
readonly mode: "literacy";
|
|
@@ -158,7 +158,7 @@ export const exampleAgentAddSchemaData = [
|
|
|
158
158
|
"coding"
|
|
159
159
|
],
|
|
160
160
|
"fixtures": [
|
|
161
|
-
"file://apps/
|
|
161
|
+
"file://apps/editor"
|
|
162
162
|
],
|
|
163
163
|
"prompt": {
|
|
164
164
|
"text": "You have a Sanity Studio project with an existing article schema.\nAdd a new \"post\" document type with the following fields:\n1. title (string, required)\n2. slug (slug, sourced from title, required)\n3. author (string)\n4. publishedAt (datetime)\n5. body (array of block content)\n\nCreate the schema file at schemas/post.ts using defineType() and defineField().\nRegister it in schemas/index.ts alongside the existing article schema."
|
|
@@ -201,9 +201,9 @@ export const exampleAgentAddSchemaData = [
|
|
|
201
201
|
}
|
|
202
202
|
];
|
|
203
203
|
/** TypeScript task template for example-agent-add-schema */
|
|
204
|
-
export const exampleAgentAddSchemaTs = "/**\n * Example Task: Agent harness — add a schema to a Sanity Studio project.\n *\n * This is a starter template for agent-harness evaluations. It tests whether\n * an autonomous coding agent can modify a real project in a sandboxed\n * environment using file system tools.\n *\n * Unlike literacy or knowledge-probe tasks that evaluate text responses,\n * agent-harness tasks evaluate *side-effects*: files created, code modified,\n * commands executed. The agent gets a working directory with real files and\n * tools (Bash, Read, Write, Edit, etc.) and is graded on what it produces.\n *\n * This task is a DRAFT — it won't run unless activated or explicitly targeted.\n * To activate: change status to \"active\" or remove the status field.\n *\n * @see https://github.com/sanity-labs/ai-literacy-framework/blob/main/docs/modes.md#agent-harness\n */\n\nimport { defineTask } from \"@sanity/ailf\"\n\nexport default defineTask({\n // ── Mode ──────────────────────────────────────────────────────\n // \"agent-harness\" runs a real coding agent (Claude Agent SDK) with\n // filesystem tools in an isolated sandbox. The agent can read, write,\n // edit files and run shell commands — then assertions verify the results.\n //\n // Other modes: \"literacy\" (text Q&A), \"mcp-server\" (tool use),\n // \"knowledge-probe\" (baseline knowledge).\n mode: \"agent-harness\",\n\n id: \"example-agent-add-schema\",\n title: \"Add a document schema to a Sanity Studio project\",\n description:\n \"Example — tests whether an agent can create a schema file and \" +\n \"register it in an existing Sanity Studio project\",\n\n // Area groups tasks for scoring. All agent-harness tasks in the same\n // area are aggregated together in the score report.\n area: \"studio\",\n\n // ── Sandbox ───────────────────────────────────────────────────\n // The sandbox isolates the agent's file operations from your real repo.\n // Currently only \"tempdir\" is implemented (creates a temporary directory).\n // The pipeline creates the sandbox dir at config-generation time, copies\n // fixtures into it before the agent starts, and the agent's working_dir\n // is set to the sandbox path.\n //\n // See: docs/modes.md#sandbox-lifecycle\n sandbox: { type: \"tempdir\" },\n\n // ── Tools ─────────────────────────────────────────────────────\n // Tool presets control which Claude Agent SDK tools the agent can use:\n // \"coding\" → Bash, Read, Write, Edit, Glob, Grep\n // \"full-access\" → coding + WebSearch, WebFetch, TodoRead, TodoWrite\n // \"read-only\" → Read, Glob, Grep, WebSearch\n //\n // You can also mix presets with explicit tool names:\n // tools: [\"coding\", \"WebFetch\"]\n tools: [\"coding\"],\n\n // ── Fixtures ──────────────────────────────────────────────────\n // Fixtures are files or directories copied into the sandbox before the\n // agent starts. Paths use the file:// prefix and resolve relative to\n // the directory where you run the pipeline (typically your repo root).\n //\n // The agent sees these files in its working directory as if they were\n // a real project. For example, \"file://apps/
|
|
204
|
+
export const exampleAgentAddSchemaTs = "/**\n * Example Task: Agent harness — add a schema to a Sanity Studio project.\n *\n * This is a starter template for agent-harness evaluations. It tests whether\n * an autonomous coding agent can modify a real project in a sandboxed\n * environment using file system tools.\n *\n * Unlike literacy or knowledge-probe tasks that evaluate text responses,\n * agent-harness tasks evaluate *side-effects*: files created, code modified,\n * commands executed. The agent gets a working directory with real files and\n * tools (Bash, Read, Write, Edit, etc.) and is graded on what it produces.\n *\n * This task is a DRAFT — it won't run unless activated or explicitly targeted.\n * To activate: change status to \"active\" or remove the status field.\n *\n * @see https://github.com/sanity-labs/ai-literacy-framework/blob/main/docs/modes.md#agent-harness\n */\n\nimport { defineTask } from \"@sanity/ailf\"\n\nexport default defineTask({\n // ── Mode ──────────────────────────────────────────────────────\n // \"agent-harness\" runs a real coding agent (Claude Agent SDK) with\n // filesystem tools in an isolated sandbox. The agent can read, write,\n // edit files and run shell commands — then assertions verify the results.\n //\n // Other modes: \"literacy\" (text Q&A), \"mcp-server\" (tool use),\n // \"knowledge-probe\" (baseline knowledge).\n mode: \"agent-harness\",\n\n id: \"example-agent-add-schema\",\n title: \"Add a document schema to a Sanity Studio project\",\n description:\n \"Example — tests whether an agent can create a schema file and \" +\n \"register it in an existing Sanity Studio project\",\n\n // Area groups tasks for scoring. All agent-harness tasks in the same\n // area are aggregated together in the score report.\n area: \"studio\",\n\n // ── Sandbox ───────────────────────────────────────────────────\n // The sandbox isolates the agent's file operations from your real repo.\n // Currently only \"tempdir\" is implemented (creates a temporary directory).\n // The pipeline creates the sandbox dir at config-generation time, copies\n // fixtures into it before the agent starts, and the agent's working_dir\n // is set to the sandbox path.\n //\n // See: docs/modes.md#sandbox-lifecycle\n sandbox: { type: \"tempdir\" },\n\n // ── Tools ─────────────────────────────────────────────────────\n // Tool presets control which Claude Agent SDK tools the agent can use:\n // \"coding\" → Bash, Read, Write, Edit, Glob, Grep\n // \"full-access\" → coding + WebSearch, WebFetch, TodoRead, TodoWrite\n // \"read-only\" → Read, Glob, Grep, WebSearch\n //\n // You can also mix presets with explicit tool names:\n // tools: [\"coding\", \"WebFetch\"]\n tools: [\"coding\"],\n\n // ── Fixtures ──────────────────────────────────────────────────\n // Fixtures are files or directories copied into the sandbox before the\n // agent starts. Paths use the file:// prefix and resolve relative to\n // the directory where you run the pipeline (typically your repo root).\n //\n // The agent sees these files in its working directory as if they were\n // a real project. For example, \"file://apps/editor\" copies the entire\n // editor Studio app into the sandbox root.\n //\n // If you don't have fixture projects, you can omit this field and the\n // agent starts with an empty directory.\n fixtures: [\"file://apps/editor\"],\n\n // ── Prompt ────────────────────────────────────────────────────\n // The task instructions sent to the agent. Be specific about expected\n // file paths and patterns — the assertions check for exact paths.\n prompt: {\n text: `You have a Sanity Studio project with an existing article schema.\nAdd a new \"post\" document type with the following fields:\n1. title (string, required)\n2. slug (slug, sourced from title, required)\n3. author (string)\n4. publishedAt (datetime)\n5. body (array of block content)\n\nCreate the schema file at schemas/post.ts using defineType() and defineField().\nRegister it in schemas/index.ts alongside the existing article schema.`,\n },\n\n // ── Assertions ────────────────────────────────────────────────\n // Agent-harness assertions verify the sandbox state after the agent runs.\n // They execute in a full Node.js context (not eval()) so they can use\n // fs, child_process, etc. All file paths resolve relative to the sandbox.\n //\n // Available assertion types:\n // file-exists — check a file was created\n // file-contains — check a file contains a substring\n // command-succeeds — run a shell command (exit 0 = pass)\n // diff-matches — check git diff contains a pattern\n // llm-rubric — LLM grades the agent's text output\n assertions: [\n // Verify the agent created the new schema file\n { type: \"file-exists\", value: \"schemas/post.ts\" },\n\n // Verify it uses the modern Sanity schema API\n {\n type: \"file-contains\",\n value: { path: \"schemas/post.ts\", content: \"defineType\" },\n },\n {\n type: \"file-contains\",\n value: { path: \"schemas/post.ts\", content: \"defineField\" },\n },\n\n // Verify the schema was registered in the barrel export\n {\n type: \"file-contains\",\n value: { path: \"schemas/index.ts\", content: \"post\" },\n },\n\n // Verify the existing config is still intact\n {\n type: \"file-contains\",\n value: { path: \"sanity.config.ts\", content: \"defineConfig\" },\n },\n ],\n\n status: \"draft\",\n})\n";
|
|
205
205
|
/** Generated YAML for example-agent-add-schema (from parsed TS data) */
|
|
206
|
-
export const exampleAgentAddSchemaYaml = "- mode: agent-harness\n id: example-agent-add-schema\n title: Add a document schema to a Sanity Studio project\n description: Example — tests whether an agent can create a schema file and register it in an existing Sanity Studio project\n area: studio\n sandbox:\n type: tempdir\n tools:\n - coding\n fixtures:\n - file://apps/
|
|
206
|
+
export const exampleAgentAddSchemaYaml = "- mode: agent-harness\n id: example-agent-add-schema\n title: Add a document schema to a Sanity Studio project\n description: Example — tests whether an agent can create a schema file and register it in an existing Sanity Studio project\n area: studio\n sandbox:\n type: tempdir\n tools:\n - coding\n fixtures:\n - file://apps/editor\n prompt:\n text: |-\n You have a Sanity Studio project with an existing article schema.\n Add a new \"post\" document type with the following fields:\n 1. title (string, required)\n 2. slug (slug, sourced from title, required)\n 3. author (string)\n 4. publishedAt (datetime)\n 5. body (array of block content)\n\n Create the schema file at schemas/post.ts using defineType() and defineField().\n Register it in schemas/index.ts alongside the existing article schema.\n assertions:\n - type: file-exists\n value: schemas/post.ts\n - type: file-contains\n value:\n path: schemas/post.ts\n content: defineType\n - type: file-contains\n value:\n path: schemas/post.ts\n content: defineField\n - type: file-contains\n value:\n path: schemas/index.ts\n content: post\n - type: file-contains\n value:\n path: sanity.config.ts\n content: defineConfig\n status: draft\n";
|
|
207
207
|
/** Parsed task data for example-groq-blog-listing (JSON-safe) */
|
|
208
208
|
export const exampleGroqBlogListingData = [
|
|
209
209
|
{
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical default GCS bucket for AILF run artifacts.
|
|
3
|
+
*
|
|
4
|
+
* Why this lives in `@sanity/ailf-shared`: the eval package
|
|
5
|
+
* (`packages/eval/src/composition-root.ts`), the API gateway
|
|
6
|
+
* (`packages/api/src/routes/runs.ts`), and the dashboard
|
|
7
|
+
* (`apps/dashboard/src/components/report-artifacts/`) all need to agree
|
|
8
|
+
* on the same default when `AILF_GCS_ARTIFACT_BUCKET` is unset. Three
|
|
9
|
+
* independent string literals drift; one constant doesn't.
|
|
10
|
+
*
|
|
11
|
+
* The gateway's signing credentials are scoped to this bucket — alternate
|
|
12
|
+
* names require reconfiguring the gateway in addition to setting the env
|
|
13
|
+
* variable. See `docs/decisions/D0030-external-artifact-store.md` and
|
|
14
|
+
* `docs/decisions/D0032-run-anchored-artifact-store.md`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DEFAULT_GCS_ARTIFACT_BUCKET = "ailf-artifacts";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical default GCS bucket for AILF run artifacts.
|
|
3
|
+
*
|
|
4
|
+
* Why this lives in `@sanity/ailf-shared`: the eval package
|
|
5
|
+
* (`packages/eval/src/composition-root.ts`), the API gateway
|
|
6
|
+
* (`packages/api/src/routes/runs.ts`), and the dashboard
|
|
7
|
+
* (`apps/dashboard/src/components/report-artifacts/`) all need to agree
|
|
8
|
+
* on the same default when `AILF_GCS_ARTIFACT_BUCKET` is unset. Three
|
|
9
|
+
* independent string literals drift; one constant doesn't.
|
|
10
|
+
*
|
|
11
|
+
* The gateway's signing credentials are scoped to this bucket — alternate
|
|
12
|
+
* names require reconfiguring the gateway in addition to setting the env
|
|
13
|
+
* variable. See `docs/decisions/D0030-external-artifact-store.md` and
|
|
14
|
+
* `docs/decisions/D0032-run-anchored-artifact-store.md`.
|
|
15
|
+
*/
|
|
16
|
+
export const DEFAULT_GCS_ARTIFACT_BUCKET = "ailf-artifacts";
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/extract-help.ts — do not edit.
|
|
2
|
+
// Re-generate with: pnpm extract-help
|
|
3
|
+
export const HELP_TOPICS = [
|
|
4
|
+
{
|
|
5
|
+
"id": "negative-doc-lift",
|
|
6
|
+
"title": "When Docs Hurt: Negative Doc Lift",
|
|
7
|
+
"body": "The ceiling score is _lower_ than the floor score. The canonical docs actively\nhurt the model's performance. This is a negative Doc Lift: the model produces\nbetter output from its training data alone than when given the \"correct\"\ndocumentation.\n\nThis will happen. It is not an error condition — it is a high-signal diagnostic\nthat demands investigation. A negative Doc Lift means one or more of the\nfollowing:\n\n- **Outdated documentation** — the docs describe an older API version or\n pattern, and the model's training data has absorbed a newer version. The docs\n are actively teaching the model the wrong thing. _Action: update the docs to\n reflect the current API._\n\n- **Misleading documentation** — the docs are technically accurate but\n structured in a way that leads the model to an incorrect implementation path.\n Ambiguous phrasing, conflicting code examples, or poor organization can cause\n a model to produce worse code than its baseline intuition. _Action:\n restructure or rewrite the docs for clarity._\n\n- **Adversarial context dilution** — the canonical doc set is too large or\n contains too much tangential content, and the relevant signal gets buried in\n noise. The model performs better with no docs because fewer tokens means less\n distraction. _Action: trim the canonical doc set or restructure docs to\n front-load the most relevant information._\n\n- **Model training data superiority** — for mature, well-known features (e.g.,\n basic GROQ queries, standard Studio setup), the model may have absorbed\n high-quality examples from training data (blog posts, Stack Overflow, open\n source code) that are simply better than the official documentation. _Action:\n improve the docs to meet or exceed the quality of community content the model\n learned from._",
|
|
8
|
+
"source": "docs/design-docs/scenario-matrix/evaluation-ceiling.md",
|
|
9
|
+
"related": [
|
|
10
|
+
"doc-lift",
|
|
11
|
+
"three-layer"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "three-layer",
|
|
16
|
+
"title": "Floor, Ceiling, and Actual Scores",
|
|
17
|
+
"body": "- **Doc Lift** = `ceiling score − floor score`. Positive when docs help,\n negative when docs hurt. This is the fundamental documentation value metric.\n When negative, it triggers the interference investigation described above\n- **Retrieval gap** = `ceiling score − agentic score`. The cost of imperfect\n discovery. Should be minimized via infrastructure investment (`llms.txt`,\n `.md` endpoints, better navigation, SEO). Note: this metric is only meaningful\n when Doc Lift is positive — if the docs themselves are harmful, a large\n retrieval gap might paradoxically be _protective_ (agents that can't find the\n bad docs may outperform agents that can)\n- **Doc quality gap** = `100 − ceiling score`. The ceiling itself is below\n perfect. This is the documentation team's problem — the docs need improvement\n regardless of how they're delivered\n- **Infrastructure efficiency** = `agentic score / ceiling score`. What fraction\n of the documentation's potential value actually reaches agents? A ratio of\n 0.90 means infrastructure delivers 90% of the doc quality. A ratio of 0.50\n means half the documentation value is lost in delivery. When the ceiling is\n below the floor, this ratio is undefined — report it as \"N/A (negative Doc\n Lift)\" rather than producing a misleading number\n\n### Decomposition: the healthy case (positive Doc Lift)\n\n```\nfloor score → model's inherent knowledge\n + Doc Lift (ceiling − floor) → documentation quality contribution\n − retrieval gap (ceiling − agentic) → discovery/infrastructure loss\n = agentic score → what users actually experience\n```\n\n### Decomposition: the interference case (negative Doc Lift)\n\n```\nfloor score → model's inherent knowledge\n − |Doc Lift| (floor − ceiling) → documentation interference penalty\n − retrieval gap (ceiling − agentic) → discovery/infrastructure loss\n = agentic score → what users actually experience\n\n but note: agentic score may exceed ceiling score here, because\n agents that fail to find the interfering docs avoid the penalty.\n In this case the \"retrieval gap\" inverts — poor retrieval is a\n net positive. The framework should flag this explicitly:\n \"Retrieval failure is masking a documentation quality problem.\"\n```\n\nBoth decompositions are valid expressions of the **core measurement model**.\nEvery scenario in the matrix is asking about one or more of these three layers:\ninherent knowledge, documentation quality, or discovery effectiveness. The sign\nof the Doc Lift determines which layer needs urgent attention.",
|
|
18
|
+
"source": "docs/design-docs/scenario-matrix/evaluation-ceiling.md",
|
|
19
|
+
"related": [
|
|
20
|
+
"doc-lift",
|
|
21
|
+
"negative-doc-lift",
|
|
22
|
+
"retrieval-gap",
|
|
23
|
+
"scoring-model"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "comparing-runs",
|
|
28
|
+
"title": "Comparing Evaluation Runs",
|
|
29
|
+
"body": "## How comparison works\n\nThe Compare view lets you select any two evaluation reports and see a detailed\nside-by-side breakdown. One report is the **baseline** (your reference point)\nand the other is the **experiment** (what you're evaluating).\n\n## Reading the comparison\n\nFor each feature area, you'll see:\n\n- **Delta** — The score difference (experiment minus baseline). Positive means\n the experiment scored higher.\n- **Change** — Whether the delta is meaningful: **improved**, **regressed**, or\n **unchanged**. This accounts for the noise threshold — small deltas within the\n noise band are marked unchanged even if they're non-zero.\n\n## The noise threshold\n\nNot every score change is real. LLM responses vary between runs, and the grader\nmodel has its own variance. The comparison applies a noise threshold (currently\nconfigured per-evaluation) to filter out statistical noise. Only changes that\nexceed this threshold are classified as improvements or regressions.\n\n## What to compare\n\n- **Before and after a doc change** — Did your edits actually improve scores?\n- **Production vs. branch** — Will publishing this content release help or hurt?\n- **Different models** — How does Claude compare to GPT on the same docs?\n- **Baseline vs. full mode** — Is the retrieval gap shrinking over time?\n\n## Per-area deltas\n\nThe most actionable part of the comparison is the per-area breakdown. If your\noverall score improved but one area regressed, the per-area deltas tell you\nexactly which area needs attention.",
|
|
30
|
+
"source": "docs/help/comparing-runs.md",
|
|
31
|
+
"related": [
|
|
32
|
+
"reading-score-trends",
|
|
33
|
+
"scoring-model"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "doc-lift",
|
|
38
|
+
"title": "Doc Lift: Do Your Docs Help?",
|
|
39
|
+
"body": "## What is doc lift?\n\n**Doc lift** is the difference between how an AI performs _with_ your\ndocumentation and how it performs _without_ it:\n\n```\nDoc lift = ceiling score − floor score\n```\n\n- **Ceiling score** — the AI's score when gold-standard docs are injected\n directly into its prompt.\n- **Floor score** — the AI's score with no documentation at all, relying only on\n its training data.\n\nA positive doc lift means your docs are helping. The higher the number, the more\nvalue your documentation provides beyond what the model already knows.\n\n## What good doc lift looks like\n\n- **Doc lift of 15+** — Your docs are providing crucial information the model\n doesn't already know. This is a strong signal that the docs are worth\n maintaining and improving.\n- **Doc lift of 5–15** — Docs are helping, but the model's training data covers\n a lot of the ground already. The docs are adding incremental value.\n- **Doc lift near zero** — The docs aren't adding much. Either the model already\n knows the material, or the docs aren't providing useful implementation\n guidance.\n\n## Negative doc lift\n\nA **negative** doc lift means the documentation is actively hurting the AI's\nperformance — the model produces _better_ code without your docs than with them.\nThis is never ignorable. See the \"When Docs Hurt\" help topic for causes and\nremediation.\n\n## Where you see it\n\nDoc lift appears in several places in the dashboard:\n\n- **Overview stats** — The aggregate doc lift across all areas.\n- **Per-area score table** — Doc lift for each feature area, so you can see\n which docs help most and which help least.\n- **Comparison view** — Doc lift deltas between two runs, showing whether your\n doc changes increased or decreased documentation value.",
|
|
40
|
+
"source": "docs/help/doc-lift.md",
|
|
41
|
+
"related": [
|
|
42
|
+
"three-layer",
|
|
43
|
+
"negative-doc-lift",
|
|
44
|
+
"scoring-model"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "getting-started",
|
|
49
|
+
"title": "Getting Started",
|
|
50
|
+
"body": "## What does AILF measure?\n\nThe AI Literacy Framework measures how well your documentation helps AI coding\ntools (like Claude Code, Cursor, ChatGPT, and Copilot) implement features\ncorrectly. When a developer asks an AI agent \"set up a webhook in Sanity,\" the\nagent needs to find the right docs and produce working code. AILF scores how\nwell that goes.\n\n## The key number: AI Literacy Score\n\nEvery evaluation produces a score from 0–100, composed of three dimensions:\n\n- **Task Completion (50%)** — Can the AI implement the feature at all?\n- **Code Correctness (25%)** — Is the generated code correct and idiomatic?\n- **Doc Coverage (25%)** — Did the docs provide the information needed?\n\nHigher is better. Scores above 80 mean the docs are working well for that\nfeature. Scores below 70 need attention.\n\n## What you see in the dashboard\n\n- **Latest Reports** — The most recent evaluation runs with scores, areas\n tested, and trend indicators.\n- **Score Timeline** — How scores change over time. Look for upward trends after\n doc improvements.\n- **Compare** — Side-by-side comparison of any two runs to see what improved or\n regressed.\n\nClick into any report for the full breakdown: per-area scores, diagnostics, and\n(for full-mode runs) how AI agents actually navigated your docs.\n\n## Quick orientation\n\n| If you see… | It means… |\n| ------------------- | ---------------------------------------------------- |\n| A score above 80 | Docs are working well for this area |\n| A score below 70 | Docs need improvement — AI agents struggle here |\n| Positive doc lift | Docs are helping (good!) |\n| Negative doc lift | Docs are hurting — they're worse than no docs at all |\n| Large retrieval gap | Good docs exist but agents can't find them |",
|
|
51
|
+
"source": "docs/help/getting-started.md",
|
|
52
|
+
"related": [
|
|
53
|
+
"scoring-model",
|
|
54
|
+
"eval-modes"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "interpreting-diagnostics",
|
|
59
|
+
"title": "Interpreting Diagnostics",
|
|
60
|
+
"body": "## The diagnostics tab\n\nWhen you open a report and click the **Diagnostics** tab, you see a health\nsummary of your documentation across all feature areas. This is the most\nactionable view in the dashboard — it tells you exactly where to focus your doc\nimprovement efforts.\n\n## Health categories\n\nFeature areas are grouped into three health bands:\n\n- **Strong (80+)** — Docs are working well. AI agents produce correct, complete\n implementations. No action needed unless you see regression.\n- **Needs Attention (70–79)** — Docs are okay but have gaps. There may be\n specific dimensions (like code correctness or doc coverage) dragging the score\n down. Worth investigating.\n- **Weak (below 70)** — Docs are not providing enough support. AI agents\n consistently struggle with these features. These need priority attention.\n\n## Strengths vs. Issues\n\nThe diagnostics tab has two sub-views:\n\n**Strengths** highlights what's working: high-scoring areas, strong dimensions,\nand areas where agents successfully find and use your docs. Use this to\nunderstand what good looks like in your docs — and replicate it elsewhere.\n\n**Issues** lists the problems: weak areas, dimensions scoring below 50, negative\ndoc lift, retrieval problems, and (if gap analysis was run) specific\nrecommendations with estimated score lift.\n\n## Key diagnostic signals\n\n| Signal | What it means | What to do |\n| ------------------------------ | ------------------------------------------ | ---------------------------------------- |\n| **Negative doc lift** | Docs are worse than no docs | Rewrite or remove the offending docs |\n| **Large retrieval gap** | Good docs exist but agents can't find them | Improve page titles, metadata, SEO |\n| **Low code correctness** | Agents find the docs but produce bad code | Add or fix code examples |\n| **Low doc coverage** | The docs don't cover what the task needs | Write new documentation |\n| **Efficiency anomaly (>100%)** | Agents do better without gold docs | Injected docs may be confusing the model |",
|
|
61
|
+
"source": "docs/help/interpreting-diagnostics.md",
|
|
62
|
+
"related": [
|
|
63
|
+
"scoring-model",
|
|
64
|
+
"weaknesses-recommendations"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "reading-score-trends",
|
|
69
|
+
"title": "Reading Score Trends",
|
|
70
|
+
"body": "## What the timeline shows\n\nThe Score Timeline view plots your AI Literacy Score over time. Each point is an\nevaluation run — a snapshot of how well your docs support AI agents at that\nmoment.\n\n## What to look for\n\n**Upward trends** after doc changes confirm that your improvements are working.\nIf you rewrote a GROQ guide and the GROQ area score climbs in the next run,\nthat's direct evidence of impact.\n\n**Sudden drops** usually mean something changed: a doc was deleted, an API\nchanged without a doc update, or a new task was added that exposes a gap.\n\n**Flat lines** mean stability — neither improving nor regressing. This is fine\nfor mature areas but concerning for areas you're actively working on.\n\n## Meaningful change vs. noise\n\nSmall fluctuations (±2–3 points) between runs are normal — they come from LLM\nnon-determinism and grader variance. Focus on changes of **5+ points** sustained\nacross multiple runs. The comparison view applies a noise threshold to help\ndistinguish real changes from statistical noise.\n\n## Filtering the timeline\n\nUse the filters to focus on specific evaluation modes (baseline vs. full),\nspecific doc sources (production vs. branch), or specific feature areas.\nComparing the same area across modes reveals whether a problem is in the docs\nthemselves (baseline score) or in how agents find them (agentic score).",
|
|
71
|
+
"source": "docs/help/reading-score-trends.md",
|
|
72
|
+
"related": [
|
|
73
|
+
"scoring-model",
|
|
74
|
+
"comparing-runs"
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "retrieval-gap",
|
|
79
|
+
"title": "Retrieval Gap & Infrastructure Efficiency",
|
|
80
|
+
"body": "## What is the retrieval gap?\n\nThe **retrieval gap** is the difference between the **ceiling score** (docs\ninjected directly into the AI's prompt) and the **actual score** (the AI agent\nfinds docs on its own via web search). It measures how much documentation\nquality is lost because agents can't find the right pages.\n\n```\nRetrieval gap = ceiling score − actual score\n```\n\nA retrieval gap of zero means agents find everything. A gap of 20 means 20\npoints of doc quality never reach the agents.\n\n## What is infrastructure efficiency?\n\n**Infrastructure efficiency** expresses the retrieval gap as a ratio:\n\n```\nInfrastructure efficiency = actual score / ceiling score\n```\n\nAn efficiency of 90% means agents capture 90% of your docs' potential. An\nefficiency of 50% means half the documentation value is lost to discoverability\nproblems.\n\n## What causes a large retrieval gap?\n\n- **Poor page titles** — Agents search by keyword. If your page title doesn't\n match what a developer would ask, agents won't find it.\n- **Missing from search indexes** — Pages that aren't indexed by search engines\n are invisible to agents that rely on web search.\n- **No `llms.txt`** — An `llms.txt` file gives agents a table of contents.\n Without it, they rely entirely on search queries.\n- **No `.md` endpoints** — Agents that can fetch clean markdown directly\n (instead of parsing HTML) get better context with less noise.\n- **Content spread across many pages** — If implementing a feature requires\n reading 5 different pages, agents are less likely to find all of them.\n\n## How to shrink the retrieval gap\n\n1. **Add clear, keyword-rich page titles** that match how developers phrase\n their questions.\n2. **Ensure pages are indexed** by search engines (no `noindex` meta tags on doc\n pages).\n3. **Provide `llms.txt`** at your docs root so agents can browse a structured\n table of contents.\n4. **Provide `.md` endpoints** so agents can fetch clean markdown instead of\n parsing JavaScript-rendered HTML.\n5. **Consolidate related content** — fewer, more comprehensive pages are easier\n for agents to find than many small fragments.\n\n## When the retrieval gap inverts\n\nIn rare cases, the actual score exceeds the ceiling score — agents that can't\nfind the docs perform _better_ than agents with gold-standard docs injected.\nThis means the docs themselves are hurting performance (negative doc lift), and\nagents that fail to find them accidentally avoid the damage. The dashboard flags\nthis as an **inverted retrieval gap** — it's a documentation quality problem,\nnot a discoverability win.",
|
|
81
|
+
"source": "docs/help/retrieval-gap.md",
|
|
82
|
+
"related": [
|
|
83
|
+
"three-layer",
|
|
84
|
+
"eval-modes",
|
|
85
|
+
"how-agents-work"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "scoring-model",
|
|
90
|
+
"title": "Understanding Scores",
|
|
91
|
+
"body": "## The three dimensions\n\nEvery evaluation task is scored on three dimensions, each graded 0–100:\n\n- **Task Completion (50% weight)** — Can the AI implement the requested feature?\n Does the output actually do what was asked?\n- **Code Correctness (25% weight)** — Is the generated code idiomatic, correct,\n and following best practices?\n- **Doc Coverage (25% weight)** — Did the documentation provide the information\n needed to implement the feature?\n\n## How the overall score is calculated\n\nThe three dimensions combine into a single **AI Literacy Score** per task using\nnamed scoring profiles from `config/rubrics.yaml`:\n\n```\nGold (with docs): Total = Task × 0.50 + Code × 0.25 + Docs × 0.25\nBaseline (no docs): Total = Task × 0.60 + Code × 0.40\n```\n\nThe gold profile includes all three dimensions. The baseline profile excludes\nDoc Coverage because it is undefined when no documentation is provided. This\nensures Doc Lift (ceiling − floor) is a clean structural measurement of\ndocumentation value.\n\nThe weighted composite produces a score from 0–100. Scores are then averaged\nacross all tasks in a feature area to produce a **per-area score**, and across\nall areas to produce the **overall score**.\n\n## What the numbers mean\n\n| Score range | Interpretation |\n| ------------ | ----------------------------------------------------------------- |\n| **80–100** | Docs are working well — AI agents produce correct implementations |\n| **70–79** | Needs attention — there may be gaps in specific dimensions |\n| **Below 70** | Weak — AI agents consistently struggle with this area |\n\n## Ceiling decomposition (baseline mode)\n\nWhen running in baseline mode, each task is evaluated twice — with and without\ndocumentation. This produces:\n\n- **Floor score** — Score without docs (what the model knows from training data\n alone)\n- **Ceiling score** — Score with gold-standard docs injected directly into the\n prompt\n- **Doc Lift** — Ceiling minus floor. Positive means docs help; negative means\n docs hurt.\n- **Doc Quality Gap** — 100 minus ceiling. Room for documentation improvement.\n\n## Three-layer decomposition (full mode)\n\nFull mode adds a third measurement — what happens when AI agents find docs on\ntheir own:\n\n- **Floor** — No docs (parametric knowledge only)\n- **Ceiling** — Gold-standard docs injected (best the docs can do)\n- **Actual** — Agent-retrieved docs (real-world performance)\n- **Retrieval Gap** — Ceiling minus actual (quality lost to findability)\n- **Infrastructure Efficiency** — Actual ÷ ceiling (what fraction of doc quality\n reaches agents)\n\n## Cost tracking\n\nEach evaluation also tracks token costs:\n\n- **Provider cost** — Token usage for generating implementations\n- **Grader cost** — Token usage for the grading model's assessments\n- **Total cost** — Both combined, reported in the score summary",
|
|
92
|
+
"source": "docs/help/scoring-model.md",
|
|
93
|
+
"related": [
|
|
94
|
+
"three-layer",
|
|
95
|
+
"doc-lift",
|
|
96
|
+
"eval-modes"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "weaknesses-recommendations",
|
|
101
|
+
"title": "Weaknesses & Recommendations",
|
|
102
|
+
"body": "## Understanding weaknesses\n\nThe Issues sub-tab in Diagnostics lists every area or dimension that scored\nbelow threshold. Each weakness entry shows:\n\n- **The feature area** — Which product feature is affected (e.g., GROQ,\n Functions, Webhooks).\n- **The bottleneck dimension** — Which scoring dimension is dragging the area\n down: task completion, code correctness, or doc coverage.\n- **The score** — How far below threshold the dimension scored.\n\n## Gap analysis recommendations\n\nWhen an evaluation runs with gap analysis enabled, the dashboard shows\n**prioritized recommendations** — specific actions ranked by estimated impact.\n\nEach recommendation includes:\n\n- **Failure mode** — The type of doc problem identified:\n - `missing-docs` — The functionality isn't documented at all.\n - `incorrect-docs` — The docs contain factual errors.\n - `outdated-docs` — The docs describe an old API version or pattern.\n - `poor-structure` — The docs exist but are hard to find or understand.\n- **Estimated lift** — How many score points fixing this gap would add. Based on\n raising the bottleneck dimension to the median of non-bottleneck dimensions.\n Conservative estimate — actual improvement may be higher.\n- **Confidence** — How sure the analysis is about this diagnosis (high, medium,\n or low).\n- **Affected tasks** — Which specific evaluation tasks exposed this gap.\n\n## Low-scoring judgments\n\nBelow the recommendations, you'll find the **grader's explanations** for tests\nthat scored below 70. These are the raw assessments from the grading model\nexplaining exactly what went wrong — missing API calls, incorrect patterns,\nhallucinated features, etc.\n\nEach judgment shows the task, the dimension, the score, and the grader's natural\nlanguage reason. These are the most granular diagnostic signal available and\noften point directly to the doc section that needs fixing.",
|
|
103
|
+
"source": "docs/help/weaknesses-recommendations.md",
|
|
104
|
+
"related": [
|
|
105
|
+
"interpreting-diagnostics",
|
|
106
|
+
"scoring-model",
|
|
107
|
+
"negative-doc-lift"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "how-agents-work",
|
|
112
|
+
"title": "How AI Agents Find Documentation",
|
|
113
|
+
"body": "Understanding how popular AI coding agents retrieve and use documentation is\ncentral to the ai-literacy-framework evaluation framework. This document\nexplains the mechanisms used by common agents and how our test modes simulate\nthem.\n\n## The Documentation Access Problem\n\nWhen a developer asks an AI coding assistant \"Set up a Sanity Studio with a\ncustom blog schema,\" the agent needs to find and read the relevant Sanity\ndocumentation. But different agents do this in fundamentally different ways, and\nthose differences directly impact the quality of the response.\n\nThe framework measures this impact through four evaluation modes: **full**\n(default — runs baseline + agentic together), **baseline** (docs in prompt),\n**agentic** (tool-calling with real web access), and **observed** (instrumented\nsingle-call).\n\n## How Popular Agents Work\n\n### Claude Code (Anthropic)\n\nClaude Code has built-in tools including `WebSearchTool` and `WebFetchTool`.\nWhen a user asks a Sanity question:\n\n1. The model decides whether to search the web\n2. If so, it calls `WebSearchTool` with a query string\n3. Search results come back as structured data (titles, URLs, snippets)\n4. The model may call `WebFetchTool` to read specific pages\n5. The fetched content is returned as **rendered text** — Claude Code's fetch\n tool handles JavaScript rendering internally, so even SPA pages return\n readable content\n6. The model synthesizes the fetched docs with its training data to produce an\n answer\n\n**Key characteristic**: Claude Code sees the web as rendered, readable text. It\ndoesn't get raw HTML soup. But it also doesn't know about agent-friendly\nendpoints like `.md` files or `llms.txt` — it fetches the same HTML pages a\nbrowser would load.\n\n### ChatGPT (OpenAI)\n\nChatGPT's browsing capability uses Bing search under the hood:\n\n1. The model decides to search (users can also explicitly ask it to browse)\n2. It searches via Bing, getting ranked results\n3. It can \"click\" on results to read page content\n4. Pages are rendered server-side and returned as text\n5. The model reads relevant sections and synthesizes an answer\n\n**Key characteristic**: ChatGPT's browsing is similar to Claude Code — it gets\nrendered content. The URLs visited are returned in citations. It also has no\nawareness of `llms.txt` or `.md` endpoints.\n\n### Cursor\n\nCursor takes a different approach:\n\n1. It maintains a pre-built index of popular documentation sites (`@docs`)\n2. Users can manually add documentation sources\n3. It also has web search capability for unknown topics\n4. Codebase context is injected automatically from the project\n\n**Key characteristic**: Cursor's `@docs` feature means it may have indexed\nSanity docs already, but the index may be outdated. For unknown topics, it falls\nback to web search like the other agents.\n\n### GitHub Copilot\n\nCopilot primarily relies on:\n\n1. The model's training data (parametric knowledge)\n2. Codebase context from the current project\n3. Bing search for `@workspace` queries in newer versions\n\n**Key characteristic**: Copilot historically had no web access, relying entirely\non training data. Newer versions can search, but the experience is similar to\nChatGPT.\n\n## The JavaScript SPA Problem\n\nSanity's documentation site (`sanity.io/docs`) is built with Next.js — a\nJavaScript single-page application. When an agent makes a raw HTTP request:\n\n```\nGET https://www.sanity.io/docs/schema-types\n→ Returns ~125KB of HTML that is mostly:\n - <script> tags for Next.js bundles\n - React hydration data\n - Navigation chrome\n - Very little actual documentation text\n```\n\nReal agents handle this differently than a raw `fetch()`:\n\n| Agent | Raw fetch? | Gets readable content? | How? |\n| ------------- | ---------- | ---------------------- | ---------------------------------- |\n| Claude Code | No | Yes | Built-in rendering in WebFetchTool |\n| ChatGPT | No | Yes | Server-side rendering via Bing |\n| Cursor | No | Yes | Pre-built doc index |\n| Raw `fetch()` | Yes | **No** | Gets HTML soup |\n\nThis is why the agentic provider uses **Jina Reader** (`r.jina.ai`) as a\nreadability proxy in \"naive\" mode — it simulates the rendering capability that\nreal agents have built in.\n\n## Sanity's Agent-Friendly Endpoints\n\nSanity has invested in making their documentation accessible to AI agents\nthrough special endpoints:\n\n### `.md` endpoint\n\nAppending `.md` to any docs URL returns pure markdown:\n\n```\nGET https://www.sanity.io/docs/schema-types.md\nContent-Type: text/markdown;charset=UTF-8\n\n# Schema types\nSchema types are used to define the shape of your content...\n```\n\nThis returns **clean markdown** — no HTML, no JavaScript, no navigation. Just\nthe documentation content. Typical response size: 2-10KB (vs 125KB for the HTML\npage).\n\n### `llms.txt`\n\nSanity provides an `llms.txt` file at `https://www.sanity.io/docs/llms.txt` — a\nstructured listing of all documentation pages designed for AI agent consumption:\n\n```\n# Sanity\n## Docs\n- [Manage Sanity with code](https://www.sanity.io/docs/blueprints)\n- [Introduction](https://www.sanity.io/docs/blueprints-introduction)\n- [Deploy with GitHub Actions](https://www.sanity.io/docs/blueprints/blueprint-action)\n...\n```\n\nThis follows the emerging [llms.txt standard](https://llmstxt.org/) — a\nmachine-readable table of contents that tells agents what documentation is\navailable and where to find it.\n\n### Impact on Agent Performance\n\nOur smoke tests show the dramatic difference these endpoints make:\n\n| Metric | Naive Agent (Jina) | Optimized Agent (.md) |\n| ---------------- | ------------------ | --------------------- |\n| Result | ❌ FAIL | ✅ PASS |\n| Latency | 57.9s | 15.2s (3.8× faster) |\n| Bytes downloaded | 108 KB | 59 KB (45% less) |\n| Total requests | 9 | 6 (33% fewer) |\n| Search queries | 3 | 0 (used llms.txt) |\n\nThe optimized agent skips search entirely — it calls `list_docs(\"sanity.io\")` to\nget the `llms.txt` table of contents, identifies the relevant pages, and fetches\nthem directly as `.md`. No search round-trips, no proxy overhead, no content\ncleaning needed.\n\n## How Test Modes Map to Real Agents\n\n| Mode | Config | Simulates | Documentation Access |\n| -------------------------- | ------------------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------- |\n| `eval` (baseline) | `promptfooconfig.yaml` | No agent — docs in prompt | Docs are injected directly into the prompt context, with and without variants |\n| `eval:observed` | `promptfooconfig.observed.yaml` | Non-agentic API call | Single OpenAI API call, records the HTTP request but model doesn't browse |\n| `eval:agentic` (naive) | `promptfooconfig.agentic.yaml` | Claude Code, ChatGPT today | Model has `web_search` + `fetch_page` tools; pages fetched via Jina Reader (simulates JS rendering) |\n| `eval:agentic` (optimized) | `promptfooconfig.agentic.yaml` | Ideal future agent | Model has `web_search` + `fetch_page` + `list_docs` tools; fetches `.md` endpoints directly, uses `llms.txt` for discovery |\n| `agent-harness` | compiled via compiler | Real agent in sandbox | Agent harness mode evaluates real agent behavior in a sandboxed environment (Docker, tempdir, git-worktree) |\n\n### Why Both Naive and Optimized?\n\nThe comparison between naive and optimized modes answers a critical business\nquestion:\n\n> **\"How much does investing in agent-friendly documentation endpoints (`.md`,\n> `llms.txt`) improve the AI developer experience?\"**\n\nIf the optimized agent significantly outperforms the naive agent, it validates\nthe investment in these endpoints. The data from our tests provides concrete\nevidence for this.\n\n## Limitations of the Simulation\n\nWhile the agentic provider faithfully simulates agent behavior, there are\ndifferences from real agents:\n\n1. **Search quality**: We use DuckDuckGo via Jina as a search fallback. Real\n agents use Bing (ChatGPT) or their own search (Claude Code). Search result\n quality varies.\n\n2. **Page rendering**: Jina Reader is a good proxy for JS rendering, but may\n produce slightly different output than what Claude Code or ChatGPT's internal\n renderers produce.\n\n3. **Context window management**: Real agents have sophisticated context\n management — they may truncate long pages, summarize content, or use sliding\n windows. Our provider returns content up to a fixed limit (12KB).\n\n4. **Codebase context**: Real agents (especially Cursor and Copilot) inject the\n developer's current codebase into context. Our eval doesn't simulate this —\n it only tests documentation retrieval.\n\n5. **Multi-turn interactions**: A real developer might have a conversation with\n their agent, refining the request. Our eval tests single-turn interactions.\n\n## Future Directions\n\nThe architecture overhaul (Phase 4: agent harness mode) addressed several of\nthese goals — real agents can now be evaluated in sandboxed environments with\nfixture provisioning, tool manifests, and process-quality scoring. Remaining\ndirections:\n\n- **Subprocess agents** _(partially addressed by agent harness mode)_: The\n harness supports running agents via entrypoints in Docker, tempdir, or\n git-worktree sandboxes. Real `claude` CLI or other agent CLIs can be\n configured as harness entrypoints.\n- **Anthropic/OpenAI native tools**: Use Claude's built-in `web_search` tool or\n OpenAI's `web_search_preview` in the Responses API for more faithful\n simulation of the agentic mode\n- **Agent-specific configs**: The compiler's mode handler system makes it\n straightforward to create per-agent configurations\n- **Codebase context injection** _(partially addressed by fixture\n provisioning)_: The agent harness fixture provisioner can inject project\n workspaces, dependency manifests, and code contexts into sandbox environments",
|
|
114
|
+
"source": "docs/how-agents-work.md",
|
|
115
|
+
"related": [
|
|
116
|
+
"eval-modes",
|
|
117
|
+
"retrieval-gap"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "eval-modes",
|
|
122
|
+
"title": "Evaluation Modes",
|
|
123
|
+
"body": "> **This guide is for:** Anyone using AILF who wants to understand what modes\n> exist and when to use each one.\n\nAILF supports five canonical evaluation modes. Each mode measures a different\naspect of AI tool effectiveness.\n\n## Mode overview\n\n| Mode | What it measures | When to use it |\n| ------------------- | ---------------------------------------------------- | ------------------------------------- |\n| **literacy** | Can AI agents implement features using your docs? | Testing documentation quality |\n| **mcp-server** | Can an LLM correctly use your MCP server's tools? | Testing MCP server implementations |\n| **knowledge-probe** | What does the model know without any docs? | Measuring baseline model knowledge |\n| **agent-harness** | Can an autonomous agent complete tasks in a sandbox? | Testing agent capabilities end-to-end |\n| **custom** | Whatever you define | Building your own evaluation type |\n\n## Choosing a mode\n\n```\nWhat do you want to test?\n │\n ├── \"Are our docs helping AI agents?\" ──────→ literacy\n ├── \"Does our MCP server work correctly?\" ──→ mcp-server\n ├── \"What does the model already know?\" ────→ knowledge-probe\n ├── \"Can an agent complete real tasks?\" ────→ agent-harness\n └── \"Something else entirely\" ──────────────→ custom\n```",
|
|
124
|
+
"source": "docs/modes.md",
|
|
125
|
+
"related": [
|
|
126
|
+
"scoring-model",
|
|
127
|
+
"three-layer"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "glossary",
|
|
132
|
+
"title": "Glossary",
|
|
133
|
+
"body": "**Overall Score**\n: A weighted average across all feature areas, using the gold scoring profile: Task Completion (50%), Code Correctness (25%), and Doc Coverage (25%).\n\n**Doc Lift**\n: How much the docs help, compared to the model's training data alone. Calculated as ceiling minus floor, where ceiling includes Doc Coverage and floor does not. Higher is better.\n\n**Actual Score**\n: How well an AI agent scores when it has to find docs on its own through web search and page fetching. This is the real-world scenario. Only available in full mode.\n\n**Retrieval Gap**\n: The score lost because agents can't find or use all the relevant docs. Calculated as ceiling minus actual. Lower is better; zero means agents find everything.\n\n**Infra Efficiency**\n: What percentage of the docs' potential quality actually reaches agents (actual ÷ ceiling). 100% means agents find and use all relevant docs perfectly.\n\n**Floor**\n: Output-quality composite without documentation — Task Completion (60%) and Code Correctness (40%) only. Doc Coverage is excluded because it's undefined when no docs are provided. This tells you what the model already knows from its training data.\n\n**Ceiling**\n: Score with gold-standard docs injected directly into the prompt. This is the best the documentation can do.\n\n**Actual**\n: Score when an AI agent finds docs on its own through web search and page fetching. This is the real-world experience.\n\n**Ret. Gap**\n: Quality lost to discoverability (ceiling minus actual). The gap between what the docs could deliver and what agents actually get.\n\n**Efficiency**\n: What fraction of the docs' quality reaches agents in practice (actual ÷ ceiling, shown as a percentage).\n\n**Inverted Retrieval Gap**\n: ⚠️ Inverted retrieval gap: agents that can't find the docs actually score higher, because the docs hurt performance. This usually means there's a doc quality problem.\n\n**Score**\n: Ceiling composite for this feature area: Task Completion × 50% + Code Correctness × 25% + Doc Coverage × 25%.\n\n**Task Completion**\n: Can the LLM implement the requested feature? Graded 0–100.\n\n**Code Correctness**\n: Is the generated code idiomatic, correct, and following best practices? Graded 0–100.\n\n**Doc Coverage**\n: Did the docs provide the information needed to implement the feature? Graded 0–100. This dimension only contributes to the ceiling composite (with docs) — it's excluded from the floor composite because it's undefined without documentation.\n\n**Tests**\n: Number of test cases in this feature area.\n\n**Overall Δ**\n: Change in overall score between the two runs. Positive means the experiment scored higher.\n\n**Actual Δ**\n: Change in actual (agent-retrieved) score between runs. Positive means agents did better.\n\n**Ret. Gap Δ**\n: Change in retrieval gap between runs. Negative is good here: it means the gap shrank and agents found more relevant docs.\n\n**Efficiency Δ**\n: Change in infrastructure efficiency between runs. Positive means agents are capturing more of the docs' potential.\n\n**Baseline**\n: The reference run you're comparing against.\n\n**Experiment**\n: The new run you're evaluating.\n\n**Delta**\n: Difference between experiment and baseline. Positive means improvement, negative means regression.\n\n**Change**\n: Whether the change is meaningful: improved, regressed, or unchanged (within the noise threshold).\n\n**Low-Scoring Judgments**\n: The grading model's explanations for tests that scored below 70/100.\n\n**Judgment Reason**\n: The grading model's natural language explanation of what went wrong.\n\n**Strong (80+)**\n: Feature areas scoring 80 or above. The docs are working well for these features — AI agents produce correct, complete implementations.\n\n**Needs Attention (70–79)**\n: Feature areas scoring 70–79. These are okay but could be improved — there may be gaps in specific dimensions like doc coverage or code correctness.\n\n**Weak (<70)**\n: Feature areas scoring below 70. The docs are not providing enough support for AI agents to implement these features correctly.\n\n**Negative Doc Lift**\n: Number of areas where the documentation actually hurts AI performance — the model scores higher without docs than with them. This usually means the docs contain outdated patterns or incorrect examples.\n\n**Weak Areas**\n: Feature areas where the overall score is below 70. These need the most attention — low scores mean AI agents consistently struggle to implement these features.\n\n**Docs Hurt Performance**\n: Areas where the floor score (no docs) is higher than the ceiling score (with docs). The documentation may be actively misleading the model. These docs should be reviewed.\n\n**Retrieval Issues**\n: Areas where AI agents can find less than 70% of the available doc quality. The docs exist and are good, but agents can't discover them through search. Consider improving page titles, metadata, or search engine indexing.\n\n**Dimension Weaknesses**\n: Individual grading dimensions scoring below 50 within an area. These are the specific skills where AI agents fail most — task completion (can it build the feature?), code correctness (is the code right?), or doc coverage (did it use the docs?).\n\n**Efficiency Anomalies**\n: Areas where agent efficiency exceeds 100% — meaning agents perform better with self-found docs than with gold-standard docs injected directly. This can indicate doc quality issues (injected docs confuse the model) or agent memorization.\n\n**Doc Lift Wins**\n: Areas where documentation boosts AI performance by 5 or more points. Higher doc lift means the docs are providing crucial information that the model doesn't already know.\n\n**Retrieval Excellence**\n: Areas where AI agents successfully find and use at least 85% of the available doc quality through web search. Good retrieval means your docs are well-indexed and easy for agents to discover.\n\n**Model Breakdown**\n: Break down scores by individual LLM model. The default 'All Models' view shows the cross-model average. Select a specific model to see how it performed independently — useful for spotting models that struggle with specific feature areas.\n\n**Strengths**\n: What's working well: high-scoring areas, dimensions where the docs are strong, and areas where AI agents successfully find and use the documentation.\n\n**Recommendations**\n: Prioritized remediation plan from gap analysis. Each recommendation identifies a documentation problem, the affected feature area, and the estimated score lift from fixing it.\n\n**Total Potential Lift**\n: Aggregate potential score lift if all identified gaps were fixed. This is a conservative estimate — each gap targets the median of non-bottlenecked dimensions, not 100.\n\n**Failure Mode**\n: The type of failure the grader emitted. Cross-cutting modes apply to any dimension (api-error, model-limitation, false-floor, unclassified). Per-dimension extensions cover documentation problems (missing-docs, incorrect-docs, outdated-docs, poor-structure), spec adherence (spec-mismatch), tool use (tool-misuse, chaotic-process, missing-recovery), and knowledge probes (factual-error, incompleteness, currency-violation, hallucination).\n\n**Estimated Lift**\n: Estimated composite score improvement if this gap is fully fixed. Based on raising bottleneck dimensions to the median of non-bottlenecked dimensions.\n\n**Confidence**\n: How confident we are in this diagnosis (D0049 ceiling-cross-check derivation). High = the grader's emitted failure mode agrees with the structural ceiling-decomposition signal. Medium = signals disagree (or the ceiling pattern is not informative for this score). Low = passing scores never classify; treat as absent.\n\n**Agent Behavior**\n: How AI agents interacted with your documentation during evaluation: what they searched for, which pages they visited, and how much time they spent on network requests.\n\n**Search Queries**\n: The exact search queries agents used to find documentation. Helps you understand how agents discover your content and whether your docs appear for relevant queries.\n\n**Unique Doc Slugs**\n: Documentation page slugs that agents actually visited during evaluation. Compare against canonical docs to see if agents found the right pages.\n\n**External Domains**\n: Non-Sanity domains that agents contacted during evaluation. High external domain counts may indicate agents couldn't find what they needed in your docs.\n\n**Avg Pages Visited**\n: Average number of documentation pages visited per test. Higher counts can mean agents need to consult many pages (complex task) or can't find the right one quickly.\n\n**Avg Searches**\n: Average number of web searches performed per test. High search counts can indicate docs are hard to discover through search engines.\n\n**Avg Network Time**\n: Average time spent on network requests per test. Includes page fetches, search queries, and API calls.\n\n**Total Requests**\n: Total number of HTTP requests the agent made during the test, including searches, page visits, and API calls.\n\n**Total Bytes Downloaded**\n: Total bytes downloaded by the agent. Large downloads may indicate the agent is fetching many pages or very large documents.\n\n**Task Completion Δ**\n: Change in task completion between runs. Positive means implementations are more complete.\n\n**Code Correctness Δ**\n: Change in code correctness between runs. Positive means better code quality.\n\n**Doc Coverage Δ**\n: Change in doc coverage between runs. Positive means the docs are providing more useful information.\n\n**Area Δ**\n: Score change for this area compared to the previous evaluation run.\n\n**Production**\n: Production source — docs fetched from the live production dataset. Scores reflect what real users and AI agents experience today.\n\n**Branch**\n: Branch source — docs fetched from a branch or draft dataset. Use this to preview how content changes affect scores before publishing.\n\n**Local**\n: Local source — docs fetched from local files or a local dev server. Useful for testing doc changes before pushing.\n\n**Score**\n: The overall ceiling composite for this evaluation run: Task Completion (50%), Code Correctness (25%), and Doc Coverage (25%), averaged across all feature areas.\n\n**Mode**\n: The evaluation mode determines which reference points are measured. Different modes test different aspects of how AI agents interact with documentation.\n\n**Trigger**\n: What initiated this evaluation run. Knowing the trigger helps you understand whether a score change was from a content edit, a code deploy, or a scheduled check.\n\n**Baseline**\n: Baseline mode — tests the model with gold-standard docs injected directly. Measures ceiling performance (best the docs can do).\n\n**Full**\n: Full mode — runs baseline + agentic. Compares ceiling (injected docs) against actual (agent-retrieved docs) to measure retrieval gap and infrastructure efficiency.\n\n**Agentic**\n: Agentic mode — the AI agent finds docs on its own via web search. Measures real-world performance: can agents actually discover and use your documentation?\n\n**Observed**\n: Observed mode — records how agents interact with docs without scoring. Captures search queries, pages visited, and browsing patterns for analysis.\n\n**Debug**\n: Debug mode — a diagnostic run for pipeline development. May use non-standard configurations or limited task sets.\n\n**Manual**\n: Manually triggered — someone ran the evaluation pipeline by hand, either locally or via the Studio UI.\n\n**CI**\n: CI-triggered — the evaluation ran automatically as part of a pull request or merge pipeline.\n\n**Scheduled**\n: Scheduled — the evaluation ran on a recurring schedule (e.g. nightly or weekly) to track score trends over time.\n\n**Webhook**\n: Webhook-triggered — a content change in Sanity triggered the evaluation automatically. Helps catch doc regressions early.\n\n**Cross-Repo**\n: Cross-repo — triggered from another repository via the dispatch API. Used when external repos want to validate their docs against AILF tasks.",
|
|
134
|
+
"source": "packages/shared/src/glossary.ts",
|
|
135
|
+
"tags": [
|
|
136
|
+
"reference",
|
|
137
|
+
"glossary"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
];
|