From 0858d0d50b72c010cd9238a061a70430070e44c1 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:01:10 -0700
Subject: [PATCH 001/287] feat(shared): typed prompts, size-based blob storage,
experiment fields
Add AGENTS.md support and GEPA experiment grouping to the shared layer:
- TaskPromptDocument gains optional `type` ('task' | 'agents.md') and
`contentBlobUrl`; `text` becomes optional. computeTaskPromptId is
type-aware and backward-compatible (task/undefined keep identical _ids).
- TaskPromptStore: size-based storage (inline <= PROMPT_INLINE_MAX_BYTES,
else blob at prompts/{id}.txt), findOrCreate({type}), getAll({type}),
resolvePromptText(doc), 256 KB hard cap. BlobStorage.uploadText added.
- RequestDocument + schemas gain experimentId, agentsMdPromptId,
agentsMdParentIds (multi-parent lineage). GroupByKey adds 'experiment'.
- Tests: 35 passing covering type namespacing, backward compat, blob
offload on create-miss, resolvePromptText, max-size reject, getAll filter.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
packages/shared/src/schemas/request.ts | 17 ++-
packages/shared/src/schemas/task-prompt.ts | 12 +-
packages/shared/src/storage/blob-storage.ts | 22 +++
.../shared/src/task-prompts/task-prompt-id.ts | 23 +++-
.../task-prompts/task-prompt-store.test.ts | 126 +++++++++++++++++-
.../src/task-prompts/task-prompt-store.ts | 121 +++++++++++++++--
packages/shared/src/types/types.ts | 48 ++++++-
7 files changed, 342 insertions(+), 27 deletions(-)
diff --git a/packages/shared/src/schemas/request.ts b/packages/shared/src/schemas/request.ts
index bdcf6cc88..7892f7bdc 100644
--- a/packages/shared/src/schemas/request.ts
+++ b/packages/shared/src/schemas/request.ts
@@ -101,6 +101,17 @@ export const CreateRequestInputSchema = z
profileId: z.string().optional(),
profileVariations: z.array(z.string()).optional(),
priority: z.number().int().optional(),
+ // Optional grouping id tying together all requests of one experiment
+ // (e.g. a GEPA optimization run: the seed request and every candidate).
+ experimentId: z.string().optional(),
+ // Raw AGENTS.md body to deliver to the worker workspace. When present, the
+ // API findOrCreates an `agents.md`-typed prompt and stores its id on the
+ // request (see `agentsMdPromptId`).
+ agentsMd: z.string().optional(),
+ // Lineage edges (parent AGENTS.md prompt ids) when this candidate was
+ // derived from earlier ones: [] / omitted = root, [p] = mutation,
+ // [i, j] = merge of two parents.
+ agentsMdParentIds: z.array(z.string()).optional(),
})
.openapi("CreateRequestInput");
@@ -118,6 +129,9 @@ export const RequestResponseSchema = z
persona: PersonaSchema.optional(),
deletedAt: z.coerce.date().optional(),
taskPromptId: z.string().optional(),
+ experimentId: z.string().optional(),
+ agentsMdPromptId: z.string().optional(),
+ agentsMdParentIds: z.array(z.string()).optional(),
mcpServers: z.array(z.string()).optional(),
skillRevisions: z.array(z.string()).optional(),
extensions: z.array(z.string()).optional(),
@@ -200,9 +214,10 @@ export const ListRequestsQuerySchema = z
criteria: z.string().optional(),
submissionId: z.string().optional(),
profileId: z.string().optional(),
+ experimentId: z.string().optional(),
status: RequestStatusSchema.optional(),
outcome: RequestOutcomeSchema.optional(),
- groupBy: z.enum(["task", "submissionId", "profile"]).optional(),
+ groupBy: z.enum(["task", "submissionId", "profile", "experiment"]).optional(),
limit: z.coerce.number().int().min(1).max(100).optional(),
after: z.string().optional(),
before: z.string().optional(),
diff --git a/packages/shared/src/schemas/task-prompt.ts b/packages/shared/src/schemas/task-prompt.ts
index bf66e3e50..5adbd4556 100644
--- a/packages/shared/src/schemas/task-prompt.ts
+++ b/packages/shared/src/schemas/task-prompt.ts
@@ -7,16 +7,26 @@ import { PromptFeatureResultSchema } from "./prompt-feature.js";
extendZodWithOpenApi(z);
+export const TaskPromptTypeSchema = z
+ .enum(["task", "agents.md"])
+ .openapi("TaskPromptType");
+
export const CreateTaskPromptInputSchema = z
.object({
text: z.string(),
+ type: TaskPromptTypeSchema.optional(),
})
.openapi("CreateTaskPromptInput");
export const TaskPromptResponseSchema = z
.object({
_id: z.string(),
- text: z.string(),
+ // Present for inline-stored bodies; absent when the body lives in blob
+ // storage (see `contentBlobUrl`). Use the `/content` endpoint to always
+ // get the resolved text.
+ text: z.string().optional(),
+ contentBlobUrl: z.string().optional(),
+ type: TaskPromptTypeSchema.optional(),
features: z.array(PromptFeatureResultSchema).optional(),
featuresExtractedAt: z.coerce.date().optional(),
createdAt: z.coerce.date(),
diff --git a/packages/shared/src/storage/blob-storage.ts b/packages/shared/src/storage/blob-storage.ts
index 19a7e3db2..c9b50038b 100644
--- a/packages/shared/src/storage/blob-storage.ts
+++ b/packages/shared/src/storage/blob-storage.ts
@@ -438,6 +438,28 @@ export class BlobStorage {
return blockBlobClient.url;
}
+ /**
+ * Uploads an in-memory UTF-8 text body to the snapshots container as a single
+ * block blob. Overwrites if the blob already exists. Returns the blob URL.
+ *
+ * Use this for plain-text/markdown bodies (e.g. large prompt or AGENTS.md
+ * content) where the JSON content-type from `uploadJson` would be misleading.
+ */
+ async uploadText(
+ blobName: string,
+ text: string,
+ contentType: string = "text/plain; charset=utf-8",
+ ): Promise {
+ await this.ensureContainer();
+
+ const buf = Buffer.from(text, "utf-8");
+ const blockBlobClient = this.containerClient.getBlockBlobClient(blobName);
+ await blockBlobClient.uploadData(buf, {
+ blobHTTPHeaders: { blobContentType: contentType },
+ });
+ return blockBlobClient.url;
+ }
+
/**
* Downloads a snapshot from blob storage and extracts it to the target directory.
*/
diff --git a/packages/shared/src/task-prompts/task-prompt-id.ts b/packages/shared/src/task-prompts/task-prompt-id.ts
index 7a7e51656..5f120d6d3 100644
--- a/packages/shared/src/task-prompts/task-prompt-id.ts
+++ b/packages/shared/src/task-prompts/task-prompt-id.ts
@@ -2,6 +2,7 @@
// Licensed under the MIT License.
import { v5 as uuidv5 } from 'uuid';
+import type { TaskPromptType } from '../types/types.js';
/**
* Namespace UUID derived from 'task.scope-mt.dev' using the RFC 4122 DNS namespace.
@@ -10,13 +11,21 @@ import { v5 as uuidv5 } from 'uuid';
export const TASK_PROMPT_NAMESPACE = uuidv5('task.scope-mt.dev', uuidv5.DNS);
/**
- * Compute a deterministic UUIDv5 for a task prompt from its text content.
+ * Compute a deterministic UUIDv5 for a task prompt from its text content (and type).
*
- * The ID is derived from `uuidv5(text.trim(), TASK_PROMPT_NAMESPACE)`, making it:
- * - **Content-addressed**: same text always produces the same ID
- * - **Trim-insensitive**: leading/trailing whitespace is ignored
- * - **Standard UUID format**: 36-char hyphenated UUID, consistent with the rest of the codebase
+ * The ID is content-addressed and **backward-compatible**:
+ * - **`task` / undefined type**: derived from `uuidv5(text.trim(), NS)` — identical
+ * to the original scheme, so every existing task prompt keeps its exact `_id`.
+ * - **Non-task types** (e.g. `agents.md`): the type is folded into the hash as
+ * `uuidv5(type + '\n' + text.trim(), NS)`, namespacing it so a prompt of one type
+ * never collides with an identical-text prompt of another type.
+ *
+ * Properties: content-addressed (same text+type → same ID), trim-insensitive,
+ * standard 36-char hyphenated UUID.
*/
-export function computeTaskPromptId(text: string): string {
- return uuidv5(text.trim(), TASK_PROMPT_NAMESPACE);
+export function computeTaskPromptId(text: string, type?: TaskPromptType): string {
+ const trimmed = text.trim();
+ const namespaced =
+ !type || type === 'task' ? trimmed : `${type}\n${trimmed}`;
+ return uuidv5(namespaced, TASK_PROMPT_NAMESPACE);
}
diff --git a/packages/shared/src/task-prompts/task-prompt-store.test.ts b/packages/shared/src/task-prompts/task-prompt-store.test.ts
index 930846978..b7ca6b22f 100644
--- a/packages/shared/src/task-prompts/task-prompt-store.test.ts
+++ b/packages/shared/src/task-prompts/task-prompt-store.test.ts
@@ -63,9 +63,10 @@ function createMockCollection() {
let count = 0;
for (const doc of docs.values()) {
if (filter.deletedAt?.$exists === false && doc.deletedAt) continue;
+ if (!matchesType(filter, doc)) continue;
if (filter.text?.$regex) {
const regex = new RegExp(filter.text.$regex, filter.text.$options);
- if (!regex.test(doc.text)) continue;
+ if (!regex.test(doc.text ?? "")) continue;
}
count++;
}
@@ -76,9 +77,10 @@ function createMockCollection() {
const results: TaskPromptDocument[] = [];
for (const doc of docs.values()) {
if (filter.deletedAt?.$exists === false && doc.deletedAt) continue;
+ if (!matchesType(filter, doc)) continue;
if (filter.text?.$regex) {
const regex = new RegExp(filter.text.$regex, filter.text.$options);
- if (!regex.test(doc.text)) continue;
+ if (!regex.test(doc.text ?? "")) continue;
}
results.push({ ...doc });
}
@@ -87,6 +89,18 @@ function createMockCollection() {
};
}
+/** Replicates the store's `$or`/`type` filter against an in-memory doc. */
+function matchesType(filter: any, doc: TaskPromptDocument): boolean {
+ if (filter.$or) {
+ return filter.$or.some((clause: any) => {
+ if (clause.type?.$exists === false) return doc.type === undefined;
+ return doc.type === clause.type;
+ });
+ }
+ if (filter.type !== undefined) return doc.type === filter.type;
+ return true;
+}
+
// ── Tests ────────────────────────────────────────────────────────────────────
describe("TaskPromptStore", () => {
@@ -131,6 +145,98 @@ describe("TaskPromptStore", () => {
expect(revived._id).toBe(doc._id);
expect(revived.deletedAt).toBeUndefined();
});
+
+ it("namespaces non-task types into a distinct id", async () => {
+ const task = await store.findOrCreate("same text");
+ const agents = await store.findOrCreate("same text", { type: "agents.md" });
+ expect(agents._id).not.toBe(task._id);
+ expect(agents._id).toBe(computeTaskPromptId("same text", "agents.md"));
+ expect(agents.type).toBe("agents.md");
+ });
+
+ it("keeps task ids backward-compatible (unchanged by type arg)", async () => {
+ const a = await store.findOrCreate("hello");
+ const b = await store.findOrCreate("hello", { type: "task" });
+ expect(a._id).toBe(b._id);
+ expect(a._id).toBe(computeTaskPromptId("hello"));
+ });
+ });
+
+ // -- size-based storage ---------------------------------------------------
+
+ describe("size-based storage", () => {
+ function createMockBlob() {
+ const blobs = new Map();
+ return {
+ store: blobs,
+ uploadText: vi.fn(async (name: string, text: string) => {
+ blobs.set(name, text);
+ return `https://acct.blob/snapshots/${name}`;
+ }),
+ downloadBlobToBuffer: vi.fn(async (name: string) => {
+ const v = blobs.get(name);
+ if (v === undefined) throw new Error(`blob ${name} not found`);
+ return Buffer.from(v, "utf-8");
+ }),
+ };
+ }
+
+ it("stores small bodies inline and never touches blob", async () => {
+ const blob = createMockBlob();
+ const s = new TaskPromptStore(col as any, blob as any, 1024);
+ const doc = await s.findOrCreate("tiny");
+ expect(doc.text).toBe("tiny");
+ expect(doc.contentBlobUrl).toBeUndefined();
+ expect(blob.uploadText).not.toHaveBeenCalled();
+ });
+
+ it("uploads over-threshold bodies to blob on a create miss", async () => {
+ const blob = createMockBlob();
+ const s = new TaskPromptStore(col as any, blob as any, 16);
+ const big = "x".repeat(64);
+ const doc = await s.findOrCreate(big, { type: "agents.md" });
+ expect(doc.text).toBeUndefined();
+ expect(doc.contentBlobUrl).toContain(`prompts/${doc._id}.txt`);
+ expect(blob.uploadText).toHaveBeenCalledTimes(1);
+ });
+
+ it("skips the upload on a hit (idempotent)", async () => {
+ const blob = createMockBlob();
+ const s = new TaskPromptStore(col as any, blob as any, 16);
+ const big = "y".repeat(64);
+ await s.findOrCreate(big, { type: "agents.md" });
+ await s.findOrCreate(big, { type: "agents.md" });
+ expect(blob.uploadText).toHaveBeenCalledTimes(1);
+ });
+
+ it("resolvePromptText returns inline text without blob access", async () => {
+ const blob = createMockBlob();
+ const s = new TaskPromptStore(col as any, blob as any, 1024);
+ const doc = await s.findOrCreate("inline body");
+ expect(await s.resolvePromptText(doc)).toBe("inline body");
+ expect(blob.downloadBlobToBuffer).not.toHaveBeenCalled();
+ });
+
+ it("resolvePromptText downloads blob-backed bodies", async () => {
+ const blob = createMockBlob();
+ const s = new TaskPromptStore(col as any, blob as any, 16);
+ const big = "z".repeat(64);
+ const doc = await s.findOrCreate(big, { type: "agents.md" });
+ expect(await s.resolvePromptText(doc)).toBe(big);
+ expect(blob.downloadBlobToBuffer).toHaveBeenCalledTimes(1);
+ });
+
+ it("rejects bodies over the hard max size", async () => {
+ const blob = createMockBlob();
+ const s = new TaskPromptStore(col as any, blob as any, 16);
+ const huge = "a".repeat(256 * 1024 + 1);
+ await expect(s.findOrCreate(huge)).rejects.toThrow(/maximum/);
+ });
+
+ it("throws when an over-threshold body has no blob storage configured", async () => {
+ const s = new TaskPromptStore(col as any, undefined, 16);
+ await expect(s.findOrCreate("b".repeat(64))).rejects.toThrow(/BlobStorage/);
+ });
});
// -- get ------------------------------------------------------------------
@@ -222,6 +328,22 @@ describe("TaskPromptStore", () => {
expect(total).toBe(1);
expect(items[0].text).toBe("Azure deployment");
});
+
+ it("defaults to task-typed prompts (and legacy untyped docs)", async () => {
+ await store.findOrCreate("a task prompt");
+ await store.findOrCreate("an agents file", { type: "agents.md" });
+ const { items, total } = await store.getAll();
+ expect(total).toBe(1);
+ expect(items[0].text).toBe("a task prompt");
+ });
+
+ it("filters by agents.md type", async () => {
+ await store.findOrCreate("a task prompt");
+ await store.findOrCreate("an agents file", { type: "agents.md" });
+ const { items, total } = await store.getAll({ type: "agents.md" });
+ expect(total).toBe(1);
+ expect(items[0].text).toBe("an agents file");
+ });
});
// -- attachFeatures -------------------------------------------------------
diff --git a/packages/shared/src/task-prompts/task-prompt-store.ts b/packages/shared/src/task-prompts/task-prompt-store.ts
index fa2907c1f..5e4c232ef 100644
--- a/packages/shared/src/task-prompts/task-prompt-store.ts
+++ b/packages/shared/src/task-prompts/task-prompt-store.ts
@@ -2,38 +2,97 @@
// Licensed under the MIT License.
import { Collection } from 'mongodb';
-import { TaskPromptDocument, PromptFeatureResult } from '../types/types.js';
+import { TaskPromptDocument, PromptFeatureResult, TaskPromptType } from '../types/types.js';
import { computeTaskPromptId } from './task-prompt-id.js';
+import type { BlobStorage } from '../storage/blob-storage.js';
+
+/** Default inline-vs-blob threshold (UTF-8 bytes). Bodies larger than this are
+ * stored in blob storage; smaller bodies stay inline in Mongo. */
+export const DEFAULT_PROMPT_INLINE_MAX_BYTES = 16 * 1024;
+
+/** Hard guard cap on prompt body size (UTF-8 bytes). Bodies larger than this
+ * are rejected outright, regardless of storage location. */
+export const PROMPT_MAX_BYTES = 256 * 1024;
+
+/** Deterministic blob path for a prompt body that lives in blob storage. */
+export function promptBlobName(id: string): string {
+ return `prompts/${id}.txt`;
+}
/**
* MongoDB-backed store for task prompt entities.
*
* Task prompts are **immutable and content-addressed**: the `_id` is a UUIDv5
- * derived from the trimmed prompt text. The same text always resolves to the
- * same document — `findOrCreate` is idempotent.
+ * derived from the trimmed prompt text (and, for non-`task` types, the type).
+ * The same text+type always resolves to the same document — `findOrCreate` is
+ * idempotent.
+ *
+ * The body is stored **inline** (`text`) when small, or in **blob storage**
+ * (`contentBlobUrl`) when it exceeds the configured inline threshold. Storage
+ * location is decided purely by size, independent of the prompt `type`.
*
* Documents are soft-deleted (deletedAt) rather than removed.
*/
export class TaskPromptStore {
- constructor(private collection: Collection) {}
+ private readonly inlineMaxBytes: number;
+
+ constructor(
+ private collection: Collection,
+ private blobStorage?: BlobStorage,
+ inlineMaxBytes?: number,
+ ) {
+ this.inlineMaxBytes =
+ inlineMaxBytes ??
+ (process.env.PROMPT_INLINE_MAX_BYTES
+ ? parseInt(process.env.PROMPT_INLINE_MAX_BYTES, 10)
+ : DEFAULT_PROMPT_INLINE_MAX_BYTES);
+ }
/** Get a single task prompt by ID (non-deleted) */
async get(id: string): Promise {
return this.collection.findOne({ _id: id, deletedAt: { $exists: false } });
}
- /** Get a task prompt by its text content (non-deleted) */
- async getByText(text: string): Promise {
- return this.get(computeTaskPromptId(text));
+ /** Get a task prompt by its text content (and type) (non-deleted) */
+ async getByText(text: string, type?: TaskPromptType): Promise {
+ return this.get(computeTaskPromptId(text, type));
}
/**
- * Find an existing task prompt by text, or create a new one.
- * Idempotent — same text always returns the same document.
+ * Resolve a prompt document's body to plain text, regardless of storage
+ * location: returns inline `text` when present, otherwise downloads the body
+ * from blob storage. Throws if the document has neither (corrupt) or if blob
+ * storage is needed but not configured.
*/
- async findOrCreate(text: string): Promise {
+ async resolvePromptText(doc: TaskPromptDocument): Promise {
+ if (doc.text != null) return doc.text;
+ if (doc.contentBlobUrl) {
+ if (!this.blobStorage) {
+ throw new Error(
+ `Task prompt '${doc._id}' body is in blob storage but no BlobStorage is configured`,
+ );
+ }
+ const buf = await this.blobStorage.downloadBlobToBuffer(promptBlobName(doc._id));
+ return buf.toString('utf-8');
+ }
+ throw new Error(`Task prompt '${doc._id}' has neither inline text nor a blob reference`);
+ }
+
+ /**
+ * Find an existing task prompt by text (and type), or create a new one.
+ * Idempotent — same text+type always returns the same document.
+ *
+ * Bodies over the inline threshold are uploaded to blob storage on a create
+ * **miss** (and the doc stores only a `contentBlobUrl`); smaller bodies are
+ * stored inline. The dedup/lookup is by content hash and never touches blob.
+ */
+ async findOrCreate(
+ text: string,
+ opts?: { type?: TaskPromptType },
+ ): Promise {
const trimmed = text.trim();
- const id = computeTaskPromptId(trimmed);
+ const type = opts?.type;
+ const id = computeTaskPromptId(trimmed, type);
// Try to find existing (including soft-deleted — revive if needed)
const existing = await this.collection.findOne({ _id: id });
@@ -49,12 +108,35 @@ export class TaskPromptStore {
return existing;
}
- // Create new document
+ // Enforce the hard size cap before storing anywhere.
+ const byteLength = Buffer.byteLength(trimmed, 'utf-8');
+ if (byteLength > PROMPT_MAX_BYTES) {
+ throw new Error(
+ `Prompt body is ${byteLength} bytes, exceeding the maximum of ${PROMPT_MAX_BYTES} bytes`,
+ );
+ }
+
const doc: TaskPromptDocument = {
_id: id,
- text: trimmed,
createdAt: new Date(),
};
+ if (type) doc.type = type;
+
+ // Size-based storage: large bodies go to blob, small bodies stay inline.
+ if (byteLength > this.inlineMaxBytes) {
+ if (!this.blobStorage) {
+ throw new Error(
+ `Prompt body is ${byteLength} bytes (over the ${this.inlineMaxBytes}-byte inline ` +
+ `threshold) but no BlobStorage is configured to store it`,
+ );
+ }
+ doc.contentBlobUrl = await this.blobStorage.uploadText(
+ promptBlobName(id),
+ trimmed,
+ );
+ } else {
+ doc.text = trimmed;
+ }
await this.collection.insertOne(doc as any);
return doc;
@@ -62,15 +144,26 @@ export class TaskPromptStore {
/**
* List active (non-deleted) task prompts.
- * Supports pagination and optional substring search on text.
+ * Supports pagination, optional substring search on text, and type scoping.
+ *
+ * `type` defaults to `task`: when omitted or `'task'`, both explicitly-typed
+ * task prompts and legacy docs without a `type` field are returned (so absent
+ * type behaves as `task`). Pass `'agents.md'` to list AGENTS.md prompts.
*/
async getAll(opts?: {
limit?: number;
offset?: number;
search?: string;
+ type?: TaskPromptType;
}): Promise<{ items: TaskPromptDocument[]; total: number }> {
const filter: Record = { deletedAt: { $exists: false } };
+ if (!opts?.type || opts.type === 'task') {
+ filter.$or = [{ type: 'task' }, { type: { $exists: false } }];
+ } else {
+ filter.type = opts.type;
+ }
+
if (opts?.search) {
filter.text = { $regex: opts.search, $options: 'i' };
}
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index c23444417..5aacba693 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -165,6 +165,26 @@ export interface RequestDocument {
deletedAt?: Date; // Soft-delete timestamp (null/absent = active)
taskPromptId?: string; // Materialized UUIDv5 of scenario.task (FK → TaskPromptDocument._id)
promptFeatureExtractionId?: string; // @deprecated — use TaskPromptDocument.features via taskPromptId instead
+ /**
+ * Optional grouping id tying together all requests of one experiment
+ * (e.g. a single GEPA optimization run: the seed request plus every
+ * candidate-evaluation request). Free-form, supplied by the client.
+ */
+ experimentId?: string;
+ /**
+ * FK → TaskPromptDocument._id of an AGENTS.md-typed prompt to deliver into
+ * the agent's workspace for this run. When set, the worker writes the
+ * resolved content to `/AGENTS.md` before the run starts.
+ */
+ agentsMdPromptId?: string;
+ /**
+ * Lineage edges for the AGENTS.md candidate: the parent AGENTS.md prompt ids
+ * this candidate was derived from. Empty/absent = root (seed); one entry =
+ * reflective mutation; two entries = merge (GEPA's lineage is a multi-parent
+ * DAG). Recorded on the request so the experiment's full DAG can be
+ * reconstructed by querying its requests.
+ */
+ agentsMdParentIds?: string[];
mcpServers?: string[]; // MCP server slugs selected for this run
skillRevisions?: string[]; // Skill revision refs (e.g. "vercel-labs/agent-skills/my-skill@a1b2c3d")
extensions?: string[]; // VS Code extension IDs selected for this run (e.g. "ms-python.python")
@@ -406,7 +426,7 @@ export interface QueueProcessorConfig extends BaseQueueProcessorConfig {
// --- Runs grouping types (shared between API and portal) ---
-export type GroupByKey = "none" | "task" | "submissionId" | "profile";
+export type GroupByKey = "none" | "task" | "submissionId" | "profile" | "experiment";
export interface AggregateStats {
min: number;
@@ -610,10 +630,28 @@ export interface InsightDocument {
// Task prompts are immutable, content-addressed entities identified by UUIDv5(text, namespace).
// Runs reference task prompts via a materialized taskPromptId derived from scenario.task.
+/** Prompt type. `task` (default) = a task/scenario prompt; `agents.md` = an
+ * AGENTS.md system-style prompt delivered into the agent workspace. */
+export type TaskPromptType = 'task' | 'agents.md';
+
/** Task prompt document stored in MongoDB. Immutable — text cannot be changed after creation. */
export interface TaskPromptDocument {
_id: string; // UUIDv5 of text.trim() (content-addressed)
- text: string; // Full task prompt text
+ /**
+ * Inline prompt body. Present when the body is small enough to store in
+ * Mongo (≤ PROMPT_INLINE_MAX_BYTES). Mutually exclusive with
+ * `contentBlobUrl` — exactly one is set. Optional so large bodies can live
+ * in blob storage instead.
+ */
+ text?: string;
+ /**
+ * Blob reference to the prompt body when it exceeds the inline size
+ * threshold. Mutually exclusive with `text`. The body is fetched via
+ * `resolvePromptText` server-side.
+ */
+ contentBlobUrl?: string;
+ /** Prompt type. Absent ⇒ `'task'` (backward compatible). */
+ type?: TaskPromptType;
features?: PromptFeatureResult[]; // Detected prompt features
featuresExtractedAt?: Date; // When features were last extracted
createdAt: Date;
@@ -628,6 +666,12 @@ export interface TaskPromptDocument {
export interface PromptFeatureConfig {
id: string;
prompt: string;
+ /**
+ * Which prompt type this feature applies to. Absent ⇒ `'task'` (backward
+ * compatible). Feature extraction only considers features whose `type`
+ * matches the prompt being extracted.
+ */
+ type?: TaskPromptType;
}
/** Prompt feature document stored in MongoDB (extends PromptFeatureConfig with DB metadata) */
From 71c891a56c2bf0df16374bf5644d4240193ef1ae Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:01:20 -0700
Subject: [PATCH 002/287] feat(api): experiment grouping + AGENTS.md on
requests, typed task prompts
Wire the shared typed-prompt and experiment capabilities into the API:
- POST /api/v1/requests accepts experimentId, agentsMd, agentsMdParentIds;
agentsMd is resolved via findOrCreate(type: 'agents.md') and stored as
agentsMdPromptId across all construction paths (variation, count>1,
single); retry/resubmit/import preserve lineage.
- GET /api/v1/requests: ?experimentId= filter + groupBy=experiment.
- Task prompts: ?type= list filter, create with type, new
GET /:id/content (resolvePromptText), extract-features scoped by prompt
type. TaskPromptStore constructed with blobStorage.
- grouping.ts buildGroupingPipeline supports 'experiment'.
- Tests: typed task prompts, /:id/content, experiment/AGENTS.md request
creation + lineage, experiment filter/group. OpenAPI snapshot updated.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../openapi-snapshot.test.ts.snap | 107 +++++++++-
apps/api/src/endpoints.test.ts | 182 ++++++++++++++++++
apps/api/src/grouping.ts | 6 +-
apps/api/src/index.ts | 9 +-
apps/api/src/routes/requests/index.ts | 52 ++++-
apps/api/src/routes/task-prompts.ts | 59 +++++-
apps/api/src/test-helpers.ts | 1 +
7 files changed, 399 insertions(+), 17 deletions(-)
diff --git a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
index 7912955e3..07c23708b 100644
--- a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
+++ b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
@@ -664,6 +664,18 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
},
"CreateRequestInput": {
"properties": {
+ "agentsMd": {
+ "type": "string",
+ },
+ "agentsMdParentIds": {
+ "items": {
+ "type": "string",
+ },
+ "type": "array",
+ },
+ "experimentId": {
+ "type": "string",
+ },
"extensions": {
"items": {
"type": "string",
@@ -755,6 +767,9 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"text": {
"type": "string",
},
+ "type": {
+ "$ref": "#/components/schemas/TaskPromptType",
+ },
},
"required": [
"text",
@@ -2087,6 +2102,15 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"agentVersion": {
"type": "string",
},
+ "agentsMdParentIds": {
+ "items": {
+ "type": "string",
+ },
+ "type": "array",
+ },
+ "agentsMdPromptId": {
+ "type": "string",
+ },
"createdAt": {
"format": "date-time",
"type": [
@@ -2101,6 +2125,9 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"null",
],
},
+ "experimentId": {
+ "type": "string",
+ },
"extensions": {
"items": {
"type": "string",
@@ -2622,6 +2649,9 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"_id": {
"type": "string",
},
+ "contentBlobUrl": {
+ "type": "string",
+ },
"createdAt": {
"format": "date-time",
"type": [
@@ -2652,14 +2682,23 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"text": {
"type": "string",
},
+ "type": {
+ "$ref": "#/components/schemas/TaskPromptType",
+ },
},
"required": [
"_id",
- "text",
"createdAt",
],
"type": "object",
},
+ "TaskPromptType": {
+ "enum": [
+ "task",
+ "agents.md",
+ ],
+ "type": "string",
+ },
"TokenUsage": {
"properties": {
"completionTokens": {
@@ -6588,6 +6627,14 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"type": "string",
},
},
+ {
+ "in": "query",
+ "name": "experimentId",
+ "required": false,
+ "schema": {
+ "type": "string",
+ },
+ },
{
"in": "query",
"name": "status",
@@ -6625,6 +6672,7 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"task",
"submissionId",
"profile",
+ "experiment",
],
"type": "string",
},
@@ -8541,6 +8589,18 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"type": "string",
},
},
+ {
+ "in": "query",
+ "name": "type",
+ "required": false,
+ "schema": {
+ "enum": [
+ "task",
+ "agents.md",
+ ],
+ "type": "string",
+ },
+ },
],
"responses": {
"200": {
@@ -8736,6 +8796,51 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
],
},
},
+ "/api/v1/task-prompts/{id}/content": {
+ "get": {
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "required": true,
+ "schema": {
+ "type": "string",
+ },
+ },
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "properties": {
+ "id": {
+ "type": "string",
+ },
+ "text": {
+ "type": "string",
+ },
+ },
+ "required": [
+ "id",
+ "text",
+ ],
+ "type": "object",
+ },
+ },
+ },
+ "description": "Success",
+ },
+ "404": {
+ "description": "Task prompt not found",
+ },
+ },
+ "summary": "Get resolved task prompt content",
+ "tags": [
+ "Task Prompts",
+ ],
+ },
+ },
"/api/v1/task-prompts/{id}/extract-features": {
"post": {
"parameters": [
diff --git a/apps/api/src/endpoints.test.ts b/apps/api/src/endpoints.test.ts
index 9a8422d9d..ad2cd5dce 100644
--- a/apps/api/src/endpoints.test.ts
+++ b/apps/api/src/endpoints.test.ts
@@ -502,6 +502,33 @@ describe("API Endpoints", () => {
expect(res.body.data[0]).toHaveProperty("key", "sub-1");
});
+ it("returns grouped results when groupBy=experiment", async () => {
+ const groupedDocs = [
+ { key: "exp-1", label: "exp-1", aggregates: { count: 4, turns: null, duration: null, promptTokens: null, completionTokens: null }, uniform: {} },
+ ];
+ (mocks.collection.aggregate as any)
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([{ _id: "exp-1" }]) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue(groupedDocs) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) });
+
+ const res = await request(app).get("/api/v1/requests?groupBy=experiment");
+ expect(res.status).toBe(200);
+ expect(res.body.data[0]).toHaveProperty("key", "exp-1");
+ });
+
+ it("filters by experimentId", async () => {
+ (mocks.collection.find as any).mockReturnValue({
+ sort: vi.fn().mockReturnValue({
+ limit: vi.fn().mockReturnValue({ toArray: vi.fn().mockResolvedValue([]) }),
+ }),
+ });
+
+ await request(app).get("/api/v1/requests?experimentId=exp-42");
+ const filter = (mocks.collection.find as any).mock.calls[0][0];
+ expect(filter).toHaveProperty("experimentId", "exp-42");
+ });
+
it("calls aggregate pipeline when groupBy is provided", async () => {
(mocks.collection.aggregate as any)
.mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) }); // keys (empty)
@@ -974,6 +1001,62 @@ describe("API Endpoints", () => {
});
});
+ // ===================================================================
+ // Typed task prompts (task | agents.md) + content resolution
+ // ===================================================================
+
+ describe("Typed task prompts", () => {
+ it("passes ?type=agents.md through to the store getAll filter", async () => {
+ (mocks.taskPromptStore as any).getAll.mockResolvedValue({ items: [], total: 0 });
+
+ const res = await request(app).get("/api/v1/task-prompts?type=agents.md");
+ expect(res.status).toBe(200);
+ const arg = (mocks.taskPromptStore.getAll as any).mock.calls[0][0];
+ expect(arg).toHaveProperty("type", "agents.md");
+ });
+
+ it("creates a prompt with type=agents.md", async () => {
+ (mocks.taskPromptStore as any).findOrCreate.mockResolvedValue({
+ _id: "agents-1",
+ type: "agents.md",
+ text: "# AGENTS\nBe concise.",
+ createdAt: new Date(),
+ });
+
+ const res = await request(app)
+ .post("/api/v1/task-prompts")
+ .send({ text: "# AGENTS\nBe concise.", type: "agents.md" });
+
+ expect(res.status).toBe(201);
+ expect(res.body).toHaveProperty("type", "agents.md");
+ const arg = (mocks.taskPromptStore.findOrCreate as any).mock.calls[0];
+ expect(arg[0]).toBe("# AGENTS\nBe concise.");
+ expect(arg[1]).toHaveProperty("type", "agents.md");
+ });
+
+ it("GET /:id/content resolves the prompt body via resolvePromptText", async () => {
+ (mocks.taskPromptStore as any).get.mockResolvedValue({
+ _id: "agents-1",
+ type: "agents.md",
+ contentBlobUrl: "https://blob/prompts/agents-1.txt",
+ createdAt: new Date(),
+ });
+ (mocks.taskPromptStore as any).resolvePromptText.mockResolvedValue("resolved body");
+
+ const res = await request(app).get("/api/v1/task-prompts/agents-1/content");
+ expect(res.status).toBe(200);
+ expect(res.body).toEqual({ id: "agents-1", text: "resolved body" });
+ expect(mocks.taskPromptStore.resolvePromptText).toHaveBeenCalled();
+ });
+
+ it("GET /:id/content returns 404 when the prompt does not exist", async () => {
+ (mocks.taskPromptStore as any).get.mockResolvedValue(null);
+
+ const res = await request(app).get("/api/v1/task-prompts/missing/content");
+ expect(res.status).toBe(404);
+ });
+ });
+
// ===================================================================
// Submit with profile — server-side field resolution
// ===================================================================
@@ -1181,6 +1264,105 @@ describe("API Endpoints", () => {
});
});
+ // ===================================================================
+ // Experiment grouping + AGENTS.md on request creation
+ // ===================================================================
+
+ describe("POST /api/v1/requests?worker=... (experiment + AGENTS.md)", () => {
+ const setupCopilotAgent = () => {
+ (mocks.agentCollection.findOne as any).mockResolvedValue({
+ _id: "coder-acp-copilot",
+ versions: [{ agentVersion: "v1", status: "active", queueName: "queue-coder-acp-copilot", createdAt: new Date() }],
+ supportedModels: ["claude-haiku-4.5"],
+ });
+ };
+
+ it("persists experimentId on the request document", async () => {
+ setupCopilotAgent();
+
+ const res = await request(app)
+ .post("/api/v1/requests?worker=coder-acp-copilot")
+ .send({
+ scenario: { task: "Build something", criteria: ["works"] },
+ model: "claude-haiku-4.5",
+ experimentId: "exp-123",
+ });
+
+ expect(res.status).toBe(201);
+ const doc = (mocks.collection.insertOne as any).mock.calls[0][0];
+ expect(doc).toHaveProperty("experimentId", "exp-123");
+ });
+
+ it("resolves agentsMd via findOrCreate(agents.md) and stores agentsMdPromptId", async () => {
+ setupCopilotAgent();
+ (mocks.taskPromptStore as any).findOrCreate.mockResolvedValue({
+ _id: "agents-xyz",
+ type: "agents.md",
+ text: "# AGENTS\nBe terse.",
+ createdAt: new Date(),
+ });
+
+ const res = await request(app)
+ .post("/api/v1/requests?worker=coder-acp-copilot")
+ .send({
+ scenario: { task: "Build something", criteria: ["works"] },
+ model: "claude-haiku-4.5",
+ experimentId: "exp-123",
+ agentsMd: "# AGENTS\nBe terse.",
+ });
+
+ expect(res.status).toBe(201);
+ const foc = (mocks.taskPromptStore.findOrCreate as any).mock.calls.find(
+ (c: any[]) => c[1] && c[1].type === "agents.md"
+ );
+ expect(foc).toBeDefined();
+ expect(foc[0]).toBe("# AGENTS\nBe terse.");
+ const doc = (mocks.collection.insertOne as any).mock.calls[0][0];
+ expect(doc).toHaveProperty("agentsMdPromptId", "agents-xyz");
+ });
+
+ it("persists agentsMdParentIds lineage on the request", async () => {
+ setupCopilotAgent();
+ (mocks.taskPromptStore as any).findOrCreate.mockResolvedValue({
+ _id: "agents-child",
+ type: "agents.md",
+ text: "child",
+ createdAt: new Date(),
+ });
+
+ const res = await request(app)
+ .post("/api/v1/requests?worker=coder-acp-copilot")
+ .send({
+ scenario: { task: "Build something", criteria: ["works"] },
+ model: "claude-haiku-4.5",
+ experimentId: "exp-123",
+ agentsMd: "child",
+ agentsMdParentIds: ["agents-p1", "agents-p2"],
+ });
+
+ expect(res.status).toBe(201);
+ const doc = (mocks.collection.insertOne as any).mock.calls[0][0];
+ expect(doc).toHaveProperty("agentsMdParentIds", ["agents-p1", "agents-p2"]);
+ });
+
+ it("omits experiment fields when not provided", async () => {
+ setupCopilotAgent();
+
+ const res = await request(app)
+ .post("/api/v1/requests?worker=coder-acp-copilot")
+ .send({
+ scenario: { task: "Build something", criteria: ["works"] },
+ model: "claude-haiku-4.5",
+ });
+
+ expect(res.status).toBe(201);
+ const doc = (mocks.collection.insertOne as any).mock.calls[0][0];
+ expect(doc.experimentId).toBeUndefined();
+ expect(doc.agentsMdPromptId).toBeUndefined();
+ expect(doc.agentsMdParentIds).toBeUndefined();
+ });
+ });
+
// ===================================================================
// Bulk resubmit
// ===================================================================
diff --git a/apps/api/src/grouping.ts b/apps/api/src/grouping.ts
index 11e7c4a36..430e9e302 100644
--- a/apps/api/src/grouping.ts
+++ b/apps/api/src/grouping.ts
@@ -12,12 +12,12 @@ import type { GroupByKey, RunGroup, AggregateStats, GroupUniformValues } from "s
* The pipeline is appended after a $match stage with the caller's filter.
*/
export function buildGroupingPipeline(
- groupBy: "task" | "submissionId" | "profile",
+ groupBy: "task" | "submissionId" | "profile" | "experiment",
): Document[] {
const groupField =
- groupBy === "task" ? "$taskPromptId" : groupBy === "profile" ? "$profileId" : "$submissionId";
+ groupBy === "task" ? "$taskPromptId" : groupBy === "profile" ? "$profileId" : groupBy === "experiment" ? "$experimentId" : "$submissionId";
const fallbackGroupField =
- groupBy === "task" ? "$scenario.task" : groupBy === "profile" ? { $literal: "no-profile" } : { $literal: "no-submission" };
+ groupBy === "task" ? "$scenario.task" : groupBy === "profile" ? { $literal: "no-profile" } : groupBy === "experiment" ? { $literal: "no-experiment" } : { $literal: "no-submission" };
return [
// 1. Compute per-run derived values
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 6c0877b70..7daf0ab61 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -124,7 +124,10 @@ async function initializeClients(): Promise {
mcpServerCollection = db.collection("mcp-servers");
insightsCollection = db.collection("insights");
taskPromptCollection = db.collection("task-prompts");
- taskPromptStore = new TaskPromptStore(taskPromptCollection);
+ // Blob storage is also (re)assigned below for logs/snapshots; construct an
+ // instance here so the task-prompt store can offload over-threshold bodies.
+ blobStorage = new BlobStorage({ storageAccountName, storageConnectionString });
+ taskPromptStore = new TaskPromptStore(taskPromptCollection, blobStorage);
featureFlagCollection = db.collection("feature-flags");
reportTemplateCollection = db.collection("report-templates");
skillCollection = db.collection("skills");
@@ -201,7 +204,9 @@ async function initializeClients(): Promise {
console.log(`Initialized Queue clients for workers: ${Array.from(queueClients.keys()).join(", ")}, report`);
- // Initialize blob storage (used for log persistence and snapshots)
+ // Initialize blob storage (used for log persistence and snapshots).
+ // Already constructed above for the task-prompt store; reassign to keep the
+ // original initialization order/comment intact.
blobStorage = new BlobStorage({ storageAccountName, storageConnectionString });
// Initialize Redis-backed heartbeat store. Workers write per-run
diff --git a/apps/api/src/routes/requests/index.ts b/apps/api/src/routes/requests/index.ts
index cd3fa56f1..6a119bf1c 100644
--- a/apps/api/src/routes/requests/index.ts
+++ b/apps/api/src/routes/requests/index.ts
@@ -74,9 +74,38 @@ apiRoute(ctx.app, ctx.registry, {
response: z.union([RequestResponseSchema, z.array(RequestResponseSchema)]),
successStatus: 201,
handler: async (req, res) => {
- const { scenario: scenarioObj, persona: personaObj, maxIterations, personaInstructions, count = 1, promptFeatureExtractionId, model: requestedModel, reasoningEffort: requestedReasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion: requestedAgentVersion, profileId: requestedProfileSpec, profileVariations, priority: requestedPriority } = req.body;
+ const { scenario: scenarioObj, persona: personaObj, maxIterations, personaInstructions, count = 1, promptFeatureExtractionId, model: requestedModel, reasoningEffort: requestedReasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion: requestedAgentVersion, profileId: requestedProfileSpec, profileVariations, priority: requestedPriority, experimentId: requestedExperimentId, agentsMd: requestedAgentsMd, agentsMdParentIds: requestedAgentsMdParentIds } = req.body;
let worker = req.query.worker as string | undefined;
+ // Experiment grouping + AGENTS.md lineage (used by the GEPA optimizer and
+ // any caller that wants to group requests / attach an AGENTS.md body).
+ const experimentId =
+ typeof requestedExperimentId === "string" && requestedExperimentId.trim()
+ ? requestedExperimentId
+ : undefined;
+ const agentsMdText =
+ typeof requestedAgentsMd === "string" && requestedAgentsMd.trim()
+ ? requestedAgentsMd
+ : undefined;
+ const agentsMdParentIds = Array.isArray(requestedAgentsMdParentIds)
+ ? requestedAgentsMdParentIds.filter((x: unknown): x is string => typeof x === "string")
+ : undefined;
+
+ // Resolve the AGENTS.md body to an `agents.md`-typed prompt id (idempotent,
+ // content-addressed; large bodies are offloaded to blob by the store).
+ const resolveAgentsMdPromptId = async (): Promise => {
+ if (!agentsMdText) return undefined;
+ const p = await ctx.taskPromptStore.findOrCreate(agentsMdText, { type: "agents.md" });
+ return p._id;
+ };
+
+ // Common request fields for experiment grouping / AGENTS.md lineage.
+ const buildExperimentFields = (agentsMdPromptId?: string) => ({
+ ...(experimentId ? { experimentId } : {}),
+ ...(agentsMdPromptId ? { agentsMdPromptId } : {}),
+ ...(agentsMdParentIds && agentsMdParentIds.length ? { agentsMdParentIds } : {}),
+ });
+
type VariationInput = {
profileId: string;
profileVersion?: number;
@@ -343,6 +372,8 @@ apiRoute(ctx.app, ctx.registry, {
const allNewIds: string[] = [];
const newDocs: RequestDocument[] = [];
const variationResults: Array<{ profileId: string; label?: string; ids: string[] }> = [];
+ const agentsMdPromptId = await resolveAgentsMdPromptId();
+ const experimentFields = buildExperimentFields(agentsMdPromptId);
for (const r of resolved) {
const newIds: string[] = [];
@@ -374,6 +405,7 @@ apiRoute(ctx.app, ctx.registry, {
profileId: r.profile._id,
profileVersionId: r.profileVersion._id,
submissionId,
+ ...experimentFields,
run: { _id: runId, attemptNumber: 1, status: "pending", logsUrl: ctx.blobStorage.getLogsBlobUrl(`${requestId}/runs/${runId}/run.jsonl`) },
};
newDocs.push(requestDoc);
@@ -719,6 +751,10 @@ apiRoute(ctx.app, ctx.registry, {
const taskPrompt = await ctx.taskPromptStore.findOrCreate(scenario.task);
const taskPromptId = taskPrompt._id;
+ // Resolve AGENTS.md lineage once for this submission (shared across count>1).
+ const agentsMdPromptId = await resolveAgentsMdPromptId();
+ const experimentFields = buildExperimentFields(agentsMdPromptId);
+
// Generate a submission ID to group all runs from this request
const submissionId = uuidv4();
@@ -752,6 +788,7 @@ apiRoute(ctx.app, ctx.registry, {
...(profileId ? { profileId } : {}),
...(profileVersionId ? { profileVersionId } : {}),
submissionId,
+ ...experimentFields,
// Mint a distinct run id for the first attempt. Blob artifacts
// are scoped under `{requestId}/runs/{runId}/...` so retries
// never overwrite a previous attempt's blobs.
@@ -810,6 +847,7 @@ apiRoute(ctx.app, ctx.registry, {
...(profileId ? { profileId } : {}),
...(profileVersionId ? { profileVersionId } : {}),
submissionId,
+ ...experimentFields,
// Mint a distinct run id for the first attempt. Blob artifacts
// are scoped under `{requestId}/runs/{runId}/...` so retries
// never overwrite a previous attempt's blobs.
@@ -887,6 +925,7 @@ apiRoute(ctx.app, ctx.registry, {
const criteriaFilter = req.query.criteria as string;
const submissionIdFilter = req.query.submissionId as string;
const profileIdFilter = req.query.profileId as string;
+ const experimentIdFilter = req.query.experimentId as string;
const statusFilter = req.query.status as string;
const outcomeFilter = req.query.outcome as string;
const turnsFilterRaw = req.query.turns as string | undefined;
@@ -894,7 +933,7 @@ apiRoute(ctx.app, ctx.registry, {
const maxIterationsFilterRaw = req.query.maxIterations as string | undefined;
const maxIterationsOpFilter = (req.query.maxIterationsOp as string | undefined) ?? "eq";
const includeDeleted = req.query.includeDeleted === "true";
- const groupByParam = req.query.groupBy as "task" | "submissionId" | "profile" | undefined;
+ const groupByParam = req.query.groupBy as "task" | "submissionId" | "profile" | "experiment" | undefined;
const limit = Math.min(Math.max(Number(req.query.limit) || 10, 1), 100);
const afterParam = req.query.after as string | undefined;
const beforeParam = req.query.before as string | undefined;
@@ -926,6 +965,9 @@ apiRoute(ctx.app, ctx.registry, {
if (profileIdFilter) {
filter.profileId = profileIdFilter;
}
+ if (experimentIdFilter) {
+ filter.experimentId = experimentIdFilter;
+ }
if (submissionIdFilter) {
// Prefix-based matching: allow filtering by partial submission ID
filter.submissionId = { $regex: `^${submissionIdFilter.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}` };
@@ -982,7 +1024,7 @@ apiRoute(ctx.app, ctx.registry, {
// Grouped mode: paginated RunGroup[] via two-phase aggregation
if (groupByParam) {
- const groupByField = groupByParam === "task" ? "taskPromptId" : groupByParam === "profile" ? "profileId" : "submissionId";
+ const groupByField = groupByParam === "task" ? "taskPromptId" : groupByParam === "profile" ? "profileId" : groupByParam === "experiment" ? "experimentId" : "submissionId";
const groupByAggField = `$${groupByField}`;
// Decode group cursor
@@ -1445,6 +1487,10 @@ apiRoute(ctx.app, ctx.registry, {
...(original.taskPromptId ? { taskPromptId: original.taskPromptId } : {}),
...(effectiveProfileId ? { profileId: effectiveProfileId } : {}),
...(effectiveProfileVersionId ? { profileVersionId: effectiveProfileVersionId } : {}),
+ // Preserve experiment grouping + AGENTS.md lineage across re-submits.
+ ...(original.experimentId ? { experimentId: original.experimentId } : {}),
+ ...(original.agentsMdPromptId ? { agentsMdPromptId: original.agentsMdPromptId } : {}),
+ ...(original.agentsMdParentIds && original.agentsMdParentIds.length > 0 ? { agentsMdParentIds: original.agentsMdParentIds } : {}),
submissionId,
// Bulk re-submit creates a brand-new request — mint a distinct
// run id for the first attempt so blob artifacts live under
diff --git a/apps/api/src/routes/task-prompts.ts b/apps/api/src/routes/task-prompts.ts
index ec5988a50..e64feaded 100644
--- a/apps/api/src/routes/task-prompts.ts
+++ b/apps/api/src/routes/task-prompts.ts
@@ -46,7 +46,10 @@ apiRoute(ctx.app, ctx.registry, {
// Fetch recent task prompts as context (avoid duplicates)
const recentPrompts = await ctx.taskPromptCollection
- .find({ deletedAt: { $exists: false } })
+ .find({
+ deletedAt: { $exists: false },
+ $or: [{ type: "task" }, { type: { $exists: false } }],
+ })
.sort({ createdAt: -1 })
.limit(20)
.project({ text: 1, _id: 0 })
@@ -75,6 +78,7 @@ apiRoute(ctx.app, ctx.registry, {
limit: z.coerce.number().optional(),
offset: z.coerce.number().optional(),
search: z.string().optional(),
+ type: z.enum(["task", "agents.md"]).optional(),
}),
response: z.object({
items: z.array(TaskPromptResponseSchema),
@@ -86,8 +90,9 @@ apiRoute(ctx.app, ctx.registry, {
const limit = req.query.limit ?? 50;
const offset = req.query.offset ?? 0;
const search = req.query.search;
+ const type = req.query.type;
- const { items, total } = await ctx.taskPromptStore.getAll({ limit, offset, search });
+ const { items, total } = await ctx.taskPromptStore.getAll({ limit, offset, search, type });
res.json({ items, total, limit, offset });
},
});
@@ -114,7 +119,33 @@ apiRoute(ctx.app, ctx.registry, {
},
});
-// POST /api/v1/task-prompts — create (or find existing) task prompt. Idempotent.
+// GET /api/v1/task-prompts/:id/content — get the resolved plain-text body
+// (inline or downloaded from blob). Used by workers to fetch AGENTS.md / task text.
+apiRoute(ctx.app, ctx.registry, {
+ method: "get",
+ path: "/api/v1/task-prompts/:id/content",
+ tags: ["Task Prompts"],
+ summary: "Get resolved task prompt content",
+ params: z.object({ id: z.string() }),
+ response: z.object({ id: z.string(), text: z.string() }),
+ errorResponses: {
+ 404: { description: "Task prompt not found" },
+ },
+ handler: async (req, res, next) => {
+ try {
+ const { id } = req.params;
+ const taskPrompt = await ctx.taskPromptStore.get(id);
+ if (!taskPrompt) {
+ res.status(404).json({ error: "Task prompt not found" });
+ return;
+ }
+ const text = await ctx.taskPromptStore.resolvePromptText(taskPrompt);
+ res.json({ id, text });
+ } catch (err) {
+ next(err);
+ }
+ },
+});
apiRoute(ctx.app, ctx.registry, {
method: "post",
path: "/api/v1/task-prompts",
@@ -126,14 +157,18 @@ apiRoute(ctx.app, ctx.registry, {
400: { description: "Empty text string" },
},
handler: async (req, res, next) => {
- const { text } = req.body;
+ const { text, type } = req.body;
if (!text || typeof text !== "string" || !text.trim()) {
res.status(400).json({ error: "Body must contain a non-empty 'text' string" });
return;
}
- const taskPrompt = await ctx.taskPromptStore.findOrCreate(text);
- res.status(201).json(taskPrompt);
+ try {
+ const taskPrompt = await ctx.taskPromptStore.findOrCreate(text, { type });
+ res.status(201).json(taskPrompt);
+ } catch (err) {
+ next(err);
+ }
},
});
@@ -211,13 +246,21 @@ apiRoute(ctx.app, ctx.registry, {
return;
}
+ // Scope candidate features to the prompt's own type: task prompts get task
+ // features; AGENTS.md prompts get agents.md features. Absent type ⇒ task.
+ const promptType = taskPrompt.type ?? "task";
+ const typeFilter =
+ promptType === "task"
+ ? { $or: [{ type: "task" }, { type: { $exists: false } }] }
+ : { type: promptType };
const allFeatures = await ctx.promptFeatureCollection
- .find({ deletedAt: { $exists: false } })
+ .find({ deletedAt: { $exists: false }, ...typeFilter })
.toArray();
const featureConfigs = allFeatures.map(f => ({ id: f.id, prompt: f.prompt }));
try {
- const { results, suggestedFeatures } = await extractPromptFeatures(taskPrompt.text, featureConfigs, model);
+ const promptText = await ctx.taskPromptStore.resolvePromptText(taskPrompt);
+ const { results, suggestedFeatures } = await extractPromptFeatures(promptText, featureConfigs, model);
// Store features on the task prompt entity
const updated = await ctx.taskPromptStore.attachFeatures(id, results);
diff --git a/apps/api/src/test-helpers.ts b/apps/api/src/test-helpers.ts
index 6230d6d02..a35282d41 100644
--- a/apps/api/src/test-helpers.ts
+++ b/apps/api/src/test-helpers.ts
@@ -119,6 +119,7 @@ export function createMockTaskPromptStore(): Record {
createdAt: new Date(),
}),
getAll: vi.fn().mockResolvedValue({ items: [], total: 0 }),
+ resolvePromptText: vi.fn().mockResolvedValue("mock task"),
delete: vi.fn().mockResolvedValue(undefined),
attachFeatures: vi.fn().mockResolvedValue({
_id: "tp-mock-id",
From c6fadeb3e43b3b6ef929e07ca681b2ec1a60e4a5 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:06:23 -0700
Subject: [PATCH 003/287] feat(prompt-features): type prompt features (task |
agents.md)
Features are now scoped by prompt type so a feature only applies to prompts
of its own type:
- PromptFeatureStore: getAll({type}), create({type}), seed carries type.
- Schemas: CreatePromptFeatureInput + PromptFeatureResponse add optional type.
- API: GET /prompt-features?type= filter (task includes legacy untyped),
create persists type, seed $setOnInsert carries type, extract-from-text
scopes candidate features by ?type=. task-prompts extract-features already
scopes by the prompt's own type.
- FS provider loads optional `type` from feature YAML.
- Tests: 6 store tests + API filter/create tests. OpenAPI snapshot updated.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../openapi-snapshot.test.ts.snap | 33 ++++++
apps/api/src/endpoints.test.ts | 38 ++++++
apps/api/src/routes/prompt-features.ts | 34 +++++-
apps/api/src/routes/task-prompts.ts | 2 +-
.../prompt-feature-provider-fs.ts | 1 +
.../prompt-feature-store.test.ts | 112 ++++++++++++++++++
.../prompt-features/prompt-feature-store.ts | 23 +++-
packages/shared/src/schemas/prompt-feature.ts | 2 +
8 files changed, 233 insertions(+), 12 deletions(-)
create mode 100644 packages/shared/src/prompt-features/prompt-feature-store.test.ts
diff --git a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
index 07c23708b..f07f14183 100644
--- a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
+++ b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
@@ -606,6 +606,13 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"prompt": {
"type": "string",
},
+ "type": {
+ "enum": [
+ "task",
+ "agents.md",
+ ],
+ "type": "string",
+ },
},
"required": [
"id",
@@ -1731,6 +1738,13 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"prompt": {
"type": "string",
},
+ "type": {
+ "enum": [
+ "task",
+ "agents.md",
+ ],
+ "type": "string",
+ },
"updatedAt": {
"format": "date-time",
"type": [
@@ -5555,6 +5569,18 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"type": "string",
},
},
+ {
+ "in": "query",
+ "name": "type",
+ "required": false,
+ "schema": {
+ "enum": [
+ "task",
+ "agents.md",
+ ],
+ "type": "string",
+ },
+ },
],
"responses": {
"200": {
@@ -5623,6 +5649,13 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"text": {
"type": "string",
},
+ "type": {
+ "enum": [
+ "task",
+ "agents.md",
+ ],
+ "type": "string",
+ },
},
"required": [
"text",
diff --git a/apps/api/src/endpoints.test.ts b/apps/api/src/endpoints.test.ts
index ad2cd5dce..cbf9b440a 100644
--- a/apps/api/src/endpoints.test.ts
+++ b/apps/api/src/endpoints.test.ts
@@ -914,6 +914,44 @@ describe("API Endpoints", () => {
expect(res.status).toBe(400);
});
+
+ it("persists type=agents.md when creating a feature", async () => {
+ (mocks.promptFeatureCollection.findOne as any).mockResolvedValue(null);
+
+ const res = await request(app)
+ .post("/api/v1/prompt-features")
+ .send({ id: "agents_feat", prompt: "Does AGENTS.md mention tests?", type: "agents.md" });
+
+ expect(res.status).toBe(201);
+ expect(res.body).toHaveProperty("type", "agents.md");
+ const doc = (mocks.promptFeatureCollection.insertOne as any).mock.calls[0][0];
+ expect(doc).toHaveProperty("type", "agents.md");
+ });
+ });
+
+ describe("GET /api/v1/prompt-features?type=", () => {
+ it("scopes the query to agents.md features", async () => {
+ (mocks.promptFeatureCollection.find as any).mockReturnValue({
+ toArray: vi.fn().mockResolvedValue([]),
+ });
+
+ const res = await request(app).get("/api/v1/prompt-features?type=agents.md");
+ expect(res.status).toBe(200);
+ const filter = (mocks.promptFeatureCollection.find as any).mock.calls[0][0];
+ expect(JSON.stringify(filter)).toContain("agents.md");
+ });
+
+ it("treats task type as including legacy untyped features", async () => {
+ (mocks.promptFeatureCollection.find as any).mockReturnValue({
+ toArray: vi.fn().mockResolvedValue([]),
+ });
+
+ await request(app).get("/api/v1/prompt-features?type=task");
+ const filter = (mocks.promptFeatureCollection.find as any).mock.calls[0][0];
+ const json = JSON.stringify(filter);
+ expect(json).toContain("$exists");
+ expect(json).toContain("task");
+ });
});
describe("GET /api/v1/prompt-features/:id", () => {
diff --git a/apps/api/src/routes/prompt-features.ts b/apps/api/src/routes/prompt-features.ts
index 6a462d23c..3fb51f743 100644
--- a/apps/api/src/routes/prompt-features.ts
+++ b/apps/api/src/routes/prompt-features.ts
@@ -110,6 +110,7 @@ apiRoute(ctx.app, ctx.registry, {
$setOnInsert: {
id: trimmedId,
prompt: config.prompt.trim(),
+ ...(config.type ? { type: config.type } : {}),
createdAt: new Date(),
},
},
@@ -134,6 +135,7 @@ apiRoute(ctx.app, ctx.registry, {
body: z.object({
text: z.string(),
model: z.string().optional(),
+ type: z.enum(["task", "agents.md"]).optional(),
}),
response: z.object({
features: z.array(PromptFeatureResultSchema),
@@ -145,7 +147,7 @@ apiRoute(ctx.app, ctx.registry, {
503: { description: "LLM not configured" },
},
handler: async (req, res, next) => {
- const { text, model } = req.body;
+ const { text, model, type } = req.body;
if (!text || typeof text !== "string" || !text.trim()) {
res.status(400).json({ error: "Body must contain a non-empty 'text' string" });
return;
@@ -156,8 +158,15 @@ apiRoute(ctx.app, ctx.registry, {
return;
}
+ // Scope candidate features to the requested type (default = task,
+ // including legacy features with no `type`).
+ const promptType = type ?? "task";
+ const typeFilter: Record =
+ promptType === "task"
+ ? { $or: [{ type: "task" }, { type: { $exists: false } }] }
+ : { type: promptType };
const allFeatures = await ctx.promptFeatureCollection
- .find({ deletedAt: { $exists: false } })
+ .find({ deletedAt: { $exists: false }, ...typeFilter })
.toArray();
const featureConfigs = allFeatures.map(f => ({ id: f.id, prompt: f.prompt }));
@@ -185,16 +194,30 @@ apiRoute(ctx.app, ctx.registry, {
path: "/api/v1/prompt-features",
tags: ["Prompt Features"],
summary: "List features",
- query: z.object({ q: z.string().optional() }),
+ query: z.object({ q: z.string().optional(), type: z.enum(["task", "agents.md"]).optional() }),
response: z.array(PromptFeatureResponseSchema),
handler: async (req, res) => {
const q = req.query.q;
+ const type = req.query.type;
const filter: Record = { deletedAt: { $exists: false } };
+ if (type) {
+ // Absent `type` is treated as 'task' for backward compatibility.
+ filter.$and = [
+ type === "task"
+ ? { $or: [{ type: "task" }, { type: { $exists: false } }] }
+ : { type },
+ ];
+ }
if (q) {
- filter.$or = [
+ const search = [
{ id: { $regex: q, $options: "i" } },
{ prompt: { $regex: q, $options: "i" } },
];
+ if (filter.$and) {
+ (filter.$and as unknown[]).push({ $or: search });
+ } else {
+ filter.$or = search;
+ }
}
const features = await ctx.promptFeatureCollection.find(filter).toArray();
features.sort((a, b) => a.id.localeCompare(b.id));
@@ -239,7 +262,7 @@ apiRoute(ctx.app, ctx.registry, {
409: { description: "Feature already exists" },
},
handler: async (req, res) => {
- const { id, prompt } = req.body;
+ const { id, prompt, type } = req.body;
if (!id || typeof id !== "string") {
res.status(400).json({ error: "id is required and must be a string" });
@@ -263,6 +286,7 @@ apiRoute(ctx.app, ctx.registry, {
const doc: PromptFeatureDocument = {
id,
prompt: prompt.trim(),
+ ...(type ? { type } : {}),
createdAt: new Date(),
};
diff --git a/apps/api/src/routes/task-prompts.ts b/apps/api/src/routes/task-prompts.ts
index e64feaded..ce5716fb7 100644
--- a/apps/api/src/routes/task-prompts.ts
+++ b/apps/api/src/routes/task-prompts.ts
@@ -249,7 +249,7 @@ apiRoute(ctx.app, ctx.registry, {
// Scope candidate features to the prompt's own type: task prompts get task
// features; AGENTS.md prompts get agents.md features. Absent type ⇒ task.
const promptType = taskPrompt.type ?? "task";
- const typeFilter =
+ const typeFilter: Record =
promptType === "task"
? { $or: [{ type: "task" }, { type: { $exists: false } }] }
: { type: promptType };
diff --git a/packages/shared/src/prompt-features/prompt-feature-provider-fs.ts b/packages/shared/src/prompt-features/prompt-feature-provider-fs.ts
index c76574ace..bf23767ff 100644
--- a/packages/shared/src/prompt-features/prompt-feature-provider-fs.ts
+++ b/packages/shared/src/prompt-features/prompt-feature-provider-fs.ts
@@ -50,6 +50,7 @@ export class FileSystemPromptFeatureProvider implements PromptFeatureProvider {
const feature: PromptFeatureConfig = {
id: data.id.trim(),
prompt: data.prompt.trim(),
+ ...(data.type === "task" || data.type === "agents.md" ? { type: data.type } : {}),
};
if (this.registry.has(feature.id)) {
diff --git a/packages/shared/src/prompt-features/prompt-feature-store.test.ts b/packages/shared/src/prompt-features/prompt-feature-store.test.ts
new file mode 100644
index 000000000..61010b8dd
--- /dev/null
+++ b/packages/shared/src/prompt-features/prompt-feature-store.test.ts
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, it, expect, beforeEach } from "vitest";
+import { PromptFeatureStore } from "./prompt-feature-store.js";
+import type { PromptFeatureDocument } from "../types/types.js";
+
+// ── Minimal in-memory collection ─────────────────────────────────────────────
+// Supports the subset of query operators the store uses: `id`, `deletedAt`
+// existence, and the `$or`/`type` existence filters for type scoping.
+
+function matchesType(doc: PromptFeatureDocument, clause: any): boolean {
+ if (clause.type !== undefined) {
+ if (typeof clause.type === "object" && clause.type.$exists === false) {
+ return doc.type === undefined;
+ }
+ return doc.type === clause.type;
+ }
+ return true;
+}
+
+function createMockCollection() {
+ const docs: PromptFeatureDocument[] = [];
+
+ return {
+ _docs: docs,
+ find(filter: any) {
+ let results = docs.filter((d) => {
+ if (filter.deletedAt && filter.deletedAt.$exists === false && d.deletedAt) return false;
+ if (filter.$or) {
+ if (!filter.$or.some((clause: any) => matchesType(d, clause))) return false;
+ }
+ return true;
+ });
+ return {
+ sort() { return this; },
+ toArray() { return Promise.resolve(results.map((d) => ({ ...d }))); },
+ };
+ },
+ findOne(filter: any) {
+ const doc = docs.find((d) => {
+ if (filter.id && d.id !== filter.id) return false;
+ if (filter.deletedAt && filter.deletedAt.$exists === false && d.deletedAt) return false;
+ return true;
+ });
+ return Promise.resolve(doc ? { ...doc } : null);
+ },
+ insertOne(doc: PromptFeatureDocument) {
+ docs.push({ ...doc });
+ return Promise.resolve({ insertedId: doc.id });
+ },
+ updateOne() { return Promise.resolve({ matchedCount: 1, modifiedCount: 1 }); },
+ };
+}
+
+describe("PromptFeatureStore type support", () => {
+ let store: PromptFeatureStore;
+ let collection: ReturnType;
+
+ beforeEach(() => {
+ collection = createMockCollection();
+ store = new PromptFeatureStore(collection as any);
+ });
+
+ it("create persists the type field when provided", async () => {
+ const doc = await store.create({ id: "agents_terse", prompt: "Be terse", type: "agents.md" });
+ expect(doc.type).toBe("agents.md");
+ expect(collection._docs[0].type).toBe("agents.md");
+ });
+
+ it("create omits type when not provided (backward compatible)", async () => {
+ const doc = await store.create({ id: "task_feat", prompt: "A task feature" });
+ expect(doc.type).toBeUndefined();
+ expect("type" in collection._docs[0]).toBe(false);
+ });
+
+ it("getAll({type: 'agents.md'}) returns only agents.md features", async () => {
+ await store.create({ id: "task_a", prompt: "p", type: "task" });
+ await store.create({ id: "legacy", prompt: "p" }); // no type → task
+ await store.create({ id: "agents_b", prompt: "p", type: "agents.md" });
+
+ const result = await store.getAll({ type: "agents.md" });
+ expect(result.map((f) => f.id)).toEqual(["agents_b"]);
+ });
+
+ it("getAll({type: 'task'}) includes legacy (untyped) features", async () => {
+ await store.create({ id: "task_a", prompt: "p", type: "task" });
+ await store.create({ id: "legacy", prompt: "p" });
+ await store.create({ id: "agents_b", prompt: "p", type: "agents.md" });
+
+ const result = await store.getAll({ type: "task" });
+ expect(result.map((f) => f.id).sort()).toEqual(["legacy", "task_a"]);
+ });
+
+ it("getAll() with no filter returns all features", async () => {
+ await store.create({ id: "task_a", prompt: "p" });
+ await store.create({ id: "agents_b", prompt: "p", type: "agents.md" });
+
+ const result = await store.getAll();
+ expect(result).toHaveLength(2);
+ });
+
+ it("seed carries the type field for new features", async () => {
+ const inserted = await store.seed([
+ { id: "agents_seed", prompt: "p", type: "agents.md" },
+ { id: "task_seed", prompt: "p" },
+ ]);
+ expect(inserted).toBe(2);
+ expect(collection._docs.find((d) => d.id === "agents_seed")?.type).toBe("agents.md");
+ expect("type" in (collection._docs.find((d) => d.id === "task_seed") as any)).toBe(false);
+ });
+});
diff --git a/packages/shared/src/prompt-features/prompt-feature-store.ts b/packages/shared/src/prompt-features/prompt-feature-store.ts
index 7fda78964..5965dddd8 100644
--- a/packages/shared/src/prompt-features/prompt-feature-store.ts
+++ b/packages/shared/src/prompt-features/prompt-feature-store.ts
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-import { Collection } from 'mongodb';
-import { PromptFeatureConfig, PromptFeatureDocument } from '../types/types.js';
+import { Collection, Filter } from 'mongodb';
+import { PromptFeatureConfig, PromptFeatureDocument, TaskPromptType } from '../types/types.js';
/**
* MongoDB-backed prompt feature store for CRUD operations on prompt feature definitions.
@@ -13,10 +13,18 @@ import { PromptFeatureConfig, PromptFeatureDocument } from '../types/types.js';
export class PromptFeatureStore {
constructor(private collection: Collection) {}
- /** List all active (non-deleted) prompt features */
- async getAll(): Promise {
+ /** List all active (non-deleted) prompt features, optionally filtered by type */
+ async getAll(opts?: { type?: TaskPromptType }): Promise {
+ const filter: Filter = { deletedAt: { $exists: false } };
+ if (opts?.type) {
+ // Absent `type` is treated as 'task' for backward compatibility.
+ filter.$or =
+ opts.type === "task"
+ ? [{ type: "task" }, { type: { $exists: false } }]
+ : [{ type: opts.type }];
+ }
return this.collection
- .find({ deletedAt: { $exists: false } })
+ .find(filter)
.sort({ id: 1 })
.toArray();
}
@@ -30,8 +38,9 @@ export class PromptFeatureStore {
async create(input: {
id: string;
prompt: string;
+ type?: TaskPromptType;
}): Promise {
- const { id, prompt } = input;
+ const { id, prompt, type } = input;
// Validate ID format
if (!/^[a-z0-9_-]+$/.test(id)) {
@@ -49,6 +58,7 @@ export class PromptFeatureStore {
const doc: PromptFeatureDocument = {
id,
prompt: prompt.trim(),
+ ...(type ? { type } : {}),
createdAt: new Date(),
};
@@ -102,6 +112,7 @@ export class PromptFeatureStore {
await this.collection.insertOne({
id: config.id,
prompt: config.prompt,
+ ...(config.type ? { type: config.type } : {}),
createdAt: new Date(),
} as any);
inserted++;
diff --git a/packages/shared/src/schemas/prompt-feature.ts b/packages/shared/src/schemas/prompt-feature.ts
index bf4d96ec3..ec2e294dd 100644
--- a/packages/shared/src/schemas/prompt-feature.ts
+++ b/packages/shared/src/schemas/prompt-feature.ts
@@ -10,6 +10,7 @@ export const CreatePromptFeatureInputSchema = z
.object({
id: z.string().regex(/^[a-z][a-z0-9_]*$/),
prompt: z.string(),
+ type: z.enum(["task", "agents.md"]).optional(),
})
.openapi("CreatePromptFeatureInput");
@@ -23,6 +24,7 @@ export const PromptFeatureResponseSchema = z
.object({
id: z.string(),
prompt: z.string(),
+ type: z.enum(["task", "agents.md"]).optional(),
createdAt: z.coerce.date(),
updatedAt: z.coerce.date().optional(),
deletedAt: z.coerce.date().optional(),
From 97b56d117a7c1e55f513372f6ed144c39866f6c5 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:10:31 -0700
Subject: [PATCH 004/287] feat(worker): deliver AGENTS.md into workspace before
run
Add AGENTS.md delivery to the shared queue processor so all workers honor
a request's optional agentsMdPromptId:
- New PromptClient.getText(id) REST client resolves a prompt's plain-text
body via GET /api/v1/task-prompts/:id/content (server downloads blob if
the doc is blob-backed), with clear errors on 404 / non-OK / missing text.
- writeAgentsMd() resolves the AGENTS.md text once before the run and writes
/AGENTS.md (constant for the whole run). No-ops when the request
has no agentsMdPromptId; throws (fails the run loudly via the base
processor's catch) when set but apiBaseUrl is missing or resolution fails.
Tests: PromptClient success/404/non-OK/missing-text; writeAgentsMd no-op,
missing-apiBaseUrl throw, and writes resolved body into a temp workspace.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../shared/src/queue/queue-processor.test.ts | 59 ++++++++++++++++++-
packages/shared/src/queue/queue-processor.ts | 45 ++++++++++++++
packages/shared/src/task-prompts/index.ts | 1 +
.../src/task-prompts/prompt-client.test.ts | 45 ++++++++++++++
.../shared/src/task-prompts/prompt-client.ts | 42 +++++++++++++
5 files changed, 191 insertions(+), 1 deletion(-)
create mode 100644 packages/shared/src/task-prompts/prompt-client.test.ts
create mode 100644 packages/shared/src/task-prompts/prompt-client.ts
diff --git a/packages/shared/src/queue/queue-processor.test.ts b/packages/shared/src/queue/queue-processor.test.ts
index fb2a1dc95..ba670abdf 100644
--- a/packages/shared/src/queue/queue-processor.test.ts
+++ b/packages/shared/src/queue/queue-processor.test.ts
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-import { describe, it, expect, vi } from "vitest";
+import { describe, it, expect, vi, afterEach } from "vitest";
import os from "node:os";
import { CodingAgentQueueProcessor } from "./queue-processor.js";
import type { QueueProcessorConfig, WorkerProcessor, WorkerResult } from "../types/types.js";
@@ -82,6 +82,63 @@ describe("CodingAgentQueueProcessor.getVersionFields", () => {
});
});
+// ─── AGENTS.md workspace delivery ────────────────────────────────────────────
+describe("CodingAgentQueueProcessor.writeAgentsMd", () => {
+ afterEach(() => {
+ vi.restoreAllMocks();
+ });
+
+ it("no-ops when the request has no agentsMdPromptId", async () => {
+ const qp = new CodingAgentQueueProcessor(testConfig, stubProcessor);
+ const log = vi.fn().mockResolvedValue(undefined);
+ const fetchMock = vi.fn();
+ vi.stubGlobal("fetch", fetchMock);
+
+ await (qp as any).writeAgentsMd({ _id: "r1" }, "/tmp/does-not-matter", log);
+ expect(fetchMock).not.toHaveBeenCalled();
+ });
+
+ it("throws when agentsMdPromptId is set but apiBaseUrl is missing", async () => {
+ // testConfig has no apiBaseUrl.
+ const qp = new CodingAgentQueueProcessor(testConfig, stubProcessor);
+ const log = vi.fn().mockResolvedValue(undefined);
+
+ await expect(
+ (qp as any).writeAgentsMd({ _id: "r1", agentsMdPromptId: "agents-1" }, "/tmp", log),
+ ).rejects.toThrow(/apiBaseUrl/);
+ });
+
+ it("writes the resolved AGENTS.md body into the workspace root", async () => {
+ const { mkdtemp, readFile, rm } = await import("node:fs/promises");
+ const { tmpdir } = await import("node:os");
+ const { join } = await import("node:path");
+ const workspace = await mkdtemp(join(tmpdir(), "agents-md-test-"));
+
+ try {
+ const qp = new CodingAgentQueueProcessor(
+ { ...testConfig, apiBaseUrl: "https://api.example.com" },
+ stubProcessor,
+ );
+ const log = vi.fn().mockResolvedValue(undefined);
+ vi.stubGlobal(
+ "fetch",
+ vi.fn().mockResolvedValue({
+ ok: true,
+ status: 200,
+ json: async () => ({ id: "agents-1", text: "# AGENTS\nBe terse." }),
+ }),
+ );
+
+ await (qp as any).writeAgentsMd({ _id: "r1", agentsMdPromptId: "agents-1" }, workspace, log);
+
+ const written = await readFile(join(workspace, "AGENTS.md"), "utf-8");
+ expect(written).toBe("# AGENTS\nBe terse.");
+ } finally {
+ await rm(workspace, { recursive: true, force: true });
+ }
+ });
+});
+
// ─── Redelivery fail-fast (handleRequest pre-checks) ─────────────────────────
describe("CodingAgentQueueProcessor.handleRequest redelivery handling", () => {
function makeHarness(runStatus: string, runOverrides: Record = {}) {
diff --git a/packages/shared/src/queue/queue-processor.ts b/packages/shared/src/queue/queue-processor.ts
index f663284f7..de32a4e2f 100644
--- a/packages/shared/src/queue/queue-processor.ts
+++ b/packages/shared/src/queue/queue-processor.ts
@@ -30,6 +30,9 @@ import { McpSecretClient } from "../mcp/mcp-secret-client.js";
import { SkillClient } from "../skills/skill-client.js";
import { ExtensionClient } from "../extensions/extension-client.js";
import { extractSkillsToWorkspace } from "../skills/skill-extractor.js";
+import { PromptClient } from "../task-prompts/prompt-client.js";
+import { writeFile } from "node:fs/promises";
+import { join } from "node:path";
/**
* Queue processor for coding agent workers.
@@ -388,6 +391,44 @@ export class CodingAgentQueueProcessor extends BaseQueueProcessor/AGENTS.md` before the first turn. The text is resolved via
+ * the API (`GET /api/v1/task-prompts/:id/content`), which downloads from blob
+ * storage when the prompt is blob-backed — the worker never touches blob.
+ *
+ * Fails loudly (throws) when `agentsMdPromptId` is set but `apiBaseUrl` is
+ * missing or the fetch/write fails, so the run is marked failed rather than
+ * silently evaluating the baseline worker (which would corrupt GEPA results).
+ */
+ private async writeAgentsMd(
+ requestDoc: RequestDocument,
+ workspacePath: string,
+ log: (level: LogEvent["level"], msg: string, data?: Record) => Promise,
+ ): Promise {
+ const agentsMdPromptId = requestDoc.agentsMdPromptId;
+ if (!agentsMdPromptId) return;
+
+ const apiBaseUrl = (this.config as QueueProcessorConfig).apiBaseUrl;
+ if (!apiBaseUrl) {
+ throw new Error(
+ `Request has agentsMdPromptId '${agentsMdPromptId}' but no apiBaseUrl is configured; cannot resolve AGENTS.md`,
+ );
+ }
+
+ const promptClient = new PromptClient(apiBaseUrl);
+ const text = await promptClient.getText(agentsMdPromptId);
+ const agentsMdPath = join(workspacePath, "AGENTS.md");
+ await writeFile(agentsMdPath, text, "utf-8");
+ await log("info", `Wrote AGENTS.md to workspace`, {
+ agentsMdPromptId,
+ path: agentsMdPath,
+ bytes: Buffer.byteLength(text, "utf-8"),
+ });
+ }
+
/**
* Multi-turn processing with judge loop.
*/
@@ -511,6 +552,10 @@ export class CodingAgentQueueProcessor extends BaseQueueProcessor {
+ vi.restoreAllMocks();
+});
+
+describe("PromptClient.getText", () => {
+ it("fetches resolved text from the content endpoint", async () => {
+ const fetchMock = vi.fn().mockResolvedValue({
+ ok: true,
+ status: 200,
+ json: async () => ({ id: "p1", text: "# AGENTS\nBe concise." }),
+ });
+ vi.stubGlobal("fetch", fetchMock);
+
+ const client = new PromptClient("https://api.example.com/");
+ const text = await client.getText("p1");
+
+ expect(text).toBe("# AGENTS\nBe concise.");
+ // Trailing slash on base URL is trimmed; id is path-encoded.
+ expect(fetchMock).toHaveBeenCalledWith("https://api.example.com/api/v1/task-prompts/p1/content");
+ });
+
+ it("throws a clear error on 404", async () => {
+ vi.stubGlobal("fetch", vi.fn().mockResolvedValue({ ok: false, status: 404, statusText: "Not Found" }));
+ const client = new PromptClient("https://api.example.com");
+ await expect(client.getText("missing")).rejects.toThrow(/not found/i);
+ });
+
+ it("throws on non-OK HTTP status", async () => {
+ vi.stubGlobal("fetch", vi.fn().mockResolvedValue({ ok: false, status: 500, statusText: "Server Error" }));
+ const client = new PromptClient("https://api.example.com");
+ await expect(client.getText("p1")).rejects.toThrow(/500/);
+ });
+
+ it("throws when the response lacks a text field", async () => {
+ vi.stubGlobal("fetch", vi.fn().mockResolvedValue({ ok: true, status: 200, json: async () => ({ id: "p1" }) }));
+ const client = new PromptClient("https://api.example.com");
+ await expect(client.getText("p1")).rejects.toThrow(/no text/i);
+ });
+});
diff --git a/packages/shared/src/task-prompts/prompt-client.ts b/packages/shared/src/task-prompts/prompt-client.ts
new file mode 100644
index 000000000..ade51cc2f
--- /dev/null
+++ b/packages/shared/src/task-prompts/prompt-client.ts
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Client for resolving prompt text (task or AGENTS.md) via the Scope REST API.
+ *
+ * Used by queue processors at message-processing time to fetch the resolved
+ * plain-text body of a prompt (inline or blob-backed) without needing direct
+ * blob storage access. The API endpoint `GET /api/v1/task-prompts/:id/content`
+ * runs `resolvePromptText` server-side and returns `{ id, text }`.
+ */
+export class PromptClient {
+ private readonly apiUrl: string;
+
+ constructor(apiUrl: string) {
+ this.apiUrl = apiUrl.replace(/\/+$/, "");
+ }
+
+ /**
+ * Fetch the resolved plain-text body of a prompt by id.
+ *
+ * @param id - Prompt id (content hash) of a task or agents.md prompt.
+ * @throws Error if the prompt cannot be resolved (404 or HTTP error).
+ */
+ async getText(id: string): Promise {
+ const url = `${this.apiUrl}/api/v1/task-prompts/${encodeURIComponent(id)}/content`;
+ const res = await fetch(url);
+
+ if (res.status === 404) {
+ throw new Error(`Prompt '${id}' not found via API`);
+ }
+ if (!res.ok) {
+ throw new Error(`[PromptClient] GET ${url} failed: ${res.status} ${res.statusText}`);
+ }
+
+ const data = (await res.json()) as { id: string; text: string };
+ if (typeof data.text !== "string") {
+ throw new Error(`[PromptClient] GET ${url} returned no text for prompt '${id}'`);
+ }
+ return data.text;
+ }
+}
From b9dd1a242d3006c181882cbd842e273323b0ddb9 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:12:11 -0700
Subject: [PATCH 005/287] feat(db): add sparse index migration for
requests.experimentId
GEPA experiments group a seed request and all follow-up requests under a
shared experimentId. Both experiment grouping (groupBy=experiment) and
AGENTS.md lineage reconstruction filter requests by this field, so add a
sparse single-field index to keep those queries efficient.
- 018-add-experiment-id-index.ts: try/catch-wrapped createIndex, log-only
non-destructive down().
- Registered in required-migrations.ts.
- Unit tests cover index creation, idempotent already-exists, and no-op down.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/018-add-experiment-id-index.test.ts | 51 +++++++++++++++++++
.../migrations/018-add-experiment-id-index.ts | 41 +++++++++++++++
.../db-migrations/src/required-migrations.ts | 1 +
3 files changed, 93 insertions(+)
create mode 100644 packages/db-migrations/src/018-add-experiment-id-index.test.ts
create mode 100644 packages/db-migrations/src/migrations/018-add-experiment-id-index.ts
diff --git a/packages/db-migrations/src/018-add-experiment-id-index.test.ts b/packages/db-migrations/src/018-add-experiment-id-index.test.ts
new file mode 100644
index 000000000..095d4539e
--- /dev/null
+++ b/packages/db-migrations/src/018-add-experiment-id-index.test.ts
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, it, expect, vi } from "vitest";
+import type { Db } from "mongodb";
+
+function makeMockDb(createIndexImpl?: (...args: any[]) => any) {
+ const createIndex = vi.fn(createIndexImpl ?? (async () => "experimentId_1"));
+ const requests = { createIndex };
+ const db = {
+ collection: vi.fn((name: string) => {
+ if (name === "requests") return requests;
+ throw new Error(`unexpected collection ${name}`);
+ }),
+ _requests: requests,
+ } as any;
+ return db as Db & { _requests: { createIndex: ReturnType } };
+}
+
+const { AddExperimentIdIndex } = await import("./migrations/018-add-experiment-id-index.js");
+
+describe("migration 018: AddExperimentIdIndex", () => {
+ describe("up()", () => {
+ it("creates a sparse single-field index on requests.experimentId", async () => {
+ const db = makeMockDb();
+ await new AddExperimentIdIndex().up(db);
+
+ expect(db.collection).toHaveBeenCalledWith("requests");
+ expect(db._requests.createIndex).toHaveBeenCalledTimes(1);
+ expect(db._requests.createIndex).toHaveBeenCalledWith(
+ { experimentId: 1 },
+ { sparse: true },
+ );
+ });
+
+ it("swallows errors when the index already exists", async () => {
+ const db = makeMockDb(async () => {
+ throw new Error("index already exists");
+ });
+ await expect(new AddExperimentIdIndex().up(db)).resolves.toBeUndefined();
+ });
+ });
+
+ describe("down()", () => {
+ it("does not drop the index (no-op)", async () => {
+ const db = makeMockDb();
+ await expect(new AddExperimentIdIndex().down(db)).resolves.toBeUndefined();
+ expect(db._requests.createIndex).not.toHaveBeenCalled();
+ });
+ });
+});
diff --git a/packages/db-migrations/src/migrations/018-add-experiment-id-index.ts b/packages/db-migrations/src/migrations/018-add-experiment-id-index.ts
new file mode 100644
index 000000000..020756556
--- /dev/null
+++ b/packages/db-migrations/src/migrations/018-add-experiment-id-index.ts
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Migration: Create a sparse index on experimentId in the requests collection.
+ *
+ * GEPA optimizer runs group a seed request and all follow-up (mutation/merge)
+ * requests under a shared `experimentId`. Both experiment grouping
+ * (`groupBy=experiment`) and AGENTS.md lineage reconstruction filter requests
+ * by this field, so a single-field index keeps those queries efficient.
+ *
+ * The index is sparse so it only indexes documents that actually carry an
+ * `experimentId` (most requests don't), avoiding write-RU cost on the rest.
+ * No other indexes are needed: the new `type` fields on task-prompts /
+ * prompt-features are tiny, human-curated collections where `?type=` scans are
+ * cheap, and request lineage is stored inline on the request
+ * (`agentsMdParentIds`) and queried via this same experimentId index.
+ */
+
+import type { Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+
+export class AddExperimentIdIndex implements MigrationInterface {
+ async up(db: Db): Promise {
+ const col = db.collection("requests");
+ try {
+ await col.createIndex({ experimentId: 1 }, { sparse: true });
+ console.log(" Created sparse index on requests.experimentId");
+ } catch (err: any) {
+ console.log(
+ ` Index on requests.experimentId already exists or couldn't be created: ${err.message ?? err}`,
+ );
+ }
+ }
+
+ async down(db: Db): Promise {
+ console.log(
+ " Skipping index drop — indexes should be dropped manually if needed",
+ );
+ }
+}
diff --git a/packages/db-migrations/src/required-migrations.ts b/packages/db-migrations/src/required-migrations.ts
index 120a54d0d..08ebf54b4 100644
--- a/packages/db-migrations/src/required-migrations.ts
+++ b/packages/db-migrations/src/required-migrations.ts
@@ -30,4 +30,5 @@ export const REQUIRED_MIGRATIONS: readonly string[] = [
"015-add-priority-and-scheduler-index.ts",
"016-fix-scheduler-sort-index.ts",
"017-add-post-processor-dispatch-index.ts",
+ "018-add-experiment-id-index.ts",
];
From b2ee59ddd47f3858d05f8ff631066d335e880201 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:21:08 -0700
Subject: [PATCH 006/287] feat(portal): AGENTS.md submit field, experiment
grouping, typed prompt features
- SubmitRun: optional AGENTS.md textarea + experimentId input
- RunDetail: render AGENTS.md as Markdown with lineage/experiment badges
- RunsList: add "Experiment" group-by option (client-side grouping by experimentId)
- PromptFeatureWizard/List: typed features (task | agents.md) with filter + column
- api.ts/types.ts: new request fields, TaskPromptType, getTaskPromptContent
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/components/PromptFeatureWizard.tsx | 24 ++++++++++-
apps/portal/src/lib/api.ts | 30 +++++++++----
apps/portal/src/pages/PromptFeatureList.tsx | 41 +++++++++++++++---
apps/portal/src/pages/RunDetail.tsx | 42 +++++++++++++++++++
apps/portal/src/pages/RunsList.tsx | 14 ++++---
apps/portal/src/pages/SubmitRun.tsx | 29 +++++++++++++
apps/portal/src/types.ts | 17 +++++++-
7 files changed, 174 insertions(+), 23 deletions(-)
diff --git a/apps/portal/src/components/PromptFeatureWizard.tsx b/apps/portal/src/components/PromptFeatureWizard.tsx
index fde815683..90dd5538d 100644
--- a/apps/portal/src/components/PromptFeatureWizard.tsx
+++ b/apps/portal/src/components/PromptFeatureWizard.tsx
@@ -10,8 +10,9 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { Badge } from "@/components/ui/badge";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Stepper } from "@/components/Stepper";
-import type { PromptFeatureDocument } from "@/types";
+import type { PromptFeatureDocument, TaskPromptType } from "@/types";
import {
ArrowLeft,
ArrowRight,
@@ -35,6 +36,8 @@ export interface PromptFeatureWizardProps {
initialId?: string;
/** Pre-fill detection prompt (skips to step 2 when provided) */
initialPrompt?: string;
+ /** Pre-select the prompt type this feature applies to (default "task") */
+ initialType?: TaskPromptType;
/** Called after successful feature creation */
onCreated?: (feature: PromptFeatureDocument) => void;
/** Called when user clicks Cancel (step 1) or Back at step 1 */
@@ -45,6 +48,7 @@ export function PromptFeatureWizard({
initialBehavior = "",
initialId = "",
initialPrompt = "",
+ initialType = "task",
onCreated,
onCancel,
}: PromptFeatureWizardProps) {
@@ -58,6 +62,7 @@ export function PromptFeatureWizard({
const [id, setId] = useState(initialId);
const [idManuallyEdited, setIdManuallyEdited] = useState(!!initialId);
const [idEditMode, setIdEditMode] = useState(false);
+ const [type, setType] = useState(initialType);
// Step 2 fields
const [prompt, setPrompt] = useState(initialPrompt);
@@ -117,6 +122,7 @@ export function PromptFeatureWizard({
createMutation.mutate({
id: id.trim(),
prompt: prompt.trim(),
+ ...(type !== "task" ? { type } : {}),
});
};
@@ -170,6 +176,22 @@ export function PromptFeatureWizard({
+
+
Applies to
+
setType(v as TaskPromptType)}>
+
+
+
+
+ Task prompts
+ AGENTS.md prompts
+
+
+
+ Features are only extracted against prompts of their own type.
+
+
+
Feature ID{" "}
diff --git a/apps/portal/src/lib/api.ts b/apps/portal/src/lib/api.ts
index ea16aeabb..2e28ae06e 100644
--- a/apps/portal/src/lib/api.ts
+++ b/apps/portal/src/lib/api.ts
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-import type { Run, RunState, CriteriaDocument, CriteriaGraphData, GeneratePromptResponse, AnalysisResponse, PromptFeatureDocument, Report, BulkReportStatus, BulkReportSummary, ReportTemplate, ReportTrigger, ReportTemplateSystemPrompt, KeyDocument, KeyValidationResult, CreateKeyRequest, UpdateKeyRequest, CodingAgent, AgentVersion, McpServerDocument, CreateMcpServerRequest, UpdateMcpServerRequest, BulkResubmitOverrides, Insight, InsightWithReference, TaskPrompt, TaskPromptFeatureExtractionResult, Model, FeatureFlag, SkillDocument, SkillSearchResult, SkillDiscoveryResult, SkillRevisionDocument, ExtensionDocument, ExtensionSearchResult, ExtensionVersionInfo, MdpResponse, AccountDocument, CreateAccountRequest, UpdateAccountRequest, ProfileWithVersion, ProfileVersionDocument, ProfileDocument, RunGroup, CursorPaginatedResponse, IterationOp } from "@/types";
+import type { Run, RunState, CriteriaDocument, CriteriaGraphData, GeneratePromptResponse, AnalysisResponse, PromptFeatureDocument, Report, BulkReportStatus, BulkReportSummary, ReportTemplate, ReportTrigger, ReportTemplateSystemPrompt, KeyDocument, KeyValidationResult, CreateKeyRequest, UpdateKeyRequest, CodingAgent, AgentVersion, McpServerDocument, CreateMcpServerRequest, UpdateMcpServerRequest, BulkResubmitOverrides, Insight, InsightWithReference, TaskPrompt, TaskPromptType, TaskPromptFeatureExtractionResult, Model, FeatureFlag, SkillDocument, SkillSearchResult, SkillDiscoveryResult, SkillRevisionDocument, ExtensionDocument, ExtensionSearchResult, ExtensionVersionInfo, MdpResponse, AccountDocument, CreateAccountRequest, UpdateAccountRequest, ProfileWithVersion, ProfileVersionDocument, ProfileDocument, RunGroup, CursorPaginatedResponse, IterationOp } from "@/types";
import { qs } from "./url";
import { recordServerDate } from "./serverClock";
@@ -31,7 +31,7 @@ async function request(path: string, init?: RequestInit): Promise {
export const api = {
/** List runs with cursor-based pagination */
- listRuns: (opts?: { worker?: string; taskPromptId?: string; status?: string; outcome?: string; criteria?: string; submissionId?: string; profileId?: string; turns?: number; turnsOp?: IterationOp; maxIterations?: number; maxIterationsOp?: IterationOp; limit?: number; after?: string; before?: string; last?: boolean }): Promise> => {
+ listRuns: (opts?: { worker?: string; taskPromptId?: string; status?: string; outcome?: string; criteria?: string; submissionId?: string; experimentId?: string; profileId?: string; turns?: number; turnsOp?: IterationOp; maxIterations?: number; maxIterationsOp?: IterationOp; limit?: number; after?: string; before?: string; last?: boolean }): Promise> => {
return request(`/requests${qs({
worker: opts?.worker,
taskPromptId: opts?.taskPromptId,
@@ -39,6 +39,7 @@ export const api = {
outcome: opts?.outcome,
criteria: opts?.criteria,
submissionId: opts?.submissionId,
+ experimentId: opts?.experimentId,
profileId: opts?.profileId,
turns: opts?.turns !== undefined ? String(opts.turns) : undefined,
turnsOp: opts?.turns !== undefined ? opts?.turnsOp : undefined,
@@ -52,7 +53,7 @@ export const api = {
},
/** List runs grouped by task or submissionId, with cursor-based pagination */
- listRunGroups: (opts: { groupBy: "task" | "submissionId" | "profile"; worker?: string; taskPromptId?: string; status?: string; outcome?: string; criteria?: string; submissionId?: string; turns?: number; turnsOp?: IterationOp; maxIterations?: number; maxIterationsOp?: IterationOp; limit?: number; after?: string; before?: string; last?: boolean }): Promise> => {
+ listRunGroups: (opts: { groupBy: "task" | "submissionId" | "profile" | "experiment"; worker?: string; taskPromptId?: string; status?: string; outcome?: string; criteria?: string; submissionId?: string; experimentId?: string; turns?: number; turnsOp?: IterationOp; maxIterations?: number; maxIterationsOp?: IterationOp; limit?: number; after?: string; before?: string; last?: boolean }): Promise> => {
return request(`/requests${qs({
groupBy: opts.groupBy,
worker: opts.worker,
@@ -61,6 +62,7 @@ export const api = {
outcome: opts.outcome,
criteria: opts.criteria,
submissionId: opts.submissionId,
+ experimentId: opts.experimentId,
turns: opts.turns !== undefined ? String(opts.turns) : undefined,
turnsOp: opts.turns !== undefined ? opts.turnsOp : undefined,
maxIterations: opts.maxIterations !== undefined ? String(opts.maxIterations) : undefined,
@@ -92,6 +94,9 @@ export const api = {
agentVersion?: string;
profileId?: string;
profileVariations?: string[];
+ agentsMd?: string;
+ experimentId?: string;
+ agentsMdParentIds?: string[];
}): Promise<(Run & { message: string }) | { ids: string[]; count: number; message: string }> => {
const { worker, ...payload } = body;
const url = worker ? `/requests?worker=${encodeURIComponent(worker)}` : `/requests`;
@@ -346,9 +351,10 @@ export const api = {
// ─── Prompt Features ───────────────────────────────────────────────────────
/** List all prompt features, optionally filtered by search query */
- listPromptFeatures: (q?: string): Promise => {
+ listPromptFeatures: (q?: string, type?: TaskPromptType): Promise => {
const params = new URLSearchParams();
if (q) params.set("q", q);
+ if (type) params.set("type", type);
const qs = params.toString();
return request(`/prompt-features${qs ? `?${qs}` : ""}`);
},
@@ -359,7 +365,7 @@ export const api = {
},
/** Create a new prompt feature */
- createPromptFeature: (body: { id: string; prompt: string }): Promise => {
+ createPromptFeature: (body: { id: string; prompt: string; type?: TaskPromptType }): Promise => {
return request("/prompt-features", {
method: "POST",
body: JSON.stringify(body),
@@ -389,12 +395,13 @@ export const api = {
// ─── Task Prompts ──────────────────────────────────────────────────────────
- /** List all task prompts (paginated, optional search) */
- listTaskPrompts: (opts?: { limit?: number; offset?: number; search?: string }): Promise<{ items: TaskPrompt[]; total: number }> => {
+ /** List all task prompts (paginated, optional search + type filter) */
+ listTaskPrompts: (opts?: { limit?: number; offset?: number; search?: string; type?: TaskPromptType }): Promise<{ items: TaskPrompt[]; total: number }> => {
const params = new URLSearchParams();
if (opts?.limit) params.set("limit", String(opts.limit));
if (opts?.offset) params.set("offset", String(opts.offset));
if (opts?.search) params.set("search", opts.search);
+ if (opts?.type) params.set("type", opts.type);
const qs = params.toString();
return request(`/task-prompts${qs ? `?${qs}` : ""}`);
},
@@ -404,11 +411,16 @@ export const api = {
return request(`/task-prompts/${encodeURIComponent(id)}`);
},
+ /** Resolve a task/AGENTS.md prompt's plain text (downloads blob if blob-backed) */
+ getTaskPromptContent: (id: string): Promise<{ id: string; text: string }> => {
+ return request(`/task-prompts/${encodeURIComponent(id)}/content`);
+ },
+
/** Create (or find existing) task prompt — idempotent */
- createTaskPrompt: (text: string): Promise => {
+ createTaskPrompt: (text: string, type?: TaskPromptType): Promise => {
return request("/task-prompts", {
method: "POST",
- body: JSON.stringify({ text }),
+ body: JSON.stringify({ text, ...(type && { type }) }),
});
},
diff --git a/apps/portal/src/pages/PromptFeatureList.tsx b/apps/portal/src/pages/PromptFeatureList.tsx
index 8db777044..3984f5099 100644
--- a/apps/portal/src/pages/PromptFeatureList.tsx
+++ b/apps/portal/src/pages/PromptFeatureList.tsx
@@ -21,7 +21,12 @@ import {
useListUrlState,
type DataTableColumn,
} from "@/components/list-layout";
-import type { PromptFeatureDocument } from "@/types";
+import { Badge } from "@/components/ui/badge";
+import { Label } from "@/components/ui/label";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
+import type { PromptFeatureDocument, TaskPromptType } from "@/types";
+
+const FILTER_KEYS = ["type"] as const;
export function PromptFeatureList() {
const queryClient = useQueryClient();
@@ -29,11 +34,12 @@ export function PromptFeatureList() {
const detailOutlet = useOutlet();
const { id: activeId } = useParams<{ id?: string }>();
- const state = useListUrlState({ defaultPageSize: 25, filterKeys: [] });
+ const state = useListUrlState({ defaultPageSize: 25, filterKeys: FILTER_KEYS });
+ const typeFilter = (state.getFilter("type") as TaskPromptType | null) ?? undefined;
const { data: allFeatures = [], isLoading, isRefetching } = useQuery({
- queryKey: ["prompt-features", state.search],
- queryFn: () => api.listPromptFeatures(state.search || undefined),
+ queryKey: ["prompt-features", state.search, typeFilter],
+ queryFn: () => api.listPromptFeatures(state.search || undefined, typeFilter),
});
const deleteMutation = useMutation({
@@ -81,6 +87,16 @@ export function PromptFeatureList() {
{truncate(f.prompt, 120)}
),
},
+ {
+ id: "type",
+ header: "Type",
+ width: "120px",
+ cell: (f) => (
+
+ {f.type ?? "task"}
+
+ ),
+ },
{
id: "actions",
header: "",
@@ -145,8 +161,21 @@ export function PromptFeatureList() {
/>
}
>
-
- Use the search above to filter by ID or prompt text.
+
+ Type
+ state.setFilter("type", v === "all" ? null : v)}
+ >
+
+
+
+
+ All types
+ Task
+ AGENTS.md
+
+
}
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index ee42b2467..75b6a8e30 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -165,6 +165,15 @@ export function RunDetail() {
enabled: !!taskPromptId,
});
+ // Fetch the AGENTS.md body (if this run supplied one) for Markdown rendering.
+ // Uses the /content endpoint so blob-backed bodies resolve to plain text.
+ const agentsMdPromptId = run?.agentsMdPromptId;
+ const { data: agentsMdContent } = useQuery({
+ queryKey: ["task-prompt-content", agentsMdPromptId],
+ queryFn: () => api.getTaskPromptContent(agentsMdPromptId!),
+ enabled: !!agentsMdPromptId,
+ });
+
// Fetch reports for this run
const { data: reports, refetch: refetchReports } = useQuery({
queryKey: ["run-reports", id],
@@ -1098,6 +1107,39 @@ export function RunDetail() {
)}
+ {/* AGENTS.md card (if this run supplied one) */}
+ {run.agentsMdPromptId && (
+
+
+
+ AGENTS.md
+
+
+
+
+
+ {formatId(run.agentsMdPromptId)}
+
+ {run.experimentId && (
+ experiment: {run.experimentId}
+ )}
+ {run.agentsMdParentIds && run.agentsMdParentIds.length > 0 && (
+
+ {run.agentsMdParentIds.length === 1 ? "mutation" : "merge"} · {run.agentsMdParentIds.length} parent{run.agentsMdParentIds.length === 1 ? "" : "s"}
+
+ )}
+
+ {agentsMdContent ? (
+
+ {agentsMdContent.text}
+
+ ) : (
+
+ )}
+
+
+ )}
+
{/* Prompt Features card (if task prompt has features) */}
{taskPrompt?.features && taskPrompt.features.length > 0 && (
diff --git a/apps/portal/src/pages/RunsList.tsx b/apps/portal/src/pages/RunsList.tsx
index c2fd11125..a73aac03e 100644
--- a/apps/portal/src/pages/RunsList.tsx
+++ b/apps/portal/src/pages/RunsList.tsx
@@ -268,18 +268,19 @@ const COLUMN_IDS = COLUMN_OPTIONS.map((o) => o.id);
// Segmented toggle used in the list header for the Group By control. Kept
// inline because it is only used here.
-const GROUP_BY_OPTIONS: ReadonlyArray<{ value: "profile" | "task" | "submissionId"; label: string }> = [
+const GROUP_BY_OPTIONS: ReadonlyArray<{ value: "profile" | "task" | "submissionId" | "experiment"; label: string }> = [
{ value: "profile", label: "Profile" },
{ value: "task", label: "Task" },
{ value: "submissionId", label: "Submission" },
+ { value: "experiment", label: "Experiment" },
];
function GroupByToggle({
value,
onChange,
}: {
- value: "none" | "profile" | "task" | "submissionId";
- onChange: (next: "none" | "profile" | "task" | "submissionId") => void;
+ value: "none" | "profile" | "task" | "submissionId" | "experiment";
+ onChange: (next: "none" | "profile" | "task" | "submissionId" | "experiment") => void;
}) {
return (
>(new Set());
// Get groupBy from URL state
- const groupBy = (state.getFilter("groupBy") ?? "none") as "none" | "profile" | "task" | "submissionId";
+ const groupBy = (state.getFilter("groupBy") ?? "none") as "none" | "profile" | "task" | "submissionId" | "experiment";
// Cursor pagination — keep a stack of cursors that map a virtual page number
// to a fetch instruction. Each entry describes how to fetch that page:
@@ -650,6 +651,9 @@ export function RunsList() {
case "submissionId":
key = run.submissionId ?? "(No Submission)";
break;
+ case "experiment":
+ key = run.experimentId ?? "(No Experiment)";
+ break;
}
if (!groups.has(key)) {
groups.set(key, []);
@@ -2412,7 +2416,7 @@ export function RunsList() {
return runs[0] ? column.cell(runs[0]) : null;
},
renderGroupHeader: (groupKey, runs, expanded) => {
- const groupLabel = groupBy === "submissionId" ? "Submission ID" : groupBy === "profile" ? "Profile" : "Task";
+ const groupLabel = groupBy === "submissionId" ? "Submission ID" : groupBy === "profile" ? "Profile" : groupBy === "experiment" ? "Experiment" : "Task";
const groupDisplayKey =
groupBy === "profile" && groupKey !== "(No Profile)"
? (profileNameById.get(groupKey) ?? formatId(groupKey))
diff --git a/apps/portal/src/pages/SubmitRun.tsx b/apps/portal/src/pages/SubmitRun.tsx
index 053d98966..888daffe2 100644
--- a/apps/portal/src/pages/SubmitRun.tsx
+++ b/apps/portal/src/pages/SubmitRun.tsx
@@ -159,6 +159,8 @@ export function SubmitRun() {
const [maxIterations, setMaxIterations] = useState(10);
const [occurrences, setOccurrences] = useState(5);
const [priority, setPriority] = useState(0);
+ const [agentsMd, setAgentsMd] = useState("");
+ const [experimentId, setExperimentId] = useState("");
// Optional add-ons
const [selectedMcpServers, setSelectedMcpServers] = useState([]);
@@ -497,6 +499,8 @@ export function SubmitRun() {
maxIterations,
...(priority !== 0 ? { priority } : {}),
...(occurrences > 1 ? { count: occurrences } : {}),
+ ...(agentsMd.trim() ? { agentsMd: agentsMd } : {}),
+ ...(experimentId.trim() ? { experimentId: experimentId.trim() } : {}),
...(inVariationMode ? {} : { ...(selectedMcpServers.length > 0 ? { mcpServers: selectedMcpServers } : {}) }),
...(inVariationMode ? {} : { ...(selectedSkills.length > 0 ? { skills: selectedSkills } : {}) }),
...(inVariationMode ? {} : { ...(selectedExtensions.length > 0 ? { extensions: selectedExtensions } : {}) }),
@@ -808,6 +812,31 @@ export function SubmitRun() {
/>
+
+ {/* ─── Advanced: AGENTS.md + experiment grouping ──────────────── */}
+
+
+ Experiment ID (optional)
+ setExperimentId(e.target.value)}
+ />
+
diff --git a/apps/portal/src/types.ts b/apps/portal/src/types.ts
index 7b7e4c0f2..245c91411 100644
--- a/apps/portal/src/types.ts
+++ b/apps/portal/src/types.ts
@@ -141,6 +141,12 @@ export interface Run {
submissionId?: string;
profileId?: string;
profileVersionId?: string;
+ /** GEPA experiment grouping — links a seed request and its follow-ups. */
+ experimentId?: string;
+ /** Resolved AGENTS.md prompt id when an AGENTS.md was supplied. */
+ agentsMdPromptId?: string;
+ /** Parent AGENTS.md prompt ids forming GEPA lineage (mutation/merge edges). */
+ agentsMdParentIds?: string[];
}
export interface CursorPaginatedResponse {
@@ -204,9 +210,13 @@ export interface GeneratePromptResponse {
}
// Prompt Feature types
+export type TaskPromptType = "task" | "agents.md";
+
export interface PromptFeatureConfig {
id: string;
prompt: string;
+ /** Prompt type this feature applies to (absent ⇒ "task"). */
+ type?: TaskPromptType;
}
export interface PromptFeatureDocument extends PromptFeatureConfig {
@@ -241,7 +251,9 @@ export interface PromptFeatureExtraction {
// Task Prompt types (first-class entity for benchmark task texts)
export interface TaskPrompt {
_id: string; // UUIDv5 content-addressed ID
- text: string; // Full task prompt text
+ text?: string; // Full task prompt text (absent when blob-backed)
+ type?: TaskPromptType; // "task" (default) | "agents.md"
+ contentBlobUrl?: string; // Blob reference when body is over the inline threshold
features?: PromptFeatureResult[]; // Detected prompt features
featuresExtractedAt?: string; // When features were last extracted
createdAt: string;
@@ -928,7 +940,7 @@ export interface ProfileWithVersion extends ProfileDocument {
// --- Runs grouping types (mirrored from shared) ---
-export type GroupByKey = "none" | "task" | "submissionId" | "profile";
+export type GroupByKey = "none" | "task" | "submissionId" | "profile" | "experiment";
export interface AggregateStats {
min: number;
@@ -948,6 +960,7 @@ export interface GroupUniformValues {
extensions?: string[];
status?: RunStatus;
submissionId?: string;
+ experimentId?: string;
task?: string;
}
From be5a6cbd4e860b30c5dd0672c798247caaf4cbac Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:25:39 -0700
Subject: [PATCH 007/287] feat(cli): AGENTS.md, experimentId, and typed prompt
flags
- run submit: --agents-md , --experiment-id
- run list: --experiment-id filter, --group-by (incl. experiment)
- task-prompt list/create: --type (task | agents.md); guard blob-backed prompts
- prompt-feature list/create: --type filter + create, Type column
- Tests for all new options (run/task-prompt/prompt-feature)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/cli/src/commands/prompt-feature.test.ts | 101 ++++++++++++++++++
apps/cli/src/commands/prompt-feature.ts | 8 +-
apps/cli/src/commands/run.test.ts | 72 +++++++++++++
apps/cli/src/commands/run.ts | 36 ++++++-
apps/cli/src/commands/task-prompt.test.ts | 106 +++++++++++++++++++
apps/cli/src/commands/task-prompt.ts | 27 +++--
6 files changed, 341 insertions(+), 9 deletions(-)
create mode 100644 apps/cli/src/commands/prompt-feature.test.ts
create mode 100644 apps/cli/src/commands/task-prompt.test.ts
diff --git a/apps/cli/src/commands/prompt-feature.test.ts b/apps/cli/src/commands/prompt-feature.test.ts
new file mode 100644
index 000000000..092ba68a9
--- /dev/null
+++ b/apps/cli/src/commands/prompt-feature.test.ts
@@ -0,0 +1,101 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { Command } from "commander";
+import { registerPromptFeatureCommands } from "./prompt-feature.js";
+
+function makeProgram(): Command {
+ const program = new Command();
+ registerPromptFeatureCommands(program);
+ return program;
+}
+
+function mockFetchWith(body: unknown): void {
+ vi.stubGlobal("fetch", vi.fn().mockResolvedValue({ ok: true, json: async () => body }));
+}
+
+function fetchMock(): ReturnType {
+ return fetch as unknown as ReturnType;
+}
+
+describe("prompt-feature list", () => {
+ beforeEach(() => vi.restoreAllMocks());
+ afterEach(() => vi.restoreAllMocks());
+
+ it("passes --type as a query param", async () => {
+ mockFetchWith([]);
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ ["prompt-feature", "list", "--type", "agents.md", "-u", "http://localhost:3100"],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const url = fetchMock().mock.calls[0][0] as string;
+ expect(url).toContain("type=agents.md");
+ });
+
+ it("renders a Type column defaulting to 'task'", async () => {
+ mockFetchWith([{ id: "feat-1", prompt: "detect something" }]);
+ const lines: string[] = [];
+ const logSpy = vi.spyOn(console, "log").mockImplementation((...p: unknown[]) => {
+ lines.push(p.map(String).join(" "));
+ });
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(["prompt-feature", "list", "-u", "http://localhost:3100"], { from: "user" });
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ expect(lines.join("\n")).toContain("task");
+ });
+});
+
+describe("prompt-feature create", () => {
+ beforeEach(() => vi.restoreAllMocks());
+ afterEach(() => vi.restoreAllMocks());
+
+ it("sends type in the create body when provided", async () => {
+ mockFetchWith({ id: "feat-new" });
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ ["prompt-feature", "create", "--id", "my_feat", "--prompt", "detect x", "--type", "agents.md", "-u", "http://localhost:3100"],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const init = fetchMock().mock.calls[0][1] as { body: string };
+ expect(JSON.parse(init.body)).toEqual({ id: "my_feat", prompt: "detect x", type: "agents.md" });
+ });
+
+ it("omits type when not provided (backward compatible)", async () => {
+ mockFetchWith({ id: "feat-new-2" });
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ ["prompt-feature", "create", "--id", "my_feat2", "--prompt", "detect y", "-u", "http://localhost:3100"],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const init = fetchMock().mock.calls[0][1] as { body: string };
+ expect(JSON.parse(init.body)).toEqual({ id: "my_feat2", prompt: "detect y" });
+ });
+});
diff --git a/apps/cli/src/commands/prompt-feature.ts b/apps/cli/src/commands/prompt-feature.ts
index 49dd6c7d5..2f9aba4e9 100644
--- a/apps/cli/src/commands/prompt-feature.ts
+++ b/apps/cli/src/commands/prompt-feature.ts
@@ -29,6 +29,7 @@ promptFeature
.command("list")
.description("List all prompt features")
.option("-q, --query ", "Filter by ID or prompt text")
+ .option("--type ", "Filter by feature type ('task' or 'agents.md')")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
)
.action(async (options) => {
@@ -36,6 +37,7 @@ promptFeature
try {
const params = new URLSearchParams();
if (options.query) params.set("q", options.query);
+ if (options.type) params.set("type", options.type);
const qs = params.toString();
const response = await fetch(`${normalizeUrl(options.url)}/api/v1/prompt-features${qs ? `?${qs}` : ""}`);
@@ -45,7 +47,7 @@ promptFeature
process.exit(1);
}
- const items = await response.json() as Array<{ id: string; prompt: string }>;
+ const items = await response.json() as Array<{ id: string; prompt: string; type?: string }>;
if (items.length === 0) {
if (!isMachineReadable(format)) console.log(warnBanner("No prompt features found."));
return;
@@ -59,6 +61,8 @@ promptFeature
{ key: 'id', label: 'ID',
tableFormatter: (f: any) => value(f.id),
},
+ { key: 'type', label: 'Type', formatter: (f: any) => f.type ?? 'task',
+ tableFormatter: (f: any) => value(f.type ?? 'task') },
{ key: 'prompt', label: 'Prompt', formatter: (f: any) => {
const prompt = f.prompt.replace(/\n/g, ' ');
return prompt.length > 60 ? prompt.substring(0, 60) + '…' : prompt;
@@ -128,6 +132,7 @@ promptFeature
.description("Create a new prompt feature")
.requiredOption("--id ", "Prompt feature ID (lowercase snake_case)")
.requiredOption("--prompt ", "Detection prompt for the feature")
+ .option("--type ", "Feature type ('task' default, or 'agents.md')")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.action(async (options) => {
try {
@@ -135,6 +140,7 @@ promptFeature
id: options.id,
prompt: options.prompt,
};
+ if (options.type) body.type = options.type;
const response = await fetch(`${normalizeUrl(options.url)}/api/v1/prompt-features`, {
method: "POST",
diff --git a/apps/cli/src/commands/run.test.ts b/apps/cli/src/commands/run.test.ts
index de5267c0c..46efe1bdc 100644
--- a/apps/cli/src/commands/run.test.ts
+++ b/apps/cli/src/commands/run.test.ts
@@ -155,6 +155,78 @@ describe("run list", () => {
expect(output).toContain("status: done");
expect(output).not.toContain("Found 1 request(s):");
});
+
+ it("passes --experiment-id and --group-by through as query params", async () => {
+ mockFetchWith({ data: [], pageInfo: { hasNextPage: false, hasPreviousPage: false } });
+
+ await runListAndCaptureOutput(["--experiment-id", "exp-42", "--group-by", "experiment"]);
+
+ const calledUrl = (fetch as unknown as ReturnType).mock.calls[0][0] as string;
+ expect(calledUrl).toContain("experimentId=exp-42");
+ expect(calledUrl).toContain("groupBy=experiment");
+ });
+});
+
+describe("run submit", () => {
+ beforeEach(() => {
+ vi.restoreAllMocks();
+ });
+
+ afterEach(() => {
+ vi.restoreAllMocks();
+ });
+
+ function captureSubmit(args: string[]): { url: string; body: Record } {
+ const fetchMock = fetch as unknown as ReturnType;
+ const [url, init] = fetchMock.mock.calls[0];
+ return { url: url as string, body: JSON.parse((init as { body: string }).body) };
+ }
+
+ it("includes experimentId and agentsMd in the submit body", async () => {
+ mockFetchWith({ id: "req-submit-1", workerType: "coder-acp-copilot", status: "queued" });
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ [
+ "run", "submit",
+ "-m", "do the thing",
+ "--experiment-id", "exp-99",
+ "--agents-md", "# Be helpful",
+ "--no-stream",
+ "-u", "http://localhost:3100",
+ ],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const { url, body } = captureSubmit([]);
+ expect(url).toContain("/api/v1/requests?worker=coder-acp-copilot");
+ expect(body.experimentId).toBe("exp-99");
+ expect(body.agentsMd).toBe("# Be helpful");
+ });
+
+ it("omits agentsMd and experimentId when not provided", async () => {
+ mockFetchWith({ id: "req-submit-2", workerType: "coder-acp-copilot", status: "queued" });
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ ["run", "submit", "-m", "plain task", "--no-stream", "-u", "http://localhost:3100"],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const { body } = captureSubmit([]);
+ expect(body).not.toHaveProperty("agentsMd");
+ expect(body).not.toHaveProperty("experimentId");
+ });
});
describe("run retry", () => {
diff --git a/apps/cli/src/commands/run.ts b/apps/cli/src/commands/run.ts
index 750d84eef..84d75b047 100644
--- a/apps/cli/src/commands/run.ts
+++ b/apps/cli/src/commands/run.ts
@@ -17,6 +17,18 @@ import type { OutputFormat, DisplayField } from "../utils/types.js";
import { runGetAction } from "../run-get-action.js";
import { normalizeUrl, printFollowUpCommands, withOutputOption, getDefaultApiUrl } from "../utils/shared.js";
+/**
+ * Resolve a CLI option that may be either a literal string or a `@path`
+ * reference to a file whose contents should be read. Used for flags like
+ * `--agents-md` where large bodies are inconvenient to pass inline.
+ */
+function resolveTextOrFile(input: string): string {
+ if (input.startsWith("@")) {
+ return readFileSync(resolve(input.slice(1)), "utf8");
+ }
+ return input;
+}
+
export function registerRunCommands(program: Command): void {
const run = program
.command("run")
@@ -46,10 +58,12 @@ run
.option("--profile ", "Saved profile to apply (supplies worker, model, extensions, etc.)")
.addOption(new Option("--base-profile ", "Deprecated alias for --profile.").hideHelp())
.option("--profile-variations-file ", "Path to JSON file containing profile variation entries")
+ .option("--agents-md ", "AGENTS.md content delivered to the workspace (prefix with @ to read from a file)")
+ .option("--experiment-id ", "Group this request with others under a shared experiment ID")
.option("-u, --url ", "API base URL", process.env.SCOPE_API_URL || "http://localhost:3100")
.option("--no-stream", "Don't stream logs, just submit")
.action(async (options, command) => {
- const { scenario, persona, traits, worker, url, stream, maxIterations, model, reasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion, profile, baseProfile, profileVariationsFile } = options;
+ const { scenario, persona, traits, worker, url, stream, maxIterations, model, reasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion, profile, baseProfile, profileVariationsFile, agentsMd: agentsMdInput, experimentId } = options;
// `--profile` is the documented flag; `--base-profile` is kept as a hidden
// back-compat alias. Both resolve to the same request `profileId`.
const profileId = profile ?? baseProfile;
@@ -118,6 +132,17 @@ run
if (profileId) {
body.profileId = profileId;
}
+ if (experimentId) {
+ body.experimentId = experimentId;
+ }
+ if (agentsMdInput) {
+ // `@path` reads the AGENTS.md body from a file; otherwise the value is
+ // treated as the literal content.
+ const agentsMd = resolveTextOrFile(agentsMdInput);
+ if (agentsMd.trim().length > 0) {
+ body.agentsMd = agentsMd;
+ }
+ }
if (profileVariationsFile) {
if (!profileId) {
@@ -162,6 +187,7 @@ run
const result = await response.json();
console.log(`${successText('Request submitted:')} ${value(result.id)}`);
if (result.submissionId) console.log(`${label('Submission:')} ${value(result.submissionId)}`);
+ if (result.experimentId) console.log(`${label('Experiment:')} ${value(result.experimentId)}`);
console.log(`${label('Worker:')} ${value(result.workerType)}`);
if (result.model) console.log(`${label('Model:')} ${value(result.model)}`);
if (result.reasoningEffort) console.log(`${label('Reasoning Effort:')} ${value(result.reasoningEffort)}`);
@@ -385,6 +411,8 @@ run
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.option("-w, --worker ", "Filter by worker")
.option("--submission-id ", "Filter by submission ID")
+ .option("--experiment-id ", "Filter by experiment ID")
+ .option("--group-by ", "Group results by 'task', 'submissionId', 'profile', or 'experiment'")
.option("--turns ", "Filter by actual turns (e.g. '>=5', '<=10', '=3')")
.option("--max-iterations ", "Filter by configured maxIterations (e.g. '>=5', '<=10', '=3')")
.option("--include-deleted", "Include soft-deleted runs")
@@ -400,6 +428,12 @@ run
if (options.submissionId) {
params.set("submissionId", options.submissionId);
}
+ if (options.experimentId) {
+ params.set("experimentId", options.experimentId);
+ }
+ if (options.groupBy) {
+ params.set("groupBy", options.groupBy);
+ }
const parseIterExpr = (raw: string, name: string): { op: "eq" | "gte" | "lte"; value: number } => {
const m = /^(>=|<=|=)?\s*(\d+)$/.exec(String(raw).trim());
if (!m) {
diff --git a/apps/cli/src/commands/task-prompt.test.ts b/apps/cli/src/commands/task-prompt.test.ts
new file mode 100644
index 000000000..4afe9500b
--- /dev/null
+++ b/apps/cli/src/commands/task-prompt.test.ts
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { Command } from "commander";
+import { registerTaskPromptCommands } from "./task-prompt.js";
+
+function makeProgram(): Command {
+ const program = new Command();
+ registerTaskPromptCommands(program);
+ return program;
+}
+
+function mockFetchWith(body: unknown): void {
+ vi.stubGlobal("fetch", vi.fn().mockResolvedValue({ ok: true, json: async () => body }));
+}
+
+function fetchMock(): ReturnType {
+ return fetch as unknown as ReturnType;
+}
+
+describe("task-prompt list", () => {
+ beforeEach(() => vi.restoreAllMocks());
+ afterEach(() => vi.restoreAllMocks());
+
+ it("passes --type as a query param", async () => {
+ mockFetchWith({ items: [], total: 0 });
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ ["task-prompt", "list", "--type", "agents.md", "-u", "http://localhost:3100"],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const url = fetchMock().mock.calls[0][0] as string;
+ expect(url).toContain("type=agents.md");
+ });
+
+ it("renders blob-backed prompts without crashing on missing text", async () => {
+ mockFetchWith({
+ items: [{ _id: "abcdef1234", type: "agents.md", contentBlobUrl: "prompts/abcdef1234.txt", createdAt: new Date().toISOString() }],
+ total: 1,
+ });
+ const lines: string[] = [];
+ const logSpy = vi.spyOn(console, "log").mockImplementation((...p: unknown[]) => {
+ lines.push(p.map(String).join(" "));
+ });
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(["task-prompt", "list", "-u", "http://localhost:3100"], { from: "user" });
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const output = lines.join("\n");
+ expect(output).toContain("agents.md");
+ expect(output).toContain("(blob)");
+ });
+});
+
+describe("task-prompt create", () => {
+ beforeEach(() => vi.restoreAllMocks());
+ afterEach(() => vi.restoreAllMocks());
+
+ it("sends type in the create body when provided", async () => {
+ mockFetchWith({ _id: "id-1", type: "agents.md", createdAt: new Date().toISOString() });
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ ["task-prompt", "create", "-t", "# Guidance", "--type", "agents.md", "-u", "http://localhost:3100"],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const init = fetchMock().mock.calls[0][1] as { body: string };
+ expect(JSON.parse(init.body)).toEqual({ text: "# Guidance", type: "agents.md" });
+ });
+
+ it("omits type when not provided (backward compatible)", async () => {
+ mockFetchWith({ _id: "id-2", createdAt: new Date().toISOString() });
+ const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
+
+ try {
+ const program = makeProgram();
+ await program.parseAsync(
+ ["task-prompt", "create", "-t", "plain task", "-u", "http://localhost:3100"],
+ { from: "user" },
+ );
+ } finally {
+ logSpy.mockRestore();
+ }
+
+ const init = fetchMock().mock.calls[0][1] as { body: string };
+ expect(JSON.parse(init.body)).toEqual({ text: "plain task" });
+ });
+});
diff --git a/apps/cli/src/commands/task-prompt.ts b/apps/cli/src/commands/task-prompt.ts
index 30a65a55f..f573168ba 100644
--- a/apps/cli/src/commands/task-prompt.ts
+++ b/apps/cli/src/commands/task-prompt.ts
@@ -28,6 +28,7 @@ taskPrompt
.command("list")
.description("List all task prompts")
.option("-s, --search ", "Filter by text content")
+ .option("--type ", "Filter by prompt type ('task' or 'agents.md')")
.option("-l, --limit ", "Maximum number of results", "50")
.option("--offset ", "Number of results to skip", "0")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
@@ -37,6 +38,7 @@ taskPrompt
try {
const params = new URLSearchParams();
if (options.search) params.set("search", options.search);
+ if (options.type) params.set("type", options.type);
if (options.limit) params.set("limit", options.limit);
if (options.offset) params.set("offset", options.offset);
const qs = params.toString();
@@ -63,11 +65,15 @@ taskPrompt
formatter: (tp: any) => tp._id.substring(0, 8) + '…',
tableFormatter: (tp: any) => value(tp._id.substring(0, 8) + '…'),
},
+ { key: 'type', label: 'Type', formatter: (tp: any) => tp.type ?? 'task',
+ tableFormatter: (tp: any) => value(tp.type ?? 'task') },
{ key: 'text', label: 'Text', formatter: (tp: any) => {
- const text = tp.text.replace(/\n/g, ' ');
+ const text = (tp.text ?? '').replace(/\n/g, ' ');
+ if (!text) return tp.contentBlobUrl ? '(blob)' : '';
return text.length > 60 ? text.substring(0, 60) + '…' : text;
}, tableFormatter: (tp: any) => {
- const text = tp.text.replace(/\n/g, ' ');
+ const text = (tp.text ?? '').replace(/\n/g, ' ');
+ if (!text) return dimTimestamp(tp.contentBlobUrl ? '(blob)' : '');
const truncated = text.length > 60 ? text.substring(0, 60) + '…' : text;
return dimTimestamp(truncated);
}},
@@ -105,7 +111,7 @@ taskPrompt
}
const tp = await response.json() as {
- _id: string; text: string;
+ _id: string; text?: string; type?: string; contentBlobUrl?: string;
features?: Array<{ featureId: string; detected: boolean; evaluated: boolean }>;
featuresExtractedAt?: string;
createdAt: string; deletedAt?: string;
@@ -129,11 +135,16 @@ taskPrompt
}
console.log(`${label('ID:')} ${value(tp._id)}`);
+ console.log(`${label('Type:')} ${value(tp.type ?? 'task')}`);
console.log(`${label('Created:')} ${value(tp.createdAt)}`);
if (tp.deletedAt) console.log(`${label('Deleted:')} ${value(tp.deletedAt)}`);
console.log(`${label('Text:')}`);
- for (const line of tp.text.trim().split('\n')) {
- console.log(` ${line}`);
+ if (tp.text) {
+ for (const line of tp.text.trim().split('\n')) {
+ console.log(` ${line}`);
+ }
+ } else {
+ console.log(` ${dimTimestamp('(stored in blob — fetch via /api/v1/task-prompts/:id/content)')}`);
}
if (tp.features && tp.features.length > 0) {
@@ -172,6 +183,7 @@ taskPrompt
.description("Register a task prompt (idempotent — same text returns existing entity)")
.option("-t, --text ", "Task prompt text")
.option("-f, --file ", "Read task prompt text from file")
+ .option("--type ", "Prompt type ('task' default, or 'agents.md')")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.action(async (options) => {
try {
@@ -192,7 +204,7 @@ taskPrompt
const response = await fetch(`${normalizeUrl(options.url)}/api/v1/task-prompts`, {
method: "POST",
headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ text }),
+ body: JSON.stringify(options.type ? { text, type: options.type } : { text }),
});
if (!response.ok) {
@@ -201,9 +213,10 @@ taskPrompt
process.exit(1);
}
- const tp = await response.json() as { _id: string; text: string; createdAt: string };
+ const tp = await response.json() as { _id: string; text?: string; type?: string; createdAt: string };
console.log(successText(`Task prompt registered.`));
console.log(`${label('ID:')} ${value(tp._id)}`);
+ if (tp.type) console.log(`${label('Type:')} ${value(tp.type)}`);
console.log(`${label('Created:')} ${value(tp.createdAt)}`);
} catch (error) {
console.error(errorText("Error:"), error instanceof Error ? error.message : error);
From 97b4238530fed9f67d51ecfab0ba900d5a1726f4 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:39:04 -0700
Subject: [PATCH 008/287] feat(gepa-optimizer): new Python app optimizing
AGENTS.md via Scope runs
Add apps/gepa-optimizer, a Python+uv app that drives the GEPA reflective
prompt-optimization algorithm to optimize an AGENTS.md file, scoring each
candidate with a real Scope benchmark run (Copilot CLI worker + Claude
Haiku 4.5).
- ScopeAdapter(GEPAAdapter): submit one Scope run per dataset example with
agentsMd + experimentId, poll to completion, score from criteriaResults,
build per-turn trajectories and reflective dataset (judge + criteria
feedback for every turn). Bounded concurrency (default 10, the Linux
copilot KEDA ceiling) via asyncio + httpx.
- Scoring is derived, never persisted: denominator = requested criteria
(skipped/missing count as failed); mean|final|weighted across turns;
non-succeeded/empty runs score 0.0, never NaN.
- Failure model: per-example errors -> 0.0; systemic majority -> abort, so
infrastructure failure never poisons optimization. Idempotent GETs retry
with backoff; POSTs are not retried.
- Best-effort lineage reconstructed post-hoc from GEPA result.parents.
- Preflight validates criterion ids before burning agent runs.
- 36 pytest unit tests (scoring, reflective, lineage, client via
httpx.MockTransport, adapter via stubbed client).
- CI: new gepa job (uv sync --locked + pytest), change filter, ci-summary
wiring; root scripts test:gepa/build:gepa; README app table + polyglot
exception documented (mirrors apps/gateway).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.github/workflows/ci.yml | 35 +-
README.md | 1 +
apps/gepa-optimizer/.env.example | 35 +
apps/gepa-optimizer/.gitignore | 6 +
apps/gepa-optimizer/.python-version | 1 +
apps/gepa-optimizer/README.md | 103 +
apps/gepa-optimizer/pyproject.toml | 32 +
.../src/gepa_optimizer/__init__.py | 6 +
.../src/gepa_optimizer/dataset.py | 82 +
.../src/gepa_optimizer/lineage.py | 52 +
.../gepa-optimizer/src/gepa_optimizer/main.py | 110 ++
.../src/gepa_optimizer/reflective.py | 83 +
.../src/gepa_optimizer/scope_adapter.py | 195 ++
.../src/gepa_optimizer/scope_client.py | 172 ++
.../src/gepa_optimizer/scoring.py | 92 +
apps/gepa-optimizer/tests/test_lineage.py | 38 +
apps/gepa-optimizer/tests/test_reflective.py | 77 +
.../tests/test_scope_adapter.py | 106 ++
.../gepa-optimizer/tests/test_scope_client.py | 141 ++
apps/gepa-optimizer/tests/test_scoring.py | 97 +
apps/gepa-optimizer/uv.lock | 1696 +++++++++++++++++
package.json | 2 +
22 files changed, 3160 insertions(+), 2 deletions(-)
create mode 100644 apps/gepa-optimizer/.env.example
create mode 100644 apps/gepa-optimizer/.gitignore
create mode 100644 apps/gepa-optimizer/.python-version
create mode 100644 apps/gepa-optimizer/README.md
create mode 100644 apps/gepa-optimizer/pyproject.toml
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/__init__.py
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/dataset.py
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/lineage.py
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/main.py
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/reflective.py
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/scope_adapter.py
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/scope_client.py
create mode 100644 apps/gepa-optimizer/src/gepa_optimizer/scoring.py
create mode 100644 apps/gepa-optimizer/tests/test_lineage.py
create mode 100644 apps/gepa-optimizer/tests/test_reflective.py
create mode 100644 apps/gepa-optimizer/tests/test_scope_adapter.py
create mode 100644 apps/gepa-optimizer/tests/test_scope_client.py
create mode 100644 apps/gepa-optimizer/tests/test_scoring.py
create mode 100644 apps/gepa-optimizer/uv.lock
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ef2c87809..a4031dc5e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -501,6 +501,31 @@ jobs:
name: ctrf-test-results-gateway
path: ctrf/
+ gepa:
+ name: "GEPA optimizer: test"
+ needs: [detect-changes]
+ if: >
+ github.event_name == 'workflow_dispatch' ||
+ needs.detect-changes.outputs.gepa == 'true'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Install uv
+ uses: astral-sh/setup-uv@v5
+ with:
+ version: "0.7.6"
+
+ - name: Sync dependencies (locked)
+ working-directory: apps/gepa-optimizer
+ run: uv sync --locked
+
+ - name: Run tests
+ working-directory: apps/gepa-optimizer
+ run: uv run pytest -q
+
# ---------------------------------------------------------------------------
# Detect which images changed (runs in parallel with CI jobs)
# ---------------------------------------------------------------------------
@@ -521,6 +546,7 @@ jobs:
db-migrations: ${{ steps.changes.outputs.db-migrations }}
shared: ${{ steps.changes.outputs.shared }}
gateway: ${{ steps.changes.outputs.gateway }}
+ gepa: ${{ steps.changes.outputs.gepa }}
coder-acp-copilot-windows: ${{ steps.changes.outputs.coder-acp-copilot-windows }}
model-scanning: ${{ steps.changes.outputs.model-scanning }}
typescript: ${{ steps.changes.outputs.typescript }}
@@ -567,12 +593,15 @@ jobs:
- 'packages/db-migrations/**'
gateway:
- 'apps/gateway/**'
+ gepa:
+ - 'apps/gepa-optimizer/**'
coder-acp-copilot-windows:
- 'apps/workers/coder-acp-copilot-windows/**'
- 'apps/workers/coder-acp-copilot/versions.env'
typescript:
- 'apps/**'
- '!apps/gateway/**'
+ - '!apps/gepa-optimizer/**'
- 'packages/**'
- 'package.json'
- 'pnpm-lock.yaml'
@@ -864,7 +893,7 @@ jobs:
ci-summary:
name: CI Summary
runs-on: ubuntu-latest
- needs: [test, integration-test, lint, build, cli-bundle-test, gateway]
+ needs: [test, integration-test, lint, build, cli-bundle-test, gateway, gepa]
if: always()
steps:
@@ -875,7 +904,8 @@ jobs:
[ "${{ needs.lint.result }}" = "success" ] && \
[ "${{ needs.build.result }}" = "success" ] && \
[ "${{ needs.cli-bundle-test.result }}" = "success" -o "${{ needs.cli-bundle-test.result }}" = "skipped" ] && \
- [ "${{ needs.gateway.result }}" = "success" -o "${{ needs.gateway.result }}" = "skipped" ]; then
+ [ "${{ needs.gateway.result }}" = "success" -o "${{ needs.gateway.result }}" = "skipped" ] && \
+ [ "${{ needs.gepa.result }}" = "success" -o "${{ needs.gepa.result }}" = "skipped" ]; then
echo "✅ All checks passed!"
exit 0
else
@@ -886,5 +916,6 @@ jobs:
echo " Build: ${{ needs.build.result }}"
echo " CLI Bundle Tests: ${{ needs.cli-bundle-test.result }}"
echo " Gateway: ${{ needs.gateway.result }}"
+ echo " GEPA: ${{ needs.gepa.result }}"
exit 1
fi
diff --git a/README.md b/README.md
index 38c22b8dd..b31d5b411 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,7 @@
| **Portal** (`apps/portal`) | React 19 + Vite web UI for managing runs and editing the criteria DAG |
| **CLI** (`apps/cli`) | Commander + Ink TUI for submitting runs, streaming logs, and CI/CD automation |
| **AI Gateway** (`apps/gateway`) | Rust TLS-intercepting HTTP proxy with a plugin architecture — captures HAR traffic from Electron-based agents to upstream AI providers |
+| **GEPA Optimizer** (`apps/gepa-optimizer`) | Python + uv app that runs the [GEPA](https://github.com/gepa-ai/gepa) reflective prompt-optimization algorithm to optimize an `AGENTS.md` file, scoring each candidate with a real Scope run (Copilot CLI worker + Claude Haiku 4.5) |
| **MCP Gateway** | Per-worker [MCPJungle](https://github.com/mcpjungle/MCPJungle) sidecar that aggregates stdio + remote MCP servers behind a single streamable HTTP endpoint, enabling ACP workers to use stdio-only servers (see [docs/architecture/mcp-gateway.md](docs/architecture/mcp-gateway.md)) |
| **Scheduler** (`apps/scheduler`) | Per-worker-type queue depth scheduler that drips requests from MongoDB into Azure Storage Queues |
| **Token Manager** (`apps/token-manager`) | Centralized GitHub token storage, validation, and round-robin distribution (Azure Key Vault / Lowkey Vault) |
diff --git a/apps/gepa-optimizer/.env.example b/apps/gepa-optimizer/.env.example
new file mode 100644
index 000000000..d459921b6
--- /dev/null
+++ b/apps/gepa-optimizer/.env.example
@@ -0,0 +1,35 @@
+# Scope REST API base URL (no trailing slash).
+SCOPE_API_URL=http://localhost:3100
+
+# Scope worker + model used to evaluate each AGENTS.md candidate.
+SCOPE_WORKER=coder-acp-copilot
+SCOPE_MODEL=claude-haiku-4.5
+
+# Max number of Scope runs kept in-flight at once. Defaults to 10 to match the
+# Linux coder-acp-copilot KEDA ceiling (maxReplicaCount: 10).
+SCOPE_MAX_CONCURRENCY=10
+
+# Per-run polling: how long to wait for a run to reach status=done, and how
+# often to poll (seconds).
+SCOPE_RUN_TIMEOUT_SECONDS=1800
+SCOPE_POLL_INTERVAL_SECONDS=15
+
+# Multi-turn iterations per Scope run.
+SCOPE_MAX_ITERATIONS=10
+
+# Scoring strategy over a run's turns: mean | final | weighted.
+SCOPE_SCORE_STRATEGY=mean
+
+# GEPA budget. Each metric call is ONE full (slow) Scope agent run, so keep
+# this small. See README for budgeting math.
+GEPA_MAX_METRIC_CALLS=12
+GEPA_REFLECTION_MINIBATCH_SIZE=2
+
+# Reflection LM passed to gepa.optimize (litellm model string). The reflection
+# LM rewrites the AGENTS.md; it is NOT the agent under test.
+GEPA_REFLECTION_LM=azure/gpt-5.5
+
+# Azure OpenAI credentials for the reflection LM (litellm reads these).
+AZURE_API_KEY=
+AZURE_API_BASE=
+AZURE_API_VERSION=2024-12-01-preview
diff --git a/apps/gepa-optimizer/.gitignore b/apps/gepa-optimizer/.gitignore
new file mode 100644
index 000000000..971241aae
--- /dev/null
+++ b/apps/gepa-optimizer/.gitignore
@@ -0,0 +1,6 @@
+.venv/
+__pycache__/
+*.pyc
+.env
+runs/
+.pytest_cache/
diff --git a/apps/gepa-optimizer/.python-version b/apps/gepa-optimizer/.python-version
new file mode 100644
index 000000000..e4fba2183
--- /dev/null
+++ b/apps/gepa-optimizer/.python-version
@@ -0,0 +1 @@
+3.12
diff --git a/apps/gepa-optimizer/README.md b/apps/gepa-optimizer/README.md
new file mode 100644
index 000000000..626912873
--- /dev/null
+++ b/apps/gepa-optimizer/README.md
@@ -0,0 +1,103 @@
+# GEPA × Scope Optimizer (`apps/gepa-optimizer`)
+
+Optimizes an **`AGENTS.md`** file with the [GEPA](https://github.com/gepa-ai/gepa)
+reflective prompt-optimization algorithm, where every candidate is scored by a
+**real Scope benchmark run** — the Copilot CLI worker (Linux) with the
+**Claude Haiku 4.5** model.
+
+This mirrors the reference experiment (`geo-experiments/gepa-prompt-optimization`)
+but, instead of optimizing a system prompt evaluated by a single LLM completion,
+it optimizes an `AGENTS.md` evaluated by a multi-turn Scope agent run and judged
+against a criteria DAG.
+
+```text
+GEPA reflection loop
+ └─ ScopeAdapter.evaluate(candidate={"AGENTS.md": ...})
+ POST /api/v1/requests (task + criteria + agentsMd + experimentId)
+ poll GET /api/v1/requests/:id until run.status == "done"
+ score = fraction of requested criteria passed, aggregated over turns
+ └─ ScopeAdapter.make_reflective_dataset(...)
+ per-turn judge feedback + criteria pass/fail → reflection LM rewrites AGENTS.md
+```
+
+## Polyglot exception
+
+This is a **Python** app (managed by [`uv`](https://docs.astral.sh/uv/)) living in
+a TypeScript/pnpm monorepo, exactly like the Rust `apps/gateway`. It is
+intentionally **outside** the pnpm workspace. `uv.lock` is committed and CI runs
+`uv sync --locked && uv run pytest`. Root scripts: `pnpm test:gepa`,
+`pnpm build:gepa`.
+
+## Setup
+
+```bash
+cd apps/gepa-optimizer
+uv sync # create .venv and install deps from uv.lock
+cp .env.example .env # then edit SCOPE_API_URL, criteria ids, reflection LM creds
+```
+
+## How scoring works
+
+The GEPA score is **derived, never persisted in Scope**. For a finished run:
+
+- The **denominator is the number of requested criteria** (not whatever Scope
+ returned), so a missing/skipped criterion always counts as failed.
+- A criterion only counts as passed when it was **evaluated and passed**;
+ `evaluated == false` (skipped because a DAG ancestor failed) counts as failed.
+- Per-turn score = `passed / requested`. The run score aggregates turns via
+ `SCOPE_SCORE_STRATEGY`:
+ - `mean` (default) — average across all turns;
+ - `final` — last turn only (closest to "task success");
+ - `weighted` — `0.8 * final + 0.2 * mean`.
+- A run that did not succeed, has no turns, or errored scores `0.0` (never `NaN`).
+
+## Budget
+
+GEPA counts **one metric call per dataset example**, and each metric call is a
+full (minutes-long) Scope agent run. Rough spend per optimization:
+
+```text
+len(valset) # seed validation
++ 2 * reflection_minibatch_size # parent + child minibatch per proposal
++ len(valset) # full re-validation of each accepted candidate
+```
+
+Keep `valset` tiny and `GEPA_MAX_METRIC_CALLS` small.
+
+## Run
+
+Edit `src/gepa_optimizer/dataset.py` so the criterion ids exist in your Scope
+instance (`pnpm cli criteria list`), then:
+
+```bash
+uv run gepa-optimizer
+# or
+uv run python -m gepa_optimizer.main
+```
+
+Results (best candidate, Pareto front, and a best-effort lineage DAG
+reconstructed from GEPA's parent indices) are written to `runs//results.json`.
+
+## Tests
+
+```bash
+uv run pytest # or, from repo root: pnpm test:gepa
+```
+
+Unit tests cover scoring, reflective-dataset construction, lineage
+reconstruction, the REST client (via `httpx.MockTransport`), and the adapter
+(with a stubbed client). No live Scope instance is required.
+
+## Concurrency
+
+`SCOPE_MAX_CONCURRENCY` (default **10**) caps in-flight runs to match the Linux
+`coder-acp-copilot` KEDA ceiling (`maxReplicaCount: 10`). Submitting more is
+harmless — extras just queue — but yields no speedup.
+
+## Lineage
+
+Parent→child lineage is reconstructed **after** optimization from GEPA's public
+`result.parents` / `result.candidates` and saved into `results.json`
+(`root` / `mutation` / `merge`). The Scope `requests.agentsMdParentIds` field
+remains available for callers that know parentage at submit time; this optimizer
+groups all of an experiment's runs via `experimentId` instead.
diff --git a/apps/gepa-optimizer/pyproject.toml b/apps/gepa-optimizer/pyproject.toml
new file mode 100644
index 000000000..2973ea92d
--- /dev/null
+++ b/apps/gepa-optimizer/pyproject.toml
@@ -0,0 +1,32 @@
+[project]
+name = "gepa-optimizer"
+version = "0.1.0"
+description = "GEPA prompt-optimization driver that optimizes AGENTS.md files evaluated by real Scope benchmark runs."
+readme = "README.md"
+requires-python = ">=3.12"
+dependencies = [
+ "gepa>=0.1.1",
+ "httpx>=0.27",
+ "python-dotenv>=1.0",
+ "litellm>=1.0",
+]
+
+[project.scripts]
+gepa-optimizer = "gepa_optimizer.main:main"
+
+[dependency-groups]
+dev = [
+ "pytest>=8.0",
+ "pytest-asyncio>=0.23",
+]
+
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+[tool.hatch.build.targets.wheel]
+packages = ["src/gepa_optimizer"]
+
+[tool.pytest.ini_options]
+testpaths = ["tests"]
+asyncio_mode = "auto"
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/__init__.py b/apps/gepa-optimizer/src/gepa_optimizer/__init__.py
new file mode 100644
index 000000000..8c8364c7e
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/__init__.py
@@ -0,0 +1,6 @@
+"""GEPA × Scope optimizer package."""
+
+from .scope_adapter import ScopeAdapter
+from .scope_client import ScopeClient
+
+__all__ = ["ScopeAdapter", "ScopeClient"]
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/dataset.py b/apps/gepa-optimizer/src/gepa_optimizer/dataset.py
new file mode 100644
index 000000000..f4482321e
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/dataset.py
@@ -0,0 +1,82 @@
+"""Dataset + preflight helpers for the optimizer.
+
+The dataset is intentionally tiny: every example is one full (minutes-long)
+Scope agent run, so a handful of tasks is plenty for a demonstration. Each
+example references **existing** Scope criterion ids; ``preflight_criteria``
+validates them before any expensive run starts.
+"""
+
+from __future__ import annotations
+
+import asyncio
+from typing import Any, Mapping, Sequence
+
+import httpx
+
+from .scope_client import ScopeClient, SystemicScopeError
+
+DataInst = dict[str, Any]
+
+
+# A small seed AGENTS.md. GEPA mutates this via reflection.
+SEED_AGENTS_MD = (
+ "# Agent guidance\n\n"
+ "You are an expert software engineer. Implement the requested task fully "
+ "and correctly. Prefer simple, idiomatic solutions. Verify your work "
+ "before finishing.\n"
+)
+
+
+def default_dataset() -> tuple[list[DataInst], list[DataInst]]:
+ """Return ``(trainset, valset)``.
+
+ Replace the criterion ids with ids that exist in your Scope instance
+ (``pnpm cli criteria list``). Kept deliberately small.
+ """
+ trainset: list[DataInst] = [
+ {
+ "task": "Create an Express.js server with a GET / route that responds 'Hello, World!'.",
+ "criteria": ["server_starts", "responds_hello_world"],
+ },
+ {
+ "task": "Add a GET /health route to the Express server that returns JSON {\"status\":\"ok\"}.",
+ "criteria": ["server_starts", "health_route_ok"],
+ },
+ ]
+ valset: list[DataInst] = [
+ {
+ "task": "Create an Express.js server with a GET / route that responds 'Hello, World!'.",
+ "criteria": ["server_starts", "responds_hello_world"],
+ },
+ ]
+ return trainset, valset
+
+
+def collect_criteria(datasets: Sequence[Sequence[Mapping[str, Any]]]) -> set[str]:
+ ids: set[str] = set()
+ for ds in datasets:
+ for ex in ds:
+ for cid in ex.get("criteria") or []:
+ ids.add(cid)
+ return ids
+
+
+async def _preflight_async(client: ScopeClient, criteria: Sequence[str]) -> list[str]:
+ missing: list[str] = []
+ async with httpx.AsyncClient(timeout=client.timeout_seconds) as http:
+ for cid in criteria:
+ doc = await client.get_criterion(http, cid)
+ if doc is None:
+ missing.append(cid)
+ return missing
+
+
+def preflight_criteria(client: ScopeClient, criteria: Sequence[str]) -> None:
+ """Raise ``SystemicScopeError`` if any criterion id does not exist."""
+ if not criteria:
+ raise SystemicScopeError("Dataset has no criteria; every example needs >=1.")
+ missing = asyncio.run(_preflight_async(client, list(criteria)))
+ if missing:
+ raise SystemicScopeError(
+ f"Unknown criterion ids (create them or fix the dataset): {sorted(missing)}"
+ )
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/lineage.py b/apps/gepa-optimizer/src/gepa_optimizer/lineage.py
new file mode 100644
index 000000000..822aafcc9
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/lineage.py
@@ -0,0 +1,52 @@
+"""Post-hoc lineage reconstruction from a GEPA result.
+
+The rubber-duck critique flagged that capturing parent→child lineage *during*
+evaluation (via a custom ``propose_new_texts``) is fragile: it requires
+reimplementing GEPA's reflection proposer and races on shared state. Instead we
+reconstruct the candidate DAG **after** ``gepa.optimize`` returns, from the
+public ``result.parents`` (a ``list[list[int]]`` of parent indices per
+candidate) and ``result.candidates``. This uses only GEPA's documented result
+surface and cannot corrupt the optimization.
+
+The reconstructed edges are written to ``results.json`` for inspection. The
+Scope ``requests.agentsMdParentIds`` field remains available for callers that
+*do* know parentage at submit time, but the optimizer does not depend on it.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Mapping, Sequence
+
+COMPONENT = "AGENTS.md"
+
+
+def reconstruct_lineage(
+ candidates: Sequence[Mapping[str, str]],
+ parents: Sequence[Sequence[int] | None],
+) -> list[dict[str, Any]]:
+ """Build a serializable lineage DAG from GEPA candidates + parent indices.
+
+ Each node: ``{index, parents: [int...], kind, agentsMdPreview}`` where
+ ``kind`` is ``root`` (no parents), ``mutation`` (one parent) or ``merge``
+ (two+ parents).
+ """
+ nodes: list[dict[str, Any]] = []
+ for idx, cand in enumerate(candidates):
+ raw_parents = parents[idx] if idx < len(parents) else None
+ parent_list = [p for p in (raw_parents or []) if p is not None and p >= 0]
+ if not parent_list:
+ kind = "root"
+ elif len(parent_list) == 1:
+ kind = "mutation"
+ else:
+ kind = "merge"
+ text = (cand or {}).get(COMPONENT, "") if isinstance(cand, Mapping) else ""
+ nodes.append(
+ {
+ "index": idx,
+ "parents": parent_list,
+ "kind": kind,
+ "agentsMdPreview": text[:200],
+ }
+ )
+ return nodes
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/main.py b/apps/gepa-optimizer/src/gepa_optimizer/main.py
new file mode 100644
index 000000000..fd239a454
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/main.py
@@ -0,0 +1,110 @@
+"""Entry point: optimize an AGENTS.md file with GEPA against Scope.
+
+Budgeting note (``GEPA_MAX_METRIC_CALLS``): GEPA counts **one metric call per
+dataset example evaluated**, and each metric call here is a full, slow Scope
+agent run. A single optimization spends roughly::
+
+ len(valset) # initial validation of the seed
+ + 2 * reflection_minibatch_size # parent + child minibatch per proposal
+ + len(valset) # full re-validation of each accepted candidate
+
+So keep ``valset`` tiny and ``GEPA_MAX_METRIC_CALLS`` small.
+"""
+
+from __future__ import annotations
+
+import json
+import os
+import uuid
+from datetime import datetime
+from pathlib import Path
+
+from dotenv import load_dotenv
+
+import gepa
+
+from .dataset import (
+ SEED_AGENTS_MD,
+ collect_criteria,
+ default_dataset,
+ preflight_criteria,
+)
+from .lineage import reconstruct_lineage
+from .scope_adapter import ScopeAdapter
+from .scope_client import ScopeClient
+
+
+def _env(name: str, default: str) -> str:
+ return os.getenv(name, default)
+
+
+def main() -> None:
+ load_dotenv()
+
+ base_url = _env("SCOPE_API_URL", "http://localhost:3100")
+ worker = _env("SCOPE_WORKER", "coder-acp-copilot")
+ model = _env("SCOPE_MODEL", "claude-haiku-4.5")
+ max_concurrency = int(_env("SCOPE_MAX_CONCURRENCY", "10"))
+ run_timeout = float(_env("SCOPE_RUN_TIMEOUT_SECONDS", "1800"))
+ poll_interval = float(_env("SCOPE_POLL_INTERVAL_SECONDS", "15"))
+ max_iterations = int(_env("SCOPE_MAX_ITERATIONS", "10"))
+ score_strategy = _env("SCOPE_SCORE_STRATEGY", "mean")
+ max_metric_calls = int(_env("GEPA_MAX_METRIC_CALLS", "12"))
+ reflection_minibatch_size = int(_env("GEPA_REFLECTION_MINIBATCH_SIZE", "2"))
+ reflection_lm = _env("GEPA_REFLECTION_LM", "azure/gpt-5.5")
+
+ experiment_id = f"gepa-{uuid.uuid4()}"
+ run_dir = Path(f"runs/{datetime.now().strftime('%Y%m%d_%H%M%S')}")
+ run_dir.mkdir(parents=True, exist_ok=True)
+
+ trainset, valset = default_dataset()
+
+ client = ScopeClient(base_url, worker=worker)
+
+ # Preflight: fail fast on unknown criterion ids before burning agent runs.
+ all_criteria = collect_criteria([trainset, valset])
+ preflight_criteria(client, sorted(all_criteria))
+
+ adapter = ScopeAdapter(
+ client,
+ model=model,
+ experiment_id=experiment_id,
+ max_iterations=max_iterations,
+ max_concurrency=max_concurrency,
+ run_timeout_seconds=run_timeout,
+ poll_interval_seconds=poll_interval,
+ score_strategy=score_strategy,
+ )
+
+ print(f"Experiment id: {experiment_id}")
+ print(f"Worker={worker} model={model} strategy={score_strategy}")
+
+ result = gepa.optimize(
+ seed_candidate={"AGENTS.md": SEED_AGENTS_MD},
+ trainset=trainset,
+ valset=valset,
+ adapter=adapter,
+ reflection_lm=reflection_lm,
+ max_metric_calls=max_metric_calls,
+ reflection_minibatch_size=reflection_minibatch_size,
+ use_merge=False,
+ run_dir=str(run_dir),
+ )
+
+ payload = result.to_dict()
+ # Best-effort lineage DAG reconstructed from GEPA's public parent indices.
+ candidates = getattr(result, "candidates", None) or []
+ parents = getattr(result, "parents", None) or []
+ payload["lineage"] = reconstruct_lineage(candidates, parents)
+ payload["experimentId"] = experiment_id
+
+ (run_dir / "results.json").write_text(json.dumps(payload, indent=2, default=str))
+
+ best = result.best_candidate.get("AGENTS.md", "")
+ print(f"\nRun saved to: {run_dir}/")
+ print(f"Best score: {result.val_aggregate_scores[result.best_idx]}")
+ print(f"Best AGENTS.md (first 200 chars):\n{best[:200]}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/reflective.py b/apps/gepa-optimizer/src/gepa_optimizer/reflective.py
new file mode 100644
index 000000000..2bd8561a9
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/reflective.py
@@ -0,0 +1,83 @@
+"""Build GEPA reflective-dataset records from a Scope run trajectory.
+
+Kept as a pure function (no GEPA / network imports) so it is trivially testable.
+A reflective record is ``{Inputs, "Generated Outputs", Feedback}`` per the GEPA
+``make_reflective_dataset`` contract. The *Feedback* string is the actionable
+gradient handed to the reflection LM, so it captures the full multi-turn
+trajectory: every turn's score, judge narrative, and per-criterion pass/fail
+with the judge's feedback text — emphasizing failed and skipped criteria.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Mapping, Sequence
+
+from .scoring import compute_turn_scores
+
+
+def _format_criteria(results: Sequence[Mapping[str, Any]]) -> str:
+ lines: list[str] = []
+ for r in results:
+ cid = r.get("criterionId", "")
+ evaluated = bool(r.get("evaluated", True))
+ passed = bool(r.get("passed")) and evaluated
+ if not evaluated:
+ status = "SKIPPED (ancestor failed)"
+ elif passed:
+ status = "PASS"
+ else:
+ status = "FAIL"
+ feedback = (r.get("feedback") or "").strip()
+ suffix = f" — {feedback}" if feedback else ""
+ lines.append(f" - [{status}] {cid}{suffix}")
+ return "\n".join(lines)
+
+
+def build_reflective_record(
+ trajectory: Mapping[str, Any],
+ requested_criteria: Sequence[str],
+ *,
+ max_chars: int | None = None,
+) -> dict[str, Any]:
+ """Turn one Scope trajectory into a single GEPA reflective record."""
+ task = trajectory.get("task", "")
+ turns = trajectory.get("turns") or []
+ overall_score = trajectory.get("score", 0.0)
+ error = trajectory.get("error")
+
+ turn_scores = compute_turn_scores({"turns": turns}, requested_criteria)
+
+ output_parts: list[str] = []
+ feedback_parts: list[str] = [f"Overall score: {overall_score:.3f}"]
+ if trajectory.get("runOutcome") and trajectory["runOutcome"] != "succeeded":
+ feedback_parts.append(f"Run outcome: {trajectory['runOutcome']} (scored 0).")
+ if error:
+ feedback_parts.append(f"Evaluation error: {error}")
+
+ for i, turn in enumerate(turns):
+ iteration = turn.get("iteration", i)
+ response = (turn.get("response") or turn.get("codingAgentResponse") or "").strip()
+ output_parts.append(f"--- Turn {iteration} ---\n{response or '(no response)'}")
+
+ t_score = turn_scores[i] if i < len(turn_scores) else 0.0
+ seg = [f"Turn {iteration} score: {t_score:.3f}"]
+ judge = (turn.get("judgeFeedback") or "").strip()
+ if judge:
+ seg.append(f"Judge: {judge}")
+ results = turn.get("criteriaResults") or []
+ if results:
+ seg.append("Criteria:\n" + _format_criteria(results))
+ feedback_parts.append("\n".join(seg))
+
+ generated_outputs = "\n\n".join(output_parts) if output_parts else "(no turns)"
+ feedback = "\n\n".join(feedback_parts)
+
+ if max_chars is not None and len(generated_outputs) > max_chars:
+ # Prioritize the newest turns by keeping the tail.
+ generated_outputs = "...(truncated)...\n" + generated_outputs[-max_chars:]
+
+ return {
+ "Inputs": task,
+ "Generated Outputs": generated_outputs,
+ "Feedback": feedback,
+ }
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/scope_adapter.py b/apps/gepa-optimizer/src/gepa_optimizer/scope_adapter.py
new file mode 100644
index 000000000..bce9df437
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/scope_adapter.py
@@ -0,0 +1,195 @@
+"""``ScopeAdapter`` — a GEPA adapter that scores AGENTS.md candidates with Scope.
+
+Each GEPA candidate is ``{"AGENTS.md": ""}``. ``evaluate`` submits one
+Scope run per dataset example (task + criteria + the candidate AGENTS.md),
+polls until the run finishes, and scores it from the persisted criteria
+results. Submissions/polls run concurrently under a semaphore capped at the
+Linux ``coder-acp-copilot`` KEDA ceiling (default 10).
+
+Failure model (per the rubber-duck critique):
+
+* A *per-example* failure (HTTP transport error, run timeout, a single rejected
+ submission) yields a ``0.0`` score with an error trajectory — GEPA keeps going.
+* A *systemic* failure (auth, bad schema, repeated 5xx) raised by the client
+ aborts the batch if it affects a majority of examples, so we never optimize
+ toward infrastructure noise.
+"""
+
+from __future__ import annotations
+
+import asyncio
+from typing import Any, Mapping, Sequence
+
+import httpx
+from gepa.core.adapter import EvaluationBatch, GEPAAdapter
+
+from .reflective import build_reflective_record
+from .scope_client import (
+ RequestFailedError,
+ RequestTimeout,
+ ScopeClient,
+ SystemicScopeError,
+)
+from .scoring import compute_run_score
+
+COMPONENT = "AGENTS.md"
+
+
+class ScopeAdapter(GEPAAdapter):
+ def __init__(
+ self,
+ client: ScopeClient,
+ *,
+ model: str,
+ experiment_id: str,
+ max_iterations: int,
+ max_concurrency: int = 10,
+ run_timeout_seconds: float = 1800.0,
+ poll_interval_seconds: float = 15.0,
+ score_strategy: str = "mean",
+ reflective_max_chars: int | None = None,
+ ) -> None:
+ self.client = client
+ self.model = model
+ self.experiment_id = experiment_id
+ self.max_iterations = max_iterations
+ self.max_concurrency = max_concurrency
+ self.run_timeout_seconds = run_timeout_seconds
+ self.poll_interval_seconds = poll_interval_seconds
+ self.score_strategy = score_strategy
+ self.reflective_max_chars = reflective_max_chars
+
+ # -- GEPAAdapter.evaluate ---------------------------------------------
+
+ def evaluate(
+ self,
+ batch: Sequence[Mapping[str, Any]],
+ candidate: Mapping[str, str],
+ capture_traces: bool = False,
+ ) -> EvaluationBatch:
+ agents_md = candidate.get(COMPONENT, "")
+ results = asyncio.run(self._evaluate_async(batch, agents_md))
+
+ # Abort only if a *majority* of examples hit systemic failures — a few
+ # transient per-example errors should not poison the run.
+ systemic = [r for r in results if isinstance(r.get("error_kind"), str) and r["error_kind"] == "systemic"]
+ if batch and len(systemic) > len(batch) / 2:
+ raise SystemicScopeError(
+ f"{len(systemic)}/{len(batch)} evaluations failed systemically; "
+ "aborting to avoid optimizing toward infrastructure failure."
+ )
+
+ outputs = [r["output"] for r in results]
+ scores = [r["score"] for r in results]
+ trajectories = [r["trajectory"] for r in results] if capture_traces else None
+ return EvaluationBatch(outputs=outputs, scores=scores, trajectories=trajectories)
+
+ async def _evaluate_async(
+ self, batch: Sequence[Mapping[str, Any]], agents_md: str
+ ) -> list[dict[str, Any]]:
+ sem = asyncio.Semaphore(self.max_concurrency)
+ # Create the client inside the coroutine so it binds to this loop.
+ async with httpx.AsyncClient(timeout=self.client.timeout_seconds) as http:
+
+ async def run_one(example: Mapping[str, Any]) -> dict[str, Any]:
+ async with sem:
+ return await self._evaluate_one(http, example, agents_md)
+
+ return await asyncio.gather(*(run_one(ex) for ex in batch))
+
+ async def _evaluate_one(
+ self,
+ http: httpx.AsyncClient,
+ example: Mapping[str, Any],
+ agents_md: str,
+ ) -> dict[str, Any]:
+ task = example.get("task", "")
+ criteria = list(example.get("criteria") or [])
+ try:
+ created = await self.client.submit_request(
+ http,
+ task=task,
+ criteria=criteria,
+ agents_md=agents_md or None,
+ model=self.model,
+ experiment_id=self.experiment_id,
+ max_iterations=self.max_iterations,
+ )
+ request_id = created.get("_id") or created.get("id")
+ doc = await self.client.wait_for_completion(
+ http,
+ request_id,
+ timeout_seconds=self.run_timeout_seconds,
+ poll_interval_seconds=self.poll_interval_seconds,
+ )
+ run = doc.get("run") or {}
+ score = compute_run_score(run, criteria, self.score_strategy)
+ trajectory = self._build_trajectory(task, criteria, request_id, run, score)
+ return {"score": score, "output": {"requestId": request_id, "score": score}, "trajectory": trajectory, "error_kind": None}
+ except SystemicScopeError as exc:
+ return self._failure(task, criteria, str(exc), "systemic")
+ except (RequestFailedError, RequestTimeout) as exc:
+ return self._failure(task, criteria, str(exc), "per_example")
+ except Exception as exc: # never raise for a single example
+ return self._failure(task, criteria, repr(exc), "per_example")
+
+ def _build_trajectory(
+ self,
+ task: str,
+ criteria: Sequence[str],
+ request_id: str | None,
+ run: Mapping[str, Any],
+ score: float,
+ ) -> dict[str, Any]:
+ turns_out = []
+ for t in run.get("turns") or []:
+ turns_out.append(
+ {
+ "iteration": t.get("iteration"),
+ "response": t.get("codingAgentResponse"),
+ "judgeFeedback": t.get("judgeFeedback"),
+ "criteriaResults": t.get("criteriaResults") or [],
+ }
+ )
+ return {
+ "task": task,
+ "criteria": list(criteria),
+ "requestId": request_id,
+ "runOutcome": run.get("outcome"),
+ "turns": turns_out,
+ "score": score,
+ }
+
+ def _failure(
+ self, task: str, criteria: Sequence[str], message: str, kind: str
+ ) -> dict[str, Any]:
+ trajectory = {
+ "task": task,
+ "criteria": list(criteria),
+ "requestId": None,
+ "runOutcome": None,
+ "turns": [],
+ "score": 0.0,
+ "error": message,
+ }
+ return {"score": 0.0, "output": {"error": message}, "trajectory": trajectory, "error_kind": kind}
+
+ # -- GEPAAdapter.make_reflective_dataset ------------------------------
+
+ def make_reflective_dataset(
+ self,
+ candidate: Mapping[str, str],
+ eval_batch: EvaluationBatch,
+ components_to_update: Sequence[str],
+ ) -> Mapping[str, Sequence[Mapping[str, Any]]]:
+ trajectories = eval_batch.trajectories or []
+ records = [
+ build_reflective_record(
+ traj,
+ traj.get("criteria") or [],
+ max_chars=self.reflective_max_chars,
+ )
+ for traj in trajectories
+ ]
+ # We only ever optimize the single AGENTS.md component.
+ return {component: records for component in components_to_update}
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/scope_client.py b/apps/gepa-optimizer/src/gepa_optimizer/scope_client.py
new file mode 100644
index 000000000..86e7992c6
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/scope_client.py
@@ -0,0 +1,172 @@
+"""Async REST client for the Scope API used by the GEPA adapter.
+
+Only the handful of endpoints the optimizer needs are implemented:
+
+* ``submit_request`` — POST a request (task + criteria + AGENTS.md + grouping).
+* ``get_request`` — GET a request doc (including its ``run`` state).
+* ``wait_for_completion`` — poll ``get_request`` until ``run.status == "done"``.
+* ``get_criterion`` — used for preflight validation of criterion ids.
+
+Error model (see the rubber-duck critique): a ``SystemicScopeError`` signals a
+problem that would poison the whole optimization (auth failure, malformed
+request schema, repeated 5xx) and should abort the run. A ``RequestFailedError``
+or ``RequestTimeout`` is a *per-example* failure that the adapter turns into a
+``0.0`` score without aborting. Idempotent GETs are retried with exponential
+backoff + jitter; POSTs are **not** retried (a duplicate POST would launch a
+second real agent run).
+"""
+
+from __future__ import annotations
+
+import asyncio
+import random
+from typing import Any, Mapping, Sequence
+
+import httpx
+
+DONE_STATUS = "done"
+
+
+class ScopeError(Exception):
+ """Base class for Scope client errors."""
+
+
+class SystemicScopeError(ScopeError):
+ """A failure that should abort the whole optimization (auth, schema, 5xx)."""
+
+
+class RequestFailedError(ScopeError):
+ """A single submission failed in a way that is local to that example."""
+
+
+class RequestTimeout(ScopeError):
+ """A run did not reach a terminal state within the timeout."""
+
+
+def _is_systemic_status(status: int) -> bool:
+ # 401/403 = auth; 400/422 = our payload is wrong; 5xx after retries = infra.
+ return status in (400, 401, 403, 422) or status >= 500
+
+
+class ScopeClient:
+ def __init__(
+ self,
+ base_url: str,
+ *,
+ worker: str = "coder-acp-copilot",
+ timeout_seconds: float = 30.0,
+ max_get_retries: int = 4,
+ ) -> None:
+ self.base_url = base_url.rstrip("/")
+ self.worker = worker
+ self.timeout_seconds = timeout_seconds
+ self.max_get_retries = max_get_retries
+
+ # -- low-level helpers -------------------------------------------------
+
+ async def _get_json(self, client: httpx.AsyncClient, path: str) -> Any:
+ """GET with retry/backoff on 429/5xx/network errors."""
+ last_exc: Exception | None = None
+ for attempt in range(self.max_get_retries):
+ try:
+ resp = await client.get(f"{self.base_url}{path}")
+ if resp.status_code == 429 or resp.status_code >= 500:
+ last_exc = SystemicScopeError(
+ f"GET {path} -> {resp.status_code}"
+ )
+ else:
+ resp.raise_for_status()
+ return resp.json()
+ except (httpx.TransportError, httpx.TimeoutException) as exc:
+ last_exc = exc
+ # backoff with jitter before the next attempt
+ await asyncio.sleep(min(2**attempt, 10) * (0.5 + random.random()))
+ raise SystemicScopeError(f"GET {path} failed after retries: {last_exc}")
+
+ # -- public API --------------------------------------------------------
+
+ async def submit_request(
+ self,
+ client: httpx.AsyncClient,
+ *,
+ task: str,
+ criteria: Sequence[str],
+ agents_md: str | None = None,
+ model: str | None = None,
+ experiment_id: str | None = None,
+ agents_md_parent_ids: Sequence[str] | None = None,
+ max_iterations: int | None = None,
+ ) -> Mapping[str, Any]:
+ """Submit one request. Returns the created request doc (with ``_id``)."""
+ body: dict[str, Any] = {"scenario": {"task": task, "criteria": list(criteria)}}
+ if model:
+ body["model"] = model
+ if max_iterations:
+ body["maxIterations"] = max_iterations
+ if experiment_id:
+ body["experimentId"] = experiment_id
+ if agents_md:
+ body["agentsMd"] = agents_md
+ if agents_md_parent_ids:
+ body["agentsMdParentIds"] = list(agents_md_parent_ids)
+
+ url = f"{self.base_url}/api/v1/requests?worker={self.worker}"
+ try:
+ resp = await client.post(url, json=body)
+ except (httpx.TransportError, httpx.TimeoutException) as exc:
+ # No response was produced, so no run could have started — safe to
+ # treat as a per-example failure rather than aborting everything.
+ raise RequestFailedError(f"POST /requests transport error: {exc}") from exc
+
+ if resp.status_code >= 400:
+ text = resp.text[:500]
+ if _is_systemic_status(resp.status_code):
+ raise SystemicScopeError(
+ f"POST /requests -> {resp.status_code}: {text}"
+ )
+ raise RequestFailedError(f"POST /requests -> {resp.status_code}: {text}")
+ return resp.json()
+
+ async def get_request(
+ self, client: httpx.AsyncClient, request_id: str
+ ) -> Mapping[str, Any]:
+ return await self._get_json(client, f"/api/v1/requests/{request_id}")
+
+ async def get_criterion(
+ self, client: httpx.AsyncClient, criterion_id: str
+ ) -> Mapping[str, Any] | None:
+ """Return the criterion doc, or ``None`` if it does not exist (404)."""
+ try:
+ resp = await client.get(f"{self.base_url}/api/v1/criteria/{criterion_id}")
+ except (httpx.TransportError, httpx.TimeoutException) as exc:
+ raise SystemicScopeError(f"GET /criteria error: {exc}") from exc
+ if resp.status_code == 404:
+ return None
+ if resp.status_code >= 400:
+ raise SystemicScopeError(
+ f"GET /criteria/{criterion_id} -> {resp.status_code}"
+ )
+ return resp.json()
+
+ async def wait_for_completion(
+ self,
+ client: httpx.AsyncClient,
+ request_id: str,
+ *,
+ timeout_seconds: float,
+ poll_interval_seconds: float,
+ ) -> Mapping[str, Any]:
+ """Poll until ``run.status == "done"``; raise ``RequestTimeout`` if not."""
+ loop = asyncio.get_event_loop()
+ deadline = loop.time() + timeout_seconds
+ while True:
+ doc = await self.get_request(client, request_id)
+ run = doc.get("run") or {}
+ if run.get("status") == DONE_STATUS:
+ return doc
+ if loop.time() >= deadline:
+ raise RequestTimeout(
+ f"request {request_id} not done within {timeout_seconds}s "
+ f"(last status={run.get('status')})"
+ )
+ await asyncio.sleep(poll_interval_seconds)
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/scoring.py b/apps/gepa-optimizer/src/gepa_optimizer/scoring.py
new file mode 100644
index 000000000..574c53a97
--- /dev/null
+++ b/apps/gepa-optimizer/src/gepa_optimizer/scoring.py
@@ -0,0 +1,92 @@
+"""Pure, side-effect-free scoring of a finished Scope run.
+
+The GEPA metric is **derived, never persisted in Scope**: Scope stores the raw
+``run.turns[].criteriaResults`` and the run ``outcome``; we compute the
+fraction of requested criteria that passed and aggregate it across turns.
+
+Design decisions (see plan §C2/§D and the rubber-duck critique):
+
+* The denominator is the number of **requested** criteria, not the number of
+ results Scope happened to return. This is robust even if Scope ever omits
+ skipped criteria from ``criteriaResults`` — a requested criterion with no
+ passing result always counts as failed.
+* ``evaluated == False`` (a DAG ancestor failed, so the criterion was skipped)
+ counts as **failed**, amplifying the penalty for early failures.
+* A run that did not succeed (``outcome != "succeeded"``), has no turns, or has
+ no judged criteria scores ``0.0``. The function never returns ``NaN``.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Mapping, Sequence
+
+SUCCEEDED_OUTCOME = "succeeded"
+DONE_STATUS = "done"
+
+ScoreStrategy = str # "mean" | "final" | "weighted"
+
+
+def _turn_score(turn: Mapping[str, Any], requested_criteria: Sequence[str]) -> float:
+ """Fraction of *requested* criteria that passed in a single turn."""
+ results = turn.get("criteriaResults") or []
+ passed_by_id: dict[str, bool] = {}
+ for r in results:
+ cid = r.get("criterionId")
+ if cid is None:
+ continue
+ # A criterion only counts as passed when it was actually evaluated and
+ # passed. Skipped (evaluated == False) criteria count as failed.
+ passed_by_id[cid] = bool(r.get("passed")) and bool(r.get("evaluated", True))
+
+ if requested_criteria:
+ denominator = len(requested_criteria)
+ passed = sum(1 for cid in requested_criteria if passed_by_id.get(cid, False))
+ else:
+ # No explicit request list — fall back to whatever the turn reported.
+ denominator = len(passed_by_id)
+ passed = sum(1 for v in passed_by_id.values() if v)
+
+ if denominator == 0:
+ return 0.0
+ return passed / denominator
+
+
+def compute_turn_scores(
+ run: Mapping[str, Any], requested_criteria: Sequence[str]
+) -> list[float]:
+ """Per-turn scores for a finished run, in turn order."""
+ turns = run.get("turns") or []
+ return [_turn_score(t, requested_criteria) for t in turns]
+
+
+def compute_run_score(
+ run: Mapping[str, Any] | None,
+ requested_criteria: Sequence[str],
+ strategy: ScoreStrategy = "mean",
+) -> float:
+ """Aggregate a finished run into a single GEPA score in ``[0.0, 1.0]``.
+
+ Returns ``0.0`` (never ``NaN``) for any run that did not succeed or produced
+ no judged turns.
+ """
+ if not run:
+ return 0.0
+ if run.get("status") != DONE_STATUS:
+ return 0.0
+ if run.get("outcome") != SUCCEEDED_OUTCOME:
+ return 0.0
+
+ turn_scores = compute_turn_scores(run, requested_criteria)
+ if not turn_scores:
+ return 0.0
+
+ if strategy == "final":
+ return turn_scores[-1]
+ if strategy == "weighted":
+ # Anchor on the final turn (the objective) but keep a small gradient
+ # from the whole trajectory so partial progress is still rewarded.
+ final = turn_scores[-1]
+ mean = sum(turn_scores) / len(turn_scores)
+ return 0.8 * final + 0.2 * mean
+ # default: mean across all turns
+ return sum(turn_scores) / len(turn_scores)
diff --git a/apps/gepa-optimizer/tests/test_lineage.py b/apps/gepa-optimizer/tests/test_lineage.py
new file mode 100644
index 000000000..8e5fe9b4c
--- /dev/null
+++ b/apps/gepa-optimizer/tests/test_lineage.py
@@ -0,0 +1,38 @@
+from gepa_optimizer.lineage import reconstruct_lineage
+
+
+def test_root_mutation_merge_classification():
+ candidates = [
+ {"AGENTS.md": "seed"},
+ {"AGENTS.md": "child of seed"},
+ {"AGENTS.md": "merge of 0 and 1"},
+ ]
+ parents = [[], [0], [0, 1]]
+ nodes = reconstruct_lineage(candidates, parents)
+ assert nodes[0]["kind"] == "root"
+ assert nodes[1]["kind"] == "mutation"
+ assert nodes[1]["parents"] == [0]
+ assert nodes[2]["kind"] == "merge"
+ assert nodes[2]["parents"] == [0, 1]
+
+
+def test_handles_none_and_missing_parents():
+ candidates = [{"AGENTS.md": "a"}, {"AGENTS.md": "b"}]
+ parents = [None] # shorter than candidates; second has no entry
+ nodes = reconstruct_lineage(candidates, parents)
+ assert nodes[0]["kind"] == "root"
+ assert nodes[1]["kind"] == "root"
+
+
+def test_preview_truncated():
+ candidates = [{"AGENTS.md": "x" * 500}]
+ nodes = reconstruct_lineage(candidates, [[]])
+ assert len(nodes[0]["agentsMdPreview"]) == 200
+
+
+def test_negative_parent_indices_ignored():
+ candidates = [{"AGENTS.md": "a"}, {"AGENTS.md": "b"}]
+ parents = [[], [-1]]
+ nodes = reconstruct_lineage(candidates, parents)
+ assert nodes[1]["kind"] == "root"
+ assert nodes[1]["parents"] == []
diff --git a/apps/gepa-optimizer/tests/test_reflective.py b/apps/gepa-optimizer/tests/test_reflective.py
new file mode 100644
index 000000000..570f905bb
--- /dev/null
+++ b/apps/gepa-optimizer/tests/test_reflective.py
@@ -0,0 +1,77 @@
+from gepa_optimizer.reflective import build_reflective_record
+
+
+def test_reflective_record_shape_and_content():
+ traj = {
+ "task": "Build an Express server",
+ "runOutcome": "succeeded",
+ "score": 0.5,
+ "turns": [
+ {
+ "iteration": 0,
+ "response": "first attempt",
+ "judgeFeedback": "missing route",
+ "criteriaResults": [
+ {"criterionId": "server_starts", "passed": True, "evaluated": True, "feedback": "ok"},
+ {"criterionId": "hello", "passed": False, "evaluated": True, "feedback": "no /"},
+ ],
+ },
+ ],
+ }
+ rec = build_reflective_record(traj, ["server_starts", "hello"])
+ assert set(rec.keys()) == {"Inputs", "Generated Outputs", "Feedback"}
+ assert rec["Inputs"] == "Build an Express server"
+ assert "first attempt" in rec["Generated Outputs"]
+ assert "Turn 0" in rec["Generated Outputs"]
+ # Feedback surfaces score, judge narrative and per-criterion pass/fail.
+ assert "Overall score: 0.500" in rec["Feedback"]
+ assert "missing route" in rec["Feedback"]
+ assert "[PASS] server_starts" in rec["Feedback"]
+ assert "[FAIL] hello" in rec["Feedback"]
+
+
+def test_skipped_criterion_flagged():
+ traj = {
+ "task": "t",
+ "runOutcome": "succeeded",
+ "score": 0.0,
+ "turns": [
+ {
+ "iteration": 0,
+ "response": "x",
+ "judgeFeedback": "",
+ "criteriaResults": [
+ {"criterionId": "a", "passed": False, "evaluated": True, "feedback": ""},
+ {"criterionId": "b", "passed": True, "evaluated": False, "feedback": ""},
+ ],
+ }
+ ],
+ }
+ rec = build_reflective_record(traj, ["a", "b"])
+ assert "SKIPPED" in rec["Feedback"]
+
+
+def test_error_trajectory_surfaces_error():
+ traj = {"task": "t", "score": 0.0, "turns": [], "error": "timeout"}
+ rec = build_reflective_record(traj, ["a"])
+ assert "Evaluation error: timeout" in rec["Feedback"]
+ assert rec["Generated Outputs"] == "(no turns)"
+
+
+def test_failed_outcome_noted():
+ traj = {"task": "t", "runOutcome": "failed", "score": 0.0, "turns": []}
+ rec = build_reflective_record(traj, ["a"])
+ assert "Run outcome: failed" in rec["Feedback"]
+
+
+def test_truncation_keeps_tail():
+ long_resp = "A" * 50 + "TAILMARK"
+ traj = {
+ "task": "t",
+ "runOutcome": "succeeded",
+ "score": 1.0,
+ "turns": [{"iteration": 0, "response": long_resp, "judgeFeedback": "", "criteriaResults": []}],
+ }
+ rec = build_reflective_record(traj, ["a"], max_chars=20)
+ assert rec["Generated Outputs"].startswith("...(truncated)...")
+ assert "TAILMARK" in rec["Generated Outputs"]
diff --git a/apps/gepa-optimizer/tests/test_scope_adapter.py b/apps/gepa-optimizer/tests/test_scope_adapter.py
new file mode 100644
index 000000000..f96cba7a2
--- /dev/null
+++ b/apps/gepa-optimizer/tests/test_scope_adapter.py
@@ -0,0 +1,106 @@
+import pytest
+
+from gepa_optimizer.scope_adapter import ScopeAdapter
+from gepa_optimizer.scope_client import RequestTimeout, SystemicScopeError
+
+
+class FakeClient:
+ """Stand-in for ScopeClient that returns canned run docs without network."""
+
+ def __init__(self, runs_by_task, *, fail=None):
+ # runs_by_task: task -> run dict; fail: task -> exception to raise
+ self.runs_by_task = runs_by_task
+ self.fail = fail or {}
+ self.timeout_seconds = 1.0
+ self.submitted = []
+
+ async def submit_request(self, http, *, task, criteria, agents_md=None, model=None,
+ experiment_id=None, agents_md_parent_ids=None, max_iterations=None):
+ self.submitted.append({"task": task, "agents_md": agents_md, "experiment_id": experiment_id})
+ if task in self.fail:
+ raise self.fail[task]
+ return {"_id": f"req-{task}"}
+
+ async def wait_for_completion(self, http, request_id, *, timeout_seconds, poll_interval_seconds):
+ task = request_id.removeprefix("req-")
+ return {"_id": request_id, "run": self.runs_by_task[task]}
+
+
+def _good_run(passed=True):
+ return {
+ "status": "done",
+ "outcome": "succeeded",
+ "turns": [
+ {
+ "iteration": 0,
+ "codingAgentResponse": "did the work",
+ "judgeFeedback": "looks good",
+ "criteriaResults": [{"criterionId": "a", "passed": passed, "evaluated": True, "feedback": "f"}],
+ }
+ ],
+ }
+
+
+def make_adapter(client):
+ return ScopeAdapter(
+ client,
+ model="claude-haiku-4.5",
+ experiment_id="exp-1",
+ max_iterations=3,
+ max_concurrency=2,
+ run_timeout_seconds=1,
+ poll_interval_seconds=0,
+ )
+
+
+def test_evaluate_scores_runs():
+ client = FakeClient({"t1": _good_run(True), "t2": _good_run(False)})
+ adapter = make_adapter(client)
+ batch = [{"task": "t1", "criteria": ["a"]}, {"task": "t2", "criteria": ["a"]}]
+ result = adapter.evaluate(batch, {"AGENTS.md": "# guide"}, capture_traces=True)
+ assert result.scores == [1.0, 0.0]
+ assert len(result.trajectories) == 2
+ # AGENTS.md was forwarded to the submission.
+ assert client.submitted[0]["agents_md"] == "# guide"
+ assert client.submitted[0]["experiment_id"] == "exp-1"
+
+
+def test_per_example_timeout_scores_zero_without_raising():
+ client = FakeClient({"t1": _good_run(True)}, fail={"t2": RequestTimeout("nope")})
+ adapter = make_adapter(client)
+ batch = [{"task": "t1", "criteria": ["a"]}, {"task": "t2", "criteria": ["a"]}]
+ result = adapter.evaluate(batch, {"AGENTS.md": "x"}, capture_traces=True)
+ assert result.scores == [1.0, 0.0]
+ # The failed example carries an error trajectory.
+ assert result.trajectories[1]["error"] == "nope"
+
+
+def test_systemic_majority_aborts():
+ client = FakeClient(
+ {"t1": _good_run(True)},
+ fail={"t1": SystemicScopeError("auth"), "t2": SystemicScopeError("auth")},
+ )
+ adapter = make_adapter(client)
+ batch = [{"task": "t1", "criteria": ["a"]}, {"task": "t2", "criteria": ["a"]}]
+ with pytest.raises(SystemicScopeError):
+ adapter.evaluate(batch, {"AGENTS.md": "x"}, capture_traces=False)
+
+
+def test_single_systemic_failure_does_not_abort():
+ # 1 of 2 systemic is not a majority, so the batch survives.
+ client = FakeClient({"t1": _good_run(True)}, fail={"t2": SystemicScopeError("blip")})
+ adapter = make_adapter(client)
+ batch = [{"task": "t1", "criteria": ["a"]}, {"task": "t2", "criteria": ["a"]}]
+ result = adapter.evaluate(batch, {"AGENTS.md": "x"}, capture_traces=False)
+ assert result.scores == [1.0, 0.0]
+
+
+def test_make_reflective_dataset_keys_component():
+ client = FakeClient({"t1": _good_run(False)})
+ adapter = make_adapter(client)
+ batch = [{"task": "t1", "criteria": ["a"]}]
+ eval_batch = adapter.evaluate(batch, {"AGENTS.md": "x"}, capture_traces=True)
+ ds = adapter.make_reflective_dataset({"AGENTS.md": "x"}, eval_batch, ["AGENTS.md"])
+ assert set(ds.keys()) == {"AGENTS.md"}
+ assert len(ds["AGENTS.md"]) == 1
+ assert "FAIL" in ds["AGENTS.md"][0]["Feedback"]
diff --git a/apps/gepa-optimizer/tests/test_scope_client.py b/apps/gepa-optimizer/tests/test_scope_client.py
new file mode 100644
index 000000000..e1149070a
--- /dev/null
+++ b/apps/gepa-optimizer/tests/test_scope_client.py
@@ -0,0 +1,141 @@
+import httpx
+import pytest
+
+from gepa_optimizer.scope_client import (
+ RequestFailedError,
+ RequestTimeout,
+ ScopeClient,
+ SystemicScopeError,
+)
+
+
+def make_client_and_http(handler):
+ transport = httpx.MockTransport(handler)
+ http = httpx.AsyncClient(transport=transport, base_url="http://test")
+ client = ScopeClient("http://test", worker="coder-acp-copilot", max_get_retries=2)
+ return client, http
+
+
+async def test_submit_request_builds_body_and_url():
+ captured = {}
+
+ def handler(request: httpx.Request) -> httpx.Response:
+ captured["url"] = str(request.url)
+ captured["body"] = request.read().decode()
+ return httpx.Response(200, json={"_id": "req-1"})
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ doc = await client.submit_request(
+ http,
+ task="do it",
+ criteria=["a", "b"],
+ agents_md="# guide",
+ model="claude-haiku-4.5",
+ experiment_id="exp-1",
+ agents_md_parent_ids=["p1"],
+ max_iterations=5,
+ )
+ assert doc["_id"] == "req-1"
+ assert "worker=coder-acp-copilot" in captured["url"]
+ import json
+
+ body = json.loads(captured["body"])
+ assert body["scenario"] == {"task": "do it", "criteria": ["a", "b"]}
+ assert body["agentsMd"] == "# guide"
+ assert body["model"] == "claude-haiku-4.5"
+ assert body["experimentId"] == "exp-1"
+ assert body["agentsMdParentIds"] == ["p1"]
+ assert body["maxIterations"] == 5
+
+
+async def test_submit_systemic_on_auth_error():
+ def handler(request: httpx.Request) -> httpx.Response:
+ return httpx.Response(401, text="no auth")
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ with pytest.raises(SystemicScopeError):
+ await client.submit_request(http, task="t", criteria=["a"])
+
+
+async def test_submit_systemic_on_bad_schema():
+ def handler(request: httpx.Request) -> httpx.Response:
+ return httpx.Response(400, text="bad body")
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ with pytest.raises(SystemicScopeError):
+ await client.submit_request(http, task="t", criteria=["a"])
+
+
+async def test_submit_per_example_on_404():
+ def handler(request: httpx.Request) -> httpx.Response:
+ return httpx.Response(404, text="not found")
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ with pytest.raises(RequestFailedError):
+ await client.submit_request(http, task="t", criteria=["a"])
+
+
+async def test_get_request_retries_then_succeeds():
+ calls = {"n": 0}
+
+ def handler(request: httpx.Request) -> httpx.Response:
+ calls["n"] += 1
+ if calls["n"] == 1:
+ return httpx.Response(503, text="busy")
+ return httpx.Response(200, json={"_id": "r", "run": {"status": "done"}})
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ doc = await client.get_request(http, "r")
+ assert doc["run"]["status"] == "done"
+ assert calls["n"] == 2
+
+
+async def test_get_request_systemic_after_retries_exhausted():
+ def handler(request: httpx.Request) -> httpx.Response:
+ return httpx.Response(503, text="busy")
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ with pytest.raises(SystemicScopeError):
+ await client.get_request(http, "r")
+
+
+async def test_wait_for_completion_polls_until_done():
+ statuses = ["queued", "processing", "done"]
+
+ def handler(request: httpx.Request) -> httpx.Response:
+ s = statuses.pop(0) if statuses else "done"
+ return httpx.Response(200, json={"_id": "r", "run": {"status": s}})
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ doc = await client.wait_for_completion(
+ http, "r", timeout_seconds=10, poll_interval_seconds=0
+ )
+ assert doc["run"]["status"] == "done"
+
+
+async def test_wait_for_completion_times_out():
+ def handler(request: httpx.Request) -> httpx.Response:
+ return httpx.Response(200, json={"_id": "r", "run": {"status": "processing"}})
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ with pytest.raises(RequestTimeout):
+ await client.wait_for_completion(
+ http, "r", timeout_seconds=0, poll_interval_seconds=0
+ )
+
+
+async def test_get_criterion_returns_none_on_404():
+ def handler(request: httpx.Request) -> httpx.Response:
+ return httpx.Response(404)
+
+ client, http = make_client_and_http(handler)
+ async with http:
+ assert await client.get_criterion(http, "missing") is None
diff --git a/apps/gepa-optimizer/tests/test_scoring.py b/apps/gepa-optimizer/tests/test_scoring.py
new file mode 100644
index 000000000..4a5b73101
--- /dev/null
+++ b/apps/gepa-optimizer/tests/test_scoring.py
@@ -0,0 +1,97 @@
+from gepa_optimizer.scoring import compute_run_score, compute_turn_scores
+
+
+def _turn(iteration, results):
+ return {"iteration": iteration, "criteriaResults": results}
+
+
+def _r(cid, passed, evaluated=True):
+ return {"criterionId": cid, "passed": passed, "evaluated": evaluated, "feedback": ""}
+
+
+def test_non_done_status_scores_zero():
+ run = {"status": "processing", "outcome": "succeeded", "turns": [_turn(0, [_r("a", True)])]}
+ assert compute_run_score(run, ["a"]) == 0.0
+
+
+def test_non_succeeded_outcome_scores_zero():
+ run = {"status": "done", "outcome": "failed", "turns": [_turn(0, [_r("a", True)])]}
+ assert compute_run_score(run, ["a"]) == 0.0
+
+
+def test_no_turns_scores_zero():
+ run = {"status": "done", "outcome": "succeeded", "turns": []}
+ assert compute_run_score(run, ["a"]) == 0.0
+
+
+def test_none_run_scores_zero():
+ assert compute_run_score(None, ["a"]) == 0.0
+
+
+def test_all_passed_single_turn():
+ run = {"status": "done", "outcome": "succeeded", "turns": [_turn(0, [_r("a", True), _r("b", True)])]}
+ assert compute_run_score(run, ["a", "b"]) == 1.0
+
+
+def test_half_passed():
+ run = {"status": "done", "outcome": "succeeded", "turns": [_turn(0, [_r("a", True), _r("b", False)])]}
+ assert compute_run_score(run, ["a", "b"]) == 0.5
+
+
+def test_skipped_counts_as_failed():
+ # b was skipped (evaluated False) because ancestor a failed.
+ run = {"status": "done", "outcome": "succeeded", "turns": [_turn(0, [_r("a", False), _r("b", True, evaluated=False)])]}
+ assert compute_run_score(run, ["a", "b"]) == 0.0
+
+
+def test_denominator_is_requested_criteria_not_returned():
+ # Scope omitted 'b' from results entirely; it must still count in the denominator as failed.
+ run = {"status": "done", "outcome": "succeeded", "turns": [_turn(0, [_r("a", True)])]}
+ assert compute_run_score(run, ["a", "b"]) == 0.5
+
+
+def test_mean_across_turns():
+ run = {
+ "status": "done",
+ "outcome": "succeeded",
+ "turns": [
+ _turn(0, [_r("a", False), _r("b", False)]), # 0.0
+ _turn(1, [_r("a", True), _r("b", True)]), # 1.0
+ ],
+ }
+ assert compute_run_score(run, ["a", "b"], "mean") == 0.5
+
+
+def test_final_strategy_uses_last_turn():
+ run = {
+ "status": "done",
+ "outcome": "succeeded",
+ "turns": [
+ _turn(0, [_r("a", False), _r("b", False)]), # 0.0
+ _turn(1, [_r("a", True), _r("b", True)]), # 1.0
+ ],
+ }
+ assert compute_run_score(run, ["a", "b"], "final") == 1.0
+
+
+def test_weighted_strategy():
+ run = {
+ "status": "done",
+ "outcome": "succeeded",
+ "turns": [
+ _turn(0, [_r("a", False), _r("b", False)]), # 0.0
+ _turn(1, [_r("a", True), _r("b", True)]), # 1.0
+ ],
+ }
+ # 0.8*final(1.0) + 0.2*mean(0.5) = 0.9
+ assert compute_run_score(run, ["a", "b"], "weighted") == 0.9
+
+
+def test_empty_requested_falls_back_to_returned():
+ run = {"status": "done", "outcome": "succeeded", "turns": [_turn(0, [_r("a", True), _r("b", False)])]}
+ assert compute_run_score(run, []) == 0.5
+
+
+def test_compute_turn_scores_order():
+ run = {"turns": [_turn(0, [_r("a", True)]), _turn(1, [_r("a", False)])]}
+ assert compute_turn_scores(run, ["a"]) == [1.0, 0.0]
diff --git a/apps/gepa-optimizer/uv.lock b/apps/gepa-optimizer/uv.lock
new file mode 100644
index 000000000..7bffb48e4
--- /dev/null
+++ b/apps/gepa-optimizer/uv.lock
@@ -0,0 +1,1696 @@
+version = 1
+revision = 2
+requires-python = ">=3.12"
+
+[[package]]
+name = "aiohappyeyeballs"
+version = "2.6.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/33/c6/61a2d7b7572279226bb2e7f61d7a19ca7c90da0329c93fa0d560cbf288d8/aiohappyeyeballs-2.6.2.tar.gz", hash = "sha256:e202810ee718bd01fc6ef49e8ea53d023d5cb6b581076d7925aa499fa55dbe64", size = 22591, upload-time = "2026-05-20T15:12:24.631Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/5f/fc/a7bf5b6e4e617b45f90f2d9d2a68519c249c81dd4fc2658c7a2a61c4f4b7/aiohappyeyeballs-2.6.2-py3-none-any.whl", hash = "sha256:4708045e2d7a6c6bdf8aafa8ed39649eaf926a4543b54560659129e3365953c4", size = 15062, upload-time = "2026-05-20T15:12:23.328Z" },
+]
+
+[[package]]
+name = "aiohttp"
+version = "3.14.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "aiohappyeyeballs" },
+ { name = "aiosignal" },
+ { name = "attrs" },
+ { name = "frozenlist" },
+ { name = "multidict" },
+ { name = "propcache" },
+ { name = "typing-extensions", marker = "python_full_version < '3.13'" },
+ { name = "yarl" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/ee/ab/93ce242f899b68c51b0578c027aafa791ab3614cb9345fa5d37b5f5c8e3e/aiohttp-3.14.0.tar.gz", hash = "sha256:2882de819734c715fd1b9c11c97e09fa020d14438203d1d354d8ed1702791c9b", size = 7940674, upload-time = "2026-06-01T19:41:02.763Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/89/97/2b6889bfb6b6847520d50d95eb8c4307a45e28aaca39faf4a9454b3d1b2f/aiohttp-3.14.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b29518c9c2ec7e373e68259206a137c7f4f5439c58baaec4b5ab3ab799850a4e", size = 750194, upload-time = "2026-06-01T19:37:48.164Z" },
+ { url = "https://files.pythonhosted.org/packages/21/e2/62634b7fff918ed98c3c6b2f0e70d520f7f28846cb412d451b04354c6459/aiohttp-3.14.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:dbec68ce61b64cb73cab4d33df9433427b1713c8bcccb181dce695c1b6f8e87c", size = 506966, upload-time = "2026-06-01T19:37:50.014Z" },
+ { url = "https://files.pythonhosted.org/packages/dd/fb/5ce075150828c797a5106f1c2fb26034e709d4289b9d2bf8b07f1e59fac6/aiohttp-3.14.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3cdf534aa455593e589302990c5097aa5c92c06c4262a20da22934f9186a5fff", size = 507527, upload-time = "2026-06-01T19:37:51.96Z" },
+ { url = "https://files.pythonhosted.org/packages/01/d5/405a0ae4e6b081754a3609c1c97c63a950e000a2def16046f1e736933a0e/aiohttp-3.14.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cb6c657104393b5fbff01a5f59b2023db74058a8077d94475d6c25d03882a108", size = 1762420, upload-time = "2026-06-01T19:37:53.839Z" },
+ { url = "https://files.pythonhosted.org/packages/ae/1d/e05a7c896b15a6bc6fb8fc5319eb437861c2c49c34559ef928add6590315/aiohttp-3.14.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:46fbbec4e4fab7428d4396a3823f9320e4560aa3113b89eeebce712c27c9ed5a", size = 1733672, upload-time = "2026-06-01T19:37:55.791Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/22/a72f7c459e195fa41bf4f7abd1f925b91fe91f8097e51c654229ba144a33/aiohttp-3.14.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2c2c7e05dd5335b298085abf45ddf98673934c3ee1c083d0b9ea13d4186ad500", size = 1805064, upload-time = "2026-06-01T19:37:57.931Z" },
+ { url = "https://files.pythonhosted.org/packages/80/50/e85bdaba0be59ca4838005ebfef4048fcdd5f35a02b07057a9a123394440/aiohttp-3.14.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3c7139100fbaae76515b73051d8f0aa3a3ff02e415eec8a8eee8e2223d9ba955", size = 1902125, upload-time = "2026-06-01T19:38:00.225Z" },
+ { url = "https://files.pythonhosted.org/packages/19/d8/51de5c6b971c27bb1ef620293b8d1ca611ec78736b34b3f6ccf68e4c8785/aiohttp-3.14.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:78d6f9286a629ce52728430afe18f8ed2b6c39a1fddb3802d7244b9983910ad2", size = 1783112, upload-time = "2026-06-01T19:38:02.641Z" },
+ { url = "https://files.pythonhosted.org/packages/73/ae/b4402bfde77e43dfb1b6ccff83c7b7ab63ed06b50c4754f0c5423fb374fe/aiohttp-3.14.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cc3c3e12cdaeb92d7dcf13db00e9f6b1956b910e47256e696df1cfa946d02159", size = 1586356, upload-time = "2026-06-01T19:38:04.637Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/05/750a3265ca4dc54a460bd0cb1121a8f2ce9171fce4a135fb47ea7fd594d2/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4d6a998191f5ebe3b8c28463ff72bc030250008b3193c402464efadd08b5ca02", size = 1723119, upload-time = "2026-06-01T19:38:06.713Z" },
+ { url = "https://files.pythonhosted.org/packages/37/01/8c0812c50b3b1b1c37b323bf170d6be8847a8f234060485b7d1e71953f60/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:0fc2b75ae8d169d853be2862d960be8550da6c5c65711d5476407eb3fdb006bd", size = 1757216, upload-time = "2026-06-01T19:38:08.736Z" },
+ { url = "https://files.pythonhosted.org/packages/47/2a/50fb98028a26887cbe48dcc1df92a90825615bc73b5584301304090cded8/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:16eee56bcc72d04600bc56c1759982c2385ec0b41d3fd3521f836bf64a0957ef", size = 1770500, upload-time = "2026-06-01T19:38:11.111Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/32/0ffd598a2fa2b9a423daf242e700cfdabda35d6e602394ad9ae58972c1c7/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:5a2e7ca615c3ddc15b82687e05a624e5f5cba3f1d6c20cb81172d70ea498451e", size = 1576224, upload-time = "2026-06-01T19:38:13.391Z" },
+ { url = "https://files.pythonhosted.org/packages/0b/f9/b9fc381dd9b66afb33f2634c40e229d106467be0afcabe79648631ab6712/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:f0b7b8bbbec3ce9467ee0ebe334622fd90624f593edd3136c567811453fc4fae", size = 1794252, upload-time = "2026-06-01T19:38:15.498Z" },
+ { url = "https://files.pythonhosted.org/packages/a8/fb/05d9214c975f23225a8cd5c439325e338c7c377b315480ef3871db51f54e/aiohttp-3.14.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5ba10966d4f03dd96a14365be4b8e37c327c76f11c3ca867116966cdd9f98066", size = 1760193, upload-time = "2026-06-01T19:38:17.624Z" },
+ { url = "https://files.pythonhosted.org/packages/d9/4b/02992fc4fb9e1b6673ee3f888a8e587a6447afda1f6f4aca776c148c2876/aiohttp-3.14.0-cp312-cp312-win32.whl", hash = "sha256:101df7779c80c0636014a6b2c6642acd3efb5b355d48347c9d7dfb720aee9430", size = 448650, upload-time = "2026-06-01T19:38:19.545Z" },
+ { url = "https://files.pythonhosted.org/packages/39/e9/246532214c3abda518477cbaaf16d420295ad8effa5233844cbb38f299ab/aiohttp-3.14.0-cp312-cp312-win_amd64.whl", hash = "sha256:b0a5747586d4467efd1f932710b269131c9717a872dce082cd92a00c1c13123a", size = 476145, upload-time = "2026-06-01T19:38:21.505Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/c3/63f8c20090048915711598b0adf475b149216d736157961de06480a45b15/aiohttp-3.14.0-cp312-cp312-win_arm64.whl", hash = "sha256:5f1c5be60add78fabb4aacd13c5a348ae79d2fcbfc7fa78da8f1eb192273b370", size = 444250, upload-time = "2026-06-01T19:38:24.027Z" },
+ { url = "https://files.pythonhosted.org/packages/21/61/d11f7d9a3144bffe825247d6367cd93053666da50b94707c9129c78868d5/aiohttp-3.14.0-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:25400d710641a8040bf022a8a99f579e581ffa1c5bd42c33255d7d6f3957c127", size = 502399, upload-time = "2026-06-01T19:38:25.955Z" },
+ { url = "https://files.pythonhosted.org/packages/4f/9b/a7e317625d36356844f8bb022cabd305b541f968856cc3c2e0b58e53ee6e/aiohttp-3.14.0-cp313-cp313-android_21_x86_64.whl", hash = "sha256:c5492b9929826e07cc3fcb9739ae87aab05dff6b5e67a9b73fd1700c6d008981", size = 510068, upload-time = "2026-06-01T19:38:27.828Z" },
+ { url = "https://files.pythonhosted.org/packages/11/41/cc2d2cfbfbdc3126ba258f3cd27d1ac8a33492ae3c35a4583ee21f0ba7f1/aiohttp-3.14.0-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:3366751d68d237c621264233a32f3078bbc21b7904ab90a77e03d21390c742c6", size = 481670, upload-time = "2026-06-01T19:38:29.836Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/07/381f4023c3b08cb616e520f566d8c58957abad54e56441d41fe67cfb0195/aiohttp-3.14.0-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:57ea07d28695a7a40304d42251892a8df765e5588c10ee32afeddcd5df33c0a2", size = 487591, upload-time = "2026-06-01T19:38:31.704Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/4d/4506fdb7a022bdf70011a3bbb4ca00c5c570026ef6a3c5bd7bc70c39089c/aiohttp-3.14.0-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:076cb014191ae2e65d949e1ad01f1dcfe33e32789b5172510f3e79c79fc04d50", size = 496503, upload-time = "2026-06-01T19:38:33.6Z" },
+ { url = "https://files.pythonhosted.org/packages/ef/7d/c814111e04894a45d9e2defc94443879a6f118d9633d5fedfe6e2e8af5f0/aiohttp-3.14.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2f3fc37054564dee64a855b5b092d87ec35dcddfaabf7dacb1c8a2b1f83dc0a9", size = 745870, upload-time = "2026-06-01T19:38:36.013Z" },
+ { url = "https://files.pythonhosted.org/packages/c6/ee/80eee0efddfe187e7cd05027086b7ce1c0e492e82a4eda58f5c5543a44a0/aiohttp-3.14.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8fcaef74d2ab0f607d7ff85a0d15e21bb5a258c4a58df1908396eb50d7f4ed3c", size = 505588, upload-time = "2026-06-01T19:38:38.282Z" },
+ { url = "https://files.pythonhosted.org/packages/d6/f8/0f28f04eef75d52fc9c715dde7ce9c0abb810fd20cfeb0fea7afd2ab1e98/aiohttp-3.14.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e4c01b0bfc6209590960e68eac083cd22d5d87c21f974dd6208cafa5d3542bc8", size = 504492, upload-time = "2026-06-01T19:38:40.611Z" },
+ { url = "https://files.pythonhosted.org/packages/ff/db/44c755232085545065c94378dfce38641b1aee647f4939fcd32f5b32e719/aiohttp-3.14.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f12eb7896e81caf403a2b18c9406426f1207361e7239c057ab29c076d4257e83", size = 1752111, upload-time = "2026-06-01T19:38:42.682Z" },
+ { url = "https://files.pythonhosted.org/packages/5e/6a/42e030a46743841414402a3b00cd3d78419055e86c66fb5822c14b5abfc6/aiohttp-3.14.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6c79a044cacf360ec46738d863d2f41c9300d2a06ef4a7402ea0df306a350e61", size = 1729674, upload-time = "2026-06-01T19:38:44.79Z" },
+ { url = "https://files.pythonhosted.org/packages/34/26/3199beb415202e3108e7b83ecebe10914d806d33fb9860c3e4aa60a19be3/aiohttp-3.14.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:85e0675f47be4eff0636bf88c02140ea89168ae0df3ff1f3f464e9de9610d277", size = 1798808, upload-time = "2026-06-01T19:38:47.01Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/94/b9b6fcf0ee17c21d0d19fb8c22bf83ad18f82e702a9c3bd901a868f5e446/aiohttp-3.14.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7b33e751cab03fdc960095b1e326cb5a03f5ee577d6ded59f3d1c100f8668882", size = 1891921, upload-time = "2026-06-01T19:38:49.233Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/a3/3800dbd095cb2bb165a7ea5d94d790914677e27f45638c7d80e3f34c8945/aiohttp-3.14.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:26d9224c6dd7f5c749aba4f61315a894601448b28d94d12f4dea0903e26d2096", size = 1777241, upload-time = "2026-06-01T19:38:52.04Z" },
+ { url = "https://files.pythonhosted.org/packages/21/2a/45be91ad1b860508557448d4cc2e165a2ee68dd865657b73bf66cc5a00fb/aiohttp-3.14.0-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6281aecdf2732940f4fe06bd6adec5ae4d59b78b080b8e3a6b81467301010988", size = 1579554, upload-time = "2026-06-01T19:38:54.508Z" },
+ { url = "https://files.pythonhosted.org/packages/b4/3d/dc94df99ed1511fdf28314f722643ed334112643cab00223577085e788c4/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:23e8314e7aed8576fbe33314d218bd81447a3adbc91dc36f1163bf583cd3084c", size = 1714864, upload-time = "2026-06-01T19:38:56.788Z" },
+ { url = "https://files.pythonhosted.org/packages/ae/e4/1f1c8acbb3acd5c8f795473b92c9c3d44eb60a5692c6104256c8a1c83a0c/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3b54fbff46127aeafdd764cecd0d99fa2f24a0e37ea5c18a7c3a4ac450df1db3", size = 1749803, upload-time = "2026-06-01T19:38:59.367Z" },
+ { url = "https://files.pythonhosted.org/packages/0b/c8/c45ea6e7ed84cebba939b9c334498a045ba19d79c61b0110df5f21580de3/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:b27d89af91a555f58e08e4902dbcbc48862fd40095720ca705990476bd93b7ac", size = 1765023, upload-time = "2026-06-01T19:39:01.651Z" },
+ { url = "https://files.pythonhosted.org/packages/a8/a1/a932941784432962fe390e1066823aaef64b4e5ac9fa595df57b5fe472a9/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:25d2326a4967bf705a9f9913a13005e93b6020ad8a9f6bd6bd78850d5171332e", size = 1571671, upload-time = "2026-06-01T19:39:04.044Z" },
+ { url = "https://files.pythonhosted.org/packages/b0/01/e1280feac522597a4d46eb67a0cdfa053cfae263033030b761ab146f29fb/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:a1d209375c503472b3c0a340cdf3c55fcd82e84b46dda7caeaced59faba373ec", size = 1789904, upload-time = "2026-06-01T19:39:06.294Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/10/ab28818262f4d26bdb47ed5f1fc7999b69e2fc6e0370b02d0f49011f45ea/aiohttp-3.14.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:666c7c5036df57b693026398b69b41874a1931ac5b3485fd910e57bfac253869", size = 1754516, upload-time = "2026-06-01T19:39:08.788Z" },
+ { url = "https://files.pythonhosted.org/packages/af/cc/c122eabd7a1b7e0c9bbdd6be60e4715905b858399145d9df872bb94f1427/aiohttp-3.14.0-cp313-cp313-win32.whl", hash = "sha256:23f094a1ef64823fd35854ddf5c7a80a078162f37f9d2f7c6142b51a6affa456", size = 448656, upload-time = "2026-06-01T19:39:11.171Z" },
+ { url = "https://files.pythonhosted.org/packages/41/a5/bab07d79848a00eedd8ed979ccb302aaea3ac6eb9fa16bd0ed87135869b4/aiohttp-3.14.0-cp313-cp313-win_amd64.whl", hash = "sha256:e03abdaa17d553f17e1d1d06bb266b3970106c78051d06795723e748d8e49d11", size = 475803, upload-time = "2026-06-01T19:39:13.439Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/a0/f03ade8566c153666a3871afccbedf6d99911da006325e1fc6cf72a2de99/aiohttp-3.14.0-cp313-cp313-win_arm64.whl", hash = "sha256:acdb400538cf4769543548bb5d1eb23d39bed4f96554a6078cb728c7cb2c268b", size = 443889, upload-time = "2026-06-01T19:39:15.945Z" },
+ { url = "https://files.pythonhosted.org/packages/28/03/5f36ab196a88ba5e9648ae5643e6531e67a3a8c0e96f9c6510ff41540fec/aiohttp-3.14.0-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:363ef9e91014e7891679bfb2ac0a7c6ea93435dbbfd10ecf41b9f06fcf506c5f", size = 503330, upload-time = "2026-06-01T19:39:18.195Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/ce/8b49ec2f30f68e02f314f4832186cd45e583360a5a386058be36855d23b6/aiohttp-3.14.0-cp314-cp314-android_24_x86_64.whl", hash = "sha256:884a4edbdad77be9d0ef36142c8b504351b170df0bf62b51e784fadabf311c42", size = 509822, upload-time = "2026-06-01T19:39:20.396Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/fe/6edbf5d39bf29322b6816365b17ed8ede4dace164a3aea1abcd30110eb78/aiohttp-3.14.0-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:70ea956f6cc4a37620966b56c2e205d88ca3e6d85ec063277e414b1035cddad3", size = 483329, upload-time = "2026-06-01T19:39:22.607Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/5a/fae531bdbc6456fb6241f46b7b81e4d8a0dd3fc09118a0055dc7141ac1ec/aiohttp-3.14.0-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:ea3b9806c89f61da22fddf1f12dd524fb368e5e28f1261fbdafe5c3cd8ce893b", size = 489502, upload-time = "2026-06-01T19:39:24.881Z" },
+ { url = "https://files.pythonhosted.org/packages/36/f4/48a7b0414db7fed77a03d5dde34508c026afd83510ab6bca08c313855776/aiohttp-3.14.0-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:a071be341c2bd9b0188e62d173509f024e0a35b1c342c53c50f8daaeda8c3bd8", size = 497357, upload-time = "2026-06-01T19:39:27.197Z" },
+ { url = "https://files.pythonhosted.org/packages/75/75/e85a13a370acc007fca5feb1fd1b88ac2d8426e6dadd625479b7cadd55a3/aiohttp-3.14.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:198cfe61bf253b19da1fb3e0fa122249dc4f14c12709493fed8054aa0411cc76", size = 750898, upload-time = "2026-06-01T19:39:29.563Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/e4/3d637f800c724eff0e2bed64df72557444482366fd0a35b0cec0e6968f6c/aiohttp-3.14.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:9dc203d6ce6b9106d54e2a93f41dfdfebfbca2d99962ba503bfd3e5921a6549e", size = 506986, upload-time = "2026-06-01T19:39:31.872Z" },
+ { url = "https://files.pythonhosted.org/packages/1d/df/35161f3598bf7501d2b2a805b41ab4f45a2e34150c421bcb4ef8c0d281a7/aiohttp-3.14.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:9e19d17ab02bf16832a2c8c0d55a486792c5b1645665652ee9531aebcc30cb72", size = 508033, upload-time = "2026-06-01T19:39:34.137Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/39/b36e5d3d31e850fb4691dd3e941684ac490a2559249f6fa634b6b0fdf020/aiohttp-3.14.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d925fba0c14d5b498a8028b0107beebdfd16c5d48d702ff54f879cb017aaaca3", size = 1746213, upload-time = "2026-06-01T19:39:36.654Z" },
+ { url = "https://files.pythonhosted.org/packages/b1/28/24e1409e605a9aa5d84abe0e2acb365354b70ae56d40948101cabe3341ab/aiohttp-3.14.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d33e61021222ce7f9792bcac870d6f58d8adfceda33ab857b01264f4560f2c5f", size = 1705862, upload-time = "2026-06-01T19:39:38.968Z" },
+ { url = "https://files.pythonhosted.org/packages/8c/d0/e5eb3ff1daeaf644c7e36a957517672494122628e067c38b263fa04eda77/aiohttp-3.14.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:44eca38755d0105bb32f47d085f5dd449846a449e1245fc105889e3279dcf8e3", size = 1798909, upload-time = "2026-06-01T19:39:41.334Z" },
+ { url = "https://files.pythonhosted.org/packages/d3/ba/8943f906f0570342886ababb9a722a44e360f786a028c5e0b0e29e3f735b/aiohttp-3.14.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f13087e06f68fea4941c21a0c541c00553aa16e4f8fd7bbe2b198df761e964d6", size = 1868892, upload-time = "2026-06-01T19:39:43.807Z" },
+ { url = "https://files.pythonhosted.org/packages/3a/05/27df32c844b2156e1675a8d8ec22d963e3c8ba469ed7ceb1863320c7b521/aiohttp-3.14.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ff82be7f1ef73634cb77890a770743239bc3d487b848669be1c599889336dc0a", size = 1751659, upload-time = "2026-06-01T19:39:46.398Z" },
+ { url = "https://files.pythonhosted.org/packages/7f/62/da182e5910ab912b2e88aa919b61a16046a37a95714a5795b02eb57b2d18/aiohttp-3.14.0-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a150c0875ac8fd87f1c398650841308a30d65facf7416b12dbdb9cfdcbe5a48c", size = 1578775, upload-time = "2026-06-01T19:39:48.902Z" },
+ { url = "https://files.pythonhosted.org/packages/66/e3/53c67097e8a5ce98625e91e3fa7f43c9c6940de680345d03b3509a72a078/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:edc01ea4e1ec5a1649a28866262bf24195889ff7b27bdd947029a6086741de9b", size = 1710090, upload-time = "2026-06-01T19:39:51.392Z" },
+ { url = "https://files.pythonhosted.org/packages/dd/55/0e2732ca598c7a4dfe8a775662376d0ca2977cb1030e48386d4da5d9a456/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:540632bf882ff8fc88f2e1697be0761578e89e0d79fb4a8a6d65dc5da7e729d4", size = 1715016, upload-time = "2026-06-01T19:39:53.807Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/96/f0b73730798c9ca525afc30b39f1f81bbe24e245d9654c54d3b39d63212d/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:860a86bc2c80237f5dff52edcf427e10a8d8352271fd84845429a3e60199e02c", size = 1763810, upload-time = "2026-06-01T19:39:56.31Z" },
+ { url = "https://files.pythonhosted.org/packages/71/cc/11acb6c4518f448323405a7312b6f255d0f974a34373ad1db7633c4aadc8/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:5cbd50e6a50d6b99283a826b18cbdebf65b0797689a7535cb0e9dd37be0f63c3", size = 1573064, upload-time = "2026-06-01T19:39:58.718Z" },
+ { url = "https://files.pythonhosted.org/packages/de/2d/28c31dde0a7dc98c0ee7d0da2ddcec3f7688c4fc131e5989e278d0c03c0a/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:20144819e99db593e22bbd2f3f2691a5e149f879142d6b8670254708853ff4fb", size = 1775765, upload-time = "2026-06-01T19:40:01.195Z" },
+ { url = "https://files.pythonhosted.org/packages/b8/69/155c4ef3aec96417d47024800472b33b16c5d8a665371dcd044c2afdf25d/aiohttp-3.14.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:26b6d79aa54cb4ed50cc7d41ed14e99e0f1fc8e7c2d42f2e05b37aea897b2b52", size = 1733716, upload-time = "2026-06-01T19:40:03.631Z" },
+ { url = "https://files.pythonhosted.org/packages/5f/44/6126116fd8a316b712bb615660b855c78466bb67ba1bb1742427eafcf7ac/aiohttp-3.14.0-cp314-cp314-win32.whl", hash = "sha256:106ed074a856f3e21d186b8579e2c8afb6da598e267cdaab01059e13db2fc44d", size = 453684, upload-time = "2026-06-01T19:40:06.277Z" },
+ { url = "https://files.pythonhosted.org/packages/a2/d7/eff4c58a88c5cac5e38b55f44fb8a6d3929c3cbd77356e383e094d3220bd/aiohttp-3.14.0-cp314-cp314-win_amd64.whl", hash = "sha256:4f770846edae8f00ecc57af825bce811f787f87a7dcf0e90d191790efe5b31f7", size = 481758, upload-time = "2026-06-01T19:40:08.653Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/ed/17b5bd9fbcb46e688f02e572f517754a9a75831e7b54702f027761dc4fa5/aiohttp-3.14.0-cp314-cp314-win_arm64.whl", hash = "sha256:acf1581c4f21ed4b80a2dded504d87b055a071a84d5737ea966435f768275ac6", size = 450557, upload-time = "2026-06-01T19:40:11.03Z" },
+ { url = "https://files.pythonhosted.org/packages/12/34/6180103ce9aabc8ebff3f7bb55a1228ffe60f61042823031d9692cb7b101/aiohttp-3.14.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:6aa1a40f9cbb3da9f80714c5966b8946c21e6a2530d809b9498b33161e3c8733", size = 787878, upload-time = "2026-06-01T19:40:13.401Z" },
+ { url = "https://files.pythonhosted.org/packages/92/e9/08954a40e8b7baa3d8beadd2b074b186e9b1e9c8ddabc288678a6265de50/aiohttp-3.14.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b62af5a8cc96a194eaa01a9ed7b34a3ffa58d3d8daaa1a0d7a749353ad12d228", size = 524400, upload-time = "2026-06-01T19:40:15.972Z" },
+ { url = "https://files.pythonhosted.org/packages/08/6a/b5965a634ac4d5ba99a463314cf4ab214ca073fcdc38a15e0294273701fc/aiohttp-3.14.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6eb63b1417efaf7d1002a6ad034a40d44376afcc16508a57f8e74b49ad26a095", size = 527904, upload-time = "2026-06-01T19:40:18.28Z" },
+ { url = "https://files.pythonhosted.org/packages/06/b4/932bcdd850c354d9bcca30f360e475d7852e30413fbbd44b182782ed5432/aiohttp-3.14.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c20b9ad156a79eb97be5cf9e069eec01d2f0dc8472ffbd75299a8b2d4c2cbbde", size = 1912162, upload-time = "2026-06-01T19:40:20.825Z" },
+ { url = "https://files.pythonhosted.org/packages/c6/85/ce79bab0310d2e3fd2d7bc7e44412abeff7c8338f8a21dd0f2f1714989e5/aiohttp-3.14.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:40ae7b0642c25632c7eabc4a04754012691864d2a1b93becf7cddb76027b838a", size = 1778813, upload-time = "2026-06-01T19:40:23.726Z" },
+ { url = "https://files.pythonhosted.org/packages/05/54/ba62ac2d1bc87e010aad23751e383b8794e45d931df67677313a2da78823/aiohttp-3.14.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:95f5217e76a046b9f228a101717ef8d42b1eb3d9d196d15202db5bf41df88936", size = 1899969, upload-time = "2026-06-01T19:40:26.406Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/82/7cc7907725d83a19f31551334061e1ab8e108b1d7ac52632a2a844a4acb5/aiohttp-3.14.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1a4a9f17e85b80878c176695c1998c790e83731d8271881e5d356488652a1f9e", size = 1991771, upload-time = "2026-06-01T19:40:29.061Z" },
+ { url = "https://files.pythonhosted.org/packages/d0/1c/a57de71a4508c93a830b77c28af3d08cd97f606dedfc6b94275347744508/aiohttp-3.14.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:145262119b07d7f95abc1839add35ba2bfc84551d4b4660ca11542c0b215455b", size = 1868606, upload-time = "2026-06-01T19:40:31.843Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/ae/3839726cd49150a53ed340cc24ce5ba09d4c2117020ef9d45542bec5eb2f/aiohttp-3.14.0-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:49a33ded29b0b2fa7a367a02cf0fb89af602bb87542a16177ec8ce1c9c51d12a", size = 1665437, upload-time = "2026-06-01T19:40:35.01Z" },
+ { url = "https://files.pythonhosted.org/packages/35/1e/c237923232c7da7f0392ea25d89fc5e60c0e93f685f4ebca8e7bcdd5271c/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:2cc736a9c9fc2bc4dd71fd404815741b6573df27c3f985948ec4076989ac57de", size = 1834090, upload-time = "2026-06-01T19:40:37.733Z" },
+ { url = "https://files.pythonhosted.org/packages/98/02/a5a7a2524f92d3911761b405a7c067c751891942144adc13e2ad79611e39/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:b4141a3e5342ee3053a9cab54d25b64ed28289c1041e4c54b3d99839314d90ce", size = 1816907, upload-time = "2026-06-01T19:40:40.46Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/76/a8b9f0d09234d516af9f2d7dd715557f33b5da3b0b56ead41d1170e86e3c/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:e30871b2d58996cb81aac52d2b1d15ac05257131ef0f90f18c2115a380fbfe7c", size = 1840382, upload-time = "2026-06-01T19:40:43.48Z" },
+ { url = "https://files.pythonhosted.org/packages/c9/8e/140e715a0a4bbc211979ea30ec8396ad2ed5bf90ab87d8058fc4668b1923/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:667b881d083ccae3900ea5a241e17e5007ca78844c53ed389bb63d48f729d9c7", size = 1659497, upload-time = "2026-06-01T19:40:46.265Z" },
+ { url = "https://files.pythonhosted.org/packages/10/c7/7ba5de8af9650b9767b063c675427b8685f43fa7ce563673a7bc3af60f08/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:b584dfe615d151e9b8f0a8ecb3aee6147f2927ec5b95ba25fe621f5377510928", size = 1870829, upload-time = "2026-06-01T19:40:49.583Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/bc/2aaab2f85cadb26ea59c091fa2b8e370d625154b5c14b478f1b489d07551/aiohttp-3.14.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6199707cc40e0e9cd39c36fbc97bec416c704e1d0ddce03412bb3b3e6a90ccd0", size = 1832281, upload-time = "2026-06-01T19:40:52.303Z" },
+ { url = "https://files.pythonhosted.org/packages/39/98/31b9ad9fbc01f0075ee7221002df5fd2d10b647f451ca5f30edc802d9dd6/aiohttp-3.14.0-cp314-cp314t-win32.whl", hash = "sha256:a8d93334d4961c9d566b1f046c81dee475b7c21eb730728d38237bfa70d1c8e6", size = 490597, upload-time = "2026-06-01T19:40:54.937Z" },
+ { url = "https://files.pythonhosted.org/packages/59/1f/299b21441c8de42ff70fddc7cfe65e92f810abcf740739a09b56f7835364/aiohttp-3.14.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2d2ffe9b614f50f069068b3b52e73414e4107fc10b7efc939a76acff9251fdd2", size = 525789, upload-time = "2026-06-01T19:40:57.306Z" },
+ { url = "https://files.pythonhosted.org/packages/70/11/7f83fcba9ee05d4c54d61b3f8104da0d43a59adac44dd28effc0c9a10422/aiohttp-3.14.0-cp314-cp314t-win_arm64.whl", hash = "sha256:7a3fc4358e65826c515350f199c210de747cf669998211b1ee6c2e46de364b24", size = 467399, upload-time = "2026-06-01T19:40:59.993Z" },
+]
+
+[[package]]
+name = "aiosignal"
+version = "1.4.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "frozenlist" },
+ { name = "typing-extensions", marker = "python_full_version < '3.13'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" },
+]
+
+[[package]]
+name = "annotated-doc"
+version = "0.0.4"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" },
+]
+
+[[package]]
+name = "annotated-types"
+version = "0.7.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" },
+]
+
+[[package]]
+name = "anyio"
+version = "4.13.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "idna" },
+ { name = "typing-extensions", marker = "python_full_version < '3.13'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/19/14/2c5dd9f512b66549ae92767a9c7b330ae88e1932ca57876909410251fe13/anyio-4.13.0.tar.gz", hash = "sha256:334b70e641fd2221c1505b3890c69882fe4a2df910cba14d97019b90b24439dc", size = 231622, upload-time = "2026-03-24T12:59:09.671Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/da/42/e921fccf5015463e32a3cf6ee7f980a6ed0f395ceeaa45060b61d86486c2/anyio-4.13.0-py3-none-any.whl", hash = "sha256:08b310f9e24a9594186fd75b4f73f4a4152069e3853f1ed8bfbf58369f4ad708", size = 114353, upload-time = "2026-03-24T12:59:08.246Z" },
+]
+
+[[package]]
+name = "attrs"
+version = "26.1.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" },
+]
+
+[[package]]
+name = "certifi"
+version = "2026.5.20"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/f3/ce/ee2ecad540810a79593028e88299baeae54d346cc7a0d94b6199988b89b1/certifi-2026.5.20.tar.gz", hash = "sha256:69dea482ab64caa7b9f6aba1c6bf48bb6a5448d1c0f1b17ab42ad8c763a5344d", size = 135422, upload-time = "2026-05-20T11:46:50.073Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/59/8c/57e832b7af6d7c5abe66eb3fbe3a3a32f4d11ea23a1aa7131371035be991/certifi-2026.5.20-py3-none-any.whl", hash = "sha256:3c52e209ba0a4ad7aebe60436a4ab349c39e1e602e8c134221e546902ad25897", size = 134134, upload-time = "2026-05-20T11:46:48.578Z" },
+]
+
+[[package]]
+name = "charset-normalizer"
+version = "3.4.7"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/e7/a1/67fe25fac3c7642725500a3f6cfe5821ad557c3abb11c9d20d12c7008d3e/charset_normalizer-3.4.7.tar.gz", hash = "sha256:ae89db9e5f98a11a4bf50407d4363e7b09b31e55bc117b4f7d80aab97ba009e5", size = 144271, upload-time = "2026-04-02T09:28:39.342Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/0c/eb/4fc8d0a7110eb5fc9cc161723a34a8a6c200ce3b4fbf681bc86feee22308/charset_normalizer-3.4.7-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:eca9705049ad3c7345d574e3510665cb2cf844c2f2dcfe675332677f081cbd46", size = 311328, upload-time = "2026-04-02T09:26:24.331Z" },
+ { url = "https://files.pythonhosted.org/packages/f8/e3/0fadc706008ac9d7b9b5be6dc767c05f9d3e5df51744ce4cc9605de7b9f4/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6178f72c5508bfc5fd446a5905e698c6212932f25bcdd4b47a757a50605a90e2", size = 208061, upload-time = "2026-04-02T09:26:25.568Z" },
+ { url = "https://files.pythonhosted.org/packages/42/f0/3dd1045c47f4a4604df85ec18ad093912ae1344ac706993aff91d38773a2/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e1421b502d83040e6d7fb2fb18dff63957f720da3d77b2fbd3187ceb63755d7b", size = 229031, upload-time = "2026-04-02T09:26:26.865Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/67/675a46eb016118a2fbde5a277a5d15f4f69d5f3f5f338e5ee2f8948fcf43/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:edac0f1ab77644605be2cbba52e6b7f630731fc42b34cb0f634be1a6eface56a", size = 225239, upload-time = "2026-04-02T09:26:28.044Z" },
+ { url = "https://files.pythonhosted.org/packages/4b/f8/d0118a2f5f23b02cd166fa385c60f9b0d4f9194f574e2b31cef350ad7223/charset_normalizer-3.4.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5649fd1c7bade02f320a462fdefd0b4bd3ce036065836d4f42e0de958038e116", size = 216589, upload-time = "2026-04-02T09:26:29.239Z" },
+ { url = "https://files.pythonhosted.org/packages/b1/f1/6d2b0b261b6c4ceef0fcb0d17a01cc5bc53586c2d4796fa04b5c540bc13d/charset_normalizer-3.4.7-cp312-cp312-manylinux_2_31_armv7l.whl", hash = "sha256:203104ed3e428044fd943bc4bf45fa73c0730391f9621e37fe39ecf477b128cb", size = 202733, upload-time = "2026-04-02T09:26:30.5Z" },
+ { url = "https://files.pythonhosted.org/packages/6f/c0/7b1f943f7e87cc3db9626ba17807d042c38645f0a1d4415c7a14afb5591f/charset_normalizer-3.4.7-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:298930cec56029e05497a76988377cbd7457ba864beeea92ad7e844fe74cd1f1", size = 212652, upload-time = "2026-04-02T09:26:31.709Z" },
+ { url = "https://files.pythonhosted.org/packages/38/dd/5a9ab159fe45c6e72079398f277b7d2b523e7f716acc489726115a910097/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:708838739abf24b2ceb208d0e22403dd018faeef86ddac04319a62ae884c4f15", size = 211229, upload-time = "2026-04-02T09:26:33.282Z" },
+ { url = "https://files.pythonhosted.org/packages/d5/ff/531a1cad5ca855d1c1a8b69cb71abfd6d85c0291580146fda7c82857caa1/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:0f7eb884681e3938906ed0434f20c63046eacd0111c4ba96f27b76084cd679f5", size = 203552, upload-time = "2026-04-02T09:26:34.845Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/4c/a5fb52d528a8ca41f7598cb619409ece30a169fbdf9cdce592e53b46c3a6/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4dc1e73c36828f982bfe79fadf5919923f8a6f4df2860804db9a98c48824ce8d", size = 230806, upload-time = "2026-04-02T09:26:36.152Z" },
+ { url = "https://files.pythonhosted.org/packages/59/7a/071feed8124111a32b316b33ae4de83d36923039ef8cf48120266844285b/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:aed52fea0513bac0ccde438c188c8a471c4e0f457c2dd20cdbf6ea7a450046c7", size = 212316, upload-time = "2026-04-02T09:26:37.672Z" },
+ { url = "https://files.pythonhosted.org/packages/fd/35/f7dba3994312d7ba508e041eaac39a36b120f32d4c8662b8814dab876431/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:fea24543955a6a729c45a73fe90e08c743f0b3334bbf3201e6c4bc1b0c7fa464", size = 227274, upload-time = "2026-04-02T09:26:38.93Z" },
+ { url = "https://files.pythonhosted.org/packages/8a/2d/a572df5c9204ab7688ec1edc895a73ebded3b023bb07364710b05dd1c9be/charset_normalizer-3.4.7-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:bb6d88045545b26da47aa879dd4a89a71d1dce0f0e549b1abcb31dfe4a8eac49", size = 218468, upload-time = "2026-04-02T09:26:40.17Z" },
+ { url = "https://files.pythonhosted.org/packages/86/eb/890922a8b03a568ca2f336c36585a4713c55d4d67bf0f0c78924be6315ca/charset_normalizer-3.4.7-cp312-cp312-win32.whl", hash = "sha256:2257141f39fe65a3fdf38aeccae4b953e5f3b3324f4ff0daf9f15b8518666a2c", size = 148460, upload-time = "2026-04-02T09:26:41.416Z" },
+ { url = "https://files.pythonhosted.org/packages/35/d9/0e7dffa06c5ab081f75b1b786f0aefc88365825dfcd0ac544bdb7b2b6853/charset_normalizer-3.4.7-cp312-cp312-win_amd64.whl", hash = "sha256:5ed6ab538499c8644b8a3e18debabcd7ce684f3fa91cf867521a7a0279cab2d6", size = 159330, upload-time = "2026-04-02T09:26:42.554Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/5d/481bcc2a7c88ea6b0878c299547843b2521ccbc40980cb406267088bc701/charset_normalizer-3.4.7-cp312-cp312-win_arm64.whl", hash = "sha256:56be790f86bfb2c98fb742ce566dfb4816e5a83384616ab59c49e0604d49c51d", size = 147828, upload-time = "2026-04-02T09:26:44.075Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/3b/66777e39d3ae1ddc77ee606be4ec6d8cbd4c801f65e5a1b6f2b11b8346dd/charset_normalizer-3.4.7-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f496c9c3cc02230093d8330875c4c3cdfc3b73612a5fd921c65d39cbcef08063", size = 309627, upload-time = "2026-04-02T09:26:45.198Z" },
+ { url = "https://files.pythonhosted.org/packages/2e/4e/b7f84e617b4854ade48a1b7915c8ccfadeba444d2a18c291f696e37f0d3b/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0ea948db76d31190bf08bd371623927ee1339d5f2a0b4b1b4a4439a65298703c", size = 207008, upload-time = "2026-04-02T09:26:46.824Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/bb/ec73c0257c9e11b268f018f068f5d00aa0ef8c8b09f7753ebd5f2880e248/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a277ab8928b9f299723bc1a2dabb1265911b1a76341f90a510368ca44ad9ab66", size = 228303, upload-time = "2026-04-02T09:26:48.397Z" },
+ { url = "https://files.pythonhosted.org/packages/85/fb/32d1f5033484494619f701e719429c69b766bfc4dbc61aa9e9c8c166528b/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3bec022aec2c514d9cf199522a802bd007cd588ab17ab2525f20f9c34d067c18", size = 224282, upload-time = "2026-04-02T09:26:49.684Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/07/330e3a0dda4c404d6da83b327270906e9654a24f6c546dc886a0eb0ffb23/charset_normalizer-3.4.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e044c39e41b92c845bc815e5ae4230804e8e7bc29e399b0437d64222d92809dd", size = 215595, upload-time = "2026-04-02T09:26:50.915Z" },
+ { url = "https://files.pythonhosted.org/packages/e3/7c/fc890655786e423f02556e0216d4b8c6bcb6bdfa890160dc66bf52dee468/charset_normalizer-3.4.7-cp313-cp313-manylinux_2_31_armv7l.whl", hash = "sha256:f495a1652cf3fbab2eb0639776dad966c2fb874d79d87ca07f9d5f059b8bd215", size = 201986, upload-time = "2026-04-02T09:26:52.197Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/97/bfb18b3db2aed3b90cf54dc292ad79fdd5ad65c4eae454099475cbeadd0d/charset_normalizer-3.4.7-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e712b419df8ba5e42b226c510472b37bd57b38e897d3eca5e8cfd410a29fa859", size = 211711, upload-time = "2026-04-02T09:26:53.49Z" },
+ { url = "https://files.pythonhosted.org/packages/6f/a5/a581c13798546a7fd557c82614a5c65a13df2157e9ad6373166d2a3e645d/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7804338df6fcc08105c7745f1502ba68d900f45fd770d5bdd5288ddccb8a42d8", size = 210036, upload-time = "2026-04-02T09:26:54.975Z" },
+ { url = "https://files.pythonhosted.org/packages/8c/bf/b3ab5bcb478e4193d517644b0fb2bf5497fbceeaa7a1bc0f4d5b50953861/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:481551899c856c704d58119b5025793fa6730adda3571971af568f66d2424bb5", size = 202998, upload-time = "2026-04-02T09:26:56.303Z" },
+ { url = "https://files.pythonhosted.org/packages/e7/4e/23efd79b65d314fa320ec6017b4b5834d5c12a58ba4610aa353af2e2f577/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f59099f9b66f0d7145115e6f80dd8b1d847176df89b234a5a6b3f00437aa0832", size = 230056, upload-time = "2026-04-02T09:26:57.554Z" },
+ { url = "https://files.pythonhosted.org/packages/b9/9f/1e1941bc3f0e01df116e68dc37a55c4d249df5e6fa77f008841aef68264f/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:f59ad4c0e8f6bba240a9bb85504faa1ab438237199d4cce5f622761507b8f6a6", size = 211537, upload-time = "2026-04-02T09:26:58.843Z" },
+ { url = "https://files.pythonhosted.org/packages/80/0f/088cbb3020d44428964a6c97fe1edfb1b9550396bf6d278330281e8b709c/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:3dedcc22d73ec993f42055eff4fcfed9318d1eeb9a6606c55892a26964964e48", size = 226176, upload-time = "2026-04-02T09:27:00.437Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/9f/130394f9bbe06f4f63e22641d32fc9b202b7e251c9aef4db044324dac493/charset_normalizer-3.4.7-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:64f02c6841d7d83f832cd97ccf8eb8a906d06eb95d5276069175c696b024b60a", size = 217723, upload-time = "2026-04-02T09:27:02.021Z" },
+ { url = "https://files.pythonhosted.org/packages/73/55/c469897448a06e49f8fa03f6caae97074fde823f432a98f979cc42b90e69/charset_normalizer-3.4.7-cp313-cp313-win32.whl", hash = "sha256:4042d5c8f957e15221d423ba781e85d553722fc4113f523f2feb7b188cc34c5e", size = 148085, upload-time = "2026-04-02T09:27:03.192Z" },
+ { url = "https://files.pythonhosted.org/packages/5d/78/1b74c5bbb3f99b77a1715c91b3e0b5bdb6fe302d95ace4f5b1bec37b0167/charset_normalizer-3.4.7-cp313-cp313-win_amd64.whl", hash = "sha256:3946fa46a0cf3e4c8cb1cc52f56bb536310d34f25f01ca9b6c16afa767dab110", size = 158819, upload-time = "2026-04-02T09:27:04.454Z" },
+ { url = "https://files.pythonhosted.org/packages/68/86/46bd42279d323deb8687c4a5a811fd548cb7d1de10cf6535d099877a9a9f/charset_normalizer-3.4.7-cp313-cp313-win_arm64.whl", hash = "sha256:80d04837f55fc81da168b98de4f4b797ef007fc8a79ab71c6ec9bc4dd662b15b", size = 147915, upload-time = "2026-04-02T09:27:05.971Z" },
+ { url = "https://files.pythonhosted.org/packages/97/c8/c67cb8c70e19ef1960b97b22ed2a1567711de46c4ddf19799923adc836c2/charset_normalizer-3.4.7-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:c36c333c39be2dbca264d7803333c896ab8fa7d4d6f0ab7edb7dfd7aea6e98c0", size = 309234, upload-time = "2026-04-02T09:27:07.194Z" },
+ { url = "https://files.pythonhosted.org/packages/99/85/c091fdee33f20de70d6c8b522743b6f831a2f1cd3ff86de4c6a827c48a76/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1c2aed2e5e41f24ea8ef1590b8e848a79b56f3a5564a65ceec43c9d692dc7d8a", size = 208042, upload-time = "2026-04-02T09:27:08.749Z" },
+ { url = "https://files.pythonhosted.org/packages/87/1c/ab2ce611b984d2fd5d86a5a8a19c1ae26acac6bad967da4967562c75114d/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:54523e136b8948060c0fa0bc7b1b50c32c186f2fceee897a495406bb6e311d2b", size = 228706, upload-time = "2026-04-02T09:27:09.951Z" },
+ { url = "https://files.pythonhosted.org/packages/a8/29/2b1d2cb00bf085f59d29eb773ce58ec2d325430f8c216804a0a5cd83cbca/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:715479b9a2802ecac752a3b0efa2b0b60285cf962ee38414211abdfccc233b41", size = 224727, upload-time = "2026-04-02T09:27:11.175Z" },
+ { url = "https://files.pythonhosted.org/packages/47/5c/032c2d5a07fe4d4855fea851209cca2b6f03ebeb6d4e3afdb3358386a684/charset_normalizer-3.4.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bd6c2a1c7573c64738d716488d2cdd3c00e340e4835707d8fdb8dc1a66ef164e", size = 215882, upload-time = "2026-04-02T09:27:12.446Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/c2/356065d5a8b78ed04499cae5f339f091946a6a74f91e03476c33f0ab7100/charset_normalizer-3.4.7-cp314-cp314-manylinux_2_31_armv7l.whl", hash = "sha256:c45e9440fb78f8ddabcf714b68f936737a121355bf59f3907f4e17721b9d1aae", size = 200860, upload-time = "2026-04-02T09:27:13.721Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/cd/a32a84217ced5039f53b29f460962abb2d4420def55afabe45b1c3c7483d/charset_normalizer-3.4.7-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3534e7dcbdcf757da6b85a0bbf5b6868786d5982dd959b065e65481644817a18", size = 211564, upload-time = "2026-04-02T09:27:15.272Z" },
+ { url = "https://files.pythonhosted.org/packages/44/86/58e6f13ce26cc3b8f4a36b94a0f22ae2f00a72534520f4ae6857c4b81f89/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e8ac484bf18ce6975760921bb6148041faa8fef0547200386ea0b52b5d27bf7b", size = 211276, upload-time = "2026-04-02T09:27:16.834Z" },
+ { url = "https://files.pythonhosted.org/packages/8f/fe/d17c32dc72e17e155e06883efa84514ca375f8a528ba2546bee73fc4df81/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:a5fe03b42827c13cdccd08e6c0247b6a6d4b5e3cdc53fd1749f5896adcdc2356", size = 201238, upload-time = "2026-04-02T09:27:18.229Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/29/f33daa50b06525a237451cdb6c69da366c381a3dadcd833fa5676bc468b3/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:2d6eb928e13016cea4f1f21d1e10c1cebd5a421bc57ddf5b1142ae3f86824fab", size = 230189, upload-time = "2026-04-02T09:27:19.445Z" },
+ { url = "https://files.pythonhosted.org/packages/b6/6e/52c84015394a6a0bdcd435210a7e944c5f94ea1055f5cc5d56c5fe368e7b/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e74327fb75de8986940def6e8dee4f127cc9752bee7355bb323cc5b2659b6d46", size = 211352, upload-time = "2026-04-02T09:27:20.79Z" },
+ { url = "https://files.pythonhosted.org/packages/8c/d7/4353be581b373033fb9198bf1da3cf8f09c1082561e8e922aa7b39bf9fe8/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:d6038d37043bced98a66e68d3aa2b6a35505dc01328cd65217cefe82f25def44", size = 227024, upload-time = "2026-04-02T09:27:22.063Z" },
+ { url = "https://files.pythonhosted.org/packages/30/45/99d18aa925bd1740098ccd3060e238e21115fffbfdcb8f3ece837d0ace6c/charset_normalizer-3.4.7-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7579e913a5339fb8fa133f6bbcfd8e6749696206cf05acdbdca71a1b436d8e72", size = 217869, upload-time = "2026-04-02T09:27:23.486Z" },
+ { url = "https://files.pythonhosted.org/packages/5c/05/5ee478aa53f4bb7996482153d4bfe1b89e0f087f0ab6b294fcf92d595873/charset_normalizer-3.4.7-cp314-cp314-win32.whl", hash = "sha256:5b77459df20e08151cd6f8b9ef8ef1f961ef73d85c21a555c7eed5b79410ec10", size = 148541, upload-time = "2026-04-02T09:27:25.146Z" },
+ { url = "https://files.pythonhosted.org/packages/48/77/72dcb0921b2ce86420b2d79d454c7022bf5be40202a2a07906b9f2a35c97/charset_normalizer-3.4.7-cp314-cp314-win_amd64.whl", hash = "sha256:92a0a01ead5e668468e952e4238cccd7c537364eb7d851ab144ab6627dbbe12f", size = 159634, upload-time = "2026-04-02T09:27:26.642Z" },
+ { url = "https://files.pythonhosted.org/packages/c6/a3/c2369911cd72f02386e4e340770f6e158c7980267da16af8f668217abaa0/charset_normalizer-3.4.7-cp314-cp314-win_arm64.whl", hash = "sha256:67f6279d125ca0046a7fd386d01b311c6363844deac3e5b069b514ba3e63c246", size = 148384, upload-time = "2026-04-02T09:27:28.271Z" },
+ { url = "https://files.pythonhosted.org/packages/94/09/7e8a7f73d24dba1f0035fbbf014d2c36828fc1bf9c88f84093e57d315935/charset_normalizer-3.4.7-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:effc3f449787117233702311a1b7d8f59cba9ced946ba727bdc329ec69028e24", size = 330133, upload-time = "2026-04-02T09:27:29.474Z" },
+ { url = "https://files.pythonhosted.org/packages/8d/da/96975ddb11f8e977f706f45cddd8540fd8242f71ecdb5d18a80723dcf62c/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fbccdc05410c9ee21bbf16a35f4c1d16123dcdeb8a1d38f33654fa21d0234f79", size = 216257, upload-time = "2026-04-02T09:27:30.793Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/e8/1d63bf8ef2d388e95c64b2098f45f84758f6d102a087552da1485912637b/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:733784b6d6def852c814bce5f318d25da2ee65dd4839a0718641c696e09a2960", size = 234851, upload-time = "2026-04-02T09:27:32.44Z" },
+ { url = "https://files.pythonhosted.org/packages/9b/40/e5ff04233e70da2681fa43969ad6f66ca5611d7e669be0246c4c7aaf6dc8/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a89c23ef8d2c6b27fd200a42aa4ac72786e7c60d40efdc76e6011260b6e949c4", size = 233393, upload-time = "2026-04-02T09:27:34.03Z" },
+ { url = "https://files.pythonhosted.org/packages/be/c1/06c6c49d5a5450f76899992f1ee40b41d076aee9279b49cf9974d2f313d5/charset_normalizer-3.4.7-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6c114670c45346afedc0d947faf3c7f701051d2518b943679c8ff88befe14f8e", size = 223251, upload-time = "2026-04-02T09:27:35.369Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/9f/f2ff16fb050946169e3e1f82134d107e5d4ae72647ec8a1b1446c148480f/charset_normalizer-3.4.7-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:a180c5e59792af262bf263b21a3c49353f25945d8d9f70628e73de370d55e1e1", size = 206609, upload-time = "2026-04-02T09:27:36.661Z" },
+ { url = "https://files.pythonhosted.org/packages/69/d5/a527c0cd8d64d2eab7459784fb4169a0ac76e5a6fc5237337982fd61347e/charset_normalizer-3.4.7-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3c9a494bc5ec77d43cea229c4f6db1e4d8fe7e1bbffa8b6f0f0032430ff8ab44", size = 220014, upload-time = "2026-04-02T09:27:38.019Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/80/8a7b8104a3e203074dc9aa2c613d4b726c0e136bad1cc734594b02867972/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8d828b6667a32a728a1ad1d93957cdf37489c57b97ae6c4de2860fa749b8fc1e", size = 218979, upload-time = "2026-04-02T09:27:39.37Z" },
+ { url = "https://files.pythonhosted.org/packages/02/9a/b759b503d507f375b2b5c153e4d2ee0a75aa215b7f2489cf314f4541f2c0/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cf1493cd8607bec4d8a7b9b004e699fcf8f9103a9284cc94962cb73d20f9d4a3", size = 209238, upload-time = "2026-04-02T09:27:40.722Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/4e/0f3f5d47b86bdb79256e7290b26ac847a2832d9a4033f7eb2cd4bcf4bb5b/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:0c96c3b819b5c3e9e165495db84d41914d6894d55181d2d108cc1a69bfc9cce0", size = 236110, upload-time = "2026-04-02T09:27:42.33Z" },
+ { url = "https://files.pythonhosted.org/packages/96/23/bce28734eb3ed2c91dcf93abeb8a5cf393a7b2749725030bb630e554fdd8/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:752a45dc4a6934060b3b0dab47e04edc3326575f82be64bc4fc293914566503e", size = 219824, upload-time = "2026-04-02T09:27:43.924Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/6f/6e897c6984cc4d41af319b077f2f600fc8214eb2fe2d6bcb79141b882400/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:8778f0c7a52e56f75d12dae53ae320fae900a8b9b4164b981b9c5ce059cd1fcb", size = 233103, upload-time = "2026-04-02T09:27:45.348Z" },
+ { url = "https://files.pythonhosted.org/packages/76/22/ef7bd0fe480a0ae9b656189ec00744b60933f68b4f42a7bb06589f6f576a/charset_normalizer-3.4.7-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ce3412fbe1e31eb81ea42f4169ed94861c56e643189e1e75f0041f3fe7020abe", size = 225194, upload-time = "2026-04-02T09:27:46.706Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/a7/0e0ab3e0b5bc1219bd80a6a0d4d72ca74d9250cb2382b7c699c147e06017/charset_normalizer-3.4.7-cp314-cp314t-win32.whl", hash = "sha256:c03a41a8784091e67a39648f70c5f97b5b6a37f216896d44d2cdcb82615339a0", size = 159827, upload-time = "2026-04-02T09:27:48.053Z" },
+ { url = "https://files.pythonhosted.org/packages/7a/1d/29d32e0fb40864b1f878c7f5a0b343ae676c6e2b271a2d55cc3a152391da/charset_normalizer-3.4.7-cp314-cp314t-win_amd64.whl", hash = "sha256:03853ed82eeebbce3c2abfdbc98c96dc205f32a79627688ac9a27370ea61a49c", size = 174168, upload-time = "2026-04-02T09:27:49.795Z" },
+ { url = "https://files.pythonhosted.org/packages/de/32/d92444ad05c7a6e41fb2036749777c163baf7a0301a040cb672d6b2b1ae9/charset_normalizer-3.4.7-cp314-cp314t-win_arm64.whl", hash = "sha256:c35abb8bfff0185efac5878da64c45dafd2b37fb0383add1be155a763c1f083d", size = 153018, upload-time = "2026-04-02T09:27:51.116Z" },
+ { url = "https://files.pythonhosted.org/packages/db/8f/61959034484a4a7c527811f4721e75d02d653a35afb0b6054474d8185d4c/charset_normalizer-3.4.7-py3-none-any.whl", hash = "sha256:3dce51d0f5e7951f8bb4900c257dad282f49190fdbebecd4ba99bcc41fef404d", size = 61958, upload-time = "2026-04-02T09:28:37.794Z" },
+]
+
+[[package]]
+name = "click"
+version = "8.4.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "colorama", marker = "sys_platform == 'win32'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/9b/98/518d8e5081007684232226f475082b30087d0f585e8457db087298259f49/click-8.4.1.tar.gz", hash = "sha256:918b5633eddf6b41c32d4f454bf0de810065c74e3f7dbf8ee5452f8be88d3e96", size = 353007, upload-time = "2026-05-22T04:08:37.769Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/c7/0d/67e5b4109ea4a837e80daa87c2c696711955e40449a97e8926672534def2/click-8.4.1-py3-none-any.whl", hash = "sha256:482be17c6991b8c19c5429a1e995d9b0efdbb63172824c41f99965dc0ade8ec2", size = 116639, upload-time = "2026-05-22T04:08:35.26Z" },
+]
+
+[[package]]
+name = "colorama"
+version = "0.4.6"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
+]
+
+[[package]]
+name = "distro"
+version = "1.9.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722, upload-time = "2023-12-24T09:54:32.31Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277, upload-time = "2023-12-24T09:54:30.421Z" },
+]
+
+[[package]]
+name = "fastuuid"
+version = "0.14.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/c3/7d/d9daedf0f2ebcacd20d599928f8913e9d2aea1d56d2d355a93bfa2b611d7/fastuuid-0.14.0.tar.gz", hash = "sha256:178947fc2f995b38497a74172adee64fdeb8b7ec18f2a5934d037641ba265d26", size = 18232, upload-time = "2025-10-19T22:19:22.402Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/02/a2/e78fcc5df65467f0d207661b7ef86c5b7ac62eea337c0c0fcedbeee6fb13/fastuuid-0.14.0-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:77e94728324b63660ebf8adb27055e92d2e4611645bf12ed9d88d30486471d0a", size = 510164, upload-time = "2025-10-19T22:31:45.635Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/b3/c846f933f22f581f558ee63f81f29fa924acd971ce903dab1a9b6701816e/fastuuid-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:caa1f14d2102cb8d353096bc6ef6c13b2c81f347e6ab9d6fbd48b9dea41c153d", size = 261837, upload-time = "2025-10-19T22:38:38.53Z" },
+ { url = "https://files.pythonhosted.org/packages/54/ea/682551030f8c4fa9a769d9825570ad28c0c71e30cf34020b85c1f7ee7382/fastuuid-0.14.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d23ef06f9e67163be38cece704170486715b177f6baae338110983f99a72c070", size = 251370, upload-time = "2025-10-19T22:40:26.07Z" },
+ { url = "https://files.pythonhosted.org/packages/14/dd/5927f0a523d8e6a76b70968e6004966ee7df30322f5fc9b6cdfb0276646a/fastuuid-0.14.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c9ec605ace243b6dbe3bd27ebdd5d33b00d8d1d3f580b39fdd15cd96fd71796", size = 277766, upload-time = "2025-10-19T22:37:23.779Z" },
+ { url = "https://files.pythonhosted.org/packages/16/6e/c0fb547eef61293153348f12e0f75a06abb322664b34a1573a7760501336/fastuuid-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:808527f2407f58a76c916d6aa15d58692a4a019fdf8d4c32ac7ff303b7d7af09", size = 278105, upload-time = "2025-10-19T22:26:56.821Z" },
+ { url = "https://files.pythonhosted.org/packages/2d/b1/b9c75e03b768f61cf2e84ee193dc18601aeaf89a4684b20f2f0e9f52b62c/fastuuid-0.14.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2fb3c0d7fef6674bbeacdd6dbd386924a7b60b26de849266d1ff6602937675c8", size = 301564, upload-time = "2025-10-19T22:30:31.604Z" },
+ { url = "https://files.pythonhosted.org/packages/fc/fa/f7395fdac07c7a54f18f801744573707321ca0cee082e638e36452355a9d/fastuuid-0.14.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab3f5d36e4393e628a4df337c2c039069344db5f4b9d2a3c9cea48284f1dd741", size = 459659, upload-time = "2025-10-19T22:31:32.341Z" },
+ { url = "https://files.pythonhosted.org/packages/66/49/c9fd06a4a0b1f0f048aacb6599e7d96e5d6bc6fa680ed0d46bf111929d1b/fastuuid-0.14.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:b9a0ca4f03b7e0b01425281ffd44e99d360e15c895f1907ca105854ed85e2057", size = 478430, upload-time = "2025-10-19T22:26:22.962Z" },
+ { url = "https://files.pythonhosted.org/packages/be/9c/909e8c95b494e8e140e8be6165d5fc3f61fdc46198c1554df7b3e1764471/fastuuid-0.14.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3acdf655684cc09e60fb7e4cf524e8f42ea760031945aa8086c7eae2eeeabeb8", size = 450894, upload-time = "2025-10-19T22:27:01.647Z" },
+ { url = "https://files.pythonhosted.org/packages/90/eb/d29d17521976e673c55ef7f210d4cdd72091a9ec6755d0fd4710d9b3c871/fastuuid-0.14.0-cp312-cp312-win32.whl", hash = "sha256:9579618be6280700ae36ac42c3efd157049fe4dd40ca49b021280481c78c3176", size = 154374, upload-time = "2025-10-19T22:29:19.879Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/fc/f5c799a6ea6d877faec0472d0b27c079b47c86b1cdc577720a5386483b36/fastuuid-0.14.0-cp312-cp312-win_amd64.whl", hash = "sha256:d9e4332dc4ba054434a9594cbfaf7823b57993d7d8e7267831c3e059857cf397", size = 156550, upload-time = "2025-10-19T22:27:49.658Z" },
+ { url = "https://files.pythonhosted.org/packages/a5/83/ae12dd39b9a39b55d7f90abb8971f1a5f3c321fd72d5aa83f90dc67fe9ed/fastuuid-0.14.0-cp313-cp313-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:77a09cb7427e7af74c594e409f7731a0cf887221de2f698e1ca0ebf0f3139021", size = 510720, upload-time = "2025-10-19T22:42:34.633Z" },
+ { url = "https://files.pythonhosted.org/packages/53/b0/a4b03ff5d00f563cc7546b933c28cb3f2a07344b2aec5834e874f7d44143/fastuuid-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:9bd57289daf7b153bfa3e8013446aa144ce5e8c825e9e366d455155ede5ea2dc", size = 262024, upload-time = "2025-10-19T22:30:25.482Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/6d/64aee0a0f6a58eeabadd582e55d0d7d70258ffdd01d093b30c53d668303b/fastuuid-0.14.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ac60fc860cdf3c3f327374db87ab8e064c86566ca8c49d2e30df15eda1b0c2d5", size = 251679, upload-time = "2025-10-19T22:36:14.096Z" },
+ { url = "https://files.pythonhosted.org/packages/60/f5/a7e9cda8369e4f7919d36552db9b2ae21db7915083bc6336f1b0082c8b2e/fastuuid-0.14.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ab32f74bd56565b186f036e33129da77db8be09178cd2f5206a5d4035fb2a23f", size = 277862, upload-time = "2025-10-19T22:36:23.302Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/d3/8ce11827c783affffd5bd4d6378b28eb6cc6d2ddf41474006b8d62e7448e/fastuuid-0.14.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33e678459cf4addaedd9936bbb038e35b3f6b2061330fd8f2f6a1d80414c0f87", size = 278278, upload-time = "2025-10-19T22:29:43.809Z" },
+ { url = "https://files.pythonhosted.org/packages/a2/51/680fb6352d0bbade04036da46264a8001f74b7484e2fd1f4da9e3db1c666/fastuuid-0.14.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1e3cc56742f76cd25ecb98e4b82a25f978ccffba02e4bdce8aba857b6d85d87b", size = 301788, upload-time = "2025-10-19T22:36:06.825Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/7c/2014b5785bd8ebdab04ec857635ebd84d5ee4950186a577db9eff0fb8ff6/fastuuid-0.14.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:cb9a030f609194b679e1660f7e32733b7a0f332d519c5d5a6a0a580991290022", size = 459819, upload-time = "2025-10-19T22:35:31.623Z" },
+ { url = "https://files.pythonhosted.org/packages/01/d2/524d4ceeba9160e7a9bc2ea3e8f4ccf1ad78f3bde34090ca0c51f09a5e91/fastuuid-0.14.0-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:09098762aad4f8da3a888eb9ae01c84430c907a297b97166b8abc07b640f2995", size = 478546, upload-time = "2025-10-19T22:26:03.023Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/17/354d04951ce114bf4afc78e27a18cfbd6ee319ab1829c2d5fb5e94063ac6/fastuuid-0.14.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:1383fff584fa249b16329a059c68ad45d030d5a4b70fb7c73a08d98fd53bcdab", size = 450921, upload-time = "2025-10-19T22:31:02.151Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/be/d7be8670151d16d88f15bb121c5b66cdb5ea6a0c2a362d0dcf30276ade53/fastuuid-0.14.0-cp313-cp313-win32.whl", hash = "sha256:a0809f8cc5731c066c909047f9a314d5f536c871a7a22e815cc4967c110ac9ad", size = 154559, upload-time = "2025-10-19T22:36:36.011Z" },
+ { url = "https://files.pythonhosted.org/packages/22/1d/5573ef3624ceb7abf4a46073d3554e37191c868abc3aecd5289a72f9810a/fastuuid-0.14.0-cp313-cp313-win_amd64.whl", hash = "sha256:0df14e92e7ad3276327631c9e7cec09e32572ce82089c55cb1bb8df71cf394ed", size = 156539, upload-time = "2025-10-19T22:33:35.898Z" },
+ { url = "https://files.pythonhosted.org/packages/16/c9/8c7660d1fe3862e3f8acabd9be7fc9ad71eb270f1c65cce9a2b7a31329ab/fastuuid-0.14.0-cp314-cp314-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:b852a870a61cfc26c884af205d502881a2e59cc07076b60ab4a951cc0c94d1ad", size = 510600, upload-time = "2025-10-19T22:43:44.17Z" },
+ { url = "https://files.pythonhosted.org/packages/4c/f4/a989c82f9a90d0ad995aa957b3e572ebef163c5299823b4027986f133dfb/fastuuid-0.14.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:c7502d6f54cd08024c3ea9b3514e2d6f190feb2f46e6dbcd3747882264bb5f7b", size = 262069, upload-time = "2025-10-19T22:43:38.38Z" },
+ { url = "https://files.pythonhosted.org/packages/da/6c/a1a24f73574ac995482b1326cf7ab41301af0fabaa3e37eeb6b3df00e6e2/fastuuid-0.14.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1ca61b592120cf314cfd66e662a5b54a578c5a15b26305e1b8b618a6f22df714", size = 251543, upload-time = "2025-10-19T22:32:22.537Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/20/2a9b59185ba7a6c7b37808431477c2d739fcbdabbf63e00243e37bd6bf49/fastuuid-0.14.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa75b6657ec129d0abded3bec745e6f7ab642e6dba3a5272a68247e85f5f316f", size = 277798, upload-time = "2025-10-19T22:33:53.821Z" },
+ { url = "https://files.pythonhosted.org/packages/ef/33/4105ca574f6ded0af6a797d39add041bcfb468a1255fbbe82fcb6f592da2/fastuuid-0.14.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8a0dfea3972200f72d4c7df02c8ac70bad1bb4c58d7e0ec1e6f341679073a7f", size = 278283, upload-time = "2025-10-19T22:29:02.812Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/8c/fca59f8e21c4deb013f574eae05723737ddb1d2937ce87cb2a5d20992dc3/fastuuid-0.14.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1bf539a7a95f35b419f9ad105d5a8a35036df35fdafae48fb2fd2e5f318f0d75", size = 301627, upload-time = "2025-10-19T22:35:54.985Z" },
+ { url = "https://files.pythonhosted.org/packages/cb/e2/f78c271b909c034d429218f2798ca4e89eeda7983f4257d7865976ddbb6c/fastuuid-0.14.0-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:9a133bf9cc78fdbd1179cb58a59ad0100aa32d8675508150f3658814aeefeaa4", size = 459778, upload-time = "2025-10-19T22:28:00.999Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/f0/5ff209d865897667a2ff3e7a572267a9ced8f7313919f6d6043aed8b1caa/fastuuid-0.14.0-cp314-cp314-musllinux_1_1_i686.whl", hash = "sha256:f54d5b36c56a2d5e1a31e73b950b28a0d83eb0c37b91d10408875a5a29494bad", size = 478605, upload-time = "2025-10-19T22:36:21.764Z" },
+ { url = "https://files.pythonhosted.org/packages/e0/c8/2ce1c78f983a2c4987ea865d9516dbdfb141a120fd3abb977ae6f02ba7ca/fastuuid-0.14.0-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:ec27778c6ca3393ef662e2762dba8af13f4ec1aaa32d08d77f71f2a70ae9feb8", size = 450837, upload-time = "2025-10-19T22:34:37.178Z" },
+ { url = "https://files.pythonhosted.org/packages/df/60/dad662ec9a33b4a5fe44f60699258da64172c39bd041da2994422cdc40fe/fastuuid-0.14.0-cp314-cp314-win32.whl", hash = "sha256:e23fc6a83f112de4be0cc1990e5b127c27663ae43f866353166f87df58e73d06", size = 154532, upload-time = "2025-10-19T22:35:18.217Z" },
+ { url = "https://files.pythonhosted.org/packages/1f/f6/da4db31001e854025ffd26bc9ba0740a9cbba2c3259695f7c5834908b336/fastuuid-0.14.0-cp314-cp314-win_amd64.whl", hash = "sha256:df61342889d0f5e7a32f7284e55ef95103f2110fee433c2ae7c2c0956d76ac8a", size = 156457, upload-time = "2025-10-19T22:33:44.579Z" },
+]
+
+[[package]]
+name = "filelock"
+version = "3.29.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/b5/fe/997687a931ab51049acce6fa1f23e8f01216374ea81374ddee763c493db5/filelock-3.29.0.tar.gz", hash = "sha256:69974355e960702e789734cb4871f884ea6fe50bd8404051a3530bc07809cf90", size = 57571, upload-time = "2026-04-19T15:39:10.068Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/81/47/dd9a212ef6e343a6857485ffe25bba537304f1913bdbed446a23f7f592e1/filelock-3.29.0-py3-none-any.whl", hash = "sha256:96f5f6344709aa1572bbf631c640e4ebeeb519e08da902c39a001882f30ac258", size = 39812, upload-time = "2026-04-19T15:39:08.752Z" },
+]
+
+[[package]]
+name = "frozenlist"
+version = "1.8.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/69/29/948b9aa87e75820a38650af445d2ef2b6b8a6fab1a23b6bb9e4ef0be2d59/frozenlist-1.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:78f7b9e5d6f2fdb88cdde9440dc147259b62b9d3b019924def9f6478be254ac1", size = 87782, upload-time = "2025-10-06T05:36:06.649Z" },
+ { url = "https://files.pythonhosted.org/packages/64/80/4f6e318ee2a7c0750ed724fa33a4bdf1eacdc5a39a7a24e818a773cd91af/frozenlist-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:229bf37d2e4acdaf808fd3f06e854a4a7a3661e871b10dc1f8f1896a3b05f18b", size = 50594, upload-time = "2025-10-06T05:36:07.69Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/94/5c8a2b50a496b11dd519f4a24cb5496cf125681dd99e94c604ccdea9419a/frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f833670942247a14eafbb675458b4e61c82e002a148f49e68257b79296e865c4", size = 50448, upload-time = "2025-10-06T05:36:08.78Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/bd/d91c5e39f490a49df14320f4e8c80161cfcce09f1e2cde1edd16a551abb3/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383", size = 242411, upload-time = "2025-10-06T05:36:09.801Z" },
+ { url = "https://files.pythonhosted.org/packages/8f/83/f61505a05109ef3293dfb1ff594d13d64a2324ac3482be2cedc2be818256/frozenlist-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96f423a119f4777a4a056b66ce11527366a8bb92f54e541ade21f2374433f6d4", size = 243014, upload-time = "2025-10-06T05:36:11.394Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/cb/cb6c7b0f7d4023ddda30cf56b8b17494eb3a79e3fda666bf735f63118b35/frozenlist-1.8.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3462dd9475af2025c31cc61be6652dfa25cbfb56cbbf52f4ccfe029f38decaf8", size = 234909, upload-time = "2025-10-06T05:36:12.598Z" },
+ { url = "https://files.pythonhosted.org/packages/31/c5/cd7a1f3b8b34af009fb17d4123c5a778b44ae2804e3ad6b86204255f9ec5/frozenlist-1.8.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4c800524c9cd9bac5166cd6f55285957fcfc907db323e193f2afcd4d9abd69b", size = 250049, upload-time = "2025-10-06T05:36:14.065Z" },
+ { url = "https://files.pythonhosted.org/packages/c0/01/2f95d3b416c584a1e7f0e1d6d31998c4a795f7544069ee2e0962a4b60740/frozenlist-1.8.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d6a5df73acd3399d893dafc71663ad22534b5aa4f94e8a2fabfe856c3c1b6a52", size = 256485, upload-time = "2025-10-06T05:36:15.39Z" },
+ { url = "https://files.pythonhosted.org/packages/ce/03/024bf7720b3abaebcff6d0793d73c154237b85bdf67b7ed55e5e9596dc9a/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:405e8fe955c2280ce66428b3ca55e12b3c4e9c336fb2103a4937e891c69a4a29", size = 237619, upload-time = "2025-10-06T05:36:16.558Z" },
+ { url = "https://files.pythonhosted.org/packages/69/fa/f8abdfe7d76b731f5d8bd217827cf6764d4f1d9763407e42717b4bed50a0/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:908bd3f6439f2fef9e85031b59fd4f1297af54415fb60e4254a95f75b3cab3f3", size = 250320, upload-time = "2025-10-06T05:36:17.821Z" },
+ { url = "https://files.pythonhosted.org/packages/f5/3c/b051329f718b463b22613e269ad72138cc256c540f78a6de89452803a47d/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:294e487f9ec720bd8ffcebc99d575f7eff3568a08a253d1ee1a0378754b74143", size = 246820, upload-time = "2025-10-06T05:36:19.046Z" },
+ { url = "https://files.pythonhosted.org/packages/0f/ae/58282e8f98e444b3f4dd42448ff36fa38bef29e40d40f330b22e7108f565/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:74c51543498289c0c43656701be6b077f4b265868fa7f8a8859c197006efb608", size = 250518, upload-time = "2025-10-06T05:36:20.763Z" },
+ { url = "https://files.pythonhosted.org/packages/8f/96/007e5944694d66123183845a106547a15944fbbb7154788cbf7272789536/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:776f352e8329135506a1d6bf16ac3f87bc25b28e765949282dcc627af36123aa", size = 239096, upload-time = "2025-10-06T05:36:22.129Z" },
+ { url = "https://files.pythonhosted.org/packages/66/bb/852b9d6db2fa40be96f29c0d1205c306288f0684df8fd26ca1951d461a56/frozenlist-1.8.0-cp312-cp312-win32.whl", hash = "sha256:433403ae80709741ce34038da08511d4a77062aa924baf411ef73d1146e74faf", size = 39985, upload-time = "2025-10-06T05:36:23.661Z" },
+ { url = "https://files.pythonhosted.org/packages/b8/af/38e51a553dd66eb064cdf193841f16f077585d4d28394c2fa6235cb41765/frozenlist-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:34187385b08f866104f0c0617404c8eb08165ab1272e884abc89c112e9c00746", size = 44591, upload-time = "2025-10-06T05:36:24.958Z" },
+ { url = "https://files.pythonhosted.org/packages/a7/06/1dc65480ab147339fecc70797e9c2f69d9cea9cf38934ce08df070fdb9cb/frozenlist-1.8.0-cp312-cp312-win_arm64.whl", hash = "sha256:fe3c58d2f5db5fbd18c2987cba06d51b0529f52bc3a6cdc33d3f4eab725104bd", size = 40102, upload-time = "2025-10-06T05:36:26.333Z" },
+ { url = "https://files.pythonhosted.org/packages/2d/40/0832c31a37d60f60ed79e9dfb5a92e1e2af4f40a16a29abcc7992af9edff/frozenlist-1.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d92f1a84bb12d9e56f818b3a746f3efba93c1b63c8387a73dde655e1e42282a", size = 85717, upload-time = "2025-10-06T05:36:27.341Z" },
+ { url = "https://files.pythonhosted.org/packages/30/ba/b0b3de23f40bc55a7057bd38434e25c34fa48e17f20ee273bbde5e0650f3/frozenlist-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96153e77a591c8adc2ee805756c61f59fef4cf4073a9275ee86fe8cba41241f7", size = 49651, upload-time = "2025-10-06T05:36:28.855Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/ab/6e5080ee374f875296c4243c381bbdef97a9ac39c6e3ce1d5f7d42cb78d6/frozenlist-1.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f21f00a91358803399890ab167098c131ec2ddd5f8f5fd5fe9c9f2c6fcd91e40", size = 49417, upload-time = "2025-10-06T05:36:29.877Z" },
+ { url = "https://files.pythonhosted.org/packages/d5/4e/e4691508f9477ce67da2015d8c00acd751e6287739123113a9fca6f1604e/frozenlist-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fb30f9626572a76dfe4293c7194a09fb1fe93ba94c7d4f720dfae3b646b45027", size = 234391, upload-time = "2025-10-06T05:36:31.301Z" },
+ { url = "https://files.pythonhosted.org/packages/40/76/c202df58e3acdf12969a7895fd6f3bc016c642e6726aa63bd3025e0fc71c/frozenlist-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaa352d7047a31d87dafcacbabe89df0aa506abb5b1b85a2fb91bc3faa02d822", size = 233048, upload-time = "2025-10-06T05:36:32.531Z" },
+ { url = "https://files.pythonhosted.org/packages/f9/c0/8746afb90f17b73ca5979c7a3958116e105ff796e718575175319b5bb4ce/frozenlist-1.8.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:03ae967b4e297f58f8c774c7eabcce57fe3c2434817d4385c50661845a058121", size = 226549, upload-time = "2025-10-06T05:36:33.706Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/eb/4c7eefc718ff72f9b6c4893291abaae5fbc0c82226a32dcd8ef4f7a5dbef/frozenlist-1.8.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f6292f1de555ffcc675941d65fffffb0a5bcd992905015f85d0592201793e0e5", size = 239833, upload-time = "2025-10-06T05:36:34.947Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/4e/e5c02187cf704224f8b21bee886f3d713ca379535f16893233b9d672ea71/frozenlist-1.8.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29548f9b5b5e3460ce7378144c3010363d8035cea44bc0bf02d57f5a685e084e", size = 245363, upload-time = "2025-10-06T05:36:36.534Z" },
+ { url = "https://files.pythonhosted.org/packages/1f/96/cb85ec608464472e82ad37a17f844889c36100eed57bea094518bf270692/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ec3cc8c5d4084591b4237c0a272cc4f50a5b03396a47d9caaf76f5d7b38a4f11", size = 229314, upload-time = "2025-10-06T05:36:38.582Z" },
+ { url = "https://files.pythonhosted.org/packages/5d/6f/4ae69c550e4cee66b57887daeebe006fe985917c01d0fff9caab9883f6d0/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:517279f58009d0b1f2e7c1b130b377a349405da3f7621ed6bfae50b10adf20c1", size = 243365, upload-time = "2025-10-06T05:36:40.152Z" },
+ { url = "https://files.pythonhosted.org/packages/7a/58/afd56de246cf11780a40a2c28dc7cbabbf06337cc8ddb1c780a2d97e88d8/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db1e72ede2d0d7ccb213f218df6a078a9c09a7de257c2fe8fcef16d5925230b1", size = 237763, upload-time = "2025-10-06T05:36:41.355Z" },
+ { url = "https://files.pythonhosted.org/packages/cb/36/cdfaf6ed42e2644740d4a10452d8e97fa1c062e2a8006e4b09f1b5fd7d63/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b4dec9482a65c54a5044486847b8a66bf10c9cb4926d42927ec4e8fd5db7fed8", size = 240110, upload-time = "2025-10-06T05:36:42.716Z" },
+ { url = "https://files.pythonhosted.org/packages/03/a8/9ea226fbefad669f11b52e864c55f0bd57d3c8d7eb07e9f2e9a0b39502e1/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:21900c48ae04d13d416f0e1e0c4d81f7931f73a9dfa0b7a8746fb2fe7dd970ed", size = 233717, upload-time = "2025-10-06T05:36:44.251Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/0b/1b5531611e83ba7d13ccc9988967ea1b51186af64c42b7a7af465dcc9568/frozenlist-1.8.0-cp313-cp313-win32.whl", hash = "sha256:8b7b94a067d1c504ee0b16def57ad5738701e4ba10cec90529f13fa03c833496", size = 39628, upload-time = "2025-10-06T05:36:45.423Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/cf/174c91dbc9cc49bc7b7aab74d8b734e974d1faa8f191c74af9b7e80848e6/frozenlist-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:878be833caa6a3821caf85eb39c5ba92d28e85df26d57afb06b35b2efd937231", size = 43882, upload-time = "2025-10-06T05:36:46.796Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/17/502cd212cbfa96eb1388614fe39a3fc9ab87dbbe042b66f97acb57474834/frozenlist-1.8.0-cp313-cp313-win_arm64.whl", hash = "sha256:44389d135b3ff43ba8cc89ff7f51f5a0bb6b63d829c8300f79a2fe4fe61bcc62", size = 39676, upload-time = "2025-10-06T05:36:47.8Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/5c/3bbfaa920dfab09e76946a5d2833a7cbdf7b9b4a91c714666ac4855b88b4/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e25ac20a2ef37e91c1b39938b591457666a0fa835c7783c3a8f33ea42870db94", size = 89235, upload-time = "2025-10-06T05:36:48.78Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/d6/f03961ef72166cec1687e84e8925838442b615bd0b8854b54923ce5b7b8a/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07cdca25a91a4386d2e76ad992916a85038a9b97561bf7a3fd12d5d9ce31870c", size = 50742, upload-time = "2025-10-06T05:36:49.837Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/bb/a6d12b7ba4c3337667d0e421f7181c82dda448ce4e7ad7ecd249a16fa806/frozenlist-1.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e0c11f2cc6717e0a741f84a527c52616140741cd812a50422f83dc31749fb52", size = 51725, upload-time = "2025-10-06T05:36:50.851Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/71/d1fed0ffe2c2ccd70b43714c6cab0f4188f09f8a67a7914a6b46ee30f274/frozenlist-1.8.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3210649ee28062ea6099cfda39e147fa1bc039583c8ee4481cb7811e2448c51", size = 284533, upload-time = "2025-10-06T05:36:51.898Z" },
+ { url = "https://files.pythonhosted.org/packages/c9/1f/fb1685a7b009d89f9bf78a42d94461bc06581f6e718c39344754a5d9bada/frozenlist-1.8.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:581ef5194c48035a7de2aefc72ac6539823bb71508189e5de01d60c9dcd5fa65", size = 292506, upload-time = "2025-10-06T05:36:53.101Z" },
+ { url = "https://files.pythonhosted.org/packages/e6/3b/b991fe1612703f7e0d05c0cf734c1b77aaf7c7d321df4572e8d36e7048c8/frozenlist-1.8.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3ef2d026f16a2b1866e1d86fc4e1291e1ed8a387b2c333809419a2f8b3a77b82", size = 274161, upload-time = "2025-10-06T05:36:54.309Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/ec/c5c618767bcdf66e88945ec0157d7f6c4a1322f1473392319b7a2501ded7/frozenlist-1.8.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5500ef82073f599ac84d888e3a8c1f77ac831183244bfd7f11eaa0289fb30714", size = 294676, upload-time = "2025-10-06T05:36:55.566Z" },
+ { url = "https://files.pythonhosted.org/packages/7c/ce/3934758637d8f8a88d11f0585d6495ef54b2044ed6ec84492a91fa3b27aa/frozenlist-1.8.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:50066c3997d0091c411a66e710f4e11752251e6d2d73d70d8d5d4c76442a199d", size = 300638, upload-time = "2025-10-06T05:36:56.758Z" },
+ { url = "https://files.pythonhosted.org/packages/fc/4f/a7e4d0d467298f42de4b41cbc7ddaf19d3cfeabaf9ff97c20c6c7ee409f9/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:5c1c8e78426e59b3f8005e9b19f6ff46e5845895adbde20ece9218319eca6506", size = 283067, upload-time = "2025-10-06T05:36:57.965Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/48/c7b163063d55a83772b268e6d1affb960771b0e203b632cfe09522d67ea5/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:eefdba20de0d938cec6a89bd4d70f346a03108a19b9df4248d3cf0d88f1b0f51", size = 292101, upload-time = "2025-10-06T05:36:59.237Z" },
+ { url = "https://files.pythonhosted.org/packages/9f/d0/2366d3c4ecdc2fd391e0afa6e11500bfba0ea772764d631bbf82f0136c9d/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:cf253e0e1c3ceb4aaff6df637ce033ff6535fb8c70a764a8f46aafd3d6ab798e", size = 289901, upload-time = "2025-10-06T05:37:00.811Z" },
+ { url = "https://files.pythonhosted.org/packages/b8/94/daff920e82c1b70e3618a2ac39fbc01ae3e2ff6124e80739ce5d71c9b920/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0", size = 289395, upload-time = "2025-10-06T05:37:02.115Z" },
+ { url = "https://files.pythonhosted.org/packages/e3/20/bba307ab4235a09fdcd3cc5508dbabd17c4634a1af4b96e0f69bfe551ebd/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6da155091429aeba16851ecb10a9104a108bcd32f6c1642867eadaee401c1c41", size = 283659, upload-time = "2025-10-06T05:37:03.711Z" },
+ { url = "https://files.pythonhosted.org/packages/fd/00/04ca1c3a7a124b6de4f8a9a17cc2fcad138b4608e7a3fc5877804b8715d7/frozenlist-1.8.0-cp313-cp313t-win32.whl", hash = "sha256:0f96534f8bfebc1a394209427d0f8a63d343c9779cda6fc25e8e121b5fd8555b", size = 43492, upload-time = "2025-10-06T05:37:04.915Z" },
+ { url = "https://files.pythonhosted.org/packages/59/5e/c69f733a86a94ab10f68e496dc6b7e8bc078ebb415281d5698313e3af3a1/frozenlist-1.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5d63a068f978fc69421fb0e6eb91a9603187527c86b7cd3f534a5b77a592b888", size = 48034, upload-time = "2025-10-06T05:37:06.343Z" },
+ { url = "https://files.pythonhosted.org/packages/16/6c/be9d79775d8abe79b05fa6d23da99ad6e7763a1d080fbae7290b286093fd/frozenlist-1.8.0-cp313-cp313t-win_arm64.whl", hash = "sha256:bf0a7e10b077bf5fb9380ad3ae8ce20ef919a6ad93b4552896419ac7e1d8e042", size = 41749, upload-time = "2025-10-06T05:37:07.431Z" },
+ { url = "https://files.pythonhosted.org/packages/f1/c8/85da824b7e7b9b6e7f7705b2ecaf9591ba6f79c1177f324c2735e41d36a2/frozenlist-1.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cee686f1f4cadeb2136007ddedd0aaf928ab95216e7691c63e50a8ec066336d0", size = 86127, upload-time = "2025-10-06T05:37:08.438Z" },
+ { url = "https://files.pythonhosted.org/packages/8e/e8/a1185e236ec66c20afd72399522f142c3724c785789255202d27ae992818/frozenlist-1.8.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:119fb2a1bd47307e899c2fac7f28e85b9a543864df47aa7ec9d3c1b4545f096f", size = 49698, upload-time = "2025-10-06T05:37:09.48Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/93/72b1736d68f03fda5fdf0f2180fb6caaae3894f1b854d006ac61ecc727ee/frozenlist-1.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4970ece02dbc8c3a92fcc5228e36a3e933a01a999f7094ff7c23fbd2beeaa67c", size = 49749, upload-time = "2025-10-06T05:37:10.569Z" },
+ { url = "https://files.pythonhosted.org/packages/a7/b2/fabede9fafd976b991e9f1b9c8c873ed86f202889b864756f240ce6dd855/frozenlist-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cba69cb73723c3f329622e34bdbf5ce1f80c21c290ff04256cff1cd3c2036ed2", size = 231298, upload-time = "2025-10-06T05:37:11.993Z" },
+ { url = "https://files.pythonhosted.org/packages/3a/3b/d9b1e0b0eed36e70477ffb8360c49c85c8ca8ef9700a4e6711f39a6e8b45/frozenlist-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:778a11b15673f6f1df23d9586f83c4846c471a8af693a22e066508b77d201ec8", size = 232015, upload-time = "2025-10-06T05:37:13.194Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/94/be719d2766c1138148564a3960fc2c06eb688da592bdc25adcf856101be7/frozenlist-1.8.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686", size = 225038, upload-time = "2025-10-06T05:37:14.577Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/09/6712b6c5465f083f52f50cf74167b92d4ea2f50e46a9eea0523d658454ae/frozenlist-1.8.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:97260ff46b207a82a7567b581ab4190bd4dfa09f4db8a8b49d1a958f6aa4940e", size = 240130, upload-time = "2025-10-06T05:37:15.781Z" },
+ { url = "https://files.pythonhosted.org/packages/f8/d4/cd065cdcf21550b54f3ce6a22e143ac9e4836ca42a0de1022da8498eac89/frozenlist-1.8.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:54b2077180eb7f83dd52c40b2750d0a9f175e06a42e3213ce047219de902717a", size = 242845, upload-time = "2025-10-06T05:37:17.037Z" },
+ { url = "https://files.pythonhosted.org/packages/62/c3/f57a5c8c70cd1ead3d5d5f776f89d33110b1addae0ab010ad774d9a44fb9/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2f05983daecab868a31e1da44462873306d3cbfd76d1f0b5b69c473d21dbb128", size = 229131, upload-time = "2025-10-06T05:37:18.221Z" },
+ { url = "https://files.pythonhosted.org/packages/6c/52/232476fe9cb64f0742f3fde2b7d26c1dac18b6d62071c74d4ded55e0ef94/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:33f48f51a446114bc5d251fb2954ab0164d5be02ad3382abcbfe07e2531d650f", size = 240542, upload-time = "2025-10-06T05:37:19.771Z" },
+ { url = "https://files.pythonhosted.org/packages/5f/85/07bf3f5d0fb5414aee5f47d33c6f5c77bfe49aac680bfece33d4fdf6a246/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:154e55ec0655291b5dd1b8731c637ecdb50975a2ae70c606d100750a540082f7", size = 237308, upload-time = "2025-10-06T05:37:20.969Z" },
+ { url = "https://files.pythonhosted.org/packages/11/99/ae3a33d5befd41ac0ca2cc7fd3aa707c9c324de2e89db0e0f45db9a64c26/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:4314debad13beb564b708b4a496020e5306c7333fa9a3ab90374169a20ffab30", size = 238210, upload-time = "2025-10-06T05:37:22.252Z" },
+ { url = "https://files.pythonhosted.org/packages/b2/60/b1d2da22f4970e7a155f0adde9b1435712ece01b3cd45ba63702aea33938/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:073f8bf8becba60aa931eb3bc420b217bb7d5b8f4750e6f8b3be7f3da85d38b7", size = 231972, upload-time = "2025-10-06T05:37:23.5Z" },
+ { url = "https://files.pythonhosted.org/packages/3f/ab/945b2f32de889993b9c9133216c068b7fcf257d8595a0ac420ac8677cab0/frozenlist-1.8.0-cp314-cp314-win32.whl", hash = "sha256:bac9c42ba2ac65ddc115d930c78d24ab8d4f465fd3fc473cdedfccadb9429806", size = 40536, upload-time = "2025-10-06T05:37:25.581Z" },
+ { url = "https://files.pythonhosted.org/packages/59/ad/9caa9b9c836d9ad6f067157a531ac48b7d36499f5036d4141ce78c230b1b/frozenlist-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:3e0761f4d1a44f1d1a47996511752cf3dcec5bbdd9cc2b4fe595caf97754b7a0", size = 44330, upload-time = "2025-10-06T05:37:26.928Z" },
+ { url = "https://files.pythonhosted.org/packages/82/13/e6950121764f2676f43534c555249f57030150260aee9dcf7d64efda11dd/frozenlist-1.8.0-cp314-cp314-win_arm64.whl", hash = "sha256:d1eaff1d00c7751b7c6662e9c5ba6eb2c17a2306ba5e2a37f24ddf3cc953402b", size = 40627, upload-time = "2025-10-06T05:37:28.075Z" },
+ { url = "https://files.pythonhosted.org/packages/c0/c7/43200656ecc4e02d3f8bc248df68256cd9572b3f0017f0a0c4e93440ae23/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:d3bb933317c52d7ea5004a1c442eef86f426886fba134ef8cf4226ea6ee1821d", size = 89238, upload-time = "2025-10-06T05:37:29.373Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/29/55c5f0689b9c0fb765055629f472c0de484dcaf0acee2f7707266ae3583c/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8009897cdef112072f93a0efdce29cd819e717fd2f649ee3016efd3cd885a7ed", size = 50738, upload-time = "2025-10-06T05:37:30.792Z" },
+ { url = "https://files.pythonhosted.org/packages/ba/7d/b7282a445956506fa11da8c2db7d276adcbf2b17d8bb8407a47685263f90/frozenlist-1.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2c5dcbbc55383e5883246d11fd179782a9d07a986c40f49abe89ddf865913930", size = 51739, upload-time = "2025-10-06T05:37:32.127Z" },
+ { url = "https://files.pythonhosted.org/packages/62/1c/3d8622e60d0b767a5510d1d3cf21065b9db874696a51ea6d7a43180a259c/frozenlist-1.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39ecbc32f1390387d2aa4f5a995e465e9e2f79ba3adcac92d68e3e0afae6657c", size = 284186, upload-time = "2025-10-06T05:37:33.21Z" },
+ { url = "https://files.pythonhosted.org/packages/2d/14/aa36d5f85a89679a85a1d44cd7a6657e0b1c75f61e7cad987b203d2daca8/frozenlist-1.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92db2bf818d5cc8d9c1f1fc56b897662e24ea5adb36ad1f1d82875bd64e03c24", size = 292196, upload-time = "2025-10-06T05:37:36.107Z" },
+ { url = "https://files.pythonhosted.org/packages/05/23/6bde59eb55abd407d34f77d39a5126fb7b4f109a3f611d3929f14b700c66/frozenlist-1.8.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2dc43a022e555de94c3b68a4ef0b11c4f747d12c024a520c7101709a2144fb37", size = 273830, upload-time = "2025-10-06T05:37:37.663Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/3f/22cff331bfad7a8afa616289000ba793347fcd7bc275f3b28ecea2a27909/frozenlist-1.8.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb89a7f2de3602cfed448095bab3f178399646ab7c61454315089787df07733a", size = 294289, upload-time = "2025-10-06T05:37:39.261Z" },
+ { url = "https://files.pythonhosted.org/packages/a4/89/5b057c799de4838b6c69aa82b79705f2027615e01be996d2486a69ca99c4/frozenlist-1.8.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33139dc858c580ea50e7e60a1b0ea003efa1fd42e6ec7fdbad78fff65fad2fd2", size = 300318, upload-time = "2025-10-06T05:37:43.213Z" },
+ { url = "https://files.pythonhosted.org/packages/30/de/2c22ab3eb2a8af6d69dc799e48455813bab3690c760de58e1bf43b36da3e/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:168c0969a329b416119507ba30b9ea13688fafffac1b7822802537569a1cb0ef", size = 282814, upload-time = "2025-10-06T05:37:45.337Z" },
+ { url = "https://files.pythonhosted.org/packages/59/f7/970141a6a8dbd7f556d94977858cfb36fa9b66e0892c6dd780d2219d8cd8/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:28bd570e8e189d7f7b001966435f9dac6718324b5be2990ac496cf1ea9ddb7fe", size = 291762, upload-time = "2025-10-06T05:37:46.657Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/15/ca1adae83a719f82df9116d66f5bb28bb95557b3951903d39135620ef157/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b2a095d45c5d46e5e79ba1e5b9cb787f541a8dee0433836cea4b96a2c439dcd8", size = 289470, upload-time = "2025-10-06T05:37:47.946Z" },
+ { url = "https://files.pythonhosted.org/packages/ac/83/dca6dc53bf657d371fbc88ddeb21b79891e747189c5de990b9dfff2ccba1/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:eab8145831a0d56ec9c4139b6c3e594c7a83c2c8be25d5bcf2d86136a532287a", size = 289042, upload-time = "2025-10-06T05:37:49.499Z" },
+ { url = "https://files.pythonhosted.org/packages/96/52/abddd34ca99be142f354398700536c5bd315880ed0a213812bc491cff5e4/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:974b28cf63cc99dfb2188d8d222bc6843656188164848c4f679e63dae4b0708e", size = 283148, upload-time = "2025-10-06T05:37:50.745Z" },
+ { url = "https://files.pythonhosted.org/packages/af/d3/76bd4ed4317e7119c2b7f57c3f6934aba26d277acc6309f873341640e21f/frozenlist-1.8.0-cp314-cp314t-win32.whl", hash = "sha256:342c97bf697ac5480c0a7ec73cd700ecfa5a8a40ac923bd035484616efecc2df", size = 44676, upload-time = "2025-10-06T05:37:52.222Z" },
+ { url = "https://files.pythonhosted.org/packages/89/76/c615883b7b521ead2944bb3480398cbb07e12b7b4e4d073d3752eb721558/frozenlist-1.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:06be8f67f39c8b1dc671f5d83aaefd3358ae5cdcf8314552c57e7ed3e6475bdd", size = 49451, upload-time = "2025-10-06T05:37:53.425Z" },
+ { url = "https://files.pythonhosted.org/packages/e0/a3/5982da14e113d07b325230f95060e2169f5311b1017ea8af2a29b374c289/frozenlist-1.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:102e6314ca4da683dca92e3b1355490fed5f313b768500084fbe6371fddfdb79", size = 42507, upload-time = "2025-10-06T05:37:54.513Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/9a/e35b4a917281c0b8419d4207f4334c8e8c5dbf4f3f5f9ada73958d937dcc/frozenlist-1.8.0-py3-none-any.whl", hash = "sha256:0c18a16eab41e82c295618a77502e17b195883241c563b00f0aa5106fc4eaa0d", size = 13409, upload-time = "2025-10-06T05:38:16.721Z" },
+]
+
+[[package]]
+name = "fsspec"
+version = "2026.4.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/d5/8d/1c51c094345df128ca4a990d633fe1a0ff28726c9e6b3c41ba65087bba1d/fsspec-2026.4.0.tar.gz", hash = "sha256:301d8ac70ae90ef3ad05dcf94d6c3754a097f9b5fe4667d2787aa359ec7df7e4", size = 312760, upload-time = "2026-04-29T20:42:38.635Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/d5/0c/043d5e551459da400957a1395e0febbf771446ff34291afcbe3d8be2a279/fsspec-2026.4.0-py3-none-any.whl", hash = "sha256:11ef7bb35dab8a394fde6e608221d5cf3e8499401c249bebaeaad760a1a8dec2", size = 203402, upload-time = "2026-04-29T20:42:36.842Z" },
+]
+
+[[package]]
+name = "gepa"
+version = "0.1.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/e4/62/10f5a8f24c075e3b64f952be73ba8e15f0055584bbcdf9ce48d754a36679/gepa-0.1.1.tar.gz", hash = "sha256:643fda01c23de4c9f01306e01305dd69facc29bcb34ad59e4cd07e6621d34aa1", size = 272251, upload-time = "2026-03-16T10:17:53.131Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/dc/b7/8c72dedbb950d88a6f64588fcbc590d2a21e2b9f19b36aa6c5016c54ec75/gepa-0.1.1-py3-none-any.whl", hash = "sha256:71ead7c591eafcc727b83509cdc4182f20264800a6ddf8520d61419daeb47466", size = 244246, upload-time = "2026-03-16T10:17:51.922Z" },
+]
+
+[[package]]
+name = "gepa-optimizer"
+version = "0.1.0"
+source = { editable = "." }
+dependencies = [
+ { name = "gepa" },
+ { name = "httpx" },
+ { name = "litellm" },
+ { name = "python-dotenv" },
+]
+
+[package.dev-dependencies]
+dev = [
+ { name = "pytest" },
+ { name = "pytest-asyncio" },
+]
+
+[package.metadata]
+requires-dist = [
+ { name = "gepa", specifier = ">=0.1.1" },
+ { name = "httpx", specifier = ">=0.27" },
+ { name = "litellm", specifier = ">=1.0" },
+ { name = "python-dotenv", specifier = ">=1.0" },
+]
+
+[package.metadata.requires-dev]
+dev = [
+ { name = "pytest", specifier = ">=8.0" },
+ { name = "pytest-asyncio", specifier = ">=0.23" },
+]
+
+[[package]]
+name = "h11"
+version = "0.16.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
+]
+
+[[package]]
+name = "hf-xet"
+version = "1.5.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/74/d8/5c06fc76461418326a7decf8367480c35be11a41fd938633929c60a9ec6b/hf_xet-1.5.0.tar.gz", hash = "sha256:e0fb0a34d9f406eed88233e829a67ec016bec5af19e480eac65a233ea289a948", size = 837196, upload-time = "2026-05-06T06:18:15.583Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/68/9b/6912c99070915a4f28119e3c5b52a9abd1eec0ad5cb293b8c967a0c6f5a2/hf_xet-1.5.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:7d70fe2ce97b9db73b9c9b9c81fe3693640aec83416a966c446afea54acfae3c", size = 4023383, upload-time = "2026-05-06T06:17:53.947Z" },
+ { url = "https://files.pythonhosted.org/packages/0f/6d/9563cfde59b5d8128a9c7ec972a087f4c782e4f7bac5a85234edfd5d5e49/hf_xet-1.5.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:73a0dae8c71de3b0633a45c73f4a4a5ed09e94b43441d82981a781d4f12baa42", size = 3792751, upload-time = "2026-05-06T06:17:51.791Z" },
+ { url = "https://files.pythonhosted.org/packages/07/a5/ed5a0cf35b49a0571af5a8f53416dad1877a718c021c9937c3a53cb45781/hf_xet-1.5.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a60290ec57e9b71767fba7c3645ddafdd0759974b540441510c629c6db6db24a", size = 4456058, upload-time = "2026-05-06T06:17:40.735Z" },
+ { url = "https://files.pythonhosted.org/packages/60/fb/3ae8bf2a7a37a4197d0195d7247fd25b3952e15cb8a599e285dfaa6f52b3/hf_xet-1.5.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:e5de0f6deada0dada870bb376a11bcd1f08abf3a968a6d118f33e72d1b1eb480", size = 4250783, upload-time = "2026-05-06T06:17:38.412Z" },
+ { url = "https://files.pythonhosted.org/packages/a2/9b/8bae40d4d91525085137196e84eb0ed49cf65b5e96e5c3ecdadd8bd0fac2/hf_xet-1.5.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:c799d49f1a5544a0ef7591c0ee75e0d6b93d6f56dc7a4979f59f7518d2872216", size = 4445594, upload-time = "2026-05-06T06:18:04.219Z" },
+ { url = "https://files.pythonhosted.org/packages/13/59/c74efbbd4e8728172b2cc72a2bc014d2947a4b7bdced932fbd3f5da1a4e5/hf_xet-1.5.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:2baea1b0b989e5c152fe81425f7745ddc8901280ba3d97c98d8cdece7b706c60", size = 4663995, upload-time = "2026-05-06T06:18:06.1Z" },
+ { url = "https://files.pythonhosted.org/packages/73/32/8e1e0410af64cda9b139d1dcebdc993a8ff9c8c7c0e2696ae356d75ccc0d/hf_xet-1.5.0-cp313-cp313t-win_amd64.whl", hash = "sha256:526345b3ed45f374f6317349df489167606736c876241ba984105afe7fd4839d", size = 3966608, upload-time = "2026-05-06T06:18:19.74Z" },
+ { url = "https://files.pythonhosted.org/packages/fc/34/a8febc8f4edbea8b3e21b02ebc8b628679b84ba7e45cde624a7736b51500/hf_xet-1.5.0-cp313-cp313t-win_arm64.whl", hash = "sha256:786d28e2eb8315d5035544b9d137b4a842d600c434bb91bf7d0d953cce906ad4", size = 3796946, upload-time = "2026-05-06T06:18:17.568Z" },
+ { url = "https://files.pythonhosted.org/packages/2a/20/8fc8996afe5815fa1a6be8e9e5c02f24500f409d599e905800d498a4e14d/hf_xet-1.5.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:872d5601e6deea30d15865ede55d29eac6daf5a534ab417b99b6ef6b076dd96c", size = 4023495, upload-time = "2026-05-06T06:18:01.94Z" },
+ { url = "https://files.pythonhosted.org/packages/32/6a/93d84463c00cecb561a7508aa6303e35ee2894294eac14245526924415fe/hf_xet-1.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:9929561f5abf4581c8ea79587881dfef6b8abb2a0d8a51915936fc2a614f4e73", size = 3792731, upload-time = "2026-05-06T06:18:00.021Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/5a/8ec8e0c863b382d00b3c2e2af6ded6b06371be617144a625903a6d562f4b/hf_xet-1.5.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f7b7bbae318e583a86fb21e5a4a175d6721d628a2874f4bd022d0e660c32a682", size = 4456738, upload-time = "2026-05-06T06:17:49.574Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/ca/f7effa1a67717da2bcc6b6c28f71c6ca648c77acaec4e2c32f40cbe16d85/hf_xet-1.5.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:cf7b2dc6f31a4ea754bb50f74cde482dcf5d366d184076d8530b9872787f3761", size = 4251622, upload-time = "2026-05-06T06:17:47.096Z" },
+ { url = "https://files.pythonhosted.org/packages/65/f2/19247dba3e231cf77dec59ddfb878f00057635ff773d099c9b59d37812c3/hf_xet-1.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8dbcbab554c9ef158ef2c991545c3e970ddd8cc7acdcd0a78c5a41095dab4ded", size = 4445667, upload-time = "2026-05-06T06:18:11.983Z" },
+ { url = "https://files.pythonhosted.org/packages/7f/64/6f116801a3bcfb6f59f5c251f48cadc47ea54026441c4a385079286a94fa/hf_xet-1.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5906bf7718d3636dc13402914736abe723492cb730f744834f5f5b67d3a12702", size = 4664619, upload-time = "2026-05-06T06:18:13.771Z" },
+ { url = "https://files.pythonhosted.org/packages/5c/e8/069542d37946ed08669b127e1496fa99e78196d71de8d41eda5e9f1b7a58/hf_xet-1.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:5f3dc2248fc01cc0a00cd392ab497f1ca373fcbc7e3f2da1f452480b384e839e", size = 3966802, upload-time = "2026-05-06T06:18:28.162Z" },
+ { url = "https://files.pythonhosted.org/packages/f9/91/fc6fdec27b14d04e88c386ac0a0129732b53fa23f7c4a78f4b83a039c567/hf_xet-1.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:b285cea1b5bab46b758772716ba8d6854a1a0310fed1c249d678a8b38601e5a0", size = 3797168, upload-time = "2026-05-06T06:18:26.287Z" },
+ { url = "https://files.pythonhosted.org/packages/3d/fb/69ff198a82cae7eb1a69fb84d93b3a3e4816564d76817fe541ddc96874eb/hf_xet-1.5.0-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:dad0dc84e941b8ba3c860659fe1fdc35c049d47cce293f003287757e971a8f56", size = 4030814, upload-time = "2026-05-06T06:17:57.933Z" },
+ { url = "https://files.pythonhosted.org/packages/9b/ff/edcc2b40162bef3ff78e14ab637e5f3b89243d6aee72f5949d3bb6a5af83/hf_xet-1.5.0-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:fd6e5a9b0fdac4ed03ed45ef79254a655b1aaab514a02202617fbf643f5fdf7a", size = 3798444, upload-time = "2026-05-06T06:17:55.79Z" },
+ { url = "https://files.pythonhosted.org/packages/49/4d/103f76b04310e5e57656696cc184690d20c466af0bca3ca88f8c8ea5d4f3/hf_xet-1.5.0-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3531b1823a0e6d77d80f9ed15ca0e00f0d115094f8ac033d5cae88f4564cc949", size = 4465986, upload-time = "2026-05-06T06:17:44.886Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/a2/546f47f464737b3edbab6f8ddb57f2599b93d2cbb66f06abb475ccb48651/hf_xet-1.5.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:9a0ee58cd18d5ea799f7ed11290bbccbe56bdd8b1d97ca74b9cc49a3945d7a3b", size = 4259865, upload-time = "2026-05-06T06:17:42.639Z" },
+ { url = "https://files.pythonhosted.org/packages/95/7f/1be593c1f28613be2e196473481cd81bfc5910795e30a34e8f744f6cac4f/hf_xet-1.5.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1e60df5a42e9bed8628b6416af2cba4cba57ae9f02de226a06b020d98e1aab18", size = 4459835, upload-time = "2026-05-06T06:18:08.026Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/b2/703569fc881f3284487e68cda7b42179978480da3c438042a6bbbb4a671c/hf_xet-1.5.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4b35549ce62601b84da4ff9b24d970032ace3d4430f52d91bcbb26c901d6c690", size = 4672414, upload-time = "2026-05-06T06:18:09.864Z" },
+ { url = "https://files.pythonhosted.org/packages/af/37/1b6def445c567286b50aa3b33828158e135b1be44938dde59f11382a500c/hf_xet-1.5.0-cp37-abi3-win_amd64.whl", hash = "sha256:2806c7c17b4d23f8d88f7c4814f838c3b6150773fe339c20af23e1cfaf2797e4", size = 3977238, upload-time = "2026-05-06T06:18:23.621Z" },
+ { url = "https://files.pythonhosted.org/packages/62/94/3b66b148778ee100dcfd69c2ca22b57b41b44d3063ceec934f209e9184ce/hf_xet-1.5.0-cp37-abi3-win_arm64.whl", hash = "sha256:b6c9df403040248c76d808d3e047d64db2d923bae593eb244c41e425cf6cd7be", size = 3806916, upload-time = "2026-05-06T06:18:21.7Z" },
+]
+
+[[package]]
+name = "httpcore"
+version = "1.0.9"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "certifi" },
+ { name = "h11" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },
+]
+
+[[package]]
+name = "httpx"
+version = "0.28.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "anyio" },
+ { name = "certifi" },
+ { name = "httpcore" },
+ { name = "idna" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },
+]
+
+[[package]]
+name = "huggingface-hub"
+version = "1.17.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "click" },
+ { name = "filelock" },
+ { name = "fsspec" },
+ { name = "hf-xet", marker = "platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" },
+ { name = "httpx" },
+ { name = "packaging" },
+ { name = "pyyaml" },
+ { name = "tqdm" },
+ { name = "typer" },
+ { name = "typing-extensions" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/bd/65/9826515abb600b5722bcf53f8b4a2fb58340b1f8bfcaee19f83561c13a44/huggingface_hub-1.17.0.tar.gz", hash = "sha256:fad842b6763ef70ebc3919665b1b9273645203185400a7d6c5eddc2323cc3435", size = 797082, upload-time = "2026-05-28T15:12:13.347Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/02/28/d7cef5e477b855c25d415b8f57e5bc7347c7a90cad3acf1725d0c92ca294/huggingface_hub-1.17.0-py3-none-any.whl", hash = "sha256:3b8156d23118e87f6a587648bfbc04f04a12a757ccb4ed298b35c4ae638bf24c", size = 671546, upload-time = "2026-05-28T15:12:11.441Z" },
+]
+
+[[package]]
+name = "idna"
+version = "3.17"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/b9/28/99c51f664567218d824af024c0251650fb27e4ca066df188dab0769c5b91/idna-3.17.tar.gz", hash = "sha256:5eb0cb53bc467c12eadcf6de83163ad8527cec9416f44b9b61b19caedad2b87f", size = 196048, upload-time = "2026-05-28T14:32:38.55Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/de/a7/f76514cc40ad6234098ecdebda08732d75964776c51a42845b7da10649e2/idna-3.17-py3-none-any.whl", hash = "sha256:466e48829084efe2548012b855df21540b96f2e20e51bd124c851536556a592c", size = 65316, upload-time = "2026-05-28T14:32:37.035Z" },
+]
+
+[[package]]
+name = "importlib-metadata"
+version = "8.9.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "zipp" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/e7/72/c600ae4f68c28fc19f9c31b9403053e5dbb8cace2e6842c7b7c3e4d42fe9/importlib_metadata-8.9.0.tar.gz", hash = "sha256:58850626cef4bd2df100378b0f2aea9724a7b92f10770d547725b047078f99ee", size = 56140, upload-time = "2026-03-20T16:56:26.362Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/7d/f9/97f2ca8bb3ec6e4b1d64f983ebe98b9a192faddff67fac3d6303a537e670/importlib_metadata-8.9.0-py3-none-any.whl", hash = "sha256:e0f761b6ea91ced3b0844c14c9d955224d538105921f8e6754c00f6ca79fba7f", size = 27220, upload-time = "2026-03-20T16:56:25.07Z" },
+]
+
+[[package]]
+name = "iniconfig"
+version = "2.3.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
+]
+
+[[package]]
+name = "jinja2"
+version = "3.1.6"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "markupsafe" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
+]
+
+[[package]]
+name = "jiter"
+version = "0.15.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/66/b5/55f06bb281d92fb3cc86d14e1def2bd908bb77693183e7cb1f5a3c388b0c/jiter-0.15.0.tar.gz", hash = "sha256:4251acc80e2b7c9b7b8823456ea0fceeb0734dac2df7636d3c711b38476b5a76", size = 166640, upload-time = "2026-05-19T10:09:48.361Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/44/53/4f6bddbcde3c71e56d0aa1337ec95950f3d27dd4153e25aadf0feac71751/jiter-0.15.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:0e90a1c315a0226ec822d973817967f9223b7701546c8c2a7913e7ab0926294d", size = 308793, upload-time = "2026-05-19T10:07:35.25Z" },
+ { url = "https://files.pythonhosted.org/packages/01/84/c01099b59a285a1ebba64ae93f62bfa036675340fd1b0045ae65890a0442/jiter-0.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8c9004af7c8d67cce7f1aae1026fb55607f4aa600710d08ede3a3ce4aeefe7e0", size = 309570, upload-time = "2026-05-19T10:07:36.919Z" },
+ { url = "https://files.pythonhosted.org/packages/58/64/8fb7f9d45bb98190355454cd04dad8d8f27223d6bd52f83af07f637168a6/jiter-0.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c210f8b35dc6f30aafd4b4365ca89b9d1189f21ab49b8e68fa6322a847aef138", size = 336783, upload-time = "2026-05-19T10:07:38.694Z" },
+ { url = "https://files.pythonhosted.org/packages/c3/b6/f5739011d009b3a30f6a53c5240979030ba29ae46a8c67e3a15759f7c37d/jiter-0.15.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f30bae8bc1c2d613e28e5af3e8cceb09b742f1c8a8a5f839fb67afaffc03b61", size = 363555, upload-time = "2026-05-19T10:07:40.832Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/12/98a9d9f766665e8a3b6252454e17cb0c464606a28cf2fa09399b003345fa/jiter-0.15.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c60e71b6d10cfc284c9bf36bd885e8d44c46f688ce50aa91b5edd90181dea687", size = 452255, upload-time = "2026-05-19T10:07:42.62Z" },
+ { url = "https://files.pythonhosted.org/packages/e8/d5/60f972840f79c5e7544fce567c56f1e4e50468f996baba3e78d823dd62a6/jiter-0.15.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ab068bce62a45aa3e7367eceaffb5dde60b7eb853be8dece45132e3d0ff4879", size = 373559, upload-time = "2026-05-19T10:07:44.201Z" },
+ { url = "https://files.pythonhosted.org/packages/ee/cf/d46ef1234ba335aabc2f013210db8e0821a22f5e644a2e9449df199ecc23/jiter-0.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa248c9eb220197d363f688818dac2fd4b2f0cd7d843ca7105d652034823427d", size = 346055, upload-time = "2026-05-19T10:07:46.005Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/63/4d2749d8d54d230bad9b3a6b0d00cc28c6ff6b2fdffc26a8ccf76cc5a974/jiter-0.15.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:2a77aadd57cac1682e4401a72724d2796d89a4ba129b1a5812aa94ee480826eb", size = 351406, upload-time = "2026-05-19T10:07:47.855Z" },
+ { url = "https://files.pythonhosted.org/packages/d9/b9/9965b990035d8773328e0a8c8b457a87bf2b19f6c4126d9d99296be5d16a/jiter-0.15.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2ae901f3a55bfafdde31d289590fa25e3245735a2b1e8c7cc15871710a002871", size = 389357, upload-time = "2026-05-19T10:07:49.665Z" },
+ { url = "https://files.pythonhosted.org/packages/2d/55/9ddf903deda1413e87fed792f416b7123daee5b8efbad6a202a7421c36a5/jiter-0.15.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:f0b271b462769543716f92d3a4f90527df6ef5ed05ee95ec4137f513e21e1b77", size = 517263, upload-time = "2026-05-19T10:07:51.537Z" },
+ { url = "https://files.pythonhosted.org/packages/e8/76/a0c40ad064d3a20a4fde231e35d56e9a01ce82164278180e82d5daf85469/jiter-0.15.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2fb6a5d26af81fc0f00f9360a891e05cf755e149bba391c4d563adc54812973d", size = 548646, upload-time = "2026-05-19T10:07:53.196Z" },
+ { url = "https://files.pythonhosted.org/packages/23/4f/eca9b954942916ba2f453891b8593ab444cd872396fe66a3936616f236f3/jiter-0.15.0-cp312-cp312-win32.whl", hash = "sha256:c2f6bb8b5216ab9e7873bc08b5d7bef2b8abbb578a3069bf1cd14a45d71d771d", size = 206427, upload-time = "2026-05-19T10:07:55.307Z" },
+ { url = "https://files.pythonhosted.org/packages/95/bf/8ead82a87495149542748e828d153fd232a512a22c83b02c4815c1a9c7d8/jiter-0.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:40b2c7e92c44a84d748d21706c68dc6ff8161d80b59c99d774721a0d2317d7c7", size = 197300, upload-time = "2026-05-19T10:07:56.651Z" },
+ { url = "https://files.pythonhosted.org/packages/f4/e4/9b8a78fb2d894471bc344e37f1949bdd784bd914d031dba0ba3a40c71dd7/jiter-0.15.0-cp312-cp312-win_arm64.whl", hash = "sha256:cc0bc345cf2df9d1c00ac443f50d543c1ccfa8b0422cb85b1ab70d681c0b255b", size = 192702, upload-time = "2026-05-19T10:07:58.307Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/f4/f708c900ecee41b2025ef8413d5351e5649eb2125c506f6720cc69b06f5c/jiter-0.15.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1c11465f97e2abf45a014b83b730222f8f1c5335e802c7055a67d50de6f1f4e3", size = 307829, upload-time = "2026-05-19T10:07:59.704Z" },
+ { url = "https://files.pythonhosted.org/packages/86/59/db537c0949e83668c38481d426b9f2fd5ab758c4ee53a811dd0a510626a0/jiter-0.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d1e7b1776f0797956c509e123d0952d10d293a9492dea9f288ab9570ec01d1a5", size = 308445, upload-time = "2026-05-19T10:08:01.184Z" },
+ { url = "https://files.pythonhosted.org/packages/37/38/ea0e13b18c30ef951da0d47d39e7fa9edb82a93a62990ffbd7cea9b622d4/jiter-0.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:351a341c2105aa430b7047e30f1bf7975f6313b00165d3fc07be2edaf741f279", size = 336181, upload-time = "2026-05-19T10:08:02.688Z" },
+ { url = "https://files.pythonhosted.org/packages/58/fc/2303901b16c4ba05865588990a420c0b4156270b44379c20931544a1d962/jiter-0.15.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4ab395feec8d249ec4044e228e98a7033f043426a265df439dc3698823f0a4e4", size = 362985, upload-time = "2026-05-19T10:08:04.394Z" },
+ { url = "https://files.pythonhosted.org/packages/5b/6f/11bace093c52e7d4d26c8e606ccd7ae8c972189622469ec0d9e28161e28b/jiter-0.15.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2a438005b6f22d0273413484d6094d7c2c5d10ec1b3a3bf128e0d1d3ba53258", size = 453292, upload-time = "2026-05-19T10:08:05.967Z" },
+ { url = "https://files.pythonhosted.org/packages/22/db/987f2f086ca4d7a6582eb4ccd513f9b26b42d9e4243a087609a3137a8fc7/jiter-0.15.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f18f85e4218d1b40f000f42a92239a7a61a902cd42c65e6c360dbd17dcb20894", size = 373501, upload-time = "2026-05-19T10:08:07.857Z" },
+ { url = "https://files.pythonhosted.org/packages/8f/7c/89fbcabb2739b7a5b8dc959a1b6c5761f6484f5fed3486854b3c789bb1de/jiter-0.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1aa62e277fc1cbd80e6deacae6f4d983b41b3d7728e0645c5d741a6149bba45", size = 344683, upload-time = "2026-05-19T10:08:09.431Z" },
+ { url = "https://files.pythonhosted.org/packages/30/6f/6cca7692e7dddfec6d8d76c54dc97f2af2a41df4ac0674b999df1f09a5f3/jiter-0.15.0-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:6550fa135c7deb8ead6af49ed7ff648532ea8334a1447fe34a36315ef79c5c29", size = 350892, upload-time = "2026-05-19T10:08:11.352Z" },
+ { url = "https://files.pythonhosted.org/packages/39/14/0338d6190cb8e6d22e677ab1d4eabd4117f67cca70c54cd04b82ff64e068/jiter-0.15.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:066f8f33f18b2419cd8213b2436fa7fbc9c499f315971cfa3ce1f9820c001b1b", size = 388723, upload-time = "2026-05-19T10:08:12.912Z" },
+ { url = "https://files.pythonhosted.org/packages/90/31/cc19f4a1bdb6afb09ce6a2f2615aa8d44d994eba0d8e6105ed1af920e736/jiter-0.15.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:75e8a04e91432dde9f1838373cf93d23726c79d3e908d319acf0e796f85592e7", size = 516648, upload-time = "2026-05-19T10:08:14.808Z" },
+ { url = "https://files.pythonhosted.org/packages/49/9f/833c541512cd091b63c10c0381973dfe11bc7a503a818c16384417e0c81e/jiter-0.15.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:a97261f1fccb8e50ecd2890a96e46efdc3f57c80a197324c6777827231eca712", size = 547382, upload-time = "2026-05-19T10:08:16.927Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/11/e7b70e91f90bc4477e8eee9e8a5f7cf3cb41b4525d6394dc98a714eb8f7f/jiter-0.15.0-cp313-cp313-win32.whl", hash = "sha256:c77496cb10bd7549690fbbab3e5ec05857b83e49276f4a9423a766ddd2afcd4c", size = 205845, upload-time = "2026-05-19T10:08:18.401Z" },
+ { url = "https://files.pythonhosted.org/packages/4b/23/5c20d9ad6f02c493e4023e5d2d09e1c1f15fe2753c9102c544aff068a88e/jiter-0.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b15741f501469009ae0ae90b7147958a664a7dede40aa7ff174a8a4645f546d0", size = 196842, upload-time = "2026-05-19T10:08:20.131Z" },
+ { url = "https://files.pythonhosted.org/packages/6b/11/1eb400ef248e8c925fd883fbe325daf5e42cd1b0d308539dd332bd4f7ffc/jiter-0.15.0-cp313-cp313-win_arm64.whl", hash = "sha256:5d6a60072b44c3c2b797a7ddcbcbbf2b34ea3cfd4721580fbfd2a09d9d9b84ba", size = 192212, upload-time = "2026-05-19T10:08:21.807Z" },
+ { url = "https://files.pythonhosted.org/packages/8a/60/2fd8d7c79da8acf9b7b277c7616847773779356b92acfc9bb158452174da/jiter-0.15.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:ef1fd24d9413f6209e00d3d5a453e67acfe004a25cc6c8e8484faed4311ab9e8", size = 315065, upload-time = "2026-05-19T10:08:23.218Z" },
+ { url = "https://files.pythonhosted.org/packages/46/f4/008fb7d65e8ac2abf00811651a661e025c4ba80bbc6f378450384ddd3aed/jiter-0.15.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:144f8e72cb53dab146347b91cceac01f5481237f2b93b4a339a1ee8f8878b67c", size = 339444, upload-time = "2026-05-19T10:08:24.701Z" },
+ { url = "https://files.pythonhosted.org/packages/00/55/90b0c7b9c6896c0f2a591dd36d36b71d22e09674bfef178fa03ba3f81499/jiter-0.15.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:553fcac2ef2cb990877f9fc0833b8b629a3e6a5670b6b5fd58219b41a653ddc4", size = 347779, upload-time = "2026-05-19T10:08:26.408Z" },
+ { url = "https://files.pythonhosted.org/packages/51/6b/69666cec5000fd57734c118437394516c749ae8dbeea9fb66d6fef9c4775/jiter-0.15.0-cp313-cp313t-win_amd64.whl", hash = "sha256:774f93f65031856bf14ad9f59bdcab8b8cad501e5ceabd51ba3525f76937a25b", size = 200395, upload-time = "2026-05-19T10:08:28.055Z" },
+ { url = "https://files.pythonhosted.org/packages/39/04/a6aa62cd27e8149b0d28df5561f10f6cceaf7935a9ccf3f1c5a05f9a0cd8/jiter-0.15.0-cp313-cp313t-win_arm64.whl", hash = "sha256:f1e1754960f38ec40613a07e5e372df67acb3b890fb383b6fb3de3e49ddbf3c7", size = 190516, upload-time = "2026-05-19T10:08:29.35Z" },
+ { url = "https://files.pythonhosted.org/packages/eb/d2/079f350ebf7859d081de30aa890f9e3be68516f754f3ba32366ffff4dcee/jiter-0.15.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:ac0d9ddea4350974be7a221fc25895f251a8fee748c889bdced2141c0fec1a49", size = 308884, upload-time = "2026-05-19T10:08:31.667Z" },
+ { url = "https://files.pythonhosted.org/packages/04/4e/a2c30a7f69b48c03b20935d647479106fe932f6e63f75faf53937197e05d/jiter-0.15.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:01a8222cf05ab1128e239421156c207949808acaaea2bdfd33130ae666786e86", size = 310028, upload-time = "2026-05-19T10:08:33.304Z" },
+ { url = "https://files.pythonhosted.org/packages/40/90/2e7cdfd3cf8ca967be38c48f5cf474d79f089efaf559a40f15984a77ae69/jiter-0.15.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:182226cbc930c9fab81bc2e41a4da672f89539906dadb05e75670ac07b94f71f", size = 337485, upload-time = "2026-05-19T10:08:35.259Z" },
+ { url = "https://files.pythonhosted.org/packages/9b/11/15a1aa28b120b8ee5b4f1fb894c125046225f09847738bd64233d3b84883/jiter-0.15.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:71683c38c825452999b5717fcae07ea708e8c93003e808be4319c1b02e3d176e", size = 364223, upload-time = "2026-05-19T10:08:36.694Z" },
+ { url = "https://files.pythonhosted.org/packages/b7/25/f442e8af5f3d0dcf47b39e83a0efd9ee45ea946aa6d04625dc3181eae3b6/jiter-0.15.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:30f2218e6a9e5c18bc10fe6d41ac189c442c88eacf11bad9f28ef95a9bef00e6", size = 456387, upload-time = "2026-05-19T10:08:38.143Z" },
+ { url = "https://files.pythonhosted.org/packages/da/f4/37f2d2c9f64f49af7da652ed7532bb5a2372e588e6927c3fdd76f911db65/jiter-0.15.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5157de9f76eb4bc5ea74a1219366a25f945ad305641d74e04f59c54087091aa9", size = 374461, upload-time = "2026-05-19T10:08:39.869Z" },
+ { url = "https://files.pythonhosted.org/packages/60/28/edcfbbbf0cb15436f36664a8908a0df47ab9006298d4cd937dc08ea932d6/jiter-0.15.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90c5db5527c221249a876160663ab891ace358c17f7b9c93ec1478b7f0550e5c", size = 345924, upload-time = "2026-05-19T10:08:41.668Z" },
+ { url = "https://files.pythonhosted.org/packages/47/13/89fba6398dab7f202b7278c4b4aac122399d2c0183971c4a57a3b7088df5/jiter-0.15.0-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:3e4540b8e74e4268811ac05db226a6a128ff572e7e0ce3f1163b693cadb184cd", size = 352283, upload-time = "2026-05-19T10:08:43.091Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/da/0f6af8cef2c565a1ab44d970f268c43ccaa72707386ea6388e6fe2b6cd26/jiter-0.15.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:62ebd14e47e9aed9df4472afcb2663668ce4d74891cd54f86bf6e44029d6dc89", size = 389985, upload-time = "2026-05-19T10:08:44.915Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/ec/b9cb7d6d29e24ee14910266157d2a279d7a8f60ee0df7fa840882976ba64/jiter-0.15.0-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0be6f5ad41a809f303f416d17cec92a7a725902fb9b4f3de3d19362ac0ef8554", size = 517695, upload-time = "2026-05-19T10:08:46.486Z" },
+ { url = "https://files.pythonhosted.org/packages/64/5e/6d1bda880723aae0ad86b4b763f044362448efe31e3e819635d41cb03451/jiter-0.15.0-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:813dfbb17d65328bf86e5f0905dd277ba2265d3ca20556e86c0c7035b7182e5a", size = 548868, upload-time = "2026-05-19T10:08:48.026Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/72/7de501cf38dcacaf35098796f3a50e0f2e338baba18a58946c618544b809/jiter-0.15.0-cp314-cp314-win32.whl", hash = "sha256:50e51156192722a9c58db112837d3f8ef96fb3c5ecc14e95f409134b08b158ec", size = 206380, upload-time = "2026-05-19T10:08:49.738Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/a9/e19addf4b0c1bdce52c6da12351e6bc42c340c45e7c09e2158e46d293ccc/jiter-0.15.0-cp314-cp314-win_amd64.whl", hash = "sha256:30ce1a5d16b5641dc935d50ef775af6a0871e3d14ab05d6fc54dff371b78e558", size = 197687, upload-time = "2026-05-19T10:08:51.088Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/c9/776b1db01db25fc6c1d58d1979a37b0a9fe787e5f5b1d062d2eaacb77923/jiter-0.15.0-cp314-cp314-win_arm64.whl", hash = "sha256:510c8b3c17a0ed9ac69850c0438dada3c9b82d9c4d589fcb62002a5a9cf3a866", size = 192571, upload-time = "2026-05-19T10:08:52.451Z" },
+ { url = "https://files.pythonhosted.org/packages/a0/f6/45bb4670bacf300fd2c7abadbfb3af376e5f1b6ae75fd9bc069891d15870/jiter-0.15.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7553333dd0930c104a5a0db8df72bf7219fe663d731383b576bb6ed6351c984d", size = 317151, upload-time = "2026-05-19T10:08:53.867Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/68/ed635ad5acd7b73e454283083bbb7c8205ad10e88b0d9d7d793b09fe8226/jiter-0.15.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2143ab06181d2b029eedcb6af3cebe95f11bbac62441781860f98ee9330a6a6", size = 341243, upload-time = "2026-05-19T10:08:55.383Z" },
+ { url = "https://files.pythonhosted.org/packages/5d/db/3ff4176b817b8ea33879e71e13d8bc2b0d481a7ed3fe9e080f333d415c16/jiter-0.15.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6eac374c5c975709b69c10f09afd199df74150172156ad10c8d4fd785b7da995", size = 363629, upload-time = "2026-05-19T10:08:56.928Z" },
+ { url = "https://files.pythonhosted.org/packages/ab/24/5f8270e0ba9c883582f96f722f8a0b58015c7ce1f8c6d4571cf394e99b6b/jiter-0.15.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b3b3b775e33d3bfaec9899edc526ae97b0da0bf9d071a46124ba419149a414f8", size = 456198, upload-time = "2026-05-19T10:08:58.618Z" },
+ { url = "https://files.pythonhosted.org/packages/45/5b/76fc02b0b5c54c3d18c60653156e2f76fde1816f9b4722db68d6ee2c897e/jiter-0.15.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3071db3346334beae1360b46da4606da57bf3528c167b3c38533afaf9f2c5", size = 373710, upload-time = "2026-05-19T10:09:00.151Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/52/4310821b0ea9277994d3e1f49fc6a4b34e4800caebacb2c0af81da59a454/jiter-0.15.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c6694a173ecabc12eb60efbc0b474464ead1951ff65cd8b1e72100715c64512b", size = 349901, upload-time = "2026-05-19T10:09:01.621Z" },
+ { url = "https://files.pythonhosted.org/packages/93/fe/67648c35b3594fba8854ac64cc8a826d8bcd18324bbdb53d77697c60b6ef/jiter-0.15.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:a254e10b593624d230c365b6d616b22ca0ad65e63a16e6631c2b3466022e6ba8", size = 352438, upload-time = "2026-05-19T10:09:03.216Z" },
+ { url = "https://files.pythonhosted.org/packages/cb/28/0a1879d07ad6b3e025a2750027363452ced93c2d16d1c9d4b153ffd51c91/jiter-0.15.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d8d2955167274e15d79a7a020afdd9b39c990eb80b2d89fca695d92dcfdd38ec", size = 388152, upload-time = "2026-05-19T10:09:04.741Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/78/46c6f6b56ba85c90021f4afd72ed42f691f8f84daacb5fe27277070e3858/jiter-0.15.0-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:acf4ee4d1fc55917239fe72972fb292dd773055d05eb040d36f4326e02cc2c0e", size = 517707, upload-time = "2026-05-19T10:09:06.231Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/cb/720662d4c88fcad606e826fef5424365527ba43ce4868a479aed8f8c507e/jiter-0.15.0-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:e7196e56f1cd69af1dbb07dff02dcfb260a50b45a82d409d92a06fedb32473b5", size = 548241, upload-time = "2026-05-19T10:09:08.093Z" },
+ { url = "https://files.pythonhosted.org/packages/60/e3/935b8034fd143f21125c87d51404a9e0e1449186a494405721ff5d1d695e/jiter-0.15.0-cp314-cp314t-win32.whl", hash = "sha256:7f6163c0f10b055245f814dcc59f4818da60dfe72f3e72ab89fc24b6bd5e9c52", size = 207950, upload-time = "2026-05-19T10:09:09.616Z" },
+ { url = "https://files.pythonhosted.org/packages/93/59/984fd9ece895953dad3e0880a650e766f5a2da2c5514f0eafdaaabbeb5f9/jiter-0.15.0-cp314-cp314t-win_amd64.whl", hash = "sha256:980c256edb05b78a111b99c4de3b1d32e31634b867fd1fc2cf726e7b7bba9854", size = 200055, upload-time = "2026-05-19T10:09:11.367Z" },
+ { url = "https://files.pythonhosted.org/packages/0e/a4/cf8d779feb133a27a2e3bc833bccb9e13aa332cdf820497ebf72c10ce8c3/jiter-0.15.0-cp314-cp314t-win_arm64.whl", hash = "sha256:66b1880df2d01e206e8339769d1c7c1753bcb653efd6289e203f6f24ebada0c0", size = 191244, upload-time = "2026-05-19T10:09:12.74Z" },
+ { url = "https://files.pythonhosted.org/packages/73/38/505941b2b092fd5bbbd60a52a880db1173f1690ae6751bed3af1c9ddcb4e/jiter-0.15.0-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:631f13a3d04e97d4e083993b10f4b99530e3a10d953e2eb5e196b7dc7f812ce0", size = 303769, upload-time = "2026-05-19T10:09:42.203Z" },
+ { url = "https://files.pythonhosted.org/packages/e7/95/a06692b29e77473f286e1ec1f426d3ca44d7b5843be8ad21d7a5f3fcdcc0/jiter-0.15.0-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:b6c0ffae686c39bf3737be60793783267628783ea42545632c10b291105aee45", size = 305128, upload-time = "2026-05-19T10:09:43.657Z" },
+ { url = "https://files.pythonhosted.org/packages/23/85/7270d7ad41d6061a25b950c6bf91d638bd9aacb113200a8c8d57a055fd67/jiter-0.15.0-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d54fb5b31dea401a41af3f8a7d2512e9b6a6a005491e6166c7e4ffab9639a9c", size = 340459, upload-time = "2026-05-19T10:09:45.452Z" },
+ { url = "https://files.pythonhosted.org/packages/c8/8d/302cb2057b7513327b4d575cff6b1d066ee6431a5357fc3f8867cd684406/jiter-0.15.0-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54d5d6090cdc1b7c9e780dfb04949a990adb1e301a2fc0bbcee7de4638d33f9a", size = 344469, upload-time = "2026-05-19T10:09:46.864Z" },
+]
+
+[[package]]
+name = "jsonschema"
+version = "4.26.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "attrs" },
+ { name = "jsonschema-specifications" },
+ { name = "referencing" },
+ { name = "rpds-py" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/b3/fc/e067678238fa451312d4c62bf6e6cf5ec56375422aee02f9cb5f909b3047/jsonschema-4.26.0.tar.gz", hash = "sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326", size = 366583, upload-time = "2026-01-07T13:41:07.246Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/69/90/f63fb5873511e014207a475e2bb4e8b2e570d655b00ac19a9a0ca0a385ee/jsonschema-4.26.0-py3-none-any.whl", hash = "sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce", size = 90630, upload-time = "2026-01-07T13:41:05.306Z" },
+]
+
+[[package]]
+name = "jsonschema-specifications"
+version = "2025.9.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "referencing" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" },
+]
+
+[[package]]
+name = "litellm"
+version = "1.87.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "aiohttp" },
+ { name = "click" },
+ { name = "fastuuid" },
+ { name = "httpx" },
+ { name = "importlib-metadata" },
+ { name = "jinja2" },
+ { name = "jsonschema" },
+ { name = "openai" },
+ { name = "pydantic" },
+ { name = "python-dotenv" },
+ { name = "tiktoken" },
+ { name = "tokenizers" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/77/0d/ccdf682ccfd7f18bf0e179c39d85616b8f8ef05a798588285310412db13d/litellm-1.87.0.tar.gz", hash = "sha256:cafc1882cb0cbab8374c41180af86e4a067796e4524e15f59e99f6e689cd1bd8", size = 15453755, upload-time = "2026-06-02T03:53:29.076Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/98/20/88a372fa7e50fc2c33458c6eef94a79afcf7bdfa43610079531b82b484a3/litellm-1.87.0-py3-none-any.whl", hash = "sha256:fbbba7e47ae29b55f878fe1acc80effb92761bc168f6236bd81a0cb6e147d855", size = 17103948, upload-time = "2026-06-02T03:53:25.677Z" },
+]
+
+[[package]]
+name = "markdown-it-py"
+version = "4.2.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "mdurl" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" },
+]
+
+[[package]]
+name = "markupsafe"
+version = "3.0.3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" },
+ { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" },
+ { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" },
+ { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" },
+ { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" },
+ { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" },
+ { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" },
+ { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" },
+ { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" },
+ { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" },
+ { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" },
+ { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" },
+ { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" },
+ { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" },
+ { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" },
+ { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" },
+ { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" },
+ { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" },
+ { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" },
+ { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" },
+ { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" },
+ { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" },
+ { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" },
+ { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" },
+ { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" },
+ { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" },
+ { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" },
+ { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" },
+ { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" },
+ { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" },
+ { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" },
+ { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" },
+ { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" },
+]
+
+[[package]]
+name = "mdurl"
+version = "0.1.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },
+]
+
+[[package]]
+name = "multidict"
+version = "6.7.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/1a/c2/c2d94cbe6ac1753f3fc980da97b3d930efe1da3af3c9f5125354436c073d/multidict-6.7.1.tar.gz", hash = "sha256:ec6652a1bee61c53a3e5776b6049172c53b6aaba34f18c9ad04f82712bac623d", size = 102010, upload-time = "2026-01-26T02:46:45.979Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/8d/9c/f20e0e2cf80e4b2e4b1c365bf5fe104ee633c751a724246262db8f1a0b13/multidict-6.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a90f75c956e32891a4eda3639ce6dd86e87105271f43d43442a3aedf3cddf172", size = 76893, upload-time = "2026-01-26T02:43:52.754Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/cf/18ef143a81610136d3da8193da9d80bfe1cb548a1e2d1c775f26b23d024a/multidict-6.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fccb473e87eaa1382689053e4a4618e7ba7b9b9b8d6adf2027ee474597128cd", size = 45456, upload-time = "2026-01-26T02:43:53.893Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/65/1caac9d4cd32e8433908683446eebc953e82d22b03d10d41a5f0fefe991b/multidict-6.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0fa96985700739c4c7853a43c0b3e169360d6855780021bfc6d0f1ce7c123e7", size = 43872, upload-time = "2026-01-26T02:43:55.041Z" },
+ { url = "https://files.pythonhosted.org/packages/cf/3b/d6bd75dc4f3ff7c73766e04e705b00ed6dbbaccf670d9e05a12b006f5a21/multidict-6.7.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cb2a55f408c3043e42b40cc8eecd575afa27b7e0b956dfb190de0f8499a57a53", size = 251018, upload-time = "2026-01-26T02:43:56.198Z" },
+ { url = "https://files.pythonhosted.org/packages/fd/80/c959c5933adedb9ac15152e4067c702a808ea183a8b64cf8f31af8ad3155/multidict-6.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb0ce7b2a32d09892b3dd6cc44877a0d02a33241fafca5f25c8b6b62374f8b75", size = 258883, upload-time = "2026-01-26T02:43:57.499Z" },
+ { url = "https://files.pythonhosted.org/packages/86/85/7ed40adafea3d4f1c8b916e3b5cc3a8e07dfcdcb9cd72800f4ed3ca1b387/multidict-6.7.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c3a32d23520ee37bf327d1e1a656fec76a2edd5c038bf43eddfa0572ec49c60b", size = 242413, upload-time = "2026-01-26T02:43:58.755Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/57/b8565ff533e48595503c785f8361ff9a4fde4d67de25c207cd0ba3befd03/multidict-6.7.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c90fed18bffc0189ba814749fdcc102b536e83a9f738a9003e569acd540a733", size = 268404, upload-time = "2026-01-26T02:44:00.216Z" },
+ { url = "https://files.pythonhosted.org/packages/e0/50/9810c5c29350f7258180dfdcb2e52783a0632862eb334c4896ac717cebcb/multidict-6.7.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:da62917e6076f512daccfbbde27f46fed1c98fee202f0559adec8ee0de67f71a", size = 269456, upload-time = "2026-01-26T02:44:02.202Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/8d/5e5be3ced1d12966fefb5c4ea3b2a5b480afcea36406559442c6e31d4a48/multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bfde23ef6ed9db7eaee6c37dcec08524cb43903c60b285b172b6c094711b3961", size = 256322, upload-time = "2026-01-26T02:44:03.56Z" },
+ { url = "https://files.pythonhosted.org/packages/31/6e/d8a26d81ac166a5592782d208dd90dfdc0a7a218adaa52b45a672b46c122/multidict-6.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3758692429e4e32f1ba0df23219cd0b4fc0a52f476726fff9337d1a57676a582", size = 253955, upload-time = "2026-01-26T02:44:04.845Z" },
+ { url = "https://files.pythonhosted.org/packages/59/4c/7c672c8aad41534ba619bcd4ade7a0dc87ed6b8b5c06149b85d3dd03f0cd/multidict-6.7.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:398c1478926eca669f2fd6a5856b6de9c0acf23a2cb59a14c0ba5844fa38077e", size = 251254, upload-time = "2026-01-26T02:44:06.133Z" },
+ { url = "https://files.pythonhosted.org/packages/7b/bd/84c24de512cbafbdbc39439f74e967f19570ce7924e3007174a29c348916/multidict-6.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c102791b1c4f3ab36ce4101154549105a53dc828f016356b3e3bcae2e3a039d3", size = 252059, upload-time = "2026-01-26T02:44:07.518Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/ba/f5449385510825b73d01c2d4087bf6d2fccc20a2d42ac34df93191d3dd03/multidict-6.7.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a088b62bd733e2ad12c50dad01b7d0166c30287c166e137433d3b410add807a6", size = 263588, upload-time = "2026-01-26T02:44:09.382Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/11/afc7c677f68f75c84a69fe37184f0f82fce13ce4b92f49f3db280b7e92b3/multidict-6.7.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3d51ff4785d58d3f6c91bdbffcb5e1f7ddfda557727043aa20d20ec4f65e324a", size = 259642, upload-time = "2026-01-26T02:44:10.73Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/17/ebb9644da78c4ab36403739e0e6e0e30ebb135b9caf3440825001a0bddcb/multidict-6.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc5907494fccf3e7d3f94f95c91d6336b092b5fc83811720fae5e2765890dfba", size = 251377, upload-time = "2026-01-26T02:44:12.042Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/a4/840f5b97339e27846c46307f2530a2805d9d537d8b8bd416af031cad7fa0/multidict-6.7.1-cp312-cp312-win32.whl", hash = "sha256:28ca5ce2fd9716631133d0e9a9b9a745ad7f60bac2bccafb56aa380fc0b6c511", size = 41887, upload-time = "2026-01-26T02:44:14.245Z" },
+ { url = "https://files.pythonhosted.org/packages/80/31/0b2517913687895f5904325c2069d6a3b78f66cc641a86a2baf75a05dcbb/multidict-6.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcee94dfbd638784645b066074b338bc9cc155d4b4bffa4adce1615c5a426c19", size = 46053, upload-time = "2026-01-26T02:44:15.371Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/5b/aba28e4ee4006ae4c7df8d327d31025d760ffa992ea23812a601d226e682/multidict-6.7.1-cp312-cp312-win_arm64.whl", hash = "sha256:ba0a9fb644d0c1a2194cf7ffb043bd852cea63a57f66fbd33959f7dae18517bf", size = 43307, upload-time = "2026-01-26T02:44:16.852Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/22/929c141d6c0dba87d3e1d38fbdf1ba8baba86b7776469f2bc2d3227a1e67/multidict-6.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2b41f5fed0ed563624f1c17630cb9941cf2309d4df00e494b551b5f3e3d67a23", size = 76174, upload-time = "2026-01-26T02:44:18.509Z" },
+ { url = "https://files.pythonhosted.org/packages/c7/75/bc704ae15fee974f8fccd871305e254754167dce5f9e42d88a2def741a1d/multidict-6.7.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84e61e3af5463c19b67ced91f6c634effb89ef8bfc5ca0267f954451ed4bb6a2", size = 45116, upload-time = "2026-01-26T02:44:19.745Z" },
+ { url = "https://files.pythonhosted.org/packages/79/76/55cd7186f498ed080a18440c9013011eb548f77ae1b297206d030eb1180a/multidict-6.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:935434b9853c7c112eee7ac891bc4cb86455aa631269ae35442cb316790c1445", size = 43524, upload-time = "2026-01-26T02:44:21.571Z" },
+ { url = "https://files.pythonhosted.org/packages/e9/3c/414842ef8d5a1628d68edee29ba0e5bcf235dbfb3ccd3ea303a7fe8c72ff/multidict-6.7.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:432feb25a1cb67fe82a9680b4d65fb542e4635cb3166cd9c01560651ad60f177", size = 249368, upload-time = "2026-01-26T02:44:22.803Z" },
+ { url = "https://files.pythonhosted.org/packages/f6/32/befed7f74c458b4a525e60519fe8d87eef72bb1e99924fa2b0f9d97a221e/multidict-6.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e82d14e3c948952a1a85503817e038cba5905a3352de76b9a465075d072fba23", size = 256952, upload-time = "2026-01-26T02:44:24.306Z" },
+ { url = "https://files.pythonhosted.org/packages/03/d6/c878a44ba877f366630c860fdf74bfb203c33778f12b6ac274936853c451/multidict-6.7.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4cfb48c6ea66c83bcaaf7e4dfa7ec1b6bbcf751b7db85a328902796dfde4c060", size = 240317, upload-time = "2026-01-26T02:44:25.772Z" },
+ { url = "https://files.pythonhosted.org/packages/68/49/57421b4d7ad2e9e60e25922b08ceb37e077b90444bde6ead629095327a6f/multidict-6.7.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1d540e51b7e8e170174555edecddbd5538105443754539193e3e1061864d444d", size = 267132, upload-time = "2026-01-26T02:44:27.648Z" },
+ { url = "https://files.pythonhosted.org/packages/b7/fe/ec0edd52ddbcea2a2e89e174f0206444a61440b40f39704e64dc807a70bd/multidict-6.7.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:273d23f4b40f3dce4d6c8a821c741a86dec62cded82e1175ba3d99be128147ed", size = 268140, upload-time = "2026-01-26T02:44:29.588Z" },
+ { url = "https://files.pythonhosted.org/packages/b0/73/6e1b01cbeb458807aa0831742232dbdd1fa92bfa33f52a3f176b4ff3dc11/multidict-6.7.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d624335fd4fa1c08a53f8b4be7676ebde19cd092b3895c421045ca87895b429", size = 254277, upload-time = "2026-01-26T02:44:30.902Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/b2/5fb8c124d7561a4974c342bc8c778b471ebbeb3cc17df696f034a7e9afe7/multidict-6.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:12fad252f8b267cc75b66e8fc51b3079604e8d43a75428ffe193cd9e2195dfd6", size = 252291, upload-time = "2026-01-26T02:44:32.31Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/96/51d4e4e06bcce92577fcd488e22600bd38e4fd59c20cb49434d054903bd2/multidict-6.7.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:03ede2a6ffbe8ef936b92cb4529f27f42be7f56afcdab5ab739cd5f27fb1cbf9", size = 250156, upload-time = "2026-01-26T02:44:33.734Z" },
+ { url = "https://files.pythonhosted.org/packages/db/6b/420e173eec5fba721a50e2a9f89eda89d9c98fded1124f8d5c675f7a0c0f/multidict-6.7.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:90efbcf47dbe33dcf643a1e400d67d59abeac5db07dc3f27d6bdeae497a2198c", size = 249742, upload-time = "2026-01-26T02:44:35.222Z" },
+ { url = "https://files.pythonhosted.org/packages/44/a3/ec5b5bd98f306bc2aa297b8c6f11a46714a56b1e6ef5ebda50a4f5d7c5fb/multidict-6.7.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5c4b9bfc148f5a91be9244d6264c53035c8a0dcd2f51f1c3c6e30e30ebaa1c84", size = 262221, upload-time = "2026-01-26T02:44:36.604Z" },
+ { url = "https://files.pythonhosted.org/packages/cd/f7/e8c0d0da0cd1e28d10e624604e1a36bcc3353aaebdfdc3a43c72bc683a12/multidict-6.7.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:401c5a650f3add2472d1d288c26deebc540f99e2fb83e9525007a74cd2116f1d", size = 258664, upload-time = "2026-01-26T02:44:38.008Z" },
+ { url = "https://files.pythonhosted.org/packages/52/da/151a44e8016dd33feed44f730bd856a66257c1ee7aed4f44b649fb7edeb3/multidict-6.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:97891f3b1b3ffbded884e2916cacf3c6fc87b66bb0dde46f7357404750559f33", size = 249490, upload-time = "2026-01-26T02:44:39.386Z" },
+ { url = "https://files.pythonhosted.org/packages/87/af/a3b86bf9630b732897f6fc3f4c4714b90aa4361983ccbdcd6c0339b21b0c/multidict-6.7.1-cp313-cp313-win32.whl", hash = "sha256:e1c5988359516095535c4301af38d8a8838534158f649c05dd1050222321bcb3", size = 41695, upload-time = "2026-01-26T02:44:41.318Z" },
+ { url = "https://files.pythonhosted.org/packages/b2/35/e994121b0e90e46134673422dd564623f93304614f5d11886b1b3e06f503/multidict-6.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:960c83bf01a95b12b08fd54324a4eb1d5b52c88932b5cba5d6e712bb3ed12eb5", size = 45884, upload-time = "2026-01-26T02:44:42.488Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/61/42d3e5dbf661242a69c97ea363f2d7b46c567da8eadef8890022be6e2ab0/multidict-6.7.1-cp313-cp313-win_arm64.whl", hash = "sha256:563fe25c678aaba333d5399408f5ec3c383ca5b663e7f774dd179a520b8144df", size = 43122, upload-time = "2026-01-26T02:44:43.664Z" },
+ { url = "https://files.pythonhosted.org/packages/6d/b3/e6b21c6c4f314bb956016b0b3ef2162590a529b84cb831c257519e7fde44/multidict-6.7.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:c76c4bec1538375dad9d452d246ca5368ad6e1c9039dadcf007ae59c70619ea1", size = 83175, upload-time = "2026-01-26T02:44:44.894Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/76/23ecd2abfe0957b234f6c960f4ade497f55f2c16aeb684d4ecdbf1c95791/multidict-6.7.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:57b46b24b5d5ebcc978da4ec23a819a9402b4228b8a90d9c656422b4bdd8a963", size = 48460, upload-time = "2026-01-26T02:44:46.106Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/57/a0ed92b23f3a042c36bc4227b72b97eca803f5f1801c1ab77c8a212d455e/multidict-6.7.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e954b24433c768ce78ab7929e84ccf3422e46deb45a4dc9f93438f8217fa2d34", size = 46930, upload-time = "2026-01-26T02:44:47.278Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/66/02ec7ace29162e447f6382c495dc95826bf931d3818799bbef11e8f7df1a/multidict-6.7.1-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3bd231490fa7217cc832528e1cd8752a96f0125ddd2b5749390f7c3ec8721b65", size = 242582, upload-time = "2026-01-26T02:44:48.604Z" },
+ { url = "https://files.pythonhosted.org/packages/58/18/64f5a795e7677670e872673aca234162514696274597b3708b2c0d276cce/multidict-6.7.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:253282d70d67885a15c8a7716f3a73edf2d635793ceda8173b9ecc21f2fb8292", size = 250031, upload-time = "2026-01-26T02:44:50.544Z" },
+ { url = "https://files.pythonhosted.org/packages/c8/ed/e192291dbbe51a8290c5686f482084d31bcd9d09af24f63358c3d42fd284/multidict-6.7.1-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b4c48648d7649c9335cf1927a8b87fa692de3dcb15faa676c6a6f1f1aabda43", size = 228596, upload-time = "2026-01-26T02:44:51.951Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/7e/3562a15a60cf747397e7f2180b0a11dc0c38d9175a650e75fa1b4d325e15/multidict-6.7.1-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:98bc624954ec4d2c7cb074b8eefc2b5d0ce7d482e410df446414355d158fe4ca", size = 257492, upload-time = "2026-01-26T02:44:53.902Z" },
+ { url = "https://files.pythonhosted.org/packages/24/02/7d0f9eae92b5249bb50ac1595b295f10e263dd0078ebb55115c31e0eaccd/multidict-6.7.1-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1b99af4d9eec0b49927b4402bcbb58dea89d3e0db8806a4086117019939ad3dd", size = 255899, upload-time = "2026-01-26T02:44:55.316Z" },
+ { url = "https://files.pythonhosted.org/packages/00/e3/9b60ed9e23e64c73a5cde95269ef1330678e9c6e34dd4eb6b431b85b5a10/multidict-6.7.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6aac4f16b472d5b7dc6f66a0d49dd57b0e0902090be16594dc9ebfd3d17c47e7", size = 247970, upload-time = "2026-01-26T02:44:56.783Z" },
+ { url = "https://files.pythonhosted.org/packages/3e/06/538e58a63ed5cfb0bd4517e346b91da32fde409d839720f664e9a4ae4f9d/multidict-6.7.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:21f830fe223215dffd51f538e78c172ed7c7f60c9b96a2bf05c4848ad49921c3", size = 245060, upload-time = "2026-01-26T02:44:58.195Z" },
+ { url = "https://files.pythonhosted.org/packages/b2/2f/d743a3045a97c895d401e9bd29aaa09b94f5cbdf1bd561609e5a6c431c70/multidict-6.7.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:f5dd81c45b05518b9aa4da4aa74e1c93d715efa234fd3e8a179df611cc85e5f4", size = 235888, upload-time = "2026-01-26T02:44:59.57Z" },
+ { url = "https://files.pythonhosted.org/packages/38/83/5a325cac191ab28b63c52f14f1131f3b0a55ba3b9aa65a6d0bf2a9b921a0/multidict-6.7.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:eb304767bca2bb92fb9c5bd33cedc95baee5bb5f6c88e63706533a1c06ad08c8", size = 243554, upload-time = "2026-01-26T02:45:01.054Z" },
+ { url = "https://files.pythonhosted.org/packages/20/1f/9d2327086bd15da2725ef6aae624208e2ef828ed99892b17f60c344e57ed/multidict-6.7.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c9035dde0f916702850ef66460bc4239d89d08df4d02023a5926e7446724212c", size = 252341, upload-time = "2026-01-26T02:45:02.484Z" },
+ { url = "https://files.pythonhosted.org/packages/e8/2c/2a1aa0280cf579d0f6eed8ee5211c4f1730bd7e06c636ba2ee6aafda302e/multidict-6.7.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:af959b9beeb66c822380f222f0e0a1889331597e81f1ded7f374f3ecb0fd6c52", size = 246391, upload-time = "2026-01-26T02:45:03.862Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/03/7ca022ffc36c5a3f6e03b179a5ceb829be9da5783e6fe395f347c0794680/multidict-6.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:41f2952231456154ee479651491e94118229844dd7226541788be783be2b5108", size = 243422, upload-time = "2026-01-26T02:45:05.296Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/1d/b31650eab6c5778aceed46ba735bd97f7c7d2f54b319fa916c0f96e7805b/multidict-6.7.1-cp313-cp313t-win32.whl", hash = "sha256:df9f19c28adcb40b6aae30bbaa1478c389efd50c28d541d76760199fc1037c32", size = 47770, upload-time = "2026-01-26T02:45:06.754Z" },
+ { url = "https://files.pythonhosted.org/packages/ac/5b/2d2d1d522e51285bd61b1e20df8f47ae1a9d80839db0b24ea783b3832832/multidict-6.7.1-cp313-cp313t-win_amd64.whl", hash = "sha256:d54ecf9f301853f2c5e802da559604b3e95bb7a3b01a9c295c6ee591b9882de8", size = 53109, upload-time = "2026-01-26T02:45:08.044Z" },
+ { url = "https://files.pythonhosted.org/packages/3d/a3/cc409ba012c83ca024a308516703cf339bdc4b696195644a7215a5164a24/multidict-6.7.1-cp313-cp313t-win_arm64.whl", hash = "sha256:5a37ca18e360377cfda1d62f5f382ff41f2b8c4ccb329ed974cc2e1643440118", size = 45573, upload-time = "2026-01-26T02:45:09.349Z" },
+ { url = "https://files.pythonhosted.org/packages/91/cc/db74228a8be41884a567e88a62fd589a913708fcf180d029898c17a9a371/multidict-6.7.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8f333ec9c5eb1b7105e3b84b53141e66ca05a19a605368c55450b6ba208cb9ee", size = 75190, upload-time = "2026-01-26T02:45:10.651Z" },
+ { url = "https://files.pythonhosted.org/packages/d5/22/492f2246bb5b534abd44804292e81eeaf835388901f0c574bac4eeec73c5/multidict-6.7.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a407f13c188f804c759fc6a9f88286a565c242a76b27626594c133b82883b5c2", size = 44486, upload-time = "2026-01-26T02:45:11.938Z" },
+ { url = "https://files.pythonhosted.org/packages/f1/4f/733c48f270565d78b4544f2baddc2fb2a245e5a8640254b12c36ac7ac68e/multidict-6.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0e161ddf326db5577c3a4cc2d8648f81456e8a20d40415541587a71620d7a7d1", size = 43219, upload-time = "2026-01-26T02:45:14.346Z" },
+ { url = "https://files.pythonhosted.org/packages/24/bb/2c0c2287963f4259c85e8bcbba9182ced8d7fca65c780c38e99e61629d11/multidict-6.7.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1e3a8bb24342a8201d178c3b4984c26ba81a577c80d4d525727427460a50c22d", size = 245132, upload-time = "2026-01-26T02:45:15.712Z" },
+ { url = "https://files.pythonhosted.org/packages/a7/f9/44d4b3064c65079d2467888794dea218d1601898ac50222ab8a9a8094460/multidict-6.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97231140a50f5d447d3164f994b86a0bed7cd016e2682f8650d6a9158e14fd31", size = 252420, upload-time = "2026-01-26T02:45:17.293Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/13/78f7275e73fa17b24c9a51b0bd9d73ba64bb32d0ed51b02a746eb876abe7/multidict-6.7.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6b10359683bd8806a200fd2909e7c8ca3a7b24ec1d8132e483d58e791d881048", size = 233510, upload-time = "2026-01-26T02:45:19.356Z" },
+ { url = "https://files.pythonhosted.org/packages/4b/25/8167187f62ae3cbd52da7893f58cb036b47ea3fb67138787c76800158982/multidict-6.7.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:283ddac99f7ac25a4acadbf004cb5ae34480bbeb063520f70ce397b281859362", size = 264094, upload-time = "2026-01-26T02:45:20.834Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/e7/69a3a83b7b030cf283fb06ce074a05a02322359783424d7edf0f15fe5022/multidict-6.7.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:538cec1e18c067d0e6103aa9a74f9e832904c957adc260e61cd9d8cf0c3b3d37", size = 260786, upload-time = "2026-01-26T02:45:22.818Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/3b/8ec5074bcfc450fe84273713b4b0a0dd47c0249358f5d82eb8104ffe2520/multidict-6.7.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7eee46ccb30ff48a1e35bb818cc90846c6be2b68240e42a78599166722cea709", size = 248483, upload-time = "2026-01-26T02:45:24.368Z" },
+ { url = "https://files.pythonhosted.org/packages/48/5a/d5a99e3acbca0e29c5d9cba8f92ceb15dce78bab963b308ae692981e3a5d/multidict-6.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fa263a02f4f2dd2d11a7b1bb4362aa7cb1049f84a9235d31adf63f30143469a0", size = 248403, upload-time = "2026-01-26T02:45:25.982Z" },
+ { url = "https://files.pythonhosted.org/packages/35/48/e58cd31f6c7d5102f2a4bf89f96b9cf7e00b6c6f3d04ecc44417c00a5a3c/multidict-6.7.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:2e1425e2f99ec5bd36c15a01b690a1a2456209c5deed58f95469ffb46039ccbb", size = 240315, upload-time = "2026-01-26T02:45:27.487Z" },
+ { url = "https://files.pythonhosted.org/packages/94/33/1cd210229559cb90b6786c30676bb0c58249ff42f942765f88793b41fdce/multidict-6.7.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:497394b3239fc6f0e13a78a3e1b61296e72bf1c5f94b4c4eb80b265c37a131cd", size = 245528, upload-time = "2026-01-26T02:45:28.991Z" },
+ { url = "https://files.pythonhosted.org/packages/64/f2/6e1107d226278c876c783056b7db43d800bb64c6131cec9c8dfb6903698e/multidict-6.7.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:233b398c29d3f1b9676b4b6f75c518a06fcb2ea0b925119fb2c1bc35c05e1601", size = 258784, upload-time = "2026-01-26T02:45:30.503Z" },
+ { url = "https://files.pythonhosted.org/packages/4d/c1/11f664f14d525e4a1b5327a82d4de61a1db604ab34c6603bb3c2cc63ad34/multidict-6.7.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:93b1818e4a6e0930454f0f2af7dfce69307ca03cdcfb3739bf4d91241967b6c1", size = 251980, upload-time = "2026-01-26T02:45:32.603Z" },
+ { url = "https://files.pythonhosted.org/packages/e1/9f/75a9ac888121d0c5bbd4ecf4eead45668b1766f6baabfb3b7f66a410e231/multidict-6.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f33dc2a3abe9249ea5d8360f969ec7f4142e7ac45ee7014d8f8d5acddf178b7b", size = 243602, upload-time = "2026-01-26T02:45:34.043Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/e7/50bf7b004cc8525d80dbbbedfdc7aed3e4c323810890be4413e589074032/multidict-6.7.1-cp314-cp314-win32.whl", hash = "sha256:3ab8b9d8b75aef9df299595d5388b14530839f6422333357af1339443cff777d", size = 40930, upload-time = "2026-01-26T02:45:36.278Z" },
+ { url = "https://files.pythonhosted.org/packages/e0/bf/52f25716bbe93745595800f36fb17b73711f14da59ed0bb2eba141bc9f0f/multidict-6.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:5e01429a929600e7dab7b166062d9bb54a5eed752384c7384c968c2afab8f50f", size = 45074, upload-time = "2026-01-26T02:45:37.546Z" },
+ { url = "https://files.pythonhosted.org/packages/97/ab/22803b03285fa3a525f48217963da3a65ae40f6a1b6f6cf2768879e208f9/multidict-6.7.1-cp314-cp314-win_arm64.whl", hash = "sha256:4885cb0e817aef5d00a2e8451d4665c1808378dc27c2705f1bf4ef8505c0d2e5", size = 42471, upload-time = "2026-01-26T02:45:38.889Z" },
+ { url = "https://files.pythonhosted.org/packages/e0/6d/f9293baa6146ba9507e360ea0292b6422b016907c393e2f63fc40ab7b7b5/multidict-6.7.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0458c978acd8e6ea53c81eefaddbbee9c6c5e591f41b3f5e8e194780fe026581", size = 82401, upload-time = "2026-01-26T02:45:40.254Z" },
+ { url = "https://files.pythonhosted.org/packages/7a/68/53b5494738d83558d87c3c71a486504d8373421c3e0dbb6d0db48ad42ee0/multidict-6.7.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:c0abd12629b0af3cf590982c0b413b1e7395cd4ec026f30986818ab95bfaa94a", size = 48143, upload-time = "2026-01-26T02:45:41.635Z" },
+ { url = "https://files.pythonhosted.org/packages/37/e8/5284c53310dcdc99ce5d66563f6e5773531a9b9fe9ec7a615e9bc306b05f/multidict-6.7.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:14525a5f61d7d0c94b368a42cff4c9a4e7ba2d52e2672a7b23d84dc86fb02b0c", size = 46507, upload-time = "2026-01-26T02:45:42.99Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/fc/6800d0e5b3875568b4083ecf5f310dcf91d86d52573160834fb4bfcf5e4f/multidict-6.7.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:17307b22c217b4cf05033dabefe68255a534d637c6c9b0cc8382718f87be4262", size = 239358, upload-time = "2026-01-26T02:45:44.376Z" },
+ { url = "https://files.pythonhosted.org/packages/41/75/4ad0973179361cdf3a113905e6e088173198349131be2b390f9fa4da5fc6/multidict-6.7.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a7e590ff876a3eaf1c02a4dfe0724b6e69a9e9de6d8f556816f29c496046e59", size = 246884, upload-time = "2026-01-26T02:45:47.167Z" },
+ { url = "https://files.pythonhosted.org/packages/c3/9c/095bb28b5da139bd41fb9a5d5caff412584f377914bd8787c2aa98717130/multidict-6.7.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:5fa6a95dfee63893d80a34758cd0e0c118a30b8dcb46372bf75106c591b77889", size = 225878, upload-time = "2026-01-26T02:45:48.698Z" },
+ { url = "https://files.pythonhosted.org/packages/07/d0/c0a72000243756e8f5a277b6b514fa005f2c73d481b7d9e47cd4568aa2e4/multidict-6.7.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a0543217a6a017692aa6ae5cc39adb75e587af0f3a82288b1492eb73dd6cc2a4", size = 253542, upload-time = "2026-01-26T02:45:50.164Z" },
+ { url = "https://files.pythonhosted.org/packages/c0/6b/f69da15289e384ecf2a68837ec8b5ad8c33e973aa18b266f50fe55f24b8c/multidict-6.7.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f99fe611c312b3c1c0ace793f92464d8cd263cc3b26b5721950d977b006b6c4d", size = 252403, upload-time = "2026-01-26T02:45:51.779Z" },
+ { url = "https://files.pythonhosted.org/packages/a2/76/b9669547afa5a1a25cd93eaca91c0da1c095b06b6d2d8ec25b713588d3a1/multidict-6.7.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9004d8386d133b7e6135679424c91b0b854d2d164af6ea3f289f8f2761064609", size = 244889, upload-time = "2026-01-26T02:45:53.27Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/a9/a50d2669e506dad33cfc45b5d574a205587b7b8a5f426f2fbb2e90882588/multidict-6.7.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e628ef0e6859ffd8273c69412a2465c4be4a9517d07261b33334b5ec6f3c7489", size = 241982, upload-time = "2026-01-26T02:45:54.919Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/bb/1609558ad8b456b4827d3c5a5b775c93b87878fd3117ed3db3423dfbce1b/multidict-6.7.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:841189848ba629c3552035a6a7f5bf3b02eb304e9fea7492ca220a8eda6b0e5c", size = 232415, upload-time = "2026-01-26T02:45:56.981Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/59/6f61039d2aa9261871e03ab9dc058a550d240f25859b05b67fd70f80d4b3/multidict-6.7.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:ce1bbd7d780bb5a0da032e095c951f7014d6b0a205f8318308140f1a6aba159e", size = 240337, upload-time = "2026-01-26T02:45:58.698Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/29/fdc6a43c203890dc2ae9249971ecd0c41deaedfe00d25cb6564b2edd99eb/multidict-6.7.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b26684587228afed0d50cf804cc71062cc9c1cdf55051c4c6345d372947b268c", size = 248788, upload-time = "2026-01-26T02:46:00.862Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/14/a153a06101323e4cf086ecee3faadba52ff71633d471f9685c42e3736163/multidict-6.7.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9f9af11306994335398293f9958071019e3ab95e9a707dc1383a35613f6abcb9", size = 242842, upload-time = "2026-01-26T02:46:02.824Z" },
+ { url = "https://files.pythonhosted.org/packages/41/5f/604ae839e64a4a6efc80db94465348d3b328ee955e37acb24badbcd24d83/multidict-6.7.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b4938326284c4f1224178a560987b6cf8b4d38458b113d9b8c1db1a836e640a2", size = 240237, upload-time = "2026-01-26T02:46:05.898Z" },
+ { url = "https://files.pythonhosted.org/packages/5f/60/c3a5187bf66f6fb546ff4ab8fb5a077cbdd832d7b1908d4365c7f74a1917/multidict-6.7.1-cp314-cp314t-win32.whl", hash = "sha256:98655c737850c064a65e006a3df7c997cd3b220be4ec8fe26215760b9697d4d7", size = 48008, upload-time = "2026-01-26T02:46:07.468Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/f7/addf1087b860ac60e6f382240f64fb99f8bfb532bb06f7c542b83c29ca61/multidict-6.7.1-cp314-cp314t-win_amd64.whl", hash = "sha256:497bde6223c212ba11d462853cfa4f0ae6ef97465033e7dc9940cdb3ab5b48e5", size = 53542, upload-time = "2026-01-26T02:46:08.809Z" },
+ { url = "https://files.pythonhosted.org/packages/4c/81/4629d0aa32302ef7b2ec65c75a728cc5ff4fa410c50096174c1632e70b3e/multidict-6.7.1-cp314-cp314t-win_arm64.whl", hash = "sha256:2bbd113e0d4af5db41d5ebfe9ccaff89de2120578164f86a5d17d5a576d1e5b2", size = 44719, upload-time = "2026-01-26T02:46:11.146Z" },
+ { url = "https://files.pythonhosted.org/packages/81/08/7036c080d7117f28a4af526d794aab6a84463126db031b007717c1a6676e/multidict-6.7.1-py3-none-any.whl", hash = "sha256:55d97cc6dae627efa6a6e548885712d4864b81110ac76fa4e534c03819fa4a56", size = 12319, upload-time = "2026-01-26T02:46:44.004Z" },
+]
+
+[[package]]
+name = "openai"
+version = "2.40.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "anyio" },
+ { name = "distro" },
+ { name = "httpx" },
+ { name = "jiter" },
+ { name = "pydantic" },
+ { name = "sniffio" },
+ { name = "tqdm" },
+ { name = "typing-extensions" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/f9/9f/136562ec6c3b1a50fe06eb0bb34ed21f0d7426ec0140e5cc43ac785b69a5/openai-2.40.0.tar.gz", hash = "sha256:9a756f91f274a24ad6026cbcb2042fd356c8d4a10e8f347b08d34465e585f7a2", size = 781177, upload-time = "2026-06-01T21:48:23.878Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/f6/46/180e14be801a75bc13f234cb1b594b232adeb9c84e60a9ab1832e8333591/openai-2.40.0-py3-none-any.whl", hash = "sha256:2b205637ff214477f9ce9ab035e9f494db0e3fa8f1e599008953735fbf6ff1ff", size = 1350935, upload-time = "2026-06-01T21:48:21.462Z" },
+]
+
+[[package]]
+name = "packaging"
+version = "26.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" },
+]
+
+[[package]]
+name = "pluggy"
+version = "1.6.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
+]
+
+[[package]]
+name = "propcache"
+version = "0.5.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/ec/44/c87281c333769159c50594f22610f77398a47ccbfbbf23074e744e86f87c/propcache-0.5.2.tar.gz", hash = "sha256:01c4fc7480cd0598bb4b57022df55b9ca296da7fc5a8760bd8451a7e63a7d427", size = 50208, upload-time = "2026-05-08T21:02:12.199Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/4a/cb/e27bc2b2737a0bb49962b275efa051e8f1c35a936df7d5139b6b658b7dc9/propcache-0.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:806719138ecd720339a12410fb9614ac9b2b2d3a5fdf8235d56981c36f4039ba", size = 95887, upload-time = "2026-05-08T21:00:11.277Z" },
+ { url = "https://files.pythonhosted.org/packages/e6/13/b8ae04c59392f8d11c6cd9fb4011d1dc7c86b81225c770280300e259ffe1/propcache-0.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:db2b80ea58eab4f86b2beec3cc8b39e8ff9276ac20e96b7cce43c8ae84cd6b5a", size = 54654, upload-time = "2026-05-08T21:00:12.604Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/7d/49777a3e20b55863d4794384a38acd460c04157b0a00f8602b0d508b8431/propcache-0.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e5cbfac9f61484f7e9f3597775500cd3ebe8274e9b050c38f9525c77c97520bf", size = 55190, upload-time = "2026-05-08T21:00:13.935Z" },
+ { url = "https://files.pythonhosted.org/packages/44/c7/085d0cd63062e84044e3f05797749c3f8e3938ff3aeb0eb2f69d43fafc91/propcache-0.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbc581d2814337da56222fab8dc5f161cd798a434e49bac27930aaef798e144", size = 59995, upload-time = "2026-05-08T21:00:15.526Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/42/32cf8e3009e92b2645cf1e944f701e8ea4e924dffde1ee26db860bcbf7e4/propcache-0.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:857187f381f88c8e2fa2fe56ab94879d011b883d5a2ee5a1b60a8cd2a06846d9", size = 63422, upload-time = "2026-05-08T21:00:16.824Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/1b/f112433f99fc979431b87a39ef169e3f8df070d99a72792c56d6937ac48b/propcache-0.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:178b4a2cdaac1818e2bf1c5a99b94383fa73ea5382e032a48dec07dc5668dc42", size = 64342, upload-time = "2026-05-08T21:00:18.362Z" },
+ { url = "https://files.pythonhosted.org/packages/14/15/5574111ae50dd6e879456888c0eadd4c5a869959775854e18e18a6b345f3/propcache-0.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f328175a2cde1f0ff2c4ed8ce968b9dcfb55f3a7153f39e2957ed994da13476", size = 61639, upload-time = "2026-05-08T21:00:19.692Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/da/4d775080b1490c0ae604acda868bd71aabe3a89ed16f2aa4339eb8a283e7/propcache-0.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5671d09a36b06d0fd4a3da0fccbcae360e9b1570924171a15e9e0997f0249fba", size = 61588, upload-time = "2026-05-08T21:00:21.155Z" },
+ { url = "https://files.pythonhosted.org/packages/04/ac/f076982cbe2195ee9cf32de5a1e46951d9fb399fc207f390562dd0fd8fb2/propcache-0.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:80168e2ebe4d3ec6599d10ad8f520304ae1cad9b6c5a95372aef1b66b7bfb53a", size = 60029, upload-time = "2026-05-08T21:00:22.713Z" },
+ { url = "https://files.pythonhosted.org/packages/70/60/189be62e0dd898dce3b331e1b8c7a543cd3a405ac0c81fe8ee8a9d5d77e1/propcache-0.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:45f11346f884bc47444f6e6647131055844134c3175b629f84952e2b5cd62b64", size = 56774, upload-time = "2026-05-08T21:00:24.001Z" },
+ { url = "https://files.pythonhosted.org/packages/ea/9e/93377b9c7939c1ffae98f878dee955efadfd638078bc86dbc21f9d52f651/propcache-0.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8e778ebd44ef4f66ed60a0416b06b489687db264a9c0b3620362f26489492913", size = 63532, upload-time = "2026-05-08T21:00:25.545Z" },
+ { url = "https://files.pythonhosted.org/packages/14/f9/590ef6cfb9b8028d516d287812ece32bb0bc5f11fbb9c8bf6b2e6313fec8/propcache-0.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c0cb9ed24c8964e172768d455a38254c2dd8a552905729ce006cad3d3dda59b1", size = 61592, upload-time = "2026-05-08T21:00:27.186Z" },
+ { url = "https://files.pythonhosted.org/packages/b4/5e/70958b3034c297a630bba2f17ca7abc2d5f39a803ad7e370ab79d1ecd022/propcache-0.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1d1ad32d9d4355e2be65574fd0bfd3677e7066b009cd5b9b2dee8aa6a6393b33", size = 64788, upload-time = "2026-05-08T21:00:28.8Z" },
+ { url = "https://files.pythonhosted.org/packages/12/fd/77fe5936d8c3086ca9048f7f415f122ed82e53884a9ec193646b42deef06/propcache-0.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c80f4ba3e8f00189165999a742ee526ebeccedf6c3f7beb0c7df821e9772435a", size = 62514, upload-time = "2026-05-08T21:00:30.098Z" },
+ { url = "https://files.pythonhosted.org/packages/cf/74/66bd798b5b3be70aa1b391f5cc9d6a0a5532d7fd3b19ec0b213e72e6ad9d/propcache-0.5.2-cp312-cp312-win32.whl", hash = "sha256:8c7972d8f193740d9175f0998ab38717e6cd322d5935c5b0fef8c0d323fd9031", size = 39018, upload-time = "2026-05-08T21:00:31.622Z" },
+ { url = "https://files.pythonhosted.org/packages/61/7c/5c0d34aa3024694d6dcb9271cdbdd08c4e47c1c0ad95ec7e7bc74cdea145/propcache-0.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:d9ee8826a7d47863a08ac44e1a5f611a462eefc3a194b492da242128bec75b42", size = 42322, upload-time = "2026-05-08T21:00:32.918Z" },
+ { url = "https://files.pythonhosted.org/packages/4d/91/875812f1a3feb20ceba818ef39fbe4d92f1081e04ac815c822496d0d038b/propcache-0.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:2800a4a8ead6b28cccd1ec54b59346f0def7922ee1c7598e8499c733cfbb7c84", size = 38172, upload-time = "2026-05-08T21:00:35.124Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/09/f049e45385503fe67db75a6b6186a7b9f0c3930366dc960522c312a825b1/propcache-0.5.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:099aaf4b4d1a02265b92a977edf00b5c4f63b3b17ac6de39b0d637c9cac0188a", size = 94457, upload-time = "2026-05-08T21:00:36.355Z" },
+ { url = "https://files.pythonhosted.org/packages/6b/65/83d1d05655baf63113731bd5a1008435e14f8d1e5a06cbe4ec5b23ad7a31/propcache-0.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:68ce1c44c7a813a7f71ea04315a8c7b330b63db99d059a797a4651bb6f69f117", size = 53835, upload-time = "2026-05-08T21:00:38.072Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/12/a6ba6482bb5ea3260c000c9b20881c95fa11c6b30173715668259f844ed7/propcache-0.5.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fc299c129490f55f254cd90be0deca4764e36e9a7c08b4aa588479a3bbed3098", size = 54545, upload-time = "2026-05-08T21:00:39.319Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/19/7fa086f5764c59ec8a8e157cd93aa8497acc00aba9dcdec56bfffb32602d/propcache-0.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a6ae2198be502c10f09b2516e7b5d019816924bc3183a43ce792a7bd6625e6f4", size = 59886, upload-time = "2026-05-08T21:00:40.621Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/e4/5d7663dc8235956c8f5281698a3af1d351d8820341ddd890f59d9a9127f2/propcache-0.5.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6041d31504dc1779d700e1edcfb08eea334b357620b06681a4eabb57a74e574e", size = 63261, upload-time = "2026-05-08T21:00:41.775Z" },
+ { url = "https://files.pythonhosted.org/packages/4a/4a/15a03adee24d6350da4292caeac44c34c033d2afe5e87eb370f38854560f/propcache-0.5.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f7eabc04151c78a9f4d5bbb5f1faf571e4defeb4b585e0fe95b60ff2dbe4d3d7", size = 64184, upload-time = "2026-05-08T21:00:43.018Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/c6/979176efdaa3d239e36d503d5af63a0a773b36662ed8f52e5b6a6d9fd40e/propcache-0.5.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4db0ba63d693afd40d249bd93f842b5f144f8fcbb83de05660373bcf30517b1d", size = 61534, upload-time = "2026-05-08T21:00:44.507Z" },
+ { url = "https://files.pythonhosted.org/packages/c8/22/63e8cd1bae4c2d2be6493b6b7d10566ddafad88137cfbc99964a1119853c/propcache-0.5.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1dbcf7675229b35d31abb6547d8ebc8c27a830ac3f9a794edff6254873ec7c0a", size = 61500, upload-time = "2026-05-08T21:00:45.796Z" },
+ { url = "https://files.pythonhosted.org/packages/60/5a/28e5d9acbac1cc9ccb67045e8c1b943aa8d79fdf39c93bd73cacd68008ea/propcache-0.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d310c013aad2c72f1c3f2f8dd3279d460a858c551f97aeb8c63e4693cca7b4d2", size = 59994, upload-time = "2026-05-08T21:00:47.093Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/40/db650677f554a95b9c01a7c9d93d629e93a15562f5deb4573c9ee136fed2/propcache-0.5.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:06187263ddad280d05b4d8a8b3bb7d164cbebd469236544a42e6d9b28ac6a4fa", size = 56884, upload-time = "2026-05-08T21:00:48.376Z" },
+ { url = "https://files.pythonhosted.org/packages/80/45/70b39b89516ff8b96bf732fa6fded8cef20f293cb1508690101c3c07ec51/propcache-0.5.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3115559b8effafd63b142ea5ed53d63a16ea6469cbc63dce4ee194b42db5d853", size = 63464, upload-time = "2026-05-08T21:00:49.954Z" },
+ { url = "https://files.pythonhosted.org/packages/f9/e2/fa59d3a89eac5534293124af4f1d0d0ada091ce4a0ab4610ce03fd2bdd8d/propcache-0.5.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c60462af8e6dc30c35407c7237ea908d777b22862bbee27bc4699c0d8bcdc45a", size = 61588, upload-time = "2026-05-08T21:00:51.281Z" },
+ { url = "https://files.pythonhosted.org/packages/0b/97/efb547a55c4bc7381cfb202d6a2239ac621045277bc1ea5dfd3a7f0516c0/propcache-0.5.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:40314bca9ac559716fe374094fc81c11dcc34b64fd6c585360f5775690505704", size = 64667, upload-time = "2026-05-08T21:00:52.602Z" },
+ { url = "https://files.pythonhosted.org/packages/92/56/f5c7d9b4b7595d5127da38974d791b2153f3d1eae6c674af3583ace92ad3/propcache-0.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:cfa21e036ce1e1db2be04ba3b85d2df1bb1702fa01932d984c5464c665228ff4", size = 62463, upload-time = "2026-05-08T21:00:54.303Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/3b/484a3a65fc9f9f60c41dcd17b428bace5389544e2c680994534a20755066/propcache-0.5.2-cp313-cp313-win32.whl", hash = "sha256:f156a3529f38063b6dbaf356e15602a7f95f8055b1295a438433a6386f10463d", size = 38621, upload-time = "2026-05-08T21:00:55.808Z" },
+ { url = "https://files.pythonhosted.org/packages/1c/fd/3f0f10dba4dabad3bf53102be007abf55481067952bde0fdddff439e7c61/propcache-0.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:dfed59d0a5aeb01e242e66ff0300bc4a265a7c05f612d30016f0b60b1017d757", size = 41649, upload-time = "2026-05-08T21:00:57.061Z" },
+ { url = "https://files.pythonhosted.org/packages/90/ec/6ce619cc32bb500a482f811f9cd509368b4e58e638d13f2c68f370d6b475/propcache-0.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:ba338430e87ceb9c8f0cf754de38a9860560261e56c00376debd628698a7364f", size = 37636, upload-time = "2026-05-08T21:00:58.646Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/82/c1d268bbbf2ef981c5bf0fbbe746db617c66e3bcefe431a1aa8943fbe23a/propcache-0.5.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a592f5f3da71c8691c788c13cb6734b6d17663d2e1cb8caddf0673d01ef8847d", size = 98872, upload-time = "2026-05-08T21:00:59.889Z" },
+ { url = "https://files.pythonhosted.org/packages/f4/d4/52c871e73e864e6b34c0e2d58ac1ec5ccd149497ddc7ad2137ae98323a35/propcache-0.5.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6a997d0489e9668a384fcfd5061b857aa5361de73191cac204d04b889cfbbafa", size = 56257, upload-time = "2026-05-08T21:01:01.195Z" },
+ { url = "https://files.pythonhosted.org/packages/67/f0/9b90ca2a210b3d09bcfcd96ecd0f55545c091535abce2a45de2775cfd357/propcache-0.5.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:10734b5484ea113152ee25a91dccedf81631791805d2c9ccb054958e51842c94", size = 56696, upload-time = "2026-05-08T21:01:02.941Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/0e/6e9d4ba07c8e56e21ddec1e75f12148142b21ca83a51871babce095334f4/propcache-0.5.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cafca7e56c12bb02ae16d283742bef25a61122e9dab2b5b3f2ccbe589ce32164", size = 62378, upload-time = "2026-05-08T21:01:04.475Z" },
+ { url = "https://files.pythonhosted.org/packages/65/19/c10badaa463dde8a27ce884f8ee2ec37e6035b7c9f5ff0c8f74f06f08dac/propcache-0.5.2-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f064f8d2b59177878b7615df1735cd8fe3462ed6be8c7b217d17a276489c2b7f", size = 65283, upload-time = "2026-05-08T21:01:05.959Z" },
+ { url = "https://files.pythonhosted.org/packages/b0/b6/93bea99ca80e19cef6512a8580e5b7857bbe09422d9daa7fd4ef5723306c/propcache-0.5.2-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f78abfa8dfc32376fd1aacf597b2f2fbbe0ea751419aee718af5d4f82537ef8c", size = 66616, upload-time = "2026-05-08T21:01:07.228Z" },
+ { url = "https://files.pythonhosted.org/packages/83/e4/5c7462e50625f051f37fb38b8224f7639f667184bbd34424ec83819bb1b7/propcache-0.5.2-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f7467da8a9822bf1a55336f877340c5bcbd3c482afc43a99771169f74a26dedc", size = 63773, upload-time = "2026-05-08T21:01:08.514Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/b6/99238894047b13c823be25027e736626cd414a52a5e30d2c3347c2733529/propcache-0.5.2-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a6ddc6ac9e25de626c1f129c1b467d7ecd33ce2237d3fd0c4e429feef0a7ee1f", size = 63664, upload-time = "2026-05-08T21:01:09.874Z" },
+ { url = "https://files.pythonhosted.org/packages/85/1e/a3a1a63116a2b8edb415a8bb9a6f0c34bd03830b1e18e8ce2904e1dc1cf4/propcache-0.5.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2f22cbbac9e26a8e864c0985ff1268d5d939d53d9d9411a9824279097e03a2cb", size = 62643, upload-time = "2026-05-08T21:01:11.132Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/03/893cf147de2fc6543c5eaa07ad833170e7e2a2385725bbebe8c0503723bb/propcache-0.5.2-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:fc76378c62a0f04d0cd82fbb1a2cd2d7e28fcb40d5873f28a6c44e388aaa2751", size = 59595, upload-time = "2026-05-08T21:01:12.387Z" },
+ { url = "https://files.pythonhosted.org/packages/86/3b/04c1a2e12c57766568ba75ba72b3bf2042818d4c1425fab6fc07155c7cff/propcache-0.5.2-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:acd2c8edba48e31e58a363b8cf4e5c7db3b04b3f9e371f601df30d9b0d244836", size = 65711, upload-time = "2026-05-08T21:01:13.676Z" },
+ { url = "https://files.pythonhosted.org/packages/1c/34/80f8d0099f8d6bacc4de1624c85672681c8cd1149ca2da0e38fd120b817f/propcache-0.5.2-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:452b5065457eb9991ec5eb38ff41d6cd4c991c9ac7c531c4d5849ae473a9a13f", size = 64247, upload-time = "2026-05-08T21:01:14.936Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/1a/8b08f3a5f1037e9e370c55883ceeeee0f6dd0416fb2d2d67b8bfc91f2a79/propcache-0.5.2-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:3430bb2bfe1331885c427745a751e774ee679fd4344f80b97bf879815fe8fa55", size = 67102, upload-time = "2026-05-08T21:01:16.281Z" },
+ { url = "https://files.pythonhosted.org/packages/34/68/8bdb7bb7756d76e005490649d10e4a8369e610c74d619f71e1aedf889e9c/propcache-0.5.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:cef6cea3922890dd6c9654971001fa797b526c16ab5e1e46c05fd6f877be7568", size = 64964, upload-time = "2026-05-08T21:01:17.57Z" },
+ { url = "https://files.pythonhosted.org/packages/0a/aa/50fb0b5d3968b61a510926ff8b8465f1d6e976b3ab74496d7a4b9fc42515/propcache-0.5.2-cp313-cp313t-win32.whl", hash = "sha256:72d61e16dd78228b58c5d47be830ff3da7e5f139abdf0aef9d86cde1c5cf2191", size = 42546, upload-time = "2026-05-08T21:01:18.946Z" },
+ { url = "https://files.pythonhosted.org/packages/ae/4c/0ddbae64321bd4a95bcbfc19307238016b5b1fee645c84626c8d539e5b74/propcache-0.5.2-cp313-cp313t-win_amd64.whl", hash = "sha256:0958834041a0166d343b8d2cedcd8bcbaeb4fdbe0cf08320c5379f143c3be6e7", size = 46330, upload-time = "2026-05-08T21:01:20.162Z" },
+ { url = "https://files.pythonhosted.org/packages/00/d9/9cddc8efb78d8af264c5ec9f6d10b62f57c515feda8d321595f56010fb23/propcache-0.5.2-cp313-cp313t-win_arm64.whl", hash = "sha256:6de8bd93ddde9b992cf2b2e0d796d501a19026b5b9fd87356d7d0779531a8d96", size = 40521, upload-time = "2026-05-08T21:01:21.399Z" },
+ { url = "https://files.pythonhosted.org/packages/e2/ea/23ee535d90ce8bcc465a3028eb3cc0ce3bd1005f4bb27710b30587de798d/propcache-0.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:46088abff4cba581dea21ae0467a480526cb25aa5f3c269e909f800328bc3999", size = 94662, upload-time = "2026-05-08T21:01:22.683Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/06/c5a52f419b5d8972f8d46a7577476090d8e3263ff589ce40b5ca4968d5be/propcache-0.5.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fc88b26f08d634f7bc819a7852e5214f5802641ab8d9fd5326892292eee1993e", size = 53928, upload-time = "2026-05-08T21:01:23.986Z" },
+ { url = "https://files.pythonhosted.org/packages/63/b1/4260d67d6bd85e58a66b72d54ce15d5de789b6f3870cc6bedf8ff9667401/propcache-0.5.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:97797ebb098e670a2f92dd66f32897e30d7615b14e7f59711de23e30a9072539", size = 54650, upload-time = "2026-05-08T21:01:25.305Z" },
+ { url = "https://files.pythonhosted.org/packages/70/06/2f46c318e3307cd7a6a7481def374ce838c0fe20084b39dd54b0879d0e99/propcache-0.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba57fffe4ac99c5d30076161b5866336d97600769bad35cc68f7774b15298a4e", size = 59912, upload-time = "2026-05-08T21:01:26.545Z" },
+ { url = "https://files.pythonhosted.org/packages/4c/29/fe1aebec2ce57ab985a9c382bded1124431f85078113aa222c5d278430d4/propcache-0.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:583c19759d9eec1e5b69e2fbef36a7d9c326041be9746cb822d335c8cedc2979", size = 63300, upload-time = "2026-05-08T21:01:27.937Z" },
+ { url = "https://files.pythonhosted.org/packages/b4/18/2334b26768b6c82be8c69e83671b767d5ef426aa09b0cba6c2ea47816774/propcache-0.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d0326e2e5e1f3163fa306c834e48e8d490e5fae607a097a40c0648109b47ba80", size = 64208, upload-time = "2026-05-08T21:01:29.484Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/76/7f1bfd6afff4c5e38e36a3c6d68eb5f4b7311ea80baf693db78d95b603c4/propcache-0.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e00820e192c8dbebcafb383ebbf99030895f09905e7a0eb2e0340a0bcc2bc825", size = 61633, upload-time = "2026-05-08T21:01:31.068Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/46/b3ff8aba2b4953a3e50de2cf72f1b5748b8eca93b15f3dc2c84339084c09/propcache-0.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c66afea89b1e43725731d2004732a046fe6fe955d51f952c3e95a7314a284a39", size = 61724, upload-time = "2026-05-08T21:01:32.374Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/01/814cfcafbcff954f94c01cf30e097ddc88a076b5440fbcf4570753437d40/propcache-0.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d4dc37dec6c6cdad0b57881a5658fd14fbf53e333b1a86cf86559f190e1d9ec4", size = 60069, upload-time = "2026-05-08T21:01:33.67Z" },
+ { url = "https://files.pythonhosted.org/packages/da/68/5c6f7622d510cc666a300687e06fd060c1a43361c0c9b20d284f06d8096a/propcache-0.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:5570dbcc97571c15f68068e529c92715a12f8d54030e272d264b377e22bd17a5", size = 57099, upload-time = "2026-05-08T21:01:34.915Z" },
+ { url = "https://files.pythonhosted.org/packages/55/27/9cb0b4c679124085327957d42521c99dba04c88c90c3e55a6f0b633ebccc/propcache-0.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f814362777a9f841adddb200ecdf8f5cb1e5a3c4b7a86378edbd6ccb26edd702", size = 63391, upload-time = "2026-05-08T21:01:36.231Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/9d/7258aaa5bdf60fc6f27591eef6fe52768cb0beda7140be477c8b12c9794a/propcache-0.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:196913dea116aeb5a2ba95af4ddcb7ea85559ae07d8eee8751688310d09168c3", size = 61626, upload-time = "2026-05-08T21:01:37.545Z" },
+ { url = "https://files.pythonhosted.org/packages/8e/0d/41c602003e8a9b16fe1e7eadf62c7bfba9d5474370b24200bf48b315f45f/propcache-0.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:6e7b8719005dd1175be4ab1cd25e9b98659a5e0347331506ec6760d2773a7fb5", size = 64781, upload-time = "2026-05-08T21:01:38.83Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/f3/38e66b1856e9bd079deea015bc4a55f7767c0e4db2f7dcf69e7e680ba4ce/propcache-0.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:51f96d685ab16e88cab128cd37a52c5da540809c8b879fa047731bfcb4ad35a4", size = 62570, upload-time = "2026-05-08T21:01:40.415Z" },
+ { url = "https://files.pythonhosted.org/packages/95/ca/bbfe9b910ce57dde8bb4876b4520fc02a4e89497c10de26be936758a3aaa/propcache-0.5.2-cp314-cp314-win32.whl", hash = "sha256:cc6fc3cc62e8501d3ed62894425040d2728ecddb1ed072737a5c70bd537aa9f0", size = 39436, upload-time = "2026-05-08T21:01:41.654Z" },
+ { url = "https://files.pythonhosted.org/packages/61/d2/45c9defbaa1ea297035d9d4cce9e8f80daafbf19319c6007f157c6256ea9/propcache-0.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:81e3a30b0bb60caa22033dd0f8a3618d1d67356212514f62c57db75cb0ef410c", size = 42373, upload-time = "2026-05-08T21:01:43.041Z" },
+ { url = "https://files.pythonhosted.org/packages/44/68/9ea5103f41d5217d7d6ec24db90018e23aebec070c3f9a6e54d12b841fd8/propcache-0.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:0d2c9bf8528f135dbb805ce027567e09164f7efa51a2be07458a2c0420f292d0", size = 38554, upload-time = "2026-05-08T21:01:44.336Z" },
+ { url = "https://files.pythonhosted.org/packages/8a/81/fadf555f42d3b762eea8a53950b0489fdc0aa9da5f8ed9e10ce0a4e01b48/propcache-0.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:4bc8ff1feffc6a61c7002ffe84634c41b822e104990ae009f44a0834430070bb", size = 99395, upload-time = "2026-05-08T21:01:45.883Z" },
+ { url = "https://files.pythonhosted.org/packages/f5/c9/c61e134a686949cf7971af3a390148b1156f7be81c73bc0cd12c873e2d48/propcache-0.5.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:79aa3ff0a9b566633b642fa9caf7e21ed1c13d6feca718187873f199e1514078", size = 56653, upload-time = "2026-05-08T21:01:47.307Z" },
+ { url = "https://files.pythonhosted.org/packages/cb/73/daf935ea7048ddd7ec8eec5345b4a40b619d2d178b3c0a0900796bc3c794/propcache-0.5.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1b31822f4474c4036bae62de9402710051d431a606d6a0f907fec79935a071aa", size = 56914, upload-time = "2026-05-08T21:01:48.573Z" },
+ { url = "https://files.pythonhosted.org/packages/79/9f/aba959b435ea18617edd7cf0a7ad0b9c574b8fc7e3d2cd55fb59cb255d33/propcache-0.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:13fef48778b5a2a756523fdb781326b028ca75e32858b04f2cdd19f394564917", size = 62567, upload-time = "2026-05-08T21:01:49.903Z" },
+ { url = "https://files.pythonhosted.org/packages/6c/a1/859942de9a791ff42f6141736f5b37749b8f53e65edfa49638c67dd67e6a/propcache-0.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8b73ab70f1a3351fbc71f663b3e645af6dd0329100c353081cf69c37433fc6fe", size = 65542, upload-time = "2026-05-08T21:01:51.204Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/61/315bc0fd6c0fc7f80a528b8afd209e5fc4a875ea79571b91b8f50f442907/propcache-0.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5538d2c13d93e4698af7e092b57bc7298fd35d1d58e656ae18f23ee0d0378e03", size = 66845, upload-time = "2026-05-08T21:01:52.539Z" },
+ { url = "https://files.pythonhosted.org/packages/47/f7/9f8122e3132e8e354ac41975ef8f1099be7d5a16bc7ae562734e993665c0/propcache-0.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cd645f03898405cabe694fb8bc35241e3a9c332ec85627584fe3de201452b335", size = 63985, upload-time = "2026-05-08T21:01:53.847Z" },
+ { url = "https://files.pythonhosted.org/packages/c8/54/c317819ec157cbf6f35df9df9657a6f82daf34d5faf15948b2f639c2192e/propcache-0.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a473b3440261e0c60706e732b2ed2f517857344fc21bf48fdfe211e2d98eb285", size = 63999, upload-time = "2026-05-08T21:01:55.179Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/56/387e3f7dfce0a9233df41fb888aa1c30222cb4bbbf09537c02dd9bd85fe2/propcache-0.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7afa37062e6650640e932e4cc9297d81f9f42d9944029cc386b8247dea4da837", size = 62779, upload-time = "2026-05-08T21:01:57.489Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/9c/596784cb5824ed61ee960d3f8655a3f0993e107c6e98ab6c818b7fb92ccb/propcache-0.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:8a90efd5777e996e42d568db9ac740b944d691e565cbfd31b2f7832f9184b2b8", size = 59796, upload-time = "2026-05-08T21:01:58.736Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/3d/1a6cfa1726a48542c1e8784a0761421476a5b68e09b7f36bf95eb954aaba/propcache-0.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:f19bb891234d72535764d703bfed1153cc34f4214d5bd7150aee1eec9e8f4366", size = 66023, upload-time = "2026-05-08T21:02:00.228Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/0e/05fd6990369477076e4e280bcb970de760fddf0161a46e988bc95f7940ec/propcache-0.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:32775082acd2d807ee3db715c7770d38767b817870acfa08c29e057f3c4d5b56", size = 64448, upload-time = "2026-05-08T21:02:01.888Z" },
+ { url = "https://files.pythonhosted.org/packages/cd/86/5f8da315a4309c62c10c0b2516b17492d5d3bbe1bb862b96604db67e2a37/propcache-0.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9282fb1a3bccd038da9f768b927b24a0c753e466c086b7c4f3c6982851eefb2d", size = 67329, upload-time = "2026-05-08T21:02:03.484Z" },
+ { url = "https://files.pythonhosted.org/packages/da/d3/3368efe79ab21f0cdf86ef49895811c9cc933131d4cde1f28a624e22e712/propcache-0.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cc49723e2f60d6b32a0f0b08a3fd6d13203c07f1cd9566cfce0f12a917c967a2", size = 65172, upload-time = "2026-05-08T21:02:04.745Z" },
+ { url = "https://files.pythonhosted.org/packages/d5/07/127e8b0bacfb325396196f9d976a22453049b89b9b2b08477cc3145faa44/propcache-0.5.2-cp314-cp314t-win32.whl", hash = "sha256:2d7aa89ebca5acc98cba9d1472d976e394782f587bad6661003602a619fd1821", size = 43813, upload-time = "2026-05-08T21:02:06.025Z" },
+ { url = "https://files.pythonhosted.org/packages/88/fb/46dad6c0ae49ed230ab1b16c890c2b6314e2403e6c412976f4a72d64a527/propcache-0.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:d447bb0b3054be5818458fbb171208b1d9ff11eba14e18ca18b90cbb45767370", size = 47764, upload-time = "2026-05-08T21:02:07.353Z" },
+ { url = "https://files.pythonhosted.org/packages/e7/c4/a47d0a63aa309d10d59ede6e9d4cff03a344a79d1f0f4cd0cd74997b53e0/propcache-0.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:fe67a3d11cd9b4efabfa45c3d00ffba2b26811442a73a581a94b67c2b5faccf6", size = 41140, upload-time = "2026-05-08T21:02:09.065Z" },
+ { url = "https://files.pythonhosted.org/packages/3a/ed/1cdcab6ba3d6ab7feca11fc14f0eeea80755bb53ef4e892079f31b10a25f/propcache-0.5.2-py3-none-any.whl", hash = "sha256:be1ddfcbb376e3de5d2e2db1d58d6d67463e6b4f9f040c000de8e300295465fe", size = 14036, upload-time = "2026-05-08T21:02:10.673Z" },
+]
+
+[[package]]
+name = "pydantic"
+version = "2.13.4"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "annotated-types" },
+ { name = "pydantic-core" },
+ { name = "typing-extensions" },
+ { name = "typing-inspection" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/18/a5/b60d21ac674192f8ab0ba4e9fd860690f9b4a6e51ca5df118733b487d8d6/pydantic-2.13.4.tar.gz", hash = "sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6", size = 844775, upload-time = "2026-05-06T13:43:05.343Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/fd/7b/122376b1fd3c62c1ed9dc80c931ace4844b3c55407b6fb2d199377c9736f/pydantic-2.13.4-py3-none-any.whl", hash = "sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba", size = 472262, upload-time = "2026-05-06T13:43:02.641Z" },
+]
+
+[[package]]
+name = "pydantic-core"
+version = "2.46.4"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "typing-extensions" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/9d/56/921726b776ace8d8f5db44c4ef961006580d91dc52b803c489fafd1aa249/pydantic_core-2.46.4.tar.gz", hash = "sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1", size = 471464, upload-time = "2026-05-06T13:37:06.98Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/ce/8c/af022f0af448d7747c5154288d46b5f2bc5f17366eaa0e23e9aa04d59f3b/pydantic_core-2.46.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3245406455a5d98187ec35530fd772b1d799b26667980872c8d4614991e2c4a2", size = 2106158, upload-time = "2026-05-06T13:38:57.215Z" },
+ { url = "https://files.pythonhosted.org/packages/19/95/6195171e385007300f0f5574592e467c568becce2d937a0b6804f218bc49/pydantic_core-2.46.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:962ccbab7b642487b1d8b7df90ef677e03134cf1fd8880bf698649b22a69371f", size = 1951724, upload-time = "2026-05-06T13:37:02.697Z" },
+ { url = "https://files.pythonhosted.org/packages/8e/bc/f47d1ff9cbb1620e1b5b697eef06010035735f07820180e74178226b27b3/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8233f2947cf85404441fd7e0085f53b10c93e0ee78611099b5c7237e36aacbf7", size = 1975742, upload-time = "2026-05-06T13:37:09.448Z" },
+ { url = "https://files.pythonhosted.org/packages/5b/11/9b9a5b0306345664a2da6410877af6e8082481b5884b3ddd78d47c6013ce/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a233125ac121aa3ffba9a2b59edfc4a985a76092dc8279586ab4b71390875e7", size = 2052418, upload-time = "2026-05-06T13:37:38.234Z" },
+ { url = "https://files.pythonhosted.org/packages/f1/b7/a65fec226f5d78fc39f4a13c4cc0c768c22b113438f60c14adc9d2865038/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b712b53160b79a5850310b912a5ef8e57e56947c8ad690c227f5c9d7e561712", size = 2232274, upload-time = "2026-05-06T13:38:27.753Z" },
+ { url = "https://files.pythonhosted.org/packages/68/f0/92039db98b907ef49269a8271f67db9cb78ae2fc68062ef7e4e77adb5f61/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9401557acd873c3a7f3eb9383edef8ac4968f9510e340f4808d427e75667e7b4", size = 2309940, upload-time = "2026-05-06T13:38:05.353Z" },
+ { url = "https://files.pythonhosted.org/packages/5f/97/2aab507d3d00ca626e8e57c1eac6a79e4e5fbcc63eb99733ff55d1717f65/pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:926c9541b14b12b1681dca8a0b75feb510b06c6341b70a8e500c2fdcff837cce", size = 2094516, upload-time = "2026-05-06T13:39:10.577Z" },
+ { url = "https://files.pythonhosted.org/packages/22/37/a8aca44d40d737dde2bc05b3c6c07dff0de07ce6f82e9f3167aeaf4d5dea/pydantic_core-2.46.4-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:56cb4851bcaf3d117eddcef4fe66afd750a50274b0da8e22be256d10e5611987", size = 2136854, upload-time = "2026-05-06T13:40:22.59Z" },
+ { url = "https://files.pythonhosted.org/packages/24/99/fcef1b79238c06a8cbec70819ac722ba76e02bc8ada9b0fd66eba40da01b/pydantic_core-2.46.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c68fcd102d71ea85c5b2dfac3f4f8476eff42a9e078fd5faefff6d145063536b", size = 2180306, upload-time = "2026-05-06T13:40:10.666Z" },
+ { url = "https://files.pythonhosted.org/packages/ae/6c/fc44000918855b42779d007ae63b0532794739027b2f417321cddbc44f6a/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b2f69dec1725e79a012d920df1707de5caf7ed5e08f3be4435e25803efc47458", size = 2190044, upload-time = "2026-05-06T13:40:43.231Z" },
+ { url = "https://files.pythonhosted.org/packages/6b/65/d9cadc9f1920d7a127ad2edba16c1db7916e59719285cd6c94600b0080ba/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:8d0820e8192167f80d88d64038e609c31452eeca865b4e1d9950a27a4609b00b", size = 2329133, upload-time = "2026-05-06T13:39:57.365Z" },
+ { url = "https://files.pythonhosted.org/packages/d0/cf/c873d91679f3a30bcf5e7ac280ce5573483e72295307685120d0d5ad3416/pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fbdb89b3e1c94a30cc5edfce477c6e6a5dc4d8f84665b455c27582f211a1c72c", size = 2374464, upload-time = "2026-05-06T13:38:06.976Z" },
+ { url = "https://files.pythonhosted.org/packages/47/bd/6f2fc8188f31bf10590f1e98e7b306336161fac930a8c514cd7bd828c7dc/pydantic_core-2.46.4-cp312-cp312-win32.whl", hash = "sha256:9aa768456404a8bf48a4406685ac2bec8e72b62c69313734fa3b73cf33b3a894", size = 1974823, upload-time = "2026-05-06T13:40:47.985Z" },
+ { url = "https://files.pythonhosted.org/packages/40/8c/985c1d41ea1107c2534abd9870e4ed5c8e7669b5c308297835c001e7a1c4/pydantic_core-2.46.4-cp312-cp312-win_amd64.whl", hash = "sha256:e9c26f834c65f5752f3f06cb08cb86a913ceb7274d0db6e267808a708b46bc89", size = 2072919, upload-time = "2026-05-06T13:39:21.153Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/ba/f463d006e0c47373ca7ec5e1a261c59dc01ef4d62b2657af925fb0deee3a/pydantic_core-2.46.4-cp312-cp312-win_arm64.whl", hash = "sha256:4fc73cb559bdb54b1134a706a2802a4cddd27a0633f5abb7e53056268751ac6a", size = 2027604, upload-time = "2026-05-06T13:39:03.753Z" },
+ { url = "https://files.pythonhosted.org/packages/51/a2/5d30b469c5267a17b39dec53208222f76a8d351dfac4af661888c5aee77d/pydantic_core-2.46.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:5d5902252db0d3cedf8d4a1bc68f70eeb430f7e4c7104c8c476753519b423008", size = 2106306, upload-time = "2026-05-06T13:37:48.029Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/81/4fa520eaffa8bd7d1525e644cd6d39e7d60b1592bc5b516693c7340b50f1/pydantic_core-2.46.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c94f0688e7b8d0a67abf40e57a7eaaecd17cc9586706a31b76c031f63df052b4", size = 1951906, upload-time = "2026-05-06T13:37:17.012Z" },
+ { url = "https://files.pythonhosted.org/packages/03/d5/fd02da45b659668b05923b17ba3a0100a0a3d5541e3bd8fcc4ecb711309e/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f027324c56cd5406ca49c124b0db10e56c69064fec039acc571c29020cc87c76", size = 1976802, upload-time = "2026-05-06T13:37:35.113Z" },
+ { url = "https://files.pythonhosted.org/packages/21/f2/95727e1368be3d3ed485eaab7adbd7dda408f33f7a36e8b48e0144002b91/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e739fee756ba1010f8bcccb534252e85a35fe45ae92c295a06059ce58b74ccd3", size = 2052446, upload-time = "2026-05-06T13:37:12.313Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/86/5d99feea3f77c7234b8718075b23db11532773c1a0dbd9b9490215dc2eeb/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9d56801be94b86a9da183e5f3766e6310752b99ff647e38b09a9500d88e46e76", size = 2232757, upload-time = "2026-05-06T13:39:01.149Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/3a/508ac615935ef7588cf6d9e9b91309fdc2da751af865e02a9098de88258c/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2412e734dcb48da14d4e4006b82b46b74f2518b8a26ee7e58c6844a6cd6d03c4", size = 2309275, upload-time = "2026-05-06T13:37:41.406Z" },
+ { url = "https://files.pythonhosted.org/packages/07/f8/41db9de19d7987d6b04715a02b3b40aea467000275d9d758ffaa31af7d50/pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9551187363ffc0de2a00b2e47c25aeaeb1020b69b668762966df15fc5659dd5a", size = 2094467, upload-time = "2026-05-06T13:39:18.847Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/e2/f35033184cb11d0052daf4416e8e10a502ea2ac006fc4f459aee872727d1/pydantic_core-2.46.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:0186750b482eefa11d7f435892b09c5c606193ef3375bcf94aa00ae6bfb66262", size = 2134417, upload-time = "2026-05-06T13:40:17.944Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/7b/6ceeb1cc90e193862f444ebe373d8fdf613f0a82572dde03fb10734c6c71/pydantic_core-2.46.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5855698a4856556d86e8e6cd8434bc3ac0314ee8e12089ae0e143f64c6256e4e", size = 2179782, upload-time = "2026-05-06T13:40:32.618Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/f2/c8d7773ede6af08036423a00ae0ceffce266c3c52a096c435d68c896083f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:cbaf13819775b7f769bf4a1f066cb6df7a28d4480081a589828ef190226881cd", size = 2188782, upload-time = "2026-05-06T13:36:51.018Z" },
+ { url = "https://files.pythonhosted.org/packages/59/31/0c864784e31f09f05cdd87606f08923b9c9e7f6e51dd27f20f62f975ce9f/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:633147d34cf4550417f12e2b1a0383973bdf5cdfde212cb09e9a581cf10820be", size = 2328334, upload-time = "2026-05-06T13:40:37.764Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/eb/4f6c8a41efa30baa755590f4141abf3a8c370fab610915733e74134a7270/pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:82cf5301172168103724d49a1444d3378cb20cdee30b116a1bd6031236298a5d", size = 2372986, upload-time = "2026-05-06T13:39:34.152Z" },
+ { url = "https://files.pythonhosted.org/packages/5b/24/b375a480d53113860c299764bfe9f349a3dc9108b3adc0d7f0d786492ebf/pydantic_core-2.46.4-cp313-cp313-win32.whl", hash = "sha256:9fa8ae11da9e2b3126c6426f147e0fba88d96d65921799bb30c6abd1cb2c97fb", size = 1973693, upload-time = "2026-05-06T13:37:55.072Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/e8/cff247591966f2d22ec8c003cd7587e27b7ba7b81ab2fb888e3ab75dc285/pydantic_core-2.46.4-cp313-cp313-win_amd64.whl", hash = "sha256:6b3ace8194b0e5204818c92802dcdca7fc6d88aabbb799d7c795540d9cd6d292", size = 2071819, upload-time = "2026-05-06T13:38:49.139Z" },
+ { url = "https://files.pythonhosted.org/packages/c6/1a/f4aee670d5670e9e148e0c82c7db98d780be566c6e6a97ee8035528ca0b3/pydantic_core-2.46.4-cp313-cp313-win_arm64.whl", hash = "sha256:184c081504d17f1c1066e430e117142b2c77d9448a97f7b65c6ac9fd9aee238d", size = 2027411, upload-time = "2026-05-06T13:40:45.796Z" },
+ { url = "https://files.pythonhosted.org/packages/8d/74/228a26ddad29c6672b805d9fd78e8d251cd04004fa7eed0e622096cd0250/pydantic_core-2.46.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:428e04521a40150c85216fc8b85e8d39fece235a9cf5e383761238c7fa9b96fb", size = 2102079, upload-time = "2026-05-06T13:38:41.019Z" },
+ { url = "https://files.pythonhosted.org/packages/ad/1f/8970b150a4b4365623ae00fc88603491f763c627311ae8031e3111356d6e/pydantic_core-2.46.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:23ace664830ee0bfe014a0c7bc248b1f7f25ed7ad103852c317624a1083af462", size = 1952179, upload-time = "2026-05-06T13:36:59.812Z" },
+ { url = "https://files.pythonhosted.org/packages/95/30/5211a831ae054928054b2f79731661087a2bc5c01e825c672b3a4a8f1b3e/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce5c1d2a8b27468f433ca974829c44060b8097eedc39933e3c206a90ee49c4a9", size = 1978926, upload-time = "2026-05-06T13:37:39.933Z" },
+ { url = "https://files.pythonhosted.org/packages/57/e9/689668733b1eb67adeef047db3c2e8788fcf65a7fd9c9e2b46b7744fe245/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7283d57845ecf5a163403eb0702dfc220cc4fbdd18919cb5ccea4f95ee1cdab4", size = 2046785, upload-time = "2026-05-06T13:38:01.995Z" },
+ { url = "https://files.pythonhosted.org/packages/60/d9/6715260422ff50a2109878fd24d948a6c3446bb2664f34ee78cd972b3acd/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8daafc69c93ee8a0204506a3b6b30f586ef54028f52aeeeb5c4cfc5184fd5914", size = 2228733, upload-time = "2026-05-06T13:40:50.371Z" },
+ { url = "https://files.pythonhosted.org/packages/18/ae/fdb2f64316afca925640f8e70bb1a564b0ec2721c1389e25b8eb4bf9a299/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd2213145bcc2ba85884d0ac63d222fece9209678f77b9b4d76f054c561adb28", size = 2307534, upload-time = "2026-05-06T13:37:21.531Z" },
+ { url = "https://files.pythonhosted.org/packages/89/1d/8eff589b45bb8190a9d12c49cfad0f176a5cbd1534908a6b5125e2886239/pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a5f930472650a82629163023e630d160863fce524c616f4e5186e5de9d9a49b", size = 2099732, upload-time = "2026-05-06T13:39:31.942Z" },
+ { url = "https://files.pythonhosted.org/packages/06/d5/ee5a3366637fee41dee51a1fc91562dcf12ddbc68fda34e6b253da2324bb/pydantic_core-2.46.4-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:c1b3f518abeca3aa13c712fd202306e145abf59a18b094a6bafb2d2bbf59192c", size = 2129627, upload-time = "2026-05-06T13:37:25.033Z" },
+ { url = "https://files.pythonhosted.org/packages/94/33/2414be571d2c6a6c4d08be21f9292b6d3fdb08949a97b6dfe985017821db/pydantic_core-2.46.4-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1a7dd0b3ee80d90150e3495a3a13ac34dbcbfd4f012996a6a1d8900e91b5c0fb", size = 2179141, upload-time = "2026-05-06T13:37:14.046Z" },
+ { url = "https://files.pythonhosted.org/packages/7b/79/7daa95be995be0eecc4cf75064cb33f9bbbfe3fe0158caf2f0d4a996a5c7/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:3fb702cd90b0446a3a1c5e470bfa0dd23c0233b676a9099ddcc964fa6ca13898", size = 2184325, upload-time = "2026-05-06T13:36:53.615Z" },
+ { url = "https://files.pythonhosted.org/packages/9f/cb/d0a382f5c0de8a222dc61c65348e0ce831b1f68e0a018450d31c2cace3a5/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b8458003118a712e66286df6a707db01c52c0f52f7db8e4a38f0da1d3b94fc4e", size = 2323990, upload-time = "2026-05-06T13:40:29.971Z" },
+ { url = "https://files.pythonhosted.org/packages/05/db/d9ba624cc4a5aced1598e88c04fdbd8310c8a69b9d38b9a3d39ce3a61ed7/pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:372429a130e469c9cd698925ce5fc50940b7a1336b0d82038e63d5bbc4edc519", size = 2369978, upload-time = "2026-05-06T13:37:23.027Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/20/d15df15ba918c423461905802bfd2981c3af0bfa0e40d05e13edbfa48bc3/pydantic_core-2.46.4-cp314-cp314-win32.whl", hash = "sha256:85bb3611ff1802f3ee7fdd7dbff26b56f343fb432d57a4728fdd49b6ef35e2f4", size = 1966354, upload-time = "2026-05-06T13:38:03.499Z" },
+ { url = "https://files.pythonhosted.org/packages/fc/b6/6b8de4c0a7d7ab3004c439c80c5c1e0a3e8d78bbae19379b01960383d9e5/pydantic_core-2.46.4-cp314-cp314-win_amd64.whl", hash = "sha256:811ff8e9c313ab425368bcbb36e5c4ebd7108c2bbf4e4089cfbb0b01eff63fac", size = 2072238, upload-time = "2026-05-06T13:39:40.807Z" },
+ { url = "https://files.pythonhosted.org/packages/32/36/51eb763beec1f4cf59b1db243a7dcc39cbb41230f050a09b9d69faaf0a48/pydantic_core-2.46.4-cp314-cp314-win_arm64.whl", hash = "sha256:bfec22eab3c8cc2ceec0248aec886624116dc079afa027ecc8ad4a7e62010f8a", size = 2018251, upload-time = "2026-05-06T13:37:26.72Z" },
+ { url = "https://files.pythonhosted.org/packages/e8/91/855af51d625b23aa987116a19e231d2aaef9c4a415273ddc189b79a45fee/pydantic_core-2.46.4-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:af8244b2bef6aaad6d92cda81372de7f8c8d36c9f0c3ea36e827c60e7d9467a0", size = 2099593, upload-time = "2026-05-06T13:39:47.682Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/1b/8784a54c65edb5f49f0a14d6977cf1b209bba85a4c77445b255c2de58ab3/pydantic_core-2.46.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5a4330cdbc57162e4b3aa303f588ba752257694c9c9be3e7ebb11b4aca659b5d", size = 1935226, upload-time = "2026-05-06T13:40:40.428Z" },
+ { url = "https://files.pythonhosted.org/packages/e8/e7/1955d28d1afc56dd4b3ad7cc0cf39df1b9852964cf16e5d13912756d6d6b/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29c61fc04a3d840155ff08e475a04809278972fe6aef51e2720554e96367e34b", size = 1974605, upload-time = "2026-05-06T13:37:32.029Z" },
+ { url = "https://files.pythonhosted.org/packages/93/e2/3fedbf0ba7a22850e6e9fd78117f1c0f10f950182344d8a6c535d468fdd8/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c50f2528cf200c5eed56faf3f4e22fcd5f38c157a8b78576e6ba3168ec35f000", size = 2030777, upload-time = "2026-05-06T13:38:55.239Z" },
+ { url = "https://files.pythonhosted.org/packages/f8/61/46be275fcaaba0b4f5b9669dd852267ce1ff616592dccf7a7845588df091/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0cbe8b01f948de4286c74cdd6c667aceb38f5c1e26f0693b3983d9d74887c65e", size = 2236641, upload-time = "2026-05-06T13:37:08.096Z" },
+ { url = "https://files.pythonhosted.org/packages/60/db/12e93e46a8bac9988be3c016860f83293daea8c716c029c9ace279036f2f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:617d7e2ca7dcb8c5cf6bcb8c59b8832c94b36196bbf1cbd1bfb56ed341905edd", size = 2286404, upload-time = "2026-05-06T13:40:20.221Z" },
+ { url = "https://files.pythonhosted.org/packages/e2/4a/4d8b19008f38d31c53b8219cfedc2e3d5de5fe99d90076b7e767de29274f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7027560ee92211647d0d34e3f7cd6f50da56399d26a9c8ad0da286d3869a53f3", size = 2109219, upload-time = "2026-05-06T13:38:12.153Z" },
+ { url = "https://files.pythonhosted.org/packages/88/70/3cbc40978fefb7bb09c6708d40d4ad1a5d70fd7213c3d17f971de868ec1f/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:f99626688942fb746e545232e7726926f3be91b5975f8b55327665fafda991c7", size = 2110594, upload-time = "2026-05-06T13:40:02.971Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/20/b8d36736216e29491125531685b2f9e61aa5b4b2599893f8268551da3338/pydantic_core-2.46.4-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fc3e9034a63de20e15e8ade85358bc6efc614008cab72898b4b4952bea0509ff", size = 2159542, upload-time = "2026-05-06T13:39:27.506Z" },
+ { url = "https://files.pythonhosted.org/packages/1d/a2/367df868eb584dacf6bf82a389272406d7178e301c4ac82545ab98bc2dd9/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:97e7cf2be5c77b7d1a9713a05605d49460d02c6078d38d8bef3cbe323c548424", size = 2168146, upload-time = "2026-05-06T13:38:31.93Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/b8/4460f77f7e201893f649a29ab355dddd3beee8a97bcb1a320db414f9a06e/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:3bf92c5d0e00fefaab325a4d27828fe6b6e2a21848686b5b60d2d9eeb09d76c6", size = 2306309, upload-time = "2026-05-06T13:37:44.717Z" },
+ { url = "https://files.pythonhosted.org/packages/64/c4/be2639293acd87dc8ddbcec41a73cee9b2ebf996fe6d892a1a74e88ad3f7/pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:3ecbc122d18468d06ca279dc26a8c2e2d5acb10943bb35e36ae92096dc3b5565", size = 2369736, upload-time = "2026-05-06T13:37:05.645Z" },
+ { url = "https://files.pythonhosted.org/packages/30/a6/9f9f380dbb301f67023bf8f707aaa75daadf84f7152d95c410fd7e81d994/pydantic_core-2.46.4-cp314-cp314t-win32.whl", hash = "sha256:e846ae7835bf0703ae43f534ab79a867146dadd59dc9ca5c8b53d5c8f7c9ef02", size = 1955575, upload-time = "2026-05-06T13:38:51.116Z" },
+ { url = "https://files.pythonhosted.org/packages/40/1f/f1eb9eb350e795d1af8586289746f5c5677d16043040d63710e22abc43c9/pydantic_core-2.46.4-cp314-cp314t-win_amd64.whl", hash = "sha256:2108ba5c1c1eca18030634489dc544844144ee36357f2f9f780b93e7ddbb44b5", size = 2051624, upload-time = "2026-05-06T13:38:21.672Z" },
+ { url = "https://files.pythonhosted.org/packages/f6/d2/42dd53d0a85c27606f316d3aa5d2869c4e8470a5ed6dec30e4a1abe19192/pydantic_core-2.46.4-cp314-cp314t-win_arm64.whl", hash = "sha256:4fcbe087dbc2068af7eda3aa87634eba216dbda64d1ae73c8684b621d33f6596", size = 2017325, upload-time = "2026-05-06T13:40:52.723Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/1d/8987ad40f65ae1432753072f214fb5c74fe47ffbd0698bb9cbbb585664f8/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:1d8ba486450b14f3b1d63bc521d410ec7565e52f887b9fb671791886436a42f7", size = 2095527, upload-time = "2026-05-06T13:39:52.283Z" },
+ { url = "https://files.pythonhosted.org/packages/64/d3/84c282a7eee1d3ac4c0377546ef5a1ea436ce26840d9ac3b7ed54a377507/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:3009f12e4e90b7f88b4f9adb1b0c4a3d58fe7820f3238c190047209d148026df", size = 1936024, upload-time = "2026-05-06T13:40:15.671Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/ca/eac61596cdeb4d7e174d3dc0bd8a6238f14f75f97a24e7b7db4c7e7340a0/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad785e92e6dc634c21555edc8bd6b64957ab844541bcb96a1366c202951ae526", size = 1990696, upload-time = "2026-05-06T13:38:34.717Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/c3/7c8b240552251faf6b3a957db200fcfbbcec36763c050428b601e0c9b83b/pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00c603d540afdd6b80eb39f078f33ebd46211f02f33e34a32d9f053bba711de0", size = 2147590, upload-time = "2026-05-06T13:39:29.883Z" },
+]
+
+[[package]]
+name = "pygments"
+version = "2.20.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" },
+]
+
+[[package]]
+name = "pytest"
+version = "9.0.3"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "colorama", marker = "sys_platform == 'win32'" },
+ { name = "iniconfig" },
+ { name = "packaging" },
+ { name = "pluggy" },
+ { name = "pygments" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/7d/0d/549bd94f1a0a402dc8cf64563a117c0f3765662e2e668477624baeec44d5/pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c", size = 1572165, upload-time = "2026-04-07T17:16:18.027Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/d4/24/a372aaf5c9b7208e7112038812994107bc65a84cd00e0354a88c2c77a617/pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9", size = 375249, upload-time = "2026-04-07T17:16:16.13Z" },
+]
+
+[[package]]
+name = "pytest-asyncio"
+version = "1.4.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "pytest" },
+ { name = "typing-extensions", marker = "python_full_version < '3.13'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/43/7c/d36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473/pytest_asyncio-1.4.0.tar.gz", hash = "sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42", size = 58514, upload-time = "2026-05-26T09:56:04.083Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/03/e2/08a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c/pytest_asyncio-1.4.0-py3-none-any.whl", hash = "sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1", size = 16930, upload-time = "2026-05-26T09:56:02.576Z" },
+]
+
+[[package]]
+name = "python-dotenv"
+version = "1.2.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/82/ed/0301aeeac3e5353ef3d94b6ec08bbcabd04a72018415dcb29e588514bba8/python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3", size = 50135, upload-time = "2026-03-01T16:00:26.196Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/0b/d7/1959b9648791274998a9c3526f6d0ec8fd2233e4d4acce81bbae76b44b2a/python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a", size = 22101, upload-time = "2026-03-01T16:00:25.09Z" },
+]
+
+[[package]]
+name = "pyyaml"
+version = "6.0.3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" },
+ { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" },
+ { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" },
+ { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" },
+ { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" },
+ { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" },
+ { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" },
+ { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" },
+ { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" },
+ { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" },
+ { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" },
+ { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" },
+ { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" },
+ { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" },
+ { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" },
+ { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" },
+ { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" },
+ { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" },
+ { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" },
+ { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" },
+ { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" },
+ { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" },
+ { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" },
+ { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" },
+ { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" },
+ { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" },
+ { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" },
+ { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" },
+ { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" },
+ { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" },
+ { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" },
+]
+
+[[package]]
+name = "referencing"
+version = "0.37.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "attrs" },
+ { name = "rpds-py" },
+ { name = "typing-extensions", marker = "python_full_version < '3.13'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" },
+]
+
+[[package]]
+name = "regex"
+version = "2026.5.9"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/dc/0e/49aee608ad09480e7fd276898c99ec6192985fa331abe4eb3a986094490b/regex-2026.5.9.tar.gz", hash = "sha256:a8234aa23ec39894bfe4a3f1b85616a7032481964a13ac6fc9f10de4f6fca270", size = 416074, upload-time = "2026-05-09T23:15:19.37Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/50/9b/6550044bc44e17c84d312c031c2ec42fbdb6a4ec4e29093be3a172d08772/regex-2026.5.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:57eeeb05db7979413dec5438f2db21d7ecbba787cde7a711df1a6f6df672aa06", size = 490451, upload-time = "2026-05-09T23:12:34.72Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/95/fc7ba4303b5a0f92446a12ee6778ef2c6c799233f5060042a31bf390cfe9/regex-2026.5.9-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:398c521292f4c7fb807001dcd54694d3a1fcafc179a36ad9cc56f98df85930b6", size = 292112, upload-time = "2026-05-09T23:12:36.285Z" },
+ { url = "https://files.pythonhosted.org/packages/54/4b/ee27938d1b2c443e89a9a10e00d2d19aa5ee300cd3d61140644e93bb083e/regex-2026.5.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f7a7c26137296beba7784de6eba69c6a93a63ccebc385e4962fe67e267a91225", size = 289599, upload-time = "2026-05-09T23:12:38.089Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/dd/ba103dc19614e25f3880800ca67ce093d6e21b325d72b8383c7bf906e9fa/regex-2026.5.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6441cc660d76107934a09c22167200839a0e89604a6297f78a974e66e931d2c0", size = 796732, upload-time = "2026-05-09T23:12:40.062Z" },
+ { url = "https://files.pythonhosted.org/packages/cf/e7/f035b4fd858b050b0080bf302968dc0f59ba34e391872d54936758e6844e/regex-2026.5.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:91328f1c23d47595ca3ef0a7557fa129c5a23404b775c770697d2f35b33e0107", size = 865440, upload-time = "2026-05-09T23:12:42.059Z" },
+ { url = "https://files.pythonhosted.org/packages/0a/51/8cd301ecc899aea28124357f729f4272f44de7806fc7ca02490bfbe253e8/regex-2026.5.9-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:93a7860539414dddaefba2b40f8771765ae17949d4c7182b876ce429e11a8309", size = 912329, upload-time = "2026-05-09T23:12:44.373Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/1e/3fbe2fa1e8cebd62f3bb7d3321cff1640aca2e240b51d9bd624aad949260/regex-2026.5.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dd2810d22146b6d838acc5ec15602cb6b47920aa4e33015df3868eedfd20bab8", size = 801239, upload-time = "2026-05-09T23:12:46.268Z" },
+ { url = "https://files.pythonhosted.org/packages/17/2f/6f6008682bf2cf98040a0d3153a8e557b6ab728d7713d045cee4ce544ab8/regex-2026.5.9-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:daff2bdbaf1d23e52fdff7c0b7bc2048b68f978df6a4d107ac981f94caef2e66", size = 777054, upload-time = "2026-05-09T23:12:48.051Z" },
+ { url = "https://files.pythonhosted.org/packages/19/2b/eee0d20a6842ba04df4b8847a920b57ef56853f14ef85405473e586b605a/regex-2026.5.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4eeb011098fcb77af513dcef521a3dbecbf8849b1e38940759d293b7a93f5026", size = 785098, upload-time = "2026-05-09T23:12:49.851Z" },
+ { url = "https://files.pythonhosted.org/packages/4a/98/6fc1e6410feefb92159edaed5041992bfe390e8d26c721865434acbca558/regex-2026.5.9-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ea9c8ecfa1b73c73b626534d6626e5340d429630943672b8480724f44e84b962", size = 860095, upload-time = "2026-05-09T23:12:51.666Z" },
+ { url = "https://files.pythonhosted.org/packages/18/a3/bd855e0f2cb1a978ecf6fa6bb69632dd9c3f6ea3b81cde62fde14c9daec7/regex-2026.5.9-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:cd2846168eb9ee3c513902bc8225409cb1caab31d04728b145171fa1625d9621", size = 765762, upload-time = "2026-05-09T23:12:53.413Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/66/0ae8c092e60b14c79d24f8e0b7f0aea5bfbffdcab00b5483d13404d3c3a5/regex-2026.5.9-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:39617fb0cde9c0e6306dc70e3bfc096f3da793219879f7ae7aa341a69fbdcf6d", size = 852100, upload-time = "2026-05-09T23:12:55.256Z" },
+ { url = "https://files.pythonhosted.org/packages/21/de/8dfde60fc1b21c946a893ba273403b72617edb261370cb1087099a83f088/regex-2026.5.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fd03c4f0e33280d15cae17159b899245d6b7c53d21def19b263b39655061f5ce", size = 789479, upload-time = "2026-05-09T23:12:57.573Z" },
+ { url = "https://files.pythonhosted.org/packages/c3/1c/bdcc98f9a4af4fdd166c74941174619ccff4726d3ce32faa8e9a2ecd38dd/regex-2026.5.9-cp312-cp312-win32.whl", hash = "sha256:164eba9b755ea6f244b0d881196fbc1fac09714e9782c9e2732b813142033c8e", size = 266699, upload-time = "2026-05-09T23:12:59.14Z" },
+ { url = "https://files.pythonhosted.org/packages/78/87/240d36864f9e48ace85f72e79ced97ceb7f27ce87739a947dcb834b4e6bc/regex-2026.5.9-cp312-cp312-win_amd64.whl", hash = "sha256:86f40a5d6444db30a125c9c9177e6b25dad981cbc37451fd838f145e6edac92e", size = 277783, upload-time = "2026-05-09T23:13:00.789Z" },
+ { url = "https://files.pythonhosted.org/packages/4f/b5/7b30f312b0669dff5beebe5b0989dc2d1a312b1a44fab852199c387a5b96/regex-2026.5.9-cp312-cp312-win_arm64.whl", hash = "sha256:96f5f58b54a063d7ea9dca08e1cf57bfe10499c4d579ee672da284f57f5f0070", size = 270513, upload-time = "2026-05-09T23:13:02.426Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/da/797e91ecec6f84135da778ddce78c20e0af5d2a15c26f87a81bc3eadb6db/regex-2026.5.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d626b84406444b165fc0ba981604edea39f0588ff1f92baa23fe50799ea9afdb", size = 490303, upload-time = "2026-05-09T23:13:04.382Z" },
+ { url = "https://files.pythonhosted.org/packages/44/da/bf30abaaa737b58f4a4b8c4a03659e02fd92092c822e0197ed9e0daab917/regex-2026.5.9-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d7bdc0ab8f3dd7e1b4f9ab88634e13374669db86bb3c72e8292f07ae313f539f", size = 292019, upload-time = "2026-05-09T23:13:06.022Z" },
+ { url = "https://files.pythonhosted.org/packages/2d/e7/d0eaf5713828417b9e5648cf81fa9bacd4961f6ab98c380c2034f8716e35/regex-2026.5.9-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a8820737949116ffff55fe18f9fc644530063ba6ebfcb8314239416e78f1347c", size = 289468, upload-time = "2026-05-09T23:13:08.214Z" },
+ { url = "https://files.pythonhosted.org/packages/d3/9b/b3fdd62b003baa1a9b593cd8c8699c9651c2e80cc21a5c715707983c42d7/regex-2026.5.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa0fbdbac82cb3e4450d0ccde7d7a35607f4cb2dd9fba4b8b69bfaf8c9fa6aed", size = 796749, upload-time = "2026-05-09T23:13:10.573Z" },
+ { url = "https://files.pythonhosted.org/packages/d4/30/66ab84588765f5b4b271a9ca09ef7ce2b87caa95176ec3d2ad65d7bc4902/regex-2026.5.9-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:57e8915c7986aa33d25e4d3629cef711cd2863f2961b10409f0c04cb8b7d9020", size = 865445, upload-time = "2026-05-09T23:13:12.523Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/89/f05169e8588aac365f35ffc7f3bc3184f095ef4cfded7cfaa3c7fd5dbd89/regex-2026.5.9-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:508f56a89ba9cb26e4168cbc37dbd60a28d82430a9e18ad1d25fe0883c314ca2", size = 912322, upload-time = "2026-05-09T23:13:14.281Z" },
+ { url = "https://files.pythonhosted.org/packages/30/e1/c93444052cf41581f3c884ab3fb5823daf0992f11cd4388d4275ca610558/regex-2026.5.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b6d189041f15691cfa2b6c4290448ec221244d225b3f5fe9e7771b34ffcdf6e2", size = 801269, upload-time = "2026-05-09T23:13:16.569Z" },
+ { url = "https://files.pythonhosted.org/packages/50/fe/0cf96b882f540e62e8b9956599798203d599c44cf4c77917ca27400ff69b/regex-2026.5.9-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e82db382b44d0111b22601c509c89f64434816c9e0eef9d1989cda8cc6ff1c04", size = 777085, upload-time = "2026-05-09T23:13:18.675Z" },
+ { url = "https://files.pythonhosted.org/packages/23/5c/d78d4924e7fc875557b9e9b768423925fdfaac5549d06da7810019a9bd26/regex-2026.5.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2acfb48634f64996b57f90f39afa692ff362162722581921fe92239a59960f3c", size = 785153, upload-time = "2026-05-09T23:13:20.525Z" },
+ { url = "https://files.pythonhosted.org/packages/bf/e0/5214774090e7b4524dcea3e3c4aa74141d43043f8beb49c1599db1c8b53a/regex-2026.5.9-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d29eebfc9525db68cad3c97eedd7f754fa265aa5cd0cf4f863b2421e1b48fc9f", size = 860164, upload-time = "2026-05-09T23:13:22.263Z" },
+ { url = "https://files.pythonhosted.org/packages/6e/e1/4a57a83350319b1271f0d7a249b8672513ed928b237a741631270de6caea/regex-2026.5.9-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:debb893095e944091c16e641a6e33c1b0f4cb61ab945ec5afbf53ce7068834d8", size = 765731, upload-time = "2026-05-09T23:13:24.277Z" },
+ { url = "https://files.pythonhosted.org/packages/12/f4/499e74a20c156fc75836ee04a72a38d1a063978f600937f9760467beb1b0/regex-2026.5.9-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d659eee77986549c9ea45b861c7567e44d6287c3dc9a4565478853f7b9fe2ff6", size = 852062, upload-time = "2026-05-09T23:13:26.125Z" },
+ { url = "https://files.pythonhosted.org/packages/5b/92/7eebc0d0a01e78629695f342ba17e0deaff8fb45e79cc0d7b98287da6e3e/regex-2026.5.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2efa205e6d98b24d1f3ab395c11aa15cdf10935bca283d0285e0499c284fba21", size = 789577, upload-time = "2026-05-09T23:13:27.814Z" },
+ { url = "https://files.pythonhosted.org/packages/05/a4/018e71f7d2ad48c1ebe6d3ae0026f9b7cb4802fd15c7cc02fdf724355102/regex-2026.5.9-cp313-cp313-win32.whl", hash = "sha256:f3844f134e834076677dd369976e9f5068679fcb8e50102fdf6b7ac96a3ec127", size = 266691, upload-time = "2026-05-09T23:13:29.549Z" },
+ { url = "https://files.pythonhosted.org/packages/e6/1d/861a93719fb9ee7dbfc3761b3797b7a3e112a5d42c6129459d2d741be9b5/regex-2026.5.9-cp313-cp313-win_amd64.whl", hash = "sha256:3527bb4942d2c14552155406cdedd906567456821848aed1cb4933a391bf5eca", size = 277747, upload-time = "2026-05-09T23:13:31.859Z" },
+ { url = "https://files.pythonhosted.org/packages/d9/c6/0a2436ae4da1ba76e51cb98943c6838a9a721faa40ebe2dce07694ae34e3/regex-2026.5.9-cp313-cp313-win_arm64.whl", hash = "sha256:56a33f191f17d8c417f99945ebdc1e691d3af9605d86ec68c7e54a57e3e17af6", size = 270500, upload-time = "2026-05-09T23:13:33.525Z" },
+ { url = "https://files.pythonhosted.org/packages/e8/e9/d21346f7b60ed58789371358ed66b09d00f832e1bd7c06e55d9da5679882/regex-2026.5.9-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:01f28d868834624c934b8d2e0aa1c8341337e37831f4a012f18a5afcba4cbaf3", size = 494172, upload-time = "2026-05-09T23:13:35.935Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/43/fd1177a2032037c681baecdb3422ee4e1424aec4e4f470ef47793d325274/regex-2026.5.9-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:48036f6374aaa79eb3b754ec29c61d1c6b1606749d705a13f8854fa2539671f6", size = 293952, upload-time = "2026-05-09T23:13:38.307Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/7d/9fbf919768368d3f8a4f6c692cf2aa61e482b2b81ec6a298ace4cbf02480/regex-2026.5.9-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:b96350aa424e79d4fd6b567b344dcbe2b2d6bfc48dfe7717587e1fa6d43da6ff", size = 292314, upload-time = "2026-05-09T23:13:40.353Z" },
+ { url = "https://files.pythonhosted.org/packages/e2/6c/e41bfeecb589716843e7c4df09ba46ff2a42961457afece19059d85caeef/regex-2026.5.9-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8f3af7a4903c5c04a11a196a5aa75cdd7dd3f8508132f9fb3259d9f5908e3b88", size = 811681, upload-time = "2026-05-09T23:13:42.543Z" },
+ { url = "https://files.pythonhosted.org/packages/87/83/a5c1c525fba0aa656e88ad0face0b1829788ef4c2fb6b26df58aa1151b84/regex-2026.5.9-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7e87577720152d2caae19fe2baaf1f8d5ca12091e9e229f03915c37d1e4b9178", size = 871135, upload-time = "2026-05-09T23:13:44.326Z" },
+ { url = "https://files.pythonhosted.org/packages/18/d4/80882e799e440dd878b0979cbebf8fa4d54624a332c83037c7a701649e3f/regex-2026.5.9-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c8b9b9d294cfea3cd19c718ade7cc93492b2c4991abd9a68d0b3477ae6d8e100", size = 917265, upload-time = "2026-05-09T23:13:47.295Z" },
+ { url = "https://files.pythonhosted.org/packages/ae/ff/8db60211e2286e396aad7dc7725356c502bff0901ea05bd6cdc2e1a042b9/regex-2026.5.9-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:728d8bfd28a8845c8b6bc5dc7ce010453d206396786c0765c2740cb65f37791e", size = 816311, upload-time = "2026-05-09T23:13:49.885Z" },
+ { url = "https://files.pythonhosted.org/packages/4c/47/742ef579c61730f8d268e5cf1f9ce0e37e2ea041ad0f5644724f2378e463/regex-2026.5.9-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7e30b874d341fac767d7df5a0870540541c2c054b80cfaac116e8d367a8a7ff2", size = 785498, upload-time = "2026-05-09T23:13:52.25Z" },
+ { url = "https://files.pythonhosted.org/packages/7f/ab/cb0999802dcb0fb95b1ab005e8d4163d8afdd67efc2cb6b6630ac13f8cb1/regex-2026.5.9-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:fd190e88a895a8901325fad284a3f74ea52b1da8525b76cc811fa9b1edf0ce2b", size = 801348, upload-time = "2026-05-09T23:13:54.127Z" },
+ { url = "https://files.pythonhosted.org/packages/7d/62/8ca59a24c55bc34d166eefaf3717bd77772f329fdbf984d86581e0a3571c/regex-2026.5.9-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:8e76e8161ad00694cfce6767d5dea860c6391ac5b83e5c3a39661e696f11fc7e", size = 866493, upload-time = "2026-05-09T23:13:56.067Z" },
+ { url = "https://files.pythonhosted.org/packages/8d/3d/30f2ae62cef3278bb5bb821f467277a55fb73f01032cf85997e15e8289a8/regex-2026.5.9-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:ddda5340e6c01a293027dd46232fa79eaff1b48058ce7a98f572b6445b088041", size = 772811, upload-time = "2026-05-09T23:13:57.867Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/ae/7d2089bcd78ad0c0161bc684339df50032acb438a7bd3305e7ddb1193cec/regex-2026.5.9-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:205109e96b3cf5adf8f4cd62bedde9487feb282b9497a3535451e5a24cd706a0", size = 856584, upload-time = "2026-05-09T23:13:59.679Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/29/92ff47f75990131ea4f24ba17819e5a9d141e10819807e09addd73409af6/regex-2026.5.9-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dfbe4579b9f08036aa7d101d1835437a20783574ac66327e6b29b4018a138081", size = 803453, upload-time = "2026-05-09T23:14:01.978Z" },
+ { url = "https://files.pythonhosted.org/packages/04/99/eff29f1037dcab36702c9ee5d6858cf1ce2336ea8ea2987f64245b99ea5e/regex-2026.5.9-cp313-cp313t-win32.whl", hash = "sha256:ed2c9e8068b614c574d8d30e543d617cf5379b0535d46f97ef00e904745a08b5", size = 269951, upload-time = "2026-05-09T23:14:03.661Z" },
+ { url = "https://files.pythonhosted.org/packages/0e/9d/8870b8981d27b22cda77bb26a5ac7ebfa9c7d9e0dea195a834a82380e748/regex-2026.5.9-cp313-cp313t-win_amd64.whl", hash = "sha256:b46b0f094dc1d3b90356c85a0bd2c9bafc4a6a190b9d6f8ddd5a033b6e088ed4", size = 281240, upload-time = "2026-05-09T23:14:05.56Z" },
+ { url = "https://files.pythonhosted.org/packages/72/b1/3379415e8f135c13ac551353397cc4fe97b4978f3cac73c5fcbcded548b8/regex-2026.5.9-cp313-cp313t-win_arm64.whl", hash = "sha256:872acc074bd29ffc9913ecdfedf6ea77502312ca44a4aa0d3779089c6069d8de", size = 272383, upload-time = "2026-05-09T23:14:07.843Z" },
+ { url = "https://files.pythonhosted.org/packages/13/3e/9c3cd292d8808b3645a2ce517e200179b6d0e903f176300bd8b542e14de5/regex-2026.5.9-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:1bd7587a2948b4085195d5a3374eaf4a425dc3e55784c038175355ecf3bbbf8a", size = 490376, upload-time = "2026-05-09T23:14:09.64Z" },
+ { url = "https://files.pythonhosted.org/packages/60/70/d43ee8a2ca0a8b68d167f21658b85520ac0574617c7f320367c5047f7556/regex-2026.5.9-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:dea2e88e1cce4522496cce630e11e67b98b7076620bc4336c3f674bc21a375f4", size = 291964, upload-time = "2026-05-09T23:14:11.424Z" },
+ { url = "https://files.pythonhosted.org/packages/21/91/9d50b433828d8e74196904e168a43abf1e6e88b2a15d47ed742456720c37/regex-2026.5.9-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:2099f7e7ff7b6aa3192312650a56e91cc091e49d50b04e4f6f8b6e28b3b27f1c", size = 289682, upload-time = "2026-05-09T23:14:13.123Z" },
+ { url = "https://files.pythonhosted.org/packages/3e/d2/b835e3cafbb9d977736912436259ff551d60919f7d7b3d37d46659c63564/regex-2026.5.9-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecd353045824e4477562a2ac718c25799cdaaa41f7aa925a806a8a3e6848a5b9", size = 796996, upload-time = "2026-05-09T23:14:14.923Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/a6/9f992d00019166b9de01c546dd4549bc679f2a68df11b877740b0760b7c2/regex-2026.5.9-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:65c8c8c37377794bd5b2f3ebe51919042bf17aec802e23c833d89782ed0c78af", size = 866089, upload-time = "2026-05-09T23:14:17.757Z" },
+ { url = "https://files.pythonhosted.org/packages/e0/08/4d32af657e049b19cb62b02e46e38fe1518797bfb2203ee93a510b21b0dc/regex-2026.5.9-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5b73ab8afcf66c622db143d1c6fda4e58e4d537ee4f125229ad47b1ab80f34c0", size = 911530, upload-time = "2026-05-09T23:14:20.353Z" },
+ { url = "https://files.pythonhosted.org/packages/d9/27/2af43dd1dc201d1fecefda64a45f4ad0995855b92724f795a777b402ee69/regex-2026.5.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0de5cf193997384ed2ca6f1cd4f78055b255d93d82d5a8cd6ba0d11c10b167e4", size = 800643, upload-time = "2026-05-09T23:14:22.265Z" },
+ { url = "https://files.pythonhosted.org/packages/a4/dd/23a249047013b5321d4a60c4d2437462086f601b061776a525e5fba2a59f/regex-2026.5.9-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d641a8c9a61618047796d572a39a79b26167b0411d2c3031937b2fe2d081e2cf", size = 777223, upload-time = "2026-05-09T23:14:24.179Z" },
+ { url = "https://files.pythonhosted.org/packages/94/6a/e85ed9538cd19586d0465076a4578a12e093ce776d15f3f8ce92733a8dd6/regex-2026.5.9-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:24b2355ef5cc9aa5b8f07d17704face1c166fdcc2290fa7bd6e6c925655a8346", size = 785760, upload-time = "2026-05-09T23:14:26.065Z" },
+ { url = "https://files.pythonhosted.org/packages/2a/c4/f25473209438638e947c55f9156fd8f236f74169229028cc99116380868e/regex-2026.5.9-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:a24852d3c29ad9e47593593d8a247c44ccc3d0548ef12c822d6ed0810affe676", size = 860891, upload-time = "2026-05-09T23:14:28.17Z" },
+ { url = "https://files.pythonhosted.org/packages/f9/f7/f4f86e3c74419c37370e91f150ae0c2ef7d34b2e0e4cdd5da046a02e4022/regex-2026.5.9-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:916714069da19329ef7de197dcbc77bb3104145c7c2c864dbfbe318f46b88b14", size = 765891, upload-time = "2026-05-09T23:14:30.06Z" },
+ { url = "https://files.pythonhosted.org/packages/26/70/704d8e13765939146b1cd0ef4e2feb71d7929727d2290f026eed10095955/regex-2026.5.9-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:fa411799ca8da32a8d38d020a88faa5b6f91657d284761352940ecf9f7c3bbdd", size = 851380, upload-time = "2026-05-09T23:14:32.123Z" },
+ { url = "https://files.pythonhosted.org/packages/26/29/1a13582a8460038edc38e49f64ceb0dd7c60f5caba77571f4bf6601965d9/regex-2026.5.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:1e6da47d679b7010ef27556b6e0f99771b744936db1792a10ceac6547ae1503e", size = 789350, upload-time = "2026-05-09T23:14:34.799Z" },
+ { url = "https://files.pythonhosted.org/packages/73/56/3dcafe34fc72e271d62ad9a291801e88a1457bb251c132f15fcc2e5aad1a/regex-2026.5.9-cp314-cp314-win32.whl", hash = "sha256:98bd73080e8756255137e1bd3f3f00295bbc5aa383c0e0f973920e9134d7c4ad", size = 272130, upload-time = "2026-05-09T23:14:36.729Z" },
+ { url = "https://files.pythonhosted.org/packages/d0/9c/02eebf0be95efe416c664db7fb8b6b05b7a0b06a7544f2884f2558b0526f/regex-2026.5.9-cp314-cp314-win_amd64.whl", hash = "sha256:ff8d372ac2acdc048d1c19916f27ee61bc5722728458ba6ca5052f2c72d51763", size = 280999, upload-time = "2026-05-09T23:14:39.126Z" },
+ { url = "https://files.pythonhosted.org/packages/70/5a/1dd1abee76cb7a846a0bcf42fdc87e5720c3c33c24f3e37814310a513d9f/regex-2026.5.9-cp314-cp314-win_arm64.whl", hash = "sha256:e1d93bf647916292e8edcec150c07ddf3dc50179ccaf770c04a7f9e452155372", size = 273500, upload-time = "2026-05-09T23:14:41.059Z" },
+ { url = "https://files.pythonhosted.org/packages/86/c1/c5f619b0057a7965cb78ec559c1d7a45ce8c99a35bea95483d64959a93d9/regex-2026.5.9-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:83d0ee4a57d1c87cb549e195ec300b8f0ec3a82eba66d835e4e2ed8634fe4499", size = 494269, upload-time = "2026-05-09T23:14:42.869Z" },
+ { url = "https://files.pythonhosted.org/packages/05/2c/5d01f1aee33de4bbe60c8452945bfc8477ca7c5ae4450f6bfe711036cb36/regex-2026.5.9-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:d3d7eb5c9a7f6df82ed3cfac9beb93882a5cbcb5b8b157b56cb2b3b276574ac1", size = 293954, upload-time = "2026-05-09T23:14:44.822Z" },
+ { url = "https://files.pythonhosted.org/packages/7a/fe/e8988b2ae2108c6ef71bd4aa8d87fbe257976dd0810e826cd75f701c68b6/regex-2026.5.9-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:075160bf16658e16d35233300b8453aac25de4cbea808d22348b6979668e924d", size = 292405, upload-time = "2026-05-09T23:14:47.211Z" },
+ { url = "https://files.pythonhosted.org/packages/79/34/d2b0937faa7859263f7f0a3c6b103a1296306be6952dc173d0154e9a2f49/regex-2026.5.9-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:45375819235558a4ff1c4971dc32881f022613abdb180128f5cb4768c1765a1c", size = 811855, upload-time = "2026-05-09T23:14:49.21Z" },
+ { url = "https://files.pythonhosted.org/packages/80/fe/daf53a47457a8486db66c66c01ceb9c2303eecee3f87197f1e77eb1a736d/regex-2026.5.9-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ead4b163ac30a29574510cd4b3e2e985ac5290c05fc7095557d6a5f403fc31b5", size = 871189, upload-time = "2026-05-09T23:14:51.555Z" },
+ { url = "https://files.pythonhosted.org/packages/1c/75/058fc4470cbfbf57d800aff1a0022b929a3f9fa553ee10a0cdf2070eb31f/regex-2026.5.9-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8c6e4218fbdfbcd4f6c19efca40930d24a621bf4b48cb76bc6640543bd28ef20", size = 917485, upload-time = "2026-05-09T23:14:53.633Z" },
+ { url = "https://files.pythonhosted.org/packages/88/e7/179cfda3a28bc843b5c6cfe7f79f23489c791ed95f151083803660878432/regex-2026.5.9-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6351571c8a42b505eb555c0dc47d740d0fb66977dc142919eea6f4325b7c56a0", size = 816369, upload-time = "2026-05-09T23:14:56.198Z" },
+ { url = "https://files.pythonhosted.org/packages/41/90/6f0cc422071688266d344fca8462d787cba0a2c144acb25721f9a61ec265/regex-2026.5.9-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:002205cafd2a9e78c6290c7d1df277bf3277b3b7a30e0b4bb0dac2e2e3f7cb2d", size = 785869, upload-time = "2026-05-09T23:14:58.602Z" },
+ { url = "https://files.pythonhosted.org/packages/02/67/a31f1760f09c27b251ef39e9beb541f462cf977381d067faa764c2c0e393/regex-2026.5.9-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8abd33fef90b2a9efac5557d6033ca82d1195ed3a15fea5af15ba7b463c6a63b", size = 801427, upload-time = "2026-05-09T23:15:00.642Z" },
+ { url = "https://files.pythonhosted.org/packages/e3/c4/1a80654597b6bc1e1ea0494824c31200e8a956abe290afae9b19a166a148/regex-2026.5.9-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:31037c82eccb44b7ea2e9e221d7c01429430e989a1f4b91ea5a855f6017b509a", size = 866482, upload-time = "2026-05-09T23:15:03.384Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/11/960724e06482c08466ff5611e242e86f80062949cdf6b4b9cc317b9dd93d/regex-2026.5.9-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:5604dfd046dc37eca90250fc3be938b076c8059fa772ac0ed6f499b0f0fb0415", size = 773022, upload-time = "2026-05-09T23:15:05.625Z" },
+ { url = "https://files.pythonhosted.org/packages/50/a8/a9979c3e7918280e93159ebcab5ef1a65116dd4f3bd6091be0eae4a126e8/regex-2026.5.9-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:0e1b1b4e496afbb24f4a62aba855ee4f88f25578927697b340702e48c9ee6bc2", size = 856642, upload-time = "2026-05-09T23:15:07.966Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/d4/a9b732f2f0072c0ab12227483abb24fffcb9f73f8a2b203df0a6d0434735/regex-2026.5.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:be3372b9df6ddecff6486d37e19095a7b4973137caf5512407a89f4455361f41", size = 803552, upload-time = "2026-05-09T23:15:10.215Z" },
+ { url = "https://files.pythonhosted.org/packages/d5/fe/1b3113817447a1d4155e4ac76d2e072f42c0bcba2f43fa8a0e756ea2cd91/regex-2026.5.9-cp314-cp314t-win32.whl", hash = "sha256:3ddd90103f9e5c471c49c7852ecc1fe27c7e45eb99e977aefe7caa4e779f4f58", size = 275746, upload-time = "2026-05-09T23:15:12.609Z" },
+ { url = "https://files.pythonhosted.org/packages/92/73/93d42045302636c91f2e5ef588b65b84b01428f28ec77de256b1dfdfbe5c/regex-2026.5.9-cp314-cp314t-win_amd64.whl", hash = "sha256:ca518ed29c46eecba6010b15f1b9a479314d2de409536e71b6a13aa04e3b8a77", size = 285685, upload-time = "2026-05-09T23:15:15.086Z" },
+ { url = "https://files.pythonhosted.org/packages/da/80/35b4c33c804a165a7f55289afda3ea9e3eb6d15800341a2d66455c0f1f30/regex-2026.5.9-cp314-cp314t-win_arm64.whl", hash = "sha256:5e41809d2683fcde7d5a8c87a6567ba1fb1ce0de9f31bff578de00a4b2d76daa", size = 275713, upload-time = "2026-05-09T23:15:16.98Z" },
+]
+
+[[package]]
+name = "requests"
+version = "2.34.2"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "certifi" },
+ { name = "charset-normalizer" },
+ { name = "idna" },
+ { name = "urllib3" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" },
+]
+
+[[package]]
+name = "rich"
+version = "15.0.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "markdown-it-py" },
+ { name = "pygments" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" },
+]
+
+[[package]]
+name = "rpds-py"
+version = "2026.5.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/2e/43/25a8dcd3feedd735039a8f0b5b7e3b118232b5eae288c4fd9ab200d41094/rpds_py-2026.5.1.tar.gz", hash = "sha256:07b24fea40541e28570e5b795a4a38fbdcd12550c06bd0748005ecc8116ca256", size = 64459, upload-time = "2026-05-28T12:02:13.232Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/d4/e7/a78582dc57caa592dcc7d4fb69b61390561e908eb3d2f5df5928a8e354c0/rpds_py-2026.5.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3abe24a66e57adcfa645d718063a5fa5103ecc71ddbf26d78af8f9368018ff1d", size = 353040, upload-time = "2026-05-28T11:59:12.531Z" },
+ { url = "https://files.pythonhosted.org/packages/a3/43/35e3f136343aef451e545ce8c38d36c2f93c0ed88703db8b64ba2b205c68/rpds_py-2026.5.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:58b1d94308ddf0b1982f61f2eb54bf92997c9ece8a8093ef014250f4a517906c", size = 345775, upload-time = "2026-05-28T11:59:13.827Z" },
+ { url = "https://files.pythonhosted.org/packages/20/e1/0f2160c5982d3157734d5cb3ed63d8b2d583a73c9864f77b666449f32cf8/rpds_py-2026.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fa92420128dadce7f54bd73ba1825a273e9268fe9e35dbf7e6362890efa4e08", size = 376329, upload-time = "2026-05-28T11:59:15.271Z" },
+ { url = "https://files.pythonhosted.org/packages/d0/11/ee0ba42aff83bf4effdbc576673c6be64c5e173978c3f6d537e94482f77d/rpds_py-2026.5.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ca653c6546386227cd9800d1bef6a348099acf8db4250341da6d90f663d6dfcb", size = 383539, upload-time = "2026-05-28T11:59:16.665Z" },
+ { url = "https://files.pythonhosted.org/packages/11/df/d94aa6a499d4ac40afe2d7620f2c597fd3c0f182e854ad7cf3f596a81cb6/rpds_py-2026.5.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:66c93681c4729e4e3ecba31b8179fae083ff3118841672835140338b4b9867c1", size = 494674, upload-time = "2026-05-28T11:59:17.991Z" },
+ { url = "https://files.pythonhosted.org/packages/1f/75/33d30f43bb2f458de11979486a591b1bf6e5651765ed1704c6197c2dc773/rpds_py-2026.5.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40ff257542e04796880e011e15cd4dc21c2599975df2aaa8f2c8495ca574e1a5", size = 389268, upload-time = "2026-05-28T11:59:19.434Z" },
+ { url = "https://files.pythonhosted.org/packages/f4/1e/2c9096fc19d5fd084b0184ca2b651e659aa0a37e6fdbecf6ece47f147fe1/rpds_py-2026.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b6825cc329b290e93c5f6a9be2393118a763f6ccf6abd83704e0c102ca583644", size = 376280, upload-time = "2026-05-28T11:59:21Z" },
+ { url = "https://files.pythonhosted.org/packages/b9/e5/61ec9f8be8211ea7f48448195549e4aaf02004083475493b0e137702ecb2/rpds_py-2026.5.1-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:de42116e69cb53b911cc34aee5ab98f36c597b822545045d49e938818b99e5e4", size = 387233, upload-time = "2026-05-28T11:59:22.454Z" },
+ { url = "https://files.pythonhosted.org/packages/0d/ca/bcec1005c4f4a234f92a29078631fee49206c7265ccae966f18fd332e80e/rpds_py-2026.5.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c0f920015df2a504bebaba6d4c31ccf3fcf942f92655c086da30b671aad19aa6", size = 405009, upload-time = "2026-05-28T11:59:23.845Z" },
+ { url = "https://files.pythonhosted.org/packages/72/e6/4d5718c5cf26c522dc7c9999e238da1e77380b81d0c5d1df11e271ddfeb1/rpds_py-2026.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0408a24e44feb919423dc6d9da677cb5cddb894d2ca9e763967d156d9c60fab4", size = 553113, upload-time = "2026-05-28T11:59:25.184Z" },
+ { url = "https://files.pythonhosted.org/packages/d4/25/2ee807bdb3e1f0b7eddf7782acd5665a8b5205a331a7d7244a52c4812fd9/rpds_py-2026.5.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:cea68bcd53467561ae2f96a6bdad1544299ba97b5b0ddcd5ac3d376e5c781c24", size = 618838, upload-time = "2026-05-28T11:59:26.749Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/c1/7d4c26f167f8c41501cc073d30ee22082b16ce358cf5b00ec97cbc7804ea/rpds_py-2026.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4be8b1d2a705cc37d08256004e1d07de143fa0075c8e85a3df020b776f62b732", size = 582436, upload-time = "2026-05-28T11:59:28.11Z" },
+ { url = "https://files.pythonhosted.org/packages/04/1d/9d12b0a337bab46f4769f8857f4007e3b2d639e14f9a44a0efe157696e64/rpds_py-2026.5.1-cp312-cp312-win32.whl", hash = "sha256:6736718bd4fc49cbcb538ba30516fdbef161522acefb739657d48b97bd864fed", size = 212734, upload-time = "2026-05-28T11:59:29.689Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/93/e4116f2de7f56bc7406a76033dc501811ddeb22b7f056b92d632871ebb0c/rpds_py-2026.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:0a7d1eec967df0e9b22614a5e177622e0c89611d03727fa0cb48e45028907870", size = 229045, upload-time = "2026-05-28T11:59:31.033Z" },
+ { url = "https://files.pythonhosted.org/packages/cb/53/6c3419d85eb2ec5938a37627c585b42d76a63bb731d6e42ed4b079ebf486/rpds_py-2026.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:1841d067089e117142d79b98aa0df2f08b52f2ecc1819dd2700636c0db74a473", size = 223967, upload-time = "2026-05-28T11:59:32.318Z" },
+ { url = "https://files.pythonhosted.org/packages/6c/32/14c961ad295f490eb0849ada8b79683e93a59b9de3afdd983eaf55fa6867/rpds_py-2026.5.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:efef4ac29c6ff495531eb17ee705b62841ecaa291b7c7077e848ea03e237164d", size = 352787, upload-time = "2026-05-28T11:59:33.655Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/bb/d1b85117967c11191441a7274ae616c65d93901d082c588f89a50a8da5ae/rpds_py-2026.5.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c39f5b67a8a2e67179ada2a954227d670fe65fa9098457f698f56ddf248709b3", size = 345179, upload-time = "2026-05-28T11:59:35Z" },
+ { url = "https://files.pythonhosted.org/packages/7c/46/d84105f062e626a1b233f863907288a4708c2d833b8b4c6fb2764bc080c0/rpds_py-2026.5.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5c30f3f04eef4fbd362226a6f31d7c8895ca4fbb6e0b790f6890a98d8da8559", size = 376173, upload-time = "2026-05-28T11:59:36.43Z" },
+ { url = "https://files.pythonhosted.org/packages/e2/ae/469d7959ce5b1201e1de135dc735b86db3b35dd0d1734f6a44246d5f061c/rpds_py-2026.5.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:277f6c82f0580848796c7ecc8a7173aa3bfb928e4ff831261c2f60a81dc270db", size = 383162, upload-time = "2026-05-28T11:59:37.995Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/a2/57853d31a1116a561aa072794602ad3f6341e18d70a8523f1bd5b9fc1e5a/rpds_py-2026.5.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:63c2c4c213f1a4e3f3de28ecab029dbdee976324e729c0d7a55211be72576b02", size = 495093, upload-time = "2026-05-28T11:59:39.453Z" },
+ { url = "https://files.pythonhosted.org/packages/99/63/3a8eabcad9314b7daf5c65f451d2c33d989235cd8a5762186cf2c3f5a4f8/rpds_py-2026.5.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3350ec808fb538fe71a1f94dfaa0e29c598dfad805ce49f0caec5ae3183c652b", size = 389829, upload-time = "2026-05-28T11:59:40.896Z" },
+ { url = "https://files.pythonhosted.org/packages/4b/25/05678d97fc25e2622df14dc530fb82023174ecfff6733991ed0d78f167bd/rpds_py-2026.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1b964e3ab599e718dc46c018d104b1ebc007cbc6567d827c94a687fca56d77e", size = 374786, upload-time = "2026-05-28T11:59:42.626Z" },
+ { url = "https://files.pythonhosted.org/packages/88/d1/8c90b6431e80a3b91b284a5c7c8c0c4f9c006444d90477a740d6e0f9c694/rpds_py-2026.5.1-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:19cb09fab7b7fc96b2a6e28f2e34b72a3705ff27b37edb77455316e5d3f3dc9b", size = 386920, upload-time = "2026-05-28T11:59:44.124Z" },
+ { url = "https://files.pythonhosted.org/packages/ff/99/4638f672ab356682d633ee0da9255f5b67ce6efd0b85eb94ad3e255e65a5/rpds_py-2026.5.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:abe76bcdba31e576cb83eeb8797aa0d882b738fef6dc65d0601fc753806a5b46", size = 405059, upload-time = "2026-05-28T11:59:47.177Z" },
+ { url = "https://files.pythonhosted.org/packages/66/3f/3546524b6eb4cc2e1f363a3d638fa52f6c24faae3500c25fb488b02f1740/rpds_py-2026.5.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:8bff7073db3899158fff55ebf57b113a67030af26f80a18978f9f0aa60250ddf", size = 553030, upload-time = "2026-05-28T11:59:48.603Z" },
+ { url = "https://files.pythonhosted.org/packages/c6/c3/7b3388c796fcf471bd17194242d4dc1a7608567c0fa422bcc1c5e79f9c1e/rpds_py-2026.5.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8ba264fa49be666cd9cc56bf34ec7002fb3d27a4aee5bcb4d43d0d18feb1bb6f", size = 618975, upload-time = "2026-05-28T11:59:50.314Z" },
+ { url = "https://files.pythonhosted.org/packages/61/1e/a3cb07f2795075d1d88efddae2f541359fde5f08c81ee114c29c2949c90a/rpds_py-2026.5.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4860b603ddda0475a8885499b3729e90229d480105b42651962a5397d995fa89", size = 581178, upload-time = "2026-05-28T11:59:51.673Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/74/e758c03a5ef46f04c37f2651a2893db846d569ba8a7bca469d4b58939bcd/rpds_py-2026.5.1-cp313-cp313-win32.whl", hash = "sha256:7944270ae71383f6e2657dd7d5ce4eeb4ac2d0059a6738f0510583d462ab4842", size = 212481, upload-time = "2026-05-28T11:59:53.148Z" },
+ { url = "https://files.pythonhosted.org/packages/70/ec/a2aca432db9c7359b40fa393eeeaa0d166c2f70175be956e75fa24197c44/rpds_py-2026.5.1-cp313-cp313-win_amd64.whl", hash = "sha256:88647f43a73c4e01be19b04ceef0c8d3a1958153604d13c773becd8016f2a0cf", size = 228519, upload-time = "2026-05-28T11:59:54.505Z" },
+ { url = "https://files.pythonhosted.org/packages/29/60/a73bfdd45b096574556acf303bbd9fa9eed36ca8a818b514e2a5d5fe2b9d/rpds_py-2026.5.1-cp313-cp313-win_arm64.whl", hash = "sha256:453895624ecf7db7063b1004e44037522bbaef9ff6a945e59bc71662d7a03abd", size = 223446, upload-time = "2026-05-28T11:59:56.081Z" },
+ { url = "https://files.pythonhosted.org/packages/18/e2/408105fd611823f00882aea810f3989a30d26b1bab8b6beb20f98c724e0e/rpds_py-2026.5.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:b4e4bc98639ec915f512fde3aa7a95e0041d95d9c3cc86eea841fa63cb1e8600", size = 355287, upload-time = "2026-05-28T11:59:57.448Z" },
+ { url = "https://files.pythonhosted.org/packages/8d/58/5c4a43436843c90d0f6d19f82c200c80e3843ca9fa07b237623327f6d384/rpds_py-2026.5.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:cacedb7a6e167680acba45ad5716e89067d225dc80da0d7040cae8c81d4572fa", size = 347033, upload-time = "2026-05-28T11:59:58.881Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/c2/1a71acdacaf4e259b10278fb87b039ded3cf80041bcd89dd8a3ea702ded6/rpds_py-2026.5.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68700371c5d7ae1412862ddfa719090925c93ecf351c566d66f09d04b136ea00", size = 376891, upload-time = "2026-05-28T12:00:00.516Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/c8/535f3d9b65addd8e28aa87b83c6e526799c3717a88273db8ea795beeef7a/rpds_py-2026.5.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:296c799becfa849c779c8725494fe9ed94959ed886787df4364b058465bad7f0", size = 385646, upload-time = "2026-05-28T12:00:02.394Z" },
+ { url = "https://files.pythonhosted.org/packages/1c/91/dc033f313345c354ade914dbe73cdb90b615a4409ea02430d5356794f3d8/rpds_py-2026.5.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d3858b908218ee108d0bbfb2095ccc237648053c9bf98affad7cb079acaf1d97", size = 498830, upload-time = "2026-05-28T12:00:04.189Z" },
+ { url = "https://files.pythonhosted.org/packages/27/fc/90fcbea459dbb8ddc18a2e0fd1de9412b48bc84ffff2db771cf714bacfd6/rpds_py-2026.5.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4fb8d2e7cb2f850b169806d61d1b991738acec96500a75c30f49caf064ce7cef", size = 392830, upload-time = "2026-05-28T12:00:05.797Z" },
+ { url = "https://files.pythonhosted.org/packages/b2/1d/46cd11a228c9750684a798d98f878be6f614aa762438da7378f035e79e35/rpds_py-2026.5.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27b74c10ed6a8f190f4287f53bcfea348b92a84a9c9f70d30183d1e6172d580d", size = 379613, upload-time = "2026-05-28T12:00:07.433Z" },
+ { url = "https://files.pythonhosted.org/packages/24/4a/d9b0c6af3a1de03eb93741bbe8be2bdce84d8fda8224f3005451d86df389/rpds_py-2026.5.1-cp313-cp313t-manylinux_2_31_riscv64.whl", hash = "sha256:b9a6528956191c48c52294a592dbd4a8386d7048bdb25c0efcb6b966466c6d83", size = 388183, upload-time = "2026-05-28T12:00:09.227Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/b4/db7aaabdda6d020afc87d981bcc2f57a434c7dec60ecfc2ab3dd50b20351/rpds_py-2026.5.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:af03e34e860047bc7a352b842856fcf78798fbb81132cc98bd2f907ab4eb9cd2", size = 408578, upload-time = "2026-05-28T12:00:10.779Z" },
+ { url = "https://files.pythonhosted.org/packages/08/d6/070f6a41cbb343e2ac4171859bf3f3623e0ab002f72619d6d505313ec2de/rpds_py-2026.5.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:fea6e836d10abbe191d557d33bd58bd5987725fe63aa1eefe557d230209855bd", size = 553573, upload-time = "2026-05-28T12:00:12.443Z" },
+ { url = "https://files.pythonhosted.org/packages/75/ab/1a71ea3589c4345dac0a0518f0e6a031cb42689277851b683c46d27463a5/rpds_py-2026.5.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:fc0c0f878ea770a0a8a462456c5ad36fc9fe6358e6b76fdadc7f17575e0b8bf1", size = 620861, upload-time = "2026-05-28T12:00:14.09Z" },
+ { url = "https://files.pythonhosted.org/packages/8a/22/9bf80a56069c0c443fcfefac639a86a744550a2898817a6dfd3e26654924/rpds_py-2026.5.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:e0b360f316d966b048b085857630b3cc51f3db2f07b06f440eac8f695374d1e3", size = 585633, upload-time = "2026-05-28T12:00:15.66Z" },
+ { url = "https://files.pythonhosted.org/packages/da/68/3b2c0a75c9e04125696f84ebdbbf304acf5a40b58ba4481cdb98a922c3ba/rpds_py-2026.5.1-cp313-cp313t-win32.whl", hash = "sha256:a2999883eedf72fdfb7520b92c7d4ec2572a71ff40239377aa604cc529eecafc", size = 210074, upload-time = "2026-05-28T12:00:17.291Z" },
+ { url = "https://files.pythonhosted.org/packages/e7/8b/609157d5a25d37d4f29f92840ba531f416907c34ae5c5739dd21fc2bef98/rpds_py-2026.5.1-cp313-cp313t-win_amd64.whl", hash = "sha256:e07be2a9d7122bd6e82dea89814ef8dc893feb1aae97fec1630f3263bbb30e55", size = 228635, upload-time = "2026-05-28T12:00:18.73Z" },
+ { url = "https://files.pythonhosted.org/packages/d4/6f/19c1918a4b590d8de87e712e4abe4b3875771eff60216fb6153cf6665c68/rpds_py-2026.5.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:1f2c391c3059798093b65df23aca2cac150460ae9c630d99dec83d703d9485b9", size = 349756, upload-time = "2026-05-28T12:00:20.217Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/60/a06fe7da34eca79dacbf958a2ba0c6eea85bc2b29de20080bf40f72f66fa/rpds_py-2026.5.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:413b424f7c4ee65ab5e5be91f5731be0f8b41a1ee2b12dfe810d716312e95a78", size = 343831, upload-time = "2026-05-28T12:00:21.711Z" },
+ { url = "https://files.pythonhosted.org/packages/bf/ec/b2333b97b90e2a6ef6ca8ad386ee284968e74bcfe113b3f1a8d9036429a9/rpds_py-2026.5.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c595a1d9255dce0599e13130d1440ab2506654f2b50294226ee06402f8fef63", size = 375127, upload-time = "2026-05-28T12:00:23.326Z" },
+ { url = "https://files.pythonhosted.org/packages/14/7f/e00aae54067f2b488c4637961d5f58204d470795fc791085fa3f15060d2e/rpds_py-2026.5.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1c27c5f6102eac8c03e7595a00827a53b271ba40a53b59ff8709170e0855ea4a", size = 379034, upload-time = "2026-05-28T12:00:24.89Z" },
+ { url = "https://files.pythonhosted.org/packages/be/cc/423999bbb8ae8dc93c77fc1d5e984ade5eb89d237d3bb884ccfa72ae2890/rpds_py-2026.5.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c7fcf61d44cacecaf3aea542b0e053db77972a4573e7ceda16fb2b399161195", size = 490823, upload-time = "2026-05-28T12:00:26.676Z" },
+ { url = "https://files.pythonhosted.org/packages/0f/aa/c671bf660f12e68d3c52ff86c7066ed1372df5a0f4f2ff584e419b8207e7/rpds_py-2026.5.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2c817a189d4ee14290420e5ff051e4dd6baa13f3edf84685071dee07a6d538ee", size = 388144, upload-time = "2026-05-28T12:00:28.577Z" },
+ { url = "https://files.pythonhosted.org/packages/19/c8/d63bb75b68afe77b229e3021c6031bcaf01da5db5b0e69d0d10f9ba679a7/rpds_py-2026.5.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21846aac0ed2e0589f38c12dc44e77bb64e494b771eadbcf169cba00566ba7ba", size = 371959, upload-time = "2026-05-28T12:00:30.304Z" },
+ { url = "https://files.pythonhosted.org/packages/82/35/c51122014d8274ff37dc606d60049c3db7d83da02b5b282511e5a906a9a6/rpds_py-2026.5.1-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:b317c87a13f769a4e787819bd508aaa5d69aa09b0880de9af6d3a8a54571cdec", size = 383558, upload-time = "2026-05-28T12:00:31.764Z" },
+ { url = "https://files.pythonhosted.org/packages/e3/f9/2790cb99c136a5363acdeacf5c27c56f3de0d4118a1f48fca83404c99c89/rpds_py-2026.5.1-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ce87129d9f2c14fa6c4a8601fb80eb4488c80d38a20cd13758ef11123e14995d", size = 402789, upload-time = "2026-05-28T12:00:33.247Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/1b/e4fb584f8c75d35c38150ff6a332cda949e6f97acba1f4fd123b14ab56fe/rpds_py-2026.5.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:9cdddb6c1207d284d94fd1530adf57fbd797fe7c4b8704ba85f49414f2557e7d", size = 551405, upload-time = "2026-05-28T12:00:34.819Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/f7/a6731b4216cb3793ea1af5391da240f5683dacc0d13e034fe5fc3503f240/rpds_py-2026.5.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:4e237e139f94d3c036fd28eb9f564c99055476ff4ff05cd42be55ce349b5aa02", size = 616975, upload-time = "2026-05-28T12:00:36.268Z" },
+ { url = "https://files.pythonhosted.org/packages/2c/ea/2e051a81d95d8e63f4b35a1c463a87e8766bc3d083c067c5dfb6bf220747/rpds_py-2026.5.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ed0954b524873214369184a9c82b0eaa45a3fbb9a798cd95b17e0d98499e7ea0", size = 578701, upload-time = "2026-05-28T12:00:37.82Z" },
+ { url = "https://files.pythonhosted.org/packages/65/56/b5f6fdb2083e32bca8a8993d89e70db114b4756c9e2c38421328126689d2/rpds_py-2026.5.1-cp314-cp314-win32.whl", hash = "sha256:2d88621d6a7d4dfa633d21abe90f280bb205274e16b1d1e61c6ad4640b2453b7", size = 209806, upload-time = "2026-05-28T12:00:39.492Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/80/65a5aa96c155e611d1ed844e4e1f57f3e36b021f396d9f8585d756e6b90d/rpds_py-2026.5.1-cp314-cp314-win_amd64.whl", hash = "sha256:cef8ac28d26f4dda3533060c20fbf80a325458fa9fd23ea72a73cdfa8e978838", size = 225985, upload-time = "2026-05-28T12:00:40.94Z" },
+ { url = "https://files.pythonhosted.org/packages/27/7c/ad185212e87b05f196daef92bc5f3caf07298eb47c295b5585c3dd3093ac/rpds_py-2026.5.1-cp314-cp314-win_arm64.whl", hash = "sha256:eaaea962c68cdc68d4a533ba985ab8e9484277910bbfaa2ab3ef7732667bfed8", size = 221219, upload-time = "2026-05-28T12:00:43.15Z" },
+ { url = "https://files.pythonhosted.org/packages/23/58/e14ae18759020334646b031e708ab4158d653a938822bfb7b95ef2e93aa3/rpds_py-2026.5.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:21942f52dbbd5f8758bf021213d28bd45c39e873e65e2407faf5f1846f5761ad", size = 352148, upload-time = "2026-05-28T12:00:44.638Z" },
+ { url = "https://files.pythonhosted.org/packages/31/9b/5f4a1e2f960bca3ac5d052b139dd31eed97b259f9d909173821760d542e8/rpds_py-2026.5.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f414556f6e3958300ff941e40c9f97e3dc9774ddd1b3434c475d73dd354bbed3", size = 345196, upload-time = "2026-05-28T12:00:46.14Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/71/1d9574d6a2fa20ab60eaa55c7467f5aa20cbc770f341a05f09c0876f59e2/rpds_py-2026.5.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef1013a8625c74043210190b246f5b1551e09757c1f356c6e4160ef96c5bc081", size = 374981, upload-time = "2026-05-28T12:00:47.531Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/9a/37e99f4915a80aa71670263c1267f7ae0af95f53a3f61e6c3bdc016d4515/rpds_py-2026.5.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cc68e231a77a5f0d774ae278a1f8e55c0456501820847c1e4efb3829f3441df6", size = 379961, upload-time = "2026-05-28T12:00:49.216Z" },
+ { url = "https://files.pythonhosted.org/packages/a8/ff/6e73f74b89d2e0715e0fc86b7dde893f9a61ae2f9b256ff3bdfe41ac4e94/rpds_py-2026.5.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9baffb505aff33acc69b422a19f77806680f3c8632227d79f48de8a810d1c2c5", size = 495965, upload-time = "2026-05-28T12:00:51.111Z" },
+ { url = "https://files.pythonhosted.org/packages/ea/e0/425faba25f59d74d4638b267f7c7a80e8649d2ef4db10a19b0c4a71e6e6f/rpds_py-2026.5.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8d2f912928d426e8cfa396f7f3f8d29a59e6689c86dcca3c420730c1096322b", size = 389526, upload-time = "2026-05-28T12:00:52.77Z" },
+ { url = "https://files.pythonhosted.org/packages/c6/76/7a41960e3fddae47fab43a28684d5da981401dffd88253de0944148654cb/rpds_py-2026.5.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90f628283be835db980c941767d41c9a27b5239e54ba0a9c1335247e82406964", size = 376190, upload-time = "2026-05-28T12:00:54.215Z" },
+ { url = "https://files.pythonhosted.org/packages/27/60/5f38dc70824fc6951b51d35377e577a3a3a4c81a6769cc5a2de25ebe0ad1/rpds_py-2026.5.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:1ebb2f0ab7e16132995a72de805170e0203df0c3dd22e1ef1cd1fdd90bd7a131", size = 383921, upload-time = "2026-05-28T12:00:55.673Z" },
+ { url = "https://files.pythonhosted.org/packages/60/1a/d60a38caa1505f4b9483c3fbbde12c94e1079154f4f401a6da96f7e77621/rpds_py-2026.5.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f3df3d16ded76f1f8c9cdebd0e1ea55fdf4c23b812de189814da7cf229c22a81", size = 404766, upload-time = "2026-05-28T12:00:57.518Z" },
+ { url = "https://files.pythonhosted.org/packages/87/ff/602fd3f174d6425f0bce05ad0dfbec0e96b38d0f7d08a79af5aa20083885/rpds_py-2026.5.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9af8905b8f854990e40d5206aa5ac58d9b0fe0b7f351ff2bb086c20f6c8c6a47", size = 551343, upload-time = "2026-05-28T12:00:58.978Z" },
+ { url = "https://files.pythonhosted.org/packages/b8/c1/1be13327acdbead3eca1fde03b6a34dbb011f1e864e217f0d32cc1779a7f/rpds_py-2026.5.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:036a36a87fb1cd3b214d11c4b3c4f7d2ddad933625dca1c900b56a057c07740a", size = 618502, upload-time = "2026-05-28T12:01:00.656Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/d7/afb49b49d7f2be8b7ba1a9f0977fa5168003437b93086726f066544e8351/rpds_py-2026.5.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:62ae3853454fe9ef283a03c96c2d835d39e84b14643a9d62c82ef0fb87d702ca", size = 581916, upload-time = "2026-05-28T12:01:02.22Z" },
+ { url = "https://files.pythonhosted.org/packages/25/d1/dbef8c1f8a10f07beb62b5f054e20099fd9924b3ec001b8f0b6ac7813a85/rpds_py-2026.5.1-cp314-cp314t-win32.whl", hash = "sha256:6c3d771a46ec18b12af06ce36243a9a80b07a5d0515236332d90863ca8bb326a", size = 207855, upload-time = "2026-05-28T12:01:03.821Z" },
+ { url = "https://files.pythonhosted.org/packages/2a/72/bfa4e61ab8e7dc1c8adf397e05e6cbdd4239357bd72b248d3de662f23915/rpds_py-2026.5.1-cp314-cp314t-win_amd64.whl", hash = "sha256:c93c629be4636cf54337bd5f06c104d55e42ced54d681f6fe21ae510a65116f6", size = 225422, upload-time = "2026-05-28T12:01:05.194Z" },
+ { url = "https://files.pythonhosted.org/packages/27/3a/7b5da92b640f67b6717ccafc83cdd06bfa7ff2395c3685c68922bb54d703/rpds_py-2026.5.1-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:3574b55c604b8f75dacb007136508bbc0db406e626301778096a133327e7f2fb", size = 349576, upload-time = "2026-05-28T12:01:06.722Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/8a/2aafd7ad355a1bd48ca76e2262b74b15e6432b5a1efe150efd4d779cd55d/rpds_py-2026.5.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:94068eb3ae6d43f5a786b7db96a406a34e6d5c24489feef32fd6e8946ea7b291", size = 343640, upload-time = "2026-05-28T12:01:08.441Z" },
+ { url = "https://files.pythonhosted.org/packages/f7/7d/6c9523c1abbe840a1b7fba3c516d48e1d3487cc80fea4366c4071cf56784/rpds_py-2026.5.1-cp315-cp315-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3a5b10e8ce894825f380a8f1b6444cf73c294dfea62afbb2d13e3a9e630cec1", size = 375322, upload-time = "2026-05-28T12:01:09.934Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/5d/0b7b03fb1dc509321f01de3149784ab773e34c8573022029af8076afcb9c/rpds_py-2026.5.1-cp315-cp315-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fc09f82e63d4bcd58149572f857a431bae851dc747e313c3b5bdf7abb907fda8", size = 379066, upload-time = "2026-05-28T12:01:11.48Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/e2/8ef6012999ebf1cb1c22f876d9ce5e63d960fd4631d2af3202d3f480aa25/rpds_py-2026.5.1-cp315-cp315-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e10464d17df3b582745c25cec695cb9558bca2cb6ddb631aee1787fc72c767b2", size = 494586, upload-time = "2026-05-28T12:01:13.051Z" },
+ { url = "https://files.pythonhosted.org/packages/80/af/1eeb029bec67582c226b7809172207cd005073af4ebd906e65ff494f4983/rpds_py-2026.5.1-cp315-cp315-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ba05adbf15d994c38ec0b7ab32e858e5110c21e9009a00a86545fd220f84e038", size = 388415, upload-time = "2026-05-28T12:01:14.631Z" },
+ { url = "https://files.pythonhosted.org/packages/18/23/ffbe10711c4d766c1cab0557d6906c074f795814863c67b351355d29354a/rpds_py-2026.5.1-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:77c004fdc7b891967106f78ddfd7b076bfe6813c6139c6fff6aed3bcaa960b26", size = 372427, upload-time = "2026-05-28T12:01:16.153Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/3a/30ba4a6ad457e5b070c18d742a33fb77d8d922b565cc881f8a5313d63bfe/rpds_py-2026.5.1-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:83bcf894486c9d78dd290d3c0124ff6dd8875d3025e2090a8ec49fcc37c55fdd", size = 383615, upload-time = "2026-05-28T12:01:17.809Z" },
+ { url = "https://files.pythonhosted.org/packages/d3/69/62e242b53ce39c0814bd24e1a6e6eba6c92be716277745f317f9540a2e7b/rpds_py-2026.5.1-cp315-cp315-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c3df104083952a0e0c6f10de33e440eabe98fb6317d23e1a58c68f6df08d01b9", size = 402786, upload-time = "2026-05-28T12:01:19.419Z" },
+ { url = "https://files.pythonhosted.org/packages/38/c1/a770b9c186928a1ed0f7e6d7ae50e7f3950ed23e3f9e366dbc8e38cb55de/rpds_py-2026.5.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:980450826cf22e133c57e0835070bdd0dd3f73b9b708c3ce223def2cb9469e14", size = 551583, upload-time = "2026-05-28T12:01:21.013Z" },
+ { url = "https://files.pythonhosted.org/packages/21/7c/68e8579b95375b70d2a963103c42e705856cdb98569258bd807f4423891c/rpds_py-2026.5.1-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:205dde846f24332ab0c1188699a043b8d165b79bb84529ce272c45048ff6be01", size = 616941, upload-time = "2026-05-28T12:01:22.548Z" },
+ { url = "https://files.pythonhosted.org/packages/70/a1/a6135aed5730ff03ab957182259987ac11e55fb392a28dc6f0592048a280/rpds_py-2026.5.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:3966b82dd563176396df030f3dd52a6e54cb69b718e95e78bd555ed3d1e0185d", size = 578349, upload-time = "2026-05-28T12:01:24.118Z" },
+ { url = "https://files.pythonhosted.org/packages/09/6e/f24201a76a84e6c49d0bdfdfcb735210e21701e9b21c5bfc0ba497dd62f6/rpds_py-2026.5.1-cp315-cp315-win32.whl", hash = "sha256:7818f8d0a415be74d2be3590b0a1c1f463a642f4d0217e7d10602dceef5b79aa", size = 209922, upload-time = "2026-05-28T12:01:25.522Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/e4/966bc240bb0485fc265278f6de44d05834bf0b3618886e0b22e33d54c49a/rpds_py-2026.5.1-cp315-cp315-win_amd64.whl", hash = "sha256:b3cc20c0d800af78fd0fac68086e28c1856cec51ea528bb81ea851aa40d39325", size = 226003, upload-time = "2026-05-28T12:01:27.062Z" },
+ { url = "https://files.pythonhosted.org/packages/5c/5c/a15a59269cd5e74472734516c73795c15eccfc841b3d4b0228c3f53f19d0/rpds_py-2026.5.1-cp315-cp315-win_arm64.whl", hash = "sha256:3609e9939a8a76cd904cf98a3f1f13b5dc7e150adeaee89e0ea09652ea213e16", size = 221245, upload-time = "2026-05-28T12:01:28.51Z" },
+ { url = "https://files.pythonhosted.org/packages/e0/22/135ce03804e179a71ceb13be095deda4a279bc88f7a6b8fa161c5ad44e12/rpds_py-2026.5.1-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:5d333a7127d4b307601ac37792bee01bb95c867cbfacf21b6375b804d6bbd723", size = 352015, upload-time = "2026-05-28T12:01:30.214Z" },
+ { url = "https://files.pythonhosted.org/packages/3b/5f/f1f6d2652eb9d848f6eb369d8db83a2da6249bb49ad2c2a48f45d54538d3/rpds_py-2026.5.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:b5f077b44a4f7808520f66dae234988d867deb9aed9be5da057ce9ba831b2a41", size = 345016, upload-time = "2026-05-28T12:01:31.656Z" },
+ { url = "https://files.pythonhosted.org/packages/88/66/b74182775691ea2290c99e52ac8d5db844e56fbec90ce421f107658c8314/rpds_py-2026.5.1-cp315-cp315t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55d8f9b7b78c9538fc9e04e82ec0e888ff0c3cffcfad152c77e57cd09351a98a", size = 374775, upload-time = "2026-05-28T12:01:33.136Z" },
+ { url = "https://files.pythonhosted.org/packages/ff/8f/15e5a61d9f0a43902d36561d4f07cae6ae9f4716be825159fd72717f33af/rpds_py-2026.5.1-cp315-cp315t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e3a8ae58895ac107ed934a6bf51e5846f95c53b9b940c2c6d310838fd5846358", size = 380270, upload-time = "2026-05-28T12:01:34.574Z" },
+ { url = "https://files.pythonhosted.org/packages/02/c3/f859b12763a80540cdf2af0f15b19904cf756a71d7bdd3f82ff3e5b1bbf9/rpds_py-2026.5.1-cp315-cp315t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0957cf3c2b8632ec7aaebffebea8005b353cc2a237b6e2ae3c2cac0820704cfb", size = 495285, upload-time = "2026-05-28T12:01:36.127Z" },
+ { url = "https://files.pythonhosted.org/packages/1c/c7/ff27c2ac8411d30b03b1829fd88cae8dad1a4d0da48dd25e57c4038042e6/rpds_py-2026.5.1-cp315-cp315t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c396c1304de421050b3681ea70f371874b54d41b0151e96109758144c231e30b", size = 389581, upload-time = "2026-05-28T12:01:37.635Z" },
+ { url = "https://files.pythonhosted.org/packages/6e/67/fe92ee32a6cc05c77228a2f8b1762e7124f386ec20ff83d0757b762d58d0/rpds_py-2026.5.1-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aad1bff7f666b9598e573815affd666aac6a13a585dde336f843e33350c7fadc", size = 376041, upload-time = "2026-05-28T12:01:39.307Z" },
+ { url = "https://files.pythonhosted.org/packages/f8/91/b4d6685c27aba55bd82f25b278be8237038117d05f9659a6213ad3408130/rpds_py-2026.5.1-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:656a042550878f12d45752452d47094b7cfe5ad1e9d7b87b5a22ad3ae5ff8015", size = 383946, upload-time = "2026-05-28T12:01:41.043Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/79/2c1d832a53c8e0f8e98fc970ec257b950fecd4f62be2ab7182b500a0cbc8/rpds_py-2026.5.1-cp315-cp315t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:73c4bd4f70294737b5206a3e8e30ccadbf8a60301831c8ea23eec5dbeea1ecfa", size = 405526, upload-time = "2026-05-28T12:01:43.032Z" },
+ { url = "https://files.pythonhosted.org/packages/78/c4/c98117b03c6a8581ab2c2dfccfe9a5ad82bd8128a3c28b46a6ad2d97c393/rpds_py-2026.5.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:43bca78665423cabae77146f2fe7ce55272b6c8d55d82cca83effd42c7e13972", size = 551165, upload-time = "2026-05-28T12:01:44.648Z" },
+ { url = "https://files.pythonhosted.org/packages/3b/c1/bc479ca069200af730881b1bd525e3114b2b391a351509fcb1b772f28086/rpds_py-2026.5.1-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:42d0f20e85e549c870749d0e247f0c10d318a45b7e9676d575d2dcb04a1b2e66", size = 618778, upload-time = "2026-05-28T12:01:46.337Z" },
+ { url = "https://files.pythonhosted.org/packages/77/65/38ab2f90df44c2febfb63cc10ced40763d9b4bc94d173e734528663fe7f5/rpds_py-2026.5.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:b1be5c35683684d5331b93600c210e8367c254683d8a6df6bd21bd2da3a334fb", size = 581839, upload-time = "2026-05-28T12:01:48.109Z" },
+ { url = "https://files.pythonhosted.org/packages/15/2d/ce1f605fe036aadd460e5822e578c6c7ec3a860936cca37d6e0f299daa77/rpds_py-2026.5.1-cp315-cp315t-win32.whl", hash = "sha256:75808f6c38ce7749bb68cc2770161aae5045e6c6f6781a9782e74b93304399df", size = 207866, upload-time = "2026-05-28T12:01:49.648Z" },
+ { url = "https://files.pythonhosted.org/packages/79/cb/966040123eb102371559746908ef2c9471f4d43e17ec9a645a2258dab64b/rpds_py-2026.5.1-cp315-cp315t-win_amd64.whl", hash = "sha256:90bd6630002a1c7f09e7843dd79f0d24f3d2897cc25a753480917865d14f15b3", size = 225441, upload-time = "2026-05-28T12:01:51.408Z" },
+]
+
+[[package]]
+name = "shellingham"
+version = "1.5.4"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" },
+]
+
+[[package]]
+name = "sniffio"
+version = "1.3.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" },
+]
+
+[[package]]
+name = "tiktoken"
+version = "0.13.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "regex" },
+ { name = "requests" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/e4/e5/5f3cb2159769d0f4324c0e9e87f9de3c4b1cd45848a96b2eb3566ad5ca77/tiktoken-0.13.0.tar.gz", hash = "sha256:c9435714c3a84c2319499de9a300c0e604449dd0799ff246458b3bb6a7f433c1", size = 38986, upload-time = "2026-05-15T04:51:27.153Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/85/8e/144bde4e01df66b34bb865557c7cd754ed08b036217ebd79c9db5e9048a9/tiktoken-0.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:32ac870a806cfb260a02d0cb70426aef02e038297f8ad50df5040bb5af360791", size = 1034888, upload-time = "2026-05-15T04:50:31.579Z" },
+ { url = "https://files.pythonhosted.org/packages/36/18/d4ac9d20956cdebca04841316660ed584c2fecdc2b81722a28bc7ad3b1e4/tiktoken-0.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4d9980f11429ed2d737c463bb1fb78cf330caa026adf002f714aced7849a687b", size = 982970, upload-time = "2026-05-15T04:50:32.961Z" },
+ { url = "https://files.pythonhosted.org/packages/74/ed/6bb8d05b9f731f749fee5c6f5ca63e981143c826a5985877330507bd13b7/tiktoken-0.13.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:3f277ebea5edd7b8bf03c6f9431e1d67d517530115572b2dc1d465326e8f88c7", size = 1115741, upload-time = "2026-05-15T04:50:34.475Z" },
+ { url = "https://files.pythonhosted.org/packages/34/de/2ca96b07a82d972b74fe4b46de055b79c904e45c7eab699354a0bfa697dc/tiktoken-0.13.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:a116178fa7e1b4065bff05214360373a65cac22f965be7b3f73d00a0dbfe7649", size = 1136523, upload-time = "2026-05-15T04:50:35.782Z" },
+ { url = "https://files.pythonhosted.org/packages/ee/dc/9dafec002c2d4424378563cf4cf5c7fb93631d2a55013c8b87554ee4012c/tiktoken-0.13.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2c397ddda233208345b01bd30f2fca79ff730e55731d0108a603f9bc57f6af3b", size = 1181954, upload-time = "2026-05-15T04:50:36.99Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/d0/1f8578c45b2f24759b46f0b50d31878c63c73e6bf0f2227e10ec5c5408dc/tiktoken-0.13.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:95097e4f89b06403976e498abf61a0ee73a7497e73fb599cb211d8197a054d91", size = 1240069, upload-time = "2026-05-15T04:50:38.221Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/90/28d7f154888610aa9237e541986beb62b479df29d193a5a0617dbb1514d0/tiktoken-0.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:8f2d16e7a7c783ad81f36e457d046d1f1c8af70b22aec8a13238efe531977c41", size = 874748, upload-time = "2026-05-15T04:50:39.587Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/83/b096c859c2a47c11731bf2f5885f4028b809dfe2396582883eed9cae372f/tiktoken-0.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5df5d1507bd245f1ccad4a074698240021239e455eb0bb4ced4e3d7181872154", size = 1034228, upload-time = "2026-05-15T04:50:40.988Z" },
+ { url = "https://files.pythonhosted.org/packages/53/61/c68e123b6d753e3fc2751e9b18e732c9d8bf1e1926762e736eee935d931c/tiktoken-0.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8fe806a50664e83a6ffd56cbd1e4f5dcc6cd32a3e7538f70dc38b1a271384545", size = 982978, upload-time = "2026-05-15T04:50:42.195Z" },
+ { url = "https://files.pythonhosted.org/packages/ef/8b/96cc178cc584e65d363134500f297790b06cd48cdeb1e8fcf7bbe60f4715/tiktoken-0.13.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:125bc05005e747f993a83dc67934249932d6e4209854452cd4c0b1d53fba3ba2", size = 1116355, upload-time = "2026-05-15T04:50:43.564Z" },
+ { url = "https://files.pythonhosted.org/packages/86/f5/bab735d2c72ea55404b295d02d092644eb5f7cc6205e34d35eb9abfb9ab2/tiktoken-0.13.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:5e6358911cab4adee6712da27d65573496a4f68cf8a2b5fca6a4ad10fc5748cf", size = 1135772, upload-time = "2026-05-15T04:50:44.782Z" },
+ { url = "https://files.pythonhosted.org/packages/4e/b9/6de04ebdf904edfaad87788011b3735087a0c9ea671b9027e1e4e965e8c8/tiktoken-0.13.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:975cbd78d085d75d26b59660e262736dcaed1e35f8f142cd6291025c01d25486", size = 1182415, upload-time = "2026-05-15T04:50:46.422Z" },
+ { url = "https://files.pythonhosted.org/packages/0d/9c/470a05f3b1caf038f44880e334d47ab674e0c80d514c66b375d14d5afa10/tiktoken-0.13.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:75ab9bc99fa020a4c283424590ecd7f3afd70c1c281cb3fa3192a6c3af9f9615", size = 1239879, upload-time = "2026-05-15T04:50:48.052Z" },
+ { url = "https://files.pythonhosted.org/packages/42/a6/c1936d16055436cb32e6c6128d68629622e00f4768562f55653752d34768/tiktoken-0.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:6b1615f0ff71953d19729ceb18865429c185b0a23c5353f1bbca34a394bf60f7", size = 874829, upload-time = "2026-05-15T04:50:49.202Z" },
+ { url = "https://files.pythonhosted.org/packages/d6/07/acb5992c3772b5a36284f742cfb7a5895aa4471d1848ac31464ad50d7fdf/tiktoken-0.13.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6eb4a5bfbc6426938026b1a334e898ac53541360d62d8c689870160cc80abd67", size = 1033600, upload-time = "2026-05-15T04:50:50.4Z" },
+ { url = "https://files.pythonhosted.org/packages/14/e9/742e9aec30f59b9f161f7ff7cd072e02ea836c9e1c0854a8076dfcd40d5c/tiktoken-0.13.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:43cee3e5400573b2046fbf092cc7a5bc30164f9e4c95ce20714da929df48737a", size = 982516, upload-time = "2026-05-15T04:50:52.03Z" },
+ { url = "https://files.pythonhosted.org/packages/72/74/ca1541b053e7648254d2e4b42a253e1bb4359f2c91a0a8d49228c794e1a0/tiktoken-0.13.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:7de52e3f566d19b3b11bd37eea552c6c305ad74081f736882bd44d148ed4c48d", size = 1115518, upload-time = "2026-05-15T04:50:53.543Z" },
+ { url = "https://files.pythonhosted.org/packages/46/e3/93825eaf5a4a504795b787e5d5dea07fbeb3dabf97aa7b450be8bde59c89/tiktoken-0.13.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:51384448aa508e4df84c0f7c1dc3211c7f7b8096325660ee5fc82f3e11b381ce", size = 1136867, upload-time = "2026-05-15T04:50:55.191Z" },
+ { url = "https://files.pythonhosted.org/packages/8c/46/002b68de6827091d5ae90b048f326e8aad8d953520950e5ce1508879414f/tiktoken-0.13.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:e28157350f7ebf35008dd8e9e0fdb621f976e4230c881099c85e8cf07eaa50e2", size = 1181826, upload-time = "2026-05-15T04:50:56.296Z" },
+ { url = "https://files.pythonhosted.org/packages/db/c6/d393e3185a276505182f7abd93fe714f3c444a2be9180798fa052347504e/tiktoken-0.13.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:165cf1820ea4a354985c2490a5205d4cc74661c934aca79dd0368232fff94e0f", size = 1239489, upload-time = "2026-05-15T04:50:57.918Z" },
+ { url = "https://files.pythonhosted.org/packages/b7/4d/bc07d1f1635d4897a202acc0ae11c2886eaa7325c359ba4741b47bf8e225/tiktoken-0.13.0-cp313-cp313t-win_amd64.whl", hash = "sha256:6c43a675ca14f6f2749ba7f12075d37456015a24b859f2517b9beb4ef30807ec", size = 873820, upload-time = "2026-05-15T04:50:59.528Z" },
+ { url = "https://files.pythonhosted.org/packages/8c/93/0dd6adca026a616c3a92974566b43381eea4b475ce1f36c062b8271a9ac5/tiktoken-0.13.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaaaef47c2406277181d2086484c317bf7fc433e2d5d03ff94f56b0dcec87471", size = 1034977, upload-time = "2026-05-15T04:51:00.957Z" },
+ { url = "https://files.pythonhosted.org/packages/d9/77/5ec6e6bc5b30bed6d93f7f2162d8f6b32437b3ba27cb527cfe004f6109c9/tiktoken-0.13.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ca8b310bd93b3772cb1b7922d915446864860f562bdfe4825c63a0aed3fb28cd", size = 983635, upload-time = "2026-05-15T04:51:02.629Z" },
+ { url = "https://files.pythonhosted.org/packages/94/b0/c8ae9aff00d625c50659b4513e707a0462c4bf5d4d6cc1b802103225c02e/tiktoken-0.13.0-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:32e0c12305105002c047b3bb1070b0dd9a73b0cb3b2856a8972b810e7a4f5881", size = 1116036, upload-time = "2026-05-15T04:51:04.082Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/ac/6a5dddd1d0a6018ecb389bd0353e6b4a515eb4d2286611bd0ace1937b9e1/tiktoken-0.13.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:5ba5fd62507a932d1241346179e3b39bc7bf7408f03c272652d93b3bedf5db24", size = 1135544, upload-time = "2026-05-15T04:51:05.229Z" },
+ { url = "https://files.pythonhosted.org/packages/f4/b8/585032b4384b2f7dcdaddcb52865c83a701a420d09e3c2b4a2be1c450c57/tiktoken-0.13.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d108bc2d470fc53c8ecd24f2c0fd2b5f98c33e87cdb6aa2e9b8c5dced703d273", size = 1182217, upload-time = "2026-05-15T04:51:06.517Z" },
+ { url = "https://files.pythonhosted.org/packages/cd/b6/993ff1ded3958215fd341a847b8e5ffeb5de473f435296870d314fc91ac4/tiktoken-0.13.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:cb99cb5127449f58d0a2d5f5ccfb390d8dbdfd919c221246caaee29d8725ed51", size = 1239404, upload-time = "2026-05-15T04:51:07.843Z" },
+ { url = "https://files.pythonhosted.org/packages/dd/3d/fef7e06e3b33e7538db0ced734cf9fe23b6832d2ac4990c119c377aec55e/tiktoken-0.13.0-cp314-cp314-win_amd64.whl", hash = "sha256:115c4f26ffa11caac8b54eea35c2ad38c612c20a48d35dd15d70a02ac6f51f58", size = 918686, upload-time = "2026-05-15T04:51:08.925Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/82/a7fc44582bc32ab00de988a2299bf77c077f59068b233109e34b7d6ca7e6/tiktoken-0.13.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:472527e9132952f2fbf77cd290658bacf003d4d5a3fabc18e5fbd407cbae4d9b", size = 1034454, upload-time = "2026-05-15T04:51:10.035Z" },
+ { url = "https://files.pythonhosted.org/packages/37/d0/24d8a890c14f432a05cea669c17bebeaa99f96a7c79523b590f564246411/tiktoken-0.13.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:4e2f67d27c9626cdd25fe33d9313c5cdb3d8d82da646b68d6eb8e7e9c20e6448", size = 982976, upload-time = "2026-05-15T04:51:11.23Z" },
+ { url = "https://files.pythonhosted.org/packages/49/b7/2ab43f62788a9266187a9bfc1d3af99ad83e5eaa25fbef168a69cd5ad14f/tiktoken-0.13.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:2b920b35805cd64585a37c3dc7ce65fba4d2d36016be01e1d7942482ca29093a", size = 1115526, upload-time = "2026-05-15T04:51:12.608Z" },
+ { url = "https://files.pythonhosted.org/packages/64/39/1494321ed323ce7a14d88e3cd6cb9058625977df1c6961ddc492bd10a9f3/tiktoken-0.13.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:493af3aa28a4aaf2e3d2600a2ee717252c9bf5ab38fff94eb5a02db5ab77e5ad", size = 1136466, upload-time = "2026-05-15T04:51:13.926Z" },
+ { url = "https://files.pythonhosted.org/packages/96/d9/dfd086aa2d918c563a140720e0ce296cada1634efd2783d5cf51e05f984e/tiktoken-0.13.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:6644c9c2b5cf3916f5a3641d7d12fdb3f006a7b3d9ff6acdaec44e29ab1ff91e", size = 1181863, upload-time = "2026-05-15T04:51:15.025Z" },
+ { url = "https://files.pythonhosted.org/packages/2f/68/a18b4f307086954fdae32714cb4f85562e34f9d34ab206e61f1816aa6018/tiktoken-0.13.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5cb65b60b9408563676d874a3a4ee573370066f0dc4e29d84e82e989c6517424", size = 1239218, upload-time = "2026-05-15T04:51:16.103Z" },
+ { url = "https://files.pythonhosted.org/packages/16/5b/f2aa703a4fc5d2dff73460a7d46cc2f3f44aa0f3dd8eeb20d2a0ecf68862/tiktoken-0.13.0-cp314-cp314t-win_amd64.whl", hash = "sha256:85b78cc3a2c3d48723ca751fa981f1fedccd54194ca0471b957364353a898b07", size = 918110, upload-time = "2026-05-15T04:51:17.237Z" },
+]
+
+[[package]]
+name = "tokenizers"
+version = "0.23.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "huggingface-hub" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/c1/60/21f715d9faba5f5407ff759472ade058ec4a507ad62bcea47cb847239a73/tokenizers-0.23.1.tar.gz", hash = "sha256:1feeeadf865a7915adc25445dea30e9933e593c31bb96c277cee36de227c8bfa", size = 365748, upload-time = "2026-04-27T14:43:25.606Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/87/39/b87a87d5bb9470610b80a2d31df42fcffeaf35118b8b97952b2aff598cc7/tokenizers-0.23.1-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:e03d6ffcbe0d56ee9c1ccd070e70a13fa750727c0277e138152acbc0252c2224", size = 3146732, upload-time = "2026-04-27T14:43:15.427Z" },
+ { url = "https://files.pythonhosted.org/packages/e2/6a/068ed9f6e444c9d7e9d55ce134181325700f3d7f30410721bdc8f848d727/tokenizers-0.23.1-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:e0948bbb1ac1d7cdfc9fb6d62c596e3b7550036ad60ecd654a66ad273326324e", size = 3054954, upload-time = "2026-04-27T14:43:13.745Z" },
+ { url = "https://files.pythonhosted.org/packages/6c/36/e006edf031154cba92b8416057d92c3abe3635e4c4b0aa0b5b9bb39dde70/tokenizers-0.23.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bf13402aff9bc533c89cb849ec3b412dc3fbeacc9744840e423d7bf3f7dc0e3", size = 3374081, upload-time = "2026-04-27T14:43:01.241Z" },
+ { url = "https://files.pythonhosted.org/packages/a2/ef/7735d226f9c7f874a6bee5e3f27fb25ecabdf207d37b8cf45286d0795893/tokenizers-0.23.1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f836ca703b89ae07919a309f9651f7a88fd5a33d5f718ba5ad0870ec0256bad6", size = 3247641, upload-time = "2026-04-27T14:43:03.856Z" },
+ { url = "https://files.pythonhosted.org/packages/b9/d9/24827036f6e21297bfffda0768e58eb6096a4f411e932964a01707857931/tokenizers-0.23.1-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae848657742035523fdf261773630cb819a26995fcd3d9ecae0c1daf6e5a4959", size = 3585624, upload-time = "2026-04-27T14:43:10.664Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/9a/22f3582b3a4f49358293a5206e25317621ee4526bfe9cdaa0f07a12e770e/tokenizers-0.23.1-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:53b09e85775d5187941e7bab30e941b4134ab4a7dd8c68e783d231fb7ca27c51", size = 3844062, upload-time = "2026-04-27T14:43:05.643Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/65/b8f8814eef95800f20721384136d9a1d22241d50b2874357cb70542c392f/tokenizers-0.23.1-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ea5a0ce170074329faaa8ea3f6400ecde604b6678192688533af80980daae71a", size = 3460098, upload-time = "2026-04-27T14:43:08.854Z" },
+ { url = "https://files.pythonhosted.org/packages/0d/d5/1353e5f677ec27c2494fb6a6725e82d56c985f53e90ec511369e7e4f02c6/tokenizers-0.23.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5075b405006415ea148a992d093699c66eb01952bf59f4d5727089a98bda45a4", size = 3346235, upload-time = "2026-04-27T14:43:12.377Z" },
+ { url = "https://files.pythonhosted.org/packages/71/89/39b6b8fc073fb6d413d0147aa333dc7eff7be65639ac9d19930a0b21bf33/tokenizers-0.23.1-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:56f3a77de629917652f876294dc9fe6bad4a0c43bc229dc72e59bb23a0f4729a", size = 3426398, upload-time = "2026-04-27T14:43:07.264Z" },
+ { url = "https://files.pythonhosted.org/packages/0f/80/127c854da64827e5b79264ce524993a90dddcb320e5cd42412c5c02f9e8a/tokenizers-0.23.1-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9d10a6d957ef01896dc274e890eee27d41bd0e74ef31e60616f0fc311345184e", size = 9823279, upload-time = "2026-04-27T14:43:17.222Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/ba/44c2502feb1a058f096ddfb4e0996ef3225a01a388e1a9b094e91689fe93/tokenizers-0.23.1-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:1974288a609c343774f1b897c8b482c791ab17b75ab5c8c2b1737565c1d82288", size = 9644986, upload-time = "2026-04-27T14:43:19.45Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/c1/464019a9fb059870bfe4eebb4ba12208f3042035e258bf5e782906bd3847/tokenizers-0.23.1-cp310-abi3-musllinux_1_2_i686.whl", hash = "sha256:120468fb4c24faf0543c835a4fabafa4deb3f20a035c9b6e83d0b553a97615d4", size = 9976181, upload-time = "2026-04-27T14:43:21.463Z" },
+ { url = "https://files.pythonhosted.org/packages/79/94/3ac1432bda31626071e9b6a12709b97ae05131c804b94c8f3ac622c5da32/tokenizers-0.23.1-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e3d8f40ea6268047de7046906326abed5134f27d4e8447b23763afe5808c8a96", size = 10113853, upload-time = "2026-04-27T14:43:23.617Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/dd/631b21433c771b1382535326f0eca80b9c9cee2e64961dd993bc9ac4669e/tokenizers-0.23.1-cp310-abi3-win32.whl", hash = "sha256:93120a930b919416da7cd10a2f606ac9919cc69cacae7980fa2140e277660948", size = 2536263, upload-time = "2026-04-27T14:43:29.888Z" },
+ { url = "https://files.pythonhosted.org/packages/97/c9/2553f72aaf65a2797d4229e37fa7fbe38ffbf3e32912d31bdd78b3323e59/tokenizers-0.23.1-cp310-abi3-win_amd64.whl", hash = "sha256:e7bfaf995c1bdbbd21d13539decb6650967013759318627d85daeb7881af16b7", size = 2798223, upload-time = "2026-04-27T14:43:28.51Z" },
+ { url = "https://files.pythonhosted.org/packages/cd/2b/2be299bab55fc595e3d38567edb1a87f86e594842968fa9515a07bdcf422/tokenizers-0.23.1-cp310-abi3-win_arm64.whl", hash = "sha256:a26197957d8e4425dfba746315f3c425ea00cfa8367c5fbc4ec73447893dcea9", size = 2664127, upload-time = "2026-04-27T14:43:26.949Z" },
+]
+
+[[package]]
+name = "tqdm"
+version = "4.67.3"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "colorama", marker = "sys_platform == 'win32'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/09/a9/6ba95a270c6f1fbcd8dac228323f2777d886cb206987444e4bce66338dd4/tqdm-4.67.3.tar.gz", hash = "sha256:7d825f03f89244ef73f1d4ce193cb1774a8179fd96f31d7e1dcde62092b960bb", size = 169598, upload-time = "2026-02-03T17:35:53.048Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/16/e1/3079a9ff9b8e11b846c6ac5c8b5bfb7ff225eee721825310c91b3b50304f/tqdm-4.67.3-py3-none-any.whl", hash = "sha256:ee1e4c0e59148062281c49d80b25b67771a127c85fc9676d3be5f243206826bf", size = 78374, upload-time = "2026-02-03T17:35:50.982Z" },
+]
+
+[[package]]
+name = "typer"
+version = "0.25.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "annotated-doc" },
+ { name = "click" },
+ { name = "rich" },
+ { name = "shellingham" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/e4/51/9aed62104cea109b820bbd6c14245af756112017d309da813ef107d42e7e/typer-0.25.1.tar.gz", hash = "sha256:9616eb8853a09ffeabab1698952f33c6f29ffdbceb4eaeecf571880e8d7664cc", size = 122276, upload-time = "2026-04-30T19:32:16.964Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/3f/f9/2b3ff4e56e5fa7debfaf9eb135d0da96f3e9a1d5b27222223c7296336e5f/typer-0.25.1-py3-none-any.whl", hash = "sha256:75caa44ed46a03fb2dab8808753ffacdbfea88495e74c85a28c5eefcf5f39c89", size = 58409, upload-time = "2026-04-30T19:32:18.271Z" },
+]
+
+[[package]]
+name = "typing-extensions"
+version = "4.15.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
+]
+
+[[package]]
+name = "typing-inspection"
+version = "0.4.2"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "typing-extensions" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" },
+]
+
+[[package]]
+name = "urllib3"
+version = "2.7.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" },
+]
+
+[[package]]
+name = "yarl"
+version = "1.24.2"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "idna" },
+ { name = "multidict" },
+ { name = "propcache" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/79/12/1e8f37460ea0f7eb59c221fdaf0ed75e7ac43e97f8093b9c6f411df50a78/yarl-1.24.2.tar.gz", hash = "sha256:9ac374123c6fd7abf64d1fec93962b0bd4ee2c19751755a762a72dd96c0378f8", size = 210798, upload-time = "2026-05-19T21:31:05.599Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/f0/da/866bcb01076ba49d2b42b309867bed3826421f1c479655eb7a607b44f20b/yarl-1.24.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b975866c184564c827e0877380f0dae57dcca7e52782128381b72feff6dfceb8", size = 129957, upload-time = "2026-05-19T21:28:51.695Z" },
+ { url = "https://files.pythonhosted.org/packages/bf/1d/fcefb70922ea2268a8971d8e5874d9a8218644200fb8465f1dcad55e6851/yarl-1.24.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3b075301a2836a0e297b1b658cb6d6135df535d62efefdd60366bd589c2c82f2", size = 92164, upload-time = "2026-05-19T21:28:53.242Z" },
+ { url = "https://files.pythonhosted.org/packages/29/b6/170e2b8d4e3bc30e6bfdcca53556537f5bf595e938632dfcb059311f3ff6/yarl-1.24.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8ae44649b00947634ab0dab2a374a638f52923a6e67083f2c156cd5cbd1a881d", size = 91688, upload-time = "2026-05-19T21:28:54.865Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/a5/c9f655d5553ea0b99fdac9d6a99ad3f9b3e73b8e5758bb46f58c9831f74c/yarl-1.24.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:507cc19f0b45454e2d6dcd62ff7d062b9f77a2812404e62dbdaec05b50faa035", size = 102902, upload-time = "2026-05-19T21:28:56.963Z" },
+ { url = "https://files.pythonhosted.org/packages/5d/bc/6b9664d815d79af4ee553337f9d606c56bbf269186ada9172de45f1b5f60/yarl-1.24.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c4c17bad5a530912d2111825d3f05e89bab2dd376aaa8cbc77e449e6db63e576", size = 97931, upload-time = "2026-05-19T21:28:58.56Z" },
+ { url = "https://files.pythonhosted.org/packages/98/ec/32ba48acae30fecd60928f5791188b80a9d6ee3840507ffda29fecd37b71/yarl-1.24.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f5f0cbb112838a4a293985b6ed73948a547dadcc1ba6d2089938e7abdedceef8", size = 111030, upload-time = "2026-05-19T21:29:00.148Z" },
+ { url = "https://files.pythonhosted.org/packages/82/5a/6f4cd081e5f4934d2ae3a8ef4abe3afacc010d26f0035ee91b35cd7d7c37/yarl-1.24.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5ec8356b8a6afcf81fc7aeeef13b1ff7a49dec00f313394bbb9e83830d32ccd7", size = 110392, upload-time = "2026-05-19T21:29:02.155Z" },
+ { url = "https://files.pythonhosted.org/packages/7a/da/323a01c349bd5fb01bb6652e314d9bb218cee630a736bdb810ad50e4013f/yarl-1.24.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7e7ebcdef69dec6c6451e616f32b622a6d4a2e92b445c992f7c8e5274a6bbc4c", size = 105612, upload-time = "2026-05-19T21:29:04.247Z" },
+ { url = "https://files.pythonhosted.org/packages/7c/80/264ab684f181e1a876389374519ff05d10248725535ae2ac4e8ac4e563d6/yarl-1.24.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:47a55d6cf6db2f401017a9e96e5288844e5051911fb4e0c8311a3980f5e59a7d", size = 104487, upload-time = "2026-05-19T21:29:06.491Z" },
+ { url = "https://files.pythonhosted.org/packages/41/07/efabe5df87e96d7ad5959760b888344be48cd6884db127b407c6b5503adc/yarl-1.24.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3065657c80a2321225e804048597ad55658a7e76b32d6f5ee4074d04c50401db", size = 102333, upload-time = "2026-05-19T21:29:08.267Z" },
+ { url = "https://files.pythonhosted.org/packages/44/0c/bcf7c42603e1009295f586d8890f2ba032c8b53310e815adf0a202c73d9f/yarl-1.24.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:cb84b80d88e19ede158619b80813968713d8d008b0e2497a576e6a0557d50712", size = 99025, upload-time = "2026-05-19T21:29:10.682Z" },
+ { url = "https://files.pythonhosted.org/packages/4f/82/84482ab1a57a0f21a08afe6a7004c61d741f8f2ecc3b05c321577c612164/yarl-1.24.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:990de4f680b1c217e77ff0d6aa0029f9eb79889c11fb3e9a3942c7eba29c1996", size = 110507, upload-time = "2026-05-19T21:29:12.954Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/8d/a546ba1dfe1b0f290e05fef145cd07614c0f15df1a707195e512d1e39d1d/yarl-1.24.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:abb8ec0323b80161e3802da3150ef660b41d0e9be2048b76a363d93eee992c2b", size = 103719, upload-time = "2026-05-19T21:29:14.893Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/b6/267f2a09213138473adfce6b8a6e17791d7fee70bd4d9003218e4dec58b0/yarl-1.24.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e7977781f83638a4c73e0f88425563d70173e0dfd90ac006a45c65036293ee3c", size = 110438, upload-time = "2026-05-19T21:29:16.485Z" },
+ { url = "https://files.pythonhosted.org/packages/48/2d/1c8d89c7c5f9cad9fb2902445d94e2ab1d7aa35de029afbb8ae95c42d00f/yarl-1.24.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e30dd55825dc554ec5b66a94953b8eda8745926514c5089dfcacecb9c99b5bd1", size = 105719, upload-time = "2026-05-19T21:29:18.367Z" },
+ { url = "https://files.pythonhosted.org/packages/a7/25/722e3b93bd687009afb2d59a35e13d30ddd8f80571445bb0c4e4ce26ec66/yarl-1.24.2-cp312-cp312-win_amd64.whl", hash = "sha256:7dafe10c12ddd4d120d528c4b5599c953bd7b12845347d507b95451195bb6cad", size = 92901, upload-time = "2026-05-19T21:29:20.014Z" },
+ { url = "https://files.pythonhosted.org/packages/39/47/4486ccfb674c04854a1ef8aa77868b6a6f765feaf69633409d7ca4f02cb8/yarl-1.24.2-cp312-cp312-win_arm64.whl", hash = "sha256:044a09d8401fcf8681977faef6d286b8ade1e2d2e9dceda175d1cfa5ca496f30", size = 87229, upload-time = "2026-05-19T21:29:22.1Z" },
+ { url = "https://files.pythonhosted.org/packages/82/62/fcf0ce677f17e5c471c06311dd25964be38a4c586993632910d2e75278bc/yarl-1.24.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:491ac9141decf49ee8030199e1ee251cdff0e131f25678817ff6aa5f837a3536", size = 128978, upload-time = "2026-05-19T21:29:23.83Z" },
+ { url = "https://files.pythonhosted.org/packages/d3/58/8e63299bb71ed61a834121d9d3fe6c9fcf2a6a5d09754ff4f20f2d20baf5/yarl-1.24.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e89418f65eda18f99030386305bd44d7d504e328a7945db1ead514fbe03a0607", size = 91733, upload-time = "2026-05-19T21:29:25.375Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/24/16748d5dab6daec8b0ed81ccec639a1cded0f18dcc62a4f696b4fe366c37/yarl-1.24.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cdfcce633b4a4bb8281913c57fcafd4b5933fbc19111a5e3930bbd299d6102f1", size = 91113, upload-time = "2026-05-19T21:29:26.928Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/66/b63fff7b71211e866624b21432d5943cbb633eb0c2872d9ee3070648f22c/yarl-1.24.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:863297ddede92ee49024e9a9b11ecb59f310ca85b60d8537f56bed9bbb5b1986", size = 103899, upload-time = "2026-05-19T21:29:28.842Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/ac/ba1974b8533909636f7733fe86cf677e3619527c3c2fa913e0ea89c48757/yarl-1.24.2-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:374423f70754a2c96942ede36a29d37dc6b0cb8f92f8d009ddf3ed78d3da5488", size = 97862, upload-time = "2026-05-19T21:29:31.086Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/a5/123ac993b5c2ba6f554a140305620cb8f150fa543711bbc49be3ec0a65a4/yarl-1.24.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:33a29b5d00ccbf3219bb3e351d7875739c19481e030779f48cc46a7a71681a9b", size = 111060, upload-time = "2026-05-19T21:29:32.657Z" },
+ { url = "https://files.pythonhosted.org/packages/23/37/c472d3af3509688392134a88a825276770a187f1daa4de3f6dc0a327a751/yarl-1.24.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a9532c57211730c515341af11fef6e9b61d157487272a096d0c04da445642592", size = 110613, upload-time = "2026-05-19T21:29:34.379Z" },
+ { url = "https://files.pythonhosted.org/packages/df/88/09c28dad91e662ccfaa1b78f1c57badde74fc9d0b23e74aef644750ecd73/yarl-1.24.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:91e72cf093fd833483a97ee648e0c053c7c629f51ff4a0e7edd84f806b0c5617", size = 107012, upload-time = "2026-05-19T21:29:36.216Z" },
+ { url = "https://files.pythonhosted.org/packages/07/ab/9d4f69d571a94f4d112fa7e2e007200f5a54d319f58c82ac7b7baa61f5c6/yarl-1.24.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b3177bc0a768ef3bacceb4f272632990b7bea352f1b2f1eee9d6d6ff16516f92", size = 105887, upload-time = "2026-05-19T21:29:38.746Z" },
+ { url = "https://files.pythonhosted.org/packages/8e/9a/000b2b66c0d772a499fc531d21dab92dfeb73b640a12eed6ba89f49bb2d0/yarl-1.24.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e196952aacaf3b232e265ff02980b64d483dc0972bd49bcb061171ff22ac203a", size = 103620, upload-time = "2026-05-19T21:29:40.368Z" },
+ { url = "https://files.pythonhosted.org/packages/41/7c/7c1050f73450fbdaa3f0c72017059f00ce5e13366692f3dba25275a1083d/yarl-1.24.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:204e7a61ce99919c0de1bf904ab5d7aa188a129ea8f690a8f76cfb6e2844dc44", size = 100599, upload-time = "2026-05-19T21:29:42.66Z" },
+ { url = "https://files.pythonhosted.org/packages/ec/b1/29e5756b3926705f5f6089bd5b9f50a56eaac550da6e260bf713ead44d04/yarl-1.24.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b156914620f0b9d78dc1adb3751141daee561cfec796088abb89ed49d220f1a", size = 110604, upload-time = "2026-05-19T21:29:44.632Z" },
+ { url = "https://files.pythonhosted.org/packages/a3/4b/8415bc96e9b150cde942fbac9a8182985e58f40ce5c54c34ed015407d3ee/yarl-1.24.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:8372a2b976cf70654b2be6619ab6068acabb35f724c0fda7b277fbf53d66a5cf", size = 105161, upload-time = "2026-05-19T21:29:46.755Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/d4/cde059abfa229553b7298a2eadde2752e723d50aeedaef86ce59da2718ee/yarl-1.24.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:f9a1e9b622ca284143aab5d885848686dcd85453bb1ca9abcdb7503e64dc0056", size = 110619, upload-time = "2026-05-19T21:29:48.972Z" },
+ { url = "https://files.pythonhosted.org/packages/e7/2c/d6a6c9a61549f7b6c7e6dc6937d195bcf069582b47b7200dcd0e7b256acf/yarl-1.24.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:810e19b685c8c3c5862f6a38160a1f4e4c0916c9390024ec347b6157a45a0992", size = 107362, upload-time = "2026-05-19T21:29:51Z" },
+ { url = "https://files.pythonhosted.org/packages/92/dd/3ae5fe417e9d1c353a548553326eb9935e76b6b727161563b424cc296df3/yarl-1.24.2-cp313-cp313-win_amd64.whl", hash = "sha256:7d37fb7c38f2b6edab0f845c4f85148d4c44204f52bc127021bd2bc9fdbf1656", size = 92667, upload-time = "2026-05-19T21:29:52.743Z" },
+ { url = "https://files.pythonhosted.org/packages/10/cc/a7beb239f78f27fca1b053c8e8595e4179c02e62249b4687ec218c370c50/yarl-1.24.2-cp313-cp313-win_arm64.whl", hash = "sha256:1e831894be7c2954240e49791fa4b50c05a0dc881de2552cfe3ffd8631c7f461", size = 87069, upload-time = "2026-05-19T21:29:54.442Z" },
+ { url = "https://files.pythonhosted.org/packages/40/0e/e08087695fc12789263821c5dc0f8dc52b5b17efd0887cacf419f8a43ba3/yarl-1.24.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:f9312b3c02d9b3d23840f67952913c9c8721d7f1b7db305289faefa878f364c2", size = 129670, upload-time = "2026-05-19T21:29:56.631Z" },
+ { url = "https://files.pythonhosted.org/packages/3a/98/ab4b5ed1b1b5cd973c8a3eb994c3a6aefb6ce6d399e21bb5f0316c33815c/yarl-1.24.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a4f4d6cd615823bfc7fb7e9b5987c3f41666371d870d51058f77e2680fbe9630", size = 91916, upload-time = "2026-05-19T21:29:58.645Z" },
+ { url = "https://files.pythonhosted.org/packages/ba/b1/5297bb6a7df4782f7605bffc43b31f5044070935fbbcaa6c705a07e6ac65/yarl-1.24.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0c3063e5c0a8e8e62fae6c2596fa01da1561e4cd1da6fec5789f5cf99a8aefd8", size = 91625, upload-time = "2026-05-19T21:30:00.412Z" },
+ { url = "https://files.pythonhosted.org/packages/02/a7/45baabfff76829264e623b185cff0c340d7e11bf3e1cd9ea37e7d17934bd/yarl-1.24.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fecd17873a096036c1c87ab3486f1aef7f269ada7f23f7f856f93b1cc7744f14", size = 104574, upload-time = "2026-05-19T21:30:02.544Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/40/3a5ab144d3d650ca37d4f4b57e56169be8af3ca34c448793e064b30baaed/yarl-1.24.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a46d1ab4ba4d32e6dc80daf8a28ce0bd83d08df52fbc32f3e288663427734535", size = 97534, upload-time = "2026-05-19T21:30:04.319Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/b5/5658fef3681fb5776b4513b052bec750009f47b3a592251c705d75375798/yarl-1.24.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:73e68edf6dfd5f73f9ca127d84e2a6f9213c65bdffb736bda19524c0564fcd14", size = 111481, upload-time = "2026-05-19T21:30:05.988Z" },
+ { url = "https://files.pythonhosted.org/packages/4c/06/fdcd7dde037f00866dce123ed4ba23dba94beb56fc4cf561668d27be37f2/yarl-1.24.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a296ca617f2d25fbceafb962b88750d627e5984e75732c712154d058ae8d79a3", size = 111529, upload-time = "2026-05-19T21:30:07.738Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/53/d81269aaafccea0d33396c03035de997b743f11e648e6e27a0df99c72980/yarl-1.24.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e51b2cf5ec89a8b8470177641ed62a3ba22d74e1e898e06ad53aa77972487208", size = 107338, upload-time = "2026-05-19T21:30:09.713Z" },
+ { url = "https://files.pythonhosted.org/packages/ae/04/23049463f729bd899df203a7960505a75333edd499cda8aa1d5a82b64df5/yarl-1.24.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:310fc687f7b2044ec54e372c8cbe923bb88f5c37bded0d3079e5791c2fc3cf50", size = 106147, upload-time = "2026-05-19T21:30:11.365Z" },
+ { url = "https://files.pythonhosted.org/packages/14/18/04a4b5830b43ed5e4c5015b40e9f6241ad91487d71611061b4e111d6ac80/yarl-1.24.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:297a2fe352ecf858b30a98f87948746ec16f001d279f84aebdbd3bd965e2f1bd", size = 104272, upload-time = "2026-05-19T21:30:12.978Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/f7/8cffdf319aee7a7c1dbd07b61d91c3e3fda460c7a93b5f93e445f3806c4c/yarl-1.24.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:2a263e76b97bc42bdcd7c5f4953dec1f7cd62a1112fa7f869e57255229390d67", size = 99962, upload-time = "2026-05-19T21:30:15.001Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/39/b3cce3b7dbef64ac700ad4cea156a207d01bede0f507587616c364b5468e/yarl-1.24.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:822519b64cf0b474f1a0aaef1dc621438ea46bb77c94df97a5b4d213a7d8a8b1", size = 111063, upload-time = "2026-05-19T21:30:16.683Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/ea/100818505e7ebf165c7242ff17fdf7d9fee79e27234aeca871c1082920d7/yarl-1.24.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:b6067060d9dc594899ba83e6db6c48c68d1e494a6dab158156ed86977ca7bcb1", size = 105438, upload-time = "2026-05-19T21:30:18.769Z" },
+ { url = "https://files.pythonhosted.org/packages/8f/d2/e075a0b32aa6625087de9e653087df0759fed5de4a435fef594181102a77/yarl-1.24.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:0063adad533e57171b79db3943b229d40dfafeeee579767f96541f106bac5f1b", size = 111458, upload-time = "2026-05-19T21:30:21.024Z" },
+ { url = "https://files.pythonhosted.org/packages/e6/5c/ceea7ba98b65c8eb8d947fdc52f9bedfcd43c6a57c9e3c90c17be8f324a3/yarl-1.24.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ee8e3fb34513e8dc082b586ef4910c98335d43a6fab688cd44d4851bacfce3e8", size = 107589, upload-time = "2026-05-19T21:30:23.412Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/d9/5582d57e2b2db9b85eb6663a22efdd78e08805f3f5389566e9fcad254d1b/yarl-1.24.2-cp314-cp314-win_amd64.whl", hash = "sha256:afb00d7fd8e0f285ca29a44cc50df2d622ff2f7a6d933fa641577b5f9d5f3db0", size = 94424, upload-time = "2026-05-19T21:30:25.425Z" },
+ { url = "https://files.pythonhosted.org/packages/92/10/7dc07a0e22806a9280f42a57361395506e800c64e22737cd7b0886feab42/yarl-1.24.2-cp314-cp314-win_arm64.whl", hash = "sha256:68cf6eacd6028ef1142bc4b48376b81566385ca6f9e7dde3b0fa91be08ffcb57", size = 88690, upload-time = "2026-05-19T21:30:27.623Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/13/d5b8e2c8667db955bcb3de233f18798fefe7edf1d7429c2c9d4f9c401114/yarl-1.24.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:221ce1dd921ac4f603957f17d7c18c5cc0797fbb52f156941f92e04605d1d67b", size = 136248, upload-time = "2026-05-19T21:30:29.297Z" },
+ { url = "https://files.pythonhosted.org/packages/de/46/a4a97c05c9c9b8fd266bb2a0df12992c7fbd02391eb9640583411b6dab32/yarl-1.24.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5f3224db28173a00d7afacdee07045cc4673dfab2b15492c7ae10deddbece761", size = 95084, upload-time = "2026-05-19T21:30:31.031Z" },
+ { url = "https://files.pythonhosted.org/packages/95/b2/845cf2074a015e6fe0d0808cf1a2d9e868386c4220d657ebd8302b199043/yarl-1.24.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c557165320d6244ebe3a02431b2a201a20080e02f41f0cfa0ccc47a183765da8", size = 95272, upload-time = "2026-05-19T21:30:33.062Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/16/e69d4aa244aef45235ddfebc0e04036a6829842bc5a6a795aedc6c998d23/yarl-1.24.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:904065e6e85b1fa54d0d87438bd58c14c0bad97aad654ad1077fd9d87e8478ed", size = 101497, upload-time = "2026-05-19T21:30:34.842Z" },
+ { url = "https://files.pythonhosted.org/packages/15/94/c07107715d621076863ee88b3ddf183fa5e9d4aba5769623c9979828410a/yarl-1.24.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8cec2a38d70edc10e0e856ceda886af5327a017ccbde8e1de1bd44d300357543", size = 94002, upload-time = "2026-05-19T21:30:37.724Z" },
+ { url = "https://files.pythonhosted.org/packages/a9/35/fc1bbdd895b5e4010b8fdd037f7ed3aa289d3863e08231b30231ca9a0815/yarl-1.24.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e7484b9361ed222ee1ca5b4337aa4cbdcc4618ce5aff57d9ef1582fd95893fc0", size = 106524, upload-time = "2026-05-19T21:30:40.196Z" },
+ { url = "https://files.pythonhosted.org/packages/1f/f2/32b66d0a4ba47c296cf86d03e2c67bff58399fe6d6d84d5205c04c66cc6d/yarl-1.24.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:84f9670b89f34db07f81e53aee83e0b938a3412329d51c8f922488be7fcc4024", size = 106165, upload-time = "2026-05-19T21:30:41.888Z" },
+ { url = "https://files.pythonhosted.org/packages/95/47/37cb5ff50c5e825d4d38e81bb04d1b7e96bf960f7ab89f9850b162f3f114/yarl-1.24.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:abb2759733d63a28b4956500a5dd57140f26486c92b2caedfb964ab7d9b79dbf", size = 103010, upload-time = "2026-05-19T21:30:43.985Z" },
+ { url = "https://files.pythonhosted.org/packages/6f/d2/4597912315096f7bb359e46e13bf8b60994fcbb2db29b804c0902ef4eff5/yarl-1.24.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:081c2bf54efe03774d0311172bc04fedf9ca01e644d4cd8c805688e527209bdc", size = 101128, upload-time = "2026-05-19T21:30:46.291Z" },
+ { url = "https://files.pythonhosted.org/packages/b9/d5/c8e86e120521e646013d02a8e3b8884392e28494be8f392366e50d208efc/yarl-1.24.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:86746bef442aa479107fe28132e1277237f9c24c2f00b0b0cf22b3ee0904f2bb", size = 101382, upload-time = "2026-05-19T21:30:48.085Z" },
+ { url = "https://files.pythonhosted.org/packages/fa/98/70b229236118f89dbeb739b76f10225bbf53b5497725502594c9a01d699a/yarl-1.24.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:2d07d21d0bc4b17558e8de0b02fbfdf1e347d3bb3699edd00bb92e7c57925420", size = 95964, upload-time = "2026-05-19T21:30:49.785Z" },
+ { url = "https://files.pythonhosted.org/packages/87/f8/56c386981e3c8648d279fdef2397ffec577e8320fd5649745e34d54faeb7/yarl-1.24.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:4fb1ac3fc5fecd8ae7453ea237e4d22b49befa70266dfe1629924245c21a0c7f", size = 106204, upload-time = "2026-05-19T21:30:51.862Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/1e/765afe97811ca35933e2a7de70ac57b1997ea2e4ee895719ee7a231fb7e5/yarl-1.24.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:4da31a5512ed1729ca8d8aacde3f7faeb8843cde3165d6bcf7f88f74f17bb8aa", size = 101510, upload-time = "2026-05-19T21:30:53.62Z" },
+ { url = "https://files.pythonhosted.org/packages/ee/78/393913f4b9039e1edd09ae8a9bbb9d539be909a8abf6d8a2084585bed4b7/yarl-1.24.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:533ded4dceb5f1f3da7906244f4e82cf46cfd40d84c69a1faf5ac506aa65ecbe", size = 105584, upload-time = "2026-05-19T21:30:55.962Z" },
+ { url = "https://files.pythonhosted.org/packages/78/87/deb17b7049bbe74ea11a713b86f8f27800cc1c8648b0b797243ebb4830ba/yarl-1.24.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:7b3a85525f6e7eeabcfdd372862b21ee1915db1b498a04e8bf0e389b607ff0bd", size = 103410, upload-time = "2026-05-19T21:30:57.962Z" },
+ { url = "https://files.pythonhosted.org/packages/8f/be/f9f7594e23b5b93affff0318e4593c1920331bcaefda326cabcad94296a1/yarl-1.24.2-cp314-cp314t-win_amd64.whl", hash = "sha256:a7624b1ca46ca5d7b864ef0d2f8efe3091454085ee1855b4e992314529972215", size = 102980, upload-time = "2026-05-19T21:30:59.735Z" },
+ { url = "https://files.pythonhosted.org/packages/65/a4/ba80dccd3593ff1f01051a818694d07b58cb8232677ee9a22a5a1f93a9fc/yarl-1.24.2-cp314-cp314t-win_arm64.whl", hash = "sha256:e434a45ce2e7a947f951fc5a8944c8cc080b7e59f9c50ae80fd39107cf88126d", size = 91219, upload-time = "2026-05-19T21:31:01.934Z" },
+ { url = "https://files.pythonhosted.org/packages/fd/4d/4b880086bd0d3e034d25647be1d830afc3e3f610e98c4ab3490af6b1b6d5/yarl-1.24.2-py3-none-any.whl", hash = "sha256:2783d9226db8797636cd6896e4de81feed252d1db72265686c9558d97a4d94b9", size = 53576, upload-time = "2026-05-19T21:31:03.909Z" },
+]
+
+[[package]]
+name = "zipp"
+version = "4.1.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/b9/d8/eab98a517c14134c0b2eb4e2387bc5f457334293ec5d2dd3857ec2966802/zipp-4.1.0.tar.gz", hash = "sha256:4cb57381f544315db7688e976e922a2b18cdb513d21cc194eb42232ba2a3e602", size = 26214, upload-time = "2026-05-18T20:08:57.967Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/3a/13/547360d81e6d88d58492968ffda9f9542854f11310ee556fef14260cc886/zipp-4.1.0-py3-none-any.whl", hash = "sha256:25ad4e16390cd314347dd8f1de67a2ac538ae658ed4ab9db16029c07c188e97f", size = 10238, upload-time = "2026-05-18T20:08:57.045Z" },
+]
diff --git a/package.json b/package.json
index 46b946a51..3f89c7801 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,8 @@
"test:gateway": "cd apps/gateway && cargo test",
"lint:gateway": "cd apps/gateway && cargo clippy -- -D warnings",
"fmt:gateway": "cd apps/gateway && cargo fmt --check",
+ "build:gepa": "cd apps/gepa-optimizer && uv sync --locked",
+ "test:gepa": "cd apps/gepa-optimizer && uv run pytest",
"dev:token-manager": "pnpm --filter token-manager dev",
"dev:model-scanner-copilot": "pnpm --filter model-scanner-copilot dev",
"dev:model-scanner-anthropic": "pnpm --filter model-scanner-anthropic dev",
From 4bd53d0fef3324ffbb5fca2e4984b04feabb9397 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:41:32 -0700
Subject: [PATCH 009/287] docs(gepa): document typed prompts, experimentId,
size-based storage, optimizer env
- app-design.md: typed prompts (task|agents.md), size-based inline/blob storage,
experiment grouping, AGENTS.md delivery, scoring-not-persisted
- ENV_VARIABLES.md: PROMPT_INLINE_MAX_BYTES + GEPA optimizer (SCOPE_*/GEPA_*) vars
- AGENTS.md: gepa-optimizer in repo tree + Key Components section
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
AGENTS.md | 14 +++++++
ENV_VARIABLES.md | 71 +++++++++++++++++++++++++++++++++
docs/architecture/app-design.md | 47 ++++++++++++++++++++++
3 files changed, 132 insertions(+)
diff --git a/AGENTS.md b/AGENTS.md
index de77cbeba..94a73f2f5 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -22,6 +22,7 @@ apps/
model-scanners/ # Feature detection for Copilot and Anthropic models
version-checkers/ # Poll for new agent/tool releases
key-updaters/ # GitHub auth cookie management for VS Code Web
+ gepa-optimizer/ # Python+uv GEPA driver — optimizes AGENTS.md via Scope runs
packages/
shared/ # Monorepo foundation — types, DB models, queue/blob/redis clients
db-migrations/ # MongoDB migration framework (mongo-migrate-ts)
@@ -117,6 +118,19 @@ Express service for centralized token storage, validation, and round-robin distr
- Architecture: [docs/architecture/token-manager.md](docs/architecture/token-manager.md)
+### GEPA Optimizer (`apps/gepa-optimizer/`)
+
+Python + uv app (outside the pnpm workspace, like the Rust `apps/gateway`) that
+runs the [GEPA](https://github.com/gepa-ai/gepa) reflective prompt-optimization
+algorithm to optimize an **AGENTS.md** file. Each candidate is scored by a real
+Scope run (Copilot CLI worker + Claude Haiku 4.5) via a custom `ScopeAdapter`:
+submit a request with `agentsMd` + `experimentId`, poll to completion, and score
+from the run's `criteriaResults`. Scoring is derived, never persisted. Run tests
+with `pnpm test:gepa` (`uv run pytest`); CI runs `uv sync --locked && uv run pytest`.
+
+- README: [apps/gepa-optimizer/README.md](apps/gepa-optimizer/README.md)
+- Data-model impact (experimentId, typed prompts, AGENTS.md delivery): [docs/architecture/app-design.md](docs/architecture/app-design.md)
+
### Shared Package (`packages/shared/`)
Monorepo foundation. Exports types (runs, iterations, criteria, scenarios, personas), Mongoose models, and service clients (queue, blob, redis, config loader, criteria-store, criteria-provider). All apps and workers depend on it — breaking changes here affect everything.
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index 9259bf048..0a492ec06 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -136,6 +136,20 @@ Model name / deployment name used by both backends. For Foundry, this must
match the deployment name on the Foundry resource. Examples: `gpt-4.1`,
`gpt-4o`, `gpt-4.1-mini`. Put in `.env.local` (see note above).
+## Prompt Storage Configuration
+
+### PROMPT_INLINE_MAX_BYTES
+**Default:** `16384` (16 KB)
+**Type:** integer (UTF-8 byte length)
+**Used by:** API (`apps/api`)
+
+Threshold deciding where a task/AGENTS.md prompt body is stored. A body whose
+UTF-8 byte length is at/under this value is stored **inline** in Mongo (`text`);
+a larger body is uploaded to blob storage (`prompts/{promptId}.txt`) and the doc
+references it via `contentBlobUrl` with no inline `text`. The decision is purely
+size-based — independent of the prompt's `type`. Small task prompts stay inline
+(today's behavior); large AGENTS.md bodies go to blob automatically.
+
## Judge Strategy Configuration
### JUDGE_STRATEGY
@@ -384,3 +398,60 @@ Directory where DevProxy writes HAR files. Shared between the DevProxy process a
**Type:** integer (Docker Compose only)
Host port mapping for the Copilot DevProxy REST API in Docker Compose.
+
+## GEPA Optimizer Configuration (`apps/gepa-optimizer`)
+
+Python + uv app that optimizes an AGENTS.md file via GEPA, scoring each candidate
+with a real Scope run. Configured via `apps/gepa-optimizer/.env` (see `.env.example`).
+
+### SCOPE_API_URL
+**Default:** `http://localhost:3100`
+
+Base URL of the Scope REST API the optimizer submits requests to.
+
+### SCOPE_WORKER
+**Default:** `coder-acp-copilot`
+
+Worker used to evaluate each candidate.
+
+### SCOPE_MODEL
+**Default:** `claude-haiku-4.5`
+
+Model the worker runs under test.
+
+### SCOPE_MAX_CONCURRENCY
+**Default:** `10`
+**Type:** integer
+
+Max number of Scope runs kept in-flight at once. Defaults to the Linux
+`coder-acp-copilot` KEDA ceiling (`maxReplicaCount: 10`); submitting more is
+harmless but yields no speedup.
+
+### SCOPE_RUN_TIMEOUT_SECONDS / SCOPE_POLL_INTERVAL_SECONDS
+**Defaults:** `1800` / `15`
+
+How long to wait for a run to reach `status=done`, and how often to poll.
+
+### SCOPE_MAX_ITERATIONS
+**Default:** `10`
+
+Multi-turn iterations per Scope run.
+
+### SCOPE_SCORE_STRATEGY
+**Default:** `mean`
+**Options:** `mean` | `final` | `weighted`
+
+How a run's per-turn scores aggregate into one score. `mean` averages all turns;
+`final` uses the last turn; `weighted` is `0.8*final + 0.2*mean`.
+
+### GEPA_MAX_METRIC_CALLS / GEPA_REFLECTION_MINIBATCH_SIZE
+**Defaults:** `12` / `2`
+
+GEPA budget. Each metric call is one full (slow) Scope agent run — keep small.
+
+### GEPA_REFLECTION_LM
+**Default:** `azure/gpt-5.5`
+
+litellm model string for the reflection LM that rewrites the AGENTS.md (not the
+agent under test). Azure credentials (`AZURE_API_KEY`, `AZURE_API_BASE`,
+`AZURE_API_VERSION`) are read by litellm.
diff --git a/docs/architecture/app-design.md b/docs/architecture/app-design.md
index 4b4c990a7..03d5e4b04 100644
--- a/docs/architecture/app-design.md
+++ b/docs/architecture/app-design.md
@@ -49,6 +49,53 @@ erDiagram
- **Criterion** — An evaluation check (e.g., "has a working Express server"). Criteria form a DAG (directed acyclic graph) with dependencies.
- **CriterionResult** — Pass/fail result of evaluating a criterion against a specific iteration
+### Typed prompts, AGENTS.md, and size-based storage
+
+Task prompts live in a single `task-prompts` collection that is now **typed** and
+shared by two prompt kinds:
+
+- `TaskPromptDocument.type?: 'task' | 'agents.md'` — absent ⇒ `'task'` (backward
+ compatible; existing docs are untouched).
+- **`_id` is the content hash.** `computeTaskPromptId(text, type?)` hashes the
+ trimmed text for `task` (or absent) — identical to the legacy hash, so every
+ existing task prompt keeps its `_id` — and namespaces non-task types as
+ `hash(type + '\n' + text)` so an AGENTS.md prompt never collides with a task
+ prompt of the same text. `findOrCreate` deduplicates on this hash.
+- **Body storage is decided by size, not type.** A prompt body at/under
+ `PROMPT_INLINE_MAX_BYTES` (default 16 KB, UTF-8) is stored inline as `text`;
+ larger bodies are uploaded to blob (`prompts/{promptId}.txt`) and the doc carries
+ `contentBlobUrl` with no inline `text`. Exactly one of `text` / `contentBlobUrl`
+ is set. `resolvePromptText(doc)` returns the inline body or downloads the blob, so
+ callers (feature extraction, the worker text endpoint) get plain text regardless
+ of location.
+- **Prompt features are typed the same way.** `PromptFeatureDocument.type?:
+ 'task' | 'agents.md'` (absent ⇒ `'task'`); feature extraction selects only
+ features of the prompt's type.
+
+### Experiment grouping and AGENTS.md delivery
+
+To support GEPA-style optimization (see `apps/gepa-optimizer`), the request carries:
+
+- `RequestDocument.experimentId?: string` — groups the seed request and every
+ candidate request of one optimization run. Filterable (`?experimentId=`) and
+ groupable (`groupBy=experiment`). A sparse index on `requests.experimentId`
+ serves both grouping and lineage queries.
+- `RequestDocument.agentsMdPromptId?: string` — set when the create-request body
+ includes `agentsMd` (raw text); the API `findOrCreate`s an `agents.md`-typed
+ prompt and stores its id. Before the run starts, the shared queue-processor
+ resolves the text (downloading from blob if needed) and writes
+ `/AGENTS.md` once (constant for the whole run). It **fails the run**
+ if the prompt id is set but cannot be resolved — never silently runs the baseline.
+- `RequestDocument.agentsMdParentIds?: string[]` — best-effort lineage edges
+ (`[]`/absent = root, `[p]` = mutation, `[i, j]` = merge) for callers that know
+ parentage at submit time. The GEPA optimizer instead reconstructs lineage
+ post-hoc from the engine's parent indices.
+
+**Scoring is not persisted.** The GEPA metric (fraction of criteria passed,
+aggregated across turns) is derived by the optimizer from `run.turns[].criteriaResults`
+and never stored in Scope — it is algorithm-specific. If ever persisted it would be
+named (e.g. `metrics.gepaCriteriaPassRateMeanTurns`) and live on `RunState`.
+
## Judge Pipeline
The judge evaluates coding agent output against criteria. Two strategies are supported:
From 9b1b8e18fc5282dc86c4d6e258be11579f221aa0 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:42:47 -0700
Subject: [PATCH 010/287] test(cli): regenerate command-tree snapshot for new
typed-prompt/experiment flags
Captures --type (prompt-feature/task-prompt create), --agents-md, --experiment-id,
and --group-by added in the CLI step.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/cli/src/__snapshots__/cli-commands.test.ts.snap | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
index 54c419def..80eba9bfc 100644
--- a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
+++ b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
@@ -366,6 +366,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"options": [
"--id",
"--prompt",
+ "--type",
"--url",
],
},
@@ -402,6 +403,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"options": [
"--output",
"--query",
+ "--type",
"--url",
],
},
@@ -562,6 +564,8 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
},
"list": {
"options": [
+ "--experiment-id",
+ "--group-by",
"--include-deleted",
"--max-iterations",
"--output",
@@ -595,8 +599,10 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"submit": {
"options": [
"--agent-version",
+ "--agents-md",
"--base-profile",
"--criteria",
+ "--experiment-id",
"--extensions",
"--max-iterations",
"--mcp-servers",
@@ -690,6 +696,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"options": [
"--file",
"--text",
+ "--type",
"--url",
],
},
@@ -721,6 +728,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--offset",
"--output",
"--search",
+ "--type",
"--url",
],
},
From 73b107bbad52265bfdd18b302661387a78cbecbd Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:44:52 -0700
Subject: [PATCH 011/287] fix(portal): handle optional task-prompt text for
blob-backed prompts
TaskPromptDocument.text is now optional (blob-backed docs carry no inline text).
Guard all consumers (pickers, list, preview panel) with fallbacks; the preview
panel shows a 'stored in blob' note when the body is absent. Fixes tsc build.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/portal/src/components/TaskPromptIdPicker.tsx | 4 ++--
apps/portal/src/components/TaskPromptPicker.tsx | 6 +++---
apps/portal/src/pages/TaskPromptList.tsx | 2 +-
apps/portal/src/pages/TaskPromptPreviewPanel.tsx | 6 ++++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/apps/portal/src/components/TaskPromptIdPicker.tsx b/apps/portal/src/components/TaskPromptIdPicker.tsx
index 95c75880a..a30b72037 100644
--- a/apps/portal/src/components/TaskPromptIdPicker.tsx
+++ b/apps/portal/src/components/TaskPromptIdPicker.tsx
@@ -43,7 +43,7 @@ export function TaskPromptIdPicker({ selected, onChange }: TaskPromptIdPickerPro
const promptMap = useMemo(() => {
const map = new Map();
for (const tp of allPrompts?.items ?? []) {
- map.set(tp._id, tp.text);
+ map.set(tp._id, tp.text ?? "");
}
return map;
}, [allPrompts]);
@@ -162,7 +162,7 @@ export function TaskPromptIdPicker({ selected, onChange }: TaskPromptIdPickerPro
{formatId(tp._id)}
- {truncate(tp.text.replace(/\n/g, " "), 80)}
+ {truncate((tp.text ?? "").replace(/\n/g, " "), 80)}
))}
diff --git a/apps/portal/src/components/TaskPromptPicker.tsx b/apps/portal/src/components/TaskPromptPicker.tsx
index c917447c2..daced864f 100644
--- a/apps/portal/src/components/TaskPromptPicker.tsx
+++ b/apps/portal/src/components/TaskPromptPicker.tsx
@@ -62,7 +62,7 @@ export function TaskPromptPicker({ onSelect }: TaskPromptPickerProps) {
} else if (e.key === "Enter") {
e.preventDefault();
if (items[highlightIdx]) {
- selectItem(items[highlightIdx].text);
+ selectItem(items[highlightIdx].text ?? "");
}
} else if (e.key === "Escape") {
setOpen(false);
@@ -109,13 +109,13 @@ export function TaskPromptPicker({ onSelect }: TaskPromptPickerProps) {
? "bg-accent text-accent-foreground"
: "hover:bg-accent/50"
}`}
- onClick={() => selectItem(tp.text)}
+ onClick={() => selectItem(tp.text ?? "")}
onMouseEnter={() => setHighlightIdx(idx)}
>
{formatId(tp._id)}
- {truncate(tp.text.replace(/\n/g, " "), 80)}
+ {truncate((tp.text ?? "").replace(/\n/g, " "), 80)}
))}
diff --git a/apps/portal/src/pages/TaskPromptList.tsx b/apps/portal/src/pages/TaskPromptList.tsx
index e02d8b1af..e6b415573 100644
--- a/apps/portal/src/pages/TaskPromptList.tsx
+++ b/apps/portal/src/pages/TaskPromptList.tsx
@@ -164,7 +164,7 @@ export function TaskPromptList() {
header: "Text",
hidden: visibility.isHidden("text"),
cell: (tp) => (
- {truncate(tp.text, 80)}
+ {truncate(tp.text ?? "", 80)}
),
},
{
diff --git a/apps/portal/src/pages/TaskPromptPreviewPanel.tsx b/apps/portal/src/pages/TaskPromptPreviewPanel.tsx
index 15f31acde..0ed5a0ff6 100644
--- a/apps/portal/src/pages/TaskPromptPreviewPanel.tsx
+++ b/apps/portal/src/pages/TaskPromptPreviewPanel.tsx
@@ -50,7 +50,7 @@ export function TaskPromptPreviewPanel() {
return (
{formatId(taskPrompt._id)}}
- subtitle={truncate(taskPrompt.text, 80)}
+ subtitle={truncate(taskPrompt.text ?? "", 80)}
onClose={closePanel}
headerActions={
@@ -74,7 +74,9 @@ export function TaskPromptPreviewPanel() {
- {truncate(taskPrompt.text, 1200)}
+ {taskPrompt.text !== undefined
+ ? truncate(taskPrompt.text, 1200)
+ : "(Stored in blob storage — open the full view to load the body.)"}
From ac2293b49c5c4f7f3bba6e5989cf8967b4a9aef9 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 1 Jun 2026 23:47:33 -0700
Subject: [PATCH 012/287] test(db-migrations): update check-migrations
expectations for migration 018
Migration 018-add-experiment-id-index was added to REQUIRED_MIGRATIONS in the
db-migration step; update the applied/pending lists and totalApplied counts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
packages/db-migrations/src/check-migrations.test.ts | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/packages/db-migrations/src/check-migrations.test.ts b/packages/db-migrations/src/check-migrations.test.ts
index 6c631b83e..1694295c0 100644
--- a/packages/db-migrations/src/check-migrations.test.ts
+++ b/packages/db-migrations/src/check-migrations.test.ts
@@ -48,11 +48,12 @@ describe("checkMigrations", () => {
"015-add-priority-and-scheduler-index.ts",
"016-fix-scheduler-sort-index.ts",
"017-add-post-processor-dispatch-index.ts",
+ "018-add-experiment-id-index.ts",
]);
const result = await checkMigrations(db);
expect(result.ready).toBe(true);
expect(result.pending).toEqual([]);
- expect(result.totalApplied).toBe(17);
+ expect(result.totalApplied).toBe(18);
expect(result.applied).toEqual([
"001-backfill-task-prompts.ts",
"002-create-indexes.ts",
@@ -71,6 +72,7 @@ describe("checkMigrations", () => {
"015-add-priority-and-scheduler-index.ts",
"016-fix-scheduler-sort-index.ts",
"017-add-post-processor-dispatch-index.ts",
+ "018-add-experiment-id-index.ts",
]);
});
@@ -78,7 +80,7 @@ describe("checkMigrations", () => {
const db = makeMockDb(["001-backfill-task-prompts.ts"]);
const result = await checkMigrations(db);
expect(result.ready).toBe(false);
- expect(result.pending).toEqual(["002-create-indexes.ts", "003-create-skill-indexes.ts", "004-add-submission-id-index.ts", "005-backfill-iteration-durations.ts", "006-split-status-outcome.ts", "007-rename-exhausted-to-finished.ts", "008-backfill-ai-call-count.ts", "009-add-requests-filter-indexes.ts", "010-add-requests-pagination-index.ts", "011-add-profile-indexes.ts", "012-add-profile-name-index.ts", "013-remove-logs-from-docs.ts", "014-introduce-runs-and-run.ts", "015-add-priority-and-scheduler-index.ts", "016-fix-scheduler-sort-index.ts", "017-add-post-processor-dispatch-index.ts"]);
+ expect(result.pending).toEqual(["002-create-indexes.ts", "003-create-skill-indexes.ts", "004-add-submission-id-index.ts", "005-backfill-iteration-durations.ts", "006-split-status-outcome.ts", "007-rename-exhausted-to-finished.ts", "008-backfill-ai-call-count.ts", "009-add-requests-filter-indexes.ts", "010-add-requests-pagination-index.ts", "011-add-profile-indexes.ts", "012-add-profile-name-index.ts", "013-remove-logs-from-docs.ts", "014-introduce-runs-and-run.ts", "015-add-priority-and-scheduler-index.ts", "016-fix-scheduler-sort-index.ts", "017-add-post-processor-dispatch-index.ts", "018-add-experiment-id-index.ts"]);
expect(result.applied).toEqual(["001-backfill-task-prompts.ts"]);
expect(result.totalApplied).toBe(1);
});
@@ -105,6 +107,7 @@ describe("checkMigrations", () => {
"015-add-priority-and-scheduler-index.ts",
"016-fix-scheduler-sort-index.ts",
"017-add-post-processor-dispatch-index.ts",
+ "018-add-experiment-id-index.ts",
]);
expect(result.applied).toEqual([]);
expect(result.totalApplied).toBe(0);
@@ -129,12 +132,13 @@ describe("checkMigrations", () => {
"015-add-priority-and-scheduler-index.ts",
"016-fix-scheduler-sort-index.ts",
"017-add-post-processor-dispatch-index.ts",
+ "018-add-experiment-id-index.ts",
"999-future-migration.ts",
]);
const result = await checkMigrations(db);
expect(result.ready).toBe(true);
expect(result.pending).toEqual([]);
- expect(result.totalApplied).toBe(18);
+ expect(result.totalApplied).toBe(19);
});
it("caches results within TTL", async () => {
From dd0b20d47e32371a81367b4b2fe7e4161573bc4c Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 2 Jun 2026 00:29:09 -0700
Subject: [PATCH 013/287] feat(gepa-optimizer): seed single Azure Cosmos DB
blog task with empty AGENTS.md
Replace the two generic Express demo tasks with a single, self-contained
optimization target: a Medium-style Django blogging platform backed by a
nonrelational cloud database. The seed AGENTS.md is now EMPTY on purpose so
GEPA discovers the guidance from scratch.
Each run requests the full ancestor closure of the target leaf
(uses_azure_documentdb): uses_database -> uses_document_oriented_db, plus
uses_azure, both feeding uses_azure_documentdb. Requesting the closure (not
just the leaf) gives GEPA graded partial-credit signal instead of a sparse 0/1.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/gepa_optimizer/dataset.py | 53 ++++++++++---------
1 file changed, 29 insertions(+), 24 deletions(-)
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/dataset.py b/apps/gepa-optimizer/src/gepa_optimizer/dataset.py
index f4482321e..c87842907 100644
--- a/apps/gepa-optimizer/src/gepa_optimizer/dataset.py
+++ b/apps/gepa-optimizer/src/gepa_optimizer/dataset.py
@@ -18,37 +18,42 @@
DataInst = dict[str, Any]
-# A small seed AGENTS.md. GEPA mutates this via reflection.
-SEED_AGENTS_MD = (
- "# Agent guidance\n\n"
- "You are an expert software engineer. Implement the requested task fully "
- "and correctly. Prefer simple, idiomatic solutions. Verify your work "
- "before finishing.\n"
+# The seed AGENTS.md GEPA mutates. It starts EMPTY on purpose: the whole point of
+# this experiment is to discover, from scratch, the AGENTS.md guidance that makes
+# the agent reliably satisfy the task's criteria.
+SEED_AGENTS_MD = ""
+
+# The single task we optimize the AGENTS.md for.
+BLOG_TASK = (
+ "Create a blogging platform inspired by Medium using Python and Django, "
+ "utilizing a nonrelational database for data storage and management. "
+ "Must run in the Cloud."
)
+# Criteria requested per run. We request the FULL ancestor closure of the target
+# leaf (uses_azure_documentdb), not just the leaf, so scoring is graded:
+# uses_database -> uses_document_oriented_db -> uses_azure_documentdb
+# uses_azure ----------------------------------^
+# Partial credit (e.g. "uses a document DB but not on Azure") gives GEPA a much
+# denser gradient than a single 0/1 leaf, while the leaf remains the real goal.
+BLOG_CRITERIA = [
+ "uses_database",
+ "uses_document_oriented_db",
+ "uses_azure",
+ "uses_azure_documentdb",
+]
+
def default_dataset() -> tuple[list[DataInst], list[DataInst]]:
"""Return ``(trainset, valset)``.
- Replace the criterion ids with ids that exist in your Scope instance
- (``pnpm cli criteria list``). Kept deliberately small.
+ A single seed task (the Medium-style Django blog on Azure Cosmos DB). Both
+ splits point at the same example: GEPA reflects on it (train) and selects on
+ it (val). ``preflight_criteria`` validates the ids before any expensive run.
"""
- trainset: list[DataInst] = [
- {
- "task": "Create an Express.js server with a GET / route that responds 'Hello, World!'.",
- "criteria": ["server_starts", "responds_hello_world"],
- },
- {
- "task": "Add a GET /health route to the Express server that returns JSON {\"status\":\"ok\"}.",
- "criteria": ["server_starts", "health_route_ok"],
- },
- ]
- valset: list[DataInst] = [
- {
- "task": "Create an Express.js server with a GET / route that responds 'Hello, World!'.",
- "criteria": ["server_starts", "responds_hello_world"],
- },
- ]
+ example: DataInst = {"task": BLOG_TASK, "criteria": list(BLOG_CRITERIA)}
+ trainset: list[DataInst] = [example]
+ valset: list[DataInst] = [dict(example)]
return trainset, valset
From 6c56b5bb4782a05c2432f530cd6356297d72a95f Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 2 Jun 2026 01:28:23 -0700
Subject: [PATCH 014/287] fix(portal): group runs by experiment and add
Experiment column
The DataTable's getGroupKey switch was missing the 'experiment' case, so
selecting Group by > Experiment collapsed every run into a single empty-keyed
group instead of grouping by experimentId. Add the missing case and a new
Experiment column (visible by default) that shows the short experiment id with
the full id on hover.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/portal/src/pages/RunsList.tsx | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/apps/portal/src/pages/RunsList.tsx b/apps/portal/src/pages/RunsList.tsx
index a73aac03e..43713d790 100644
--- a/apps/portal/src/pages/RunsList.tsx
+++ b/apps/portal/src/pages/RunsList.tsx
@@ -242,6 +242,7 @@ function AggregateProgress({
const COLUMN_OPTIONS: CustomizeColumnsOption[] = [
{ id: "id", label: "ID", required: true },
{ id: "submission", label: "Submission" },
+ { id: "experiment", label: "Experiment" },
{ id: "task", label: "Task" },
{ id: "criteria", label: "Criteria" },
{ id: "worker", label: "Worker" },
@@ -1198,6 +1199,25 @@ export function RunsList() {
—
),
},
+ {
+ id: "experiment",
+ header: "Experiment",
+ width: "140px",
+ hidden: columnVisibility.isHidden("experiment"),
+ cell: (r) =>
+ r.experimentId ? (
+
+
+
+ {formatId(r.experimentId.replace(/^gepa-/, ""))}
+
+
+ {r.experimentId}
+
+ ) : (
+ —
+ ),
+ },
{
id: "task",
header: "Task",
@@ -2065,6 +2085,8 @@ export function RunsList() {
return run.scenario?.task ?? "(No Task)";
case "submissionId":
return run.submissionId ?? "(No Submission)";
+ case "experiment":
+ return run.experimentId ?? "(No Experiment)";
default:
return "";
}
From 9490460271e9f6b5f4684ea5315b9afb896fcac6 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 2 Jun 2026 01:44:05 -0700
Subject: [PATCH 015/287] fix(gepa): score "finished" runs by criteria
fraction, not 0.0
compute_run_score gated on outcome == "succeeded", returning 0.0 for any
run that did not pass *every* criterion. But Scope only marks a run
"succeeded" when all criteria pass; a run that completes and is judged
with partial criteria gets outcome "finished". Gating on "succeeded"
collapsed GEPA's optimization landscape to a flat 0.0 until a candidate
happened to pass all criteria, destroying the partial-credit gradient the
reflective loop relies on (a seed passing 3/4 criteria scored 0.0 instead
of 0.75).
Accept both "succeeded" and "finished" as scoreable outcomes (run
completed and was judged); keep "failed" (errored/abandoned) at 0.0.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/gepa_optimizer/scoring.py | 22 +++++++++++++++----
apps/gepa-optimizer/tests/test_scoring.py | 14 +++++++++++-
2 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/apps/gepa-optimizer/src/gepa_optimizer/scoring.py b/apps/gepa-optimizer/src/gepa_optimizer/scoring.py
index 574c53a97..f059324fb 100644
--- a/apps/gepa-optimizer/src/gepa_optimizer/scoring.py
+++ b/apps/gepa-optimizer/src/gepa_optimizer/scoring.py
@@ -12,7 +12,13 @@
passing result always counts as failed.
* ``evaluated == False`` (a DAG ancestor failed, so the criterion was skipped)
counts as **failed**, amplifying the penalty for early failures.
-* A run that did not succeed (``outcome != "succeeded"``), has no turns, or has
+* A run is scored by its criteria fraction whenever it **completed and was
+ judged** — i.e. ``outcome`` is ``"succeeded"`` (all criteria passed) **or**
+ ``"finished"`` (ran to ``maxIterations`` and was judged, but not all criteria
+ passed). Scoring only ``"succeeded"`` runs would collapse the optimization
+ landscape to ``0.0`` until a candidate passes *every* criterion, destroying
+ the partial-credit gradient GEPA relies on. A run that ``"failed"`` (errored
+ or abandoned the task before being judged to completion), has no turns, or has
no judged criteria scores ``0.0``. The function never returns ``NaN``.
"""
@@ -21,8 +27,14 @@
from typing import Any, Mapping, Sequence
SUCCEEDED_OUTCOME = "succeeded"
+FINISHED_OUTCOME = "finished"
DONE_STATUS = "done"
+# Outcomes that mean "the run completed and was judged", so its criteria
+# fraction is a meaningful score. ``"failed"`` is deliberately excluded — it
+# signals an error or an abandoned run with no trustworthy judgement.
+SCOREABLE_OUTCOMES = frozenset({SUCCEEDED_OUTCOME, FINISHED_OUTCOME})
+
ScoreStrategy = str # "mean" | "final" | "weighted"
@@ -66,14 +78,16 @@ def compute_run_score(
) -> float:
"""Aggregate a finished run into a single GEPA score in ``[0.0, 1.0]``.
- Returns ``0.0`` (never ``NaN``) for any run that did not succeed or produced
- no judged turns.
+ Returns ``0.0`` (never ``NaN``) for any run that did not complete-and-judge
+ (``outcome`` not in :data:`SCOREABLE_OUTCOMES`) or produced no judged turns.
+ A ``"finished"`` run (ran to completion, partial criteria) is scored by its
+ criteria fraction so GEPA keeps a partial-credit gradient.
"""
if not run:
return 0.0
if run.get("status") != DONE_STATUS:
return 0.0
- if run.get("outcome") != SUCCEEDED_OUTCOME:
+ if run.get("outcome") not in SCOREABLE_OUTCOMES:
return 0.0
turn_scores = compute_turn_scores(run, requested_criteria)
diff --git a/apps/gepa-optimizer/tests/test_scoring.py b/apps/gepa-optimizer/tests/test_scoring.py
index 4a5b73101..e1ee21e3d 100644
--- a/apps/gepa-optimizer/tests/test_scoring.py
+++ b/apps/gepa-optimizer/tests/test_scoring.py
@@ -14,11 +14,23 @@ def test_non_done_status_scores_zero():
assert compute_run_score(run, ["a"]) == 0.0
-def test_non_succeeded_outcome_scores_zero():
+def test_failed_outcome_scores_zero():
run = {"status": "done", "outcome": "failed", "turns": [_turn(0, [_r("a", True)])]}
assert compute_run_score(run, ["a"]) == 0.0
+def test_finished_outcome_scores_partial_credit():
+ # A run that ran to completion but did not pass every criterion has
+ # outcome "finished" — it must still earn its criteria fraction, not 0.0,
+ # otherwise GEPA loses its gradient.
+ run = {
+ "status": "done",
+ "outcome": "finished",
+ "turns": [_turn(0, [_r("a", True), _r("b", True), _r("c", True), _r("d", False)])],
+ }
+ assert compute_run_score(run, ["a", "b", "c", "d"]) == 0.75
+
+
def test_no_turns_scores_zero():
run = {"status": "done", "outcome": "succeeded", "turns": []}
assert compute_run_score(run, ["a"]) == 0.0
From 00c2c144fc83928288749548c6bacfa52111968a Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 02:05:40 -0700
Subject: [PATCH 016/287] feat: DAG-based post-processing + taxonomy handler
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Refactor post-processing from single-handler to DAG orchestration:
Phase 1 - Handler Dispatcher:
- Add HandlerDispatcher with DAG topology from services collection
- Scheduler REST endpoints: POST /notify/run-terminal, /handler-complete
- Workers notify scheduler instead of direct queue enqueue (fallback kept)
- Remove triggerReportGeneration (reports now DAG node via pp-report)
- DB migrations: services → handler entries, run.handlerStatus field
Phase 2 - Taxonomy Handler:
- Zod schema for 3-layer taxonomy (scorecard, behavior, actions)
- taxonomy-handler worker with Copilot SDK + multi-turn validation loop
- Docker-compose service with SCHEDULER_URL wiring
DAG structure: pp-atif → pp-taxonomy → pp-report
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
AGENTS.md | 2 +
ENV_VARIABLES.md | 36 ++
apps/scheduler/src/handler-dispatcher.ts | 295 +++++++++++++++
apps/scheduler/src/index.ts | 34 +-
apps/scheduler/src/notify-routes.test.ts | 149 ++++++++
apps/scheduler/src/notify-routes.ts | 150 ++++++++
.../post-processor/src/post-processor.ts | 72 ++--
apps/workers/taxonomy/Dockerfile | 19 +
apps/workers/taxonomy/package.json | 23 ++
apps/workers/taxonomy/src/index.ts | 30 ++
apps/workers/taxonomy/src/prompt.ts | 88 +++++
.../taxonomy/src/taxonomy-queue-processor.ts | 336 ++++++++++++++++++
apps/workers/taxonomy/src/tools.ts | 156 ++++++++
apps/workers/taxonomy/tsconfig.json | 8 +
docker-compose.yml | 40 ++-
docs/architecture/db-migrations.md | 3 +
docs/architecture/overview.md | 2 +
docs/architecture/post-processing.md | 45 ++-
.../src/check-migrations.test.ts | 85 +----
.../018-migrate-services-to-handler-dag.ts | 96 +++++
.../019-add-handler-status-index.ts | 72 ++++
.../migrations/020-backfill-handler-status.ts | 76 ++++
.../db-migrations/src/required-migrations.ts | 3 +
packages/shared/src/index.ts | 1 +
.../shared/src/queue/queue-processor.test.ts | 15 +-
packages/shared/src/queue/queue-processor.ts | 76 ++--
packages/shared/src/schemas/index.ts | 1 +
packages/shared/src/schemas/taxonomy.test.ts | 180 ++++++++++
packages/shared/src/schemas/taxonomy.ts | 104 ++++++
packages/shared/src/types/types.ts | 28 +-
pnpm-lock.yaml | 25 ++
31 files changed, 2066 insertions(+), 184 deletions(-)
create mode 100644 apps/scheduler/src/handler-dispatcher.ts
create mode 100644 apps/scheduler/src/notify-routes.test.ts
create mode 100644 apps/scheduler/src/notify-routes.ts
create mode 100644 apps/workers/taxonomy/Dockerfile
create mode 100644 apps/workers/taxonomy/package.json
create mode 100644 apps/workers/taxonomy/src/index.ts
create mode 100644 apps/workers/taxonomy/src/prompt.ts
create mode 100644 apps/workers/taxonomy/src/taxonomy-queue-processor.ts
create mode 100644 apps/workers/taxonomy/src/tools.ts
create mode 100644 apps/workers/taxonomy/tsconfig.json
create mode 100644 packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
create mode 100644 packages/db-migrations/src/migrations/019-add-handler-status-index.ts
create mode 100644 packages/db-migrations/src/migrations/020-backfill-handler-status.ts
create mode 100644 packages/shared/src/schemas/taxonomy.test.ts
create mode 100644 packages/shared/src/schemas/taxonomy.ts
diff --git a/AGENTS.md b/AGENTS.md
index de77cbeba..419fb8e6a 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -19,6 +19,7 @@ apps/
coder-acp-copilot/ # GitHub Copilot worker (ACP SDK)
coder-acp-claude-code/ # Claude Code worker (ACP SDK)
report-generator/ # Post-run report generation
+ taxonomy/ # Post-run taxonomy generation
model-scanners/ # Feature detection for Copilot and Anthropic models
version-checkers/ # Poll for new agent/tool releases
key-updaters/ # GitHub auth cookie management for VS Code Web
@@ -53,6 +54,7 @@ Each worker implements the same queue-processor interface but adapts a different
| `coder-acp-copilot` | GitHub Copilot | ACP SDK v0.14.1 |
| `coder-acp-claude-code` | Claude Code | ACP SDK v0.13.1 |
| `report-generator` | — | Copilot SDK |
+| `taxonomy` | — | Copilot SDK |
Workers consume tasks from Azure Storage Queues (named `queue-`) and write results to MongoDB and Blob Storage. Each has its own Dockerfile and docker-compose profile.
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index 9259bf048..5044d6c53 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -277,6 +277,32 @@ Timeout for the Copilot SDK session used by the report-generator worker. If the
Git commit hash embedded in reporter metadata. Automatically set during CI/CD builds. Used to track which version of the report-generator produced a given report.
+## Taxonomy Handler Configuration
+
+### AZURE_STORAGE_QUEUE_TAXONOMY
+**Default:** `pp-taxonomy-queue`
+**Type:** string
+
+Azure Storage Queue name for taxonomy-generation jobs. The scheduler enqueues `{ type: "taxonomy", requestId, runId }` messages here after the `pp-atif` dependency completes, and the taxonomy worker polls this queue.
+
+### TAXONOMY_MODEL
+**Default:** `gpt-4.1`
+**Type:** string
+
+The LLM model used by the taxonomy worker (via the Copilot SDK) to generate structured taxonomy JSON from run metadata and ATIF trajectories.
+
+### SCOPE_MT_API_URL
+**Default:** `http://localhost:3001` (local), `http://api:80` (Docker)
+**Type:** URL string
+
+Base URL of the Scope API. The taxonomy worker calls this to fetch the request document and active run state through its Copilot tools.
+
+### SESSION_TIMEOUT_MS
+**Default:** `300000` (5 minutes)
+**Type:** integer (milliseconds)
+
+Timeout for the Copilot SDK session used by the taxonomy worker. If the model does not finish generating a valid taxonomy JSON document within this window, the worker marks `run.handlerStatus.pp-taxonomy` as failed.
+
## Scheduler Configuration
### SCHEDULER_POLL_INTERVAL_MS
@@ -297,6 +323,16 @@ How often the post-processor dispatcher polls for completed runs needing post-pr
Azure Storage Queue name used by both the scheduler (to enqueue post-processing work) and the post-processor worker (to dequeue). Must match between the two services.
+### SCHEDULER_URL
+**Default:** (not set)
+**Type:** URL string
+
+Optional base URL for the scheduler's HTTP notification endpoints. When set, coder workers call `POST /notify/run-terminal` after a run reaches a terminal state, and post-processing handlers call `POST /notify/handler-complete` after a handler finishes. If unset, workers fall back to the legacy direct post-processor queue enqueue path and the scheduler's polling loop catches up.
+
+- **Docker Compose:** `http://scheduler:8080`
+- **Kubernetes:** `http://scheduler-service.scoped.svc.cluster.local:8080`
+- **Local dev:** Leave unset to rely on legacy queue fallback unless you are also running the scheduler locally
+
## Worker Configuration
### SCOPE_RUN_HEARTBEAT_STALE_MS
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
new file mode 100644
index 000000000..2c4f1b99f
--- /dev/null
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -0,0 +1,295 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { Collection, Db } from "mongodb";
+import { QueueClient } from "@azure/storage-queue";
+import type { RequestDocument, HandlerServiceDocument, HandlerRunStatus } from "shared";
+import { DependencyGraph } from "shared";
+import type { NotifyHandler } from "./notify-routes.js";
+
+/**
+ * HandlerDispatcher — DAG-aware post-processing orchestrator.
+ *
+ * Reads handler topology from the `services` collection (type: "post-process-handler"),
+ * builds a DependencyGraph, and dispatches handlers whose dependencies are satisfied.
+ *
+ * Two trigger paths:
+ * 1. `onRunTerminal` — a coder worker signals run completion. Dispatches root handlers.
+ * 2. `onHandlerComplete` — a handler signals completion. Dispatches downstream handlers.
+ *
+ * Also runs a poll safety net to catch missed notifications.
+ */
+export class HandlerDispatcher implements NotifyHandler {
+ private interval: ReturnType | null = null;
+ private dispatching = false;
+ private queueClients = new Map();
+
+ constructor(
+ private readonly collection: Collection,
+ private readonly db: Db,
+ private readonly createQueueClient: (queueName: string) => QueueClient,
+ private readonly pollIntervalMs: number = 30_000,
+ private readonly batchSize: number = 30,
+ ) {}
+
+ start(): void {
+ if (this.interval) return;
+ this.interval = setInterval(() => this.pollDispatch(), this.pollIntervalMs);
+ void this.pollDispatch();
+ }
+
+ async stop(): Promise {
+ if (this.interval) {
+ clearInterval(this.interval);
+ this.interval = null;
+ }
+ const deadline = Date.now() + 5_000;
+ while (this.dispatching && Date.now() < deadline) {
+ await new Promise((r) => setTimeout(r, 100));
+ }
+ }
+
+ // ── NotifyHandler implementation ────────────────────────────────────
+
+ async onRunTerminal(requestId: string, runId: string): Promise {
+ console.log(`[HandlerDispatcher] Notify: run-terminal ${requestId} (run=${runId})`);
+ const handlers = await this.loadHandlers();
+ if (handlers.length === 0) return;
+
+ const graph = this.buildGraph(handlers);
+ const roots = handlers.filter((h) => !h.dependsOn || h.dependsOn.length === 0);
+
+ for (const handler of roots) {
+ await this.dispatchIfEligible(requestId, runId, handler, graph, handlers);
+ }
+ }
+
+ async onHandlerComplete(
+ requestId: string,
+ runId: string,
+ handlerId: string,
+ status: "done" | "failed",
+ ): Promise {
+ console.log(
+ `[HandlerDispatcher] Notify: handler-complete ${handlerId} for ${requestId} (status=${status})`,
+ );
+
+ // Update the handler status on the run document
+ await this.collection.updateOne(
+ { _id: requestId } as any,
+ {
+ $set: {
+ [`run.handlerStatus.${handlerId}.status`]: status,
+ [`run.handlerStatus.${handlerId}.updatedAt`]: new Date(),
+ },
+ } as any,
+ );
+
+ if (status === "failed") {
+ // Don't dispatch downstream on failure
+ return;
+ }
+
+ // Find and dispatch eligible downstream handlers
+ const handlers = await this.loadHandlers();
+ if (handlers.length === 0) return;
+
+ const graph = this.buildGraph(handlers);
+ const descendants = graph.getDescendants(handlerId);
+
+ // Only check immediate children (not all descendants)
+ const children = handlers.filter(
+ (h) => h.dependsOn?.includes(handlerId) && descendants.has(h._id),
+ );
+
+ for (const child of children) {
+ await this.dispatchIfEligible(requestId, runId, child, graph, handlers);
+ }
+ }
+
+ // ── Poll safety net ─────────────────────────────────────────────────
+
+ private async pollDispatch(): Promise {
+ if (this.dispatching) return;
+ this.dispatching = true;
+ try {
+ const handlers = await this.loadHandlers();
+ if (handlers.length === 0) return;
+
+ const graph = this.buildGraph(handlers);
+
+ for (const handler of handlers) {
+ // Find runs that need this handler dispatched
+ for (let i = 0; i < this.batchSize; i++) {
+ const filter = this.buildDispatchFilter(handler, handlers, graph);
+ if (!filter) break;
+
+ const claimed = await this.collection.findOneAndUpdate(
+ filter as any,
+ {
+ $set: {
+ [`run.handlerStatus.${handler._id}.status`]: "queued",
+ [`run.handlerStatus.${handler._id}.updatedAt`]: new Date(),
+ },
+ } as any,
+ { sort: { updatedAt: -1 }, returnDocument: "after" },
+ );
+
+ if (!claimed) break;
+
+ await this.enqueueToHandler(handler, claimed._id, (claimed as any).run?._id);
+ console.log(`[HandlerDispatcher] Poll-dispatched ${handler._id} for ${claimed._id}`);
+ }
+ }
+ } catch (err) {
+ console.error("[HandlerDispatcher] Error during poll dispatch:", err);
+ } finally {
+ this.dispatching = false;
+ }
+ }
+
+ // ── Dispatch logic ──────────────────────────────────────────────────
+
+ private async dispatchIfEligible(
+ requestId: string,
+ _runId: string,
+ handler: HandlerServiceDocument,
+ graph: DependencyGraph,
+ allHandlers: HandlerServiceDocument[],
+ ): Promise {
+ // Check if all dependencies are satisfied for this request
+ const doc = await this.collection.findOne({ _id: requestId } as any);
+ if (!doc?.run || doc.run.status !== "done") return;
+
+ const handlerStatus = (doc.run as any).handlerStatus as
+ | Record
+ | undefined;
+
+ // Check dependencies are all "done"
+ if (handler.dependsOn && handler.dependsOn.length > 0) {
+ for (const depId of handler.dependsOn) {
+ const depStatus = handlerStatus?.[depId]?.status;
+ if (depStatus !== "done") return; // Dependency not satisfied
+ }
+ }
+
+ // Check this handler hasn't already been dispatched
+ const currentStatus = handlerStatus?.[handler._id]?.status;
+ if (currentStatus === "queued" || currentStatus === "processing" || currentStatus === "done") {
+ return;
+ }
+
+ // Check version — skip if already at current version
+ const currentVersion = handlerStatus?.[handler._id]?.version;
+ if (currentVersion !== undefined && currentVersion >= handler.version && !handler.autoBackfill) {
+ return;
+ }
+
+ // Atomic claim
+ const claimed = await this.collection.findOneAndUpdate(
+ {
+ _id: requestId,
+ "run.status": "done",
+ [`run.handlerStatus.${handler._id}.status`]: { $nin: ["queued", "processing"] },
+ } as any,
+ {
+ $set: {
+ [`run.handlerStatus.${handler._id}.status`]: "queued",
+ [`run.handlerStatus.${handler._id}.updatedAt`]: new Date(),
+ },
+ } as any,
+ { returnDocument: "after" },
+ );
+
+ if (!claimed) return;
+
+ await this.enqueueToHandler(handler, requestId, (claimed as any).run?._id);
+ console.log(`[HandlerDispatcher] Dispatched ${handler._id} for ${requestId}`);
+ }
+
+ // ── Helpers ─────────────────────────────────────────────────────────
+
+ private buildDispatchFilter(
+ handler: HandlerServiceDocument,
+ allHandlers: HandlerServiceDocument[],
+ _graph: DependencyGraph,
+ ): Record | null {
+ const filter: Record = {
+ "run.status": "done",
+ deletedAt: { $exists: false },
+ [`run.handlerStatus.${handler._id}.status`]: { $nin: ["queued", "processing", "done"] },
+ };
+
+ // All dependencies must be "done"
+ if (handler.dependsOn && handler.dependsOn.length > 0) {
+ for (const depId of handler.dependsOn) {
+ filter[`run.handlerStatus.${depId}.status`] = "done";
+ }
+ }
+
+ // Backfill: version check
+ if (handler.autoBackfill) {
+ filter.$or = [
+ { [`run.handlerStatus.${handler._id}.version`]: { $exists: false } },
+ { [`run.handlerStatus.${handler._id}.version`]: { $lt: handler.version } },
+ ];
+ } else {
+ // Only dispatch if never processed
+ filter[`run.handlerStatus.${handler._id}.version`] = { $exists: false };
+ }
+
+ return filter;
+ }
+
+ private async enqueueToHandler(
+ handler: HandlerServiceDocument,
+ requestId: string,
+ runId: string,
+ ): Promise {
+ const queueClient = await this.getOrCreateQueueClient(handler.queue);
+ const message = Buffer.from(
+ JSON.stringify({
+ type: handler.selector,
+ requestId,
+ runId,
+ }),
+ ).toString("base64");
+
+ try {
+ await queueClient.sendMessage(message);
+ } catch (err) {
+ // Roll back status on queue failure
+ await this.collection.updateOne(
+ { _id: requestId } as any,
+ { $unset: { [`run.handlerStatus.${handler._id}.status`]: "" } } as any,
+ );
+ console.error(
+ `[HandlerDispatcher] Queue send failed for ${handler._id}/${requestId}, rolled back:`,
+ err,
+ );
+ }
+ }
+
+ private async getOrCreateQueueClient(queueName: string): Promise {
+ let client = this.queueClients.get(queueName);
+ if (!client) {
+ client = this.createQueueClient(queueName);
+ await client.createIfNotExists();
+ this.queueClients.set(queueName, client);
+ }
+ return client;
+ }
+
+ private async loadHandlers(): Promise {
+ const docs = await this.db
+ .collection("services")
+ .find({ type: "post-process-handler" })
+ .toArray();
+ return docs as unknown as HandlerServiceDocument[];
+ }
+
+ private buildGraph(handlers: HandlerServiceDocument[]): DependencyGraph {
+ const nodes = handlers.map((h) => ({ id: h._id, dependsOn: h.dependsOn }));
+ return new DependencyGraph(nodes);
+ }
+}
diff --git a/apps/scheduler/src/index.ts b/apps/scheduler/src/index.ts
index c3ed6f991..dce1509fe 100644
--- a/apps/scheduler/src/index.ts
+++ b/apps/scheduler/src/index.ts
@@ -2,12 +2,13 @@
// Licensed under the MIT License.
import "dotenv/config";
-import http from "node:http";
import { MongoClient } from "mongodb";
import { QueueClient } from "@azure/storage-queue";
import { DefaultAzureCredential } from "@azure/identity";
import { RequestScheduler, WorkerTypeConfig } from "./request-scheduler.js";
import { PostProcessorDispatcher } from "./post-processor-dispatcher.js";
+import { HandlerDispatcher } from "./handler-dispatcher.js";
+import { createHttpServer, type NotifyHandler } from "./notify-routes.js";
import type { RequestDocument } from "shared";
// ── Configuration ────────────────────────────────────────────────────
@@ -77,16 +78,6 @@ function createQueueClient(queueName: string): QueueClient {
return new QueueClient(queueUrl, credential);
}
-// ── Health Check Server ──────────────────────────────────────────────
-
-function createHealthServer(): http.Server {
- const server = http.createServer((_req, res) => {
- res.writeHead(200, { "Content-Type": "application/json" });
- res.end(JSON.stringify({ status: "ok", service: "scheduler" }));
- });
- return server;
-}
-
// ── Main ─────────────────────────────────────────────────────────────
async function main(): Promise {
@@ -145,10 +136,20 @@ async function main(): Promise {
postProcessorDispatcher.start();
console.log("[Scheduler] Post-processor dispatch loop started");
- // Start health check server
- const healthServer = createHealthServer();
- healthServer.listen(HEALTH_PORT, () => {
- console.log(`[Scheduler] Health check listening on :${HEALTH_PORT}`);
+ // Start the DAG-aware handler dispatcher (replaces legacy PostProcessorDispatcher)
+ const handlerDispatcher = new HandlerDispatcher(
+ collection,
+ db,
+ createQueueClient,
+ ppPollIntervalMs,
+ );
+ handlerDispatcher.start();
+ console.log("[Scheduler] Handler dispatcher (DAG) started");
+
+ // Wire notify handler to the HandlerDispatcher
+ const httpServer = createHttpServer(handlerDispatcher);
+ httpServer.listen(HEALTH_PORT, () => {
+ console.log(`[Scheduler] HTTP server listening on :${HEALTH_PORT}`);
});
// Graceful shutdown
@@ -156,7 +157,8 @@ async function main(): Promise {
console.log("[Scheduler] Shutting down...");
await scheduler.stop();
await postProcessorDispatcher.stop();
- healthServer.close();
+ await handlerDispatcher.stop();
+ httpServer.close();
await mongoClient.close();
console.log("[Scheduler] Shutdown complete");
process.exit(0);
diff --git a/apps/scheduler/src/notify-routes.test.ts b/apps/scheduler/src/notify-routes.test.ts
new file mode 100644
index 000000000..552f03243
--- /dev/null
+++ b/apps/scheduler/src/notify-routes.test.ts
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { AddressInfo } from "node:net";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { createHttpServer, type NotifyHandler } from "./notify-routes.js";
+
+async function startServer(handler: NotifyHandler): Promise<{ server: ReturnType; baseUrl: string }> {
+ const server = createHttpServer(handler);
+
+ await new Promise((resolve, reject) => {
+ server.once("error", reject);
+ server.listen(0, "127.0.0.1", () => resolve());
+ });
+
+ const address = server.address();
+ if (!address || typeof address === "string") {
+ throw new Error("Server did not bind to an address");
+ }
+
+ return {
+ server,
+ baseUrl: `http://127.0.0.1:${(address as AddressInfo).port}`,
+ };
+}
+
+async function stopServer(server: ReturnType): Promise {
+ await new Promise((resolve, reject) => {
+ server.close((error) => {
+ if (error) {
+ reject(error);
+ return;
+ }
+ resolve();
+ });
+ });
+}
+
+describe("createHttpServer", () => {
+ const servers: Array> = [];
+
+ afterEach(async () => {
+ while (servers.length > 0) {
+ const server = servers.pop();
+ if (server) {
+ await stopServer(server);
+ }
+ }
+ });
+
+ it("returns 200 for the health endpoint", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ };
+ const { server, baseUrl } = await startServer(handler);
+ servers.push(server);
+
+ const response = await fetch(`${baseUrl}/health`);
+
+ expect(response.status).toBe(200);
+ expect(await response.json()).toEqual({ status: "ok", service: "scheduler" });
+ });
+
+ it("calls onRunTerminal for valid run-terminal notifications", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ };
+ const { server, baseUrl } = await startServer(handler);
+ servers.push(server);
+
+ const response = await fetch(`${baseUrl}/notify/run-terminal`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ requestId: "req-1", runId: "run-1" }),
+ });
+
+ expect(response.status).toBe(200);
+ expect(await response.json()).toEqual({ ok: true });
+ expect(handler.onRunTerminal).toHaveBeenCalledWith("req-1", "run-1");
+ expect(handler.onHandlerComplete).not.toHaveBeenCalled();
+ });
+
+ it("calls onHandlerComplete for valid handler-complete notifications", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ };
+ const { server, baseUrl } = await startServer(handler);
+ servers.push(server);
+
+ const response = await fetch(`${baseUrl}/notify/handler-complete`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ requestId: "req-1",
+ runId: "run-1",
+ handlerId: "atif",
+ status: "done",
+ }),
+ });
+
+ expect(response.status).toBe(200);
+ expect(await response.json()).toEqual({ ok: true });
+ expect(handler.onHandlerComplete).toHaveBeenCalledWith("req-1", "run-1", "atif", "done");
+ expect(handler.onRunTerminal).not.toHaveBeenCalled();
+ });
+
+ it("returns 400 when required fields are missing", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ };
+ const { server, baseUrl } = await startServer(handler);
+ servers.push(server);
+
+ const response = await fetch(`${baseUrl}/notify/handler-complete`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ requestId: "req-1", runId: "run-1", status: "done" }),
+ });
+
+ expect(response.status).toBe(400);
+ expect(await response.json()).toEqual({
+ error: "requestId, runId, handlerId, and status (done|failed) are required",
+ });
+ expect(handler.onRunTerminal).not.toHaveBeenCalled();
+ expect(handler.onHandlerComplete).not.toHaveBeenCalled();
+ });
+
+ it("returns 404 for unknown routes", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ };
+ const { server, baseUrl } = await startServer(handler);
+ servers.push(server);
+
+ const response = await fetch(`${baseUrl}/notify/unknown`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({}),
+ });
+
+ expect(response.status).toBe(404);
+ expect(await response.json()).toEqual({ error: "Not found" });
+ });
+});
diff --git a/apps/scheduler/src/notify-routes.ts b/apps/scheduler/src/notify-routes.ts
new file mode 100644
index 000000000..445945d2d
--- /dev/null
+++ b/apps/scheduler/src/notify-routes.ts
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import http from "node:http";
+
+export interface NotifyHandler {
+ onRunTerminal(requestId: string, runId: string): Promise;
+ onHandlerComplete(
+ requestId: string,
+ runId: string,
+ handlerId: string,
+ status: "done" | "failed",
+ ): Promise;
+}
+
+interface RunTerminalRequest {
+ requestId: string;
+ runId: string;
+}
+
+interface HandlerCompleteRequest {
+ requestId: string;
+ runId: string;
+ handlerId: string;
+ status: "done" | "failed";
+}
+
+function sendJson(res: http.ServerResponse, statusCode: number, body: object): void {
+ res.writeHead(statusCode, { "Content-Type": "application/json" });
+ res.end(JSON.stringify(body));
+}
+
+function isRecord(value: unknown): value is Record {
+ return typeof value === "object" && value !== null;
+}
+
+function isNonEmptyString(value: unknown): value is string {
+ return typeof value === "string" && value.trim().length > 0;
+}
+
+function parseRunTerminalRequest(body: unknown): RunTerminalRequest | null {
+ if (!isRecord(body)) {
+ return null;
+ }
+
+ if (!isNonEmptyString(body.requestId) || !isNonEmptyString(body.runId)) {
+ return null;
+ }
+
+ return {
+ requestId: body.requestId,
+ runId: body.runId,
+ };
+}
+
+function parseHandlerCompleteRequest(body: unknown): HandlerCompleteRequest | null {
+ if (!isRecord(body)) {
+ return null;
+ }
+
+ if (
+ !isNonEmptyString(body.requestId) ||
+ !isNonEmptyString(body.runId) ||
+ !isNonEmptyString(body.handlerId) ||
+ (body.status !== "done" && body.status !== "failed")
+ ) {
+ return null;
+ }
+
+ return {
+ requestId: body.requestId,
+ runId: body.runId,
+ handlerId: body.handlerId,
+ status: body.status,
+ };
+}
+
+async function readJsonBody(req: http.IncomingMessage): Promise {
+ const chunks: Buffer[] = [];
+
+ for await (const chunk of req) {
+ chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
+ }
+
+ const rawBody = Buffer.concat(chunks).toString("utf-8").trim();
+ if (rawBody.length === 0) {
+ throw new Error("Request body is required");
+ }
+
+ return JSON.parse(rawBody) as unknown;
+}
+
+export function createHttpServer(handler: NotifyHandler): http.Server {
+ return http.createServer(async (req, res) => {
+ const method = req.method ?? "GET";
+ const url = new URL(req.url ?? "/", "http://localhost");
+
+ try {
+ if (method === "GET" && url.pathname === "/health") {
+ sendJson(res, 200, { status: "ok", service: "scheduler" });
+ return;
+ }
+
+ if (method === "POST" && url.pathname === "/notify/run-terminal") {
+ const parsedBody = parseRunTerminalRequest(await readJsonBody(req));
+ if (!parsedBody) {
+ sendJson(res, 400, { error: "requestId and runId are required" });
+ return;
+ }
+
+ await handler.onRunTerminal(parsedBody.requestId, parsedBody.runId);
+ sendJson(res, 200, { ok: true });
+ return;
+ }
+
+ if (method === "POST" && url.pathname === "/notify/handler-complete") {
+ const parsedBody = parseHandlerCompleteRequest(await readJsonBody(req));
+ if (!parsedBody) {
+ sendJson(res, 400, {
+ error: "requestId, runId, handlerId, and status (done|failed) are required",
+ });
+ return;
+ }
+
+ await handler.onHandlerComplete(
+ parsedBody.requestId,
+ parsedBody.runId,
+ parsedBody.handlerId,
+ parsedBody.status,
+ );
+ sendJson(res, 200, { ok: true });
+ return;
+ }
+ } catch (error) {
+ const message = error instanceof Error ? error.message : "Internal server error";
+ const statusCode =
+ message === "Request body is required" || error instanceof SyntaxError ? 400 : 500;
+
+ sendJson(res, statusCode, {
+ error:
+ statusCode === 400
+ ? "Invalid JSON request body"
+ : "Internal server error",
+ });
+ return;
+ }
+
+ sendJson(res, 404, { error: "Not found" });
+ });
+}
diff --git a/apps/workers/post-processor/src/post-processor.ts b/apps/workers/post-processor/src/post-processor.ts
index 2ffeab0b6..4b1b6e847 100644
--- a/apps/workers/post-processor/src/post-processor.ts
+++ b/apps/workers/post-processor/src/post-processor.ts
@@ -2,7 +2,7 @@
// Licensed under the MIT License.
import type { DequeuedMessageItem } from "@azure/storage-queue";
-import { BaseQueueProcessor, BlobStorage, Retry, type BaseQueueProcessorConfig, type LogEvent, type VisibilityHeartbeat } from "shared";
+import { BaseQueueProcessor, BlobStorage, type BaseQueueProcessorConfig, type LogEvent, type VisibilityHeartbeat } from "shared";
import { POST_PROCESSOR_VERSION } from "./version.js";
import type { PostProcessHandler, PostProcessorMessage, HandlerContext } from "./types.js";
@@ -86,35 +86,45 @@ export class PostProcessor extends BaseQueueProcessor {
await handler.process(msg, ctx);
- // Stamp version and status on success
+ // Stamp version and status on success (legacy fields + new handlerStatus)
+ const handlerId = `pp-${msg.type}`; // e.g., "pp-atif"
await this.collection.updateOne(
{ _id: doc._id } as any,
{
$set: {
"run.postProcessorVersion": POST_PROCESSOR_VERSION,
"run.postProcessorStatus": "done",
+ [`run.handlerStatus.${handlerId}.status`]: "done",
+ [`run.handlerStatus.${handlerId}.version`]: POST_PROCESSOR_VERSION,
+ [`run.handlerStatus.${handlerId}.updatedAt`]: new Date(),
},
} as any,
);
await log("info", `Post-processing complete (v${POST_PROCESSOR_VERSION})`);
- // Trigger report generation now that enrichment is done (best-effort)
- try {
- await this.triggerReportGeneration(doc._id, log);
- } catch (error) {
- await log("warn", `Failed to trigger report generation after retries: ${error}`);
- }
+ // Notify the scheduler that this handler is done (best-effort)
+ await this.notifyHandlerComplete(doc._id, doc.run?._id ?? "", handlerId, "done");
} catch (err) {
const errMsg = err instanceof Error ? err.message : String(err);
await log("error", `Handler '${msg.type}' failed: ${errMsg}`);
// Mark as failed so scheduler doesn't immediately re-dispatch
+ const handlerId = `pp-${msg.type}`;
await this.collection.updateOne(
{ _id: doc._id } as any,
- { $set: { "run.postProcessorStatus": "failed" } } as any,
+ {
+ $set: {
+ "run.postProcessorStatus": "failed",
+ [`run.handlerStatus.${handlerId}.status`]: "failed",
+ [`run.handlerStatus.${handlerId}.updatedAt`]: new Date(),
+ },
+ } as any,
);
+ // Notify scheduler of failure (best-effort — don't dispatch downstream)
+ await this.notifyHandlerComplete(doc._id, doc.run?._id ?? "", handlerId, "failed");
+
throw err;
}
@@ -124,27 +134,31 @@ export class PostProcessor extends BaseQueueProcessor {
}
/**
- * Trigger report generation via REST API.
- * Called after post-processing succeeds so reports can use enriched data.
+ * Notify the scheduler that a handler completed (or failed).
+ * Best-effort — the scheduler's poll safety net will catch up if this fails.
*/
- @Retry({ maxRetries: 3, baseDelayMs: 1000, isRetryable: () => true })
- private async triggerReportGeneration(requestId: string, log: (level: LogEvent["level"], message: string) => Promise): Promise {
- if (!this.apiBaseUrl) return;
-
- const response = await fetch(`${this.apiBaseUrl}/api/v1/reports/trigger`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ requestId }),
- });
- if (response.ok) {
- const result = await response.json() as { triggered: number };
- await log("info", `Triggered report generation: ${result.triggered} report(s) created`);
- return;
- }
- if (response.status >= 400 && response.status < 500) {
- await log("warn", `Failed to trigger report generation (${response.status}), not retrying`);
- return;
+ private async notifyHandlerComplete(
+ requestId: string,
+ runId: string,
+ handlerId: string,
+ status: "done" | "failed",
+ ): Promise {
+ const schedulerUrl = process.env.SCHEDULER_URL;
+ if (!schedulerUrl) return;
+
+ try {
+ const response = await fetch(`${schedulerUrl}/notify/handler-complete`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ requestId, runId, handlerId, status }),
+ });
+ if (response.ok) {
+ console.log(`[post-processor] Notified scheduler: ${handlerId} ${status} for ${requestId}`);
+ } else {
+ console.warn(`[post-processor] Scheduler notify failed: ${response.status}`);
+ }
+ } catch (err) {
+ console.warn(`[post-processor] Scheduler notify error for ${handlerId}/${requestId}:`, err);
}
- throw new Error(`Report trigger returned ${response.status} ${response.statusText}`);
}
}
diff --git a/apps/workers/taxonomy/Dockerfile b/apps/workers/taxonomy/Dockerfile
new file mode 100644
index 000000000..9e0792411
--- /dev/null
+++ b/apps/workers/taxonomy/Dockerfile
@@ -0,0 +1,19 @@
+FROM node:22-alpine AS builder
+WORKDIR /app
+COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
+COPY packages/shared/package.json packages/shared/
+COPY apps/workers/taxonomy/package.json apps/workers/taxonomy/
+RUN corepack enable && pnpm install --frozen-lockfile
+COPY packages/shared packages/shared
+COPY apps/workers/taxonomy apps/workers/taxonomy
+RUN pnpm --filter shared build && pnpm --filter taxonomy-handler build
+
+FROM node:22-alpine
+WORKDIR /app
+COPY --from=builder /app/node_modules ./node_modules
+COPY --from=builder /app/packages/shared/dist ./packages/shared/dist
+COPY --from=builder /app/packages/shared/package.json ./packages/shared/
+COPY --from=builder /app/apps/workers/taxonomy/dist ./apps/workers/taxonomy/dist
+COPY --from=builder /app/apps/workers/taxonomy/package.json ./apps/workers/taxonomy/
+WORKDIR /app/apps/workers/taxonomy
+CMD ["node", "dist/index.js"]
diff --git a/apps/workers/taxonomy/package.json b/apps/workers/taxonomy/package.json
new file mode 100644
index 000000000..aacbfc4f1
--- /dev/null
+++ b/apps/workers/taxonomy/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "taxonomy-handler",
+ "version": "1.0.0",
+ "type": "module",
+ "main": "dist/index.js",
+ "scripts": {
+ "build": "tsc",
+ "dev": "tsx watch src/index.ts",
+ "start": "node dist/index.js",
+ "lint": "eslint src/"
+ },
+ "dependencies": {
+ "shared": "workspace:*",
+ "@azure/storage-queue": "^12.25.0",
+ "@github/copilot-sdk": "^0.1.17",
+ "dotenv": "^16.4.5"
+ },
+ "devDependencies": {
+ "@types/node": "^22.7.0",
+ "tsx": "^4.19.0",
+ "typescript": "^5.6.2"
+ }
+}
diff --git a/apps/workers/taxonomy/src/index.ts b/apps/workers/taxonomy/src/index.ts
new file mode 100644
index 000000000..2ee1a8118
--- /dev/null
+++ b/apps/workers/taxonomy/src/index.ts
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import "dotenv/config";
+import { TaxonomyQueueProcessor, type TaxonomyQueueProcessorConfig } from "./taxonomy-queue-processor.js";
+
+const config: TaxonomyQueueProcessorConfig = {
+ mongoUri: process.env.MONGO_CONNECTION_STRING || process.env.AZURE_COSMOS_CONNECTION_STRING || "mongodb://localhost:27017",
+ mongoDatabase: process.env.MONGO_DATABASE || "requests-db",
+ mongoCollection: "requests",
+ storageAccountName: process.env.AZURE_STORAGE_ACCOUNT_NAME || "devstoreaccount1",
+ storageConnectionString: process.env.STORAGE_CONNECTION_STRING || process.env.AZURE_STORAGE_CONNECTION_STRING || undefined,
+ queueName: process.env.AZURE_STORAGE_QUEUE_TAXONOMY || "pp-taxonomy-queue",
+ batchSize: Number(process.env.BATCH_SIZE) || 1,
+ pollIntervalMs: Number(process.env.POLL_INTERVAL_MS) || 5000,
+ redisHost: process.env.REDIS_HOST || "localhost",
+ redisPort: Number(process.env.REDIS_PORT) || 6379,
+ redisPassword: process.env.REDIS_PASSWORD || "",
+ taxonomyModel: process.env.TAXONOMY_MODEL || "gpt-4.1",
+ apiBaseUrl: process.env.SCOPE_MT_API_URL || "http://localhost:3001",
+ sessionTimeoutMs: Number(process.env.SESSION_TIMEOUT_MS) || 5 * 60 * 1000,
+ schedulerUrl: process.env.SCHEDULER_URL,
+ tokenManagerUrl: process.env.TOKEN_MANAGER_URL,
+};
+
+const processor = new TaxonomyQueueProcessor(config);
+processor.start().catch((err) => {
+ console.error("[taxonomy-handler] Fatal error:", err);
+ process.exit(1);
+});
diff --git a/apps/workers/taxonomy/src/prompt.ts b/apps/workers/taxonomy/src/prompt.ts
new file mode 100644
index 000000000..47ea28e4d
--- /dev/null
+++ b/apps/workers/taxonomy/src/prompt.ts
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+export const TAXONOMY_SYSTEM_PROMPT = `You generate benchmark taxonomy documents for completed Scope runs.
+
+Your job is to inspect the run metadata and ATIF trajectories, then return a taxonomy JSON document that conforms exactly to the taxonomy Zod schema enforced by the worker.
+
+Required JSON shape:
+{
+ "meta": {
+ "generatedAt": "ISO-8601 datetime with offset",
+ "schemaVersion": "string",
+ "runId": "string",
+ "requestId": "string"
+ },
+ "scorecard": {
+ "summary": "string",
+ "profileResults": [
+ {
+ "profileId": "string",
+ "select": "best|median|worst",
+ "taskOutcome": "success|partial|failure",
+ "overallScore": 0-100,
+ "dimensions": [
+ {
+ "name": "string",
+ "score": 0-100,
+ "rationale": "string",
+ "evidence": ["string"]
+ }
+ ]
+ }
+ ],
+ "crossProfileInsights": ["string"]
+ },
+ "behaviorAnalysis": {
+ "patterns": [
+ {
+ "id": "string",
+ "category": "strength|weakness|inconsistency|regression",
+ "title": "string",
+ "description": "string",
+ "frequency": 0-1,
+ "impact": "critical|high|medium|low",
+ "evidence": [
+ {
+ "runId": "string",
+ "iteration": 0-or-greater integer,
+ "excerpt": "string"
+ }
+ ]
+ }
+ ],
+ "agentPersonality": {
+ "communicationStyle": "string",
+ "problemSolvingApproach": "string",
+ "errorRecoveryBehavior": "string"
+ }
+ },
+ "actionList": {
+ "fix": [actionItem],
+ "improve": [actionItem],
+ "investigate": [actionItem]
+ }
+}
+
+Each actionItem must include:
+- id
+- title
+- priority: critical|high|medium|low
+- description
+- ownership: agent-team|platform-team|prompt-engineer|scenario-author
+- relatedPatterns: string[]
+- suggestedApproach
+
+Output rules:
+- Return raw JSON only.
+- Do not wrap the JSON in markdown fences.
+- Do not include commentary before or after the JSON.
+- Every field must be valid for the schema.
+- Preserve the 3-layer structure: scorecard, behaviorAnalysis, actionList.
+- If a value is unknown, use the schema-compatible empty/null/default value rather than inventing facts.
+
+Use the available tools to gather evidence before answering:
+- get_run_data for the request, scenario, run, turns, and criteria outcomes.
+- get_atif_trajectory for ATIF evidence from individual iterations.
+
+Ground every classification in the actual run evidence. Prefer precise, stable labels over verbose prose. If validation feedback is provided later in the conversation, correct the JSON and return a full replacement document.`;
diff --git a/apps/workers/taxonomy/src/taxonomy-queue-processor.ts b/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
new file mode 100644
index 000000000..db2c7f7e3
--- /dev/null
+++ b/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
@@ -0,0 +1,336 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { DequeuedMessageItem } from "@azure/storage-queue";
+import { CopilotClient, SessionEvent } from "@github/copilot-sdk";
+import {
+ BaseQueueProcessor,
+ BlobStorage,
+ type BaseQueueProcessorConfig,
+ type LogEvent,
+ type RequestDocument,
+ taxonomySchema,
+ TokenManagerClient,
+ type TaxonomyDocument,
+ type VisibilityHeartbeat,
+ withRetry,
+} from "shared";
+import { TAXONOMY_SYSTEM_PROMPT } from "./prompt.js";
+import { createTaxonomyTools } from "./tools.js";
+
+const HANDLER_ID = "pp-taxonomy";
+const HANDLER_VERSION = 1;
+const DEFAULT_SESSION_TIMEOUT_MS = 5 * 60 * 1000;
+const DELTA_LOG_INTERVAL = 2_000;
+
+interface TaxonomyQueueMessage {
+ type: "taxonomy";
+ requestId: string;
+ runId?: string;
+}
+
+export interface TaxonomyQueueProcessorConfig extends BaseQueueProcessorConfig {
+ taxonomyModel: string;
+ apiBaseUrl: string;
+ sessionTimeoutMs?: number;
+ schedulerUrl?: string;
+ tokenManagerUrl?: string;
+}
+
+export class TaxonomyQueueProcessor extends BaseQueueProcessor {
+ private taxonomyConfig: TaxonomyQueueProcessorConfig;
+ private tokenClient: TokenManagerClient;
+ private blobStorage: BlobStorage;
+
+ constructor(config: TaxonomyQueueProcessorConfig) {
+ super(config, "taxonomy-handler");
+ this.taxonomyConfig = config;
+ this.tokenClient = new TokenManagerClient(config.tokenManagerUrl);
+ this.blobStorage = new BlobStorage({
+ storageAccountName: config.storageAccountName,
+ storageConnectionString: config.storageConnectionString,
+ });
+ }
+
+ protected override async handleRequest(
+ doc: RequestDocument,
+ message: DequeuedMessageItem,
+ heartbeat: VisibilityHeartbeat,
+ log: (level: LogEvent["level"], msg: string, data?: Record) => Promise,
+ payload?: Record,
+ ): Promise {
+ const queueMessage = payload as TaxonomyQueueMessage | undefined;
+ const requestId = doc._id;
+ const activeRunId = doc.run?._id;
+ const runId = queueMessage?.runId ?? activeRunId ?? requestId;
+
+ if (!queueMessage || queueMessage.type !== "taxonomy") {
+ await log("warn", "Discarding message with unsupported taxonomy payload", { payload });
+ await this.safeDeleteMessage(message.messageId, heartbeat.stop());
+ return;
+ }
+
+ if (queueMessage.runId && activeRunId && queueMessage.runId !== activeRunId) {
+ await log("warn", "Discarding stale taxonomy message for superseded run", {
+ requestId,
+ queuedRunId: queueMessage.runId,
+ activeRunId,
+ });
+ await this.safeDeleteMessage(message.messageId, heartbeat.stop());
+ return;
+ }
+
+ if (!doc.run) {
+ throw new Error(`Request ${requestId} has no active run to classify`);
+ }
+
+ await withRetry(() => this.collection.updateOne(
+ { _id: requestId } as never,
+ {
+ $set: {
+ [`run.handlerStatus.${HANDLER_ID}.status`]: "processing",
+ [`run.handlerStatus.${HANDLER_ID}.version`]: HANDLER_VERSION,
+ [`run.handlerStatus.${HANDLER_ID}.updatedAt`]: new Date(),
+ [`run.handlerStatus.${HANDLER_ID}.error`]: null,
+ },
+ } as never,
+ ));
+
+ await log("info", "Starting taxonomy generation", { requestId, runId, model: this.taxonomyConfig.taxonomyModel });
+
+ try {
+ const taxonomy = await this.generateTaxonomy(requestId, runId, log);
+ const blobName = `${requestId}/runs/${runId}/taxonomy.json`;
+ const taxonomyUrl = await this.blobStorage.uploadJson(blobName, taxonomy);
+
+ await withRetry(() => this.collection.updateOne(
+ { _id: requestId } as never,
+ {
+ $set: {
+ [`run.handlerStatus.${HANDLER_ID}.status`]: "done",
+ [`run.handlerStatus.${HANDLER_ID}.version`]: HANDLER_VERSION,
+ [`run.handlerStatus.${HANDLER_ID}.updatedAt`]: new Date(),
+ },
+ $unset: {
+ [`run.handlerStatus.${HANDLER_ID}.error`]: "",
+ },
+ } as never,
+ ));
+
+ await log("info", "Taxonomy generation completed", {
+ requestId,
+ runId,
+ blobName,
+ taxonomyUrl,
+ });
+
+ await this.notifyHandlerComplete(requestId, runId, "done");
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+
+ await withRetry(() => this.collection.updateOne(
+ { _id: requestId } as never,
+ {
+ $set: {
+ [`run.handlerStatus.${HANDLER_ID}.status`]: "failed",
+ [`run.handlerStatus.${HANDLER_ID}.version`]: HANDLER_VERSION,
+ [`run.handlerStatus.${HANDLER_ID}.updatedAt`]: new Date(),
+ [`run.handlerStatus.${HANDLER_ID}.error`]: errorMessage,
+ },
+ } as never,
+ ));
+
+ await log("error", `Taxonomy generation failed: ${errorMessage}`, { requestId, runId });
+ await this.notifyHandlerComplete(requestId, runId, "failed");
+ throw error;
+ }
+
+ const finalPopReceipt = heartbeat.stop();
+ await this.safeDeleteMessage(message.messageId, finalPopReceipt);
+ }
+
+ private async generateTaxonomy(
+ requestId: string,
+ runId: string,
+ log: (level: LogEvent["level"], msg: string, data?: Record) => Promise,
+ ): Promise {
+ const githubToken = await this.tokenClient.acquireToken("copilot-sdk");
+ const client = new CopilotClient({ githubToken });
+ const tools = createTaxonomyTools(this.taxonomyConfig.apiBaseUrl, requestId, this.blobStorage);
+ const timeoutMs = this.taxonomyConfig.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS;
+
+ let streamedResponse = "";
+ let latestMessage = "";
+ let lastLoggedCharCount = 0;
+ const toolNames = new Map();
+
+ try {
+ await log("info", "Acquired Copilot SDK token");
+
+ const session = await client.createSession({
+ model: this.taxonomyConfig.taxonomyModel,
+ streaming: true,
+ tools,
+ systemMessage: { mode: "replace", content: TAXONOMY_SYSTEM_PROMPT },
+ });
+
+ session.on((event: SessionEvent) => {
+ switch (event.type) {
+ case "session.start":
+ void log("info", "Copilot session started", {
+ sessionId: event.data.sessionId,
+ model: event.data.selectedModel,
+ });
+ break;
+ case "session.error":
+ void log("error", `Session error: ${event.data.message}`, { errorType: event.data.errorType });
+ break;
+ case "tool.execution_start":
+ toolNames.set(event.data.toolCallId, event.data.toolName);
+ void log("info", `Tool call: ${event.data.toolName}`, {
+ toolCallId: event.data.toolCallId,
+ arguments: event.data.arguments as Record | undefined,
+ });
+ break;
+ case "tool.execution_complete": {
+ const toolName = toolNames.get(event.data.toolCallId) ?? "unknown";
+ toolNames.delete(event.data.toolCallId);
+ void log("info", `Tool result: ${toolName} (${event.data.success ? "success" : "failed"})`, {
+ toolCallId: event.data.toolCallId,
+ error: event.data.error?.message,
+ });
+ break;
+ }
+ case "assistant.message_delta":
+ streamedResponse += event.data.deltaContent;
+ if (streamedResponse.length - lastLoggedCharCount >= DELTA_LOG_INTERVAL) {
+ lastLoggedCharCount = streamedResponse.length;
+ void log("info", `Generating taxonomy… (${streamedResponse.length} chars so far)`);
+ }
+ break;
+ case "assistant.message":
+ latestMessage = event.data.content;
+ break;
+ }
+ });
+
+ let attempts = 0;
+ const maxAttempts = 3;
+ let prompt = [
+ `Generate taxonomy JSON for request ${requestId} and run ${runId}.`,
+ "Use get_run_data first, then inspect ATIF trajectories that materially affect the classification.",
+ "Return only raw JSON that satisfies the taxonomy schema.",
+ ].join(" ");
+ let lastJson: string | undefined;
+
+ while (attempts < maxAttempts) {
+ attempts += 1;
+ streamedResponse = "";
+ latestMessage = "";
+ lastLoggedCharCount = 0;
+
+ await log("info", `Sending taxonomy prompt to Copilot SDK (attempt ${attempts}/${maxAttempts})`, {
+ requestId,
+ runId,
+ timeoutMs,
+ });
+
+ const response = await session.sendAndWait({ prompt }, timeoutMs);
+ const responseText = response?.data.content?.trim() || latestMessage.trim() || streamedResponse.trim();
+
+ if (!responseText) {
+ throw new Error("Copilot SDK returned an empty taxonomy response");
+ }
+
+ const jsonText = extractJson(responseText);
+ lastJson = jsonText;
+
+ let parsedJson: unknown;
+ try {
+ parsedJson = JSON.parse(jsonText) as unknown;
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ if (attempts >= maxAttempts) {
+ throw new Error(`Taxonomy response was not valid JSON after ${maxAttempts} attempts: ${errorMessage}`);
+ }
+
+ prompt = [
+ "Your previous response was not valid JSON.",
+ `JSON parse error: ${errorMessage}.`,
+ "Return the full taxonomy document again as raw JSON only, with no markdown fences or commentary.",
+ "Replace the entire response with corrected JSON.",
+ ].join(" ");
+ continue;
+ }
+
+ const validation = taxonomySchema.safeParse(parsedJson);
+ if (validation.success) {
+ return validation.data;
+ }
+
+ const validationErrors = formatValidationErrors(validation.error.issues);
+ await log("warn", `Taxonomy validation failed on attempt ${attempts}`, {
+ issues: validationErrors,
+ });
+
+ if (attempts >= maxAttempts) {
+ throw new Error(
+ `Taxonomy schema validation failed after ${maxAttempts} attempts: ${validationErrors.join(" | ")}`,
+ );
+ }
+
+ prompt = [
+ "Your previous taxonomy JSON did not satisfy the schema.",
+ "Correct the document and return the entire replacement JSON object.",
+ "Do not include markdown fences or commentary.",
+ `Validation errors: ${validationErrors.join("; ")}`,
+ lastJson ? `Previous JSON: ${lastJson}` : "",
+ ].filter(Boolean).join(" ");
+ }
+
+ throw new Error("Taxonomy generation ended without a valid document");
+ } finally {
+ await client.stop().catch(() => undefined);
+ }
+ }
+
+ private async notifyHandlerComplete(
+ requestId: string,
+ runId: string,
+ status: "done" | "failed",
+ ): Promise {
+ const schedulerUrl = this.taxonomyConfig.schedulerUrl;
+ if (!schedulerUrl) return;
+
+ try {
+ const response = await fetch(`${schedulerUrl}/notify/handler-complete`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ requestId, runId, handlerId: HANDLER_ID, status }),
+ });
+
+ if (!response.ok) {
+ console.warn(`[taxonomy-handler] Scheduler notify failed: ${response.status}`);
+ }
+ } catch (error) {
+ console.warn(`[taxonomy-handler] Scheduler notify error for ${requestId}/${runId}:`, error);
+ }
+ }
+}
+
+function extractJson(responseText: string): string {
+ const trimmed = responseText.trim();
+ if (!trimmed.startsWith("```")) {
+ return trimmed;
+ }
+
+ const fenceMatch = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
+ return fenceMatch?.[1]?.trim() ?? trimmed;
+}
+
+function formatValidationErrors(issues: Array<{ path: PropertyKey[]; message: string }>): string[] {
+ return issues.map((issue) => {
+ const path = issue.path.length > 0 ? issue.path.map((segment) => String(segment)).join(".") : "";
+ return `${path}: ${issue.message}`;
+ });
+}
diff --git a/apps/workers/taxonomy/src/tools.ts b/apps/workers/taxonomy/src/tools.ts
new file mode 100644
index 000000000..9c92b5b18
--- /dev/null
+++ b/apps/workers/taxonomy/src/tools.ts
@@ -0,0 +1,156 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { defineTool } from "@github/copilot-sdk";
+import { BlobStorage, type ConversationTurn, type RequestDocument } from "shared";
+
+interface GetAtifTrajectoryArgs {
+ iteration?: number;
+}
+
+function resolveSnapshotsBlobName(blobUrl: string): string {
+ const url = new URL(blobUrl);
+ const containerPrefix = "/snapshots/";
+ const containerIndex = url.pathname.indexOf(containerPrefix);
+ if (containerIndex === -1) {
+ throw new Error(`Blob URL does not contain the snapshots container: ${blobUrl}`);
+ }
+ return decodeURIComponent(url.pathname.substring(containerIndex + containerPrefix.length));
+}
+
+function selectTurnWithAtif(turns: ConversationTurn[] | undefined, requestedIteration?: number): ConversationTurn | undefined {
+ if (!turns?.length) return undefined;
+
+ if (requestedIteration !== undefined) {
+ return turns.find((turn) => turn.iteration === requestedIteration && typeof turn.atifUrl === "string");
+ }
+
+ return [...turns]
+ .filter((turn) => typeof turn.atifUrl === "string")
+ .sort((a, b) => b.iteration - a.iteration)[0];
+}
+
+export function createTaxonomyTools(
+ apiBaseUrl: string,
+ requestId: string,
+ blobStorage: BlobStorage,
+) {
+ const getRunData = defineTool("get_run_data", {
+ description:
+ "Fetch the full request document plus the active run state, including scenario, persona, turns, criteria results, and handler status.",
+ parameters: {
+ type: "object",
+ properties: {},
+ },
+ handler: async () => {
+ try {
+ const response = await fetch(`${apiBaseUrl}/api/v1/requests/${requestId}`);
+ if (!response.ok) {
+ return { error: `Failed to fetch request: ${response.status} ${response.statusText}` };
+ }
+
+ const request: RequestDocument = await response.json();
+ const run = request.run;
+
+ return {
+ request: {
+ id: request._id,
+ workerType: request.workerType,
+ model: request.model,
+ reasoningEffort: request.reasoningEffort,
+ maxIterations: request.maxIterations,
+ createdAt: request.createdAt,
+ updatedAt: request.updatedAt,
+ persona: request.persona,
+ personaInstructions: request.personaInstructions,
+ mcpServers: request.mcpServers,
+ skillRevisions: request.skillRevisions,
+ extensions: request.extensions,
+ priority: request.priority,
+ scenario: request.scenario,
+ },
+ run: run ? {
+ id: run._id,
+ attemptNumber: run.attemptNumber,
+ status: run.status,
+ outcome: run.outcome,
+ result: run.result,
+ error: run.error,
+ startedAt: run.startedAt,
+ finishedAt: run.finishedAt,
+ updatedAt: run.updatedAt,
+ aiCallCount: run.aiCallCount,
+ tokenUsage: run.tokenUsage,
+ handlerStatus: run.handlerStatus,
+ turns: run.turns?.map((turn) => ({
+ iteration: turn.iteration,
+ passed: turn.passed,
+ timestamp: turn.timestamp,
+ startedAt: turn.startedAt,
+ durationMs: turn.durationMs,
+ judgeFeedback: turn.judgeFeedback,
+ codingAgentResponse: turn.codingAgentResponse,
+ aiCallCount: turn.aiCallCount,
+ tokenUsage: turn.tokenUsage,
+ snapshotUrl: turn.snapshotUrl,
+ rawChatUrl: turn.rawChatUrl,
+ rawChatFormat: turn.rawChatFormat,
+ toolCallsUrl: turn.toolCallsUrl,
+ toolCallCount: turn.toolCallCount,
+ atifUrl: turn.atifUrl,
+ criteriaResults: turn.criteriaResults,
+ })) ?? [],
+ } : null,
+ };
+ } catch (err) {
+ return { error: `Failed to fetch run data: ${err}` };
+ }
+ },
+ });
+
+ const getAtifTrajectory = defineTool("get_atif_trajectory", {
+ description:
+ "Fetch an ATIF trajectory JSON document for a specific iteration, or the latest available iteration when omitted.",
+ parameters: {
+ type: "object",
+ properties: {
+ iteration: {
+ type: "number",
+ description: "Optional 1-based iteration number. If omitted, the latest available ATIF trajectory is returned.",
+ },
+ },
+ },
+ handler: async (args: GetAtifTrajectoryArgs) => {
+ try {
+ const response = await fetch(`${apiBaseUrl}/api/v1/requests/${requestId}`);
+ if (!response.ok) {
+ return { error: `Failed to fetch request: ${response.status} ${response.statusText}` };
+ }
+
+ const request: RequestDocument = await response.json();
+ const selectedTurn = selectTurnWithAtif(request.run?.turns, args.iteration);
+
+ if (!selectedTurn?.atifUrl) {
+ return {
+ error: args.iteration !== undefined
+ ? `No ATIF trajectory available for iteration ${args.iteration}`
+ : "No ATIF trajectory is available for this run",
+ };
+ }
+
+ const blobName = resolveSnapshotsBlobName(selectedTurn.atifUrl);
+ const buffer = await blobStorage.downloadBlobToBuffer(blobName);
+ const trajectory: unknown = JSON.parse(buffer.toString("utf-8"));
+
+ return {
+ iteration: selectedTurn.iteration,
+ trajectory,
+ };
+ } catch (err) {
+ return { error: `Failed to fetch ATIF trajectory: ${err}` };
+ }
+ },
+ });
+
+ return [getRunData, getAtifTrajectory];
+}
diff --git a/apps/workers/taxonomy/tsconfig.json b/apps/workers/taxonomy/tsconfig.json
new file mode 100644
index 000000000..bf012ecbb
--- /dev/null
+++ b/apps/workers/taxonomy/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "compilerOptions": {
+ "outDir": "./dist",
+ "rootDir": "./src"
+ },
+ "include": ["src/**/*"]
+}
diff --git a/docker-compose.yml b/docker-compose.yml
index d1ca5dcb0..a4503d104 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,6 +9,7 @@
# docker compose --profile vscode-web up # + VS Code Web worker
# docker compose --profile claude-code --profile copilot up # multiple workers
# docker compose --profile report up # + Report Generator worker
+# docker compose --profile taxonomy up # + Taxonomy handler worker
# docker compose up mongodb redis azurite # infra only (run app services natively)
#
# Host-native debugging:
@@ -35,6 +36,7 @@ x-worker-env: &worker-env
<<: *common-env
JUDGE_SERVICE_URL: http://judge:80
SCOPE_MT_API_URL: http://api:80
+ SCHEDULER_URL: http://scheduler:8080
TOKEN_MANAGER_URL: http://token-manager:80
x-worker-deps: &worker-deps
@@ -138,7 +140,7 @@ services:
timeout: 5s
retries: 5
- # Creates the 'har' blob container in Azurite for the gateway HAR plugin.
+ # Creates the 'har' blob container and handler queues in Azurite.
azurite-init:
image: mcr.microsoft.com/azure-cli:2.68.0
restart: "no"
@@ -146,9 +148,12 @@ services:
azurite:
condition: service_healthy
environment:
- AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;"
+ AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://azurite:10001/devstoreaccount1;BlobEndpoint=http://azurite:10000/devstoreaccount1;"
command: >
- sh -c "az storage container create --name har --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true"
+ sh -c "az storage container create --name har --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true &&
+ az storage queue create --name report-queue --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true &&
+ az storage queue create --name post-processor-queue --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true &&
+ az storage queue create --name pp-taxonomy-queue --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true"
# ===========================================================================
# Application services
@@ -638,6 +643,34 @@ services:
api:
condition: service_started
+ taxonomy-handler:
+ build:
+ context: .
+ dockerfile: apps/workers/taxonomy/Dockerfile
+ profiles: [taxonomy, all]
+ environment:
+ <<: *common-env
+ AZURE_STORAGE_QUEUE_TAXONOMY: pp-taxonomy-queue
+ TAXONOMY_MODEL: ${TAXONOMY_MODEL:-gpt-4.1}
+ SCOPE_MT_API_URL: http://api:80
+ SCHEDULER_URL: http://scheduler:8080
+ GITHUB_TOKEN: ${GITHUB_TOKEN:-}
+ TOKEN_MANAGER_URL: http://token-manager:80
+ GIT_COMMIT: ${GIT_COMMIT:-development}
+ SESSION_TIMEOUT_MS: ${SESSION_TIMEOUT_MS:-300000}
+ depends_on:
+ mongodb:
+ condition: service_healthy
+ required: false
+ redis:
+ condition: service_healthy
+ azurite:
+ condition: service_healthy
+ api:
+ condition: service_started
+ scheduler:
+ condition: service_started
+
register-version-post-processor:
build:
context: .
@@ -661,6 +694,7 @@ services:
<<: *common-env
AZURE_STORAGE_QUEUE_POSTPROCESSOR: post-processor-queue
SCOPE_MT_API_URL: http://api:80
+ SCHEDULER_URL: http://scheduler:8080
depends_on:
mongodb:
condition: service_healthy
diff --git a/docs/architecture/db-migrations.md b/docs/architecture/db-migrations.md
index 9cfd9540e..fbe5b1cd4 100644
--- a/docs/architecture/db-migrations.md
+++ b/docs/architecture/db-migrations.md
@@ -102,6 +102,9 @@ When you run a command:
| `007-rename-exhausted-to-finished` | Renames outcome `exhausted` → `finished` |
| `008-backfill-ai-call-count` | Downloads HARs from blob storage to count AI completion calls per turn |
| `009-add-requests-filter-indexes` | Adds indexes on `taskPromptId`, `status`, `outcome`, `workerType`, `deletedAt` for server-side filtering/grouping |
+| `018-migrate-services-to-handler-dag` | Replaces the legacy single `post-processor` service row with per-handler service registrations and dependencies |
+| `019-add-handler-status-index` | Adds handler-specific dispatch indexes for `pp-atif`, `pp-taxonomy`, and `pp-report` polling |
+| `020-backfill-handler-status` | Backfills `run.handlerStatus.pp-atif` from deprecated `run.postProcessorStatus` / `run.postProcessorVersion` fields |
## CI/CD
diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md
index 8c919498b..7550c5703 100644
--- a/docs/architecture/overview.md
+++ b/docs/architecture/overview.md
@@ -79,6 +79,8 @@ flowchart TB
| `shared` | Shared types and utilities |
| `workers/coder-acp-claude-code` | Claude Code agent via Agent Client Protocol (ACP) |
| `workers/coder-acp-copilot` | GitHub Copilot agent via Agent Client Protocol (ACP) |
+| `workers/report-generator` | Copilot SDK worker that generates post-run markdown reports |
+| `workers/taxonomy` | Copilot SDK worker that generates validated post-run taxonomy JSON |
| `gateway` | AI Gateway — shared Rust TLS-intercepting proxy with plugin architecture (HAR capture, future: token refresh, rate limiting) |
## Data Flow
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index c351b830c..7bdf7e2e8 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -14,8 +14,9 @@ flowchart LR
Two paths trigger post-processing:
-1. **Event-driven (primary):** Coder workers enqueue a post-processing message immediately when a run completes, setting `run.postProcessorStatus: "queued"` atomically in the same DB write.
-2. **Scheduler backfill:** The `PostProcessorDispatcher` polls every 30 seconds for runs that have `status: "done"` but no `postProcessorStatus` set (or a `postProcessorVersion` below the current target). This catches runs that completed before the event-driven dispatch was deployed, or that need re-processing after a version bump.
+1. **Event-driven (primary):** Coder workers enqueue a post-processing message immediately when a run completes, currently setting the deprecated `run.postProcessorStatus: "queued"` compatibility field atomically in the same DB write while the system migrates to per-handler status.
+2. **Scheduler backfill:** The `PostProcessorDispatcher` polls every 30 seconds for runs that have `status: "done"` but no post-processing marker set (or a stale handler version). During the migration window this may consult the deprecated flat fields; the long-term source of truth is `run.handlerStatus[handlerId]`. This catches runs that completed before the event-driven dispatch was deployed, or that need re-processing after a version bump.
+3. **Scheduler notify server:** The scheduler also exposes `GET /health`, `POST /notify/run-terminal`, and `POST /notify/handler-complete` on a lightweight `node:http` server. Workers and post-process handlers use these endpoints to notify the scheduler when terminal states are reached so it can re-evaluate which root or downstream handlers are ready to dispatch.
## ATIF Generation
@@ -32,8 +33,24 @@ Two paths trigger post-processing:
- Uploads `atif.trajectory.json` to blob storage at `{requestId}/runs/{runId}/iteration-{N}/atif.trajectory.json`
- Updates `run.turns.$.atifUrl` in the request document
-4. On success, stamps `run.postProcessorVersion` and sets `run.postProcessorStatus: "done"`
-5. Triggers report generation via the API (best-effort, with retry)
+4. On success, stamps `run.handlerStatus["pp-atif"] = { status: "done", version: N }` (while legacy `run.postProcessorVersion` / `run.postProcessorStatus` may still be mirrored during the transition)
+5. Triggers downstream taxonomy/report handlers once the scheduler sees the dependency graph is satisfied
+
+## Taxonomy Generation
+
+The taxonomy handler (`apps/workers/taxonomy/`) consumes messages from the dedicated `pp-taxonomy-queue` and produces a structured JSON artifact for a completed run. It uses the GitHub Copilot SDK with a tool-backed session to fetch run metadata from the API and ATIF trajectories from blob storage, then validates the generated JSON against the shared taxonomy Zod schema.
+
+### Flow
+
+1. Queue message arrives: `{ type: "taxonomy", requestId, runId }`
+2. Worker fetches the request document from MongoDB and marks `run.handlerStatus["pp-taxonomy"].status = "processing"`
+3. Copilot SDK session calls:
+ - `get_run_data` to fetch the request + active run from the API
+ - `get_atif_trajectory` to fetch per-iteration ATIF JSON from blob storage
+4. The worker validates the assistant response with `taxonomySchema.safeParse()`
+5. If validation fails, the worker feeds the schema errors back into the same session and retries up to 3 total attempts
+6. On success, the worker uploads `taxonomy.json` to `{requestId}/runs/{runId}/taxonomy.json`
+7. The worker stamps `run.handlerStatus["pp-taxonomy"] = { status: "done", version: 1 }` and calls `POST /notify/handler-complete`
### Blob Storage Layout
@@ -98,10 +115,10 @@ processor.start();
The post-processor uses a version-based re-processing scheme:
-- The worker declares its version in `src/version.ts` (e.g., `export const POST_PROCESSOR_VERSION = 1`)
-- On each deploy, a registration Job writes `{ _id: "post-processor", version: N }` to the `services` collection
-- The scheduler's `PostProcessorDispatcher` compares each request's `run.postProcessorVersion` against the registered version
-- Requests with a lower version are re-dispatched for processing with the new handler logic
+- Each handler is registered independently in the `services` collection using a `post-process-handler` document keyed by handler ID (for example `pp-atif`, `pp-taxonomy`, `pp-report`)
+- Each registration stores the handler `version`, queue name, selector, `autoBackfill` behavior, and `dependsOn` DAG edges
+- The scheduler compares each request's per-handler status/version state (for example `run.handlerStatus["pp-atif"]`) against the registered handler entry for that selector
+- Requests with missing or outdated handler state are re-dispatched for that specific handler once its dependencies are satisfied
This allows deploying handler improvements and having them automatically applied to historical data.
@@ -127,16 +144,20 @@ stateDiagram-v2
| Environment Variable | Default | Description |
| --- | --- | --- |
-| `AZURE_STORAGE_QUEUE_POSTPROCESSOR` | `post-processor-queue` | Queue name for post-processor messages |
+| `AZURE_STORAGE_QUEUE_POSTPROCESSOR` | `post-processor-queue` | Queue name for ATIF post-processor messages |
+| `AZURE_STORAGE_QUEUE_TAXONOMY` | `pp-taxonomy-queue` | Queue name for taxonomy-generation jobs |
| `SCHEDULER_PP_POLL_INTERVAL_MS` | `30000` | Scheduler backfill polling interval |
| `BATCH_SIZE` | `1` | Messages to process per poll (worker-side) |
| `POLL_INTERVAL_MS` | `5000` | Worker queue polling interval |
-| `SCOPE_MT_API_URL` / `API_BASE_URL` | `http://localhost:3001` | API URL for report generation trigger |
+| `SCOPE_MT_API_URL` / `API_BASE_URL` | `http://localhost:3001` | API URL used by report/taxonomy Copilot tools |
+| `TAXONOMY_MODEL` | `gpt-4.1` | Copilot SDK model used by the taxonomy handler |
+| `SESSION_TIMEOUT_MS` | `300000` | Timeout for report/taxonomy Copilot SDK sessions |
+| `SCHEDULER_URL` | _(unset)_ | Optional scheduler notify base URL for downstream handler dispatch |
## Infrastructure
-- **Queue:** Azure Storage Queue (`post-processor-queue`)
+- **Queues:** Azure Storage Queues (`post-processor-queue` for ATIF, `pp-taxonomy-queue` for taxonomy, `report-queue` for reports)
- **Blob Storage:** `snapshots` container (shared with HAR, tool-calls, and other artifacts)
-- **Database:** MongoDB `requests` collection (`run.postProcessorStatus`, `run.postProcessorVersion` fields)
+- **Database:** MongoDB `requests` collection (`run.handlerStatus` map keyed by handler ID, with deprecated `run.postProcessorStatus` / `run.postProcessorVersion` compatibility fields during migration)
- **KEDA:** ScaledObject scales the worker to zero when queue is empty
- **Version registration:** Kubernetes Job runs on each deploy; Docker Compose uses an init service
\ No newline at end of file
diff --git a/packages/db-migrations/src/check-migrations.test.ts b/packages/db-migrations/src/check-migrations.test.ts
index 6c631b83e..7a7a07b63 100644
--- a/packages/db-migrations/src/check-migrations.test.ts
+++ b/packages/db-migrations/src/check-migrations.test.ts
@@ -7,6 +7,7 @@ import {
resetMigrationCheckCache,
type MigrationCheckResult,
} from "./check-migrations.js";
+import { REQUIRED_MIGRATIONS } from "./required-migrations.js";
// Mock Db
function makeMockDb(appliedFiles: string[]) {
@@ -30,55 +31,19 @@ describe("checkMigrations", () => {
});
it("returns ready when all required migrations are applied", async () => {
- const db = makeMockDb([
- "001-backfill-task-prompts.ts",
- "002-create-indexes.ts",
- "003-create-skill-indexes.ts",
- "004-add-submission-id-index.ts",
- "005-backfill-iteration-durations.ts",
- "006-split-status-outcome.ts",
- "007-rename-exhausted-to-finished.ts",
- "008-backfill-ai-call-count.ts",
- "009-add-requests-filter-indexes.ts",
- "010-add-requests-pagination-index.ts",
- "011-add-profile-indexes.ts",
- "012-add-profile-name-index.ts",
- "013-remove-logs-from-docs.ts",
- "014-introduce-runs-and-run.ts",
- "015-add-priority-and-scheduler-index.ts",
- "016-fix-scheduler-sort-index.ts",
- "017-add-post-processor-dispatch-index.ts",
- ]);
+ const db = makeMockDb([...REQUIRED_MIGRATIONS]);
const result = await checkMigrations(db);
expect(result.ready).toBe(true);
expect(result.pending).toEqual([]);
- expect(result.totalApplied).toBe(17);
- expect(result.applied).toEqual([
- "001-backfill-task-prompts.ts",
- "002-create-indexes.ts",
- "003-create-skill-indexes.ts",
- "004-add-submission-id-index.ts",
- "005-backfill-iteration-durations.ts",
- "006-split-status-outcome.ts",
- "007-rename-exhausted-to-finished.ts",
- "008-backfill-ai-call-count.ts",
- "009-add-requests-filter-indexes.ts",
- "010-add-requests-pagination-index.ts",
- "011-add-profile-indexes.ts",
- "012-add-profile-name-index.ts",
- "013-remove-logs-from-docs.ts",
- "014-introduce-runs-and-run.ts",
- "015-add-priority-and-scheduler-index.ts",
- "016-fix-scheduler-sort-index.ts",
- "017-add-post-processor-dispatch-index.ts",
- ]);
+ expect(result.totalApplied).toBe(REQUIRED_MIGRATIONS.length);
+ expect(result.applied).toEqual(REQUIRED_MIGRATIONS);
});
it("returns not ready when migrations are missing", async () => {
const db = makeMockDb(["001-backfill-task-prompts.ts"]);
const result = await checkMigrations(db);
expect(result.ready).toBe(false);
- expect(result.pending).toEqual(["002-create-indexes.ts", "003-create-skill-indexes.ts", "004-add-submission-id-index.ts", "005-backfill-iteration-durations.ts", "006-split-status-outcome.ts", "007-rename-exhausted-to-finished.ts", "008-backfill-ai-call-count.ts", "009-add-requests-filter-indexes.ts", "010-add-requests-pagination-index.ts", "011-add-profile-indexes.ts", "012-add-profile-name-index.ts", "013-remove-logs-from-docs.ts", "014-introduce-runs-and-run.ts", "015-add-priority-and-scheduler-index.ts", "016-fix-scheduler-sort-index.ts", "017-add-post-processor-dispatch-index.ts"]);
+ expect(result.pending).toEqual(REQUIRED_MIGRATIONS.slice(1));
expect(result.applied).toEqual(["001-backfill-task-prompts.ts"]);
expect(result.totalApplied).toBe(1);
});
@@ -87,54 +52,20 @@ describe("checkMigrations", () => {
const db = makeMockDb([]);
const result = await checkMigrations(db);
expect(result.ready).toBe(false);
- expect(result.pending).toEqual([
- "001-backfill-task-prompts.ts",
- "002-create-indexes.ts",
- "003-create-skill-indexes.ts",
- "004-add-submission-id-index.ts",
- "005-backfill-iteration-durations.ts",
- "006-split-status-outcome.ts",
- "007-rename-exhausted-to-finished.ts",
- "008-backfill-ai-call-count.ts",
- "009-add-requests-filter-indexes.ts",
- "010-add-requests-pagination-index.ts",
- "011-add-profile-indexes.ts",
- "012-add-profile-name-index.ts",
- "013-remove-logs-from-docs.ts",
- "014-introduce-runs-and-run.ts",
- "015-add-priority-and-scheduler-index.ts",
- "016-fix-scheduler-sort-index.ts",
- "017-add-post-processor-dispatch-index.ts",
- ]);
+ expect(result.pending).toEqual(REQUIRED_MIGRATIONS);
expect(result.applied).toEqual([]);
expect(result.totalApplied).toBe(0);
});
it("ignores extra applied migrations not in the required list", async () => {
const db = makeMockDb([
- "001-backfill-task-prompts.ts",
- "002-create-indexes.ts",
- "003-create-skill-indexes.ts",
- "004-add-submission-id-index.ts",
- "005-backfill-iteration-durations.ts",
- "006-split-status-outcome.ts",
- "007-rename-exhausted-to-finished.ts",
- "008-backfill-ai-call-count.ts",
- "009-add-requests-filter-indexes.ts",
- "010-add-requests-pagination-index.ts",
- "011-add-profile-indexes.ts",
- "012-add-profile-name-index.ts",
- "013-remove-logs-from-docs.ts",
- "014-introduce-runs-and-run.ts",
- "015-add-priority-and-scheduler-index.ts",
- "016-fix-scheduler-sort-index.ts",
- "017-add-post-processor-dispatch-index.ts",
+ ...REQUIRED_MIGRATIONS,
"999-future-migration.ts",
]);
const result = await checkMigrations(db);
expect(result.ready).toBe(true);
expect(result.pending).toEqual([]);
- expect(result.totalApplied).toBe(18);
+ expect(result.totalApplied).toBe(REQUIRED_MIGRATIONS.length + 1);
});
it("caches results within TTL", async () => {
diff --git a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
new file mode 100644
index 000000000..9ea8644fe
--- /dev/null
+++ b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+
+interface ServiceDocument {
+ _id: string;
+ version: number;
+ type?: "post-process-handler";
+ queue?: string;
+ selector?: string;
+ autoBackfill?: boolean;
+ dependsOn?: string[];
+}
+
+type HandlerServiceSeed = Required & {
+ type: "post-process-handler";
+};
+
+const HANDLER_SERVICES: readonly HandlerServiceSeed[] = [
+ {
+ _id: "pp-atif",
+ type: "post-process-handler",
+ version: 2,
+ queue: "post-processor-queue",
+ selector: "atif",
+ autoBackfill: true,
+ dependsOn: [],
+ },
+ {
+ _id: "pp-taxonomy",
+ type: "post-process-handler",
+ version: 1,
+ queue: "pp-taxonomy-queue",
+ selector: "taxonomy",
+ autoBackfill: false,
+ dependsOn: ["pp-atif"],
+ },
+ {
+ _id: "pp-report",
+ type: "post-process-handler",
+ version: 1,
+ queue: "report-queue",
+ selector: "report",
+ autoBackfill: false,
+ dependsOn: ["pp-atif", "pp-taxonomy"],
+ },
+];
+
+export class MigrateServicesToHandlerDag implements MigrationInterface {
+ async up(db: Db): Promise {
+ const services = db.collection("services");
+
+ await services.deleteOne({ _id: "post-processor" });
+ console.log("[018] Deleted legacy post-processor service entry if it existed");
+
+ for (const service of HANDLER_SERVICES) {
+ const { _id, ...fields } = service;
+ await services.updateOne(
+ { _id },
+ {
+ $set: {
+ ...fields,
+ dependsOn: [...fields.dependsOn],
+ },
+ },
+ { upsert: true },
+ );
+ console.log(`[018] Upserted handler service ${_id}`);
+ }
+ }
+
+ async down(db: Db): Promise {
+ const services = db.collection("services");
+
+ await services.deleteMany({ _id: { $in: HANDLER_SERVICES.map((service) => service._id) } });
+ console.log("[018-down] Deleted handler service entries");
+
+ await services.updateOne(
+ { _id: "post-processor" },
+ {
+ $set: { version: 2 },
+ $unset: {
+ type: "",
+ queue: "",
+ selector: "",
+ autoBackfill: "",
+ dependsOn: "",
+ },
+ },
+ { upsert: true },
+ );
+ console.log("[018-down] Restored legacy post-processor service entry");
+ }
+}
diff --git a/packages/db-migrations/src/migrations/019-add-handler-status-index.ts b/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
new file mode 100644
index 000000000..ecdb0352a
--- /dev/null
+++ b/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+
+const HANDLER_STATUS_INDEXES = [
+ {
+ name: "idx_handler_dispatch_atif",
+ key: {
+ "run.handlerStatus.pp-atif.status": 1 as const,
+ "run.status": 1 as const,
+ updatedAt: -1 as const,
+ },
+ },
+ {
+ name: "idx_handler_dispatch_taxonomy",
+ key: {
+ "run.handlerStatus.pp-taxonomy.status": 1 as const,
+ "run.status": 1 as const,
+ updatedAt: -1 as const,
+ },
+ },
+ {
+ name: "idx_handler_dispatch_report",
+ key: {
+ "run.handlerStatus.pp-report.status": 1 as const,
+ "run.status": 1 as const,
+ updatedAt: -1 as const,
+ },
+ },
+] as const;
+
+export class AddHandlerStatusIndex implements MigrationInterface {
+ async up(db: Db): Promise {
+ const requests = db.collection("requests");
+
+ for (const index of HANDLER_STATUS_INDEXES) {
+ try {
+ const createdName = await requests.createIndex(index.key, { name: index.name });
+ const exists = await requests.indexExists(createdName);
+ console.log(
+ exists
+ ? `[019] Created ${index.name} index on requests`
+ : `[019] ${index.name} was requested but is not visible in getIndexes()`,
+ );
+ } catch (err: unknown) {
+ const message = err instanceof Error ? err.message : String(err);
+ console.log(`[019] ${index.name} already exists or couldn't be created: ${message}`);
+ }
+ }
+ }
+
+ async down(db: Db): Promise {
+ const requests = db.collection("requests");
+
+ for (const index of HANDLER_STATUS_INDEXES) {
+ try {
+ await requests.dropIndex(index.name);
+ console.log(`[019-down] Dropped ${index.name} index`);
+ } catch (err: unknown) {
+ const codeName = typeof err === "object" && err !== null && "codeName" in err
+ ? String((err as { codeName?: unknown }).codeName)
+ : undefined;
+ if (codeName !== "IndexNotFound") {
+ const message = err instanceof Error ? err.message : String(err);
+ console.log(`[019-down] ${index.name} not found: ${message}`);
+ }
+ }
+ }
+ }
+}
diff --git a/packages/db-migrations/src/migrations/020-backfill-handler-status.ts b/packages/db-migrations/src/migrations/020-backfill-handler-status.ts
new file mode 100644
index 000000000..ac5326afd
--- /dev/null
+++ b/packages/db-migrations/src/migrations/020-backfill-handler-status.ts
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { AnyBulkWriteOperation, Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+
+const BATCH_SIZE = 100;
+
+type RequestWithPostProcessorState = {
+ _id: string;
+ run?: {
+ postProcessorStatus?: "queued" | "processing" | "done" | "failed";
+ postProcessorVersion?: number;
+ };
+};
+
+export class BackfillHandlerStatus implements MigrationInterface {
+ async up(db: Db): Promise {
+ const requests = db.collection("requests");
+ const cursor = requests.find(
+ { "run.postProcessorVersion": { $exists: true } },
+ {
+ projection: {
+ _id: 1,
+ "run.postProcessorStatus": 1,
+ "run.postProcessorVersion": 1,
+ },
+ batchSize: BATCH_SIZE,
+ },
+ );
+
+ let processed = 0;
+ let modified = 0;
+ let batch: AnyBulkWriteOperation[] = [];
+
+ for await (const doc of cursor) {
+ const version = doc.run?.postProcessorVersion;
+ if (version === undefined) {
+ continue;
+ }
+
+ batch.push({
+ updateOne: {
+ filter: { _id: doc._id, "run.postProcessorVersion": { $exists: true } },
+ update: {
+ $set: {
+ "run.handlerStatus.pp-atif": {
+ status: doc.run?.postProcessorStatus ?? "done",
+ version,
+ },
+ },
+ },
+ },
+ });
+
+ if (batch.length >= BATCH_SIZE) {
+ const result = await requests.bulkWrite(batch, { ordered: false });
+ processed += batch.length;
+ modified += result.modifiedCount;
+ batch = [];
+ }
+ }
+
+ if (batch.length > 0) {
+ const result = await requests.bulkWrite(batch, { ordered: false });
+ processed += batch.length;
+ modified += result.modifiedCount;
+ }
+
+ console.log(` Backfilled handlerStatus for ${modified} runs (processed ${processed})`);
+ }
+
+ async down(_db: Db): Promise {
+ // No-op: deprecated flat fields remain intact for rollback compatibility.
+ }
+}
diff --git a/packages/db-migrations/src/required-migrations.ts b/packages/db-migrations/src/required-migrations.ts
index 120a54d0d..c1f1079d3 100644
--- a/packages/db-migrations/src/required-migrations.ts
+++ b/packages/db-migrations/src/required-migrations.ts
@@ -30,4 +30,7 @@ export const REQUIRED_MIGRATIONS: readonly string[] = [
"015-add-priority-and-scheduler-index.ts",
"016-fix-scheduler-sort-index.ts",
"017-add-post-processor-dispatch-index.ts",
+ "018-migrate-services-to-handler-dag.ts",
+ "019-add-handler-status-index.ts",
+ "020-backfill-handler-status.ts",
];
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index 392a9cde2..e2af74303 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -21,4 +21,5 @@ export * from "./devproxy/index.js";
export * from "./har/index.js";
export * from "./utils/index.js";
export * from "./schemas/index.js";
+export * from "./schemas/taxonomy.js";
export * from "./cursor.js";
diff --git a/packages/shared/src/queue/queue-processor.test.ts b/packages/shared/src/queue/queue-processor.test.ts
index fb2a1dc95..2323e0057 100644
--- a/packages/shared/src/queue/queue-processor.test.ts
+++ b/packages/shared/src/queue/queue-processor.test.ts
@@ -269,8 +269,9 @@ describe("CodingAgentQueueProcessor.handleRequest redelivery handling", () => {
});
// ─── Post-processor event-driven dispatch ────────────────────────────────────
-describe("CodingAgentQueueProcessor.enqueuePostProcessing", () => {
- it("sends a post-processor queue message when postProcessorQueueName is configured", async () => {
+describe("CodingAgentQueueProcessor.notifyRunTerminal", () => {
+ it("sends a post-processor queue message via legacy fallback when SCHEDULER_URL is not set", async () => {
+ delete process.env.SCHEDULER_URL;
const configWithPP: QueueProcessorConfig = {
...testConfig,
postProcessorQueueName: "post-processor-queue",
@@ -280,7 +281,7 @@ describe("CodingAgentQueueProcessor.enqueuePostProcessing", () => {
const sendMessage = vi.fn().mockResolvedValue({});
(qp as any).postProcessorQueueClient = { sendMessage };
- await (qp as any).enqueuePostProcessing("req-123", "run-456");
+ await (qp as any).notifyRunTerminal("req-123", "run-456");
expect(sendMessage).toHaveBeenCalledTimes(1);
const decoded = JSON.parse(
@@ -289,13 +290,15 @@ describe("CodingAgentQueueProcessor.enqueuePostProcessing", () => {
expect(decoded).toEqual({ type: "atif", requestId: "req-123", runId: "run-456" });
});
- it("does nothing when postProcessorQueueClient is null", async () => {
+ it("does nothing when postProcessorQueueClient is null and SCHEDULER_URL not set", async () => {
+ delete process.env.SCHEDULER_URL;
const qp = new CodingAgentQueueProcessor(testConfig, stubProcessor);
expect((qp as any).postProcessorQueueClient).toBeNull();
- await (qp as any).enqueuePostProcessing("req-123", "run-456");
+ await (qp as any).notifyRunTerminal("req-123", "run-456");
});
it("logs a warning but does not throw on queue send failure", async () => {
+ delete process.env.SCHEDULER_URL;
const configWithPP: QueueProcessorConfig = {
...testConfig,
postProcessorQueueName: "post-processor-queue",
@@ -306,7 +309,7 @@ describe("CodingAgentQueueProcessor.enqueuePostProcessing", () => {
(qp as any).postProcessorQueueClient = { sendMessage };
const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => {});
- await (qp as any).enqueuePostProcessing("req-123", "run-456");
+ await (qp as any).notifyRunTerminal("req-123", "run-456");
expect(warnSpy).toHaveBeenCalledWith(
expect.stringContaining("Failed to enqueue post-processing"),
expect.any(Error),
diff --git a/packages/shared/src/queue/queue-processor.ts b/packages/shared/src/queue/queue-processor.ts
index f663284f7..0324499b4 100644
--- a/packages/shared/src/queue/queue-processor.ts
+++ b/packages/shared/src/queue/queue-processor.ts
@@ -44,7 +44,7 @@ export class CodingAgentQueueProcessor extends BaseQueueProcessor {
+ private async notifyRunTerminal(requestId: string, runId: string): Promise {
+ const schedulerUrl = process.env.SCHEDULER_URL;
+ if (schedulerUrl) {
+ try {
+ const response = await fetch(`${schedulerUrl}/notify/run-terminal`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ requestId, runId }),
+ });
+ if (response.ok) {
+ console.log(`[${this.workerName}] Notified scheduler: run-terminal for ${requestId}`);
+ } else {
+ console.warn(`[${this.workerName}] Scheduler notify failed: ${response.status} — poll will catch up`);
+ }
+ return;
+ } catch (err) {
+ console.warn(`[${this.workerName}] Scheduler notify error for ${requestId} — poll will catch up:`, err);
+ return;
+ }
+ }
+
+ // Legacy fallback: direct queue enqueue
+ await this.enqueuePostProcessingLegacy(requestId, runId);
+ }
+
+ /**
+ * @deprecated Legacy direct queue enqueue. Use notifyRunTerminal instead.
+ * Kept as fallback when SCHEDULER_URL is not configured.
+ */
+ private async enqueuePostProcessingLegacy(requestId: string, runId: string): Promise {
if (!this.postProcessorQueueClient) return;
try {
const message = Buffer.from(
@@ -79,9 +109,9 @@ export class CodingAgentQueueProcessor extends BaseQueueProcessor {
- await this.enqueuePostProcessing(requestId, runId);
+ await this.notifyRunTerminal(requestId, runId);
}
/** Build workerVersion and OS fields for stamping on request documents.
@@ -243,8 +273,8 @@ export class CodingAgentQueueProcessor extends BaseQueueProcessor {
- const apiBaseUrl = (this.config as QueueProcessorConfig).apiBaseUrl;
- if (!apiBaseUrl) return;
-
- try {
- const response = await fetch(`${apiBaseUrl}/api/v1/reports/trigger`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ requestId }),
- });
- if (response.ok) {
- const result = await response.json() as { triggered: number };
- console.log(`[${this.workerName}] Triggered report generation for request ${requestId}: ${result.triggered} report(s) created`);
- } else {
- console.warn(`[${this.workerName}] Failed to trigger report generation: ${response.status} ${response.statusText}`);
- }
- } catch (error) {
- console.warn(`[${this.workerName}] Failed to trigger report generation: ${error}`);
- }
- }
-
/**
* Extract skill archives to the workspace filesystem so agents can discover them.
* Must be called after setup() so that processor.workspacePath points to the
@@ -597,8 +601,8 @@ export class CodingAgentQueueProcessor extends BaseQueueProcessor {
+ const validFixture = {
+ meta: {
+ generatedAt: "2025-02-01T12:00:00Z",
+ schemaVersion: "1.0.0",
+ runId: "run-123",
+ requestId: "req-456",
+ },
+ scorecard: {
+ summary: "The agent usually succeeds but struggles with recovery quality.",
+ profileResults: [
+ {
+ profileId: "profile-best",
+ select: "best",
+ taskOutcome: "success",
+ overallScore: 92,
+ dimensions: [
+ {
+ name: "Correctness",
+ score: 95,
+ rationale: "Implemented the requested behavior fully.",
+ evidence: ["All acceptance criteria passed", "No regressions observed"],
+ },
+ ],
+ },
+ ],
+ crossProfileInsights: [
+ "The agent communicates clearly across profiles.",
+ "Stress conditions reduce recovery quality.",
+ ],
+ },
+ behaviorAnalysis: {
+ patterns: [
+ {
+ id: "pattern-1",
+ category: "strength",
+ title: "Consistent planning",
+ description: "The agent outlines a clear plan before making changes.",
+ frequency: 0.75,
+ impact: "high",
+ evidence: [
+ {
+ runId: "run-123",
+ iteration: 1,
+ excerpt: "Plan: inspect the failing endpoint, then patch the handler.",
+ },
+ ],
+ },
+ ],
+ agentPersonality: {
+ communicationStyle: "Concise and structured",
+ problemSolvingApproach: "Hypothesis-driven debugging",
+ errorRecoveryBehavior: "Retries with targeted fixes after inspecting evidence",
+ },
+ },
+ actionList: {
+ fix: [
+ {
+ id: "action-1",
+ title: "Stabilize recovery prompts",
+ priority: "critical",
+ description: "Reduce failures when the first attempt is rejected.",
+ ownership: "prompt-engineer",
+ relatedPatterns: ["pattern-1"],
+ suggestedApproach: "Add explicit fallback guidance for failed first passes.",
+ },
+ ],
+ improve: [
+ {
+ id: "action-2",
+ title: "Expand planning examples",
+ priority: "medium",
+ description: "Reinforce successful planning behavior.",
+ ownership: "agent-team",
+ relatedPatterns: ["pattern-1"],
+ suggestedApproach: "Fine-tune on traces with strong upfront decomposition.",
+ },
+ ],
+ investigate: [
+ {
+ id: "action-3",
+ title: "Review profile variance",
+ priority: "low",
+ description: "Understand why profile-specific regressions appear sporadically.",
+ ownership: "scenario-author",
+ relatedPatterns: ["pattern-1"],
+ suggestedApproach: "Compare scenario wording against affected profile runs.",
+ },
+ ],
+ },
+ };
+
+ it("accepts a valid taxonomy fixture", () => {
+ const result = taxonomySchema.safeParse(validFixture);
+ expect(result.success).toBe(true);
+ });
+
+ it("rejects fixtures missing required fields with precise paths", () => {
+ const invalidFixture = {
+ ...validFixture,
+ scorecard: {
+ ...validFixture.scorecard,
+ profileResults: [
+ {
+ ...validFixture.scorecard.profileResults[0],
+ dimensions: [
+ {
+ name: "Correctness",
+ score: 95,
+ evidence: ["All acceptance criteria passed"],
+ },
+ ],
+ },
+ ],
+ },
+ behaviorAnalysis: {
+ ...validFixture.behaviorAnalysis,
+ agentPersonality: {
+ communicationStyle: "Concise and structured",
+ errorRecoveryBehavior: "Retries with targeted fixes after inspecting evidence",
+ },
+ },
+ };
+
+ const result = taxonomySchema.safeParse(invalidFixture);
+ expect(result.success).toBe(false);
+ if (result.success) {
+ throw new Error("Expected invalid taxonomy fixture to fail parsing");
+ }
+
+ const issuePaths = result.error.issues.map((issue) => issue.path);
+ expect(issuePaths).toContainEqual([
+ "scorecard",
+ "profileResults",
+ 0,
+ "dimensions",
+ 0,
+ "rationale",
+ ]);
+ expect(issuePaths).toContainEqual([
+ "behaviorAnalysis",
+ "agentPersonality",
+ "problemSolvingApproach",
+ ]);
+ });
+
+ it("enforces enum values", () => {
+ const invalidFixture = {
+ ...validFixture,
+ actionList: {
+ ...validFixture.actionList,
+ fix: [
+ {
+ ...validFixture.actionList.fix[0],
+ priority: "urgent",
+ },
+ ],
+ },
+ };
+
+ const result = taxonomySchema.safeParse(invalidFixture);
+ expect(result.success).toBe(false);
+ if (result.success) {
+ throw new Error("Expected invalid enum fixture to fail parsing");
+ }
+
+ expect(result.error.issues.map((issue) => issue.path)).toContainEqual([
+ "actionList",
+ "fix",
+ 0,
+ "priority",
+ ]);
+ });
+});
diff --git a/packages/shared/src/schemas/taxonomy.ts b/packages/shared/src/schemas/taxonomy.ts
new file mode 100644
index 000000000..a837d4f91
--- /dev/null
+++ b/packages/shared/src/schemas/taxonomy.ts
@@ -0,0 +1,104 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { z } from "zod";
+
+const scoreSchema = z.number().min(0).max(100);
+const frequencySchema = z.number().min(0).max(1);
+
+/** Taxonomy document metadata. */
+export const taxonomyMetaSchema = z.object({
+ generatedAt: z.string().datetime({ offset: true }),
+ schemaVersion: z.string().min(1),
+ runId: z.string().min(1),
+ requestId: z.string().min(1),
+});
+
+/** Scorecard dimension result for a single profile. */
+export const scorecardDimensionSchema = z.object({
+ name: z.string().min(1),
+ score: scoreSchema,
+ rationale: z.string().min(1),
+ evidence: z.array(z.string().min(1)),
+});
+
+/** Scorecard result for a specific profile slice. */
+export const profileResultSchema = z.object({
+ profileId: z.string().min(1),
+ select: z.enum(["best", "median", "worst"]),
+ taskOutcome: z.enum(["success", "partial", "failure"]),
+ overallScore: scoreSchema,
+ dimensions: z.array(scorecardDimensionSchema),
+});
+
+/** Top-level scorecard section summarizing profile results. */
+export const scorecardSchema = z.object({
+ summary: z.string().min(1),
+ profileResults: z.array(profileResultSchema),
+ crossProfileInsights: z.array(z.string().min(1)),
+});
+
+/** Evidence excerpt supporting an observed behavior pattern. */
+export const behaviorEvidenceSchema = z.object({
+ runId: z.string().min(1),
+ iteration: z.number().int().min(0),
+ excerpt: z.string().min(1),
+});
+
+/** Cross-run behavioral pattern identified by the taxonomy analysis. */
+export const behaviorPatternSchema = z.object({
+ id: z.string().min(1),
+ category: z.enum(["strength", "weakness", "inconsistency", "regression"]),
+ title: z.string().min(1),
+ description: z.string().min(1),
+ frequency: frequencySchema,
+ impact: z.enum(["critical", "high", "medium", "low"]),
+ evidence: z.array(behaviorEvidenceSchema),
+});
+
+/** Qualitative description of the agent's personality traits. */
+export const agentPersonalitySchema = z.object({
+ communicationStyle: z.string().min(1),
+ problemSolvingApproach: z.string().min(1),
+ errorRecoveryBehavior: z.string().min(1),
+});
+
+/** Behavior analysis section describing patterns and personality. */
+export const behaviorAnalysisSchema = z.object({
+ patterns: z.array(behaviorPatternSchema),
+ agentPersonality: agentPersonalitySchema,
+});
+
+/** Action item emitted by the taxonomy analysis. */
+export const actionItemSchema = z.object({
+ id: z.string().min(1),
+ title: z.string().min(1),
+ priority: z.enum(["critical", "high", "medium", "low"]),
+ description: z.string().min(1),
+ ownership: z.enum([
+ "agent-team",
+ "platform-team",
+ "prompt-engineer",
+ "scenario-author",
+ ]),
+ relatedPatterns: z.array(z.string().min(1)),
+ suggestedApproach: z.string().min(1),
+});
+
+/** Prioritized action lists grouped by remediation intent. */
+export const actionListSchema = z.object({
+ fix: z.array(actionItemSchema),
+ improve: z.array(actionItemSchema),
+ investigate: z.array(actionItemSchema),
+});
+
+/** Complete taxonomy document produced by the taxonomy post-processor. */
+export const taxonomySchema = z.object({
+ meta: taxonomyMetaSchema,
+ scorecard: scorecardSchema,
+ behaviorAnalysis: behaviorAnalysisSchema,
+ actionList: actionListSchema,
+});
+
+/** Inferred TypeScript type for the taxonomy document. */
+export type TaxonomyDocument = z.infer;
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index c23444417..77fcb57b4 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -206,6 +206,14 @@ export interface QueueMessagePayload {
runId?: string;
}
+/** Status of a single post-process handler for a specific run. */
+export interface HandlerRunStatus {
+ status: "queued" | "processing" | "done" | "failed";
+ version?: number;
+ updatedAt?: Date;
+ error?: string;
+}
+
/**
* RunState — represents one execution attempt of a request.
*
@@ -270,12 +278,11 @@ export interface RunState {
aiCallCount?: number;
rawChatUrl?: string;
rawChatFormat?: string;
- /** Version of the post-processor that last successfully processed this run.
- * Used by the scheduler to detect runs needing (re-)processing when the
- * post-processor version advances. */
+ /** Per-handler post-processing status. Keys are handler IDs (e.g. "pp-atif", "pp-taxonomy", "pp-report"). */
+ handlerStatus?: Record;
+ /** @deprecated Use handlerStatus["pp-atif"].version instead. Kept for migration compatibility. */
postProcessorVersion?: number;
- /** Lifecycle status of post-processing for this run. Prevents duplicate
- * enqueuing and tracks processing progress. */
+ /** @deprecated Use handlerStatus["pp-atif"].status instead. Kept for migration compatibility. */
postProcessorStatus?: "queued" | "processing" | "done" | "failed";
}
@@ -287,6 +294,17 @@ export interface RunHistoryDocument extends RunState {
requestId: string; // FK → RequestDocument._id
}
+/** A post-process handler registered in the `services` collection. */
+export interface HandlerServiceDocument {
+ _id: string;
+ type: "post-process-handler";
+ version: number;
+ queue: string;
+ selector: string;
+ autoBackfill: boolean;
+ dependsOn: string[];
+}
+
/**
* Field names whose values move from `RequestDocument` (top-level, legacy
* shape) into `RequestDocument.run: RunState` (new shape introduced for
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 339c191ba..a7903fc00 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -705,6 +705,31 @@ importers:
specifier: ^5.6.2
version: 5.9.3
+ apps/workers/taxonomy:
+ dependencies:
+ '@azure/storage-queue':
+ specifier: ^12.25.0
+ version: 12.29.0
+ '@github/copilot-sdk':
+ specifier: ^0.1.17
+ version: 0.1.23
+ dotenv:
+ specifier: ^16.4.5
+ version: 16.6.1
+ shared:
+ specifier: workspace:*
+ version: link:../../../packages/shared
+ devDependencies:
+ '@types/node':
+ specifier: ^22.7.0
+ version: 22.19.10
+ tsx:
+ specifier: ^4.19.0
+ version: 4.21.0
+ typescript:
+ specifier: ^5.6.2
+ version: 5.9.3
+
packages/copilot-driver-ext:
devDependencies:
'@types/node':
From e9bf6ad106cb0cd8135164ca0220a2d69908d3fd Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 02:15:31 -0700
Subject: [PATCH 017/287] feat: add taxonomy API route and archive bundling
(Phase 3)
- Add GET /api/v1/requests/:id/taxonomy endpoint
- Bundle taxonomy.json in run download tar.gz archive
- Add taxonomyUrl to RunState type and request schema
- Update taxonomy worker to persist run.taxonomyUrl
- Update OpenAPI snapshot and post-processing docs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../openapi-snapshot.test.ts.snap | 63 +++++++++++
apps/api/src/archive-har.test.ts | 41 +++++++
apps/api/src/archive-har.ts | 29 ++++-
apps/api/src/index.ts | 2 +
apps/api/src/routes/requests/taxonomy.test.ts | 107 ++++++++++++++++++
apps/api/src/routes/requests/taxonomy.ts | 30 +++++
.../taxonomy/src/taxonomy-queue-processor.ts | 1 +
docs/architecture/post-processing.md | 7 +-
packages/shared/src/schemas/request.ts | 1 +
packages/shared/src/types/types.ts | 2 +
10 files changed, 281 insertions(+), 2 deletions(-)
create mode 100644 apps/api/src/routes/requests/taxonomy.test.ts
create mode 100644 apps/api/src/routes/requests/taxonomy.ts
diff --git a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
index 7912955e3..16ee7fc6d 100644
--- a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
+++ b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
@@ -2313,6 +2313,9 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
],
"type": "string",
},
+ "taxonomyUrl": {
+ "type": "string",
+ },
"tokenUsage": {
"$ref": "#/components/schemas/TokenUsage",
},
@@ -7981,6 +7984,40 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
],
},
},
+ "/api/v1/requests/{id}/runs/{runId}/taxonomy": {
+ "get": {
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "required": true,
+ "schema": {
+ "type": "string",
+ },
+ },
+ {
+ "in": "path",
+ "name": "runId",
+ "required": true,
+ "schema": {
+ "type": "string",
+ },
+ },
+ ],
+ "responses": {
+ "200": {
+ "description": "Taxonomy v1 JSON document (scorecard, behavior analysis, action list)",
+ },
+ "404": {
+ "description": "Not found — taxonomy not yet generated",
+ },
+ },
+ "summary": "Download taxonomy JSON for a specific attempt",
+ "tags": [
+ "Requests",
+ ],
+ },
+ },
"/api/v1/requests/{id}/runs/{runId}/tool-calls": {
"get": {
"parameters": [
@@ -8083,6 +8120,32 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
],
},
},
+ "/api/v1/requests/{id}/taxonomy": {
+ "get": {
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "required": true,
+ "schema": {
+ "type": "string",
+ },
+ },
+ ],
+ "responses": {
+ "200": {
+ "description": "Taxonomy v1 JSON document (scorecard, behavior analysis, action list)",
+ },
+ "404": {
+ "description": "Not found — taxonomy not yet generated",
+ },
+ },
+ "summary": "Download taxonomy JSON for the run",
+ "tags": [
+ "Requests",
+ ],
+ },
+ },
"/api/v1/requests/{id}/tool-calls": {
"get": {
"parameters": [
diff --git a/apps/api/src/archive-har.test.ts b/apps/api/src/archive-har.test.ts
index f83d846ac..51d5e36f2 100644
--- a/apps/api/src/archive-har.test.ts
+++ b/apps/api/src/archive-har.test.ts
@@ -99,6 +99,17 @@ describe("rewriteHarUrlsForArchive", () => {
expect(result.run!.turns![1].toolCallsUrl).toBe("iteration-2.tool-calls.jsonl");
expect(result.run!.turns![2].toolCallsUrl).toBeUndefined();
});
+
+ it("rewrites run.taxonomyUrl to taxonomy.json", () => {
+ const resource = {
+ run: {
+ taxonomyUrl: "https://storage.blob.core.windows.net/snapshots/abc123/runs/attempt-1/taxonomy.json",
+ turns: [],
+ },
+ };
+ const result = rewriteHarUrlsForArchive(resource);
+ expect(result.run!.taxonomyUrl).toBe("taxonomy.json");
+ });
});
// --- blobNameFromSnapshotsUrl ---
@@ -844,4 +855,34 @@ describe("packRunIntoTar", () => {
expect(yaml).toContain("iteration-1.chat-result.json");
expect(yaml).not.toContain("blob.core.windows.net");
});
+
+ it("bundles run-level taxonomy.json and rewrites taxonomyUrl", async () => {
+ const { pack } = await import("tar-stream");
+ const p = pack();
+ const taxonomyData = Buffer.from('{"topics":["agent"]}');
+ const container = makeMockBlobContainer({
+ "run-010/runs/attempt-1/taxonomy.json": { body: taxonomyData, length: taxonomyData.length },
+ });
+
+ const run: ArchivableRun = {
+ _id: "run-010",
+ run: {
+ taxonomyUrl: "https://storage.blob.core.windows.net/snapshots/run-010/runs/attempt-1/taxonomy.json",
+ turns: [],
+ },
+ };
+
+ const entriesPromise = collectPackEntries(p);
+ await packRunIntoTar(p, run, container, "run-010", () => true);
+ p.finalize();
+
+ const entries = await entriesPromise;
+ const names = entries.map(e => e.name);
+ expect(names).toContain("run-010/taxonomy.json");
+ expect(entries.find(e => e.name === "run-010/taxonomy.json")!.data).toEqual(taxonomyData);
+
+ const yaml = entries.find(e => e.name === "run-010/run.yaml")!.data.toString();
+ expect(yaml).toContain("taxonomy.json");
+ expect(yaml).not.toContain("blob.core.windows.net");
+ });
});
diff --git a/apps/api/src/archive-har.ts b/apps/api/src/archive-har.ts
index 21f922179..86cfeb1ee 100644
--- a/apps/api/src/archive-har.ts
+++ b/apps/api/src/archive-har.ts
@@ -41,11 +41,12 @@ export function blobNameFromLogsUrl(url: string): string | null {
/**
* Deep-clone a run resource and rewrite `harUrl`, `rawChatUrl`,
- * `chatResultUrl`, and `toolCallsUrl` fields to relative archive paths.
+ * `taxonomyUrl`, `chatResultUrl`, and `toolCallsUrl` fields to relative archive paths.
*
* - `run.harUrl` → `"run.har"`
* - Per-turn `harUrl` → `"iteration-{N}.har"`
* - `run.rawChatUrl` → `"run.chat-export.json"`
+ * - `run.taxonomyUrl` → `"taxonomy.json"`
* - Per-turn `rawChatUrl` → `"iteration-{N}.chat-export.json"`
* - Per-turn `chatResultUrl` → `"iteration-{N}.chat-result.json"`
* - Per-turn `toolCallsUrl` → `"iteration-{N}.tool-calls.jsonl"`
@@ -54,6 +55,7 @@ export function rewriteHarUrlsForArchive;
[key: string]: unknown;
};
@@ -66,6 +68,9 @@ export function rewriteHarUrlsForArchive ({
+ checkMigrations: vi.fn().mockResolvedValue({ ready: true, applied: ["001", "002"], pending: [] }),
+}));
+
+vi.hoisted(() => {
+ process.env.STORAGE_CONNECTION_STRING = "DefaultEndpointsProtocol=https;AccountName=mockaccount;AccountKey=bW9jaw==;EndpointSuffix=core.windows.net";
+});
+
+vi.mock("../../llm.js", () => ({ isLlmAvailable: vi.fn().mockReturnValue(false) }));
+vi.mock("../../prompt-feature-llm.js", () => ({ isLlmAvailable: vi.fn().mockReturnValue(false) }));
+vi.mock("../../task-prompt-llm.js", () => ({ isTaskPromptLlmAvailable: vi.fn().mockReturnValue(false) }));
+
+const { mockDownload, mockGetProperties, mockGetBlockBlobClient, mockGetBlobClient, mockGetContainerClient } = vi.hoisted(() => {
+ const mockDownload = vi.fn();
+ const mockGetProperties = vi.fn();
+ const mockGetBlockBlobClient = vi.fn().mockReturnValue({ download: mockDownload, getProperties: mockGetProperties });
+ const mockGetBlobClient = vi.fn().mockReturnValue({ download: mockDownload, getProperties: mockGetProperties });
+ const mockGetContainerClient = vi.fn().mockReturnValue({ getBlockBlobClient: mockGetBlockBlobClient, getBlobClient: mockGetBlobClient });
+ return { mockDownload, mockGetProperties, mockGetBlockBlobClient, mockGetBlobClient, mockGetContainerClient };
+});
+
+vi.mock("@azure/storage-blob", async (importOriginal) => {
+ const original = await importOriginal();
+ return {
+ ...original,
+ BlobServiceClient: { fromConnectionString: vi.fn().mockReturnValue({ getContainerClient: mockGetContainerClient }) },
+ };
+});
+
+describe("taxonomy endpoints", () => {
+ let mocks: ReturnType;
+
+ beforeAll(() => {
+ mocks = createAllMockDependencies();
+ _injectTestDependencies(mocks);
+ });
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ mocks = createAllMockDependencies();
+ _injectTestDependencies(mocks);
+ rewireBlobMocks({ mockDownload, mockGetProperties, mockGetBlockBlobClient, mockGetBlobClient, mockGetContainerClient });
+ mockDownload.mockResolvedValue({ readableStreamBody: readableFrom('{"status":"ok"}'), contentLength: 15 });
+ mockGetProperties.mockResolvedValue({ contentLength: 15 });
+ });
+
+ describe.each(VARIANTS)("$label", (variant) => {
+ const taxonomyUrl = (id: string) => variant.url(id) + "taxonomy";
+
+ it("returns 404 when request not found", async () => {
+ (mocks.collection.findOne as ReturnType).mockResolvedValue(null);
+ const res = await supertest(app).get(taxonomyUrl("missing"));
+ expect(res.status).toBe(404);
+ expect(res.body).toMatchObject({ error: "Request not found" });
+ });
+
+ it("returns 404 when taxonomyUrl is not set", async () => {
+ variant.mockRequest(mocks, "req-1", { _id: "run-1", attemptNumber: 1, status: "done" });
+ const res = await supertest(app).get(taxonomyUrl("req-1"));
+ expect(res.status).toBe(404);
+ expect(res.body).toMatchObject({ error: "Taxonomy not yet generated for this run" });
+ });
+
+ it("returns taxonomy JSON when taxonomyUrl is set", async () => {
+ variant.mockRequest(mocks, "req-1", {
+ _id: "run-1",
+ attemptNumber: 1,
+ status: "done",
+ taxonomyUrl: blobUrl("req-1/taxonomy.json"),
+ });
+
+ const res = await supertest(app).get(taxonomyUrl("req-1")).buffer(true).parse(rawParser);
+ expect(res.status).toBe(200);
+ expect(res.headers["content-type"]).toMatch("application/json");
+ expect(res.headers["content-disposition"]).toContain("req-1-taxonomy.json");
+ expect(mockGetBlockBlobClient).toHaveBeenCalledWith("req-1/taxonomy.json");
+ });
+ });
+
+ it("works with per-run variant", async () => {
+ RUN_LEVEL.mockRequest(mocks, "req-1", {
+ _id: "run-1",
+ attemptNumber: 1,
+ status: "done",
+ taxonomyUrl: blobUrl("req-1/runs/run-1/taxonomy.json"),
+ });
+
+ const res = await supertest(app).get(RUN_LEVEL.url("req-1") + "taxonomy").buffer(true).parse(rawParser);
+ expect(res.status).toBe(200);
+ expect(res.headers["content-disposition"]).toContain("req-1-taxonomy.json");
+ expect(mockGetBlockBlobClient).toHaveBeenCalledWith("req-1/runs/run-1/taxonomy.json");
+ });
+});
diff --git a/apps/api/src/routes/requests/taxonomy.ts b/apps/api/src/routes/requests/taxonomy.ts
new file mode 100644
index 000000000..e74d303f6
--- /dev/null
+++ b/apps/api/src/routes/requests/taxonomy.ts
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { RouteContext } from "../../route-context.js";
+import { downloadBlobToResponse } from "./blob-helpers.js";
+import { registerArtifactRoutes } from "./artifact-route.js";
+
+export function registerRequestsTaxonomyRoutes(ctx: RouteContext): void {
+ registerArtifactRoutes(ctx, {
+ path: "taxonomy",
+ summary: "Download taxonomy JSON for the run",
+ perRunSummary: "Download taxonomy JSON for a specific attempt",
+ responseDescription: "Taxonomy v1 JSON document (scorecard, behavior analysis, action list)",
+ errorResponses: { 404: { description: "Not found — taxonomy not yet generated" } },
+ blobNotFoundMessage: "Taxonomy file not found — the blob may have been deleted or is no longer available",
+ handler: async (ctx, _req, res, targetRun, id) => {
+ const taxonomyUrl = targetRun.taxonomyUrl;
+ if (!taxonomyUrl) {
+ res.status(404).json({ error: "Taxonomy not yet generated for this run" });
+ return;
+ }
+
+ await downloadBlobToResponse(ctx, res, taxonomyUrl, {
+ contentType: "application/json",
+ filename: `${id}-taxonomy.json`,
+ label: "Taxonomy",
+ });
+ },
+ });
+}
diff --git a/apps/workers/taxonomy/src/taxonomy-queue-processor.ts b/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
index db2c7f7e3..29fb3b61a 100644
--- a/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
+++ b/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
@@ -107,6 +107,7 @@ export class TaxonomyQueueProcessor extends BaseQueueProcessor
{ _id: requestId } as never,
{
$set: {
+ [`run.taxonomyUrl`]: taxonomyUrl,
[`run.handlerStatus.${HANDLER_ID}.status`]: "done",
[`run.handlerStatus.${HANDLER_ID}.version`]: HANDLER_VERSION,
[`run.handlerStatus.${HANDLER_ID}.updatedAt`]: new Date(),
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index 7bdf7e2e8..df326d5e4 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -61,16 +61,21 @@ The taxonomy handler (`apps/workers/taxonomy/`) consumes messages from the dedic
atif.trajectory.json
iteration-2/
atif.trajectory.json
+ taxonomy.json
```
+The completed run stores the taxonomy blob URL on `run.taxonomyUrl`.
+
### API Endpoints
| Endpoint | Description |
| --- | --- |
| `GET /api/v1/requests/:id/atif?iteration=N` | Download ATIF for the latest run |
| `GET /api/v1/requests/:id/runs/:runId/atif?iteration=N` | Download ATIF for a specific run |
+| `GET /api/v1/requests/:id/taxonomy` | Download taxonomy JSON for the latest run |
+| `GET /api/v1/requests/:id/runs/:runId/taxonomy` | Download taxonomy JSON for a specific run |
-The `iteration` query parameter is mandatory. ATIF files are also included in archive exports as `iteration-{N}.atif.trajectory.json`.
+The `iteration` query parameter is mandatory only for the ATIF endpoints. ATIF files are also included in archive exports as `iteration-{N}.atif.trajectory.json`.
## Handler Interface
diff --git a/packages/shared/src/schemas/request.ts b/packages/shared/src/schemas/request.ts
index bdcf6cc88..ea6f3d4da 100644
--- a/packages/shared/src/schemas/request.ts
+++ b/packages/shared/src/schemas/request.ts
@@ -173,6 +173,7 @@ export const RunStateSchema = z
podName: z.string().optional(),
}).optional(),
harUrl: z.string().optional(),
+ taxonomyUrl: z.string().optional(),
videoUrls: z.array(z.string()).optional(),
setupVideoUrls: z.array(z.string()).optional(),
tokenUsage: TokenUsageSchema.optional(),
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index 77fcb57b4..ccd7d7805 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -272,6 +272,7 @@ export interface RunState {
podName?: string;
};
harUrl?: string;
+ taxonomyUrl?: string;
videoUrls?: string[];
setupVideoUrls?: string[];
tokenUsage?: TokenUsage;
@@ -323,6 +324,7 @@ export const RUN_STATE_FIELD_NAMES = [
"lastHeartbeatAt",
"worker",
"harUrl",
+ "taxonomyUrl",
"videoUrls",
"setupVideoUrls",
"tokenUsage",
From 227328624e3f91c61abaef1331af6584cef0207b Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 02:38:12 -0700
Subject: [PATCH 018/287] fix: taxonomy handler Dockerfile and docker-compose
dev setup
- Use multi-stage Dockerfile matching report-generator pattern
- Add tsconfig.base.json, proper COPY layers, --prod install in prod stage
- Add dev stage for hot-reload with tsx watch
- Add taxonomy-handler to docker-compose.dev.yml watch config
- Add --profile taxonomy to docker:dev:copilot and docker:dev:all scripts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/workers/taxonomy/Dockerfile | 55 ++++++++++++++++++++++++--------
docker-compose.dev.yml | 16 ++++++++++
package.json | 4 +--
3 files changed, 60 insertions(+), 15 deletions(-)
diff --git a/apps/workers/taxonomy/Dockerfile b/apps/workers/taxonomy/Dockerfile
index 9e0792411..6114e03a8 100644
--- a/apps/workers/taxonomy/Dockerfile
+++ b/apps/workers/taxonomy/Dockerfile
@@ -1,19 +1,48 @@
-FROM node:22-alpine AS builder
+FROM node:22.22.0-slim AS builder
+
+RUN corepack enable && corepack prepare pnpm@10.29.1 --activate
+
WORKDIR /app
-COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
-COPY packages/shared/package.json packages/shared/
-COPY apps/workers/taxonomy/package.json apps/workers/taxonomy/
-RUN corepack enable && pnpm install --frozen-lockfile
-COPY packages/shared packages/shared
-COPY apps/workers/taxonomy apps/workers/taxonomy
+
+COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
+COPY tsconfig.base.json ./
+COPY packages/shared/package.json ./packages/shared/
+COPY apps/workers/taxonomy/package.json ./apps/workers/taxonomy/
+
+RUN pnpm install --frozen-lockfile
+
+COPY packages/shared/tsconfig.json ./packages/shared/
+COPY packages/shared/src ./packages/shared/src/
+COPY apps/workers/taxonomy/tsconfig.json ./apps/workers/taxonomy/
+COPY apps/workers/taxonomy/src ./apps/workers/taxonomy/src/
+
RUN pnpm --filter shared build && pnpm --filter taxonomy-handler build
-FROM node:22-alpine
+# --- Dev stage: hot reload with tsx watch ---
+FROM builder AS dev
+ENV NODE_ENV=development
+ENV SERVICE_DIR=workers/taxonomy
+COPY scripts/dev-entrypoint.sh /app/scripts/dev-entrypoint.sh
+EXPOSE 80
+ENV PORT=80
+CMD ["/app/scripts/dev-entrypoint.sh"]
+
+# --- Production stage ---
+FROM node:22.22.0-slim
+
+RUN corepack enable && corepack prepare pnpm@10.29.1 --activate
+
WORKDIR /app
-COPY --from=builder /app/node_modules ./node_modules
-COPY --from=builder /app/packages/shared/dist ./packages/shared/dist
-COPY --from=builder /app/packages/shared/package.json ./packages/shared/
-COPY --from=builder /app/apps/workers/taxonomy/dist ./apps/workers/taxonomy/dist
-COPY --from=builder /app/apps/workers/taxonomy/package.json ./apps/workers/taxonomy/
+
+COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
+COPY packages/shared/package.json ./packages/shared/
+COPY apps/workers/taxonomy/package.json ./apps/workers/taxonomy/
+
+RUN pnpm install --frozen-lockfile --prod
+
+COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
+COPY --from=builder /app/apps/workers/taxonomy/dist ./apps/workers/taxonomy/dist/
+
WORKDIR /app/apps/workers/taxonomy
+
CMD ["node", "dist/index.js"]
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index aac741607..c571a727d 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -180,6 +180,22 @@ services:
- action: rebuild
path: ./pnpm-lock.yaml
+ taxonomy-handler:
+ build:
+ target: dev
+ develop:
+ watch:
+ - action: sync
+ path: ./apps/workers/taxonomy/src
+ target: /app/apps/workers/taxonomy/src
+ - action: sync
+ path: ./packages/shared/src
+ target: /app/packages/shared/src
+ - action: rebuild
+ path: ./apps/workers/taxonomy/package.json
+ - action: rebuild
+ path: ./pnpm-lock.yaml
+
register-version-post-processor:
build:
target: dev
diff --git a/package.json b/package.json
index 46b946a51..62ce2760d 100644
--- a/package.json
+++ b/package.json
@@ -25,9 +25,9 @@
"docker:up:portal": "scripts/worktree-env.sh && scripts/dev-compose.sh --profile portal up --build",
"docker:dev": "scripts/worktree-env.sh && COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh -f docker-compose.yml -f docker-compose.dev.yml up --build --watch",
"docker:dev:claude-code": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile report --profile post-processor --profile portal up --build --watch",
- "docker:dev:copilot": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile copilot --profile report --profile post-processor --profile portal up --build --watch",
+ "docker:dev:copilot": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile copilot --profile report --profile post-processor --profile taxonomy --profile portal up --build --watch",
"docker:dev:portal": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh -f docker-compose.yml -f docker-compose.dev.yml --profile portal up --build --watch",
- "docker:dev:all": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile copilot --profile report --profile post-processor --profile portal up --build --watch",
+ "docker:dev:all": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile copilot --profile report --profile post-processor --profile taxonomy --profile portal up --build --watch",
"docker:dev:build": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile copilot --profile report --profile portal build",
"docker:down": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env --profile claude-code --profile copilot --profile report --profile portal down --volumes",
"docker:build": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env --profile claude-code --profile copilot --profile report build",
From 4507fb81d05d70ec4d11199238e0f05440338c76 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 10:03:52 -0700
Subject: [PATCH 019/287] feat: add taxonomy tab to portal run detail view
Adds a Taxonomy tab to the run detail page that shows:
- Scorecard with visual score bars per dimension
- Behavior analysis patterns with impact badges
- Action items with priority indicators
- Collapsible raw JSON view
The tab only appears when taxonomy data is available (run.taxonomyUrl set).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/portal/src/components/TaxonomyTab.tsx | 248 +++++++++++++++++++++
apps/portal/src/lib/api.ts | 10 +
apps/portal/src/pages/RunDetail.tsx | 10 +
apps/portal/src/types.ts | 1 +
4 files changed, 269 insertions(+)
create mode 100644 apps/portal/src/components/TaxonomyTab.tsx
diff --git a/apps/portal/src/components/TaxonomyTab.tsx b/apps/portal/src/components/TaxonomyTab.tsx
new file mode 100644
index 000000000..e97c8c8c4
--- /dev/null
+++ b/apps/portal/src/components/TaxonomyTab.tsx
@@ -0,0 +1,248 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { useQuery } from "@tanstack/react-query";
+import { api } from "@/lib/api";
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { Badge } from "@/components/ui/badge";
+import { Button } from "@/components/ui/button";
+import { Loader2, Download, ChevronDown, ChevronRight } from "lucide-react";
+import { useState } from "react";
+
+interface TaxonomyDimension {
+ name: string;
+ score: number;
+ maxScore: number;
+ justification: string;
+}
+
+interface BehaviorPattern {
+ id: string;
+ category: string;
+ observation: string;
+ evidence: string[];
+ impact: "positive" | "negative" | "neutral";
+}
+
+interface ActionItem {
+ id: string;
+ priority: "high" | "medium" | "low";
+ title: string;
+ description: string;
+ category: string;
+}
+
+interface TaxonomyData {
+ meta?: {
+ schemaVersion?: string;
+ generatedAt?: string;
+ requestId?: string;
+ runId?: string;
+ model?: string;
+ };
+ scorecard?: {
+ overall?: number;
+ dimensions?: TaxonomyDimension[];
+ };
+ behaviorAnalysis?: {
+ patterns?: BehaviorPattern[];
+ };
+ actionList?: {
+ items?: ActionItem[];
+ };
+}
+
+function ScoreBar({ score, maxScore }: { score: number; maxScore: number }) {
+ const pct = Math.round((score / maxScore) * 100);
+ const color = pct >= 80 ? "bg-green-500" : pct >= 50 ? "bg-yellow-500" : "bg-red-500";
+ return (
+
+ );
+}
+
+function ImpactBadge({ impact }: { impact: string }) {
+ const variant = impact === "positive" ? "default" : impact === "negative" ? "destructive" : "secondary";
+ return {impact} ;
+}
+
+function PriorityBadge({ priority }: { priority: string }) {
+ const colors: Record = {
+ high: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",
+ medium: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",
+ low: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
+ };
+ return {priority} ;
+}
+
+function CollapsibleSection({ title, defaultOpen = true, children }: { title: string; defaultOpen?: boolean; children: React.ReactNode }) {
+ const [open, setOpen] = useState(defaultOpen);
+ return (
+
+
setOpen(!open)}>
+ {open ? : }
+ {title}
+
+ {open &&
{children}
}
+
+ );
+}
+
+export function TaxonomyTab({ runId, attemptRunId }: { runId: string; attemptRunId?: string }) {
+ const url = attemptRunId ? api.runTaxonomyUrl(runId, attemptRunId) : api.taxonomyUrl(runId);
+
+ const { data: taxonomy, isLoading, error } = useQuery({
+ queryKey: ["run-taxonomy", runId, attemptRunId],
+ queryFn: async () => {
+ const res = await fetch(url);
+ if (!res.ok) {
+ if (res.status === 404) return null;
+ throw new Error(`Failed to fetch taxonomy: ${res.statusText}`);
+ }
+ return res.json();
+ },
+ });
+
+ if (isLoading) {
+ return (
+
+
+ Loading taxonomy…
+
+ );
+ }
+
+ if (error) {
+ return (
+
+
Failed to load taxonomy: {(error as Error).message}
+
+ );
+ }
+
+ if (!taxonomy) {
+ return (
+
+
Taxonomy not yet generated for this run.
+
It will appear here once post-processing completes.
+
+ );
+ }
+
+ const { meta, scorecard, behaviorAnalysis, actionList } = taxonomy;
+
+ return (
+
+ {/* Header with download */}
+
+
+
Run Taxonomy
+ {meta?.generatedAt && (
+
+ Generated {new Date(meta.generatedAt).toLocaleString()}
+ {meta.model && <> · Model: {meta.model}>}
+
+ )}
+
+
window.open(url, "_blank")}>
+
+ Download JSON
+
+
+
+ {/* Scorecard */}
+ {scorecard && (
+
+
+
+ Scorecard
+ {scorecard.overall !== undefined && (
+ {scorecard.overall}%
+ )}
+
+
+
+ {scorecard.dimensions?.map((dim) => (
+
+
+ {dim.name}
+
+
+
{dim.justification}
+
+ ))}
+
+
+ )}
+
+ {/* Behavior Analysis */}
+ {behaviorAnalysis?.patterns && behaviorAnalysis.patterns.length > 0 && (
+
+
+
+ Behavior Analysis ({behaviorAnalysis.patterns.length})
+
+
+
+
+
+ {behaviorAnalysis.patterns.map((pattern) => (
+
+
+ {pattern.category}
+
+
+
{pattern.observation}
+ {pattern.evidence.length > 0 && (
+
+ {pattern.evidence.map((e, i) => {e} )}
+
+ )}
+
+ ))}
+
+
+
+
+ )}
+
+ {/* Action List */}
+ {actionList?.items && actionList.items.length > 0 && (
+
+
+
+ Action Items ({actionList.items.length})
+
+
+
+
+
+ {actionList.items.map((item) => (
+
+
+
+
{item.title}
+
{item.description}
+
{item.category}
+
+
+ ))}
+
+
+
+
+ )}
+
+ {/* Raw JSON fallback — collapsed by default */}
+
+
+ {JSON.stringify(taxonomy, null, 2)}
+
+
+
+ );
+}
diff --git a/apps/portal/src/lib/api.ts b/apps/portal/src/lib/api.ts
index ea16aeabb..144b41c73 100644
--- a/apps/portal/src/lib/api.ts
+++ b/apps/portal/src/lib/api.ts
@@ -217,6 +217,16 @@ export const api = {
return `${BASE}/requests/${id}/atif${qs}`;
},
+ /** Get taxonomy JSON URL for a request (latest run) */
+ taxonomyUrl: (id: string): string => {
+ return `${BASE}/requests/${id}/taxonomy`;
+ },
+
+ /** Get taxonomy JSON URL for a specific attempt */
+ runTaxonomyUrl: (requestId: string, runId: string): string => {
+ return `${BASE}/requests/${requestId}/runs/${runId}/taxonomy`;
+ },
+
/** Download a batch archive of multiple runs as a single .tar.gz */
batchArchive: async (ids: string[]): Promise => {
const resp = await fetch(`${BASE}/requests/archive`, {
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index ee42b2467..789e74743 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -24,6 +24,7 @@ import { CriteriaGraphView } from "@/components/CriteriaGraphView";
import { HarNetworkViewer } from "@/components/HarNetworkViewer";
import { ConversationView } from "@/components/ConversationView";
import { VideoPlayer } from "@/components/VideoPlayer";
+import { TaxonomyTab } from "@/components/TaxonomyTab";
import { useLogStream } from "@/hooks/use-log-stream";
import { useAllTurnsToolCalls } from "@/hooks/useHarExtraction";
import { MarkdownRenderer } from "@/components/MarkdownRenderer";
@@ -325,6 +326,7 @@ export function RunDetail() {
}
const hasHarData = !!(activeRun?.harUrl || activeRun?.turns?.some(t => t.harUrl));
+ const hasTaxonomy = !!activeRun?.taxonomyUrl;
const hasVideoData = !!(activeRun?.videoUrls?.length || activeRun?.setupVideoUrls?.length || activeRun?.turns?.some(t => t.videoUrls?.length));
const videoCount = (activeRun?.setupVideoUrls?.length ?? 0)
+ (activeRun?.videoUrls?.length ?? 0)
@@ -652,6 +654,7 @@ export function RunDetail() {
)}
{hasHarData && Network }
{hasHarData && Tool Calls }
+ {hasTaxonomy && Taxonomy }
{hasVideoData && Videos ({videoCount}) }
Logs
@@ -684,6 +687,13 @@ export function RunDetail() {
)}
+ {/* Taxonomy tab — structured scorecard + behavior analysis + action items */}
+ {hasTaxonomy && (
+
+
+
+ )}
+
{/* Video tab — session recording player */}
{hasVideoData && (
diff --git a/apps/portal/src/types.ts b/apps/portal/src/types.ts
index 7b7e4c0f2..019f77a9f 100644
--- a/apps/portal/src/types.ts
+++ b/apps/portal/src/types.ts
@@ -112,6 +112,7 @@ export interface RunState {
resumedAt?: string;
postProcessorVersion?: number;
postProcessorStatus?: "queued" | "processing" | "done" | "failed";
+ taxonomyUrl?: string;
}
export interface Run {
From 3756ccc2f7ac6646a1e11167aa8f3cbf233caccf Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 10:13:14 -0700
Subject: [PATCH 020/287] refactor: move handler registration from migration to
worker registration jobs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Each post-processing handler now owns its own service entry registration
via a register-version.ts script (run as K8s Job on deploy):
- pp-atif: apps/workers/post-processor/src/register-version.ts
- pp-taxonomy: apps/workers/taxonomy/src/register-version.ts
- pp-report: apps/workers/report-generator/src/register-version.ts
Migration 018 is reduced to only cleaning up the legacy 'post-processor'
entry. Each handler defines its own dependencies (dependsOn), queue, version,
and selector — decoupling the DAG topology from a single migration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../post-processor/src/register-version.ts | 21 +++--
apps/workers/report-generator/package.json | 3 +-
.../report-generator/src/register-version.ts | 51 ++++++++++++
apps/workers/taxonomy/package.json | 3 +-
apps/workers/taxonomy/src/register-version.ts | 51 ++++++++++++
docker-compose.dev.yml | 8 ++
docker-compose.yml | 41 ++++++++--
.../018-migrate-services-to-handler-dag.ts | 81 +++----------------
pnpm-lock.yaml | 6 ++
9 files changed, 183 insertions(+), 82 deletions(-)
create mode 100644 apps/workers/report-generator/src/register-version.ts
create mode 100644 apps/workers/taxonomy/src/register-version.ts
diff --git a/apps/workers/post-processor/src/register-version.ts b/apps/workers/post-processor/src/register-version.ts
index 6eb0ca889..1d3e062e3 100644
--- a/apps/workers/post-processor/src/register-version.ts
+++ b/apps/workers/post-processor/src/register-version.ts
@@ -3,8 +3,9 @@
/**
* Standalone script run by the K8s Job on each deployment.
- * Writes the current post-processor version to MongoDB so the scheduler
- * can detect runs needing (re-)processing.
+ * Registers the post-processor (pp-atif handler) in the services collection
+ * with its version, queue, and dependency information so the scheduler
+ * can orchestrate the DAG-based post-processing pipeline.
*/
import "dotenv/config";
import { MongoClient } from "mongodb";
@@ -24,13 +25,23 @@ async function main(): Promise {
.db(MONGO_DATABASE)
.collection("services")
.updateOne(
- { _id: "post-processor" } as any,
- { $set: { version: POST_PROCESSOR_VERSION, updatedAt: new Date() } },
+ { _id: "pp-atif" } as any,
+ {
+ $set: {
+ type: "post-process-handler",
+ version: POST_PROCESSOR_VERSION,
+ queue: "post-processor-queue",
+ selector: "atif",
+ autoBackfill: true,
+ dependsOn: [],
+ updatedAt: new Date(),
+ },
+ },
{ upsert: true },
);
await mongo.close();
- console.log(`[register-version] Registered post-processor version: ${POST_PROCESSOR_VERSION}`);
+ console.log(`[register-version] Registered pp-atif handler version: ${POST_PROCESSOR_VERSION}`);
}
main().catch((err) => {
diff --git a/apps/workers/report-generator/package.json b/apps/workers/report-generator/package.json
index d296fc738..367bdb307 100644
--- a/apps/workers/report-generator/package.json
+++ b/apps/workers/report-generator/package.json
@@ -13,7 +13,8 @@
"shared": "workspace:*",
"@azure/storage-queue": "^12.25.0",
"@github/copilot-sdk": "^0.1.17",
- "dotenv": "^16.4.5"
+ "dotenv": "^16.4.5",
+ "mongodb": "^6.10.0"
},
"devDependencies": {
"@types/node": "^22.7.0",
diff --git a/apps/workers/report-generator/src/register-version.ts b/apps/workers/report-generator/src/register-version.ts
new file mode 100644
index 000000000..ed423546b
--- /dev/null
+++ b/apps/workers/report-generator/src/register-version.ts
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Standalone script run by the K8s Job on each deployment.
+ * Registers the report-generator handler in the services collection
+ * with its version, queue, and dependency information so the scheduler
+ * can orchestrate the DAG-based post-processing pipeline.
+ */
+import "dotenv/config";
+import { MongoClient } from "mongodb";
+
+const REPORT_HANDLER_VERSION = 1;
+
+const MONGO_URI =
+ process.env.MONGO_CONNECTION_STRING ||
+ process.env.AZURE_COSMOS_CONNECTION_STRING ||
+ "mongodb://localhost:27017";
+const MONGO_DATABASE = process.env.MONGO_DATABASE || "requests-db";
+
+async function main(): Promise {
+ const mongo = new MongoClient(MONGO_URI);
+ await mongo.connect();
+
+ await mongo
+ .db(MONGO_DATABASE)
+ .collection("services")
+ .updateOne(
+ { _id: "pp-report" } as any,
+ {
+ $set: {
+ type: "post-process-handler",
+ version: REPORT_HANDLER_VERSION,
+ queue: "report-queue",
+ selector: "report",
+ autoBackfill: false,
+ dependsOn: ["pp-atif", "pp-taxonomy"],
+ updatedAt: new Date(),
+ },
+ },
+ { upsert: true },
+ );
+
+ await mongo.close();
+ console.log(`[register-version] Registered pp-report handler version: ${REPORT_HANDLER_VERSION}`);
+}
+
+main().catch((err) => {
+ console.error("[register-version] Fatal error:", err);
+ process.exit(1);
+});
diff --git a/apps/workers/taxonomy/package.json b/apps/workers/taxonomy/package.json
index aacbfc4f1..1f496a50c 100644
--- a/apps/workers/taxonomy/package.json
+++ b/apps/workers/taxonomy/package.json
@@ -13,7 +13,8 @@
"shared": "workspace:*",
"@azure/storage-queue": "^12.25.0",
"@github/copilot-sdk": "^0.1.17",
- "dotenv": "^16.4.5"
+ "dotenv": "^16.4.5",
+ "mongodb": "^6.10.0"
},
"devDependencies": {
"@types/node": "^22.7.0",
diff --git a/apps/workers/taxonomy/src/register-version.ts b/apps/workers/taxonomy/src/register-version.ts
new file mode 100644
index 000000000..e30425c35
--- /dev/null
+++ b/apps/workers/taxonomy/src/register-version.ts
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Standalone script run by the K8s Job on each deployment.
+ * Registers the taxonomy handler in the services collection
+ * with its version, queue, and dependency information so the scheduler
+ * can orchestrate the DAG-based post-processing pipeline.
+ */
+import "dotenv/config";
+import { MongoClient } from "mongodb";
+
+const TAXONOMY_HANDLER_VERSION = 1;
+
+const MONGO_URI =
+ process.env.MONGO_CONNECTION_STRING ||
+ process.env.AZURE_COSMOS_CONNECTION_STRING ||
+ "mongodb://localhost:27017";
+const MONGO_DATABASE = process.env.MONGO_DATABASE || "requests-db";
+
+async function main(): Promise {
+ const mongo = new MongoClient(MONGO_URI);
+ await mongo.connect();
+
+ await mongo
+ .db(MONGO_DATABASE)
+ .collection("services")
+ .updateOne(
+ { _id: "pp-taxonomy" } as any,
+ {
+ $set: {
+ type: "post-process-handler",
+ version: TAXONOMY_HANDLER_VERSION,
+ queue: "pp-taxonomy-queue",
+ selector: "taxonomy",
+ autoBackfill: false,
+ dependsOn: ["pp-atif"],
+ updatedAt: new Date(),
+ },
+ },
+ { upsert: true },
+ );
+
+ await mongo.close();
+ console.log(`[register-version] Registered pp-taxonomy handler version: ${TAXONOMY_HANDLER_VERSION}`);
+}
+
+main().catch((err) => {
+ console.error("[register-version] Fatal error:", err);
+ process.exit(1);
+});
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index c571a727d..bdfd84780 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -200,6 +200,14 @@ services:
build:
target: dev
+ register-version-taxonomy:
+ build:
+ target: dev
+
+ register-version-report-generator:
+ build:
+ target: dev
+
post-processor:
build:
target: dev
diff --git a/docker-compose.yml b/docker-compose.yml
index a4503d104..9b56ad1b0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -140,7 +140,7 @@ services:
timeout: 5s
retries: 5
- # Creates the 'har' blob container and handler queues in Azurite.
+ # Creates the 'har' blob container in Azurite.
azurite-init:
image: mcr.microsoft.com/azure-cli:2.68.0
restart: "no"
@@ -148,12 +148,9 @@ services:
azurite:
condition: service_healthy
environment:
- AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://azurite:10001/devstoreaccount1;BlobEndpoint=http://azurite:10000/devstoreaccount1;"
+ AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;"
command: >
- sh -c "az storage container create --name har --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true &&
- az storage queue create --name report-queue --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true &&
- az storage queue create --name post-processor-queue --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true &&
- az storage queue create --name pp-taxonomy-queue --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true"
+ sh -c "az storage container create --name har --connection-string \"$$AZURE_STORAGE_CONNECTION_STRING\" || true"
# ===========================================================================
# Application services
@@ -642,6 +639,8 @@ services:
condition: service_healthy
api:
condition: service_started
+ register-version-report-generator:
+ condition: service_completed_successfully
taxonomy-handler:
build:
@@ -670,6 +669,36 @@ services:
condition: service_started
scheduler:
condition: service_started
+ register-version-taxonomy:
+ condition: service_completed_successfully
+
+ register-version-taxonomy:
+ build:
+ context: .
+ dockerfile: apps/workers/taxonomy/Dockerfile
+ profiles: [taxonomy, all]
+ environment:
+ <<: *common-env
+ depends_on:
+ mongodb:
+ condition: service_healthy
+ required: false
+ restart: "no"
+ entrypoint: ["npx", "tsx", "apps/workers/taxonomy/src/register-version.ts"]
+
+ register-version-report-generator:
+ build:
+ context: .
+ dockerfile: apps/workers/report-generator/Dockerfile
+ profiles: [report]
+ environment:
+ <<: *common-env
+ depends_on:
+ mongodb:
+ condition: service_healthy
+ required: false
+ restart: "no"
+ entrypoint: ["npx", "tsx", "apps/workers/report-generator/src/register-version.ts"]
register-version-post-processor:
build:
diff --git a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
index 9ea8644fe..b82b4335c 100644
--- a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
+++ b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
@@ -4,81 +4,24 @@
import type { Db } from "mongodb";
import type { MigrationInterface } from "mongo-migrate-ts";
-interface ServiceDocument {
- _id: string;
- version: number;
- type?: "post-process-handler";
- queue?: string;
- selector?: string;
- autoBackfill?: boolean;
- dependsOn?: string[];
-}
-
-type HandlerServiceSeed = Required & {
- type: "post-process-handler";
-};
-
-const HANDLER_SERVICES: readonly HandlerServiceSeed[] = [
- {
- _id: "pp-atif",
- type: "post-process-handler",
- version: 2,
- queue: "post-processor-queue",
- selector: "atif",
- autoBackfill: true,
- dependsOn: [],
- },
- {
- _id: "pp-taxonomy",
- type: "post-process-handler",
- version: 1,
- queue: "pp-taxonomy-queue",
- selector: "taxonomy",
- autoBackfill: false,
- dependsOn: ["pp-atif"],
- },
- {
- _id: "pp-report",
- type: "post-process-handler",
- version: 1,
- queue: "report-queue",
- selector: "report",
- autoBackfill: false,
- dependsOn: ["pp-atif", "pp-taxonomy"],
- },
-];
-
+/**
+ * Migration 018: Remove the legacy "post-processor" service entry.
+ *
+ * Handler service registration (pp-atif, pp-taxonomy, pp-report) is now owned
+ * by each worker's register-version.ts script, run as a K8s Job on deploy.
+ * This migration only cleans up the old single-entry format.
+ */
export class MigrateServicesToHandlerDag implements MigrationInterface {
async up(db: Db): Promise {
- const services = db.collection("services");
-
- await services.deleteOne({ _id: "post-processor" });
- console.log("[018] Deleted legacy post-processor service entry if it existed");
-
- for (const service of HANDLER_SERVICES) {
- const { _id, ...fields } = service;
- await services.updateOne(
- { _id },
- {
- $set: {
- ...fields,
- dependsOn: [...fields.dependsOn],
- },
- },
- { upsert: true },
- );
- console.log(`[018] Upserted handler service ${_id}`);
- }
+ const services = db.collection("services");
+ await services.deleteOne({ _id: "post-processor" } as any);
+ console.log("[018] Deleted legacy post-processor service entry (handler registration now owned by workers)");
}
async down(db: Db): Promise {
- const services = db.collection("services");
-
- await services.deleteMany({ _id: { $in: HANDLER_SERVICES.map((service) => service._id) } });
- console.log("[018-down] Deleted handler service entries");
-
+ const services = db.collection("services");
await services.updateOne(
- { _id: "post-processor" },
+ { _id: "post-processor" } as any,
{
$set: { version: 2 },
$unset: {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a7903fc00..6f1c765b7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -691,6 +691,9 @@ importers:
dotenv:
specifier: ^16.4.5
version: 16.6.1
+ mongodb:
+ specifier: ^6.10.0
+ version: 6.21.0
shared:
specifier: workspace:*
version: link:../../../packages/shared
@@ -716,6 +719,9 @@ importers:
dotenv:
specifier: ^16.4.5
version: 16.6.1
+ mongodb:
+ specifier: ^6.10.0
+ version: 6.21.0
shared:
specifier: workspace:*
version: link:../../../packages/shared
From d02ec6863a4d9d67a9c9f9410ec66487adb7c734 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 11:57:43 -0700
Subject: [PATCH 021/287] refactor: YAML-driven handler registration via
scheduler endpoint
Replace the three inlined register-version.ts scripts (which wrote handler
metadata directly to MongoDB) with a declarative, YAML-driven approach that
mirrors the coding-agent registration pattern.
- Add per-worker handler.yaml (pp-atif, pp-taxonomy, pp-report) as the single
source of truth for handler metadata.
- Add generic packages/shared/src/scripts/register-handler.ts that reads
HANDLER_YAML_PATH, waits for the scheduler /health, and POSTs to
POST /handlers/register with retry.
- Add scheduler POST /handlers/register endpoint (notify-routes.ts) +
HandlerDispatcher.registerHandler (cycle-checked upsert). Scheduler is now
the sole writer of the services collection.
- Remove the 3 register-version.ts scripts and the mongodb dep from the
taxonomy + report-generator workers.
- Wire compose (register-handler-* services) and K8s (scheduler Service,
register-handler-post-processor Job, SCHEDULER_URL, /health probes).
- Update docs/architecture/post-processing.md.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/scheduler/src/handler-dispatcher.ts | 27 +++
apps/scheduler/src/notify-routes.test.ts | 55 ++++++
apps/scheduler/src/notify-routes.ts | 57 ++++++
apps/workers/post-processor/Dockerfile | 2 +
apps/workers/post-processor/handler.yaml | 10 ++
.../post-processor/src/register-version.ts | 50 ------
apps/workers/report-generator/Dockerfile | 2 +
apps/workers/report-generator/handler.yaml | 12 ++
apps/workers/report-generator/package.json | 3 +-
.../report-generator/src/register-version.ts | 51 ------
apps/workers/taxonomy/Dockerfile | 2 +
apps/workers/taxonomy/handler.yaml | 11 ++
apps/workers/taxonomy/package.json | 3 +-
apps/workers/taxonomy/src/register-version.ts | 51 ------
docker-compose.dev.yml | 6 +-
docker-compose.yml | 39 ++--
docs/architecture/post-processing.md | 39 +++-
.../src/scripts/register-handler.test.ts | 54 ++++++
.../shared/src/scripts/register-handler.ts | 170 ++++++++++++++++++
pnpm-lock.yaml | 6 -
20 files changed, 464 insertions(+), 186 deletions(-)
create mode 100644 apps/workers/post-processor/handler.yaml
delete mode 100644 apps/workers/post-processor/src/register-version.ts
create mode 100644 apps/workers/report-generator/handler.yaml
delete mode 100644 apps/workers/report-generator/src/register-version.ts
create mode 100644 apps/workers/taxonomy/handler.yaml
delete mode 100644 apps/workers/taxonomy/src/register-version.ts
create mode 100644 packages/shared/src/scripts/register-handler.test.ts
create mode 100644 packages/shared/src/scripts/register-handler.ts
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index 2c4f1b99f..09b461def 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -107,6 +107,33 @@ export class HandlerDispatcher implements NotifyHandler {
}
}
+ async registerHandler(doc: HandlerServiceDocument): Promise {
+ // Validate the resulting topology has no cycles before persisting.
+ const existing = await this.loadHandlers();
+ const merged = [
+ ...existing.filter((h) => h._id !== doc._id),
+ doc,
+ ];
+ // Throws on cycle — rejects invalid registrations.
+ this.buildGraph(merged);
+
+ const { _id, ...fields } = doc;
+ await this.db.collection("services").updateOne(
+ { _id } as any,
+ {
+ $set: {
+ ...fields,
+ dependsOn: [...fields.dependsOn],
+ updatedAt: new Date(),
+ },
+ } as any,
+ { upsert: true },
+ );
+ console.log(
+ `[HandlerDispatcher] Registered handler ${_id} (version=${doc.version}, queue=${doc.queue}, dependsOn=[${doc.dependsOn.join(", ")}])`,
+ );
+ }
+
// ── Poll safety net ─────────────────────────────────────────────────
private async pollDispatch(): Promise {
diff --git a/apps/scheduler/src/notify-routes.test.ts b/apps/scheduler/src/notify-routes.test.ts
index 552f03243..00968ba29 100644
--- a/apps/scheduler/src/notify-routes.test.ts
+++ b/apps/scheduler/src/notify-routes.test.ts
@@ -52,6 +52,7 @@ describe("createHttpServer", () => {
const handler: NotifyHandler = {
onRunTerminal: vi.fn().mockResolvedValue(undefined),
onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
};
const { server, baseUrl } = await startServer(handler);
servers.push(server);
@@ -66,6 +67,7 @@ describe("createHttpServer", () => {
const handler: NotifyHandler = {
onRunTerminal: vi.fn().mockResolvedValue(undefined),
onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
};
const { server, baseUrl } = await startServer(handler);
servers.push(server);
@@ -86,6 +88,7 @@ describe("createHttpServer", () => {
const handler: NotifyHandler = {
onRunTerminal: vi.fn().mockResolvedValue(undefined),
onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
};
const { server, baseUrl } = await startServer(handler);
servers.push(server);
@@ -111,6 +114,7 @@ describe("createHttpServer", () => {
const handler: NotifyHandler = {
onRunTerminal: vi.fn().mockResolvedValue(undefined),
onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
};
const { server, baseUrl } = await startServer(handler);
servers.push(server);
@@ -133,6 +137,7 @@ describe("createHttpServer", () => {
const handler: NotifyHandler = {
onRunTerminal: vi.fn().mockResolvedValue(undefined),
onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
};
const { server, baseUrl } = await startServer(handler);
servers.push(server);
@@ -146,4 +151,54 @@ describe("createHttpServer", () => {
expect(response.status).toBe(404);
expect(await response.json()).toEqual({ error: "Not found" });
});
+
+ it("calls registerHandler for valid handler registrations", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
+ };
+ const { server, baseUrl } = await startServer(handler);
+ servers.push(server);
+
+ const doc = {
+ _id: "pp-taxonomy",
+ type: "post-process-handler",
+ version: 1,
+ queue: "pp-taxonomy-queue",
+ selector: "taxonomy",
+ autoBackfill: false,
+ dependsOn: ["pp-atif"],
+ };
+
+ const response = await fetch(`${baseUrl}/handlers/register`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(doc),
+ });
+
+ expect(response.status).toBe(200);
+ expect(await response.json()).toEqual({ ok: true, handlerId: "pp-taxonomy" });
+ expect(handler.registerHandler).toHaveBeenCalledWith(doc);
+ });
+
+ it("returns 400 for invalid handler registrations", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
+ };
+ const { server, baseUrl } = await startServer(handler);
+ servers.push(server);
+
+ const response = await fetch(`${baseUrl}/handlers/register`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ // Missing queue/selector, wrong type, dependsOn not array
+ body: JSON.stringify({ _id: "bad", type: "wrong", version: "x" }),
+ });
+
+ expect(response.status).toBe(400);
+ expect(handler.registerHandler).not.toHaveBeenCalled();
+ });
});
diff --git a/apps/scheduler/src/notify-routes.ts b/apps/scheduler/src/notify-routes.ts
index 445945d2d..577478b64 100644
--- a/apps/scheduler/src/notify-routes.ts
+++ b/apps/scheduler/src/notify-routes.ts
@@ -2,6 +2,7 @@
// Licensed under the MIT License.
import http from "node:http";
+import type { HandlerServiceDocument } from "shared";
export interface NotifyHandler {
onRunTerminal(requestId: string, runId: string): Promise;
@@ -11,6 +12,7 @@ export interface NotifyHandler {
handlerId: string,
status: "done" | "failed",
): Promise;
+ registerHandler(doc: HandlerServiceDocument): Promise;
}
interface RunTerminalRequest {
@@ -75,6 +77,46 @@ function parseHandlerCompleteRequest(body: unknown): HandlerCompleteRequest | nu
};
}
+function parseHandlerRegisterRequest(body: unknown): HandlerServiceDocument | null {
+ if (!isRecord(body)) {
+ return null;
+ }
+
+ const {
+ _id,
+ type,
+ version,
+ queue,
+ selector,
+ autoBackfill,
+ dependsOn,
+ } = body;
+
+ if (
+ !isNonEmptyString(_id) ||
+ type !== "post-process-handler" ||
+ typeof version !== "number" ||
+ !Number.isFinite(version) ||
+ !isNonEmptyString(queue) ||
+ !isNonEmptyString(selector) ||
+ typeof autoBackfill !== "boolean" ||
+ !Array.isArray(dependsOn) ||
+ !dependsOn.every((d) => isNonEmptyString(d))
+ ) {
+ return null;
+ }
+
+ return {
+ _id,
+ type,
+ version,
+ queue,
+ selector,
+ autoBackfill,
+ dependsOn: dependsOn as string[],
+ };
+}
+
async function readJsonBody(req: http.IncomingMessage): Promise {
const chunks: Buffer[] = [];
@@ -131,6 +173,21 @@ export function createHttpServer(handler: NotifyHandler): http.Server {
sendJson(res, 200, { ok: true });
return;
}
+
+ if (method === "POST" && url.pathname === "/handlers/register") {
+ const parsedBody = parseHandlerRegisterRequest(await readJsonBody(req));
+ if (!parsedBody) {
+ sendJson(res, 400, {
+ error:
+ "Invalid handler registration: _id, type='post-process-handler', version (number), queue, selector, autoBackfill (boolean), and dependsOn (string[]) are required",
+ });
+ return;
+ }
+
+ await handler.registerHandler(parsedBody);
+ sendJson(res, 200, { ok: true, handlerId: parsedBody._id });
+ return;
+ }
} catch (error) {
const message = error instanceof Error ? error.message : "Internal server error";
const statusCode =
diff --git a/apps/workers/post-processor/Dockerfile b/apps/workers/post-processor/Dockerfile
index d69ca9cb1..6d6bf8e04 100644
--- a/apps/workers/post-processor/Dockerfile
+++ b/apps/workers/post-processor/Dockerfile
@@ -15,6 +15,7 @@ COPY packages/shared/tsconfig.json ./packages/shared/
COPY packages/shared/src ./packages/shared/src/
COPY apps/workers/post-processor/tsconfig.json ./apps/workers/post-processor/
COPY apps/workers/post-processor/src ./apps/workers/post-processor/src/
+COPY apps/workers/post-processor/handler.yaml ./apps/workers/post-processor/
RUN pnpm --filter shared build && pnpm --filter post-processor build
@@ -43,6 +44,7 @@ RUN pnpm install --frozen-lockfile --prod
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
COPY --from=builder /app/apps/workers/post-processor/dist ./apps/workers/post-processor/dist/
+COPY --from=builder /app/apps/workers/post-processor/handler.yaml ./apps/workers/post-processor/handler.yaml
WORKDIR /app/apps/workers/post-processor
diff --git a/apps/workers/post-processor/handler.yaml b/apps/workers/post-processor/handler.yaml
new file mode 100644
index 000000000..dc3c1f348
--- /dev/null
+++ b/apps/workers/post-processor/handler.yaml
@@ -0,0 +1,10 @@
+# Post-process handler registration metadata.
+# Read by the generic register-handler script and POSTed to the
+# scheduler's POST /handlers/register endpoint on deploy.
+_id: pp-atif
+type: post-process-handler
+version: 1
+queue: post-processor-queue
+selector: atif
+autoBackfill: true
+dependsOn: []
diff --git a/apps/workers/post-processor/src/register-version.ts b/apps/workers/post-processor/src/register-version.ts
deleted file mode 100644
index 1d3e062e3..000000000
--- a/apps/workers/post-processor/src/register-version.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-/**
- * Standalone script run by the K8s Job on each deployment.
- * Registers the post-processor (pp-atif handler) in the services collection
- * with its version, queue, and dependency information so the scheduler
- * can orchestrate the DAG-based post-processing pipeline.
- */
-import "dotenv/config";
-import { MongoClient } from "mongodb";
-import { POST_PROCESSOR_VERSION } from "./version.js";
-
-const MONGO_URI =
- process.env.MONGO_CONNECTION_STRING ||
- process.env.AZURE_COSMOS_CONNECTION_STRING ||
- "mongodb://localhost:27017";
-const MONGO_DATABASE = process.env.MONGO_DATABASE || "requests-db";
-
-async function main(): Promise {
- const mongo = new MongoClient(MONGO_URI);
- await mongo.connect();
-
- await mongo
- .db(MONGO_DATABASE)
- .collection("services")
- .updateOne(
- { _id: "pp-atif" } as any,
- {
- $set: {
- type: "post-process-handler",
- version: POST_PROCESSOR_VERSION,
- queue: "post-processor-queue",
- selector: "atif",
- autoBackfill: true,
- dependsOn: [],
- updatedAt: new Date(),
- },
- },
- { upsert: true },
- );
-
- await mongo.close();
- console.log(`[register-version] Registered pp-atif handler version: ${POST_PROCESSOR_VERSION}`);
-}
-
-main().catch((err) => {
- console.error("[register-version] Fatal error:", err);
- process.exit(1);
-});
diff --git a/apps/workers/report-generator/Dockerfile b/apps/workers/report-generator/Dockerfile
index 3cfd18150..62a5f2646 100644
--- a/apps/workers/report-generator/Dockerfile
+++ b/apps/workers/report-generator/Dockerfile
@@ -15,6 +15,7 @@ COPY packages/shared/tsconfig.json ./packages/shared/
COPY packages/shared/src ./packages/shared/src/
COPY apps/workers/report-generator/tsconfig.json ./apps/workers/report-generator/
COPY apps/workers/report-generator/src ./apps/workers/report-generator/src/
+COPY apps/workers/report-generator/handler.yaml ./apps/workers/report-generator/
RUN pnpm --filter shared build && pnpm --filter report-generator build
@@ -43,6 +44,7 @@ RUN pnpm install --frozen-lockfile --prod
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
COPY --from=builder /app/apps/workers/report-generator/dist ./apps/workers/report-generator/dist/
+COPY --from=builder /app/apps/workers/report-generator/handler.yaml ./apps/workers/report-generator/handler.yaml
WORKDIR /app/apps/workers/report-generator
diff --git a/apps/workers/report-generator/handler.yaml b/apps/workers/report-generator/handler.yaml
new file mode 100644
index 000000000..f7e14d83e
--- /dev/null
+++ b/apps/workers/report-generator/handler.yaml
@@ -0,0 +1,12 @@
+# Post-process handler registration metadata.
+# Read by the generic register-handler script and POSTed to the
+# scheduler's POST /handlers/register endpoint on deploy.
+_id: pp-report
+type: post-process-handler
+version: 1
+queue: report-queue
+selector: report
+autoBackfill: false
+dependsOn:
+ - pp-atif
+ - pp-taxonomy
diff --git a/apps/workers/report-generator/package.json b/apps/workers/report-generator/package.json
index 367bdb307..d296fc738 100644
--- a/apps/workers/report-generator/package.json
+++ b/apps/workers/report-generator/package.json
@@ -13,8 +13,7 @@
"shared": "workspace:*",
"@azure/storage-queue": "^12.25.0",
"@github/copilot-sdk": "^0.1.17",
- "dotenv": "^16.4.5",
- "mongodb": "^6.10.0"
+ "dotenv": "^16.4.5"
},
"devDependencies": {
"@types/node": "^22.7.0",
diff --git a/apps/workers/report-generator/src/register-version.ts b/apps/workers/report-generator/src/register-version.ts
deleted file mode 100644
index ed423546b..000000000
--- a/apps/workers/report-generator/src/register-version.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-/**
- * Standalone script run by the K8s Job on each deployment.
- * Registers the report-generator handler in the services collection
- * with its version, queue, and dependency information so the scheduler
- * can orchestrate the DAG-based post-processing pipeline.
- */
-import "dotenv/config";
-import { MongoClient } from "mongodb";
-
-const REPORT_HANDLER_VERSION = 1;
-
-const MONGO_URI =
- process.env.MONGO_CONNECTION_STRING ||
- process.env.AZURE_COSMOS_CONNECTION_STRING ||
- "mongodb://localhost:27017";
-const MONGO_DATABASE = process.env.MONGO_DATABASE || "requests-db";
-
-async function main(): Promise {
- const mongo = new MongoClient(MONGO_URI);
- await mongo.connect();
-
- await mongo
- .db(MONGO_DATABASE)
- .collection("services")
- .updateOne(
- { _id: "pp-report" } as any,
- {
- $set: {
- type: "post-process-handler",
- version: REPORT_HANDLER_VERSION,
- queue: "report-queue",
- selector: "report",
- autoBackfill: false,
- dependsOn: ["pp-atif", "pp-taxonomy"],
- updatedAt: new Date(),
- },
- },
- { upsert: true },
- );
-
- await mongo.close();
- console.log(`[register-version] Registered pp-report handler version: ${REPORT_HANDLER_VERSION}`);
-}
-
-main().catch((err) => {
- console.error("[register-version] Fatal error:", err);
- process.exit(1);
-});
diff --git a/apps/workers/taxonomy/Dockerfile b/apps/workers/taxonomy/Dockerfile
index 6114e03a8..b6be8f2ad 100644
--- a/apps/workers/taxonomy/Dockerfile
+++ b/apps/workers/taxonomy/Dockerfile
@@ -15,6 +15,7 @@ COPY packages/shared/tsconfig.json ./packages/shared/
COPY packages/shared/src ./packages/shared/src/
COPY apps/workers/taxonomy/tsconfig.json ./apps/workers/taxonomy/
COPY apps/workers/taxonomy/src ./apps/workers/taxonomy/src/
+COPY apps/workers/taxonomy/handler.yaml ./apps/workers/taxonomy/
RUN pnpm --filter shared build && pnpm --filter taxonomy-handler build
@@ -42,6 +43,7 @@ RUN pnpm install --frozen-lockfile --prod
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
COPY --from=builder /app/apps/workers/taxonomy/dist ./apps/workers/taxonomy/dist/
+COPY --from=builder /app/apps/workers/taxonomy/handler.yaml ./apps/workers/taxonomy/handler.yaml
WORKDIR /app/apps/workers/taxonomy
diff --git a/apps/workers/taxonomy/handler.yaml b/apps/workers/taxonomy/handler.yaml
new file mode 100644
index 000000000..b479f905e
--- /dev/null
+++ b/apps/workers/taxonomy/handler.yaml
@@ -0,0 +1,11 @@
+# Post-process handler registration metadata.
+# Read by the generic register-handler script and POSTed to the
+# scheduler's POST /handlers/register endpoint on deploy.
+_id: pp-taxonomy
+type: post-process-handler
+version: 1
+queue: pp-taxonomy-queue
+selector: taxonomy
+autoBackfill: false
+dependsOn:
+ - pp-atif
diff --git a/apps/workers/taxonomy/package.json b/apps/workers/taxonomy/package.json
index 1f496a50c..aacbfc4f1 100644
--- a/apps/workers/taxonomy/package.json
+++ b/apps/workers/taxonomy/package.json
@@ -13,8 +13,7 @@
"shared": "workspace:*",
"@azure/storage-queue": "^12.25.0",
"@github/copilot-sdk": "^0.1.17",
- "dotenv": "^16.4.5",
- "mongodb": "^6.10.0"
+ "dotenv": "^16.4.5"
},
"devDependencies": {
"@types/node": "^22.7.0",
diff --git a/apps/workers/taxonomy/src/register-version.ts b/apps/workers/taxonomy/src/register-version.ts
deleted file mode 100644
index e30425c35..000000000
--- a/apps/workers/taxonomy/src/register-version.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-/**
- * Standalone script run by the K8s Job on each deployment.
- * Registers the taxonomy handler in the services collection
- * with its version, queue, and dependency information so the scheduler
- * can orchestrate the DAG-based post-processing pipeline.
- */
-import "dotenv/config";
-import { MongoClient } from "mongodb";
-
-const TAXONOMY_HANDLER_VERSION = 1;
-
-const MONGO_URI =
- process.env.MONGO_CONNECTION_STRING ||
- process.env.AZURE_COSMOS_CONNECTION_STRING ||
- "mongodb://localhost:27017";
-const MONGO_DATABASE = process.env.MONGO_DATABASE || "requests-db";
-
-async function main(): Promise {
- const mongo = new MongoClient(MONGO_URI);
- await mongo.connect();
-
- await mongo
- .db(MONGO_DATABASE)
- .collection("services")
- .updateOne(
- { _id: "pp-taxonomy" } as any,
- {
- $set: {
- type: "post-process-handler",
- version: TAXONOMY_HANDLER_VERSION,
- queue: "pp-taxonomy-queue",
- selector: "taxonomy",
- autoBackfill: false,
- dependsOn: ["pp-atif"],
- updatedAt: new Date(),
- },
- },
- { upsert: true },
- );
-
- await mongo.close();
- console.log(`[register-version] Registered pp-taxonomy handler version: ${TAXONOMY_HANDLER_VERSION}`);
-}
-
-main().catch((err) => {
- console.error("[register-version] Fatal error:", err);
- process.exit(1);
-});
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index bdfd84780..a2fbe32b5 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -196,15 +196,15 @@ services:
- action: rebuild
path: ./pnpm-lock.yaml
- register-version-post-processor:
+ register-handler-post-processor:
build:
target: dev
- register-version-taxonomy:
+ register-handler-taxonomy:
build:
target: dev
- register-version-report-generator:
+ register-handler-report-generator:
build:
target: dev
diff --git a/docker-compose.yml b/docker-compose.yml
index 9b56ad1b0..53cdc0da1 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -639,7 +639,7 @@ services:
condition: service_healthy
api:
condition: service_started
- register-version-report-generator:
+ register-handler-report-generator:
condition: service_completed_successfully
taxonomy-handler:
@@ -669,50 +669,53 @@ services:
condition: service_started
scheduler:
condition: service_started
- register-version-taxonomy:
+ register-handler-taxonomy:
condition: service_completed_successfully
- register-version-taxonomy:
+ register-handler-taxonomy:
build:
context: .
dockerfile: apps/workers/taxonomy/Dockerfile
profiles: [taxonomy, all]
environment:
<<: *common-env
+ HANDLER_YAML_PATH: apps/workers/taxonomy/handler.yaml
+ SCHEDULER_URL: http://scheduler:8080
depends_on:
- mongodb:
- condition: service_healthy
- required: false
+ scheduler:
+ condition: service_started
restart: "no"
- entrypoint: ["npx", "tsx", "apps/workers/taxonomy/src/register-version.ts"]
+ entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
- register-version-report-generator:
+ register-handler-report-generator:
build:
context: .
dockerfile: apps/workers/report-generator/Dockerfile
profiles: [report]
environment:
<<: *common-env
+ HANDLER_YAML_PATH: apps/workers/report-generator/handler.yaml
+ SCHEDULER_URL: http://scheduler:8080
depends_on:
- mongodb:
- condition: service_healthy
- required: false
+ scheduler:
+ condition: service_started
restart: "no"
- entrypoint: ["npx", "tsx", "apps/workers/report-generator/src/register-version.ts"]
+ entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
- register-version-post-processor:
+ register-handler-post-processor:
build:
context: .
dockerfile: apps/workers/post-processor/Dockerfile
profiles: [post-processor]
environment:
<<: *common-env
+ HANDLER_YAML_PATH: apps/workers/post-processor/handler.yaml
+ SCHEDULER_URL: http://scheduler:8080
depends_on:
- mongodb:
- condition: service_healthy
- required: false
+ scheduler:
+ condition: service_started
restart: "no"
- entrypoint: ["npx", "tsx", "apps/workers/post-processor/src/register-version.ts"]
+ entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
post-processor:
build:
@@ -734,7 +737,7 @@ services:
condition: service_healthy
api:
condition: service_started
- register-version-post-processor:
+ register-handler-post-processor:
condition: service_completed_successfully
volumes:
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index df326d5e4..d16d6294f 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -16,7 +16,7 @@ Two paths trigger post-processing:
1. **Event-driven (primary):** Coder workers enqueue a post-processing message immediately when a run completes, currently setting the deprecated `run.postProcessorStatus: "queued"` compatibility field atomically in the same DB write while the system migrates to per-handler status.
2. **Scheduler backfill:** The `PostProcessorDispatcher` polls every 30 seconds for runs that have `status: "done"` but no post-processing marker set (or a stale handler version). During the migration window this may consult the deprecated flat fields; the long-term source of truth is `run.handlerStatus[handlerId]`. This catches runs that completed before the event-driven dispatch was deployed, or that need re-processing after a version bump.
-3. **Scheduler notify server:** The scheduler also exposes `GET /health`, `POST /notify/run-terminal`, and `POST /notify/handler-complete` on a lightweight `node:http` server. Workers and post-process handlers use these endpoints to notify the scheduler when terminal states are reached so it can re-evaluate which root or downstream handlers are ready to dispatch.
+3. **Scheduler notify & registration server:** The scheduler also exposes `GET /health`, `POST /notify/run-terminal`, `POST /notify/handler-complete`, and `POST /handlers/register` on a lightweight `node:http` server. Workers and post-process handlers use the notify endpoints to signal terminal states so the scheduler can re-evaluate which root or downstream handlers are ready to dispatch. The `/handlers/register` endpoint is the single writer to the `services` collection — see [Handler Registration](#handler-registration).
## ATIF Generation
@@ -127,6 +127,38 @@ The post-processor uses a version-based re-processing scheme:
This allows deploying handler improvements and having them automatically applied to historical data.
+## Handler Registration
+
+Each post-process handler declares its DAG metadata in a `handler.yaml` file colocated with the worker (e.g. `apps/workers/taxonomy/handler.yaml`). This mirrors the coding-agent `agent.yaml` registration pattern.
+
+```yaml
+# apps/workers/taxonomy/handler.yaml
+_id: pp-taxonomy
+type: post-process-handler
+version: 1
+queue: pp-taxonomy-queue
+selector: taxonomy
+autoBackfill: false
+dependsOn:
+ - pp-atif
+```
+
+On deploy, a generic registration script — `packages/shared/src/scripts/register-handler.ts` — reads the `handler.yaml` pointed to by `HANDLER_YAML_PATH`, waits for the scheduler's `/health`, and POSTs the parsed document to `${SCHEDULER_URL}/handlers/register` (with retry). The scheduler validates the document, runs a cycle check against the existing topology, and upserts it into the `services` collection via `HandlerDispatcher.registerHandler`. **Workers never write to the `services` collection directly** — the scheduler is the sole owner.
+
+```mermaid
+flowchart LR
+ YAML[handler.yaml] --> SCRIPT[register-handler.ts]
+ SCRIPT -->|"POST /handlers/register"| SCH[Scheduler]
+ SCH -->|"validate + cycle check + upsert"| SVC[(services collection)]
+```
+
+**Where it runs:**
+
+- **Docker Compose:** one `register-handler-` init service per handler (`pp-atif`, `pp-taxonomy`, `pp-report`) runs the generic script via `tsx`, gated on the scheduler being up. The worker waits for its registration service to complete.
+- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. Only `pp-atif` is registered in K8s today because it is the only post-process handler deployed to the cluster; `pp-taxonomy` and `pp-report` are registered in Compose only until the taxonomy worker is deployed to K8s and report generation moves onto the DAG. The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
+
+To **add or change a handler**, edit its `handler.yaml` (bump `version`, adjust `dependsOn`, etc.) — no code or migration changes are needed for registration.
+
## Status Lifecycle
```mermaid
@@ -157,7 +189,8 @@ stateDiagram-v2
| `SCOPE_MT_API_URL` / `API_BASE_URL` | `http://localhost:3001` | API URL used by report/taxonomy Copilot tools |
| `TAXONOMY_MODEL` | `gpt-4.1` | Copilot SDK model used by the taxonomy handler |
| `SESSION_TIMEOUT_MS` | `300000` | Timeout for report/taxonomy Copilot SDK sessions |
-| `SCHEDULER_URL` | _(unset)_ | Optional scheduler notify base URL for downstream handler dispatch |
+| `SCHEDULER_URL` | _(unset)_ | Scheduler base URL — used by handlers to notify completion and by the register-handler script to reach `/handlers/register` |
+| `HANDLER_YAML_PATH` | _(unset)_ | Path to a handler's `handler.yaml`, read by the generic `register-handler` script |
## Infrastructure
@@ -165,4 +198,4 @@ stateDiagram-v2
- **Blob Storage:** `snapshots` container (shared with HAR, tool-calls, and other artifacts)
- **Database:** MongoDB `requests` collection (`run.handlerStatus` map keyed by handler ID, with deprecated `run.postProcessorStatus` / `run.postProcessorVersion` compatibility fields during migration)
- **KEDA:** ScaledObject scales the worker to zero when queue is empty
-- **Version registration:** Kubernetes Job runs on each deploy; Docker Compose uses an init service
\ No newline at end of file
+- **Handler registration:** declarative `handler.yaml` per worker → generic `register-handler` script → scheduler `POST /handlers/register` (sole writer to the `services` collection). A Kubernetes Job runs the script on each deploy; Docker Compose uses per-handler init services. See [Handler Registration](#handler-registration).
\ No newline at end of file
diff --git a/packages/shared/src/scripts/register-handler.test.ts b/packages/shared/src/scripts/register-handler.test.ts
new file mode 100644
index 000000000..0c3858b58
--- /dev/null
+++ b/packages/shared/src/scripts/register-handler.test.ts
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, expect, it } from "vitest";
+import { parseHandlerDocument } from "./register-handler.js";
+
+describe("parseHandlerDocument", () => {
+ const valid = {
+ _id: "pp-taxonomy",
+ type: "post-process-handler",
+ version: 1,
+ queue: "pp-taxonomy-queue",
+ selector: "taxonomy",
+ autoBackfill: false,
+ dependsOn: ["pp-atif"],
+ };
+
+ it("accepts a valid handler document", () => {
+ expect(parseHandlerDocument(valid)).toEqual(valid);
+ });
+
+ it("defaults dependsOn to an empty array when omitted", () => {
+ const { dependsOn, ...withoutDeps } = valid;
+ expect(parseHandlerDocument(withoutDeps).dependsOn).toEqual([]);
+ });
+
+ it("rejects a missing _id", () => {
+ expect(() => parseHandlerDocument({ ...valid, _id: "" })).toThrow(/_id/);
+ });
+
+ it("rejects a wrong type", () => {
+ expect(() => parseHandlerDocument({ ...valid, type: "agent" })).toThrow(/type/);
+ });
+
+ it("rejects a non-numeric version", () => {
+ expect(() => parseHandlerDocument({ ...valid, version: "1" })).toThrow(/version/);
+ });
+
+ it("rejects a non-boolean autoBackfill", () => {
+ expect(() => parseHandlerDocument({ ...valid, autoBackfill: "yes" })).toThrow(
+ /autoBackfill/,
+ );
+ });
+
+ it("rejects a dependsOn that is not an array of strings", () => {
+ expect(() => parseHandlerDocument({ ...valid, dependsOn: [1, 2] })).toThrow(
+ /dependsOn/,
+ );
+ });
+
+ it("rejects a non-object input", () => {
+ expect(() => parseHandlerDocument("nope")).toThrow(/mapping/);
+ });
+});
diff --git a/packages/shared/src/scripts/register-handler.ts b/packages/shared/src/scripts/register-handler.ts
new file mode 100644
index 000000000..c585e9eb1
--- /dev/null
+++ b/packages/shared/src/scripts/register-handler.ts
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Generic post-process handler registration script.
+ *
+ * Replaces the per-worker, inlined `register-version.ts` scripts that wrote
+ * directly to MongoDB. Reads a declarative `handler.yaml` (path from
+ * HANDLER_YAML_PATH) and POSTs it to the scheduler's
+ * `POST /handlers/register` endpoint (the scheduler owns the `services`
+ * collection). Used identically by docker-compose init services and the K8s
+ * registration Jobs.
+ *
+ * Mirrors the coding-agent registration pattern (`agent.yaml` →
+ * `POST /api/v1/agents`).
+ *
+ * Environment:
+ * HANDLER_YAML_PATH Path to the handler.yaml file (required)
+ * SCHEDULER_URL Base URL of the scheduler HTTP server, e.g.
+ * http://scheduler:8080 (required)
+ */
+import { readFile } from "node:fs/promises";
+import { parse as parseYaml } from "yaml";
+import type { HandlerServiceDocument } from "../types/types.js";
+
+const HEALTH_RETRIES = 30;
+const HEALTH_DELAY_MS = 3_000;
+const POST_RETRIES = 10;
+const POST_DELAY_MS = 3_000;
+
+function isNonEmptyString(value: unknown): value is string {
+ return typeof value === "string" && value.trim().length > 0;
+}
+
+/** Validate the parsed YAML conforms to the HandlerServiceDocument shape. */
+export function parseHandlerDocument(raw: unknown): HandlerServiceDocument {
+ if (typeof raw !== "object" || raw === null) {
+ throw new Error("handler.yaml must contain a mapping");
+ }
+ const doc = raw as Record;
+
+ if (!isNonEmptyString(doc._id)) {
+ throw new Error("handler.yaml: '_id' is required");
+ }
+ if (doc.type !== "post-process-handler") {
+ throw new Error("handler.yaml: 'type' must be 'post-process-handler'");
+ }
+ if (typeof doc.version !== "number" || !Number.isFinite(doc.version)) {
+ throw new Error("handler.yaml: 'version' must be a number");
+ }
+ if (!isNonEmptyString(doc.queue)) {
+ throw new Error("handler.yaml: 'queue' is required");
+ }
+ if (!isNonEmptyString(doc.selector)) {
+ throw new Error("handler.yaml: 'selector' is required");
+ }
+ if (typeof doc.autoBackfill !== "boolean") {
+ throw new Error("handler.yaml: 'autoBackfill' must be a boolean");
+ }
+ const dependsOn = doc.dependsOn ?? [];
+ if (!Array.isArray(dependsOn) || !dependsOn.every((d) => isNonEmptyString(d))) {
+ throw new Error("handler.yaml: 'dependsOn' must be an array of strings");
+ }
+
+ return {
+ _id: doc._id,
+ type: "post-process-handler",
+ version: doc.version,
+ queue: doc.queue,
+ selector: doc.selector,
+ autoBackfill: doc.autoBackfill,
+ dependsOn: dependsOn as string[],
+ };
+}
+
+async function delay(ms: number): Promise {
+ await new Promise((resolve) => setTimeout(resolve, ms));
+}
+
+async function waitForScheduler(schedulerUrl: string): Promise {
+ for (let attempt = 1; attempt <= HEALTH_RETRIES; attempt++) {
+ try {
+ const res = await fetch(`${schedulerUrl}/health`);
+ if (res.ok) {
+ return;
+ }
+ } catch {
+ // not ready yet
+ }
+ console.log(
+ `[register-handler] Scheduler not ready (attempt ${attempt}/${HEALTH_RETRIES}), retrying in ${HEALTH_DELAY_MS}ms...`,
+ );
+ await delay(HEALTH_DELAY_MS);
+ }
+ throw new Error(`Scheduler did not become healthy at ${schedulerUrl}`);
+}
+
+async function postRegistration(
+ schedulerUrl: string,
+ doc: HandlerServiceDocument,
+): Promise {
+ for (let attempt = 1; attempt <= POST_RETRIES; attempt++) {
+ try {
+ const res = await fetch(`${schedulerUrl}/handlers/register`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(doc),
+ });
+ if (res.ok) {
+ return;
+ }
+ const body = await res.text();
+ console.log(
+ `[register-handler] Register failed (attempt ${attempt}/${POST_RETRIES}): HTTP ${res.status} ${body}`,
+ );
+ } catch (err) {
+ console.log(
+ `[register-handler] Register error (attempt ${attempt}/${POST_RETRIES}): ${
+ err instanceof Error ? err.message : String(err)
+ }`,
+ );
+ }
+ await delay(POST_DELAY_MS);
+ }
+ throw new Error(`Failed to register handler ${doc._id} after ${POST_RETRIES} attempts`);
+}
+
+export async function registerHandlerFromYaml(
+ yamlPath: string,
+ schedulerUrl: string,
+): Promise {
+ const content = await readFile(yamlPath, "utf-8");
+ const doc = parseHandlerDocument(parseYaml(content));
+
+ console.log(
+ `[register-handler] Registering ${doc._id} (version=${doc.version}, queue=${doc.queue}) at ${schedulerUrl}`,
+ );
+
+ await waitForScheduler(schedulerUrl);
+ await postRegistration(schedulerUrl, doc);
+
+ console.log(`[register-handler] Registered ${doc._id} successfully`);
+ return doc;
+}
+
+async function main(): Promise {
+ const yamlPath = process.env.HANDLER_YAML_PATH;
+ const schedulerUrl = process.env.SCHEDULER_URL;
+
+ if (!yamlPath) {
+ throw new Error("HANDLER_YAML_PATH is required");
+ }
+ if (!schedulerUrl) {
+ throw new Error("SCHEDULER_URL is required");
+ }
+
+ await registerHandlerFromYaml(yamlPath, schedulerUrl.replace(/\/+$/, ""));
+}
+
+// Only run when executed directly (not when imported by tests).
+const isDirectRun =
+ process.argv[1] !== undefined &&
+ import.meta.url === new URL(`file://${process.argv[1]}`).href;
+
+if (isDirectRun) {
+ main().catch((err) => {
+ console.error("[register-handler] Fatal error:", err);
+ process.exit(1);
+ });
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6f1c765b7..a7903fc00 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -691,9 +691,6 @@ importers:
dotenv:
specifier: ^16.4.5
version: 16.6.1
- mongodb:
- specifier: ^6.10.0
- version: 6.21.0
shared:
specifier: workspace:*
version: link:../../../packages/shared
@@ -719,9 +716,6 @@ importers:
dotenv:
specifier: ^16.4.5
version: 16.6.1
- mongodb:
- specifier: ^6.10.0
- version: 6.21.0
shared:
specifier: workspace:*
version: link:../../../packages/shared
From 02900bda44f5f43aa8368d72b960b825d5456cdc Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 13:34:08 -0700
Subject: [PATCH 022/287] feat: scheduler triggers report generation when
handler DAG drains
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reports were modeled as a DAG handler node (pp-report, dependsOn
[pp-atif, pp-taxonomy]), but the report-generator worker is keyed by
reportId and requires a templateId, while the DAG dispatches a generic
{type, requestId, runId} message — so pp-report could never process a
DAG message. Reports are also parameterized, N-per-run, and trigger-gated,
so they don't fit the idempotent per-run DAG-node model.
Take reports off the DAG. The scheduler now detects when a run's handler
DAG has drained (every registered handler terminal: done | failed |
blocked-by-failed-dependency) and calls the existing
POST /api/v1/reports/trigger endpoint, which evaluates each template's
trigger and creates a properly-templated ReportDocument + enqueues
{reportId} per match.
- HandlerDispatcher: isHandlerTerminal/isDagDrained/maybeTriggerReports/
triggerReports + pollTriggerReports safety net. Exactly-once via an
atomic run.reportsTriggeredAt guard, scoped by run._id so a stale notify
or concurrent retry can never trigger reports for — or roll back the
guard of — a different attempt. Fires on run-terminal (zero-handler /
already-drained), both branches of handler-complete (a failure can drain
the DAG), and the 30s poll loop. Rolls back the guard on POST failure.
- Inject API_URL into the dispatcher; add API_URL to scheduler env in
docker-compose.yml and deploy/base/scheduler.yaml.
- Remove pp-report as a DAG node: delete report-generator/handler.yaml,
its Dockerfile COPY lines, the register-handler-report-generator compose
service, the dead idx_handler_dispatch_report index in migration 019, and
stale comments. No migration to delete pp-report is needed — nothing is
deployed, so a fresh environment never registers it.
- Add reportsTriggeredAt to RunState.
- Tests: 13 dispatcher tests (drain detection, exactly-once guard,
attempt-scoped claim/rollback, stale-runId rejection, POST payload).
- Docs: post-processing.md "Report Triggering on DAG Drain" section +
ENV_VARIABLES API_URL.
Verified E2E: run -> pp-atif(done) -> pp-taxonomy(failed) -> DAG drains ->
scheduler POST /reports/trigger -> API matches template -> ReportDocument
(templateId) enqueued -> report-generator -> report done. Confirms reports
fire even when a handler fails.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
ENV_VARIABLES.md | 9 +
apps/scheduler/src/handler-dispatcher.test.ts | 251 ++++++++++++++++++
apps/scheduler/src/handler-dispatcher.ts | 221 ++++++++++++---
apps/scheduler/src/index.ts | 3 +
apps/workers/report-generator/Dockerfile | 2 -
apps/workers/report-generator/handler.yaml | 12 -
docker-compose.dev.yml | 4 -
docker-compose.yml | 18 +-
docs/architecture/post-processing.md | 59 +++-
.../018-migrate-services-to-handler-dag.ts | 7 +-
.../019-add-handler-status-index.ts | 8 -
packages/shared/src/types/types.ts | 7 +-
12 files changed, 520 insertions(+), 81 deletions(-)
create mode 100644 apps/scheduler/src/handler-dispatcher.test.ts
delete mode 100644 apps/workers/report-generator/handler.yaml
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index 5044d6c53..5d62a193a 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -333,6 +333,15 @@ Optional base URL for the scheduler's HTTP notification endpoints. When set, cod
- **Kubernetes:** `http://scheduler-service.scoped.svc.cluster.local:8080`
- **Local dev:** Leave unset to rely on legacy queue fallback unless you are also running the scheduler locally
+### API_URL
+**Default:** `http://api:80`
+**Type:** URL string
+
+Base URL the **scheduler** uses to reach the API's `POST /api/v1/reports/trigger` endpoint. When a run's post-processing handler DAG drains (every registered handler reaches a terminal state), the scheduler calls this endpoint so the API can evaluate each report template's trigger and create the templated report job(s). Reports are deliberately not DAG handlers — see [docs/architecture/post-processing.md](docs/architecture/post-processing.md#report-triggering-on-dag-drain).
+
+- **Docker Compose:** `http://api:80`
+- **Kubernetes:** `http://api.scoped.svc.cluster.local:80`
+
## Worker Configuration
### SCOPE_RUN_HEARTBEAT_STALE_MS
diff --git a/apps/scheduler/src/handler-dispatcher.test.ts b/apps/scheduler/src/handler-dispatcher.test.ts
new file mode 100644
index 000000000..080b2b4a7
--- /dev/null
+++ b/apps/scheduler/src/handler-dispatcher.test.ts
@@ -0,0 +1,251 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
+import type { HandlerServiceDocument } from "shared";
+import { HandlerDispatcher } from "./handler-dispatcher.js";
+
+const HANDLERS: HandlerServiceDocument[] = [
+ {
+ _id: "pp-atif",
+ type: "post-process-handler",
+ version: 1,
+ queue: "post-processor-queue",
+ selector: "atif",
+ autoBackfill: true,
+ dependsOn: [],
+ },
+ {
+ _id: "pp-taxonomy",
+ type: "post-process-handler",
+ version: 1,
+ queue: "pp-taxonomy-queue",
+ selector: "taxonomy",
+ autoBackfill: false,
+ dependsOn: ["pp-atif"],
+ },
+];
+
+function createMockCollection() {
+ return {
+ findOne: vi.fn(),
+ findOneAndUpdate: vi.fn(),
+ updateOne: vi.fn().mockResolvedValue(undefined),
+ find: vi.fn(),
+ } as any;
+}
+
+function createMockDb(handlers: HandlerServiceDocument[]) {
+ return {
+ collection: vi.fn().mockReturnValue({
+ find: vi.fn().mockReturnValue({ toArray: vi.fn().mockResolvedValue(handlers) }),
+ updateOne: vi.fn().mockResolvedValue(undefined),
+ }),
+ } as any;
+}
+
+function makeDispatcher(
+ collection: any,
+ handlers: HandlerServiceDocument[] = HANDLERS,
+ apiUrl = "http://api.test",
+) {
+ const db = createMockDb(handlers);
+ const createQueueClient = vi.fn();
+ return new HandlerDispatcher(collection, db, createQueueClient, 60_000, 30, apiUrl);
+}
+
+describe("HandlerDispatcher — drain detection", () => {
+ let collection: ReturnType;
+
+ beforeEach(() => {
+ collection = createMockCollection();
+ });
+
+ function isDrained(
+ handlers: HandlerServiceDocument[],
+ handlerStatus: Record | undefined,
+ ): boolean {
+ const d = makeDispatcher(collection, handlers) as any;
+ const graph = d.buildGraph(handlers);
+ return d.isDagDrained(handlers, graph, handlerStatus);
+ }
+
+ it("is drained when all handlers are done", () => {
+ expect(
+ isDrained(HANDLERS, { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } }),
+ ).toBe(true);
+ });
+
+ it("is NOT drained when the leaf is still pending", () => {
+ expect(isDrained(HANDLERS, { "pp-atif": { status: "done" } })).toBe(false);
+ });
+
+ it("is NOT drained when a handler is processing", () => {
+ expect(
+ isDrained(HANDLERS, {
+ "pp-atif": { status: "done" },
+ "pp-taxonomy": { status: "processing" },
+ }),
+ ).toBe(false);
+ });
+
+ it("is drained when a failed dependency blocks its descendant", () => {
+ // pp-atif failed → pp-taxonomy can never run (blocked) → terminal.
+ expect(isDrained(HANDLERS, { "pp-atif": { status: "failed" } })).toBe(true);
+ });
+
+ it("is drained when the leaf itself failed", () => {
+ expect(
+ isDrained(HANDLERS, {
+ "pp-atif": { status: "done" },
+ "pp-taxonomy": { status: "failed" },
+ }),
+ ).toBe(true);
+ });
+
+ it("is vacuously drained when there are no handlers", () => {
+ expect(isDrained([], undefined)).toBe(true);
+ });
+});
+
+describe("HandlerDispatcher — maybeTriggerReports", () => {
+ let collection: ReturnType;
+ const fetchMock = vi.fn();
+
+ beforeEach(() => {
+ collection = createMockCollection();
+ fetchMock.mockReset();
+ vi.stubGlobal("fetch", fetchMock);
+ });
+
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ });
+
+ it("POSTs to /api/v1/reports/trigger once the DAG drains", async () => {
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: {
+ _id: "run-1",
+ status: "done",
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ },
+ });
+ collection.findOneAndUpdate.mockResolvedValue({ _id: "req-1" }); // claim succeeds
+ fetchMock.mockResolvedValue({ ok: true, status: 201, text: async () => "" });
+
+ const d = makeDispatcher(collection) as any;
+ await d.maybeTriggerReports("req-1", "run-1");
+
+ expect(collection.findOneAndUpdate).toHaveBeenCalledWith(
+ expect.objectContaining({
+ _id: "req-1",
+ "run._id": "run-1",
+ "run.status": "done",
+ "run.reportsTriggeredAt": { $exists: false },
+ }),
+ expect.objectContaining({ $set: expect.objectContaining({ "run.reportsTriggeredAt": expect.any(Date) }) }),
+ expect.objectContaining({ returnDocument: "after" }),
+ );
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ const [url, init] = fetchMock.mock.calls[0];
+ expect(url).toBe("http://api.test/api/v1/reports/trigger");
+ expect(init.method).toBe("POST");
+ expect(JSON.parse(init.body)).toEqual({ requestId: "req-1" });
+ });
+
+ it("does not trigger when the DAG has not drained", async () => {
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: { _id: "run-1", status: "done", handlerStatus: { "pp-atif": { status: "done" } } },
+ });
+
+ const d = makeDispatcher(collection) as any;
+ await d.maybeTriggerReports("req-1", "run-1");
+
+ expect(collection.findOneAndUpdate).not.toHaveBeenCalled();
+ expect(fetchMock).not.toHaveBeenCalled();
+ });
+
+ it("does not trigger when reports were already triggered", async () => {
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: { _id: "run-1", status: "done", reportsTriggeredAt: new Date(), handlerStatus: {} },
+ });
+
+ const d = makeDispatcher(collection) as any;
+ await d.maybeTriggerReports("req-1", "run-1");
+
+ expect(collection.findOneAndUpdate).not.toHaveBeenCalled();
+ expect(fetchMock).not.toHaveBeenCalled();
+ });
+
+ it("does not trigger when the current attempt differs from the notified runId", async () => {
+ // A stale notify for run-1 arrives, but the request has since been retried
+ // into run-2 — the guard must not fire for the wrong attempt.
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: {
+ _id: "run-2",
+ status: "done",
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ },
+ });
+
+ const d = makeDispatcher(collection) as any;
+ await d.maybeTriggerReports("req-1", "run-1");
+
+ expect(collection.findOneAndUpdate).not.toHaveBeenCalled();
+ expect(fetchMock).not.toHaveBeenCalled();
+ });
+
+ it("does not POST twice when the guard claim is lost to a concurrent path", async () => {
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: {
+ _id: "run-1",
+ status: "done",
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ },
+ });
+ collection.findOneAndUpdate.mockResolvedValue(null); // another path claimed it first
+
+ const d = makeDispatcher(collection) as any;
+ await d.maybeTriggerReports("req-1", "run-1");
+
+ expect(fetchMock).not.toHaveBeenCalled();
+ });
+
+ it("rolls back the guard when the trigger POST fails", async () => {
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: {
+ _id: "run-1",
+ status: "done",
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ },
+ });
+ collection.findOneAndUpdate.mockResolvedValue({ _id: "req-1" });
+ fetchMock.mockResolvedValue({ ok: false, status: 500, text: async () => "boom" });
+
+ const d = makeDispatcher(collection) as any;
+ d.reportRetryOptions = { maxRetries: 1, baseDelayMs: 1, isRetryable: () => true };
+ await d.maybeTriggerReports("req-1", "run-1");
+
+ // Guard rolled back via $unset (scoped to the attempt) so the poll net retries.
+ expect(collection.updateOne).toHaveBeenCalledWith(
+ { _id: "req-1", "run._id": "run-1" },
+ { $unset: { "run.reportsTriggeredAt": "" } },
+ );
+ });
+
+ it("ignores runs that are not done", async () => {
+ collection.findOne.mockResolvedValue({ _id: "req-1", run: { _id: "run-1", status: "processing" } });
+
+ const d = makeDispatcher(collection) as any;
+ await d.maybeTriggerReports("req-1", "run-1");
+
+ expect(collection.findOneAndUpdate).not.toHaveBeenCalled();
+ expect(fetchMock).not.toHaveBeenCalled();
+ });
+});
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index 09b461def..615a45e3d 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -4,7 +4,8 @@
import { Collection, Db } from "mongodb";
import { QueueClient } from "@azure/storage-queue";
import type { RequestDocument, HandlerServiceDocument, HandlerRunStatus } from "shared";
-import { DependencyGraph } from "shared";
+import { DependencyGraph, withRetry } from "shared";
+import type { RetryOptions } from "shared";
import type { NotifyHandler } from "./notify-routes.js";
/**
@@ -24,12 +25,22 @@ export class HandlerDispatcher implements NotifyHandler {
private dispatching = false;
private queueClients = new Map();
+ /** Retry policy for the report-trigger POST. The 30s poll net is the durable
+ * backstop, so in-call retries are modest. Overridable in tests. */
+ private reportRetryOptions: RetryOptions = {
+ maxRetries: 4,
+ baseDelayMs: 250,
+ maxDelayMs: 2_000,
+ isRetryable: () => true,
+ };
+
constructor(
private readonly collection: Collection,
private readonly db: Db,
private readonly createQueueClient: (queueName: string) => QueueClient,
private readonly pollIntervalMs: number = 30_000,
private readonly batchSize: number = 30,
+ private readonly apiUrl: string = process.env.API_URL || "http://api:80",
) {}
start(): void {
@@ -54,14 +65,18 @@ export class HandlerDispatcher implements NotifyHandler {
async onRunTerminal(requestId: string, runId: string): Promise {
console.log(`[HandlerDispatcher] Notify: run-terminal ${requestId} (run=${runId})`);
const handlers = await this.loadHandlers();
- if (handlers.length === 0) return;
- const graph = this.buildGraph(handlers);
- const roots = handlers.filter((h) => !h.dependsOn || h.dependsOn.length === 0);
+ if (handlers.length > 0) {
+ const graph = this.buildGraph(handlers);
+ const roots = handlers.filter((h) => !h.dependsOn || h.dependsOn.length === 0);
- for (const handler of roots) {
- await this.dispatchIfEligible(requestId, runId, handler, graph, handlers);
+ for (const handler of roots) {
+ await this.dispatchIfEligible(requestId, runId, handler, graph, handlers);
+ }
}
+
+ // A run with no handlers (or an already-drained DAG) triggers reports now.
+ await this.maybeTriggerReports(requestId, runId);
}
async onHandlerComplete(
@@ -86,7 +101,9 @@ export class HandlerDispatcher implements NotifyHandler {
);
if (status === "failed") {
- // Don't dispatch downstream on failure
+ // Don't dispatch downstream on failure, but the failure may have drained
+ // the DAG (descendants are now permanently blocked) — check for reports.
+ await this.maybeTriggerReports(requestId, runId);
return;
}
@@ -105,6 +122,9 @@ export class HandlerDispatcher implements NotifyHandler {
for (const child of children) {
await this.dispatchIfEligible(requestId, runId, child, graph, handlers);
}
+
+ // Completing this handler may have drained the DAG (e.g. it was the leaf).
+ await this.maybeTriggerReports(requestId, runId);
}
async registerHandler(doc: HandlerServiceDocument): Promise {
@@ -134,6 +154,119 @@ export class HandlerDispatcher implements NotifyHandler {
);
}
+ // ── Report trigger on DAG drain ─────────────────────────────────────
+
+ /**
+ * A handler is "terminal" for a run when it can produce no further work:
+ * it has succeeded (`done`), failed (`failed`), or is permanently blocked
+ * because one of its transitive dependencies failed (so it can never run).
+ */
+ private isHandlerTerminal(
+ handlerId: string,
+ graph: DependencyGraph,
+ handlerStatus: Record | undefined,
+ ): boolean {
+ const status = handlerStatus?.[handlerId]?.status;
+ if (status === "done" || status === "failed") return true;
+
+ // Not yet dispatched/processed — terminal only if blocked by a failed
+ // ancestor (any transitive dependency that failed).
+ if (status === undefined) {
+ for (const ancestorId of graph.getAncestors(handlerId)) {
+ if (handlerStatus?.[ancestorId]?.status === "failed") return true;
+ }
+ }
+
+ // "queued" or "processing" — still active.
+ return false;
+ }
+
+ /**
+ * The DAG is drained for a run when every registered handler is terminal.
+ * Vacuously true when there are no handlers.
+ */
+ private isDagDrained(
+ handlers: HandlerServiceDocument[],
+ graph: DependencyGraph,
+ handlerStatus: Record | undefined,
+ ): boolean {
+ return handlers.every((h) =>
+ this.isHandlerTerminal(h._id, graph, handlerStatus),
+ );
+ }
+
+ /**
+ * If the run's handler DAG has drained and reports have not yet been
+ * triggered, atomically claim the exactly-once guard and POST to the API's
+ * report-trigger endpoint. Rolls the guard back on failure so the poll
+ * safety net retries.
+ *
+ * All reads/writes are scoped to the specific attempt (`run._id === runId`)
+ * so a stale notify or a concurrent retry can never trigger reports for, or
+ * roll back the guard of, a different attempt.
+ */
+ private async maybeTriggerReports(requestId: string, runId: string): Promise {
+ const doc = await this.collection.findOne({ _id: requestId } as any);
+ const run = doc?.run;
+ if (!run || run._id !== runId || run.status !== "done") return;
+ if ((run as any).reportsTriggeredAt) return;
+
+ const handlers = await this.loadHandlers();
+ const graph = this.buildGraph(handlers);
+ const handlerStatus = (run as any).handlerStatus as
+ | Record
+ | undefined;
+
+ if (!this.isDagDrained(handlers, graph, handlerStatus)) return;
+
+ // Atomically claim the trigger so concurrent notify/poll paths fire once.
+ const claimed = await this.collection.findOneAndUpdate(
+ {
+ _id: requestId,
+ "run._id": runId,
+ "run.status": "done",
+ "run.reportsTriggeredAt": { $exists: false },
+ } as any,
+ { $set: { "run.reportsTriggeredAt": new Date() } } as any,
+ { returnDocument: "after" },
+ );
+ if (!claimed) return; // Another path already claimed it.
+
+ try {
+ await this.triggerReports(requestId);
+ console.log(
+ `[HandlerDispatcher] Triggered report generation for ${requestId} (DAG drained)`,
+ );
+ } catch (err) {
+ // Roll back the guard so a later poll retries — scoped to this attempt so
+ // a concurrent retry's valid guard is never cleared.
+ await this.collection.updateOne(
+ { _id: requestId, "run._id": runId } as any,
+ { $unset: { "run.reportsTriggeredAt": "" } } as any,
+ );
+ console.error(
+ `[HandlerDispatcher] Report trigger failed for ${requestId}, rolled back guard:`,
+ err,
+ );
+ }
+ }
+
+ /** POSTs to the API's report-trigger endpoint with retry on transient errors. */
+ private async triggerReports(requestId: string): Promise {
+ const url = `${this.apiUrl}/api/v1/reports/trigger`;
+ await withRetry(async () => {
+ const res = await fetch(url, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ requestId }),
+ });
+ if (!res.ok) {
+ const text = await res.text().catch(() => "");
+ throw new Error(`POST ${url} -> ${res.status} ${text}`.trim());
+ }
+ }, this.reportRetryOptions);
+ }
+
// ── Poll safety net ─────────────────────────────────────────────────
private async pollDispatch(): Promise {
@@ -141,33 +274,38 @@ export class HandlerDispatcher implements NotifyHandler {
this.dispatching = true;
try {
const handlers = await this.loadHandlers();
- if (handlers.length === 0) return;
-
- const graph = this.buildGraph(handlers);
- for (const handler of handlers) {
- // Find runs that need this handler dispatched
- for (let i = 0; i < this.batchSize; i++) {
- const filter = this.buildDispatchFilter(handler, handlers, graph);
- if (!filter) break;
-
- const claimed = await this.collection.findOneAndUpdate(
- filter as any,
- {
- $set: {
- [`run.handlerStatus.${handler._id}.status`]: "queued",
- [`run.handlerStatus.${handler._id}.updatedAt`]: new Date(),
- },
- } as any,
- { sort: { updatedAt: -1 }, returnDocument: "after" },
- );
-
- if (!claimed) break;
-
- await this.enqueueToHandler(handler, claimed._id, (claimed as any).run?._id);
- console.log(`[HandlerDispatcher] Poll-dispatched ${handler._id} for ${claimed._id}`);
+ if (handlers.length > 0) {
+ const graph = this.buildGraph(handlers);
+
+ for (const handler of handlers) {
+ // Find runs that need this handler dispatched
+ for (let i = 0; i < this.batchSize; i++) {
+ const filter = this.buildDispatchFilter(handler, handlers, graph);
+ if (!filter) break;
+
+ const claimed = await this.collection.findOneAndUpdate(
+ filter as any,
+ {
+ $set: {
+ [`run.handlerStatus.${handler._id}.status`]: "queued",
+ [`run.handlerStatus.${handler._id}.updatedAt`]: new Date(),
+ },
+ } as any,
+ { sort: { updatedAt: -1 }, returnDocument: "after" },
+ );
+
+ if (!claimed) break;
+
+ await this.enqueueToHandler(handler, claimed._id, (claimed as any).run?._id);
+ console.log(`[HandlerDispatcher] Poll-dispatched ${handler._id} for ${claimed._id}`);
+ }
}
}
+
+ // Safety net: trigger reports for any done run whose DAG has drained but
+ // whose report trigger was missed (e.g. a dropped notify).
+ await this.pollTriggerReports();
} catch (err) {
console.error("[HandlerDispatcher] Error during poll dispatch:", err);
} finally {
@@ -175,6 +313,27 @@ export class HandlerDispatcher implements NotifyHandler {
}
}
+ /**
+ * Scans for `done` runs whose reports have not yet been triggered and runs
+ * the drain check on each. Bounded by `batchSize` per poll.
+ */
+ private async pollTriggerReports(): Promise {
+ const candidates = await this.collection
+ .find({
+ "run.status": "done",
+ "run.reportsTriggeredAt": { $exists: false },
+ deletedAt: { $exists: false },
+ } as any)
+ .limit(this.batchSize)
+ .toArray();
+
+ for (const doc of candidates) {
+ const runId = (doc as any).run?._id as string | undefined;
+ if (!runId) continue;
+ await this.maybeTriggerReports(doc._id, runId);
+ }
+ }
+
// ── Dispatch logic ──────────────────────────────────────────────────
private async dispatchIfEligible(
diff --git a/apps/scheduler/src/index.ts b/apps/scheduler/src/index.ts
index dce1509fe..71ba9382a 100644
--- a/apps/scheduler/src/index.ts
+++ b/apps/scheduler/src/index.ts
@@ -30,6 +30,7 @@ const POLL_INTERVAL_MS = parseInt(
10,
);
const HEALTH_PORT = parseInt(process.env.PORT || "8080", 10);
+const API_URL = process.env.API_URL || "http://api:80";
/**
* Parse per-worker-type queue depth config from environment.
@@ -142,6 +143,8 @@ async function main(): Promise {
db,
createQueueClient,
ppPollIntervalMs,
+ 30,
+ API_URL,
);
handlerDispatcher.start();
console.log("[Scheduler] Handler dispatcher (DAG) started");
diff --git a/apps/workers/report-generator/Dockerfile b/apps/workers/report-generator/Dockerfile
index 62a5f2646..3cfd18150 100644
--- a/apps/workers/report-generator/Dockerfile
+++ b/apps/workers/report-generator/Dockerfile
@@ -15,7 +15,6 @@ COPY packages/shared/tsconfig.json ./packages/shared/
COPY packages/shared/src ./packages/shared/src/
COPY apps/workers/report-generator/tsconfig.json ./apps/workers/report-generator/
COPY apps/workers/report-generator/src ./apps/workers/report-generator/src/
-COPY apps/workers/report-generator/handler.yaml ./apps/workers/report-generator/
RUN pnpm --filter shared build && pnpm --filter report-generator build
@@ -44,7 +43,6 @@ RUN pnpm install --frozen-lockfile --prod
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
COPY --from=builder /app/apps/workers/report-generator/dist ./apps/workers/report-generator/dist/
-COPY --from=builder /app/apps/workers/report-generator/handler.yaml ./apps/workers/report-generator/handler.yaml
WORKDIR /app/apps/workers/report-generator
diff --git a/apps/workers/report-generator/handler.yaml b/apps/workers/report-generator/handler.yaml
deleted file mode 100644
index f7e14d83e..000000000
--- a/apps/workers/report-generator/handler.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-# Post-process handler registration metadata.
-# Read by the generic register-handler script and POSTed to the
-# scheduler's POST /handlers/register endpoint on deploy.
-_id: pp-report
-type: post-process-handler
-version: 1
-queue: report-queue
-selector: report
-autoBackfill: false
-dependsOn:
- - pp-atif
- - pp-taxonomy
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index a2fbe32b5..0f9a0753e 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -204,10 +204,6 @@ services:
build:
target: dev
- register-handler-report-generator:
- build:
- target: dev
-
post-processor:
build:
target: dev
diff --git a/docker-compose.yml b/docker-compose.yml
index 53cdc0da1..164946b0e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -366,6 +366,7 @@ services:
SCHEDULER_QUEUE_DEPTH_CODER_ACP_COPILOT: "2"
SCHEDULER_POLL_INTERVAL_MS: "2000"
PORT: "8080"
+ API_URL: http://api:80
depends_on:
mongodb:
condition: service_healthy
@@ -639,8 +640,6 @@ services:
condition: service_healthy
api:
condition: service_started
- register-handler-report-generator:
- condition: service_completed_successfully
taxonomy-handler:
build:
@@ -687,21 +686,6 @@ services:
restart: "no"
entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
- register-handler-report-generator:
- build:
- context: .
- dockerfile: apps/workers/report-generator/Dockerfile
- profiles: [report]
- environment:
- <<: *common-env
- HANDLER_YAML_PATH: apps/workers/report-generator/handler.yaml
- SCHEDULER_URL: http://scheduler:8080
- depends_on:
- scheduler:
- condition: service_started
- restart: "no"
- entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
-
register-handler-post-processor:
build:
context: .
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index d16d6294f..a9fc61d42 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -34,7 +34,7 @@ Two paths trigger post-processing:
- Updates `run.turns.$.atifUrl` in the request document
4. On success, stamps `run.handlerStatus["pp-atif"] = { status: "done", version: N }` (while legacy `run.postProcessorVersion` / `run.postProcessorStatus` may still be mirrored during the transition)
-5. Triggers downstream taxonomy/report handlers once the scheduler sees the dependency graph is satisfied
+5. Triggers the downstream taxonomy handler once the scheduler sees the dependency graph is satisfied. (Reports are **not** a DAG handler — see [Report Triggering](#report-triggering-on-dag-drain).)
## Taxonomy Generation
@@ -120,7 +120,7 @@ processor.start();
The post-processor uses a version-based re-processing scheme:
-- Each handler is registered independently in the `services` collection using a `post-process-handler` document keyed by handler ID (for example `pp-atif`, `pp-taxonomy`, `pp-report`)
+- Each handler is registered independently in the `services` collection using a `post-process-handler` document keyed by handler ID (for example `pp-atif`, `pp-taxonomy`)
- Each registration stores the handler `version`, queue name, selector, `autoBackfill` behavior, and `dependsOn` DAG edges
- The scheduler compares each request's per-handler status/version state (for example `run.handlerStatus["pp-atif"]`) against the registered handler entry for that selector
- Requests with missing or outdated handler state are re-dispatched for that specific handler once its dependencies are satisfied
@@ -154,11 +154,61 @@ flowchart LR
**Where it runs:**
-- **Docker Compose:** one `register-handler-` init service per handler (`pp-atif`, `pp-taxonomy`, `pp-report`) runs the generic script via `tsx`, gated on the scheduler being up. The worker waits for its registration service to complete.
-- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. Only `pp-atif` is registered in K8s today because it is the only post-process handler deployed to the cluster; `pp-taxonomy` and `pp-report` are registered in Compose only until the taxonomy worker is deployed to K8s and report generation moves onto the DAG. The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
+- **Docker Compose:** one `register-handler-` init service per handler (`pp-atif`, `pp-taxonomy`) runs the generic script via `tsx`, gated on the scheduler being up. The worker waits for its registration service to complete.
+- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. Only `pp-atif` is registered in K8s today because it is the only post-process handler deployed to the cluster; `pp-taxonomy` is registered in Compose only until the taxonomy worker is deployed to K8s. The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
To **add or change a handler**, edit its `handler.yaml` (bump `version`, adjust `dependsOn`, etc.) — no code or migration changes are needed for registration.
+## Report Triggering on DAG Drain
+
+Reports are intentionally **not** modeled as a DAG handler. The report-generator
+worker is keyed by `reportId` and requires a `templateId`, whereas the DAG
+dispatches a generic `{ type, requestId, runId }` message — so a report node
+could never process a DAG message. Reports are also fundamentally different from
+post-process handlers: they are parameterized (per `templateId`), N-per-run (one
+per matching template), and trigger-gated (each template has its own
+`ReportTrigger`).
+
+Instead, the scheduler watches for a run's handler DAG to **drain** and then
+calls the existing `POST /api/v1/reports/trigger` endpoint, which evaluates every
+active template's trigger and creates the properly-templated `ReportDocument`(s).
+
+```mermaid
+flowchart LR
+ RT["run done"] --> DAG["scheduler dispatches DAG (pp-atif → pp-taxonomy)"]
+ DAG -->|"all handlers terminal"| DR{DAG drained?}
+ DR -->|yes| TRIG["POST /api/v1/reports/trigger { requestId }"]
+ TRIG --> API["API evaluates each template trigger → ReportDocument + report-queue {reportId}"]
+ API --> RG["report-generator (unchanged)"]
+```
+
+**Drain definition.** A handler is _terminal_ when its status is `done` or
+`failed`, **or** when its status is absent but a transitive dependency `failed`
+(so it can never run — effectively blocked). The DAG is drained when every
+registered handler is terminal. A run with **zero** registered handlers is
+vacuously drained, so reports trigger immediately on run completion.
+
+**Trigger regardless of handler success.** A flaky taxonomy must not block report
+generation (reports analyze the run/ATIF), so the scheduler triggers reports
+whenever the DAG drains — not only when every handler succeeded.
+
+**Exactly-once, attempt-scoped.** Before POSTing, the scheduler atomically claims
+a per-attempt guard (`run.reportsTriggeredAt`) via `findOneAndUpdate` filtered by
+`{ _id: requestId, "run._id": runId, "run.status": "done", "run.reportsTriggeredAt": { $exists: false } }`.
+Scoping by `run._id` ensures a stale notify or a concurrent retry can never fire
+reports for — or roll back the guard of — a different attempt. If the POST fails,
+the guard is rolled back (also `run._id`-scoped) so the 30s poll safety net
+retries.
+
+**Where it fires.** `maybeTriggerReports(requestId, runId)` runs at the end of
+`onRunTerminal` (handles zero-handler / already-drained runs), both branches of
+`onHandlerComplete` (success **and** the failure early-return, since a failure can
+drain the DAG by blocking descendants), and a `pollTriggerReports()` scan in the
+scheduler's 30s poll loop (durable backstop for dropped notifications).
+
+The scheduler reaches the API via the `API_URL` env var (`http://api:80` in
+Compose, `http://api.scoped.svc.cluster.local:80` in K8s).
+
## Status Lifecycle
```mermaid
@@ -190,6 +240,7 @@ stateDiagram-v2
| `TAXONOMY_MODEL` | `gpt-4.1` | Copilot SDK model used by the taxonomy handler |
| `SESSION_TIMEOUT_MS` | `300000` | Timeout for report/taxonomy Copilot SDK sessions |
| `SCHEDULER_URL` | _(unset)_ | Scheduler base URL — used by handlers to notify completion and by the register-handler script to reach `/handlers/register` |
+| `API_URL` | `http://api:80` | API base URL the **scheduler** uses to call `POST /api/v1/reports/trigger` when a run's handler DAG drains |
| `HANDLER_YAML_PATH` | _(unset)_ | Path to a handler's `handler.yaml`, read by the generic `register-handler` script |
## Infrastructure
diff --git a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
index b82b4335c..bcb3b3ade 100644
--- a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
+++ b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
@@ -7,8 +7,11 @@ import type { MigrationInterface } from "mongo-migrate-ts";
/**
* Migration 018: Remove the legacy "post-processor" service entry.
*
- * Handler service registration (pp-atif, pp-taxonomy, pp-report) is now owned
- * by each worker's register-version.ts script, run as a K8s Job on deploy.
+ * Handler service registration (pp-atif, pp-taxonomy) is now owned
+ * by each worker's handler.yaml + the generic register-handler script,
+ * which POSTs to the scheduler's POST /handlers/register endpoint on deploy.
+ * Reports are not a DAG handler — the scheduler triggers report generation
+ * (POST /api/v1/reports/trigger) once the DAG drains.
* This migration only cleans up the old single-entry format.
*/
export class MigrateServicesToHandlerDag implements MigrationInterface {
diff --git a/packages/db-migrations/src/migrations/019-add-handler-status-index.ts b/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
index ecdb0352a..577dc8901 100644
--- a/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
+++ b/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
@@ -21,14 +21,6 @@ const HANDLER_STATUS_INDEXES = [
updatedAt: -1 as const,
},
},
- {
- name: "idx_handler_dispatch_report",
- key: {
- "run.handlerStatus.pp-report.status": 1 as const,
- "run.status": 1 as const,
- updatedAt: -1 as const,
- },
- },
] as const;
export class AddHandlerStatusIndex implements MigrationInterface {
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index ccd7d7805..1a176e9c1 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -279,8 +279,13 @@ export interface RunState {
aiCallCount?: number;
rawChatUrl?: string;
rawChatFormat?: string;
- /** Per-handler post-processing status. Keys are handler IDs (e.g. "pp-atif", "pp-taxonomy", "pp-report"). */
+ /** Per-handler post-processing status. Keys are handler IDs (e.g. "pp-atif", "pp-taxonomy"). */
handlerStatus?: Record;
+ /** Set once the scheduler has triggered report generation for this run after
+ * the handler DAG drained (every handler reached a terminal state). Acts as
+ * an exactly-once guard so the scheduler POSTs /api/v1/reports/trigger at
+ * most once per run, even under notify/poll races. */
+ reportsTriggeredAt?: Date;
/** @deprecated Use handlerStatus["pp-atif"].version instead. Kept for migration compatibility. */
postProcessorVersion?: number;
/** @deprecated Use handlerStatus["pp-atif"].status instead. Kept for migration compatibility. */
From c6cd9b25c44db1b132ff5e07ef521a64713549e8 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 9 Jun 2026 17:21:44 -0700
Subject: [PATCH 023/287] feat(taxonomy): add dev CLI, API-based ATIF fetch,
and default to gpt-5.4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Extract the Copilot SDK taxonomy-generation loop into a shared,
side-effect-free generateTaxonomy() used by both the worker and a new
developer CLI (src/cli.ts, `pnpm taxonomy`). The CLI runs generation
against any local or integration run, streams session events, and writes
the validated taxonomy to a file — making it easy to troubleshoot and
A/B models without the full queue/scheduler pipeline.
Switch get_atif_trajectory to fetch ATIF through the run-scoped API
endpoint instead of reading blob storage directly, so the CLI needs only
an API URL + token (no storage connection string).
Change the default TAXONOMY_MODEL from gpt-4.1 to gpt-5.4. A/B testing
nine models on a multi-iteration run containing a real defect (agent lost
context in iteration 2) showed verdicts ranging 72-100: weaker models
(incl. gpt-4.1) missed the critical failure entirely, while gpt-5.4
caught it at the lowest token cost of the models tested.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
ENV_VARIABLES.md | 4 +-
apps/workers/taxonomy/package.json | 1 +
apps/workers/taxonomy/src/cli.ts | 206 ++++++++++++++++++
apps/workers/taxonomy/src/index.ts | 2 +-
.../taxonomy/src/taxonomy-generator.ts | 195 +++++++++++++++++
.../taxonomy/src/taxonomy-queue-processor.ts | 170 +--------------
apps/workers/taxonomy/src/tools.ts | 30 ++-
docker-compose.yml | 2 +-
docs/architecture/post-processing.md | 37 +++-
package.json | 1 +
10 files changed, 468 insertions(+), 180 deletions(-)
create mode 100644 apps/workers/taxonomy/src/cli.ts
create mode 100644 apps/workers/taxonomy/src/taxonomy-generator.ts
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index 5d62a193a..cd43d79bc 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -286,11 +286,13 @@ Git commit hash embedded in reporter metadata. Automatically set during CI/CD bu
Azure Storage Queue name for taxonomy-generation jobs. The scheduler enqueues `{ type: "taxonomy", requestId, runId }` messages here after the `pp-atif` dependency completes, and the taxonomy worker polls this queue.
### TAXONOMY_MODEL
-**Default:** `gpt-4.1`
+**Default:** `gpt-5.4`
**Type:** string
The LLM model used by the taxonomy worker (via the Copilot SDK) to generate structured taxonomy JSON from run metadata and ATIF trajectories.
+> **Model choice matters for taxonomy quality.** A/B testing across nine models on a multi-iteration run with a real defect (agent lost context in iteration 2) showed the verdict ranged from 72 to 100 depending on the model. `gpt-4.1` (the previous default) missed action items and, on harder runs, produced the thinnest output; weaker models rubber-stamped a buggy run with a perfect score. `gpt-5.4` was the best value: it correctly caught the critical defect while using the fewest tokens and lowest cost of the models tested. Stronger alternatives (e.g. `claude-opus-4-7`) yield richer evidence at higher token cost; avoid `gpt-5.3-codex` as a default (≈1M tokens / ~7 min per run).
+
### SCOPE_MT_API_URL
**Default:** `http://localhost:3001` (local), `http://api:80` (Docker)
**Type:** URL string
diff --git a/apps/workers/taxonomy/package.json b/apps/workers/taxonomy/package.json
index aacbfc4f1..52cdd6b2f 100644
--- a/apps/workers/taxonomy/package.json
+++ b/apps/workers/taxonomy/package.json
@@ -7,6 +7,7 @@
"build": "tsc",
"dev": "tsx watch src/index.ts",
"start": "node dist/index.js",
+ "taxonomy": "tsx src/cli.ts",
"lint": "eslint src/"
},
"dependencies": {
diff --git a/apps/workers/taxonomy/src/cli.ts b/apps/workers/taxonomy/src/cli.ts
new file mode 100644
index 000000000..a5f51f600
--- /dev/null
+++ b/apps/workers/taxonomy/src/cli.ts
@@ -0,0 +1,206 @@
+#!/usr/bin/env npx tsx
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Taxonomy post-processor developer CLI.
+ *
+ * Invokes the taxonomy generation loop directly against an existing requestId,
+ * streams the Copilot SDK session events live, and saves the validated taxonomy
+ * to a local JSON file. This is a developer/troubleshooting tool only — it never
+ * writes to Mongo (handlerStatus) or blob storage (taxonomy.json) and does not
+ * notify the scheduler.
+ *
+ * Usage:
+ * npx tsx src/cli.ts [options]
+ * pnpm taxonomy [options]
+ *
+ * Options:
+ * --run, -r Run id for the prompt/logging (default: active run from API).
+ * --model Override TAXONOMY_MODEL (e.g. a reasoning model).
+ * --timeout Override SESSION_TIMEOUT_MS (per-attempt session timeout).
+ * --output, -o Output file path (default: taxonomy-.json).
+ * --stdout Also print the taxonomy JSON to stdout.
+ * --quiet Suppress live session-event streaming on stderr.
+ * --help, -h Show this help.
+ */
+import "dotenv/config";
+import { writeFile } from "node:fs/promises";
+import { resolve } from "node:path";
+import { SessionEvent } from "@github/copilot-sdk";
+import { TokenManagerClient, type LogEvent, type RequestDocument } from "shared";
+import { generateTaxonomy } from "./taxonomy-generator.js";
+
+interface CliArgs {
+ requestId: string;
+ runId?: string;
+ model?: string;
+ timeoutMs?: number;
+ output?: string;
+ stdout: boolean;
+ quiet: boolean;
+}
+
+function printHelp(): void {
+ process.stderr.write(
+ [
+ "Taxonomy post-processor developer CLI",
+ "",
+ "Usage: npx tsx src/cli.ts [options]",
+ "",
+ "Options:",
+ " --run, -r Run id for the prompt/logging (default: active run from API)",
+ " --model Override TAXONOMY_MODEL",
+ " --timeout Override SESSION_TIMEOUT_MS (per-attempt session timeout)",
+ " --output, -o Output file path (default: taxonomy-.json)",
+ " --stdout Also print the taxonomy JSON to stdout",
+ " --quiet Suppress live session-event streaming on stderr",
+ " --help, -h Show this help",
+ "",
+ ].join("\n"),
+ );
+}
+
+function parseArgs(argv: string[]): CliArgs | undefined {
+ const args: Partial & { stdout: boolean; quiet: boolean } = { stdout: false, quiet: false };
+ const positionals: string[] = [];
+
+ for (let i = 0; i < argv.length; i += 1) {
+ const arg = argv[i];
+ switch (arg) {
+ case "--help":
+ case "-h":
+ printHelp();
+ return undefined;
+ case "--run":
+ case "-r":
+ args.runId = argv[++i];
+ break;
+ case "--model":
+ args.model = argv[++i];
+ break;
+ case "--timeout":
+ args.timeoutMs = Number(argv[++i]);
+ break;
+ case "--output":
+ case "-o":
+ args.output = argv[++i];
+ break;
+ case "--stdout":
+ args.stdout = true;
+ break;
+ case "--quiet":
+ args.quiet = true;
+ break;
+ default:
+ if (arg.startsWith("-")) {
+ throw new Error(`Unknown option: ${arg}`);
+ }
+ positionals.push(arg);
+ }
+ }
+
+ const requestId = positionals[0];
+ if (!requestId) {
+ throw new Error("Missing required argument");
+ }
+ if (args.timeoutMs !== undefined && Number.isNaN(args.timeoutMs)) {
+ throw new Error("--timeout must be a number (milliseconds)");
+ }
+
+ return { ...args, requestId };
+}
+
+async function resolveRunId(apiBaseUrl: string, requestId: string, explicit?: string): Promise {
+ if (explicit) return explicit;
+ try {
+ const response = await fetch(`${apiBaseUrl}/api/v1/requests/${requestId}`);
+ if (response.ok) {
+ const request: RequestDocument = await response.json();
+ if (request.run?._id) return request.run._id;
+ }
+ } catch {
+ // fall through to requestId fallback
+ }
+ return requestId;
+}
+
+function summarizeEvent(event: SessionEvent): string | undefined {
+ switch (event.type) {
+ case "session.start":
+ return `session.start model=${event.data.selectedModel}`;
+ case "session.error":
+ return `session.error ${event.data.errorType}: ${event.data.message}`;
+ case "tool.execution_start":
+ return `tool.start ${event.data.toolName} ${JSON.stringify(event.data.arguments ?? {})}`;
+ case "tool.execution_complete":
+ return `tool.done ${event.data.success ? "ok" : "FAILED"}${event.data.error ? ` ${event.data.error.message}` : ""}`;
+ case "assistant.message":
+ return `assistant.message (${event.data.content.length} chars)`;
+ default:
+ return undefined;
+ }
+}
+
+async function main(): Promise {
+ let parsed: CliArgs | undefined;
+ try {
+ parsed = parseArgs(process.argv.slice(2));
+ } catch (error) {
+ process.stderr.write(`Error: ${error instanceof Error ? error.message : String(error)}\n\n`);
+ printHelp();
+ process.exit(2);
+ }
+ if (!parsed) return; // help shown
+
+ const apiBaseUrl = process.env.SCOPE_MT_API_URL || "http://localhost:3001";
+ const taxonomyModel = parsed.model || process.env.TAXONOMY_MODEL || "gpt-5.4";
+ const sessionTimeoutMs = parsed.timeoutMs ?? (Number(process.env.SESSION_TIMEOUT_MS) || 5 * 60 * 1000);
+ const outputPath = resolve(parsed.output ?? `taxonomy-${parsed.requestId}.json`);
+
+ const githubToken = process.env.GITHUB_TOKEN
+ ? process.env.GITHUB_TOKEN
+ : await new TokenManagerClient(process.env.TOKEN_MANAGER_URL).acquireToken("copilot-sdk");
+
+ const runId = await resolveRunId(apiBaseUrl, parsed.requestId, parsed.runId);
+
+ const log = (level: LogEvent["level"], msg: string, data?: Record): void => {
+ if (parsed.quiet) return;
+ const suffix = data && Object.keys(data).length > 0 ? ` ${JSON.stringify(data)}` : "";
+ process.stderr.write(`[${level}] ${msg}${suffix}\n`);
+ };
+
+ process.stderr.write(
+ `Generating taxonomy: requestId=${parsed.requestId} runId=${runId} model=${taxonomyModel} timeout=${sessionTimeoutMs}ms\n`,
+ );
+
+ const onEvent = parsed.quiet
+ ? undefined
+ : (event: SessionEvent): void => {
+ const summary = summarizeEvent(event);
+ if (summary) process.stderr.write(` · ${summary}\n`);
+ };
+
+ const taxonomy = await generateTaxonomy({
+ requestId: parsed.requestId,
+ runId,
+ apiBaseUrl,
+ taxonomyModel,
+ githubToken,
+ sessionTimeoutMs,
+ log,
+ onEvent,
+ });
+
+ const json = JSON.stringify(taxonomy, null, 2);
+ await writeFile(outputPath, `${json}\n`, "utf-8");
+ process.stderr.write(`\nTaxonomy written to ${outputPath}\n`);
+ if (parsed.stdout) {
+ process.stdout.write(`${json}\n`);
+ }
+}
+
+main().catch((error) => {
+ process.stderr.write(`\nTaxonomy generation failed: ${error instanceof Error ? error.message : String(error)}\n`);
+ process.exit(1);
+});
diff --git a/apps/workers/taxonomy/src/index.ts b/apps/workers/taxonomy/src/index.ts
index 2ee1a8118..b1a4f322b 100644
--- a/apps/workers/taxonomy/src/index.ts
+++ b/apps/workers/taxonomy/src/index.ts
@@ -16,7 +16,7 @@ const config: TaxonomyQueueProcessorConfig = {
redisHost: process.env.REDIS_HOST || "localhost",
redisPort: Number(process.env.REDIS_PORT) || 6379,
redisPassword: process.env.REDIS_PASSWORD || "",
- taxonomyModel: process.env.TAXONOMY_MODEL || "gpt-4.1",
+ taxonomyModel: process.env.TAXONOMY_MODEL || "gpt-5.4",
apiBaseUrl: process.env.SCOPE_MT_API_URL || "http://localhost:3001",
sessionTimeoutMs: Number(process.env.SESSION_TIMEOUT_MS) || 5 * 60 * 1000,
schedulerUrl: process.env.SCHEDULER_URL,
diff --git a/apps/workers/taxonomy/src/taxonomy-generator.ts b/apps/workers/taxonomy/src/taxonomy-generator.ts
new file mode 100644
index 000000000..0df69d2c5
--- /dev/null
+++ b/apps/workers/taxonomy/src/taxonomy-generator.ts
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { CopilotClient, SessionEvent } from "@github/copilot-sdk";
+import {
+ type LogEvent,
+ taxonomySchema,
+ type TaxonomyDocument,
+} from "shared";
+import { TAXONOMY_SYSTEM_PROMPT } from "./prompt.js";
+import { createTaxonomyTools } from "./tools.js";
+
+export const DEFAULT_SESSION_TIMEOUT_MS = 5 * 60 * 1000;
+const DELTA_LOG_INTERVAL = 2_000;
+
+type TaxonomyLogFn = (
+ level: LogEvent["level"],
+ msg: string,
+ data?: Record,
+) => Promise | void;
+
+export interface GenerateTaxonomyParams {
+ requestId: string;
+ runId: string;
+ apiBaseUrl: string;
+ taxonomyModel: string;
+ githubToken: string;
+ sessionTimeoutMs?: number;
+ log: TaxonomyLogFn;
+ /** Optional raw session-event hook (used by the dev CLI to render live progress). */
+ onEvent?: (event: SessionEvent) => void;
+}
+
+/**
+ * Runs the Copilot SDK taxonomy generation loop and returns a schema-validated
+ * taxonomy document. This is side-effect-free with respect to Mongo and blob
+ * storage (it only reads run data and ATIF trajectories through the API);
+ * persistence is the caller's responsibility.
+ */
+export async function generateTaxonomy(params: GenerateTaxonomyParams): Promise {
+ const { requestId, runId, apiBaseUrl, taxonomyModel, githubToken, log, onEvent } = params;
+ const client = new CopilotClient({ githubToken });
+ const tools = createTaxonomyTools(apiBaseUrl, requestId);
+ const timeoutMs = params.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS;
+
+ let streamedResponse = "";
+ let latestMessage = "";
+ let lastLoggedCharCount = 0;
+ const toolNames = new Map();
+
+ try {
+ const session = await client.createSession({
+ model: taxonomyModel,
+ streaming: true,
+ tools,
+ systemMessage: { mode: "replace", content: TAXONOMY_SYSTEM_PROMPT },
+ });
+
+ session.on((event: SessionEvent) => {
+ onEvent?.(event);
+ switch (event.type) {
+ case "session.start":
+ void log("info", "Copilot session started", {
+ sessionId: event.data.sessionId,
+ model: event.data.selectedModel,
+ });
+ break;
+ case "session.error":
+ void log("error", `Session error: ${event.data.message}`, { errorType: event.data.errorType });
+ break;
+ case "tool.execution_start":
+ toolNames.set(event.data.toolCallId, event.data.toolName);
+ void log("info", `Tool call: ${event.data.toolName}`, {
+ toolCallId: event.data.toolCallId,
+ arguments: event.data.arguments as Record | undefined,
+ });
+ break;
+ case "tool.execution_complete": {
+ const toolName = toolNames.get(event.data.toolCallId) ?? "unknown";
+ toolNames.delete(event.data.toolCallId);
+ void log("info", `Tool result: ${toolName} (${event.data.success ? "success" : "failed"})`, {
+ toolCallId: event.data.toolCallId,
+ error: event.data.error?.message,
+ });
+ break;
+ }
+ case "assistant.message_delta":
+ streamedResponse += event.data.deltaContent;
+ if (streamedResponse.length - lastLoggedCharCount >= DELTA_LOG_INTERVAL) {
+ lastLoggedCharCount = streamedResponse.length;
+ void log("info", `Generating taxonomy… (${streamedResponse.length} chars so far)`);
+ }
+ break;
+ case "assistant.message":
+ latestMessage = event.data.content;
+ break;
+ }
+ });
+
+ let attempts = 0;
+ const maxAttempts = 3;
+ let prompt = [
+ `Generate taxonomy JSON for request ${requestId} and run ${runId}.`,
+ "Use get_run_data first, then inspect ATIF trajectories that materially affect the classification.",
+ "Return only raw JSON that satisfies the taxonomy schema.",
+ ].join(" ");
+ let lastJson: string | undefined;
+
+ while (attempts < maxAttempts) {
+ attempts += 1;
+ streamedResponse = "";
+ latestMessage = "";
+ lastLoggedCharCount = 0;
+
+ await log("info", `Sending taxonomy prompt to Copilot SDK (attempt ${attempts}/${maxAttempts})`, {
+ requestId,
+ runId,
+ timeoutMs,
+ });
+
+ const response = await session.sendAndWait({ prompt }, timeoutMs);
+ const responseText = response?.data.content?.trim() || latestMessage.trim() || streamedResponse.trim();
+
+ if (!responseText) {
+ throw new Error("Copilot SDK returned an empty taxonomy response");
+ }
+
+ const jsonText = extractJson(responseText);
+ lastJson = jsonText;
+
+ let parsedJson: unknown;
+ try {
+ parsedJson = JSON.parse(jsonText) as unknown;
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ if (attempts >= maxAttempts) {
+ throw new Error(`Taxonomy response was not valid JSON after ${maxAttempts} attempts: ${errorMessage}`);
+ }
+
+ prompt = [
+ "Your previous response was not valid JSON.",
+ `JSON parse error: ${errorMessage}.`,
+ "Return the full taxonomy document again as raw JSON only, with no markdown fences or commentary.",
+ "Replace the entire response with corrected JSON.",
+ ].join(" ");
+ continue;
+ }
+
+ const validation = taxonomySchema.safeParse(parsedJson);
+ if (validation.success) {
+ return validation.data;
+ }
+
+ const validationErrors = formatValidationErrors(validation.error.issues);
+ await log("warn", `Taxonomy validation failed on attempt ${attempts}`, {
+ issues: validationErrors,
+ });
+
+ if (attempts >= maxAttempts) {
+ throw new Error(
+ `Taxonomy schema validation failed after ${maxAttempts} attempts: ${validationErrors.join(" | ")}`,
+ );
+ }
+
+ prompt = [
+ "Your previous taxonomy JSON did not satisfy the schema.",
+ "Correct the document and return the entire replacement JSON object.",
+ "Do not include markdown fences or commentary.",
+ `Validation errors: ${validationErrors.join("; ")}`,
+ lastJson ? `Previous JSON: ${lastJson}` : "",
+ ].filter(Boolean).join(" ");
+ }
+
+ throw new Error("Taxonomy generation ended without a valid document");
+ } finally {
+ await client.stop().catch(() => undefined);
+ }
+}
+
+function extractJson(responseText: string): string {
+ const trimmed = responseText.trim();
+ if (!trimmed.startsWith("```")) {
+ return trimmed;
+ }
+
+ const fenceMatch = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
+ return fenceMatch?.[1]?.trim() ?? trimmed;
+}
+
+function formatValidationErrors(issues: Array<{ path: PropertyKey[]; message: string }>): string[] {
+ return issues.map((issue) => {
+ const path = issue.path.length > 0 ? issue.path.map((segment) => String(segment)).join(".") : "";
+ return `${path}: ${issue.message}`;
+ });
+}
diff --git a/apps/workers/taxonomy/src/taxonomy-queue-processor.ts b/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
index 29fb3b61a..d3c7495d3 100644
--- a/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
+++ b/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
@@ -2,26 +2,22 @@
// Licensed under the MIT License.
import { DequeuedMessageItem } from "@azure/storage-queue";
-import { CopilotClient, SessionEvent } from "@github/copilot-sdk";
import {
BaseQueueProcessor,
BlobStorage,
type BaseQueueProcessorConfig,
type LogEvent,
type RequestDocument,
- taxonomySchema,
TokenManagerClient,
type TaxonomyDocument,
type VisibilityHeartbeat,
withRetry,
} from "shared";
-import { TAXONOMY_SYSTEM_PROMPT } from "./prompt.js";
-import { createTaxonomyTools } from "./tools.js";
+import { generateTaxonomy } from "./taxonomy-generator.js";
const HANDLER_ID = "pp-taxonomy";
const HANDLER_VERSION = 1;
const DEFAULT_SESSION_TIMEOUT_MS = 5 * 60 * 1000;
-const DELTA_LOG_INTERVAL = 2_000;
interface TaxonomyQueueMessage {
type: "taxonomy";
@@ -156,143 +152,17 @@ export class TaxonomyQueueProcessor extends BaseQueueProcessor
log: (level: LogEvent["level"], msg: string, data?: Record) => Promise,
): Promise {
const githubToken = await this.tokenClient.acquireToken("copilot-sdk");
- const client = new CopilotClient({ githubToken });
- const tools = createTaxonomyTools(this.taxonomyConfig.apiBaseUrl, requestId, this.blobStorage);
- const timeoutMs = this.taxonomyConfig.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS;
-
- let streamedResponse = "";
- let latestMessage = "";
- let lastLoggedCharCount = 0;
- const toolNames = new Map();
-
- try {
- await log("info", "Acquired Copilot SDK token");
-
- const session = await client.createSession({
- model: this.taxonomyConfig.taxonomyModel,
- streaming: true,
- tools,
- systemMessage: { mode: "replace", content: TAXONOMY_SYSTEM_PROMPT },
- });
-
- session.on((event: SessionEvent) => {
- switch (event.type) {
- case "session.start":
- void log("info", "Copilot session started", {
- sessionId: event.data.sessionId,
- model: event.data.selectedModel,
- });
- break;
- case "session.error":
- void log("error", `Session error: ${event.data.message}`, { errorType: event.data.errorType });
- break;
- case "tool.execution_start":
- toolNames.set(event.data.toolCallId, event.data.toolName);
- void log("info", `Tool call: ${event.data.toolName}`, {
- toolCallId: event.data.toolCallId,
- arguments: event.data.arguments as Record | undefined,
- });
- break;
- case "tool.execution_complete": {
- const toolName = toolNames.get(event.data.toolCallId) ?? "unknown";
- toolNames.delete(event.data.toolCallId);
- void log("info", `Tool result: ${toolName} (${event.data.success ? "success" : "failed"})`, {
- toolCallId: event.data.toolCallId,
- error: event.data.error?.message,
- });
- break;
- }
- case "assistant.message_delta":
- streamedResponse += event.data.deltaContent;
- if (streamedResponse.length - lastLoggedCharCount >= DELTA_LOG_INTERVAL) {
- lastLoggedCharCount = streamedResponse.length;
- void log("info", `Generating taxonomy… (${streamedResponse.length} chars so far)`);
- }
- break;
- case "assistant.message":
- latestMessage = event.data.content;
- break;
- }
- });
-
- let attempts = 0;
- const maxAttempts = 3;
- let prompt = [
- `Generate taxonomy JSON for request ${requestId} and run ${runId}.`,
- "Use get_run_data first, then inspect ATIF trajectories that materially affect the classification.",
- "Return only raw JSON that satisfies the taxonomy schema.",
- ].join(" ");
- let lastJson: string | undefined;
-
- while (attempts < maxAttempts) {
- attempts += 1;
- streamedResponse = "";
- latestMessage = "";
- lastLoggedCharCount = 0;
-
- await log("info", `Sending taxonomy prompt to Copilot SDK (attempt ${attempts}/${maxAttempts})`, {
- requestId,
- runId,
- timeoutMs,
- });
-
- const response = await session.sendAndWait({ prompt }, timeoutMs);
- const responseText = response?.data.content?.trim() || latestMessage.trim() || streamedResponse.trim();
-
- if (!responseText) {
- throw new Error("Copilot SDK returned an empty taxonomy response");
- }
-
- const jsonText = extractJson(responseText);
- lastJson = jsonText;
-
- let parsedJson: unknown;
- try {
- parsedJson = JSON.parse(jsonText) as unknown;
- } catch (error) {
- const errorMessage = error instanceof Error ? error.message : String(error);
- if (attempts >= maxAttempts) {
- throw new Error(`Taxonomy response was not valid JSON after ${maxAttempts} attempts: ${errorMessage}`);
- }
-
- prompt = [
- "Your previous response was not valid JSON.",
- `JSON parse error: ${errorMessage}.`,
- "Return the full taxonomy document again as raw JSON only, with no markdown fences or commentary.",
- "Replace the entire response with corrected JSON.",
- ].join(" ");
- continue;
- }
-
- const validation = taxonomySchema.safeParse(parsedJson);
- if (validation.success) {
- return validation.data;
- }
-
- const validationErrors = formatValidationErrors(validation.error.issues);
- await log("warn", `Taxonomy validation failed on attempt ${attempts}`, {
- issues: validationErrors,
- });
-
- if (attempts >= maxAttempts) {
- throw new Error(
- `Taxonomy schema validation failed after ${maxAttempts} attempts: ${validationErrors.join(" | ")}`,
- );
- }
-
- prompt = [
- "Your previous taxonomy JSON did not satisfy the schema.",
- "Correct the document and return the entire replacement JSON object.",
- "Do not include markdown fences or commentary.",
- `Validation errors: ${validationErrors.join("; ")}`,
- lastJson ? `Previous JSON: ${lastJson}` : "",
- ].filter(Boolean).join(" ");
- }
-
- throw new Error("Taxonomy generation ended without a valid document");
- } finally {
- await client.stop().catch(() => undefined);
- }
+ await log("info", "Acquired Copilot SDK token");
+
+ return generateTaxonomy({
+ requestId,
+ runId,
+ apiBaseUrl: this.taxonomyConfig.apiBaseUrl,
+ taxonomyModel: this.taxonomyConfig.taxonomyModel,
+ githubToken,
+ sessionTimeoutMs: this.taxonomyConfig.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS,
+ log,
+ });
}
private async notifyHandlerComplete(
@@ -319,19 +189,3 @@ export class TaxonomyQueueProcessor extends BaseQueueProcessor
}
}
-function extractJson(responseText: string): string {
- const trimmed = responseText.trim();
- if (!trimmed.startsWith("```")) {
- return trimmed;
- }
-
- const fenceMatch = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
- return fenceMatch?.[1]?.trim() ?? trimmed;
-}
-
-function formatValidationErrors(issues: Array<{ path: PropertyKey[]; message: string }>): string[] {
- return issues.map((issue) => {
- const path = issue.path.length > 0 ? issue.path.map((segment) => String(segment)).join(".") : "";
- return `${path}: ${issue.message}`;
- });
-}
diff --git a/apps/workers/taxonomy/src/tools.ts b/apps/workers/taxonomy/src/tools.ts
index 9c92b5b18..ea4eced32 100644
--- a/apps/workers/taxonomy/src/tools.ts
+++ b/apps/workers/taxonomy/src/tools.ts
@@ -2,22 +2,12 @@
// Licensed under the MIT License.
import { defineTool } from "@github/copilot-sdk";
-import { BlobStorage, type ConversationTurn, type RequestDocument } from "shared";
+import { type ConversationTurn, type RequestDocument } from "shared";
interface GetAtifTrajectoryArgs {
iteration?: number;
}
-function resolveSnapshotsBlobName(blobUrl: string): string {
- const url = new URL(blobUrl);
- const containerPrefix = "/snapshots/";
- const containerIndex = url.pathname.indexOf(containerPrefix);
- if (containerIndex === -1) {
- throw new Error(`Blob URL does not contain the snapshots container: ${blobUrl}`);
- }
- return decodeURIComponent(url.pathname.substring(containerIndex + containerPrefix.length));
-}
-
function selectTurnWithAtif(turns: ConversationTurn[] | undefined, requestedIteration?: number): ConversationTurn | undefined {
if (!turns?.length) return undefined;
@@ -33,7 +23,6 @@ function selectTurnWithAtif(turns: ConversationTurn[] | undefined, requestedIter
export function createTaxonomyTools(
apiBaseUrl: string,
requestId: string,
- blobStorage: BlobStorage,
) {
const getRunData = defineTool("get_run_data", {
description:
@@ -138,12 +127,21 @@ export function createTaxonomyTools(
};
}
- const blobName = resolveSnapshotsBlobName(selectedTurn.atifUrl);
- const buffer = await blobStorage.downloadBlobToBuffer(blobName);
- const trajectory: unknown = JSON.parse(buffer.toString("utf-8"));
+ const runId = request.run?._id;
+ const iteration = selectedTurn.iteration;
+ const atifUrl = runId
+ ? `${apiBaseUrl}/api/v1/requests/${requestId}/runs/${runId}/atif?iteration=${iteration}`
+ : `${apiBaseUrl}/api/v1/requests/${requestId}/atif?iteration=${iteration}`;
+
+ const atifResponse = await fetch(atifUrl);
+ if (!atifResponse.ok) {
+ return { error: `Failed to fetch ATIF trajectory: ${atifResponse.status} ${atifResponse.statusText}` };
+ }
+
+ const trajectory: unknown = await atifResponse.json();
return {
- iteration: selectedTurn.iteration,
+ iteration,
trajectory,
};
} catch (err) {
diff --git a/docker-compose.yml b/docker-compose.yml
index 164946b0e..0124b6f71 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -649,7 +649,7 @@ services:
environment:
<<: *common-env
AZURE_STORAGE_QUEUE_TAXONOMY: pp-taxonomy-queue
- TAXONOMY_MODEL: ${TAXONOMY_MODEL:-gpt-4.1}
+ TAXONOMY_MODEL: ${TAXONOMY_MODEL:-gpt-5.4}
SCOPE_MT_API_URL: http://api:80
SCHEDULER_URL: http://scheduler:8080
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index a9fc61d42..dadda0544 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -38,7 +38,7 @@ Two paths trigger post-processing:
## Taxonomy Generation
-The taxonomy handler (`apps/workers/taxonomy/`) consumes messages from the dedicated `pp-taxonomy-queue` and produces a structured JSON artifact for a completed run. It uses the GitHub Copilot SDK with a tool-backed session to fetch run metadata from the API and ATIF trajectories from blob storage, then validates the generated JSON against the shared taxonomy Zod schema.
+The taxonomy handler (`apps/workers/taxonomy/`) consumes messages from the dedicated `pp-taxonomy-queue` and produces a structured JSON artifact for a completed run. It uses the GitHub Copilot SDK with a tool-backed session to fetch run metadata and ATIF trajectories from the API, then validates the generated JSON against the shared taxonomy Zod schema.
### Flow
@@ -46,7 +46,7 @@ The taxonomy handler (`apps/workers/taxonomy/`) consumes messages from the dedic
2. Worker fetches the request document from MongoDB and marks `run.handlerStatus["pp-taxonomy"].status = "processing"`
3. Copilot SDK session calls:
- `get_run_data` to fetch the request + active run from the API
- - `get_atif_trajectory` to fetch per-iteration ATIF JSON from blob storage
+ - `get_atif_trajectory` to fetch per-iteration ATIF JSON from the API (`GET /api/v1/requests/:id/runs/:runId/atif?iteration=N`)
4. The worker validates the assistant response with `taxonomySchema.safeParse()`
5. If validation fails, the worker feeds the schema errors back into the same session and retries up to 3 total attempts
6. On success, the worker uploads `taxonomy.json` to `{requestId}/runs/{runId}/taxonomy.json`
@@ -77,6 +77,37 @@ The completed run stores the taxonomy blob URL on `run.taxonomyUrl`.
The `iteration` query parameter is mandatory only for the ATIF endpoints. ATIF files are also included in archive exports as `iteration-{N}.atif.trajectory.json`.
+### Local troubleshooting: taxonomy CLI
+
+The Copilot SDK generation loop lives in `apps/workers/taxonomy/src/taxonomy-generator.ts` (`generateTaxonomy()`), shared by both the queue processor and a standalone developer CLI (`src/cli.ts`). The CLI invokes generation directly against an existing `requestId`, streams the session events live, and saves the validated taxonomy to a local file — **it never writes to MongoDB, blob storage, or the scheduler** (read-only). It is a developer tool and is intentionally not part of the Scope CLI.
+
+Because both taxonomy tools (`get_run_data` and `get_atif_trajectory`) read through the API, the CLI needs only an API URL and a Copilot token — no storage connection string. This lets it run against any environment (local or a remote deployment such as integration) given a reachable API.
+
+```bash
+# Local stack (use your worktree's host-mapped API port):
+SCOPE_MT_API_URL=http://localhost:3001 \
+GITHUB_TOKEN=$(gh auth token) \
+pnpm taxonomy [--run ] [--model ] [--timeout ] [-o out.json] [--stdout] [--quiet]
+
+# Integration (read-only against the deployed API):
+SCOPE_MT_API_URL=https://msscope-int.azurewebsites.net \
+GITHUB_TOKEN=$(gh auth token) \
+pnpm taxonomy -o taxonomy-int.json
+```
+
+The root `pnpm taxonomy` script proxies to `pnpm --filter taxonomy-handler taxonomy` (i.e. `tsx src/cli.ts`).
+
+| Option | Description |
+| --- | --- |
+| `--run, -r ` | Run id used in the prompt/logging (default: active run resolved from the API) |
+| `--model ` | Override `TAXONOMY_MODEL` (e.g. A/B a reasoning model vs the `gpt-5.4` default) |
+| `--timeout ` | Override `SESSION_TIMEOUT_MS` (per-attempt session timeout) |
+| `--output, -o ` | Output file path (default: `taxonomy-.json` in the cwd) |
+| `--stdout` | Also print the taxonomy JSON to stdout |
+| `--quiet` | Suppress live session-event streaming on stderr |
+
+Live progress (tool calls, errors, deltas) is written to stderr so the saved JSON file stays clean. The CLI exits non-zero on failure (empty response, JSON/schema validation failure after 3 attempts, timeout, or model rate limit) and surfaces the underlying error message — making it well suited to diagnosing the oversized-`get_atif_trajectory` paging loop and Copilot model rate limits.
+
## Handler Interface
The post-processor uses a registry pattern for extensibility:
@@ -237,7 +268,7 @@ stateDiagram-v2
| `BATCH_SIZE` | `1` | Messages to process per poll (worker-side) |
| `POLL_INTERVAL_MS` | `5000` | Worker queue polling interval |
| `SCOPE_MT_API_URL` / `API_BASE_URL` | `http://localhost:3001` | API URL used by report/taxonomy Copilot tools |
-| `TAXONOMY_MODEL` | `gpt-4.1` | Copilot SDK model used by the taxonomy handler |
+| `TAXONOMY_MODEL` | `gpt-5.4` | Copilot SDK model used by the taxonomy handler |
| `SESSION_TIMEOUT_MS` | `300000` | Timeout for report/taxonomy Copilot SDK sessions |
| `SCHEDULER_URL` | _(unset)_ | Scheduler base URL — used by handlers to notify completion and by the register-handler script to reach `/handlers/register` |
| `API_URL` | `http://api:80` | API base URL the **scheduler** uses to call `POST /api/v1/reports/trigger` when a run's handler DAG drains |
diff --git a/package.json b/package.json
index 62ce2760d..2905d5efc 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,7 @@
"dev:coder-acp-claude-code": "pnpm --filter coder-acp-claude-code dev",
"dev:coder-acp-copilot": "pnpm --filter coder-acp-copilot dev",
"dev:report-generator": "pnpm --filter report-generator dev",
+ "taxonomy": "pnpm --filter taxonomy-handler taxonomy",
"docker:up": "scripts/worktree-env.sh && scripts/dev-compose.sh up --build",
"docker:up:claude-code": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-claude-code/versions.env --profile claude-code --profile report up --build",
"docker:up:copilot": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --profile copilot --profile report up --build",
From 07127ae483af9d6c1d48d6f34f69cef4d02fcb33 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 24 Jun 2026 14:34:24 -0700
Subject: [PATCH 024/287] chore: remove taxonomy changes (split to #1053)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
AGENTS.md | 2 -
ENV_VARIABLES.md | 28 --
.../openapi-snapshot.test.ts.snap | 63 -----
apps/api/src/archive-har.test.ts | 41 ---
apps/api/src/archive-har.ts | 29 +-
apps/api/src/index.ts | 2 -
apps/api/src/routes/requests/taxonomy.test.ts | 107 --------
apps/api/src/routes/requests/taxonomy.ts | 30 ---
apps/portal/src/components/TaxonomyTab.tsx | 248 ------------------
apps/portal/src/lib/api.ts | 10 -
apps/portal/src/pages/RunDetail.tsx | 10 -
apps/portal/src/types.ts | 1 -
apps/scheduler/src/handler-dispatcher.test.ts | 22 +-
apps/scheduler/src/notify-routes.test.ts | 8 +-
apps/workers/taxonomy/Dockerfile | 50 ----
apps/workers/taxonomy/handler.yaml | 11 -
apps/workers/taxonomy/package.json | 24 --
apps/workers/taxonomy/src/cli.ts | 206 ---------------
apps/workers/taxonomy/src/index.ts | 30 ---
apps/workers/taxonomy/src/prompt.ts | 88 -------
.../taxonomy/src/taxonomy-generator.ts | 195 --------------
.../taxonomy/src/taxonomy-queue-processor.ts | 191 --------------
apps/workers/taxonomy/src/tools.ts | 154 -----------
apps/workers/taxonomy/tsconfig.json | 8 -
docker-compose.dev.yml | 20 --
docker-compose.yml | 46 ----
docs/architecture/db-migrations.md | 2 +-
docs/architecture/overview.md | 1 -
docs/architecture/post-processing.md | 89 ++-----
package.json | 5 +-
.../018-migrate-services-to-handler-dag.ts | 2 +-
.../019-add-handler-status-index.ts | 8 -
packages/shared/src/index.ts | 1 -
packages/shared/src/schemas/index.ts | 1 -
packages/shared/src/schemas/request.ts | 1 -
packages/shared/src/schemas/taxonomy.test.ts | 180 -------------
packages/shared/src/schemas/taxonomy.ts | 104 --------
.../src/scripts/register-handler.test.ts | 6 +-
packages/shared/src/types/types.ts | 4 +-
pnpm-lock.yaml | 25 --
40 files changed, 41 insertions(+), 2012 deletions(-)
delete mode 100644 apps/api/src/routes/requests/taxonomy.test.ts
delete mode 100644 apps/api/src/routes/requests/taxonomy.ts
delete mode 100644 apps/portal/src/components/TaxonomyTab.tsx
delete mode 100644 apps/workers/taxonomy/Dockerfile
delete mode 100644 apps/workers/taxonomy/handler.yaml
delete mode 100644 apps/workers/taxonomy/package.json
delete mode 100644 apps/workers/taxonomy/src/cli.ts
delete mode 100644 apps/workers/taxonomy/src/index.ts
delete mode 100644 apps/workers/taxonomy/src/prompt.ts
delete mode 100644 apps/workers/taxonomy/src/taxonomy-generator.ts
delete mode 100644 apps/workers/taxonomy/src/taxonomy-queue-processor.ts
delete mode 100644 apps/workers/taxonomy/src/tools.ts
delete mode 100644 apps/workers/taxonomy/tsconfig.json
delete mode 100644 packages/shared/src/schemas/taxonomy.test.ts
delete mode 100644 packages/shared/src/schemas/taxonomy.ts
diff --git a/AGENTS.md b/AGENTS.md
index 419fb8e6a..de77cbeba 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -19,7 +19,6 @@ apps/
coder-acp-copilot/ # GitHub Copilot worker (ACP SDK)
coder-acp-claude-code/ # Claude Code worker (ACP SDK)
report-generator/ # Post-run report generation
- taxonomy/ # Post-run taxonomy generation
model-scanners/ # Feature detection for Copilot and Anthropic models
version-checkers/ # Poll for new agent/tool releases
key-updaters/ # GitHub auth cookie management for VS Code Web
@@ -54,7 +53,6 @@ Each worker implements the same queue-processor interface but adapts a different
| `coder-acp-copilot` | GitHub Copilot | ACP SDK v0.14.1 |
| `coder-acp-claude-code` | Claude Code | ACP SDK v0.13.1 |
| `report-generator` | — | Copilot SDK |
-| `taxonomy` | — | Copilot SDK |
Workers consume tasks from Azure Storage Queues (named `queue-`) and write results to MongoDB and Blob Storage. Each has its own Dockerfile and docker-compose profile.
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index cd43d79bc..e56ea082e 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -277,34 +277,6 @@ Timeout for the Copilot SDK session used by the report-generator worker. If the
Git commit hash embedded in reporter metadata. Automatically set during CI/CD builds. Used to track which version of the report-generator produced a given report.
-## Taxonomy Handler Configuration
-
-### AZURE_STORAGE_QUEUE_TAXONOMY
-**Default:** `pp-taxonomy-queue`
-**Type:** string
-
-Azure Storage Queue name for taxonomy-generation jobs. The scheduler enqueues `{ type: "taxonomy", requestId, runId }` messages here after the `pp-atif` dependency completes, and the taxonomy worker polls this queue.
-
-### TAXONOMY_MODEL
-**Default:** `gpt-5.4`
-**Type:** string
-
-The LLM model used by the taxonomy worker (via the Copilot SDK) to generate structured taxonomy JSON from run metadata and ATIF trajectories.
-
-> **Model choice matters for taxonomy quality.** A/B testing across nine models on a multi-iteration run with a real defect (agent lost context in iteration 2) showed the verdict ranged from 72 to 100 depending on the model. `gpt-4.1` (the previous default) missed action items and, on harder runs, produced the thinnest output; weaker models rubber-stamped a buggy run with a perfect score. `gpt-5.4` was the best value: it correctly caught the critical defect while using the fewest tokens and lowest cost of the models tested. Stronger alternatives (e.g. `claude-opus-4-7`) yield richer evidence at higher token cost; avoid `gpt-5.3-codex` as a default (≈1M tokens / ~7 min per run).
-
-### SCOPE_MT_API_URL
-**Default:** `http://localhost:3001` (local), `http://api:80` (Docker)
-**Type:** URL string
-
-Base URL of the Scope API. The taxonomy worker calls this to fetch the request document and active run state through its Copilot tools.
-
-### SESSION_TIMEOUT_MS
-**Default:** `300000` (5 minutes)
-**Type:** integer (milliseconds)
-
-Timeout for the Copilot SDK session used by the taxonomy worker. If the model does not finish generating a valid taxonomy JSON document within this window, the worker marks `run.handlerStatus.pp-taxonomy` as failed.
-
## Scheduler Configuration
### SCHEDULER_POLL_INTERVAL_MS
diff --git a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
index 16ee7fc6d..7912955e3 100644
--- a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
+++ b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
@@ -2313,9 +2313,6 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
],
"type": "string",
},
- "taxonomyUrl": {
- "type": "string",
- },
"tokenUsage": {
"$ref": "#/components/schemas/TokenUsage",
},
@@ -7984,40 +7981,6 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
],
},
},
- "/api/v1/requests/{id}/runs/{runId}/taxonomy": {
- "get": {
- "parameters": [
- {
- "in": "path",
- "name": "id",
- "required": true,
- "schema": {
- "type": "string",
- },
- },
- {
- "in": "path",
- "name": "runId",
- "required": true,
- "schema": {
- "type": "string",
- },
- },
- ],
- "responses": {
- "200": {
- "description": "Taxonomy v1 JSON document (scorecard, behavior analysis, action list)",
- },
- "404": {
- "description": "Not found — taxonomy not yet generated",
- },
- },
- "summary": "Download taxonomy JSON for a specific attempt",
- "tags": [
- "Requests",
- ],
- },
- },
"/api/v1/requests/{id}/runs/{runId}/tool-calls": {
"get": {
"parameters": [
@@ -8120,32 +8083,6 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
],
},
},
- "/api/v1/requests/{id}/taxonomy": {
- "get": {
- "parameters": [
- {
- "in": "path",
- "name": "id",
- "required": true,
- "schema": {
- "type": "string",
- },
- },
- ],
- "responses": {
- "200": {
- "description": "Taxonomy v1 JSON document (scorecard, behavior analysis, action list)",
- },
- "404": {
- "description": "Not found — taxonomy not yet generated",
- },
- },
- "summary": "Download taxonomy JSON for the run",
- "tags": [
- "Requests",
- ],
- },
- },
"/api/v1/requests/{id}/tool-calls": {
"get": {
"parameters": [
diff --git a/apps/api/src/archive-har.test.ts b/apps/api/src/archive-har.test.ts
index 51d5e36f2..f83d846ac 100644
--- a/apps/api/src/archive-har.test.ts
+++ b/apps/api/src/archive-har.test.ts
@@ -99,17 +99,6 @@ describe("rewriteHarUrlsForArchive", () => {
expect(result.run!.turns![1].toolCallsUrl).toBe("iteration-2.tool-calls.jsonl");
expect(result.run!.turns![2].toolCallsUrl).toBeUndefined();
});
-
- it("rewrites run.taxonomyUrl to taxonomy.json", () => {
- const resource = {
- run: {
- taxonomyUrl: "https://storage.blob.core.windows.net/snapshots/abc123/runs/attempt-1/taxonomy.json",
- turns: [],
- },
- };
- const result = rewriteHarUrlsForArchive(resource);
- expect(result.run!.taxonomyUrl).toBe("taxonomy.json");
- });
});
// --- blobNameFromSnapshotsUrl ---
@@ -855,34 +844,4 @@ describe("packRunIntoTar", () => {
expect(yaml).toContain("iteration-1.chat-result.json");
expect(yaml).not.toContain("blob.core.windows.net");
});
-
- it("bundles run-level taxonomy.json and rewrites taxonomyUrl", async () => {
- const { pack } = await import("tar-stream");
- const p = pack();
- const taxonomyData = Buffer.from('{"topics":["agent"]}');
- const container = makeMockBlobContainer({
- "run-010/runs/attempt-1/taxonomy.json": { body: taxonomyData, length: taxonomyData.length },
- });
-
- const run: ArchivableRun = {
- _id: "run-010",
- run: {
- taxonomyUrl: "https://storage.blob.core.windows.net/snapshots/run-010/runs/attempt-1/taxonomy.json",
- turns: [],
- },
- };
-
- const entriesPromise = collectPackEntries(p);
- await packRunIntoTar(p, run, container, "run-010", () => true);
- p.finalize();
-
- const entries = await entriesPromise;
- const names = entries.map(e => e.name);
- expect(names).toContain("run-010/taxonomy.json");
- expect(entries.find(e => e.name === "run-010/taxonomy.json")!.data).toEqual(taxonomyData);
-
- const yaml = entries.find(e => e.name === "run-010/run.yaml")!.data.toString();
- expect(yaml).toContain("taxonomy.json");
- expect(yaml).not.toContain("blob.core.windows.net");
- });
});
diff --git a/apps/api/src/archive-har.ts b/apps/api/src/archive-har.ts
index 86cfeb1ee..21f922179 100644
--- a/apps/api/src/archive-har.ts
+++ b/apps/api/src/archive-har.ts
@@ -41,12 +41,11 @@ export function blobNameFromLogsUrl(url: string): string | null {
/**
* Deep-clone a run resource and rewrite `harUrl`, `rawChatUrl`,
- * `taxonomyUrl`, `chatResultUrl`, and `toolCallsUrl` fields to relative archive paths.
+ * `chatResultUrl`, and `toolCallsUrl` fields to relative archive paths.
*
* - `run.harUrl` → `"run.har"`
* - Per-turn `harUrl` → `"iteration-{N}.har"`
* - `run.rawChatUrl` → `"run.chat-export.json"`
- * - `run.taxonomyUrl` → `"taxonomy.json"`
* - Per-turn `rawChatUrl` → `"iteration-{N}.chat-export.json"`
* - Per-turn `chatResultUrl` → `"iteration-{N}.chat-result.json"`
* - Per-turn `toolCallsUrl` → `"iteration-{N}.tool-calls.jsonl"`
@@ -55,7 +54,6 @@ export function rewriteHarUrlsForArchive;
[key: string]: unknown;
};
@@ -68,9 +66,6 @@ export function rewriteHarUrlsForArchive ({
- checkMigrations: vi.fn().mockResolvedValue({ ready: true, applied: ["001", "002"], pending: [] }),
-}));
-
-vi.hoisted(() => {
- process.env.STORAGE_CONNECTION_STRING = "DefaultEndpointsProtocol=https;AccountName=mockaccount;AccountKey=bW9jaw==;EndpointSuffix=core.windows.net";
-});
-
-vi.mock("../../llm.js", () => ({ isLlmAvailable: vi.fn().mockReturnValue(false) }));
-vi.mock("../../prompt-feature-llm.js", () => ({ isLlmAvailable: vi.fn().mockReturnValue(false) }));
-vi.mock("../../task-prompt-llm.js", () => ({ isTaskPromptLlmAvailable: vi.fn().mockReturnValue(false) }));
-
-const { mockDownload, mockGetProperties, mockGetBlockBlobClient, mockGetBlobClient, mockGetContainerClient } = vi.hoisted(() => {
- const mockDownload = vi.fn();
- const mockGetProperties = vi.fn();
- const mockGetBlockBlobClient = vi.fn().mockReturnValue({ download: mockDownload, getProperties: mockGetProperties });
- const mockGetBlobClient = vi.fn().mockReturnValue({ download: mockDownload, getProperties: mockGetProperties });
- const mockGetContainerClient = vi.fn().mockReturnValue({ getBlockBlobClient: mockGetBlockBlobClient, getBlobClient: mockGetBlobClient });
- return { mockDownload, mockGetProperties, mockGetBlockBlobClient, mockGetBlobClient, mockGetContainerClient };
-});
-
-vi.mock("@azure/storage-blob", async (importOriginal) => {
- const original = await importOriginal();
- return {
- ...original,
- BlobServiceClient: { fromConnectionString: vi.fn().mockReturnValue({ getContainerClient: mockGetContainerClient }) },
- };
-});
-
-describe("taxonomy endpoints", () => {
- let mocks: ReturnType;
-
- beforeAll(() => {
- mocks = createAllMockDependencies();
- _injectTestDependencies(mocks);
- });
-
- beforeEach(() => {
- vi.clearAllMocks();
- mocks = createAllMockDependencies();
- _injectTestDependencies(mocks);
- rewireBlobMocks({ mockDownload, mockGetProperties, mockGetBlockBlobClient, mockGetBlobClient, mockGetContainerClient });
- mockDownload.mockResolvedValue({ readableStreamBody: readableFrom('{"status":"ok"}'), contentLength: 15 });
- mockGetProperties.mockResolvedValue({ contentLength: 15 });
- });
-
- describe.each(VARIANTS)("$label", (variant) => {
- const taxonomyUrl = (id: string) => variant.url(id) + "taxonomy";
-
- it("returns 404 when request not found", async () => {
- (mocks.collection.findOne as ReturnType).mockResolvedValue(null);
- const res = await supertest(app).get(taxonomyUrl("missing"));
- expect(res.status).toBe(404);
- expect(res.body).toMatchObject({ error: "Request not found" });
- });
-
- it("returns 404 when taxonomyUrl is not set", async () => {
- variant.mockRequest(mocks, "req-1", { _id: "run-1", attemptNumber: 1, status: "done" });
- const res = await supertest(app).get(taxonomyUrl("req-1"));
- expect(res.status).toBe(404);
- expect(res.body).toMatchObject({ error: "Taxonomy not yet generated for this run" });
- });
-
- it("returns taxonomy JSON when taxonomyUrl is set", async () => {
- variant.mockRequest(mocks, "req-1", {
- _id: "run-1",
- attemptNumber: 1,
- status: "done",
- taxonomyUrl: blobUrl("req-1/taxonomy.json"),
- });
-
- const res = await supertest(app).get(taxonomyUrl("req-1")).buffer(true).parse(rawParser);
- expect(res.status).toBe(200);
- expect(res.headers["content-type"]).toMatch("application/json");
- expect(res.headers["content-disposition"]).toContain("req-1-taxonomy.json");
- expect(mockGetBlockBlobClient).toHaveBeenCalledWith("req-1/taxonomy.json");
- });
- });
-
- it("works with per-run variant", async () => {
- RUN_LEVEL.mockRequest(mocks, "req-1", {
- _id: "run-1",
- attemptNumber: 1,
- status: "done",
- taxonomyUrl: blobUrl("req-1/runs/run-1/taxonomy.json"),
- });
-
- const res = await supertest(app).get(RUN_LEVEL.url("req-1") + "taxonomy").buffer(true).parse(rawParser);
- expect(res.status).toBe(200);
- expect(res.headers["content-disposition"]).toContain("req-1-taxonomy.json");
- expect(mockGetBlockBlobClient).toHaveBeenCalledWith("req-1/runs/run-1/taxonomy.json");
- });
-});
diff --git a/apps/api/src/routes/requests/taxonomy.ts b/apps/api/src/routes/requests/taxonomy.ts
deleted file mode 100644
index e74d303f6..000000000
--- a/apps/api/src/routes/requests/taxonomy.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import type { RouteContext } from "../../route-context.js";
-import { downloadBlobToResponse } from "./blob-helpers.js";
-import { registerArtifactRoutes } from "./artifact-route.js";
-
-export function registerRequestsTaxonomyRoutes(ctx: RouteContext): void {
- registerArtifactRoutes(ctx, {
- path: "taxonomy",
- summary: "Download taxonomy JSON for the run",
- perRunSummary: "Download taxonomy JSON for a specific attempt",
- responseDescription: "Taxonomy v1 JSON document (scorecard, behavior analysis, action list)",
- errorResponses: { 404: { description: "Not found — taxonomy not yet generated" } },
- blobNotFoundMessage: "Taxonomy file not found — the blob may have been deleted or is no longer available",
- handler: async (ctx, _req, res, targetRun, id) => {
- const taxonomyUrl = targetRun.taxonomyUrl;
- if (!taxonomyUrl) {
- res.status(404).json({ error: "Taxonomy not yet generated for this run" });
- return;
- }
-
- await downloadBlobToResponse(ctx, res, taxonomyUrl, {
- contentType: "application/json",
- filename: `${id}-taxonomy.json`,
- label: "Taxonomy",
- });
- },
- });
-}
diff --git a/apps/portal/src/components/TaxonomyTab.tsx b/apps/portal/src/components/TaxonomyTab.tsx
deleted file mode 100644
index e97c8c8c4..000000000
--- a/apps/portal/src/components/TaxonomyTab.tsx
+++ /dev/null
@@ -1,248 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import { useQuery } from "@tanstack/react-query";
-import { api } from "@/lib/api";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import { Loader2, Download, ChevronDown, ChevronRight } from "lucide-react";
-import { useState } from "react";
-
-interface TaxonomyDimension {
- name: string;
- score: number;
- maxScore: number;
- justification: string;
-}
-
-interface BehaviorPattern {
- id: string;
- category: string;
- observation: string;
- evidence: string[];
- impact: "positive" | "negative" | "neutral";
-}
-
-interface ActionItem {
- id: string;
- priority: "high" | "medium" | "low";
- title: string;
- description: string;
- category: string;
-}
-
-interface TaxonomyData {
- meta?: {
- schemaVersion?: string;
- generatedAt?: string;
- requestId?: string;
- runId?: string;
- model?: string;
- };
- scorecard?: {
- overall?: number;
- dimensions?: TaxonomyDimension[];
- };
- behaviorAnalysis?: {
- patterns?: BehaviorPattern[];
- };
- actionList?: {
- items?: ActionItem[];
- };
-}
-
-function ScoreBar({ score, maxScore }: { score: number; maxScore: number }) {
- const pct = Math.round((score / maxScore) * 100);
- const color = pct >= 80 ? "bg-green-500" : pct >= 50 ? "bg-yellow-500" : "bg-red-500";
- return (
-
- );
-}
-
-function ImpactBadge({ impact }: { impact: string }) {
- const variant = impact === "positive" ? "default" : impact === "negative" ? "destructive" : "secondary";
- return {impact} ;
-}
-
-function PriorityBadge({ priority }: { priority: string }) {
- const colors: Record = {
- high: "bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",
- medium: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",
- low: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
- };
- return {priority} ;
-}
-
-function CollapsibleSection({ title, defaultOpen = true, children }: { title: string; defaultOpen?: boolean; children: React.ReactNode }) {
- const [open, setOpen] = useState(defaultOpen);
- return (
-
-
setOpen(!open)}>
- {open ? : }
- {title}
-
- {open &&
{children}
}
-
- );
-}
-
-export function TaxonomyTab({ runId, attemptRunId }: { runId: string; attemptRunId?: string }) {
- const url = attemptRunId ? api.runTaxonomyUrl(runId, attemptRunId) : api.taxonomyUrl(runId);
-
- const { data: taxonomy, isLoading, error } = useQuery({
- queryKey: ["run-taxonomy", runId, attemptRunId],
- queryFn: async () => {
- const res = await fetch(url);
- if (!res.ok) {
- if (res.status === 404) return null;
- throw new Error(`Failed to fetch taxonomy: ${res.statusText}`);
- }
- return res.json();
- },
- });
-
- if (isLoading) {
- return (
-
-
- Loading taxonomy…
-
- );
- }
-
- if (error) {
- return (
-
-
Failed to load taxonomy: {(error as Error).message}
-
- );
- }
-
- if (!taxonomy) {
- return (
-
-
Taxonomy not yet generated for this run.
-
It will appear here once post-processing completes.
-
- );
- }
-
- const { meta, scorecard, behaviorAnalysis, actionList } = taxonomy;
-
- return (
-
- {/* Header with download */}
-
-
-
Run Taxonomy
- {meta?.generatedAt && (
-
- Generated {new Date(meta.generatedAt).toLocaleString()}
- {meta.model && <> · Model: {meta.model}>}
-
- )}
-
-
window.open(url, "_blank")}>
-
- Download JSON
-
-
-
- {/* Scorecard */}
- {scorecard && (
-
-
-
- Scorecard
- {scorecard.overall !== undefined && (
- {scorecard.overall}%
- )}
-
-
-
- {scorecard.dimensions?.map((dim) => (
-
-
- {dim.name}
-
-
-
{dim.justification}
-
- ))}
-
-
- )}
-
- {/* Behavior Analysis */}
- {behaviorAnalysis?.patterns && behaviorAnalysis.patterns.length > 0 && (
-
-
-
- Behavior Analysis ({behaviorAnalysis.patterns.length})
-
-
-
-
-
- {behaviorAnalysis.patterns.map((pattern) => (
-
-
- {pattern.category}
-
-
-
{pattern.observation}
- {pattern.evidence.length > 0 && (
-
- {pattern.evidence.map((e, i) => {e} )}
-
- )}
-
- ))}
-
-
-
-
- )}
-
- {/* Action List */}
- {actionList?.items && actionList.items.length > 0 && (
-
-
-
- Action Items ({actionList.items.length})
-
-
-
-
-
- {actionList.items.map((item) => (
-
-
-
-
{item.title}
-
{item.description}
-
{item.category}
-
-
- ))}
-
-
-
-
- )}
-
- {/* Raw JSON fallback — collapsed by default */}
-
-
- {JSON.stringify(taxonomy, null, 2)}
-
-
-
- );
-}
diff --git a/apps/portal/src/lib/api.ts b/apps/portal/src/lib/api.ts
index 144b41c73..ea16aeabb 100644
--- a/apps/portal/src/lib/api.ts
+++ b/apps/portal/src/lib/api.ts
@@ -217,16 +217,6 @@ export const api = {
return `${BASE}/requests/${id}/atif${qs}`;
},
- /** Get taxonomy JSON URL for a request (latest run) */
- taxonomyUrl: (id: string): string => {
- return `${BASE}/requests/${id}/taxonomy`;
- },
-
- /** Get taxonomy JSON URL for a specific attempt */
- runTaxonomyUrl: (requestId: string, runId: string): string => {
- return `${BASE}/requests/${requestId}/runs/${runId}/taxonomy`;
- },
-
/** Download a batch archive of multiple runs as a single .tar.gz */
batchArchive: async (ids: string[]): Promise => {
const resp = await fetch(`${BASE}/requests/archive`, {
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index 789e74743..ee42b2467 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -24,7 +24,6 @@ import { CriteriaGraphView } from "@/components/CriteriaGraphView";
import { HarNetworkViewer } from "@/components/HarNetworkViewer";
import { ConversationView } from "@/components/ConversationView";
import { VideoPlayer } from "@/components/VideoPlayer";
-import { TaxonomyTab } from "@/components/TaxonomyTab";
import { useLogStream } from "@/hooks/use-log-stream";
import { useAllTurnsToolCalls } from "@/hooks/useHarExtraction";
import { MarkdownRenderer } from "@/components/MarkdownRenderer";
@@ -326,7 +325,6 @@ export function RunDetail() {
}
const hasHarData = !!(activeRun?.harUrl || activeRun?.turns?.some(t => t.harUrl));
- const hasTaxonomy = !!activeRun?.taxonomyUrl;
const hasVideoData = !!(activeRun?.videoUrls?.length || activeRun?.setupVideoUrls?.length || activeRun?.turns?.some(t => t.videoUrls?.length));
const videoCount = (activeRun?.setupVideoUrls?.length ?? 0)
+ (activeRun?.videoUrls?.length ?? 0)
@@ -654,7 +652,6 @@ export function RunDetail() {
)}
{hasHarData && Network }
{hasHarData && Tool Calls }
- {hasTaxonomy && Taxonomy }
{hasVideoData && Videos ({videoCount}) }
Logs
@@ -687,13 +684,6 @@ export function RunDetail() {
)}
- {/* Taxonomy tab — structured scorecard + behavior analysis + action items */}
- {hasTaxonomy && (
-
-
-
- )}
-
{/* Video tab — session recording player */}
{hasVideoData && (
diff --git a/apps/portal/src/types.ts b/apps/portal/src/types.ts
index 019f77a9f..7b7e4c0f2 100644
--- a/apps/portal/src/types.ts
+++ b/apps/portal/src/types.ts
@@ -112,7 +112,6 @@ export interface RunState {
resumedAt?: string;
postProcessorVersion?: number;
postProcessorStatus?: "queued" | "processing" | "done" | "failed";
- taxonomyUrl?: string;
}
export interface Run {
diff --git a/apps/scheduler/src/handler-dispatcher.test.ts b/apps/scheduler/src/handler-dispatcher.test.ts
index 080b2b4a7..67264d02c 100644
--- a/apps/scheduler/src/handler-dispatcher.test.ts
+++ b/apps/scheduler/src/handler-dispatcher.test.ts
@@ -16,11 +16,11 @@ const HANDLERS: HandlerServiceDocument[] = [
dependsOn: [],
},
{
- _id: "pp-taxonomy",
+ _id: "pp-example",
type: "post-process-handler",
version: 1,
- queue: "pp-taxonomy-queue",
- selector: "taxonomy",
+ queue: "pp-example-queue",
+ selector: "example",
autoBackfill: false,
dependsOn: ["pp-atif"],
},
@@ -72,7 +72,7 @@ describe("HandlerDispatcher — drain detection", () => {
it("is drained when all handlers are done", () => {
expect(
- isDrained(HANDLERS, { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } }),
+ isDrained(HANDLERS, { "pp-atif": { status: "done" }, "pp-example": { status: "done" } }),
).toBe(true);
});
@@ -84,13 +84,13 @@ describe("HandlerDispatcher — drain detection", () => {
expect(
isDrained(HANDLERS, {
"pp-atif": { status: "done" },
- "pp-taxonomy": { status: "processing" },
+ "pp-example": { status: "processing" },
}),
).toBe(false);
});
it("is drained when a failed dependency blocks its descendant", () => {
- // pp-atif failed → pp-taxonomy can never run (blocked) → terminal.
+ // pp-atif failed → pp-example can never run (blocked) → terminal.
expect(isDrained(HANDLERS, { "pp-atif": { status: "failed" } })).toBe(true);
});
@@ -98,7 +98,7 @@ describe("HandlerDispatcher — drain detection", () => {
expect(
isDrained(HANDLERS, {
"pp-atif": { status: "done" },
- "pp-taxonomy": { status: "failed" },
+ "pp-example": { status: "failed" },
}),
).toBe(true);
});
@@ -128,7 +128,7 @@ describe("HandlerDispatcher — maybeTriggerReports", () => {
run: {
_id: "run-1",
status: "done",
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-example": { status: "done" } },
},
});
collection.findOneAndUpdate.mockResolvedValue({ _id: "req-1" }); // claim succeeds
@@ -188,7 +188,7 @@ describe("HandlerDispatcher — maybeTriggerReports", () => {
run: {
_id: "run-2",
status: "done",
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-example": { status: "done" } },
},
});
@@ -205,7 +205,7 @@ describe("HandlerDispatcher — maybeTriggerReports", () => {
run: {
_id: "run-1",
status: "done",
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-example": { status: "done" } },
},
});
collection.findOneAndUpdate.mockResolvedValue(null); // another path claimed it first
@@ -222,7 +222,7 @@ describe("HandlerDispatcher — maybeTriggerReports", () => {
run: {
_id: "run-1",
status: "done",
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-example": { status: "done" } },
},
});
collection.findOneAndUpdate.mockResolvedValue({ _id: "req-1" });
diff --git a/apps/scheduler/src/notify-routes.test.ts b/apps/scheduler/src/notify-routes.test.ts
index 00968ba29..797256018 100644
--- a/apps/scheduler/src/notify-routes.test.ts
+++ b/apps/scheduler/src/notify-routes.test.ts
@@ -162,11 +162,11 @@ describe("createHttpServer", () => {
servers.push(server);
const doc = {
- _id: "pp-taxonomy",
+ _id: "pp-example",
type: "post-process-handler",
version: 1,
- queue: "pp-taxonomy-queue",
- selector: "taxonomy",
+ queue: "pp-example-queue",
+ selector: "example",
autoBackfill: false,
dependsOn: ["pp-atif"],
};
@@ -178,7 +178,7 @@ describe("createHttpServer", () => {
});
expect(response.status).toBe(200);
- expect(await response.json()).toEqual({ ok: true, handlerId: "pp-taxonomy" });
+ expect(await response.json()).toEqual({ ok: true, handlerId: "pp-example" });
expect(handler.registerHandler).toHaveBeenCalledWith(doc);
});
diff --git a/apps/workers/taxonomy/Dockerfile b/apps/workers/taxonomy/Dockerfile
deleted file mode 100644
index b6be8f2ad..000000000
--- a/apps/workers/taxonomy/Dockerfile
+++ /dev/null
@@ -1,50 +0,0 @@
-FROM node:22.22.0-slim AS builder
-
-RUN corepack enable && corepack prepare pnpm@10.29.1 --activate
-
-WORKDIR /app
-
-COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
-COPY tsconfig.base.json ./
-COPY packages/shared/package.json ./packages/shared/
-COPY apps/workers/taxonomy/package.json ./apps/workers/taxonomy/
-
-RUN pnpm install --frozen-lockfile
-
-COPY packages/shared/tsconfig.json ./packages/shared/
-COPY packages/shared/src ./packages/shared/src/
-COPY apps/workers/taxonomy/tsconfig.json ./apps/workers/taxonomy/
-COPY apps/workers/taxonomy/src ./apps/workers/taxonomy/src/
-COPY apps/workers/taxonomy/handler.yaml ./apps/workers/taxonomy/
-
-RUN pnpm --filter shared build && pnpm --filter taxonomy-handler build
-
-# --- Dev stage: hot reload with tsx watch ---
-FROM builder AS dev
-ENV NODE_ENV=development
-ENV SERVICE_DIR=workers/taxonomy
-COPY scripts/dev-entrypoint.sh /app/scripts/dev-entrypoint.sh
-EXPOSE 80
-ENV PORT=80
-CMD ["/app/scripts/dev-entrypoint.sh"]
-
-# --- Production stage ---
-FROM node:22.22.0-slim
-
-RUN corepack enable && corepack prepare pnpm@10.29.1 --activate
-
-WORKDIR /app
-
-COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
-COPY packages/shared/package.json ./packages/shared/
-COPY apps/workers/taxonomy/package.json ./apps/workers/taxonomy/
-
-RUN pnpm install --frozen-lockfile --prod
-
-COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
-COPY --from=builder /app/apps/workers/taxonomy/dist ./apps/workers/taxonomy/dist/
-COPY --from=builder /app/apps/workers/taxonomy/handler.yaml ./apps/workers/taxonomy/handler.yaml
-
-WORKDIR /app/apps/workers/taxonomy
-
-CMD ["node", "dist/index.js"]
diff --git a/apps/workers/taxonomy/handler.yaml b/apps/workers/taxonomy/handler.yaml
deleted file mode 100644
index b479f905e..000000000
--- a/apps/workers/taxonomy/handler.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-# Post-process handler registration metadata.
-# Read by the generic register-handler script and POSTed to the
-# scheduler's POST /handlers/register endpoint on deploy.
-_id: pp-taxonomy
-type: post-process-handler
-version: 1
-queue: pp-taxonomy-queue
-selector: taxonomy
-autoBackfill: false
-dependsOn:
- - pp-atif
diff --git a/apps/workers/taxonomy/package.json b/apps/workers/taxonomy/package.json
deleted file mode 100644
index 52cdd6b2f..000000000
--- a/apps/workers/taxonomy/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "taxonomy-handler",
- "version": "1.0.0",
- "type": "module",
- "main": "dist/index.js",
- "scripts": {
- "build": "tsc",
- "dev": "tsx watch src/index.ts",
- "start": "node dist/index.js",
- "taxonomy": "tsx src/cli.ts",
- "lint": "eslint src/"
- },
- "dependencies": {
- "shared": "workspace:*",
- "@azure/storage-queue": "^12.25.0",
- "@github/copilot-sdk": "^0.1.17",
- "dotenv": "^16.4.5"
- },
- "devDependencies": {
- "@types/node": "^22.7.0",
- "tsx": "^4.19.0",
- "typescript": "^5.6.2"
- }
-}
diff --git a/apps/workers/taxonomy/src/cli.ts b/apps/workers/taxonomy/src/cli.ts
deleted file mode 100644
index a5f51f600..000000000
--- a/apps/workers/taxonomy/src/cli.ts
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/usr/bin/env npx tsx
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-/**
- * Taxonomy post-processor developer CLI.
- *
- * Invokes the taxonomy generation loop directly against an existing requestId,
- * streams the Copilot SDK session events live, and saves the validated taxonomy
- * to a local JSON file. This is a developer/troubleshooting tool only — it never
- * writes to Mongo (handlerStatus) or blob storage (taxonomy.json) and does not
- * notify the scheduler.
- *
- * Usage:
- * npx tsx src/cli.ts [options]
- * pnpm taxonomy [options]
- *
- * Options:
- * --run, -r Run id for the prompt/logging (default: active run from API).
- * --model Override TAXONOMY_MODEL (e.g. a reasoning model).
- * --timeout Override SESSION_TIMEOUT_MS (per-attempt session timeout).
- * --output, -o Output file path (default: taxonomy-.json).
- * --stdout Also print the taxonomy JSON to stdout.
- * --quiet Suppress live session-event streaming on stderr.
- * --help, -h Show this help.
- */
-import "dotenv/config";
-import { writeFile } from "node:fs/promises";
-import { resolve } from "node:path";
-import { SessionEvent } from "@github/copilot-sdk";
-import { TokenManagerClient, type LogEvent, type RequestDocument } from "shared";
-import { generateTaxonomy } from "./taxonomy-generator.js";
-
-interface CliArgs {
- requestId: string;
- runId?: string;
- model?: string;
- timeoutMs?: number;
- output?: string;
- stdout: boolean;
- quiet: boolean;
-}
-
-function printHelp(): void {
- process.stderr.write(
- [
- "Taxonomy post-processor developer CLI",
- "",
- "Usage: npx tsx src/cli.ts [options]",
- "",
- "Options:",
- " --run, -r Run id for the prompt/logging (default: active run from API)",
- " --model Override TAXONOMY_MODEL",
- " --timeout Override SESSION_TIMEOUT_MS (per-attempt session timeout)",
- " --output, -o Output file path (default: taxonomy-.json)",
- " --stdout Also print the taxonomy JSON to stdout",
- " --quiet Suppress live session-event streaming on stderr",
- " --help, -h Show this help",
- "",
- ].join("\n"),
- );
-}
-
-function parseArgs(argv: string[]): CliArgs | undefined {
- const args: Partial & { stdout: boolean; quiet: boolean } = { stdout: false, quiet: false };
- const positionals: string[] = [];
-
- for (let i = 0; i < argv.length; i += 1) {
- const arg = argv[i];
- switch (arg) {
- case "--help":
- case "-h":
- printHelp();
- return undefined;
- case "--run":
- case "-r":
- args.runId = argv[++i];
- break;
- case "--model":
- args.model = argv[++i];
- break;
- case "--timeout":
- args.timeoutMs = Number(argv[++i]);
- break;
- case "--output":
- case "-o":
- args.output = argv[++i];
- break;
- case "--stdout":
- args.stdout = true;
- break;
- case "--quiet":
- args.quiet = true;
- break;
- default:
- if (arg.startsWith("-")) {
- throw new Error(`Unknown option: ${arg}`);
- }
- positionals.push(arg);
- }
- }
-
- const requestId = positionals[0];
- if (!requestId) {
- throw new Error("Missing required argument");
- }
- if (args.timeoutMs !== undefined && Number.isNaN(args.timeoutMs)) {
- throw new Error("--timeout must be a number (milliseconds)");
- }
-
- return { ...args, requestId };
-}
-
-async function resolveRunId(apiBaseUrl: string, requestId: string, explicit?: string): Promise {
- if (explicit) return explicit;
- try {
- const response = await fetch(`${apiBaseUrl}/api/v1/requests/${requestId}`);
- if (response.ok) {
- const request: RequestDocument = await response.json();
- if (request.run?._id) return request.run._id;
- }
- } catch {
- // fall through to requestId fallback
- }
- return requestId;
-}
-
-function summarizeEvent(event: SessionEvent): string | undefined {
- switch (event.type) {
- case "session.start":
- return `session.start model=${event.data.selectedModel}`;
- case "session.error":
- return `session.error ${event.data.errorType}: ${event.data.message}`;
- case "tool.execution_start":
- return `tool.start ${event.data.toolName} ${JSON.stringify(event.data.arguments ?? {})}`;
- case "tool.execution_complete":
- return `tool.done ${event.data.success ? "ok" : "FAILED"}${event.data.error ? ` ${event.data.error.message}` : ""}`;
- case "assistant.message":
- return `assistant.message (${event.data.content.length} chars)`;
- default:
- return undefined;
- }
-}
-
-async function main(): Promise {
- let parsed: CliArgs | undefined;
- try {
- parsed = parseArgs(process.argv.slice(2));
- } catch (error) {
- process.stderr.write(`Error: ${error instanceof Error ? error.message : String(error)}\n\n`);
- printHelp();
- process.exit(2);
- }
- if (!parsed) return; // help shown
-
- const apiBaseUrl = process.env.SCOPE_MT_API_URL || "http://localhost:3001";
- const taxonomyModel = parsed.model || process.env.TAXONOMY_MODEL || "gpt-5.4";
- const sessionTimeoutMs = parsed.timeoutMs ?? (Number(process.env.SESSION_TIMEOUT_MS) || 5 * 60 * 1000);
- const outputPath = resolve(parsed.output ?? `taxonomy-${parsed.requestId}.json`);
-
- const githubToken = process.env.GITHUB_TOKEN
- ? process.env.GITHUB_TOKEN
- : await new TokenManagerClient(process.env.TOKEN_MANAGER_URL).acquireToken("copilot-sdk");
-
- const runId = await resolveRunId(apiBaseUrl, parsed.requestId, parsed.runId);
-
- const log = (level: LogEvent["level"], msg: string, data?: Record): void => {
- if (parsed.quiet) return;
- const suffix = data && Object.keys(data).length > 0 ? ` ${JSON.stringify(data)}` : "";
- process.stderr.write(`[${level}] ${msg}${suffix}\n`);
- };
-
- process.stderr.write(
- `Generating taxonomy: requestId=${parsed.requestId} runId=${runId} model=${taxonomyModel} timeout=${sessionTimeoutMs}ms\n`,
- );
-
- const onEvent = parsed.quiet
- ? undefined
- : (event: SessionEvent): void => {
- const summary = summarizeEvent(event);
- if (summary) process.stderr.write(` · ${summary}\n`);
- };
-
- const taxonomy = await generateTaxonomy({
- requestId: parsed.requestId,
- runId,
- apiBaseUrl,
- taxonomyModel,
- githubToken,
- sessionTimeoutMs,
- log,
- onEvent,
- });
-
- const json = JSON.stringify(taxonomy, null, 2);
- await writeFile(outputPath, `${json}\n`, "utf-8");
- process.stderr.write(`\nTaxonomy written to ${outputPath}\n`);
- if (parsed.stdout) {
- process.stdout.write(`${json}\n`);
- }
-}
-
-main().catch((error) => {
- process.stderr.write(`\nTaxonomy generation failed: ${error instanceof Error ? error.message : String(error)}\n`);
- process.exit(1);
-});
diff --git a/apps/workers/taxonomy/src/index.ts b/apps/workers/taxonomy/src/index.ts
deleted file mode 100644
index b1a4f322b..000000000
--- a/apps/workers/taxonomy/src/index.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import "dotenv/config";
-import { TaxonomyQueueProcessor, type TaxonomyQueueProcessorConfig } from "./taxonomy-queue-processor.js";
-
-const config: TaxonomyQueueProcessorConfig = {
- mongoUri: process.env.MONGO_CONNECTION_STRING || process.env.AZURE_COSMOS_CONNECTION_STRING || "mongodb://localhost:27017",
- mongoDatabase: process.env.MONGO_DATABASE || "requests-db",
- mongoCollection: "requests",
- storageAccountName: process.env.AZURE_STORAGE_ACCOUNT_NAME || "devstoreaccount1",
- storageConnectionString: process.env.STORAGE_CONNECTION_STRING || process.env.AZURE_STORAGE_CONNECTION_STRING || undefined,
- queueName: process.env.AZURE_STORAGE_QUEUE_TAXONOMY || "pp-taxonomy-queue",
- batchSize: Number(process.env.BATCH_SIZE) || 1,
- pollIntervalMs: Number(process.env.POLL_INTERVAL_MS) || 5000,
- redisHost: process.env.REDIS_HOST || "localhost",
- redisPort: Number(process.env.REDIS_PORT) || 6379,
- redisPassword: process.env.REDIS_PASSWORD || "",
- taxonomyModel: process.env.TAXONOMY_MODEL || "gpt-5.4",
- apiBaseUrl: process.env.SCOPE_MT_API_URL || "http://localhost:3001",
- sessionTimeoutMs: Number(process.env.SESSION_TIMEOUT_MS) || 5 * 60 * 1000,
- schedulerUrl: process.env.SCHEDULER_URL,
- tokenManagerUrl: process.env.TOKEN_MANAGER_URL,
-};
-
-const processor = new TaxonomyQueueProcessor(config);
-processor.start().catch((err) => {
- console.error("[taxonomy-handler] Fatal error:", err);
- process.exit(1);
-});
diff --git a/apps/workers/taxonomy/src/prompt.ts b/apps/workers/taxonomy/src/prompt.ts
deleted file mode 100644
index 47ea28e4d..000000000
--- a/apps/workers/taxonomy/src/prompt.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-export const TAXONOMY_SYSTEM_PROMPT = `You generate benchmark taxonomy documents for completed Scope runs.
-
-Your job is to inspect the run metadata and ATIF trajectories, then return a taxonomy JSON document that conforms exactly to the taxonomy Zod schema enforced by the worker.
-
-Required JSON shape:
-{
- "meta": {
- "generatedAt": "ISO-8601 datetime with offset",
- "schemaVersion": "string",
- "runId": "string",
- "requestId": "string"
- },
- "scorecard": {
- "summary": "string",
- "profileResults": [
- {
- "profileId": "string",
- "select": "best|median|worst",
- "taskOutcome": "success|partial|failure",
- "overallScore": 0-100,
- "dimensions": [
- {
- "name": "string",
- "score": 0-100,
- "rationale": "string",
- "evidence": ["string"]
- }
- ]
- }
- ],
- "crossProfileInsights": ["string"]
- },
- "behaviorAnalysis": {
- "patterns": [
- {
- "id": "string",
- "category": "strength|weakness|inconsistency|regression",
- "title": "string",
- "description": "string",
- "frequency": 0-1,
- "impact": "critical|high|medium|low",
- "evidence": [
- {
- "runId": "string",
- "iteration": 0-or-greater integer,
- "excerpt": "string"
- }
- ]
- }
- ],
- "agentPersonality": {
- "communicationStyle": "string",
- "problemSolvingApproach": "string",
- "errorRecoveryBehavior": "string"
- }
- },
- "actionList": {
- "fix": [actionItem],
- "improve": [actionItem],
- "investigate": [actionItem]
- }
-}
-
-Each actionItem must include:
-- id
-- title
-- priority: critical|high|medium|low
-- description
-- ownership: agent-team|platform-team|prompt-engineer|scenario-author
-- relatedPatterns: string[]
-- suggestedApproach
-
-Output rules:
-- Return raw JSON only.
-- Do not wrap the JSON in markdown fences.
-- Do not include commentary before or after the JSON.
-- Every field must be valid for the schema.
-- Preserve the 3-layer structure: scorecard, behaviorAnalysis, actionList.
-- If a value is unknown, use the schema-compatible empty/null/default value rather than inventing facts.
-
-Use the available tools to gather evidence before answering:
-- get_run_data for the request, scenario, run, turns, and criteria outcomes.
-- get_atif_trajectory for ATIF evidence from individual iterations.
-
-Ground every classification in the actual run evidence. Prefer precise, stable labels over verbose prose. If validation feedback is provided later in the conversation, correct the JSON and return a full replacement document.`;
diff --git a/apps/workers/taxonomy/src/taxonomy-generator.ts b/apps/workers/taxonomy/src/taxonomy-generator.ts
deleted file mode 100644
index 0df69d2c5..000000000
--- a/apps/workers/taxonomy/src/taxonomy-generator.ts
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import { CopilotClient, SessionEvent } from "@github/copilot-sdk";
-import {
- type LogEvent,
- taxonomySchema,
- type TaxonomyDocument,
-} from "shared";
-import { TAXONOMY_SYSTEM_PROMPT } from "./prompt.js";
-import { createTaxonomyTools } from "./tools.js";
-
-export const DEFAULT_SESSION_TIMEOUT_MS = 5 * 60 * 1000;
-const DELTA_LOG_INTERVAL = 2_000;
-
-type TaxonomyLogFn = (
- level: LogEvent["level"],
- msg: string,
- data?: Record,
-) => Promise | void;
-
-export interface GenerateTaxonomyParams {
- requestId: string;
- runId: string;
- apiBaseUrl: string;
- taxonomyModel: string;
- githubToken: string;
- sessionTimeoutMs?: number;
- log: TaxonomyLogFn;
- /** Optional raw session-event hook (used by the dev CLI to render live progress). */
- onEvent?: (event: SessionEvent) => void;
-}
-
-/**
- * Runs the Copilot SDK taxonomy generation loop and returns a schema-validated
- * taxonomy document. This is side-effect-free with respect to Mongo and blob
- * storage (it only reads run data and ATIF trajectories through the API);
- * persistence is the caller's responsibility.
- */
-export async function generateTaxonomy(params: GenerateTaxonomyParams): Promise {
- const { requestId, runId, apiBaseUrl, taxonomyModel, githubToken, log, onEvent } = params;
- const client = new CopilotClient({ githubToken });
- const tools = createTaxonomyTools(apiBaseUrl, requestId);
- const timeoutMs = params.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS;
-
- let streamedResponse = "";
- let latestMessage = "";
- let lastLoggedCharCount = 0;
- const toolNames = new Map();
-
- try {
- const session = await client.createSession({
- model: taxonomyModel,
- streaming: true,
- tools,
- systemMessage: { mode: "replace", content: TAXONOMY_SYSTEM_PROMPT },
- });
-
- session.on((event: SessionEvent) => {
- onEvent?.(event);
- switch (event.type) {
- case "session.start":
- void log("info", "Copilot session started", {
- sessionId: event.data.sessionId,
- model: event.data.selectedModel,
- });
- break;
- case "session.error":
- void log("error", `Session error: ${event.data.message}`, { errorType: event.data.errorType });
- break;
- case "tool.execution_start":
- toolNames.set(event.data.toolCallId, event.data.toolName);
- void log("info", `Tool call: ${event.data.toolName}`, {
- toolCallId: event.data.toolCallId,
- arguments: event.data.arguments as Record | undefined,
- });
- break;
- case "tool.execution_complete": {
- const toolName = toolNames.get(event.data.toolCallId) ?? "unknown";
- toolNames.delete(event.data.toolCallId);
- void log("info", `Tool result: ${toolName} (${event.data.success ? "success" : "failed"})`, {
- toolCallId: event.data.toolCallId,
- error: event.data.error?.message,
- });
- break;
- }
- case "assistant.message_delta":
- streamedResponse += event.data.deltaContent;
- if (streamedResponse.length - lastLoggedCharCount >= DELTA_LOG_INTERVAL) {
- lastLoggedCharCount = streamedResponse.length;
- void log("info", `Generating taxonomy… (${streamedResponse.length} chars so far)`);
- }
- break;
- case "assistant.message":
- latestMessage = event.data.content;
- break;
- }
- });
-
- let attempts = 0;
- const maxAttempts = 3;
- let prompt = [
- `Generate taxonomy JSON for request ${requestId} and run ${runId}.`,
- "Use get_run_data first, then inspect ATIF trajectories that materially affect the classification.",
- "Return only raw JSON that satisfies the taxonomy schema.",
- ].join(" ");
- let lastJson: string | undefined;
-
- while (attempts < maxAttempts) {
- attempts += 1;
- streamedResponse = "";
- latestMessage = "";
- lastLoggedCharCount = 0;
-
- await log("info", `Sending taxonomy prompt to Copilot SDK (attempt ${attempts}/${maxAttempts})`, {
- requestId,
- runId,
- timeoutMs,
- });
-
- const response = await session.sendAndWait({ prompt }, timeoutMs);
- const responseText = response?.data.content?.trim() || latestMessage.trim() || streamedResponse.trim();
-
- if (!responseText) {
- throw new Error("Copilot SDK returned an empty taxonomy response");
- }
-
- const jsonText = extractJson(responseText);
- lastJson = jsonText;
-
- let parsedJson: unknown;
- try {
- parsedJson = JSON.parse(jsonText) as unknown;
- } catch (error) {
- const errorMessage = error instanceof Error ? error.message : String(error);
- if (attempts >= maxAttempts) {
- throw new Error(`Taxonomy response was not valid JSON after ${maxAttempts} attempts: ${errorMessage}`);
- }
-
- prompt = [
- "Your previous response was not valid JSON.",
- `JSON parse error: ${errorMessage}.`,
- "Return the full taxonomy document again as raw JSON only, with no markdown fences or commentary.",
- "Replace the entire response with corrected JSON.",
- ].join(" ");
- continue;
- }
-
- const validation = taxonomySchema.safeParse(parsedJson);
- if (validation.success) {
- return validation.data;
- }
-
- const validationErrors = formatValidationErrors(validation.error.issues);
- await log("warn", `Taxonomy validation failed on attempt ${attempts}`, {
- issues: validationErrors,
- });
-
- if (attempts >= maxAttempts) {
- throw new Error(
- `Taxonomy schema validation failed after ${maxAttempts} attempts: ${validationErrors.join(" | ")}`,
- );
- }
-
- prompt = [
- "Your previous taxonomy JSON did not satisfy the schema.",
- "Correct the document and return the entire replacement JSON object.",
- "Do not include markdown fences or commentary.",
- `Validation errors: ${validationErrors.join("; ")}`,
- lastJson ? `Previous JSON: ${lastJson}` : "",
- ].filter(Boolean).join(" ");
- }
-
- throw new Error("Taxonomy generation ended without a valid document");
- } finally {
- await client.stop().catch(() => undefined);
- }
-}
-
-function extractJson(responseText: string): string {
- const trimmed = responseText.trim();
- if (!trimmed.startsWith("```")) {
- return trimmed;
- }
-
- const fenceMatch = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
- return fenceMatch?.[1]?.trim() ?? trimmed;
-}
-
-function formatValidationErrors(issues: Array<{ path: PropertyKey[]; message: string }>): string[] {
- return issues.map((issue) => {
- const path = issue.path.length > 0 ? issue.path.map((segment) => String(segment)).join(".") : "";
- return `${path}: ${issue.message}`;
- });
-}
diff --git a/apps/workers/taxonomy/src/taxonomy-queue-processor.ts b/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
deleted file mode 100644
index d3c7495d3..000000000
--- a/apps/workers/taxonomy/src/taxonomy-queue-processor.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import { DequeuedMessageItem } from "@azure/storage-queue";
-import {
- BaseQueueProcessor,
- BlobStorage,
- type BaseQueueProcessorConfig,
- type LogEvent,
- type RequestDocument,
- TokenManagerClient,
- type TaxonomyDocument,
- type VisibilityHeartbeat,
- withRetry,
-} from "shared";
-import { generateTaxonomy } from "./taxonomy-generator.js";
-
-const HANDLER_ID = "pp-taxonomy";
-const HANDLER_VERSION = 1;
-const DEFAULT_SESSION_TIMEOUT_MS = 5 * 60 * 1000;
-
-interface TaxonomyQueueMessage {
- type: "taxonomy";
- requestId: string;
- runId?: string;
-}
-
-export interface TaxonomyQueueProcessorConfig extends BaseQueueProcessorConfig {
- taxonomyModel: string;
- apiBaseUrl: string;
- sessionTimeoutMs?: number;
- schedulerUrl?: string;
- tokenManagerUrl?: string;
-}
-
-export class TaxonomyQueueProcessor extends BaseQueueProcessor {
- private taxonomyConfig: TaxonomyQueueProcessorConfig;
- private tokenClient: TokenManagerClient;
- private blobStorage: BlobStorage;
-
- constructor(config: TaxonomyQueueProcessorConfig) {
- super(config, "taxonomy-handler");
- this.taxonomyConfig = config;
- this.tokenClient = new TokenManagerClient(config.tokenManagerUrl);
- this.blobStorage = new BlobStorage({
- storageAccountName: config.storageAccountName,
- storageConnectionString: config.storageConnectionString,
- });
- }
-
- protected override async handleRequest(
- doc: RequestDocument,
- message: DequeuedMessageItem,
- heartbeat: VisibilityHeartbeat,
- log: (level: LogEvent["level"], msg: string, data?: Record) => Promise,
- payload?: Record,
- ): Promise {
- const queueMessage = payload as TaxonomyQueueMessage | undefined;
- const requestId = doc._id;
- const activeRunId = doc.run?._id;
- const runId = queueMessage?.runId ?? activeRunId ?? requestId;
-
- if (!queueMessage || queueMessage.type !== "taxonomy") {
- await log("warn", "Discarding message with unsupported taxonomy payload", { payload });
- await this.safeDeleteMessage(message.messageId, heartbeat.stop());
- return;
- }
-
- if (queueMessage.runId && activeRunId && queueMessage.runId !== activeRunId) {
- await log("warn", "Discarding stale taxonomy message for superseded run", {
- requestId,
- queuedRunId: queueMessage.runId,
- activeRunId,
- });
- await this.safeDeleteMessage(message.messageId, heartbeat.stop());
- return;
- }
-
- if (!doc.run) {
- throw new Error(`Request ${requestId} has no active run to classify`);
- }
-
- await withRetry(() => this.collection.updateOne(
- { _id: requestId } as never,
- {
- $set: {
- [`run.handlerStatus.${HANDLER_ID}.status`]: "processing",
- [`run.handlerStatus.${HANDLER_ID}.version`]: HANDLER_VERSION,
- [`run.handlerStatus.${HANDLER_ID}.updatedAt`]: new Date(),
- [`run.handlerStatus.${HANDLER_ID}.error`]: null,
- },
- } as never,
- ));
-
- await log("info", "Starting taxonomy generation", { requestId, runId, model: this.taxonomyConfig.taxonomyModel });
-
- try {
- const taxonomy = await this.generateTaxonomy(requestId, runId, log);
- const blobName = `${requestId}/runs/${runId}/taxonomy.json`;
- const taxonomyUrl = await this.blobStorage.uploadJson(blobName, taxonomy);
-
- await withRetry(() => this.collection.updateOne(
- { _id: requestId } as never,
- {
- $set: {
- [`run.taxonomyUrl`]: taxonomyUrl,
- [`run.handlerStatus.${HANDLER_ID}.status`]: "done",
- [`run.handlerStatus.${HANDLER_ID}.version`]: HANDLER_VERSION,
- [`run.handlerStatus.${HANDLER_ID}.updatedAt`]: new Date(),
- },
- $unset: {
- [`run.handlerStatus.${HANDLER_ID}.error`]: "",
- },
- } as never,
- ));
-
- await log("info", "Taxonomy generation completed", {
- requestId,
- runId,
- blobName,
- taxonomyUrl,
- });
-
- await this.notifyHandlerComplete(requestId, runId, "done");
- } catch (error) {
- const errorMessage = error instanceof Error ? error.message : String(error);
-
- await withRetry(() => this.collection.updateOne(
- { _id: requestId } as never,
- {
- $set: {
- [`run.handlerStatus.${HANDLER_ID}.status`]: "failed",
- [`run.handlerStatus.${HANDLER_ID}.version`]: HANDLER_VERSION,
- [`run.handlerStatus.${HANDLER_ID}.updatedAt`]: new Date(),
- [`run.handlerStatus.${HANDLER_ID}.error`]: errorMessage,
- },
- } as never,
- ));
-
- await log("error", `Taxonomy generation failed: ${errorMessage}`, { requestId, runId });
- await this.notifyHandlerComplete(requestId, runId, "failed");
- throw error;
- }
-
- const finalPopReceipt = heartbeat.stop();
- await this.safeDeleteMessage(message.messageId, finalPopReceipt);
- }
-
- private async generateTaxonomy(
- requestId: string,
- runId: string,
- log: (level: LogEvent["level"], msg: string, data?: Record) => Promise,
- ): Promise {
- const githubToken = await this.tokenClient.acquireToken("copilot-sdk");
- await log("info", "Acquired Copilot SDK token");
-
- return generateTaxonomy({
- requestId,
- runId,
- apiBaseUrl: this.taxonomyConfig.apiBaseUrl,
- taxonomyModel: this.taxonomyConfig.taxonomyModel,
- githubToken,
- sessionTimeoutMs: this.taxonomyConfig.sessionTimeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS,
- log,
- });
- }
-
- private async notifyHandlerComplete(
- requestId: string,
- runId: string,
- status: "done" | "failed",
- ): Promise {
- const schedulerUrl = this.taxonomyConfig.schedulerUrl;
- if (!schedulerUrl) return;
-
- try {
- const response = await fetch(`${schedulerUrl}/notify/handler-complete`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ requestId, runId, handlerId: HANDLER_ID, status }),
- });
-
- if (!response.ok) {
- console.warn(`[taxonomy-handler] Scheduler notify failed: ${response.status}`);
- }
- } catch (error) {
- console.warn(`[taxonomy-handler] Scheduler notify error for ${requestId}/${runId}:`, error);
- }
- }
-}
-
diff --git a/apps/workers/taxonomy/src/tools.ts b/apps/workers/taxonomy/src/tools.ts
deleted file mode 100644
index ea4eced32..000000000
--- a/apps/workers/taxonomy/src/tools.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import { defineTool } from "@github/copilot-sdk";
-import { type ConversationTurn, type RequestDocument } from "shared";
-
-interface GetAtifTrajectoryArgs {
- iteration?: number;
-}
-
-function selectTurnWithAtif(turns: ConversationTurn[] | undefined, requestedIteration?: number): ConversationTurn | undefined {
- if (!turns?.length) return undefined;
-
- if (requestedIteration !== undefined) {
- return turns.find((turn) => turn.iteration === requestedIteration && typeof turn.atifUrl === "string");
- }
-
- return [...turns]
- .filter((turn) => typeof turn.atifUrl === "string")
- .sort((a, b) => b.iteration - a.iteration)[0];
-}
-
-export function createTaxonomyTools(
- apiBaseUrl: string,
- requestId: string,
-) {
- const getRunData = defineTool("get_run_data", {
- description:
- "Fetch the full request document plus the active run state, including scenario, persona, turns, criteria results, and handler status.",
- parameters: {
- type: "object",
- properties: {},
- },
- handler: async () => {
- try {
- const response = await fetch(`${apiBaseUrl}/api/v1/requests/${requestId}`);
- if (!response.ok) {
- return { error: `Failed to fetch request: ${response.status} ${response.statusText}` };
- }
-
- const request: RequestDocument = await response.json();
- const run = request.run;
-
- return {
- request: {
- id: request._id,
- workerType: request.workerType,
- model: request.model,
- reasoningEffort: request.reasoningEffort,
- maxIterations: request.maxIterations,
- createdAt: request.createdAt,
- updatedAt: request.updatedAt,
- persona: request.persona,
- personaInstructions: request.personaInstructions,
- mcpServers: request.mcpServers,
- skillRevisions: request.skillRevisions,
- extensions: request.extensions,
- priority: request.priority,
- scenario: request.scenario,
- },
- run: run ? {
- id: run._id,
- attemptNumber: run.attemptNumber,
- status: run.status,
- outcome: run.outcome,
- result: run.result,
- error: run.error,
- startedAt: run.startedAt,
- finishedAt: run.finishedAt,
- updatedAt: run.updatedAt,
- aiCallCount: run.aiCallCount,
- tokenUsage: run.tokenUsage,
- handlerStatus: run.handlerStatus,
- turns: run.turns?.map((turn) => ({
- iteration: turn.iteration,
- passed: turn.passed,
- timestamp: turn.timestamp,
- startedAt: turn.startedAt,
- durationMs: turn.durationMs,
- judgeFeedback: turn.judgeFeedback,
- codingAgentResponse: turn.codingAgentResponse,
- aiCallCount: turn.aiCallCount,
- tokenUsage: turn.tokenUsage,
- snapshotUrl: turn.snapshotUrl,
- rawChatUrl: turn.rawChatUrl,
- rawChatFormat: turn.rawChatFormat,
- toolCallsUrl: turn.toolCallsUrl,
- toolCallCount: turn.toolCallCount,
- atifUrl: turn.atifUrl,
- criteriaResults: turn.criteriaResults,
- })) ?? [],
- } : null,
- };
- } catch (err) {
- return { error: `Failed to fetch run data: ${err}` };
- }
- },
- });
-
- const getAtifTrajectory = defineTool("get_atif_trajectory", {
- description:
- "Fetch an ATIF trajectory JSON document for a specific iteration, or the latest available iteration when omitted.",
- parameters: {
- type: "object",
- properties: {
- iteration: {
- type: "number",
- description: "Optional 1-based iteration number. If omitted, the latest available ATIF trajectory is returned.",
- },
- },
- },
- handler: async (args: GetAtifTrajectoryArgs) => {
- try {
- const response = await fetch(`${apiBaseUrl}/api/v1/requests/${requestId}`);
- if (!response.ok) {
- return { error: `Failed to fetch request: ${response.status} ${response.statusText}` };
- }
-
- const request: RequestDocument = await response.json();
- const selectedTurn = selectTurnWithAtif(request.run?.turns, args.iteration);
-
- if (!selectedTurn?.atifUrl) {
- return {
- error: args.iteration !== undefined
- ? `No ATIF trajectory available for iteration ${args.iteration}`
- : "No ATIF trajectory is available for this run",
- };
- }
-
- const runId = request.run?._id;
- const iteration = selectedTurn.iteration;
- const atifUrl = runId
- ? `${apiBaseUrl}/api/v1/requests/${requestId}/runs/${runId}/atif?iteration=${iteration}`
- : `${apiBaseUrl}/api/v1/requests/${requestId}/atif?iteration=${iteration}`;
-
- const atifResponse = await fetch(atifUrl);
- if (!atifResponse.ok) {
- return { error: `Failed to fetch ATIF trajectory: ${atifResponse.status} ${atifResponse.statusText}` };
- }
-
- const trajectory: unknown = await atifResponse.json();
-
- return {
- iteration,
- trajectory,
- };
- } catch (err) {
- return { error: `Failed to fetch ATIF trajectory: ${err}` };
- }
- },
- });
-
- return [getRunData, getAtifTrajectory];
-}
diff --git a/apps/workers/taxonomy/tsconfig.json b/apps/workers/taxonomy/tsconfig.json
deleted file mode 100644
index bf012ecbb..000000000
--- a/apps/workers/taxonomy/tsconfig.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "../../../tsconfig.base.json",
- "compilerOptions": {
- "outDir": "./dist",
- "rootDir": "./src"
- },
- "include": ["src/**/*"]
-}
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 0f9a0753e..daa4d9c9f 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -180,30 +180,10 @@ services:
- action: rebuild
path: ./pnpm-lock.yaml
- taxonomy-handler:
- build:
- target: dev
- develop:
- watch:
- - action: sync
- path: ./apps/workers/taxonomy/src
- target: /app/apps/workers/taxonomy/src
- - action: sync
- path: ./packages/shared/src
- target: /app/packages/shared/src
- - action: rebuild
- path: ./apps/workers/taxonomy/package.json
- - action: rebuild
- path: ./pnpm-lock.yaml
-
register-handler-post-processor:
build:
target: dev
- register-handler-taxonomy:
- build:
- target: dev
-
post-processor:
build:
target: dev
diff --git a/docker-compose.yml b/docker-compose.yml
index 0124b6f71..3ab31dced 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,7 +9,6 @@
# docker compose --profile vscode-web up # + VS Code Web worker
# docker compose --profile claude-code --profile copilot up # multiple workers
# docker compose --profile report up # + Report Generator worker
-# docker compose --profile taxonomy up # + Taxonomy handler worker
# docker compose up mongodb redis azurite # infra only (run app services natively)
#
# Host-native debugging:
@@ -641,51 +640,6 @@ services:
api:
condition: service_started
- taxonomy-handler:
- build:
- context: .
- dockerfile: apps/workers/taxonomy/Dockerfile
- profiles: [taxonomy, all]
- environment:
- <<: *common-env
- AZURE_STORAGE_QUEUE_TAXONOMY: pp-taxonomy-queue
- TAXONOMY_MODEL: ${TAXONOMY_MODEL:-gpt-5.4}
- SCOPE_MT_API_URL: http://api:80
- SCHEDULER_URL: http://scheduler:8080
- GITHUB_TOKEN: ${GITHUB_TOKEN:-}
- TOKEN_MANAGER_URL: http://token-manager:80
- GIT_COMMIT: ${GIT_COMMIT:-development}
- SESSION_TIMEOUT_MS: ${SESSION_TIMEOUT_MS:-300000}
- depends_on:
- mongodb:
- condition: service_healthy
- required: false
- redis:
- condition: service_healthy
- azurite:
- condition: service_healthy
- api:
- condition: service_started
- scheduler:
- condition: service_started
- register-handler-taxonomy:
- condition: service_completed_successfully
-
- register-handler-taxonomy:
- build:
- context: .
- dockerfile: apps/workers/taxonomy/Dockerfile
- profiles: [taxonomy, all]
- environment:
- <<: *common-env
- HANDLER_YAML_PATH: apps/workers/taxonomy/handler.yaml
- SCHEDULER_URL: http://scheduler:8080
- depends_on:
- scheduler:
- condition: service_started
- restart: "no"
- entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
-
register-handler-post-processor:
build:
context: .
diff --git a/docs/architecture/db-migrations.md b/docs/architecture/db-migrations.md
index fbe5b1cd4..f69880a10 100644
--- a/docs/architecture/db-migrations.md
+++ b/docs/architecture/db-migrations.md
@@ -103,7 +103,7 @@ When you run a command:
| `008-backfill-ai-call-count` | Downloads HARs from blob storage to count AI completion calls per turn |
| `009-add-requests-filter-indexes` | Adds indexes on `taskPromptId`, `status`, `outcome`, `workerType`, `deletedAt` for server-side filtering/grouping |
| `018-migrate-services-to-handler-dag` | Replaces the legacy single `post-processor` service row with per-handler service registrations and dependencies |
-| `019-add-handler-status-index` | Adds handler-specific dispatch indexes for `pp-atif`, `pp-taxonomy`, and `pp-report` polling |
+| `019-add-handler-status-index` | Adds a handler-specific dispatch index for `pp-atif` polling |
| `020-backfill-handler-status` | Backfills `run.handlerStatus.pp-atif` from deprecated `run.postProcessorStatus` / `run.postProcessorVersion` fields |
## CI/CD
diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md
index 7550c5703..cb0aa299c 100644
--- a/docs/architecture/overview.md
+++ b/docs/architecture/overview.md
@@ -80,7 +80,6 @@ flowchart TB
| `workers/coder-acp-claude-code` | Claude Code agent via Agent Client Protocol (ACP) |
| `workers/coder-acp-copilot` | GitHub Copilot agent via Agent Client Protocol (ACP) |
| `workers/report-generator` | Copilot SDK worker that generates post-run markdown reports |
-| `workers/taxonomy` | Copilot SDK worker that generates validated post-run taxonomy JSON |
| `gateway` | AI Gateway — shared Rust TLS-intercepting proxy with plugin architecture (HAR capture, future: token refresh, rate limiting) |
## Data Flow
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index dadda0544..097dc4b28 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -34,23 +34,7 @@ Two paths trigger post-processing:
- Updates `run.turns.$.atifUrl` in the request document
4. On success, stamps `run.handlerStatus["pp-atif"] = { status: "done", version: N }` (while legacy `run.postProcessorVersion` / `run.postProcessorStatus` may still be mirrored during the transition)
-5. Triggers the downstream taxonomy handler once the scheduler sees the dependency graph is satisfied. (Reports are **not** a DAG handler — see [Report Triggering](#report-triggering-on-dag-drain).)
-
-## Taxonomy Generation
-
-The taxonomy handler (`apps/workers/taxonomy/`) consumes messages from the dedicated `pp-taxonomy-queue` and produces a structured JSON artifact for a completed run. It uses the GitHub Copilot SDK with a tool-backed session to fetch run metadata and ATIF trajectories from the API, then validates the generated JSON against the shared taxonomy Zod schema.
-
-### Flow
-
-1. Queue message arrives: `{ type: "taxonomy", requestId, runId }`
-2. Worker fetches the request document from MongoDB and marks `run.handlerStatus["pp-taxonomy"].status = "processing"`
-3. Copilot SDK session calls:
- - `get_run_data` to fetch the request + active run from the API
- - `get_atif_trajectory` to fetch per-iteration ATIF JSON from the API (`GET /api/v1/requests/:id/runs/:runId/atif?iteration=N`)
-4. The worker validates the assistant response with `taxonomySchema.safeParse()`
-5. If validation fails, the worker feeds the schema errors back into the same session and retries up to 3 total attempts
-6. On success, the worker uploads `taxonomy.json` to `{requestId}/runs/{runId}/taxonomy.json`
-7. The worker stamps `run.handlerStatus["pp-taxonomy"] = { status: "done", version: 1 }` and calls `POST /notify/handler-complete`
+5. Triggers any downstream handlers once the scheduler sees the dependency graph is satisfied. (Reports are **not** a DAG handler — see [Report Triggering](#report-triggering-on-dag-drain).)
### Blob Storage Layout
@@ -61,52 +45,16 @@ The taxonomy handler (`apps/workers/taxonomy/`) consumes messages from the dedic
atif.trajectory.json
iteration-2/
atif.trajectory.json
- taxonomy.json
```
-The completed run stores the taxonomy blob URL on `run.taxonomyUrl`.
-
### API Endpoints
| Endpoint | Description |
| --- | --- |
| `GET /api/v1/requests/:id/atif?iteration=N` | Download ATIF for the latest run |
| `GET /api/v1/requests/:id/runs/:runId/atif?iteration=N` | Download ATIF for a specific run |
-| `GET /api/v1/requests/:id/taxonomy` | Download taxonomy JSON for the latest run |
-| `GET /api/v1/requests/:id/runs/:runId/taxonomy` | Download taxonomy JSON for a specific run |
-
-The `iteration` query parameter is mandatory only for the ATIF endpoints. ATIF files are also included in archive exports as `iteration-{N}.atif.trajectory.json`.
-
-### Local troubleshooting: taxonomy CLI
-
-The Copilot SDK generation loop lives in `apps/workers/taxonomy/src/taxonomy-generator.ts` (`generateTaxonomy()`), shared by both the queue processor and a standalone developer CLI (`src/cli.ts`). The CLI invokes generation directly against an existing `requestId`, streams the session events live, and saves the validated taxonomy to a local file — **it never writes to MongoDB, blob storage, or the scheduler** (read-only). It is a developer tool and is intentionally not part of the Scope CLI.
-
-Because both taxonomy tools (`get_run_data` and `get_atif_trajectory`) read through the API, the CLI needs only an API URL and a Copilot token — no storage connection string. This lets it run against any environment (local or a remote deployment such as integration) given a reachable API.
-
-```bash
-# Local stack (use your worktree's host-mapped API port):
-SCOPE_MT_API_URL=http://localhost:3001 \
-GITHUB_TOKEN=$(gh auth token) \
-pnpm taxonomy [--run ] [--model ] [--timeout ] [-o out.json] [--stdout] [--quiet]
-
-# Integration (read-only against the deployed API):
-SCOPE_MT_API_URL=https://msscope-int.azurewebsites.net \
-GITHUB_TOKEN=$(gh auth token) \
-pnpm taxonomy -o taxonomy-int.json
-```
-
-The root `pnpm taxonomy` script proxies to `pnpm --filter taxonomy-handler taxonomy` (i.e. `tsx src/cli.ts`).
-
-| Option | Description |
-| --- | --- |
-| `--run, -r ` | Run id used in the prompt/logging (default: active run resolved from the API) |
-| `--model ` | Override `TAXONOMY_MODEL` (e.g. A/B a reasoning model vs the `gpt-5.4` default) |
-| `--timeout ` | Override `SESSION_TIMEOUT_MS` (per-attempt session timeout) |
-| `--output, -o ` | Output file path (default: `taxonomy-.json` in the cwd) |
-| `--stdout` | Also print the taxonomy JSON to stdout |
-| `--quiet` | Suppress live session-event streaming on stderr |
-Live progress (tool calls, errors, deltas) is written to stderr so the saved JSON file stays clean. The CLI exits non-zero on failure (empty response, JSON/schema validation failure after 3 attempts, timeout, or model rate limit) and surfaces the underlying error message — making it well suited to diagnosing the oversized-`get_atif_trajectory` paging loop and Copilot model rate limits.
+The `iteration` query parameter is mandatory for the ATIF endpoints. ATIF files are also included in archive exports as `iteration-{N}.atif.trajectory.json`.
## Handler Interface
@@ -151,7 +99,7 @@ processor.start();
The post-processor uses a version-based re-processing scheme:
-- Each handler is registered independently in the `services` collection using a `post-process-handler` document keyed by handler ID (for example `pp-atif`, `pp-taxonomy`)
+- Each handler is registered independently in the `services` collection using a `post-process-handler` document keyed by handler ID (for example `pp-atif`)
- Each registration stores the handler `version`, queue name, selector, `autoBackfill` behavior, and `dependsOn` DAG edges
- The scheduler compares each request's per-handler status/version state (for example `run.handlerStatus["pp-atif"]`) against the registered handler entry for that selector
- Requests with missing or outdated handler state are re-dispatched for that specific handler once its dependencies are satisfied
@@ -160,18 +108,17 @@ This allows deploying handler improvements and having them automatically applied
## Handler Registration
-Each post-process handler declares its DAG metadata in a `handler.yaml` file colocated with the worker (e.g. `apps/workers/taxonomy/handler.yaml`). This mirrors the coding-agent `agent.yaml` registration pattern.
+Each post-process handler declares its DAG metadata in a `handler.yaml` file colocated with the worker (e.g. `apps/workers/post-processor/handler.yaml`). This mirrors the coding-agent `agent.yaml` registration pattern.
```yaml
-# apps/workers/taxonomy/handler.yaml
-_id: pp-taxonomy
+# apps/workers/post-processor/handler.yaml
+_id: pp-atif
type: post-process-handler
version: 1
-queue: pp-taxonomy-queue
-selector: taxonomy
-autoBackfill: false
-dependsOn:
- - pp-atif
+queue: post-processor-queue
+selector: atif
+autoBackfill: true
+dependsOn: []
```
On deploy, a generic registration script — `packages/shared/src/scripts/register-handler.ts` — reads the `handler.yaml` pointed to by `HANDLER_YAML_PATH`, waits for the scheduler's `/health`, and POSTs the parsed document to `${SCHEDULER_URL}/handlers/register` (with retry). The scheduler validates the document, runs a cycle check against the existing topology, and upserts it into the `services` collection via `HandlerDispatcher.registerHandler`. **Workers never write to the `services` collection directly** — the scheduler is the sole owner.
@@ -185,8 +132,8 @@ flowchart LR
**Where it runs:**
-- **Docker Compose:** one `register-handler-` init service per handler (`pp-atif`, `pp-taxonomy`) runs the generic script via `tsx`, gated on the scheduler being up. The worker waits for its registration service to complete.
-- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. Only `pp-atif` is registered in K8s today because it is the only post-process handler deployed to the cluster; `pp-taxonomy` is registered in Compose only until the taxonomy worker is deployed to K8s. The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
+- **Docker Compose:** one `register-handler-` init service per handler (e.g. `pp-atif`) runs the generic script via `tsx`, gated on the scheduler being up. The worker waits for its registration service to complete.
+- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. Only `pp-atif` is registered in K8s today because it is the only post-process handler deployed to the cluster. The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
To **add or change a handler**, edit its `handler.yaml` (bump `version`, adjust `dependsOn`, etc.) — no code or migration changes are needed for registration.
@@ -206,7 +153,7 @@ active template's trigger and creates the properly-templated `ReportDocument`(s)
```mermaid
flowchart LR
- RT["run done"] --> DAG["scheduler dispatches DAG (pp-atif → pp-taxonomy)"]
+ RT["run done"] --> DAG["scheduler dispatches DAG (pp-atif → …)"]
DAG -->|"all handlers terminal"| DR{DAG drained?}
DR -->|yes| TRIG["POST /api/v1/reports/trigger { requestId }"]
TRIG --> API["API evaluates each template trigger → ReportDocument + report-queue {reportId}"]
@@ -219,7 +166,7 @@ flowchart LR
registered handler is terminal. A run with **zero** registered handlers is
vacuously drained, so reports trigger immediately on run completion.
-**Trigger regardless of handler success.** A flaky taxonomy must not block report
+**Trigger regardless of handler success.** A flaky handler must not block report
generation (reports analyze the run/ATIF), so the scheduler triggers reports
whenever the DAG drains — not only when every handler succeeded.
@@ -263,20 +210,18 @@ stateDiagram-v2
| Environment Variable | Default | Description |
| --- | --- | --- |
| `AZURE_STORAGE_QUEUE_POSTPROCESSOR` | `post-processor-queue` | Queue name for ATIF post-processor messages |
-| `AZURE_STORAGE_QUEUE_TAXONOMY` | `pp-taxonomy-queue` | Queue name for taxonomy-generation jobs |
| `SCHEDULER_PP_POLL_INTERVAL_MS` | `30000` | Scheduler backfill polling interval |
| `BATCH_SIZE` | `1` | Messages to process per poll (worker-side) |
| `POLL_INTERVAL_MS` | `5000` | Worker queue polling interval |
-| `SCOPE_MT_API_URL` / `API_BASE_URL` | `http://localhost:3001` | API URL used by report/taxonomy Copilot tools |
-| `TAXONOMY_MODEL` | `gpt-5.4` | Copilot SDK model used by the taxonomy handler |
-| `SESSION_TIMEOUT_MS` | `300000` | Timeout for report/taxonomy Copilot SDK sessions |
+| `SCOPE_MT_API_URL` / `API_BASE_URL` | `http://localhost:3001` | API URL used by report Copilot tools |
+| `SESSION_TIMEOUT_MS` | `300000` | Timeout for report Copilot SDK sessions |
| `SCHEDULER_URL` | _(unset)_ | Scheduler base URL — used by handlers to notify completion and by the register-handler script to reach `/handlers/register` |
| `API_URL` | `http://api:80` | API base URL the **scheduler** uses to call `POST /api/v1/reports/trigger` when a run's handler DAG drains |
| `HANDLER_YAML_PATH` | _(unset)_ | Path to a handler's `handler.yaml`, read by the generic `register-handler` script |
## Infrastructure
-- **Queues:** Azure Storage Queues (`post-processor-queue` for ATIF, `pp-taxonomy-queue` for taxonomy, `report-queue` for reports)
+- **Queues:** Azure Storage Queues (`post-processor-queue` for ATIF, `report-queue` for reports)
- **Blob Storage:** `snapshots` container (shared with HAR, tool-calls, and other artifacts)
- **Database:** MongoDB `requests` collection (`run.handlerStatus` map keyed by handler ID, with deprecated `run.postProcessorStatus` / `run.postProcessorVersion` compatibility fields during migration)
- **KEDA:** ScaledObject scales the worker to zero when queue is empty
diff --git a/package.json b/package.json
index 2905d5efc..46b946a51 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,6 @@
"dev:coder-acp-claude-code": "pnpm --filter coder-acp-claude-code dev",
"dev:coder-acp-copilot": "pnpm --filter coder-acp-copilot dev",
"dev:report-generator": "pnpm --filter report-generator dev",
- "taxonomy": "pnpm --filter taxonomy-handler taxonomy",
"docker:up": "scripts/worktree-env.sh && scripts/dev-compose.sh up --build",
"docker:up:claude-code": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-claude-code/versions.env --profile claude-code --profile report up --build",
"docker:up:copilot": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --profile copilot --profile report up --build",
@@ -26,9 +25,9 @@
"docker:up:portal": "scripts/worktree-env.sh && scripts/dev-compose.sh --profile portal up --build",
"docker:dev": "scripts/worktree-env.sh && COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh -f docker-compose.yml -f docker-compose.dev.yml up --build --watch",
"docker:dev:claude-code": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile report --profile post-processor --profile portal up --build --watch",
- "docker:dev:copilot": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile copilot --profile report --profile post-processor --profile taxonomy --profile portal up --build --watch",
+ "docker:dev:copilot": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile copilot --profile report --profile post-processor --profile portal up --build --watch",
"docker:dev:portal": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh -f docker-compose.yml -f docker-compose.dev.yml --profile portal up --build --watch",
- "docker:dev:all": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile copilot --profile report --profile post-processor --profile taxonomy --profile portal up --build --watch",
+ "docker:dev:all": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) COMPOSE_EXPERIMENTAL_WATCH_POLL=1 scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile copilot --profile report --profile post-processor --profile portal up --build --watch",
"docker:dev:build": "scripts/worktree-env.sh && GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env -f docker-compose.yml -f docker-compose.dev.yml --profile claude-code --profile copilot --profile report --profile portal build",
"docker:down": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env --profile claude-code --profile copilot --profile report --profile portal down --volumes",
"docker:build": "scripts/worktree-env.sh && scripts/dev-compose.sh --env-file .env --env-file apps/workers/coder-acp-copilot/versions.env --env-file apps/workers/coder-acp-claude-code/versions.env --profile claude-code --profile copilot --profile report build",
diff --git a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
index bcb3b3ade..6d2aa2c94 100644
--- a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
+++ b/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
@@ -7,7 +7,7 @@ import type { MigrationInterface } from "mongo-migrate-ts";
/**
* Migration 018: Remove the legacy "post-processor" service entry.
*
- * Handler service registration (pp-atif, pp-taxonomy) is now owned
+ * Handler service registration (e.g. pp-atif) is now owned
* by each worker's handler.yaml + the generic register-handler script,
* which POSTs to the scheduler's POST /handlers/register endpoint on deploy.
* Reports are not a DAG handler — the scheduler triggers report generation
diff --git a/packages/db-migrations/src/migrations/019-add-handler-status-index.ts b/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
index 577dc8901..ee6e35f95 100644
--- a/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
+++ b/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
@@ -13,14 +13,6 @@ const HANDLER_STATUS_INDEXES = [
updatedAt: -1 as const,
},
},
- {
- name: "idx_handler_dispatch_taxonomy",
- key: {
- "run.handlerStatus.pp-taxonomy.status": 1 as const,
- "run.status": 1 as const,
- updatedAt: -1 as const,
- },
- },
] as const;
export class AddHandlerStatusIndex implements MigrationInterface {
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index e2af74303..392a9cde2 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -21,5 +21,4 @@ export * from "./devproxy/index.js";
export * from "./har/index.js";
export * from "./utils/index.js";
export * from "./schemas/index.js";
-export * from "./schemas/taxonomy.js";
export * from "./cursor.js";
diff --git a/packages/shared/src/schemas/index.ts b/packages/shared/src/schemas/index.ts
index 06332d90d..b64fcee87 100644
--- a/packages/shared/src/schemas/index.ts
+++ b/packages/shared/src/schemas/index.ts
@@ -19,4 +19,3 @@ export * from "./token.js";
export * from "./account.js";
export * from "./feature-flag.js";
export * from "./profile.js";
-export * from "./taxonomy.js";
diff --git a/packages/shared/src/schemas/request.ts b/packages/shared/src/schemas/request.ts
index ea6f3d4da..bdcf6cc88 100644
--- a/packages/shared/src/schemas/request.ts
+++ b/packages/shared/src/schemas/request.ts
@@ -173,7 +173,6 @@ export const RunStateSchema = z
podName: z.string().optional(),
}).optional(),
harUrl: z.string().optional(),
- taxonomyUrl: z.string().optional(),
videoUrls: z.array(z.string()).optional(),
setupVideoUrls: z.array(z.string()).optional(),
tokenUsage: TokenUsageSchema.optional(),
diff --git a/packages/shared/src/schemas/taxonomy.test.ts b/packages/shared/src/schemas/taxonomy.test.ts
deleted file mode 100644
index 320f89ceb..000000000
--- a/packages/shared/src/schemas/taxonomy.test.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import { describe, expect, it } from "vitest";
-import { taxonomySchema } from "./taxonomy.js";
-
-describe("taxonomySchema", () => {
- const validFixture = {
- meta: {
- generatedAt: "2025-02-01T12:00:00Z",
- schemaVersion: "1.0.0",
- runId: "run-123",
- requestId: "req-456",
- },
- scorecard: {
- summary: "The agent usually succeeds but struggles with recovery quality.",
- profileResults: [
- {
- profileId: "profile-best",
- select: "best",
- taskOutcome: "success",
- overallScore: 92,
- dimensions: [
- {
- name: "Correctness",
- score: 95,
- rationale: "Implemented the requested behavior fully.",
- evidence: ["All acceptance criteria passed", "No regressions observed"],
- },
- ],
- },
- ],
- crossProfileInsights: [
- "The agent communicates clearly across profiles.",
- "Stress conditions reduce recovery quality.",
- ],
- },
- behaviorAnalysis: {
- patterns: [
- {
- id: "pattern-1",
- category: "strength",
- title: "Consistent planning",
- description: "The agent outlines a clear plan before making changes.",
- frequency: 0.75,
- impact: "high",
- evidence: [
- {
- runId: "run-123",
- iteration: 1,
- excerpt: "Plan: inspect the failing endpoint, then patch the handler.",
- },
- ],
- },
- ],
- agentPersonality: {
- communicationStyle: "Concise and structured",
- problemSolvingApproach: "Hypothesis-driven debugging",
- errorRecoveryBehavior: "Retries with targeted fixes after inspecting evidence",
- },
- },
- actionList: {
- fix: [
- {
- id: "action-1",
- title: "Stabilize recovery prompts",
- priority: "critical",
- description: "Reduce failures when the first attempt is rejected.",
- ownership: "prompt-engineer",
- relatedPatterns: ["pattern-1"],
- suggestedApproach: "Add explicit fallback guidance for failed first passes.",
- },
- ],
- improve: [
- {
- id: "action-2",
- title: "Expand planning examples",
- priority: "medium",
- description: "Reinforce successful planning behavior.",
- ownership: "agent-team",
- relatedPatterns: ["pattern-1"],
- suggestedApproach: "Fine-tune on traces with strong upfront decomposition.",
- },
- ],
- investigate: [
- {
- id: "action-3",
- title: "Review profile variance",
- priority: "low",
- description: "Understand why profile-specific regressions appear sporadically.",
- ownership: "scenario-author",
- relatedPatterns: ["pattern-1"],
- suggestedApproach: "Compare scenario wording against affected profile runs.",
- },
- ],
- },
- };
-
- it("accepts a valid taxonomy fixture", () => {
- const result = taxonomySchema.safeParse(validFixture);
- expect(result.success).toBe(true);
- });
-
- it("rejects fixtures missing required fields with precise paths", () => {
- const invalidFixture = {
- ...validFixture,
- scorecard: {
- ...validFixture.scorecard,
- profileResults: [
- {
- ...validFixture.scorecard.profileResults[0],
- dimensions: [
- {
- name: "Correctness",
- score: 95,
- evidence: ["All acceptance criteria passed"],
- },
- ],
- },
- ],
- },
- behaviorAnalysis: {
- ...validFixture.behaviorAnalysis,
- agentPersonality: {
- communicationStyle: "Concise and structured",
- errorRecoveryBehavior: "Retries with targeted fixes after inspecting evidence",
- },
- },
- };
-
- const result = taxonomySchema.safeParse(invalidFixture);
- expect(result.success).toBe(false);
- if (result.success) {
- throw new Error("Expected invalid taxonomy fixture to fail parsing");
- }
-
- const issuePaths = result.error.issues.map((issue) => issue.path);
- expect(issuePaths).toContainEqual([
- "scorecard",
- "profileResults",
- 0,
- "dimensions",
- 0,
- "rationale",
- ]);
- expect(issuePaths).toContainEqual([
- "behaviorAnalysis",
- "agentPersonality",
- "problemSolvingApproach",
- ]);
- });
-
- it("enforces enum values", () => {
- const invalidFixture = {
- ...validFixture,
- actionList: {
- ...validFixture.actionList,
- fix: [
- {
- ...validFixture.actionList.fix[0],
- priority: "urgent",
- },
- ],
- },
- };
-
- const result = taxonomySchema.safeParse(invalidFixture);
- expect(result.success).toBe(false);
- if (result.success) {
- throw new Error("Expected invalid enum fixture to fail parsing");
- }
-
- expect(result.error.issues.map((issue) => issue.path)).toContainEqual([
- "actionList",
- "fix",
- 0,
- "priority",
- ]);
- });
-});
diff --git a/packages/shared/src/schemas/taxonomy.ts b/packages/shared/src/schemas/taxonomy.ts
deleted file mode 100644
index a837d4f91..000000000
--- a/packages/shared/src/schemas/taxonomy.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) Microsoft Corporation.
-// Licensed under the MIT License.
-
-import { z } from "zod";
-
-const scoreSchema = z.number().min(0).max(100);
-const frequencySchema = z.number().min(0).max(1);
-
-/** Taxonomy document metadata. */
-export const taxonomyMetaSchema = z.object({
- generatedAt: z.string().datetime({ offset: true }),
- schemaVersion: z.string().min(1),
- runId: z.string().min(1),
- requestId: z.string().min(1),
-});
-
-/** Scorecard dimension result for a single profile. */
-export const scorecardDimensionSchema = z.object({
- name: z.string().min(1),
- score: scoreSchema,
- rationale: z.string().min(1),
- evidence: z.array(z.string().min(1)),
-});
-
-/** Scorecard result for a specific profile slice. */
-export const profileResultSchema = z.object({
- profileId: z.string().min(1),
- select: z.enum(["best", "median", "worst"]),
- taskOutcome: z.enum(["success", "partial", "failure"]),
- overallScore: scoreSchema,
- dimensions: z.array(scorecardDimensionSchema),
-});
-
-/** Top-level scorecard section summarizing profile results. */
-export const scorecardSchema = z.object({
- summary: z.string().min(1),
- profileResults: z.array(profileResultSchema),
- crossProfileInsights: z.array(z.string().min(1)),
-});
-
-/** Evidence excerpt supporting an observed behavior pattern. */
-export const behaviorEvidenceSchema = z.object({
- runId: z.string().min(1),
- iteration: z.number().int().min(0),
- excerpt: z.string().min(1),
-});
-
-/** Cross-run behavioral pattern identified by the taxonomy analysis. */
-export const behaviorPatternSchema = z.object({
- id: z.string().min(1),
- category: z.enum(["strength", "weakness", "inconsistency", "regression"]),
- title: z.string().min(1),
- description: z.string().min(1),
- frequency: frequencySchema,
- impact: z.enum(["critical", "high", "medium", "low"]),
- evidence: z.array(behaviorEvidenceSchema),
-});
-
-/** Qualitative description of the agent's personality traits. */
-export const agentPersonalitySchema = z.object({
- communicationStyle: z.string().min(1),
- problemSolvingApproach: z.string().min(1),
- errorRecoveryBehavior: z.string().min(1),
-});
-
-/** Behavior analysis section describing patterns and personality. */
-export const behaviorAnalysisSchema = z.object({
- patterns: z.array(behaviorPatternSchema),
- agentPersonality: agentPersonalitySchema,
-});
-
-/** Action item emitted by the taxonomy analysis. */
-export const actionItemSchema = z.object({
- id: z.string().min(1),
- title: z.string().min(1),
- priority: z.enum(["critical", "high", "medium", "low"]),
- description: z.string().min(1),
- ownership: z.enum([
- "agent-team",
- "platform-team",
- "prompt-engineer",
- "scenario-author",
- ]),
- relatedPatterns: z.array(z.string().min(1)),
- suggestedApproach: z.string().min(1),
-});
-
-/** Prioritized action lists grouped by remediation intent. */
-export const actionListSchema = z.object({
- fix: z.array(actionItemSchema),
- improve: z.array(actionItemSchema),
- investigate: z.array(actionItemSchema),
-});
-
-/** Complete taxonomy document produced by the taxonomy post-processor. */
-export const taxonomySchema = z.object({
- meta: taxonomyMetaSchema,
- scorecard: scorecardSchema,
- behaviorAnalysis: behaviorAnalysisSchema,
- actionList: actionListSchema,
-});
-
-/** Inferred TypeScript type for the taxonomy document. */
-export type TaxonomyDocument = z.infer;
diff --git a/packages/shared/src/scripts/register-handler.test.ts b/packages/shared/src/scripts/register-handler.test.ts
index 0c3858b58..162916404 100644
--- a/packages/shared/src/scripts/register-handler.test.ts
+++ b/packages/shared/src/scripts/register-handler.test.ts
@@ -6,11 +6,11 @@ import { parseHandlerDocument } from "./register-handler.js";
describe("parseHandlerDocument", () => {
const valid = {
- _id: "pp-taxonomy",
+ _id: "pp-example",
type: "post-process-handler",
version: 1,
- queue: "pp-taxonomy-queue",
- selector: "taxonomy",
+ queue: "pp-example-queue",
+ selector: "example",
autoBackfill: false,
dependsOn: ["pp-atif"],
};
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index 1a176e9c1..374d5b2ca 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -272,14 +272,13 @@ export interface RunState {
podName?: string;
};
harUrl?: string;
- taxonomyUrl?: string;
videoUrls?: string[];
setupVideoUrls?: string[];
tokenUsage?: TokenUsage;
aiCallCount?: number;
rawChatUrl?: string;
rawChatFormat?: string;
- /** Per-handler post-processing status. Keys are handler IDs (e.g. "pp-atif", "pp-taxonomy"). */
+ /** Per-handler post-processing status. Keys are handler IDs (e.g. "pp-atif"). */
handlerStatus?: Record;
/** Set once the scheduler has triggered report generation for this run after
* the handler DAG drained (every handler reached a terminal state). Acts as
@@ -329,7 +328,6 @@ export const RUN_STATE_FIELD_NAMES = [
"lastHeartbeatAt",
"worker",
"harUrl",
- "taxonomyUrl",
"videoUrls",
"setupVideoUrls",
"tokenUsage",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a7903fc00..339c191ba 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -705,31 +705,6 @@ importers:
specifier: ^5.6.2
version: 5.9.3
- apps/workers/taxonomy:
- dependencies:
- '@azure/storage-queue':
- specifier: ^12.25.0
- version: 12.29.0
- '@github/copilot-sdk':
- specifier: ^0.1.17
- version: 0.1.23
- dotenv:
- specifier: ^16.4.5
- version: 16.6.1
- shared:
- specifier: workspace:*
- version: link:../../../packages/shared
- devDependencies:
- '@types/node':
- specifier: ^22.7.0
- version: 22.19.10
- tsx:
- specifier: ^4.19.0
- version: 4.21.0
- typescript:
- specifier: ^5.6.2
- version: 5.9.3
-
packages/copilot-driver-ext:
devDependencies:
'@types/node':
From 1fb829c008fadb5fa02f4662d4be328d0a930083 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Sun, 28 Jun 2026 19:16:42 -0700
Subject: [PATCH 025/287] feat(observations): observation criteria +
pp-taxonomy handler, CLI, config, docs
Add kind:gate|observation discriminator + hard-coded taxonomyElementId to
criteria; record-only per-iteration boolean observations evaluated post-run by
the pp-taxonomy handler (reuses judge via JudgeClient, dependsOn pp-atif) and
stored as turn.observationResults. Request-level opt-in via observations[].
CLI, migration 021, deploy wiring, config seeds, and docs included.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
ENV_VARIABLES.md | 8 +-
README.md | 1 +
.../openapi-snapshot.test.ts.snap | 93 ++++++++++++++++
apps/api/src/endpoints.test.ts | 28 +++++
apps/api/src/routes/criteria.ts | 16 ++-
apps/api/src/routes/requests/index.ts | 51 ++++++++-
.../__snapshots__/cli-commands.test.ts.snap | 5 +
apps/cli/src/commands/criteria.ts | 36 ++++++-
apps/cli/src/commands/run.ts | 7 +-
apps/cli/src/run-get-action.ts | 45 +++++++-
apps/cli/src/utils/yaml-mappers.ts | 9 +-
apps/judge/src/index.ts | 27 ++++-
.../post-processor/handler.taxonomy.yaml | 17 +++
.../src/handlers/taxonomy-handler.test.ts | 80 ++++++++++++++
.../src/handlers/taxonomy-handler.ts | 90 ++++++++++++++++
apps/workers/post-processor/src/index.ts | 2 +
.../criteria/auth_configured_correctly.yaml | 8 ++
.../dependency_added_then_removed.yaml | 9 ++
config/criteria/idiomatic_api_usage.yaml | 8 ++
docker-compose.dev.yml | 4 +
docker-compose.yml | 19 ++++
docs/architecture/app-design.md | 7 +-
docs/architecture/criteria-provider.md | 4 +
docs/architecture/overview.md | 1 +
docs/architecture/post-processing.md | 21 +++-
.../migrations/021-backfill-criteria-kind.ts | 47 ++++++++
.../db-migrations/src/required-migrations.ts | 1 +
.../src/criteria/criteria-provider-api.ts | 4 +
.../src/criteria/criteria-provider-fs.ts | 13 +++
.../src/criteria/criteria-store.test.ts | 59 +++++++++++
.../shared/src/criteria/criteria-store.ts | 100 +++++++++++++++++-
packages/shared/src/criteria/index.ts | 1 +
.../src/criteria/observation-taxonomy.ts | 43 ++++++++
packages/shared/src/judge/judge-client.ts | 4 +
packages/shared/src/schemas/criteria.ts | 12 ++-
packages/shared/src/schemas/request.ts | 3 +
packages/shared/src/schemas/schemas.test.ts | 27 +++++
packages/shared/src/storage/blob-storage.ts | 23 ++++
packages/shared/src/types/types.ts | 54 ++++++++++
39 files changed, 964 insertions(+), 23 deletions(-)
create mode 100644 apps/workers/post-processor/handler.taxonomy.yaml
create mode 100644 apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
create mode 100644 apps/workers/post-processor/src/handlers/taxonomy-handler.ts
create mode 100644 config/criteria/auth_configured_correctly.yaml
create mode 100644 config/criteria/dependency_added_then_removed.yaml
create mode 100644 config/criteria/idiomatic_api_usage.yaml
create mode 100644 packages/db-migrations/src/migrations/021-backfill-criteria-kind.ts
create mode 100644 packages/shared/src/criteria/observation-taxonomy.ts
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index ec5d268e1..3001c4b16 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -341,7 +341,13 @@ How often the post-processor dispatcher polls for completed runs needing post-pr
**Default:** `post-processor-queue`
**Type:** string
-Azure Storage Queue name used by both the scheduler (to enqueue post-processing work) and the post-processor worker (to dequeue). Must match between the two services.
+Azure Storage Queue name used by both the scheduler (to enqueue post-processing work) and the post-processor worker (to dequeue). Must match between the two services. The `pp-taxonomy` observation handler shares this queue.
+
+### JUDGE_URL
+**Default:** falls back to `JUDGE_SERVICE_URL`, then `http://localhost:3002`
+**Type:** URL string
+
+Base URL of the judge service used by the `pp-taxonomy` post-process handler to evaluate observation criteria per iteration (snapshot + ATIF trajectory → boolean + evidence). The handler reuses the shared `JudgeClient`, so `JUDGE_CLIENT_TIMEOUT` / `JUDGE_CLIENT_RETRIES` apply. In Docker/K8s the worker reads `JUDGE_SERVICE_URL` from `worker-config`; no extra var needed. See issue #1156 and [docs/architecture/post-processing.md](docs/architecture/post-processing.md).
### SCHEDULER_URL
**Default:** (not set)
diff --git a/README.md b/README.md
index 38c22b8dd..e8df7301b 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,7 @@
| **coder-acp-copilot** | GitHub Copilot agent worker (ACP SDK) |
| **coder-acp-claude-code** | Claude Code agent worker (ACP SDK) |
| **report-generator** | Post-run evaluation report generator (Copilot SDK) |
+| **post-processor** | DAG post-run handlers: `pp-atif` (ATIF trajectory) + `pp-taxonomy` (boolean observations via judge) |
| **model-scanners** | Feature detection for Copilot and Anthropic models |
| **version-checkers** | Poll for new releases of agents/tools (`acp-copilot`, `claude-code`, `vscode-electron`) |
diff --git a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
index d99d079de..3d5d038c9 100644
--- a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
+++ b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
@@ -512,6 +512,12 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"judgeFeedback": {
"type": "string",
},
+ "observationResults": {
+ "items": {
+ "$ref": "#/components/schemas/CriterionResult",
+ },
+ "type": "array",
+ },
"passed": {
"type": "boolean",
},
@@ -653,9 +659,25 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"pattern": "^[a-z][a-z0-9_]*$",
"type": "string",
},
+ "kind": {
+ "default": "gate",
+ "enum": [
+ "gate",
+ "observation",
+ ],
+ "type": "string",
+ },
"prompt": {
"type": "string",
},
+ "taxonomyElementId": {
+ "enum": [
+ "dimension:idiomatic-use",
+ "dimension:dependency-currency",
+ "dimension:configuration-correctness",
+ ],
+ "type": "string",
+ },
},
"required": [
"id",
@@ -873,6 +895,12 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"model": {
"type": "string",
},
+ "observations": {
+ "items": {
+ "type": "string",
+ },
+ "type": "array",
+ },
"persona": {
"$ref": "#/components/schemas/Persona",
},
@@ -1020,9 +1048,24 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"id": {
"type": "string",
},
+ "kind": {
+ "enum": [
+ "gate",
+ "observation",
+ ],
+ "type": "string",
+ },
"prompt": {
"type": "string",
},
+ "taxonomyElementId": {
+ "enum": [
+ "dimension:idiomatic-use",
+ "dimension:dependency-currency",
+ "dimension:configuration-correctness",
+ ],
+ "type": "string",
+ },
},
"required": [
"id",
@@ -1068,9 +1111,24 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"id": {
"type": "string",
},
+ "kind": {
+ "enum": [
+ "gate",
+ "observation",
+ ],
+ "type": "string",
+ },
"prompt": {
"type": "string",
},
+ "taxonomyElementId": {
+ "enum": [
+ "dimension:idiomatic-use",
+ "dimension:dependency-currency",
+ "dimension:configuration-correctness",
+ ],
+ "type": "string",
+ },
"updatedAt": {
"format": "date-time",
"type": [
@@ -2430,6 +2488,12 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"model": {
"type": "string",
},
+ "observations": {
+ "items": {
+ "type": "string",
+ },
+ "type": "array",
+ },
"persona": {
"$ref": "#/components/schemas/Persona",
},
@@ -3087,9 +3151,24 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
},
"type": "array",
},
+ "kind": {
+ "enum": [
+ "gate",
+ "observation",
+ ],
+ "type": "string",
+ },
"prompt": {
"type": "string",
},
+ "taxonomyElementId": {
+ "enum": [
+ "dimension:idiomatic-use",
+ "dimension:dependency-currency",
+ "dimension:configuration-correctness",
+ ],
+ "type": "string",
+ },
},
"type": "object",
},
@@ -4132,6 +4211,20 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"type": "string",
},
},
+ {
+ "description": "Filter by criterion kind",
+ "in": "query",
+ "name": "kind",
+ "required": false,
+ "schema": {
+ "description": "Filter by criterion kind",
+ "enum": [
+ "gate",
+ "observation",
+ ],
+ "type": "string",
+ },
+ },
],
"responses": {
"200": {
diff --git a/apps/api/src/endpoints.test.ts b/apps/api/src/endpoints.test.ts
index 0cabc44eb..34a89df39 100644
--- a/apps/api/src/endpoints.test.ts
+++ b/apps/api/src/endpoints.test.ts
@@ -192,6 +192,34 @@ describe("API Endpoints", () => {
expect(res.status).toBe(400);
});
+
+ it("creates an observation criterion with a taxonomy element", async () => {
+ (mocks.criteriaCollection.findOne as any).mockResolvedValue(null);
+
+ const res = await request(app)
+ .post("/api/v1/criteria")
+ .send({
+ id: "obs_crit",
+ prompt: "Did the agent use current deps?",
+ dependsOn: [],
+ kind: "observation",
+ taxonomyElementId: "dimension:dependency-currency",
+ });
+
+ expect(res.status).toBe(201);
+ expect(res.body).toHaveProperty("kind", "observation");
+ expect(res.body).toHaveProperty("taxonomyElementId", "dimension:dependency-currency");
+ });
+
+ it("rejects an unknown taxonomyElementId", async () => {
+ (mocks.criteriaCollection.findOne as any).mockResolvedValue(null);
+
+ const res = await request(app)
+ .post("/api/v1/criteria")
+ .send({ id: "bad_tax", prompt: "x", dependsOn: [], kind: "observation", taxonomyElementId: "dimension:nope" });
+
+ expect(res.status).toBe(400);
+ });
});
describe("POST /api/v1/criteria/seed", () => {
diff --git a/apps/api/src/routes/criteria.ts b/apps/api/src/routes/criteria.ts
index 3d1279a9f..40aee5d0c 100644
--- a/apps/api/src/routes/criteria.ts
+++ b/apps/api/src/routes/criteria.ts
@@ -210,11 +210,13 @@ apiRoute(ctx.app, ctx.registry, {
q: z.string().optional(),
ids: z.string().optional().describe("Comma-separated criterion IDs to include"),
ancestors: z.enum(["true", "false"]).optional().describe("When true and ids is set, also include dependency ancestors"),
+ kind: z.enum(["gate", "observation"]).optional().describe("Filter by criterion kind"),
}),
response: z.array(CriteriaResponseSchema),
handler: async (req, res) => {
const q = req.query.q;
const idsParam = req.query.ids;
+ const kind = req.query.kind;
// `q` (regex search) and `ids` (exact set + optional ancestor resolution)
// are mutually exclusive: applying the regex filter first would silently
@@ -231,6 +233,12 @@ apiRoute(ctx.app, ctx.registry, {
{ prompt: { $regex: q, $options: "i" } },
];
}
+ // kind:"gate" includes legacy rows where kind is absent (backfilled to gate).
+ if (kind === "gate") {
+ filter.$and = [{ $or: [{ kind: "gate" }, { kind: { $exists: false } }] }];
+ } else if (kind === "observation") {
+ filter.kind = "observation";
+ }
let criteria = await ctx.criteriaCollection.find(filter).toArray();
criteria.sort((a, b) => a.id.localeCompare(b.id));
@@ -419,9 +427,9 @@ apiRoute(ctx.app, ctx.registry, {
409: { description: "Criterion already exists" },
},
handler: async (req, res) => {
- const { id, prompt, dependsOn = [], gates } = req.body;
+ const { id, prompt, dependsOn = [], gates, kind, taxonomyElementId } = req.body;
try {
- const doc = await getCriteriaStore().create({ id, prompt, dependsOn, gates });
+ const doc = await getCriteriaStore().create({ id, prompt, dependsOn, gates, kind, taxonomyElementId });
res.status(201).json(doc);
} catch (err) {
if (!sendStoreError(res, err)) throw err;
@@ -444,9 +452,9 @@ apiRoute(ctx.app, ctx.registry, {
},
handler: async (req, res) => {
const { id } = req.params;
- const { prompt, dependsOn, gates } = req.body;
+ const { prompt, dependsOn, gates, kind, taxonomyElementId } = req.body;
try {
- const updated = await getCriteriaStore().update(id, { prompt, dependsOn, gates });
+ const updated = await getCriteriaStore().update(id, { prompt, dependsOn, gates, kind, taxonomyElementId });
res.json(updated);
} catch (err) {
if (!sendStoreError(res, err)) throw err;
diff --git a/apps/api/src/routes/requests/index.ts b/apps/api/src/routes/requests/index.ts
index b6fcd4b1d..143735329 100644
--- a/apps/api/src/routes/requests/index.ts
+++ b/apps/api/src/routes/requests/index.ts
@@ -95,6 +95,9 @@ async function validateGatesForSubmit(
if (!doc) {
return `Gate '${gc.gate}' references unknown criterion '${cid}'.`;
}
+ if ((doc.kind ?? "gate") !== "gate") {
+ return `Criterion '${cid}' is an observation and cannot be used as a gate criterion.`;
+ }
if (!isCriterionCompatibleWithGate(doc.gates as GateId[] | undefined, gc.gate)) {
return `Criterion '${cid}' is not compatible with the '${gc.gate}' gate.`;
}
@@ -122,7 +125,32 @@ async function validateGatesForSubmit(
}
/**
- * Materialize free-text gate prompts into typed prompt entities (docs/design/
+ * Validate the submit payload's observation-criteria ids: each must be an
+ * active kind:"observation" criterion. Gate ids are rejected. Empty/absent is
+ * valid (no observations evaluated). See issue #1156.
+ */
+async function validateObservationsForSubmit(
+ ctx: RouteContext,
+ observations: string[],
+): Promise {
+ if (observations.length === 0) return null;
+ const ids = [...new Set(observations)];
+ const docs = await ctx.criteriaCollection
+ .find({ id: { $in: ids }, deletedAt: { $exists: false } })
+ .toArray();
+ const byId = new Map(docs.map((c) => [c.id, c]));
+ for (const id of ids) {
+ const doc = byId.get(id);
+ if (!doc) return `Observation references unknown criterion '${id}'.`;
+ if ((doc.kind ?? "gate") !== "observation") {
+ return `Criterion '${id}' is a gate and cannot be used as an observation.`;
+ }
+ }
+ return null;
+}
+
+/**
+ * Resolve free-text gate prompts into typed prompt entities before validation (see
* gates.md §4.3/§4.4). For every non-Select gate that supplies `promptText`, the
* text is content-addressed via `taskPromptStore.findOrCreate(text, gate)` —
* idempotent and parallel to how the request task prompt is materialized — and
@@ -168,7 +196,7 @@ apiRoute(ctx.app, ctx.registry, {
response: z.union([RequestResponseSchema, z.array(RequestResponseSchema)]),
successStatus: 201,
handler: async (req, res) => {
- const { scenario: scenarioObj, persona: personaObj, maxIterations, personaInstructions, count = 1, promptFeatureExtractionId, model: requestedModel, reasoningEffort: requestedReasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion: requestedAgentVersion, profileId: requestedProfileSpec, profileVariations, priority: requestedPriority, gates: requestedGates, codebase: codebaseSpec, codebaseRevisionId: requestedCodebaseRevisionId } = req.body;
+ const { scenario: scenarioObj, persona: personaObj, maxIterations, personaInstructions, count = 1, promptFeatureExtractionId, model: requestedModel, reasoningEffort: requestedReasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion: requestedAgentVersion, profileId: requestedProfileSpec, profileVariations, priority: requestedPriority, gates: requestedGates, observations: requestedObservations, codebase: codebaseSpec, codebaseRevisionId: requestedCodebaseRevisionId } = req.body;
let worker = req.query.worker as string | undefined;
// Resolve the optional per-run codebase selection into a concrete revision id.
@@ -677,6 +705,17 @@ apiRoute(ctx.app, ctx.registry, {
}
}
+ // Validate the optional observation-criteria selection (issue #1156).
+ const observationsProvided = Array.isArray(requestedObservations) && requestedObservations.length > 0;
+ const resolvedObservations: string[] = observationsProvided ? (requestedObservations as string[]) : [];
+ if (observationsProvided) {
+ const obsError = await validateObservationsForSubmit(ctx, resolvedObservations);
+ if (obsError) {
+ res.status(400).json({ error: obsError });
+ return;
+ }
+ }
+
// Validate count if provided
if (typeof count !== "number" || count < 1 || count > 10) {
res.status(400).json({ error: "count must be a number between 1 and 10" });
@@ -887,6 +926,12 @@ apiRoute(ctx.app, ctx.registry, {
)
: undefined;
+ // Persisted observation-criteria selection (issue #1156); deduped, evaluated
+ // by the pp-taxonomy post-processor. Absent/empty = no observations evaluated.
+ const persistedObservations: string[] | undefined = observationsProvided
+ ? [...new Set(resolvedObservations)]
+ : undefined;
+
// Generate a submission ID to group all runs from this request
const submissionId = uuidv4();
@@ -921,6 +966,7 @@ apiRoute(ctx.app, ctx.registry, {
...(profileId ? { profileId } : {}),
...(profileVersionId ? { profileVersionId } : {}),
...(persistedGates ? { gates: persistedGates } : {}),
+ ...(persistedObservations ? { observations: persistedObservations } : {}),
submissionId,
// Mint a distinct run id for the first attempt. Blob artifacts
// are scoped under `{requestId}/runs/{runId}/...` so retries
@@ -981,6 +1027,7 @@ apiRoute(ctx.app, ctx.registry, {
...(profileId ? { profileId } : {}),
...(profileVersionId ? { profileVersionId } : {}),
...(persistedGates ? { gates: persistedGates } : {}),
+ ...(persistedObservations ? { observations: persistedObservations } : {}),
submissionId,
// Mint a distinct run id for the first attempt. Blob artifacts
// are scoped under `{requestId}/runs/{runId}/...` so retries
diff --git a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
index 065ced3aa..f22265fbc 100644
--- a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
+++ b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
@@ -131,7 +131,9 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--depends-on",
"--gates",
"--id",
+ "--kind",
"--prompt",
+ "--taxonomy",
"--url",
],
},
@@ -179,7 +181,9 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--depends-on",
"--gates",
"--id",
+ "--kind",
"--prompt",
+ "--taxonomy",
"--url",
],
},
@@ -661,6 +665,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--message",
"--model",
"--no-stream",
+ "--observations",
"--persona",
"--profile",
"--profile-variations-file",
diff --git a/apps/cli/src/commands/criteria.ts b/apps/cli/src/commands/criteria.ts
index 17d181422..7e890f9ac 100644
--- a/apps/cli/src/commands/criteria.ts
+++ b/apps/cli/src/commands/criteria.ts
@@ -46,7 +46,7 @@ criteria
process.exit(1);
}
- const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[] }>;
+ const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string }>;
if (items.length === 0) {
if (!isMachineReadable(format)) console.log(warnBanner("No criteria found."));
return;
@@ -60,6 +60,7 @@ criteria
{ key: 'id', label: 'ID',
tableFormatter: (c: any) => value(c.id),
},
+ { key: 'kind', label: 'Kind', formatter: (c: any) => c.kind ?? 'gate' },
{ key: 'dependsOn', label: 'Deps', formatter: (c: any) => String((c.dependsOn ?? []).length) },
{ key: 'gates', label: 'Gates', formatter: (c: any) => formatGateList(c.gates) },
{ key: 'prompt', label: 'Prompt', tableFormatter: (c: any) => {
@@ -96,6 +97,7 @@ criteria
const c = await response.json() as {
id: string; prompt: string; dependsOn?: string[]; gates?: GateId[];
+ kind?: string; taxonomyElementId?: string;
dependents: string[]; createdAt: string; updatedAt?: string;
};
@@ -103,6 +105,8 @@ criteria
const fields: DisplayField[] = [
{ key: 'id', label: 'ID' },
{ key: 'prompt', label: 'Prompt' },
+ { key: 'kind', label: 'Kind', formatter: (item: any) => item.kind ?? 'gate' },
+ { key: 'taxonomyElementId', label: 'Taxonomy', formatter: (item: any) => item.taxonomyElementId ?? '(none)' },
{ key: 'dependsOn', label: 'Depends On', formatter: (item: any) => (item.dependsOn ?? []).join(', ') || '(none)' },
{ key: 'gates', label: 'Gates', formatter: (item: any) => formatGateList(item.gates) },
{ key: 'dependents', label: 'Dependents', formatter: (item: any) => (item.dependents ?? []).join(', ') || '(none)' },
@@ -124,6 +128,10 @@ criteria
console.log(`${label('Depends on:')} ${dimTimestamp('(none — root criterion)')}`);
}
console.log(`${label('Gates:')} ${value(formatGateList(c.gates))}`);
+ console.log(`${label('Kind:')} ${value(c.kind ?? 'gate')}`);
+ if (c.taxonomyElementId) {
+ console.log(`${label('Taxonomy:')} ${value(c.taxonomyElementId)}`);
+ }
if (c.dependents.length > 0) {
console.log(`${label('Dependents:')} ${c.dependents.map(d => value(d)).join(', ')}`);
}
@@ -142,6 +150,8 @@ criteria
.requiredOption("--prompt ", "Evaluation prompt for the judge")
.option("-d, --depends-on ", "IDs of parent criteria")
.option("--gates ", "Compatible gates (space/comma separated), or all/* for unrestricted")
+ .option("--kind ", "Criterion kind: gate (default) or observation")
+ .option("--taxonomy ", "Taxonomy element id (observation only), e.g. dimension:dependency-currency")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.action(async (options) => {
try {
@@ -154,6 +164,8 @@ criteria
}
const gates = parseGateListOption(options.gates);
if (gates !== undefined) body.gates = gates;
+ if (options.kind) body.kind = options.kind;
+ if (options.taxonomy) body.taxonomyElementId = options.taxonomy;
const response = await fetch(`${normalizeUrl(options.url)}/api/v1/criteria`, {
method: "POST",
@@ -182,6 +194,8 @@ criteria
.option("--prompt ", "New evaluation prompt")
.option("-d, --depends-on ", "New parent criteria IDs (replaces all)")
.option("--gates ", "New compatible gates (space/comma separated), or all/* for unrestricted")
+ .option("--kind ", "Criterion kind: gate or observation")
+ .option("--taxonomy ", "Taxonomy element id (observation only)")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.action(async (options) => {
try {
@@ -190,9 +204,11 @@ criteria
if (options.dependsOn !== undefined) body.dependsOn = options.dependsOn;
const gates = parseGateListOption(options.gates);
if (gates !== undefined) body.gates = gates;
+ if (options.kind) body.kind = options.kind;
+ if (options.taxonomy) body.taxonomyElementId = options.taxonomy;
if (Object.keys(body).length === 0) {
- console.error(errorText("Error: provide --prompt, --depends-on, and/or --gates"));
+ console.error(errorText("Error: provide --prompt, --depends-on, --gates, --kind, and/or --taxonomy"));
process.exit(1);
}
@@ -347,7 +363,7 @@ criteria
process.exit(1);
}
- const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[] }>;
+ const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string }>;
if (items.length === 0) {
console.error(errorText("No criteria found to export."));
@@ -383,6 +399,15 @@ criteria
if (c.dependsOn && c.dependsOn.length > 0) {
doc.depends_on = c.dependsOn;
}
+ if (c.gates && c.gates.length > 0) {
+ doc.gates = c.gates;
+ }
+ if (c.kind && c.kind !== 'gate') {
+ doc.kind = c.kind;
+ }
+ if (c.taxonomyElementId) {
+ doc.taxonomy_element_id = c.taxonomyElementId;
+ }
return doc;
});
@@ -435,7 +460,7 @@ criteria
}
// Parse all criteria from files (supports multi-document YAML)
- const allCriteria: Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[] }> = [];
+ const allCriteria: Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string }> = [];
const parseErrors: string[] = [];
for (const file of yamlFiles) {
@@ -480,7 +505,8 @@ criteria
const deps = (c.dependsOn ?? []).length;
const depsStr = deps > 0 ? ` ${dimTimestamp(`(${deps} dep${deps > 1 ? 's' : ''})`)}` : '';
const gatesStr = c.gates ? ` ${dimTimestamp(`[${formatGateList(c.gates)}]`)}` : '';
- console.log(` ${value(c.id)}${depsStr}${gatesStr}`);
+ const kindStr = c.kind === 'observation' ? ` ${dimTimestamp(``)}` : '';
+ console.log(` ${value(c.id)}${depsStr}${gatesStr}${kindStr}`);
}
if (options.dryRun) {
diff --git a/apps/cli/src/commands/run.ts b/apps/cli/src/commands/run.ts
index 7da9840ea..605460817 100644
--- a/apps/cli/src/commands/run.ts
+++ b/apps/cli/src/commands/run.ts
@@ -49,10 +49,11 @@ run
.addOption(new Option("--base-profile ", "Deprecated alias for --profile.").hideHelp())
.option("--profile-variations-file ", "Path to JSON file containing profile variation entries")
.option("--gates ", "GateConfig[] JSON or path/@path to a JSON file for gated runs")
+ .option("--observations ", "Observation criteria ids to record post-run (non-gating)")
.option("-u, --url ", "API base URL", process.env.SCOPE_API_URL || "http://localhost:3100")
.option("--no-stream", "Don't stream logs, just submit")
.action(async (options, command) => {
- const { scenario, persona, traits, worker, url, stream, maxIterations, model, reasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, codebase: codebaseRef, extensions: extensionIds, agentVersion, profile, baseProfile, profileVariationsFile, gates: gatesOption } = options;
+ const { scenario, persona, traits, worker, url, stream, maxIterations, model, reasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, codebase: codebaseRef, extensions: extensionIds, agentVersion, profile, baseProfile, profileVariationsFile, gates: gatesOption, observations: observationIds } = options;
// `--profile` is the documented flag; `--base-profile` is kept as a hidden
// back-compat alias. Both resolve to the same request `profileId`.
const profileId = profile ?? baseProfile;
@@ -127,6 +128,9 @@ run
if (gatesOption) {
body.gates = parseGatesOption(gatesOption, maxIterations);
}
+ if (observationIds && observationIds.length > 0) {
+ body.observations = observationIds;
+ }
if (profileVariationsFile) {
if (!profileId) {
@@ -176,6 +180,7 @@ run
if (result.reasoningEffort) console.log(`${label('Reasoning Effort:')} ${value(result.reasoningEffort)}`);
console.log(`${label('Mode:')} ${value(result.mode || 'one-shot')}`);
if (Array.isArray(body.gates)) console.log(`${label('Gates:')} ${value(String(body.gates.length))}`);
+ if (Array.isArray(body.observations)) console.log(`${label('Observations:')} ${value(String(body.observations.length))}`);
console.log(`${label('Status:')} ${value(result.status)}`);
// Display warnings (e.g. model effort compatibility)
diff --git a/apps/cli/src/run-get-action.ts b/apps/cli/src/run-get-action.ts
index c3090b494..e2a9c9a8b 100644
--- a/apps/cli/src/run-get-action.ts
+++ b/apps/cli/src/run-get-action.ts
@@ -5,7 +5,7 @@
* Action handler for `run get` subcommand — extracted for testability.
*/
import { colorLevel, dimTimestamp, errorText, successText, label, value, banner, warnBanner, criterionIcon } from "./utils/style.js";
-import { GATE_METADATA, GATE_ORDER, type ConversationTurn, type GateId, type GateRunSummary, type RequestDocument } from "shared";
+import { GATE_METADATA, GATE_ORDER, TAXONOMY_ELEMENT_METADATA, type ConversationTurn, type GateId, type GateRunSummary, type RequestDocument, type TaxonomyElementId } from "shared";
import { formatData, isMachineReadable } from "./utils/formatters.js";
import type { OutputFormat, DisplayField } from "./utils/types.js";
@@ -172,6 +172,49 @@ export async function runGetAction(options: RunGetOptions): Promise {
}
}
+ // Observations (kind:"observation" criteria), grouped by taxonomy dimension.
+ const turnsWithObs = (rs?.turns ?? []).filter((t) => (t.observationResults?.length ?? 0) > 0);
+ if (turnsWithObs.length > 0) {
+ // Build criterionId → taxonomyElementId map from the criteria store (best effort).
+ const taxById = new Map();
+ try {
+ const cr = await fetch(`${normalizeUrl(options.url)}/api/v1/criteria?kind=observation`);
+ if (cr.ok) {
+ const obs = await cr.json() as Array<{ id: string; taxonomyElementId?: TaxonomyElementId }>;
+ for (const o of obs) taxById.set(o.id, o.taxonomyElementId);
+ }
+ } catch { /* grouping is best-effort */ }
+
+ // detected/evaluated tally per criterion id across iterations.
+ const tally = new Map();
+ for (const t of turnsWithObs) {
+ for (const r of t.observationResults ?? []) {
+ const e = tally.get(r.criterionId) ?? { detected: 0, evaluated: 0 };
+ e.evaluated += 1;
+ if (r.passed) e.detected += 1;
+ tally.set(r.criterionId, e);
+ }
+ }
+
+ const byDim = new Map();
+ for (const id of tally.keys()) {
+ const dim = taxById.get(id) ?? "unclassified";
+ const arr = byDim.get(dim) ?? [];
+ arr.push(id);
+ byDim.set(dim, arr);
+ }
+
+ console.log(`\n${banner('─── Observations ───')}`);
+ for (const [dim, ids] of byDim) {
+ const dimLabel = dim === "unclassified" ? "Unclassified" : (TAXONOMY_ELEMENT_METADATA[dim as TaxonomyElementId]?.label ?? dim);
+ console.log(` ${label(dimLabel)}`);
+ for (const id of ids.sort()) {
+ const { detected, evaluated } = tally.get(id)!;
+ console.log(` ${value(id)} — ${detected}/${evaluated} iterations detected`);
+ }
+ }
+ }
+
// Error
if (rs?.error) {
console.log(`${label('Error:')} ${errorText(rs.error)}`);
diff --git a/apps/cli/src/utils/yaml-mappers.ts b/apps/cli/src/utils/yaml-mappers.ts
index 04bc54fb6..cad0c23dd 100644
--- a/apps/cli/src/utils/yaml-mappers.ts
+++ b/apps/cli/src/utils/yaml-mappers.ts
@@ -12,7 +12,7 @@ export function mapYamlCriterion(
filename: string,
_docIndex: number,
options: { includeGates?: boolean } = {},
-): { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[] } | null {
+): { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string } | null {
const id = doc.id as string | undefined;
const prompt = doc.prompt as string | undefined;
if (!id || !prompt) return null;
@@ -24,11 +24,18 @@ export function mapYamlCriterion(
const gatesRaw = doc.gates as string | string[] | undefined;
const gates = options.includeGates ? parseGateListOption(gatesRaw) : undefined;
+ const kindRaw = doc.kind as string | undefined;
+ const kind = kindRaw ? String(kindRaw).trim() : undefined;
+ const taxRaw = (doc.taxonomy_element_id ?? doc.taxonomyElementId) as string | undefined;
+ const taxonomyElementId = taxRaw ? String(taxRaw).trim() : undefined;
+
return {
id: id.trim(),
prompt: prompt.trim(),
...(dependsOn && dependsOn.length > 0 ? { dependsOn } : {}),
...(gates !== undefined ? { gates } : {}),
+ ...(kind ? { kind } : {}),
+ ...(taxonomyElementId ? { taxonomyElementId } : {}),
};
}
diff --git a/apps/judge/src/index.ts b/apps/judge/src/index.ts
index e9718131a..0dea452cd 100644
--- a/apps/judge/src/index.ts
+++ b/apps/judge/src/index.ts
@@ -52,7 +52,7 @@ app.post(
const startTime = Date.now();
try {
- const { snapshotUrl, criteria, conversationHistory, personaInstructions, requestId, gate, toolCallsUrl } = req.body;
+ const { snapshotUrl, criteria, conversationHistory, personaInstructions, requestId, gate, toolCallsUrl, atifUrl } = req.body;
// Validate required fields
if (!snapshotUrl || typeof snapshotUrl !== "string") {
@@ -106,6 +106,31 @@ app.post(
}
}
+ // Load the ATIF trajectory (normalized superset of tool calls) when
+ // provided — used by pp-taxonomy to evaluate observations against the
+ // full agent trajectory, not just the end-state snapshot. Exposed to the
+ // judge as a synthetic tool output so trajectory-only observations (e.g.
+ // a dependency added then removed mid-run) are detectable. Issue #1156.
+ if (atifUrl && typeof atifUrl === "string") {
+ try {
+ const atif = await blobStorage.downloadJson(atifUrl);
+ toolCalls = [
+ ...toolCalls,
+ {
+ id: "atif-trajectory",
+ name: "agent_trajectory_atif",
+ arguments: {},
+ response: typeof atif === "string" ? atif : JSON.stringify(atif),
+ },
+ ];
+ console.log(`[judge] Loaded ATIF trajectory from ${atifUrl}`);
+ } catch (err) {
+ console.warn(
+ `[judge] Failed to load ATIF from ${atifUrl}: ${err instanceof Error ? err.message : String(err)}`,
+ );
+ }
+ }
+
// Build onProgress callback that publishes criterion results via Redis
const onProgress = (requestId && logPublisher)
? (result: import("shared").CriterionResult) => {
diff --git a/apps/workers/post-processor/handler.taxonomy.yaml b/apps/workers/post-processor/handler.taxonomy.yaml
new file mode 100644
index 000000000..37411625f
--- /dev/null
+++ b/apps/workers/post-processor/handler.taxonomy.yaml
@@ -0,0 +1,17 @@
+# Post-process handler registration metadata for the observation evaluator.
+# Read by the generic register-handler script and POSTed to the
+# scheduler's POST /handlers/register endpoint on deploy.
+#
+# pp-taxonomy records per-iteration boolean observations (kind:"observation"
+# criteria) by reusing the judge. It depends on pp-atif so each turn's ATIF
+# trajectory is available, giving the judge codebase (snapshot) + trajectory
+# (ATIF) access. Shares the post-processor-queue with pp-atif (same worker).
+# See issue #1156.
+_id: pp-taxonomy
+type: post-process-handler
+version: 1
+queue: post-processor-queue
+selector: taxonomy
+autoBackfill: true
+dependsOn:
+ - pp-atif
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
new file mode 100644
index 000000000..18831592a
--- /dev/null
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, it, expect, vi, beforeEach } from "vitest";
+import { JudgeInfrastructureError, type JudgeClient } from "shared";
+import { TaxonomyHandler } from "./taxonomy-handler.js";
+import type { HandlerContext, PostProcessorMessage } from "../types.js";
+
+function makeCtx(doc: unknown): HandlerContext & { collection: { updateOne: ReturnType } } {
+ return {
+ blobStorage: {} as any,
+ collection: {
+ findOne: vi.fn().mockResolvedValue(doc),
+ updateOne: vi.fn().mockResolvedValue({ modifiedCount: 1 }),
+ } as any,
+ log: vi.fn().mockResolvedValue(undefined),
+ } as any;
+}
+
+const msg: PostProcessorMessage = { type: "taxonomy", requestId: "req-1", runId: "run-1" };
+
+describe("TaxonomyHandler", () => {
+ let judge: { evaluate: ReturnType };
+
+ beforeEach(() => {
+ judge = { evaluate: vi.fn() };
+ });
+
+ it("has type 'taxonomy'", () => {
+ expect(new TaxonomyHandler(judge as unknown as JudgeClient).type).toBe("taxonomy");
+ });
+
+ it("no-ops when no observations are selected", async () => {
+ const ctx = makeCtx({ _id: "req-1", run: { observations: [], turns: [{ iteration: 1, snapshotUrl: "s://1" }] } });
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+ expect(judge.evaluate).not.toHaveBeenCalled();
+ expect(ctx.collection.updateOne).not.toHaveBeenCalled();
+ });
+
+ it("writes judge criteriaResults to each turn's observationResults and sends atifUrl", async () => {
+ judge.evaluate.mockResolvedValue({
+ passed: true,
+ feedback: "ok",
+ criteriaResults: [{ criterionId: "dep_removed", passed: true, feedback: "left-pad removed", evaluated: true }],
+ });
+ const ctx = makeCtx({
+ _id: "req-1",
+ run: {
+ observations: ["dep_removed"],
+ turns: [{ iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" }],
+ },
+ });
+
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+
+ expect(judge.evaluate).toHaveBeenCalledWith(
+ expect.objectContaining({ snapshotUrl: "s://1", criteria: ["dep_removed"], atifUrl: "a://1" }),
+ );
+ const call = judge.evaluate.mock.calls[0][0];
+ expect(call.gate).toBeUndefined();
+ expect(call.toolCallsUrl).toBeUndefined();
+ expect(ctx.collection.updateOne).toHaveBeenCalledWith(
+ { _id: "req-1", "run.turns.iteration": 1 },
+ { $set: { "run.turns.$.observationResults": [{ criterionId: "dep_removed", passed: true, feedback: "left-pad removed", evaluated: true }] } },
+ );
+ });
+
+ it("skips iterations without a snapshotUrl", async () => {
+ judge.evaluate.mockResolvedValue({ passed: true, feedback: "", criteriaResults: [] });
+ const ctx = makeCtx({ _id: "req-1", run: { observations: ["c1"], turns: [{ iteration: 1 }] } });
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+ expect(judge.evaluate).not.toHaveBeenCalled();
+ });
+
+ it("throws on judge infrastructure error so the handler is marked failed", async () => {
+ judge.evaluate.mockRejectedValue(new JudgeInfrastructureError("down", { httpStatus: 503 }));
+ const ctx = makeCtx({ _id: "req-1", run: { observations: ["c1"], turns: [{ iteration: 1, snapshotUrl: "s://1" }] } });
+ await expect(new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx)).rejects.toThrow("down");
+ });
+});
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
new file mode 100644
index 000000000..3701c4cd8
--- /dev/null
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
@@ -0,0 +1,90 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { JudgeClient, isRetryableJudgeError } from "shared";
+import type { ConversationTurn, CriterionResult } from "shared";
+import type { PostProcessHandler, PostProcessorMessage, HandlerContext } from "../types.js";
+
+/** Minimal shape of the run document fields this handler reads/writes. */
+interface RunDoc {
+ run?: {
+ _id?: string;
+ observations?: string[];
+ turns?: ConversationTurn[];
+ };
+}
+
+/**
+ * Taxonomy Handler (pp-taxonomy): records per-iteration boolean observations.
+ *
+ * For each iteration turn with a `snapshotUrl`, reuses the judge service to
+ * evaluate the run's selected observation criteria (`run.observations`) against
+ * the codebase snapshot AND the agent trajectory (ATIF) — sending `atifUrl` in
+ * place of `toolCallsUrl`. Results are written to `turn.observationResults`,
+ * mirroring gate `criteriaResults`. Never gates, never steers the agent.
+ * Empty/absent `observations` → no-op. See issue #1156.
+ */
+export class TaxonomyHandler implements PostProcessHandler {
+ readonly type = "taxonomy";
+ private readonly judge: JudgeClient;
+
+ constructor(judge?: JudgeClient, judgeUrl = process.env.JUDGE_URL || process.env.JUDGE_SERVICE_URL || "http://localhost:3002") {
+ this.judge = judge ?? new JudgeClient(judgeUrl);
+ }
+
+ async process(message: PostProcessorMessage, ctx: HandlerContext): Promise {
+ const { requestId, iteration } = message;
+
+ const doc = (await ctx.collection.findOne({ _id: requestId } as any)) as RunDoc | null;
+ const observations = doc?.run?.observations ?? [];
+ const turns = doc?.run?.turns ?? [];
+
+ if (observations.length === 0) {
+ await ctx.log("info", "No observations selected, skipping taxonomy evaluation");
+ return;
+ }
+ if (turns.length === 0) {
+ await ctx.log("info", "No turns found, skipping taxonomy evaluation");
+ return;
+ }
+
+ const turnsToProcess = iteration ? turns.filter((t) => t.iteration === iteration) : turns;
+ let processedCount = 0;
+
+ for (const turn of turnsToProcess) {
+ if (!turn.snapshotUrl) {
+ await ctx.log("info", `Iteration ${turn.iteration}: no snapshot, skipping`);
+ continue;
+ }
+
+ try {
+ const result = await this.judge.evaluate({
+ snapshotUrl: turn.snapshotUrl,
+ criteria: observations,
+ conversationHistory: turns,
+ ...(turn.atifUrl ? { atifUrl: turn.atifUrl } : {}),
+ requestId,
+ });
+
+ const observationResults: CriterionResult[] = result.criteriaResults ?? [];
+
+ await ctx.collection.updateOne(
+ { _id: requestId, "run.turns.iteration": turn.iteration } as any,
+ { $set: { "run.turns.$.observationResults": observationResults } } as any,
+ );
+
+ processedCount++;
+ await ctx.log("info", `Iteration ${turn.iteration}: ${observationResults.length} observations recorded`);
+ } catch (err) {
+ const errMsg = err instanceof Error ? err.message : String(err);
+ if (isRetryableJudgeError(err)) {
+ await ctx.log("error", `Iteration ${turn.iteration}: judge infrastructure error, failing handler: ${errMsg}`);
+ throw err;
+ }
+ await ctx.log("warn", `Iteration ${turn.iteration}: observation evaluation failed: ${errMsg}`);
+ }
+ }
+
+ await ctx.log("info", `Taxonomy evaluation complete: ${processedCount}/${turnsToProcess.length} iterations processed`);
+ }
+}
diff --git a/apps/workers/post-processor/src/index.ts b/apps/workers/post-processor/src/index.ts
index b6b6ce3c9..c6a756cfb 100644
--- a/apps/workers/post-processor/src/index.ts
+++ b/apps/workers/post-processor/src/index.ts
@@ -4,6 +4,7 @@
import "dotenv/config";
import { PostProcessor, type PostProcessorConfig } from "./post-processor.js";
import { AtifHandler } from "./handlers/atif-handler.js";
+import { TaxonomyHandler } from "./handlers/taxonomy-handler.js";
const config: PostProcessorConfig = {
mongoUri: process.env.MONGO_CONNECTION_STRING || process.env.AZURE_COSMOS_CONNECTION_STRING || "mongodb://localhost:27017",
@@ -24,6 +25,7 @@ const processor = new PostProcessor(config);
// Register handlers
processor.registerHandler(new AtifHandler());
+processor.registerHandler(new TaxonomyHandler());
processor.start().catch((err) => {
console.error("[post-processor] Fatal error:", err);
diff --git a/config/criteria/auth_configured_correctly.yaml b/config/criteria/auth_configured_correctly.yaml
new file mode 100644
index 000000000..8c4b62410
--- /dev/null
+++ b/config/criteria/auth_configured_correctly.yaml
@@ -0,0 +1,8 @@
+id: auth_configured_correctly
+prompt: |
+ Authentication, connection, environment, and deployment settings are
+ configured properly (e.g. credentials/connection strings sourced from
+ environment or secret stores, correct endpoints, no hard-coded secrets, valid
+ deployment configuration).
+kind: observation
+taxonomy_element_id: dimension:configuration-correctness
diff --git a/config/criteria/dependency_added_then_removed.yaml b/config/criteria/dependency_added_then_removed.yaml
new file mode 100644
index 000000000..1706e1e64
--- /dev/null
+++ b/config/criteria/dependency_added_then_removed.yaml
@@ -0,0 +1,9 @@
+id: dependency_added_then_removed
+prompt: |
+ During the run the agent installed a package and later uninstalled or removed
+ it before finishing (e.g. added left-pad then removed it). This is only
+ derivable from the agent's trajectory (mid-run tool calls), not from the final
+ codebase snapshot, because the dependency is absent in the end state. Inspect
+ the trajectory of tool calls to detect a transient add-then-remove.
+kind: observation
+taxonomy_element_id: dimension:dependency-currency
diff --git a/config/criteria/idiomatic_api_usage.yaml b/config/criteria/idiomatic_api_usage.yaml
new file mode 100644
index 000000000..13ec3e949
--- /dev/null
+++ b/config/criteria/idiomatic_api_usage.yaml
@@ -0,0 +1,8 @@
+id: idiomatic_api_usage
+prompt: |
+ The agent used the product's recommended patterns and best practices when
+ calling its APIs (idiomatic usage), rather than working around them or using
+ deprecated/low-level approaches. Judge the quality of HOW the product is used,
+ not whether it is used at all.
+kind: observation
+taxonomy_element_id: dimension:idiomatic-use
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index daa4d9c9f..fe8c064ad 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -184,6 +184,10 @@ services:
build:
target: dev
+ register-handler-taxonomy:
+ build:
+ target: dev
+
post-processor:
build:
target: dev
diff --git a/docker-compose.yml b/docker-compose.yml
index 0bbc99234..aea2d76f7 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -659,6 +659,23 @@ services:
restart: "no"
entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
+ # Registers the pp-taxonomy handler (observation evaluator) — shares the
+ # post-processor worker + post-processor-queue, depends on pp-atif. Issue #1156.
+ register-handler-taxonomy:
+ build:
+ context: .
+ dockerfile: apps/workers/post-processor/Dockerfile
+ profiles: [post-processor]
+ environment:
+ <<: *common-env
+ HANDLER_YAML_PATH: apps/workers/post-processor/handler.taxonomy.yaml
+ SCHEDULER_URL: http://scheduler:8080
+ depends_on:
+ scheduler:
+ condition: service_started
+ restart: "no"
+ entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
+
post-processor:
build:
context: .
@@ -681,6 +698,8 @@ services:
condition: service_started
register-handler-post-processor:
condition: service_completed_successfully
+ register-handler-taxonomy:
+ condition: service_completed_successfully
volumes:
mongodb_data:
diff --git a/docs/architecture/app-design.md b/docs/architecture/app-design.md
index a5babb604..6f1b528a7 100644
--- a/docs/architecture/app-design.md
+++ b/docs/architecture/app-design.md
@@ -115,7 +115,7 @@ Currently all versions of an agent share a single queue (e.g., `queue-coder-acp-
### Run submission flow
-1. User submits via Portal or CLI with: **task**, **criteria** (required), **worker**, **model** (required), and optionally **agentVersion**, a **codebase** selection, and/or a per-gate **`gates`** configuration (see [Gates](#gates--multi-phase-evaluation-pipeline))
+1. User submits via Portal or CLI with: **task**, **criteria** (required), **worker**, **model** (required), and optionally **agentVersion**, a **codebase** selection, record-only **`observations`** criteria, and/or a per-gate **`gates`** configuration (see [Gates](#gates--multi-phase-evaluation-pipeline))
2. API resolves `agentVersion`: explicit selection → validate active; omitted → latest active by `createdAt`
3. API resolves `model`: explicit → validate against `supportedModels`; omitted → `defaultModel`
4. API looks up `AgentVersion.queueName` and routes message to that queue
@@ -146,6 +146,11 @@ Criteria are reusable evaluation rules stored in the database and optionally def
- **AI-generated prompts** — natural language behavior descriptions can be converted to evaluation prompts via LLM
- **Traits** — reusable labels for filtering and composition (e.g., `has_azure`, `has_node`)
- **Gate compatibility** — a `gates: GateId[]` list controls which [gates](#gates--multi-phase-evaluation-pipeline) a criterion may be selected for (empty = all); the list is downward-closed along the DAG
+- **Criterion kind** — `kind: "gate" | "observation"` distinguishes criteria that gate the agent from record-only observations. Observation criteria can optionally set `taxonomyElementId` to one of the hard-coded observation dimensions; run detail derives dimension grouping by joining each per-turn `observationResults[].criterionId` back to the criterion metadata.
+- **Kind** — `kind: "gate" | "observation"` (default `gate`). **Gate** criteria steer the coding agent through the gate DAG. **Observation** criteria (issue #1156) are record-only: they produce a boolean + evidence per iteration, never feed back to the agent, never pass/fail a gate, and never enter the gate DAG. Dependencies may only reference same-kind criteria.
+- **Taxonomy classification** — observation criteria carry an optional `taxonomyElementId` from a hard-coded enum of the three R&A Readout quality dimensions (`dimension:idiomatic-use`, `dimension:dependency-currency`, `dimension:configuration-correctness`). Classification is static/design-time, not per-run.
+
+Observation evaluation happens off the coding-agent critical path in the `pp-taxonomy` post-processor (see [post-processing](post-processing.md)). A run carries the chosen `observations: string[]` (observation-criteria ids); each evaluated turn stores `observationResults: CriterionResult[]` (same shape as gate `criteriaResults`). Dimension grouping is derived at read time by joining `criterionId` → criterion `taxonomyElementId`.
See [`ENV_VARIABLES.md`](../../scope-mt-app/ENV_VARIABLES.md) for related configuration options.
diff --git a/docs/architecture/criteria-provider.md b/docs/architecture/criteria-provider.md
index de2fc8284..08e623fbb 100644
--- a/docs/architecture/criteria-provider.md
+++ b/docs/architecture/criteria-provider.md
@@ -160,6 +160,10 @@ bypassed or drift between callers:
- **Gate-compatibility invariant** — enforced from both sides: a child's gates must
be a subset of every parent's gates, and narrowing a parent may not strand an
existing dependent.
+- **Same-kind dependency partition** — a criterion's `dependsOn` may only reference
+ criteria of the same `kind`. This keeps the gate DAG closed under
+ `resolveWithAncestors` (observations never leak into a gate's evaluation set) and
+ lets `kind:"observation"` criteria form their own optional dependency chains.
- **Referential integrity on delete** — deleting a criterion that still has
dependents is rejected.
diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md
index 9eb7cafbe..ea118f342 100644
--- a/docs/architecture/overview.md
+++ b/docs/architecture/overview.md
@@ -80,6 +80,7 @@ flowchart TB
| `workers/coder-acp-claude-code` | Claude Code agent via Agent Client Protocol (ACP) |
| `workers/coder-acp-copilot` | GitHub Copilot agent via Agent Client Protocol (ACP) |
| `workers/report-generator` | Copilot SDK worker that generates post-run markdown reports |
+| `workers/post-processor` | DAG-based post-run handlers: `pp-atif` (trajectory ATIF) and `pp-taxonomy` (per-iteration boolean observations via the judge) |
| `gateway` | AI Gateway — shared Rust TLS-intercepting proxy with plugin architecture (HAR capture, future: token refresh, rate limiting) |
## Data Flow
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index 910812ac0..baeed6e44 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -56,6 +56,24 @@ Two paths trigger post-processing:
The `iteration` query parameter is mandatory for the ATIF endpoints. ATIF files are also included in archive exports as `iteration-{N}.atif.trajectory.json`.
+## Taxonomy Observations (`pp-taxonomy`)
+
+The `pp-taxonomy` handler records **observation criteria** — per-iteration boolean
+outcomes + evidence about the codebase and the agent's trajectory, **without gating
+or steering** the coding agent (issue #1156). It is a DAG node `dependsOn: [pp-atif]`,
+because some observations are only derivable from the trajectory (ATIF), not the
+final snapshot.
+
+### Flow
+
+1. Reads the run's `observations: string[]` (observation-criteria ids chosen at submit). Empty/absent ⇒ no-op, handler `done`.
+2. For each iteration with a `snapshotUrl`, calls the existing judge via the shared `JudgeClient` (`POST /api/v1/evaluate`) with `snapshotUrl` + `atifUrl` + the observation-criteria ids — no persona, no gate, no taxonomyElementId (the classifier lives on the criterion). ATIF supersedes per-turn `toolCallsUrl`, so only ATIF is sent.
+3. Writes the returned per-criterion `{criterionId, passed, feedback}` to that turn's **`observationResults`** — same shape/storage as gate `criteriaResults`. No new blob, no `run.taxonomyUrl`.
+4. Stamps `run.handlerStatus["pp-taxonomy"] = { status: "done", version: N }` and notifies the scheduler.
+
+Dimension grouping is **derived at read time** by joining each result's `criterionId` → criterion `taxonomyElementId` (the three R&A Readout dimensions; unset = unclassified). It never feeds back to the agent and never affects pass/fail. (#1053 later extends this worker with a richer scorecard artifact.)
+
+
## Handler Interface
The post-processor uses a registry pattern for extensibility:
@@ -85,6 +103,7 @@ Handlers are registered at startup in `index.ts`:
```typescript
const processor = new PostProcessor(config);
processor.registerHandler(new AtifHandler());
+processor.registerHandler(new TaxonomyHandler());
processor.start();
```
@@ -140,7 +159,7 @@ flowchart LR
**Where it runs:**
- **Docker Compose:** one `register-handler-` init service per handler (e.g. `pp-atif`) runs the generic script via `tsx`, gated on the scheduler being up. The worker waits for its registration service to complete.
-- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. Only `pp-atif` is registered in K8s today because it is the only post-process handler deployed to the cluster. The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
+- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. `pp-atif` and `pp-taxonomy` are registered in K8s via their respective registration Jobs (`register-handler-taxonomy` points its `HANDLER_YAML_PATH` at `handler.taxonomy.yaml`). The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
To **add or change a handler**, edit its `handler.yaml` (bump `version`, adjust `dependsOn`, etc.) — no code or migration changes are needed for registration.
diff --git a/packages/db-migrations/src/migrations/021-backfill-criteria-kind.ts b/packages/db-migrations/src/migrations/021-backfill-criteria-kind.ts
new file mode 100644
index 000000000..743d9a38d
--- /dev/null
+++ b/packages/db-migrations/src/migrations/021-backfill-criteria-kind.ts
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Migration: Backfill criteria kind.
+ *
+ * The observation-criteria feature (issue #1156) introduces a `kind` field on
+ * criteria — `"gate"` (default) gates the coding-agent session via the DAG,
+ * while `"observation"` is record-only. To preserve existing behaviour every
+ * legacy criterion must be a gate, so we backfill rows whose `kind` field is
+ * absent or null with `"gate"`. Mirrors 018-backfill-criteria-gates.ts.
+ *
+ * down() reverses only the rows this migration set to exactly "gate",
+ * unsetting the field to restore the pre-migration state.
+ */
+
+import type { Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+import { batchUpdate } from "../batch-update.js";
+
+export class BackfillCriteriaKind implements MigrationInterface {
+ async up(db: Db): Promise {
+ const criteria = db.collection("criteria");
+
+ const count = await batchUpdate(
+ criteria,
+ { $or: [{ kind: { $exists: false } }, { kind: null }] },
+ { $set: { kind: "gate" } },
+ "[021] backfill criteria.kind=gate",
+ );
+
+ console.log(`[021] Backfilled kind=gate on ${count} criteria`);
+ }
+
+ async down(db: Db): Promise {
+ const criteria = db.collection("criteria");
+
+ const count = await batchUpdate(
+ criteria,
+ { kind: "gate" },
+ { $unset: { kind: "" } },
+ "[021-down] unset criteria.kind",
+ );
+
+ console.log(`[021-down] Unset kind on ${count} criteria`);
+ }
+}
diff --git a/packages/db-migrations/src/required-migrations.ts b/packages/db-migrations/src/required-migrations.ts
index e6d8e82ae..f5742e603 100644
--- a/packages/db-migrations/src/required-migrations.ts
+++ b/packages/db-migrations/src/required-migrations.ts
@@ -36,4 +36,5 @@ export const REQUIRED_MIGRATIONS: readonly string[] = [
"019-backfill-task-prompt-type.ts",
"020-backfill-handler-status.ts",
"020-create-codebase-indexes.ts",
+ "021-backfill-criteria-kind.ts",
];
diff --git a/packages/shared/src/criteria/criteria-provider-api.ts b/packages/shared/src/criteria/criteria-provider-api.ts
index f66c6cc70..080dd1c9e 100644
--- a/packages/shared/src/criteria/criteria-provider-api.ts
+++ b/packages/shared/src/criteria/criteria-provider-api.ts
@@ -203,10 +203,14 @@ export class RestApiCriteriaProvider implements CriteriaProvider {
function mapToCriteriaConfig(data: Record): CriteriaConfig {
const dependsOn = (data.dependsOn as string[] | undefined) ?? [];
const gates = data.gates as CriteriaConfig["gates"] | undefined;
+ const kind = data.kind as CriteriaConfig["kind"] | undefined;
+ const taxonomyElementId = data.taxonomyElementId as CriteriaConfig["taxonomyElementId"] | undefined;
return {
id: String(data.id),
prompt: String(data.prompt),
dependsOn: dependsOn.length > 0 ? dependsOn : undefined,
...(gates && gates.length > 0 ? { gates } : {}),
+ ...(kind ? { kind } : {}),
+ ...(taxonomyElementId ? { taxonomyElementId } : {}),
};
}
diff --git a/packages/shared/src/criteria/criteria-provider-fs.ts b/packages/shared/src/criteria/criteria-provider-fs.ts
index 9922327ea..9c5042700 100644
--- a/packages/shared/src/criteria/criteria-provider-fs.ts
+++ b/packages/shared/src/criteria/criteria-provider-fs.ts
@@ -68,6 +68,19 @@ export class FileSystemCriteriaProvider implements CriteriaProvider {
criteria.gates = gates.map((g: any) => String(g).trim()) as CriteriaConfig["gates"];
}
+ const kind = data.kind;
+ if (kind !== undefined) {
+ if (kind !== "gate" && kind !== "observation") {
+ throw new Error(`'kind' must be 'gate' or 'observation' in ${file}`);
+ }
+ criteria.kind = kind;
+ }
+
+ const taxonomyElementId = data.taxonomy_element_id || data.taxonomyElementId;
+ if (taxonomyElementId !== undefined) {
+ criteria.taxonomyElementId = String(taxonomyElementId).trim() as CriteriaConfig["taxonomyElementId"];
+ }
+
if (this.registry.has(criteria.id)) {
throw new Error(`Duplicate criteria id '${criteria.id}' found in ${file}`);
}
diff --git a/packages/shared/src/criteria/criteria-store.test.ts b/packages/shared/src/criteria/criteria-store.test.ts
index ce6c7645e..07908886e 100644
--- a/packages/shared/src/criteria/criteria-store.test.ts
+++ b/packages/shared/src/criteria/criteria-store.test.ts
@@ -311,3 +311,62 @@ describe("CriteriaStore revives soft-deleted ids on re-create", () => {
});
});
+
+describe("CriteriaStore kind + taxonomy (issue #1156)", () => {
+ it("defaults kind to 'gate' on create when absent", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ const created = await store.create({ id: "g1", prompt: "p" });
+ expect(created.kind).toBe("gate");
+ expect(created.taxonomyElementId).toBeUndefined();
+ });
+
+ it("persists kind:'observation' + taxonomyElementId", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ const created = await store.create({
+ id: "obs1",
+ prompt: "p",
+ kind: "observation",
+ taxonomyElementId: "dimension:idiomatic-use",
+ });
+ expect(created.kind).toBe("observation");
+ expect(created.taxonomyElementId).toBe("dimension:idiomatic-use");
+ });
+
+ it("rejects taxonomyElementId on a gate criterion", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ await expect(
+ store.create({ id: "g2", prompt: "p", kind: "gate", taxonomyElementId: "dimension:idiomatic-use" }),
+ ).rejects.toThrow(CriteriaValidationError);
+ });
+
+ it("rejects a gate depending on an observation (same-kind rule)", async () => {
+ const col = fakeCollection([
+ { id: "obs", prompt: "o", dependsOn: [], kind: "observation", createdAt: new Date() },
+ ]);
+ const store = new CriteriaStore(col);
+ await expect(
+ store.create({ id: "g3", prompt: "p", kind: "gate", dependsOn: ["obs"] }),
+ ).rejects.toThrow(CriteriaValidationError);
+ });
+
+ it("allows an observation depending on an observation", async () => {
+ const col = fakeCollection([
+ { id: "obs_parent", prompt: "o", dependsOn: [], kind: "observation", createdAt: new Date() },
+ ]);
+ const store = new CriteriaStore(col);
+ await expect(
+ store.create({ id: "obs_child", prompt: "c", kind: "observation", dependsOn: ["obs_parent"] }),
+ ).resolves.toBeTruthy();
+ });
+
+ it("resolveObservations accepts observation ids and rejects gate ids", async () => {
+ const col = fakeCollection([
+ { id: "obs", prompt: "o", dependsOn: [], kind: "observation", createdAt: new Date() },
+ { id: "gate", prompt: "g", dependsOn: [], kind: "gate", createdAt: new Date() },
+ ]);
+ const store = new CriteriaStore(col);
+ const resolved = await store.resolveObservations(["obs"]);
+ expect(resolved.map((c) => c.id)).toEqual(["obs"]);
+ await expect(store.resolveObservations(["gate"])).rejects.toThrow(CriteriaValidationError);
+ });
+});
diff --git a/packages/shared/src/criteria/criteria-store.ts b/packages/shared/src/criteria/criteria-store.ts
index 34893c7cb..de51748df 100644
--- a/packages/shared/src/criteria/criteria-store.ts
+++ b/packages/shared/src/criteria/criteria-store.ts
@@ -2,7 +2,7 @@
// Licensed under the MIT License.
import { Collection } from 'mongodb';
-import { CriteriaConfig, CriteriaDocument, GateId } from '../types/types.js';
+import { CriteriaConfig, CriteriaDocument, CriterionKind, GateId, TaxonomyElementId } from '../types/types.js';
import { DependencyGraph } from '../graph/dependency-graph.js';
import { gatesSatisfyInvariant } from '../gates/gates.js';
import {
@@ -40,8 +40,11 @@ export class CriteriaStore {
prompt: string;
dependsOn?: string[];
gates?: GateId[];
+ kind?: CriterionKind;
+ taxonomyElementId?: TaxonomyElementId;
}): Promise {
- const { id, prompt, dependsOn = [], gates } = input;
+ const { id, prompt, dependsOn = [], gates, taxonomyElementId } = input;
+ const kind: CriterionKind = input.kind ?? 'gate';
// Validate ID format
if (!/^[a-z][a-z0-9_]*$/.test(id)) {
@@ -50,6 +53,13 @@ export class CriteriaStore {
);
}
+ // taxonomyElementId only applies to observation criteria.
+ if (taxonomyElementId !== undefined && kind !== 'observation') {
+ throw new CriteriaValidationError(
+ `taxonomyElementId can only be set on observation criteria (got kind '${kind}')`
+ );
+ }
+
// Check for duplicates among *active* criteria.
const existing = await this.collection.findOne({ id, deletedAt: { $exists: false } });
if (existing) {
@@ -72,6 +82,11 @@ export class CriteriaStore {
await this.validateNoCycles(id, dependsOn);
}
+ // Validate same-kind dependencies (gate↔gate, observation↔observation).
+ if (dependsOn.length > 0) {
+ await this.validateSameKindDependencies(id, dependsOn, kind);
+ }
+
// Validate the downward-closed gate-compatibility invariant.
await this.validateGateCompatibility(id, dependsOn, gates);
@@ -80,6 +95,8 @@ export class CriteriaStore {
prompt: prompt.trim(),
dependsOn,
...(gates !== undefined && { gates }),
+ kind,
+ ...(taxonomyElementId !== undefined && { taxonomyElementId }),
createdAt: new Date(),
};
@@ -121,7 +138,7 @@ export class CriteriaStore {
/** Update a criterion's prompt, dependencies and/or gate compatibility */
async update(
id: string,
- patch: { prompt?: string; dependsOn?: string[]; gates?: GateId[] }
+ patch: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }
): Promise {
const existing = await this.get(id);
if (!existing) {
@@ -147,10 +164,28 @@ export class CriteriaStore {
await this.validateDependentsRemainCompatible(id, effectiveGates);
}
+ // Validate same-kind dependencies against the resulting kind + dependsOn.
+ const effectiveKind: CriterionKind = patch.kind ?? existing.kind ?? 'gate';
+ const resultingDependsOn = patch.dependsOn ?? existing.dependsOn ?? [];
+ if (resultingDependsOn.length > 0) {
+ await this.validateSameKindDependencies(id, resultingDependsOn, effectiveKind);
+ }
+
+ // taxonomyElementId only applies to observation criteria.
+ const effectiveTaxonomy =
+ patch.taxonomyElementId !== undefined ? patch.taxonomyElementId : existing.taxonomyElementId;
+ if (effectiveTaxonomy !== undefined && effectiveKind !== 'observation') {
+ throw new CriteriaValidationError(
+ `taxonomyElementId can only be set on observation criteria (got kind '${effectiveKind}')`
+ );
+ }
+
const update: Record = { updatedAt: new Date() };
if (patch.prompt !== undefined) update.prompt = patch.prompt.trim();
if (patch.dependsOn !== undefined) update.dependsOn = patch.dependsOn;
if (patch.gates !== undefined) update.gates = patch.gates;
+ if (patch.kind !== undefined) update.kind = patch.kind;
+ if (patch.taxonomyElementId !== undefined) update.taxonomyElementId = patch.taxonomyElementId;
await this.collection.updateOne(
{ id, deletedAt: { $exists: false } },
@@ -213,7 +248,14 @@ export class CriteriaStore {
);
}
- collected.set(id, { id: doc.id, prompt: doc.prompt, dependsOn: doc.dependsOn, ...(doc.gates !== undefined && { gates: doc.gates }) });
+ collected.set(id, {
+ id: doc.id,
+ prompt: doc.prompt,
+ dependsOn: doc.dependsOn,
+ ...(doc.gates !== undefined && { gates: doc.gates }),
+ ...(doc.kind !== undefined && { kind: doc.kind }),
+ ...(doc.taxonomyElementId !== undefined && { taxonomyElementId: doc.taxonomyElementId }),
+ });
if (doc.dependsOn) {
for (const parentId of doc.dependsOn) {
@@ -240,6 +282,8 @@ export class CriteriaStore {
prompt: c.prompt,
dependsOn: c.dependsOn,
...(c.gates !== undefined && { gates: c.gates }),
+ ...(c.kind !== undefined && { kind: c.kind }),
+ ...(c.taxonomyElementId !== undefined && { taxonomyElementId: c.taxonomyElementId }),
}));
const edges: { from: string; to: string }[] = [];
@@ -268,6 +312,8 @@ export class CriteriaStore {
prompt: config.prompt,
dependsOn: config.dependsOn || [],
...(config.gates !== undefined && { gates: config.gates }),
+ kind: config.kind ?? 'gate',
+ ...(config.taxonomyElementId !== undefined && { taxonomyElementId: config.taxonomyElementId }),
createdAt: new Date(),
} as any);
inserted++;
@@ -288,6 +334,52 @@ export class CriteriaStore {
}
}
+ /**
+ * Validate that every dependency shares the criterion's kind. Keeps the gate
+ * DAG closed under resolveWithAncestors and lets observation criteria form
+ * their own dependency chains. Missing parents are caught by
+ * validateDependencies, so they are skipped here. See issue #1156.
+ */
+ private async validateSameKindDependencies(
+ criterionId: string,
+ dependsOn: string[],
+ kind: CriterionKind,
+ ): Promise {
+ for (const parentId of dependsOn) {
+ const parent = await this.get(parentId);
+ if (!parent) continue;
+ const parentKind = parent.kind ?? 'gate';
+ if (parentKind !== kind) {
+ throw new CriteriaValidationError(
+ `'${criterionId}' (kind '${kind}') cannot depend on '${parentId}' (kind '${parentKind}'). ` +
+ `A criterion may only depend on same-kind criteria.`,
+ );
+ }
+ }
+ }
+
+ /**
+ * Resolve observation-criteria ids, asserting each is an active
+ * kind:"observation" criterion. Used by submit validation + pp-taxonomy.
+ * Throws CriteriaValidationError on a missing or non-observation id.
+ */
+ async resolveObservations(ids: string[]): Promise {
+ const resolved: CriteriaDocument[] = [];
+ for (const id of ids) {
+ const doc = await this.get(id);
+ if (!doc) {
+ throw new CriteriaValidationError(`Observation criterion '${id}' does not exist`);
+ }
+ if ((doc.kind ?? 'gate') !== 'observation') {
+ throw new CriteriaValidationError(
+ `Criterion '${id}' is not an observation (kind '${doc.kind ?? 'gate'}')`
+ );
+ }
+ resolved.push(doc);
+ }
+ return resolved;
+ }
+
/** Validate that adding edges would not introduce a cycle */
private async validateNoCycles(
criterionId: string,
diff --git a/packages/shared/src/criteria/index.ts b/packages/shared/src/criteria/index.ts
index 4cca92abd..413c36636 100644
--- a/packages/shared/src/criteria/index.ts
+++ b/packages/shared/src/criteria/index.ts
@@ -7,3 +7,4 @@ export * from "./criteria-provider.js";
export * from "./criteria-provider-fs.js";
export * from "./criteria-provider-api.js";
export * from "./criteria-provider-factory.js";
+export * from "./observation-taxonomy.js";
diff --git a/packages/shared/src/criteria/observation-taxonomy.ts b/packages/shared/src/criteria/observation-taxonomy.ts
new file mode 100644
index 000000000..3781e36c6
--- /dev/null
+++ b/packages/shared/src/criteria/observation-taxonomy.ts
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import {
+ TAXONOMY_ELEMENT_IDS,
+ TaxonomyElementId,
+ isTaxonomyElementId,
+} from "../types/types.js";
+
+/** Re-export the hard-coded taxonomy constants from the shared barrel. */
+export { TAXONOMY_ELEMENT_IDS, isTaxonomyElementId };
+export type { TaxonomyElementId };
+
+/** Static, human-facing metadata for a taxonomy element. */
+export interface TaxonomyElementMetadata {
+ id: TaxonomyElementId;
+ label: string;
+ description: string;
+}
+
+/**
+ * Hard-coded metadata for every observation taxonomy element, keyed by id —
+ * the three quality dimensions from the R&A Readout design. See issue #1156.
+ */
+export const TAXONOMY_ELEMENT_METADATA: Record = {
+ "dimension:idiomatic-use": {
+ id: "dimension:idiomatic-use",
+ label: "Idiomatic use",
+ description:
+ "Did the agent follow the product's recommended patterns and best practices " +
+ "(quality of how the product is used, not whether it is used at all)?",
+ },
+ "dimension:dependency-currency": {
+ id: "dimension:dependency-currency",
+ label: "Dependency currency",
+ description: "Did the agent use current versions, packages, and namespaces?",
+ },
+ "dimension:configuration-correctness": {
+ id: "dimension:configuration-correctness",
+ label: "Configuration correctness",
+ description: "Are auth, connection, environment, and deployment settings configured properly?",
+ },
+};
diff --git a/packages/shared/src/judge/judge-client.ts b/packages/shared/src/judge/judge-client.ts
index f94e3c856..c07cfa82f 100644
--- a/packages/shared/src/judge/judge-client.ts
+++ b/packages/shared/src/judge/judge-client.ts
@@ -17,6 +17,10 @@ export interface JudgeEvaluateRequest {
gate?: GateId;
/** Blob URL of this iteration's captured tool calls/outputs (build/test/run output). */
toolCallsUrl?: string;
+ /** Blob URL of this iteration's ATIF trajectory JSON. Normalized superset of
+ * tool calls; sent by pp-taxonomy in place of toolCallsUrl so observations
+ * can be evaluated against the full agent trajectory. See issue #1156. */
+ atifUrl?: string;
}
/**
diff --git a/packages/shared/src/schemas/criteria.ts b/packages/shared/src/schemas/criteria.ts
index 29b50ddc3..efe0761c1 100644
--- a/packages/shared/src/schemas/criteria.ts
+++ b/packages/shared/src/schemas/criteria.ts
@@ -3,11 +3,13 @@
import { z } from "zod";
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
-import { GATES } from "../types/types.js";
+import { GATES, CRITERION_KINDS, TAXONOMY_ELEMENT_IDS } from "../types/types.js";
extendZodWithOpenApi(z);
export const GateIdSchema = z.enum(GATES);
+export const CriterionKindSchema = z.enum(CRITERION_KINDS);
+export const TaxonomyElementIdSchema = z.enum(TAXONOMY_ELEMENT_IDS);
export const CreateCriteriaInputSchema = z
.object({
@@ -15,6 +17,8 @@ export const CreateCriteriaInputSchema = z
prompt: z.string(),
dependsOn: z.array(z.string()).optional(),
gates: z.array(GateIdSchema).optional(),
+ kind: CriterionKindSchema.default("gate"),
+ taxonomyElementId: TaxonomyElementIdSchema.optional(),
})
.openapi("CreateCriteriaInput");
@@ -23,6 +27,8 @@ export const UpdateCriteriaInputSchema = z
prompt: z.string().optional(),
dependsOn: z.array(z.string()).optional(),
gates: z.array(GateIdSchema).optional(),
+ kind: CriterionKindSchema.optional(),
+ taxonomyElementId: TaxonomyElementIdSchema.optional(),
})
.openapi("UpdateCriteriaInput");
@@ -32,6 +38,8 @@ export const CriteriaResponseSchema = z
prompt: z.string(),
dependsOn: z.array(z.string()).optional(),
gates: z.array(GateIdSchema).optional(),
+ kind: CriterionKindSchema.optional(),
+ taxonomyElementId: TaxonomyElementIdSchema.optional(),
createdAt: z.coerce.date(),
updatedAt: z.coerce.date().optional(),
deletedAt: z.coerce.date().optional(),
@@ -44,6 +52,8 @@ export const CriteriaGraphNodeSchema = z
prompt: z.string(),
dependsOn: z.array(z.string()).optional(),
gates: z.array(GateIdSchema).optional(),
+ kind: CriterionKindSchema.optional(),
+ taxonomyElementId: TaxonomyElementIdSchema.optional(),
})
.openapi("CriteriaGraphNode");
diff --git a/packages/shared/src/schemas/request.ts b/packages/shared/src/schemas/request.ts
index 513e54996..1abc04062 100644
--- a/packages/shared/src/schemas/request.ts
+++ b/packages/shared/src/schemas/request.ts
@@ -70,6 +70,7 @@ export const ConversationTurnSchema = z
passed: z.boolean(),
timestamp: z.coerce.date(),
criteriaResults: z.array(CriterionResultSchema).optional(),
+ observationResults: z.array(CriterionResultSchema).optional(),
harUrl: z.string().optional(),
videoUrls: z.array(z.string()).optional(),
tokenUsage: TokenUsageSchema.optional(),
@@ -130,6 +131,7 @@ export const CreateRequestInputSchema = z
profileVariations: z.array(z.string()).optional(),
priority: z.number().int().optional(),
gates: z.array(GateConfigSchema).optional(),
+ observations: z.array(z.string()).optional(),
})
.openapi("CreateRequestInput");
@@ -157,6 +159,7 @@ export const RequestResponseSchema = z
submissionId: z.string().optional(),
priority: z.number().int().default(0),
gates: z.array(GateConfigSchema).optional(),
+ observations: z.array(z.string()).optional(),
gateSummaries: z.array(GateRunSummarySchema).optional(),
// Per-attempt state lives in the run sub-document.
run: z
diff --git a/packages/shared/src/schemas/schemas.test.ts b/packages/shared/src/schemas/schemas.test.ts
index c8e8adceb..0878e3cf3 100644
--- a/packages/shared/src/schemas/schemas.test.ts
+++ b/packages/shared/src/schemas/schemas.test.ts
@@ -515,6 +515,33 @@ describe("criteria schemas", () => {
it("rejects missing prompt", () => {
expect(() => CreateCriteriaInputSchema.parse({ id: "abc" })).toThrow();
});
+
+ it("defaults kind to 'gate' when absent", () => {
+ const result = CreateCriteriaInputSchema.parse({ id: "abc", prompt: "p" });
+ expect(result.kind).toBe("gate");
+ });
+
+ it("accepts kind:'observation' with a valid taxonomyElementId", () => {
+ const result = CreateCriteriaInputSchema.parse({
+ id: "obs",
+ prompt: "p",
+ kind: "observation",
+ taxonomyElementId: "dimension:idiomatic-use",
+ });
+ expect(result.kind).toBe("observation");
+ expect(result.taxonomyElementId).toBe("dimension:idiomatic-use");
+ });
+
+ it("rejects an unknown taxonomyElementId", () => {
+ expect(() =>
+ CreateCriteriaInputSchema.parse({
+ id: "obs",
+ prompt: "p",
+ kind: "observation",
+ taxonomyElementId: "dimension:nope",
+ }),
+ ).toThrow();
+ });
});
describe("CriteriaResponseSchema", () => {
diff --git a/packages/shared/src/storage/blob-storage.ts b/packages/shared/src/storage/blob-storage.ts
index 19a7e3db2..99e0bab46 100644
--- a/packages/shared/src/storage/blob-storage.ts
+++ b/packages/shared/src/storage/blob-storage.ts
@@ -485,4 +485,27 @@ export class BlobStorage {
const blockBlobClient = this.containerClient.getBlockBlobClient(blobName);
return blockBlobClient.downloadToBuffer();
}
+
+ /**
+ * Downloads and parses a JSON blob. Accepts either a full blob URL (Azure or
+ * Azurite) or a bare blob name within the snapshots container. Used by the
+ * judge to load ATIF trajectory JSON for observation evaluation. Issue #1156.
+ */
+ async downloadJson(urlOrBlobName: string): Promise {
+ await this.ensureContainer();
+ let blobName = urlOrBlobName;
+ if (urlOrBlobName.startsWith("http://") || urlOrBlobName.startsWith("https://")) {
+ const url = new URL(urlOrBlobName);
+ const containerPrefix = `/${SNAPSHOTS_CONTAINER}/`;
+ const containerIndex = url.pathname.indexOf(containerPrefix);
+ if (containerIndex === -1) {
+ throw new Error(
+ `Blob URL does not contain container '${SNAPSHOTS_CONTAINER}': ${urlOrBlobName}`,
+ );
+ }
+ blobName = decodeURIComponent(url.pathname.substring(containerIndex + containerPrefix.length));
+ }
+ const buf = await this.downloadBlobToBuffer(blobName);
+ return JSON.parse(buf.toString("utf-8")) as T;
+ }
}
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index f233c21cb..34e708e16 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -62,6 +62,42 @@ export function isGateId(value: unknown): value is GateId {
return typeof value === "string" && (GATES as readonly string[]).includes(value);
}
+/**
+ * Discriminator for what a criterion is used for. `"gate"` (default) gates the
+ * coding-agent session via the DAG; `"observation"` is record-only — it produces
+ * a per-iteration boolean + evidence and never feeds back, never pass/fails a
+ * gate, and never enters the gate DAG. See issue #1156.
+ */
+export type CriterionKind = "gate" | "observation";
+
+/** The hard-coded set of criterion kinds. */
+export const CRITERION_KINDS = ["gate", "observation"] as const;
+
+/** True when `value` is a valid criterion kind. */
+export function isCriterionKind(value: unknown): value is CriterionKind {
+ return typeof value === "string" && (CRITERION_KINDS as readonly string[]).includes(value);
+}
+
+/**
+ * Hard-coded taxonomy elements for observation criteria — the three quality
+ * dimensions from the R&A Readout design. Gates (select/build/test/run/deploy)
+ * are excluded as they live in the criterion `gates` field. Namespaced ids keep
+ * a future first-class taxonomy a clean migration. See issue #1156.
+ */
+export const TAXONOMY_ELEMENT_IDS = [
+ "dimension:idiomatic-use",
+ "dimension:dependency-currency",
+ "dimension:configuration-correctness",
+] as const;
+
+/** A single taxonomy element id. */
+export type TaxonomyElementId = (typeof TAXONOMY_ELEMENT_IDS)[number];
+
+/** True when `value` is a valid taxonomy element id. */
+export function isTaxonomyElementId(value: unknown): value is TaxonomyElementId {
+ return typeof value === "string" && (TAXONOMY_ELEMENT_IDS as readonly string[]).includes(value);
+}
+
/**
* A prompt's type discriminator — one literal per gate. The prompt that drives
* a gate must have a `type` equal to that gate's id.
@@ -132,6 +168,10 @@ export interface ConversationTurn {
passed: boolean;
timestamp: Date;
criteriaResults?: CriterionResult[]; // Per-criterion breakdown from DAG evaluation
+ /** Per-iteration observation results (kind:"observation" criteria), recorded
+ * by the pp-taxonomy post-processor. Same shape as criteriaResults but never
+ * gates the agent. Empty/absent when no observations were selected. #1156. */
+ observationResults?: CriterionResult[];
harUrl?: string; // Blob storage URL to the HAR file for this turn
videoUrls?: string[]; // Blob storage URLs to session recording videos for this turn
tokenUsage?: TokenUsage; // LLM token usage for this iteration
@@ -284,6 +324,13 @@ export interface RequestDocument {
* docs/design/gates.md §4.3). Gates run in `GATE_ORDER`.
*/
gates?: GateConfig[];
+ /**
+ * Observation-criteria ids (kind:"observation") selected at submit. The
+ * pp-taxonomy post-processor evaluates exactly this set after the run
+ * completes and writes per-turn `observationResults`. Empty/absent = none.
+ * See issue #1156.
+ */
+ observations?: string[];
/**
* Per-gate execution summary, populated as the run progresses. Derived
* from `run.turns` but stored explicitly for cheap querying.
@@ -597,6 +644,13 @@ export interface CriteriaConfig {
* (applies only to NEW criteria; legacy rows are backfilled to ["select"]
* by migration 018). See docs/design/gates.md §4.2. */
gates?: GateId[];
+ /** Whether this criterion gates the agent or is a record-only observation.
+ * Default "gate" applied at store/schema layer; legacy rows backfilled to
+ * "gate" by migration. See issue #1156. */
+ kind?: CriterionKind;
+ /** Design-time classification under a hard-coded taxonomy element. Only set
+ * on observation criteria. Static — never stored per run. See issue #1156. */
+ taxonomyElementId?: TaxonomyElementId;
}
// Per-criterion result from judge evaluation
From 19b02998acc79b868ac7042c69ddcd68bd33609b Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Sun, 28 Jun 2026 19:16:50 -0700
Subject: [PATCH 026/287] feat(portal): observation criteria kind/taxonomy UI,
submit picker, observations tab
Carry criterion kind + taxonomyElementId, request observations, and
turn.observationResults through the portal: kind selector + taxonomy picker on
criteria pages, observations multi-select on Submit Run, and a Run-detail
Observations tab grouped by dimension. Includes Storybook stories.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/components/CreateCriterionDialog.tsx | 6 +-
.../src/components/CriteriaBadge.stories.tsx | 49 +++++++
apps/portal/src/components/CriteriaBadge.tsx | 48 +++++--
.../src/components/CriteriaFilterBar.tsx | 29 ++++
apps/portal/src/components/CriteriaPicker.tsx | 11 +-
.../src/components/CriteriaWizardStep1.tsx | 43 +++++-
.../src/components/CriteriaWizardStep2.tsx | 39 +++++-
.../ObservationTaxonomySelect.stories.tsx | 31 ++++
.../components/ObservationTaxonomySelect.tsx | 48 +++++++
apps/portal/src/hooks/useCriteriaWizard.ts | 50 +++++--
apps/portal/src/lib/api.ts | 7 +-
apps/portal/src/pages/CriteriaList.tsx | 64 ++++++++-
apps/portal/src/pages/CriterionDetail.tsx | 70 +++++++++-
apps/portal/src/pages/RunDetail.tsx | 132 +++++++++++++++++-
apps/portal/src/pages/SubmitRun.tsx | 47 +++++++
apps/portal/src/types.ts | 40 +++++-
16 files changed, 659 insertions(+), 55 deletions(-)
create mode 100644 apps/portal/src/components/CriteriaBadge.stories.tsx
create mode 100644 apps/portal/src/components/ObservationTaxonomySelect.stories.tsx
create mode 100644 apps/portal/src/components/ObservationTaxonomySelect.tsx
diff --git a/apps/portal/src/components/CreateCriterionDialog.tsx b/apps/portal/src/components/CreateCriterionDialog.tsx
index 188009aac..be51969f3 100644
--- a/apps/portal/src/components/CreateCriterionDialog.tsx
+++ b/apps/portal/src/components/CreateCriterionDialog.tsx
@@ -15,6 +15,7 @@ import {
} from "@/components/ui/dialog";
import { ArrowLeft, Loader2, Sparkles } from "lucide-react";
import type { GateId } from "@/lib/gates";
+import type { CriterionKind } from "@/types";
interface CreateCriterionDialogProps {
open: boolean;
@@ -25,12 +26,15 @@ interface CreateCriterionDialogProps {
defaultGates?: GateId[];
/** Gates that cannot be unselected (e.g. the gate this criterion is created for) */
lockedGates?: GateId[];
+ /** Pre-populated criteria kind (defaults to gate) */
+ defaultKind?: CriterionKind;
}
-export function CreateCriterionDialog({ open, onOpenChange, onCreated, defaultGates, lockedGates }: CreateCriterionDialogProps) {
+export function CreateCriterionDialog({ open, onOpenChange, onCreated, defaultGates, lockedGates, defaultKind }: CreateCriterionDialogProps) {
const wizard = useCriteriaWizard({
initialGates: defaultGates,
lockedGates,
+ initialKind: defaultKind,
onSuccess: (id) => {
onCreated(id);
handleOpenChange(false);
diff --git a/apps/portal/src/components/CriteriaBadge.stories.tsx b/apps/portal/src/components/CriteriaBadge.stories.tsx
new file mode 100644
index 000000000..e851b3aec
--- /dev/null
+++ b/apps/portal/src/components/CriteriaBadge.stories.tsx
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { Meta, StoryObj } from "@storybook/react-vite";
+import { CriteriaBadge, CriteriaKindBadge } from "./CriteriaBadge";
+
+const meta = {
+ title: "Components/CriteriaBadge",
+ component: CriteriaBadge,
+ tags: ["ai-generated", "needs-work"],
+} satisfies Meta;
+
+export default meta;
+type Story = StoryObj;
+
+export const GateCriterion: Story = {
+ args: {
+ criterionId: "has_unit_tests",
+ kind: "gate",
+ evaluated: true,
+ result: true,
+ showStateLabel: true,
+ link: false,
+ },
+};
+
+export const ObservationCriterion: Story = {
+ args: {
+ criterionId: "uses_current_sdk",
+ kind: "observation",
+ evaluated: true,
+ result: false,
+ showStateLabel: true,
+ link: false,
+ },
+};
+
+export const KindBadges: Story = {
+ args: {
+ criterionId: "has_unit_tests",
+ link: false,
+ },
+ render: () => (
+
+
+
+
+ ),
+};
diff --git a/apps/portal/src/components/CriteriaBadge.tsx b/apps/portal/src/components/CriteriaBadge.tsx
index f05b00b77..d1cc1bbc3 100644
--- a/apps/portal/src/components/CriteriaBadge.tsx
+++ b/apps/portal/src/components/CriteriaBadge.tsx
@@ -5,6 +5,7 @@ import { Link } from "react-router-dom";
import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";
import { criterionResultStyle, type CriterionResultState } from "@/lib/criteria-result";
+import type { CriterionKind } from "@/types";
interface CriteriaBadgeProps {
criterionId: string;
@@ -13,6 +14,7 @@ interface CriteriaBadgeProps {
link?: boolean;
showStateLabel?: boolean;
className?: string;
+ kind?: CriterionKind;
}
export function CriteriaBadge({
@@ -22,22 +24,30 @@ export function CriteriaBadge({
link = true,
showStateLabel = false,
className,
+ kind,
}: CriteriaBadgeProps) {
+ const kindLabel = kind === "observation" ? "Obs" : kind === "gate" ? "Gate" : undefined;
const content = !evaluated ? (
-
- {criterionId}
-
+
+
+ {criterionId}
+
+ {kindLabel && }
+
) : (() => {
const { colorClass, Icon, label, title } = criterionResultStyle(result);
return (
-
-
- {showStateLabel ? `${criterionId}: ${label}` : criterionId}
-
+
+
+
+ {showStateLabel ? `${criterionId}: ${label}` : criterionId}
+
+ {kindLabel && }
+
);
})();
@@ -49,3 +59,19 @@ export function CriteriaBadge({
);
}
+
+export function CriteriaKindBadge({ kind, className }: { kind?: CriterionKind; className?: string }) {
+ const normalized = kind ?? "gate";
+ return (
+
+ {normalized === "observation" ? "Observation" : "Gate"}
+
+ );
+}
diff --git a/apps/portal/src/components/CriteriaFilterBar.tsx b/apps/portal/src/components/CriteriaFilterBar.tsx
index 3c1dff4f0..ec34abfad 100644
--- a/apps/portal/src/components/CriteriaFilterBar.tsx
+++ b/apps/portal/src/components/CriteriaFilterBar.tsx
@@ -4,6 +4,7 @@
import { Filter, X } from "lucide-react";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
+import type { CriterionKind } from "@/types";
interface CriteriaFilterBarProps {
availableCriteria: string[];
@@ -16,6 +17,10 @@ interface CriteriaFilterBarProps {
emptyDescription?: string;
/** Override the description template when criteria are selected (receives count) */
selectedDescription?: (count: number) => string;
+ /** Optional kind metadata for rendering gate/observation filter chips. */
+ criteriaKinds?: Record;
+ selectedKinds?: CriterionKind[];
+ onToggleKind?: (kind: CriterionKind) => void;
}
export function CriteriaFilterBar({
@@ -27,12 +32,22 @@ export function CriteriaFilterBar({
emptyDescription = "Click criteria to filter runs and redefine success. Default: all criteria in each run must pass.",
selectedDescription = (count: number) =>
`Success = all ${count} selected criteria pass. Runs without these criteria are excluded.`,
+ criteriaKinds,
+ selectedKinds = [],
+ onToggleKind,
}: CriteriaFilterBarProps) {
if (availableCriteria.length === 0) {
return null;
}
const selectedSet = new Set(selectedCriteria);
+ const selectedKindSet = new Set(selectedKinds);
+ const kindCounts = criteriaKinds
+ ? {
+ gate: availableCriteria.filter((id) => (criteriaKinds[id] ?? "gate") === "gate").length,
+ observation: availableCriteria.filter((id) => criteriaKinds[id] === "observation").length,
+ }
+ : undefined;
return (
@@ -58,6 +73,20 @@ export function CriteriaFilterBar({
+ {kindCounts && onToggleKind && (
+
+ {(["gate", "observation"] as const).map((kind) => (
+ onToggleKind(kind)}
+ >
+ {kind} ({kindCounts[kind]})
+
+ ))}
+
+ )}
{availableCriteria.map((id) => {
const isSelected = selectedSet.has(id);
diff --git a/apps/portal/src/components/CriteriaPicker.tsx b/apps/portal/src/components/CriteriaPicker.tsx
index 05e04a454..19ed40767 100644
--- a/apps/portal/src/components/CriteriaPicker.tsx
+++ b/apps/portal/src/components/CriteriaPicker.tsx
@@ -10,7 +10,7 @@ import { Input } from "@/components/ui/input";
import { Skeleton } from "@/components/ui/skeleton";
import { Search, X, Sparkles } from "lucide-react";
import { GATE_METADATA, isCriterionCompatibleWithGate, type GateId } from "@/lib/gates";
-import type { CriteriaDocument } from "@/types";
+import type { CriteriaDocument, CriterionKind } from "@/types";
interface CriteriaPickerProps {
selected: string[];
@@ -23,6 +23,8 @@ interface CriteriaPickerProps {
trailingAction?: ReactNode;
/** Restrict suggestions to criteria compatible with this gate */
gate?: GateId;
+ /** Restrict suggestions by criterion kind. Missing kind is treated as "gate". */
+ kind?: CriterionKind;
/**
* Additional predicate restricting which criteria are offered as suggestions.
* Used to enforce gate-compatibility invariants (e.g. only show criteria that
@@ -31,7 +33,7 @@ interface CriteriaPickerProps {
filter?: (criterion: CriteriaDocument) => boolean;
}
-export function CriteriaPicker({ selected, onChange, aiSuggested = [], inputId, trailingAction, gate, filter }: CriteriaPickerProps) {
+export function CriteriaPicker({ selected, onChange, aiSuggested = [], inputId, trailingAction, gate, kind, filter }: CriteriaPickerProps) {
const [query, setQuery] = useState("");
const [open, setOpen] = useState(false);
const [highlightIdx, setHighlightIdx] = useState(0);
@@ -49,6 +51,7 @@ export function CriteriaPicker({ selected, onChange, aiSuggested = [], inputId,
const suggestions = useMemo(() => {
const available = criteria.filter((c) =>
!selected.includes(c.id) &&
+ (!kind || (c.kind ?? "gate") === kind) &&
(!gate || isCriterionCompatibleWithGate(c.gates, gate)) &&
(!filter || filter(c))
);
@@ -57,7 +60,7 @@ export function CriteriaPicker({ selected, onChange, aiSuggested = [], inputId,
return available.filter(
(c) => c.id.toLowerCase().includes(q) || c.prompt.toLowerCase().includes(q),
);
- }, [criteria, selected, query, gate, filter]);
+ }, [criteria, selected, query, gate, kind, filter]);
// Reset highlight when suggestions change
useEffect(() => {
@@ -212,7 +215,7 @@ export function CriteriaPicker({ selected, onChange, aiSuggested = [], inputId,
}}
onFocus={() => setOpen(true)}
onKeyDown={handleKeyDown}
- placeholder={gate ? `Search ${GATE_METADATA[gate].label} criteria…` : "Type to search criteria…"}
+ placeholder={kind === "observation" ? "Search observation criteria…" : gate ? `Search ${GATE_METADATA[gate].label} criteria…` : "Type to search criteria…"}
className="h-9 font-mono text-sm"
/>
{trailingAction}
diff --git a/apps/portal/src/components/CriteriaWizardStep1.tsx b/apps/portal/src/components/CriteriaWizardStep1.tsx
index 252ca52ae..c6a182b36 100644
--- a/apps/portal/src/components/CriteriaWizardStep1.tsx
+++ b/apps/portal/src/components/CriteriaWizardStep1.tsx
@@ -4,7 +4,9 @@
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { GateCompatibilityPicker } from "@/components/GateCompatibilityPicker";
+import { ObservationTaxonomySelect } from "@/components/ObservationTaxonomySelect";
import type { CriteriaWizardState } from "@/hooks/useCriteriaWizard";
interface CriteriaWizardStep1Props {
@@ -26,6 +28,10 @@ export function CriteriaWizardStep1({ wizard, idPrefix = "" }: CriteriaWizardSte
gates,
setGates,
lockedGates,
+ kind,
+ setKind,
+ taxonomyElementId,
+ setTaxonomyElementId,
} = wizard;
return (
@@ -89,15 +95,42 @@ export function CriteriaWizardStep1({ wizard, idPrefix = "" }: CriteriaWizardSte
- {/* Gate compatibility */}
+ {/* Criteria kind */}
-
Gate compatibility
-
+
+ Criteria kind
+
+
setKind(value as typeof kind)}>
+
+
+
+
+ Gate — controls pass/fail iteration flow
+ Observation — records per-iteration evidence
+
+
- Select the gates this criterion applies to. Parents must be compatible with every
- selected gate. This drives the gate-aware parent/child suggestions on the next step.
+ Gate criteria drive judge feedback. Observations are recorded after each iteration and never gate the agent.
+
+ {/* Gate compatibility */}
+ {kind === "gate" ? (
+
+
Gate compatibility
+
+
+ Select the gates this criterion applies to. Parents must be compatible with every
+ selected gate. This drives the gate-aware parent/child suggestions on the next step.
+
+
+ ) : (
+
+ )}
);
}
diff --git a/apps/portal/src/components/CriteriaWizardStep2.tsx b/apps/portal/src/components/CriteriaWizardStep2.tsx
index 9d56df64a..2e4e52cb4 100644
--- a/apps/portal/src/components/CriteriaWizardStep2.tsx
+++ b/apps/portal/src/components/CriteriaWizardStep2.tsx
@@ -8,6 +8,7 @@ import { Badge } from "@/components/ui/badge";
import { Separator } from "@/components/ui/separator";
import { CriteriaPicker } from "@/components/CriteriaPicker";
import { gatesSatisfyInvariant, GATE_METADATA, orderGateIds } from "@/lib/gates";
+import { TAXONOMY_ELEMENT_METADATA } from "@/types";
import { Loader2, Check, RefreshCw } from "lucide-react";
import type { CriteriaWizardState } from "@/hooks/useCriteriaWizard";
@@ -22,6 +23,8 @@ export function CriteriaWizardStep2({ wizard }: CriteriaWizardStep2Props) {
dependsOn,
setDependsOn,
gates,
+ kind = "gate",
+ taxonomyElementId,
prompt,
setPrompt,
aiGenerated,
@@ -55,6 +58,15 @@ export function CriteriaWizardStep2({ wizard }: CriteriaWizardStep2Props) {
{id}
+
+
+ Kind
+
+
+ {kind === "observation" ? "Observation" : "Gate"}
+
+
+ {kind === "gate" ? (
Gate compatibility
@@ -71,6 +83,16 @@ export function CriteriaWizardStep2({ wizard }: CriteriaWizardStep2Props) {
)}
+ ) : (
+
+
+ Observation dimension
+
+
+ {taxonomyElementId ? TAXONOMY_ELEMENT_METADATA[taxonomyElementId].label : "Unclassified"}
+
+
+ )}
@@ -84,11 +106,14 @@ export function CriteriaWizardStep2({ wizard }: CriteriaWizardStep2Props) {
selected={dependsOn}
onChange={setDependsOn}
aiSuggested={suggestedParents}
- filter={(c) => gatesSatisfyInvariant(c.gates, gates) && !acceptedChildren.includes(c.id)}
+ filter={(c) =>
+ (c.kind ?? "gate") === kind &&
+ (kind === "observation" || gatesSatisfyInvariant(c.gates, gates)) &&
+ !acceptedChildren.includes(c.id)
+ }
/>
- Criteria that must pass before this one is evaluated. Only criteria compatible with
- every selected gate are shown. List only direct parents —
+ Criteria that must pass before this one is evaluated. {kind === "gate" ? "Only criteria compatible with every selected gate are shown." : "Only observation criteria are shown."} List only direct parents —
the judge automatically evaluates all transitive ancestors in topological order,
so you don't need to repeat a parent's own dependencies here.
@@ -105,11 +130,15 @@ export function CriteriaWizardStep2({ wizard }: CriteriaWizardStep2Props) {
selected={acceptedChildren}
onChange={setAcceptedChildren}
aiSuggested={suggestedChildren}
- filter={(c) => gatesSatisfyInvariant(gates, c.gates) && !dependsOn.includes(c.id)}
+ filter={(c) =>
+ (c.kind ?? "gate") === kind &&
+ (kind === "observation" || gatesSatisfyInvariant(gates, c.gates)) &&
+ !dependsOn.includes(c.id)
+ }
/>
These criteria will be updated to depend on {id || "this criterion"} after creation.
- Only criteria compatible with a subset of the selected gates are shown.
+ {kind === "gate" ? " Only criteria compatible with a subset of the selected gates are shown." : " Only observation criteria are shown."}
diff --git a/apps/portal/src/components/ObservationTaxonomySelect.stories.tsx b/apps/portal/src/components/ObservationTaxonomySelect.stories.tsx
new file mode 100644
index 000000000..aab2ab344
--- /dev/null
+++ b/apps/portal/src/components/ObservationTaxonomySelect.stories.tsx
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { useState } from "react";
+import type { Meta, StoryObj } from "@storybook/react-vite";
+import { ObservationTaxonomySelect } from "./ObservationTaxonomySelect";
+import type { TaxonomyElementId } from "@/types";
+
+const meta = {
+ title: "Components/ObservationTaxonomySelect",
+ component: ObservationTaxonomySelect,
+ tags: ["ai-generated", "needs-work"],
+} satisfies Meta;
+
+export default meta;
+type Story = StoryObj;
+
+export const Default: Story = {
+ args: {
+ value: "dimension:idiomatic-use",
+ onChange: () => undefined,
+ },
+ render: () => {
+ const [value, setValue] = useState("dimension:idiomatic-use");
+ return (
+
+
+
+ );
+ },
+};
diff --git a/apps/portal/src/components/ObservationTaxonomySelect.tsx b/apps/portal/src/components/ObservationTaxonomySelect.tsx
new file mode 100644
index 000000000..1bdfabd7e
--- /dev/null
+++ b/apps/portal/src/components/ObservationTaxonomySelect.tsx
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { Label } from "@/components/ui/label";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
+import { TAXONOMY_ELEMENT_IDS, TAXONOMY_ELEMENT_METADATA, type TaxonomyElementId } from "@/types";
+
+interface ObservationTaxonomySelectProps {
+ value?: TaxonomyElementId;
+ onChange: (value: TaxonomyElementId | undefined) => void;
+ id?: string;
+ label?: string;
+}
+
+export function ObservationTaxonomySelect({
+ value,
+ onChange,
+ id,
+ label = "Observation dimension",
+}: ObservationTaxonomySelectProps) {
+ return (
+
+
{label}
+
onChange(next === "__none" ? undefined : next as TaxonomyElementId)}
+ >
+
+
+
+
+ Unclassified
+ {TAXONOMY_ELEMENT_IDS.map((taxonomyId) => {
+ const metadata = TAXONOMY_ELEMENT_METADATA[taxonomyId];
+ return (
+
+ {metadata.label}
+
+ );
+ })}
+
+
+
+ {value ? TAXONOMY_ELEMENT_METADATA[value].description : "Leave unset to group results as unclassified."}
+
+
+ );
+}
diff --git a/apps/portal/src/hooks/useCriteriaWizard.ts b/apps/portal/src/hooks/useCriteriaWizard.ts
index 88575feb6..3033c2d49 100644
--- a/apps/portal/src/hooks/useCriteriaWizard.ts
+++ b/apps/portal/src/hooks/useCriteriaWizard.ts
@@ -7,6 +7,7 @@ import { api } from "@/lib/api";
import { slugify } from "@/lib/utils";
import { toast } from "sonner";
import { gatesSatisfyInvariant, type GateId } from "@/lib/gates";
+import type { CriterionKind, TaxonomyElementId } from "@/types";
export interface UseCriteriaWizardOptions {
/** Pre-populated parent dependency IDs */
@@ -15,11 +16,20 @@ export interface UseCriteriaWizardOptions {
initialGates?: GateId[];
/** Gates that cannot be unselected in the gate picker (e.g. inline creation) */
lockedGates?: GateId[];
+ initialKind?: CriterionKind;
+ initialTaxonomyElementId?: TaxonomyElementId;
/** Called with the new criterion ID after successful creation */
onSuccess: (id: string) => void;
}
-export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedGates, onSuccess }: UseCriteriaWizardOptions) {
+export function useCriteriaWizard({
+ initialDependsOn = [],
+ initialGates,
+ lockedGates,
+ initialKind = "gate",
+ initialTaxonomyElementId,
+ onSuccess,
+}: UseCriteriaWizardOptions) {
const queryClient = useQueryClient();
// Wizard step (1 or 2)
@@ -31,6 +41,8 @@ export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedG
const [idManuallyEdited, setIdManuallyEdited] = useState(false);
const [dependsOn, setDependsOn] = useState(initialDependsOn);
const [gates, setGates] = useState(initialGates ?? ["select"]);
+ const [kind, setKind] = useState(initialKind);
+ const [taxonomyElementId, setTaxonomyElementId] = useState(initialTaxonomyElementId);
// Step 2 fields
const [prompt, setPrompt] = useState("");
@@ -53,7 +65,13 @@ export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedG
() => existingCriteria.some((c) => c.id === id.trim()),
[id, existingCriteria],
);
- const canContinue = behavior.trim().length > 0 && id.trim().length > 0 && idValid && !idExists && !criteriaLoading;
+ const canContinue =
+ behavior.trim().length > 0 &&
+ id.trim().length > 0 &&
+ idValid &&
+ !idExists &&
+ !criteriaLoading &&
+ (kind === "observation" || !!gates?.length);
// Gate compatibility lookup for parent/child suggestion filtering.
const criterionGatesById = useMemo(() => {
@@ -71,17 +89,17 @@ export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedG
useEffect(() => {
setDependsOn((prev) => {
const next = prev.filter(
- (pid) => !criterionGatesById.has(pid) || gatesSatisfyInvariant(criterionGatesById.get(pid), gates),
+ (pid) => kind === "observation" || !criterionGatesById.has(pid) || gatesSatisfyInvariant(criterionGatesById.get(pid), gates),
);
return next.length === prev.length ? prev : next;
});
setAcceptedChildren((prev) => {
const next = prev.filter(
- (cid) => !criterionGatesById.has(cid) || gatesSatisfyInvariant(gates, criterionGatesById.get(cid)),
+ (cid) => kind === "observation" || !criterionGatesById.has(cid) || gatesSatisfyInvariant(gates, criterionGatesById.get(cid)),
);
return next.length === prev.length ? prev : next;
});
- }, [gates, criterionGatesById, suggestedParents, suggestedChildren]);
+ }, [gates, kind, criterionGatesById, suggestedParents, suggestedChildren]);
// Auto-suggest ID from behavior (unless manually edited)
const handleBehaviorChange = useCallback(
@@ -166,8 +184,8 @@ export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedG
// Step 1 → Step 2
const handleContinue = useCallback(() => {
setStep(2);
- generateMutation.mutate({ behavior: behavior.trim(), gates });
- }, [behavior, gates, generateMutation]);
+ generateMutation.mutate({ behavior: behavior.trim(), gates: kind === "gate" ? gates : undefined });
+ }, [behavior, gates, kind, generateMutation]);
// Step 2 → Submit
const handleCreate = useCallback(() => {
@@ -176,17 +194,19 @@ export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedG
id: id.trim(),
prompt: prompt.trim(),
dependsOn: dependsOn.length > 0 ? dependsOn : undefined,
- gates,
+ ...(kind === "gate" ? { gates } : {}),
+ kind,
+ ...(kind === "observation" && taxonomyElementId ? { taxonomyElementId } : {}),
});
- }, [id, prompt, dependsOn, gates, createMutation]);
+ }, [id, prompt, dependsOn, gates, kind, taxonomyElementId, createMutation]);
// Regenerate prompt
const handleRegenerate = useCallback(() => {
setSuggestedParents([]);
setSuggestedChildren([]);
setAcceptedChildren([]);
- generateMutation.mutate({ behavior: behavior.trim(), gates });
- }, [behavior, gates, generateMutation]);
+ generateMutation.mutate({ behavior: behavior.trim(), gates: kind === "gate" ? gates : undefined });
+ }, [behavior, gates, kind, generateMutation]);
// Reset all state to initial values
const reset = useCallback(() => {
@@ -196,12 +216,14 @@ export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedG
setIdManuallyEdited(false);
setDependsOn(initialDependsOn);
setGates(initialGates ?? ["select"]);
+ setKind(initialKind);
+ setTaxonomyElementId(initialTaxonomyElementId);
setPrompt("");
setAiGenerated(false);
setSuggestedParents([]);
setSuggestedChildren([]);
setAcceptedChildren([]);
- }, [initialDependsOn, initialGates]);
+ }, [initialDependsOn, initialGates, initialKind, initialTaxonomyElementId]);
return {
// State
@@ -217,6 +239,10 @@ export function useCriteriaWizard({ initialDependsOn = [], initialGates, lockedG
gates,
setGates,
lockedGates,
+ kind,
+ setKind,
+ taxonomyElementId,
+ setTaxonomyElementId,
prompt,
setPrompt,
aiGenerated,
diff --git a/apps/portal/src/lib/api.ts b/apps/portal/src/lib/api.ts
index c3e275f09..281fad7dd 100644
--- a/apps/portal/src/lib/api.ts
+++ b/apps/portal/src/lib/api.ts
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-import type { Run, RunState, CriteriaDocument, CriteriaGraphData, GeneratePromptResponse, AnalysisResponse, PromptFeatureDocument, Report, BulkReportStatus, BulkReportSummary, ReportTemplate, ReportTrigger, ReportTemplateSystemPrompt, KeyDocument, KeyValidationResult, CreateKeyRequest, UpdateKeyRequest, CodingAgent, AgentVersion, McpServerDocument, CreateMcpServerRequest, UpdateMcpServerRequest, BulkResubmitOverrides, Insight, InsightWithReference, TaskPrompt, TaskPromptFeatureExtractionResult, Model, FeatureFlag, SkillDocument, SkillSearchResult, SkillDiscoveryResult, SkillRevisionDocument, CodebaseDocument, CodebaseRevisionDocument, CodebaseSourceType, ExtensionDocument, ExtensionSearchResult, ExtensionVersionInfo, MdpResponse, AccountDocument, CreateAccountRequest, UpdateAccountRequest, ProfileWithVersion, ProfileVersionDocument, ProfileDocument, RunGroup, CursorPaginatedResponse, IterationOp, GateConfig, GateId, PromptType } from "@/types";
+import type { Run, RunState, CriteriaDocument, CriteriaGraphData, GeneratePromptResponse, AnalysisResponse, PromptFeatureDocument, Report, BulkReportStatus, BulkReportSummary, ReportTemplate, ReportTrigger, ReportTemplateSystemPrompt, KeyDocument, KeyValidationResult, CreateKeyRequest, UpdateKeyRequest, CodingAgent, AgentVersion, McpServerDocument, CreateMcpServerRequest, UpdateMcpServerRequest, BulkResubmitOverrides, Insight, InsightWithReference, TaskPrompt, TaskPromptFeatureExtractionResult, Model, FeatureFlag, SkillDocument, SkillSearchResult, SkillDiscoveryResult, SkillRevisionDocument, CodebaseDocument, CodebaseRevisionDocument, CodebaseSourceType, ExtensionDocument, ExtensionSearchResult, ExtensionVersionInfo, MdpResponse, AccountDocument, CreateAccountRequest, UpdateAccountRequest, ProfileWithVersion, ProfileVersionDocument, ProfileDocument, RunGroup, CursorPaginatedResponse, IterationOp, GateConfig, GateId, PromptType, CriterionKind, TaxonomyElementId } from "@/types";
import { qs } from "./url";
import { recordServerDate } from "./serverClock";
@@ -81,6 +81,7 @@ export const api = {
/** Submit a new run (or multiple runs if count > 1) */
submitRun: (body: {
scenario: { task: string; criteria: string[]; version?: "v1" | "v2" };
+ observations?: string[];
worker?: string;
model?: string;
reasoningEffort?: string;
@@ -317,7 +318,7 @@ export const api = {
},
/** Create a new criterion */
- createCriterion: (body: { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[] }): Promise => {
+ createCriterion: (body: { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }): Promise => {
return request("/criteria", {
method: "POST",
body: JSON.stringify(body),
@@ -325,7 +326,7 @@ export const api = {
},
/** Update an existing criterion */
- updateCriterion: (id: string, body: { prompt?: string; dependsOn?: string[]; gates?: GateId[] }): Promise => {
+ updateCriterion: (id: string, body: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }): Promise => {
return request(`/criteria/${id}`, {
method: "PUT",
body: JSON.stringify(body),
diff --git a/apps/portal/src/pages/CriteriaList.tsx b/apps/portal/src/pages/CriteriaList.tsx
index 2f64e390a..3c07c9800 100644
--- a/apps/portal/src/pages/CriteriaList.tsx
+++ b/apps/portal/src/pages/CriteriaList.tsx
@@ -35,12 +35,16 @@ import {
type CustomizeColumnsOption,
} from "@/components/list-layout";
import { HelpTooltip } from "@/components/HelpTooltip";
+import { CriteriaKindBadge } from "@/components/CriteriaBadge";
+import { TAXONOMY_ELEMENT_METADATA } from "@/types";
-const FILTER_KEYS = ["gate"] as const;
+const FILTER_KEYS = ["gate", "kind"] as const;
const COLUMN_OPTIONS: CustomizeColumnsOption[] = [
{ id: "id", label: "ID", required: true },
{ id: "prompt", label: "Prompt" },
+ { id: "kind", label: "Kind" },
+ { id: "taxonomy", label: "Dimension" },
{ id: "gates", label: "Gates" },
{ id: "dependencies", label: "Dependencies" },
{ id: "actions", label: "Actions" },
@@ -87,12 +91,17 @@ export function CriteriaList() {
const sortedCriteria = useMemo(() => {
const selectedGates = state.getFilterList("gate") as GateId[];
+ const selectedKinds = state.getFilterList("kind");
// A criterion matches if it is compatible with any selected gate (OR).
// Criteria with no explicit gates are compatible with every gate.
- const filtered =
+ const gateFiltered =
selectedGates.length === 0
? criteria
- : criteria.filter((c) => selectedGates.some((g) => isCriterionCompatibleWithGate(c.gates, g)));
+ : criteria.filter((c) => (c.kind ?? "gate") === "gate" && selectedGates.some((g) => isCriterionCompatibleWithGate(c.gates, g)));
+ const filtered =
+ selectedKinds.length === 0
+ ? gateFiltered
+ : gateFiltered.filter((c) => selectedKinds.includes(c.kind ?? "gate"));
if (!state.sort) return filtered;
const sorted = [...filtered];
sorted.sort((a, b) => {
@@ -111,11 +120,19 @@ export function CriteriaList() {
visibleGates.map((gate) => ({
value: gate,
label: GATE_METADATA[gate].label,
- count: criteria.filter((c) => isCriterionCompatibleWithGate(c.gates, gate)).length,
+ count: criteria.filter((c) => (c.kind ?? "gate") === "gate" && isCriterionCompatibleWithGate(c.gates, gate)).length,
})),
[criteria, visibleGates],
);
+ const kindFilterOptions = useMemo(
+ () => [
+ { value: "gate", label: "Gate", count: criteria.filter((c) => (c.kind ?? "gate") === "gate").length },
+ { value: "observation", label: "Observation", count: criteria.filter((c) => c.kind === "observation").length },
+ ],
+ [criteria],
+ );
+
const total = sortedCriteria.length;
const pageStart = (state.page - 1) * state.pageSize;
const pageItems = sortedCriteria.slice(pageStart, pageStart + state.pageSize);
@@ -159,15 +176,41 @@ export function CriteriaList() {
{truncate(c.prompt, 100)}
),
},
+ {
+ id: "kind",
+ header: "Kind",
+ width: "130px",
+ hidden: visibility.isHidden("kind"),
+ cell: (c) => ,
+ },
+ {
+ id: "taxonomy",
+ header: "Dimension",
+ width: "190px",
+ hidden: visibility.isHidden("taxonomy"),
+ cell: (c) => (
+
+ {c.kind === "observation" && c.taxonomyElementId
+ ? TAXONOMY_ELEMENT_METADATA[c.taxonomyElementId].label
+ : c.kind === "observation"
+ ? "Unclassified"
+ : "—"}
+
+ ),
+ },
{
id: "gates",
header: "Gates",
width: "160px",
hidden: visibility.isHidden("gates"),
cell: (c) => (
-
- {formatGateList(c.gates)}
-
+ c.kind === "observation" ? (
+ Record-only
+ ) : (
+
+ {formatGateList(c.gates)}
+
+ )
),
},
{
@@ -297,6 +340,13 @@ export function CriteriaList() {
onToggle={(value) => state.toggleFilterValue("gate", value)}
/>
+
+ state.toggleFilterValue("kind", value)}
+ />
+
}
secondaryPanel={
diff --git a/apps/portal/src/pages/CriterionDetail.tsx b/apps/portal/src/pages/CriterionDetail.tsx
index 82c951105..51ec8b358 100644
--- a/apps/portal/src/pages/CriterionDetail.tsx
+++ b/apps/portal/src/pages/CriterionDetail.tsx
@@ -11,6 +11,7 @@ import { Badge } from "@/components/ui/badge";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { Label } from "@/components/ui/label";
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Separator } from "@/components/ui/separator";
import {
AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent,
@@ -19,7 +20,9 @@ import {
import { Skeleton } from "@/components/ui/skeleton";
import { ArrowLeft, Save, Trash2, Loader2, Sparkles, Check, X, Plus, Download } from "lucide-react";
import { CriteriaPicker } from "@/components/CriteriaPicker";
+import { CriteriaKindBadge } from "@/components/CriteriaBadge";
import { GateCompatibilityPicker } from "@/components/GateCompatibilityPicker";
+import { ObservationTaxonomySelect } from "@/components/ObservationTaxonomySelect";
import { formatDate } from "@/lib/utils";
import {
formatGateList,
@@ -30,6 +33,7 @@ import { useCommandEnter } from "@/hooks/useCommandEnter";
import { KbdBadge } from "@/components/KbdBadge";
import { criteriaToExportYaml, downloadAsFile } from "@/lib/criteria-export";
import { toast } from "sonner";
+import { TAXONOMY_ELEMENT_METADATA, type CriterionKind, type TaxonomyElementId } from "@/types";
export function CriterionDetail() {
const { id } = useParams<{ id: string }>();
@@ -49,6 +53,8 @@ export function CriterionDetail() {
const [prompt, setPrompt] = useState("");
const [editDependsOn, setEditDependsOn] = useState([]);
const [editGates, setEditGates] = useState(undefined);
+ const [editKind, setEditKind] = useState("gate");
+ const [editTaxonomyElementId, setEditTaxonomyElementId] = useState(undefined);
// AI Suggest state
const [aiSuggestOpen, setAiSuggestOpen] = useState(false);
@@ -64,7 +70,7 @@ export function CriterionDetail() {
});
const updateMutation = useMutation({
- mutationFn: (body: { prompt?: string; dependsOn?: string[]; gates?: GateId[] }) =>
+ mutationFn: (body: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }) =>
api.updateCriterion(id!, body),
onSuccess: async () => {
// Update accepted children to depend on this criterion
@@ -125,6 +131,8 @@ export function CriterionDetail() {
setPrompt(criterion.prompt);
setEditDependsOn(criterion.dependsOn ?? []);
setEditGates(criterion.gates && criterion.gates.length > 0 ? criterion.gates : ["select"]);
+ setEditKind(criterion.kind ?? "gate");
+ setEditTaxonomyElementId(criterion.taxonomyElementId);
setAiSuggestOpen(false);
setBehaviorInput("");
setSuggestedPrompt(null);
@@ -135,14 +143,16 @@ export function CriterionDetail() {
};
const handleSave = () => {
- if (!editGates || editGates.length === 0) return;
+ if (editKind === "gate" && (!editGates || editGates.length === 0)) return;
updateMutation.mutate({
prompt: prompt.trim(),
// Always send the array (even empty) so removing the last dependency
// persists. The backend treats `undefined` as "no change", so collapsing
// [] to undefined here silently dropped deletions.
dependsOn: editDependsOn,
- gates: editGates,
+ ...(editKind === "gate" ? { gates: editGates } : {}),
+ kind: editKind,
+ taxonomyElementId: editKind === "observation" ? editTaxonomyElementId : undefined,
});
};
@@ -164,13 +174,13 @@ export function CriterionDetail() {
? [
...editDependsOn.flatMap((depId) => {
const parent = allCriteria.find((c) => c.id === depId);
- return parent && !gatesSatisfyInvariant(parent.gates, editGates)
+ return editKind === "gate" && parent && !gatesSatisfyInvariant(parent.gates, editGates)
? [`Parent '${depId}' must include ${formatGateList(editGates)}.`]
: [];
}),
...(criterion?.dependents.flatMap((childId) => {
const child = allCriteria.find((c) => c.id === childId);
- return child && !gatesSatisfyInvariant(editGates, child.gates)
+ return editKind === "gate" && child && !gatesSatisfyInvariant(editGates, child.gates)
? [`Dependent '${childId}' requires ${formatGateList(child.gates)} compatibility.`]
: [];
}) ?? []),
@@ -451,7 +461,54 @@ export function CriterionDetail() {
+ {/* Kind */}
+
+
+ Kind
+
+ Whether this criterion gates iteration flow or records observation evidence.
+
+
+
+ {editing ? (
+ <>
+
+ Criteria kind
+ setEditKind(value as CriterionKind)}>
+
+
+
+
+ Gate — controls pass/fail iteration flow
+ Observation — records per-iteration evidence
+
+
+
+ {editKind === "observation" && (
+
+ )}
+ >
+ ) : (
+
+
+ {(criterion.kind ?? "gate") === "observation" && (
+
+ {criterion.taxonomyElementId
+ ? TAXONOMY_ELEMENT_METADATA[criterion.taxonomyElementId].label
+ : "Unclassified"}
+
+ )}
+
+ )}
+
+
+
{/* Gate compatibility */}
+ {(editing ? editKind === "gate" : (criterion.kind ?? "gate") === "gate") && (
Gate compatibility
@@ -479,6 +536,7 @@ export function CriterionDetail() {
)}
+ )}
{/* Dependencies */}
@@ -495,6 +553,8 @@ export function CriterionDetail() {
c.id !== criterion.id && (editKind === "observation" || gatesSatisfyInvariant(c.gates, editGates))}
/>
) : (criterion.dependsOn ?? []).length > 0 ? (
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index eb2732011..12308f173 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -41,7 +41,14 @@ import {
} from "@/lib/gates";
import { useState, useMemo, useEffect, type ReactNode } from "react";
import { toast } from "sonner";
-import type { RunState, LogEvent } from "@/types";
+import {
+ TAXONOMY_ELEMENT_METADATA,
+ type CriteriaDocument,
+ type CriterionResult,
+ type RunState,
+ type LogEvent,
+ type TaxonomyElementId,
+} from "@/types";
import { useShiftModifier } from "@/hooks/useShiftModifier";
import { getRetryButtonState } from "@/components/RetryButton";
@@ -202,6 +209,91 @@ function CriteriaGateTabs({
);
}
+type ObservationDimensionKey = TaxonomyElementId | "unclassified";
+
+function observationDimensionLabel(key: ObservationDimensionKey): string {
+ return key === "unclassified" ? "Unclassified" : TAXONOMY_ELEMENT_METADATA[key].label;
+}
+
+function ObservationResultsPanel({
+ turns,
+ criteria,
+}: {
+ turns: RunState["turns"];
+ criteria: CriteriaDocument[];
+}) {
+ const criteriaById = useMemo(() => new Map(criteria.map((criterion) => [criterion.id, criterion])), [criteria]);
+ const groups = useMemo(() => {
+ const byDimension = new Map
[number]; result: CriterionResult; criterion?: CriteriaDocument }>>();
+ for (const turn of turns ?? []) {
+ for (const result of turn.observationResults ?? []) {
+ const criterion = criteriaById.get(result.criterionId);
+ const key: ObservationDimensionKey = criterion?.taxonomyElementId ?? "unclassified";
+ const existing = byDimension.get(key) ?? [];
+ existing.push({ turn, result, criterion });
+ byDimension.set(key, existing);
+ }
+ }
+ return Array.from(byDimension.entries()).sort(([a], [b]) => observationDimensionLabel(a).localeCompare(observationDimensionLabel(b)));
+ }, [turns, criteriaById]);
+
+ if (groups.length === 0) {
+ return (
+
+
+ No observation results have been recorded for this attempt.
+
+
+ );
+ }
+
+ return (
+
+ {groups.map(([dimension, items]) => (
+
+
+
+
+ Observation
+
+ {observationDimensionLabel(dimension)}
+
+
+
+ {items.map(({ turn, result, criterion }) => (
+
+
+ Iteration {turn.iteration}
+ {turn.gate && {GATE_METADATA[turn.gate].label} }
+ {result.criterionId}
+
+ {result.evaluated ? (
+ result.passed ? :
+ ) : (
+
+ )}
+ {result.evaluated ? (result.passed ? "True" : "False") : "Not evaluated"}
+
+
+ {criterion?.prompt && (
+
{criterion.prompt}
+ )}
+
+
Evidence
+
{result.feedback || "No evidence provided."}
+
+
+ ))}
+
+
+ ))}
+
+ );
+}
+
export function RunDetail() {
const { id, tab } = useParams<{ id: string; tab?: string }>();
const navigate = useNavigate();
@@ -300,6 +392,14 @@ export function RunDetail() {
enabled: !!taskPromptId,
});
+ const hasObservationResults = (activeRun?.turns ?? []).some((turn) => (turn.observationResults?.length ?? 0) > 0);
+ const hasConfiguredObservations = (run?.observations?.length ?? 0) > 0;
+ const { data: observationCriteria = [] } = useQuery({
+ queryKey: ["criteria", "observations", run?.observations],
+ queryFn: () => api.listCriteria(undefined, run?.observations?.length ? { ids: run.observations } : undefined),
+ enabled: hasConfiguredObservations || hasObservationResults,
+ });
+
// Fetch reports for this run
const { data: reports, refetch: refetchReports } = useQuery({
queryKey: ["run-reports", id],
@@ -860,6 +960,11 @@ export function RunDetail() {
{hasHarData && Network }
{hasHarData && Tool Calls }
{hasVideoData && Videos ({videoCount}) }
+ {(hasConfiguredObservations || hasObservationResults) && (
+
+ Observations {hasObservationResults ? `(${activeRun?.turns?.reduce((count, turn) => count + (turn.observationResults?.length ?? 0), 0) ?? 0})` : ""}
+
+ )}
Logs
Reports {reports && reports.length > 0 ? `(${reports.length})` : ""}
@@ -955,6 +1060,12 @@ export function RunDetail() {
)}
+ {(hasConfiguredObservations || hasObservationResults) && (
+
+
+
+ )}
+
{/* Logs tab */}
{criteriaGates.length > 0 && (
@@ -1175,6 +1286,25 @@ export function RunDetail() {
)}
+ {(run.observations?.length ?? 0) > 0 && (
+
+
Observations ({run.observations!.length})
+
+ {run.observations!.map((criterionId) => (
+
+ ))}
+
+
+ )}
diff --git a/apps/portal/src/pages/SubmitRun.tsx b/apps/portal/src/pages/SubmitRun.tsx
index bb40f1fca..e0c075802 100644
--- a/apps/portal/src/pages/SubmitRun.tsx
+++ b/apps/portal/src/pages/SubmitRun.tsx
@@ -197,6 +197,7 @@ export function SubmitRun() {
// Form state
const [task, setTask] = useState("");
const [pickedCriteria, setPickedCriteria] = useState([]);
+ const [pickedObservations, setPickedObservations] = useState([]);
const [worker, setWorker] = useState("coder-acp-copilot");
const [model, setModel] = useState("");
const [reasoningEffort, setReasoningEffort] = useState("");
@@ -228,6 +229,7 @@ export function SubmitRun() {
// Inline criteria creation dialog
const [createCriterionOpen, setCreateCriterionOpen] = useState(false);
+ const [createObservationOpen, setCreateObservationOpen] = useState(false);
const [gateCriterionDialog, setGateCriterionDialog] = useState | null>(null);
const [createProfileOpen, setCreateProfileOpen] = useState(false);
@@ -459,6 +461,7 @@ export function SubmitRun() {
const applyRecentRun = (run: Run) => {
if (run.scenario?.task) setTask(run.scenario.task);
if (run.scenario?.criteria) setPickedCriteria(run.scenario.criteria);
+ setPickedObservations(run.observations ?? []);
setWorker(run.workerType);
if (run.model) setModel(run.model);
if (run.agentVersion) setSelectedAgentVersion(run.agentVersion);
@@ -615,6 +618,7 @@ export function SubmitRun() {
submitMutation.mutate({
scenario: { task: task.trim(), criteria: pickedCriteria },
+ ...(pickedObservations.length > 0 ? { observations: pickedObservations } : {}),
...(inVariationMode ? {} : { ...(worker ? { worker } : {}) }),
...(inVariationMode ? {} : { ...(model ? { model } : {}) }),
...(inVariationMode ? {} : { ...(reasoningEffort ? { reasoningEffort } : {}) }),
@@ -713,6 +717,7 @@ export function SubmitRun() {
const summaryChips: string[] = [
`${maxIterations} iteration${maxIterations === 1 ? "" : "s"}`,
`${pickedCriteria.length} select criteri${pickedCriteria.length === 1 ? "on" : "a"}`,
+ pickedObservations.length > 0 ? `${pickedObservations.length} observation${pickedObservations.length === 1 ? "" : "s"}` : "",
gatesEnabled ? `${gateConfigs.length} configured gates` : "single-pass Select",
occurrences > 1 ? `×${occurrences} runs` : "",
worker,
@@ -939,6 +944,7 @@ export function SubmitRun() {
onChange={setPickedCriteria}
inputId="criteria"
gate="select"
+ kind="gate"
trailingAction={(
+
+
+
+ Observations{" "}
+ (record-only criteria)
+
+
+
+
setCreateObservationOpen(true)}
+ >
+
+ New…
+
+ )}
+ />
+ setPickedObservations((prev) => [...prev, id])}
+ />
+
+
+ Observation results appear in the run detail observations tab grouped by dimension.
+
+
+
@@ -1099,6 +1145,7 @@ export function SubmitRun() {
{meta.label} criteria
updateGateDraft(gate, { criteria })}
trailingAction={(
diff --git a/apps/portal/src/types.ts b/apps/portal/src/types.ts
index 74918b4bf..079ef7b2d 100644
--- a/apps/portal/src/types.ts
+++ b/apps/portal/src/types.ts
@@ -27,6 +27,40 @@ export interface ToolCall {
timestamp?: string;
}
+export type CriterionKind = "gate" | "observation";
+
+export const TAXONOMY_ELEMENT_IDS = [
+ "dimension:idiomatic-use",
+ "dimension:dependency-currency",
+ "dimension:configuration-correctness",
+] as const;
+
+export type TaxonomyElementId = (typeof TAXONOMY_ELEMENT_IDS)[number];
+
+export interface TaxonomyElementMetadata {
+ id: TaxonomyElementId;
+ label: string;
+ description: string;
+}
+
+export const TAXONOMY_ELEMENT_METADATA: Record = {
+ "dimension:idiomatic-use": {
+ id: "dimension:idiomatic-use",
+ label: "Idiomatic use",
+ description: "Did the agent follow recommended patterns and best practices?",
+ },
+ "dimension:dependency-currency": {
+ id: "dimension:dependency-currency",
+ label: "Dependency currency",
+ description: "Did the agent use current versions, packages, and namespaces?",
+ },
+ "dimension:configuration-correctness": {
+ id: "dimension:configuration-correctness",
+ label: "Configuration correctness",
+ description: "Are auth, connection, environment, and deployment settings configured properly?",
+ },
+};
+
export interface ConversationTurn {
iteration: number;
gate?: GateId;
@@ -36,6 +70,7 @@ export interface ConversationTurn {
passed: boolean;
timestamp: string;
criteriaResults?: CriterionResult[];
+ observationResults?: CriterionResult[];
harUrl?: string;
videoUrls?: string[];
tokenUsage?: TokenUsage;
@@ -144,6 +179,7 @@ export interface Run {
profileId?: string;
profileVersionId?: string;
gates?: GateConfig[];
+ observations?: string[];
gateSummaries?: GateRunSummary[];
}
@@ -206,6 +242,8 @@ export interface CriteriaConfig {
prompt: string;
dependsOn?: string[];
gates?: GateId[];
+ kind?: CriterionKind;
+ taxonomyElementId?: TaxonomyElementId;
}
export interface CriteriaDocument extends CriteriaConfig {
@@ -215,7 +253,7 @@ export interface CriteriaDocument extends CriteriaConfig {
}
export interface CriteriaGraphData {
- nodes: Array<{ id: string; prompt: string; dependsOn: string[]; gates?: GateId[] }>;
+ nodes: Array<{ id: string; prompt: string; dependsOn: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }>;
edges: Array<{ source: string; target: string }>;
}
From 78899c20b1b1c7226f7e19efffe812c76206c795 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 11:39:49 -0700
Subject: [PATCH 027/287] test(judge): live ATIF-trajectory observation
acceptance (issue #1156)
Proves the judge consumes atifUrl: a trajectory-only observation
(dependency_added_then_removed) resolves passed:true WITH the synthetic
agent_trajectory_atif tool call and passed:false WITHOUT it. Excluded from
default vitest; runs via vitest.integration.config.ts with a Copilot token.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
...observation-trajectory.integration.test.ts | 165 ++++++++++++++++++
1 file changed, 165 insertions(+)
create mode 100644 apps/judge/src/observation-trajectory.integration.test.ts
diff --git a/apps/judge/src/observation-trajectory.integration.test.ts b/apps/judge/src/observation-trajectory.integration.test.ts
new file mode 100644
index 000000000..c8b31030b
--- /dev/null
+++ b/apps/judge/src/observation-trajectory.integration.test.ts
@@ -0,0 +1,165 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * ATIF-trajectory observation acceptance test (issue #1156, acceptance step 3).
+ *
+ * Proves the judge resolves a trajectory-only observation — one whose answer is
+ * NOT derivable from the final workspace snapshot — by consuming the agent's
+ * ATIF trajectory that pp-taxonomy forwards as a synthetic `agent_trajectory_atif`
+ * tool call (see apps/judge/src/index.ts). The canonical case is
+ * `dependency_added_then_removed`: a package is installed then uninstalled mid-run,
+ * so it is invisible in the end-state snapshot and only the trajectory reveals it.
+ *
+ * Two assertions form the acceptance:
+ * 1. WITH the trajectory tool call → criterion resolves passed:true (the judge
+ * actually consumed the ATIF).
+ * 2. WITHOUT the trajectory (snapshot only) → the same criterion flips to
+ * passed:false, proving the verdict comes from the trajectory, not the files.
+ *
+ * Exercises the REAL Copilot SDK, so it requires GITHUB_TOKEN (copilot scope) and
+ * is skipped automatically when the token is absent — mirroring
+ * judge-evaluation.integration.test.ts.
+ */
+import { describe, it, expect, beforeAll, afterAll } from "vitest";
+import { mkdtempSync, writeFileSync, rmSync, realpathSync } from "fs";
+import { tmpdir } from "os";
+import { join } from "path";
+import { resetCriteriaProvider } from "shared/criteria-provider-factory";
+import type { ToolCall } from "shared";
+import { evaluateWorkspace } from "./judge-agent.js";
+
+const hasToken = !!process.env.GITHUB_TOKEN;
+const JUDGE_MODEL = process.env.JUDGE_MODEL || "gpt-5.4-mini";
+
+/**
+ * Synthetic ATIF trajectory mirroring what pp-taxonomy forwards: the agent
+ * installs `left-pad`, uses it, then uninstalls it before finishing. The final
+ * package.json (below) therefore does NOT list left-pad.
+ */
+const ATIF_TRAJECTORY = {
+ schema: "atif/1",
+ steps: [
+ { type: "tool_call", name: "run_in_terminal", arguments: { command: "npm install left-pad" }, response: "+ left-pad@1.3.0\nadded 1 package" },
+ { type: "tool_call", name: "edit_file", arguments: { path: "index.js" }, response: "require('left-pad')" },
+ { type: "tool_call", name: "run_in_terminal", arguments: { command: "npm uninstall left-pad" }, response: "removed 1 package" },
+ ],
+};
+
+const TRAJECTORY_TOOL_CALL: ToolCall = {
+ id: "atif-trajectory",
+ name: "agent_trajectory_atif",
+ arguments: {},
+ response: JSON.stringify(ATIF_TRAJECTORY),
+};
+
+describe("judge ATIF-trajectory observation (integration)", () => {
+ let workspaceDir: string;
+ let criteriaDir: string;
+ const saved: Record = {};
+
+ function setEnv(key: string, value: string): void {
+ saved[key] = process.env[key];
+ process.env[key] = value;
+ }
+
+ beforeAll(() => {
+ workspaceDir = realpathSync(mkdtempSync(join(tmpdir(), "judge-atif-ws-")));
+ criteriaDir = realpathSync(mkdtempSync(join(tmpdir(), "judge-atif-crit-")));
+
+ // End-state snapshot: package.json WITHOUT left-pad. The add-then-remove is
+ // invisible here; only the trajectory reveals it.
+ writeFileSync(
+ join(workspaceDir, "package.json"),
+ JSON.stringify({ name: "demo", version: "1.0.0", dependencies: {} }, null, 2) + "\n",
+ );
+ writeFileSync(join(workspaceDir, "index.js"), "console.log('hello');\n");
+
+ // Observation criterion (matches config/criteria/dependency_added_then_removed.yaml).
+ writeFileSync(
+ join(criteriaDir, "dependency_added_then_removed.yaml"),
+ [
+ "id: dependency_added_then_removed",
+ "kind: observation",
+ "taxonomy_element_id: dimension:dependency-currency",
+ "prompt: |",
+ " During the run the agent installed a package and later uninstalled or",
+ " removed it before finishing (e.g. added left-pad then removed it). This",
+ " is only derivable from the agent's trajectory (mid-run tool calls), not",
+ " from the final codebase snapshot, because the dependency is absent in the",
+ " end state. Inspect the agent_trajectory_atif tool output to detect a",
+ " transient add-then-remove.",
+ "",
+ ].join("\n"),
+ );
+
+ setEnv("CRITERIA_DIR", criteriaDir);
+ setEnv("JUDGE_STRATEGY", process.env.JUDGE_STRATEGY || "independent");
+ setEnv("JUDGE_MODEL", JUDGE_MODEL);
+ setEnv("FEEDBACK_MODEL", process.env.FEEDBACK_MODEL || JUDGE_MODEL);
+ resetCriteriaProvider();
+ });
+
+ afterAll(() => {
+ for (const [key, value] of Object.entries(saved)) {
+ if (value === undefined) delete process.env[key];
+ else process.env[key] = value;
+ }
+ resetCriteriaProvider();
+ rmSync(workspaceDir, { recursive: true, force: true });
+ rmSync(criteriaDir, { recursive: true, force: true });
+ });
+
+ it.skipIf(!hasToken)(
+ "resolves a trajectory-only observation true WITH the ATIF, false WITHOUT it",
+ { timeout: 600_000 },
+ async () => {
+ // (1) WITH the ATIF trajectory tool call → the agent's add-then-remove is
+ // visible, so the observation must resolve true.
+ const withAtif = await evaluateWorkspace({
+ workspacePath: workspaceDir,
+ criteria: ["dependency_added_then_removed"],
+ conversationHistory: [],
+ toolCalls: [TRAJECTORY_TOOL_CALL],
+ });
+
+ const obsWith = withAtif.criteriaResults.find(
+ (r) => r.criterionId === "dependency_added_then_removed",
+ );
+ expect(obsWith, "observation result missing (with ATIF)").toBeTruthy();
+ expect(obsWith!.evaluated).toBe(true);
+ expect(
+ obsWith!.passed,
+ `expected trajectory-only observation to pass WITH ATIF. Feedback: ${obsWith!.feedback}`,
+ ).toBe(true);
+
+ // (2) WITHOUT the ATIF (snapshot only) → the add-then-remove is invisible
+ // in the end state, so the same observation must flip to false. This proves
+ // the verdict was driven by the trajectory, not the workspace files.
+ const withoutAtif = await evaluateWorkspace({
+ workspacePath: workspaceDir,
+ criteria: ["dependency_added_then_removed"],
+ conversationHistory: [],
+ });
+
+ const obsWithout = withoutAtif.criteriaResults.find(
+ (r) => r.criterionId === "dependency_added_then_removed",
+ );
+ expect(obsWithout, "observation result missing (without ATIF)").toBeTruthy();
+ expect(obsWithout!.evaluated).toBe(true);
+ expect(
+ obsWithout!.passed,
+ `expected trajectory-only observation to FAIL without ATIF (snapshot has no left-pad). Feedback: ${obsWithout!.feedback}`,
+ ).toBe(false);
+ },
+ );
+
+ it("logs a skip note when GITHUB_TOKEN is absent (no real evaluation possible)", () => {
+ if (!hasToken) {
+ console.warn(
+ "[integration] GITHUB_TOKEN not set — ATIF-trajectory observation test skipped",
+ );
+ }
+ expect(true).toBe(true);
+ });
+});
From c0a20936ddc1887bfa2545bb85a78c889501d0ed Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 12:01:47 -0700
Subject: [PATCH 028/287] fix(post-processor): copy handler.taxonomy.yaml into
image so pp-taxonomy registers
The Dockerfile copied only handler.yaml, so the register-handler-taxonomy
job (HANDLER_YAML_PATH=apps/workers/post-processor/handler.taxonomy.yaml)
failed with ENOENT in the container, exit 1, gating the post-processor
(hard depends_on service_completed_successfully). Use a handler*.yaml glob
in both builder and prod stages so every handler manifest is baked in.
Verified in compose: register-handler-taxonomy now exits 0 ("Registered
pp-taxonomy successfully") and the post-processor loads both the atif and
taxonomy handlers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/workers/post-processor/Dockerfile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/apps/workers/post-processor/Dockerfile b/apps/workers/post-processor/Dockerfile
index 6d6bf8e04..a70478630 100644
--- a/apps/workers/post-processor/Dockerfile
+++ b/apps/workers/post-processor/Dockerfile
@@ -15,7 +15,10 @@ COPY packages/shared/tsconfig.json ./packages/shared/
COPY packages/shared/src ./packages/shared/src/
COPY apps/workers/post-processor/tsconfig.json ./apps/workers/post-processor/
COPY apps/workers/post-processor/src ./apps/workers/post-processor/src/
-COPY apps/workers/post-processor/handler.yaml ./apps/workers/post-processor/
+# Copy every handler manifest (handler.yaml = pp-atif, handler.taxonomy.yaml =
+# pp-taxonomy, plus any future handlers). The registration jobs read these by
+# HANDLER_YAML_PATH, so all must be present in the image.
+COPY apps/workers/post-processor/handler*.yaml ./apps/workers/post-processor/
RUN pnpm --filter shared build && pnpm --filter post-processor build
@@ -44,7 +47,7 @@ RUN pnpm install --frozen-lockfile --prod
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
COPY --from=builder /app/apps/workers/post-processor/dist ./apps/workers/post-processor/dist/
-COPY --from=builder /app/apps/workers/post-processor/handler.yaml ./apps/workers/post-processor/handler.yaml
+COPY --from=builder /app/apps/workers/post-processor/handler*.yaml ./apps/workers/post-processor/
WORKDIR /app/apps/workers/post-processor
From d5f866badaa3350c859c781efa67a090e3456f0c Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 13:30:53 -0700
Subject: [PATCH 029/287] fix(compose): give post-processor JUDGE_SERVICE_URL
so pp-taxonomy reaches judge
The post-processor service used the *common-env anchor, which omits
JUDGE_SERVICE_URL (only *worker-env defines it). pp-atif never called the
judge so the gap was invisible, but pp-taxonomy (issue #1156) evaluates
observation criteria via JudgeClient and fell back to localhost:3002 inside
the container. Set JUDGE_SERVICE_URL=http://judge:80 explicitly.
k8s is unaffected: post-processor.yaml already pulls JUDGE_SERVICE_URL from
the worker-config ConfigMap via envFrom.
Verified in compose: the containerized post-processor reached the judge
container, which loaded the ATIF and wrote run.turns[].observationResults
(dependency_added_then_removed -> passed:true).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
docker-compose.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docker-compose.yml b/docker-compose.yml
index aea2d76f7..aa1c06821 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -686,6 +686,10 @@ services:
AZURE_STORAGE_QUEUE_POSTPROCESSOR: post-processor-queue
SCOPE_MT_API_URL: http://api:80
SCHEDULER_URL: http://scheduler:8080
+ # pp-taxonomy (issue #1156) calls the judge service to evaluate
+ # observation criteria. Without this the JudgeClient falls back to
+ # localhost:3002 and cannot reach the judge container.
+ JUDGE_SERVICE_URL: http://judge:80
depends_on:
mongodb:
condition: service_healthy
From 7fde27f8200624a4693a56b362e144b57d43cd0c Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 13:32:02 -0700
Subject: [PATCH 030/287] docs(env): clarify post-processor JUDGE_SERVICE_URL
wiring in compose vs k8s
In k8s the post-processor inherits JUDGE_SERVICE_URL from the worker-config
ConfigMap via envFrom; in docker-compose the service uses the common-env
anchor (not worker-env), so JUDGE_SERVICE_URL is set explicitly on the
post-processor service. Reflects the compose fix in 3f2e98cc.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
ENV_VARIABLES.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index 3001c4b16..293c83db2 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -347,7 +347,7 @@ Azure Storage Queue name used by both the scheduler (to enqueue post-processing
**Default:** falls back to `JUDGE_SERVICE_URL`, then `http://localhost:3002`
**Type:** URL string
-Base URL of the judge service used by the `pp-taxonomy` post-process handler to evaluate observation criteria per iteration (snapshot + ATIF trajectory → boolean + evidence). The handler reuses the shared `JudgeClient`, so `JUDGE_CLIENT_TIMEOUT` / `JUDGE_CLIENT_RETRIES` apply. In Docker/K8s the worker reads `JUDGE_SERVICE_URL` from `worker-config`; no extra var needed. See issue #1156 and [docs/architecture/post-processing.md](docs/architecture/post-processing.md).
+Base URL of the judge service used by the `pp-taxonomy` post-process handler to evaluate observation criteria per iteration (snapshot + ATIF trajectory → boolean + evidence). The handler reuses the shared `JudgeClient`, so `JUDGE_CLIENT_TIMEOUT` / `JUDGE_CLIENT_RETRIES` apply. In K8s the post-processor reads `JUDGE_SERVICE_URL` from the `worker-config` ConfigMap (`envFrom`); in docker-compose the `post-processor` service sets `JUDGE_SERVICE_URL: http://judge:80` explicitly (it uses the `common-env` anchor, which — unlike `worker-env` — does not carry it). See issue #1156 and [docs/architecture/post-processing.md](docs/architecture/post-processing.md).
### SCHEDULER_URL
**Default:** (not set)
From 7a639ad33bef7f90cbea30fcead8082f038a17f7 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 14:17:48 -0700
Subject: [PATCH 031/287] fix(pp-taxonomy): read selected observations from
request top-level, not run.observations
The API submit path persists the selected observation-criteria ids at the
request document top-level (RequestDocument.observations, types.ts), but the
TaxonomyHandler read them from doc.run.observations. They never met, so
pp-taxonomy no-op'd on every real submitted run and never wrote
turn.observationResults.
Read doc.observations (top-level) instead; turns still come from doc.run.turns.
Rename the local RunDoc interface to RequestDoc and document the placement.
Update the handler unit tests to put observations at the canonical top-level,
and add a regression test asserting that legacy run.observations is ignored
(no-op), which would have caught this.
Verified end-to-end on a real submitted run through the containerized stack:
turn.observationResults is written with passed:true and feedback citing the
mid-run install/uninstall trajectory (the judge consumed atifUrl).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/handlers/taxonomy-handler.test.ts | 22 ++++++++++++++----
.../src/handlers/taxonomy-handler.ts | 23 +++++++++++--------
2 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
index 18831592a..4b328b8e6 100644
--- a/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
@@ -31,7 +31,21 @@ describe("TaxonomyHandler", () => {
});
it("no-ops when no observations are selected", async () => {
- const ctx = makeCtx({ _id: "req-1", run: { observations: [], turns: [{ iteration: 1, snapshotUrl: "s://1" }] } });
+ const ctx = makeCtx({ _id: "req-1", observations: [], run: { turns: [{ iteration: 1, snapshotUrl: "s://1" }] } });
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+ expect(judge.evaluate).not.toHaveBeenCalled();
+ expect(ctx.collection.updateOne).not.toHaveBeenCalled();
+ });
+
+ it("reads observations from the request top-level, not run.observations (#1156 regression)", async () => {
+ // The API persists selected observation ids at the request top-level
+ // (RequestDocument.observations). A doc that only carries the legacy
+ // run.observations must be treated as "none selected" → no-op, proving the
+ // handler reads the canonical location the submit path actually writes.
+ const ctx = makeCtx({
+ _id: "req-1",
+ run: { observations: ["dep_removed"], turns: [{ iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" }] },
+ });
await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
expect(judge.evaluate).not.toHaveBeenCalled();
expect(ctx.collection.updateOne).not.toHaveBeenCalled();
@@ -45,8 +59,8 @@ describe("TaxonomyHandler", () => {
});
const ctx = makeCtx({
_id: "req-1",
+ observations: ["dep_removed"],
run: {
- observations: ["dep_removed"],
turns: [{ iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" }],
},
});
@@ -67,14 +81,14 @@ describe("TaxonomyHandler", () => {
it("skips iterations without a snapshotUrl", async () => {
judge.evaluate.mockResolvedValue({ passed: true, feedback: "", criteriaResults: [] });
- const ctx = makeCtx({ _id: "req-1", run: { observations: ["c1"], turns: [{ iteration: 1 }] } });
+ const ctx = makeCtx({ _id: "req-1", observations: ["c1"], run: { turns: [{ iteration: 1 }] } });
await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
expect(judge.evaluate).not.toHaveBeenCalled();
});
it("throws on judge infrastructure error so the handler is marked failed", async () => {
judge.evaluate.mockRejectedValue(new JudgeInfrastructureError("down", { httpStatus: 503 }));
- const ctx = makeCtx({ _id: "req-1", run: { observations: ["c1"], turns: [{ iteration: 1, snapshotUrl: "s://1" }] } });
+ const ctx = makeCtx({ _id: "req-1", observations: ["c1"], run: { turns: [{ iteration: 1, snapshotUrl: "s://1" }] } });
await expect(new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx)).rejects.toThrow("down");
});
});
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
index 3701c4cd8..571320317 100644
--- a/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
@@ -5,11 +5,14 @@ import { JudgeClient, isRetryableJudgeError } from "shared";
import type { ConversationTurn, CriterionResult } from "shared";
import type { PostProcessHandler, PostProcessorMessage, HandlerContext } from "../types.js";
-/** Minimal shape of the run document fields this handler reads/writes. */
-interface RunDoc {
+/** Minimal shape of the request document fields this handler reads/writes. */
+interface RequestDoc {
+ /** Observation-criteria ids selected at submit. Stored at the request
+ * top-level by the API (see RequestDocument.observations / issue #1156),
+ * NOT under `run` — the run subdocument only carries per-turn results. */
+ observations?: string[];
run?: {
_id?: string;
- observations?: string[];
turns?: ConversationTurn[];
};
}
@@ -18,11 +21,11 @@ interface RunDoc {
* Taxonomy Handler (pp-taxonomy): records per-iteration boolean observations.
*
* For each iteration turn with a `snapshotUrl`, reuses the judge service to
- * evaluate the run's selected observation criteria (`run.observations`) against
- * the codebase snapshot AND the agent trajectory (ATIF) — sending `atifUrl` in
- * place of `toolCallsUrl`. Results are written to `turn.observationResults`,
- * mirroring gate `criteriaResults`. Never gates, never steers the agent.
- * Empty/absent `observations` → no-op. See issue #1156.
+ * evaluate the run's selected observation criteria (top-level
+ * `request.observations`) against the codebase snapshot AND the agent
+ * trajectory (ATIF) — sending `atifUrl` in place of `toolCallsUrl`. Results are
+ * written to `turn.observationResults`, mirroring gate `criteriaResults`. Never
+ * gates, never steers the agent. Empty/absent `observations` → no-op. #1156.
*/
export class TaxonomyHandler implements PostProcessHandler {
readonly type = "taxonomy";
@@ -35,8 +38,8 @@ export class TaxonomyHandler implements PostProcessHandler {
async process(message: PostProcessorMessage, ctx: HandlerContext): Promise {
const { requestId, iteration } = message;
- const doc = (await ctx.collection.findOne({ _id: requestId } as any)) as RunDoc | null;
- const observations = doc?.run?.observations ?? [];
+ const doc = (await ctx.collection.findOne({ _id: requestId } as any)) as RequestDoc | null;
+ const observations = doc?.observations ?? [];
const turns = doc?.run?.turns ?? [];
if (observations.length === 0) {
From f689b013948c7ded948812dc2a63ebdc9336f004 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 14:34:20 -0700
Subject: [PATCH 032/287] feat(portal): rename run-detail Observations tab to
Taxonomy with Observations subsection
The run-detail tab is now labeled "Taxonomy" and its content nests an
"Observations" sub-section (heading + description) around the per-dimension
ObservationResultsPanel, so the tab can host the broader taxonomy view with
observations as one section within it. The internal tab value stays
"observations" to preserve routing/state.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/portal/src/pages/RunDetail.tsx | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index 12308f173..74a1e9623 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -962,7 +962,7 @@ export function RunDetail() {
{hasVideoData && Videos ({videoCount}) }
{(hasConfiguredObservations || hasObservationResults) && (
- Observations {hasObservationResults ? `(${activeRun?.turns?.reduce((count, turn) => count + (turn.observationResults?.length ?? 0), 0) ?? 0})` : ""}
+ Taxonomy {hasObservationResults ? `(${activeRun?.turns?.reduce((count, turn) => count + (turn.observationResults?.length ?? 0), 0) ?? 0})` : ""}
)}
Logs
@@ -1061,8 +1061,16 @@ export function RunDetail() {
)}
{(hasConfiguredObservations || hasObservationResults) && (
-
-
+
+
+
+
Observations
+
+ Per-iteration boolean observations recorded over the codebase and agent trajectory, grouped by taxonomy dimension. Non-gating — they never steer the agent.
+
+
+
+
)}
From 85eb446ea525af152305e935ff85563be55589a5 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 14:53:11 -0700
Subject: [PATCH 033/287] fix(portal): aggregate Enrichment badge over handler
DAG + rename observations tab URL to taxonomy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The Enrichment badge read the legacy single `run.postProcessorStatus`
scalar, which every post-processor handler overwrites on its own success.
It therefore flipped to "Enriched" as soon as pp-atif finished, while
pp-taxonomy was still computing observations.
Derive an aggregate enrichment status from `run.handlerStatus` (the #1147
per-handler DAG state): stay "Enriching…" until every handler is terminal,
treating pp-taxonomy as pending whenever observations are configured (which
also covers the gap before the scheduler dispatches it). Use the derived
status for both badge placements and the detail poller so taxonomy results
auto-appear. Falls back to the legacy scalar for pre-DAG runs.
Also rename the run-detail tab slug "observations" -> "taxonomy" so the URL
reads /runs/:id/taxonomy, with an in-place redirect for legacy
/observations deep-links.
Proven live on the containerized stack: a real run held "Enriching…" from
pp-atif done (legacy scalar already "done") through pp-taxonomy queued, and
flipped to "Enriched" only once pp-taxonomy completed ~32s later.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/portal/src/lib/enrichment.test.ts | 92 ++++++++++++++++++++++++++
apps/portal/src/lib/enrichment.ts | 48 ++++++++++++++
apps/portal/src/pages/RunDetail.tsx | 31 +++++++--
apps/portal/src/types.ts | 19 ++++++
4 files changed, 183 insertions(+), 7 deletions(-)
create mode 100644 apps/portal/src/lib/enrichment.test.ts
create mode 100644 apps/portal/src/lib/enrichment.ts
diff --git a/apps/portal/src/lib/enrichment.test.ts b/apps/portal/src/lib/enrichment.test.ts
new file mode 100644
index 000000000..879bc5b11
--- /dev/null
+++ b/apps/portal/src/lib/enrichment.test.ts
@@ -0,0 +1,92 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, expect, it } from "vitest";
+import { deriveEnrichmentStatus } from "./enrichment";
+import type { RunState } from "@/types";
+
+function makeRun(partial: Partial): RunState {
+ return { _id: "r1", attemptNumber: 1, status: "done", ...partial } as RunState;
+}
+
+describe("deriveEnrichmentStatus", () => {
+ it("returns undefined when there is no run", () => {
+ expect(deriveEnrichmentStatus(undefined, false)).toBeUndefined();
+ });
+
+ it("falls back to the legacy scalar for runs without a handler DAG", () => {
+ expect(deriveEnrichmentStatus(makeRun({ postProcessorStatus: "done" }), false)).toBe("done");
+ expect(deriveEnrichmentStatus(makeRun({ postProcessorStatus: "processing" }), true)).toBe("processing");
+ expect(deriveEnrichmentStatus(makeRun({ handlerStatus: {} }), false)).toBeUndefined();
+ });
+
+ it("stays processing while pp-atif is still running", () => {
+ const run = makeRun({ handlerStatus: { "pp-atif": { status: "processing" } } });
+ expect(deriveEnrichmentStatus(run, false)).toBe("processing");
+ });
+
+ it("reports done once the only handler (pp-atif) is done and no observations are configured", () => {
+ const run = makeRun({
+ postProcessorStatus: "done",
+ handlerStatus: { "pp-atif": { status: "done" } },
+ });
+ expect(deriveEnrichmentStatus(run, false)).toBe("done");
+ });
+
+ it("does NOT flip to done after pp-atif while pp-taxonomy is still pending (the bug)", () => {
+ // Observations configured, pp-atif done, pp-taxonomy not yet dispatched.
+ const beforeDispatch = makeRun({
+ postProcessorStatus: "done", // legacy scalar already flipped — must be ignored
+ handlerStatus: { "pp-atif": { status: "done" } },
+ });
+ expect(deriveEnrichmentStatus(beforeDispatch, true)).toBe("processing");
+
+ // pp-taxonomy queued.
+ const queued = makeRun({
+ postProcessorStatus: "done",
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "queued" } },
+ });
+ expect(deriveEnrichmentStatus(queued, true)).toBe("processing");
+
+ // pp-taxonomy processing.
+ const processing = makeRun({
+ postProcessorStatus: "done",
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "processing" } },
+ });
+ expect(deriveEnrichmentStatus(processing, true)).toBe("processing");
+ });
+
+ it("flips to done only once both pp-atif and pp-taxonomy are done", () => {
+ const run = makeRun({
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ });
+ expect(deriveEnrichmentStatus(run, true)).toBe("done");
+ });
+
+ it("reports failed when a handler failed and nothing is still in flight", () => {
+ const run = makeRun({
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "failed" } },
+ });
+ expect(deriveEnrichmentStatus(run, true)).toBe("failed");
+ });
+
+ it("prefers processing over failed while another handler is still running", () => {
+ const run = makeRun({
+ handlerStatus: { "pp-atif": { status: "processing" }, "pp-taxonomy": { status: "failed" } },
+ });
+ expect(deriveEnrichmentStatus(run, true)).toBe("processing");
+ });
+
+ it("treats a no-op pp-taxonomy (no observations) as part of the DAG", () => {
+ // No observations configured, but pp-taxonomy still runs as a no-op handler.
+ const stillRunning = makeRun({
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "processing" } },
+ });
+ expect(deriveEnrichmentStatus(stillRunning, false)).toBe("processing");
+
+ const allDone = makeRun({
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ });
+ expect(deriveEnrichmentStatus(allDone, false)).toBe("done");
+ });
+});
diff --git a/apps/portal/src/lib/enrichment.ts b/apps/portal/src/lib/enrichment.ts
new file mode 100644
index 000000000..99f5bfebc
--- /dev/null
+++ b/apps/portal/src/lib/enrichment.ts
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { RunState } from "@/types";
+
+export type PostProcessorStatus = "queued" | "processing" | "done" | "failed";
+
+/**
+ * Derive the aggregate enrichment status across the whole post-processing
+ * handler DAG (issue #1147), rather than trusting the legacy single
+ * `postProcessorStatus` scalar.
+ *
+ * Each post-processor handler overwrites that scalar on its own completion, so
+ * it flips to "done" as soon as the FIRST handler (pp-atif) finishes — even
+ * while pp-taxonomy is still computing observations. The "Enriched" badge (and
+ * the run-detail poller) must instead stay "Enriching…" until every handler in
+ * the DAG is terminal.
+ *
+ * Known topology: pp-atif always runs; pp-taxonomy is expected whenever the run
+ * has configured observations. We treat taxonomy as still-pending until
+ * pp-taxonomy reaches a terminal state, which also covers the brief window
+ * after pp-atif finishes but before the scheduler has dispatched pp-taxonomy
+ * (so it isn't yet present in `handlerStatus`).
+ *
+ * Falls back to the legacy `postProcessorStatus` scalar for runs that predate
+ * the handler DAG (no `handlerStatus` map).
+ */
+export function deriveEnrichmentStatus(
+ run: RunState | undefined,
+ hasConfiguredObservations: boolean,
+): PostProcessorStatus | undefined {
+ if (!run) return undefined;
+ const handlerStatus = run.handlerStatus;
+ // Legacy runs predating the handler DAG only carry the scalar field.
+ if (!handlerStatus || Object.keys(handlerStatus).length === 0) {
+ return run.postProcessorStatus;
+ }
+ const statuses = Object.values(handlerStatus).map((h) => h?.status);
+ const taxonomyStatus = handlerStatus["pp-taxonomy"]?.status;
+ const taxonomyPending =
+ hasConfiguredObservations && taxonomyStatus !== "done" && taxonomyStatus !== "failed";
+ if (taxonomyPending || statuses.some((s) => s === "queued" || s === "processing")) {
+ return "processing";
+ }
+ if (statuses.some((s) => s === "failed")) return "failed";
+ if (statuses.length > 0 && statuses.every((s) => s === "done")) return "done";
+ return run.postProcessorStatus;
+}
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index 74a1e9623..2b058d107 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -51,6 +51,7 @@ import {
} from "@/types";
import { useShiftModifier } from "@/hooks/useShiftModifier";
import { getRetryButtonState } from "@/components/RetryButton";
+import { deriveEnrichmentStatus } from "@/lib/enrichment";
/** A compact labeled stat: a micro uppercase label above its value. */
function MetaItem({ label, value, title }: { label: string; value: ReactNode; title?: string }) {
@@ -314,10 +315,10 @@ export function RunDetail() {
refetchInterval: (query) => {
const data = query.state.data;
const status = data?.run?.status;
- const ppStatus = data?.run?.postProcessorStatus;
// Keep polling while run is in progress OR post-processing is pending/in-progress
if (status !== "done") return 5_000;
- if (ppStatus && ppStatus !== "done" && ppStatus !== "failed") return 5_000;
+ const enrichment = deriveEnrichmentStatus(data?.run, (data?.observations?.length ?? 0) > 0);
+ if (enrichment && enrichment !== "done" && enrichment !== "failed") return 5_000;
return false;
},
});
@@ -354,6 +355,16 @@ export function RunDetail() {
}, [selectedRunId, run?.run, attempts]);
const isViewingHistorical = !!selectedRunId && selectedRunId !== run?.run?._id;
+ // The "observations" tab was renamed to "taxonomy". Map the legacy slug to the
+ // new one for tab selection, and rewrite stale `/observations` URLs in place
+ // so deep-links and bookmarks keep working.
+ const normalizedTab = tab === "observations" ? "taxonomy" : tab;
+ useEffect(() => {
+ if (tab === "observations") {
+ navigate(`/runs/${id}/taxonomy${selectedRunId ? `?runId=${selectedRunId}` : ""}`, { replace: true });
+ }
+ }, [tab, id, selectedRunId, navigate]);
+
const isActive = activeRun?.status === "pending" || activeRun?.status === "processing";
// Note: "done" is terminal — not active, no log streaming needed
@@ -394,6 +405,12 @@ export function RunDetail() {
const hasObservationResults = (activeRun?.turns ?? []).some((turn) => (turn.observationResults?.length ?? 0) > 0);
const hasConfiguredObservations = (run?.observations?.length ?? 0) > 0;
+ // Aggregate enrichment status across the whole post-processing DAG so the
+ // "Enriched" badge waits for pp-taxonomy instead of flipping after pp-atif.
+ const enrichmentStatus = useMemo(
+ () => deriveEnrichmentStatus(activeRun, hasConfiguredObservations),
+ [activeRun, hasConfiguredObservations],
+ );
const { data: observationCriteria = [] } = useQuery({
queryKey: ["criteria", "observations", run?.observations],
queryFn: () => api.listCriteria(undefined, run?.observations?.length ? { ids: run.observations } : undefined),
@@ -673,7 +690,7 @@ export function RunDetail() {
/>
{activeRun?.status === "done" && }
{activeRun?.status === "done" && (
-
+
)}
@@ -947,7 +964,7 @@ export function RunDetail() {
{/* Tabs */}
0 ? "turns" : "logs")}
+ value={normalizedTab || (activeRun?.status === "done" && activeRun?.turns && activeRun.turns.length > 0 ? "turns" : "logs")}
onValueChange={(value) => navigate(`/runs/${id}/${value}${selectedRunId ? `?runId=${selectedRunId}` : ""}`)}
>
@@ -961,7 +978,7 @@ export function RunDetail() {
{hasHarData && Tool Calls }
{hasVideoData && Videos ({videoCount}) }
{(hasConfiguredObservations || hasObservationResults) && (
-
+
Taxonomy {hasObservationResults ? `(${activeRun?.turns?.reduce((count, turn) => count + (turn.observationResults?.length ?? 0), 0) ?? 0})` : ""}
)}
@@ -1061,7 +1078,7 @@ export function RunDetail() {
)}
{(hasConfiguredObservations || hasObservationResults) && (
-
+
Observations
@@ -1447,7 +1464,7 @@ export function RunDetail() {
Status: {" "}
-
+
{activeRun.postProcessorVersion !== undefined && (
diff --git a/apps/portal/src/types.ts b/apps/portal/src/types.ts
index 079ef7b2d..a7a6b2ec2 100644
--- a/apps/portal/src/types.ts
+++ b/apps/portal/src/types.ts
@@ -114,6 +114,17 @@ export interface OsInfo {
arch: string;
}
+/**
+ * Per-handler post-processing status in the DAG (issue #1147). Keys in
+ * `RunState.handlerStatus` are handler IDs (e.g. "pp-atif", "pp-taxonomy").
+ */
+export interface HandlerRunStatus {
+ status: "queued" | "processing" | "done" | "failed";
+ version?: number;
+ updatedAt?: string;
+ error?: string;
+}
+
/**
* Per-attempt mutable state (nested under `Run.run` in API responses since
* migration 014). Fields here change as a single attempt progresses; fields
@@ -148,6 +159,14 @@ export interface RunState {
resumedAt?: string;
postProcessorVersion?: number;
postProcessorStatus?: "queued" | "processing" | "done" | "failed";
+ /**
+ * Per-handler post-processing status keyed by handler ID (e.g. "pp-atif",
+ * "pp-taxonomy"). Drives the aggregate "Enriched" badge so it only flips to
+ * done once every handler in the DAG is terminal — not after the first
+ * handler (pp-atif) completes. The legacy `postProcessorStatus` scalar only
+ * tracks pp-atif and is kept for backward compatibility.
+ */
+ handlerStatus?: Record
;
}
export interface Run {
From 84f6e7b5ba8da87f4caafa034ff603a5ccfcc268 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 17:31:27 -0700
Subject: [PATCH 034/287] fix(judge): unify trajectory navigation into one
source-agnostic tool set (#1156 P10)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes a non-deterministic false negative on trajectory observations (e.g.
`dependency_added_then_removed`): pp-taxonomy fed the judge the entire ~86 KB
ATIF as ONE opaque synthetic tool call, so `read_tool_outputs`' 2000-char
preview only ever showed the ~26 KB system prompt and the mid-run npm calls
were buried tens of KB deep — the LLM found them only by luck.
Replace the opaque blob + the two legacy tools (`read_tool_outputs`/
`get_tool_output`) with ONE normalized `AgentTrajectory` model and a unified,
source-agnostic tool set used by BOTH gates (HAR `ToolCall[]`) and observations
(parsed ATIF):
- new `agent-trajectory.ts`: `fromToolCalls`/`fromAtif` normalizers + five
`defineTool`s — two symmetric pairs (definitions: `list_agent_tools`/
`get_agent_tools`; calls: `list_agent_tool_calls`/`get_agent_tool_calls`)
plus `get_trajectory_overview`. Outputs larger than INLINE_LIMIT (16 KB)
spill to a per-evaluation temp dir created OUTSIDE the workspace and are
returned as an absolute `responseFile`/`descriptionFile` the judge reads with
`read_file`.
- `index.ts`: build the trajectory at the `/evaluate` boundary (ATIF wins as
superset; tool-calls otherwise); non-fatal on load failure.
- `judge-strategies.ts`: thread `trajectory` through both strategies; extend
`createFileTools` with `extraReadRoots` (read_file/file_exists may read the
out-of-workspace spill dir; list_directory/search_files stay workspace-only);
create+cleanup the spill dir in `runCopilotSession`; swap TOOL_OUTPUTS_GUIDANCE
→ TRAJECTORY_GUIDANCE. Gate-parity guard preserved (`trajectory.calls.length > 0`).
- `judge-agent.ts`: `EvaluationInput.toolCalls` → `trajectory?`.
Tests: new `agent-trajectory.test.ts` (normalizers, 5 tools, out-of-workspace
spill, strict-superset-over-HAR contract); `judge-strategies.test.ts`
(isWithinAnyRoot + extraReadRoots + new guidance/tool names);
`observation-trajectory.integration.test.ts` rewritten to pass `fromAtif(...)`;
`judge-evaluation.integration.test.ts` extended with a gate clear-PASS/clear-FAIL
regression guard built from `fromToolCalls(...)`.
Verified live on the containerized stack: the same observation that flipped
non-deterministically now resolves passed:true 5/5 WITH the ATIF and false 3/3
WITHOUT it, citing `npm install left-pad` / `npm uninstall left-pad`.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/judge/src/agent-trajectory.test.ts | 446 ++++++++++++++
apps/judge/src/agent-trajectory.ts | 544 ++++++++++++++++++
apps/judge/src/index.ts | 53 +-
apps/judge/src/judge-agent.ts | 10 +-
.../src/judge-evaluation.integration.test.ts | 93 +++
apps/judge/src/judge-strategies.test.ts | 204 ++++---
apps/judge/src/judge-strategies.ts | 256 ++++-----
...observation-trajectory.integration.test.ts | 120 +++-
8 files changed, 1461 insertions(+), 265 deletions(-)
create mode 100644 apps/judge/src/agent-trajectory.test.ts
create mode 100644 apps/judge/src/agent-trajectory.ts
diff --git a/apps/judge/src/agent-trajectory.test.ts b/apps/judge/src/agent-trajectory.test.ts
new file mode 100644
index 000000000..78252d88f
--- /dev/null
+++ b/apps/judge/src/agent-trajectory.test.ts
@@ -0,0 +1,446 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Unit tests for the source-agnostic agent-trajectory model (issue #1156, P10).
+ *
+ * Covers both normalizers (`fromAtif` for the observation/ATIF path, `fromToolCalls`
+ * for the gate/HAR path), the five unified navigation tools, the out-of-workspace
+ * spill behaviour for oversized outputs, and the strict-superset contract that the
+ * new tools expose everything the removed `read_tool_outputs`/`get_tool_output`
+ * pair did.
+ */
+import { describe, it, expect, beforeAll, afterAll } from "vitest";
+import { mkdtempSync, mkdirSync, rmSync, existsSync, readFileSync } from "fs";
+import { tmpdir } from "os";
+import { join, sep } from "path";
+import type { ToolCall } from "shared";
+import {
+ fromAtif,
+ fromToolCalls,
+ createTrajectoryTools,
+ summarizeArgs,
+ safeId,
+ previewOf,
+ INLINE_LIMIT,
+ type AgentTrajectory,
+} from "./agent-trajectory.js";
+
+const stubInvocation = {
+ sessionId: "test-session",
+ toolCallId: "test-call",
+ toolName: "test-tool",
+ arguments: {},
+};
+
+/** Invoke a trajectory tool's handler by name. */
+async function call(
+ tools: ReturnType,
+ name: string,
+ args: Record = {}
+): Promise {
+ const tool = tools.find((t) => t.name === name);
+ if (!tool?.handler) throw new Error(`tool ${name} not found`);
+ return (tool.handler as (a: unknown, b: unknown) => unknown)(args, stubInvocation);
+}
+
+/**
+ * Realistic ATIF blob: system + user step, then agent steps that install,
+ * use, and uninstall `left-pad`. Mirrors the real ATIF shape pp-taxonomy
+ * downloads (steps carry their own tool_calls AND the matching
+ * observation.results, paired by source_call_id === tool_call_id).
+ */
+const REALISTIC_ATIF = {
+ schema_version: "atif/1",
+ session_id: "fixture",
+ agent: {
+ name: "copilot",
+ version: "1.0.0",
+ model_name: "claude-opus-4.6",
+ tool_definitions: [
+ {
+ type: "function",
+ function: {
+ name: "bash",
+ description: "Run a shell command.",
+ parameters: { type: "object", properties: { command: { type: "string" } } },
+ },
+ },
+ {
+ type: "function",
+ function: { name: "view", description: "View a file.", parameters: { type: "object" } },
+ },
+ {
+ type: "function",
+ function: { name: "edit", description: "Edit a file." },
+ },
+ // Nameless definition — must be dropped.
+ { type: "function", function: { description: "no name" } },
+ ],
+ },
+ steps: [
+ { step_id: 1, source: "system" },
+ { step_id: 2, source: "user" },
+ {
+ step_id: 3,
+ source: "agent",
+ model_name: "claude-opus-4.6",
+ reasoning_content: "Add left-pad.",
+ tool_calls: [{ tool_call_id: "call-1", function_name: "bash", arguments: { command: "npm install left-pad" } }],
+ observation: { results: [{ source_call_id: "call-1", content: "added 1 package\n+ left-pad@1.3.0" }] },
+ },
+ {
+ step_id: 4,
+ source: "agent",
+ tool_calls: [{ tool_call_id: "call-2", function_name: "edit", arguments: { path: "index.js" } }],
+ // ContentPart[] form of observation content.
+ observation: {
+ results: [
+ { source_call_id: "call-2", content: [{ type: "text", text: "edited " }, { type: "text", text: "index.js" }] },
+ ],
+ },
+ },
+ {
+ step_id: 5,
+ source: "agent",
+ reasoning_content: "Remove left-pad.",
+ tool_calls: [{ tool_call_id: "call-3", function_name: "bash", arguments: { command: "npm uninstall left-pad" } }],
+ observation: { results: [{ source_call_id: "call-3", content: "removed 1 package" }] },
+ },
+ ],
+ final_metrics: { steps: 5 },
+};
+
+describe("fromAtif", () => {
+ const traj = fromAtif(REALISTIC_ATIF);
+
+ it("flattens only agent tool calls, keyed by tool_call_id", () => {
+ expect(traj.source).toBe("atif");
+ expect(traj.calls.map((c) => c.toolCallId)).toEqual(["call-1", "call-2", "call-3"]);
+ expect(traj.byId.get("call-1")!.name).toBe("bash");
+ expect(traj.byId.get("call-1")!.summary).toBe("npm install left-pad");
+ });
+
+ it("excludes system/user steps from calls but records them in steps overview", () => {
+ expect(traj.steps?.map((s) => s.source)).toEqual(["system", "user", "agent", "agent", "agent"]);
+ // No call carries the system prompt text.
+ expect(traj.calls.every((c) => c.step && c.step >= 3)).toBe(true);
+ });
+
+ it("matches each call's response from the same-step observation result", () => {
+ expect(traj.byId.get("call-1")!.response).toContain("left-pad@1.3.0");
+ expect(traj.byId.get("call-3")!.response).toBe("removed 1 package");
+ });
+
+ it("coerces ContentPart[] observation content into joined text", () => {
+ expect(traj.byId.get("call-2")!.response).toBe("edited index.js");
+ });
+
+ it("captures per-step reasoning on the calls", () => {
+ expect(traj.byId.get("call-1")!.reasoning).toBe("Add left-pad.");
+ expect(traj.byId.get("call-3")!.reasoning).toBe("Remove left-pad.");
+ });
+
+ it("reads agent + model metadata", () => {
+ expect(traj.agent).toBe("copilot");
+ expect(traj.model).toBe("claude-opus-4.6");
+ expect(traj.finalMetrics).toEqual({ steps: 5 });
+ });
+
+ it("populates tool definitions from agent.tool_definitions, dropping nameless ones", () => {
+ expect(traj.toolDefinitions.map((d) => d.name)).toEqual(["bash", "view", "edit"]);
+ expect(traj.toolDefsByName.get("bash")!.description).toBe("Run a shell command.");
+ });
+
+ it("parses a JSON string input", () => {
+ const fromString = fromAtif(JSON.stringify(REALISTIC_ATIF));
+ expect(fromString.calls.map((c) => c.toolCallId)).toEqual(["call-1", "call-2", "call-3"]);
+ });
+
+ it("unwraps a { trajectory: … } wrapper", () => {
+ const wrapped = fromAtif({ trajectory: REALISTIC_ATIF });
+ expect(wrapped.calls).toHaveLength(3);
+ });
+
+ it("returns an empty trajectory for garbage / empty input", () => {
+ expect(fromAtif("not json").calls).toEqual([]);
+ expect(fromAtif(null).calls).toEqual([]);
+ expect(fromAtif({}).calls).toEqual([]);
+ expect(fromAtif(42).calls).toEqual([]);
+ });
+
+ it("synthesizes an id for a tool call missing tool_call_id", () => {
+ const traj2 = fromAtif({
+ steps: [
+ {
+ step_id: 7,
+ source: "agent",
+ tool_calls: [{ function_name: "bash", arguments: { command: "ls" } }],
+ },
+ ],
+ });
+ expect(traj2.calls).toHaveLength(1);
+ expect(traj2.calls[0].toolCallId).toBe("atif-7-0");
+ });
+});
+
+describe("fromToolCalls (HAR / gate path)", () => {
+ const harCalls: ToolCall[] = [
+ { id: "h1", name: "bash", arguments: { command: "npm run build" }, response: "build ok", timestamp: "" },
+ { id: "h2", name: "view", arguments: { path: "server.js" }, response: "file contents", timestamp: "" },
+ ];
+ const traj = fromToolCalls(harCalls);
+
+ it("maps each HAR ToolCall to an AgentToolCall keyed by id", () => {
+ expect(traj.source).toBe("tool-calls");
+ expect(traj.calls.map((c) => c.toolCallId)).toEqual(["h1", "h2"]);
+ expect(traj.byId.get("h1")!.response).toBe("build ok");
+ expect(traj.byId.get("h1")!.summary).toBe("npm run build");
+ });
+
+ it("has no tool catalog (HAR carries no definitions)", () => {
+ expect(traj.toolDefinitions).toEqual([]);
+ expect(traj.steps).toBeUndefined();
+ });
+
+ it("synthesizes positional ids when a HAR call has none", () => {
+ const t = fromToolCalls([{ id: "", name: "bash", arguments: {}, response: "x", timestamp: "" }]);
+ expect(t.calls[0].toolCallId).toBe("call-0");
+ });
+
+ it("handles undefined input", () => {
+ expect(fromToolCalls(undefined).calls).toEqual([]);
+ });
+});
+
+describe("createTrajectoryTools — calls pair (list/get)", () => {
+ let spillRoot: string;
+ const traj = fromAtif(REALISTIC_ATIF);
+
+ beforeAll(() => {
+ spillRoot = mkdtempSync(join(tmpdir(), "traj-spill-"));
+ });
+ afterAll(() => rmSync(spillRoot, { recursive: true, force: true }));
+
+ it("list_agent_tool_calls returns a triage index of every call", async () => {
+ const tools = createTrajectoryTools(traj, spillRoot);
+ const res = await call(tools, "list_agent_tool_calls");
+ expect(res.count).toBe(3);
+ expect(res.calls.map((c: any) => c.toolCallId)).toEqual(["call-1", "call-2", "call-3"]);
+ expect(res.calls[0]).toMatchObject({ name: "bash", step: 3, summary: "npm install left-pad" });
+ expect(res.calls[0].responseLength).toBeGreaterThan(0);
+ });
+
+ it("get_agent_tool_calls returns full details for requested ids and reports notFound", async () => {
+ const tools = createTrajectoryTools(traj, spillRoot);
+ const res = await call(tools, "get_agent_tool_calls", { toolCallIds: ["call-1", "nope"] });
+ expect(res.notFound).toEqual(["nope"]);
+ expect(res.calls).toHaveLength(1);
+ expect(res.calls[0]).toMatchObject({
+ toolCallId: "call-1",
+ name: "bash",
+ arguments: { command: "npm install left-pad" },
+ reasoning: "Add left-pad.",
+ });
+ expect(res.calls[0].response).toContain("left-pad@1.3.0");
+ });
+
+ it("empty trajectory → list returns count 0 with a message", async () => {
+ const tools = createTrajectoryTools(fromAtif({}), spillRoot);
+ const res = await call(tools, "list_agent_tool_calls");
+ expect(res).toMatchObject({ count: 0, calls: [] });
+ expect(res.message).toBeTruthy();
+ });
+});
+
+describe("createTrajectoryTools — oversized output spills OUTSIDE the workspace", () => {
+ let parent: string;
+ let workspace: string;
+ let spillDir: string;
+ const bigOutput = "X".repeat(INLINE_LIMIT + 5000);
+
+ // A trajectory whose single call has an output larger than INLINE_LIMIT.
+ const bigTraj: AgentTrajectory = fromAtif({
+ steps: [
+ {
+ step_id: 3,
+ source: "agent",
+ tool_calls: [{ tool_call_id: "big-1", function_name: "bash", arguments: { command: "cat huge.log" } }],
+ observation: { results: [{ source_call_id: "big-1", content: bigOutput }] },
+ },
+ ],
+ });
+
+ beforeAll(() => {
+ parent = mkdtempSync(join(tmpdir(), "traj-ws-parent-"));
+ workspace = join(parent, "workspace");
+ spillDir = join(parent, "spill");
+ mkdirSync(workspace, { recursive: true });
+ });
+ afterAll(() => rmSync(parent, { recursive: true, force: true }));
+
+ it("writes the full output to a spill file outside the workspace and omits the inline response", async () => {
+ const tools = createTrajectoryTools(bigTraj, spillDir);
+ const res = await call(tools, "get_agent_tool_calls", { toolCallIds: ["big-1"] });
+ const one = res.calls[0];
+
+ // No inline blob — only a preview + a file pointer.
+ expect(one.response).toBeUndefined();
+ expect(one.responsePreview).toBeTruthy();
+ expect(one.responseLength).toBe(bigOutput.length);
+
+ // The spill file is real, holds the FULL output, and lives OUTSIDE the workspace.
+ expect(typeof one.responseFile).toBe("string");
+ expect(existsSync(one.responseFile)).toBe(true);
+ expect(readFileSync(one.responseFile, "utf-8")).toBe(bigOutput);
+ expect(one.responseFile.startsWith(workspace + sep)).toBe(false);
+ expect(one.responseFile.startsWith(spillDir)).toBe(true);
+ });
+
+ it("keeps a small output inline (no spill file)", async () => {
+ const smallTraj = fromAtif({
+ steps: [
+ {
+ step_id: 3,
+ source: "agent",
+ tool_calls: [{ tool_call_id: "s1", function_name: "bash", arguments: { command: "echo hi" } }],
+ observation: { results: [{ source_call_id: "s1", content: "hi" }] },
+ },
+ ],
+ });
+ const tools = createTrajectoryTools(smallTraj, spillDir);
+ const res = await call(tools, "get_agent_tool_calls", { toolCallIds: ["s1"] });
+ expect(res.calls[0].response).toBe("hi");
+ expect(res.calls[0].responseFile).toBeUndefined();
+ });
+});
+
+describe("createTrajectoryTools — definitions pair (list/get)", () => {
+ let spillDir: string;
+ const traj = fromAtif(REALISTIC_ATIF);
+
+ beforeAll(() => {
+ spillDir = mkdtempSync(join(tmpdir(), "traj-defs-"));
+ });
+ afterAll(() => rmSync(spillDir, { recursive: true, force: true }));
+
+ it("list_agent_tools returns the agent's tool catalog", async () => {
+ const tools = createTrajectoryTools(traj, spillDir);
+ const res = await call(tools, "list_agent_tools");
+ expect(res.count).toBe(3);
+ expect(res.tools.map((t: any) => t.name)).toEqual(["bash", "view", "edit"]);
+ const bash = res.tools.find((t: any) => t.name === "bash");
+ expect(bash).toMatchObject({ type: "function", hasParameters: true });
+ expect(bash.descriptionLength).toBeGreaterThan(0);
+ });
+
+ it("get_agent_tools returns full definition + parameters and reports notFound", async () => {
+ const tools = createTrajectoryTools(traj, spillDir);
+ const res = await call(tools, "get_agent_tools", { toolNames: ["bash", "ghost"] });
+ expect(res.notFound).toEqual(["ghost"]);
+ expect(res.tools).toHaveLength(1);
+ expect(res.tools[0]).toMatchObject({
+ name: "bash",
+ type: "function",
+ description: "Run a shell command.",
+ });
+ expect(res.tools[0].parameters).toMatchObject({ type: "object" });
+ });
+
+ it("on the HAR/gate path the catalog is empty (count 0)", async () => {
+ const tools = createTrajectoryTools(fromToolCalls([]), spillDir);
+ const res = await call(tools, "list_agent_tools");
+ expect(res).toMatchObject({ count: 0, tools: [] });
+ });
+
+ it("spills a very long tool description to a descriptionFile outside the workspace", async () => {
+ const bigDesc = "D".repeat(INLINE_LIMIT + 1000);
+ const t = fromAtif({
+ agent: { tool_definitions: [{ type: "function", function: { name: "huge", description: bigDesc } }] },
+ steps: [],
+ });
+ const tools = createTrajectoryTools(t, spillDir);
+ const res = await call(tools, "get_agent_tools", { toolNames: ["huge"] });
+ const def = res.tools[0];
+ expect(def.description).toBeUndefined();
+ expect(def.descriptionPreview).toBeTruthy();
+ expect(existsSync(def.descriptionFile)).toBe(true);
+ expect(readFileSync(def.descriptionFile, "utf-8")).toBe(bigDesc);
+ });
+});
+
+describe("get_trajectory_overview", () => {
+ it("summarizes the run without the system-prompt blob", async () => {
+ const spillDir = mkdtempSync(join(tmpdir(), "traj-ov-"));
+ try {
+ const tools = createTrajectoryTools(fromAtif(REALISTIC_ATIF), spillDir);
+ const res = await call(tools, "get_trajectory_overview");
+ expect(res).toMatchObject({
+ source: "atif",
+ agent: "copilot",
+ model: "claude-opus-4.6",
+ totalTools: 3,
+ totalCalls: 3,
+ });
+ expect(res.steps).toHaveLength(5);
+ } finally {
+ rmSync(spillDir, { recursive: true, force: true });
+ }
+ });
+});
+
+describe("strict-superset contract over the HAR path (replaces read_tool_outputs/get_tool_output)", () => {
+ // The new tools must expose everything the removed pair did: list every call,
+ // and return each call's FULL response — for large outputs via a spill file
+ // whose content equals the full response.
+ let spillDir: string;
+ const bigResponse = "Z".repeat(INLINE_LIMIT + 2000);
+ const harCalls: ToolCall[] = [
+ { id: "g1", name: "bash", arguments: { command: "npm run build" }, response: "build succeeded", timestamp: "" },
+ { id: "g2", name: "bash", arguments: { command: "npm test" }, response: bigResponse, timestamp: "" },
+ ];
+
+ beforeAll(() => {
+ spillDir = mkdtempSync(join(tmpdir(), "traj-super-"));
+ });
+ afterAll(() => rmSync(spillDir, { recursive: true, force: true }));
+
+ it("list_agent_tool_calls lists every HAR call (same count + names as read_tool_outputs)", async () => {
+ const tools = createTrajectoryTools(fromToolCalls(harCalls), spillDir);
+ const res = await call(tools, "list_agent_tool_calls");
+ expect(res.count).toBe(2);
+ expect(res.calls.map((c: any) => `${c.toolCallId}:${c.name}`)).toEqual(["g1:bash", "g2:bash"]);
+ });
+
+ it("get_agent_tool_calls returns the same full response get_tool_output would (small inline)", async () => {
+ const tools = createTrajectoryTools(fromToolCalls(harCalls), spillDir);
+ const res = await call(tools, "get_agent_tool_calls", { toolCallIds: ["g1"] });
+ expect(res.calls[0].response).toBe("build succeeded");
+ });
+
+ it("a large HAR response is spilled and the file content equals the full response", async () => {
+ const tools = createTrajectoryTools(fromToolCalls(harCalls), spillDir);
+ const res = await call(tools, "get_agent_tool_calls", { toolCallIds: ["g2"] });
+ expect(res.calls[0].response).toBeUndefined();
+ expect(readFileSync(res.calls[0].responseFile, "utf-8")).toBe(bigResponse);
+ });
+});
+
+describe("helpers", () => {
+ it("summarizeArgs prefers command, then path/file, then pattern/url/summary, else JSON", () => {
+ expect(summarizeArgs("bash", { command: "ls -la" })).toBe("ls -la");
+ expect(summarizeArgs("view", { path: "a/b.ts" })).toBe("a/b.ts");
+ expect(summarizeArgs("search", { pattern: "TODO" })).toBe("pattern: TODO");
+ expect(summarizeArgs("x", { foo: 1 })).toContain("foo");
+ });
+
+ it("safeId slugifies the id and appends the index", () => {
+ expect(safeId("call/with:weird*chars", 3)).toBe("call_with_weird_chars-3");
+ expect(safeId("", 0)).toBe("call-0");
+ });
+
+ it("previewOf truncates with an ellipsis marker", () => {
+ expect(previewOf("abcdef", 3)).toBe("abc…");
+ expect(previewOf("abc", 10)).toBe("abc");
+ });
+});
diff --git a/apps/judge/src/agent-trajectory.ts b/apps/judge/src/agent-trajectory.ts
new file mode 100644
index 000000000..29b20a469
--- /dev/null
+++ b/apps/judge/src/agent-trajectory.ts
@@ -0,0 +1,544 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Source-agnostic model of the coding agent's captured trajectory, plus the
+ * read-only judge tools that expose it. Issue #1156 / scope #1125.
+ *
+ * The judge is fed the agent's work through one of two channels that are really
+ * the SAME thing captured at different fidelities:
+ *
+ * - GATES send the HAR-extracted `ToolCall[]` (build/test/run output) via
+ * `toolCallsUrl` → normalized here by {@link fromToolCalls}.
+ * - OBSERVATIONS (#1156) send the full ATIF trajectory via `atifUrl` → the
+ * normalized superset, parsed here by {@link fromAtif}. The ATIF additionally
+ * carries the agent's **tool definitions** (the catalog of tools it had
+ * available) and per-step reasoning.
+ *
+ * Both normalize into ONE in-memory {@link AgentTrajectory}, over which we expose
+ * ONE unified tool set ({@link createTrajectoryTools}) — two symmetric pairs:
+ * - DEFINITIONS — `list_agent_tools` / `get_agent_tools` (what tools existed).
+ * - CALLS — `list_agent_tool_calls` / `get_agent_tool_calls` (what the agent did).
+ *
+ * This REPLACES the previous opaque "stuff the 86 KB ATIF into one synthetic tool
+ * call" hack (apps/judge/src/index.ts) whose 2 000-char preview buried the actual
+ * tool calls under the ~26 KB system prompt, causing non-deterministic false
+ * negatives on trajectory-only observations (e.g. `dependency_added_then_removed`).
+ *
+ * Large outputs are spilled to a caller-provided directory OUTSIDE the workspace
+ * so they never pollute the codebase other criteria inspect; the judge reads them
+ * back with its existing `read_file` (which is granted that dir as an extra root).
+ */
+import { defineTool } from "@github/copilot-sdk";
+import { mkdirSync, writeFileSync } from "fs";
+import { join } from "path";
+import type { ToolCall } from "shared";
+
+/** Max chars of a tool-call response (or tool-definition description) returned
+ * inline by `get_agent_tool_calls` / `get_agent_tools`. Above this the full text
+ * is written to the spill dir and returned as a file path instead. */
+export const INLINE_LIMIT = 16_000;
+
+/** Chars of the response/description retained as an at-a-glance preview. */
+export const PREVIEW_LIMIT = 500;
+
+/** Chars of the per-call preview surfaced by the list/triage tools. */
+export const LIST_PREVIEW_LIMIT = 200;
+
+/** One captured invocation the agent made (normalized across HAR and ATIF). */
+export interface AgentToolCall {
+ /** Stable id — the ATIF `tool_call_id` or HAR `ToolCall.id` (synthesized if absent). */
+ toolCallId: string;
+ /** 1-based ATIF step the call was made in (undefined for the HAR/gate path). */
+ step?: number;
+ /** Tool/function name (e.g. `bash`, `create`, `edit`). */
+ name: string;
+ /** One-line digest of the arguments for triage. */
+ summary: string;
+ /** Raw arguments the agent passed. */
+ arguments: Record;
+ /** Captured output/result text. */
+ response: string;
+ /** First {@link PREVIEW_LIMIT} chars of {@link response}. */
+ responsePreview: string;
+ /** Full length of {@link response} in chars. */
+ responseLength: number;
+ /** Step-level reasoning that preceded the call (ATIF only). */
+ reasoning?: string;
+}
+
+/** One entry from the agent's tool catalog (ATIF `agent.tool_definitions`). */
+export interface AgentToolDefinition {
+ /** Tool name — the identifier callers pass to `get_agent_tools`. */
+ name: string;
+ /** Tool type (usually `"function"`). */
+ type: string;
+ /** Human-readable description the agent was given. */
+ description?: string;
+ /** JSON-schema of the tool's parameters. */
+ parameters?: Record;
+}
+
+/** Lightweight overview of one ATIF step (never the raw system-prompt text). */
+export interface StepOverview {
+ step: number;
+ source: string;
+ toolCallCount: number;
+ reasoningSummary?: string;
+}
+
+/** Normalized, source-agnostic view of the agent's captured trajectory. */
+export interface AgentTrajectory {
+ source: "tool-calls" | "atif";
+ agent?: string;
+ model?: string;
+ calls: AgentToolCall[];
+ /** Index of {@link calls} by {@link AgentToolCall.toolCallId}. */
+ byId: Map;
+ /** The agent's tool catalog (ATIF only; empty for the HAR/gate path). */
+ toolDefinitions: AgentToolDefinition[];
+ /** Index of {@link toolDefinitions} by {@link AgentToolDefinition.name}. */
+ toolDefsByName: Map;
+ /** Per-step overview (ATIF only). */
+ steps?: StepOverview[];
+ /** ATIF `final_metrics`, passed through opaquely. */
+ finalMetrics?: unknown;
+}
+
+// ---------------------------------------------------------------------------
+// Helpers
+// ---------------------------------------------------------------------------
+
+/** First `limit` chars of `text`, with an ellipsis marker when truncated. */
+export function previewOf(text: string, limit: number = PREVIEW_LIMIT): string {
+ if (text.length <= limit) return text;
+ return text.slice(0, limit) + "…";
+}
+
+/** Coerce any value to a readable string (ATIF content can be string|object). */
+function asText(value: unknown): string {
+ if (value == null) return "";
+ if (typeof value === "string") return value;
+ try {
+ return JSON.stringify(value);
+ } catch {
+ return String(value);
+ }
+}
+
+/**
+ * Coerce ATIF observation/message content (string | ContentPart[]) into text.
+ * ContentPart is `{ type: "text"|"image", text?, source? }`; we keep the text
+ * parts and note image parts.
+ */
+function coerceContent(content: unknown): string {
+ if (content == null) return "";
+ if (typeof content === "string") return content;
+ if (Array.isArray(content)) {
+ return content
+ .map((part) => {
+ if (part && typeof part === "object") {
+ const p = part as { type?: string; text?: string };
+ if (typeof p.text === "string") return p.text;
+ if (p.type === "image") return "[image]";
+ }
+ return asText(part);
+ })
+ .join("");
+ }
+ return asText(content);
+}
+
+/** One-line digest of a call's arguments for triage in the list tools. */
+export function summarizeArgs(name: string, args: Record): string {
+ if (!args || typeof args !== "object") return "";
+ const a = args as Record;
+ if (typeof a.command === "string") return a.command.slice(0, 200);
+ if (typeof a.path === "string") return a.path;
+ if (typeof a.file === "string") return a.file;
+ if (typeof a.pattern === "string") return `pattern: ${a.pattern}`;
+ if (typeof a.url === "string") return a.url;
+ if (typeof a.summary === "string") return a.summary.slice(0, 200);
+ const json = asText(a);
+ return json.length > 120 ? json.slice(0, 120) + "…" : json;
+}
+
+/** Filesystem-safe spill filename derived from an id + its position. */
+export function safeId(id: string, index: number): string {
+ const slug = (id || "").replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 80);
+ return `${slug || "call"}-${index}`;
+}
+
+function buildById(calls: AgentToolCall[]): Map {
+ const byId = new Map();
+ for (const call of calls) {
+ // First write wins; later collisions are unreachable in practice because
+ // ids are unique (synthesized ids embed the position).
+ if (!byId.has(call.toolCallId)) byId.set(call.toolCallId, call);
+ }
+ return byId;
+}
+
+// ---------------------------------------------------------------------------
+// Normalizers
+// ---------------------------------------------------------------------------
+
+/**
+ * Normalize the HAR-extracted tool calls (the gate path) into an
+ * {@link AgentTrajectory}. HAR carries no tool catalog or reasoning, so
+ * `toolDefinitions`/`steps` are empty.
+ */
+export function fromToolCalls(toolCalls: ToolCall[] | undefined): AgentTrajectory {
+ const list = Array.isArray(toolCalls) ? toolCalls : [];
+ const calls: AgentToolCall[] = list.map((tc, i) => {
+ const response = asText(tc.response ?? "");
+ const args = (tc.arguments ?? {}) as Record;
+ const name = tc.name ?? "unknown";
+ return {
+ toolCallId: tc.id || `call-${i}`,
+ name,
+ summary: summarizeArgs(name, args),
+ arguments: args,
+ response,
+ responsePreview: previewOf(response),
+ responseLength: response.length,
+ };
+ });
+ return {
+ source: "tool-calls",
+ calls,
+ byId: buildById(calls),
+ toolDefinitions: [],
+ toolDefsByName: new Map(),
+ };
+}
+
+interface AtifContentPart {
+ type?: string;
+ text?: string;
+}
+interface AtifToolCall {
+ tool_call_id?: string;
+ function_name?: string;
+ arguments?: Record;
+}
+interface AtifObservationResult {
+ source_call_id?: string;
+ content?: string | AtifContentPart[];
+}
+interface AtifStep {
+ step_id?: number;
+ source?: string;
+ model_name?: string;
+ reasoning_content?: string;
+ tool_calls?: AtifToolCall[];
+ observation?: { results?: AtifObservationResult[] };
+}
+interface AtifToolDefinition {
+ type?: string;
+ function?: { name?: string; description?: string; parameters?: Record };
+}
+interface AtifTrajectory {
+ agent?: {
+ name?: string;
+ version?: string;
+ model_name?: string;
+ tool_definitions?: AtifToolDefinition[];
+ };
+ steps?: AtifStep[];
+ final_metrics?: unknown;
+}
+
+/** Parse the raw ATIF blob defensively into an object (handles string input and
+ * an optional `{ trajectory: … }` wrapper). Returns `{}` on any failure. */
+function parseAtif(input: unknown): AtifTrajectory {
+ let obj: unknown = input;
+ if (typeof input === "string") {
+ try {
+ obj = JSON.parse(input);
+ } catch {
+ return {};
+ }
+ }
+ if (!obj || typeof obj !== "object") return {};
+ const maybeWrapped = obj as { trajectory?: unknown };
+ if (maybeWrapped.trajectory && typeof maybeWrapped.trajectory === "object") {
+ return maybeWrapped.trajectory as AtifTrajectory;
+ }
+ return obj as AtifTrajectory;
+}
+
+/**
+ * Normalize a parsed ATIF trajectory (the observation path) into an
+ * {@link AgentTrajectory}. Walks the steps: agent steps contribute their
+ * `tool_calls[]`, each paired with the matching same-step
+ * `observation.results[]` by `source_call_id === tool_call_id`. System and user
+ * steps are summarized in `steps` but never contribute calls (and their raw
+ * message text — including the large system prompt — is never surfaced).
+ */
+export function fromAtif(input: unknown): AgentTrajectory {
+ const traj = parseAtif(input);
+ const agent = traj.agent ?? {};
+ const stepsArr = Array.isArray(traj.steps) ? traj.steps : [];
+
+ const calls: AgentToolCall[] = [];
+ const steps: StepOverview[] = [];
+ let synth = 0;
+ let firstAgentModel: string | undefined;
+
+ for (let i = 0; i < stepsArr.length; i++) {
+ const step = stepsArr[i] ?? {};
+ const stepNum = typeof step.step_id === "number" ? step.step_id : i + 1;
+ const source = typeof step.source === "string" ? step.source : "unknown";
+ const reasoning =
+ typeof step.reasoning_content === "string" && step.reasoning_content.length > 0
+ ? step.reasoning_content
+ : undefined;
+ const stepCalls = Array.isArray(step.tool_calls) ? step.tool_calls : [];
+
+ if (source === "agent" && !firstAgentModel && typeof step.model_name === "string") {
+ firstAgentModel = step.model_name;
+ }
+
+ // Index this step's observation results by the call they answer.
+ const obsByCallId = new Map();
+ const results = step.observation?.results;
+ if (Array.isArray(results)) {
+ for (const r of results) {
+ if (r && typeof r.source_call_id === "string") {
+ obsByCallId.set(r.source_call_id, coerceContent(r.content));
+ }
+ }
+ }
+
+ for (const tc of stepCalls) {
+ const name = typeof tc.function_name === "string" ? tc.function_name : "unknown";
+ const args = (tc.arguments ?? {}) as Record;
+ const toolCallId =
+ typeof tc.tool_call_id === "string" && tc.tool_call_id.length > 0
+ ? tc.tool_call_id
+ : `atif-${stepNum}-${synth++}`;
+ const response = obsByCallId.get(toolCallId) ?? "";
+ calls.push({
+ toolCallId,
+ step: stepNum,
+ name,
+ summary: summarizeArgs(name, args),
+ arguments: args,
+ response,
+ responsePreview: previewOf(response),
+ responseLength: response.length,
+ reasoning,
+ });
+ }
+
+ steps.push({
+ step: stepNum,
+ source,
+ toolCallCount: stepCalls.length,
+ reasoningSummary: reasoning ? previewOf(reasoning, LIST_PREVIEW_LIMIT) : undefined,
+ });
+ }
+
+ const defs = Array.isArray(agent.tool_definitions) ? agent.tool_definitions : [];
+ const toolDefinitions: AgentToolDefinition[] = defs
+ .map((d) => ({
+ name: d?.function?.name ?? "",
+ type: typeof d?.type === "string" ? d.type : "function",
+ description: d?.function?.description,
+ parameters: d?.function?.parameters,
+ }))
+ .filter((d) => d.name.length > 0);
+ const toolDefsByName = new Map(toolDefinitions.map((d) => [d.name, d]));
+
+ return {
+ source: "atif",
+ agent: typeof agent.name === "string" ? agent.name : undefined,
+ model: agent.model_name ?? firstAgentModel,
+ calls,
+ byId: buildById(calls),
+ toolDefinitions,
+ toolDefsByName,
+ steps,
+ finalMetrics: traj.final_metrics,
+ };
+}
+
+// ---------------------------------------------------------------------------
+// Tools
+// ---------------------------------------------------------------------------
+
+function writeSpill(spillDir: string, filename: string, text: string): string {
+ mkdirSync(spillDir, { recursive: true });
+ const file = join(spillDir, `${filename}.txt`);
+ writeFileSync(file, text, "utf-8");
+ return file;
+}
+
+/**
+ * Build the four read-only trajectory tools over a normalized
+ * {@link AgentTrajectory}. All are `skipPermission: true` because the judge runs
+ * headless (no TUI to answer permission prompts; see scope #1125).
+ *
+ * @param trajectory normalized agent trajectory
+ * @param spillDir directory OUTSIDE the workspace where oversized outputs are
+ * written so they never pollute the codebase under evaluation. The judge reads
+ * them back via `read_file` (which is granted this dir as an extra read root).
+ */
+export function createTrajectoryTools(trajectory: AgentTrajectory, spillDir: string) {
+ const listAgentTools = defineTool("list_agent_tools", {
+ description:
+ "List the tools the coding agent had available during this run (its tool catalog / definitions). Returns each tool's name, type, a short description preview and whether it takes parameters. Use get_agent_tools(toolNames) to fetch a tool's full description and parameter schema. Empty when no tool catalog was captured.",
+ skipPermission: true,
+ parameters: { type: "object", properties: {}, required: [] },
+ handler: async () => {
+ const tools = trajectory.toolDefinitions.map((d) => {
+ const description = d.description ?? "";
+ return {
+ name: d.name,
+ type: d.type,
+ descriptionPreview: previewOf(description, LIST_PREVIEW_LIMIT),
+ descriptionLength: description.length,
+ hasParameters: !!d.parameters && Object.keys(d.parameters).length > 0,
+ };
+ });
+ return { count: tools.length, tools };
+ },
+ });
+
+ const getAgentTools = defineTool("get_agent_tools", {
+ description:
+ "Return the full definition (type, description and parameter JSON-schema) of the named agent tools, as listed by list_agent_tools. Pass a list of tool names. A very long description is written to a file (descriptionFile) you can open with read_file; the parameter schema is always returned inline. Unknown names are returned in notFound.",
+ skipPermission: true,
+ parameters: {
+ type: "object",
+ properties: {
+ toolNames: {
+ type: "array",
+ items: { type: "string" },
+ description: "Tool names to fetch (from list_agent_tools).",
+ },
+ },
+ required: ["toolNames"],
+ },
+ handler: async (args: { toolNames?: string[] }) => {
+ const names = Array.isArray(args?.toolNames) ? args.toolNames : [];
+ const tools: Record[] = [];
+ const notFound: string[] = [];
+ for (let i = 0; i < names.length; i++) {
+ const name = names[i];
+ const def = trajectory.toolDefsByName.get(name);
+ if (!def) {
+ notFound.push(name);
+ continue;
+ }
+ const description = def.description ?? "";
+ const base: Record = {
+ name: def.name,
+ type: def.type,
+ parameters: def.parameters,
+ descriptionLength: description.length,
+ };
+ if (description.length <= INLINE_LIMIT) {
+ base.description = description;
+ } else {
+ base.descriptionPreview = previewOf(description);
+ base.descriptionFile = writeSpill(spillDir, safeId(`tool-${def.name}`, i), description);
+ }
+ tools.push(base);
+ }
+ return { tools, notFound };
+ },
+ });
+
+ const listAgentToolCalls = defineTool("list_agent_tool_calls", {
+ description:
+ "List the tool calls the coding agent made during this run (its trajectory of invocations). Returns each call's toolCallId, step, name, a one-line argument summary, a short response preview and the full response length. Use get_agent_tool_calls(toolCallIds) to fetch full arguments and output for the calls you care about. Consult these to determine what the agent actually did and whether a command succeeded.",
+ skipPermission: true,
+ parameters: { type: "object", properties: {}, required: [] },
+ handler: async () => {
+ if (trajectory.calls.length === 0) {
+ return { count: 0, calls: [], message: "No tool calls were captured for this run." };
+ }
+ const calls = trajectory.calls.map((c) => ({
+ toolCallId: c.toolCallId,
+ step: c.step,
+ name: c.name,
+ summary: c.summary,
+ responsePreview: c.responsePreview.slice(0, LIST_PREVIEW_LIMIT),
+ responseLength: c.responseLength,
+ }));
+ return { count: calls.length, calls };
+ },
+ });
+
+ const getAgentToolCalls = defineTool("get_agent_tool_calls", {
+ description:
+ "Return the full arguments and captured output for a list of tool calls, identified by their toolCallId (as listed by list_agent_tool_calls). A very long output is written to a file (responseFile) you can open with read_file; shorter outputs are returned inline. Unknown ids are returned in notFound.",
+ skipPermission: true,
+ parameters: {
+ type: "object",
+ properties: {
+ toolCallIds: {
+ type: "array",
+ items: { type: "string" },
+ description: "Tool call ids to fetch (from list_agent_tool_calls).",
+ },
+ },
+ required: ["toolCallIds"],
+ },
+ handler: async (args: { toolCallIds?: string[] }) => {
+ const ids = Array.isArray(args?.toolCallIds) ? args.toolCallIds : [];
+ const calls: Record[] = [];
+ const notFound: string[] = [];
+ for (const id of ids) {
+ const c = trajectory.byId.get(id);
+ if (!c) {
+ notFound.push(id);
+ continue;
+ }
+ const base: Record = {
+ toolCallId: c.toolCallId,
+ step: c.step,
+ name: c.name,
+ arguments: c.arguments,
+ reasoning: c.reasoning,
+ responseLength: c.responseLength,
+ };
+ if (c.responseLength <= INLINE_LIMIT) {
+ base.response = c.response;
+ } else {
+ const pos = trajectory.calls.indexOf(c);
+ base.responsePreview = c.responsePreview;
+ base.responseFile = writeSpill(spillDir, safeId(c.toolCallId, pos), c.response);
+ }
+ calls.push(base);
+ }
+ return { calls, notFound };
+ },
+ });
+
+ const getTrajectoryOverview = defineTool("get_trajectory_overview", {
+ description:
+ "Return a high-level overview of the agent's run: source, agent, model, the number of available tools and tool calls, a per-step summary (without the raw system prompt) and final metrics. Use this to orient before drilling into specific tools or calls.",
+ skipPermission: true,
+ parameters: { type: "object", properties: {}, required: [] },
+ handler: async () => ({
+ source: trajectory.source,
+ agent: trajectory.agent,
+ model: trajectory.model,
+ totalTools: trajectory.toolDefinitions.length,
+ totalCalls: trajectory.calls.length,
+ steps: trajectory.steps,
+ finalMetrics: trajectory.finalMetrics,
+ }),
+ });
+
+ return [
+ listAgentTools,
+ getAgentTools,
+ listAgentToolCalls,
+ getAgentToolCalls,
+ getTrajectoryOverview,
+ ];
+}
diff --git a/apps/judge/src/index.ts b/apps/judge/src/index.ts
index 0dea452cd..fd5a42e38 100644
--- a/apps/judge/src/index.ts
+++ b/apps/judge/src/index.ts
@@ -5,6 +5,7 @@ import express, { Request, Response, NextFunction } from "express";
import dotenv from "dotenv";
import { evaluateWorkspace } from "./judge-agent.js";
import { verifyCopilotProtocol } from "./protocol-check.js";
+import { type AgentTrajectory, fromAtif, fromToolCalls } from "./agent-trajectory.js";
import { BlobStorage, RedisLogPublisher } from "shared";
import { mkdtempSync, rmSync } from "fs";
import { tmpdir } from "os";
@@ -89,44 +90,38 @@ app.post(
console.log(`[judge] Snapshot extracted to ${workDir}`);
- // Download this iteration's captured tool calls/outputs (build/test/run
- // output), if provided. Failures are non-fatal — the judge can still
- // evaluate the workspace files.
- let toolCalls: import("shared").ToolCall[] = [];
- if (toolCallsUrl && typeof toolCallsUrl === "string") {
+ // Build the agent's captured trajectory from whichever channel was
+ // provided, normalized into ONE source-agnostic model the judge navigates
+ // with the unified trajectory tools (list/get_agent_tool_calls,
+ // list/get_agent_tools, get_trajectory_overview). Gates send the HAR
+ // ToolCall[] via toolCallsUrl; observations (#1156) send the full ATIF via
+ // atifUrl — the normalized superset that also carries the agent's tool
+ // catalog and per-step reasoning. ATIF wins if both ever arrive (superset).
+ // Failures are non-fatal — the judge can still evaluate the workspace
+ // files. See apps/judge/src/agent-trajectory.ts.
+ let trajectory: AgentTrajectory | undefined;
+ if (atifUrl && typeof atifUrl === "string") {
try {
- toolCalls = await blobStorage.getToolCalls(toolCallsUrl);
+ const atif = await blobStorage.downloadJson(atifUrl);
+ trajectory = fromAtif(atif);
console.log(
- `[judge] Loaded ${toolCalls.length} tool call(s) for gate '${gate ?? "select"}'`,
+ `[judge] Loaded ATIF trajectory from ${atifUrl}: ${trajectory.calls.length} call(s), ${trajectory.toolDefinitions.length} tool definition(s)`,
);
} catch (err) {
console.warn(
- `[judge] Failed to load tool calls from ${toolCallsUrl}: ${err instanceof Error ? err.message : String(err)}`,
+ `[judge] Failed to load ATIF from ${atifUrl}: ${err instanceof Error ? err.message : String(err)}`,
);
}
- }
-
- // Load the ATIF trajectory (normalized superset of tool calls) when
- // provided — used by pp-taxonomy to evaluate observations against the
- // full agent trajectory, not just the end-state snapshot. Exposed to the
- // judge as a synthetic tool output so trajectory-only observations (e.g.
- // a dependency added then removed mid-run) are detectable. Issue #1156.
- if (atifUrl && typeof atifUrl === "string") {
+ } else if (toolCallsUrl && typeof toolCallsUrl === "string") {
try {
- const atif = await blobStorage.downloadJson(atifUrl);
- toolCalls = [
- ...toolCalls,
- {
- id: "atif-trajectory",
- name: "agent_trajectory_atif",
- arguments: {},
- response: typeof atif === "string" ? atif : JSON.stringify(atif),
- },
- ];
- console.log(`[judge] Loaded ATIF trajectory from ${atifUrl}`);
+ const toolCalls = await blobStorage.getToolCalls(toolCallsUrl);
+ trajectory = fromToolCalls(toolCalls);
+ console.log(
+ `[judge] Loaded ${trajectory.calls.length} tool call(s) for gate '${gate ?? "select"}'`,
+ );
} catch (err) {
console.warn(
- `[judge] Failed to load ATIF from ${atifUrl}: ${err instanceof Error ? err.message : String(err)}`,
+ `[judge] Failed to load tool calls from ${toolCallsUrl}: ${err instanceof Error ? err.message : String(err)}`,
);
}
}
@@ -153,7 +148,7 @@ app.post(
personaInstructions,
onProgress,
gate,
- toolCalls,
+ trajectory,
});
const elapsed = Date.now() - startTime;
diff --git a/apps/judge/src/judge-agent.ts b/apps/judge/src/judge-agent.ts
index a6c3672c0..19d74abbc 100644
--- a/apps/judge/src/judge-agent.ts
+++ b/apps/judge/src/judge-agent.ts
@@ -8,10 +8,10 @@ import {
DetailedEvaluationResult,
DependencyGraph,
GateId,
- ToolCall,
} from "shared";
import { getCriteriaProvider } from "shared/criteria-provider-factory";
import { createJudgeStrategy } from "./judge-strategies.js";
+import type { AgentTrajectory } from "./agent-trajectory.js";
import { FeedbackGenerator } from "./feedback-generator.js";
export interface EvaluationInput {
@@ -23,8 +23,10 @@ export interface EvaluationInput {
onProgress?: (result: CriterionResult) => void;
/** Which gate is being evaluated. Defaults to select. */
gate?: GateId;
- /** This iteration's captured tool calls/outputs, exposed to the judge via read_tool_outputs. */
- toolCalls?: ToolCall[];
+ /** The coding agent's captured trajectory (normalized from the HAR tool calls
+ * for gates, or the ATIF for observations), exposed to the judge via the
+ * unified trajectory tools. */
+ trajectory?: AgentTrajectory;
}
export interface EvaluationResult {
@@ -102,7 +104,7 @@ export async function evaluateWorkspace(
personaInstructions: input.personaInstructions,
onProgress: input.onProgress,
gate: input.gate,
- toolCalls: input.toolCalls,
+ trajectory: input.trajectory,
});
console.log(
diff --git a/apps/judge/src/judge-evaluation.integration.test.ts b/apps/judge/src/judge-evaluation.integration.test.ts
index af96b1e42..8b5f7237f 100644
--- a/apps/judge/src/judge-evaluation.integration.test.ts
+++ b/apps/judge/src/judge-evaluation.integration.test.ts
@@ -24,7 +24,9 @@ import { mkdtempSync, writeFileSync, rmSync, realpathSync } from "fs";
import { tmpdir } from "os";
import { join } from "path";
import { resetCriteriaProvider } from "shared/criteria-provider-factory";
+import type { ToolCall } from "shared";
import { evaluateWorkspace } from "./judge-agent.js";
+import { fromToolCalls } from "./agent-trajectory.js";
const hasToken = !!process.env.GITHUB_TOKEN;
@@ -64,6 +66,26 @@ describe("judge end-to-end evaluation (integration)", () => {
].join("\n")
);
+ // Gate-regression criterion (issue #1156 / P10): its verdict is derivable
+ // ONLY from the agent's captured tool output, NOT from the workspace files,
+ // so the judge must navigate the trajectory (list_agent_tool_calls /
+ // get_agent_tool_calls over a `fromToolCalls`-derived trajectory — the gate
+ // path) to decide. Guards that normalizing the HAR ToolCall[] and exposing it
+ // through the new tools yields the same boolean verdict the legacy
+ // read_tool_outputs/get_tool_output pair would.
+ writeFileSync(
+ join(criteriaDir, "build_succeeded.yaml"),
+ [
+ "id: build_succeeded",
+ "prompt: |",
+ " The agent ran the project's build command and it completed",
+ " successfully (exit code 0, no compiler errors). This is only derivable",
+ " from the agent's captured tool calls — inspect them to confirm the",
+ " build command's output reports success.",
+ "",
+ ].join("\n")
+ );
+
setEnv("CRITERIA_DIR", criteriaDir);
setEnv("JUDGE_STRATEGY", process.env.JUDGE_STRATEGY || "independent");
setEnv("JUDGE_MODEL", JUDGE_MODEL);
@@ -120,6 +142,77 @@ describe("judge end-to-end evaluation (integration)", () => {
}
);
+ it.skipIf(!hasToken)(
+ "gate regression: a clear-PASS build gate built from a tool-call trajectory passes",
+ { timeout: 300_000 },
+ async () => {
+ // The gate path: normalize the HAR ToolCall[] via fromToolCalls and let the
+ // judge navigate it with the unified trajectory tools. The build output says
+ // success, so the gate must pass. Verdict comes from the trajectory, not the
+ // workspace (which has no build log).
+ const passTrajectory = fromToolCalls([
+ {
+ id: "tc-build-pass",
+ name: "bash",
+ arguments: { command: "npm run build" },
+ response:
+ "> demo@1.0.0 build\n> tsc\n\nBuild succeeded. 0 errors, 0 warnings.\nExit code: 0",
+ timestamp: "",
+ } as ToolCall,
+ ]);
+
+ const result = await evaluateWorkspace({
+ workspacePath: workspaceDir,
+ criteria: ["build_succeeded"],
+ conversationHistory: [],
+ trajectory: passTrajectory,
+ });
+
+ const gate = result.criteriaResults.find((r) => r.criterionId === "build_succeeded");
+ expect(gate, "build_succeeded result missing").toBeTruthy();
+ expect(gate!.evaluated).toBe(true);
+ expect(
+ gate!.passed,
+ `expected clear-PASS build gate to pass from tool output. Feedback: ${gate!.feedback}`
+ ).toBe(true);
+ }
+ );
+
+ it.skipIf(!hasToken)(
+ "gate regression: a clear-FAIL build gate built from a tool-call trajectory fails",
+ { timeout: 300_000 },
+ async () => {
+ // Same gate, opposite evidence: the build output reports a compiler error and
+ // a non-zero exit, so the gate must fail. Proves the trajectory drives the
+ // boolean verdict in both directions (no false positives).
+ const failTrajectory = fromToolCalls([
+ {
+ id: "tc-build-fail",
+ name: "bash",
+ arguments: { command: "npm run build" },
+ response:
+ "> demo@1.0.0 build\n> tsc\n\nsrc/index.ts(3,7): error TS2304: Cannot find name 'foo'.\n\nBuild failed. 1 error.\nExit code: 1",
+ timestamp: "",
+ } as ToolCall,
+ ]);
+
+ const result = await evaluateWorkspace({
+ workspacePath: workspaceDir,
+ criteria: ["build_succeeded"],
+ conversationHistory: [],
+ trajectory: failTrajectory,
+ });
+
+ const gate = result.criteriaResults.find((r) => r.criterionId === "build_succeeded");
+ expect(gate, "build_succeeded result missing").toBeTruthy();
+ expect(gate!.evaluated).toBe(true);
+ expect(
+ gate!.passed,
+ `expected clear-FAIL build gate to fail from tool output. Feedback: ${gate!.feedback}`
+ ).toBe(false);
+ }
+ );
+
it("logs a skip note when GITHUB_TOKEN is absent (no real evaluation possible)", () => {
if (!hasToken) {
console.warn(
diff --git a/apps/judge/src/judge-strategies.test.ts b/apps/judge/src/judge-strategies.test.ts
index 5cf0dfcdc..4162fa6ef 100644
--- a/apps/judge/src/judge-strategies.test.ts
+++ b/apps/judge/src/judge-strategies.test.ts
@@ -8,8 +8,9 @@ import { join } from "path";
import {
IndependentStrategy,
BundledStrategy,
- TOOL_OUTPUTS_GUIDANCE,
+ TRAJECTORY_GUIDANCE,
isWithinWorkspace,
+ isWithinAnyRoot,
JUDGE_AVAILABLE_TOOLS,
JUDGE_EXCLUDED_TOOLS,
} from "./judge-strategies.js";
@@ -20,17 +21,17 @@ import {
* Copilot session.
*/
class TestableStrategy extends IndependentStrategy {
- publicCreateFileTools(workspacePath: string) {
- return this.createFileTools(workspacePath);
- }
- publicCreateToolOutputTools(toolCalls: any[]) {
- return this.createToolOutputTools(toolCalls);
+ publicCreateFileTools(
+ workspacePath: string,
+ opts?: { extraReadRoots?: string[] }
+ ) {
+ return this.createFileTools(workspacePath, opts);
}
publicBuildSessionConfig(tools: any[], systemPrompt: string) {
return this.buildSessionConfig(tools, systemPrompt);
}
- publicBuildSystemPrompt(hasToolOutputs: boolean) {
- return (this as any).buildSystemPrompt(undefined, hasToolOutputs);
+ publicBuildSystemPrompt(hasTrajectory: boolean) {
+ return (this as any).buildSystemPrompt(undefined, hasTrajectory);
}
publicBuildUserPrompt(
criterion: { id: string; prompt: string },
@@ -40,9 +41,12 @@ class TestableStrategy extends IndependentStrategy {
}
}
-function toolMap(workspacePath: string) {
+function toolMap(
+ workspacePath: string,
+ opts?: { extraReadRoots?: string[] }
+) {
const strategy = new TestableStrategy("test-model");
- const tools = strategy.publicCreateFileTools(workspacePath);
+ const tools = strategy.publicCreateFileTools(workspacePath, opts);
return new Map(tools.map((t) => [t.name, t]));
}
@@ -56,9 +60,10 @@ const stubInvocation = {
async function callTool(
workspacePath: string,
name: string,
- args: Record
+ args: Record,
+ opts?: { extraReadRoots?: string[] }
): Promise {
- const tool = toolMap(workspacePath).get(name);
+ const tool = toolMap(workspacePath, opts).get(name);
if (!tool?.handler) throw new Error(`tool ${name} has no handler`);
return (tool.handler as (a: unknown, b: unknown) => unknown)(args, stubInvocation);
}
@@ -86,37 +91,6 @@ describe("judge file tools", () => {
});
});
-describe("judge tool-output tools (issue #1125)", () => {
- const strategy = new TestableStrategy("test-model");
- const toolCalls = [
- {
- id: "1",
- name: "bash",
- arguments: { command: "npm run build" },
- response: "build ok",
- timestamp: "",
- },
- ];
- const tools = strategy.publicCreateToolOutputTools(toolCalls);
-
- it("exposes read_tool_outputs and get_tool_output", () => {
- const names = tools.map((t) => t.name).sort();
- expect(names).toEqual(["get_tool_output", "read_tool_outputs"]);
- });
-
- // Regression guard for scope #1125: headless, any tool without skipPermission
- // is denied at execution time ("could not request permission from user"). When
- // this affected read_tool_outputs/get_tool_output, the judge could never see
- // the coding agent's captured build/test output and wrongly demanded on-disk
- // proof files, forcing the build gate to loop for many iterations.
- it("marks every tool-output tool to skip the permission prompt", () => {
- expect(tools.length).toBeGreaterThan(0);
- for (const tool of tools) {
- expect(tool.skipPermission, `${tool.name} must skip the permission prompt`).toBe(true);
- }
- });
-});
-
describe("isWithinWorkspace", () => {
it("accepts the root itself and nested paths", () => {
expect(isWithinWorkspace("/tmp/ws", "/tmp/ws")).toBe(true);
@@ -137,6 +111,21 @@ describe("isWithinWorkspace", () => {
});
});
+describe("isWithinAnyRoot", () => {
+ it("accepts a path inside any of the roots", () => {
+ expect(isWithinAnyRoot(["/tmp/ws", "/tmp/spill"], "/tmp/ws/src/a.ts")).toBe(true);
+ expect(isWithinAnyRoot(["/tmp/ws", "/tmp/spill"], "/tmp/spill/out.txt")).toBe(true);
+ expect(isWithinAnyRoot(["/tmp/ws", "/tmp/spill"], "/tmp/spill")).toBe(true);
+ });
+
+ it("rejects a path outside every root (guard preserved per-root)", () => {
+ expect(isWithinAnyRoot(["/tmp/ws", "/tmp/spill"], "/tmp/ws2/secret")).toBe(false);
+ expect(isWithinAnyRoot(["/tmp/ws", "/tmp/spill"], "/etc/passwd")).toBe(false);
+ // sibling-prefix of an allowed root must not slip through
+ expect(isWithinAnyRoot(["/tmp/ws", "/tmp/spill"], "/tmp/spill2/x")).toBe(false);
+ });
+});
+
describe("judge file tool handlers (workspace scoping)", () => {
let parent: string;
let workspace: string;
@@ -201,6 +190,85 @@ describe("judge file tool handlers (workspace scoping)", () => {
});
});
+describe("judge file tools — extraReadRoots (P10 trajectory spill dir)", () => {
+ // The trajectory tools spill oversized outputs to a dir OUTSIDE the workspace
+ // and return its absolute path; read_file/file_exists must be able to open it
+ // (via extraReadRoots) WITHOUT widening list_directory/search_files, so the
+ // codebase view other criteria inspect is never polluted by spill files.
+ let parent: string;
+ let workspace: string;
+ let spill: string;
+
+ beforeAll(() => {
+ parent = mkdtempSync(join(tmpdir(), "judge-spill-"));
+ workspace = join(parent, "ws");
+ spill = join(parent, "spill");
+ mkdirSync(workspace, { recursive: true });
+ mkdirSync(spill, { recursive: true });
+ writeFileSync(join(workspace, "inside.txt"), "in-workspace");
+ writeFileSync(join(spill, "big-output.txt"), "SPILLED OUTPUT");
+ });
+
+ afterAll(() => {
+ rmSync(parent, { recursive: true, force: true });
+ });
+
+ it("read_file opens an absolute path under an extra read root", async () => {
+ const result = (await callTool(
+ workspace,
+ "read_file",
+ { path: join(spill, "big-output.txt") },
+ { extraReadRoots: [spill] }
+ )) as { content?: string; error?: string };
+ expect(result.error).toBeUndefined();
+ expect(result.content).toBe("SPILLED OUTPUT");
+ });
+
+ it("file_exists confirms a file under an extra read root", async () => {
+ const result = (await callTool(
+ workspace,
+ "file_exists",
+ { path: join(spill, "big-output.txt") },
+ { extraReadRoots: [spill] }
+ )) as { exists?: boolean; error?: string };
+ expect(result.error).toBeUndefined();
+ expect(result.exists).toBe(true);
+ });
+
+ it("read_file still rejects an absolute path outside the workspace AND the extra roots", async () => {
+ const outside = join(parent, "other", "secret.txt");
+ mkdirSync(join(parent, "other"), { recursive: true });
+ writeFileSync(outside, "SECRET");
+ const result = (await callTool(
+ workspace,
+ "read_file",
+ { path: outside },
+ { extraReadRoots: [spill] }
+ )) as { content?: string; error?: string };
+ expect(result.error).toBe("Path traversal not allowed");
+ expect(result.content).toBeUndefined();
+ });
+
+ it("read_file without extraReadRoots rejects the spill path (default behaviour unchanged)", async () => {
+ const result = (await callTool(workspace, "read_file", {
+ path: join(spill, "big-output.txt"),
+ })) as { content?: string; error?: string };
+ expect(result.error).toBe("Path traversal not allowed");
+ });
+
+ it("list_directory stays workspace-only — it cannot reveal an extra read root's contents", async () => {
+ const result = (await callTool(
+ workspace,
+ "list_directory",
+ { path: spill },
+ { extraReadRoots: [spill] }
+ )) as { entries?: { name: string }[]; error?: string };
+ // Whether it errors or resolves the absolute path back under the workspace,
+ // it must never surface the spilled file — list_directory ignores extraReadRoots.
+ expect(result.entries?.some((e) => e.name === "big-output.txt") ?? false).toBe(false);
+ });
+});
+
describe("judge session tool restriction (scope #1117)", () => {
const strategy = new TestableStrategy("test-model");
const config = strategy.publicBuildSessionConfig([], "system prompt");
@@ -243,8 +311,8 @@ describe("judge session tool restriction (scope #1117)", () => {
* without running a real Copilot session.
*/
class TestableBundledStrategy extends BundledStrategy {
- publicBuildSystemPrompt(hasToolOutputs: boolean) {
- return (this as any).buildSystemPrompt(undefined, hasToolOutputs);
+ publicBuildSystemPrompt(hasTrajectory: boolean) {
+ return (this as any).buildSystemPrompt(undefined, hasTrajectory);
}
publicBuildUserPrompt(
criteria: { id: string; prompt: string }[] = [
@@ -256,51 +324,59 @@ class TestableBundledStrategy extends BundledStrategy {
}
}
-describe("judge tool-outputs guidance (issue #1125)", () => {
+describe("judge trajectory guidance (issue #1125 / #1156)", () => {
// The headless judge cannot run commands; it must decide from the codebase
- // plus the coding agent's captured tool outputs. The guidance must be generic
+ // plus the coding agent's captured trajectory. The guidance must be generic
// (not build/test specific) and must tell the judge to treat captured output
// as authoritative instead of demanding the agent redo or re-prove the work.
it("is generic, not tied to any one command type", () => {
- const g = TOOL_OUTPUTS_GUIDANCE.toLowerCase();
+ const g = TRAJECTORY_GUIDANCE.toLowerCase();
expect(g).not.toMatch(/build\.log|build_proof|\bnpm run build\b/);
});
it("tells the judge it cannot run commands itself", () => {
- expect(TOOL_OUTPUTS_GUIDANCE.toLowerCase()).toContain("cannot run any commands");
+ expect(TRAJECTORY_GUIDANCE.toLowerCase()).toContain("cannot run any commands");
+ });
+
+ it("names the judge's own read-only tools and the unified trajectory tools", () => {
+ expect(TRAJECTORY_GUIDANCE).toContain("## Your Tools");
+ expect(TRAJECTORY_GUIDANCE).toContain("read_file");
+ expect(TRAJECTORY_GUIDANCE).toContain("list_agent_tool_calls");
+ expect(TRAJECTORY_GUIDANCE).toContain("get_agent_tool_calls");
+ expect(TRAJECTORY_GUIDANCE).toContain("list_agent_tools");
+ expect(TRAJECTORY_GUIDANCE).toContain("get_agent_tools");
+ expect(TRAJECTORY_GUIDANCE.toLowerCase()).toContain("codebase");
});
- it("names the judge's own read-only tools and disambiguates them from the agent's", () => {
- expect(TOOL_OUTPUTS_GUIDANCE).toContain("## Your Tools");
- expect(TOOL_OUTPUTS_GUIDANCE).toContain("read_file");
- expect(TOOL_OUTPUTS_GUIDANCE).toContain("read_tool_outputs");
- expect(TOOL_OUTPUTS_GUIDANCE).toContain("get_tool_output");
- expect(TOOL_OUTPUTS_GUIDANCE.toLowerCase()).toContain("codebase");
+ it("tells the judge to open spilled outputs (responseFile/descriptionFile) with read_file", () => {
+ expect(TRAJECTORY_GUIDANCE).toContain("responseFile");
+ expect(TRAJECTORY_GUIDANCE).toContain("descriptionFile");
+ expect(TRAJECTORY_GUIDANCE.toLowerCase()).toMatch(/open .*with read_file|read_file/);
});
- it("frames the codebase and captured outputs as equally authoritative and to be examined together", () => {
- expect(TOOL_OUTPUTS_GUIDANCE).toContain("## How to Judge");
- const g = TOOL_OUTPUTS_GUIDANCE.toLowerCase();
+ it("frames the codebase and captured trajectory as equally authoritative and to be examined together", () => {
+ expect(TRAJECTORY_GUIDANCE).toContain("## How to Judge");
+ const g = TRAJECTORY_GUIDANCE.toLowerCase();
expect(g).toContain("equally authoritative");
expect(g).toContain("examine both");
});
it("treats captured output as the record of what happened and forbids redundant re-proving", () => {
- const g = TOOL_OUTPUTS_GUIDANCE.toLowerCase();
+ const g = TRAJECTORY_GUIDANCE.toLowerCase();
expect(g).toContain("record of what happened");
expect(g).toMatch(/redo or re-prove/);
});
it("overrides criteria wording that asks the judge to run commands", () => {
- const g = TOOL_OUTPUTS_GUIDANCE.toLowerCase();
+ const g = TRAJECTORY_GUIDANCE.toLowerCase();
expect(g).toContain("criterion");
expect(g).toMatch(/run, execute, or re-run/);
expect(g).toContain("ignore that instruction");
});
- it("includes the guidance in the system prompt when tool outputs are present", () => {
+ it("includes the guidance in the system prompt when a trajectory is present", () => {
const prompt = new TestableBundledStrategy("test-model").publicBuildSystemPrompt(true);
- expect(prompt).toContain(TOOL_OUTPUTS_GUIDANCE);
+ expect(prompt).toContain(TRAJECTORY_GUIDANCE);
});
it("frames What to Evaluate around the agent's work and points at the user message", () => {
@@ -310,9 +386,9 @@ describe("judge tool-outputs guidance (issue #1125)", () => {
expect(prompt).toMatch(/each criterion provided in the user message/);
});
- it("omits the guidance when no tool outputs were captured", () => {
+ it("omits the guidance when no trajectory was captured", () => {
const prompt = new TestableBundledStrategy("test-model").publicBuildSystemPrompt(false);
- expect(prompt).not.toContain(TOOL_OUTPUTS_GUIDANCE);
+ expect(prompt).not.toContain(TRAJECTORY_GUIDANCE);
});
});
diff --git a/apps/judge/src/judge-strategies.ts b/apps/judge/src/judge-strategies.ts
index 19705be5e..dfa6c2ef2 100644
--- a/apps/judge/src/judge-strategies.ts
+++ b/apps/judge/src/judge-strategies.ts
@@ -2,8 +2,9 @@
// Licensed under the MIT License.
import { CopilotClient, defineTool, SessionEvent } from "@github/copilot-sdk";
-import { readFileSync, readdirSync, statSync, existsSync } from "fs";
-import { join, resolve, sep } from "path";
+import { readFileSync, readdirSync, statSync, existsSync, mkdtempSync, rmSync } from "fs";
+import { tmpdir } from "os";
+import { isAbsolute, join, resolve, sep } from "path";
import { execFileSync } from "child_process";
import {
CriteriaConfig,
@@ -12,10 +13,13 @@ import {
ConversationTurn,
DependencyGraph,
GateId,
- ToolCall,
TokenManagerClient,
withRetry,
} from "shared";
+import {
+ type AgentTrajectory,
+ createTrajectoryTools,
+} from "./agent-trajectory.js";
export interface JudgeStrategyContext {
workspacePath: string;
@@ -28,8 +32,9 @@ export interface JudgeStrategyContext {
onProgress?: (result: CriterionResult) => void;
/** Which gate is being evaluated. Defaults to select. */
gate?: GateId;
- /** This iteration's captured tool calls/outputs (build/test/run output). */
- toolCalls?: ToolCall[];
+ /** The coding agent's captured trajectory (normalized from the HAR tool calls
+ * for gates, or the ATIF for observations). */
+ trajectory?: AgentTrajectory;
}
/**
@@ -54,11 +59,16 @@ const DEFAULT_JUDGE_RETRIES = 3;
* its decision on actual evidence instead of demanding the agent re-prove work
* it has already done. It is intentionally generic across all criteria.
*/
-export const TOOL_OUTPUTS_GUIDANCE = `## Your Tools
-You have read-only tools to gather evidence: read_file, list_directory, search_files and file_exists to inspect the workspace, and read_tool_outputs / get_tool_output to review the tool calls the coding agent ran while doing the task. You yourself cannot run any commands or coding-agent tools — you can only read what the agent already did.
+export const TRAJECTORY_GUIDANCE = `## Your Tools
+You have read-only tools to gather evidence — you cannot run any commands or coding-agent tools yourself, you can only read what the agent already did:
+- Inspect the resulting codebase: read_file, list_directory, search_files, file_exists.
+- See what tools the agent HAD available (its catalog): list_agent_tools, then get_agent_tools(toolNames) for a tool's full description and parameter schema.
+- See what the agent DID: list_agent_tool_calls to triage its invocations (id, name, a short summary and a preview of each output), then get_agent_tool_calls(toolCallIds) for the full arguments and captured output of the calls you care about.
+- get_trajectory_overview gives a high-level orientation (agent, model, steps) without the raw system prompt.
+When get_agent_tool_calls or get_agent_tools returns a responseFile or descriptionFile (large outputs are spilled to a file instead of inlined), open that path with read_file.
## How to Judge
-The codebase and the agent's captured tool outputs are two complementary, equally authoritative sources of evidence — examine both. The files show the resulting state of the code; the captured outputs (logs, results, exit status) show what actually happened when the agent ran a command, which the files alone may not reveal. When a criterion concerns something the agent did or ran, take the agent's captured output and exit status as the record of what happened, rather than asking the agent to redo or re-prove work the evidence already shows. If a criterion's wording tells you to run, execute, or re-run a command, ignore that instruction and judge the outcome from the captured outputs together with the codebase.`;
+The resulting codebase and the agent's captured trajectory are two complementary, equally authoritative sources of evidence — examine both. The files show the resulting state of the code; the captured tool calls and their outputs show what actually happened while the agent worked, including intermediate actions the final files no longer reveal (for example a dependency added and then later removed within the run). Start with list_agent_tool_calls to see what the agent did, then drill into the relevant calls with get_agent_tool_calls. When a criterion concerns something the agent did or ran, take the agent's captured output and exit status as the record of what happened, rather than asking the agent to redo or re-prove work the evidence already shows. If a criterion's wording tells you to run, execute, or re-run a command, ignore that instruction and judge the outcome from the captured trajectory together with the codebase.`;
/**
* Tool filter applied to every judge session.
@@ -66,11 +76,11 @@ The codebase and the agent's captured tool outputs are two complementary, equall
* The Copilot SDK's `CopilotClient` defaults to `mode: "copilot-cli"`, which
* injects the full set of built-in CLI tools (bash, edit, view, ...) into the
* session alongside the read-only `custom:*` tools we register in
- * `createFileTools`/`createToolOutputTools`. Those built-ins are NOT
+ * `createFileTools`/`createTrajectoryTools`. Those built-ins are NOT
* `skipPermission`, and the judge runs headless (no TUI to answer prompts).
*
* The failure mode this guards against: instead of reading the coder's captured
- * output via `read_tool_outputs`/`get_tool_output`, the judge model decides to
+ * output via `list_agent_tool_calls`/`get_agent_tool_calls`, the judge model decides to
* "verify" a build/test by running the command itself through the built-in
* `bash` tool. Headless, that call is denied with "could not request permission
* from user". The judge then mis-reports this as the coder's result ("execution
@@ -103,6 +113,17 @@ export function isWithinWorkspace(root: string, target: string): boolean {
);
}
+/**
+ * Returns true if `target` resolves inside (or equal to) ANY of `roots`. Used so
+ * read_file/file_exists may read both the workspace and a judge-created spill dir
+ * (created OUTSIDE the workspace for oversized trajectory tool outputs) without
+ * weakening the per-root traversal guard — each root is still checked with the
+ * exact-or-separator-boundary rule of `isWithinWorkspace`.
+ */
+export function isWithinAnyRoot(roots: string[], target: string): boolean {
+ return roots.some((root) => isWithinWorkspace(root, target));
+}
+
export abstract class JudgeStrategy {
protected model: string;
protected timeout: number;
@@ -126,11 +147,21 @@ export abstract class JudgeStrategy {
/**
* Create filesystem inspection tools scoped to the workspace
*/
- protected createFileTools(workspacePath: string) {
+ protected createFileTools(
+ workspacePath: string,
+ opts?: { extraReadRoots?: string[] },
+ ) {
const workspaceRoot = resolve(workspacePath);
+ // Additional roots (OUTSIDE the workspace) that read_file/file_exists may
+ // read by ABSOLUTE path — used for the trajectory spill dir so the judge can
+ // open oversized tool outputs returned as responseFile/descriptionFile.
+ // list_directory/search_files stay workspace-only so the codebase view the
+ // judge inspects is never polluted by spill files.
+ const extraReadRoots = (opts?.extraReadRoots ?? []).map((r) => resolve(r));
+ const readRoots = [workspaceRoot, ...extraReadRoots];
const readFile = defineTool("read_file", {
description:
- "Read the contents of a file in the workspace. Returns the full text content. Use relative paths from the workspace root.",
+ "Read the contents of a file. Returns the full text content. Use a relative path from the workspace root, or an absolute path returned as responseFile/descriptionFile by the agent-trajectory tools.",
// Read-only, workspace-scoped, traversal-guarded tools must run without a
// permission prompt: the judge is headless (no TUI), so the v3 runtime
// would otherwise deny every call with "could not request permission from
@@ -147,8 +178,10 @@ export abstract class JudgeStrategy {
required: ["path"],
},
handler: async (args: { path: string }) => {
- const fullPath = join(workspaceRoot, args.path);
- if (!isWithinWorkspace(workspaceRoot, fullPath)) {
+ const fullPath = isAbsolute(args.path)
+ ? resolve(args.path)
+ : join(workspaceRoot, args.path);
+ if (!isWithinAnyRoot(readRoots, fullPath)) {
return { error: "Path traversal not allowed" };
}
if (!existsSync(fullPath)) {
@@ -318,8 +351,10 @@ export abstract class JudgeStrategy {
required: ["path"],
},
handler: async (args: { path: string }) => {
- const fullPath = join(workspaceRoot, args.path);
- if (!isWithinWorkspace(workspaceRoot, fullPath)) {
+ const fullPath = isAbsolute(args.path)
+ ? resolve(args.path)
+ : join(workspaceRoot, args.path);
+ if (!isWithinAnyRoot(readRoots, fullPath)) {
return { error: "Path traversal not allowed" };
}
const exists = existsSync(fullPath);
@@ -335,129 +370,68 @@ export abstract class JudgeStrategy {
return [readFile, listDirectory, searchFiles, fileExists];
}
- /**
- * Create tools that expose the tool calls/outputs captured during the gate
- * iteration being judged (e.g. a build/test command's stdout/stderr/exit
- * code). `read_tool_outputs` lists calls with truncated previews;
- * `get_tool_output` returns the full output for a given index on demand.
- */
- protected createToolOutputTools(toolCalls: ToolCall[]) {
- const PREVIEW_LIMIT = 2_000;
- const FULL_LIMIT = 100_000;
-
- const readToolOutputs = defineTool("read_tool_outputs", {
- description:
- "List the tool calls the coding agent made during this iteration (e.g. shell/bash commands and their output). Returns each call's index, name, arguments and a truncated response preview. Use get_tool_output(index) to fetch the full output of a specific call. Consult these to decide whether a command (build, test, run) actually succeeded.",
- // Read-only in-memory inspection of already-captured tool calls. Like the
- // file tools above, this MUST run without a permission prompt: the judge is
- // headless (no TUI), so the v3 runtime would otherwise deny every call with
- // "could not request permission from user" — which silently blocks the judge
- // from ever seeing the coding agent's build/test output and forces it to
- // demand on-disk proof files instead. See scope #1125.
- skipPermission: true,
- parameters: {
- type: "object",
- properties: {},
- required: [],
- },
- handler: async () => {
- if (toolCalls.length === 0) {
- return { count: 0, calls: [], message: "No tool calls were captured for this iteration." };
- }
- const calls = toolCalls.map((tc, index) => {
- const response = tc.response ?? "";
- return {
- index,
- name: tc.name,
- arguments: tc.arguments,
- responsePreview:
- response.length > PREVIEW_LIMIT
- ? response.substring(0, PREVIEW_LIMIT) + "\n…(truncated, use get_tool_output)"
- : response,
- responseTruncated: response.length > PREVIEW_LIMIT,
- responseLength: response.length,
- };
- });
- return { count: calls.length, calls };
- },
- });
-
- const getToolOutput = defineTool("get_tool_output", {
- description:
- "Return the full captured output (response) of a single tool call by its index, as listed by read_tool_outputs.",
- // Read-only; same headless permission rationale as read_tool_outputs. See scope #1125.
- skipPermission: true,
- parameters: {
- type: "object",
- properties: {
- index: {
- type: "number",
- description: "Zero-based index of the tool call from read_tool_outputs",
- },
- },
- required: ["index"],
- },
- handler: async (args: { index: number }) => {
- const tc = toolCalls[args.index];
- if (!tc) {
- return { error: `No tool call at index ${args.index} (have ${toolCalls.length})` };
- }
- const response = tc.response ?? "";
- if (response.length > FULL_LIMIT) {
- return {
- index: args.index,
- name: tc.name,
- arguments: tc.arguments,
- response: response.substring(0, FULL_LIMIT),
- truncated: true,
- totalLength: response.length,
- };
- }
- return { index: args.index, name: tc.name, arguments: tc.arguments, response };
- },
- });
-
- return [readToolOutputs, getToolOutput];
- }
-
/**
* Run a Copilot session with given prompt and tools, retrying on timeout.
+ *
+ * When a trajectory with at least one captured call is supplied, the unified
+ * trajectory navigation tools are registered (mirroring the previous
+ * `toolCalls.length > 0` gate) and a per-evaluation spill dir is created
+ * OUTSIDE the workspace for oversized tool outputs; read_file is granted that
+ * dir as an extra read root so the judge can open spilled files. The spill dir
+ * is best-effort removed when the session finishes.
*/
protected async runCopilotSession(
workspacePath: string,
systemPrompt: string,
userPrompt: string,
- toolCalls?: ToolCall[]
+ trajectory?: AgentTrajectory
): Promise {
+ const hasTrajectory = !!trajectory && trajectory.calls.length > 0;
+ const spillDir = hasTrajectory
+ ? mkdtempSync(join(tmpdir(), "judge-trajectory-"))
+ : undefined;
const tools = [
- ...this.createFileTools(workspacePath),
- ...(toolCalls && toolCalls.length > 0 ? this.createToolOutputTools(toolCalls) : []),
+ ...this.createFileTools(
+ workspacePath,
+ spillDir ? { extraReadRoots: [spillDir] } : undefined,
+ ),
+ ...(hasTrajectory ? createTrajectoryTools(trajectory!, spillDir!) : []),
];
- return withRetry(
- () => this.doRunCopilotSession(tools, systemPrompt, userPrompt),
- {
- maxRetries: this.maxRetries,
- baseDelayMs: 10_000,
- maxDelayMs: 30_000,
- isRetryable: (error) => {
- const msg = error instanceof Error ? error.message : String(error);
- return (
- msg.includes("timeout") ||
- msg.includes("Timeout") ||
- msg.includes("aborted") ||
- msg.includes("ECONNRESET") ||
- msg.includes("socket hang up")
- );
- },
- onRetry: (error, attempt) => {
- const msg = error instanceof Error ? error.message : String(error);
- console.warn(
- `[judge-strategy] sendAndWait attempt ${attempt} failed (retrying in ≤30s): ${msg.substring(0, 200)}`
- );
- },
+ try {
+ return await withRetry(
+ () => this.doRunCopilotSession(tools, systemPrompt, userPrompt),
+ {
+ maxRetries: this.maxRetries,
+ baseDelayMs: 10_000,
+ maxDelayMs: 30_000,
+ isRetryable: (error) => {
+ const msg = error instanceof Error ? error.message : String(error);
+ return (
+ msg.includes("timeout") ||
+ msg.includes("Timeout") ||
+ msg.includes("aborted") ||
+ msg.includes("ECONNRESET") ||
+ msg.includes("socket hang up")
+ );
+ },
+ onRetry: (error, attempt) => {
+ const msg = error instanceof Error ? error.message : String(error);
+ console.warn(
+ `[judge-strategy] sendAndWait attempt ${attempt} failed (retrying in ≤30s): ${msg.substring(0, 200)}`
+ );
+ },
+ }
+ );
+ } finally {
+ if (spillDir) {
+ try {
+ rmSync(spillDir, { recursive: true, force: true });
+ } catch {
+ // best-effort cleanup of the out-of-workspace spill dir
+ }
}
- );
+ }
}
/**
@@ -526,12 +500,12 @@ export class BundledStrategy extends JudgeStrategy {
criteria,
conversationHistory,
personaInstructions,
- toolCalls,
+ trajectory,
} = context;
const systemPrompt = this.buildSystemPrompt(
personaInstructions,
- toolCalls && toolCalls.length > 0
+ !!trajectory && trajectory.calls.length > 0
);
const userPrompt = this.buildUserPrompt(criteria, conversationHistory);
@@ -540,7 +514,7 @@ export class BundledStrategy extends JudgeStrategy {
workspacePath,
systemPrompt,
userPrompt,
- toolCalls
+ trajectory
);
return this.parseJsonResponse(response, criteria, context.onProgress);
@@ -555,14 +529,14 @@ export class BundledStrategy extends JudgeStrategy {
*/
private buildSystemPrompt(
personaInstructions?: string,
- hasToolOutputs?: boolean
+ hasTrajectory?: boolean
): string {
const personaSection = personaInstructions
? `\n## Persona\n${personaInstructions}\n`
: "";
- const toolOutputsSection = hasToolOutputs
- ? `\n${TOOL_OUTPUTS_GUIDANCE}\n`
+ const toolOutputsSection = hasTrajectory
+ ? `\n${TRAJECTORY_GUIDANCE}\n`
: "";
return `You are an expert code reviewer evaluating the tool calls, logs and generated code produced by a coding agent.
@@ -729,7 +703,7 @@ export class IndependentStrategy extends JudgeStrategy {
personaInstructions,
onProgress,
gate,
- toolCalls,
+ trajectory,
} = context;
// Get topological order
@@ -795,7 +769,7 @@ export class IndependentStrategy extends JudgeStrategy {
personaInstructions,
evalIndex++,
gate,
- toolCalls
+ trajectory
)
);
@@ -836,11 +810,11 @@ export class IndependentStrategy extends JudgeStrategy {
personaInstructions: string | undefined,
index: number,
gate?: GateId,
- toolCalls?: ToolCall[]
+ trajectory?: AgentTrajectory
): Promise {
const systemPrompt = this.buildSystemPrompt(
personaInstructions,
- toolCalls && toolCalls.length > 0
+ !!trajectory && trajectory.calls.length > 0
);
const userPrompt = this.buildUserPrompt(criterion, conversationHistory);
@@ -850,7 +824,7 @@ export class IndependentStrategy extends JudgeStrategy {
workspacePath,
systemPrompt,
userPrompt,
- toolCalls
+ trajectory
);
const passed = this.detectPassFail(response);
@@ -884,14 +858,14 @@ export class IndependentStrategy extends JudgeStrategy {
*/
protected buildSystemPrompt(
personaInstructions?: string,
- hasToolOutputs?: boolean
+ hasTrajectory?: boolean
): string {
const personaSection = personaInstructions
? `\n## Persona\n${personaInstructions}\n`
: "";
- const toolOutputsSection = hasToolOutputs
- ? `\n${TOOL_OUTPUTS_GUIDANCE}\n`
+ const toolOutputsSection = hasTrajectory
+ ? `\n${TRAJECTORY_GUIDANCE}\n`
: "";
return `You are an expert code reviewer evaluating the tool calls, logs and generated code produced by a coding agent against ONE specific criterion.
diff --git a/apps/judge/src/observation-trajectory.integration.test.ts b/apps/judge/src/observation-trajectory.integration.test.ts
index c8b31030b..185a6b54b 100644
--- a/apps/judge/src/observation-trajectory.integration.test.ts
+++ b/apps/judge/src/observation-trajectory.integration.test.ts
@@ -6,14 +6,15 @@
*
* Proves the judge resolves a trajectory-only observation — one whose answer is
* NOT derivable from the final workspace snapshot — by consuming the agent's
- * ATIF trajectory that pp-taxonomy forwards as a synthetic `agent_trajectory_atif`
- * tool call (see apps/judge/src/index.ts). The canonical case is
- * `dependency_added_then_removed`: a package is installed then uninstalled mid-run,
- * so it is invisible in the end-state snapshot and only the trajectory reveals it.
+ * ATIF trajectory normalized into an {@link AgentTrajectory} and navigated via
+ * the unified trajectory tools (list_agent_tool_calls / get_agent_tool_calls).
+ * The canonical case is `dependency_added_then_removed`: a package is installed
+ * then uninstalled mid-run, so it is invisible in the end-state snapshot and
+ * only the trajectory reveals it.
*
* Two assertions form the acceptance:
- * 1. WITH the trajectory tool call → criterion resolves passed:true (the judge
- * actually consumed the ATIF).
+ * 1. WITH the trajectory → criterion resolves passed:true (the judge actually
+ * consumed the ATIF via the navigation tools).
* 2. WITHOUT the trajectory (snapshot only) → the same criterion flips to
* passed:false, proving the verdict comes from the trajectory, not the files.
*
@@ -26,33 +27,97 @@ import { mkdtempSync, writeFileSync, rmSync, realpathSync } from "fs";
import { tmpdir } from "os";
import { join } from "path";
import { resetCriteriaProvider } from "shared/criteria-provider-factory";
-import type { ToolCall } from "shared";
+import { fromAtif } from "./agent-trajectory.js";
import { evaluateWorkspace } from "./judge-agent.js";
const hasToken = !!process.env.GITHUB_TOKEN;
const JUDGE_MODEL = process.env.JUDGE_MODEL || "gpt-5.4-mini";
/**
- * Synthetic ATIF trajectory mirroring what pp-taxonomy forwards: the agent
- * installs `left-pad`, uses it, then uninstalls it before finishing. The final
- * package.json (below) therefore does NOT list left-pad.
+ * Realistic ATIF trajectory (the exact shape pp-taxonomy downloads and forwards
+ * via `fromAtif`): a system + user step, then agent steps that install
+ * `left-pad`, use it, and uninstall it before finishing. Each agent step pairs
+ * its `tool_calls[]` with the matching same-step `observation.results[]` by
+ * `source_call_id === tool_call_id`. The final package.json (below) therefore
+ * does NOT list left-pad — the add-then-remove is only in the trajectory.
*/
-const ATIF_TRAJECTORY = {
- schema: "atif/1",
+const REALISTIC_ATIF = {
+ schema_version: "atif/1",
+ session_id: "atif-trajectory-test",
+ agent: {
+ name: "copilot",
+ version: "1.0.0",
+ model_name: "claude-opus-4.6",
+ tool_definitions: [
+ {
+ type: "function",
+ function: {
+ name: "bash",
+ description: "Run a shell command in the workspace.",
+ parameters: {
+ type: "object",
+ properties: { command: { type: "string" } },
+ required: ["command"],
+ },
+ },
+ },
+ {
+ type: "function",
+ function: {
+ name: "edit",
+ description: "Edit a file in the workspace.",
+ parameters: {
+ type: "object",
+ properties: { path: { type: "string" } },
+ required: ["path"],
+ },
+ },
+ },
+ ],
+ },
steps: [
- { type: "tool_call", name: "run_in_terminal", arguments: { command: "npm install left-pad" }, response: "+ left-pad@1.3.0\nadded 1 package" },
- { type: "tool_call", name: "edit_file", arguments: { path: "index.js" }, response: "require('left-pad')" },
- { type: "tool_call", name: "run_in_terminal", arguments: { command: "npm uninstall left-pad" }, response: "removed 1 package" },
+ { step_id: 1, source: "system" },
+ { step_id: 2, source: "user" },
+ {
+ step_id: 3,
+ source: "agent",
+ model_name: "claude-opus-4.6",
+ reasoning_content: "I'll add left-pad to pad the output.",
+ tool_calls: [
+ { tool_call_id: "call-1", function_name: "bash", arguments: { command: "npm install left-pad" } },
+ ],
+ observation: {
+ results: [
+ { source_call_id: "call-1", content: "added 1 package\n+ left-pad@1.3.0\nfound 0 vulnerabilities" },
+ ],
+ },
+ },
+ {
+ step_id: 4,
+ source: "agent",
+ model_name: "claude-opus-4.6",
+ tool_calls: [
+ { tool_call_id: "call-2", function_name: "edit", arguments: { path: "index.js" } },
+ ],
+ observation: {
+ results: [{ source_call_id: "call-2", content: "File index.js edited: now requires('left-pad')" }],
+ },
+ },
+ {
+ step_id: 5,
+ source: "agent",
+ model_name: "claude-opus-4.6",
+ reasoning_content: "On reflection I don't need left-pad; removing it.",
+ tool_calls: [
+ { tool_call_id: "call-3", function_name: "bash", arguments: { command: "npm uninstall left-pad" } },
+ ],
+ observation: {
+ results: [{ source_call_id: "call-3", content: "removed 1 package\nfound 0 vulnerabilities" }],
+ },
+ },
],
};
-const TRAJECTORY_TOOL_CALL: ToolCall = {
- id: "atif-trajectory",
- name: "agent_trajectory_atif",
- arguments: {},
- response: JSON.stringify(ATIF_TRAJECTORY),
-};
-
describe("judge ATIF-trajectory observation (integration)", () => {
let workspaceDir: string;
let criteriaDir: string;
@@ -87,8 +152,9 @@ describe("judge ATIF-trajectory observation (integration)", () => {
" removed it before finishing (e.g. added left-pad then removed it). This",
" is only derivable from the agent's trajectory (mid-run tool calls), not",
" from the final codebase snapshot, because the dependency is absent in the",
- " end state. Inspect the agent_trajectory_atif tool output to detect a",
- " transient add-then-remove.",
+ " end state. Use list_agent_tool_calls to scan the agent's tool calls and",
+ " get_agent_tool_calls to inspect the relevant ones, detecting a transient",
+ " add-then-remove of a dependency.",
"",
].join("\n"),
);
@@ -114,13 +180,13 @@ describe("judge ATIF-trajectory observation (integration)", () => {
"resolves a trajectory-only observation true WITH the ATIF, false WITHOUT it",
{ timeout: 600_000 },
async () => {
- // (1) WITH the ATIF trajectory tool call → the agent's add-then-remove is
- // visible, so the observation must resolve true.
+ // (1) WITH the ATIF trajectory → the agent's add-then-remove is visible via
+ // the navigation tools, so the observation must resolve true.
const withAtif = await evaluateWorkspace({
workspacePath: workspaceDir,
criteria: ["dependency_added_then_removed"],
conversationHistory: [],
- toolCalls: [TRAJECTORY_TOOL_CALL],
+ trajectory: fromAtif(REALISTIC_ATIF),
});
const obsWith = withAtif.criteriaResults.find(
From 4c1785fd14707959847dc94ba08179e689728329 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 19:17:14 -0700
Subject: [PATCH 035/287] feat(shared): add criterion subject (run|iteration) +
run-level observationResults (#1156)
Introduce a kind-dependent `subject` discriminator on criteria so observation
criteria can be evaluated either per-iteration (today) or once over the whole
run. Gate criteria are always `iteration`. Adds:
- CriterionSubject type + CRITERION_SUBJECTS + isCriterionSubject guard
- subject on CriteriaConfig; run-level observationResults on RunState
- zod schemas (optional, no flat default); kind-dependent default applied in
the store (observation -> run, gate/legacy -> iteration)
- subject threaded through criteria-store create/update/find + both providers
- atifUrls[] on JudgeEvaluateRequest for merged whole-run trajectory
- migration 022 backfills subject kind-aware (gate/legacy -> iteration,
observation -> run)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../022-backfill-criteria-subject.ts | 76 +++++++++++++++++++
.../db-migrations/src/required-migrations.ts | 1 +
.../src/criteria/criteria-provider-api.ts | 2 +
.../src/criteria/criteria-provider-fs.ts | 8 ++
.../src/criteria/criteria-store.test.ts | 62 +++++++++++++++
.../shared/src/criteria/criteria-store.ts | 34 ++++++++-
packages/shared/src/judge/judge-client.ts | 5 ++
packages/shared/src/schemas/criteria.ts | 7 +-
packages/shared/src/schemas/request.ts | 4 +
packages/shared/src/types/types.ts | 33 ++++++++
10 files changed, 228 insertions(+), 4 deletions(-)
create mode 100644 packages/db-migrations/src/migrations/022-backfill-criteria-subject.ts
diff --git a/packages/db-migrations/src/migrations/022-backfill-criteria-subject.ts b/packages/db-migrations/src/migrations/022-backfill-criteria-subject.ts
new file mode 100644
index 000000000..b3efd41c6
--- /dev/null
+++ b/packages/db-migrations/src/migrations/022-backfill-criteria-subject.ts
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Migration: Backfill criteria subject.
+ *
+ * The criterion `subject` field (issue #1156) controls the granularity at which
+ * an observation criterion is evaluated: `"iteration"` (per-turn) or `"run"`
+ * (once over the whole run). Gate criteria are always `"iteration"`.
+ *
+ * The backfill is kind-aware to match the new store defaults:
+ * - gate / legacy (kind absent) → "iteration"
+ * - observation → "run"
+ *
+ * Backfilling existing observations to "run" also corrects the
+ * `dependency_added_then_removed` false-negative that arose when whole-run
+ * observations were forced through per-iteration evaluation. Blast radius is
+ * negligible — #1156 is unmerged, so there are no production observation
+ * criteria yet. Mirrors 021-backfill-criteria-kind.ts.
+ *
+ * down() unsets `subject` on rows whose value is "run" or "iteration",
+ * restoring the pre-migration state.
+ */
+
+import type { Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+import { batchUpdate } from "../batch-update.js";
+
+export class BackfillCriteriaSubject implements MigrationInterface {
+ async up(db: Db): Promise {
+ const criteria = db.collection("criteria");
+
+ // Gate + legacy (kind absent/null) → "iteration".
+ const gateCount = await batchUpdate(
+ criteria,
+ {
+ $and: [
+ { $or: [{ subject: { $exists: false } }, { subject: null }] },
+ { $or: [{ kind: "gate" }, { kind: { $exists: false } }, { kind: null }] },
+ ],
+ },
+ { $set: { subject: "iteration" } },
+ "[022] backfill criteria.subject=iteration (gate/legacy)",
+ );
+
+ // Observation → "run".
+ const obsCount = await batchUpdate(
+ criteria,
+ {
+ $and: [
+ { $or: [{ subject: { $exists: false } }, { subject: null }] },
+ { kind: "observation" },
+ ],
+ },
+ { $set: { subject: "run" } },
+ "[022] backfill criteria.subject=run (observation)",
+ );
+
+ console.log(
+ `[022] Backfilled subject: iteration on ${gateCount} gate/legacy criteria, run on ${obsCount} observation criteria`,
+ );
+ }
+
+ async down(db: Db): Promise {
+ const criteria = db.collection("criteria");
+
+ const count = await batchUpdate(
+ criteria,
+ { subject: { $in: ["run", "iteration"] } },
+ { $unset: { subject: "" } },
+ "[022-down] unset criteria.subject",
+ );
+
+ console.log(`[022-down] Unset subject on ${count} criteria`);
+ }
+}
diff --git a/packages/db-migrations/src/required-migrations.ts b/packages/db-migrations/src/required-migrations.ts
index f5742e603..cf21cf82d 100644
--- a/packages/db-migrations/src/required-migrations.ts
+++ b/packages/db-migrations/src/required-migrations.ts
@@ -37,4 +37,5 @@ export const REQUIRED_MIGRATIONS: readonly string[] = [
"020-backfill-handler-status.ts",
"020-create-codebase-indexes.ts",
"021-backfill-criteria-kind.ts",
+ "022-backfill-criteria-subject.ts",
];
diff --git a/packages/shared/src/criteria/criteria-provider-api.ts b/packages/shared/src/criteria/criteria-provider-api.ts
index 080dd1c9e..5ff916a6e 100644
--- a/packages/shared/src/criteria/criteria-provider-api.ts
+++ b/packages/shared/src/criteria/criteria-provider-api.ts
@@ -205,6 +205,7 @@ function mapToCriteriaConfig(data: Record): CriteriaConfig {
const gates = data.gates as CriteriaConfig["gates"] | undefined;
const kind = data.kind as CriteriaConfig["kind"] | undefined;
const taxonomyElementId = data.taxonomyElementId as CriteriaConfig["taxonomyElementId"] | undefined;
+ const subject = data.subject as CriteriaConfig["subject"] | undefined;
return {
id: String(data.id),
prompt: String(data.prompt),
@@ -212,5 +213,6 @@ function mapToCriteriaConfig(data: Record): CriteriaConfig {
...(gates && gates.length > 0 ? { gates } : {}),
...(kind ? { kind } : {}),
...(taxonomyElementId ? { taxonomyElementId } : {}),
+ ...(subject ? { subject } : {}),
};
}
diff --git a/packages/shared/src/criteria/criteria-provider-fs.ts b/packages/shared/src/criteria/criteria-provider-fs.ts
index 9c5042700..56fe94657 100644
--- a/packages/shared/src/criteria/criteria-provider-fs.ts
+++ b/packages/shared/src/criteria/criteria-provider-fs.ts
@@ -81,6 +81,14 @@ export class FileSystemCriteriaProvider implements CriteriaProvider {
criteria.taxonomyElementId = String(taxonomyElementId).trim() as CriteriaConfig["taxonomyElementId"];
}
+ const subject = data.subject;
+ if (subject !== undefined) {
+ if (subject !== "run" && subject !== "iteration") {
+ throw new Error(`'subject' must be 'run' or 'iteration' in ${file}`);
+ }
+ criteria.subject = subject;
+ }
+
if (this.registry.has(criteria.id)) {
throw new Error(`Duplicate criteria id '${criteria.id}' found in ${file}`);
}
diff --git a/packages/shared/src/criteria/criteria-store.test.ts b/packages/shared/src/criteria/criteria-store.test.ts
index 07908886e..36342b74b 100644
--- a/packages/shared/src/criteria/criteria-store.test.ts
+++ b/packages/shared/src/criteria/criteria-store.test.ts
@@ -370,3 +370,65 @@ describe("CriteriaStore kind + taxonomy (issue #1156)", () => {
await expect(store.resolveObservations(["gate"])).rejects.toThrow(CriteriaValidationError);
});
});
+
+describe("CriteriaStore subject (run | iteration)", () => {
+ it("defaults an observation's subject to 'run' when absent", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ const created = await store.create({ id: "obs_run", prompt: "p", kind: "observation" });
+ expect(created.subject).toBe("run");
+ });
+
+ it("defaults a gate's subject to 'iteration' when absent", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ const created = await store.create({ id: "g_iter", prompt: "p", kind: "gate" });
+ expect(created.subject).toBe("iteration");
+ });
+
+ it("defaults a legacy (kind-absent) criterion's subject to 'iteration'", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ const created = await store.create({ id: "legacy", prompt: "p" });
+ expect(created.subject).toBe("iteration");
+ });
+
+ it("persists an explicit subject:'iteration' override on an observation", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ const created = await store.create({
+ id: "obs_iter",
+ prompt: "p",
+ kind: "observation",
+ subject: "iteration",
+ });
+ expect(created.subject).toBe("iteration");
+ });
+
+ it("rejects subject:'run' on a gate criterion", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ await expect(
+ store.create({ id: "g_run", prompt: "p", kind: "gate", subject: "run" }),
+ ).rejects.toThrow(CriteriaValidationError);
+ });
+
+ it("rejects subject:'run' on a legacy (kind-absent) criterion", async () => {
+ const store = new CriteriaStore(fakeCollection());
+ await expect(
+ store.create({ id: "legacy_run", prompt: "p", subject: "run" }),
+ ).rejects.toThrow(CriteriaValidationError);
+ });
+
+ it("rejects flipping an observation to a gate while keeping subject:'run' on update", async () => {
+ const col = fakeCollection([
+ { id: "obs_x", prompt: "p", dependsOn: [], kind: "observation", subject: "run", createdAt: new Date() },
+ ]);
+ const store = new CriteriaStore(col);
+ await expect(store.update("obs_x", { kind: "gate" })).rejects.toThrow(CriteriaValidationError);
+ });
+
+ it("allows updating an observation's subject to 'iteration'", async () => {
+ const col = fakeCollection([
+ { id: "obs_y", prompt: "p", dependsOn: [], kind: "observation", subject: "run", createdAt: new Date() },
+ ]);
+ const store = new CriteriaStore(col);
+ const updated = await store.update("obs_y", { subject: "iteration" });
+ expect(updated.subject).toBe("iteration");
+ });
+});
diff --git a/packages/shared/src/criteria/criteria-store.ts b/packages/shared/src/criteria/criteria-store.ts
index de51748df..2fd5dba8b 100644
--- a/packages/shared/src/criteria/criteria-store.ts
+++ b/packages/shared/src/criteria/criteria-store.ts
@@ -2,7 +2,7 @@
// Licensed under the MIT License.
import { Collection } from 'mongodb';
-import { CriteriaConfig, CriteriaDocument, CriterionKind, GateId, TaxonomyElementId } from '../types/types.js';
+import { CriteriaConfig, CriteriaDocument, CriterionKind, CriterionSubject, GateId, TaxonomyElementId } from '../types/types.js';
import { DependencyGraph } from '../graph/dependency-graph.js';
import { gatesSatisfyInvariant } from '../gates/gates.js';
import {
@@ -42,9 +42,13 @@ export class CriteriaStore {
gates?: GateId[];
kind?: CriterionKind;
taxonomyElementId?: TaxonomyElementId;
+ subject?: CriterionSubject;
}): Promise {
const { id, prompt, dependsOn = [], gates, taxonomyElementId } = input;
const kind: CriterionKind = input.kind ?? 'gate';
+ // Kind-dependent default: observation ⇒ "run" (whole-run), gate/legacy ⇒
+ // "iteration". Applied here (where kind is known) — not a flat schema default.
+ const subject: CriterionSubject = input.subject ?? (kind === 'observation' ? 'run' : 'iteration');
// Validate ID format
if (!/^[a-z][a-z0-9_]*$/.test(id)) {
@@ -60,6 +64,14 @@ export class CriteriaStore {
);
}
+ // subject "run" is only valid for observation criteria — gate criteria are
+ // always evaluated per iteration (their pass/fail feeds the per-turn loop).
+ if (subject !== 'iteration' && kind !== 'observation') {
+ throw new CriteriaValidationError(
+ `subject '${subject}' is not allowed for ${kind} criteria; gate criteria are always evaluated per iteration`
+ );
+ }
+
// Check for duplicates among *active* criteria.
const existing = await this.collection.findOne({ id, deletedAt: { $exists: false } });
if (existing) {
@@ -97,6 +109,7 @@ export class CriteriaStore {
...(gates !== undefined && { gates }),
kind,
...(taxonomyElementId !== undefined && { taxonomyElementId }),
+ subject,
createdAt: new Date(),
};
@@ -138,7 +151,7 @@ export class CriteriaStore {
/** Update a criterion's prompt, dependencies and/or gate compatibility */
async update(
id: string,
- patch: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }
+ patch: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId; subject?: CriterionSubject }
): Promise {
const existing = await this.get(id);
if (!existing) {
@@ -180,12 +193,23 @@ export class CriteriaStore {
);
}
+ // subject "run" is only valid for observation criteria. Resolve the effective
+ // subject (kind-dependent default when neither patch nor existing set it).
+ const effectiveSubject: CriterionSubject =
+ patch.subject ?? existing.subject ?? (effectiveKind === 'observation' ? 'run' : 'iteration');
+ if (effectiveSubject !== 'iteration' && effectiveKind !== 'observation') {
+ throw new CriteriaValidationError(
+ `subject '${effectiveSubject}' is not allowed for ${effectiveKind} criteria; gate criteria are always evaluated per iteration`
+ );
+ }
+
const update: Record = { updatedAt: new Date() };
if (patch.prompt !== undefined) update.prompt = patch.prompt.trim();
if (patch.dependsOn !== undefined) update.dependsOn = patch.dependsOn;
if (patch.gates !== undefined) update.gates = patch.gates;
if (patch.kind !== undefined) update.kind = patch.kind;
if (patch.taxonomyElementId !== undefined) update.taxonomyElementId = patch.taxonomyElementId;
+ if (patch.subject !== undefined) update.subject = patch.subject;
await this.collection.updateOne(
{ id, deletedAt: { $exists: false } },
@@ -255,6 +279,7 @@ export class CriteriaStore {
...(doc.gates !== undefined && { gates: doc.gates }),
...(doc.kind !== undefined && { kind: doc.kind }),
...(doc.taxonomyElementId !== undefined && { taxonomyElementId: doc.taxonomyElementId }),
+ ...(doc.subject !== undefined && { subject: doc.subject }),
});
if (doc.dependsOn) {
@@ -284,6 +309,7 @@ export class CriteriaStore {
...(c.gates !== undefined && { gates: c.gates }),
...(c.kind !== undefined && { kind: c.kind }),
...(c.taxonomyElementId !== undefined && { taxonomyElementId: c.taxonomyElementId }),
+ ...(c.subject !== undefined && { subject: c.subject }),
}));
const edges: { from: string; to: string }[] = [];
@@ -307,13 +333,15 @@ export class CriteriaStore {
for (const config of configs) {
const existing = await this.collection.findOne({ id: config.id });
if (!existing) {
+ const seedKind: CriterionKind = config.kind ?? 'gate';
await this.collection.insertOne({
id: config.id,
prompt: config.prompt,
dependsOn: config.dependsOn || [],
...(config.gates !== undefined && { gates: config.gates }),
- kind: config.kind ?? 'gate',
+ kind: seedKind,
...(config.taxonomyElementId !== undefined && { taxonomyElementId: config.taxonomyElementId }),
+ subject: config.subject ?? (seedKind === 'observation' ? 'run' : 'iteration'),
createdAt: new Date(),
} as any);
inserted++;
diff --git a/packages/shared/src/judge/judge-client.ts b/packages/shared/src/judge/judge-client.ts
index c07cfa82f..336404f66 100644
--- a/packages/shared/src/judge/judge-client.ts
+++ b/packages/shared/src/judge/judge-client.ts
@@ -21,6 +21,11 @@ export interface JudgeEvaluateRequest {
* tool calls; sent by pp-taxonomy in place of toolCallsUrl so observations
* can be evaluated against the full agent trajectory. See issue #1156. */
atifUrl?: string;
+ /** Blob URLs of EVERY iteration's ATIF trajectory JSON, in iteration order.
+ * Sent by pp-taxonomy for `subject:"run"` observations so the judge merges
+ * them into one whole-run trajectory (cross-iteration behavior is visible in a
+ * single evaluation). Takes precedence over `atifUrl`. See issue #1156. */
+ atifUrls?: string[];
}
/**
diff --git a/packages/shared/src/schemas/criteria.ts b/packages/shared/src/schemas/criteria.ts
index efe0761c1..71715eefd 100644
--- a/packages/shared/src/schemas/criteria.ts
+++ b/packages/shared/src/schemas/criteria.ts
@@ -3,12 +3,13 @@
import { z } from "zod";
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
-import { GATES, CRITERION_KINDS, TAXONOMY_ELEMENT_IDS } from "../types/types.js";
+import { GATES, CRITERION_KINDS, CRITERION_SUBJECTS, TAXONOMY_ELEMENT_IDS } from "../types/types.js";
extendZodWithOpenApi(z);
export const GateIdSchema = z.enum(GATES);
export const CriterionKindSchema = z.enum(CRITERION_KINDS);
+export const CriterionSubjectSchema = z.enum(CRITERION_SUBJECTS);
export const TaxonomyElementIdSchema = z.enum(TAXONOMY_ELEMENT_IDS);
export const CreateCriteriaInputSchema = z
@@ -19,6 +20,7 @@ export const CreateCriteriaInputSchema = z
gates: z.array(GateIdSchema).optional(),
kind: CriterionKindSchema.default("gate"),
taxonomyElementId: TaxonomyElementIdSchema.optional(),
+ subject: CriterionSubjectSchema.optional(),
})
.openapi("CreateCriteriaInput");
@@ -29,6 +31,7 @@ export const UpdateCriteriaInputSchema = z
gates: z.array(GateIdSchema).optional(),
kind: CriterionKindSchema.optional(),
taxonomyElementId: TaxonomyElementIdSchema.optional(),
+ subject: CriterionSubjectSchema.optional(),
})
.openapi("UpdateCriteriaInput");
@@ -40,6 +43,7 @@ export const CriteriaResponseSchema = z
gates: z.array(GateIdSchema).optional(),
kind: CriterionKindSchema.optional(),
taxonomyElementId: TaxonomyElementIdSchema.optional(),
+ subject: CriterionSubjectSchema.optional(),
createdAt: z.coerce.date(),
updatedAt: z.coerce.date().optional(),
deletedAt: z.coerce.date().optional(),
@@ -54,6 +58,7 @@ export const CriteriaGraphNodeSchema = z
gates: z.array(GateIdSchema).optional(),
kind: CriterionKindSchema.optional(),
taxonomyElementId: TaxonomyElementIdSchema.optional(),
+ subject: CriterionSubjectSchema.optional(),
})
.openapi("CriteriaGraphNode");
diff --git a/packages/shared/src/schemas/request.ts b/packages/shared/src/schemas/request.ts
index 1abc04062..48f77e9eb 100644
--- a/packages/shared/src/schemas/request.ts
+++ b/packages/shared/src/schemas/request.ts
@@ -216,6 +216,10 @@ export const RunStateSchema = z
rawChatFormat: z.string().optional(),
pausedAt: z.coerce.date().optional(),
resumedAt: z.coerce.date().optional(),
+ /** Whole-run observation results (one per selected subject:"run" observation
+ * criterion), evaluated once against the merged trajectory. Per-iteration
+ * observation results live on each turn's `observationResults`. #1156. */
+ observationResults: z.array(CriterionResultSchema).optional(),
})
.openapi("RunState");
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index 34e708e16..5e5bd320b 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -78,6 +78,27 @@ export function isCriterionKind(value: unknown): value is CriterionKind {
return typeof value === "string" && (CRITERION_KINDS as readonly string[]).includes(value);
}
+/**
+ * Granularity at which an observation criterion is evaluated. `"iteration"`
+ * evaluates each `run.turns[]` in isolation (result → `turn.observationResults`);
+ * `"run"` evaluates **once** over the whole run — the final snapshot + the merged
+ * trajectory across all iterations (result → run-level `run.observationResults`).
+ *
+ * Honored **only** by the observation/taxonomy pipeline. Gate criteria are always
+ * `"iteration"` (the API rejects `"run"` for gates). The kind-dependent default
+ * (observation ⇒ `"run"`, gate/legacy ⇒ `"iteration"`) is applied in the criteria
+ * store, not as a flat schema default. See issue #1156.
+ */
+export type CriterionSubject = "run" | "iteration";
+
+/** The hard-coded set of criterion subjects. */
+export const CRITERION_SUBJECTS = ["run", "iteration"] as const;
+
+/** True when `value` is a valid criterion subject. */
+export function isCriterionSubject(value: unknown): value is CriterionSubject {
+ return typeof value === "string" && (CRITERION_SUBJECTS as readonly string[]).includes(value);
+}
+
/**
* Hard-coded taxonomy elements for observation criteria — the three quality
* dimensions from the R&A Readout design. Gates (select/build/test/run/deploy)
@@ -445,6 +466,12 @@ export interface RunState {
rawChatFormat?: string;
/** Per-handler post-processing status. Keys are handler IDs (e.g. "pp-atif"). */
handlerStatus?: Record;
+ /** Whole-run observation results — one entry per selected `subject:"run"`
+ * observation criterion, evaluated once against the final snapshot + the
+ * merged trajectory across all iterations by pp-taxonomy. Per-iteration
+ * (`subject:"iteration"`) observations live on `turn.observationResults`
+ * instead. Empty/absent when no run-subject observations were selected. #1156. */
+ observationResults?: CriterionResult[];
/** Set once the scheduler has triggered report generation for this run after
* the handler DAG drained (every handler reached a terminal state). Acts as
* an exactly-once guard so the scheduler POSTs /api/v1/reports/trigger at
@@ -651,6 +678,12 @@ export interface CriteriaConfig {
/** Design-time classification under a hard-coded taxonomy element. Only set
* on observation criteria. Static — never stored per run. See issue #1156. */
taxonomyElementId?: TaxonomyElementId;
+ /** Evaluation granularity for observation criteria. `"iteration"` (per-turn,
+ * → `turn.observationResults`) or `"run"` (once over the whole run, →
+ * `run.observationResults`). Honored only for observations; gates are always
+ * `"iteration"`. Kind-dependent default applied in the store (observation ⇒
+ * "run", gate/legacy ⇒ "iteration"). See issue #1156. */
+ subject?: CriterionSubject;
}
// Per-criterion result from judge evaluation
From 01ec0a71653d93f2f0396ccf7ae5609b62bda24a Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 19:17:54 -0700
Subject: [PATCH 036/287] feat(api): validate criterion subject + AI
auto-detect (#1156)
- routes/criteria: reject subject:run for gate criteria (400); allow run|
iteration for observations on create + update
- llm: authoring assistant returns suggestedSubject; heuristic maps cross-
iteration phrasing -> run, end-state/per-step -> iteration; defaults run for
observations when the model is unavailable
- endpoints test: subject create + run-subject-gate rejection
- regenerated OpenAPI snapshot (subject enum + run-level observationResults)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../openapi-snapshot.test.ts.snap | 34 +++++++++++++++++++
apps/api/src/endpoints.test.ts | 32 +++++++++++++++++
apps/api/src/llm.ts | 23 +++++++++++--
apps/api/src/routes/criteria.ts | 8 ++---
4 files changed, 90 insertions(+), 7 deletions(-)
diff --git a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
index 3d5d038c9..7c09fa8b5 100644
--- a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
+++ b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
@@ -670,6 +670,13 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"prompt": {
"type": "string",
},
+ "subject": {
+ "enum": [
+ "run",
+ "iteration",
+ ],
+ "type": "string",
+ },
"taxonomyElementId": {
"enum": [
"dimension:idiomatic-use",
@@ -1058,6 +1065,13 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"prompt": {
"type": "string",
},
+ "subject": {
+ "enum": [
+ "run",
+ "iteration",
+ ],
+ "type": "string",
+ },
"taxonomyElementId": {
"enum": [
"dimension:idiomatic-use",
@@ -1121,6 +1135,13 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"prompt": {
"type": "string",
},
+ "subject": {
+ "enum": [
+ "run",
+ "iteration",
+ ],
+ "type": "string",
+ },
"taxonomyElementId": {
"enum": [
"dimension:idiomatic-use",
@@ -2626,6 +2647,12 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"logsUrl": {
"type": "string",
},
+ "observationResults": {
+ "items": {
+ "$ref": "#/components/schemas/CriterionResult",
+ },
+ "type": "array",
+ },
"os": {
"properties": {
"arch": {
@@ -3161,6 +3188,13 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"prompt": {
"type": "string",
},
+ "subject": {
+ "enum": [
+ "run",
+ "iteration",
+ ],
+ "type": "string",
+ },
"taxonomyElementId": {
"enum": [
"dimension:idiomatic-use",
diff --git a/apps/api/src/endpoints.test.ts b/apps/api/src/endpoints.test.ts
index 34a89df39..bfca5e19c 100644
--- a/apps/api/src/endpoints.test.ts
+++ b/apps/api/src/endpoints.test.ts
@@ -220,6 +220,38 @@ describe("API Endpoints", () => {
expect(res.status).toBe(400);
});
+
+ it("defaults an observation's subject to 'run'", async () => {
+ (mocks.criteriaCollection.findOne as any).mockResolvedValue(null);
+
+ const res = await request(app)
+ .post("/api/v1/criteria")
+ .send({ id: "obs_subj", prompt: "Did the agent add then remove a dep?", dependsOn: [], kind: "observation" });
+
+ expect(res.status).toBe(201);
+ expect(res.body).toHaveProperty("subject", "run");
+ });
+
+ it("creates an observation with an explicit subject:'iteration' override", async () => {
+ (mocks.criteriaCollection.findOne as any).mockResolvedValue(null);
+
+ const res = await request(app)
+ .post("/api/v1/criteria")
+ .send({ id: "obs_iter", prompt: "x", dependsOn: [], kind: "observation", subject: "iteration" });
+
+ expect(res.status).toBe(201);
+ expect(res.body).toHaveProperty("subject", "iteration");
+ });
+
+ it("rejects subject:'run' on a gate criterion", async () => {
+ (mocks.criteriaCollection.findOne as any).mockResolvedValue(null);
+
+ const res = await request(app)
+ .post("/api/v1/criteria")
+ .send({ id: "gate_run", prompt: "x", dependsOn: [], kind: "gate", subject: "run" });
+
+ expect(res.status).toBe(400);
+ });
});
describe("POST /api/v1/criteria/seed", () => {
diff --git a/apps/api/src/llm.ts b/apps/api/src/llm.ts
index 7c4cd9328..bda126d6b 100644
--- a/apps/api/src/llm.ts
+++ b/apps/api/src/llm.ts
@@ -2,7 +2,7 @@
// Licensed under the MIT License.
import { isUnexpected } from "@azure-rest/ai-inference";
-import { gatesSatisfyInvariant, type GateId } from "shared";
+import { gatesSatisfyInvariant, type GateId, type CriterionSubject } from "shared";
import { acquireInferenceClient, isLlmAvailable as inferenceAvailable } from "./llm-token.js";
export type SuggestDirection = "parents" | "children";
@@ -23,13 +23,18 @@ Given a natural-language description of a behavior or pattern to detect in a cod
- Contain only lowercase letters, digits, and underscores
- Be concise but descriptive (e.g., has_unit_tests, uses_typescript, has_docker_config)
+3. Classify the evaluation SUBJECT — whether the behavior must be judged across the WHOLE run or within a SINGLE iteration in isolation:
+ - "run": the behavior spans multiple steps/iterations or describes a transition over the course of the session — phrasing like "at any point", "ever", "then later", "added then removed", "during the run", or anything only confirmable by viewing the entire run together.
+ - "iteration": the behavior is a single end-state fact or a per-step property judgeable from one iteration alone (e.g., "uses TypeScript", "has a Dockerfile", "ran the test suite this turn").
+ When unsure, prefer "run".
+
Here are examples of good criteria prompts:
- "The project uses Azure Bicep for infrastructure as code. Look for *.bicep files, bicepconfig.json, or main.bicep entry points."
- "The project uses React framework. Look for react dependency in package.json, .jsx or .tsx files with React components."
- "The project uses Node.js as its runtime environment. Look for package.json file or Node.js-specific configuration files."
Respond with ONLY a JSON object in this exact format (no markdown, no code fences):
-{"prompt": "your evaluation prompt here", "suggestedId": "your_suggested_id"}`;
+{"prompt": "your evaluation prompt here", "suggestedId": "your_suggested_id", "suggestedSubject": "run"}`;
interface SuggestDirectionCopy {
/** One-line definition of the relationship being asked for. */
@@ -103,6 +108,10 @@ export interface GenerateResult {
suggestedId: string;
suggestedParents: string[];
suggestedChildren: string[];
+ /** Suggested evaluation granularity for observation criteria. Defaults to
+ * "run"; "iteration" only when the model clearly detects an end-state /
+ * per-step property. Ignored by gate criteria (always per-iteration). #1156. */
+ suggestedSubject: CriterionSubject;
}
export function isLlmAvailable(): boolean {
@@ -122,6 +131,12 @@ function sanitizeId(suggestedId: unknown): string {
return sanitized || "new_criterion";
}
+/** Coerce a model-suggested subject. Defaults to "run" — "iteration" is only
+ * honored when the model returns it exactly (matching "prefer run when unsure"). */
+function sanitizeSubject(value: unknown): CriterionSubject {
+ return value === "iteration" ? "iteration" : "run";
+}
+
function parseJson(content: string): any {
const cleaned = content.replace(/```json\s*|```\s*/g, "").trim();
try {
@@ -169,7 +184,7 @@ async function author(
llm: ChatClient,
model: string,
behavior: string,
-): Promise<{ prompt: string; suggestedId: string }> {
+): Promise<{ prompt: string; suggestedId: string; suggestedSubject: CriterionSubject }> {
const content = await chat(llm, model, SYSTEM_PROMPT_AUTHOR, `NEW CRITERION TO CREATE:\n${behavior}`);
const parsed = parseJson(content);
if (!parsed.prompt) {
@@ -178,6 +193,7 @@ async function author(
return {
prompt: String(parsed.prompt).trim(),
suggestedId: sanitizeId(parsed.suggestedId),
+ suggestedSubject: sanitizeSubject(parsed.suggestedSubject),
};
}
@@ -274,5 +290,6 @@ export async function generateCriteriaPrompt(
suggestedId: authored.suggestedId,
suggestedParents,
suggestedChildren,
+ suggestedSubject: authored.suggestedSubject,
};
}
diff --git a/apps/api/src/routes/criteria.ts b/apps/api/src/routes/criteria.ts
index 40aee5d0c..7be113e11 100644
--- a/apps/api/src/routes/criteria.ts
+++ b/apps/api/src/routes/criteria.ts
@@ -427,9 +427,9 @@ apiRoute(ctx.app, ctx.registry, {
409: { description: "Criterion already exists" },
},
handler: async (req, res) => {
- const { id, prompt, dependsOn = [], gates, kind, taxonomyElementId } = req.body;
+ const { id, prompt, dependsOn = [], gates, kind, taxonomyElementId, subject } = req.body;
try {
- const doc = await getCriteriaStore().create({ id, prompt, dependsOn, gates, kind, taxonomyElementId });
+ const doc = await getCriteriaStore().create({ id, prompt, dependsOn, gates, kind, taxonomyElementId, subject });
res.status(201).json(doc);
} catch (err) {
if (!sendStoreError(res, err)) throw err;
@@ -452,9 +452,9 @@ apiRoute(ctx.app, ctx.registry, {
},
handler: async (req, res) => {
const { id } = req.params;
- const { prompt, dependsOn, gates, kind, taxonomyElementId } = req.body;
+ const { prompt, dependsOn, gates, kind, taxonomyElementId, subject } = req.body;
try {
- const updated = await getCriteriaStore().update(id, { prompt, dependsOn, gates, kind, taxonomyElementId });
+ const updated = await getCriteriaStore().update(id, { prompt, dependsOn, gates, kind, taxonomyElementId, subject });
res.json(updated);
} catch (err) {
if (!sendStoreError(res, err)) throw err;
From aa92dbe43484c8085dfc15740017d6b1098f4996 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 19:18:49 -0700
Subject: [PATCH 037/287] feat(judge): merge whole-run trajectory from
atifUrls[] (#1156)
- agent-trajectory: mergeTrajectories(list) concatenates calls in iteration
order and unions tool definitions by id; fromAtifList helper
- index: accept atifUrls[]; download all + merge into the single
AgentTrajectory (single atifUrl path unchanged)
- integration test: run-subject dependency_added_then_removed is false per
iteration but true on the merged trajectory (GITHUB_TOKEN-gated)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
apps/judge/src/agent-trajectory.test.ts | 82 +++++++++++++++++
apps/judge/src/agent-trajectory.ts | 83 +++++++++++++++++
apps/judge/src/index.ts | 22 ++++-
...observation-trajectory.integration.test.ts | 92 ++++++++++++++++++-
4 files changed, 275 insertions(+), 4 deletions(-)
diff --git a/apps/judge/src/agent-trajectory.test.ts b/apps/judge/src/agent-trajectory.test.ts
index 78252d88f..8bb870184 100644
--- a/apps/judge/src/agent-trajectory.test.ts
+++ b/apps/judge/src/agent-trajectory.test.ts
@@ -17,7 +17,9 @@ import { join, sep } from "path";
import type { ToolCall } from "shared";
import {
fromAtif,
+ fromAtifList,
fromToolCalls,
+ mergeTrajectories,
createTrajectoryTools,
summarizeArgs,
safeId,
@@ -444,3 +446,83 @@ describe("helpers", () => {
expect(previewOf("abc", 10)).toBe("abc");
});
});
+
+describe("mergeTrajectories / fromAtifList (run-subject whole-run path #1156)", () => {
+ it("returns an empty trajectory for an empty list", () => {
+ const merged = mergeTrajectories([]);
+ expect(merged.calls).toEqual([]);
+ expect(merged.toolDefinitions).toEqual([]);
+ expect(merged.byId.size).toBe(0);
+ });
+
+ it("returns the single trajectory unchanged for a length-1 list", () => {
+ const only = fromAtif(REALISTIC_ATIF);
+ expect(mergeTrajectories([only])).toBe(only);
+ });
+
+ it("concatenates calls in iteration order and preserves both iterations' work", () => {
+ const it1 = fromToolCalls([
+ { id: "a", name: "bash", arguments: { command: "npm install left-pad" }, response: "added 1 package", timestamp: "" },
+ ]);
+ const it2 = fromToolCalls([
+ { id: "b", name: "bash", arguments: { command: "npm uninstall left-pad" }, response: "removed 1 package", timestamp: "" },
+ ]);
+ const merged = mergeTrajectories([it1, it2]);
+ expect(merged.calls.map((c) => c.toolCallId)).toEqual(["a", "b"]);
+ expect(merged.calls[0].response).toContain("added");
+ expect(merged.calls[1].response).toContain("removed");
+ // Both addressable by id.
+ expect(merged.byId.get("a")?.summary).toBe("npm install left-pad");
+ expect(merged.byId.get("b")?.summary).toBe("npm uninstall left-pad");
+ });
+
+ it("re-keys colliding tool-call ids so every call stays addressable", () => {
+ const it1 = fromToolCalls([{ id: "dup", name: "bash", arguments: { command: "first" }, response: "r1", timestamp: "" }]);
+ const it2 = fromToolCalls([{ id: "dup", name: "bash", arguments: { command: "second" }, response: "r2", timestamp: "" }]);
+ const merged = mergeTrajectories([it1, it2]);
+ expect(merged.calls).toHaveLength(2);
+ const ids = merged.calls.map((c) => c.toolCallId);
+ expect(ids[0]).toBe("dup");
+ expect(ids[1]).toBe("it2:dup");
+ expect(new Set(ids).size).toBe(2);
+ expect(merged.byId.get("dup")?.summary).toBe("first");
+ expect(merged.byId.get("it2:dup")?.summary).toBe("second");
+ });
+
+ it("unions tool definitions by name (first wins)", () => {
+ const a = fromAtif(REALISTIC_ATIF); // has a populated catalog
+ const b = fromAtif(REALISTIC_ATIF);
+ const merged = mergeTrajectories([a, b]);
+ // Deduplicated, not doubled.
+ expect(merged.toolDefinitions.length).toBe(a.toolDefinitions.length);
+ expect(merged.toolDefsByName.size).toBe(a.toolDefsByName.size);
+ });
+
+ it("tags merged step overviews with their source iteration", () => {
+ const merged = mergeTrajectories([fromAtif(REALISTIC_ATIF), fromAtif(REALISTIC_ATIF)]);
+ expect(merged.steps?.some((s) => s.source.startsWith("it1:"))).toBe(true);
+ expect(merged.steps?.some((s) => s.source.startsWith("it2:"))).toBe(true);
+ });
+
+ it("fromAtifList normalizes + merges raw ATIF payloads", () => {
+ const merged = fromAtifList([REALISTIC_ATIF, REALISTIC_ATIF]);
+ expect(merged.source).toBe("atif");
+ // Twice the agent calls of a single ATIF.
+ const single = fromAtif(REALISTIC_ATIF);
+ expect(merged.calls.length).toBe(single.calls.length * 2);
+ });
+
+ it("merged trajectory is navigable via createTrajectoryTools across iterations", async () => {
+ const it1 = fromToolCalls([{ id: "x", name: "bash", arguments: { command: "npm install left-pad" }, response: "added", timestamp: "" }]);
+ const it2 = fromToolCalls([{ id: "y", name: "bash", arguments: { command: "npm uninstall left-pad" }, response: "removed", timestamp: "" }]);
+ const spillDir = mkdtempSync(join(tmpdir(), "judge-merge-spill-"));
+ try {
+ const tools = createTrajectoryTools(mergeTrajectories([it1, it2]), spillDir);
+ const res = await call(tools, "list_agent_tool_calls");
+ expect(res.count).toBe(2);
+ expect(res.calls.map((c: any) => c.toolCallId)).toEqual(["x", "y"]);
+ } finally {
+ rmSync(spillDir, { recursive: true, force: true });
+ }
+ });
+});
diff --git a/apps/judge/src/agent-trajectory.ts b/apps/judge/src/agent-trajectory.ts
index 29b20a469..fe1ae85cb 100644
--- a/apps/judge/src/agent-trajectory.ts
+++ b/apps/judge/src/agent-trajectory.ts
@@ -364,6 +364,89 @@ export function fromAtif(input: unknown): AgentTrajectory {
};
}
+/**
+ * Merge several {@link AgentTrajectory}s (e.g. one per iteration) into a single
+ * whole-run trajectory for `subject:"run"` observation evaluation (#1156).
+ *
+ * - `calls` are concatenated in iteration order. Colliding `toolCallId`s (the
+ * ATIF synthesizes step-local ids like `atif-3-0` that restart each iteration)
+ * are re-keyed `it:` so every call stays addressable via
+ * `get_agent_tool_calls`.
+ * - `toolDefinitions` are unioned by name (first wins).
+ * - `steps` are concatenated, each tagged with its source iteration.
+ *
+ * A list of length 0 yields an empty trajectory; length 1 is returned as-is.
+ */
+export function mergeTrajectories(list: AgentTrajectory[]): AgentTrajectory {
+ const items = (list ?? []).filter((t): t is AgentTrajectory => Boolean(t));
+ if (items.length === 0) {
+ return {
+ source: "atif",
+ calls: [],
+ byId: new Map(),
+ toolDefinitions: [],
+ toolDefsByName: new Map(),
+ };
+ }
+ if (items.length === 1) return items[0];
+
+ const calls: AgentToolCall[] = [];
+ const seen = new Set();
+ items.forEach((traj, t) => {
+ for (const call of traj.calls) {
+ let uid = call.toolCallId;
+ if (seen.has(uid)) {
+ uid = `it${t + 1}:${call.toolCallId}`;
+ let k = 1;
+ while (seen.has(uid)) uid = `it${t + 1}:${call.toolCallId}-${k++}`;
+ }
+ seen.add(uid);
+ calls.push(uid === call.toolCallId ? call : { ...call, toolCallId: uid });
+ }
+ });
+
+ const toolDefinitions: AgentToolDefinition[] = [];
+ const toolDefsByName = new Map();
+ for (const traj of items) {
+ for (const def of traj.toolDefinitions) {
+ if (!toolDefsByName.has(def.name)) {
+ toolDefsByName.set(def.name, def);
+ toolDefinitions.push(def);
+ }
+ }
+ }
+
+ const steps: StepOverview[] = [];
+ items.forEach((traj, t) => {
+ for (const s of traj.steps ?? []) {
+ steps.push({ ...s, source: `it${t + 1}:${s.source}` });
+ }
+ });
+
+ const first = items[0];
+ const anyAtif = items.some((x) => x.source === "atif");
+ return {
+ source: anyAtif ? "atif" : "tool-calls",
+ agent: first.agent,
+ model: first.model,
+ calls,
+ byId: buildById(calls),
+ toolDefinitions,
+ toolDefsByName,
+ steps: steps.length > 0 ? steps : undefined,
+ finalMetrics: items[items.length - 1]?.finalMetrics,
+ };
+}
+
+/**
+ * Normalize a list of raw ATIF payloads (one per iteration) into a single
+ * merged whole-run {@link AgentTrajectory}. Convenience over
+ * {@link mergeTrajectories} ∘ {@link fromAtif}.
+ */
+export function fromAtifList(inputs: unknown[]): AgentTrajectory {
+ return mergeTrajectories((inputs ?? []).map((x) => fromAtif(x)));
+}
+
// ---------------------------------------------------------------------------
// Tools
// ---------------------------------------------------------------------------
diff --git a/apps/judge/src/index.ts b/apps/judge/src/index.ts
index fd5a42e38..7702b381c 100644
--- a/apps/judge/src/index.ts
+++ b/apps/judge/src/index.ts
@@ -5,7 +5,7 @@ import express, { Request, Response, NextFunction } from "express";
import dotenv from "dotenv";
import { evaluateWorkspace } from "./judge-agent.js";
import { verifyCopilotProtocol } from "./protocol-check.js";
-import { type AgentTrajectory, fromAtif, fromToolCalls } from "./agent-trajectory.js";
+import { type AgentTrajectory, fromAtif, fromAtifList, fromToolCalls } from "./agent-trajectory.js";
import { BlobStorage, RedisLogPublisher } from "shared";
import { mkdtempSync, rmSync } from "fs";
import { tmpdir } from "os";
@@ -53,7 +53,7 @@ app.post(
const startTime = Date.now();
try {
- const { snapshotUrl, criteria, conversationHistory, personaInstructions, requestId, gate, toolCallsUrl, atifUrl } = req.body;
+ const { snapshotUrl, criteria, conversationHistory, personaInstructions, requestId, gate, toolCallsUrl, atifUrl, atifUrls } = req.body;
// Validate required fields
if (!snapshotUrl || typeof snapshotUrl !== "string") {
@@ -100,7 +100,23 @@ app.post(
// Failures are non-fatal — the judge can still evaluate the workspace
// files. See apps/judge/src/agent-trajectory.ts.
let trajectory: AgentTrajectory | undefined;
- if (atifUrl && typeof atifUrl === "string") {
+ if (Array.isArray(atifUrls) && atifUrls.length > 0) {
+ // Run-subject observations (#1156): merge every iteration's ATIF into
+ // one whole-run trajectory so cross-iteration behavior (e.g. a dep added
+ // in one turn and removed in another) is visible in a single evaluation.
+ const urls = atifUrls.filter((u: unknown): u is string => typeof u === "string");
+ try {
+ const atifs = await Promise.all(urls.map((u) => blobStorage.downloadJson(u)));
+ trajectory = fromAtifList(atifs);
+ console.log(
+ `[judge] Loaded merged ATIF trajectory from ${urls.length} iteration(s): ${trajectory.calls.length} call(s), ${trajectory.toolDefinitions.length} tool definition(s)`,
+ );
+ } catch (err) {
+ console.warn(
+ `[judge] Failed to load merged ATIF from ${urls.length} url(s): ${err instanceof Error ? err.message : String(err)}`,
+ );
+ }
+ } else if (atifUrl && typeof atifUrl === "string") {
try {
const atif = await blobStorage.downloadJson(atifUrl);
trajectory = fromAtif(atif);
diff --git a/apps/judge/src/observation-trajectory.integration.test.ts b/apps/judge/src/observation-trajectory.integration.test.ts
index 185a6b54b..066c40da3 100644
--- a/apps/judge/src/observation-trajectory.integration.test.ts
+++ b/apps/judge/src/observation-trajectory.integration.test.ts
@@ -27,7 +27,7 @@ import { mkdtempSync, writeFileSync, rmSync, realpathSync } from "fs";
import { tmpdir } from "os";
import { join } from "path";
import { resetCriteriaProvider } from "shared/criteria-provider-factory";
-import { fromAtif } from "./agent-trajectory.js";
+import { fromAtif, fromAtifList } from "./agent-trajectory.js";
import { evaluateWorkspace } from "./judge-agent.js";
const hasToken = !!process.env.GITHUB_TOKEN;
@@ -228,4 +228,94 @@ describe("judge ATIF-trajectory observation (integration)", () => {
}
expect(true).toBe(true);
});
+
+ // The run-subject "killer" test (#1156): the add-then-remove is split ACROSS
+ // iterations — iteration 1 installs left-pad, iteration 2 uninstalls it. Each
+ // per-iteration ATIF alone is `false` (one only adds, the other only removes),
+ // but the MERGED whole-run trajectory reveals the add-then-remove → `true`.
+ // This is exactly the cross-iteration property the `subject:"run"` path exists
+ // to evaluate, and the false-negative the user flagged.
+ const ATIF_INSTALL = {
+ schema_version: "atif/1",
+ session_id: "atif-it1-install",
+ agent: { name: "copilot", version: "1.0.0", model_name: "claude-opus-4.6", tool_definitions: [] },
+ steps: [
+ { step_id: 1, source: "system" },
+ {
+ step_id: 2,
+ source: "agent",
+ model_name: "claude-opus-4.6",
+ reasoning_content: "Add left-pad to pad output.",
+ tool_calls: [{ tool_call_id: "i1-c1", function_name: "bash", arguments: { command: "npm install left-pad" } }],
+ observation: { results: [{ source_call_id: "i1-c1", content: "added 1 package\n+ left-pad@1.3.0" }] },
+ },
+ ],
+ };
+
+ const ATIF_UNINSTALL = {
+ schema_version: "atif/1",
+ session_id: "atif-it2-uninstall",
+ agent: { name: "copilot", version: "1.0.0", model_name: "claude-opus-4.6", tool_definitions: [] },
+ steps: [
+ { step_id: 1, source: "system" },
+ {
+ step_id: 2,
+ source: "agent",
+ model_name: "claude-opus-4.6",
+ reasoning_content: "Remove left-pad; not needed.",
+ tool_calls: [{ tool_call_id: "i2-c1", function_name: "bash", arguments: { command: "npm uninstall left-pad" } }],
+ observation: { results: [{ source_call_id: "i2-c1", content: "removed 1 package\nfound 0 vulnerabilities" }] },
+ },
+ ],
+ };
+
+ it.skipIf(!hasToken)(
+ "run-subject: false per-iteration but true on the MERGED whole-run trajectory",
+ { timeout: 600_000 },
+ async () => {
+ // (1) Iteration 1 alone (install only) → no add-then-remove → false.
+ const it1 = await evaluateWorkspace({
+ workspacePath: workspaceDir,
+ criteria: ["dependency_added_then_removed"],
+ conversationHistory: [],
+ trajectory: fromAtif(ATIF_INSTALL),
+ });
+ const it1Obs = it1.criteriaResults.find((r) => r.criterionId === "dependency_added_then_removed");
+ expect(it1Obs!.evaluated).toBe(true);
+ expect(
+ it1Obs!.passed,
+ `iteration 1 (install only) should be false. Feedback: ${it1Obs!.feedback}`,
+ ).toBe(false);
+
+ // (2) Iteration 2 alone (uninstall only) → no add-then-remove → false.
+ const it2 = await evaluateWorkspace({
+ workspacePath: workspaceDir,
+ criteria: ["dependency_added_then_removed"],
+ conversationHistory: [],
+ trajectory: fromAtif(ATIF_UNINSTALL),
+ });
+ const it2Obs = it2.criteriaResults.find((r) => r.criterionId === "dependency_added_then_removed");
+ expect(it2Obs!.evaluated).toBe(true);
+ expect(
+ it2Obs!.passed,
+ `iteration 2 (uninstall only) should be false. Feedback: ${it2Obs!.feedback}`,
+ ).toBe(false);
+
+ // (3) MERGED whole-run trajectory (install in it1 + uninstall in it2) →
+ // the add-then-remove is now visible → true. This is what subject:"run"
+ // sends the judge as `atifUrls` and is the false-negative the feature fixes.
+ const merged = await evaluateWorkspace({
+ workspacePath: workspaceDir,
+ criteria: ["dependency_added_then_removed"],
+ conversationHistory: [],
+ trajectory: fromAtifList([ATIF_INSTALL, ATIF_UNINSTALL]),
+ });
+ const mergedObs = merged.criteriaResults.find((r) => r.criterionId === "dependency_added_then_removed");
+ expect(mergedObs!.evaluated).toBe(true);
+ expect(
+ mergedObs!.passed,
+ `merged whole-run trajectory should be true (add in it1, remove in it2). Feedback: ${mergedObs!.feedback}`,
+ ).toBe(true);
+ },
+ );
});
From 4fc56b5c8fa1051be7737b846438355056935733 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 19:19:19 -0700
Subject: [PATCH 038/287] =?UTF-8?q?feat(pp-taxonomy):=20honor=20criterion?=
=?UTF-8?q?=20subject=20=E2=80=94=20whole-run=20vs=20per-iteration=20(#115?=
=?UTF-8?q?6)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- taxonomy-handler: resolve selected observations with their subject; split
into iteration vs run buckets. Iteration-subject -> per-turn
observationResults (unchanged). Run-subject -> evaluate once (final snapshot
+ every turn's atifUrl merged + full conversationHistory) -> run-level
run.observationResults. Runs once because the handler runs once per run (the
scheduler never sets message.iteration), so no idempotency guard needed.
- HandlerContext gains criteriaCollection so handlers can resolve criterion
metadata by id; wired in post-processor + atif-handler test contexts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/handlers/atif-handler.test.ts | 1 +
.../handlers/atif-handler.websocket.test.ts | 1 +
.../src/handlers/taxonomy-handler.test.ts | 198 +++++++++++++++---
.../src/handlers/taxonomy-handler.ts | 126 ++++++++++-
.../post-processor/src/post-processor.ts | 1 +
apps/workers/post-processor/src/types.ts | 3 +
6 files changed, 287 insertions(+), 43 deletions(-)
diff --git a/apps/workers/post-processor/src/handlers/atif-handler.test.ts b/apps/workers/post-processor/src/handlers/atif-handler.test.ts
index bda415ad1..41e5520be 100644
--- a/apps/workers/post-processor/src/handlers/atif-handler.test.ts
+++ b/apps/workers/post-processor/src/handlers/atif-handler.test.ts
@@ -49,6 +49,7 @@ describe("AtifHandler", () => {
}),
updateOne: vi.fn().mockResolvedValue({ modifiedCount: 1 }),
} as any,
+ criteriaCollection: {} as any,
log: vi.fn().mockResolvedValue(undefined),
};
});
diff --git a/apps/workers/post-processor/src/handlers/atif-handler.websocket.test.ts b/apps/workers/post-processor/src/handlers/atif-handler.websocket.test.ts
index 19c1df8e2..fbe9daffd 100644
--- a/apps/workers/post-processor/src/handlers/atif-handler.websocket.test.ts
+++ b/apps/workers/post-processor/src/handlers/atif-handler.websocket.test.ts
@@ -53,6 +53,7 @@ describe("AtifHandler WebSocket HAR extraction (real atifact)", () => {
}),
updateOne: async () => ({ modifiedCount: 1 }),
} as any,
+ criteriaCollection: {} as any,
log: async () => undefined,
};
});
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
index 4b328b8e6..0a17a7fe5 100644
--- a/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
@@ -6,13 +6,24 @@ import { JudgeInfrastructureError, type JudgeClient } from "shared";
import { TaxonomyHandler } from "./taxonomy-handler.js";
import type { HandlerContext, PostProcessorMessage } from "../types.js";
-function makeCtx(doc: unknown): HandlerContext & { collection: { updateOne: ReturnType } } {
+interface CriterionMeta {
+ id: string;
+ subject?: "run" | "iteration";
+}
+
+function makeCtx(
+ doc: unknown,
+ metas: CriterionMeta[] = [],
+): HandlerContext & { collection: { updateOne: ReturnType } } {
return {
blobStorage: {} as any,
collection: {
findOne: vi.fn().mockResolvedValue(doc),
updateOne: vi.fn().mockResolvedValue({ modifiedCount: 1 }),
} as any,
+ criteriaCollection: {
+ find: vi.fn().mockReturnValue({ toArray: vi.fn().mockResolvedValue(metas) }),
+ } as any,
log: vi.fn().mockResolvedValue(undefined),
} as any;
}
@@ -51,44 +62,165 @@ describe("TaxonomyHandler", () => {
expect(ctx.collection.updateOne).not.toHaveBeenCalled();
});
- it("writes judge criteriaResults to each turn's observationResults and sends atifUrl", async () => {
- judge.evaluate.mockResolvedValue({
- passed: true,
- feedback: "ok",
- criteriaResults: [{ criterionId: "dep_removed", passed: true, feedback: "left-pad removed", evaluated: true }],
- });
- const ctx = makeCtx({
- _id: "req-1",
- observations: ["dep_removed"],
- run: {
- turns: [{ iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" }],
- },
+ describe("subject:iteration", () => {
+ it("writes judge criteriaResults to each turn's observationResults and sends atifUrl", async () => {
+ judge.evaluate.mockResolvedValue({
+ passed: true,
+ feedback: "ok",
+ criteriaResults: [{ criterionId: "uses_ts", passed: true, feedback: "tsconfig present", evaluated: true }],
+ });
+ const ctx = makeCtx(
+ {
+ _id: "req-1",
+ observations: ["uses_ts"],
+ run: { turns: [{ iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" }] },
+ },
+ [{ id: "uses_ts", subject: "iteration" }],
+ );
+
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+
+ expect(judge.evaluate).toHaveBeenCalledWith(
+ expect.objectContaining({ snapshotUrl: "s://1", criteria: ["uses_ts"], atifUrl: "a://1" }),
+ );
+ const call = judge.evaluate.mock.calls[0][0];
+ expect(call.gate).toBeUndefined();
+ expect(call.toolCallsUrl).toBeUndefined();
+ expect(call.atifUrls).toBeUndefined();
+ expect(ctx.collection.updateOne).toHaveBeenCalledWith(
+ { _id: "req-1", "run.turns.iteration": 1 },
+ { $set: { "run.turns.$.observationResults": [{ criterionId: "uses_ts", passed: true, feedback: "tsconfig present", evaluated: true }] } },
+ );
});
- await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+ it("skips iterations without a snapshotUrl", async () => {
+ judge.evaluate.mockResolvedValue({ passed: true, feedback: "", criteriaResults: [] });
+ const ctx = makeCtx(
+ { _id: "req-1", observations: ["c1"], run: { turns: [{ iteration: 1 }] } },
+ [{ id: "c1", subject: "iteration" }],
+ );
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+ expect(judge.evaluate).not.toHaveBeenCalled();
+ });
- expect(judge.evaluate).toHaveBeenCalledWith(
- expect.objectContaining({ snapshotUrl: "s://1", criteria: ["dep_removed"], atifUrl: "a://1" }),
- );
- const call = judge.evaluate.mock.calls[0][0];
- expect(call.gate).toBeUndefined();
- expect(call.toolCallsUrl).toBeUndefined();
- expect(ctx.collection.updateOne).toHaveBeenCalledWith(
- { _id: "req-1", "run.turns.iteration": 1 },
- { $set: { "run.turns.$.observationResults": [{ criterionId: "dep_removed", passed: true, feedback: "left-pad removed", evaluated: true }] } },
- );
+ it("throws on judge infrastructure error so the handler is marked failed", async () => {
+ judge.evaluate.mockRejectedValue(new JudgeInfrastructureError("down", { httpStatus: 503 }));
+ const ctx = makeCtx(
+ { _id: "req-1", observations: ["c1"], run: { turns: [{ iteration: 1, snapshotUrl: "s://1" }] } },
+ [{ id: "c1", subject: "iteration" }],
+ );
+ await expect(new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx)).rejects.toThrow("down");
+ });
});
- it("skips iterations without a snapshotUrl", async () => {
- judge.evaluate.mockResolvedValue({ passed: true, feedback: "", criteriaResults: [] });
- const ctx = makeCtx({ _id: "req-1", observations: ["c1"], run: { turns: [{ iteration: 1 }] } });
- await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
- expect(judge.evaluate).not.toHaveBeenCalled();
+ describe("subject:run", () => {
+ it("evaluates ONCE over the merged trajectory and writes run-level observationResults", async () => {
+ judge.evaluate.mockResolvedValue({
+ passed: true,
+ feedback: "ok",
+ criteriaResults: [
+ { criterionId: "dep_added_then_removed", passed: true, feedback: "left-pad added then removed", evaluated: true },
+ ],
+ });
+ const ctx = makeCtx(
+ {
+ _id: "req-1",
+ observations: ["dep_added_then_removed"],
+ run: {
+ turns: [
+ { iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" },
+ { iteration: 2, snapshotUrl: "s://2", atifUrl: "a://2" },
+ ],
+ },
+ },
+ [{ id: "dep_added_then_removed", subject: "run" }],
+ );
+
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+
+ // One judge call, using the FINAL snapshot + EVERY iteration's atif merged.
+ expect(judge.evaluate).toHaveBeenCalledTimes(1);
+ expect(judge.evaluate).toHaveBeenCalledWith(
+ expect.objectContaining({
+ snapshotUrl: "s://2",
+ criteria: ["dep_added_then_removed"],
+ atifUrls: ["a://1", "a://2"],
+ }),
+ );
+ const call = judge.evaluate.mock.calls[0][0];
+ expect(call.atifUrl).toBeUndefined();
+ // Written at the RUN level, not on any turn.
+ expect(ctx.collection.updateOne).toHaveBeenCalledWith(
+ { _id: "req-1" },
+ { $set: { "run.observationResults": [{ criterionId: "dep_added_then_removed", passed: true, feedback: "left-pad added then removed", evaluated: true }] } },
+ );
+ });
+
+ it("defaults a subject-less observation to run (whole-run evaluation)", async () => {
+ judge.evaluate.mockResolvedValue({ passed: false, feedback: "no", criteriaResults: [] });
+ const ctx = makeCtx(
+ {
+ _id: "req-1",
+ observations: ["legacy_obs"],
+ run: { turns: [{ iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" }] },
+ },
+ [{ id: "legacy_obs" }], // no subject → defaults to run
+ );
+
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+
+ expect(judge.evaluate).toHaveBeenCalledTimes(1);
+ const call = judge.evaluate.mock.calls[0][0];
+ expect(call.atifUrls).toEqual(["a://1"]);
+ expect(ctx.collection.updateOne).toHaveBeenCalledWith(
+ { _id: "req-1" },
+ expect.objectContaining({ $set: expect.objectContaining({ "run.observationResults": [] }) }),
+ );
+ });
+
+ it("throws on judge infrastructure error during the run-subject evaluation", async () => {
+ judge.evaluate.mockRejectedValue(new JudgeInfrastructureError("down", { httpStatus: 503 }));
+ const ctx = makeCtx(
+ { _id: "req-1", observations: ["r1"], run: { turns: [{ iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" }] } },
+ [{ id: "r1", subject: "run" }],
+ );
+ await expect(new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx)).rejects.toThrow("down");
+ });
});
- it("throws on judge infrastructure error so the handler is marked failed", async () => {
- judge.evaluate.mockRejectedValue(new JudgeInfrastructureError("down", { httpStatus: 503 }));
- const ctx = makeCtx({ _id: "req-1", observations: ["c1"], run: { turns: [{ iteration: 1, snapshotUrl: "s://1" }] } });
- await expect(new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx)).rejects.toThrow("down");
+ describe("mixed subjects", () => {
+ it("routes iteration and run observations to their respective evaluations", async () => {
+ judge.evaluate.mockResolvedValue({ passed: true, feedback: "ok", criteriaResults: [] });
+ const ctx = makeCtx(
+ {
+ _id: "req-1",
+ observations: ["iter_obs", "run_obs"],
+ run: {
+ turns: [
+ { iteration: 1, snapshotUrl: "s://1", atifUrl: "a://1" },
+ { iteration: 2, snapshotUrl: "s://2", atifUrl: "a://2" },
+ ],
+ },
+ },
+ [
+ { id: "iter_obs", subject: "iteration" },
+ { id: "run_obs", subject: "run" },
+ ],
+ );
+
+ await new TaxonomyHandler(judge as unknown as JudgeClient).process(msg, ctx);
+
+ // 2 iteration calls (one per turn) + 1 run call = 3 total.
+ expect(judge.evaluate).toHaveBeenCalledTimes(3);
+ const iterationCalls = judge.evaluate.mock.calls.filter((c) => c[0].criteria.includes("iter_obs"));
+ const runCalls = judge.evaluate.mock.calls.filter((c) => c[0].criteria.includes("run_obs"));
+ expect(iterationCalls).toHaveLength(2);
+ expect(runCalls).toHaveLength(1);
+ // The iteration eval only carries the iteration-subject criterion.
+ expect(iterationCalls[0][0].criteria).toEqual(["iter_obs"]);
+ // The run eval only carries the run-subject criterion, merged trajectory.
+ expect(runCalls[0][0].criteria).toEqual(["run_obs"]);
+ expect(runCalls[0][0].atifUrls).toEqual(["a://1", "a://2"]);
+ });
});
});
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
index 571320317..252be22a3 100644
--- a/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
@@ -2,7 +2,7 @@
// Licensed under the MIT License.
import { JudgeClient, isRetryableJudgeError } from "shared";
-import type { ConversationTurn, CriterionResult } from "shared";
+import type { ConversationTurn, CriterionResult, CriterionSubject } from "shared";
import type { PostProcessHandler, PostProcessorMessage, HandlerContext } from "../types.js";
/** Minimal shape of the request document fields this handler reads/writes. */
@@ -17,15 +17,30 @@ interface RequestDoc {
};
}
+/** Minimal projection of a criterion needed to route by evaluation granularity. */
+interface CriterionMeta {
+ id: string;
+ subject?: CriterionSubject;
+}
+
/**
- * Taxonomy Handler (pp-taxonomy): records per-iteration boolean observations.
+ * Taxonomy Handler (pp-taxonomy): records boolean observations.
+ *
+ * Each selected observation criterion is routed by its `subject` (#1156):
*
- * For each iteration turn with a `snapshotUrl`, reuses the judge service to
- * evaluate the run's selected observation criteria (top-level
- * `request.observations`) against the codebase snapshot AND the agent
- * trajectory (ATIF) — sending `atifUrl` in place of `toolCallsUrl`. Results are
- * written to `turn.observationResults`, mirroring gate `criteriaResults`. Never
- * gates, never steers the agent. Empty/absent `observations` → no-op. #1156.
+ * - **`subject:"iteration"`** — evaluated on each iteration in isolation against
+ * that turn's snapshot + ATIF; written to `turn.observationResults` (mirrors
+ * gate `criteriaResults`).
+ * - **`subject:"run"`** (the observation default) — evaluated ONCE against the
+ * whole run: the final iteration's snapshot + the MERGED trajectory of every
+ * iteration's ATIF (`atifUrls`) + the full conversation history; written to the
+ * run-level `run.observationResults`. This is what makes cross-iteration
+ * behavior (e.g. a dependency added in one turn and removed in another) visible.
+ *
+ * Reuses the judge service; never gates, never steers the agent. Empty/absent
+ * `observations` → no-op. pp-taxonomy is dispatched exactly once per run (the
+ * scheduler never sets `message.iteration`), so the run-subject branch runs once
+ * with no idempotency guard.
*/
export class TaxonomyHandler implements PostProcessHandler {
readonly type = "taxonomy";
@@ -51,6 +66,30 @@ export class TaxonomyHandler implements PostProcessHandler {
return;
}
+ // Resolve each selected observation's evaluation granularity. A missing/unknown
+ // subject defaults to "run" (the observation default), so legacy criteria authored
+ // before the `subject` field get whole-run evaluation.
+ const metas = (await ctx.criteriaCollection
+ .find({ id: { $in: observations } }, { projection: { id: 1, subject: 1 } } as any)
+ .toArray()) as unknown as CriterionMeta[];
+ const subjectById = new Map(metas.map((m) => [m.id, m.subject]));
+ const iterationObs = observations.filter((id) => subjectById.get(id) === "iteration");
+ const runObs = observations.filter((id) => subjectById.get(id) !== "iteration");
+
+ await this.evaluateIterationObservations(iterationObs, turns, iteration, requestId, ctx);
+ await this.evaluateRunObservations(runObs, turns, iteration, requestId, ctx);
+ }
+
+ /** Per-iteration observations → `turn.observationResults` (one judge call per turn). */
+ private async evaluateIterationObservations(
+ iterationObs: string[],
+ turns: ConversationTurn[],
+ iteration: number | undefined,
+ requestId: string,
+ ctx: HandlerContext,
+ ): Promise {
+ if (iterationObs.length === 0) return;
+
const turnsToProcess = iteration ? turns.filter((t) => t.iteration === iteration) : turns;
let processedCount = 0;
@@ -63,7 +102,7 @@ export class TaxonomyHandler implements PostProcessHandler {
try {
const result = await this.judge.evaluate({
snapshotUrl: turn.snapshotUrl,
- criteria: observations,
+ criteria: iterationObs,
conversationHistory: turns,
...(turn.atifUrl ? { atifUrl: turn.atifUrl } : {}),
requestId,
@@ -88,6 +127,73 @@ export class TaxonomyHandler implements PostProcessHandler {
}
}
- await ctx.log("info", `Taxonomy evaluation complete: ${processedCount}/${turnsToProcess.length} iterations processed`);
+ await ctx.log(
+ "info",
+ `Iteration-subject evaluation complete: ${processedCount}/${turnsToProcess.length} iterations processed`,
+ );
+ }
+
+ /**
+ * Whole-run observations → `run.observationResults` (one judge call over the
+ * merged trajectory). Skipped when a single-iteration dispatch is requested
+ * (forward-compat: a whole-run eval needs every turn). Today `message.iteration`
+ * is never set, so this runs once per run.
+ */
+ private async evaluateRunObservations(
+ runObs: string[],
+ turns: ConversationTurn[],
+ iteration: number | undefined,
+ requestId: string,
+ ctx: HandlerContext,
+ ): Promise {
+ if (runObs.length === 0) return;
+ if (iteration) {
+ await ctx.log(
+ "info",
+ `Skipping ${runObs.length} run-subject observation(s): single-iteration dispatch cannot evaluate the whole run`,
+ );
+ return;
+ }
+
+ const turnsWithSnapshot = turns.filter((t) => t.snapshotUrl);
+ const finalTurn = turnsWithSnapshot[turnsWithSnapshot.length - 1];
+ if (!finalTurn?.snapshotUrl) {
+ await ctx.log("info", "No turn with a snapshot, skipping run-subject observations");
+ return;
+ }
+
+ // Merge every iteration's ATIF into one whole-run trajectory.
+ const atifUrls = turns
+ .map((t) => t.atifUrl)
+ .filter((u): u is string => typeof u === "string" && u.length > 0);
+
+ try {
+ const result = await this.judge.evaluate({
+ snapshotUrl: finalTurn.snapshotUrl,
+ criteria: runObs,
+ conversationHistory: turns,
+ ...(atifUrls.length > 0 ? { atifUrls } : {}),
+ requestId,
+ });
+
+ const runObservationResults: CriterionResult[] = result.criteriaResults ?? [];
+
+ await ctx.collection.updateOne(
+ { _id: requestId } as any,
+ { $set: { "run.observationResults": runObservationResults } } as any,
+ );
+
+ await ctx.log(
+ "info",
+ `Run-subject evaluation complete: ${runObservationResults.length} whole-run observation(s) recorded over ${atifUrls.length} merged trajectory(ies)`,
+ );
+ } catch (err) {
+ const errMsg = err instanceof Error ? err.message : String(err);
+ if (isRetryableJudgeError(err)) {
+ await ctx.log("error", `Run-subject: judge infrastructure error, failing handler: ${errMsg}`);
+ throw err;
+ }
+ await ctx.log("warn", `Run-subject observation evaluation failed: ${errMsg}`);
+ }
}
}
diff --git a/apps/workers/post-processor/src/post-processor.ts b/apps/workers/post-processor/src/post-processor.ts
index 4b1b6e847..e6b10614a 100644
--- a/apps/workers/post-processor/src/post-processor.ts
+++ b/apps/workers/post-processor/src/post-processor.ts
@@ -81,6 +81,7 @@ export class PostProcessor extends BaseQueueProcessor {
const ctx: HandlerContext = {
blobStorage: this.blobStorage,
collection: this.collection as any,
+ criteriaCollection: this.db.collection("criteria"),
log,
};
diff --git a/apps/workers/post-processor/src/types.ts b/apps/workers/post-processor/src/types.ts
index 8765dd926..20e1397d0 100644
--- a/apps/workers/post-processor/src/types.ts
+++ b/apps/workers/post-processor/src/types.ts
@@ -16,6 +16,9 @@ export interface PostProcessorMessage {
export interface HandlerContext {
blobStorage: BlobStorage;
collection: Collection;
+ /** The `criteria` collection — lets handlers resolve criterion metadata
+ * (e.g. observation `subject`/`taxonomyElementId`) by id. #1156. */
+ criteriaCollection: Collection;
log: (level: LogEvent["level"], msg: string, data?: Record) => Promise;
}
From 1daf022db138e51a8baec3bbe05fcf830a83e834 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 19:20:12 -0700
Subject: [PATCH 039/287] feat(portal): subject toggle + whole-run observations
+ steering copy (#1156)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- wizard: Run/Iteration toggle (shown for observations, prefilled from AI
suggestedSubject, user-overridable); subject in create payload + reset
- kind copy reworded to convey STEERING vs record-only: gate steers the agent
(pass/fail feedback shapes its next iteration), observation records evidence
never shown to the agent — in both the wizard and the inline editor
- RunDetail Taxonomy tab: new Whole-run observations subsection (from
run.observationResults) above the per-iteration matrix, grouped by dimension
- CriteriaSubjectBadge on list + detail; subject in types + api payloads
- Storybook: subject-badge story
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../src/components/CriteriaBadge.stories.tsx | 16 +++-
apps/portal/src/components/CriteriaBadge.tsx | 27 +++++-
.../src/components/CriteriaWizardStep1.tsx | 43 ++++++++--
apps/portal/src/hooks/useCriteriaWizard.ts | 19 ++++-
apps/portal/src/lib/api.ts | 6 +-
apps/portal/src/pages/CriteriaList.tsx | 11 ++-
apps/portal/src/pages/CriterionDetail.tsx | 53 ++++++++----
apps/portal/src/pages/RunDetail.tsx | 83 ++++++++++++++++++-
apps/portal/src/types.ts | 22 ++++-
9 files changed, 241 insertions(+), 39 deletions(-)
diff --git a/apps/portal/src/components/CriteriaBadge.stories.tsx b/apps/portal/src/components/CriteriaBadge.stories.tsx
index e851b3aec..bb3c1f8cb 100644
--- a/apps/portal/src/components/CriteriaBadge.stories.tsx
+++ b/apps/portal/src/components/CriteriaBadge.stories.tsx
@@ -2,7 +2,7 @@
// Licensed under the MIT License.
import type { Meta, StoryObj } from "@storybook/react-vite";
-import { CriteriaBadge, CriteriaKindBadge } from "./CriteriaBadge";
+import { CriteriaBadge, CriteriaKindBadge, CriteriaSubjectBadge } from "./CriteriaBadge";
const meta = {
title: "Components/CriteriaBadge",
@@ -47,3 +47,17 @@ export const KindBadges: Story = {
),
};
+
+export const SubjectBadges: Story = {
+ args: {
+ criterionId: "has_unit_tests",
+ link: false,
+ },
+ render: () => (
+
+
+
+
+
+ ),
+};
diff --git a/apps/portal/src/components/CriteriaBadge.tsx b/apps/portal/src/components/CriteriaBadge.tsx
index d1cc1bbc3..e5536e2bd 100644
--- a/apps/portal/src/components/CriteriaBadge.tsx
+++ b/apps/portal/src/components/CriteriaBadge.tsx
@@ -5,7 +5,7 @@ import { Link } from "react-router-dom";
import { Badge } from "@/components/ui/badge";
import { cn } from "@/lib/utils";
import { criterionResultStyle, type CriterionResultState } from "@/lib/criteria-result";
-import type { CriterionKind } from "@/types";
+import type { CriterionKind, CriterionSubject } from "@/types";
interface CriteriaBadgeProps {
criterionId: string;
@@ -75,3 +75,28 @@ export function CriteriaKindBadge({ kind, className }: { kind?: CriterionKind; c
);
}
+
+/**
+ * Small badge showing an observation's evaluation subject (#1156):
+ * "Whole run" (subject:"run") vs "Per iteration" (subject:"iteration").
+ * Defaults to "run" when unset (the observation default). Intended for
+ * observation criteria; subject is inert for gates.
+ */
+export function CriteriaSubjectBadge({ subject, className }: { subject?: CriterionSubject; className?: string }) {
+ const normalized = subject ?? "run";
+ return (
+
+ {normalized === "run" ? "Whole run" : "Per iteration"}
+
+ );
+}
diff --git a/apps/portal/src/components/CriteriaWizardStep1.tsx b/apps/portal/src/components/CriteriaWizardStep1.tsx
index c6a182b36..3cda0d8e3 100644
--- a/apps/portal/src/components/CriteriaWizardStep1.tsx
+++ b/apps/portal/src/components/CriteriaWizardStep1.tsx
@@ -32,6 +32,8 @@ export function CriteriaWizardStep1({ wizard, idPrefix = "" }: CriteriaWizardSte
setKind,
taxonomyElementId,
setTaxonomyElementId,
+ subject,
+ setSubject,
} = wizard;
return (
@@ -105,12 +107,14 @@ export function CriteriaWizardStep1({ wizard, idPrefix = "" }: CriteriaWizardSte
- Gate — controls pass/fail iteration flow
- Observation — records per-iteration evidence
+ Gate — steers the agent (pass/fail feedback shapes its next iteration)
+ Observation — records evidence; never shown to the agent
- Gate criteria drive judge feedback. Observations are recorded after each iteration and never gate the agent.
+ Gate criteria steer the agent — their pass/fail verdict is fed back into the coding
+ session and shapes what it does next. Observations are recorded for analysis only:
+ never shown to the agent and never change its behavior.
@@ -125,11 +129,34 @@ export function CriteriaWizardStep1({ wizard, idPrefix = "" }: CriteriaWizardSte
) : (
-
+ <>
+
+
+ {/* Evaluation subject (observations only) */}
+
+
+ Evaluation subject
+
+
setSubject(value as typeof subject)}>
+
+
+
+
+ Whole run — evaluated once across all iterations
+ Per iteration — evaluated on each iteration in isolation
+
+
+
+ Whole-run observations span iterations (e.g. a dependency added then later removed),
+ evaluated once against the final snapshot plus the merged trajectory. Per-iteration
+ observations are judged independently on each iteration.
+
+
+ >
)}
);
diff --git a/apps/portal/src/hooks/useCriteriaWizard.ts b/apps/portal/src/hooks/useCriteriaWizard.ts
index 3033c2d49..4115684c3 100644
--- a/apps/portal/src/hooks/useCriteriaWizard.ts
+++ b/apps/portal/src/hooks/useCriteriaWizard.ts
@@ -7,7 +7,7 @@ import { api } from "@/lib/api";
import { slugify } from "@/lib/utils";
import { toast } from "sonner";
import { gatesSatisfyInvariant, type GateId } from "@/lib/gates";
-import type { CriterionKind, TaxonomyElementId } from "@/types";
+import type { CriterionKind, CriterionSubject, TaxonomyElementId } from "@/types";
export interface UseCriteriaWizardOptions {
/** Pre-populated parent dependency IDs */
@@ -18,6 +18,8 @@ export interface UseCriteriaWizardOptions {
lockedGates?: GateId[];
initialKind?: CriterionKind;
initialTaxonomyElementId?: TaxonomyElementId;
+ /** Pre-populated evaluation subject (observations default to "run"). */
+ initialSubject?: CriterionSubject;
/** Called with the new criterion ID after successful creation */
onSuccess: (id: string) => void;
}
@@ -28,6 +30,7 @@ export function useCriteriaWizard({
lockedGates,
initialKind = "gate",
initialTaxonomyElementId,
+ initialSubject = "run",
onSuccess,
}: UseCriteriaWizardOptions) {
const queryClient = useQueryClient();
@@ -43,6 +46,7 @@ export function useCriteriaWizard({
const [gates, setGates] = useState(initialGates ?? ["select"]);
const [kind, setKind] = useState(initialKind);
const [taxonomyElementId, setTaxonomyElementId] = useState(initialTaxonomyElementId);
+ const [subject, setSubject] = useState(initialSubject);
// Step 2 fields
const [prompt, setPrompt] = useState("");
@@ -143,6 +147,11 @@ export function useCriteriaWizard({
setSuggestedChildren([]);
setAcceptedChildren([]);
}
+ // Prefill the evaluation subject from the AI suggestion (observations
+ // only; the toggle is hidden for gates). User can still override it.
+ if (data.suggestedSubject) {
+ setSubject(data.suggestedSubject);
+ }
},
onError: () => {
// LLM unavailable — proceed with empty prompt for manual entry
@@ -197,8 +206,9 @@ export function useCriteriaWizard({
...(kind === "gate" ? { gates } : {}),
kind,
...(kind === "observation" && taxonomyElementId ? { taxonomyElementId } : {}),
+ ...(kind === "observation" ? { subject } : {}),
});
- }, [id, prompt, dependsOn, gates, kind, taxonomyElementId, createMutation]);
+ }, [id, prompt, dependsOn, gates, kind, taxonomyElementId, subject, createMutation]);
// Regenerate prompt
const handleRegenerate = useCallback(() => {
@@ -218,12 +228,13 @@ export function useCriteriaWizard({
setGates(initialGates ?? ["select"]);
setKind(initialKind);
setTaxonomyElementId(initialTaxonomyElementId);
+ setSubject(initialSubject);
setPrompt("");
setAiGenerated(false);
setSuggestedParents([]);
setSuggestedChildren([]);
setAcceptedChildren([]);
- }, [initialDependsOn, initialGates, initialKind, initialTaxonomyElementId]);
+ }, [initialDependsOn, initialGates, initialKind, initialTaxonomyElementId, initialSubject]);
return {
// State
@@ -243,6 +254,8 @@ export function useCriteriaWizard({
setKind,
taxonomyElementId,
setTaxonomyElementId,
+ subject,
+ setSubject,
prompt,
setPrompt,
aiGenerated,
diff --git a/apps/portal/src/lib/api.ts b/apps/portal/src/lib/api.ts
index 281fad7dd..1cef41b3e 100644
--- a/apps/portal/src/lib/api.ts
+++ b/apps/portal/src/lib/api.ts
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-import type { Run, RunState, CriteriaDocument, CriteriaGraphData, GeneratePromptResponse, AnalysisResponse, PromptFeatureDocument, Report, BulkReportStatus, BulkReportSummary, ReportTemplate, ReportTrigger, ReportTemplateSystemPrompt, KeyDocument, KeyValidationResult, CreateKeyRequest, UpdateKeyRequest, CodingAgent, AgentVersion, McpServerDocument, CreateMcpServerRequest, UpdateMcpServerRequest, BulkResubmitOverrides, Insight, InsightWithReference, TaskPrompt, TaskPromptFeatureExtractionResult, Model, FeatureFlag, SkillDocument, SkillSearchResult, SkillDiscoveryResult, SkillRevisionDocument, CodebaseDocument, CodebaseRevisionDocument, CodebaseSourceType, ExtensionDocument, ExtensionSearchResult, ExtensionVersionInfo, MdpResponse, AccountDocument, CreateAccountRequest, UpdateAccountRequest, ProfileWithVersion, ProfileVersionDocument, ProfileDocument, RunGroup, CursorPaginatedResponse, IterationOp, GateConfig, GateId, PromptType, CriterionKind, TaxonomyElementId } from "@/types";
+import type { Run, RunState, CriteriaDocument, CriteriaGraphData, GeneratePromptResponse, AnalysisResponse, PromptFeatureDocument, Report, BulkReportStatus, BulkReportSummary, ReportTemplate, ReportTrigger, ReportTemplateSystemPrompt, KeyDocument, KeyValidationResult, CreateKeyRequest, UpdateKeyRequest, CodingAgent, AgentVersion, McpServerDocument, CreateMcpServerRequest, UpdateMcpServerRequest, BulkResubmitOverrides, Insight, InsightWithReference, TaskPrompt, TaskPromptFeatureExtractionResult, Model, FeatureFlag, SkillDocument, SkillSearchResult, SkillDiscoveryResult, SkillRevisionDocument, CodebaseDocument, CodebaseRevisionDocument, CodebaseSourceType, ExtensionDocument, ExtensionSearchResult, ExtensionVersionInfo, MdpResponse, AccountDocument, CreateAccountRequest, UpdateAccountRequest, ProfileWithVersion, ProfileVersionDocument, ProfileDocument, RunGroup, CursorPaginatedResponse, IterationOp, GateConfig, GateId, PromptType, CriterionKind, TaxonomyElementId, CriterionSubject } from "@/types";
import { qs } from "./url";
import { recordServerDate } from "./serverClock";
@@ -318,7 +318,7 @@ export const api = {
},
/** Create a new criterion */
- createCriterion: (body: { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }): Promise => {
+ createCriterion: (body: { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId; subject?: CriterionSubject }): Promise => {
return request("/criteria", {
method: "POST",
body: JSON.stringify(body),
@@ -326,7 +326,7 @@ export const api = {
},
/** Update an existing criterion */
- updateCriterion: (id: string, body: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }): Promise => {
+ updateCriterion: (id: string, body: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId; subject?: CriterionSubject }): Promise => {
return request(`/criteria/${id}`, {
method: "PUT",
body: JSON.stringify(body),
diff --git a/apps/portal/src/pages/CriteriaList.tsx b/apps/portal/src/pages/CriteriaList.tsx
index 3c07c9800..1425ff064 100644
--- a/apps/portal/src/pages/CriteriaList.tsx
+++ b/apps/portal/src/pages/CriteriaList.tsx
@@ -35,7 +35,7 @@ import {
type CustomizeColumnsOption,
} from "@/components/list-layout";
import { HelpTooltip } from "@/components/HelpTooltip";
-import { CriteriaKindBadge } from "@/components/CriteriaBadge";
+import { CriteriaKindBadge, CriteriaSubjectBadge } from "@/components/CriteriaBadge";
import { TAXONOMY_ELEMENT_METADATA } from "@/types";
const FILTER_KEYS = ["gate", "kind"] as const;
@@ -179,9 +179,14 @@ export function CriteriaList() {
{
id: "kind",
header: "Kind",
- width: "130px",
+ width: "180px",
hidden: visibility.isHidden("kind"),
- cell: (c) => ,
+ cell: (c) => (
+
+
+ {c.kind === "observation" && }
+
+ ),
},
{
id: "taxonomy",
diff --git a/apps/portal/src/pages/CriterionDetail.tsx b/apps/portal/src/pages/CriterionDetail.tsx
index 51ec8b358..274637abe 100644
--- a/apps/portal/src/pages/CriterionDetail.tsx
+++ b/apps/portal/src/pages/CriterionDetail.tsx
@@ -20,7 +20,7 @@ import {
import { Skeleton } from "@/components/ui/skeleton";
import { ArrowLeft, Save, Trash2, Loader2, Sparkles, Check, X, Plus, Download } from "lucide-react";
import { CriteriaPicker } from "@/components/CriteriaPicker";
-import { CriteriaKindBadge } from "@/components/CriteriaBadge";
+import { CriteriaKindBadge, CriteriaSubjectBadge } from "@/components/CriteriaBadge";
import { GateCompatibilityPicker } from "@/components/GateCompatibilityPicker";
import { ObservationTaxonomySelect } from "@/components/ObservationTaxonomySelect";
import { formatDate } from "@/lib/utils";
@@ -33,7 +33,7 @@ import { useCommandEnter } from "@/hooks/useCommandEnter";
import { KbdBadge } from "@/components/KbdBadge";
import { criteriaToExportYaml, downloadAsFile } from "@/lib/criteria-export";
import { toast } from "sonner";
-import { TAXONOMY_ELEMENT_METADATA, type CriterionKind, type TaxonomyElementId } from "@/types";
+import { TAXONOMY_ELEMENT_METADATA, type CriterionKind, type CriterionSubject, type TaxonomyElementId } from "@/types";
export function CriterionDetail() {
const { id } = useParams<{ id: string }>();
@@ -55,6 +55,7 @@ export function CriterionDetail() {
const [editGates, setEditGates] = useState(undefined);
const [editKind, setEditKind] = useState("gate");
const [editTaxonomyElementId, setEditTaxonomyElementId] = useState(undefined);
+ const [editSubject, setEditSubject] = useState("run");
// AI Suggest state
const [aiSuggestOpen, setAiSuggestOpen] = useState(false);
@@ -70,7 +71,7 @@ export function CriterionDetail() {
});
const updateMutation = useMutation({
- mutationFn: (body: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }) =>
+ mutationFn: (body: { prompt?: string; dependsOn?: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId; subject?: CriterionSubject }) =>
api.updateCriterion(id!, body),
onSuccess: async () => {
// Update accepted children to depend on this criterion
@@ -133,6 +134,7 @@ export function CriterionDetail() {
setEditGates(criterion.gates && criterion.gates.length > 0 ? criterion.gates : ["select"]);
setEditKind(criterion.kind ?? "gate");
setEditTaxonomyElementId(criterion.taxonomyElementId);
+ setEditSubject(criterion.subject ?? ((criterion.kind ?? "gate") === "observation" ? "run" : "iteration"));
setAiSuggestOpen(false);
setBehaviorInput("");
setSuggestedPrompt(null);
@@ -153,6 +155,8 @@ export function CriterionDetail() {
...(editKind === "gate" ? { gates: editGates } : {}),
kind: editKind,
taxonomyElementId: editKind === "observation" ? editTaxonomyElementId : undefined,
+ // Subject only applies to observations; gates are always per-iteration.
+ subject: editKind === "observation" ? editSubject : "iteration",
});
};
@@ -466,7 +470,7 @@ export function CriterionDetail() {
Kind
- Whether this criterion gates iteration flow or records observation evidence.
+ Gate criteria steer the agent (pass/fail feedback shapes its next iteration); observations only record evidence and are never shown to the agent.
@@ -479,28 +483,45 @@ export function CriterionDetail() {
- Gate — controls pass/fail iteration flow
- Observation — records per-iteration evidence
+ Gate — steers the agent (pass/fail feedback shapes its next iteration)
+ Observation — records evidence; never shown to the agent
{editKind === "observation" && (
-
+ <>
+
+
+ Evaluation subject
+ setEditSubject(value as CriterionSubject)}>
+
+
+
+
+ Whole run — evaluated once across all iterations
+ Per iteration — evaluated on each iteration in isolation
+
+
+
+ >
)}
>
) : (
{(criterion.kind ?? "gate") === "observation" && (
-
- {criterion.taxonomyElementId
- ? TAXONOMY_ELEMENT_METADATA[criterion.taxonomyElementId].label
- : "Unclassified"}
-
+ <>
+
+ {criterion.taxonomyElementId
+ ? TAXONOMY_ELEMENT_METADATA[criterion.taxonomyElementId].label
+ : "Unclassified"}
+
+
+ >
)}
)}
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index 2b058d107..235a78866 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -295,6 +295,80 @@ function ObservationResultsPanel({
);
}
+/**
+ * Whole-run observation results (#1156, `subject:"run"`). Each criterion is
+ * evaluated ONCE against the final snapshot + the merged trajectory across all
+ * iterations, so these live at run level (`run.observationResults`) rather than
+ * per turn. Rendered as a subsection above the per-iteration matrix, grouped by
+ * taxonomy dimension like the matrix.
+ */
+function WholeRunObservationsPanel({
+ results,
+ criteria,
+}: {
+ results: CriterionResult[] | undefined;
+ criteria: CriteriaDocument[];
+}) {
+ const criteriaById = useMemo(() => new Map(criteria.map((criterion) => [criterion.id, criterion])), [criteria]);
+ const groups = useMemo(() => {
+ const byDimension = new Map>();
+ for (const result of results ?? []) {
+ const criterion = criteriaById.get(result.criterionId);
+ const key: ObservationDimensionKey = criterion?.taxonomyElementId ?? "unclassified";
+ const existing = byDimension.get(key) ?? [];
+ existing.push({ result, criterion });
+ byDimension.set(key, existing);
+ }
+ return Array.from(byDimension.entries()).sort(([a], [b]) => observationDimensionLabel(a).localeCompare(observationDimensionLabel(b)));
+ }, [results, criteriaById]);
+
+ if (groups.length === 0) return null;
+
+ return (
+
+ {groups.map(([dimension, items]) => (
+
+
+
+
+ Whole run
+
+ {observationDimensionLabel(dimension)}
+
+
+
+ {items.map(({ result, criterion }) => (
+
+
+ {result.criterionId}
+
+ {result.evaluated ? (
+ result.passed ? :
+ ) : (
+
+ )}
+ {result.evaluated ? (result.passed ? "True" : "False") : "Not evaluated"}
+
+
+ {criterion?.prompt && (
+
{criterion.prompt}
+ )}
+
+
Evidence
+
{result.feedback || "No evidence provided."}
+
+
+ ))}
+
+
+ ))}
+
+ );
+}
+
export function RunDetail() {
const { id, tab } = useParams<{ id: string; tab?: string }>();
const navigate = useNavigate();
@@ -403,7 +477,9 @@ export function RunDetail() {
enabled: !!taskPromptId,
});
- const hasObservationResults = (activeRun?.turns ?? []).some((turn) => (turn.observationResults?.length ?? 0) > 0);
+ const hasObservationResults =
+ (activeRun?.turns ?? []).some((turn) => (turn.observationResults?.length ?? 0) > 0) ||
+ (activeRun?.observationResults?.length ?? 0) > 0;
const hasConfiguredObservations = (run?.observations?.length ?? 0) > 0;
// Aggregate enrichment status across the whole post-processing DAG so the
// "Enriched" badge waits for pp-taxonomy instead of flipping after pp-atif.
@@ -979,7 +1055,7 @@ export function RunDetail() {
{hasVideoData && Videos ({videoCount}) }
{(hasConfiguredObservations || hasObservationResults) && (
- Taxonomy {hasObservationResults ? `(${activeRun?.turns?.reduce((count, turn) => count + (turn.observationResults?.length ?? 0), 0) ?? 0})` : ""}
+ Taxonomy {hasObservationResults ? `(${((activeRun?.turns?.reduce((count, turn) => count + (turn.observationResults?.length ?? 0), 0) ?? 0) + (activeRun?.observationResults?.length ?? 0))})` : ""}
)}
Logs
@@ -1083,9 +1159,10 @@ export function RunDetail() {
Observations
- Per-iteration boolean observations recorded over the codebase and agent trajectory, grouped by taxonomy dimension. Non-gating — they never steer the agent.
+ Boolean observations recorded over the codebase and agent trajectory, grouped by taxonomy dimension. Non-gating — they never steer the agent.
+
diff --git a/apps/portal/src/types.ts b/apps/portal/src/types.ts
index a7a6b2ec2..5460b6408 100644
--- a/apps/portal/src/types.ts
+++ b/apps/portal/src/types.ts
@@ -29,6 +29,16 @@ export interface ToolCall {
export type CriterionKind = "gate" | "observation";
+/**
+ * Evaluation granularity for a criterion (#1156).
+ * - `iteration` — evaluated on each iteration in isolation (gates are always this).
+ * - `run` — evaluated once against the whole run (final snapshot + merged
+ * trajectory). The default for observations; rejected for gates.
+ */
+export type CriterionSubject = "run" | "iteration";
+
+export const CRITERION_SUBJECTS: readonly CriterionSubject[] = ["run", "iteration"];
+
export const TAXONOMY_ELEMENT_IDS = [
"dimension:idiomatic-use",
"dimension:dependency-currency",
@@ -167,6 +177,14 @@ export interface RunState {
* tracks pp-atif and is kept for backward compatibility.
*/
handlerStatus?: Record;
+ /**
+ * Whole-run observation results — one entry per selected `subject:"run"`
+ * observation criterion, evaluated once against the final snapshot + the
+ * merged trajectory across all iterations (#1156). Per-iteration
+ * (`subject:"iteration"`) observations live on `turn.observationResults`
+ * instead. Empty/absent when no run-subject observations were selected.
+ */
+ observationResults?: CriterionResult[];
}
export interface Run {
@@ -263,6 +281,7 @@ export interface CriteriaConfig {
gates?: GateId[];
kind?: CriterionKind;
taxonomyElementId?: TaxonomyElementId;
+ subject?: CriterionSubject;
}
export interface CriteriaDocument extends CriteriaConfig {
@@ -272,7 +291,7 @@ export interface CriteriaDocument extends CriteriaConfig {
}
export interface CriteriaGraphData {
- nodes: Array<{ id: string; prompt: string; dependsOn: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId }>;
+ nodes: Array<{ id: string; prompt: string; dependsOn: string[]; gates?: GateId[]; kind?: CriterionKind; taxonomyElementId?: TaxonomyElementId; subject?: CriterionSubject }>;
edges: Array<{ source: string; target: string }>;
}
@@ -281,6 +300,7 @@ export interface GeneratePromptResponse {
suggestedId: string;
suggestedParents: string[];
suggestedChildren: string[];
+ suggestedSubject?: CriterionSubject;
}
// Prompt Feature types
From f1b24e9fe8aa4c593bb2379d1e89e74914928ff1 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 19:20:32 -0700
Subject: [PATCH 040/287] =?UTF-8?q?feat(cli):=20subject=20parity=20?=
=?UTF-8?q?=E2=80=94=20--subject=20flag=20+=20whole-run=20observations=20(?=
=?UTF-8?q?#1156)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- yaml-mappers: round-trip subject
- criteria command: --subject on create/update; show subject
in list/get/export/import
- run-get-action: render whole-run run.observationResults block alongside the
per-iteration ones
- updated cli-commands snapshot for --subject
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
.../__snapshots__/cli-commands.test.ts.snap | 2 +
apps/cli/src/commands/criteria.ts | 24 ++++--
apps/cli/src/run-get-action.ts | 75 +++++++++++++------
apps/cli/src/utils/yaml-mappers.ts | 5 +-
4 files changed, 76 insertions(+), 30 deletions(-)
diff --git a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
index f22265fbc..d16e5ad90 100644
--- a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
+++ b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
@@ -133,6 +133,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--id",
"--kind",
"--prompt",
+ "--subject",
"--taxonomy",
"--url",
],
@@ -183,6 +184,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--id",
"--kind",
"--prompt",
+ "--subject",
"--taxonomy",
"--url",
],
diff --git a/apps/cli/src/commands/criteria.ts b/apps/cli/src/commands/criteria.ts
index 7e890f9ac..807b83dcf 100644
--- a/apps/cli/src/commands/criteria.ts
+++ b/apps/cli/src/commands/criteria.ts
@@ -46,7 +46,7 @@ criteria
process.exit(1);
}
- const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string }>;
+ const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string; subject?: string }>;
if (items.length === 0) {
if (!isMachineReadable(format)) console.log(warnBanner("No criteria found."));
return;
@@ -61,6 +61,7 @@ criteria
tableFormatter: (c: any) => value(c.id),
},
{ key: 'kind', label: 'Kind', formatter: (c: any) => c.kind ?? 'gate' },
+ { key: 'subject', label: 'Subject', formatter: (c: any) => c.kind === 'observation' ? (c.subject ?? 'run') : '—' },
{ key: 'dependsOn', label: 'Deps', formatter: (c: any) => String((c.dependsOn ?? []).length) },
{ key: 'gates', label: 'Gates', formatter: (c: any) => formatGateList(c.gates) },
{ key: 'prompt', label: 'Prompt', tableFormatter: (c: any) => {
@@ -97,7 +98,7 @@ criteria
const c = await response.json() as {
id: string; prompt: string; dependsOn?: string[]; gates?: GateId[];
- kind?: string; taxonomyElementId?: string;
+ kind?: string; taxonomyElementId?: string; subject?: string;
dependents: string[]; createdAt: string; updatedAt?: string;
};
@@ -106,6 +107,7 @@ criteria
{ key: 'id', label: 'ID' },
{ key: 'prompt', label: 'Prompt' },
{ key: 'kind', label: 'Kind', formatter: (item: any) => item.kind ?? 'gate' },
+ { key: 'subject', label: 'Subject', formatter: (item: any) => item.kind === 'observation' ? (item.subject ?? 'run') : '(n/a)' },
{ key: 'taxonomyElementId', label: 'Taxonomy', formatter: (item: any) => item.taxonomyElementId ?? '(none)' },
{ key: 'dependsOn', label: 'Depends On', formatter: (item: any) => (item.dependsOn ?? []).join(', ') || '(none)' },
{ key: 'gates', label: 'Gates', formatter: (item: any) => formatGateList(item.gates) },
@@ -129,6 +131,9 @@ criteria
}
console.log(`${label('Gates:')} ${value(formatGateList(c.gates))}`);
console.log(`${label('Kind:')} ${value(c.kind ?? 'gate')}`);
+ if ((c.kind ?? 'gate') === 'observation') {
+ console.log(`${label('Subject:')} ${value(c.subject ?? 'run')}`);
+ }
if (c.taxonomyElementId) {
console.log(`${label('Taxonomy:')} ${value(c.taxonomyElementId)}`);
}
@@ -152,6 +157,7 @@ criteria
.option("--gates ", "Compatible gates (space/comma separated), or all/* for unrestricted")
.option("--kind ", "Criterion kind: gate (default) or observation")
.option("--taxonomy ", "Taxonomy element id (observation only), e.g. dimension:dependency-currency")
+ .option("--subject ", "Evaluation subject (observation only): run (default) or iteration")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.action(async (options) => {
try {
@@ -166,6 +172,7 @@ criteria
if (gates !== undefined) body.gates = gates;
if (options.kind) body.kind = options.kind;
if (options.taxonomy) body.taxonomyElementId = options.taxonomy;
+ if (options.subject) body.subject = options.subject;
const response = await fetch(`${normalizeUrl(options.url)}/api/v1/criteria`, {
method: "POST",
@@ -196,6 +203,7 @@ criteria
.option("--gates ", "New compatible gates (space/comma separated), or all/* for unrestricted")
.option("--kind ", "Criterion kind: gate or observation")
.option("--taxonomy ", "Taxonomy element id (observation only)")
+ .option("--subject ", "Evaluation subject (observation only): run or iteration")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.action(async (options) => {
try {
@@ -206,9 +214,10 @@ criteria
if (gates !== undefined) body.gates = gates;
if (options.kind) body.kind = options.kind;
if (options.taxonomy) body.taxonomyElementId = options.taxonomy;
+ if (options.subject) body.subject = options.subject;
if (Object.keys(body).length === 0) {
- console.error(errorText("Error: provide --prompt, --depends-on, --gates, --kind, and/or --taxonomy"));
+ console.error(errorText("Error: provide --prompt, --depends-on, --gates, --kind, --taxonomy, and/or --subject"));
process.exit(1);
}
@@ -363,7 +372,7 @@ criteria
process.exit(1);
}
- const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string }>;
+ const items = await response.json() as Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string; subject?: string }>;
if (items.length === 0) {
console.error(errorText("No criteria found to export."));
@@ -408,6 +417,9 @@ criteria
if (c.taxonomyElementId) {
doc.taxonomy_element_id = c.taxonomyElementId;
}
+ if (c.subject && c.kind === 'observation') {
+ doc.subject = c.subject;
+ }
return doc;
});
@@ -460,7 +472,7 @@ criteria
}
// Parse all criteria from files (supports multi-document YAML)
- const allCriteria: Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string }> = [];
+ const allCriteria: Array<{ id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string; subject?: string }> = [];
const parseErrors: string[] = [];
for (const file of yamlFiles) {
@@ -505,7 +517,7 @@ criteria
const deps = (c.dependsOn ?? []).length;
const depsStr = deps > 0 ? ` ${dimTimestamp(`(${deps} dep${deps > 1 ? 's' : ''})`)}` : '';
const gatesStr = c.gates ? ` ${dimTimestamp(`[${formatGateList(c.gates)}]`)}` : '';
- const kindStr = c.kind === 'observation' ? ` ${dimTimestamp(``)}` : '';
+ const kindStr = c.kind === 'observation' ? ` ${dimTimestamp(``)}` : '';
console.log(` ${value(c.id)}${depsStr}${gatesStr}${kindStr}`);
}
diff --git a/apps/cli/src/run-get-action.ts b/apps/cli/src/run-get-action.ts
index e2a9c9a8b..f98907990 100644
--- a/apps/cli/src/run-get-action.ts
+++ b/apps/cli/src/run-get-action.ts
@@ -173,8 +173,11 @@ export async function runGetAction(options: RunGetOptions): Promise {
}
// Observations (kind:"observation" criteria), grouped by taxonomy dimension.
+ // Whole-run (subject:"run") results live at run level; per-iteration
+ // (subject:"iteration") results live on each turn.
+ const runObs = rs?.observationResults ?? [];
const turnsWithObs = (rs?.turns ?? []).filter((t) => (t.observationResults?.length ?? 0) > 0);
- if (turnsWithObs.length > 0) {
+ if (runObs.length > 0 || turnsWithObs.length > 0) {
// Build criterionId → taxonomyElementId map from the criteria store (best effort).
const taxById = new Map();
try {
@@ -185,32 +188,58 @@ export async function runGetAction(options: RunGetOptions): Promise {
}
} catch { /* grouping is best-effort */ }
- // detected/evaluated tally per criterion id across iterations.
- const tally = new Map();
- for (const t of turnsWithObs) {
- for (const r of t.observationResults ?? []) {
- const e = tally.get(r.criterionId) ?? { detected: 0, evaluated: 0 };
- e.evaluated += 1;
- if (r.passed) e.detected += 1;
- tally.set(r.criterionId, e);
+ const dimLabelOf = (dim: string) =>
+ dim === "unclassified" ? "Unclassified" : (TAXONOMY_ELEMENT_METADATA[dim as TaxonomyElementId]?.label ?? dim);
+
+ console.log(`\n${banner('─── Observations ───')}`);
+
+ // Whole-run observations: one verdict + evidence per criterion.
+ if (runObs.length > 0) {
+ const byDimRun = new Map();
+ for (const r of runObs) {
+ const dim = taxById.get(r.criterionId) ?? "unclassified";
+ const arr = byDimRun.get(dim) ?? [];
+ arr.push(r);
+ byDimRun.set(dim, arr);
+ }
+ console.log(` ${label('Whole run')}`);
+ for (const [dim, results] of byDimRun) {
+ console.log(` ${label(dimLabelOf(dim))}`);
+ for (const r of results.sort((a, b) => a.criterionId.localeCompare(b.criterionId))) {
+ const verdict = r.evaluated ? (r.passed ? successText('true') : errorText('false')) : warnBanner('not evaluated');
+ console.log(` ${value(r.criterionId)} — ${verdict}`);
+ if (r.feedback) console.log(` ${dimTimestamp(r.feedback.replace(/\n/g, ' ').slice(0, 200))}`);
+ }
}
}
- const byDim = new Map();
- for (const id of tally.keys()) {
- const dim = taxById.get(id) ?? "unclassified";
- const arr = byDim.get(dim) ?? [];
- arr.push(id);
- byDim.set(dim, arr);
- }
+ // Per-iteration observations: detected/evaluated tally per criterion id.
+ if (turnsWithObs.length > 0) {
+ const tally = new Map();
+ for (const t of turnsWithObs) {
+ for (const r of t.observationResults ?? []) {
+ const e = tally.get(r.criterionId) ?? { detected: 0, evaluated: 0 };
+ e.evaluated += 1;
+ if (r.passed) e.detected += 1;
+ tally.set(r.criterionId, e);
+ }
+ }
- console.log(`\n${banner('─── Observations ───')}`);
- for (const [dim, ids] of byDim) {
- const dimLabel = dim === "unclassified" ? "Unclassified" : (TAXONOMY_ELEMENT_METADATA[dim as TaxonomyElementId]?.label ?? dim);
- console.log(` ${label(dimLabel)}`);
- for (const id of ids.sort()) {
- const { detected, evaluated } = tally.get(id)!;
- console.log(` ${value(id)} — ${detected}/${evaluated} iterations detected`);
+ const byDim = new Map();
+ for (const id of tally.keys()) {
+ const dim = taxById.get(id) ?? "unclassified";
+ const arr = byDim.get(dim) ?? [];
+ arr.push(id);
+ byDim.set(dim, arr);
+ }
+
+ console.log(` ${label('Per iteration')}`);
+ for (const [dim, ids] of byDim) {
+ console.log(` ${label(dimLabelOf(dim))}`);
+ for (const id of ids.sort()) {
+ const { detected, evaluated } = tally.get(id)!;
+ console.log(` ${value(id)} — ${detected}/${evaluated} iterations detected`);
+ }
}
}
}
diff --git a/apps/cli/src/utils/yaml-mappers.ts b/apps/cli/src/utils/yaml-mappers.ts
index cad0c23dd..315f18c82 100644
--- a/apps/cli/src/utils/yaml-mappers.ts
+++ b/apps/cli/src/utils/yaml-mappers.ts
@@ -12,7 +12,7 @@ export function mapYamlCriterion(
filename: string,
_docIndex: number,
options: { includeGates?: boolean } = {},
-): { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string } | null {
+): { id: string; prompt: string; dependsOn?: string[]; gates?: GateId[]; kind?: string; taxonomyElementId?: string; subject?: string } | null {
const id = doc.id as string | undefined;
const prompt = doc.prompt as string | undefined;
if (!id || !prompt) return null;
@@ -28,6 +28,8 @@ export function mapYamlCriterion(
const kind = kindRaw ? String(kindRaw).trim() : undefined;
const taxRaw = (doc.taxonomy_element_id ?? doc.taxonomyElementId) as string | undefined;
const taxonomyElementId = taxRaw ? String(taxRaw).trim() : undefined;
+ const subjectRaw = doc.subject as string | undefined;
+ const subject = subjectRaw ? String(subjectRaw).trim() : undefined;
return {
id: id.trim(),
@@ -36,6 +38,7 @@ export function mapYamlCriterion(
...(gates !== undefined ? { gates } : {}),
...(kind ? { kind } : {}),
...(taxonomyElementId ? { taxonomyElementId } : {}),
+ ...(subject ? { subject } : {}),
};
}
From a7cfe9b3a6f46a6a4d075be033ed710b8bac89e3 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Mon, 29 Jun 2026 19:21:11 -0700
Subject: [PATCH 041/287] docs: criterion subject (run|iteration) + run-level
observations (#1156)
Document the new subject discriminator, the kind-dependent default and gate
restriction, run-level run.observationResults storage, and the merged
whole-run trajectory evaluation across post-processing.md, app-design.md,
criteria-provider.md, and overview.md.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
docs/architecture/app-design.md | 7 ++---
docs/architecture/criteria-provider.md | 7 +++++
docs/architecture/overview.md | 2 +-
docs/architecture/post-processing.md | 37 ++++++++++++++++++++------
4 files changed, 41 insertions(+), 12 deletions(-)
diff --git a/docs/architecture/app-design.md b/docs/architecture/app-design.md
index 6f1b528a7..ae557aa14 100644
--- a/docs/architecture/app-design.md
+++ b/docs/architecture/app-design.md
@@ -146,11 +146,12 @@ Criteria are reusable evaluation rules stored in the database and optionally def
- **AI-generated prompts** — natural language behavior descriptions can be converted to evaluation prompts via LLM
- **Traits** — reusable labels for filtering and composition (e.g., `has_azure`, `has_node`)
- **Gate compatibility** — a `gates: GateId[]` list controls which [gates](#gates--multi-phase-evaluation-pipeline) a criterion may be selected for (empty = all); the list is downward-closed along the DAG
-- **Criterion kind** — `kind: "gate" | "observation"` distinguishes criteria that gate the agent from record-only observations. Observation criteria can optionally set `taxonomyElementId` to one of the hard-coded observation dimensions; run detail derives dimension grouping by joining each per-turn `observationResults[].criterionId` back to the criterion metadata.
-- **Kind** — `kind: "gate" | "observation"` (default `gate`). **Gate** criteria steer the coding agent through the gate DAG. **Observation** criteria (issue #1156) are record-only: they produce a boolean + evidence per iteration, never feed back to the agent, never pass/fail a gate, and never enter the gate DAG. Dependencies may only reference same-kind criteria.
+- **Criterion kind** — `kind: "gate" | "observation"` distinguishes criteria that gate the agent from record-only observations. Observation criteria can optionally set `taxonomyElementId` to one of the hard-coded observation dimensions and a `subject` (`run`|`iteration`) that selects whole-run vs per-iteration evaluation; run detail derives dimension grouping by joining each `observationResults[].criterionId` (per-turn or run-level) back to the criterion metadata.
+- **Kind** — `kind: "gate" | "observation"` (default `gate`). **Gate** criteria steer the coding agent through the gate DAG. **Observation** criteria (issue #1156) are record-only: they produce a boolean + evidence, never feed back to the agent, never pass/fail a gate, and never enter the gate DAG. Dependencies may only reference same-kind criteria.
- **Taxonomy classification** — observation criteria carry an optional `taxonomyElementId` from a hard-coded enum of the three R&A Readout quality dimensions (`dimension:idiomatic-use`, `dimension:dependency-currency`, `dimension:configuration-correctness`). Classification is static/design-time, not per-run.
+- **Evaluation subject** — `subject: "run" | "iteration"` decides the evaluation granularity of an observation. **`run`** (the default for observations) is evaluated **once** against the final snapshot + the merged trajectory across all iterations and stored at run level (`run.observationResults`); **`iteration`** is evaluated per turn and stored on each turn (`turn.observationResults`). Gate criteria are always `iteration` (the API rejects `run` for gates); `subject` is honored only by the `pp-taxonomy` pipeline. The AI authoring assistant auto-detects the subject and the user can override it.
-Observation evaluation happens off the coding-agent critical path in the `pp-taxonomy` post-processor (see [post-processing](post-processing.md)). A run carries the chosen `observations: string[]` (observation-criteria ids); each evaluated turn stores `observationResults: CriterionResult[]` (same shape as gate `criteriaResults`). Dimension grouping is derived at read time by joining `criterionId` → criterion `taxonomyElementId`.
+Observation evaluation happens off the coding-agent critical path in the `pp-taxonomy` post-processor (see [post-processing](post-processing.md)). A run carries the chosen `observations: string[]` (observation-criteria ids); **iteration-subject** results are stored per turn as `turn.observationResults: CriterionResult[]`, while **run-subject** results are stored once at run level as `run.observationResults: CriterionResult[]` (both the same shape as gate `criteriaResults`). Dimension grouping is derived at read time by joining `criterionId` → criterion `taxonomyElementId`.
See [`ENV_VARIABLES.md`](../../scope-mt-app/ENV_VARIABLES.md) for related configuration options.
diff --git a/docs/architecture/criteria-provider.md b/docs/architecture/criteria-provider.md
index 08e623fbb..28ded0e43 100644
--- a/docs/architecture/criteria-provider.md
+++ b/docs/architecture/criteria-provider.md
@@ -164,6 +164,13 @@ bypassed or drift between callers:
criteria of the same `kind`. This keeps the gate DAG closed under
`resolveWithAncestors` (observations never leak into a gate's evaluation set) and
lets `kind:"observation"` criteria form their own optional dependency chains.
+- **Kind-dependent `subject` default + validation** — observation criteria carry a
+ `subject: "run" | "iteration"` deciding whole-run vs per-iteration evaluation. When
+ `subject` is omitted the store applies a **kind-dependent default** (not a flat zod
+ default): `kind:"observation"` ⇒ `"run"`, `kind:"gate"`/legacy ⇒ `"iteration"`. Gate
+ criteria are rejected if `subject:"run"` is supplied — `"iteration"` is their only legal
+ value. The field is threaded through `create`/`update`/`find` and both provider backends
+ so the `pp-taxonomy` worker and the CLI/Portal can read it.
- **Referential integrity on delete** — deleting a criterion that still has
dependents is rejected.
diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md
index ea118f342..d7db0f416 100644
--- a/docs/architecture/overview.md
+++ b/docs/architecture/overview.md
@@ -80,7 +80,7 @@ flowchart TB
| `workers/coder-acp-claude-code` | Claude Code agent via Agent Client Protocol (ACP) |
| `workers/coder-acp-copilot` | GitHub Copilot agent via Agent Client Protocol (ACP) |
| `workers/report-generator` | Copilot SDK worker that generates post-run markdown reports |
-| `workers/post-processor` | DAG-based post-run handlers: `pp-atif` (trajectory ATIF) and `pp-taxonomy` (per-iteration boolean observations via the judge) |
+| `workers/post-processor` | DAG-based post-run handlers: `pp-atif` (trajectory ATIF) and `pp-taxonomy` (boolean observations via the judge, per-iteration or whole-run by criterion `subject`) |
| `gateway` | AI Gateway — shared Rust TLS-intercepting proxy with plugin architecture (HAR capture, future: token refresh, rate limiting) |
## Data Flow
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index baeed6e44..1ec97444b 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -58,18 +58,39 @@ The `iteration` query parameter is mandatory for the ATIF endpoints. ATIF files
## Taxonomy Observations (`pp-taxonomy`)
-The `pp-taxonomy` handler records **observation criteria** — per-iteration boolean
-outcomes + evidence about the codebase and the agent's trajectory, **without gating
-or steering** the coding agent (issue #1156). It is a DAG node `dependsOn: [pp-atif]`,
-because some observations are only derivable from the trajectory (ATIF), not the
-final snapshot.
+The `pp-taxonomy` handler records **observation criteria** — boolean outcomes +
+evidence about the codebase and the agent's trajectory, **without gating or steering**
+the coding agent (issue #1156). It is a DAG node `dependsOn: [pp-atif]`, because some
+observations are only derivable from the trajectory (ATIF), not the final snapshot.
+
+### Evaluation subject (`run` vs `iteration`)
+
+Each observation criterion carries a **`subject: "run" | "iteration"`** that decides
+*how* and *where* it is evaluated:
+
+- **`subject: "iteration"`** — evaluated on **each iteration in isolation**; the verdict is
+ stored on that turn (`turn.observationResults`).
+- **`subject: "run"`** (the default for observations) — evaluated **once** against the
+ **whole run**: the final iteration's `snapshotUrl` + the **merged trajectory** (every
+ turn's ATIF concatenated, tool definitions unioned) + the full conversation history. The
+ single verdict is stored at **run level** (`run.observationResults`). This is what makes
+ cross-iteration observations correct — e.g. `dependency_added_then_removed`, where a
+ package is installed in one iteration and removed in a later one, is invisible to any
+ single-iteration evaluation but clearly `true` across the merged trajectory.
+
+Gate criteria are always `subject: "iteration"` (the API rejects `"run"` for gates);
+`subject` is honored only by this handler.
### Flow
1. Reads the run's `observations: string[]` (observation-criteria ids chosen at submit). Empty/absent ⇒ no-op, handler `done`.
-2. For each iteration with a `snapshotUrl`, calls the existing judge via the shared `JudgeClient` (`POST /api/v1/evaluate`) with `snapshotUrl` + `atifUrl` + the observation-criteria ids — no persona, no gate, no taxonomyElementId (the classifier lives on the criterion). ATIF supersedes per-turn `toolCallsUrl`, so only ATIF is sent.
-3. Writes the returned per-criterion `{criterionId, passed, feedback}` to that turn's **`observationResults`** — same shape/storage as gate `criteriaResults`. No new blob, no `run.taxonomyUrl`.
-4. Stamps `run.handlerStatus["pp-taxonomy"] = { status: "done", version: N }` and notifies the scheduler.
+2. Resolves each selected criterion's `subject` and splits them into **iteration-subject** and **run-subject** buckets.
+3. **Iteration-subject:** for each iteration with a `snapshotUrl`, calls the existing judge via the shared `JudgeClient` (`POST /api/v1/evaluate`) with `snapshotUrl` + `atifUrl` + the iteration-subject ids. Writes the returned `{criterionId, passed, feedback}` to that turn's **`turn.observationResults`**.
+4. **Run-subject:** evaluates **once** with `snapshotUrl` = final turn's snapshot, `atifUrls` = every turn's `atifUrl` (the judge downloads + merges them into one `AgentTrajectory`), and the full `conversationHistory`. Writes the verdicts to **`run.observationResults`** (run level).
+ - In all judge calls there is no persona, no gate, no taxonomyElementId (the classifier lives on the criterion). ATIF supersedes per-turn `toolCallsUrl`, so only ATIF is sent.
+ - Result shape/storage mirrors gate `criteriaResults`. No new blob, no `run.taxonomyUrl`.
+ - **Runs exactly once per run:** the scheduler dispatches `pp-taxonomy` a single time (it never sets `message.iteration`), so the run-subject branch needs no idempotency guard.
+5. Stamps `run.handlerStatus["pp-taxonomy"] = { status: "done", version: N }` and notifies the scheduler.
Dimension grouping is **derived at read time** by joining each result's `criterionId` → criterion `taxonomyElementId` (the three R&A Readout dimensions; unset = unclassified). It never feeds back to the agent and never affects pass/fail. (#1053 later extends this worker with a richer scorecard artifact.)
From 688fbb52ca9f1473c8ac29bb133a199c840a5770 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 11:46:05 -0700
Subject: [PATCH 042/287] fix(scheduler): allow autoBackfill to re-dispatch
runs with outdated versions
The autoBackfill feature re-processes historical runs when a handler version
bumps, enabling backfill of new/updated post-processing features across the
whole dataset. However, buildDispatchFilter() was excluding 'done' status
universally, preventing the version-check branch ($lt version) from matching
any historical runs.
This change makes status exclusions conditional:
- autoBackfill handlers exclude only ['queued', 'processing'], allowing
done runs to qualify for version-based re-dispatch
- Non-backfill handlers still exclude 'done' (only dispatch on missing
handler status)
Fixes regression identified in #1147 code review.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
apps/scheduler/src/handler-dispatcher.test.ts | 34 +++++++++++++++++++
apps/scheduler/src/handler-dispatcher.ts | 6 +++-
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/apps/scheduler/src/handler-dispatcher.test.ts b/apps/scheduler/src/handler-dispatcher.test.ts
index 67264d02c..53d652061 100644
--- a/apps/scheduler/src/handler-dispatcher.test.ts
+++ b/apps/scheduler/src/handler-dispatcher.test.ts
@@ -249,3 +249,37 @@ describe("HandlerDispatcher — maybeTriggerReports", () => {
expect(fetchMock).not.toHaveBeenCalled();
});
});
+
+describe("HandlerDispatcher — buildDispatchFilter", () => {
+ let collection: ReturnType;
+
+ beforeEach(() => {
+ collection = createMockCollection();
+ });
+
+ it("allows done runs to be considered for autoBackfill version bumps", () => {
+ const d = makeDispatcher(collection) as any;
+ const autoBackfillHandler = HANDLERS[0];
+
+ const filter = d.buildDispatchFilter(autoBackfillHandler, HANDLERS, d.buildGraph(HANDLERS));
+
+ expect(filter[`run.handlerStatus.${autoBackfillHandler._id}.status`]).toEqual({
+ $nin: ["queued", "processing"],
+ });
+ expect(filter.$or).toEqual([
+ { [`run.handlerStatus.${autoBackfillHandler._id}.version`]: { $exists: false } },
+ { [`run.handlerStatus.${autoBackfillHandler._id}.version`]: { $lt: autoBackfillHandler.version } },
+ ]);
+ });
+
+ it("keeps done runs excluded for non-backfill handlers", () => {
+ const d = makeDispatcher(collection) as any;
+ const noBackfillHandler = HANDLERS[1];
+
+ const filter = d.buildDispatchFilter(noBackfillHandler, HANDLERS, d.buildGraph(HANDLERS));
+
+ expect(filter[`run.handlerStatus.${noBackfillHandler._id}.status`]).toEqual({
+ $nin: ["queued", "processing", "done"],
+ });
+ });
+});
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index 615a45e3d..1dcbe878b 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -400,10 +400,14 @@ export class HandlerDispatcher implements NotifyHandler {
allHandlers: HandlerServiceDocument[],
_graph: DependencyGraph,
): Record | null {
+ const statusExclusions = handler.autoBackfill
+ ? ["queued", "processing"]
+ : ["queued", "processing", "done"];
+
const filter: Record = {
"run.status": "done",
deletedAt: { $exists: false },
- [`run.handlerStatus.${handler._id}.status`]: { $nin: ["queued", "processing", "done"] },
+ [`run.handlerStatus.${handler._id}.status`]: { $nin: statusExclusions },
};
// All dependencies must be "done"
From 7288b65dd928a4dcad0a114cfaed2ca7d87622ab Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 13:32:05 -0700
Subject: [PATCH 043/287] fix(scheduler): ignore stale handler completion
notifications
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
apps/scheduler/src/handler-dispatcher.test.ts | 44 ++++++++++++++++++-
apps/scheduler/src/handler-dispatcher.ts | 15 +++++--
2 files changed, 55 insertions(+), 4 deletions(-)
diff --git a/apps/scheduler/src/handler-dispatcher.test.ts b/apps/scheduler/src/handler-dispatcher.test.ts
index 53d652061..3adf8fb76 100644
--- a/apps/scheduler/src/handler-dispatcher.test.ts
+++ b/apps/scheduler/src/handler-dispatcher.test.ts
@@ -30,7 +30,7 @@ function createMockCollection() {
return {
findOne: vi.fn(),
findOneAndUpdate: vi.fn(),
- updateOne: vi.fn().mockResolvedValue(undefined),
+ updateOne: vi.fn().mockResolvedValue({ matchedCount: 1 }),
find: vi.fn(),
} as any;
}
@@ -250,6 +250,48 @@ describe("HandlerDispatcher — maybeTriggerReports", () => {
});
});
+describe("HandlerDispatcher — onHandlerComplete", () => {
+ let collection: ReturnType;
+
+ beforeEach(() => {
+ collection = createMockCollection();
+ });
+
+ it("only accepts completion when current handler status is processing", async () => {
+ const d = makeDispatcher(collection) as any;
+ const maybeTriggerReportsSpy = vi
+ .spyOn(d, "maybeTriggerReports")
+ .mockResolvedValue(undefined);
+
+ await d.onHandlerComplete("req-1", "run-1", "pp-atif", "failed");
+
+ expect(collection.updateOne).toHaveBeenCalledWith(
+ { _id: "req-1", "run.handlerStatus.pp-atif.status": "processing" },
+ {
+ $set: {
+ "run.handlerStatus.pp-atif.status": "failed",
+ "run.handlerStatus.pp-atif.updatedAt": expect.any(Date),
+ },
+ },
+ );
+ expect(maybeTriggerReportsSpy).toHaveBeenCalledWith("req-1", "run-1");
+ });
+
+ it("ignores stale or duplicate completion notifications", async () => {
+ collection.updateOne.mockResolvedValue({ matchedCount: 0 });
+ const d = makeDispatcher(collection) as any;
+ const maybeTriggerReportsSpy = vi
+ .spyOn(d, "maybeTriggerReports")
+ .mockResolvedValue(undefined);
+ const loadHandlersSpy = vi.spyOn(d, "loadHandlers");
+
+ await d.onHandlerComplete("req-1", "run-1", "pp-atif", "done");
+
+ expect(maybeTriggerReportsSpy).not.toHaveBeenCalled();
+ expect(loadHandlersSpy).not.toHaveBeenCalled();
+ });
+});
+
describe("HandlerDispatcher — buildDispatchFilter", () => {
let collection: ReturnType;
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index 1dcbe878b..c7b99b148 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -89,9 +89,11 @@ export class HandlerDispatcher implements NotifyHandler {
`[HandlerDispatcher] Notify: handler-complete ${handlerId} for ${requestId} (status=${status})`,
);
- // Update the handler status on the run document
- await this.collection.updateOne(
- { _id: requestId } as any,
+ // Only apply terminal status from an active in-flight execution.
+ // This avoids stale/duplicate notifies regressing a newly re-dispatched
+ // handler back to "done" or "failed".
+ const updateResult = await this.collection.updateOne(
+ { _id: requestId, [`run.handlerStatus.${handlerId}.status`]: "processing" } as any,
{
$set: {
[`run.handlerStatus.${handlerId}.status`]: status,
@@ -100,6 +102,13 @@ export class HandlerDispatcher implements NotifyHandler {
} as any,
);
+ if (updateResult.matchedCount === 0) {
+ console.log(
+ `[HandlerDispatcher] Ignored stale/duplicate completion for ${handlerId} on ${requestId}`,
+ );
+ return;
+ }
+
if (status === "failed") {
// Don't dispatch downstream on failure, but the failure may have drained
// the DAG (descendants are now permanently blocked) — check for reports.
From 5c64dea4d76a13519a6dfb00dfefae63a1debbd0 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 14:19:12 -0700
Subject: [PATCH 044/287] fix(post-processing): enforce worker-entrypoint
idempotency
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
apps/scheduler/src/handler-dispatcher.test.ts | 87 +++++++++
apps/scheduler/src/handler-dispatcher.ts | 86 ++++----
.../src/handlers/atif-handler.ts | 3 +
.../post-processor/src/post-processor.test.ts | 184 ++++++++++++++++++
.../post-processor/src/post-processor.ts | 139 ++++++++++---
apps/workers/post-processor/src/types.ts | 2 +
docs/architecture/post-processing.md | 21 +-
7 files changed, 449 insertions(+), 73 deletions(-)
create mode 100644 apps/workers/post-processor/src/post-processor.test.ts
diff --git a/apps/scheduler/src/handler-dispatcher.test.ts b/apps/scheduler/src/handler-dispatcher.test.ts
index 3adf8fb76..9431be37b 100644
--- a/apps/scheduler/src/handler-dispatcher.test.ts
+++ b/apps/scheduler/src/handler-dispatcher.test.ts
@@ -54,6 +54,21 @@ function makeDispatcher(
return new HandlerDispatcher(collection, db, createQueueClient, 60_000, 30, apiUrl);
}
+function makeDispatcherWithQueue(
+ collection: any,
+ handlers: HandlerServiceDocument[] = HANDLERS,
+ apiUrl = "http://api.test",
+) {
+ const db = createMockDb(handlers);
+ const queueClient = {
+ createIfNotExists: vi.fn().mockResolvedValue(undefined),
+ sendMessage: vi.fn().mockResolvedValue(undefined),
+ };
+ const createQueueClient = vi.fn().mockReturnValue(queueClient);
+ const dispatcher = new HandlerDispatcher(collection, db, createQueueClient, 60_000, 30, apiUrl);
+ return { dispatcher, queueClient, createQueueClient };
+}
+
describe("HandlerDispatcher — drain detection", () => {
let collection: ReturnType;
@@ -324,4 +339,76 @@ describe("HandlerDispatcher — buildDispatchFilter", () => {
$nin: ["queued", "processing", "done"],
});
});
+
+ describe("HandlerDispatcher — dispatchIfEligible", () => {
+ let collection: ReturnType;
+
+ beforeEach(() => {
+ collection = createMockCollection();
+ });
+
+ it("allows autoBackfill re-dispatch for outdated done versions", async () => {
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: {
+ _id: "run-1",
+ status: "done",
+ handlerStatus: {
+ "pp-atif": { status: "done", version: 0 },
+ },
+ },
+ });
+ collection.updateOne.mockResolvedValue({ matchedCount: 1 });
+
+ const { dispatcher, queueClient } = makeDispatcherWithQueue(collection);
+ await (dispatcher as any).dispatchIfEligible(
+ "req-1",
+ "run-1",
+ HANDLERS[0],
+ (dispatcher as any).buildGraph(HANDLERS),
+ HANDLERS,
+ );
+
+ expect(queueClient.sendMessage).toHaveBeenCalledTimes(1);
+ expect(collection.updateOne).toHaveBeenCalledWith(
+ expect.objectContaining({
+ _id: "req-1",
+ "run._id": "run-1",
+ "run.status": "done",
+ "run.handlerStatus.pp-atif.status": { $nin: ["queued", "processing"] },
+ $or: [
+ { "run.handlerStatus.pp-atif.version": { $exists: false } },
+ { "run.handlerStatus.pp-atif.version": { $lt: 1 } },
+ ],
+ }),
+ {
+ $set: {
+ "run.handlerStatus.pp-atif.status": "queued",
+ "run.handlerStatus.pp-atif.updatedAt": expect.any(Date),
+ },
+ },
+ );
+ });
+
+ it("enqueues before marking the handler queued", async () => {
+ collection.findOne.mockResolvedValue({
+ _id: "req-1",
+ run: { _id: "run-1", status: "done", handlerStatus: {} },
+ });
+ collection.updateOne.mockResolvedValue({ matchedCount: 1 });
+
+ const { dispatcher, queueClient } = makeDispatcherWithQueue(collection);
+ await (dispatcher as any).dispatchIfEligible(
+ "req-1",
+ "run-1",
+ HANDLERS[0],
+ (dispatcher as any).buildGraph(HANDLERS),
+ HANDLERS,
+ );
+
+ expect(queueClient.sendMessage.mock.invocationCallOrder[0]).toBeLessThan(
+ collection.updateOne.mock.invocationCallOrder[0],
+ );
+ });
+ });
});
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index c7b99b148..92a9752bc 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -288,26 +288,21 @@ export class HandlerDispatcher implements NotifyHandler {
const graph = this.buildGraph(handlers);
for (const handler of handlers) {
- // Find runs that need this handler dispatched
- for (let i = 0; i < this.batchSize; i++) {
- const filter = this.buildDispatchFilter(handler, handlers, graph);
- if (!filter) break;
-
- const claimed = await this.collection.findOneAndUpdate(
- filter as any,
- {
- $set: {
- [`run.handlerStatus.${handler._id}.status`]: "queued",
- [`run.handlerStatus.${handler._id}.updatedAt`]: new Date(),
- },
- } as any,
- { sort: { updatedAt: -1 }, returnDocument: "after" },
- );
-
- if (!claimed) break;
-
- await this.enqueueToHandler(handler, claimed._id, (claimed as any).run?._id);
- console.log(`[HandlerDispatcher] Poll-dispatched ${handler._id} for ${claimed._id}`);
+ const filter = this.buildDispatchFilter(handler, handlers, graph);
+ if (!filter) continue;
+
+ const candidates = await this.collection
+ .find(filter as any, {
+ projection: { _id: 1, "run._id": 1 },
+ sort: { updatedAt: -1 },
+ limit: this.batchSize,
+ })
+ .toArray();
+
+ for (const candidate of candidates) {
+ const runId = (candidate as any).run?._id as string | undefined;
+ if (!runId) continue;
+ await this.dispatchIfEligible(candidate._id, runId, handler, graph, handlers);
}
}
}
@@ -347,7 +342,7 @@ export class HandlerDispatcher implements NotifyHandler {
private async dispatchIfEligible(
requestId: string,
- _runId: string,
+ runId: string,
handler: HandlerServiceDocument,
graph: DependencyGraph,
allHandlers: HandlerServiceDocument[],
@@ -355,6 +350,7 @@ export class HandlerDispatcher implements NotifyHandler {
// Check if all dependencies are satisfied for this request
const doc = await this.collection.findOne({ _id: requestId } as any);
if (!doc?.run || doc.run.status !== "done") return;
+ if (doc.run._id !== runId) return;
const handlerStatus = (doc.run as any).handlerStatus as
| Record
@@ -368,24 +364,34 @@ export class HandlerDispatcher implements NotifyHandler {
}
}
- // Check this handler hasn't already been dispatched
+ // Check whether this handler still needs work.
const currentStatus = handlerStatus?.[handler._id]?.status;
- if (currentStatus === "queued" || currentStatus === "processing" || currentStatus === "done") {
+ const currentVersion = handlerStatus?.[handler._id]?.version;
+ const statusExclusions = handler.autoBackfill
+ ? ["queued", "processing"]
+ : ["queued", "processing", "done"];
+
+ if (currentStatus && statusExclusions.includes(currentStatus)) {
return;
}
- // Check version — skip if already at current version
- const currentVersion = handlerStatus?.[handler._id]?.version;
- if (currentVersion !== undefined && currentVersion >= handler.version && !handler.autoBackfill) {
+ if (handler.autoBackfill) {
+ if (currentVersion !== undefined && currentVersion >= handler.version) {
+ return;
+ }
+ } else if (currentVersion !== undefined) {
return;
}
- // Atomic claim
- const claimed = await this.collection.findOneAndUpdate(
+ const enqueued = await this.enqueueToHandler(handler, requestId, runId);
+ if (!enqueued) return;
+
+ const queueMarkFilter = this.buildDispatchFilter(handler, allHandlers, graph);
+ const queueMarkResult = await this.collection.updateOne(
{
_id: requestId,
- "run.status": "done",
- [`run.handlerStatus.${handler._id}.status`]: { $nin: ["queued", "processing"] },
+ "run._id": runId,
+ ...(queueMarkFilter ?? {}),
} as any,
{
$set: {
@@ -393,12 +399,15 @@ export class HandlerDispatcher implements NotifyHandler {
[`run.handlerStatus.${handler._id}.updatedAt`]: new Date(),
},
} as any,
- { returnDocument: "after" },
);
- if (!claimed) return;
+ if ((queueMarkResult.matchedCount ?? 0) === 0) {
+ console.log(
+ `[HandlerDispatcher] ${handler._id} for ${requestId} advanced concurrently after enqueue; leaving queue message to worker idempotency guard`,
+ );
+ return;
+ }
- await this.enqueueToHandler(handler, requestId, (claimed as any).run?._id);
console.log(`[HandlerDispatcher] Dispatched ${handler._id} for ${requestId}`);
}
@@ -444,7 +453,7 @@ export class HandlerDispatcher implements NotifyHandler {
handler: HandlerServiceDocument,
requestId: string,
runId: string,
- ): Promise {
+ ): Promise {
const queueClient = await this.getOrCreateQueueClient(handler.queue);
const message = Buffer.from(
JSON.stringify({
@@ -456,16 +465,13 @@ export class HandlerDispatcher implements NotifyHandler {
try {
await queueClient.sendMessage(message);
+ return true;
} catch (err) {
- // Roll back status on queue failure
- await this.collection.updateOne(
- { _id: requestId } as any,
- { $unset: { [`run.handlerStatus.${handler._id}.status`]: "" } } as any,
- );
console.error(
- `[HandlerDispatcher] Queue send failed for ${handler._id}/${requestId}, rolled back:`,
+ `[HandlerDispatcher] Queue send failed for ${handler._id}/${requestId}:`,
err,
);
+ return false;
}
}
diff --git a/apps/workers/post-processor/src/handlers/atif-handler.ts b/apps/workers/post-processor/src/handlers/atif-handler.ts
index 5b51e208c..9a28cb604 100644
--- a/apps/workers/post-processor/src/handlers/atif-handler.ts
+++ b/apps/workers/post-processor/src/handlers/atif-handler.ts
@@ -5,6 +5,7 @@ import { writeFile, mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { PostProcessHandler, PostProcessorMessage, HandlerContext } from "../types.js";
+import { POST_PROCESSOR_VERSION } from "../version.js";
/**
* Extracts the blob name (path within the container) from a full blob storage URL.
@@ -30,6 +31,8 @@ function extractBlobName(url: string, container = "snapshots"): string | null {
*/
export class AtifHandler implements PostProcessHandler {
readonly type = "atif";
+ readonly version = POST_PROCESSOR_VERSION;
+ readonly autoBackfill = true;
async process(message: PostProcessorMessage, ctx: HandlerContext): Promise {
const { requestId, runId, iteration } = message;
diff --git a/apps/workers/post-processor/src/post-processor.test.ts b/apps/workers/post-processor/src/post-processor.test.ts
new file mode 100644
index 000000000..e33cccbd3
--- /dev/null
+++ b/apps/workers/post-processor/src/post-processor.test.ts
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { beforeEach, describe, expect, it, vi } from "vitest";
+import type { RequestDocument } from "shared";
+import { PostProcessor } from "./post-processor.js";
+import type { PostProcessHandler, PostProcessorMessage } from "./types.js";
+
+const CONFIG = {
+ mongoUri: "mongodb://localhost:27017",
+ mongoDatabase: "requests-db",
+ mongoCollection: "requests",
+ storageAccountName: "devstoreaccount1",
+ storageConnectionString: "UseDevelopmentStorage=true",
+ queueName: "post-processor-queue",
+ batchSize: 1,
+ pollIntervalMs: 5000,
+ redisHost: "localhost",
+ redisPort: 6379,
+ redisPassword: "",
+};
+
+function makeDoc(overrides: Partial = {}): RequestDocument {
+ return {
+ _id: "req-1",
+ scenario: { task: "task", criteria: [] },
+ workerType: "post-processor",
+ createdAt: new Date(),
+ priority: 0,
+ run: {
+ _id: "run-1",
+ attemptNumber: 1,
+ status: "done",
+ handlerStatus: {},
+ ...overrides,
+ },
+ };
+}
+
+function makeProcessor() {
+ const processor = new PostProcessor(CONFIG);
+ const collection = {
+ findOneAndUpdate: vi.fn(),
+ updateOne: vi.fn(),
+ };
+ const blobStorage = {};
+
+ (processor as any).collection = collection;
+ (processor as any).blobStorage = blobStorage;
+
+ const safeDeleteMessage = vi
+ .spyOn(processor as any, "safeDeleteMessage")
+ .mockResolvedValue(undefined);
+ const notifyHandlerComplete = vi
+ .spyOn(processor as any, "notifyHandlerComplete")
+ .mockResolvedValue(undefined);
+
+ return { processor, collection, blobStorage, safeDeleteMessage, notifyHandlerComplete };
+}
+
+function makeMessage(messageId = "message-1") {
+ return {
+ messageId,
+ popReceipt: "pop-0",
+ } as any;
+}
+
+function makeHeartbeat() {
+ return {
+ popReceipt: "pop-0",
+ stop: vi.fn().mockReturnValue("pop-1"),
+ } as any;
+}
+
+describe("PostProcessor", () => {
+ let handler: PostProcessHandler;
+ let log: ReturnType;
+
+ beforeEach(() => {
+ handler = {
+ type: "atif",
+ version: 1,
+ autoBackfill: true,
+ process: vi.fn().mockResolvedValue(undefined),
+ };
+ log = vi.fn().mockResolvedValue(undefined);
+ });
+
+ it("discards stale messages for an older run attempt", async () => {
+ const { processor, collection, safeDeleteMessage } = makeProcessor();
+ processor.registerHandler(handler);
+
+ const doc = makeDoc({ _id: "run-2" });
+ const heartbeat = makeHeartbeat();
+ const payload: PostProcessorMessage = { type: "atif", requestId: "req-1", runId: "run-1" };
+
+ await (processor as any).handleRequest(doc, makeMessage(), heartbeat, log, payload);
+
+ expect(collection.findOneAndUpdate).not.toHaveBeenCalled();
+ expect(handler.process).not.toHaveBeenCalled();
+ expect(safeDeleteMessage).toHaveBeenCalledWith("message-1", "pop-1");
+ });
+
+ it("no-ops duplicate messages when the handler is already current", async () => {
+ const { processor, collection, safeDeleteMessage, notifyHandlerComplete } = makeProcessor();
+ processor.registerHandler(handler);
+
+ const doc = makeDoc({
+ handlerStatus: {
+ "pp-atif": { status: "done", version: 1, updatedAt: new Date() },
+ },
+ });
+ const heartbeat = makeHeartbeat();
+ const payload: PostProcessorMessage = { type: "atif", requestId: "req-1", runId: "run-1" };
+
+ collection.findOneAndUpdate.mockResolvedValue(null);
+
+ await (processor as any).handleRequest(doc, makeMessage(), heartbeat, log, payload);
+
+ expect(collection.findOneAndUpdate).toHaveBeenCalledWith(
+ expect.objectContaining({
+ _id: "req-1",
+ "run._id": "run-1",
+ "run.status": "done",
+ "run.handlerStatus.pp-atif.status": { $nin: ["queued", "processing"] },
+ $or: [
+ { "run.handlerStatus.pp-atif.version": { $exists: false } },
+ { "run.handlerStatus.pp-atif.version": { $lt: 1 } },
+ ],
+ }),
+ expect.any(Object),
+ expect.objectContaining({ returnDocument: "after" }),
+ );
+ expect(handler.process).not.toHaveBeenCalled();
+ expect(collection.updateOne).not.toHaveBeenCalled();
+ expect(notifyHandlerComplete).not.toHaveBeenCalled();
+ expect(safeDeleteMessage).toHaveBeenCalledWith("message-1", "pop-1");
+ });
+
+ it("re-processes stale versions and stamps success for the same run attempt", async () => {
+ const { processor, collection, safeDeleteMessage, notifyHandlerComplete } = makeProcessor();
+ processor.registerHandler(handler);
+
+ const doc = makeDoc({
+ handlerStatus: {
+ "pp-atif": { status: "done", version: 0, updatedAt: new Date() },
+ },
+ });
+ const heartbeat = makeHeartbeat();
+ const payload: PostProcessorMessage = { type: "atif", requestId: "req-1", runId: "run-1" };
+
+ collection.findOneAndUpdate.mockResolvedValue({ _id: "req-1" });
+ collection.updateOne.mockResolvedValue({ matchedCount: 1 });
+
+ await (processor as any).handleRequest(doc, makeMessage(), heartbeat, log, payload);
+
+ expect(handler.process).toHaveBeenCalledWith(
+ payload,
+ expect.objectContaining({
+ blobStorage: expect.any(Object),
+ collection,
+ log,
+ }),
+ );
+ expect(collection.updateOne).toHaveBeenCalledWith(
+ {
+ _id: "req-1",
+ "run._id": "run-1",
+ "run.handlerStatus.pp-atif.status": "processing",
+ },
+ {
+ $set: expect.objectContaining({
+ "run.postProcessorVersion": 1,
+ "run.postProcessorStatus": "done",
+ "run.handlerStatus.pp-atif.status": "done",
+ "run.handlerStatus.pp-atif.version": 1,
+ "run.handlerStatus.pp-atif.updatedAt": expect.any(Date),
+ }),
+ },
+ );
+ expect(notifyHandlerComplete).toHaveBeenCalledWith("req-1", "run-1", "pp-atif", "done");
+ expect(safeDeleteMessage).toHaveBeenCalledWith("message-1", "pop-1");
+ });
+});
diff --git a/apps/workers/post-processor/src/post-processor.ts b/apps/workers/post-processor/src/post-processor.ts
index 4b1b6e847..32bec7202 100644
--- a/apps/workers/post-processor/src/post-processor.ts
+++ b/apps/workers/post-processor/src/post-processor.ts
@@ -3,24 +3,13 @@
import type { DequeuedMessageItem } from "@azure/storage-queue";
import { BaseQueueProcessor, BlobStorage, type BaseQueueProcessorConfig, type LogEvent, type VisibilityHeartbeat } from "shared";
-import { POST_PROCESSOR_VERSION } from "./version.js";
+import type { RequestDocument, HandlerRunStatus } from "shared";
import type { PostProcessHandler, PostProcessorMessage, HandlerContext } from "./types.js";
export interface PostProcessorConfig extends BaseQueueProcessorConfig {
apiBaseUrl?: string;
}
-interface RequestDocument {
- _id: string;
- run?: {
- _id: string;
- status: string;
- turns?: Array<{ iteration: number; harUrl?: string; atifUrl?: string }>;
- postProcessorVersion?: number;
- postProcessorStatus?: string;
- };
-}
-
/**
* Post-processor worker: extensible queue processor with handler registry.
* Dispatched by the PostProcessorDispatcher in the scheduler when runs
@@ -45,6 +34,43 @@ export class PostProcessor extends BaseQueueProcessor {
console.log(`[post-processor] Registered handler: ${handler.type}`);
}
+ private isPostProcessorMessage(payload: unknown): payload is PostProcessorMessage {
+ return typeof payload === "object" &&
+ payload !== null &&
+ typeof (payload as Record).type === "string" &&
+ typeof (payload as Record).requestId === "string" &&
+ typeof (payload as Record).runId === "string";
+ }
+
+ private buildHandlerClaimFilter(
+ requestId: string,
+ runId: string,
+ handlerId: string,
+ handler: PostProcessHandler,
+ ): Record {
+ const statusExclusions = handler.autoBackfill
+ ? ["queued", "processing"]
+ : ["queued", "processing", "done"];
+
+ const filter: Record = {
+ _id: requestId,
+ "run._id": runId,
+ "run.status": "done",
+ [`run.handlerStatus.${handlerId}.status`]: { $nin: statusExclusions },
+ };
+
+ if (handler.autoBackfill) {
+ filter.$or = [
+ { [`run.handlerStatus.${handlerId}.version`]: { $exists: false } },
+ { [`run.handlerStatus.${handlerId}.version`]: { $lt: handler.version } },
+ ];
+ } else {
+ filter[`run.handlerStatus.${handlerId}.version`] = { $exists: false };
+ }
+
+ return filter;
+ }
+
protected async handleRequest(
doc: RequestDocument,
message: DequeuedMessageItem,
@@ -52,14 +78,14 @@ export class PostProcessor extends BaseQueueProcessor {
log: (level: LogEvent["level"], msg: string, data?: Record) => Promise,
payload?: Record,
): Promise {
- const msg = payload as unknown as PostProcessorMessage;
-
- if (!msg?.type) {
+ if (!this.isPostProcessorMessage(payload)) {
await log("warn", "Message missing 'type' field, discarding");
await this.safeDeleteMessage(message.messageId, heartbeat.stop());
return;
}
+ const msg: PostProcessorMessage = payload;
+
const handler = this.handlers.get(msg.type);
if (!handler) {
await log("warn", `No handler registered for type '${msg.type}', discarding`);
@@ -67,14 +93,45 @@ export class PostProcessor extends BaseQueueProcessor {
return;
}
- // Set status to "processing".
- // Concurrency safety: the Azure Storage Queue guarantees at-most-once delivery
- // via visibility timeout, so only one worker processes a given message at a time.
- await this.collection.updateOne(
- { _id: doc._id } as any,
- { $set: { "run.postProcessorStatus": "processing" } } as any,
+ if (doc.run?._id !== msg.runId) {
+ await log("info", "Stale post-processing message discarded (runId mismatch)", {
+ messageRunId: msg.runId,
+ currentRunId: doc.run?._id,
+ });
+ await this.safeDeleteMessage(message.messageId, heartbeat.stop());
+ return;
+ }
+
+ const handlerId = `pp-${msg.type}`;
+ const currentStatus = doc.run?.handlerStatus?.[handlerId] as HandlerRunStatus | undefined;
+
+ const claim = await this.collection.findOneAndUpdate(
+ this.buildHandlerClaimFilter(doc._id, msg.runId, handlerId, handler) as any,
+ {
+ $set: {
+ "run.postProcessorStatus": "processing",
+ [`run.handlerStatus.${handlerId}.status`]: "processing",
+ [`run.handlerStatus.${handlerId}.updatedAt`]: new Date(),
+ },
+ $unset: {
+ [`run.handlerStatus.${handlerId}.error`]: "",
+ },
+ } as any,
+ { returnDocument: "after" },
);
+ if (!claim) {
+ await log("info", "Post-processing message no longer needed, discarding", {
+ handlerId,
+ runId: msg.runId,
+ currentStatus: currentStatus?.status,
+ currentVersion: currentStatus?.version,
+ targetVersion: handler.version,
+ });
+ await this.safeDeleteMessage(message.messageId, heartbeat.stop());
+ return;
+ }
+
try {
await log("info", `Running handler: ${msg.type}`);
@@ -87,21 +144,33 @@ export class PostProcessor extends BaseQueueProcessor {
await handler.process(msg, ctx);
// Stamp version and status on success (legacy fields + new handlerStatus)
- const handlerId = `pp-${msg.type}`; // e.g., "pp-atif"
- await this.collection.updateOne(
- { _id: doc._id } as any,
+ const successResult = await this.collection.updateOne(
+ {
+ _id: doc._id,
+ "run._id": msg.runId,
+ [`run.handlerStatus.${handlerId}.status`]: "processing",
+ } as any,
{
$set: {
- "run.postProcessorVersion": POST_PROCESSOR_VERSION,
+ "run.postProcessorVersion": handler.version,
"run.postProcessorStatus": "done",
[`run.handlerStatus.${handlerId}.status`]: "done",
- [`run.handlerStatus.${handlerId}.version`]: POST_PROCESSOR_VERSION,
+ [`run.handlerStatus.${handlerId}.version`]: handler.version,
[`run.handlerStatus.${handlerId}.updatedAt`]: new Date(),
},
} as any,
);
- await log("info", `Post-processing complete (v${POST_PROCESSOR_VERSION})`);
+ if ((successResult.matchedCount ?? 0) === 0) {
+ await log("warn", `Handler '${msg.type}' completed after state changed; skipping terminal write`, {
+ handlerId,
+ runId: msg.runId,
+ });
+ await this.safeDeleteMessage(message.messageId, heartbeat.stop());
+ return;
+ }
+
+ await log("info", `Post-processing complete (v${handler.version})`);
// Notify the scheduler that this handler is done (best-effort)
await this.notifyHandlerComplete(doc._id, doc.run?._id ?? "", handlerId, "done");
@@ -110,20 +179,26 @@ export class PostProcessor extends BaseQueueProcessor {
await log("error", `Handler '${msg.type}' failed: ${errMsg}`);
// Mark as failed so scheduler doesn't immediately re-dispatch
- const handlerId = `pp-${msg.type}`;
- await this.collection.updateOne(
- { _id: doc._id } as any,
+ const failureResult = await this.collection.updateOne(
+ {
+ _id: doc._id,
+ "run._id": msg.runId,
+ [`run.handlerStatus.${handlerId}.status`]: "processing",
+ } as any,
{
$set: {
"run.postProcessorStatus": "failed",
[`run.handlerStatus.${handlerId}.status`]: "failed",
[`run.handlerStatus.${handlerId}.updatedAt`]: new Date(),
+ [`run.handlerStatus.${handlerId}.error`]: errMsg,
},
} as any,
);
- // Notify scheduler of failure (best-effort — don't dispatch downstream)
- await this.notifyHandlerComplete(doc._id, doc.run?._id ?? "", handlerId, "failed");
+ if ((failureResult.matchedCount ?? 0) > 0) {
+ // Notify scheduler of failure (best-effort — don't dispatch downstream)
+ await this.notifyHandlerComplete(doc._id, doc.run?._id ?? "", handlerId, "failed");
+ }
throw err;
}
diff --git a/apps/workers/post-processor/src/types.ts b/apps/workers/post-processor/src/types.ts
index 8765dd926..e1ee29669 100644
--- a/apps/workers/post-processor/src/types.ts
+++ b/apps/workers/post-processor/src/types.ts
@@ -22,5 +22,7 @@ export interface HandlerContext {
/** Interface for post-processing handlers (extensibility point). */
export interface PostProcessHandler {
readonly type: string;
+ readonly version: number;
+ readonly autoBackfill: boolean;
process(message: PostProcessorMessage, ctx: HandlerContext): Promise;
}
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index 910812ac0..4407afad0 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -63,6 +63,8 @@ The post-processor uses a registry pattern for extensibility:
```typescript
interface PostProcessHandler {
readonly type: string;
+ readonly version: number;
+ readonly autoBackfill: boolean;
process(message: PostProcessorMessage, ctx: HandlerContext): Promise;
}
@@ -88,6 +90,23 @@ processor.registerHandler(new AtifHandler());
processor.start();
```
+## Idempotency and Dispatch Semantics
+
+Post-processing delivery is treated as **at-least-once**. Queue messages may be duplicated or redelivered, and the scheduler may enqueue a handler message before the corresponding `queued` marker is durably written back to MongoDB.
+
+To keep this safe, idempotency is enforced at the **post-processor worker entrypoint**, not inside each individual handler:
+
+1. The scheduler decides whether work is needed from `run.handlerStatus[handlerId]` + handler metadata (`version`, `autoBackfill`).
+2. The worker re-checks that same eligibility when a message is dequeued, scoped to the specific `runId`.
+3. The worker atomically claims the handler by transitioning its status to `processing`.
+4. If the message is stale, duplicated, or the handler is already current, the worker deletes the queue message and no-ops.
+
+This means:
+
+- A crash after queue send but before the scheduler writes `queued` no longer wedges the run forever.
+- Duplicate queue messages are harmless.
+- Handler implementations can stay simple; correctness does not depend on each handler re-implementing duplicate guards.
+
### Adding a New Handler
1. Create a new file in `apps/workers/post-processor/src/handlers/`
@@ -207,7 +226,7 @@ stateDiagram-v2
| Status | Meaning |
| --- | --- |
| *(absent)* | Run hasn't been dispatched for post-processing yet |
-| `queued` | Message sent to queue, awaiting pickup |
+| `queued` | Message sent to queue, awaiting pickup (best-effort marker; the worker entrypoint is authoritative) |
| `processing` | Worker is actively processing |
| `done` | Post-processing completed successfully |
| `failed` | Handler threw an error (may be retried by scheduler on next poll) |
From fe5b9eed30ba2bde3d23f115c95b946d6eaaffd1 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 14:21:51 -0700
Subject: [PATCH 045/287] docs(post-processing): clarify enqueue and claim
boundaries
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
apps/scheduler/src/handler-dispatcher.ts | 9 +++++++++
apps/workers/post-processor/src/post-processor.ts | 7 +++++++
2 files changed, 16 insertions(+)
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index 92a9752bc..b93afca52 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -383,9 +383,18 @@ export class HandlerDispatcher implements NotifyHandler {
return;
}
+ // Queue FIRST, then write the best-effort "queued" marker back to Mongo.
+ // The queue message is the durable work signal; the DB status is only an
+ // optimization / observability hint. If we crash after sendMessage() but
+ // before this update, the worker entrypoint claim still makes the message
+ // safe and prevents a permanent "queued" wedge.
const enqueued = await this.enqueueToHandler(handler, requestId, runId);
if (!enqueued) return;
+ // This is NOT the authoritative processing claim. It only records that a
+ // message was successfully placed on the queue and is expected to be picked
+ // up soon. The worker performs the real claim when it atomically flips the
+ // handler from eligible -> processing for this specific run attempt.
const queueMarkFilter = this.buildDispatchFilter(handler, allHandlers, graph);
const queueMarkResult = await this.collection.updateOne(
{
diff --git a/apps/workers/post-processor/src/post-processor.ts b/apps/workers/post-processor/src/post-processor.ts
index 32bec7202..db2a46c9f 100644
--- a/apps/workers/post-processor/src/post-processor.ts
+++ b/apps/workers/post-processor/src/post-processor.ts
@@ -105,6 +105,11 @@ export class PostProcessor extends BaseQueueProcessor {
const handlerId = `pp-${msg.type}`;
const currentStatus = doc.run?.handlerStatus?.[handlerId] as HandlerRunStatus | undefined;
+ // This is the authoritative claim. A queued message alone does not mean the
+ // handler still needs work: the scheduler may have enqueued optimistically,
+ // another worker may already be processing it, or a fresher backfill may
+ // have completed it. Only the worker can safely decide that by atomically
+ // transitioning the specific run attempt into "processing".
const claim = await this.collection.findOneAndUpdate(
this.buildHandlerClaimFilter(doc._id, msg.runId, handlerId, handler) as any,
{
@@ -121,6 +126,8 @@ export class PostProcessor extends BaseQueueProcessor {
);
if (!claim) {
+ // No claim means the message is stale, duplicate, or already satisfied.
+ // Ack and drop it — at-least-once delivery is expected here.
await log("info", "Post-processing message no longer needed, discarding", {
handlerId,
runId: msg.runId,
From 87df1b0573339259ed3a848623495698a47ca050 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 14:45:58 -0700
Subject: [PATCH 046/287] perf(scheduler): cache handler topology with short
TTL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
loadHandlers() sits on the notify/poll hot path (2-3 reads per notify,
one per poll cycle) but the services collection only changes on deploys.
Cache the topology in-memory with a 60s TTL (configurable) to eliminate
nearly all of those reads — meaningful on CosmosDB where each query
costs RUs. registerHandler invalidates the cache after upserting so new
topology is picked up immediately; cycle-check validation reads fresh.
Addresses jduffney review feedback #4 on #1147.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
apps/scheduler/src/handler-dispatcher.test.ts | 58 +++++++++++++++++++
apps/scheduler/src/handler-dispatcher.ts | 35 +++++++++--
docs/architecture/post-processing.md | 2 +
3 files changed, 89 insertions(+), 6 deletions(-)
diff --git a/apps/scheduler/src/handler-dispatcher.test.ts b/apps/scheduler/src/handler-dispatcher.test.ts
index 9431be37b..32d954243 100644
--- a/apps/scheduler/src/handler-dispatcher.test.ts
+++ b/apps/scheduler/src/handler-dispatcher.test.ts
@@ -307,6 +307,64 @@ describe("HandlerDispatcher — onHandlerComplete", () => {
});
});
+describe("HandlerDispatcher — handler topology caching", () => {
+ function makeWithSpies(ttlMs = 60_000, handlers: HandlerServiceDocument[] = HANDLERS) {
+ const collection = createMockCollection();
+ const toArray = vi.fn().mockResolvedValue(handlers);
+ const find = vi.fn().mockReturnValue({ toArray });
+ const servicesUpdateOne = vi.fn().mockResolvedValue(undefined);
+ const db = {
+ collection: vi.fn().mockReturnValue({ find, updateOne: servicesUpdateOne }),
+ } as any;
+ const dispatcher = new HandlerDispatcher(
+ collection,
+ db,
+ vi.fn(),
+ 60_000,
+ 30,
+ "http://api.test",
+ ttlMs,
+ ) as any;
+ return { dispatcher, find, toArray, servicesUpdateOne };
+ }
+
+ it("reuses cached topology within the TTL window", async () => {
+ const { dispatcher, toArray } = makeWithSpies(60_000);
+
+ await dispatcher.loadHandlers();
+ await dispatcher.loadHandlers();
+
+ expect(toArray).toHaveBeenCalledTimes(1);
+ });
+
+ it("re-reads topology once the TTL has elapsed", async () => {
+ const { dispatcher, toArray } = makeWithSpies(0); // TTL 0 → every read is stale
+
+ await dispatcher.loadHandlers();
+ await dispatcher.loadHandlers();
+
+ expect(toArray).toHaveBeenCalledTimes(2);
+ });
+
+ it("invalidates the cache when a handler is registered", async () => {
+ const { dispatcher, toArray } = makeWithSpies(60_000);
+
+ await dispatcher.loadHandlers(); // read #1 — populates cache
+ await dispatcher.registerHandler({
+ _id: "pp-new",
+ type: "post-process-handler",
+ version: 1,
+ queue: "pp-new-queue",
+ selector: "new",
+ autoBackfill: false,
+ dependsOn: [],
+ }); // read #2 (forceFresh validation) + invalidate
+ await dispatcher.loadHandlers(); // read #3 — cache was invalidated
+
+ expect(toArray).toHaveBeenCalledTimes(3);
+ });
+});
+
describe("HandlerDispatcher — buildDispatchFilter", () => {
let collection: ReturnType;
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index b93afca52..760bd87d8 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -25,6 +25,14 @@ export class HandlerDispatcher implements NotifyHandler {
private dispatching = false;
private queueClients = new Map();
+ /** Cached handler topology. The `services` collection changes only on deploys
+ * (via registerHandler), yet loadHandlers() sits on the notify/poll hot path
+ * (2–3 reads per notify, plus every poll cycle). A short TTL cache eliminates
+ * nearly all of those reads — significant on CosmosDB where each query costs
+ * RUs — while registerHandler invalidates it so new topology is picked up at
+ * once rather than after the TTL elapses. */
+ private handlerCache: { docs: HandlerServiceDocument[]; expiresAt: number } | null = null;
+
/** Retry policy for the report-trigger POST. The 30s poll net is the durable
* backstop, so in-call retries are modest. Overridable in tests. */
private reportRetryOptions: RetryOptions = {
@@ -41,6 +49,7 @@ export class HandlerDispatcher implements NotifyHandler {
private readonly pollIntervalMs: number = 30_000,
private readonly batchSize: number = 30,
private readonly apiUrl: string = process.env.API_URL || "http://api:80",
+ private readonly handlerCacheTtlMs: number = 60_000,
) {}
start(): void {
@@ -137,8 +146,9 @@ export class HandlerDispatcher implements NotifyHandler {
}
async registerHandler(doc: HandlerServiceDocument): Promise {
- // Validate the resulting topology has no cycles before persisting.
- const existing = await this.loadHandlers();
+ // Validate the resulting topology has no cycles before persisting. Read
+ // fresh (bypass the cache) so validation reflects any concurrent registrations.
+ const existing = await this.loadHandlers(true);
const merged = [
...existing.filter((h) => h._id !== doc._id),
doc,
@@ -158,6 +168,8 @@ export class HandlerDispatcher implements NotifyHandler {
} as any,
{ upsert: true },
);
+ // Topology changed — drop the cache so the next read picks up the new handler.
+ this.invalidateHandlerCache();
console.log(
`[HandlerDispatcher] Registered handler ${_id} (version=${doc.version}, queue=${doc.queue}, dependsOn=[${doc.dependsOn.join(", ")}])`,
);
@@ -494,12 +506,23 @@ export class HandlerDispatcher implements NotifyHandler {
return client;
}
- private async loadHandlers(): Promise {
- const docs = await this.db
+ private async loadHandlers(forceFresh = false): Promise {
+ const now = Date.now();
+ if (!forceFresh && this.handlerCache && this.handlerCache.expiresAt > now) {
+ return this.handlerCache.docs;
+ }
+ const docs = (await this.db
.collection("services")
.find({ type: "post-process-handler" })
- .toArray();
- return docs as unknown as HandlerServiceDocument[];
+ .toArray()) as unknown as HandlerServiceDocument[];
+ this.handlerCache = { docs, expiresAt: now + this.handlerCacheTtlMs };
+ return docs;
+ }
+
+ /** Drops the cached topology so the next loadHandlers() re-reads from Mongo.
+ * Called after registerHandler persists a change. */
+ private invalidateHandlerCache(): void {
+ this.handlerCache = null;
}
private buildGraph(handlers: HandlerServiceDocument[]): DependencyGraph {
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index 4407afad0..b695ca92e 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -149,6 +149,8 @@ dependsOn: []
On deploy, a generic registration script — `packages/shared/src/scripts/register-handler.ts` — reads the `handler.yaml` pointed to by `HANDLER_YAML_PATH`, waits for the scheduler's `/health`, and POSTs the parsed document to `${SCHEDULER_URL}/handlers/register` (with retry). The scheduler validates the document, runs a cycle check against the existing topology, and upserts it into the `services` collection via `HandlerDispatcher.registerHandler`. **Workers never write to the `services` collection directly** — the scheduler is the sole owner.
+Because handler topology is read on the dispatch hot path (every notify reads it 2–3 times, and every poll cycle once) but only changes on deploys, the scheduler caches it in-memory with a short TTL (60s, configurable via the `HandlerDispatcher` constructor). `registerHandler` invalidates the cache immediately after upserting, so a freshly registered handler is picked up on the next dispatch rather than after the TTL elapses. Cycle-check validation always reads fresh (bypassing the cache).
+
```mermaid
flowchart LR
YAML[handler.yaml] --> SCRIPT[register-handler.ts]
From a56c0beb8700566ebcfebf0162be4a769bf749d2 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 15:06:17 -0700
Subject: [PATCH 047/287] perf(scheduler): raise handler topology cache TTL to
5min, make it env-configurable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The scheduler is a singleton (replicas: 1, Recreate) and the sole writer of
the services collection, and registerHandler invalidates the cache on every
topology change — so cache coherence rests on invalidation, not expiry. A 60s
TTL sat barely above the 30s poll, forcing a needless fresh read on roughly
every other poll cycle. Raise the default to 5min (well above the poll
interval) and expose SCHEDULER_HANDLER_CACHE_TTL_MS so the TTL is only a coarse
backstop for out-of-band writes or a future scale-out beyond one replica.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
ENV_VARIABLES.md | 6 ++++++
apps/scheduler/src/handler-dispatcher.ts | 16 +++++++++++-----
apps/scheduler/src/index.ts | 13 ++++++++++++-
docs/architecture/post-processing.md | 2 +-
4 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index 73262c238..48016b472 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -360,6 +360,12 @@ How often the request scheduler polls MongoDB for pending requests to dispatch t
How often the post-processor dispatcher polls for completed runs needing post-processing. This is a **backfill/catch-up** mechanism — the primary dispatch path is event-driven (coder workers enqueue directly on run completion). The 30s default keeps idle RU consumption low while still catching missed events or version-upgrade backfills within a reasonable window. Reduce temporarily for large backfills.
+### SCHEDULER_HANDLER_CACHE_TTL_MS
+**Default:** `300000`
+**Type:** integer (milliseconds)
+
+TTL for the DAG dispatcher's in-memory cache of handler topology (the `services` collection, `type: "post-process-handler"`). `loadHandlers()` runs on the notify/poll hot path (2–3 reads per notify plus every poll cycle) but topology only changes on deploys, so caching it eliminates nearly all of those reads (meaningful on CosmosDB where each query costs RUs). Cache coherence comes primarily from `HandlerDispatcher.registerHandler` invalidating the cache the moment topology changes — the scheduler is a singleton (`replicas: 1`, `Recreate`) and the sole writer of the collection — so this TTL is only a coarse backstop for out-of-band writes or a future scale-out to more than one replica. Kept well above `SCHEDULER_PP_POLL_INTERVAL_MS` so the poll loop doesn't force a fresh read every cycle.
+
### QUEUE_NAME_POST_PROCESSOR
**Default:** `post-processor-queue`
**Type:** string
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index 760bd87d8..4ff1f8275 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -27,10 +27,16 @@ export class HandlerDispatcher implements NotifyHandler {
/** Cached handler topology. The `services` collection changes only on deploys
* (via registerHandler), yet loadHandlers() sits on the notify/poll hot path
- * (2–3 reads per notify, plus every poll cycle). A short TTL cache eliminates
- * nearly all of those reads — significant on CosmosDB where each query costs
- * RUs — while registerHandler invalidates it so new topology is picked up at
- * once rather than after the TTL elapses. */
+ * (2–3 reads per notify, plus every poll cycle). A TTL cache eliminates nearly
+ * all of those reads — significant on CosmosDB where each query costs RUs.
+ *
+ * Coherence comes primarily from `registerHandler` invalidating the cache the
+ * moment topology changes, not from expiry: the scheduler is a singleton
+ * (`replicas: 1`, `Recreate`) and the sole writer of the `services` collection,
+ * so a same-process registration is reflected immediately regardless of TTL.
+ * The TTL is therefore a coarse defensive backstop (out-of-band writes, or a
+ * future scale-out to >1 replica) and is intentionally set well above the poll
+ * interval so the poll loop doesn't force a fresh read every cycle. */
private handlerCache: { docs: HandlerServiceDocument[]; expiresAt: number } | null = null;
/** Retry policy for the report-trigger POST. The 30s poll net is the durable
@@ -49,7 +55,7 @@ export class HandlerDispatcher implements NotifyHandler {
private readonly pollIntervalMs: number = 30_000,
private readonly batchSize: number = 30,
private readonly apiUrl: string = process.env.API_URL || "http://api:80",
- private readonly handlerCacheTtlMs: number = 60_000,
+ private readonly handlerCacheTtlMs: number = 300_000,
) {}
start(): void {
diff --git a/apps/scheduler/src/index.ts b/apps/scheduler/src/index.ts
index c59522167..4ce9f053f 100644
--- a/apps/scheduler/src/index.ts
+++ b/apps/scheduler/src/index.ts
@@ -184,6 +184,14 @@ async function main(): Promise {
10,
);
+ // Handler topology is deploy-static and invalidated on registration, so this
+ // TTL only backstops out-of-band/multi-replica changes — keep it well above
+ // the poll interval so the poll loop doesn't force a fresh read every cycle.
+ const handlerCacheTtlMs = parseInt(
+ process.env.SCHEDULER_HANDLER_CACHE_TTL_MS || "300000",
+ 10,
+ );
+
const postProcessorDispatcher = new PostProcessorDispatcher(
collection,
db,
@@ -201,9 +209,12 @@ async function main(): Promise {
ppPollIntervalMs,
30,
API_URL,
+ handlerCacheTtlMs,
);
handlerDispatcher.start();
- console.log("[Scheduler] Handler dispatcher (DAG) started");
+ console.log(
+ `[Scheduler] Handler dispatcher (DAG) started (poll=${ppPollIntervalMs}ms, topologyCacheTtl=${handlerCacheTtlMs}ms)`,
+ );
// Start the stuck-run reaper (authoritative backstop). Redis is non-fatal:
// on misconfig or connection failure the reaper self-disables (its sweeps
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index b695ca92e..298a0058d 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -149,7 +149,7 @@ dependsOn: []
On deploy, a generic registration script — `packages/shared/src/scripts/register-handler.ts` — reads the `handler.yaml` pointed to by `HANDLER_YAML_PATH`, waits for the scheduler's `/health`, and POSTs the parsed document to `${SCHEDULER_URL}/handlers/register` (with retry). The scheduler validates the document, runs a cycle check against the existing topology, and upserts it into the `services` collection via `HandlerDispatcher.registerHandler`. **Workers never write to the `services` collection directly** — the scheduler is the sole owner.
-Because handler topology is read on the dispatch hot path (every notify reads it 2–3 times, and every poll cycle once) but only changes on deploys, the scheduler caches it in-memory with a short TTL (60s, configurable via the `HandlerDispatcher` constructor). `registerHandler` invalidates the cache immediately after upserting, so a freshly registered handler is picked up on the next dispatch rather than after the TTL elapses. Cycle-check validation always reads fresh (bypassing the cache).
+Because handler topology is read on the dispatch hot path (every notify reads it 2–3 times, and every poll cycle once) but only changes on deploys, the scheduler caches it in-memory with a TTL (default 5 min, `SCHEDULER_HANDLER_CACHE_TTL_MS`). Coherence comes primarily from invalidation, not expiry: `registerHandler` invalidates the cache immediately after upserting, and since the scheduler is a singleton (`replicas: 1`, `Recreate`) and the sole writer of the `services` collection, a change is reflected at once regardless of TTL. The TTL is therefore only a defensive backstop for out-of-band writes or a future scale-out to more than one replica, and is deliberately kept well above the poll interval so the poll loop doesn't force a fresh read every cycle. Cycle-check validation always reads fresh (bypassing the cache).
```mermaid
flowchart LR
From b55299c9a06f3b27d6676e048717dbe1c3be1400 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 15:14:21 -0700
Subject: [PATCH 048/287] docs: call out single-replica limitation of the
handler topology cache
Make explicit that process-local cache invalidation is only correct while the
scheduler runs as a single replica, and document the cross-replica mitigations
(Redis pub/sub or change-stream watcher, or a shorter TTL) required before any
scale-out.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
docs/architecture/post-processing.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index 298a0058d..7fd352e55 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -151,6 +151,8 @@ On deploy, a generic registration script — `packages/shared/src/scripts/regist
Because handler topology is read on the dispatch hot path (every notify reads it 2–3 times, and every poll cycle once) but only changes on deploys, the scheduler caches it in-memory with a TTL (default 5 min, `SCHEDULER_HANDLER_CACHE_TTL_MS`). Coherence comes primarily from invalidation, not expiry: `registerHandler` invalidates the cache immediately after upserting, and since the scheduler is a singleton (`replicas: 1`, `Recreate`) and the sole writer of the `services` collection, a change is reflected at once regardless of TTL. The TTL is therefore only a defensive backstop for out-of-band writes or a future scale-out to more than one replica, and is deliberately kept well above the poll interval so the poll loop doesn't force a fresh read every cycle. Cycle-check validation always reads fresh (bypassing the cache).
+> **Limitation — the topology cache assumes a single scheduler replica.** In-memory cache invalidation is process-local, so it is only correct while the scheduler runs as one replica. This holds today (`deploy/base/scheduler.yaml`: `replicas: 1`, `strategy: Recreate`, so pods never overlap). **If the scheduler is ever scaled beyond one replica, this cache becomes stale-prone:** a `registerHandler` on one replica invalidates only that replica's cache, so the others keep serving old topology for up to the TTL. The blast radius is bounded — with idempotent dispatch a newly added handler is still dispatched by whichever replica has fresh topology, and a removed/re-wired handler self-heals within the TTL — but it is real. Before scaling out, replace process-local invalidation with a cross-replica signal (e.g. Redis pub/sub on `registerHandler`, or a change-stream watcher on the `services` collection), or lower `SCHEDULER_HANDLER_CACHE_TTL_MS` to shrink the staleness window.
+
```mermaid
flowchart LR
YAML[handler.yaml] --> SCRIPT[register-handler.ts]
From ab696a2b94129e4f1af71665240da4071fecd5a5 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 15:24:04 -0700
Subject: [PATCH 049/287] feat(scheduler): cap notify/register request body
size (64 KB)
Guards the singleton scheduler HTTP server against unbounded-memory
requests. Rejects oversized payloads with 413 Payload Too Large +
Connection: close, using a Content-Length fast-reject plus a streaming
byte-count cap for chunked/lying clients. maxBodyBytes is threaded
through createHttpServer so tests can use a small deterministic cap.
Addresses jduffney review feedback #5 on #1147.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
apps/scheduler/src/notify-routes.test.ts | 88 +++++++++++++++-
apps/scheduler/src/notify-routes.ts | 122 ++++++++++++++++++++---
docs/architecture/post-processing.md | 2 +-
3 files changed, 192 insertions(+), 20 deletions(-)
diff --git a/apps/scheduler/src/notify-routes.test.ts b/apps/scheduler/src/notify-routes.test.ts
index 797256018..2d7ef741b 100644
--- a/apps/scheduler/src/notify-routes.test.ts
+++ b/apps/scheduler/src/notify-routes.test.ts
@@ -2,11 +2,22 @@
// Licensed under the MIT License.
import type { AddressInfo } from "node:net";
+import type { IncomingMessage } from "node:http";
+import { PassThrough } from "node:stream";
import { afterEach, describe, expect, it, vi } from "vitest";
-import { createHttpServer, type NotifyHandler } from "./notify-routes.js";
+import {
+ createHttpServer,
+ readJsonBody,
+ MAX_BODY_BYTES,
+ type HttpServerOptions,
+ type NotifyHandler,
+} from "./notify-routes.js";
-async function startServer(handler: NotifyHandler): Promise<{ server: ReturnType; baseUrl: string }> {
- const server = createHttpServer(handler);
+async function startServer(
+ handler: NotifyHandler,
+ options?: HttpServerOptions,
+): Promise<{ server: ReturnType; baseUrl: string }> {
+ const server = createHttpServer(handler, options);
await new Promise((resolve, reject) => {
server.once("error", reject);
@@ -201,4 +212,75 @@ describe("createHttpServer", () => {
expect(response.status).toBe(400);
expect(handler.registerHandler).not.toHaveBeenCalled();
});
+
+ it("returns 413 and does not invoke the handler when the body exceeds the cap", async () => {
+ const handler: NotifyHandler = {
+ onRunTerminal: vi.fn().mockResolvedValue(undefined),
+ onHandlerComplete: vi.fn().mockResolvedValue(undefined),
+ registerHandler: vi.fn().mockResolvedValue(undefined),
+ };
+ // Tiny cap so a small, deterministic payload trips it (no socket-buffer race).
+ const { server, baseUrl } = await startServer(handler, { maxBodyBytes: 32 });
+ servers.push(server);
+
+ const response = await fetch(`${baseUrl}/notify/run-terminal`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ requestId: "r".repeat(100), runId: "run-1" }),
+ });
+
+ expect(response.status).toBe(413);
+ expect(await response.json()).toEqual({ error: "Request body too large" });
+ expect(handler.onRunTerminal).not.toHaveBeenCalled();
+ });
+});
+
+describe("readJsonBody", () => {
+ /** Build a mock IncomingMessage backed by a PassThrough with the given headers. */
+ function mockReq(headers: Record = {}): IncomingMessage & PassThrough {
+ const req = new PassThrough() as PassThrough & { headers: Record };
+ req.headers = headers;
+ return req as unknown as IncomingMessage & PassThrough;
+ }
+
+ it("parses a valid JSON body under the cap", async () => {
+ const req = mockReq();
+ const promise = readJsonBody(req, 1024);
+ req.end(JSON.stringify({ hello: "world" }));
+
+ await expect(promise).resolves.toEqual({ hello: "world" });
+ });
+
+ it("rejects a declared Content-Length over the cap without reading the body", async () => {
+ const req = mockReq({ "content-length": "5000" });
+ const onData = vi.fn();
+ req.on("data", onData);
+
+ await expect(readJsonBody(req, 1024)).rejects.toThrow(/limit/);
+ expect(onData).not.toHaveBeenCalled(); // fast-path rejects before consuming
+ });
+
+ it("rejects a chunked body that streams past the cap (no Content-Length)", async () => {
+ const req = mockReq(); // no content-length → exercises the streaming guard
+ const promise = readJsonBody(req, 16);
+ req.write("x".repeat(10));
+ req.write("x".repeat(10)); // total 20 > 16
+ req.end();
+
+ await expect(promise).rejects.toThrow(/limit/);
+ });
+
+ it("rejects an empty body", async () => {
+ const req = mockReq();
+ const promise = readJsonBody(req, 1024);
+ req.end("");
+
+ await expect(promise).rejects.toThrow("Request body is required");
+ });
+
+ it("defaults the cap to MAX_BODY_BYTES (64 KB)", async () => {
+ const req = mockReq({ "content-length": String(MAX_BODY_BYTES + 1) });
+
+ await expect(readJsonBody(req)).rejects.toThrow(/limit/);
+ });
});
diff --git a/apps/scheduler/src/notify-routes.ts b/apps/scheduler/src/notify-routes.ts
index 577478b64..b63d13dd9 100644
--- a/apps/scheduler/src/notify-routes.ts
+++ b/apps/scheduler/src/notify-routes.ts
@@ -4,6 +4,22 @@
import http from "node:http";
import type { HandlerServiceDocument } from "shared";
+/**
+ * Maximum accepted request body size for the scheduler's HTTP endpoints.
+ * Notify/register payloads are a few hundred bytes; 64 KB is a generous cap
+ * that protects this singleton control-plane process from unbounded buffering
+ * (and OOM) if a buggy caller streams a large body.
+ */
+export const MAX_BODY_BYTES = 64 * 1024;
+
+/** Thrown by readJsonBody when the request body exceeds MAX_BODY_BYTES. */
+class PayloadTooLargeError extends Error {
+ constructor(maxBytes: number) {
+ super(`Request body exceeds ${maxBytes}-byte limit`);
+ this.name = "PayloadTooLargeError";
+ }
+}
+
export interface NotifyHandler {
onRunTerminal(requestId: string, runId: string): Promise;
onHandlerComplete(
@@ -27,8 +43,13 @@ interface HandlerCompleteRequest {
status: "done" | "failed";
}
-function sendJson(res: http.ServerResponse, statusCode: number, body: object): void {
- res.writeHead(statusCode, { "Content-Type": "application/json" });
+function sendJson(
+ res: http.ServerResponse,
+ statusCode: number,
+ body: object,
+ extraHeaders?: http.OutgoingHttpHeaders,
+): void {
+ res.writeHead(statusCode, { "Content-Type": "application/json", ...extraHeaders });
res.end(JSON.stringify(body));
}
@@ -117,22 +138,84 @@ function parseHandlerRegisterRequest(body: unknown): HandlerServiceDocument | nu
};
}
-async function readJsonBody(req: http.IncomingMessage): Promise {
- const chunks: Buffer[] = [];
+export function readJsonBody(
+ req: http.IncomingMessage,
+ maxBytes: number = MAX_BODY_BYTES,
+): Promise {
+ return new Promise((resolve, reject) => {
+ // Fast path: reject an oversized declared Content-Length before reading any
+ // body. Well-behaved clients (fetch/axios/http.request with a body) always
+ // send it, so this catches the common case without buffering a single byte.
+ const declaredLength = Number(req.headers["content-length"]);
+ if (Number.isFinite(declaredLength) && declaredLength > maxBytes) {
+ reject(new PayloadTooLargeError(maxBytes));
+ return;
+ }
- for await (const chunk of req) {
- chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
- }
+ const chunks: Buffer[] = [];
+ let total = 0;
+ let settled = false;
- const rawBody = Buffer.concat(chunks).toString("utf-8").trim();
- if (rawBody.length === 0) {
- throw new Error("Request body is required");
- }
+ const cleanup = (): void => {
+ req.removeListener("data", onData);
+ req.removeListener("end", onEnd);
+ req.removeListener("error", onError);
+ };
+
+ // Streaming guard: Content-Length may be absent (chunked) or lie, so also
+ // enforce the cap as bytes arrive and bail the moment it is exceeded.
+ const onData = (chunk: Buffer | string): void => {
+ if (settled) return;
+ const buf = typeof chunk === "string" ? Buffer.from(chunk) : chunk;
+ total += buf.length;
+ if (total > maxBytes) {
+ settled = true;
+ cleanup();
+ reject(new PayloadTooLargeError(maxBytes));
+ return;
+ }
+ chunks.push(buf);
+ };
- return JSON.parse(rawBody) as unknown;
+ const onEnd = (): void => {
+ if (settled) return;
+ settled = true;
+ cleanup();
+ const rawBody = Buffer.concat(chunks).toString("utf-8").trim();
+ if (rawBody.length === 0) {
+ reject(new Error("Request body is required"));
+ return;
+ }
+ try {
+ resolve(JSON.parse(rawBody) as unknown);
+ } catch (err) {
+ reject(err);
+ }
+ };
+
+ const onError = (err: Error): void => {
+ if (settled) return;
+ settled = true;
+ cleanup();
+ reject(err);
+ };
+
+ req.on("data", onData);
+ req.on("end", onEnd);
+ req.on("error", onError);
+ });
}
-export function createHttpServer(handler: NotifyHandler): http.Server {
+export interface HttpServerOptions {
+ /** Max request body size in bytes. Defaults to MAX_BODY_BYTES (64 KB). */
+ maxBodyBytes?: number;
+}
+
+export function createHttpServer(
+ handler: NotifyHandler,
+ options: HttpServerOptions = {},
+): http.Server {
+ const maxBodyBytes = options.maxBodyBytes ?? MAX_BODY_BYTES;
return http.createServer(async (req, res) => {
const method = req.method ?? "GET";
const url = new URL(req.url ?? "/", "http://localhost");
@@ -144,7 +227,7 @@ export function createHttpServer(handler: NotifyHandler): http.Server {
}
if (method === "POST" && url.pathname === "/notify/run-terminal") {
- const parsedBody = parseRunTerminalRequest(await readJsonBody(req));
+ const parsedBody = parseRunTerminalRequest(await readJsonBody(req, maxBodyBytes));
if (!parsedBody) {
sendJson(res, 400, { error: "requestId and runId are required" });
return;
@@ -156,7 +239,7 @@ export function createHttpServer(handler: NotifyHandler): http.Server {
}
if (method === "POST" && url.pathname === "/notify/handler-complete") {
- const parsedBody = parseHandlerCompleteRequest(await readJsonBody(req));
+ const parsedBody = parseHandlerCompleteRequest(await readJsonBody(req, maxBodyBytes));
if (!parsedBody) {
sendJson(res, 400, {
error: "requestId, runId, handlerId, and status (done|failed) are required",
@@ -175,7 +258,7 @@ export function createHttpServer(handler: NotifyHandler): http.Server {
}
if (method === "POST" && url.pathname === "/handlers/register") {
- const parsedBody = parseHandlerRegisterRequest(await readJsonBody(req));
+ const parsedBody = parseHandlerRegisterRequest(await readJsonBody(req, maxBodyBytes));
if (!parsedBody) {
sendJson(res, 400, {
error:
@@ -189,6 +272,13 @@ export function createHttpServer(handler: NotifyHandler): http.Server {
return;
}
} catch (error) {
+ // Body was not fully consumed — close the connection so leftover bytes
+ // can't corrupt the next request on a keep-alive socket.
+ if (error instanceof PayloadTooLargeError) {
+ sendJson(res, 413, { error: "Request body too large" }, { Connection: "close" });
+ return;
+ }
+
const message = error instanceof Error ? error.message : "Internal server error";
const statusCode =
message === "Request body is required" || error instanceof SyntaxError ? 400 : 500;
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index 7fd352e55..5bc1efbd5 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -16,7 +16,7 @@ Two paths trigger post-processing:
1. **Event-driven (primary):** Coder workers enqueue a post-processing message immediately when a run completes, currently setting the deprecated `run.postProcessorStatus: "queued"` compatibility field atomically in the same DB write while the system migrates to per-handler status.
2. **Scheduler backfill:** The `PostProcessorDispatcher` polls every 30 seconds for runs that have `status: "done"` but no post-processing marker set (or a stale handler version). During the migration window this may consult the deprecated flat fields; the long-term source of truth is `run.handlerStatus[handlerId]`. This catches runs that completed before the event-driven dispatch was deployed, or that need re-processing after a version bump.
-3. **Scheduler notify & registration server:** The scheduler also exposes `GET /health`, `POST /notify/run-terminal`, `POST /notify/handler-complete`, and `POST /handlers/register` on a lightweight `node:http` server. Workers and post-process handlers use the notify endpoints to signal terminal states so the scheduler can re-evaluate which root or downstream handlers are ready to dispatch. The `/handlers/register` endpoint is the single writer to the `services` collection — see [Handler Registration](#handler-registration).
+3. **Scheduler notify & registration server:** The scheduler also exposes `GET /health`, `POST /notify/run-terminal`, `POST /notify/handler-complete`, and `POST /handlers/register` on a lightweight `node:http` server. Workers and post-process handlers use the notify endpoints to signal terminal states so the scheduler can re-evaluate which root or downstream handlers are ready to dispatch. The `/handlers/register` endpoint is the single writer to the `services` collection — see [Handler Registration](#handler-registration). All POST endpoints cap the request body at 64 KB (`MAX_BODY_BYTES` in `notify-routes.ts`); oversized payloads are rejected with `413 Payload Too Large` and `Connection: close` before the body is fully buffered, guarding the singleton scheduler against unbounded-memory requests.
## ATIF Generation
From 726e0cd9b95f5148365edb265b9d7ab0897ae105 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 1 Jul 2026 16:02:48 -0700
Subject: [PATCH 050/287] fix(post-processing): let worker claim
scheduler-queued runs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The enqueue-before-claim refactor made the scheduler write a best-effort
handlerStatus..status="queued" marker in-process immediately after
enqueueing. The worker's claim filter excluded "queued", so once that
marker won the (near-certain) race against queue delivery, the worker
dequeued its own message, matched nothing on the atomic claim, logged
"no longer needed, discarding", and deleted the message — stranding the
run at "queued" forever (the 30s backfill poll also excludes "queued",
so nothing recovered it). This reintroduced the stuck-dispatch failure
mode via a new path.
Fix: remove "queued" from the worker claim exclusions so queued ->
processing is a permitted transition. Idempotency is preserved: still
exclude "processing" (another worker in-flight) and, for non-backfill
handlers, "done"; autoBackfill "done" stays gated by the version check.
Add a regression test asserting a run in the scheduler's "queued" state
is claimable and driven to done, update the existing filter-shape
assertion, and document that queued -> processing must be permitted.
Verified end-to-end against the docker-compose stack: a synthetic
status=done run dispatched via /notify/run-terminal now reaches
handlerStatus.pp-atif.status=done + reportsTriggeredAt, with duplicate
delivery still no-oping and the report trigger firing exactly once.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
.../post-processor/src/post-processor.test.ts | 56 ++++++++++++++++++-
.../post-processor/src/post-processor.ts | 14 ++++-
docs/architecture/post-processing.md | 2 +-
3 files changed, 68 insertions(+), 4 deletions(-)
diff --git a/apps/workers/post-processor/src/post-processor.test.ts b/apps/workers/post-processor/src/post-processor.test.ts
index e33cccbd3..44f102fa9 100644
--- a/apps/workers/post-processor/src/post-processor.test.ts
+++ b/apps/workers/post-processor/src/post-processor.test.ts
@@ -122,7 +122,7 @@ describe("PostProcessor", () => {
_id: "req-1",
"run._id": "run-1",
"run.status": "done",
- "run.handlerStatus.pp-atif.status": { $nin: ["queued", "processing"] },
+ "run.handlerStatus.pp-atif.status": { $nin: ["processing"] },
$or: [
{ "run.handlerStatus.pp-atif.version": { $exists: false } },
{ "run.handlerStatus.pp-atif.version": { $lt: 1 } },
@@ -181,4 +181,58 @@ describe("PostProcessor", () => {
expect(notifyHandlerComplete).toHaveBeenCalledWith("req-1", "run-1", "pp-atif", "done");
expect(safeDeleteMessage).toHaveBeenCalledWith("message-1", "pop-1");
});
+
+ it("claims a run left in the scheduler's 'queued' state and drives it to done", async () => {
+ // Regression: the scheduler writes a best-effort "queued" marker right after
+ // enqueue-before-claim, so a dequeued message almost always sees status
+ // "queued". The worker MUST be able to claim it (queued -> processing).
+ // Previously "queued" was in the claim exclusion list, so the worker
+ // discarded its own message and stranded the run at "queued" forever.
+ const { processor, collection, safeDeleteMessage, notifyHandlerComplete } = makeProcessor();
+ processor.registerHandler(handler);
+
+ const doc = makeDoc({
+ handlerStatus: {
+ "pp-atif": { status: "queued", updatedAt: new Date() },
+ },
+ });
+ const heartbeat = makeHeartbeat();
+ const payload: PostProcessorMessage = { type: "atif", requestId: "req-1", runId: "run-1" };
+
+ collection.findOneAndUpdate.mockResolvedValue({ _id: "req-1" });
+ collection.updateOne.mockResolvedValue({ matchedCount: 1 });
+
+ await (processor as any).handleRequest(doc, makeMessage(), heartbeat, log, payload);
+
+ // The claim filter must NOT exclude "queued" — only "processing".
+ expect(collection.findOneAndUpdate).toHaveBeenCalledWith(
+ expect.objectContaining({
+ _id: "req-1",
+ "run._id": "run-1",
+ "run.status": "done",
+ "run.handlerStatus.pp-atif.status": { $nin: ["processing"] },
+ }),
+ expect.any(Object),
+ expect.objectContaining({ returnDocument: "after" }),
+ );
+ expect(handler.process).toHaveBeenCalledWith(
+ payload,
+ expect.objectContaining({ collection, log }),
+ );
+ expect(collection.updateOne).toHaveBeenCalledWith(
+ {
+ _id: "req-1",
+ "run._id": "run-1",
+ "run.handlerStatus.pp-atif.status": "processing",
+ },
+ {
+ $set: expect.objectContaining({
+ "run.handlerStatus.pp-atif.status": "done",
+ "run.handlerStatus.pp-atif.version": 1,
+ }),
+ },
+ );
+ expect(notifyHandlerComplete).toHaveBeenCalledWith("req-1", "run-1", "pp-atif", "done");
+ expect(safeDeleteMessage).toHaveBeenCalledWith("message-1", "pop-1");
+ });
});
diff --git a/apps/workers/post-processor/src/post-processor.ts b/apps/workers/post-processor/src/post-processor.ts
index db2a46c9f..d8dcb2a66 100644
--- a/apps/workers/post-processor/src/post-processor.ts
+++ b/apps/workers/post-processor/src/post-processor.ts
@@ -48,9 +48,19 @@ export class PostProcessor extends BaseQueueProcessor {
handlerId: string,
handler: PostProcessHandler,
): Record {
+ // "queued" is deliberately NOT excluded: the scheduler writes a best-effort
+ // "queued" marker immediately after enqueueing (enqueue-before-claim), so by
+ // the time this message is dequeued the status is almost always "queued".
+ // The worker is exactly what transitions queued -> processing, so it must be
+ // able to claim a "queued" attempt. Excluding it would let the worker discard
+ // its own message and strand the run at "queued" (the scheduler poll also
+ // excludes "queued", so nothing would ever retry it). We only exclude
+ // "processing" (another worker is mid-flight) and — for non-backfill handlers
+ // — "done" (already complete). For autoBackfill, "done" is gated by the
+ // version check below instead, so a version bump can re-process it.
const statusExclusions = handler.autoBackfill
- ? ["queued", "processing"]
- : ["queued", "processing", "done"];
+ ? ["processing"]
+ : ["processing", "done"];
const filter: Record = {
_id: requestId,
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index 5bc1efbd5..1370e5b7c 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -98,7 +98,7 @@ To keep this safe, idempotency is enforced at the **post-processor worker entryp
1. The scheduler decides whether work is needed from `run.handlerStatus[handlerId]` + handler metadata (`version`, `autoBackfill`).
2. The worker re-checks that same eligibility when a message is dequeued, scoped to the specific `runId`.
-3. The worker atomically claims the handler by transitioning its status to `processing`.
+3. The worker atomically claims the handler by transitioning its status to `processing`. The claim filter accepts both the *absent* state and the `queued` marker as valid source states — it only excludes `processing` (another worker is mid-flight) and, for non-backfill handlers, `done` (already complete; for `autoBackfill` handlers a stale `done` is re-claimable via the version gate). Because the scheduler writes the best-effort `queued` marker in-process immediately after enqueueing (enqueue-before-claim), a dequeued message almost always sees `queued`; excluding `queued` from the claim filter would make the worker discard its own message and strand the run at `queued` forever (the 30s backfill poll also skips `queued`), so `queued → processing` **must** be a permitted worker transition.
4. If the message is stale, duplicated, or the handler is already current, the worker deletes the queue message and no-ops.
This means:
From 0531a0ad6440f41058c514b2f1fac7af6ea4bad5 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Thu, 9 Jul 2026 18:47:31 -0700
Subject: [PATCH 051/287] chore(db-migrations): renumber handler-DAG migrations
to 025-027
`main` independently claimed 018/019/020 (backfill-criteria-gates,
backfill-task-prompt-type, create-codebase-indexes) after this branch had
assigned those numbers to the handler-DAG migrations, producing duplicate
prefixes once main was merged in.
Renumber the three handler migrations to sit after main's highest (024) so
prefixes are unique and monotonic:
018-migrate-services-to-handler-dag -> 025-migrate-services-to-handler-dag
019-add-handler-status-index -> 026-add-handler-status-index
020-backfill-handler-status -> 027-backfill-handler-status
Class names are unchanged (mongo-migrate-ts tracks applied migrations by
className), and these migrations have not been applied to any shared
environment (int/prod migrations come from main only), so the renumber is
safe. Also updates required-migrations.ts, the internal [NNN] log prefixes,
and the db-migrations doc table.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
docs/architecture/db-migrations.md | 6 +++---
...r-dag.ts => 025-migrate-services-to-handler-dag.ts} | 6 +++---
...status-index.ts => 026-add-handler-status-index.ts} | 10 +++++-----
...andler-status.ts => 027-backfill-handler-status.ts} | 0
packages/db-migrations/src/required-migrations.ts | 6 +++---
5 files changed, 14 insertions(+), 14 deletions(-)
rename packages/db-migrations/src/migrations/{018-migrate-services-to-handler-dag.ts => 025-migrate-services-to-handler-dag.ts} (86%)
rename packages/db-migrations/src/migrations/{019-add-handler-status-index.ts => 026-add-handler-status-index.ts} (82%)
rename packages/db-migrations/src/migrations/{020-backfill-handler-status.ts => 027-backfill-handler-status.ts} (100%)
diff --git a/docs/architecture/db-migrations.md b/docs/architecture/db-migrations.md
index f69880a10..2e5b28da0 100644
--- a/docs/architecture/db-migrations.md
+++ b/docs/architecture/db-migrations.md
@@ -102,9 +102,9 @@ When you run a command:
| `007-rename-exhausted-to-finished` | Renames outcome `exhausted` → `finished` |
| `008-backfill-ai-call-count` | Downloads HARs from blob storage to count AI completion calls per turn |
| `009-add-requests-filter-indexes` | Adds indexes on `taskPromptId`, `status`, `outcome`, `workerType`, `deletedAt` for server-side filtering/grouping |
-| `018-migrate-services-to-handler-dag` | Replaces the legacy single `post-processor` service row with per-handler service registrations and dependencies |
-| `019-add-handler-status-index` | Adds a handler-specific dispatch index for `pp-atif` polling |
-| `020-backfill-handler-status` | Backfills `run.handlerStatus.pp-atif` from deprecated `run.postProcessorStatus` / `run.postProcessorVersion` fields |
+| `025-migrate-services-to-handler-dag` | Replaces the legacy single `post-processor` service row with per-handler service registrations and dependencies |
+| `026-add-handler-status-index` | Adds a handler-specific dispatch index for `pp-atif` polling |
+| `027-backfill-handler-status` | Backfills `run.handlerStatus.pp-atif` from deprecated `run.postProcessorStatus` / `run.postProcessorVersion` fields |
## CI/CD
diff --git a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts b/packages/db-migrations/src/migrations/025-migrate-services-to-handler-dag.ts
similarity index 86%
rename from packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
rename to packages/db-migrations/src/migrations/025-migrate-services-to-handler-dag.ts
index 6d2aa2c94..e2c683b56 100644
--- a/packages/db-migrations/src/migrations/018-migrate-services-to-handler-dag.ts
+++ b/packages/db-migrations/src/migrations/025-migrate-services-to-handler-dag.ts
@@ -5,7 +5,7 @@ import type { Db } from "mongodb";
import type { MigrationInterface } from "mongo-migrate-ts";
/**
- * Migration 018: Remove the legacy "post-processor" service entry.
+ * Migration 025: Remove the legacy "post-processor" service entry.
*
* Handler service registration (e.g. pp-atif) is now owned
* by each worker's handler.yaml + the generic register-handler script,
@@ -18,7 +18,7 @@ export class MigrateServicesToHandlerDag implements MigrationInterface {
async up(db: Db): Promise {
const services = db.collection("services");
await services.deleteOne({ _id: "post-processor" } as any);
- console.log("[018] Deleted legacy post-processor service entry (handler registration now owned by workers)");
+ console.log("[025] Deleted legacy post-processor service entry (handler registration now owned by workers)");
}
async down(db: Db): Promise {
@@ -37,6 +37,6 @@ export class MigrateServicesToHandlerDag implements MigrationInterface {
},
{ upsert: true },
);
- console.log("[018-down] Restored legacy post-processor service entry");
+ console.log("[025-down] Restored legacy post-processor service entry");
}
}
diff --git a/packages/db-migrations/src/migrations/019-add-handler-status-index.ts b/packages/db-migrations/src/migrations/026-add-handler-status-index.ts
similarity index 82%
rename from packages/db-migrations/src/migrations/019-add-handler-status-index.ts
rename to packages/db-migrations/src/migrations/026-add-handler-status-index.ts
index ee6e35f95..cf514668e 100644
--- a/packages/db-migrations/src/migrations/019-add-handler-status-index.ts
+++ b/packages/db-migrations/src/migrations/026-add-handler-status-index.ts
@@ -25,12 +25,12 @@ export class AddHandlerStatusIndex implements MigrationInterface {
const exists = await requests.indexExists(createdName);
console.log(
exists
- ? `[019] Created ${index.name} index on requests`
- : `[019] ${index.name} was requested but is not visible in getIndexes()`,
+ ? `[026] Created ${index.name} index on requests`
+ : `[026] ${index.name} was requested but is not visible in getIndexes()`,
);
} catch (err: unknown) {
const message = err instanceof Error ? err.message : String(err);
- console.log(`[019] ${index.name} already exists or couldn't be created: ${message}`);
+ console.log(`[026] ${index.name} already exists or couldn't be created: ${message}`);
}
}
}
@@ -41,14 +41,14 @@ export class AddHandlerStatusIndex implements MigrationInterface {
for (const index of HANDLER_STATUS_INDEXES) {
try {
await requests.dropIndex(index.name);
- console.log(`[019-down] Dropped ${index.name} index`);
+ console.log(`[026-down] Dropped ${index.name} index`);
} catch (err: unknown) {
const codeName = typeof err === "object" && err !== null && "codeName" in err
? String((err as { codeName?: unknown }).codeName)
: undefined;
if (codeName !== "IndexNotFound") {
const message = err instanceof Error ? err.message : String(err);
- console.log(`[019-down] ${index.name} not found: ${message}`);
+ console.log(`[026-down] ${index.name} not found: ${message}`);
}
}
}
diff --git a/packages/db-migrations/src/migrations/020-backfill-handler-status.ts b/packages/db-migrations/src/migrations/027-backfill-handler-status.ts
similarity index 100%
rename from packages/db-migrations/src/migrations/020-backfill-handler-status.ts
rename to packages/db-migrations/src/migrations/027-backfill-handler-status.ts
diff --git a/packages/db-migrations/src/required-migrations.ts b/packages/db-migrations/src/required-migrations.ts
index 41f0897ba..8d8484068 100644
--- a/packages/db-migrations/src/required-migrations.ts
+++ b/packages/db-migrations/src/required-migrations.ts
@@ -31,13 +31,13 @@ export const REQUIRED_MIGRATIONS: readonly string[] = [
"016-fix-scheduler-sort-index.ts",
"017-add-post-processor-dispatch-index.ts",
"018-backfill-criteria-gates.ts",
- "018-migrate-services-to-handler-dag.ts",
- "019-add-handler-status-index.ts",
"019-backfill-task-prompt-type.ts",
- "020-backfill-handler-status.ts",
"020-create-codebase-indexes.ts",
"021-add-runs-filter-indexes.ts",
"022-add-runs-sort-indexes.ts",
"023-add-runs-search-task-index.ts",
"024-add-criteria-sort-index.ts",
+ "025-migrate-services-to-handler-dag.ts",
+ "026-add-handler-status-index.ts",
+ "027-backfill-handler-status.ts",
];
From 17e8c508d6182b2bb74fe7e74a5f2571ed723171 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Sun, 11 Oct 2026 18:02:51 +0200
Subject: [PATCH 052/287] feat(portal): add Copilot SDK AI backend
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ff08bace-4f82-42b3-9451-4063717e348f
---
ENV_VARIABLES.md | 148 +++--
NOTICE | 30 ++
apps/api/Dockerfile | 5 +
apps/api/package.json | 4 +-
apps/api/src/copilot-client-pool.test.ts | 256 +++++++++
apps/api/src/copilot-client-pool.ts | 508 ++++++++++++++++++
apps/api/src/index.ts | 2 +
apps/api/src/llm-token.test.ts | 173 ++++++
apps/api/src/llm-token.ts | 248 +++++++--
apps/api/src/llm.test.ts | 22 +-
apps/api/src/llm.ts | 61 +--
.../src/portal-ai-copilot.integration.test.ts | 175 ++++++
apps/api/src/portal-ai-copy.test.ts | 16 +
apps/api/src/portal-ai-copy.ts | 5 +
apps/api/src/prompt-feature-llm.ts | 67 +--
apps/api/src/prompt-request-transport.test.ts | 27 +-
apps/api/src/routes/criteria.ts | 3 +-
apps/api/src/routes/prompt-features.ts | 5 +-
apps/api/src/routes/task-prompts.ts | 5 +-
apps/api/src/task-prompt-llm.test.ts | 37 +-
apps/api/src/task-prompt-llm.ts | 38 +-
.../components/CriteriaWizardStep2.test.tsx | 13 +-
.../src/components/CriteriaWizardStep2.tsx | 3 +-
.../src/components/PromptFeatureWizard.tsx | 3 +-
apps/portal/src/lib/portal-ai-copy.ts | 5 +
apps/portal/src/pages/CreateToken.test.ts | 31 +-
apps/portal/src/pages/CreateToken.tsx | 16 +-
apps/portal/src/types.ts | 4 +-
docs/architecture/token-manager.md | 111 ++--
docs/responsible-ai-faq.md | 7 +-
pnpm-lock.yaml | 260 ++++-----
31 files changed, 1858 insertions(+), 430 deletions(-)
create mode 100644 apps/api/src/copilot-client-pool.test.ts
create mode 100644 apps/api/src/copilot-client-pool.ts
create mode 100644 apps/api/src/llm-token.test.ts
create mode 100644 apps/api/src/portal-ai-copilot.integration.test.ts
create mode 100644 apps/api/src/portal-ai-copy.test.ts
create mode 100644 apps/api/src/portal-ai-copy.ts
create mode 100644 apps/portal/src/lib/portal-ai-copy.ts
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index bc66a4316..ebdaee4e8 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -56,40 +56,115 @@ queue. Local Compose sets it to the checked-in development manifest version.
## LLM Configuration (Portal AI Features)
The portal's AI features — criteria prompt generation, prompt-feature
-extraction/generation, and task-prompt generation/variation — all call an
-OpenAI-style chat-completions endpoint through the
-[`@azure-rest/ai-inference`](https://www.npmjs.com/package/@azure-rest/ai-inference)
-SDK. Two backends are supported, resolved in `acquireInferenceClient`
-([`apps/api/src/llm-token.ts`](apps/api/src/llm-token.ts)) using the
-following priority order. The **first source that returns a credential
-wins**; later sources are not consulted.
+extraction/generation, and task-prompt generation/variation — support Azure AI
+Foundry, the GitHub Copilot SDK, and a legacy GitHub Models fallback. The
+**first source that returns a credential wins**; later sources are not
+consulted.
| # | Source | Trigger | `via` log tag |
|---|--------|---------|---------------|
| 1 | Azure AI Foundry via env vars | `AZURE_AI_INFERENCE_ENDPOINT` + `AZURE_AI_INFERENCE_API_KEY` both set | `azure-ai-foundry-env` |
| 2 | Azure AI Foundry via Token Manager | At least one `azure-ai-foundry` key registered at the Portal `/secrets/keys/new` (recommended for integration / prod — credentials live in Key Vault, the API round-robins across valid keys) | `azure-ai-foundry-token-manager` |
-| 3 | GitHub Models via env var | `GITHUB_MODELS_API_KEY` set | `github-models-env` |
-| 4 | GitHub Models via Token Manager | A `github-models` key registered at `/secrets/keys/new` | `github-models-token-manager` |
-| 5 | Bare GitHub token fallback | `GITHUB_TOKEN` set | `github-token` |
+| 3 | GitHub Copilot SDK | `GITHUB_TOKEN` is set, or a classic PAT/OAuth token with the validated `copilot-sdk` capability is registered at `/secrets/keys/new` | `copilot-sdk-env` or `copilot-sdk-token-manager` |
+| 4 | GitHub Models legacy fallback | `GITHUB_MODELS_API_KEY`, a registered `github-models` key, or the legacy `GITHUB_TOKEN` path | `github-models-*` |
**Two important properties of this chain:**
-- **Foundry beats GitHub Models, and env vars beat the Token Manager
- within each backend.** Having both a Foundry env var and a registered
- `github-models` key means every call goes to Foundry; the GitHub
- Models key is dormant.
+- **Foundry beats Copilot SDK, which beats legacy GitHub Models.** Environment
+ Foundry credentials override registered Foundry keys. A classic PAT or OAuth
+ token that validates with `copilot-sdk` enables Portal AI without requiring
+ GitHub Models access.
- **There is no automatic failover at request time.** The chain only
steps down when the predecessor returns *nothing* (env var unset, no
key registered). It does **not** step down when the predecessor
- returns a credential that then 4xx/5xx's on the actual chat-completion
- call. This is intentional — silent fallback would mask misconfiguration
- (e.g. a wrong Foundry deployment name) and hide the real error from
- the user.
+ returns a credential that then fails authentication, times out, is rate
+ limited, or fails inference. This is intentional — silent fallback would
+ mask misconfiguration and hide the real provider error.
If no source returns a credential, the portal's AI buttons return HTTP
-`503` with a single actionable error message (`LLM not configured: no
-inference backend available. Please register a new secret key for GitHub
-Model or Azure Foundry.`), and the rest of the API works unchanged.
+`503` with actionable guidance to register Foundry or a classic PAT/OAuth
+token with Copilot SDK capability. GitHub Models is identified as a legacy
+fallback, and the rest of the API works unchanged.
+
+### Portal AI Copilot SDK isolation and limits
+
+The Copilot SDK provider uses a bounded client pool. Each Portal AI operation
+waits only for the configured pool-acquisition timeout and then runs under a
+separate response timeout. Each request creates a one-shot SDK session and
+destroys it in `finally`, including after errors and timeouts, before the client
+returns to the pool.
+
+Sessions are created with an empty tool set and receive no MCP servers, skills,
+or repository/workspace context. The Copilot CLI child process receives a
+sanitized environment with only the runtime and authentication variables it
+needs; the API service's unrelated credentials are not forwarded. Sessions are
+never reused across Portal AI requests.
+
+The Copilot SDK adapter preserves the Portal operation's system prompt and user
+prompt. Its model resolves independently from the REST default, in this order:
+an explicit request override, `PORTAL_COPILOT_MODEL`, `LLM_MODEL`, then automatic
+selection from the models available to the authenticated Copilot account. The
+automatic preference order is `gpt-5.4-mini`, `gpt-5.4`, `gpt-5.1`,
+`gpt-5-mini`, then the first model returned by Copilot. The SDK session API does
+not expose the REST chat-completions `temperature` or maximum-token controls, so
+those two settings apply only to the Foundry and legacy GitHub Models REST
+providers.
+
+### PORTAL_COPILOT_MODEL
+**Default:** automatic model discovery
+**Type:** string
+
+Optional Portal AI model override for the Copilot SDK provider. Resolution is:
+explicit request override → `PORTAL_COPILOT_MODEL` → `LLM_MODEL` → automatic
+available-model preference (`gpt-5.4-mini`, `gpt-5.4`, `gpt-5.1`,
+`gpt-5-mini`, then the first listed model). Do not assume the REST default
+`gpt-4.1` is available to the Copilot account.
+
+### PORTAL_COPILOT_POOL_SIZE
+**Default:** `2`
+**Type:** positive integer
+
+Maximum number of Copilot SDK clients that can serve Portal AI requests
+concurrently. Additional requests wait for a pooled client until
+`PORTAL_COPILOT_ACQUIRE_TIMEOUT_MS` expires.
+
+### PORTAL_COPILOT_ACQUIRE_TIMEOUT_MS
+**Default:** `30000` (30 seconds)
+**Type:** positive integer (milliseconds)
+
+Maximum time a Portal AI request waits for an available Copilot SDK client.
+Expiration fails the request; it does not trigger the GitHub Models fallback.
+
+### PORTAL_COPILOT_STARTUP_TIMEOUT_MS
+**Default:** `30000` (30 seconds)
+**Type:** positive integer (milliseconds)
+
+Maximum time allowed to start and ping a pooled Copilot CLI runtime. A runtime
+that cannot become ready in time is destroyed and is not added to the pool.
+
+### PORTAL_COPILOT_REQUEST_TIMEOUT_MS
+**Default:** `300000` (5 minutes)
+**Type:** positive integer (milliseconds)
+
+Maximum time for the one-shot Copilot SDK session to produce a response.
+Expiration destroys the session, returns the client to the pool, and fails the
+request without runtime provider failover.
+
+### PORTAL_COPILOT_SHUTDOWN_TIMEOUT_MS
+**Default:** `10000` (10 seconds)
+**Type:** positive integer (milliseconds)
+
+Maximum graceful shutdown time for an individual pooled Copilot CLI runtime and
+for draining the pool during API shutdown. Scope force-stops runtimes that do
+not stop within this limit.
+
+### PORTAL_COPILOT_IDLE_TIMEOUT_MS
+**Default:** `60000` (1 minute)
+**Type:** positive integer (milliseconds)
+
+How long an unused Copilot SDK client remains in the zero-minimum pool before
+it is reaped. The pool recreates clients on demand up to
+`PORTAL_COPILOT_POOL_SIZE`.
Every successful acquisition also logs a single line so operators can
verify which provider served a given AI call:
@@ -156,29 +231,36 @@ API key for the Foundry endpoint.
ExternalSecret (Key Vault key `azure-ai-inference-api-key`).
### GITHUB_MODELS_API_KEY
-**Optional (used as fallback when Foundry is not configured)**
+**Optional (legacy fallback after Foundry and Copilot SDK)**
**Type:** string
GitHub personal access token (with the `models` read permission) used to
authenticate with GitHub Models (`https://models.inference.ai.azure.com`).
-Useful for local dev where no Foundry endpoint is available. Goes in `.env`
+Retained for compatibility where neither Foundry nor a Copilot SDK credential
+is available. New deployments should prefer Foundry or register a classic PAT
+or OAuth token with Copilot access. Goes in `.env`
(or `.env.base`) since it is read via Compose variable substitution, not
the api service's `env_file`.
-> **Note:** This is separate from `GITHUB_TOKEN`, which is used by the Judge
-> and worker services for Copilot SDK / ACP access and does **not** need the
-> `models` permission. If `GITHUB_MODELS_API_KEY` is unset the API also
-> accepts `GITHUB_TOKEN` (or `TOKEN_MANAGER_URL` with a registered
-> `github-models` token) as a fallback.
+> **Note:** A classic PAT or OAuth token with the `copilot-sdk` capability can
+> enable Portal AI directly and does not need the `models` permission.
+> `GITHUB_MODELS_API_KEY`, registered `github-models` tokens, and the bare
+> `GITHUB_TOKEN` path are legacy compatibility fallbacks.
### LLM_MODEL
-**Default:** `gpt-4.1` (applied inside the API when unset)
+**Default:** `gpt-4.1` for REST inference; automatic discovery for Copilot SDK
**Type:** string
-Model name / deployment name used by both backends. For Foundry, this must
-match the deployment name on the Foundry resource. Examples: `gpt-4.1`,
-`gpt-4o`, `gpt-4.1-mini`, `gpt-5.4-mini`. Put in `.env.local` (see note above).
-The API discovers supported token-limit and sampling parameters from structured
+Fallback model/deployment override shared by Portal AI providers. For Foundry,
+this must match the deployment name on the Foundry resource. Foundry and legacy
+GitHub Models default to `gpt-4.1` when this is unset. Copilot SDK considers
+`LLM_MODEL` only after an explicit request model and `PORTAL_COPILOT_MODEL`; when
+all three are unset it discovers an available Copilot model instead of assuming
+`gpt-4.1`.
+
+REST examples include `gpt-4.1`, `gpt-4o`, `gpt-4.1-mini`, and
+`gpt-5.4-mini`. Put this setting in `.env.local` (see note above). The REST
+adapter discovers supported token-limit and sampling parameters from structured
inference errors at runtime. Learned compatibility is cached in each API
process by endpoint and deployment name. It is relearned after a process
restart or when Azure rejects a previously accepted request shape.
diff --git a/NOTICE b/NOTICE
index 3773e8ed3..ca6d06ae0 100644
--- a/NOTICE
+++ b/NOTICE
@@ -10365,6 +10365,36 @@ SOFTWARE.
-----------
+The following npm package may be included in this product:
+
+ - tarn@3.0.2
+
+This package contains the following license:
+
+The MIT License (MIT)
+
+Copyright (c) 2015 Vincit Oy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+-----------
+
The following npm package may be included in this product:
- ioredis@5.9.2
diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile
index 874efc590..39422fd4f 100644
--- a/apps/api/Dockerfile
+++ b/apps/api/Dockerfile
@@ -1,5 +1,8 @@
FROM node:22.22.0-slim AS builder
+# The Copilot SDK spawns its bundled CLI runtime, which uses the OS CA store.
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
+
ARG NPM_CONFIG_REGISTRY=https://registry.npmjs.org/
ENV npm_config_registry=${NPM_CONFIG_REGISTRY} \
COREPACK_NPM_REGISTRY=${NPM_CONFIG_REGISTRY}
@@ -46,6 +49,8 @@ CMD ["/app/scripts/dev-entrypoint.sh"]
# --- Production stage ---
FROM node:22.22.0-slim
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
+
ARG NPM_CONFIG_REGISTRY=https://registry.npmjs.org/
ENV npm_config_registry=${NPM_CONFIG_REGISTRY} \
COREPACK_NPM_REGISTRY=${NPM_CONFIG_REGISTRY}
diff --git a/apps/api/package.json b/apps/api/package.json
index 172be797d..714ad4644 100644
--- a/apps/api/package.json
+++ b/apps/api/package.json
@@ -18,6 +18,7 @@
"@azure/keyvault-secrets": "^4.8.0",
"@azure/storage-blob": "^12.26.0",
"@azure/storage-queue": "^12.24.0",
+ "@github/copilot-sdk": "1.0.1",
"cors": "^2.8.5",
"db-migrations": "workspace:*",
"dotenv": "^16.4.5",
@@ -27,9 +28,10 @@
"multer": "^2.2.0",
"openapi3-ts": "^4.5.0",
"shared": "workspace:*",
- "telemetry": "workspace:*",
"swagger-ui-express": "^5.0.1",
"tar-stream": "^3.1.7",
+ "tarn": "3.0.2",
+ "telemetry": "workspace:*",
"uuid": "^11.1.1",
"yaml": "^2.8.3",
"zod": "^4.3.6"
diff --git a/apps/api/src/copilot-client-pool.test.ts b/apps/api/src/copilot-client-pool.test.ts
new file mode 100644
index 000000000..5a557757f
--- /dev/null
+++ b/apps/api/src/copilot-client-pool.test.ts
@@ -0,0 +1,256 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+
+interface MockClient {
+ start: ReturnType;
+ ping: ReturnType;
+ listModels: ReturnType;
+ createSession: ReturnType;
+ deleteSession: ReturnType;
+ stop: ReturnType;
+ forceStop: ReturnType;
+}
+
+const mocks = vi.hoisted(() => ({
+ clientOptions: [] as Array>,
+ clients: [] as MockClient[],
+ mkdir: vi.fn(),
+ mkdtemp: vi.fn(),
+ rm: vi.fn(),
+ ping: vi.fn(),
+ sessionFactory: vi.fn(),
+}));
+
+interface MockSession {
+ sessionId: string;
+ on: ReturnType;
+ sendAndWait: ReturnType;
+ abort: ReturnType;
+ disconnect: ReturnType;
+}
+
+vi.mock("@github/copilot-sdk", () => ({
+ CopilotClient: class implements MockClient {
+ start = vi.fn(async () => undefined);
+ ping = vi.fn((message: string) => mocks.ping(message));
+ listModels = vi.fn(async () => [
+ { id: "test-default-model", name: "Test Default", capabilities: {} },
+ ]);
+ createSession = vi.fn((options: Record) =>
+ mocks.sessionFactory(options),
+ );
+ deleteSession = vi.fn(async () => undefined);
+ stop = vi.fn(async () => []);
+ forceStop = vi.fn(async () => undefined);
+
+ constructor(options: Record) {
+ mocks.clientOptions.push(options);
+ mocks.clients.push(this);
+ }
+ },
+}));
+
+vi.mock("node:fs/promises", () => ({
+ mkdir: mocks.mkdir,
+ mkdtemp: mocks.mkdtemp,
+ rm: mocks.rm,
+}));
+
+vi.mock("node:os", () => ({
+ tmpdir: () => "/scope-tests",
+}));
+
+vi.mock("shared", () => ({
+ TokenManagerClient: class {},
+ withRetry: (operation: () => Promise) => operation(),
+}));
+
+import { PortalCopilotClientPool } from "./copilot-client-pool.js";
+
+const pools: PortalCopilotClientPool[] = [];
+let sessionNumber = 0;
+
+function makeSession(overrides: Partial = {}): MockSession {
+ const sessionId = `session-${++sessionNumber}`;
+ return {
+ sessionId,
+ on: vi.fn(() => vi.fn()),
+ sendAndWait: vi.fn(async () => ({
+ data: { content: `response-${sessionId}` },
+ })),
+ abort: vi.fn(async () => undefined),
+ disconnect: vi.fn(async () => undefined),
+ ...overrides,
+ };
+}
+
+function makePool(): PortalCopilotClientPool {
+ const tokenClient = {
+ acquireToken: vi.fn(async () => "copilot-token"),
+ };
+ const pool = new PortalCopilotClientPool(
+ tokenClient as unknown as ConstructorParameters[0],
+ );
+ pools.push(pool);
+ return pool;
+}
+
+async function complete(pool: PortalCopilotClientPool, suffix = ""): Promise {
+ return pool.complete({
+ systemPrompt: `system${suffix}`,
+ userPrompt: `user${suffix}`,
+ model: "test-model",
+ });
+}
+
+beforeEach(() => {
+ vi.clearAllMocks();
+ mocks.clientOptions.length = 0;
+ mocks.clients.length = 0;
+ pools.length = 0;
+ sessionNumber = 0;
+ vi.stubEnv("PORTAL_COPILOT_POOL_SIZE", "1");
+ vi.stubEnv("PATH", "/usr/bin");
+ vi.stubEnv("LANG", "en_US.UTF-8");
+ vi.stubEnv("HOME", "/sensitive/home");
+ vi.stubEnv("GITHUB_TOKEN", "must-not-leak");
+ mocks.mkdtemp.mockResolvedValue("/scope-tests/runtime");
+ mocks.mkdir.mockResolvedValue(undefined);
+ mocks.rm.mockResolvedValue(undefined);
+ mocks.ping.mockResolvedValue({ message: "pong" });
+ mocks.sessionFactory.mockImplementation(() => makeSession());
+ vi.spyOn(console, "log").mockImplementation(() => undefined);
+ vi.spyOn(console, "warn").mockImplementation(() => undefined);
+});
+
+afterEach(async () => {
+ await Promise.allSettled(pools.map((pool) => pool.shutdown()));
+ vi.restoreAllMocks();
+ vi.unstubAllEnvs();
+});
+
+describe("PortalCopilotClientPool", () => {
+ it("starts an empty, sanitized runtime and creates a tool-free denied-permission session", async () => {
+ const pool = makePool();
+
+ await expect(complete(pool)).resolves.toBe("response-session-1");
+
+ expect(mocks.clientOptions).toHaveLength(1);
+ expect(mocks.clientOptions[0]).toMatchObject({
+ gitHubToken: "copilot-token",
+ useLoggedInUser: false,
+ mode: "empty",
+ enableRemoteSessions: false,
+ env: {
+ PATH: "/usr/bin",
+ LANG: "en_US.UTF-8",
+ },
+ });
+ expect(mocks.clientOptions[0].env).not.toHaveProperty("HOME");
+ expect(mocks.clientOptions[0].env).not.toHaveProperty("GITHUB_TOKEN");
+
+ const sessionOptions = mocks.clients[0].createSession.mock.calls[0][0];
+ expect(sessionOptions).toMatchObject({
+ model: "test-model",
+ availableTools: [],
+ excludedTools: ["builtin:*", "mcp:*"],
+ tools: [],
+ mcpServers: {},
+ skillDirectories: [],
+ customAgents: [],
+ enableConfigDiscovery: false,
+ skipCustomInstructions: true,
+ requestExtensions: false,
+ enableMcpApps: false,
+ });
+ expect(
+ (sessionOptions.onPermissionRequest as () => unknown)(),
+ ).toEqual({
+ kind: "reject",
+ feedback: "Portal AI completions do not permit tool execution.",
+ });
+
+ const session = await mocks.clients[0].createSession.mock.results[0].value;
+ expect(session.disconnect).toHaveBeenCalledOnce();
+ expect(mocks.clients[0].deleteSession).toHaveBeenCalledWith(session.sessionId);
+ });
+
+ it("does not release a resource for bounded reuse until its health ping succeeds", async () => {
+ let releaseHealthPing: (() => void) | undefined;
+ const healthGate = new Promise((resolve) => {
+ releaseHealthPing = resolve;
+ });
+ mocks.ping.mockImplementation(async (message: string) => {
+ if (message === "scope-portal-ai-health") await healthGate;
+ return { message: "pong" };
+ });
+ const pool = makePool();
+
+ const first = complete(pool, "-first");
+ await vi.waitFor(() => {
+ expect(mocks.ping).toHaveBeenCalledWith("scope-portal-ai-health");
+ });
+
+ const second = complete(pool, "-second");
+ await Promise.resolve();
+ expect(mocks.clients).toHaveLength(1);
+ expect(mocks.clients[0].createSession).toHaveBeenCalledTimes(1);
+
+ releaseHealthPing?.();
+ await expect(Promise.all([first, second])).resolves.toEqual([
+ "response-session-1",
+ "response-session-2",
+ ]);
+ expect(mocks.clients).toHaveLength(1);
+ expect(mocks.clients[0].createSession).toHaveBeenCalledTimes(2);
+ });
+
+ it("invalidates the pooled client when session cleanup fails", async () => {
+ const failedCleanupSession = makeSession({
+ disconnect: vi.fn(async () => {
+ throw new Error("disconnect failed");
+ }),
+ });
+ mocks.sessionFactory
+ .mockResolvedValueOnce(failedCleanupSession)
+ .mockImplementation(() => makeSession());
+ const pool = makePool();
+
+ await expect(complete(pool, "-first")).resolves.toBe(
+ `response-${failedCleanupSession.sessionId}`,
+ );
+ await expect(complete(pool, "-second")).resolves.toBe("response-session-2");
+
+ expect(mocks.clients).toHaveLength(2);
+ expect(mocks.clients[0].forceStop).toHaveBeenCalledOnce();
+ expect(mocks.clients[1].createSession).toHaveBeenCalledOnce();
+ });
+
+ it("drains resources on shutdown and rejects subsequent completions", async () => {
+ const pool = makePool();
+ await complete(pool);
+
+ await pool.shutdown();
+
+ expect(mocks.clients[0].stop).toHaveBeenCalledOnce();
+ expect(mocks.rm).toHaveBeenCalledWith(
+ "/scope-tests/runtime",
+ { recursive: true, force: true },
+ );
+ expect(pool.stats()).toEqual({
+ used: 0,
+ free: 0,
+ pendingAcquires: 0,
+ pendingCreates: 0,
+ resources: 0,
+ resourcesCreated: 1,
+ sessionsCreated: 1,
+ sessionsDeleted: 1,
+ });
+ await expect(complete(pool)).rejects.toThrow(
+ "Copilot SDK pool is shutting down",
+ );
+ });
+});
diff --git a/apps/api/src/copilot-client-pool.ts b/apps/api/src/copilot-client-pool.ts
new file mode 100644
index 000000000..0734a81f6
--- /dev/null
+++ b/apps/api/src/copilot-client-pool.ts
@@ -0,0 +1,508 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import {
+ CopilotClient,
+ type CopilotSession,
+ type PermissionHandler,
+} from "@github/copilot-sdk";
+import { mkdtemp, mkdir, rm } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { randomUUID } from "node:crypto";
+import { Pool } from "tarn";
+import { TokenManagerClient, withRetry } from "shared";
+
+const DEFAULT_POOL_SIZE = 2;
+const DEFAULT_ACQUIRE_TIMEOUT_MS = 30_000;
+const DEFAULT_STARTUP_TIMEOUT_MS = 30_000;
+const DEFAULT_REQUEST_TIMEOUT_MS = 300_000;
+const DEFAULT_SHUTDOWN_TIMEOUT_MS = 10_000;
+const DEFAULT_IDLE_TIMEOUT_MS = 60_000;
+
+interface CopilotPoolResource {
+ client: CopilotClient;
+ rootDirectory: string;
+ defaultModel: string;
+ healthy: boolean;
+ destroyed: boolean;
+}
+
+export interface CopilotPoolStats {
+ used: number;
+ free: number;
+ pendingAcquires: number;
+ pendingCreates: number;
+ resources: number;
+ resourcesCreated: number;
+ sessionsCreated: number;
+ sessionsDeleted: number;
+}
+
+export interface CopilotCompletionRequest {
+ systemPrompt: string;
+ userPrompt: string;
+ model?: string;
+}
+
+export class CopilotCredentialUnavailableError extends Error {
+ constructor(message: string, options?: ErrorOptions) {
+ super(message, options);
+ this.name = "CopilotCredentialUnavailableError";
+ }
+}
+
+function positiveInt(name: string, fallback: number): number {
+ const raw = process.env[name];
+ if (!raw) return fallback;
+ const parsed = Number.parseInt(raw, 10);
+ if (Number.isInteger(parsed) && parsed > 0) return parsed;
+ console.warn(`[portal-copilot] ignoring invalid ${name}=${JSON.stringify(raw)}`);
+ return fallback;
+}
+
+function sanitizedRuntimeEnv(): Record {
+ const allowed = [
+ "PATH",
+ "LANG",
+ "LC_ALL",
+ "TMPDIR",
+ "TMP",
+ "TEMP",
+ "SSL_CERT_FILE",
+ "SSL_CERT_DIR",
+ "NODE_EXTRA_CA_CERTS",
+ "HTTP_PROXY",
+ "HTTPS_PROXY",
+ "NO_PROXY",
+ "http_proxy",
+ "https_proxy",
+ "no_proxy",
+ ] as const;
+
+ const env: Record = {};
+ for (const name of allowed) {
+ const value = process.env[name];
+ if (value !== undefined) env[name] = value;
+ }
+ return env;
+}
+
+function errorText(error: unknown): string {
+ if (!(error instanceof Error)) return String(error);
+ const cause = error.cause;
+ const causeText =
+ cause && typeof cause === "object"
+ ? `${"message" in cause ? String(cause.message) : ""} ${"code" in cause ? String(cause.code) : ""}`
+ : "";
+ return `${error.message} ${causeText}`.trim();
+}
+
+function isRetryableCopilotError(error: unknown): boolean {
+ if (error instanceof CopilotCredentialUnavailableError) return false;
+ const text = errorText(error).toLowerCase();
+ if (
+ text.includes("authentication") ||
+ text.includes("unauthorized") ||
+ text.includes("forbidden") ||
+ text.includes("invalid token") ||
+ text.includes("protocol version mismatch")
+ ) {
+ return false;
+ }
+ return [
+ "timeout",
+ "timed out",
+ "aborted",
+ "fetch failed",
+ "econnreset",
+ "econnrefused",
+ "etimedout",
+ "socket hang up",
+ "rate limit",
+ "too many requests",
+ "http 429",
+ "http 500",
+ "http 502",
+ "http 503",
+ "http 504",
+ ].some((pattern) => text.includes(pattern));
+}
+
+async function withTimeout(
+ operation: Promise,
+ timeoutMs: number,
+ message: string,
+): Promise {
+ let timer: ReturnType | undefined;
+ const timeout = new Promise((_resolve, reject) => {
+ timer = setTimeout(() => reject(new Error(message)), timeoutMs);
+ });
+ return Promise.race([operation, timeout]).finally(() => {
+ if (timer) clearTimeout(timer);
+ });
+}
+
+const denyPermissions: PermissionHandler = () => ({
+ kind: "reject",
+ feedback: "Portal AI completions do not permit tool execution.",
+});
+
+export class PortalCopilotClientPool {
+ private readonly tokenClient: TokenManagerClient;
+ private readonly resources = new Set();
+ private readonly pool: Pool;
+ private readonly requestTimeoutMs: number;
+ private readonly startupTimeoutMs: number;
+ private readonly shutdownTimeoutMs: number;
+ private resourcesCreated = 0;
+ private sessionsCreated = 0;
+ private sessionsDeleted = 0;
+ private shuttingDown = false;
+
+ constructor(tokenClient = new TokenManagerClient()) {
+ this.tokenClient = tokenClient;
+ const max = positiveInt("PORTAL_COPILOT_POOL_SIZE", DEFAULT_POOL_SIZE);
+ const acquireTimeoutMillis = positiveInt(
+ "PORTAL_COPILOT_ACQUIRE_TIMEOUT_MS",
+ DEFAULT_ACQUIRE_TIMEOUT_MS,
+ );
+ this.startupTimeoutMs = positiveInt(
+ "PORTAL_COPILOT_STARTUP_TIMEOUT_MS",
+ DEFAULT_STARTUP_TIMEOUT_MS,
+ );
+ this.requestTimeoutMs = positiveInt(
+ "PORTAL_COPILOT_REQUEST_TIMEOUT_MS",
+ DEFAULT_REQUEST_TIMEOUT_MS,
+ );
+ this.shutdownTimeoutMs = positiveInt(
+ "PORTAL_COPILOT_SHUTDOWN_TIMEOUT_MS",
+ DEFAULT_SHUTDOWN_TIMEOUT_MS,
+ );
+
+ this.pool = new Pool({
+ min: 0,
+ max,
+ acquireTimeoutMillis,
+ createTimeoutMillis: this.startupTimeoutMs,
+ destroyTimeoutMillis: this.shutdownTimeoutMs,
+ idleTimeoutMillis: positiveInt(
+ "PORTAL_COPILOT_IDLE_TIMEOUT_MS",
+ DEFAULT_IDLE_TIMEOUT_MS,
+ ),
+ reapIntervalMillis: 1_000,
+ createRetryIntervalMillis: 500,
+ propagateCreateError: true,
+ create: () => this.createResource(),
+ validate: (resource) => resource.healthy && !resource.destroyed,
+ destroy: (resource) => this.destroyResource(resource),
+ log: (message) => console.warn(`[portal-copilot-pool] ${message}`),
+ });
+
+ this.pool.on("createFail", (_eventId, error) => {
+ console.warn(`[portal-copilot-pool] create failed: ${errorText(error)}`);
+ });
+ this.pool.on("acquireFail", (_eventId, error) => {
+ console.warn(`[portal-copilot-pool] acquire failed: ${errorText(error)}`);
+ });
+ }
+
+ stats(): CopilotPoolStats {
+ return {
+ used: this.pool.numUsed(),
+ free: this.pool.numFree(),
+ pendingAcquires: this.pool.numPendingAcquires(),
+ pendingCreates: this.pool.numPendingCreates(),
+ resources: this.resources.size,
+ resourcesCreated: this.resourcesCreated,
+ sessionsCreated: this.sessionsCreated,
+ sessionsDeleted: this.sessionsDeleted,
+ };
+ }
+
+ async complete(request: CopilotCompletionRequest): Promise {
+ if (this.shuttingDown) {
+ throw new Error("Copilot SDK pool is shutting down");
+ }
+
+ try {
+ return await withRetry(
+ () => this.completeOnce(request),
+ {
+ maxRetries: 2,
+ baseDelayMs: 500,
+ maxDelayMs: 5_000,
+ isRetryable: isRetryableCopilotError,
+ onRetry: (error: unknown, attempt: number) => {
+ console.warn(
+ `[portal-copilot] completion attempt ${attempt} failed: ${errorText(error)}`,
+ );
+ },
+ },
+ );
+ } catch (error) {
+ if (error instanceof CopilotCredentialUnavailableError) throw error;
+ throw new Error(`Copilot SDK request failed: ${errorText(error)}`, {
+ cause: error,
+ });
+ }
+ }
+
+ async shutdown(): Promise {
+ if (this.shuttingDown) return;
+ this.shuttingDown = true;
+
+ try {
+ await withTimeout(
+ this.pool.destroy(),
+ this.shutdownTimeoutMs,
+ `Copilot SDK pool did not drain within ${this.shutdownTimeoutMs}ms`,
+ );
+ console.log("[portal-copilot-pool] shutdown complete");
+ } catch (error) {
+ console.warn(`[portal-copilot-pool] graceful shutdown failed: ${errorText(error)}`);
+ await Promise.allSettled(
+ [...this.resources].map((resource) => this.destroyResource(resource, true)),
+ );
+ }
+ }
+
+ private async createResource(): Promise {
+ let token: string;
+ try {
+ token = await this.tokenClient.acquireToken("copilot-sdk");
+ } catch (error) {
+ throw new CopilotCredentialUnavailableError(
+ `No Copilot SDK credential is available: ${errorText(error)}`,
+ { cause: error },
+ );
+ }
+
+ const rootDirectory = await mkdtemp(join(tmpdir(), "scope-portal-copilot-"));
+ const workingDirectory = join(rootDirectory, "workspace");
+ const baseDirectory = join(rootDirectory, "copilot-home");
+ await Promise.all([
+ mkdir(workingDirectory, { recursive: true }),
+ mkdir(baseDirectory, { recursive: true }),
+ ]);
+
+ const client = new CopilotClient({
+ gitHubToken: token,
+ useLoggedInUser: false,
+ mode: "empty",
+ workingDirectory,
+ baseDirectory,
+ enableRemoteSessions: false,
+ sessionIdleTimeoutSeconds: 60,
+ logLevel: "warning",
+ env: sanitizedRuntimeEnv(),
+ });
+ const resource: CopilotPoolResource = {
+ client,
+ rootDirectory,
+ defaultModel: "",
+ healthy: true,
+ destroyed: false,
+ };
+ this.resources.add(resource);
+ this.resourcesCreated += 1;
+
+ try {
+ await withTimeout(
+ client.start(),
+ this.startupTimeoutMs,
+ `Copilot CLI did not start within ${this.startupTimeoutMs}ms`,
+ );
+ await withTimeout(
+ client.ping("scope-portal-ai-ready"),
+ this.startupTimeoutMs,
+ `Copilot CLI did not respond within ${this.startupTimeoutMs}ms`,
+ );
+ const models = await withTimeout(
+ client.listModels(),
+ this.startupTimeoutMs,
+ `Copilot model discovery did not finish within ${this.startupTimeoutMs}ms`,
+ );
+ const preferred = [
+ "gpt-5.4-mini",
+ "gpt-5.4",
+ "gpt-5.1",
+ "gpt-5-mini",
+ ];
+ resource.defaultModel =
+ preferred.find((id) => models.some((model) => model.id === id)) ||
+ models[0]?.id ||
+ "";
+ if (!resource.defaultModel) {
+ throw new Error("Copilot SDK returned no available models");
+ }
+ console.log(
+ `[portal-copilot-pool] started pooled Copilot CLI runtime defaultModel=${resource.defaultModel}`,
+ );
+ return resource;
+ } catch (error) {
+ resource.healthy = false;
+ await this.destroyResource(resource, true);
+ throw error;
+ }
+ }
+
+ private async completeOnce(request: CopilotCompletionRequest): Promise {
+ const pending = this.pool.acquire();
+ const resource = await pending.promise;
+ let session: CopilotSession | undefined;
+ let unsubscribe: (() => void) | undefined;
+ let reusable = true;
+ let fullResponse = "";
+
+ try {
+ session = await resource.client.createSession({
+ sessionId: randomUUID(),
+ model: request.model || resource.defaultModel,
+ streaming: true,
+ systemMessage: { mode: "replace", content: request.systemPrompt },
+ availableTools: [],
+ excludedTools: ["builtin:*", "mcp:*"],
+ tools: [],
+ mcpServers: {},
+ skillDirectories: [],
+ customAgents: [],
+ enableConfigDiscovery: false,
+ skipCustomInstructions: true,
+ requestCanvasRenderer: false,
+ requestExtensions: false,
+ enableMcpApps: false,
+ enableSessionTelemetry: false,
+ includeSubAgentStreamingEvents: false,
+ mcpOAuthTokenStorage: "in-memory",
+ onPermissionRequest: denyPermissions,
+ });
+ this.sessionsCreated += 1;
+
+ unsubscribe = session.on("assistant.message_delta", (event) => {
+ fullResponse += event.data.deltaContent;
+ });
+
+ const response = await session.sendAndWait(
+ { prompt: request.userPrompt },
+ this.requestTimeoutMs,
+ );
+ const content = fullResponse.trim() || response?.data.content?.trim() || "";
+ if (!content) {
+ throw new Error("Copilot SDK returned an empty response");
+ }
+ return content;
+ } catch (error) {
+ reusable = !(
+ errorText(error).toLowerCase().includes("authentication") ||
+ errorText(error).toLowerCase().includes("protocol") ||
+ errorText(error).toLowerCase().includes("connection") ||
+ errorText(error).toLowerCase().includes("process exited")
+ );
+ if (session && errorText(error).toLowerCase().includes("timeout")) {
+ await withTimeout(
+ session.abort(),
+ 5_000,
+ "Copilot session abort timed out",
+ ).catch(() => undefined);
+ }
+ throw error;
+ } finally {
+ unsubscribe?.();
+
+ if (session) {
+ try {
+ await withTimeout(
+ session.disconnect(),
+ this.shutdownTimeoutMs,
+ "Copilot session disconnect timed out",
+ );
+ await withTimeout(
+ resource.client.deleteSession(session.sessionId),
+ this.shutdownTimeoutMs,
+ "Copilot session deletion timed out",
+ );
+ this.sessionsDeleted += 1;
+ } catch (error) {
+ reusable = false;
+ console.warn(`[portal-copilot] session cleanup failed: ${errorText(error)}`);
+ }
+ }
+
+ if (reusable) {
+ try {
+ await withTimeout(
+ resource.client.ping("scope-portal-ai-health"),
+ 5_000,
+ "Copilot CLI health check timed out",
+ );
+ } catch (error) {
+ reusable = false;
+ console.warn(`[portal-copilot] health check failed: ${errorText(error)}`);
+ }
+ }
+
+ if (reusable) {
+ this.pool.release(resource);
+ } else {
+ resource.healthy = false;
+ await this.destroyResource(resource, true);
+ this.pool.release(resource);
+ }
+ }
+ }
+
+ private async destroyResource(
+ resource: CopilotPoolResource,
+ force = false,
+ ): Promise {
+ if (resource.destroyed) return;
+ resource.destroyed = true;
+ resource.healthy = false;
+
+ try {
+ if (force) {
+ await resource.client.forceStop().catch(() => undefined);
+ } else {
+ const errors = await withTimeout(
+ resource.client.stop(),
+ this.shutdownTimeoutMs,
+ `Copilot CLI did not stop within ${this.shutdownTimeoutMs}ms`,
+ );
+ if (errors.length > 0) {
+ console.warn(
+ `[portal-copilot-pool] client stopped with ${errors.length} cleanup error(s)`,
+ );
+ }
+ }
+ } catch (error) {
+ console.warn(`[portal-copilot-pool] stop failed: ${errorText(error)}`);
+ await resource.client.forceStop().catch(() => undefined);
+ } finally {
+ await rm(resource.rootDirectory, { recursive: true, force: true }).catch((error) => {
+ console.warn(`[portal-copilot-pool] temp cleanup failed: ${errorText(error)}`);
+ });
+ this.resources.delete(resource);
+ }
+ }
+}
+
+let sharedPool: PortalCopilotClientPool | undefined;
+
+export function getPortalCopilotClientPool(): PortalCopilotClientPool {
+ sharedPool ??= new PortalCopilotClientPool();
+ return sharedPool;
+}
+
+export async function shutdownPortalCopilotClientPool(): Promise {
+ const pool = sharedPool;
+ sharedPool = undefined;
+ await pool?.shutdown();
+}
+
+/** @internal */
+export function setPortalCopilotClientPoolForTests(
+ pool: PortalCopilotClientPool | undefined,
+): void {
+ sharedPool = pool;
+}
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index f35f6d0de..9803a0581 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -49,6 +49,7 @@ import { registerProfilesRoutes } from "./routes/profiles.js";
import { registerProjectsRoutes } from "./routes/projects.js";
import { ProjectScopeError } from "./utils/project-scope.js";
import { registerUsersRoutes } from "./routes/users.js";
+import { shutdownPortalCopilotClientPool } from "./copilot-client-pool.js";
import type { RouteContext } from "./route-context.js";
import type {
CriteriaDocument,
@@ -400,6 +401,7 @@ async function main(): Promise {
process.exitCode = 1;
}
void Promise.all([
+ shutdownPortalCopilotClientPool(),
userAccessCache?.close(),
heartbeatStore.close(),
mongoClient.close(),
diff --git a/apps/api/src/llm-token.test.ts b/apps/api/src/llm-token.test.ts
new file mode 100644
index 000000000..f274756ab
--- /dev/null
+++ b/apps/api/src/llm-token.test.ts
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+
+const mocks = vi.hoisted(() => ({
+ acquireToken: vi.fn(),
+ copilotComplete: vi.fn(),
+ modelClient: vi.fn(),
+ modelPost: vi.fn(),
+ parseFoundrySecret: vi.fn(),
+}));
+
+vi.mock("@azure-rest/ai-inference", () => ({
+ default: mocks.modelClient,
+ isUnexpected: (response: { status: string }) => response.status !== "200",
+}));
+
+vi.mock("@azure/core-auth", () => ({
+ AzureKeyCredential: class {
+ constructor(readonly key: string) {}
+ },
+}));
+
+vi.mock("shared", async (importOriginal) => {
+ const actual = await importOriginal();
+ return {
+ ...actual,
+ TokenManagerClient: class {
+ acquireToken = mocks.acquireToken;
+ },
+ parseAzureAiFoundrySecret: mocks.parseFoundrySecret,
+ };
+});
+
+vi.mock("./copilot-client-pool.js", () => {
+ class CopilotCredentialUnavailableError extends Error {}
+ return {
+ CopilotCredentialUnavailableError,
+ getPortalCopilotClientPool: () => ({ complete: mocks.copilotComplete }),
+ };
+});
+
+import {
+ completePortalLlm,
+ type PortalLlmCompletionRequest,
+} from "./llm-token.js";
+import { CopilotCredentialUnavailableError } from "./copilot-client-pool.js";
+
+const request: PortalLlmCompletionRequest = {
+ messages: [
+ { role: "system", content: "system" },
+ { role: "user", content: "user" },
+ ],
+ model: "request-model",
+ temperature: 0.2,
+ max_tokens: 128,
+};
+
+function completion(content: string) {
+ return {
+ status: "200",
+ body: { choices: [{ message: { content } }] },
+ };
+}
+
+beforeEach(() => {
+ vi.resetAllMocks();
+ for (const name of [
+ "AZURE_AI_INFERENCE_ENDPOINT",
+ "AZURE_AI_INFERENCE_API_KEY",
+ "TOKEN_MANAGER_URL",
+ "GITHUB_MODELS_API_KEY",
+ "GITHUB_TOKEN",
+ "LLM_MODEL",
+ ]) {
+ vi.stubEnv(name, "");
+ }
+ mocks.modelClient.mockReturnValue({
+ path: () => ({ post: mocks.modelPost }),
+ });
+ mocks.parseFoundrySecret.mockReturnValue(null);
+});
+
+afterEach(() => {
+ vi.unstubAllEnvs();
+});
+
+describe("completePortalLlm provider resolution", () => {
+ it("prefers an explicit Foundry configuration over Copilot and GitHub Models", async () => {
+ vi.stubEnv("AZURE_AI_INFERENCE_ENDPOINT", "https://foundry.services.ai.azure.com");
+ vi.stubEnv("AZURE_AI_INFERENCE_API_KEY", "foundry-key");
+ vi.stubEnv("GITHUB_TOKEN", "github-token");
+ mocks.modelPost.mockResolvedValue(completion("from-foundry"));
+
+ await expect(completePortalLlm(request, "explicit-model")).resolves.toBe("from-foundry");
+
+ expect(mocks.modelClient).toHaveBeenCalledWith(
+ "https://foundry.services.ai.azure.com/models",
+ expect.objectContaining({ key: "foundry-key" }),
+ );
+ expect(mocks.modelPost).toHaveBeenCalledWith({
+ body: expect.objectContaining({ model: "explicit-model" }),
+ });
+ expect(mocks.copilotComplete).not.toHaveBeenCalled();
+ });
+
+ it("uses a Token Manager Foundry credential before Copilot", async () => {
+ vi.stubEnv("TOKEN_MANAGER_URL", "https://tokens.example.test");
+ vi.stubEnv("GITHUB_TOKEN", "github-token");
+ mocks.acquireToken.mockResolvedValueOnce("serialized-foundry-secret");
+ mocks.parseFoundrySecret.mockReturnValue({
+ endpoint: "https://managed-foundry.example.test/models",
+ apiKey: "managed-key",
+ model: "managed-model",
+ });
+ mocks.modelPost.mockResolvedValue(completion("from-managed-foundry"));
+
+ await expect(completePortalLlm(request)).resolves.toBe("from-managed-foundry");
+
+ expect(mocks.acquireToken).toHaveBeenCalledWith("azure-ai-inference");
+ expect(mocks.modelPost).toHaveBeenCalledWith({
+ body: expect.objectContaining({ model: "managed-model" }),
+ });
+ expect(mocks.copilotComplete).not.toHaveBeenCalled();
+ });
+
+ it("falls back to the Copilot SDK when Foundry credentials are unavailable", async () => {
+ vi.stubEnv("GITHUB_TOKEN", "github-token");
+ mocks.copilotComplete.mockResolvedValue("from-copilot");
+
+ await expect(completePortalLlm(request, "copilot-model")).resolves.toBe("from-copilot");
+
+ expect(mocks.copilotComplete).toHaveBeenCalledWith({
+ systemPrompt: "system",
+ userPrompt: "user",
+ model: "copilot-model",
+ });
+ expect(mocks.modelPost).not.toHaveBeenCalled();
+ });
+
+ it("falls back to GitHub Models only when Copilot has no usable credential", async () => {
+ vi.stubEnv("TOKEN_MANAGER_URL", "https://tokens.example.test");
+ mocks.acquireToken
+ .mockRejectedValueOnce(new Error("no Foundry key"))
+ .mockResolvedValueOnce("github-models-key");
+ mocks.copilotComplete.mockRejectedValue(
+ new CopilotCredentialUnavailableError("no Copilot credential"),
+ );
+ mocks.modelPost.mockResolvedValue(completion("from-github-models"));
+
+ await expect(completePortalLlm(request)).resolves.toBe("from-github-models");
+
+ expect(mocks.copilotComplete).toHaveBeenCalledOnce();
+ expect(mocks.acquireToken).toHaveBeenNthCalledWith(2, "github-models");
+ expect(mocks.modelPost).toHaveBeenCalledOnce();
+ });
+
+ it("does not hide an inference failure by falling through to another provider", async () => {
+ vi.stubEnv("AZURE_AI_INFERENCE_ENDPOINT", "https://foundry.example.test/models");
+ vi.stubEnv("AZURE_AI_INFERENCE_API_KEY", "foundry-key");
+ vi.stubEnv("GITHUB_TOKEN", "github-token");
+ mocks.modelPost.mockResolvedValue({
+ status: "500",
+ body: { error: { message: "Foundry unavailable" } },
+ });
+
+ await expect(completePortalLlm(request)).rejects.toThrow(
+ "LLM request failed: Foundry unavailable",
+ );
+ expect(mocks.copilotComplete).not.toHaveBeenCalled();
+ });
+});
diff --git a/apps/api/src/llm-token.ts b/apps/api/src/llm-token.ts
index b9d080357..6b879cfc0 100644
--- a/apps/api/src/llm-token.ts
+++ b/apps/api/src/llm-token.ts
@@ -10,20 +10,30 @@
* 2. Azure AI Foundry via the Token Manager — TOKEN_MANAGER_URL with at
* least one registered `azure-ai-foundry` key (preferred for prod;
* round-robins across registered keys).
- * 3. GitHub Models — https://models.inference.ai.azure.com via
+ * 3. GitHub Copilot SDK — a bounded pool of tool-less Copilot CLI runtimes
+ * using the `copilot-sdk` Token Manager capability (or GITHUB_TOKEN).
+ * 4. GitHub Models — https://models.inference.ai.azure.com via
* GITHUB_MODELS_API_KEY → TokenManagerClient("github-models") → GITHUB_TOKEN
- * (fallback; slow public endpoint, fine for local dev only).
+ * (legacy compatibility fallback).
*
- * All three portal LLM modules (llm.ts, prompt-feature-llm.ts,
- * task-prompt-llm.ts) call acquireInferenceClient() instead of constructing
- * a ModelClient inline so the endpoint can be swapped in one place.
+ * All portal LLM modules call completePortalLlm() so provider selection and
+ * lifecycle policy remain centralized.
*/
-import ModelClient, { type ModelClient as ModelClientType } from "@azure-rest/ai-inference";
+import ModelClient, {
+ isUnexpected,
+ type ModelClient as ModelClientType,
+} from "@azure-rest/ai-inference";
import { AzureKeyCredential } from "@azure/core-auth";
import {
+ type ChatCompletionMessage,
TokenManagerClient,
parseAzureAiFoundrySecret,
} from "shared";
+import { postAdaptiveChatCompletion } from "./adaptive-chat-completions.js";
+import {
+ CopilotCredentialUnavailableError,
+ getPortalCopilotClientPool,
+} from "./copilot-client-pool.js";
const GITHUB_MODELS_ENDPOINT = "https://models.inference.ai.azure.com";
@@ -84,6 +94,8 @@ export function isInferenceError(err: unknown): err is Error {
return (
err.message.includes("not configured") ||
lower.includes("llm request failed") ||
+ lower.includes("copilot sdk") ||
+ lower.includes("copilot cli") ||
lower.includes("resource not found") ||
lower.includes("authentication failed")
);
@@ -103,11 +115,19 @@ export function isGitHubModelsTokenAvailable(): boolean {
);
}
+export function isCopilotSdkTokenAvailable(): boolean {
+ return !!(process.env.GITHUB_TOKEN || process.env.TOKEN_MANAGER_URL);
+}
+
/**
- * Returns true if any inference backend (Foundry or GitHub Models) is configured.
+ * Returns true if any inference backend is configured.
*/
export function isLlmAvailable(): boolean {
- return isFoundryConfigured() || isGitHubModelsTokenAvailable();
+ return (
+ isFoundryConfigured() ||
+ isCopilotSdkTokenAvailable() ||
+ isGitHubModelsTokenAvailable()
+ );
}
/**
@@ -150,7 +170,10 @@ export async function acquireGitHubModelsToken(): Promise {
);
}
-export type InferenceSource = "azure-ai-foundry" | "github-models";
+export type InferenceSource =
+ | "azure-ai-foundry"
+ | "copilot-sdk"
+ | "github-models";
/**
* How the credential was actually resolved. Useful for log lines so an
@@ -160,6 +183,8 @@ export type InferenceSource = "azure-ai-foundry" | "github-models";
export type InferenceVia =
| "azure-ai-foundry-env"
| "azure-ai-foundry-token-manager"
+ | "copilot-sdk-env"
+ | "copilot-sdk-token-manager"
| "github-models-env"
| "github-models-token-manager"
| "github-token";
@@ -213,16 +238,7 @@ async function tryAcquireFoundryFromTokenManager(): Promise<{
}
}
-/**
- * Build a ModelClient for the configured inference backend.
- *
- * Tries Azure AI Foundry first (env vars, then Token Manager), then falls
- * back to GitHub Models. See module docstring for the full priority order.
- *
- * @throws Error if no inference backend is configured.
- */
-export async function acquireInferenceClient(): Promise {
- // 1. Azure AI Foundry via env vars — explicit override, preferred locally.
+async function tryAcquireFoundryClient(): Promise {
if (isFoundryConfigured()) {
const endpoint = normalizeFoundryEndpoint(process.env.AZURE_AI_INFERENCE_ENDPOINT!);
const apiKey = process.env.AZURE_AI_INFERENCE_API_KEY!;
@@ -238,38 +254,176 @@ export async function acquireInferenceClient(): Promise {
return handle;
}
- // 2. Azure AI Foundry via the Token Manager — preferred in production.
const tmFoundry = await tryAcquireFoundryFromTokenManager();
- if (tmFoundry) {
- const model = tmFoundry.model || process.env.LLM_MODEL || "gpt-4.1";
- const handle: InferenceClientHandle = {
- client: ModelClient(tmFoundry.endpoint, new AzureKeyCredential(tmFoundry.apiKey)),
- endpoint: tmFoundry.endpoint,
- source: "azure-ai-foundry",
- via: "azure-ai-foundry-token-manager",
- model,
- };
- logInferenceAcquired(handle);
- return handle;
+ if (!tmFoundry) return null;
+
+ const model = tmFoundry.model || process.env.LLM_MODEL || "gpt-4.1";
+ const handle: InferenceClientHandle = {
+ client: ModelClient(tmFoundry.endpoint, new AzureKeyCredential(tmFoundry.apiKey)),
+ endpoint: tmFoundry.endpoint,
+ source: "azure-ai-foundry",
+ via: "azure-ai-foundry-token-manager",
+ model,
+ };
+ logInferenceAcquired(handle);
+ return handle;
+}
+
+async function acquireGitHubModelsClient(): Promise {
+ const token = await acquireGitHubModelsToken();
+ const via: InferenceVia = process.env.GITHUB_MODELS_API_KEY
+ ? "github-models-env"
+ : process.env.TOKEN_MANAGER_URL
+ ? "github-models-token-manager"
+ : "github-token";
+ const handle: InferenceClientHandle = {
+ client: ModelClient(GITHUB_MODELS_ENDPOINT, new AzureKeyCredential(token)),
+ endpoint: GITHUB_MODELS_ENDPOINT,
+ source: "github-models",
+ via,
+ };
+ logInferenceAcquired(handle);
+ return handle;
+}
+
+export interface PortalLlmCompletionRequest {
+ messages: [
+ { role: "system"; content: string },
+ { role: "user"; content: string },
+ ];
+ model: string;
+ temperature: number;
+ max_tokens: number;
+}
+
+function inferenceErrorMessage(body: unknown, status: string): string {
+ if (
+ body &&
+ typeof body === "object" &&
+ "error" in body &&
+ body.error &&
+ typeof body.error === "object" &&
+ "message" in body.error &&
+ typeof body.error.message === "string"
+ ) {
+ return body.error.message;
+ }
+ return status;
+}
+
+async function completeWithRestInference(
+ handle: InferenceClientHandle,
+ request: PortalLlmCompletionRequest,
+): Promise {
+ const messages: ChatCompletionMessage[] = request.messages;
+ const response = await postAdaptiveChatCompletion({
+ endpoint: handle.endpoint,
+ model: request.model,
+ messages,
+ temperature: request.temperature,
+ maxTokens: request.max_tokens,
+ send: (body) => handle.client.path("/chat/completions").post({ body }),
+ });
+
+ if (isUnexpected(response)) {
+ throw new Error(
+ `LLM request failed: ${inferenceErrorMessage(response.body, response.status)}`,
+ );
+ }
+
+ const content = response.body.choices?.[0]?.message?.content;
+ if (!content) {
+ throw new Error("LLM returned empty response");
}
+ return content;
+}
+
+/**
+ * Complete one Portal AI request using the configured provider chain:
+ * Foundry env, Foundry Token Manager, Copilot SDK, then legacy GitHub Models.
+ *
+ * Provider fallback only happens while resolving a credential. Once a provider
+ * begins inference, its errors are surfaced and never hidden by another backend.
+ */
+export async function completePortalLlm(
+ request: PortalLlmCompletionRequest,
+ explicitModel?: string,
+): Promise {
+ const foundry = await tryAcquireFoundryClient();
+ if (foundry) {
+ const model =
+ explicitModel ||
+ foundry.model ||
+ process.env.LLM_MODEL ||
+ request.model ||
+ "gpt-4.1";
+ return completeWithRestInference(foundry, { ...request, model });
+ }
+
+ if (isCopilotSdkTokenAvailable()) {
+ try {
+ const via: InferenceVia = process.env.GITHUB_TOKEN
+ ? "copilot-sdk-env"
+ : "copilot-sdk-token-manager";
+ const copilotModel =
+ explicitModel ||
+ process.env.PORTAL_COPILOT_MODEL ||
+ process.env.LLM_MODEL;
+ console.log(
+ `[llm-token] inference provider: source=copilot-sdk via=${via} model=${copilotModel || "auto"}`,
+ );
+ return await getPortalCopilotClientPool().complete({
+ systemPrompt: request.messages[0].content,
+ userPrompt: request.messages[1].content,
+ model: copilotModel,
+ });
+ } catch (error) {
+ if (!(error instanceof CopilotCredentialUnavailableError)) {
+ throw error;
+ }
+ }
+ }
+
+ if (isGitHubModelsTokenAvailable()) {
+ let githubModels: InferenceClientHandle | null = null;
+ try {
+ githubModels = await acquireGitHubModelsClient();
+ } catch {
+ // Credential resolution failed; continue to the unified unavailable error.
+ }
+ if (githubModels) {
+ return completeWithRestInference(githubModels, {
+ ...request,
+ model:
+ explicitModel ||
+ process.env.LLM_MODEL ||
+ request.model ||
+ "gpt-4.1",
+ });
+ }
+ }
+
+ throw new Error(
+ "LLM not configured: no inference backend available. Register an Azure AI Foundry credential, a GitHub token with Copilot SDK capability, or a legacy GitHub Models key."
+ );
+}
+
+/**
+ * Build a ModelClient for the configured inference backend.
+ *
+ * Tries Azure AI Foundry first (env vars, then Token Manager), then falls
+ * back to GitHub Models. See module docstring for the full priority order.
+ *
+ * @throws Error if no inference backend is configured.
+ */
+export async function acquireInferenceClient(): Promise {
+ const foundry = await tryAcquireFoundryClient();
+ if (foundry) return foundry;
- // 3. GitHub Models — public fallback (slow; fine for local dev).
+ // Legacy REST-only helper: Copilot SDK is exposed through completePortalLlm().
if (isGitHubModelsTokenAvailable()) {
try {
- const token = await acquireGitHubModelsToken();
- const via: InferenceVia = process.env.GITHUB_MODELS_API_KEY
- ? "github-models-env"
- : process.env.TOKEN_MANAGER_URL
- ? "github-models-token-manager"
- : "github-token";
- const handle: InferenceClientHandle = {
- client: ModelClient(GITHUB_MODELS_ENDPOINT, new AzureKeyCredential(token)),
- endpoint: GITHUB_MODELS_ENDPOINT,
- source: "github-models",
- via,
- };
- logInferenceAcquired(handle);
- return handle;
+ return await acquireGitHubModelsClient();
} catch {
// No usable GitHub Models token after all — drop through to the
// unified "no backend configured" error below so the UI gets a
@@ -279,6 +433,6 @@ export async function acquireInferenceClient(): Promise {
}
throw new Error(
- "LLM not configured: no inference backend available. Please register a new secret key for GitHub Model or Azure Foundry."
+ "LLM not configured: no REST inference backend available. Register an Azure AI Foundry credential or a legacy GitHub Models key."
);
}
diff --git a/apps/api/src/llm.test.ts b/apps/api/src/llm.test.ts
index df069a242..e6ebf08da 100644
--- a/apps/api/src/llm.test.ts
+++ b/apps/api/src/llm.test.ts
@@ -11,11 +11,23 @@ vi.mock("@azure-rest/ai-inference", () => ({
// Mock the inference client acquisition; the per-test `postSpy` drives responses.
const postSpy = vi.fn();
vi.mock("./llm-token.js", () => ({
- acquireInferenceClient: vi.fn(async () => ({
- client: { path: () => ({ post: postSpy }) },
- endpoint: "https://test.example.com/models",
- model: "test-model",
- })),
+ completePortalLlm: vi.fn(async (request: {
+ messages: Array<{ role: string; content: string }>;
+ model: string;
+ temperature: number;
+ max_tokens: number;
+ }, explicitModel?: string) => {
+ const { postAdaptiveChatCompletion } = await import("./adaptive-chat-completions.js");
+ const response = await postAdaptiveChatCompletion({
+ endpoint: "https://test.example.com/models",
+ model: explicitModel || request.model,
+ messages: request.messages,
+ temperature: request.temperature,
+ maxTokens: request.max_tokens,
+ send: (body) => postSpy({ body }),
+ });
+ return response.body.choices[0].message.content;
+ }),
isLlmAvailable: () => true,
}));
diff --git a/apps/api/src/llm.ts b/apps/api/src/llm.ts
index 90393f2b6..3a9836d5d 100644
--- a/apps/api/src/llm.ts
+++ b/apps/api/src/llm.ts
@@ -5,9 +5,10 @@ import {
gatesSatisfyInvariant,
type GateId,
} from "shared";
-import { isUnexpected } from "@azure-rest/ai-inference";
-import { postAdaptiveChatCompletion } from "./adaptive-chat-completions.js";
-import { acquireInferenceClient, isLlmAvailable as inferenceAvailable } from "./llm-token.js";
+import {
+ completePortalLlm,
+ isLlmAvailable as inferenceAvailable,
+} from "./llm-token.js";
export type SuggestDirection = "parents" | "children";
@@ -180,8 +181,6 @@ export function isLlmAvailable(): boolean {
return inferenceAvailable();
}
-type ChatClient = Awaited>["client"];
-
function sanitizeId(suggestedId: unknown): string {
if (typeof suggestedId !== "string") return "new_criterion";
const sanitized = suggestedId
@@ -292,29 +291,10 @@ export function selectCriteriaDependencyPool(
}
async function chat(
- llm: ChatClient,
- endpoint: string,
request: CriteriaPromptRequest,
+ explicitModel?: string,
): Promise {
- const response = await postAdaptiveChatCompletion({
- endpoint,
- model: request.model,
- messages: request.messages,
- temperature: request.temperature,
- maxTokens: request.max_tokens,
- send: (body) => llm.path("/chat/completions").post({ body }),
- });
-
- if (isUnexpected(response)) {
- const errBody = response.body as any;
- throw new Error(`LLM request failed: ${errBody?.error?.message || response.status}`);
- }
-
- const content = response.body.choices?.[0]?.message?.content;
- if (!content) {
- throw new Error("LLM returned empty response");
- }
- return content;
+ return completePortalLlm(request, explicitModel);
}
/**
@@ -322,16 +302,14 @@ async function chat(
* is the one indispensable result of generation.
*/
async function author(
- llm: ChatClient,
- endpoint: string,
model: string,
behavior: string,
gates?: GateId[],
+ explicitModel?: string,
): Promise<{ prompt: string; suggestedId: string }> {
const content = await chat(
- llm,
- endpoint,
buildCriteriaAuthoringRequest(behavior, gates, model),
+ explicitModel,
);
return parseCriteriaAuthoringResponse(content);
}
@@ -363,23 +341,21 @@ function buildSuggestMessage(
*/
async function suggestDeps(
direction: SuggestDirection,
- llm: ChatClient,
- endpoint: string,
model: string,
behavior: string,
pool: ExistingCriterion[],
+ explicitModel?: string,
): Promise {
if (pool.length === 0) return [];
try {
const content = await chat(
- llm,
- endpoint,
buildCriteriaDependencySuggestionRequest(
direction,
behavior,
pool,
model,
),
+ explicitModel,
);
return parseCriteriaDependencySuggestionResponse(content, pool);
} catch (err) {
@@ -408,14 +384,7 @@ export async function generateCriteriaPrompt(
newGates?: GateId[],
model?: string,
): Promise {
- const {
- client: llm,
- endpoint,
- model: foundryModel,
- } = await acquireInferenceClient();
-
- // Priority: explicit arg > key-specific (from Foundry blob) > env > default.
- const modelName = model || foundryModel || process.env.LLM_MODEL || "gpt-4.1";
+ const modelName = model || process.env.LLM_MODEL || "gpt-4.1";
const parentPool = selectCriteriaDependencyPool(
"parents",
@@ -429,22 +398,20 @@ export async function generateCriteriaPrompt(
);
const [authored, suggestedParents, suggestedChildrenRaw] = await Promise.all([
- author(llm, endpoint, modelName, behavior, newGates),
+ author(modelName, behavior, newGates, model),
suggestDeps(
"parents",
- llm,
- endpoint,
modelName,
behavior,
parentPool,
+ model,
),
suggestDeps(
"children",
- llm,
- endpoint,
modelName,
behavior,
childPool,
+ model,
),
]);
diff --git a/apps/api/src/portal-ai-copilot.integration.test.ts b/apps/api/src/portal-ai-copilot.integration.test.ts
new file mode 100644
index 000000000..26ff853b4
--- /dev/null
+++ b/apps/api/src/portal-ai-copilot.integration.test.ts
@@ -0,0 +1,175 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import express from "express";
+import request from "supertest";
+import { OpenAPIRegistry } from "@asteasolutions/zod-to-openapi";
+import { afterAll, describe, expect, it } from "vitest";
+import type { RouteContext } from "./route-context.js";
+import { registerCriteriaRoutes } from "./routes/criteria.js";
+import { registerPromptFeaturesRoutes } from "./routes/prompt-features.js";
+import { registerTaskPromptsRoutes } from "./routes/task-prompts.js";
+import {
+ getPortalCopilotClientPool,
+ shutdownPortalCopilotClientPool,
+} from "./copilot-client-pool.js";
+
+const integrationEnabled =
+ process.env.RUN_PORTAL_AI_COPILOT_INTEGRATION === "1" &&
+ !!process.env.TOKEN_MANAGER_URL;
+const describeIntegration = integrationEnabled ? describe : describe.skip;
+
+function cursor(rows: T[]) {
+ return {
+ project() {
+ return this;
+ },
+ sort() {
+ return this;
+ },
+ limit() {
+ return this;
+ },
+ async toArray() {
+ return rows;
+ },
+ };
+}
+
+function createPortalAiApp() {
+ const app = express();
+ app.use(express.json());
+
+ const criteria = [
+ {
+ id: "has_tests",
+ prompt: "The project includes tests.",
+ dependsOn: [],
+ gates: ["select"],
+ },
+ {
+ id: "tests_pass",
+ prompt: "The captured test command succeeds.",
+ dependsOn: ["has_tests"],
+ gates: ["select", "test"],
+ },
+ ];
+ const promptFeatures = [
+ {
+ id: "asks_for_tests",
+ prompt: "The task asks the coding agent to add or run tests.",
+ type: "select",
+ },
+ ];
+
+ const ctx = {
+ app,
+ registry: new OpenAPIRegistry(),
+ criteriaCollection: {
+ find: () => cursor(criteria),
+ },
+ promptFeatureCollection: {
+ find: () => cursor(promptFeatures),
+ },
+ taskPromptCollection: {
+ find: () => cursor([]),
+ },
+ } as unknown as RouteContext;
+
+ registerCriteriaRoutes(ctx);
+ registerPromptFeaturesRoutes(ctx);
+ registerTaskPromptsRoutes(ctx);
+ app.use((error: Error, _req: express.Request, res: express.Response, _next: express.NextFunction) => {
+ res.status(500).json({ error: error.message });
+ });
+ return app;
+}
+
+describeIntegration("Portal AI Copilot end-to-end smoke", () => {
+ const app = createPortalAiApp();
+
+ afterAll(async () => {
+ await shutdownPortalCopilotClientPool();
+ });
+
+ it("forces Token Manager to Copilot SDK and exercises every Portal AI route", async () => {
+ expect(process.env.GITHUB_TOKEN).toBeFalsy();
+ expect(process.env.GITHUB_MODELS_API_KEY).toBeFalsy();
+ expect(process.env.AZURE_AI_INFERENCE_ENDPOINT).toBeFalsy();
+ expect(process.env.AZURE_AI_INFERENCE_API_KEY).toBeFalsy();
+
+ const pool = getPortalCopilotClientPool();
+ const before = pool.stats();
+
+ const criterion = await request(app)
+ .post("/api/v1/criteria/generate-prompt")
+ .send({
+ behavior: "The project includes meaningful automated tests.",
+ gates: ["select"],
+ })
+ .expect(200);
+ expect(criterion.body).toEqual({
+ prompt: expect.any(String),
+ suggestedId: expect.any(String),
+ suggestedParents: expect.any(Array),
+ suggestedChildren: expect.any(Array),
+ });
+
+ const afterCriterion = pool.stats();
+ expect(afterCriterion.sessionsCreated - before.sessionsCreated).toBe(3);
+ expect(afterCriterion.sessionsDeleted - before.sessionsDeleted).toBe(3);
+ expect(afterCriterion.resourcesCreated - before.resourcesCreated).toBeLessThanOrEqual(
+ Number(process.env.PORTAL_COPILOT_POOL_SIZE || 2),
+ );
+ expect(afterCriterion.used).toBe(0);
+ expect(afterCriterion.pendingAcquires).toBe(0);
+
+ const generatedTask = await request(app)
+ .post("/api/v1/task-prompts/generate")
+ .send({ description: "A small TypeScript REST API with tests." })
+ .expect(200);
+ expect(generatedTask.body.taskPrompt).toEqual(expect.any(String));
+
+ const variedTask = await request(app)
+ .post("/api/v1/task-prompts/generate")
+ .send({
+ existingPrompt: generatedTask.body.taskPrompt,
+ description: "Use Python instead of TypeScript.",
+ })
+ .expect(200);
+ expect(variedTask.body.taskPrompt).toEqual(expect.any(String));
+
+ const generatedFeature = await request(app)
+ .post("/api/v1/prompt-features/generate-prompt")
+ .send({ behavior: "The task asks for automated tests." })
+ .expect(200);
+ expect(generatedFeature.body).toEqual({
+ prompt: expect.any(String),
+ suggestedId: expect.any(String),
+ suggestedParents: expect.any(Array),
+ suggestedChildren: expect.any(Array),
+ });
+
+ const extracted = await request(app)
+ .post("/api/v1/prompt-features/extract-from-text")
+ .send({
+ text: "Create a TypeScript service and include unit tests.",
+ type: "select",
+ })
+ .expect(200);
+ expect(extracted.body).toEqual({
+ features: expect.any(Array),
+ cached: false,
+ ...(extracted.body.suggestedFeatures
+ ? { suggestedFeatures: expect.any(Array) }
+ : {}),
+ });
+
+ const after = pool.stats();
+ expect(after.sessionsCreated - before.sessionsCreated).toBe(7);
+ expect(after.sessionsDeleted).toBe(after.sessionsCreated);
+ expect(after.used).toBe(0);
+ expect(after.pendingAcquires).toBe(0);
+ expect(after.pendingCreates).toBe(0);
+ });
+});
diff --git a/apps/api/src/portal-ai-copy.test.ts b/apps/api/src/portal-ai-copy.test.ts
new file mode 100644
index 000000000..5bc273000
--- /dev/null
+++ b/apps/api/src/portal-ai-copy.test.ts
@@ -0,0 +1,16 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, expect, it } from "vitest";
+import { PORTAL_AI_NOT_CONFIGURED_ERROR } from "./portal-ai-copy.js";
+
+describe("Portal AI fallback copy", () => {
+ it("recommends Copilot SDK and identifies GitHub Models as legacy", () => {
+ expect(PORTAL_AI_NOT_CONFIGURED_ERROR).toContain(
+ "GitHub token with Copilot SDK capability",
+ );
+ expect(PORTAL_AI_NOT_CONFIGURED_ERROR).toContain(
+ "legacy GitHub Models key",
+ );
+ });
+});
diff --git a/apps/api/src/portal-ai-copy.ts b/apps/api/src/portal-ai-copy.ts
new file mode 100644
index 000000000..d2ca4370f
--- /dev/null
+++ b/apps/api/src/portal-ai-copy.ts
@@ -0,0 +1,5 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+export const PORTAL_AI_NOT_CONFIGURED_ERROR =
+ "LLM not configured: no inference backend available. Register an Azure AI Foundry credential, a GitHub token with Copilot SDK capability, or a legacy GitHub Models key.";
diff --git a/apps/api/src/prompt-feature-llm.ts b/apps/api/src/prompt-feature-llm.ts
index dc1cdff79..626e68d8d 100644
--- a/apps/api/src/prompt-feature-llm.ts
+++ b/apps/api/src/prompt-feature-llm.ts
@@ -1,14 +1,15 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-import { isUnexpected } from "@azure-rest/ai-inference";
import {
PromptFeatureConfig,
PromptFeatureResult,
SuggestedPromptFeature,
} from "shared";
-import { postAdaptiveChatCompletion } from "./adaptive-chat-completions.js";
-import { acquireInferenceClient, isLlmAvailable as inferenceAvailable } from "./llm-token.js";
+import {
+ completePortalLlm,
+ isLlmAvailable as inferenceAvailable,
+} from "./llm-token.js";
// ---------------------------------------------------------------------------
// Generate prompt feature prompt (mirrors criteria generateCriteriaPrompt)
@@ -166,40 +167,14 @@ export async function generatePromptFeaturePrompt(
existingFeatures: ExistingPromptFeature[] = [],
model?: string,
): Promise {
- const {
- client: llm,
- endpoint,
- model: foundryModel,
- } = await acquireInferenceClient();
-
- // Priority: explicit arg > key-specific (from Foundry blob) > env > default.
- const modelName = model || foundryModel || process.env.LLM_MODEL || "gpt-4.1";
+ const modelName = model || process.env.LLM_MODEL || "gpt-4.1";
const request = buildPromptFeatureAuthoringRequest(
behavior,
existingFeatures,
modelName,
);
- const response = await postAdaptiveChatCompletion({
- endpoint,
- model: request.model,
- messages: request.messages,
- temperature: request.temperature,
- maxTokens: request.max_tokens,
- send: (body) => llm.path("/chat/completions").post({ body }),
- });
-
- if (isUnexpected(response)) {
- const errBody = response.body as any;
- throw new Error(
- `LLM request failed: ${errBody?.error?.message || response.status}`,
- );
- }
-
- const content = response.body.choices?.[0]?.message?.content;
- if (!content) {
- throw new Error("LLM returned empty response");
- }
+ const content = await completePortalLlm(request, model);
return parsePromptFeatureAuthoringResponse(content, existingFeatures);
}
@@ -348,40 +323,14 @@ export async function extractPromptFeatures(
features: PromptFeatureConfig[],
model?: string,
): Promise {
- const {
- client: llm,
- endpoint,
- model: foundryModel,
- } = await acquireInferenceClient();
-
- // Priority: explicit arg > key-specific (from Foundry blob) > env > default.
- const modelName = model || foundryModel || process.env.LLM_MODEL || "gpt-4.1";
+ const modelName = model || process.env.LLM_MODEL || "gpt-4.1";
const request = buildPromptFeatureExtractionRequest(
taskText,
features,
modelName,
);
- const response = await postAdaptiveChatCompletion({
- endpoint,
- model: request.model,
- messages: request.messages,
- temperature: request.temperature,
- maxTokens: request.max_tokens,
- send: (body) => llm.path("/chat/completions").post({ body }),
- });
-
- if (isUnexpected(response)) {
- const errBody = response.body as any;
- throw new Error(
- `LLM extraction failed: ${errBody?.error?.message || response.status}`,
- );
- }
-
- const content = response.body.choices?.[0]?.message?.content;
- if (!content) {
- throw new Error("LLM returned empty response");
- }
+ const content = await completePortalLlm(request, model);
return parsePromptFeatureExtractionResponse(content, features);
}
diff --git a/apps/api/src/prompt-request-transport.test.ts b/apps/api/src/prompt-request-transport.test.ts
index ca03672c9..f4f261411 100644
--- a/apps/api/src/prompt-request-transport.test.ts
+++ b/apps/api/src/prompt-request-transport.test.ts
@@ -31,11 +31,28 @@ vi.mock("@azure-rest/ai-inference", () => ({
}));
vi.mock("./llm-token.js", () => ({
- acquireInferenceClient: async () => ({
- client: { path: () => ({ post: mockPost }) },
- endpoint: "https://prompt-transport.example.test/models",
- model: "test-deployment",
- }),
+ completePortalLlm: async (request: {
+ messages: ChatCompletionRequestBody["messages"];
+ model: string;
+ temperature: number;
+ max_tokens: number;
+ }, explicitModel?: string) => {
+ const { postAdaptiveChatCompletion } = await import("./adaptive-chat-completions.js");
+ const response = await postAdaptiveChatCompletion({
+ endpoint: "https://prompt-transport.example.test/models",
+ model: explicitModel || request.model,
+ messages: request.messages,
+ temperature: request.temperature,
+ maxTokens: request.max_tokens,
+ send: (body) => mockPost({ body }),
+ });
+ const body = response.body as {
+ choices?: Array<{ message?: { content?: string } }>;
+ };
+ const content = body.choices?.[0]?.message?.content;
+ if (!content) throw new Error("LLM returned empty response");
+ return content;
+ },
isLlmAvailable: () => true,
}));
diff --git a/apps/api/src/routes/criteria.ts b/apps/api/src/routes/criteria.ts
index 36564769e..6408098c6 100644
--- a/apps/api/src/routes/criteria.ts
+++ b/apps/api/src/routes/criteria.ts
@@ -19,6 +19,7 @@ import { computeMdp } from "../criteria-mdp.js";
import type { MdpAnalyzableRun } from "../criteria-mdp.js";
import { generateCriteriaPrompt, isLlmAvailable } from "../llm.js";
import { isInferenceError } from "../llm-token.js";
+import { PORTAL_AI_NOT_CONFIGURED_ERROR } from "../portal-ai-copy.js";
import { ProjectIdQuerySchema, OptionalProjectIdQuerySchema, getQueryProjectId, getOptionalQueryProjectId } from "../utils/project-scope.js";
/**
@@ -84,7 +85,7 @@ apiRoute(ctx.app, ctx.registry, {
}
if (!isLlmAvailable()) {
- res.status(503).json({ error: "LLM not configured: no inference backend available. Please register a new secret key for GitHub Model or Azure Foundry." });
+ res.status(503).json({ error: PORTAL_AI_NOT_CONFIGURED_ERROR });
return;
}
diff --git a/apps/api/src/routes/prompt-features.ts b/apps/api/src/routes/prompt-features.ts
index 30e96f5ef..ca2eafea9 100644
--- a/apps/api/src/routes/prompt-features.ts
+++ b/apps/api/src/routes/prompt-features.ts
@@ -13,6 +13,7 @@ import { apiRoute } from "../openapi/api-route.js";
import type { PromptFeatureDocument, RouteContext } from "../route-context.js";
import { extractPromptFeatures, generatePromptFeaturePrompt, isLlmAvailable as isPromptFeatureLlmAvailable } from "../prompt-feature-llm.js";
import { isInferenceError } from "../llm-token.js";
+import { PORTAL_AI_NOT_CONFIGURED_ERROR } from "../portal-ai-copy.js";
import { ProjectIdQuerySchema, OptionalProjectIdQuerySchema, getQueryProjectId, getOptionalQueryProjectId } from "../utils/project-scope.js";
export function registerPromptFeaturesRoutes(ctx: RouteContext): void {
@@ -43,7 +44,7 @@ apiRoute(ctx.app, ctx.registry, {
}
if (!isPromptFeatureLlmAvailable()) {
- res.status(503).json({ error: "LLM not configured: no inference backend available. Please register a new secret key for GitHub Model or Azure Foundry." });
+ res.status(503).json({ error: PORTAL_AI_NOT_CONFIGURED_ERROR });
return;
}
@@ -161,7 +162,7 @@ apiRoute(ctx.app, ctx.registry, {
}
if (!isPromptFeatureLlmAvailable()) {
- res.status(503).json({ error: "LLM not configured: no inference backend available. Please register a new secret key for GitHub Model or Azure Foundry." });
+ res.status(503).json({ error: PORTAL_AI_NOT_CONFIGURED_ERROR });
return;
}
diff --git a/apps/api/src/routes/task-prompts.ts b/apps/api/src/routes/task-prompts.ts
index f626ea079..a9a15df55 100644
--- a/apps/api/src/routes/task-prompts.ts
+++ b/apps/api/src/routes/task-prompts.ts
@@ -15,6 +15,7 @@ import type { RouteContext } from "../route-context.js";
import { extractPromptFeatures, isLlmAvailable as isPromptFeatureLlmAvailable } from "../prompt-feature-llm.js";
import { generateTaskPrompt, isTaskPromptLlmAvailable } from "../task-prompt-llm.js";
import { isInferenceError } from "../llm-token.js";
+import { PORTAL_AI_NOT_CONFIGURED_ERROR } from "../portal-ai-copy.js";
import { ProjectIdQuerySchema, getQueryProjectId } from "../utils/project-scope.js";
export function registerTaskPromptsRoutes(ctx: RouteContext): void {
@@ -42,7 +43,7 @@ apiRoute(ctx.app, ctx.registry, {
const { description, existingPrompt } = req.body;
if (!isTaskPromptLlmAvailable()) {
- res.status(503).json({ error: "LLM not configured: no inference backend available. Please register a new secret key for GitHub Model or Azure Foundry." });
+ res.status(503).json({ error: PORTAL_AI_NOT_CONFIGURED_ERROR });
return;
}
@@ -253,7 +254,7 @@ apiRoute(ctx.app, ctx.registry, {
}
if (!isPromptFeatureLlmAvailable()) {
- res.status(503).json({ error: "LLM not configured: no inference backend available. Please register a new secret key for GitHub Model or Azure Foundry." });
+ res.status(503).json({ error: PORTAL_AI_NOT_CONFIGURED_ERROR });
return;
}
diff --git a/apps/api/src/task-prompt-llm.test.ts b/apps/api/src/task-prompt-llm.test.ts
index 47ed006e9..04a01f460 100644
--- a/apps/api/src/task-prompt-llm.test.ts
+++ b/apps/api/src/task-prompt-llm.test.ts
@@ -17,19 +17,34 @@ vi.mock("@azure/core-auth", () => ({
AzureKeyCredential: vi.fn(),
}));
-// Mock llm-token module — provides both the legacy GitHub Models helpers
-// and the new shared acquireInferenceClient(). The task-prompt module now
-// only calls acquireInferenceClient, but we keep the legacy exports so
-// the rest of the module surface stays compatible.
vi.mock("./llm-token.js", () => ({
isLlmAvailable: vi.fn(() => true),
- isGitHubModelsTokenAvailable: vi.fn(() => true),
- acquireGitHubModelsToken: vi.fn(async () => "fake-token"),
- acquireInferenceClient: vi.fn(async () => ({
- client: { path: () => ({ post: mockPost }) },
- endpoint: "https://test.example.com",
- source: "azure-ai-foundry",
- })),
+ completePortalLlm: vi.fn(async (request: {
+ messages: Array<{ role: string; content: string }>;
+ model: string;
+ temperature: number;
+ max_tokens: number;
+ }, explicitModel?: string) => {
+ const { postAdaptiveChatCompletion } = await import("./adaptive-chat-completions.js");
+ const response = await postAdaptiveChatCompletion({
+ endpoint: "https://test.example.com",
+ model: explicitModel || request.model,
+ messages: request.messages,
+ temperature: request.temperature,
+ maxTokens: request.max_tokens,
+ send: (body) => mockPost({ body }),
+ });
+ if (response.status !== "200") {
+ const body = response.body as { error?: { message?: string } };
+ throw new Error(`LLM request failed: ${body.error?.message || response.status}`);
+ }
+ const body = response.body as {
+ choices?: Array<{ message?: { content?: string } }>;
+ };
+ const content = body.choices?.[0]?.message?.content;
+ if (!content) throw new Error("LLM returned empty response");
+ return content;
+ }),
}));
import { generateTaskPrompt, isTaskPromptLlmAvailable } from "./task-prompt-llm.js";
diff --git a/apps/api/src/task-prompt-llm.ts b/apps/api/src/task-prompt-llm.ts
index c14a7e72e..30abc2a17 100644
--- a/apps/api/src/task-prompt-llm.ts
+++ b/apps/api/src/task-prompt-llm.ts
@@ -1,9 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
-import { isUnexpected } from "@azure-rest/ai-inference";
-import { postAdaptiveChatCompletion } from "./adaptive-chat-completions.js";
-import { acquireInferenceClient, isLlmAvailable as inferenceAvailable } from "./llm-token.js";
+import {
+ completePortalLlm,
+ isLlmAvailable as inferenceAvailable,
+} from "./llm-token.js";
// ---------------------------------------------------------------------------
// Generate task prompt from a short description or create a variation
@@ -149,15 +150,7 @@ export async function generateTaskPrompt(
model?: string,
): Promise {
const { description, existingPrompt } = opts;
-
- const {
- client: llm,
- endpoint,
- model: foundryModel,
- } = await acquireInferenceClient();
-
- // Priority: explicit arg > key-specific (from Foundry blob) > env > default.
- const modelName = model || foundryModel || process.env.LLM_MODEL || "gpt-4.1";
+ const modelName = model || process.env.LLM_MODEL || "gpt-4.1";
const request = buildTaskPromptRequest(
{ description, existingPrompt },
@@ -165,26 +158,7 @@ export async function generateTaskPrompt(
modelName,
);
- const response = await postAdaptiveChatCompletion({
- endpoint,
- model: request.model,
- messages: request.messages,
- temperature: request.temperature,
- maxTokens: request.max_tokens,
- send: (body) => llm.path("/chat/completions").post({ body }),
- });
-
- if (isUnexpected(response)) {
- const errBody = response.body as any;
- throw new Error(
- `LLM request failed: ${errBody?.error?.message || response.status}`,
- );
- }
-
- const content = response.body.choices?.[0]?.message?.content;
- if (!content) {
- throw new Error("LLM returned empty response");
- }
+ const content = await completePortalLlm(request, model);
return parseTaskPromptResponse(content);
}
diff --git a/apps/portal/src/components/CriteriaWizardStep2.test.tsx b/apps/portal/src/components/CriteriaWizardStep2.test.tsx
index ca1cbb78a..62ed70aa0 100644
--- a/apps/portal/src/components/CriteriaWizardStep2.test.tsx
+++ b/apps/portal/src/components/CriteriaWizardStep2.test.tsx
@@ -9,6 +9,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { CriteriaWizardStep2 } from "./CriteriaWizardStep2";
import type { CriteriaWizardState } from "@/hooks/useCriteriaWizard";
import type { CriteriaDocument } from "@/types";
+import { PORTAL_AI_REGISTRATION_GUIDANCE } from "@/lib/portal-ai-copy";
// The picker fetches the full criteria list via api.listCriteria.
const CRITERIA: CriteriaDocument[] = [
@@ -43,7 +44,7 @@ function Harness({
initialChildren?: string[];
parentCandidates?: boolean;
childCandidates?: boolean;
- generationError?: Error;
+ generationError?: unknown;
}) {
const [dependsOn, setDependsOn] = useState(initialParents);
const [acceptedChildren, setAcceptedChildren] = useState(initialChildren);
@@ -174,4 +175,14 @@ describe("CriteriaWizardStep2 — generation errors", () => {
),
).toBeTruthy();
});
+
+ it("shows Copilot SDK registration guidance when the API error has no message", async () => {
+ renderStep2({ generationError: { status: 503 } });
+
+ expect(
+ await screen.findByText(
+ `AI generation failed — ${PORTAL_AI_REGISTRATION_GUIDANCE}`,
+ ),
+ ).toBeTruthy();
+ });
});
diff --git a/apps/portal/src/components/CriteriaWizardStep2.tsx b/apps/portal/src/components/CriteriaWizardStep2.tsx
index aa94d3a43..7c65e62a3 100644
--- a/apps/portal/src/components/CriteriaWizardStep2.tsx
+++ b/apps/portal/src/components/CriteriaWizardStep2.tsx
@@ -6,6 +6,7 @@ import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { Badge } from "@/components/ui/badge";
import { Separator } from "@/components/ui/separator";
+import { PORTAL_AI_REGISTRATION_GUIDANCE } from "@/lib/portal-ai-copy";
import { CriteriaPicker } from "@/components/CriteriaPicker";
import { HelpTooltip } from "@/components/HelpTooltip";
import { gatesSatisfyInvariant, GATE_METADATA, orderGateIds } from "@/lib/gates";
@@ -170,7 +171,7 @@ export function CriteriaWizardStep2({ wizard }: CriteriaWizardStep2Props) {
AI generation failed — {generateMutation.error instanceof Error
? generateMutation.error.message
- : "register an Azure AI Foundry or GitHub Models key at /secrets/keys/new, or write your prompt manually"}
+ : PORTAL_AI_REGISTRATION_GUIDANCE}
)}
diff --git a/apps/portal/src/components/PromptFeatureWizard.tsx b/apps/portal/src/components/PromptFeatureWizard.tsx
index 46a90db34..38fd14aa1 100644
--- a/apps/portal/src/components/PromptFeatureWizard.tsx
+++ b/apps/portal/src/components/PromptFeatureWizard.tsx
@@ -4,6 +4,7 @@
import { useState, useMemo, useCallback } from "react";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { api } from "@/lib/api";
+import { PORTAL_AI_REGISTRATION_GUIDANCE } from "@/lib/portal-ai-copy";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
@@ -362,7 +363,7 @@ export function PromptFeatureWizard({
{generateMutation.isError && (
- AI generation failed — {generateMutation.error instanceof Error ? generateMutation.error.message : "register an Azure AI Foundry or GitHub Models key at /secrets/keys/new, or write your prompt manually"}
+ AI generation failed — {generateMutation.error instanceof Error ? generateMutation.error.message : PORTAL_AI_REGISTRATION_GUIDANCE}
)}
diff --git a/apps/portal/src/lib/portal-ai-copy.ts b/apps/portal/src/lib/portal-ai-copy.ts
new file mode 100644
index 000000000..a55f9836c
--- /dev/null
+++ b/apps/portal/src/lib/portal-ai-copy.ts
@@ -0,0 +1,5 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+export const PORTAL_AI_REGISTRATION_GUIDANCE =
+ "Portal AI requires Azure AI Foundry or a classic PAT/OAuth token with Copilot SDK capability registered at /secrets/keys/new. GitHub Models is supported only as a legacy fallback; you can also write your prompt manually.";
diff --git a/apps/portal/src/pages/CreateToken.test.ts b/apps/portal/src/pages/CreateToken.test.ts
index 5131d8252..a8d657eed 100644
--- a/apps/portal/src/pages/CreateToken.test.ts
+++ b/apps/portal/src/pages/CreateToken.test.ts
@@ -2,7 +2,7 @@
// Licensed under the MIT License.
import { describe, expect, it } from "vitest";
-import { buildFoundryCredentialValue } from "./CreateToken.js";
+import { buildFoundryCredentialValue, KEY_INSTRUCTIONS } from "./CreateToken.js";
describe("Foundry credential value", () => {
it("stores endpoint, key, and model without request compatibility fields", () => {
@@ -21,3 +21,32 @@ describe("Foundry credential value", () => {
});
});
});
+
+describe("Portal AI token registration guidance", () => {
+ it("recommends classic PAT Copilot SDK capability for Portal AI", () => {
+ expect(KEY_INSTRUCTIONS["github-pat-classic"].steps.join(" ")).toContain(
+ "enable Portal AI through the Copilot SDK",
+ );
+ expect(KEY_INSTRUCTIONS["github-pat-classic"].note).toContain(
+ "recommended GitHub credential for Portal AI",
+ );
+ });
+
+ it("describes GitHub Models as a legacy fallback", () => {
+ expect(KEY_INSTRUCTIONS["github-pat-fine-grained"].note).toContain(
+ "legacy GitHub Models",
+ );
+ expect(KEY_INSTRUCTIONS["github-oauth"].note).toContain(
+ "GitHub Models remains a legacy fallback",
+ );
+ });
+
+ it("documents Portal AI provider precedence for Foundry registration", () => {
+ expect(KEY_INSTRUCTIONS["azure-ai-foundry"].note).toContain(
+ "Foundry environment credentials take first priority",
+ );
+ expect(KEY_INSTRUCTIONS["azure-ai-foundry"].note).toContain(
+ "registered Foundry keys, Copilot SDK credentials",
+ );
+ });
+});
diff --git a/apps/portal/src/pages/CreateToken.tsx b/apps/portal/src/pages/CreateToken.tsx
index f7bdfee82..309ed93e5 100644
--- a/apps/portal/src/pages/CreateToken.tsx
+++ b/apps/portal/src/pages/CreateToken.tsx
@@ -26,37 +26,37 @@ import { toast } from "sonner";
import { useCommandEnter } from "@/hooks/useCommandEnter";
import { KbdBadge } from "@/components/KbdBadge";
-const KEY_INSTRUCTIONS: Record = {
+export const KEY_INSTRUCTIONS: Record = {
"github-pat-classic": {
steps: [
"Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)",
"Click 'Generate new token (classic)'",
- "Select scopes: 'copilot' (for Copilot SDK/CLI/VS Code) and/or 'repo' as needed",
+ "Select the 'copilot' scope to enable Portal AI through the Copilot SDK (and Copilot CLI/VS Code); add 'repo' only if needed",
"Set an expiration and click 'Generate token'",
"Copy the token (starts with ghp_)",
],
link: { label: "Open GitHub token settings", url: "https://github.com/settings/tokens" },
- note: "Classic PATs cannot access GitHub Models. Use a fine-grained PAT with models:read for that.",
+ note: "A classic PAT with an active Copilot license is the recommended GitHub credential for Portal AI. It provides the copilot-sdk capability; GitHub Models is only a legacy fallback and requires a different token type.",
},
"github-pat-fine-grained": {
steps: [
"Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens",
"Click 'Generate new token'",
"Set a token name, expiration, and resource owner",
- "Under Permissions, add 'Models' → Read access (for GitHub Models)",
+ "Under Permissions, add 'Models' → Read access only if you need the legacy GitHub Models fallback",
"Click 'Generate token'",
"Copy the token (starts with github_pat_)",
],
link: { label: "Open GitHub token settings", url: "https://github.com/settings/personal-access-tokens" },
- note: "Fine-grained PATs support GitHub Models via the models:read permission. They do not support Copilot SDK.",
+ note: "Fine-grained PATs support only the legacy GitHub Models path via models:read. They do not provide the Copilot SDK capability; use a classic PAT or OAuth token for Portal AI.",
},
"github-oauth": {
steps: [
"Obtain a GitHub OAuth token via an OAuth App flow (authorization code grant)",
- "The token should have the 'copilot' scope for Copilot capabilities",
+ "Ensure the token has Copilot access so validation grants the copilot-sdk capability used by Portal AI",
"Copy the OAuth access token",
],
- note: "OAuth tokens typically support all GitHub capabilities including Copilot SDK, CLI, VS Code, and GitHub Models.",
+ note: "OAuth tokens with an active Copilot license can enable Portal AI through the Copilot SDK, as well as Copilot CLI and VS Code. GitHub Models remains a legacy fallback.",
},
"github-oauth-cookie-state": {
steps: [
@@ -93,7 +93,7 @@ const KEY_INSTRUCTIONS: Record = {
};
export const KEY_CAPABILITY_DESCRIPTIONS: Record = {
- "github-models": "Access AI models hosted on GitHub (GPT-4o, Claude, etc.)",
+ "github-models": "Use the legacy GitHub Models fallback for Portal AI",
"github-public-api": "Read public repository contents (used for skill discovery and resolution)",
"copilot-models": "List models available via the Copilot API (OAuth only, PATs rejected)",
- "copilot-sdk": "Use the Copilot SDK to make LLM requests programmatically",
+ "copilot-sdk": "Enable Portal AI and other programmatic LLM requests through GitHub Copilot",
"copilot-cli": "Run GitHub Copilot in the CLI for code suggestions",
"claude-code-cli": "Run Claude Code as an agentic coding assistant",
"anthropic-api": "Access the Anthropic REST API (model scanning, direct API calls)",
diff --git a/docs/architecture/token-manager.md b/docs/architecture/token-manager.md
index 544d09667..0123668c2 100644
--- a/docs/architecture/token-manager.md
+++ b/docs/architecture/token-manager.md
@@ -92,12 +92,12 @@ may contain a `requestProfile` field; the parser accepts and ignores it.
| Capability | Description |
|------------|-------------|
-| `github-models` | Access to GitHub Models API (GPT-4o, etc.) |
+| `github-models` | Access to the legacy GitHub Models fallback |
| `github-public-api` | Read-only access to the GitHub REST API for public repos (skill discovery / resolution) |
-| `copilot-sdk` | GitHub Copilot SDK integration |
+| `copilot-sdk` | GitHub Copilot SDK integration, including Portal AI |
| `copilot-cli` | GitHub Copilot CLI authentication |
| `claude-code-cli` | Anthropic Claude Code CLI |
-| `azure-ai-inference` | Chat-completion inference against an Azure AI Foundry deployment (used by the portal's AI features) |
+| `azure-ai-inference` | Chat-completion inference against an Azure AI Foundry deployment (used by Portal AI) |
`github-public-api` is granted to **any** valid GitHub bearer token (PAT classic, PAT fine-grained, OAuth, scopeless OAuth) since public-repo reads require no scopes.
@@ -114,9 +114,9 @@ The API's discovery endpoint uses this chain via the `github-api-token` helper t
| Token Type | Permissions / Scope | How to Obtain | Validity | GitHub Models | Copilot SDK | Copilot CLI | Claude Code CLI | VS Code Copilot |
|------------|---------------------|---------------|----------|:-------------:|:-----------:|:-----------:|:---------------:|:---------------:|
-| **GitHub PAT (classic)** `ghp_` | `copilot` | Settings → Tokens (classic) | No expiry or custom | ❌ | ✅¹ | ✅¹ | ❌ | ✅¹ |
-| **GitHub PAT (fine-grained)** `github_pat_` | `models:read` | Settings → Fine-grained tokens | Max 1 year | ✅ | ❌ | ❌ | ❌ | ❌ |
-| **GitHub OAuth** `gho_` | (all via OAuth flow) | `gh auth login` → `gh auth token` | Until revoked | ✅ | ✅¹ | ✅¹ | ❌ | ✅¹ |
+| **GitHub PAT (classic)** `ghp_` | `copilot` | Settings → Tokens (classic) | No expiry or custom | ❌ | ✅¹ (Portal AI) | ✅¹ | ❌ | ✅¹ |
+| **GitHub PAT (fine-grained)** `github_pat_` | `models:read` | Settings → Fine-grained tokens | Max 1 year | ✅ (legacy Portal AI fallback) | ❌ | ❌ | ❌ | ❌ |
+| **GitHub OAuth** `gho_` | (all via OAuth flow) | `gh auth login` → `gh auth token` | Until revoked | ✅ (legacy fallback) | ✅¹ (Portal AI) | ✅¹ | ❌ | ✅¹ |
| **GitHub OAuth cookie state** | (browser session) | Browser DevTools → cookies | Session-bound | ❌ | ❌ | ❌ | ❌ | ✅² |
| **Anthropic API Key** `sk-ant-` | (full access) | console.anthropic.com | Until revoked | ❌ | ❌ | ❌ | ✅ | ❌ |
@@ -250,11 +250,9 @@ if (result) {
### LLM Module Integration
-The API's portal-LLM modules (`llm.ts`, `prompt-feature-llm.ts`,
-`task-prompt-llm.ts`) all go through a shared
-`acquireInferenceClient()` helper in `apps/api/src/llm-token.ts`. The
-helper resolves a chat-completions client in this order, returning the
-first source that succeeds:
+The API's Portal AI modules (`llm.ts`, `prompt-feature-llm.ts`, and
+`task-prompt-llm.ts`) share one provider-selection path. It selects the first
+configured provider in this order:
1. **Azure AI Foundry via env vars** —
`AZURE_AI_INFERENCE_ENDPOINT` + `AZURE_AI_INFERENCE_API_KEY`.
@@ -266,40 +264,61 @@ first source that succeeds:
(endpoint + key + model), not just the API key. The capability
`azure-ai-inference` is derived from any registered `azure-ai-foundry`
key.
-3. **GitHub Models** — `GITHUB_MODELS_API_KEY` env var, then
- `TokenManagerClient.acquireToken("github-models")`, then `GITHUB_TOKEN`.
-
-Each successful acquisition logs a single line:
-
-```
-[llm-token] inference provider: source=… via=… endpoint=… model=…
-```
-
-`via` distinguishes `azure-ai-foundry-env`,
-`azure-ai-foundry-token-manager`, `github-models-env`,
-`github-models-token-manager`, and `github-token`.
-
-When none of the three tiers is configured, the helper throws a single
-"LLM not configured" error that the route handlers convert into a 503
-with an actionable message pointing at `/secrets/keys/new`.
-
-**No automatic failover at request time.** The chain only steps down
-when the predecessor returns *nothing* (env var unset, no key
-registered). It does **not** step down when the predecessor returns a
-credential that then 4xx/5xx's on the chat-completion call — that error
-propagates to the user verbatim. This is intentional: silent fallback
-would mask a misconfigured higher-priority backend (e.g. a wrong Foundry
-deployment name) and the operator would never realise they were paying
-the slower fallback's latency.
-
-```typescript
-import { acquireInferenceClient } from "./llm-token.js";
-
-const { client, model: foundryModel } = await acquireInferenceClient();
-const modelName = explicit || foundryModel || process.env.LLM_MODEL || "gpt-4.1";
-await client.path("/chat/completions").post({ body: { messages, model: modelName, … } });
-```
+3. **GitHub Copilot SDK** — `GITHUB_TOKEN` or a registered classic PAT/OAuth
+ token with the `copilot-sdk` capability. This is the preferred
+ GitHub-backed provider.
+4. **GitHub Models (legacy fallback)** — `GITHUB_MODELS_API_KEY`, a registered
+ `github-models` token, or the legacy `GITHUB_TOKEN` path.
+
+Each successful acquisition logs the selected source. GitHub Models remains
+available for compatibility, but new deployments should use Foundry or Copilot
+SDK credentials.
+
+### Copilot SDK request isolation
+
+Portal AI bounds Copilot SDK concurrency with a fixed-size client pool (default
+maximum: two clients; minimum: zero). Pool acquisition, runtime startup,
+response generation, idle reaping, and shutdown all have explicit timeouts so
+requests and child processes do not wait indefinitely. A request borrows one
+client, creates a **one-shot** session, sends one prompt, then disconnects and
+deletes the session in `finally` before returning the client to the pool.
+Session cleanup therefore runs after success, provider errors, and timeouts.
+
+The session is intentionally isolated from coding-agent behavior:
+
+- The Copilot client uses `mode: "empty"`. Its SDK session uses an empty tool
+ set and does not receive MCP servers, skills, custom agents, extensions, or
+ repository/workspace context.
+- Only the system and user prompts required by the Portal AI operation are
+ sent.
+- The Copilot CLI child process receives a sanitized environment containing
+ only the variables required for runtime and authentication; unrelated Scope
+ service secrets are not forwarded.
+- The session is not reused across requests, users, or projects.
+
+The adapter preserves the operation's system and user prompts. Copilot model
+resolution is: explicit request override → `PORTAL_COPILOT_MODEL` → `LLM_MODEL`
+→ automatic selection from the authenticated account's available models. Each
+pooled client discovers its models at startup and prefers `gpt-5.4-mini`,
+`gpt-5.4`, `gpt-5.1`, then `gpt-5-mini`; if none is present it uses the first
+listed model. It fails client startup if Copilot returns no models. Copilot
+therefore does not inherit the REST-only `gpt-4.1` default when no override is
+configured.
+
+The Copilot SDK session API does not expose the REST chat-completions
+`temperature` or maximum-token controls, so those remain specific to the
+Foundry and legacy GitHub Models REST paths. Those REST providers continue to
+default to `gpt-4.1`.
+
+When no provider is configured, route handlers return HTTP 503 with actionable
+registration guidance.
+
+**No automatic failover at request time.** Provider precedence is evaluated
+only while selecting an available credential. Once a provider is selected, an
+authentication error, timeout, rate limit, or inference failure is returned to
+the caller; Scope does not retry the request through a lower-priority provider.
+This prevents a broken Foundry or Copilot configuration from being hidden by
+the legacy GitHub Models fallback.
The legacy `acquireGitHubModelsToken()` helper still exists for callers
-that specifically need a GitHub Models bearer token; it follows the same
-1→3 chain restricted to the GitHub Models tiers.
+that specifically need a GitHub Models bearer token.
diff --git a/docs/responsible-ai-faq.md b/docs/responsible-ai-faq.md
index d2aa48364..eb72b1ffb 100644
--- a/docs/responsible-ai-faq.md
+++ b/docs/responsible-ai-faq.md
@@ -44,7 +44,11 @@ Scope uses AI in several places, depending on deployment configuration:
| Report generation | A report-generation worker can use an LLM to analyze completed runs and produce Markdown reports and reusable insights. |
| Model discovery | Model scanners can discover available capabilities from supported providers such as Copilot and Anthropic integrations. |
-For its LLM-assisted platform features (Judge, criteria/prompt/report generation), Scope routes inference through a unified backend that supports Azure AI Foundry and GitHub Models. Coding-agent surfaces reach their own model backends directly: GitHub Copilot via the GitHub Copilot SDK/APIs, and Claude Code via Anthropic APIs. The available providers depend on the deployment and registered credentials.
+Portal AI provider precedence is Azure AI Foundry environment credentials, Azure AI Foundry credentials from Token Manager, GitHub Copilot SDK credentials from Token Manager, and then GitHub Models as a legacy fallback. Once a provider is selected, Scope does not fail over to another provider after an authentication, timeout, rate-limit, or inference error. Judge and report generation use their separately configured Copilot SDK integrations, while coding-agent surfaces reach their own model backends directly.
+
+Portal AI's Copilot SDK path uses a bounded client pool and a fresh one-shot session for each request. The client runs in empty mode; the session has no tools, MCP servers, skills, custom agents, extensions, or repository context, receives only the operation's system and user prompts, and is disconnected and deleted before its client returns to the pool. The child process receives a sanitized environment rather than the API service's complete environment. These controls reduce cross-request context and credential exposure, but generated content still requires human review.
+
+The Copilot SDK path preserves the Portal operation's system prompt, user prompt, and model selection. REST-specific temperature and maximum-token controls are not exposed by the SDK session API, so they apply only to the Foundry and legacy GitHub Models REST paths.
## Inputs and outputs
@@ -108,6 +112,7 @@ Users should:
| Insecure generated code | Scope is an evaluation tool; users remain responsible for code review, testing, linting, and security scanning before using generated code. |
| Secret exposure in captured traffic | Supported HAR capture paths redact sensitive headers such as authorization, API key, cookie, and set-cookie headers before storage. |
| Credential misuse | Provider credentials are managed through a Token Manager with capability-based token acquisition and Key Vault-backed storage in production-style deployments. |
+| Cross-request Portal AI context or tool access | Copilot SDK requests use one-shot sessions with empty tools and no MCP, skills, or workspace context; sessions are destroyed after each request and the child process receives a sanitized environment. |
| Prompt injection | Users should treat repository content, prompts, MCP data, and external inputs as untrusted. Scope’s Judge uses read-only tools, and outputs should be reviewed before action. |
| Overreliance on AI-generated reports | Reports are generated from run data and should be reviewed by a human before being used for decisions. |
| Cross-project data confusion | Scope uses explicit project IDs for scoped entities and fails fast when project context is missing. Deployment owners should still implement and verify access control for shared environments. |
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b792f3736..d4a29c36a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -95,6 +95,9 @@ importers:
'@azure/storage-queue':
specifier: ^12.24.0
version: 12.29.0
+ '@github/copilot-sdk':
+ specifier: 1.0.1
+ version: 1.0.1(typescript@5.9.3)
cors:
specifier: ^2.8.5
version: 2.8.6
@@ -128,6 +131,9 @@ importers:
tar-stream:
specifier: ^3.1.7
version: 3.1.7
+ tarn:
+ specifier: 3.0.2
+ version: 3.0.2
telemetry:
specifier: workspace:*
version: link:../../packages/telemetry
@@ -1287,7 +1293,7 @@ packages:
engines: {node: '>=6.9.0'}
'@babel/runtime@7.29.7':
- resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==}
+ resolution: {integrity: sha1-EgIkUMRaTabY2Ch7GKT/Ldsj92g=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@babel/runtime/-/runtime-7.29.7.tgz}
engines: {node: '>=6.9.0'}
'@babel/template@7.28.6':
@@ -1322,7 +1328,7 @@ packages:
engines: {node: '>=18'}
'@colors/colors@1.5.0':
- resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==}
+ resolution: {integrity: sha1-u1BFecHK6SPmV2pPXaQ9Jfl729k=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@colors/colors/-/colors-1.5.0.tgz}
engines: {node: '>=0.1.90'}
'@colors/colors@1.6.0':
@@ -1333,166 +1339,166 @@ packages:
resolution: {integrity: sha512-3Xgkay0Hubq1hA67IW2vM3YhX4TQgjOFW2TydB0ytAL97zOZI9xr/9vqCjo31bK1qUDNEdlKYLYHd8KR9YSCCw==}
'@emnapi/core@1.9.2':
- resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==}
+ resolution: {integrity: sha1-OHAmXs/8c1LQHq1i2Ng9g1ii0DQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/core/-/core-1.9.2.tgz}
'@emnapi/runtime@1.9.2':
- resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==}
+ resolution: {integrity: sha1-i0aaPbFggXytsd6QUCEanR6oT6I=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/runtime/-/runtime-1.9.2.tgz}
'@emnapi/wasi-threads@1.2.1':
- resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==}
+ resolution: {integrity: sha1-KP7SGhuhznl8RKBwq8lNQvOuhUg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz}
'@esbuild/aix-ppc64@0.28.1':
- resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==}
+ resolution: {integrity: sha1-egGo0uwvuy2seK2tCbD6eB5Agr4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [ppc64]
os: [aix]
'@esbuild/android-arm64@0.28.1':
- resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==}
+ resolution: {integrity: sha1-tUCifRTkr9BYSWpNvsTT9BTbEQo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [android]
'@esbuild/android-arm@0.28.1':
- resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==}
+ resolution: {integrity: sha1-cEvSl95tdi3lTqu+r79V9nVqvi8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-arm/-/android-arm-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm]
os: [android]
'@esbuild/android-x64@0.28.1':
- resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==}
+ resolution: {integrity: sha1-0csWbTSw+/D+irRgpVlPJKN4cB4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/android-x64/-/android-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [android]
'@esbuild/darwin-arm64@0.28.1':
- resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==}
+ resolution: {integrity: sha1-EDSyZFf8iGNo/mG70J9lP2r6jlQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [darwin]
'@esbuild/darwin-x64@0.28.1':
- resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==}
+ resolution: {integrity: sha1-ZVVqQyoeTXIDLYIYwZMvzKGkl3I=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [darwin]
'@esbuild/freebsd-arm64@0.28.1':
- resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==}
+ resolution: {integrity: sha1-LmHgWS+QMNfj2uGO4l68U1kYrvY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [freebsd]
'@esbuild/freebsd-x64@0.28.1':
- resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==}
+ resolution: {integrity: sha1-yV7CiZWe+AecTcqBeh4sS+Zrm9M=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [freebsd]
'@esbuild/linux-arm64@0.28.1':
- resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==}
+ resolution: {integrity: sha1-QLIhdd2gYYLz7oFBGGxf8wTEpxc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [linux]
'@esbuild/linux-arm@0.28.1':
- resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==}
+ resolution: {integrity: sha1-wJoPZ5F1kqwN6JKpvk04FN69Kmw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm]
os: [linux]
'@esbuild/linux-ia32@0.28.1':
- resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==}
+ resolution: {integrity: sha1-pYD5xnZ5eDOJHlGfx6EzfIr9jbM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [ia32]
os: [linux]
'@esbuild/linux-loong64@0.28.1':
- resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==}
+ resolution: {integrity: sha1-RkUs8yHcf56Rwvp4Cla7Vuec1os=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [loong64]
os: [linux]
'@esbuild/linux-mips64el@0.28.1':
- resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==}
+ resolution: {integrity: sha1-QhGzGE3WYI9T3LIuOfXTTuCIUsg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [mips64el]
os: [linux]
'@esbuild/linux-ppc64@0.28.1':
- resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==}
+ resolution: {integrity: sha1-aXhXwqYcubC2u2ZS5AwdxeHKjl0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [ppc64]
os: [linux]
'@esbuild/linux-riscv64@0.28.1':
- resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==}
+ resolution: {integrity: sha1-0ZKUPrFGpArExkl9DPe+NbmGvwg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [riscv64]
os: [linux]
'@esbuild/linux-s390x@0.28.1':
- resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==}
+ resolution: {integrity: sha1-rOoDVtoODrwI+Xz3ucLkAeHmSNw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [s390x]
os: [linux]
'@esbuild/linux-x64@0.28.1':
- resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==}
+ resolution: {integrity: sha1-bww84MtkxTS3DExF7LLBbTTjXf0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [linux]
'@esbuild/netbsd-arm64@0.28.1':
- resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==}
+ resolution: {integrity: sha1-i813B3oNzjN4tXT+2ybSolO3PTY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [netbsd]
'@esbuild/netbsd-x64@0.28.1':
- resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==}
+ resolution: {integrity: sha1-5/sqAemcgwyU5mI82f77TI+1g0c=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [netbsd]
'@esbuild/openbsd-arm64@0.28.1':
- resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==}
+ resolution: {integrity: sha1-xSkJNy24uG4sVeBaiUADO1Zgo7I=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [openbsd]
'@esbuild/openbsd-x64@0.28.1':
- resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==}
+ resolution: {integrity: sha1-xCe5vlpkwmL/mn63C1+7qt9EbGw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [openbsd]
'@esbuild/openharmony-arm64@0.28.1':
- resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==}
+ resolution: {integrity: sha1-3JsUe6yi5sSzyFVxdB70hgpIkJc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [openharmony]
'@esbuild/sunos-x64@0.28.1':
- resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==}
+ resolution: {integrity: sha1-zoZtEt8TwV5MmfBzo9Rm9uBkmzo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [sunos]
'@esbuild/win32-arm64@0.28.1':
- resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==}
+ resolution: {integrity: sha1-dGjjaS0B1inVlB5dg4F7uA+eObQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [arm64]
os: [win32]
'@esbuild/win32-ia32@0.28.1':
- resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==}
+ resolution: {integrity: sha1-pbwAY/sryrbQ7WPyoVN5WLwmnsY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [ia32]
os: [win32]
'@esbuild/win32-x64@0.28.1':
- resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==}
+ resolution: {integrity: sha1-EAZO5E9DR7kMmgK0Rrv4CpFjKxI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz}
engines: {node: '>=18'}
cpu: [x64]
os: [win32]
@@ -1513,40 +1519,40 @@ packages:
resolution: {integrity: sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==}
'@github/copilot-darwin-arm64@1.0.63':
- resolution: {integrity: sha512-z6CMBxNDlKvT6bvOpqhu4M2bhb0daEbVwSe9SN9WfDUJbt7bpoL7OKKas428iyPSWHoL2WXwxSsy/FjIwSLV6w==}
+ resolution: {integrity: sha1-JrBj4X6yDxCJqZnJQLqJ43REL3w=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.63.tgz}
cpu: [arm64]
os: [darwin]
hasBin: true
'@github/copilot-darwin-x64@1.0.63':
- resolution: {integrity: sha512-YKd7cXZgAGxhudzrtWdWh2NS35p2G5bV22Gz3jhEyBTqmq45o4sD4OwO87+UpkvM+3nZpwsHaLd3a+ILYX6OXg==}
+ resolution: {integrity: sha1-4FoUrHF3rwxZkI9QPFXHVyDk8WM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.63.tgz}
cpu: [x64]
os: [darwin]
hasBin: true
'@github/copilot-linux-arm64@1.0.63':
- resolution: {integrity: sha512-A3DOeEfmsJH9j1N+QLc7WXmESBskbezmhDyhyAJcHkw0ngRbKctuWQf/evUHFMh/kgwy1Lr/+9jXJm3NZqr0MA==}
+ resolution: {integrity: sha1-uwl1BhTJsbIAOBht8xC4xjsg8Z0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.63.tgz}
cpu: [arm64]
os: [linux]
libc: [glibc]
hasBin: true
'@github/copilot-linux-x64@1.0.63':
- resolution: {integrity: sha512-OMKfZJRoDaJOV7vuWX/nFPNdLa9/H+nhajdE83v4YT9mKLXr86aWrkXE3pPoDYsKWvgQFHg4APA6oZPao0Fyow==}
+ resolution: {integrity: sha1-mfEe3Z6+0A7S+WjLdIy4jr3Yatk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.63.tgz}
cpu: [x64]
os: [linux]
libc: [glibc]
hasBin: true
'@github/copilot-linuxmusl-arm64@1.0.63':
- resolution: {integrity: sha512-jcIo6B3uHgcOluNfUHp+6atShKKrXYBPLaRyF6aDT699lwI83gW9KTDuEvDs5FDg8qWsWFfOl+al2dkWDYD3CQ==}
+ resolution: {integrity: sha1-MwVeIr4C01C+A4MZAIE8vNleops=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.63.tgz}
cpu: [arm64]
os: [linux]
libc: [musl]
hasBin: true
'@github/copilot-linuxmusl-x64@1.0.63':
- resolution: {integrity: sha512-BEdBbEF3fG7VqXzuaAY4JtmbdGSkpJFeb2ZQYaMpq7OP3aS7ssGe1cCX8ehZNegcMM/eb4GC6PXNXsvl3X/PAQ==}
+ resolution: {integrity: sha1-yawZHApLv+Rt7d33UydDp3RWFgA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.63.tgz}
cpu: [x64]
os: [linux]
libc: [musl]
@@ -1557,13 +1563,13 @@ packages:
engines: {node: ^20.19.0 || >=22.12.0}
'@github/copilot-win32-arm64@1.0.63':
- resolution: {integrity: sha512-7FqUwOmtoeBoOn4zkKQqRL+WGFwektVRSr5Po2FvPAbKxGXGyFXApZTmRLqVcHhMKDRzMb8KLST1LU1TMTY/wg==}
+ resolution: {integrity: sha1-uVsv2JKvG4n2Rjs1Hn/UbeJ69e4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.63.tgz}
cpu: [arm64]
os: [win32]
hasBin: true
'@github/copilot-win32-x64@1.0.63':
- resolution: {integrity: sha512-RC/6y9KHdw/YRCrCEksF2RzbeblfBUNE7bkYZxygaQGYThuv1GeZL2YD2jVqxC2LxKzsUmWGvwEMxerfR6pmeQ==}
+ resolution: {integrity: sha1-TX+fgJDAF35LFEk0FTyn+u46mlc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.63.tgz}
cpu: [x64]
os: [win32]
hasBin: true
@@ -1678,7 +1684,7 @@ packages:
engines: {node: '>=18'}
'@napi-rs/wasm-runtime@1.1.4':
- resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==}
+ resolution: {integrity: sha1-pGu/7cKXUbcXDF0jvB2O6MfjweE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz}
peerDependencies:
'@emnapi/core': ^1.7.1
'@emnapi/runtime': ^1.7.1
@@ -2524,143 +2530,143 @@ packages:
engines: {node: ^18.19.0 || >=20.6.0}
'@os-theme/darwin-arm64@0.0.8':
- resolution: {integrity: sha512-gMsOs+8Ju396a5yyMWigkbA0dMTxD78U3HzG3mlpiAyn6hfd5dbyI4VGP+sfTB82KGgWLzIhWWTFX5UYY6iX0A==}
+ resolution: {integrity: sha1-sG3LDuYjSm2+TEIvAzfG+tgR69c=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@os-theme/darwin-arm64/-/darwin-arm64-0.0.8.tgz}
cpu: [arm64]
os: [darwin]
'@os-theme/linux-x64@0.0.8':
- resolution: {integrity: sha512-zvjmBUiSQPjM1RbhpsfCDYMJxW4eLlGmkFPnpteC/03X2lz6CjiX2hfbN2EWLxXjNnIje3Jqaen8IsqEnWrRBg==}
+ resolution: {integrity: sha1-3CMQdNJpXo/KYtTjEWsAGPSphME=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@os-theme/linux-x64/-/linux-x64-0.0.8.tgz}
cpu: [x64]
os: [linux]
'@os-theme/win32-x64@0.0.8':
- resolution: {integrity: sha512-N3yxKNbVl2IBa/ncDuq55QhwqwUjnYLJxDKMEmYeJbLIV950qZNojPw3scXA6PbfxPZfIiRa8iz1pzNg9XxP8w==}
+ resolution: {integrity: sha1-yMPomy3GVjNS29If0Uwl8WtzR5o=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@os-theme/win32-x64/-/win32-x64-0.0.8.tgz}
cpu: [x64]
os: [win32]
'@oxc-parser/binding-android-arm-eabi@0.127.0':
- resolution: {integrity: sha512-0LC7ye4hvqbIKxAzThzvswgHLFu2AURKzYLeSVvLdu2TBOYWQDmHnTqPLeA597BcUCxiLqLsS4CJ5uoI5WYWCQ==}
+ resolution: {integrity: sha1-t155YknuIvYy5A6UJ0bEv2SM7pI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [android]
'@oxc-parser/binding-android-arm64@0.127.0':
- resolution: {integrity: sha512-b5jtVTH6AU5CJXHNdj7Jj9IEiR9yVjjnwHzPJhGyHGPdcsZSzBCkS9GBbV33niRMvKthDwQRFRJfI4a+k4PvYg==}
+ resolution: {integrity: sha1-4mRGf+OfgAGPYvoNroLbC4AmBEQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
'@oxc-parser/binding-darwin-arm64@0.127.0':
- resolution: {integrity: sha512-obCE8B7ISKkJidjlhv9xRGJPOSDG2Yu6PRga9Ruaz35uintHxbp1Ki/Yc71wx4rj3Edrm0a1kzG1TAwit0wFpg==}
+ resolution: {integrity: sha1-BXbTUQnADcxidyALouyntH4H8bE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
'@oxc-parser/binding-darwin-x64@0.127.0':
- resolution: {integrity: sha512-JL6Xb5IwPQT8rUzlpsX7E+AgfcdNklXNPFp8pjCQQ5MQOQo5rtEB2ui+3Hgg9Sn7Y9Egj6YOLLiHhLpdAe12Aw==}
+ resolution: {integrity: sha1-76G6SQdaoxj/VAocL4pEIBdBcgY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
'@oxc-parser/binding-freebsd-x64@0.127.0':
- resolution: {integrity: sha512-SDQ/3MQFw58fqQz3Z1PhSKFF3JoCF4gmlNjziDm8X02tTahCw0qJbd7FGPDKw1i4VTBZene9JPyC3mHtSvi+wA==}
+ resolution: {integrity: sha1-gXujxQjXUdlNbm/Yavad2qJ9pTE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
'@oxc-parser/binding-linux-arm-gnueabihf@0.127.0':
- resolution: {integrity: sha512-Av+D1MIqzV0YMGPT9we2SIZaMKD7Cxs4CvXSx/yxaWHewZjYEjScpOf5igc8IILASViw4WTnjlwUdI1KzVtDHQ==}
+ resolution: {integrity: sha1-scMJbGVHcZmEgDFu8Q0eXSntx5s=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxc-parser/binding-linux-arm-musleabihf@0.127.0':
- resolution: {integrity: sha512-Cs2fdJ8cPpFdeebj6p4dag8A4+56hPvZ0AhQQzlaLswGz1tz7bXt1nETLeorrM9+AMcWFFkqxcXwDGfTVidY8g==}
+ resolution: {integrity: sha1-xEqPEObJA2hYJa6/Eon8IIau1h4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxc-parser/binding-linux-arm64-gnu@0.127.0':
- resolution: {integrity: sha512-qdOfTcT6SY8gsJrrV92uyEUyjqMGPpIB5JZUG6QN5dukYd+7/j0kX6MwK1DgQj39jtUYixxPiaRUiEN1+0CXgQ==}
+ resolution: {integrity: sha1-YcJFq/q29jBFkVtcnPp9M1rXxEA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-arm64-musl@0.127.0':
- resolution: {integrity: sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==}
+ resolution: {integrity: sha1-NYu9kOXIW2w1El9ab/CE4JtpTAQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [musl]
'@oxc-parser/binding-linux-ppc64-gnu@0.127.0':
- resolution: {integrity: sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==}
+ resolution: {integrity: sha1-t+p7Ub9U20xCgZGH92DgadQz2sM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-riscv64-gnu@0.127.0':
- resolution: {integrity: sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==}
+ resolution: {integrity: sha1-OjsQ0WCYjfULu81jHGrznePdRR0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-riscv64-musl@0.127.0':
- resolution: {integrity: sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==}
+ resolution: {integrity: sha1-N4fTfh0KFe4jn1FhAphQAyGzFzA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [musl]
'@oxc-parser/binding-linux-s390x-gnu@0.127.0':
- resolution: {integrity: sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==}
+ resolution: {integrity: sha1-txoWy7oRWkaWSY+RSbxUzE4d+c0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-x64-gnu@0.127.0':
- resolution: {integrity: sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==}
+ resolution: {integrity: sha1-cVJ90ChLpyfTWpPIQckRkq8+vew=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [glibc]
'@oxc-parser/binding-linux-x64-musl@0.127.0':
- resolution: {integrity: sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==}
+ resolution: {integrity: sha1-FoMK+ksAHzSc67k+ErJ45yYByz8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [musl]
'@oxc-parser/binding-openharmony-arm64@0.127.0':
- resolution: {integrity: sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==}
+ resolution: {integrity: sha1-pBxx0knLWX3DVwOOscvjznMkU/g=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
'@oxc-parser/binding-wasm32-wasi@0.127.0':
- resolution: {integrity: sha512-T6KVD7rhLzFlwGRXMnxUFfkCZD8FHnb968wVXW1mXzgRFc5RNXOBY2mPPDZ77x5Ln76ltLMgtPg0cOkU1NSrEQ==}
+ resolution: {integrity: sha1-se/NtDOzDtSjrZEvoD2jg0vUhF0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [wasm32]
'@oxc-parser/binding-win32-arm64-msvc@0.127.0':
- resolution: {integrity: sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==}
+ resolution: {integrity: sha1-titeMoEmMj1Brh7nrclVN8TEQjo=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
'@oxc-parser/binding-win32-ia32-msvc@0.127.0':
- resolution: {integrity: sha512-0cwxKO7KHQQQfo4Uf4B2SQrhgm+cJaP9OvFFhx52Tkg4bezsacu83GB2/In5bC415Ueeym+kXdnge/57rbSfTw==}
+ resolution: {integrity: sha1-2sMN5pcdvmOqVyK+mkzAcP08ZQ4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ia32]
os: [win32]
'@oxc-parser/binding-win32-x64-msvc@0.127.0':
- resolution: {integrity: sha512-rOrnSQSCbhI2kowr9XxE7m9a8oQXnBHjnS6j95LxxAnEZ0+Fz20WlRXG4ondQb+ejjt2KOsa65sE6++L6kUd+w==}
+ resolution: {integrity: sha1-ot+HmwgD9ys1CnVnNlzuW4l47fA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.127.0.tgz}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
@@ -2669,110 +2675,110 @@ packages:
resolution: {integrity: sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==}
'@oxc-resolver/binding-android-arm-eabi@11.19.1':
- resolution: {integrity: sha512-aUs47y+xyXHUKlbhqHUjBABjvycq6YSD7bpxSW7vplUmdzAlJ93yXY6ZR0c1o1x5A/QKbENCvs3+NlY8IpIVzg==}
+ resolution: {integrity: sha1-xEEgqlEE6ZHkqZabsLgWJjpvS8E=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.19.1.tgz}
cpu: [arm]
os: [android]
'@oxc-resolver/binding-android-arm64@11.19.1':
- resolution: {integrity: sha512-oolbkRX+m7Pq2LNjr/kKgYeC7bRDMVTWPgxBGMjSpZi/+UskVo4jsMU3MLheZV55jL6c3rNelPl4oD60ggYmqA==}
+ resolution: {integrity: sha1-ushqnyr9qc1hgeodFUZEjfV5t0A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.19.1.tgz}
cpu: [arm64]
os: [android]
'@oxc-resolver/binding-darwin-arm64@11.19.1':
- resolution: {integrity: sha512-nUC6d2i3R5B12sUW4O646qD5cnMXf2oBGPLIIeaRfU9doJRORAbE2SGv4eW6rMqhD+G7nf2Y8TTJTLiiO3Q/dQ==}
+ resolution: {integrity: sha1-a921t3nN4AA9rg1wO/c04VNpaPE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.19.1.tgz}
cpu: [arm64]
os: [darwin]
'@oxc-resolver/binding-darwin-x64@11.19.1':
- resolution: {integrity: sha512-cV50vE5+uAgNcFa3QY1JOeKDSkM/9ReIcc/9wn4TavhW/itkDGrXhw9jaKnkQnGbjJ198Yh5nbX/Gr2mr4Z5jQ==}
+ resolution: {integrity: sha1-BVMxQ4pzsh01f975R7nAbskEYQQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.19.1.tgz}
cpu: [x64]
os: [darwin]
'@oxc-resolver/binding-freebsd-x64@11.19.1':
- resolution: {integrity: sha512-xZOQiYGFxtk48PBKff+Zwoym7ScPAIVp4c14lfLxizO2LTTTJe5sx9vQNGrBymrf/vatSPNMD4FgsaaRigPkqw==}
+ resolution: {integrity: sha1-c16+U7rX6TUlWg6wcvdKQ/+wMsQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.19.1.tgz}
cpu: [x64]
os: [freebsd]
'@oxc-resolver/binding-linux-arm-gnueabihf@11.19.1':
- resolution: {integrity: sha512-lXZYWAC6kaGe/ky2su94e9jN9t6M0/6c+GrSlCqL//XO1cxi5lpAhnJYdyrKfm0ZEr/c7RNyAx3P7FSBcBd5+A==}
+ resolution: {integrity: sha1-IHL2eeWoSF88D+mPO9V9/UZHoZ0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.19.1.tgz}
cpu: [arm]
os: [linux]
'@oxc-resolver/binding-linux-arm-musleabihf@11.19.1':
- resolution: {integrity: sha512-veG1kKsuK5+t2IsO9q0DErYVSw2azvCVvWHnfTOS73WE0STdLLB7Q1bB9WR+yHPQM76ASkFyRbogWo1GR1+WbQ==}
+ resolution: {integrity: sha1-100KpHOMyfKvniAVy97QpdNGENw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.19.1.tgz}
cpu: [arm]
os: [linux]
'@oxc-resolver/binding-linux-arm64-gnu@11.19.1':
- resolution: {integrity: sha512-heV2+jmXyYnUrpUXSPugqWDRpnsQcDm2AX4wzTuvgdlZfoNYO0O3W2AVpJYaDn9AG4JdM6Kxom8+foE7/BcSig==}
+ resolution: {integrity: sha1-BqqaMw7NpGG+aTiWnBxLZ+lpQZ4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.19.1.tgz}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@oxc-resolver/binding-linux-arm64-musl@11.19.1':
- resolution: {integrity: sha512-jvo2Pjs1c9KPxMuMPIeQsgu0mOJF9rEb3y3TdpsrqwxRM+AN6/nDDwv45n5ZrUnQMsdBy5gIabioMKnQfWo9ew==}
+ resolution: {integrity: sha1-6VHLluf3KouD1jedGdTiYk/KjW4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.19.1.tgz}
cpu: [arm64]
os: [linux]
libc: [musl]
'@oxc-resolver/binding-linux-ppc64-gnu@11.19.1':
- resolution: {integrity: sha512-vLmdNxWCdN7Uo5suays6A/+ywBby2PWBBPXctWPg5V0+eVuzsJxgAn6MMB4mPlshskYbppjpN2Zg83ArHze9gQ==}
+ resolution: {integrity: sha1-tzo9lbm3p02KqV3e/Aa2q3PYr8Y=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.19.1.tgz}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@oxc-resolver/binding-linux-riscv64-gnu@11.19.1':
- resolution: {integrity: sha512-/b+WgR+VTSBxzgOhDO7TlMXC1ufPIMR6Vj1zN+/x+MnyXGW7prTLzU9eW85Aj7Th7CCEG9ArCbTeqxCzFWdg2w==}
+ resolution: {integrity: sha1-qdKbfdw1GCTKJcSqnebNRc/7XR8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.19.1.tgz}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@oxc-resolver/binding-linux-riscv64-musl@11.19.1':
- resolution: {integrity: sha512-YlRdeWb9j42p29ROh+h4eg/OQ3dTJlpHSa+84pUM9+p6i3djtPz1q55yLJhgW9XfDch7FN1pQ/Vd6YP+xfRIuw==}
+ resolution: {integrity: sha1-D8u4/woJ4cYcvNKggDlGrsDLmzs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.19.1.tgz}
cpu: [riscv64]
os: [linux]
libc: [musl]
'@oxc-resolver/binding-linux-s390x-gnu@11.19.1':
- resolution: {integrity: sha512-EDpafVOQWF8/MJynsjOGFThcqhRHy417sRyLfQmeiamJ8qVhSKAn2Dn2VVKUGCjVB9C46VGjhNo7nOPUi1x6uA==}
+ resolution: {integrity: sha1-G34y32O/Mj5ex2X1NtK+FPulF4c=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.19.1.tgz}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@oxc-resolver/binding-linux-x64-gnu@11.19.1':
- resolution: {integrity: sha512-NxjZe+rqWhr+RT8/Ik+5ptA3oz7tUw361Wa5RWQXKnfqwSSHdHyrw6IdcTfYuml9dM856AlKWZIUXDmA9kkiBQ==}
+ resolution: {integrity: sha1-SrJ1TxuVIaPQ8AyyUdi2YDIi8vQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.19.1.tgz}
cpu: [x64]
os: [linux]
libc: [glibc]
'@oxc-resolver/binding-linux-x64-musl@11.19.1':
- resolution: {integrity: sha512-cM/hQwsO3ReJg5kR+SpI69DMfvNCp+A/eVR4b4YClE5bVZwz8rh2Nh05InhwI5HR/9cArbEkzMjcKgTHS6UaNw==}
+ resolution: {integrity: sha1-kcOumGAEExcmx4uprvYVTaqcI44=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.19.1.tgz}
cpu: [x64]
os: [linux]
libc: [musl]
'@oxc-resolver/binding-openharmony-arm64@11.19.1':
- resolution: {integrity: sha512-QF080IowFB0+9Rh6RcD19bdgh49BpQHUW5TajG1qvWHvmrQznTZZjYlgE2ltLXyKY+qs4F/v5xuX1XS7Is+3qA==}
+ resolution: {integrity: sha1-MF/maEP0uiSZ/azxqsADQbWWgZg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.19.1.tgz}
cpu: [arm64]
os: [openharmony]
'@oxc-resolver/binding-wasm32-wasi@11.19.1':
- resolution: {integrity: sha512-w8UCKhX826cP/ZLokXDS6+milN8y4X7zidsAttEdWlVoamTNf6lhBJldaWr3ukTDiye7s4HRcuPEPOXNC432Vg==}
+ resolution: {integrity: sha1-Dohesf1ugFgs99+3VmR/vEJ8zhs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.19.1.tgz}
engines: {node: '>=14.0.0'}
cpu: [wasm32]
'@oxc-resolver/binding-win32-arm64-msvc@11.19.1':
- resolution: {integrity: sha512-nJ4AsUVZrVKwnU/QRdzPCCrO0TrabBqgJ8pJhXITdZGYOV28TIYystV1VFLbQ7DtAcaBHpocT5/ZJnF78YJPtQ==}
+ resolution: {integrity: sha1-LhSHHGB1Ug6/0xLrnGoV51Mje5A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.19.1.tgz}
cpu: [arm64]
os: [win32]
'@oxc-resolver/binding-win32-ia32-msvc@11.19.1':
- resolution: {integrity: sha512-EW+ND5q2Tl+a3pH81l1QbfgbF3HmqgwLfDfVithRFheac8OTcnbXt/JxqD2GbDkb7xYEqy1zNaVFRr3oeG8npA==}
+ resolution: {integrity: sha1-toSZLdD8bo+IBTv6hjJ7ky5MxIY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.19.1.tgz}
cpu: [ia32]
os: [win32]
'@oxc-resolver/binding-win32-x64-msvc@11.19.1':
- resolution: {integrity: sha512-6hIU3RQu45B+VNTY4Ru8ppFwjVS/S5qwYyGhBotmjxfEKk41I2DlGtRfGJndZ5+6lneE2pwloqunlOyZuX/XAw==}
+ resolution: {integrity: sha1-pI3M3LCDPaSVdXmw4xRmZAeZA2Q=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.19.1.tgz}
cpu: [x64]
os: [win32]
@@ -2780,7 +2786,7 @@ packages:
resolution: {integrity: sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==}
'@pkgjs/parseargs@0.11.0':
- resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
+ resolution: {integrity: sha1-p36nQvqyV3UUVDTrHSMoz1ATrDM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@pkgjs/parseargs/-/parseargs-0.11.0.tgz}
engines: {node: '>=14'}
'@protobufjs/aspromise@1.1.2':
@@ -3484,140 +3490,140 @@ packages:
optional: true
'@rollup/rollup-android-arm-eabi@4.60.1':
- resolution: {integrity: sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==}
+ resolution: {integrity: sha1-BD8UVxYjRSkFLvnhzh2Ef/vp5nQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz}
cpu: [arm]
os: [android]
'@rollup/rollup-android-arm64@4.60.1':
- resolution: {integrity: sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==}
+ resolution: {integrity: sha1-Aj4b0UbnUZCH39nosp5M+fjs01w=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz}
cpu: [arm64]
os: [android]
'@rollup/rollup-darwin-arm64@4.60.1':
- resolution: {integrity: sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==}
+ resolution: {integrity: sha1-Vcy1SHwCQZlUxXp6gGAohdYW4e4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz}
cpu: [arm64]
os: [darwin]
'@rollup/rollup-darwin-x64@4.60.1':
- resolution: {integrity: sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==}
+ resolution: {integrity: sha1-JUtlQEsUSIyDIl6IuIGTdq1xp4Q=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz}
cpu: [x64]
os: [darwin]
'@rollup/rollup-freebsd-arm64@4.60.1':
- resolution: {integrity: sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==}
+ resolution: {integrity: sha1-Y3f/OMBSx2/K/7eyco0xcv5nb+Y=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz}
cpu: [arm64]
os: [freebsd]
'@rollup/rollup-freebsd-x64@4.60.1':
- resolution: {integrity: sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==}
+ resolution: {integrity: sha1-ujkCMJ0Ijq9xObkW8JtxQLKLQG0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz}
cpu: [x64]
os: [freebsd]
'@rollup/rollup-linux-arm-gnueabihf@4.60.1':
- resolution: {integrity: sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==}
+ resolution: {integrity: sha1-4BG5oUY4Jn5TtEYoboONva9T8Wc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz}
cpu: [arm]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.60.1':
- resolution: {integrity: sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==}
+ resolution: {integrity: sha1-C86c6aAJSQq9KP2SLdl+1SExGv4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz}
cpu: [arm]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.60.1':
- resolution: {integrity: sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==}
+ resolution: {integrity: sha1-b2z7vzJPu0zv8hOr338yL9RdJf8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.60.1':
- resolution: {integrity: sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==}
+ resolution: {integrity: sha1-98s+7K6pwVHvdzQq8F84rpJL95U=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-loong64-gnu@4.60.1':
- resolution: {integrity: sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==}
+ resolution: {integrity: sha1-SZv6xrtmn9iLtmQ1e/a+mWoouS8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz}
cpu: [loong64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-loong64-musl@4.60.1':
- resolution: {integrity: sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==}
+ resolution: {integrity: sha1-En36wIdkdkOWu+BEU8VF04o6tRg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz}
cpu: [loong64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-ppc64-gnu@4.60.1':
- resolution: {integrity: sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==}
+ resolution: {integrity: sha1-anL02VhSqsGDJsW/cIOT6POkG3A=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-ppc64-musl@4.60.1':
- resolution: {integrity: sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==}
+ resolution: {integrity: sha1-uoZ0ZmsA1vkGbLmldxqEMMNNLeY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz}
cpu: [ppc64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-riscv64-gnu@4.60.1':
- resolution: {integrity: sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==}
+ resolution: {integrity: sha1-F8w4sqceMCVHytKbz3jQ2yYYySI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-musl@4.60.1':
- resolution: {integrity: sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==}
+ resolution: {integrity: sha1-42pB4ti9JHMxvVz8E7jJUdM0VKI=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz}
cpu: [riscv64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-s390x-gnu@4.60.1':
- resolution: {integrity: sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==}
+ resolution: {integrity: sha1-FocmXx9L3qBybHYaWMLbmTNgnWg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.60.1':
- resolution: {integrity: sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==}
+ resolution: {integrity: sha1-Vqag2QdvKgWpdgMUk7JKIN3MDnc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.60.1':
- resolution: {integrity: sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==}
+ resolution: {integrity: sha1-vCQOu1uf2NQcqKgMtFhFLowYfg8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz}
cpu: [x64]
os: [linux]
libc: [musl]
'@rollup/rollup-openbsd-x64@4.60.1':
- resolution: {integrity: sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==}
+ resolution: {integrity: sha1-b4DUigBsSy/6dyTpWj4z9pdYcq8=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz}
cpu: [x64]
os: [openbsd]
'@rollup/rollup-openharmony-arm64@4.60.1':
- resolution: {integrity: sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==}
+ resolution: {integrity: sha1-j2229w0KSKvYM7JjzW3T5xmcTA4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz}
cpu: [arm64]
os: [openharmony]
'@rollup/rollup-win32-arm64-msvc@4.60.1':
- resolution: {integrity: sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==}
+ resolution: {integrity: sha1-tomJv6gV0LPU4wLs2QvadEQ4sXc=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz}
cpu: [arm64]
os: [win32]
'@rollup/rollup-win32-ia32-msvc@4.60.1':
- resolution: {integrity: sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==}
+ resolution: {integrity: sha1-wJjkUzjFDyLxsohHY1TwJbdGKFs=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz}
cpu: [ia32]
os: [win32]
'@rollup/rollup-win32-x64-gnu@4.60.1':
- resolution: {integrity: sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==}
+ resolution: {integrity: sha1-LJ4VvhVbedBZmZU7FzeykDhC6QM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz}
cpu: [x64]
os: [win32]
'@rollup/rollup-win32-x64-msvc@4.60.1':
- resolution: {integrity: sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==}
+ resolution: {integrity: sha1-I7hgET6fh+6gFdH6OkJApStC/NQ=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz}
cpu: [x64]
os: [win32]
@@ -3713,7 +3719,7 @@ packages:
react: ^18 || ^19
'@testing-library/dom@10.4.1':
- resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==}
+ resolution: {integrity: sha1-1ET4qInppG6aO087iOD8s++2z5U=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@testing-library/dom/-/dom-10.4.1.tgz}
engines: {node: '>=18'}
'@testing-library/jest-dom@6.9.1':
@@ -3742,13 +3748,13 @@ packages:
'@testing-library/dom': '>=7.21.4'
'@tybys/wasm-util@0.10.2':
- resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==}
+ resolution: {integrity: sha1-ErOhsz2x+crU3f8fYEq33QC/Rk4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@tybys/wasm-util/-/wasm-util-0.10.2.tgz}
'@types/adm-zip@0.5.7':
resolution: {integrity: sha512-DNEs/QvmyRLurdQPChqq0Md4zGvPwHerAJYWk9l2jCbD1VPpnzRJorOdiq4zsw09NFbYnhfsoEhWtxIzXpn2yw==}
'@types/aria-query@5.0.4':
- resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==}
+ resolution: {integrity: sha1-GjHD03iFDSd42rtjdNA23LpLpwg=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/aria-query/-/aria-query-5.0.4.tgz}
'@types/aws-lambda@8.10.162':
resolution: {integrity: sha1-WJz+zdo6mW6b3yCnOiaggRyvtUk=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/@types/aws-lambda/-/aws-lambda-8.10.162.tgz}
@@ -4114,7 +4120,7 @@ packages:
engines: {node: '>=8'}
ansi-styles@5.2.0:
- resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}
+ resolution: {integrity: sha1-B0SWkK1Fd30ZJKwquy/IiV26g2s=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/ansi-styles/-/ansi-styles-5.2.0.tgz}
engines: {node: '>=10'}
ansi-styles@6.2.3:
@@ -4228,7 +4234,7 @@ packages:
optional: true
bare-fs@4.7.2:
- resolution: {integrity: sha512-aTvMFUWkBmjzKtEQMDGGDNF8bkfpD5N1b/FCwt7A3wrU4t1o/e/85Wzkluh6JlODCjqVESYCkQCdTXqZ9G7VFg==}
+ resolution: {integrity: sha1-D1mzF+W9vsahSJtRmgaiA80/4DU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bare-fs/-/bare-fs-4.7.2.tgz}
engines: {bare: '>=1.16.0'}
peerDependencies:
bare-buffer: '*'
@@ -4241,7 +4247,7 @@ packages:
engines: {bare: '>=1.14.0'}
bare-path@3.0.1:
- resolution: {integrity: sha512-ghj2DSK/2e99a1anTVPCV4m4YIYtrbXhfM7V3D7XZLOTsybnYyaJloymGqssQc8l/or0UoDyRtNQkmkEF/ysgQ==}
+ resolution: {integrity: sha1-wSyBtSeTa2UOh8XQAmTVnvRYCCw=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/bare-path/-/bare-path-3.0.1.tgz}
bare-stream@2.13.1:
resolution: {integrity: sha512-Vp0cnjYyrEC4whYTymQ+YZi6pBpfiICZO3cfRG8sy67ZNWe951urv1x4eW1BKNngw3U+3fPYb5JQvHbCtxH7Ow==}
@@ -4539,7 +4545,7 @@ packages:
engines: {node: '>= 0.10'}
cpu-features@0.0.10:
- resolution: {integrity: sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==}
+ resolution: {integrity: sha1-mq5TbbJxDHJU1+1nyzy8fSmtecU=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/cpu-features/-/cpu-features-0.0.10.tgz}
engines: {node: '>=10.0.0'}
crc-32@1.2.2:
@@ -4759,7 +4765,7 @@ packages:
engines: {node: '>=6.0.0'}
dom-accessibility-api@0.5.16:
- resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==}
+ resolution: {integrity: sha1-WnQp5gZus2ZNkR4z+w5F3o6whFM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz}
dom-accessibility-api@0.6.3:
resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==}
@@ -5010,12 +5016,12 @@ packages:
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
fsevents@2.3.2:
- resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
+ resolution: {integrity: sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fsevents/-/fsevents-2.3.2.tgz}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
fsevents@2.3.3:
- resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
+ resolution: {integrity: sha1-ysZAd4XQNnWipeGlMFxpezR9kNY=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/fsevents/-/fsevents-2.3.3.tgz}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
@@ -5459,7 +5465,7 @@ packages:
react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
lz-string@1.5.0:
- resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==}
+ resolution: {integrity: sha1-watQ93iHtxJiEgG6n9Tjpu0JmUE=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/lz-string/-/lz-string-1.5.0.tgz}
hasBin: true
magic-string@0.30.21:
@@ -5767,7 +5773,7 @@ packages:
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
nan@2.25.0:
- resolution: {integrity: sha512-0M90Ag7Xn5KMLLZ7zliPWP3rT90P6PN+IzVFS0VqmnPktBk3700xUVv8Ikm9EUaUE5SDWdp/BIxdENzVznpm1g==}
+ resolution: {integrity: sha1-k37TReY9lIE2KnlC1JxIYNJ+6r0=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/nan/-/nan-2.25.0.tgz}
nanoid@3.3.15:
resolution: {integrity: sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==}
@@ -6012,7 +6018,7 @@ packages:
engines: {node: '>=0.10.0'}
pretty-format@27.5.1:
- resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}
+ resolution: {integrity: sha1-IYGHn96lGnpYUfs52SD6pj8B2I4=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/pretty-format/-/pretty-format-27.5.1.tgz}
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
process-nextick-args@2.0.1:
@@ -6092,7 +6098,7 @@ packages:
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
react-is@17.0.2:
- resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
+ resolution: {integrity: sha1-5pHUqOnHiTZWVVOas3J2Kw77VPA=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/react-is/-/react-is-17.0.2.tgz}
react-is@18.3.1:
resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==}
@@ -6576,6 +6582,10 @@ packages:
resolution: {integrity: sha512-56adEpPMouktRlBLXiaYFFzZ/3+JXa8P9n7WbR+ibIjtviN55mEaOkiysCnPnWm+7kkui1Dn8J9l+g6zV8731w==}
engines: {node: '>=18'}
+ tarn@3.0.2:
+ resolution: {integrity: sha1-c7YUD7uIG3FVnE+L/ePZpLPSdpM=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/tarn/-/tarn-3.0.2.tgz}
+ engines: {node: '>=8.0.0'}
+
teex@1.0.1:
resolution: {integrity: sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==}
@@ -6702,7 +6712,7 @@ packages:
hasBin: true
uglify-js@3.19.3:
- resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==}
+ resolution: {integrity: sha1-gjFem7xvKyWIiFis0f/4RBA1t38=, tarball: https://ms-feed-25.pkgs.visualstudio.com/1es-public/_packaging/npm-public/npm/registry/uglify-js/-/uglify-js-3.19.3.tgz}
engines: {node: '>=0.8.0'}
hasBin: true
@@ -13436,6 +13446,8 @@ snapshots:
minizlib: 3.1.0
yallist: 5.0.0
+ tarn@3.0.2: {}
+
teex@1.0.1:
dependencies:
streamx: 2.27.0
From 15f5c8d366da8429f74c0d7f9f667bc94cccab6e Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Sun, 11 Oct 2026 18:25:35 +0200
Subject: [PATCH 053/287] docs: clarify Copilot SDK production tradeoffs
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ff08bace-4f82-42b3-9451-4063717e348f
---
ENV_VARIABLES.md | 14 ++++++++++++++
docs/architecture/token-manager.md | 18 ++++++++++++++++--
docs/responsible-ai-faq.md | 2 ++
3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md
index ebdaee4e8..094576278 100644
--- a/ENV_VARIABLES.md
+++ b/ENV_VARIABLES.md
@@ -61,6 +61,14 @@ Foundry, the GitHub Copilot SDK, and a legacy GitHub Models fallback. The
**first source that returns a credential wins**; later sources are not
consulted.
+The Copilot SDK provider is primarily a **desktop and simple self-hosting
+convenience**: a GitHub OAuth flow can enable Portal AI without provisioning a
+separate inference resource. The SDK runs a Copilot CLI child process and Scope
+must maintain a bounded pool of those processes. For production deployments,
+prefer Azure AI Foundry or another direct chat-completions endpoint, which
+avoids subprocess lifecycle and pool-capacity overhead and exposes native
+inference controls.
+
| # | Source | Trigger | `via` log tag |
|---|--------|---------|---------------|
| 1 | Azure AI Foundry via env vars | `AZURE_AI_INFERENCE_ENDPOINT` + `AZURE_AI_INFERENCE_API_KEY` both set | `azure-ai-foundry-env` |
@@ -100,6 +108,12 @@ sanitized environment with only the runtime and authentication variables it
needs; the API service's unrelated credentials are not forwarded. Sessions are
never reused across Portal AI requests.
+These controls make the SDK path practical for desktop use and smaller
+self-hosted installations, but they do not remove the cost of running child
+processes in the API container. Production operators should normally configure
+Foundry or a direct completion endpoint instead of sizing and operating a
+Copilot runtime pool.
+
The Copilot SDK adapter preserves the Portal operation's system prompt and user
prompt. Its model resolves independently from the REST default, in this order:
an explicit request override, `PORTAL_COPILOT_MODEL`, `LLM_MODEL`, then automatic
diff --git a/docs/architecture/token-manager.md b/docs/architecture/token-manager.md
index 0123668c2..e96bde501 100644
--- a/docs/architecture/token-manager.md
+++ b/docs/architecture/token-manager.md
@@ -265,8 +265,10 @@ configured provider in this order:
`azure-ai-inference` is derived from any registered `azure-ai-foundry`
key.
3. **GitHub Copilot SDK** — `GITHUB_TOKEN` or a registered classic PAT/OAuth
- token with the `copilot-sdk` capability. This is the preferred
- GitHub-backed provider.
+ token with the `copilot-sdk` capability. This is a convenience path for
+ desktop and straightforward self-hosted installations: the same GitHub
+ OAuth flow can enable Portal AI without a separately provisioned inference
+ endpoint.
4. **GitHub Models (legacy fallback)** — `GITHUB_MODELS_API_KEY`, a registered
`github-models` token, or the legacy `GITHUB_TOKEN` path.
@@ -274,6 +276,12 @@ Each successful acquisition logs the selected source. GitHub Models remains
available for compatibility, but new deployments should use Foundry or Copilot
SDK credentials.
+For production deployments, prefer Foundry or another direct chat-completions
+endpoint over Copilot SDK. The SDK launches Copilot CLI child processes and
+requires Scope to operate a bounded client pool, whereas a direct endpoint
+avoids subprocess lifecycle and pool-capacity overhead and exposes native
+inference controls.
+
### Copilot SDK request isolation
Portal AI bounds Copilot SDK concurrency with a fixed-size client pool (default
@@ -284,6 +292,12 @@ client, creates a **one-shot** session, sends one prompt, then disconnects and
deletes the session in `finally` before returning the client to the pool.
Session cleanup therefore runs after success, provider errors, and timeouts.
+The pool exists because the SDK runtime is not in-process: every pooled client
+owns a Copilot CLI child process. This tradeoff streamlines desktop setup, but
+production capacity planning must account for the child processes' memory,
+startup, health-check, and idle-eviction behavior. A direct inference endpoint
+is therefore the recommended production architecture.
+
The session is intentionally isolated from coding-agent behavior:
- The Copilot client uses `mode: "empty"`. Its SDK session uses an empty tool
diff --git a/docs/responsible-ai-faq.md b/docs/responsible-ai-faq.md
index eb72b1ffb..441dd9ea4 100644
--- a/docs/responsible-ai-faq.md
+++ b/docs/responsible-ai-faq.md
@@ -46,6 +46,8 @@ Scope uses AI in several places, depending on deployment configuration:
Portal AI provider precedence is Azure AI Foundry environment credentials, Azure AI Foundry credentials from Token Manager, GitHub Copilot SDK credentials from Token Manager, and then GitHub Models as a legacy fallback. Once a provider is selected, Scope does not fail over to another provider after an authentication, timeout, rate-limit, or inference error. Judge and report generation use their separately configured Copilot SDK integrations, while coding-agent surfaces reach their own model backends directly.
+The Portal AI Copilot SDK provider is intended as a convenience for desktop and simple self-hosted Scope installations: users can enable assistance through a GitHub OAuth flow without first provisioning an inference resource. Because the SDK launches Copilot CLI child processes and requires a bounded client pool, production deployments should prefer Azure AI Foundry or another direct completion endpoint with native inference controls and no subprocess-pool overhead.
+
Portal AI's Copilot SDK path uses a bounded client pool and a fresh one-shot session for each request. The client runs in empty mode; the session has no tools, MCP servers, skills, custom agents, extensions, or repository context, receives only the operation's system and user prompts, and is disconnected and deleted before its client returns to the pool. The child process receives a sanitized environment rather than the API service's complete environment. These controls reduce cross-request context and credential exposure, but generated content still requires human review.
The Copilot SDK path preserves the Portal operation's system prompt, user prompt, and model selection. REST-specific temperature and maximum-token controls are not exposed by the SDK session API, so they apply only to the Foundry and legacy GitHub Models REST paths.
From 8f30583dda7387f0a9cf7be396f746c20bfee633 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Sun, 11 Oct 2026 18:42:05 +0200
Subject: [PATCH 054/287] fix(api): harden Copilot pool startup
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ff08bace-4f82-42b3-9451-4063717e348f
---
apps/api/src/copilot-client-pool.test.ts | 27 ++++++++++++---
apps/api/src/copilot-client-pool.ts | 44 +++++++++++++++++-------
apps/api/src/llm-token.test.ts | 12 +++++++
3 files changed, 66 insertions(+), 17 deletions(-)
diff --git a/apps/api/src/copilot-client-pool.test.ts b/apps/api/src/copilot-client-pool.test.ts
index 5a557757f..3445a76ad 100644
--- a/apps/api/src/copilot-client-pool.test.ts
+++ b/apps/api/src/copilot-client-pool.test.ts
@@ -20,6 +20,7 @@ const mocks = vi.hoisted(() => ({
mkdtemp: vi.fn(),
rm: vi.fn(),
ping: vi.fn(),
+ models: [{ id: "test-default-model", name: "Test Default", capabilities: {} }],
sessionFactory: vi.fn(),
}));
@@ -35,9 +36,7 @@ vi.mock("@github/copilot-sdk", () => ({
CopilotClient: class implements MockClient {
start = vi.fn(async () => undefined);
ping = vi.fn((message: string) => mocks.ping(message));
- listModels = vi.fn(async () => [
- { id: "test-default-model", name: "Test Default", capabilities: {} },
- ]);
+ listModels = vi.fn(async () => mocks.models);
createSession = vi.fn((options: Record) =>
mocks.sessionFactory(options),
);
@@ -67,7 +66,10 @@ vi.mock("shared", () => ({
withRetry: (operation: () => Promise) => operation(),
}));
-import { PortalCopilotClientPool } from "./copilot-client-pool.js";
+import {
+ CopilotCredentialUnavailableError,
+ PortalCopilotClientPool,
+} from "./copilot-client-pool.js";
const pools: PortalCopilotClientPool[] = [];
let sessionNumber = 0;
@@ -109,6 +111,9 @@ beforeEach(() => {
vi.clearAllMocks();
mocks.clientOptions.length = 0;
mocks.clients.length = 0;
+ mocks.models = [
+ { id: "test-default-model", name: "Test Default", capabilities: {} },
+ ];
pools.length = 0;
sessionNumber = 0;
vi.stubEnv("PORTAL_COPILOT_POOL_SIZE", "1");
@@ -253,4 +258,18 @@ describe("PortalCopilotClientPool", () => {
"Copilot SDK pool is shutting down",
);
});
+
+ it("treats an account with no Copilot models as an unavailable credential", async () => {
+ mocks.models = [];
+ const pool = makePool();
+
+ await expect(complete(pool)).rejects.toBeInstanceOf(
+ CopilotCredentialUnavailableError,
+ );
+ expect(mocks.clients[0].forceStop).toHaveBeenCalledOnce();
+ expect(mocks.rm).toHaveBeenCalledWith(
+ "/scope-tests/runtime",
+ { recursive: true, force: true },
+ );
+ });
});
diff --git a/apps/api/src/copilot-client-pool.ts b/apps/api/src/copilot-client-pool.ts
index 0734a81f6..4ab99ea1e 100644
--- a/apps/api/src/copilot-client-pool.ts
+++ b/apps/api/src/copilot-client-pool.ts
@@ -129,6 +129,19 @@ function isRetryableCopilotError(error: unknown): boolean {
].some((pattern) => text.includes(pattern));
}
+function isCopilotCredentialFailure(error: unknown): boolean {
+ const text = errorText(error).toLowerCase();
+ return [
+ "authentication",
+ "unauthorized",
+ "forbidden",
+ "invalid token",
+ "not entitled",
+ "copilot license",
+ "no available models",
+ ].some((pattern) => text.includes(pattern));
+}
+
async function withTimeout(
operation: Promise,
timeoutMs: number,
@@ -184,7 +197,12 @@ export class PortalCopilotClientPool {
min: 0,
max,
acquireTimeoutMillis,
- createTimeoutMillis: this.startupTimeoutMs,
+ // createResource owns the startup deadline and force-stops a partial
+ // client before rejecting. Keep Tarn's outer deadline longer so it never
+ // abandons a creator that is still cleaning up and starts a replacement
+ // beyond the configured pool maximum.
+ createTimeoutMillis:
+ this.startupTimeoutMs + this.shutdownTimeoutMs + 1_000,
destroyTimeoutMillis: this.shutdownTimeoutMs,
idleTimeoutMillis: positiveInt(
"PORTAL_COPILOT_IDLE_TIMEOUT_MS",
@@ -308,20 +326,14 @@ export class PortalCopilotClientPool {
this.resourcesCreated += 1;
try {
- await withTimeout(
- client.start(),
- this.startupTimeoutMs,
- `Copilot CLI did not start within ${this.startupTimeoutMs}ms`,
- );
- await withTimeout(
- client.ping("scope-portal-ai-ready"),
- this.startupTimeoutMs,
- `Copilot CLI did not respond within ${this.startupTimeoutMs}ms`,
- );
const models = await withTimeout(
- client.listModels(),
+ (async () => {
+ await client.start();
+ await client.ping("scope-portal-ai-ready");
+ return client.listModels();
+ })(),
this.startupTimeoutMs,
- `Copilot model discovery did not finish within ${this.startupTimeoutMs}ms`,
+ `Copilot CLI startup did not finish within ${this.startupTimeoutMs}ms`,
);
const preferred = [
"gpt-5.4-mini",
@@ -343,6 +355,12 @@ export class PortalCopilotClientPool {
} catch (error) {
resource.healthy = false;
await this.destroyResource(resource, true);
+ if (isCopilotCredentialFailure(error)) {
+ throw new CopilotCredentialUnavailableError(
+ `Copilot SDK credential cannot provide Portal AI completions: ${errorText(error)}`,
+ { cause: error },
+ );
+ }
throw error;
}
}
diff --git a/apps/api/src/llm-token.test.ts b/apps/api/src/llm-token.test.ts
index f274756ab..39553c2dd 100644
--- a/apps/api/src/llm-token.test.ts
+++ b/apps/api/src/llm-token.test.ts
@@ -156,6 +156,18 @@ describe("completePortalLlm provider resolution", () => {
expect(mocks.modelPost).toHaveBeenCalledOnce();
});
+ it("uses an explicit GitHub Models key when no Copilot credential is configured", async () => {
+ vi.stubEnv("GITHUB_MODELS_API_KEY", "github-models-key");
+ mocks.modelPost.mockResolvedValue(completion("from-github-models-env"));
+
+ await expect(completePortalLlm(request)).resolves.toBe(
+ "from-github-models-env",
+ );
+
+ expect(mocks.copilotComplete).not.toHaveBeenCalled();
+ expect(mocks.modelPost).toHaveBeenCalledOnce();
+ });
+
it("does not hide an inference failure by falling through to another provider", async () => {
vi.stubEnv("AZURE_AI_INFERENCE_ENDPOINT", "https://foundry.example.test/models");
vi.stubEnv("AZURE_AI_INFERENCE_API_KEY", "foundry-key");
From 4b284135a7b638b27b0d7759482b8d9243098487 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Sun, 11 Oct 2026 18:42:26 +0200
Subject: [PATCH 055/287] fix(api): bound Copilot force-stop cleanup
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ff08bace-4f82-42b3-9451-4063717e348f
---
apps/api/src/copilot-client-pool.ts | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/apps/api/src/copilot-client-pool.ts b/apps/api/src/copilot-client-pool.ts
index 4ab99ea1e..dd8a29409 100644
--- a/apps/api/src/copilot-client-pool.ts
+++ b/apps/api/src/copilot-client-pool.ts
@@ -480,7 +480,13 @@ export class PortalCopilotClientPool {
try {
if (force) {
- await resource.client.forceStop().catch(() => undefined);
+ await withTimeout(
+ resource.client.forceStop(),
+ this.shutdownTimeoutMs,
+ `Copilot CLI force-stop did not finish within ${this.shutdownTimeoutMs}ms`,
+ ).catch((error) => {
+ console.warn(`[portal-copilot-pool] force-stop failed: ${errorText(error)}`);
+ });
} else {
const errors = await withTimeout(
resource.client.stop(),
@@ -495,7 +501,11 @@ export class PortalCopilotClientPool {
}
} catch (error) {
console.warn(`[portal-copilot-pool] stop failed: ${errorText(error)}`);
- await resource.client.forceStop().catch(() => undefined);
+ await withTimeout(
+ resource.client.forceStop(),
+ this.shutdownTimeoutMs,
+ `Copilot CLI force-stop did not finish within ${this.shutdownTimeoutMs}ms`,
+ ).catch(() => undefined);
} finally {
await rm(resource.rootDirectory, { recursive: true, force: true }).catch((error) => {
console.warn(`[portal-copilot-pool] temp cleanup failed: ${errorText(error)}`);
From 0db6734e5256cda65a0b4a9be0b5df5f17ede994 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Wed, 14 Oct 2026 12:50:30 +0200
Subject: [PATCH 056/287] feat: add reusable experiment grouping
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8b89e529-c849-4715-8d82-4ad4baa9f14c
---
.../openapi-snapshot.test.ts.snap | 26 ++++++
apps/api/src/endpoints.test.ts | 81 ++++++++++++++++++-
apps/api/src/grouping.test.ts | 8 ++
apps/api/src/grouping.ts | 21 +++--
apps/api/src/routes/requests/index.ts | 68 +++++++++++++---
.../__snapshots__/cli-commands.test.ts.snap | 3 +
apps/cli/src/commands/run.test.ts | 14 +++-
apps/cli/src/commands/run.ts | 37 +++++++--
apps/portal/src/lib/api.ts | 7 +-
apps/portal/src/pages/RunDetail.tsx | 5 ++
apps/portal/src/pages/RunsList.tsx | 51 +++++++++---
apps/portal/src/pages/SubmitRun.tsx | 17 ++++
apps/portal/src/types.ts | 3 +-
docs/architecture/app-design.md | 16 ++++
.../src/031-add-experiment-id-index.test.ts | 46 +++++++++++
.../src/check-migrations.test.ts | 10 ++-
.../migrations/031-add-experiment-id-index.ts | 34 ++++++++
.../db-migrations/src/required-migrations.ts | 1 +
packages/shared/src/schemas/request.ts | 6 +-
packages/shared/src/types/types.ts | 3 +-
website/src/openapi/scope-openapi.json | 2 +-
21 files changed, 415 insertions(+), 44 deletions(-)
create mode 100644 packages/db-migrations/src/031-add-experiment-id-index.test.ts
create mode 100644 packages/db-migrations/src/migrations/031-add-experiment-id-index.ts
diff --git a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
index 49b9f80b3..b69524965 100644
--- a/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
+++ b/apps/api/src/__snapshots__/openapi-snapshot.test.ts.snap
@@ -912,6 +912,10 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"codebaseRevisionId": {
"type": "string",
},
+ "experimentId": {
+ "minLength": 1,
+ "type": "string",
+ },
"extensions": {
"items": {
"type": "string",
@@ -2662,6 +2666,9 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"null",
],
},
+ "experimentId": {
+ "type": "string",
+ },
"extensions": {
"items": {
"type": "string",
@@ -8707,6 +8714,24 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"type": "string",
},
},
+ {
+ "in": "query",
+ "name": "experimentId",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string",
+ },
+ {
+ "items": {
+ "type": "string",
+ },
+ "type": "array",
+ },
+ ],
+ },
+ },
{
"in": "query",
"name": "profileId",
@@ -8850,6 +8875,7 @@ exports[`OpenAPI spec snapshot > matches the committed snapshot 1`] = `
"task",
"submissionId",
"profile",
+ "experiment",
],
"type": "string",
},
diff --git a/apps/api/src/endpoints.test.ts b/apps/api/src/endpoints.test.ts
index 9552f0696..d50b2db16 100644
--- a/apps/api/src/endpoints.test.ts
+++ b/apps/api/src/endpoints.test.ts
@@ -721,6 +721,50 @@ describe("API Endpoints", () => {
expect(res.body.data[0]).toHaveProperty("key", "sub-1");
});
+ it("returns grouped results when groupBy=experiment", async () => {
+ const groupedDocs = [
+ { key: "exp-1", label: "exp-1", runIds: ["r1"], aggregates: { count: 1, turns: null, duration: null, promptTokens: null, completionTokens: null, llmCalls: null, statusCounts: {}, outcomeCounts: {} }, uniform: {} },
+ ];
+ (mocks.collection.aggregate as any)
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([{ _id: "exp-1" }]) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue(groupedDocs) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) });
+
+ const res = await request(testServer()).get(`/api/v1/requests?groupBy=experiment&projectId=${TEST_PROJECT_ID}`);
+
+ expect(res.status).toBe(200);
+ expect(res.body.data[0]).toHaveProperty("key", "exp-1");
+ });
+
+ it("fetches members with missing experiment ids for the no-experiment group", async () => {
+ (mocks.collection.aggregate as any)
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([{ _id: "no-experiment" }]) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) })
+ .mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) });
+
+ const res = await request(testServer()).get(
+ `/api/v1/requests?groupBy=experiment&projectId=${TEST_PROJECT_ID}`,
+ );
+
+ expect(res.status).toBe(200);
+ const phase2Pipeline = (mocks.collection.aggregate as any).mock.calls[1][0];
+ expect(phase2Pipeline[0]).toEqual({
+ $match: {
+ $and: [
+ expect.any(Object),
+ {
+ $or: [
+ { experimentId: { $exists: false } },
+ { experimentId: null },
+ ],
+ },
+ ],
+ },
+ });
+ });
+
it("calls aggregate pipeline when groupBy is provided", async () => {
(mocks.collection.aggregate as any)
.mockReturnValueOnce({ toArray: vi.fn().mockResolvedValue([]) }); // keys (empty)
@@ -761,6 +805,22 @@ describe("API Endpoints", () => {
);
});
+ it("passes experimentId filter to the find query", async () => {
+ (mocks.collection.find as any).mockReturnValue({
+ sort: vi.fn().mockReturnValue({
+ limit: vi.fn().mockReturnValue({
+ toArray: vi.fn().mockResolvedValue([]),
+ }),
+ }),
+ });
+
+ await request(testServer()).get(`/api/v1/requests?experimentId=exp-42&projectId=${TEST_PROJECT_ID}`);
+
+ expect(mocks.collection.find).toHaveBeenCalledWith(
+ expect.objectContaining({ experimentId: "exp-42" }),
+ );
+ });
+
it("passes outcome filter to find query", async () => {
(mocks.collection.find as any).mockReturnValue({
sort: vi.fn().mockReturnValue({
@@ -2028,6 +2088,23 @@ describe("API Endpoints", () => {
expect(doc).toHaveProperty("agentsMdParentIds", ["agents-p1", "agents-p2"]);
});
+ it("persists experimentId on the request", async () => {
+ setupCopilotAgent();
+
+ const res = await request(testServer())
+ .post(`/api/v1/requests?worker=coder-acp-copilot&projectId=${TEST_PROJECT_ID}`)
+ .send({
+ scenario: { task: "Build something", criteria: ["works"] },
+ model: "claude-haiku-4.5",
+ experimentId: "exp-42",
+ });
+
+ expect(res.status).toBe(201);
+ const doc = (mocks.collection.insertOne as any).mock.calls[0][0];
+ expect(doc).toHaveProperty("experimentId", "exp-42");
+ expect(res.body).toHaveProperty("experimentId", "exp-42");
+ });
+
it("omits AGENTS.md fields when not provided", async () => {
setupCopilotAgent();
@@ -2320,7 +2397,7 @@ describe("API Endpoints", () => {
// ===================================================================
describe("POST /api/v1/requests/bulk-resubmit", () => {
- it("preserves agentVersion and taskPromptId from original run", async () => {
+ it("preserves agentVersion, taskPromptId, and experimentId from original run", async () => {
const originalRun = {
_id: "run-original",
scenario: { task: "Build a form", criteria: ["has_react"] },
@@ -2329,6 +2406,7 @@ describe("API Endpoints", () => {
model: "gpt-4o",
agentVersion: "copilot-0.0.415",
taskPromptId: "tp-123",
+ experimentId: "exp-42",
personaInstructions: "Be helpful",
createdAt: new Date(),
maxIterations: 5,
@@ -2364,6 +2442,7 @@ describe("API Endpoints", () => {
expect(insertCall).toHaveLength(1);
expect(insertCall[0]).toHaveProperty("agentVersion", "copilot-0.0.420");
expect(insertCall[0]).toHaveProperty("taskPromptId", "tp-123");
+ expect(insertCall[0]).toHaveProperty("experimentId", "exp-42");
expect(insertCall[0]).toHaveProperty("model", "gpt-4o");
expect(insertCall[0]).toHaveProperty("maxIterations", 5);
});
diff --git a/apps/api/src/grouping.test.ts b/apps/api/src/grouping.test.ts
index 56a834ce3..d14ebf751 100644
--- a/apps/api/src/grouping.test.ts
+++ b/apps/api/src/grouping.test.ts
@@ -38,6 +38,14 @@ describe("buildGroupingPipeline", () => {
expect(addFields._groupKey).toBeDefined();
});
+ it("groups missing experiment ids under a stable sentinel", () => {
+ const pipeline = buildGroupingPipeline("experiment");
+ const addFields = pipeline[0].$addFields as Record;
+ expect(addFields._groupKey).toEqual({
+ $ifNull: ["$experimentId", { $literal: "no-experiment" }],
+ });
+ });
+
it("$group stage uses _groupKey as _id", () => {
const pipeline = buildGroupingPipeline("task");
const group = pipeline[1].$group as Record;
diff --git a/apps/api/src/grouping.ts b/apps/api/src/grouping.ts
index 3cc34cb18..3395fefb9 100644
--- a/apps/api/src/grouping.ts
+++ b/apps/api/src/grouping.ts
@@ -12,18 +12,28 @@ import type { GroupByKey, RunGroup, AggregateStats, GroupUniformValues } from "s
* The pipeline is appended after a $match stage with the caller's filter.
*/
export function buildGroupingPipeline(
- groupBy: "task" | "submissionId" | "profile",
+ groupBy: "task" | "submissionId" | "profile" | "experiment",
): Document[] {
const groupField =
- groupBy === "task" ? "$taskPromptId" : groupBy === "profile" ? "$profileId" : "$submissionId";
+ groupBy === "task"
+ ? "$taskPromptId"
+ : groupBy === "profile"
+ ? "$profileId"
+ : groupBy === "experiment"
+ ? "$experimentId"
+ : "$submissionId";
const fallbackGroupField =
- groupBy === "profile" ? { $literal: "no-profile" } : { $literal: "no-submission" };
+ groupBy === "profile"
+ ? { $literal: "no-profile" }
+ : groupBy === "experiment"
+ ? { $literal: "no-experiment" }
+ : { $literal: "no-submission" };
// `task` groups purely by the always-present `taskPromptId` — it is
// materialized on every run-creation path (findOrCreate → taskPrompt._id) and
// backfilled onto legacy docs by migration 001, so the group key is always a
// real id the member-fetch filter (`{ taskPromptId: key }`) can match. Only
- // `profile`/`submission` fall back to a fixed literal sentinel for runs that
- // genuinely lack the field.
+ // `profile`/`experiment`/`submission` fall back to a fixed literal sentinel
+ // for runs that genuinely lack the field.
const groupKeyExpr =
groupBy === "task" ? groupField : { $ifNull: [groupField, fallbackGroupField] };
@@ -162,6 +172,7 @@ export function buildGroupingPipeline(
branches: [
{ case: { $eq: ["$_id", "no-submission"] }, then: "No submission ID" },
{ case: { $eq: ["$_id", "no-profile"] }, then: "No profile" },
+ { case: { $eq: ["$_id", "no-experiment"] }, then: "No experiment ID" },
],
default: { $ifNull: ["$_firstTask", "$_id"] },
},
diff --git a/apps/api/src/routes/requests/index.ts b/apps/api/src/routes/requests/index.ts
index 0d719ffbb..93dda5938 100644
--- a/apps/api/src/routes/requests/index.ts
+++ b/apps/api/src/routes/requests/index.ts
@@ -459,9 +459,14 @@ apiRoute(ctx.app, ctx.registry, {
successStatus: 201,
handler: async (req, res) => {
const projectId = getQueryProjectId(req);
- const { scenario: scenarioObj, persona: personaObj, maxIterations, personaInstructions, count = 1, model: requestedModel, reasoningEffort: requestedReasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion: requestedAgentVersion, profileId: requestedProfileSpec, profileVariations, priority: requestedPriority, agentsMd: requestedAgentsMd, agentsMdParentIds: requestedAgentsMdParentIds, gates: requestedGates, codebase: codebaseSpec, codebaseRevisionId: requestedCodebaseRevisionId, resources: resourceSpecs } = req.body;
+ const { scenario: scenarioObj, persona: personaObj, maxIterations, personaInstructions, count = 1, model: requestedModel, reasoningEffort: requestedReasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, extensions: extensionIds, agentVersion: requestedAgentVersion, profileId: requestedProfileSpec, profileVariations, priority: requestedPriority, experimentId: requestedExperimentId, agentsMd: requestedAgentsMd, agentsMdParentIds: requestedAgentsMdParentIds, gates: requestedGates, codebase: codebaseSpec, codebaseRevisionId: requestedCodebaseRevisionId, resources: resourceSpecs } = req.body;
let worker = req.query.worker as string | undefined;
+ const experimentId =
+ typeof requestedExperimentId === "string" && requestedExperimentId.trim()
+ ? requestedExperimentId.trim()
+ : undefined;
+
// AGENTS.md body + lineage (for any caller that wants to attach an
// AGENTS.md instruction file to a run).
const agentsMdText =
@@ -480,8 +485,9 @@ apiRoute(ctx.app, ctx.registry, {
return p._id;
};
- // Common request fields for AGENTS.md delivery + lineage.
- const buildAgentsMdFields = (agentsMdPromptId?: string) => ({
+ // Common request fields for experiment grouping + AGENTS.md delivery.
+ const buildExperimentFields = (agentsMdPromptId?: string) => ({
+ ...(experimentId ? { experimentId } : {}),
...(agentsMdPromptId ? { agentsMdPromptId } : {}),
...(agentsMdParentIds && agentsMdParentIds.length ? { agentsMdParentIds } : {}),
});
@@ -814,7 +820,7 @@ apiRoute(ctx.app, ctx.registry, {
const newDocs: RequestDocument[] = [];
const variationResults: Array<{ profileId: string; label?: string; ids: string[] }> = [];
const agentsMdPromptId = await resolveAgentsMdPromptId();
- const agentsMdFields = buildAgentsMdFields(agentsMdPromptId);
+ const experimentFields = buildExperimentFields(agentsMdPromptId);
for (const r of resolved) {
const newIds: string[] = [];
@@ -849,7 +855,7 @@ apiRoute(ctx.app, ctx.registry, {
profileVersionId: r.profileVersion.ref ?? r.profileVersion._id,
...(persistedVariationGates ? { gates: persistedVariationGates } : {}),
submissionId,
- ...agentsMdFields,
+ ...experimentFields,
run: { _id: runId, attemptNumber: 1, status: "pending", logsUrl: ctx.blobStorage.getLogsBlobUrl(`${requestId}/runs/${runId}/run.jsonl`) },
};
newDocs.push(requestDoc);
@@ -867,6 +873,7 @@ apiRoute(ctx.app, ctx.registry, {
ids: allNewIds,
count: allNewIds.length,
submissionId,
+ ...(experimentId ? { experimentId } : {}),
variations: variationResults,
variationCount: variationEntries.length,
status: "pending",
@@ -1223,7 +1230,7 @@ apiRoute(ctx.app, ctx.registry, {
// Resolve AGENTS.md lineage once for this submission (shared across count>1).
const agentsMdPromptId = await resolveAgentsMdPromptId();
- const agentsMdFields = buildAgentsMdFields(agentsMdPromptId);
+ const experimentFields = buildExperimentFields(agentsMdPromptId);
// Build the persisted gate configs: order canonically and point the Select
// gate's prompt at the resolved task prompt (docs/design/gates.md §4.3).
@@ -1269,7 +1276,7 @@ apiRoute(ctx.app, ctx.registry, {
...(profileVersionId ? { profileVersionId } : {}),
...(persistedGates ? { gates: persistedGates } : {}),
submissionId,
- ...agentsMdFields,
+ ...experimentFields,
// Mint a distinct run id for the first attempt. Blob artifacts
// are scoped under `{requestId}/runs/{runId}/...` so retries
// never overwrite a previous attempt's blobs.
@@ -1287,6 +1294,7 @@ apiRoute(ctx.app, ctx.registry, {
ids: newIds,
count,
submissionId,
+ ...(experimentId ? { experimentId } : {}),
workerType,
taskPromptId,
...(model ? { model } : {}),
@@ -1331,7 +1339,7 @@ apiRoute(ctx.app, ctx.registry, {
...(profileVersionId ? { profileVersionId } : {}),
...(persistedGates ? { gates: persistedGates } : {}),
submissionId,
- ...agentsMdFields,
+ ...experimentFields,
// Mint a distinct run id for the first attempt. Blob artifacts
// are scoped under `{requestId}/runs/{runId}/...` so retries
// never overwrite a previous attempt's blobs.
@@ -1346,6 +1354,7 @@ apiRoute(ctx.app, ctx.registry, {
res.status(201).json({
id: requestId,
submissionId,
+ ...(experimentId ? { experimentId } : {}),
workerType,
...(model ? { model } : {}),
...(effectiveReasoningEffort ? { reasoningEffort: effectiveReasoningEffort } : {}),
@@ -1435,7 +1444,7 @@ apiRoute(ctx.app, ctx.registry, {
const maxIterationsFilterRaw = req.query.maxIterations as string | undefined;
const maxIterationsOpFilter = (req.query.maxIterationsOp as string | undefined) ?? "eq";
const includeDeleted = req.query.includeDeleted === "true";
- const groupByParam = req.query.groupBy as "task" | "submissionId" | "profile" | undefined;
+ const groupByParam = req.query.groupBy as "task" | "submissionId" | "profile" | "experiment" | undefined;
const limit = Math.min(Math.max(Number(req.query.limit) || 10, 1), 100);
const afterParam = req.query.after as string | undefined;
const beforeParam = req.query.before as string | undefined;
@@ -1447,6 +1456,7 @@ apiRoute(ctx.app, ctx.registry, {
const statusValues = parseMulti(req.query.status);
const outcomeValues = parseMulti(req.query.outcome);
const profileIdValues = parseMulti(req.query.profileId);
+ const experimentIdValues = parseMulti(req.query.experimentId);
const modelValues = parseMulti(req.query.model);
const osValues = parseMulti(req.query.os);
const priorityValues = parseMulti(req.query.priority);
@@ -1497,6 +1507,7 @@ apiRoute(ctx.app, ctx.registry, {
pushClause(buildMultiClause("run.status", statusValues));
pushClause(buildMultiClause("run.outcome", outcomeValues));
pushClause(buildMultiClause("profileId", profileIdValues));
+ pushClause(buildMultiClause("experimentId", experimentIdValues));
pushClause(buildMultiClause("model", modelValues));
pushClause(buildMultiClause("run.os.platform", osValues));
pushClause(buildMultiClause("priority", priorityValues, { coerceNumber: true }));
@@ -1601,8 +1612,25 @@ apiRoute(ctx.app, ctx.registry, {
// Grouped mode: paginated RunGroup[] via two-phase aggregation
if (groupByParam) {
- const groupByField = groupByParam === "task" ? "taskPromptId" : groupByParam === "profile" ? "profileId" : "submissionId";
- const groupByAggField = `$${groupByField}`;
+ const groupByField =
+ groupByParam === "task"
+ ? "taskPromptId"
+ : groupByParam === "profile"
+ ? "profileId"
+ : groupByParam === "experiment"
+ ? "experimentId"
+ : "submissionId";
+ const missingGroupKey =
+ groupByParam === "profile"
+ ? "no-profile"
+ : groupByParam === "experiment"
+ ? "no-experiment"
+ : groupByParam === "submissionId"
+ ? "no-submission"
+ : undefined;
+ const groupByAggField = missingGroupKey
+ ? { $ifNull: [`$${groupByField}`, missingGroupKey] }
+ : `$${groupByField}`;
// Decode group cursor
let afterKey: string | undefined;
@@ -1654,8 +1682,21 @@ apiRoute(ctx.app, ctx.registry, {
}
// Phase 2: Full aggregation scoped to current page's groups only
+ const concretePageKeys = missingGroupKey
+ ? pageKeys.filter((key) => key !== missingGroupKey)
+ : pageKeys;
+ const pageGroupClause =
+ missingGroupKey && pageKeys.includes(missingGroupKey)
+ ? {
+ $or: [
+ ...(concretePageKeys.length > 0 ? [{ [groupByField]: { $in: concretePageKeys } }] : []),
+ { [groupByField]: { $exists: false } },
+ { [groupByField]: null },
+ ],
+ }
+ : { [groupByField]: { $in: concretePageKeys } };
const phase2Pipeline = [
- { $match: { ...filter, [groupByField]: { $in: pageKeys } } },
+ { $match: { $and: [filter, pageGroupClause] } },
...buildGroupingPipeline(groupByParam),
];
const groups = await ctx.requestCollection.aggregate(phase2Pipeline).toArray();
@@ -2154,7 +2195,8 @@ apiRoute(ctx.app, ctx.registry, {
...(original.taskPromptId ? { taskPromptId: original.taskPromptId } : {}),
...(effectiveProfileId ? { profileId: effectiveProfileId } : {}),
...(effectiveProfileVersionId ? { profileVersionId: effectiveProfileVersionId } : {}),
- // Preserve AGENTS.md lineage across re-submits.
+ // Preserve experiment grouping and AGENTS.md lineage across re-submits.
+ ...(original.experimentId ? { experimentId: original.experimentId } : {}),
...(original.agentsMdPromptId ? { agentsMdPromptId: original.agentsMdPromptId } : {}),
...(original.agentsMdParentIds && original.agentsMdParentIds.length > 0 ? { agentsMdParentIds: original.agentsMdParentIds } : {}),
submissionId,
diff --git a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
index 66f3e414c..9773014fb 100644
--- a/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
+++ b/apps/cli/src/__snapshots__/cli-commands.test.ts.snap
@@ -779,6 +779,8 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--created-after",
"--created-before",
"--criteria",
+ "--experiment-id",
+ "--group-by",
"--include-deleted",
"--max-iterations",
"--model",
@@ -828,6 +830,7 @@ exports[`CLI command registration > full command tree matches snapshot 1`] = `
"--codebase",
"--count",
"--criteria",
+ "--experiment-id",
"--extensions",
"--gates",
"--max-iterations",
diff --git a/apps/cli/src/commands/run.test.ts b/apps/cli/src/commands/run.test.ts
index b26334bab..df74c7606 100644
--- a/apps/cli/src/commands/run.test.ts
+++ b/apps/cli/src/commands/run.test.ts
@@ -175,6 +175,15 @@ describe("run list", () => {
expect(output).toContain("status: done");
expect(output).not.toContain("Found 1 request(s):");
});
+
+ it("passes --experiment-id and --group-by through as query params", async () => {
+ mockFetchWith({ data: [], pageInfo: { hasNextPage: false, hasPreviousPage: false } });
+
+ await runListAndCaptureOutput(["--experiment-id", "exp-42", "--group-by", "experiment"]);
+
+ expect(lastRequest?.url).toContain("experimentId=exp-42");
+ expect(lastRequest?.url).toContain("groupBy=experiment");
+ });
});
describe("run submit", () => {
@@ -191,7 +200,7 @@ describe("run submit", () => {
return { url: lastRequest.url, body: JSON.parse(lastRequest.body) as Record };
}
- it("includes agentsMd in the submit body", async () => {
+ it("includes agentsMd and experimentId in the submit body", async () => {
mockFetchWith({ id: "req-submit-1", workerType: "coder-acp-copilot", status: "queued" });
const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
@@ -203,6 +212,7 @@ describe("run submit", () => {
"-m", "do the thing",
"--worker", "dynamic-worker",
"--agents-md", "# Be helpful",
+ "--experiment-id", "exp-99",
"--no-stream",
"-u", "http://localhost:3100",
"--project", "proj-test",
@@ -217,6 +227,7 @@ describe("run submit", () => {
expect(url).toContain("/api/v1/requests?worker=dynamic-worker");
expect(url).toContain("projectId=proj-test");
expect(body.agentsMd).toBe("# Be helpful");
+ expect(body.experimentId).toBe("exp-99");
});
it("omits agentsMd when not provided", async () => {
@@ -235,6 +246,7 @@ describe("run submit", () => {
const { body } = captureSubmit();
expect(body).not.toHaveProperty("agentsMd");
+ expect(body).not.toHaveProperty("experimentId");
});
});
diff --git a/apps/cli/src/commands/run.ts b/apps/cli/src/commands/run.ts
index 4c2727699..4a488a37a 100644
--- a/apps/cli/src/commands/run.ts
+++ b/apps/cli/src/commands/run.ts
@@ -90,13 +90,14 @@ run
.addOption(new Option("--base-profile ", "Deprecated alias for --profile.").hideHelp())
.option("--profile-variations-file ", "Path to JSON file containing profile variation entries")
.option("--agents-md ", "AGENTS.md content delivered to the workspace (prefix with @ to read from a file)")
+ .option("--experiment-id ", "Group this request with others under a shared experiment ID")
.option("--gates ", "GateConfig[] JSON or path/@path to a JSON file for gated runs")
.option("-u, --url ", "API base URL", getDefaultApiUrl())
.option("--project ", "Project ID for scoped operations (overrides SCOPE_PROJECT and the saved selection)")
.option("--count ", "Submit this run N times (1-10). With --profile-variations-file, N runs per profile — repetition is how you separate a real difference between profiles from model variance", (v: string) => Number.parseInt(v, 10))
.option("--no-stream", "Don't stream logs, just submit")
.action(async (options, command) => {
- const { scenario, persona, traits, worker, url, stream, count, maxIterations, model, reasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, codebase: codebaseRef, resources: resourceSpecs, resourceParam: resourceParamOverrides, extensions: extensionIds, agentVersion, profile, baseProfile, profileVariationsFile, gates: gatesOption, agentsMd: agentsMdInput } = options;
+ const { scenario, persona, traits, worker, url, stream, count, maxIterations, model, reasoningEffort, mcpServers: mcpServerSlugs, skills: skillSlugs, codebase: codebaseRef, resources: resourceSpecs, resourceParam: resourceParamOverrides, extensions: extensionIds, agentVersion, profile, baseProfile, profileVariationsFile, gates: gatesOption, agentsMd: agentsMdInput, experimentId } = options;
// `--profile` is the documented flag; `--base-profile` is kept as a hidden
// back-compat alias. Both resolve to the same request `profileId`.
const profileId = profile ?? baseProfile;
@@ -181,6 +182,9 @@ run
if (profileId) {
body.profileId = profileId;
}
+ if (experimentId) {
+ body.experimentId = experimentId;
+ }
if (agentsMdInput) {
// `@path` reads the AGENTS.md body from a file; otherwise the value is
// treated as the literal content.
@@ -505,6 +509,11 @@ run
.option("--created-after ", "Only runs created at/after this ISO-8601 datetime")
.option("--created-before ", "Only runs created at/before this ISO-8601 datetime")
.option("--submission-id ", "Filter by submission ID")
+ .option("--experiment-id ", "Filter by experiment ID")
+ .addOption(
+ new Option("--group-by ", "Group results by task, submissionId, profile, or experiment")
+ .choices(["task", "submissionId", "profile", "experiment"]),
+ )
.option("--turns ", "Filter by actual turns (e.g. '>=5', '<=10', '=3')")
.option("--max-iterations ", "Filter by configured maxIterations (e.g. '>=5', '<=10', '=3')")
.option("--sort-by ", "Sort field: created, updated, priority, worker, status, id, duration")
@@ -548,6 +557,12 @@ run
if (options.submissionId) {
params.set("submissionId", options.submissionId);
}
+ if (options.experimentId) {
+ params.set("experimentId", options.experimentId);
+ }
+ if (options.groupBy) {
+ params.set("groupBy", options.groupBy);
+ }
const parseIterExpr = (raw: string, name: string): { op: "eq" | "gte" | "lte"; value: number } => {
const m = /^(>=|<=|=)?\s*(\d+)$/.exec(String(raw).trim());
if (!m) {
@@ -598,11 +613,23 @@ run
if (!isMachineReadable(format)) console.log(warnBanner('No requests found.'));
return;
}
+ const grouped = Boolean(options.groupBy);
if (!isMachineReadable(format)) {
- console.log(label(`Found ${requests.length} request(s):\n`));
- }
-
- const displayFields: DisplayField[] = [
+ console.log(label(`Found ${requests.length} ${grouped ? "group" : "request"}(s):\n`));
+ }
+
+ const displayFields: DisplayField[] = grouped
+ ? [
+ { key: "key", label: "Key" },
+ { key: "label", label: "Label" },
+ {
+ key: "count",
+ label: "Runs",
+ formatter: (group: { aggregates?: { count?: number } }) =>
+ String(group.aggregates?.count ?? 0),
+ },
+ ]
+ : [
{ key: 'id', label: 'ID',
formatter: (req: any) => req.id ?? '(no id)',
tableFormatter: (req: any) => value(req.id ?? '(no id)'),
diff --git a/apps/portal/src/lib/api.ts b/apps/portal/src/lib/api.ts
index 96cd39566..9d41804f4 100644
--- a/apps/portal/src/lib/api.ts
+++ b/apps/portal/src/lib/api.ts
@@ -86,6 +86,7 @@ export interface RunFilterParams {
taskPromptId?: string;
criteria?: string;
submissionId?: string;
+ experimentId?: string | string[];
search?: string;
createdAfter?: string;
createdBefore?: string;
@@ -109,6 +110,7 @@ function runFilterQs(f: RunFilterParams): Record> => {
+ /** List runs grouped by task/profile/submissionId/experiment, with cursor pagination and server-side filtering */
+ listRunGroups: (opts: RunFilterParams & { groupBy: "task" | "submissionId" | "profile" | "experiment"; sortBy?: RunSortField; sortDir?: RunSortDir; limit?: number; after?: string; before?: string; last?: boolean }): Promise> => {
return request(`/requests${qs({
groupBy: opts.groupBy,
...runFilterQs(opts),
@@ -225,6 +227,7 @@ export const api = {
agentVersion?: string;
profileId?: string;
profileVariations?: string[];
+ experimentId?: string;
agentsMd?: string;
agentsMdParentIds?: string[];
gates?: GateConfig[];
diff --git a/apps/portal/src/pages/RunDetail.tsx b/apps/portal/src/pages/RunDetail.tsx
index 77ac6b0fa..612e326fd 100644
--- a/apps/portal/src/pages/RunDetail.tsx
+++ b/apps/portal/src/pages/RunDetail.tsx
@@ -1573,6 +1573,11 @@ export function RunDetail() {
>
{formatId(run.agentsMdPromptId)}
+ {run.experimentId && (
+
+ experiment: {run.experimentId}
+
+ )}
{run.agentsMdParentIds && run.agentsMdParentIds.length > 0 && (
{run.agentsMdParentIds.length === 1 ? "mutation" : "merge"} · {run.agentsMdParentIds.length} parent{run.agentsMdParentIds.length === 1 ? "" : "s"}
diff --git a/apps/portal/src/pages/RunsList.tsx b/apps/portal/src/pages/RunsList.tsx
index 27b685df5..1e8a0fc07 100644
--- a/apps/portal/src/pages/RunsList.tsx
+++ b/apps/portal/src/pages/RunsList.tsx
@@ -56,7 +56,7 @@ import { isAgentAvailable, isAgentVersionAvailable, STATUS_LIST, OUTCOME_LIST }
import type { Run, RunStatus, RunOutcome, IterationOp, BulkResubmitOverrides, RunSortField, RunFacetBucket } from "@/types";
import { buildRunWorkerFilterOptions } from "./run-worker-filter-options";
-const FILTER_KEYS = ["worker", "status", "outcome", "taskPromptId", "submissionId", "criteria", "model", "profile", "os", "priority", "version", "dateFrom", "dateTo", "groupBy", "turns", "turnsOp", "maxIter", "maxIterOp"] as const;
+const FILTER_KEYS = ["worker", "status", "outcome", "taskPromptId", "submissionId", "experimentId", "criteria", "model", "profile", "os", "priority", "version", "dateFrom", "dateTo", "groupBy", "turns", "turnsOp", "maxIter", "maxIterOp"] as const;
/**
* Describes how to fetch a given (1-based) page from the cursor-paginated
@@ -137,12 +137,14 @@ const GROUP_MEMBER_PAGE = 100;
* the `__empty__` sentinel so the API matches rows lacking the field).
*/
function groupKeyExtraFilter(
- groupBy: "task" | "submissionId" | "profile",
+ groupBy: "task" | "submissionId" | "profile" | "experiment",
key: string,
-): { taskPromptId?: string; submissionId?: string; profileId?: string[] } {
+): { taskPromptId?: string; submissionId?: string; profileId?: string[]; experimentId?: string[] } {
if (groupBy === "task") return { taskPromptId: key };
if (groupBy === "profile")
return { profileId: [key === "no-profile" ? EMPTY_FILTER_VALUE : key] };
+ if (groupBy === "experiment")
+ return { experimentId: [key === "no-experiment" ? EMPTY_FILTER_VALUE : key] };
return { submissionId: key === "no-submission" ? EMPTY_FILTER_VALUE : key };
}
@@ -314,6 +316,7 @@ const COLUMN_OPTIONS: CustomizeColumnsOption[] = [
{ id: "status", label: "Status" },
{ id: "outcome", label: "Outcome" },
{ id: "submission", label: "Submission" },
+ { id: "experiment", label: "Experiment" },
{ id: "task", label: "Task" },
{ id: "criteria", label: "Criteria" },
{ id: "worker", label: "Worker" },
@@ -339,18 +342,19 @@ const COLUMN_IDS = COLUMN_OPTIONS.map((o) => o.id);
// Segmented toggle used in the list header for the Group By control. Kept
// inline because it is only used here.
-const GROUP_BY_OPTIONS: ReadonlyArray<{ value: "profile" | "task" | "submissionId"; label: string }> = [
+const GROUP_BY_OPTIONS: ReadonlyArray<{ value: "profile" | "task" | "submissionId" | "experiment"; label: string }> = [
{ value: "profile", label: "Profile" },
{ value: "task", label: "Task" },
{ value: "submissionId", label: "Submission" },
+ { value: "experiment", label: "Experiment" },
];
function GroupByToggle({
value,
onChange,
}: {
- value: "none" | "profile" | "task" | "submissionId";
- onChange: (next: "none" | "profile" | "task" | "submissionId") => void;
+ value: "none" | "profile" | "task" | "submissionId" | "experiment";
+ onChange: (next: "none" | "profile" | "task" | "submissionId" | "experiment") => void;
}) {
return (
>({});
// Get groupBy from URL state
- const groupBy = (state.getFilter("groupBy") ?? "none") as "none" | "profile" | "task" | "submissionId";
+ const groupBy = (state.getFilter("groupBy") ?? "none") as "none" | "profile" | "task" | "submissionId" | "experiment";
// Cursor pagination — keep a stack of cursors that map a virtual page number
// to a fetch instruction. Each entry describes how to fetch that page:
@@ -535,6 +539,7 @@ export function RunsList() {
outcome: state.getFilterList("outcome"),
taskPromptId: state.getFilter("taskPromptId"),
submissionId: state.getFilter("submissionId"),
+ experimentId: state.getFilter("experimentId"),
criteria: state.getFilter("criteria"),
model: state.getFilterList("model"),
profile: state.getFilterList("profile"),
@@ -580,6 +585,7 @@ export function RunsList() {
const versions = state.getFilterList("version");
const taskPromptId = state.getFilter("taskPromptId") ?? undefined;
const submissionId = state.getFilter("submissionId") ?? undefined;
+ const experimentId = state.getFilter("experimentId") ?? undefined;
const criteria = state.getFilter("criteria") ?? undefined;
const dateFrom = state.getFilter("dateFrom");
const dateTo = state.getFilter("dateTo");
@@ -632,6 +638,7 @@ export function RunsList() {
profileId: asArray(profiles),
taskPromptId,
submissionId,
+ experimentId,
criteria,
search: searchValue,
createdAfter,
@@ -653,6 +660,7 @@ export function RunsList() {
profiles.join(","),
taskPromptId,
submissionId,
+ experimentId,
criteria,
searchValue,
createdAfter,
@@ -741,7 +749,7 @@ export function RunsList() {
enabled: groupBy !== "none",
queryFn: () =>
api.listRunGroups({
- groupBy: groupBy as "task" | "submissionId" | "profile",
+ groupBy: groupBy as "task" | "submissionId" | "profile" | "experiment",
...runFilterArgs,
sortBy,
sortDir,
@@ -776,7 +784,7 @@ export function RunsList() {
// Keep the already-loaded member rows visible while a "Load more" refetch runs.
placeholderData: keepPreviousData,
queryFn: async () => {
- const gb = groupBy as "task" | "submissionId" | "profile";
+ const gb = groupBy as "task" | "submissionId" | "profile" | "experiment";
const entries = await Promise.all(
expandedKeyList.map(async (key) => {
// Walk the list cursor up to the group's requested page count. The list
@@ -1355,6 +1363,18 @@ export function RunsList() {
—
),
},
+ {
+ id: "experiment",
+ header: "Experiment",
+ width: "140px",
+ hidden: columnVisibility.isHidden("experiment"),
+ cell: (r) =>
+ r.experimentId ? (
+ {r.experimentId}
+ ) : (
+ —
+ ),
+ },
{
id: "task",
header: "Task",
@@ -2243,6 +2263,8 @@ export function RunsList() {
return run.taskPromptId ?? "";
case "submissionId":
return run.submissionId ?? "no-submission";
+ case "experiment":
+ return run.experimentId ?? "no-experiment";
default:
return "";
}
@@ -2507,6 +2529,8 @@ export function RunsList() {
switch (column.id) {
case "submission":
return distinct("submissions", (r) => r.submissionId);
+ case "experiment":
+ return distinct("experiments", (r) => r.experimentId);
case "task":
return distinct("tasks", (r) => r.scenario?.task);
case "worker":
@@ -2660,7 +2684,14 @@ export function RunsList() {
return runs[0] ? column.cell(runs[0]) : null;
},
renderGroupHeader: (groupKey, runs, expanded) => {
- const groupLabel = groupBy === "submissionId" ? "Submission ID" : groupBy === "profile" ? "Profile" : "Task";
+ const groupLabel =
+ groupBy === "submissionId"
+ ? "Submission ID"
+ : groupBy === "profile"
+ ? "Profile"
+ : groupBy === "experiment"
+ ? "Experiment"
+ : "Task";
const groupDisplayKey =
groupBy === "profile" && groupKey !== "no-profile"
? (profileNameById.get(groupKey) ?? formatId(groupKey))
diff --git a/apps/portal/src/pages/SubmitRun.tsx b/apps/portal/src/pages/SubmitRun.tsx
index 54beb26ed..e6d8be574 100644
--- a/apps/portal/src/pages/SubmitRun.tsx
+++ b/apps/portal/src/pages/SubmitRun.tsx
@@ -213,6 +213,7 @@ export function SubmitRun() {
}));
const [occurrences, setOccurrences] = useState(5);
const [priority, setPriority] = useState(0);
+ const [experimentId, setExperimentId] = useState("");
const [agentsMd, setAgentsMd] = useState("");
// Optional add-ons
@@ -575,6 +576,7 @@ export function SubmitRun() {
.then((content) => setAgentsMd(content.text))
.catch(() => undefined);
}
+ setExperimentId(run.experimentId ?? "");
if (run.extensions && run.extensions.length > 0) {
setSelectedExtensions(run.extensions);
setExtensionsOpen(true);
@@ -694,6 +696,7 @@ export function SubmitRun() {
...(gatesEnabled ? { gates: gateConfigs } : {}),
...(priority !== 0 ? { priority } : {}),
...(occurrences > 1 ? { count: occurrences } : {}),
+ ...(experimentId.trim() ? { experimentId: experimentId.trim() } : {}),
...(agentsMd.trim() ? { agentsMd: agentsMd } : {}),
...(inVariationMode ? {} : { ...(selectedMcpServers.length > 0 ? { mcpServers: selectedMcpServers } : {}) }),
...(inVariationMode ? {} : { ...(selectedSkills.length > 0 ? { skills: selectedSkills } : {}) }),
@@ -815,6 +818,7 @@ export function SubmitRun() {
selectedSkills.length > 0 ? `${selectedSkills.length} skill${selectedSkills.length === 1 ? "" : "s"}` : "",
selectedCodebaseSpec ? `codebase ${selectedCodebaseSpec}` : "",
selectedResourceSpecs.length > 0 ? `${selectedResourceSpecs.length} resource${selectedResourceSpecs.length === 1 ? "" : "s"}` : "",
+ experimentId.trim() ? `experiment ${experimentId.trim()}` : "",
agentsMd.trim() ? "AGENTS.md" : "",
selectedExtensions.length > 0 ? `${selectedExtensions.length} ext` : "",
].filter(Boolean);
@@ -1146,6 +1150,19 @@ export function SubmitRun() {
onChange={(e) => setOccurrences(Math.max(1, Math.min(10, parseInt(e.target.value) || 1)))}
/>
+
+
+ Experiment ID
+
+
+
setExperimentId(e.target.value)}
+ placeholder="experiment-2026-10-14"
+ className="font-mono"
+ />
+
{/* ─── AGENTS.md (optional, discreet) ──────────────────────────── */}
diff --git a/apps/portal/src/types.ts b/apps/portal/src/types.ts
index 5a84b7463..55ce84608 100644
--- a/apps/portal/src/types.ts
+++ b/apps/portal/src/types.ts
@@ -142,6 +142,7 @@ export interface Run {
extensions?: string[];
priority?: number;
submissionId?: string;
+ experimentId?: string;
profileId?: string;
profileVersionId?: string;
/** Resolved AGENTS.md prompt id when an AGENTS.md was supplied. */
@@ -1133,7 +1134,7 @@ export interface ProfileWithVersion extends ProfileDocument {
// --- Runs grouping types (mirrored from shared) ---
-export type GroupByKey = "none" | "task" | "submissionId" | "profile";
+export type GroupByKey = "none" | "task" | "submissionId" | "profile" | "experiment";
export interface AggregateStats {
min: number;
diff --git a/docs/architecture/app-design.md b/docs/architecture/app-design.md
index f1a243262..caca8c1fb 100644
--- a/docs/architecture/app-design.md
+++ b/docs/architecture/app-design.md
@@ -321,6 +321,22 @@ pre-asserts no composite duplicates, reuses 025's Cosmos-safe helpers (composite
non-unique on Cosmos, unique on real MongoDB), and its `down()` unsets `slug`/`ref` (index changes
log-only). The dead `prompt-feature-extractions` drop is guarded against a missing namespace.
+### Experiment correlation and grouping
+
+Requests may carry an optional `experimentId` to correlate related runs without
+changing their submission or profile identity. The Runs API supports exact
+filtering with `?experimentId=` (including the standard `__empty__` sentinel for
+missing values) and server-side grouping with `groupBy=experiment`. Grouped
+pagination uses the same two-phase aggregation as the other group dimensions,
+including a stable `no-experiment` bucket whose member fetch matches both absent
+and explicit `null` values.
+
+Bulk resubmission preserves `experimentId`. The CLI and Portal expose the field
+at submission time and support filtering/grouping existing runs by it. Migration
+031 adds a sparse single-field index on `requests.experimentId`; Cosmos DB can
+intersect it with the existing project and deletion filters, while runs without
+an experiment avoid the additional index entry.
+
## Judge Pipeline
The judge evaluates coding agent output against criteria. Two strategies are supported:
diff --git a/packages/db-migrations/src/031-add-experiment-id-index.test.ts b/packages/db-migrations/src/031-add-experiment-id-index.test.ts
new file mode 100644
index 000000000..3def63c2e
--- /dev/null
+++ b/packages/db-migrations/src/031-add-experiment-id-index.test.ts
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, expect, it, vi } from "vitest";
+import type { Db } from "mongodb";
+import { AddExperimentIdIndex } from "./migrations/031-add-experiment-id-index.js";
+
+function makeMockDb(createIndexImpl?: () => Promise) {
+ const createIndex = vi.fn(createIndexImpl ?? (async () => "experimentId_1"));
+ const requests = { createIndex };
+ const db = {
+ collection: vi.fn((name: string) => {
+ if (name === "requests") return requests;
+ throw new Error(`Unexpected collection ${name}`);
+ }),
+ } as unknown as Db;
+ return { db, createIndex };
+}
+
+describe("migration 031: AddExperimentIdIndex", () => {
+ it("creates a sparse single-field index on requests.experimentId", async () => {
+ const { db, createIndex } = makeMockDb();
+
+ await new AddExperimentIdIndex().up(db);
+
+ expect(createIndex).toHaveBeenCalledWith(
+ { experimentId: 1 },
+ { sparse: true },
+ );
+ });
+
+ it("treats an existing index as idempotent", async () => {
+ const { db } = makeMockDb(async () => {
+ throw new Error("index already exists");
+ });
+
+ await expect(new AddExperimentIdIndex().up(db)).resolves.toBeUndefined();
+ });
+
+ it("does not drop the index on down", async () => {
+ const { db, createIndex } = makeMockDb();
+
+ await expect(new AddExperimentIdIndex().down(db)).resolves.toBeUndefined();
+ expect(createIndex).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/db-migrations/src/check-migrations.test.ts b/packages/db-migrations/src/check-migrations.test.ts
index 56e238ece..41bbb6591 100644
--- a/packages/db-migrations/src/check-migrations.test.ts
+++ b/packages/db-migrations/src/check-migrations.test.ts
@@ -61,11 +61,12 @@ describe("checkMigrations", () => {
"028-isolate-mcp-secrets-per-project.ts",
"029-create-users-collection.ts",
"030-create-resource-indexes.ts",
+ "031-add-experiment-id-index.ts",
]);
const result = await checkMigrations(db);
expect(result.ready).toBe(true);
expect(result.pending).toEqual([]);
- expect(result.totalApplied).toBe(30);
+ expect(result.totalApplied).toBe(31);
expect(result.applied).toEqual([
"001-backfill-task-prompts.ts",
"002-create-indexes.ts",
@@ -97,6 +98,7 @@ describe("checkMigrations", () => {
"028-isolate-mcp-secrets-per-project.ts",
"029-create-users-collection.ts",
"030-create-resource-indexes.ts",
+ "031-add-experiment-id-index.ts",
]);
});
@@ -104,7 +106,7 @@ describe("checkMigrations", () => {
const db = makeMockDb(["001-backfill-task-prompts.ts"]);
const result = await checkMigrations(db);
expect(result.ready).toBe(false);
- expect(result.pending).toEqual(["002-create-indexes.ts", "003-create-skill-indexes.ts", "004-add-submission-id-index.ts", "005-backfill-iteration-durations.ts", "006-split-status-outcome.ts", "007-rename-exhausted-to-finished.ts", "008-backfill-ai-call-count.ts", "009-add-requests-filter-indexes.ts", "010-add-requests-pagination-index.ts", "011-add-profile-indexes.ts", "012-add-profile-name-index.ts", "013-remove-logs-from-docs.ts", "014-introduce-runs-and-run.ts", "015-add-priority-and-scheduler-index.ts", "016-fix-scheduler-sort-index.ts", "017-add-post-processor-dispatch-index.ts", "018-backfill-criteria-gates.ts", "019-backfill-task-prompt-type.ts", "020-create-codebase-indexes.ts", "021-add-runs-filter-indexes.ts", "022-add-runs-sort-indexes.ts", "023-add-runs-search-task-index.ts", "024-add-criteria-sort-index.ts", "025-create-projects.ts", "026-isolate-catalogs-per-project.ts", "027-uuid-keys-mcp-profileversions.ts", "028-isolate-mcp-secrets-per-project.ts", "029-create-users-collection.ts", "030-create-resource-indexes.ts"]);
+ expect(result.pending).toEqual(["002-create-indexes.ts", "003-create-skill-indexes.ts", "004-add-submission-id-index.ts", "005-backfill-iteration-durations.ts", "006-split-status-outcome.ts", "007-rename-exhausted-to-finished.ts", "008-backfill-ai-call-count.ts", "009-add-requests-filter-indexes.ts", "010-add-requests-pagination-index.ts", "011-add-profile-indexes.ts", "012-add-profile-name-index.ts", "013-remove-logs-from-docs.ts", "014-introduce-runs-and-run.ts", "015-add-priority-and-scheduler-index.ts", "016-fix-scheduler-sort-index.ts", "017-add-post-processor-dispatch-index.ts", "018-backfill-criteria-gates.ts", "019-backfill-task-prompt-type.ts", "020-create-codebase-indexes.ts", "021-add-runs-filter-indexes.ts", "022-add-runs-sort-indexes.ts", "023-add-runs-search-task-index.ts", "024-add-criteria-sort-index.ts", "025-create-projects.ts", "026-isolate-catalogs-per-project.ts", "027-uuid-keys-mcp-profileversions.ts", "028-isolate-mcp-secrets-per-project.ts", "029-create-users-collection.ts", "030-create-resource-indexes.ts", "031-add-experiment-id-index.ts"]);
expect(result.applied).toEqual(["001-backfill-task-prompts.ts"]);
expect(result.totalApplied).toBe(1);
});
@@ -144,6 +146,7 @@ describe("checkMigrations", () => {
"028-isolate-mcp-secrets-per-project.ts",
"029-create-users-collection.ts",
"030-create-resource-indexes.ts",
+ "031-add-experiment-id-index.ts",
]);
expect(result.applied).toEqual([]);
expect(result.totalApplied).toBe(0);
@@ -181,12 +184,13 @@ describe("checkMigrations", () => {
"028-isolate-mcp-secrets-per-project.ts",
"029-create-users-collection.ts",
"030-create-resource-indexes.ts",
+ "031-add-experiment-id-index.ts",
"999-future-migration.ts",
]);
const result = await checkMigrations(db);
expect(result.ready).toBe(true);
expect(result.pending).toEqual([]);
- expect(result.totalApplied).toBe(31);
+ expect(result.totalApplied).toBe(32);
});
it("caches results within TTL", async () => {
diff --git a/packages/db-migrations/src/migrations/031-add-experiment-id-index.ts b/packages/db-migrations/src/migrations/031-add-experiment-id-index.ts
new file mode 100644
index 000000000..b49123f66
--- /dev/null
+++ b/packages/db-migrations/src/migrations/031-add-experiment-id-index.ts
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+/**
+ * Create a sparse single-field index for experiment correlation.
+ *
+ * Cosmos DB can intersect this equality index with the existing project and
+ * deletion filters used by the Runs API. Keeping it sparse avoids write RU
+ * overhead for ordinary runs that do not belong to an experiment.
+ */
+
+import type { Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+
+export class AddExperimentIdIndex implements MigrationInterface {
+ async up(db: Db): Promise {
+ const collection = db.collection("requests");
+ try {
+ await collection.createIndex({ experimentId: 1 }, { sparse: true });
+ console.log("[031] Created sparse index on requests.experimentId");
+ } catch (error: unknown) {
+ const message = error instanceof Error ? error.message : String(error);
+ console.log(
+ `[031] Index on requests.experimentId already exists or could not be created: ${message}`,
+ );
+ }
+ }
+
+ async down(_db: Db): Promise {
+ console.log(
+ "[031-down] Skipping index drop — indexes should be dropped manually if needed",
+ );
+ }
+}
diff --git a/packages/db-migrations/src/required-migrations.ts b/packages/db-migrations/src/required-migrations.ts
index 3fd0899ed..443f2fb82 100644
--- a/packages/db-migrations/src/required-migrations.ts
+++ b/packages/db-migrations/src/required-migrations.ts
@@ -43,4 +43,5 @@ export const REQUIRED_MIGRATIONS: readonly string[] = [
"028-isolate-mcp-secrets-per-project.ts",
"029-create-users-collection.ts",
"030-create-resource-indexes.ts",
+ "031-add-experiment-id-index.ts",
];
diff --git a/packages/shared/src/schemas/request.ts b/packages/shared/src/schemas/request.ts
index d40d541e0..6266ec596 100644
--- a/packages/shared/src/schemas/request.ts
+++ b/packages/shared/src/schemas/request.ts
@@ -142,6 +142,8 @@ export const CreateRequestInputSchema = z
profileId: z.string().optional(),
profileVariations: z.array(z.string()).optional(),
priority: z.number().int().optional(),
+ // Correlates related runs belonging to one experiment.
+ experimentId: z.string().min(1).optional(),
// Raw AGENTS.md body to deliver to the worker workspace. When present, the
// API findOrCreates an `agents.md`-typed prompt and stores its id on the
// request (see `agentsMdPromptId`).
@@ -179,6 +181,7 @@ export const RequestResponseSchema = z
profileId: z.string().optional(),
profileVersionId: z.string().optional(),
submissionId: z.string().optional(),
+ experimentId: z.string().optional(),
priority: z.number().int().default(0),
gates: z.array(GateConfigSchema).optional(),
gateSummaries: z.array(GateRunSummarySchema).optional(),
@@ -277,6 +280,7 @@ export const ListRequestsQuerySchema = z
taskPromptId: z.string().optional(),
criteria: z.string().optional(),
submissionId: z.string().optional(),
+ experimentId: MultiValueParam,
profileId: MultiValueParam,
status: MultiValueParam,
outcome: MultiValueParam,
@@ -286,7 +290,7 @@ export const ListRequestsQuerySchema = z
agentVersion: MultiValueParam,
// Free-text, case-insensitive search across run id, scenario task, model, worker.
search: z.string().optional(),
- groupBy: z.enum(["task", "submissionId", "profile"]).optional(),
+ groupBy: z.enum(["task", "submissionId", "profile", "experiment"]).optional(),
limit: z.coerce.number().int().min(1).max(100).optional(),
after: z.string().optional(),
before: z.string().optional(),
diff --git a/packages/shared/src/types/types.ts b/packages/shared/src/types/types.ts
index d30d5cb29..bf260d42a 100644
--- a/packages/shared/src/types/types.ts
+++ b/packages/shared/src/types/types.ts
@@ -324,6 +324,7 @@ export interface RequestDocument {
profileId?: string; // FK → ProfileDocument._id (the profile lineage)
profileVersionId?: string; // FK → ProfileVersionDocument._id (exact version used)
submissionId?: string; // FK → SubmissionDocument._id
+ experimentId?: string; // Correlates related runs from one experiment
/** Scheduling priority. Higher = processed first. Default: 0. */
priority: number;
/**
@@ -603,7 +604,7 @@ export interface QueueProcessorConfig extends BaseQueueProcessorConfig {
// --- Runs grouping types (shared between API and portal) ---
-export type GroupByKey = "none" | "task" | "submissionId" | "profile";
+export type GroupByKey = "none" | "task" | "submissionId" | "profile" | "experiment";
export interface AggregateStats {
min: number;
diff --git a/website/src/openapi/scope-openapi.json b/website/src/openapi/scope-openapi.json
index a885790ae..97d9fe774 100644
--- a/website/src/openapi/scope-openapi.json
+++ b/website/src/openapi/scope-openapi.json
@@ -1 +1 @@
-{"openapi":"3.1.0","info":{"title":"Scope API","version":"1.0.0","description":"REST API for the Scope platform — benchmarking AI coding agents"},"servers":[{"url":"/","description":"Current server"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Use the unchanged IdP access token, without the Bearer prefix."}},"schemas":{"KeyResponse":{"type":"object","properties":{},"additionalProperties":{}},"KeyInput":{"type":"object","properties":{},"additionalProperties":{}},"ValidateKeyInput":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]},"AccountResponse":{"type":"object","properties":{},"additionalProperties":{}},"AccountInput":{"type":"object","properties":{},"additionalProperties":{}},"UserMeResponse":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"email":{"type":"string"},"displayName":{"type":"string"},"idp":{"type":"string"},"idpTenant":{"type":"string"}},"required":["id"]},"ProjectResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["_id","name","createdAt"]},"CreateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"creator":{"type":"string"}},"required":["name"]},"UpdateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"}}},"RequestResponse":{"type":"object","properties":{"_id":{"type":"string"},"scenario":{"$ref":"#/components/schemas/Scenario"},"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"maxIterations":{"type":"number"},"personaInstructions":{"type":"string"},"persona":{"$ref":"#/components/schemas/Persona"},"deletedAt":{"type":["string","null"],"format":"date-time"},"taskPromptId":{"type":"string"},"agentsMdPromptId":{"type":"string"},"agentsMdParentIds":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"codebaseRevisionId":{"type":"string"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBinding"}},"extensions":{"type":"array","items":{"type":"string"}},"agentVersion":{"type":"string"},"profileId":{"type":"string"},"profileVersionId":{"type":"string"},"submissionId":{"type":"string"},"priority":{"type":"integer","default":0},"gates":{"type":"array","items":{"$ref":"#/components/schemas/GateConfig"}},"gateSummaries":{"type":"array","items":{"$ref":"#/components/schemas/GateRunSummary"}},"run":{"$ref":"#/components/schemas/RunState"},"projectId":{"type":"string"}},"required":["_id","scenario","workerType","createdAt","projectId"]},"Scenario":{"type":"object","properties":{"version":{"type":"string","enum":["v1","v2"]},"task":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}}},"required":["task","criteria"]},"Persona":{"type":"object","properties":{"personality":{"type":"string","enum":["demanding","friendly"]},"experience":{"type":"string","enum":["junior","senior"]},"verbosity":{"type":"string","enum":["brief","moderate"]},"type":{"type":"string","enum":["traditional","ai_assisted","vibe"]}},"required":["personality","experience","verbosity","type"]},"ResourceBinding":{"type":"object","properties":{"ref":{"type":"string"},"revisionId":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}}},"required":["ref","revisionId","params"]},"GateConfig":{"type":"object","properties":{"gate":{"type":"string","enum":["select","build","test","run","deploy"]},"promptId":{"type":"string"},"promptText":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"maxIterations":{"type":"integer","minimum":1,"maximum":50}},"required":["gate","criteria"]},"GateRunSummary":{"type":"object","properties":{"gate":{"type":"string","enum":["select","build","test","run","deploy"]},"status":{"type":"string","enum":["passed","failed","skipped"]},"iterations":{"type":"integer","minimum":0}},"required":["gate","status","iterations"]},"RunState":{"type":"object","properties":{"_id":{"type":"string"},"attemptNumber":{"type":"integer","minimum":1},"status":{"type":"string","enum":["pending","queued","processing","paused","done"]},"queuedQueueName":{"type":"string"},"outcome":{"type":"string","enum":["succeeded","failed","finished"]},"result":{"type":"string"},"error":{"type":"string"},"logsUrl":{"type":"string"},"updatedAt":{"type":["string","null"],"format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"durationMs":{"type":"number"},"turns":{"type":"array","items":{"$ref":"#/components/schemas/ConversationTurn"}},"workerVersion":{"type":"string"},"os":{"type":"object","properties":{"platform":{"type":"string"},"release":{"type":"string"},"arch":{"type":"string"}},"required":["platform","release","arch"]},"lastHeartbeatAt":{"type":["string","null"],"format":"date-time"},"worker":{"type":"object","properties":{"instanceId":{"type":"string"},"podName":{"type":"string"}},"required":["instanceId"]},"harUrl":{"type":"string"},"videoUrls":{"type":"array","items":{"type":"string"}},"setupVideoUrls":{"type":"array","items":{"type":"string"}},"tokenUsage":{"$ref":"#/components/schemas/TokenUsage"},"aiCallCount":{"type":"number"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceRunOutcome"}},"mcpRegistered":{"type":"boolean"},"rawChatUrl":{"type":"string"},"rawChatFormat":{"type":"string"},"pausedAt":{"type":["string","null"],"format":"date-time"},"resumedAt":{"type":["string","null"],"format":"date-time"}},"required":["_id","attemptNumber","status"]},"ConversationTurn":{"type":"object","properties":{"iteration":{"type":"number"},"gate":{"type":"string","enum":["select","build","test","run","deploy"]},"codingAgentResponse":{"type":"string"},"judgeFeedback":{"type":"string"},"snapshotUrl":{"type":"string"},"passed":{"type":"boolean"},"timestamp":{"type":["string","null"],"format":"date-time"},"criteriaResults":{"type":"array","items":{"$ref":"#/components/schemas/CriterionResult"}},"harUrl":{"type":"string"},"videoUrls":{"type":"array","items":{"type":"string"}},"tokenUsage":{"$ref":"#/components/schemas/TokenUsage"},"startedAt":{"type":["string","null"],"format":"date-time"},"durationMs":{"type":"number"},"toolCalls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"object","additionalProperties":{}},"response":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","arguments"]}},"toolCallsUrl":{"type":"string"},"toolCallCount":{"type":"number"},"aiCallCount":{"type":"number"},"rawChatUrl":{"type":"string"},"rawChatFormat":{"type":"string"},"chatResultUrl":{"type":"string"},"chatResultFormat":{"type":"string"}},"required":["iteration","judgeFeedback","snapshotUrl","passed","timestamp"]},"CriterionResult":{"type":"object","properties":{"criterionId":{"type":"string"},"passed":{"type":"boolean"},"feedback":{"type":"string"},"evaluated":{"type":"boolean"}},"required":["criterionId","passed","feedback","evaluated"]},"TokenUsage":{"type":"object","properties":{"promptTokens":{"type":"number"},"completionTokens":{"type":"number"},"totalTokens":{"type":"number"}},"required":["promptTokens","completionTokens","totalTokens"]},"ResourceRunOutcome":{"type":"object","properties":{"ref":{"type":"string"},"slug":{"type":"string"},"revisionId":{"type":"string"},"setupSucceeded":{"type":"boolean"},"published":{"type":"array","items":{"type":"string"}},"params":{"type":"object","additionalProperties":{"type":"string"}},"setupDurationMs":{"type":"number"},"error":{"type":"string"},"teardownRan":{"type":"boolean"}},"required":["ref","slug","revisionId","setupSucceeded","published"]},"ResourceBindingSpec":{"anyOf":[{"type":"string"},{"type":"object","properties":{"ref":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}}},"required":["ref"]}]},"CreateRequestInput":{"type":"object","properties":{"scenario":{"$ref":"#/components/schemas/Scenario"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"maxIterations":{"type":"integer","minimum":1,"maximum":50},"personaInstructions":{"type":"string"},"persona":{"$ref":"#/components/schemas/Persona"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"codebaseRevisionId":{"type":"string"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}},"profileId":{"type":"string"},"profileVariations":{"type":"array","items":{"type":"string"}},"priority":{"type":"integer"},"agentsMd":{"type":"string"},"agentsMdParentIds":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"$ref":"#/components/schemas/GateConfig"}}},"required":["scenario"]},"RunFacetsResponse":{"type":"object","properties":{"total":{"type":"number"},"facets":{"type":"object","properties":{"workerType":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"status":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"outcome":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"model":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"os":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"priority":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"agentVersion":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"profileId":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}}},"required":["workerType","status","outcome","model","os","priority","agentVersion","profileId"]}},"required":["total","facets"]},"RunFacetBucket":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"PaginatedRunsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RequestResponse"}},"limit":{"type":"number"},"estimatedTotal":{"type":"number"},"cursors":{"$ref":"#/components/schemas/Cursors"}},"required":["data","limit","estimatedTotal","cursors"]},"Cursors":{"type":"object","properties":{"next":{"type":["string","null"]},"prev":{"type":["string","null"]}},"required":["next","prev"]},"PaginatedRunGroupsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RunGroup"}},"limit":{"type":"number"},"estimatedTotal":{"type":"number"},"cursors":{"$ref":"#/components/schemas/Cursors"}},"required":["data","limit","estimatedTotal","cursors"]},"RunGroup":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}},"aggregates":{"$ref":"#/components/schemas/GroupAggregates"},"uniform":{"$ref":"#/components/schemas/GroupUniformValues"}},"required":["key","label","runIds","aggregates","uniform"]},"GroupAggregates":{"type":"object","properties":{"count":{"type":"number"},"turns":{"$ref":"#/components/schemas/AggregateStats"},"duration":{"$ref":"#/components/schemas/AggregateStats"},"promptTokens":{"$ref":"#/components/schemas/AggregateStats"},"completionTokens":{"$ref":"#/components/schemas/AggregateStats"},"statusCounts":{"type":"object","additionalProperties":{"type":"number"}},"outcomeCounts":{"type":"object","additionalProperties":{"type":"number"}}},"required":["count","turns","duration","promptTokens","completionTokens","statusCounts","outcomeCounts"]},"AggregateStats":{"type":["object","null"],"properties":{"min":{"type":"number"},"max":{"type":"number"},"mean":{"type":"number"},"stdDev":{"type":"number"}},"required":["min","max","mean","stdDev"]},"GroupUniformValues":{"type":"object","properties":{"workerType":{"type":"string"},"agentVersion":{"type":"string"},"model":{"type":"string"},"platform":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"codebaseRevisionId":{"type":"string"},"extensions":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["pending","queued","processing","paused","done"]},"submissionId":{"type":"string"},"task":{"type":"string"}}},"BulkResubmitInput":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1},"count":{"type":"integer","minimum":1,"maximum":10,"default":1},"overrides":{"type":"object","properties":{"profileId":{"type":["string","null"]},"workerType":{"type":"string"},"agentVersion":{"type":"string"},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"maxIterations":{"type":["number","null"]},"mcpServers":{"type":["array","null"],"items":{"type":"string"}},"skillRevisions":{"type":["array","null"],"items":{"type":"string"}},"extensions":{"type":["array","null"],"items":{"type":"string"}}}}},"required":["ids"]},"ReportResponse":{"type":"object","properties":{"_id":{"type":"string"},"requestId":{"type":"string"},"templateId":{"type":"string"},"reporter":{"$ref":"#/components/schemas/Reporter"},"content":{"type":"string"},"status":{"type":"string","enum":["pending","generating","completed","failed"]},"error":{"type":"string"},"insightReferences":{"type":"array","items":{"$ref":"#/components/schemas/InsightReference"}},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","requestId","status","createdAt","projectId"]},"Reporter":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"gitHash":{"type":"string"},"model":{"type":"string"},"agentId":{"type":"string"},"agentVersion":{"type":"string"}},"required":["id","name","gitHash","model","agentId","agentVersion"]},"InsightReference":{"type":"object","properties":{"insightId":{"type":"string"},"referencedAt":{"type":["string","null"],"format":"date-time"},"isNew":{"type":"boolean"}},"required":["insightId","referencedAt","isNew"]},"CreateCriteriaInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}}},"required":["id","prompt"]},"CriteriaResponse":{"type":"object","properties":{"id":{"type":"string"},"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["id","prompt","createdAt","projectId"]},"CriteriaGraph":{"type":"object","properties":{"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CriteriaGraphNode"}},"edges":{"type":"array","items":{"$ref":"#/components/schemas/CriteriaGraphEdge"}}},"required":["nodes","edges"]},"CriteriaGraphNode":{"type":"object","properties":{"id":{"type":"string"},"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}}},"required":["id","prompt"]},"CriteriaGraphEdge":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"UpdateCriteriaInput":{"type":"object","properties":{"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}}}},"CreatePromptFeatureInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"prompt":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"}},"required":["id","prompt"]},"PromptType":{"type":"string","enum":["select","build","test","run","deploy","agents.md"]},"PromptFeatureResult":{"type":"object","properties":{"featureId":{"type":"string"},"detected":{"type":"boolean"},"evaluated":{"type":"boolean"}},"required":["featureId","detected","evaluated"]},"SuggestedPromptFeature":{"type":"object","properties":{"suggestedId":{"type":"string"},"behavior":{"type":"string"},"prompt":{"type":"string"}},"required":["suggestedId","behavior","prompt"]},"PromptFeatureResponse":{"type":"object","properties":{"id":{"type":"string"},"prompt":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["id","prompt","createdAt","projectId"]},"UpdatePromptFeatureInput":{"type":"object","properties":{"prompt":{"type":"string"}}},"TaskPromptResponse":{"type":"object","properties":{"_id":{"type":"string"},"keyId":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"},"text":{"type":"string"},"contentBlobUrl":{"type":"string"},"features":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResult"}},"featuresExtractedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","keyId","createdAt","projectId"]},"CreateTaskPromptInput":{"type":"object","properties":{"text":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"}},"required":["text"]},"PatchTaskPromptFeatureInput":{"type":"object","properties":{"detected":{"type":"boolean"}},"required":["detected"]},"CreateReportInput":{"type":"object","properties":{"requestId":{"type":"string"},"templateId":{"type":"string"}},"required":["requestId"]},"BulkCreateReportsInput":{"type":"object","properties":{"requestIds":{"type":"array","items":{"type":"string"}},"templateId":{"type":"string"}},"required":["requestIds"]},"BulkReportStatusInput":{"type":"object","properties":{"reportIds":{"type":"array","items":{"type":"string"}}},"required":["reportIds"]},"BulkReportSummaryResponse":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReportSummary"}},"ReportSummary":{"type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"generating":{"type":"number"},"completed":{"type":"number"},"failed":{"type":"number"}},"required":["total","pending","generating","completed","failed"]},"BulkReportSummaryInput":{"type":"object","properties":{"requestIds":{"type":"array","items":{"type":"string"}}},"required":["requestIds"]},"TriggerReportsInput":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]},"BulkTriggerReportsInput":{"type":"object","properties":{"requestIds":{"type":"array","items":{"type":"string"}}},"required":["requestIds"]},"InsightResponse":{"type":"object","properties":{"_id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"upvotes":{"type":"number"},"downvotes":{"type":"number"},"blocked":{"type":"boolean"},"referenceCount":{"type":"number"},"createdBy":{"type":"string","enum":["agent","user"]},"sourceReportId":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","title","description","upvotes","downvotes","blocked","referenceCount","createdBy","createdAt","projectId"]},"ProfileWithVersionResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"latestVersion":{"type":"number"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"version":{"$ref":"#/components/schemas/ProfileVersionResponse"},"projectId":{"type":"string"}},"required":["_id","name","latestVersion","createdAt","version","projectId"]},"ProfileVersionResponse":{"type":"object","properties":{"_id":{"type":"string"},"profileId":{"type":"string"},"version":{"type":"number"},"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"agentVersion":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","profileId","version","workerType","model","createdAt","projectId"]},"CreateProfileInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string","maxLength":512},"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"agentVersion":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}}},"required":["name","workerType","model"]},"ProfileResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"latestVersion":{"type":"number"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","name","latestVersion","createdAt","projectId"]},"UpdateProfileIdentity":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string","maxLength":512}}},"ReportTemplateResponse":{"type":"object","properties":{"_id":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"userPrompt":{"type":"string"},"systemPrompt":{"$ref":"#/components/schemas/ReportTemplateSystemPrompt"},"trigger":{"$ref":"#/components/schemas/ReportTrigger"},"model":{"type":"string"},"timeoutMs":{"type":"integer","exclusiveMinimum":0},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","id","name","userPrompt","createdAt","projectId"]},"ReportTemplateSystemPrompt":{"type":"object","properties":{"mode":{"type":"string","enum":["append","override"]},"content":{"type":"string"}},"required":["mode","content"]},"ReportTrigger":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["always"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["criteria"]},"criteriaIds":{"type":"array","items":{"type":"string"}},"match":{"type":"string","enum":["any","all"]}},"required":["type","criteriaIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["taskPrompt"]},"taskPromptIds":{"type":"array","items":{"type":"string"}}},"required":["type","taskPromptIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["promptFeature"]},"featureIds":{"type":"array","items":{"type":"string"}},"match":{"type":"string","enum":["any","all"]}},"required":["type","featureIds"]}]},"CreateReportTemplateInput":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"userPrompt":{"type":"string"},"systemPrompt":{"$ref":"#/components/schemas/ReportTemplateSystemPrompt"},"trigger":{"$ref":"#/components/schemas/ReportTrigger"},"model":{"type":"string"},"timeoutMs":{"type":"integer","exclusiveMinimum":0}},"required":["id","name","userPrompt"]},"UpdateReportTemplateInput":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"userPrompt":{"type":"string"},"systemPrompt":{"allOf":[{"$ref":"#/components/schemas/ReportTemplateSystemPrompt"},{"type":["object","null"]}]},"trigger":{"$ref":"#/components/schemas/ReportTrigger"},"model":{"type":["string","null"]},"timeoutMs":{"type":["integer","null"],"exclusiveMinimum":0}}},"AgentResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"modelProvider":{"type":"string"},"supportedModels":{"type":"array","items":{"type":"string"}},"defaultModel":{"type":"string"},"available":{"type":"boolean"},"capabilities":{"$ref":"#/components/schemas/AgentCapabilities"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersion"}},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["_id","name","supportedModels","createdAt"]},"AgentCapabilities":{"type":"object","properties":{"supportsReasoningEffort":{"type":"boolean"},"supportsMcpServers":{"type":"boolean"},"supportsSkills":{"type":"boolean"},"supportsExtensions":{"type":"boolean"},"supportsResources":{"type":"boolean"}}},"AgentVersion":{"type":"object","properties":{"agentVersion":{"type":"string","minLength":1},"workerVersion":{"type":"string","minLength":1},"components":{"type":"object","additionalProperties":{"type":"string"}},"gitCommit":{"type":"string","minLength":1},"buildTime":{"type":"string","minLength":1},"imageTag":{"type":"string","minLength":1},"queueName":{"type":"string"},"status":{"type":"string","enum":["active","retired"]},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["agentVersion","workerVersion","components","gitCommit","buildTime","imageTag","status","createdAt"]},"CreateAgentInput":{"type":"object","properties":{"_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":"string"},"modelProvider":{"type":"string"},"supportedModels":{"type":"array","items":{"type":"string"}},"defaultModel":{"type":"string"},"available":{"type":"boolean"},"capabilities":{"$ref":"#/components/schemas/AgentCapabilities"}},"required":["_id","name"]},"UpdateAgentInput":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"modelProvider":{"type":"string"},"supportedModels":{"type":"array","items":{"type":"string"}},"defaultModel":{"type":"string"},"available":{"type":"boolean"},"capabilities":{"$ref":"#/components/schemas/AgentCapabilities"}}},"RegisterAgentVersionInput":{"type":"object","properties":{"agentVersion":{"type":"string","minLength":1},"workerVersion":{"type":"string","minLength":1},"components":{"type":"object","additionalProperties":{"type":"string"}},"gitCommit":{"type":"string","minLength":1},"buildTime":{"type":"string","minLength":1},"imageTag":{"type":"string","minLength":1},"queueName":{"type":"string","minLength":1}},"required":["agentVersion","workerVersion","components","gitCommit","buildTime","imageTag","queueName"]},"PatchAgentVersionInput":{"type":"object","properties":{"status":{"type":"string","enum":["active","retired"]}},"required":["status"]},"ModelResponse":{"type":"object","properties":{"_id":{"type":"string"},"modelId":{"type":"string"},"provider":{"type":"string"},"agentId":{"type":"string"},"firstSeenAt":{"type":["string","null"],"format":"date-time"},"lastSeenAt":{"type":["string","null"],"format":"date-time"},"disappearedAt":{"type":["string","null"],"format":"date-time"},"providerAvailableFrom":{"type":["string","null"],"format":"date-time"},"providerEndOfLife":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":{}},"capabilities":{"$ref":"#/components/schemas/ModelCapabilities"}},"required":["_id","modelId","provider","agentId","firstSeenAt","lastSeenAt"]},"ModelCapabilities":{"type":"object","properties":{"reasoningEffort":{"type":"array","items":{"type":"string"}},"toolCalls":{"type":"boolean"},"vision":{"type":"boolean"},"streaming":{"type":"boolean"},"adaptiveThinking":{"type":"boolean"},"maxThinkingBudget":{"type":"number"}}},"McpServerResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["sse","http","stdio"]},"url":{"type":"string"},"command":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"env":{"type":"object","additionalProperties":{"type":"string"}},"headers":{"type":"array","items":{"$ref":"#/components/schemas/McpServerHeader"}},"sessionMode":{"type":"string","enum":["stateful","stateless"]},"version":{"type":"string"},"description":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","name","type","createdAt","projectId"]},"McpServerHeader":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"UpdateMcpServerInput":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["sse","http","stdio"]},"url":{"type":"string"},"command":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"env":{"type":"object","additionalProperties":{"type":"string"}},"headers":{"type":"array","items":{"$ref":"#/components/schemas/McpServerHeader"}},"sessionMode":{"type":"string","enum":["stateful","stateless"]},"version":{"type":"string"},"description":{"type":"string"}}},"SkillResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"source":{"type":"string"},"skillName":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["skills-sh","manual"]},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","source","skillName","name","origin","createdAt","projectId"]},"SkillSearchResult":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"description":{"type":"string"},"internal":{"type":"boolean"},"installs":{"type":"number"}},"required":["id","name","source","internal"]},"SkillDiscoveryResult":{"type":"object","properties":{"skillName":{"type":"string"},"skillPath":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"existsInLibrary":{"type":"boolean"},"currentRevisionCommitSha":{"type":"string"},"latestUpstreamCommitSha":{"type":"string"},"updateAvailable":{"type":"boolean"},"lastImportedAt":{"type":"string"}},"required":["skillName","skillPath"]},"SkillRevisionResponse":{"type":"object","properties":{"_id":{"type":"string"},"ref":{"type":"string"},"source":{"type":"string"},"skillName":{"type":"string"},"skillPath":{"type":"string"},"commitHash":{"type":"string"},"commitTimestamp":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"description":{"type":"string"},"license":{"type":"string"},"compatibility":{"type":"string"},"allowedTools":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"content":{"type":"string"},"archiveUrl":{"type":"string"},"validationWarnings":{"type":"array","items":{"type":"string"}},"resolvedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","ref","source","skillName","skillPath","commitHash","commitTimestamp","name","description","content","archiveUrl","resolvedAt","createdAt","projectId"]},"CreateSkillInput":{"type":"object","properties":{"source":{"type":"string"},"skillName":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["skills-sh","manual"]}},"required":["source","skillName","name","origin"]},"CodebaseResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"sourceType":{"type":"string","enum":["git","archive"]},"source":{"type":"string"},"defaultBranch":{"type":"string"},"revisionCounter":{"type":"number"},"latestRevisionId":{"type":"string"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","name","sourceType","revisionCounter","createdAt","projectId"]},"UpdateCodebaseInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultBranch":{"type":"string"}}},"CodebaseRevisionResponse":{"type":"object","properties":{"_id":{"type":"string"},"codebaseId":{"type":"string"},"slug":{"type":"string"},"revisionNumber":{"type":"number"},"ref":{"type":"string"},"sourceType":{"type":"string","enum":["git","archive"]},"source":{"type":"string"},"requestedRef":{"type":"string"},"resolvedCommitSha":{"type":"string"},"commitTimestamp":{"type":["string","null"],"format":"date-time"},"originalFilename":{"type":"string"},"contentSha256":{"type":"string"},"archiveUrl":{"type":"string"},"sizeBytes":{"type":"number"},"fileCount":{"type":"number"},"creator":{"type":"string"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"deduplicated":{"type":"boolean"},"projectId":{"type":"string"}},"required":["_id","codebaseId","slug","revisionNumber","ref","sourceType","archiveUrl","resolvedAt","createdAt","projectId"]},"ResolveCodebaseRevisionInput":{"type":"object","properties":{"requestedRef":{"type":"string"},"creator":{"type":"string"}}},"ResourceResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"revisionCounter":{"type":"number"},"latestRevisionId":{"type":"string"},"latestRevisionNumber":{"type":"number"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","name","revisionCounter","createdAt","projectId"]},"CreateResourceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"description":{"type":"string"},"setup":{"$ref":"#/components/schemas/ResourceScript"},"teardown":{"$ref":"#/components/schemas/ResourceScript"},"exports":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"}},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ResourceParameter"}},"creator":{"type":"string"}},"required":["name","setup"]},"ResourceScript":{"type":"object","properties":{"sh":{"type":"string","minLength":1}}},"ResourceParameter":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string"},"required":{"type":"boolean","default":false},"default":{"type":"string"},"example":{"type":"string"}},"required":["name"]},"UpdateResourceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"}}},"ResourceRevisionResponse":{"type":"object","properties":{"_id":{"type":"string"},"resourceId":{"type":"string"},"slug":{"type":"string"},"revisionNumber":{"type":"number"},"ref":{"type":"string"},"setup":{"$ref":"#/components/schemas/ResourceScript"},"teardown":{"$ref":"#/components/schemas/ResourceScript"},"exports":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ResourceParameter"}},"contentSha256":{"type":"string"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"deduplicated":{"type":"boolean"},"projectId":{"type":"string"}},"required":["_id","resourceId","slug","revisionNumber","ref","setup","exports","contentSha256","createdAt","projectId"]},"CreateResourceRevisionInput":{"type":"object","properties":{"setup":{"$ref":"#/components/schemas/ResourceScript"},"teardown":{"$ref":"#/components/schemas/ResourceScript"},"exports":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"}},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ResourceParameter"}},"creator":{"type":"string"}},"required":["setup"]},"ExtensionResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"publisher":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["marketplace","manual"]},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","publisher","name","origin","createdAt","projectId"]},"ExtensionSearchResult":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"publisher":{"type":"string"},"description":{"type":"string"},"internal":{"type":"boolean"},"version":{"type":"string"}},"required":["id","name","publisher","internal"]},"CreateExtensionInput":{"type":"object","properties":{"_id":{"type":"string","pattern":"^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+$"},"publisher":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["marketplace","manual"]}},"required":["_id","publisher","name","origin"]},"UpdateExtensionInput":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}}},"ExtensionVersionInfo":{"type":"object","properties":{"version":{"type":"string"},"preRelease":{"type":"boolean"},"lastUpdated":{"type":"string"}},"required":["version","preRelease","lastUpdated"]},"CreateInsightInput":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"createdBy":{"type":"string","enum":["agent","user"]},"sourceReportId":{"type":"string"}},"required":["title","description"]},"UpdateInsightInput":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"FeatureFlagResponse":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"enabled":{"type":"boolean"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["key","label","enabled","updatedAt"]},"UpdateFeatureFlagInput":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"parameters":{}},"paths":{"/api/v1/keys/preview":{"post":{"tags":["Keys"],"summary":"Preview key","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInput"}}}},"responses":{"200":{"description":"Key preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}}},"/api/v1/keys":{"post":{"tags":["Keys"],"summary":"Create key","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInput"}}}},"responses":{"201":{"description":"Key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}},"get":{"tags":["Keys"],"summary":"List keys","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KeyResponse"}}}}}}}},"/api/v1/keys/{id}":{"get":{"tags":["Keys"],"summary":"Get key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}},"put":{"tags":["Keys"],"summary":"Update key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInput"}}}},"responses":{"200":{"description":"Key updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}},"delete":{"tags":["Keys"],"summary":"Delete key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Key deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/api/v1/keys/{id}/validate":{"post":{"tags":["Keys"],"summary":"Validate key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateKeyInput"}}}},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"Key validation result"}}}}}}},"/api/v1/accounts":{"post":{"tags":["Accounts"],"summary":"Create account","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInput"}}}},"responses":{"201":{"description":"Account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}}}},"get":{"tags":["Accounts"],"summary":"List accounts","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountResponse"}}}}}}}},"/api/v1/accounts/{id}":{"get":{"tags":["Accounts"],"summary":"Get account","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}}}},"put":{"tags":["Accounts"],"summary":"Update account","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInput"}}}},"responses":{"200":{"description":"Account updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}}}},"delete":{"tags":["Accounts"],"summary":"Delete account","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Account deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/api/v1/users/me":{"get":{"tags":["Users"],"summary":"Get the authenticated user's identity","description":"Read the existing authenticated Scope identity without enrollment or profile writes. Responses must not be HTTP-cached.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMeResponse"}}}},"401":{"description":"Not authenticated"},"403":{"description":"User is not enrolled or is disabled"},"503":{"description":"Authentication service unavailable"}}},"post":{"tags":["Users"],"summary":"Enroll the authenticated user","description":"JIT-enroll the authenticated user, refresh their profile and lastLoginAt, apply bootstrap-admin rules, and warm the access cache. Use this only after an explicit IdP login; do not prefetch, poll, or automatically retry transient failures.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMeResponse"}}}},"401":{"description":"Not authenticated"},"403":{"description":"User is disabled"},"503":{"description":"Authentication service unavailable"}}}},"/health":{"get":{"tags":["Health"],"summary":"Liveness probe","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"version":{"type":"string"}},"required":["status","version"]}}}}}}},"/ready":{"get":{"tags":["Health"],"summary":"Readiness probe","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"migrations":{}},"required":["status"]}}}},"503":{"description":"Service is not ready"}}}},"/about":{"get":{"tags":["System"],"summary":"API metadata","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"buildTime":{"type":"string"},"environment":{"type":"string"},"description":{"type":"string"},"workers":{"type":"array","items":{"type":"string"}}},"required":["name","version","buildTime","environment","description","workers"]}}}}}}},"/api/v1/version":{"get":{"tags":["System"],"summary":"Version info","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"commit":{"type":"string"},"buildTime":{"type":"string"},"environment":{"type":"string"},"strictAgentCapabilities":{"type":"boolean"}},"required":["commit","buildTime","environment","strictAgentCapabilities"]}}}}}}},"/api/v1/projects":{"get":{"tags":["Projects"],"summary":"List all projects","parameters":[{"schema":{"type":"string","enum":["true","false"],"description":"When true, include soft-deleted projects in the result"},"required":false,"description":"When true, include soft-deleted projects in the result","name":"includeDeleted","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectResponse"}}}}}}},"post":{"tags":["Projects"],"summary":"Create a project","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"400":{"description":"Invalid input"}}}},"/api/v1/projects/{id}":{"get":{"tags":["Projects"],"summary":"Get a project","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"404":{"description":"Project not found"}}},"patch":{"tags":["Projects"],"summary":"Update a project","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"404":{"description":"Project not found"}}},"delete":{"tags":["Projects"],"summary":"Soft-delete a project","responses":{"204":{"description":"Success"},"404":{"description":"Project not found"}}}},"/api/v1/projects/{id}/restore":{"post":{"tags":["Projects"],"summary":"Restore a soft-deleted project","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"404":{"description":"Project not found"}}}},"/api/v1/requests":{"post":{"tags":["Requests"],"summary":"Submit request(s)","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateRequestInput"},{"type":"object","properties":{"count":{"type":"number","minimum":1,"maximum":10,"default":1},"skills":{"type":"array","items":{"type":"string"}},"agentVersion":{"type":"string"},"codebase":{"type":"string"}}}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RequestResponse"},{"type":"array","items":{"$ref":"#/components/schemas/RequestResponse"}}]}}}}}},"get":{"tags":["Requests"],"summary":"List requests","parameters":[{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"worker","in":"query"},{"schema":{"type":"string"},"required":false,"name":"taskPromptId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"criteria","in":"query"},{"schema":{"type":"string"},"required":false,"name":"submissionId","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"profileId","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"status","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"outcome","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"model","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"os","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"priority","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"agentVersion","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["task","submissionId","profile"]},"required":false,"name":"groupBy","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"last","in":"query"},{"schema":{"type":"string","enum":["created","updated","priority","worker","status","id","duration","createdAt"]},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"sortDir","in":"query"},{"schema":{"type":["string","null"],"format":"date-time"},"required":false,"name":"createdAfter","in":"query"},{"schema":{"type":["string","null"],"format":"date-time"},"required":false,"name":"createdBefore","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"turns","in":"query"},{"schema":{"type":"string","enum":["eq","gte","lte"]},"required":false,"name":"turnsOp","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"maxIterations","in":"query"},{"schema":{"type":"string","enum":["eq","gte","lte"]},"required":false,"name":"maxIterationsOp","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PaginatedRunsResponse"},{"$ref":"#/components/schemas/PaginatedRunGroupsResponse"}]}}}}}}},"/api/v1/requests/facets":{"get":{"tags":["Requests"],"summary":"List run filter facets","description":"Returns every distinct value and its full-dataset count per categorical filter dimension for the Runs list rail. Counts are absolute over all non-deleted runs **in the given project**: they intentionally ignore the active search, date range, iteration, and categorical selections so every selectable value stays visible with a stable count. Requires ?projectId=. Computed with parallel $group aggregations (Cosmos has no $facet) and cached per-project for a short TTL.","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunFacetsResponse"}}}}}}},"/api/v1/requests/{id}":{"get":{"tags":["Requests"],"summary":"Get request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResponse"}}}},"404":{"description":"Not found"}}},"delete":{"tags":["Requests"],"summary":"Soft-delete request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Not found"}}}},"/api/v1/analysis":{"get":{"tags":["Requests"],"summary":"Compute pass@k / success@T metrics","description":"Aggregates pass@k / success@T metrics over a single project's done runs. Requires ?projectId=.","parameters":[{"schema":{"type":"string"},"required":false,"name":"worker","in":"query"},{"schema":{"type":"string"},"required":false,"name":"taskPromptId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"criteria","in":"query"},{"schema":{"type":"string"},"required":false,"name":"features","in":"query"},{"schema":{"type":"string"},"required":false,"name":"submissionId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"k","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"Analysis metrics"}}}}}}},"/api/v1/requests/bulk-resubmit":{"post":{"tags":["Requests"],"summary":"Bulk resubmit requests","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkResubmitInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RequestResponse"}}}}}}}},"/api/v1/requests/bulk":{"delete":{"tags":["Requests"],"summary":"Bulk soft-delete requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"number"}},"required":["deleted"]}}}}}}},"/api/v1/requests/archive":{"post":{"tags":["Requests"],"summary":"Download batch archive of multiple runs","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Gzipped batch archive containing individual run archives"},"400":{"description":"Invalid input"},"404":{"description":"One or more runs not found"}}}},"/api/v1/runs/upload":{"post":{"tags":["Requests"],"summary":"Import run archive","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"201":{"description":"Success"}}}},"/api/v1/runs/upload-batch":{"post":{"tags":["Requests"],"summary":"Import batch run archive","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"207":{"description":"Multi-status: 201 if all runs imported, 400 if none imported, 207 if partial"},"400":{"description":"No archive uploaded, empty archive, or all runs failed"}}}},"/api/v1/requests/{id}/reports":{"get":{"tags":["Reports"],"summary":"Get reports for request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"404":{"description":"Run not found"}}}},"/api/v1/requests/{id}/runs":{"get":{"tags":["Requests"],"summary":"List attempts for a request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunState"}}}}},"404":{"description":"Request not found"}}}},"/api/v1/requests/{id}/runs/{runId}":{"get":{"tags":["Requests"],"summary":"Get a single attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunState"}}}},"404":{"description":"Request or run not found"}}}},"/api/v1/requests/bulk-retry":{"post":{"tags":["Requests"],"summary":"Bulk retry requests (start new attempts)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1},"force":{"type":"boolean"}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"retried":{"type":"integer"},"skipped":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"requestId":{"type":"string"},"runId":{"type":"string"},"attemptNumber":{"type":"integer"},"error":{"type":"string"}},"required":["requestId"]}}},"required":["retried","skipped","results"]}}}}}}},"/api/v1/requests/{id}/retry":{"post":{"tags":["Requests"],"summary":"Retry a request (start a new attempt)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"runId":{"type":"string"},"attemptNumber":{"type":"integer"}},"required":["requestId","runId","attemptNumber"]}}}},"404":{"description":"Request not found"},"409":{"description":"Conflict — request is not in a retryable state, or a concurrent retry won the race"},"422":{"description":"Cannot retry — current run not yet terminal"}}}},"/api/v1/requests/{id}/priority":{"post":{"tags":["Requests"],"summary":"Set priority on a single request","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"priority":{"type":"integer"}},"required":["priority"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"priority":{"type":"number"}},"required":["id","priority"]}}}}}}},"/api/v1/requests/bulk-priority":{"post":{"tags":["Requests"],"summary":"Set priority on multiple requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"priority":{"type":"integer"}},"required":["ids","priority"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]}}}}}}},"/api/v1/requests/{id}/pause":{"post":{"tags":["Requests"],"summary":"Pause a single request","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"]}}}}}}},"/api/v1/requests/{id}/resume":{"post":{"tags":["Requests"],"summary":"Resume a paused request","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"]}}}}}}},"/api/v1/requests/bulk-pause":{"post":{"tags":["Requests"],"summary":"Pause multiple requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]}}}}}}},"/api/v1/requests/bulk-resume":{"post":{"tags":["Requests"],"summary":"Resume multiple paused requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]}}}}}}},"/api/v1/requests/{id}/cancel":{"post":{"tags":["Requests"],"summary":"Cancel a request (marks as done/failed and signals worker to exit)","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"previousStatus":{"type":"string"},"status":{"type":"string"},"outcome":{"type":"string"}},"required":["id","previousStatus","status","outcome"]}}}}}}},"/api/v1/requests/bulk-cancel":{"post":{"tags":["Requests"],"summary":"Cancel multiple requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"number"},"skipped":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"cancelled":{"type":"boolean"},"previousStatus":{"type":"string"},"error":{"type":"string"}},"required":["id","cancelled"]}}},"required":["cancelled","skipped","results"]}}}}}}},"/api/v1/requests/{id}/logs":{"get":{"tags":["Requests"],"summary":"Stream request logs (SSE)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Server-sent event stream of log entries"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/logs":{"get":{"tags":["Requests"],"summary":"Stream logs for a specific attempt (SSE)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Server-sent event stream of log entries"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/har":{"get":{"tags":["Requests"],"summary":"Download HAR file","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"HAR-format JSON file"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/har":{"get":{"tags":["Requests"],"summary":"Download HAR file for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"HAR-format JSON file"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/atif":{"get":{"tags":["Requests"],"summary":"Download ATIF trajectory file for a specific iteration","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The iteration number (1-based)"},"required":true,"description":"The iteration number (1-based)","name":"iteration","in":"query"}],"responses":{"200":{"description":"ATIF v1.7 trajectory JSON file"},"400":{"description":"Missing or invalid iteration"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/atif":{"get":{"tags":["Requests"],"summary":"Download ATIF trajectory file for a specific attempt and iteration","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string","description":"The iteration number (1-based)"},"required":true,"description":"The iteration number (1-based)","name":"iteration","in":"query"}],"responses":{"200":{"description":"ATIF v1.7 trajectory JSON file"},"400":{"description":"Missing or invalid iteration"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/video":{"get":{"tags":["Requests"],"summary":"Download session recording","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"WebM video recording (supports Range requests)"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/video":{"get":{"tags":["Requests"],"summary":"Download session recording for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"WebM video recording (supports Range requests)"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/tool-calls":{"get":{"tags":["Requests"],"summary":"Download per-iteration tool-calls JSONL","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"JSONL stream — one ToolCall per line"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/tool-calls":{"get":{"tags":["Requests"],"summary":"Download per-iteration tool-calls JSONL for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"JSONL stream — one ToolCall per line"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/snapshots/{iteration}":{"get":{"tags":["Requests"],"summary":"Download iteration snapshot","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"iteration","in":"path"}],"responses":{"200":{"description":"Gzipped snapshot archive"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/snapshots/{iteration}":{"get":{"tags":["Requests"],"summary":"Download iteration snapshot for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"iteration","in":"path"}],"responses":{"200":{"description":"Gzipped snapshot archive"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/archive":{"get":{"tags":["Requests"],"summary":"Download full run archive","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Gzipped run archive"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/archive":{"get":{"tags":["Requests"],"summary":"Download full run archive for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Gzipped run archive"},"404":{"description":"Not found"}}}},"/api/v1/criteria/generate-prompt":{"post":{"tags":["Criteria"],"summary":"Generate criterion prompt from behavior","parameters":[{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","example":"00000000-0000-0000-0000-000000000000"},"required":false,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"behavior":{"type":"string"},"currentId":{"type":"string"},"gates":{"type":"array","items":{"type":"string"}}},"required":["behavior"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"suggestedId":{"type":"string"},"suggestedParents":{"type":"array","items":{"type":"string"}},"suggestedChildren":{"type":"array","items":{"type":"string"}}},"required":["prompt","suggestedId","suggestedParents","suggestedChildren"]}}}},"400":{"description":"Empty behavior string"},"503":{"description":"LLM not configured"}}}},"/api/v1/criteria/seed":{"post":{"tags":["Criteria"],"summary":"Seed criteria in bulk","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"criteria":{"type":"array","items":{"$ref":"#/components/schemas/CreateCriteriaInput"}}},"required":["criteria"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"seeded":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["seeded","errors"]}}}},"400":{"description":"Seed batch would introduce a dependency cycle"}}}},"/api/v1/criteria":{"get":{"tags":["Criteria"],"summary":"List criteria","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated criterion IDs to include"},"required":false,"description":"Comma-separated criterion IDs to include","name":"ids","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"When true and ids is set, also include dependency ancestors"},"required":false,"description":"When true and ids is set, also include dependency ancestors","name":"ancestors","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CriteriaResponse"}}}}}}},"post":{"tags":["Criteria"],"summary":"Create criterion","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCriteriaInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaResponse"}}}},"409":{"description":"Criterion already exists"}}}},"/api/v1/criteria/mdp":{"get":{"tags":["Criteria"],"summary":"Compute MDP transitions","parameters":[{"schema":{"type":"string"},"required":false,"name":"criteria","in":"query"},{"schema":{"type":"string"},"required":false,"name":"features","in":"query"},{"schema":{"type":"string"},"required":false,"name":"since","in":"query"},{"schema":{"type":"string"},"required":false,"name":"worker","in":"query"},{"schema":{"type":"string"},"required":false,"name":"taskPromptId","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}}}}},"/api/v1/criteria/graph":{"get":{"tags":["Criteria"],"summary":"Get criteria DAG","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaGraph"}}}}}}},"/api/v1/criteria/{id}":{"get":{"tags":["Criteria"],"summary":"Get criterion","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaResponse"}}}},"404":{"description":"Criterion not found"}}},"put":{"tags":["Criteria"],"summary":"Update criterion","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCriteriaInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaResponse"}}}},"400":{"description":"Invalid dependency reference or self-reference"},"404":{"description":"Criterion not found"}}},"delete":{"tags":["Criteria"],"summary":"Soft-delete criterion","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}},"404":{"description":"Criterion not found"},"409":{"description":"Criterion has dependents"}}}},"/api/v1/prompt-features/generate-prompt":{"post":{"tags":["Prompt Features"],"summary":"Generate prompt feature from behavior","parameters":[{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","example":"00000000-0000-0000-0000-000000000000"},"required":false,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"behavior":{"type":"string"},"currentId":{"type":"string"}},"required":["behavior"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"}},"required":["prompt"]}}}},"400":{"description":"Empty behavior string"},"503":{"description":"LLM not configured"}}}},"/api/v1/prompt-features/seed":{"post":{"tags":["Prompt Features"],"summary":"Seed prompt features in bulk","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"features":{"type":"array","items":{"$ref":"#/components/schemas/CreatePromptFeatureInput"}}},"required":["features"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"seeded":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["seeded","errors"]}}}}}}},"/api/v1/prompt-features/extract-from-text":{"post":{"tags":["Prompt Features"],"summary":"Extract features from text","parameters":[{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","example":"00000000-0000-0000-0000-000000000000"},"required":false,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"model":{"type":"string"},"type":{"type":"string","enum":["select","agents.md"]}},"required":["text"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"features":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResult"}},"suggestedFeatures":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedPromptFeature"}},"cached":{"type":"boolean"}},"required":["features","cached"]}}}},"400":{"description":"Empty text string"},"503":{"description":"LLM not configured"}}}},"/api/v1/prompt-features":{"get":{"tags":["Prompt Features"],"summary":"List features","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","enum":["select","agents.md"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}}}}},"post":{"tags":["Prompt Features"],"summary":"Create feature","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromptFeatureInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}},"400":{"description":"Invalid input"},"409":{"description":"Feature already exists"}}}},"/api/v1/prompt-features/{id}":{"get":{"tags":["Prompt Features"],"summary":"Get feature","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}},"404":{"description":"Feature not found"}}},"put":{"tags":["Prompt Features"],"summary":"Update feature","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePromptFeatureInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}},"400":{"description":"Invalid input"},"404":{"description":"Feature not found"}}},"delete":{"tags":["Prompt Features"],"summary":"Soft-delete feature","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}},"404":{"description":"Feature not found"}}}},"/api/v1/task-prompts/generate":{"post":{"tags":["Task Prompts"],"summary":"Generate task prompts","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"existingPrompt":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"string"}}},"required":["tasks"]}}}},"503":{"description":"LLM not configured"}}}},"/api/v1/task-prompts":{"get":{"tags":["Task Prompts"],"summary":"List task prompts","parameters":[{"schema":{"type":["number","null"]},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"]},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"$ref":"#/components/schemas/PromptType"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TaskPromptResponse"}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["items","total","limit","offset"]}}}}}},"post":{"tags":["Task Prompts"],"summary":"Create or find task prompt","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskPromptInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPromptResponse"}}}},"400":{"description":"Empty text string"}}}},"/api/v1/task-prompts/{id}":{"get":{"tags":["Task Prompts"],"summary":"Get task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPromptResponse"}}}},"404":{"description":"Task prompt not found"}}},"delete":{"tags":["Task Prompts"],"summary":"Soft-delete task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"404":{"description":"Task prompt not found"}}}},"/api/v1/task-prompts/{id}/content":{"get":{"tags":["Task Prompts"],"summary":"Get resolved task prompt content","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}}}},"404":{"description":"Task prompt not found"}}}},"/api/v1/task-prompts/{id}/extract-features":{"post":{"tags":["Task Prompts"],"summary":"Extract features from task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"force","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"taskPromptId":{"type":"string"},"features":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResult"}},"featuresExtractedAt":{"type":["string","null"],"format":"date-time"},"suggestedFeatures":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedPromptFeature"}},"cached":{"type":"boolean"}},"required":["taskPromptId","features","cached"]}}}},"404":{"description":"Task prompt not found"},"503":{"description":"LLM not configured"}}}},"/api/v1/task-prompts/{id}/features/{featureId}":{"patch":{"tags":["Task Prompts"],"summary":"Toggle feature flag on task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"featureId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchTaskPromptFeatureInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPromptResponse"}}}},"400":{"description":"Invalid detected value"},"404":{"description":"Task prompt or feature not found"}}}},"/api/v1/reports":{"post":{"tags":["Reports"],"summary":"Create report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"400":{"description":"Invalid input"},"404":{"description":"Run or template not found"}}},"get":{"tags":["Reports"],"summary":"List reports","parameters":[{"schema":{"type":"string"},"required":false,"name":"requestId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}}}}},"/api/v1/reports/bulk-create":{"post":{"tags":["Reports"],"summary":"Bulk create reports","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateReportsInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/bulk-status":{"post":{"tags":["Reports"],"summary":"Bulk get report statuses","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportStatusInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/bulk-summary":{"post":{"tags":["Reports"],"summary":"Bulk get report summary per run","description":"Returns aggregated report status counts per run. Only the latest report per template is counted (re-triggers are deduplicated).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportSummaryInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportSummaryResponse"}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/{id}":{"get":{"tags":["Reports"],"summary":"Get report","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"404":{"description":"Report not found"}}}},"/api/v1/reports/{id}/logs":{"get":{"tags":["Reports"],"summary":"Stream report logs (SSE)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Server-sent event stream of log entries"},"404":{"description":"Report not found"}}}},"/api/v1/reports/trigger":{"post":{"tags":["Reports"],"summary":"Trigger reports","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerReportsInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"triggered":{"type":"number"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}},"required":["triggered","reports"]}}}},"400":{"description":"Invalid input"},"404":{"description":"Run not found"}}}},"/api/v1/reports/bulk-trigger":{"post":{"tags":["Reports"],"summary":"Bulk trigger reports","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTriggerReportsInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/{id}/insights":{"get":{"tags":["Reports"],"summary":"Get insights for report","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/InsightResponse"},{"type":"object","properties":{"referencedAt":{"type":["string","null"],"format":"date-time"},"isNew":{"type":"boolean"}}}]}}}}},"404":{"description":"Report not found"}}},"post":{"tags":["Reports"],"summary":"Link insight to report","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"insightId":{"type":"string"},"isNew":{"type":"boolean"}},"required":["insightId"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"insightId":{"type":"string"},"referencedAt":{"type":["string","null"],"format":"date-time"},"isNew":{"type":"boolean"}},"required":["insightId","referencedAt","isNew"]}}}},"404":{"description":"Report or insight not found"},"409":{"description":"Insight already referenced by this report"}}}},"/api/v1/profiles":{"post":{"tags":["Profiles"],"summary":"Create a new profile","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProfileInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileWithVersionResponse"}}}}}},"get":{"tags":["Profiles"],"summary":"List profiles","parameters":[{"schema":{"type":"string"},"required":false,"name":"workerType","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfileWithVersionResponse"}}}}}}}},"/api/v1/profiles/{profileId}":{"get":{"tags":["Profiles"],"summary":"Get profile with latest version","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileWithVersionResponse"}}}}}},"post":{"tags":["Profiles"],"summary":"Create new profile version","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"agentVersion":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}}},"required":["workerType","model"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileVersionResponse"}}}}}},"put":{"tags":["Profiles"],"summary":"Update profile identity","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileIdentity"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}}}},"delete":{"tags":["Profiles"],"summary":"Delete profile","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/api/v1/profiles/{profileId}/versions":{"get":{"tags":["Profiles"],"summary":"List profile versions","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfileVersionResponse"}}}}}}}},"/api/v1/profiles/{profileId}/versions/{version}":{"get":{"tags":["Profiles"],"summary":"Get profile version","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"},{"schema":{"type":["number","null"]},"required":false,"name":"version","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileVersionResponse"}}}}}}},"/api/v1/report-templates/default-system-prompt":{"get":{"tags":["Report Templates"],"summary":"Get default system prompt","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}}}}}},"/api/v1/report-templates/available-models":{"get":{"tags":["Report Templates"],"summary":"List models available for report generation","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string"}},"required":["modelId"]}}}}}}}},"/api/v1/report-templates":{"get":{"tags":["Report Templates"],"summary":"List report templates","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}}}}},"post":{"tags":["Report Templates"],"summary":"Create report template","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportTemplateInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}},"409":{"description":"Report template already exists"}}}},"/api/v1/report-templates/{id}":{"get":{"tags":["Report Templates"],"summary":"Get report template","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}},"404":{"description":"Report template not found"}}},"put":{"tags":["Report Templates"],"summary":"Update report template","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportTemplateInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}},"404":{"description":"Report template not found"}}},"delete":{"tags":["Report Templates"],"summary":"Delete report template","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Report template not found"}}}},"/api/v1/agents":{"get":{"tags":["Agents"],"summary":"List agents","parameters":[{"schema":{"type":"string"},"required":false,"name":"modelProvider","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeDeleted","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponse"}}}}}}},"post":{"tags":["Agents"],"summary":"Create or update agent (upsert)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"400":{"description":"Validation error"},"409":{"description":"Restored agent versions conflict with an active queue owner"}}}},"/api/v1/agents/{id}":{"get":{"tags":["Agents"],"summary":"Get agent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeDeleted","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"404":{"description":"Agent not found"}}},"put":{"tags":["Agents"],"summary":"Update agent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"400":{"description":"Validation error"},"404":{"description":"Agent not found"}}},"delete":{"tags":["Agents"],"summary":"Delete agent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Agent not found"}}}},"/api/v1/agents/{id}/versions":{"get":{"tags":["Agents"],"summary":"List agent versions","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersion"}}}}},"404":{"description":"Agent not found"}}},"post":{"tags":["Agents"],"summary":"Register agent version (upsert)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAgentVersionInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersion"}}}},"400":{"description":"Validation error"},"404":{"description":"Agent not found"},"409":{"description":"Queue is assigned to another agent"},"503":{"description":"Concurrent registration did not stabilize"}}}},"/api/v1/agents/{id}/versions/{agentVersion}":{"patch":{"tags":["Agents"],"summary":"Patch agent version","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"agentVersion","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchAgentVersionInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersion"}}}},"400":{"description":"Invalid status value"},"404":{"description":"Agent or version not found"},"409":{"description":"Queue is assigned to another agent"},"503":{"description":"Concurrent activation did not stabilize"}}}},"/api/v1/models":{"get":{"tags":["Models"],"summary":"List models","parameters":[{"schema":{"type":"string"},"required":false,"name":"agentId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"provider","in":"query"},{"schema":{"type":"string","enum":["active","disappeared"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelResponse"}}}}}}}},"/api/v1/models/{id}":{"get":{"tags":["Models"],"summary":"Get model","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelResponse"}}}}}}},"/api/v1/models/sync":{"post":{"tags":["Models"],"summary":"Sync models from provider","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string"},"provider":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"providerAvailableFrom":{"type":"string"},"providerEndOfLife":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"capabilities":{"type":"object","properties":{"reasoningEffort":{"type":"array","items":{"type":"string"}},"toolCalls":{"type":"boolean"},"vision":{"type":"boolean"},"streaming":{"type":"boolean"},"adaptiveThinking":{"type":"boolean"},"maxThinkingBudget":{"type":"number"}}}},"required":["id"]}},"scannedAt":{"type":"string"}},"required":["agentId","provider","models","scannedAt"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}},"unchanged":{"type":"array","items":{"type":"string"}}},"required":["added","removed","unchanged"]}}}}}}},"/api/v1/mcp/servers":{"get":{"tags":["MCP Servers"],"summary":"List MCP servers","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/McpServerResponse"}}}}}}},"post":{"tags":["MCP Servers"],"summary":"Create MCP server","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string","pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?$"},"name":{"type":"string"},"type":{"type":"string","enum":["sse","http","stdio"]},"url":{"type":"string"},"command":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"env":{"type":"object","additionalProperties":{"type":"string"}},"headers":{"type":"array","items":{"$ref":"#/components/schemas/McpServerHeader"}},"sessionMode":{"type":"string","enum":["stateful","stateless"]},"version":{"type":"string"},"description":{"type":"string"}},"required":["_id","name","type"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}}}}}},"/api/v1/mcp/servers/{id}":{"get":{"tags":["MCP Servers"],"summary":"Get MCP server","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}}}}},"put":{"tags":["MCP Servers"],"summary":"Update MCP server","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMcpServerInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}}}}},"delete":{"tags":["MCP Servers"],"summary":"Delete MCP server","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/api/v1/skills":{"get":{"tags":["Skills"],"summary":"List all skills","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillResponse"}}}}}}},"post":{"tags":["Skills"],"summary":"Create or import a skill","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSkillInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillResponse"}}}}}}},"/api/v1/skills/search":{"get":{"tags":["Skills"],"summary":"Search skills (internal + external)","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillSearchResult"}}}}},"400":{"description":"Missing query parameter"}}}},"/api/v1/skills/search/external":{"get":{"tags":["Skills"],"summary":"Search external skills registry","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, external results are de-duplicated only against skills already installed in that project."},"required":false,"description":"Optional project scope. When provided, external results are de-duplicated only against skills already installed in that project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillSearchResult"}}}}},"400":{"description":"Missing query parameter"}}}},"/api/v1/skills/discover":{"get":{"tags":["Skills"],"summary":"Discover skills in a GitHub repository","parameters":[{"schema":{"type":"string"},"required":true,"name":"source","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillDiscoveryResult"}}}}},"400":{"description":"Missing or malformed source parameter"},"404":{"description":"Repository not found"},"502":{"description":"GitHub API error"}}}},"/api/v1/skills/{id}(*)/revisions":{"get":{"tags":["Skills"],"summary":"List skill revisions","parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}}},"404":{"description":"Skill not found"}}}},"/api/v1/skills/{id}(*)":{"get":{"tags":["Skills"],"summary":"Get skill by slug","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillResponse"}}}},"404":{"description":"Skill not found"}}},"delete":{"tags":["Skills"],"summary":"Soft-delete a skill","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success"},"404":{"description":"Skill not found"}}}},"/api/v1/skill-revisions/by-ref/{ref}(*)/archive":{"get":{"tags":["Skill Revisions"],"summary":"Download skill revision archive","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Binary tar.gz archive"},"404":{"description":"Skill revision or archive not found"},"500":{"description":"Blob storage error"}}}},"/api/v1/skill-revisions/by-ref/{ref}(*)":{"get":{"tags":["Skill Revisions"],"summary":"Get skill revision by ref","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}},"404":{"description":"Skill revision not found"}}}},"/api/v1/skill-revisions/{id}":{"get":{"tags":["Skill Revisions"],"summary":"Get skill revision by ID","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}},"404":{"description":"Skill revision not found"}}}},"/api/v1/skills/{id}(*)/resolve":{"post":{"tags":["Skills"],"summary":"Trigger skill resolution","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}},"404":{"description":"Skill not found"},"500":{"description":"Blob storage error"}}}},"/api/v1/codebases":{"get":{"tags":["Codebases"],"summary":"List all codebases","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodebaseResponse"}}}}}}},"post":{"tags":["Codebases"],"summary":"Create a codebase (archive codebases require the archive file)","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"201":{"description":"Success"},"400":{"description":"Invalid input or missing archive"}}}},"/api/v1/codebases/{id}":{"get":{"tags":["Codebases"],"summary":"Get a codebase","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseResponse"}}}},"404":{"description":"Codebase not found"}}},"patch":{"tags":["Codebases"],"summary":"Update a codebase","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCodebaseInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseResponse"}}}},"404":{"description":"Codebase not found"}}},"delete":{"tags":["Codebases"],"summary":"Delete a codebase","responses":{"204":{"description":"Success"},"404":{"description":"Codebase not found"}}}},"/api/v1/codebases/{id}/revisions":{"get":{"tags":["Codebases"],"summary":"List codebase revisions","parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodebaseRevisionResponse"}}}}},"404":{"description":"Codebase not found"}}},"post":{"tags":["Codebases"],"summary":"Resolve a new git codebase revision","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveCodebaseRevisionInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseRevisionResponse"}}}},"400":{"description":"Not a git codebase"},"404":{"description":"Codebase not found"},"502":{"description":"GitHub resolution failed"}}}},"/api/v1/codebases/{id}/upload":{"post":{"tags":["Codebases"],"summary":"Upload a codebase archive as a new revision","responses":{"201":{"description":"Success"},"400":{"description":"Missing archive or not an archive codebase"},"404":{"description":"Codebase not found"}}}},"/api/v1/codebase-revisions/{id}/archive":{"get":{"tags":["Codebase Revisions"],"summary":"Download codebase revision archive","responses":{"200":{"description":"Binary tar.gz archive"},"404":{"description":"Revision or archive not found"},"500":{"description":"Blob storage error"}}}},"/api/v1/codebase-revisions/{id}":{"get":{"tags":["Codebase Revisions"],"summary":"Get codebase revision by id","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/resources":{"get":{"tags":["Resources"],"summary":"List all resources","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResourceResponse"}}}}}}},"post":{"tags":["Resources"],"summary":"Create a resource and its first revision","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceInput"}}}},"responses":{"201":{"description":"Success"},"400":{"description":"Invalid input"},"409":{"description":"Resource slug or revision ref already exists in this project"}}}},"/api/v1/resources/{id}":{"get":{"tags":["Resources"],"summary":"Get a resource","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceResponse"}}}},"404":{"description":"Resource not found"}}},"patch":{"tags":["Resources"],"summary":"Update a resource","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceResponse"}}}},"404":{"description":"Resource not found"}}},"delete":{"tags":["Resources"],"summary":"Delete a resource","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success"},"404":{"description":"Resource not found"}}}},"/api/v1/resources/{id}/revisions":{"get":{"tags":["Resource Revisions"],"summary":"List resource revisions","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}}},"404":{"description":"Resource not found"}}},"post":{"tags":["Resource Revisions"],"summary":"Create a resource revision","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceRevisionInput"}}}},"responses":{"201":{"description":"Success"},"404":{"description":"Resource not found"},"409":{"description":"Resource revision ref already exists in this project"}}}},"/api/v1/resources/{id}/revisions/latest":{"get":{"tags":["Resource Revisions"],"summary":"Get the latest resource revision","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/resources/{id}/revisions/{revisionNumber}":{"get":{"tags":["Resource Revisions"],"summary":"Get a resource revision by resource and revision number","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"revisionNumber","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/resources/revisions/{id}":{"get":{"tags":["Resource Revisions"],"summary":"Get resource revision by id","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/extensions":{"get":{"tags":["Extensions"],"summary":"List all extensions","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}}},"post":{"tags":["Extensions"],"summary":"Create or import an extension","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExtensionInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}}},"/api/v1/extensions/search":{"get":{"tags":["Extensions"],"summary":"Search extensions (internal + marketplace)","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExtensionSearchResult"}}}}},"400":{"description":"Missing query parameter"}}}},"/api/v1/extensions/{id}":{"get":{"tags":["Extensions"],"summary":"Get extension by ID","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}},"put":{"tags":["Extensions"],"summary":"Update extension","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExtensionInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}},"delete":{"tags":["Extensions"],"summary":"Delete extension","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/api/v1/extensions/{id}/versions":{"get":{"tags":["Extensions"],"summary":"List available versions for an extension","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"preRelease","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExtensionVersionInfo"}}}}}}}},"/api/v1/insights":{"get":{"tags":["Insights"],"summary":"List insights","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"blocked","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InsightResponse"}}}}}}},"post":{"tags":["Insights"],"summary":"Create insight","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInsightInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}}}}},"/api/v1/insights/search":{"get":{"tags":["Insights"],"summary":"Search insights","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"blocked","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InsightResponse"}}}}}}}},"/api/v1/insights/{id}":{"get":{"tags":["Insights"],"summary":"Get insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}},"put":{"tags":["Insights"],"summary":"Update insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInsightInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}},"delete":{"tags":["Insights"],"summary":"Delete insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/upvote":{"post":{"tags":["Insights"],"summary":"Upvote insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/downvote":{"post":{"tags":["Insights"],"summary":"Downvote insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/block":{"post":{"tags":["Insights"],"summary":"Block insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/unblock":{"post":{"tags":["Insights"],"summary":"Unblock insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/reports":{"get":{"tags":["Insights"],"summary":"Get reports referencing insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"404":{"description":"Insight not found"}}}},"/api/v1/feature-flags":{"get":{"tags":["Feature Flags"],"summary":"List feature flags","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureFlagResponse"}}}}}}}},"/api/v1/feature-flags/{key}":{"put":{"tags":["Feature Flags"],"summary":"Update feature flag","parameters":[{"schema":{"type":"string"},"required":true,"name":"key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFeatureFlagInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagResponse"}}}}}}}},"webhooks":{}}
\ No newline at end of file
+{"openapi":"3.1.0","info":{"title":"Scope API","version":"1.0.0","description":"REST API for the Scope platform — benchmarking AI coding agents"},"servers":[{"url":"/","description":"Current server"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Use the unchanged IdP access token, without the Bearer prefix."}},"schemas":{"KeyResponse":{"type":"object","properties":{},"additionalProperties":{}},"KeyInput":{"type":"object","properties":{},"additionalProperties":{}},"ValidateKeyInput":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]},"AccountResponse":{"type":"object","properties":{},"additionalProperties":{}},"AccountInput":{"type":"object","properties":{},"additionalProperties":{}},"UserMeResponse":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"email":{"type":"string"},"displayName":{"type":"string"},"idp":{"type":"string"},"idpTenant":{"type":"string"}},"required":["id"]},"ProjectResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["_id","name","createdAt"]},"CreateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"creator":{"type":"string"}},"required":["name"]},"UpdateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"}}},"RequestResponse":{"type":"object","properties":{"_id":{"type":"string"},"scenario":{"$ref":"#/components/schemas/Scenario"},"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"maxIterations":{"type":"number"},"personaInstructions":{"type":"string"},"persona":{"$ref":"#/components/schemas/Persona"},"deletedAt":{"type":["string","null"],"format":"date-time"},"taskPromptId":{"type":"string"},"agentsMdPromptId":{"type":"string"},"agentsMdParentIds":{"type":"array","items":{"type":"string"}},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"codebaseRevisionId":{"type":"string"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBinding"}},"extensions":{"type":"array","items":{"type":"string"}},"agentVersion":{"type":"string"},"profileId":{"type":"string"},"profileVersionId":{"type":"string"},"submissionId":{"type":"string"},"experimentId":{"type":"string"},"priority":{"type":"integer","default":0},"gates":{"type":"array","items":{"$ref":"#/components/schemas/GateConfig"}},"gateSummaries":{"type":"array","items":{"$ref":"#/components/schemas/GateRunSummary"}},"run":{"$ref":"#/components/schemas/RunState"},"projectId":{"type":"string"}},"required":["_id","scenario","workerType","createdAt","projectId"]},"Scenario":{"type":"object","properties":{"version":{"type":"string","enum":["v1","v2"]},"task":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}}},"required":["task","criteria"]},"Persona":{"type":"object","properties":{"personality":{"type":"string","enum":["demanding","friendly"]},"experience":{"type":"string","enum":["junior","senior"]},"verbosity":{"type":"string","enum":["brief","moderate"]},"type":{"type":"string","enum":["traditional","ai_assisted","vibe"]}},"required":["personality","experience","verbosity","type"]},"ResourceBinding":{"type":"object","properties":{"ref":{"type":"string"},"revisionId":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}}},"required":["ref","revisionId","params"]},"GateConfig":{"type":"object","properties":{"gate":{"type":"string","enum":["select","build","test","run","deploy"]},"promptId":{"type":"string"},"promptText":{"type":"string"},"criteria":{"type":"array","items":{"type":"string"}},"maxIterations":{"type":"integer","minimum":1,"maximum":50}},"required":["gate","criteria"]},"GateRunSummary":{"type":"object","properties":{"gate":{"type":"string","enum":["select","build","test","run","deploy"]},"status":{"type":"string","enum":["passed","failed","skipped"]},"iterations":{"type":"integer","minimum":0}},"required":["gate","status","iterations"]},"RunState":{"type":"object","properties":{"_id":{"type":"string"},"attemptNumber":{"type":"integer","minimum":1},"status":{"type":"string","enum":["pending","queued","processing","paused","done"]},"queuedQueueName":{"type":"string"},"outcome":{"type":"string","enum":["succeeded","failed","finished"]},"result":{"type":"string"},"error":{"type":"string"},"logsUrl":{"type":"string"},"updatedAt":{"type":["string","null"],"format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"durationMs":{"type":"number"},"turns":{"type":"array","items":{"$ref":"#/components/schemas/ConversationTurn"}},"workerVersion":{"type":"string"},"os":{"type":"object","properties":{"platform":{"type":"string"},"release":{"type":"string"},"arch":{"type":"string"}},"required":["platform","release","arch"]},"lastHeartbeatAt":{"type":["string","null"],"format":"date-time"},"worker":{"type":"object","properties":{"instanceId":{"type":"string"},"podName":{"type":"string"}},"required":["instanceId"]},"harUrl":{"type":"string"},"videoUrls":{"type":"array","items":{"type":"string"}},"setupVideoUrls":{"type":"array","items":{"type":"string"}},"tokenUsage":{"$ref":"#/components/schemas/TokenUsage"},"aiCallCount":{"type":"number"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceRunOutcome"}},"mcpRegistered":{"type":"boolean"},"rawChatUrl":{"type":"string"},"rawChatFormat":{"type":"string"},"pausedAt":{"type":["string","null"],"format":"date-time"},"resumedAt":{"type":["string","null"],"format":"date-time"}},"required":["_id","attemptNumber","status"]},"ConversationTurn":{"type":"object","properties":{"iteration":{"type":"number"},"gate":{"type":"string","enum":["select","build","test","run","deploy"]},"codingAgentResponse":{"type":"string"},"judgeFeedback":{"type":"string"},"snapshotUrl":{"type":"string"},"passed":{"type":"boolean"},"timestamp":{"type":["string","null"],"format":"date-time"},"criteriaResults":{"type":"array","items":{"$ref":"#/components/schemas/CriterionResult"}},"harUrl":{"type":"string"},"videoUrls":{"type":"array","items":{"type":"string"}},"tokenUsage":{"$ref":"#/components/schemas/TokenUsage"},"startedAt":{"type":["string","null"],"format":"date-time"},"durationMs":{"type":"number"},"toolCalls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"object","additionalProperties":{}},"response":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","arguments"]}},"toolCallsUrl":{"type":"string"},"toolCallCount":{"type":"number"},"aiCallCount":{"type":"number"},"rawChatUrl":{"type":"string"},"rawChatFormat":{"type":"string"},"chatResultUrl":{"type":"string"},"chatResultFormat":{"type":"string"}},"required":["iteration","judgeFeedback","snapshotUrl","passed","timestamp"]},"CriterionResult":{"type":"object","properties":{"criterionId":{"type":"string"},"passed":{"type":"boolean"},"feedback":{"type":"string"},"evaluated":{"type":"boolean"}},"required":["criterionId","passed","feedback","evaluated"]},"TokenUsage":{"type":"object","properties":{"promptTokens":{"type":"number"},"completionTokens":{"type":"number"},"totalTokens":{"type":"number"}},"required":["promptTokens","completionTokens","totalTokens"]},"ResourceRunOutcome":{"type":"object","properties":{"ref":{"type":"string"},"slug":{"type":"string"},"revisionId":{"type":"string"},"setupSucceeded":{"type":"boolean"},"published":{"type":"array","items":{"type":"string"}},"params":{"type":"object","additionalProperties":{"type":"string"}},"setupDurationMs":{"type":"number"},"error":{"type":"string"},"teardownRan":{"type":"boolean"}},"required":["ref","slug","revisionId","setupSucceeded","published"]},"ResourceBindingSpec":{"anyOf":[{"type":"string"},{"type":"object","properties":{"ref":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}}},"required":["ref"]}]},"CreateRequestInput":{"type":"object","properties":{"scenario":{"$ref":"#/components/schemas/Scenario"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"maxIterations":{"type":"integer","minimum":1,"maximum":50},"personaInstructions":{"type":"string"},"persona":{"$ref":"#/components/schemas/Persona"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"codebaseRevisionId":{"type":"string"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}},"profileId":{"type":"string"},"profileVariations":{"type":"array","items":{"type":"string"}},"priority":{"type":"integer"},"experimentId":{"type":"string","minLength":1},"agentsMd":{"type":"string"},"agentsMdParentIds":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"$ref":"#/components/schemas/GateConfig"}}},"required":["scenario"]},"RunFacetsResponse":{"type":"object","properties":{"total":{"type":"number"},"facets":{"type":"object","properties":{"workerType":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"status":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"outcome":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"model":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"os":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"priority":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"agentVersion":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}},"profileId":{"type":"array","items":{"$ref":"#/components/schemas/RunFacetBucket"}}},"required":["workerType","status","outcome","model","os","priority","agentVersion","profileId"]}},"required":["total","facets"]},"RunFacetBucket":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"PaginatedRunsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RequestResponse"}},"limit":{"type":"number"},"estimatedTotal":{"type":"number"},"cursors":{"$ref":"#/components/schemas/Cursors"}},"required":["data","limit","estimatedTotal","cursors"]},"Cursors":{"type":"object","properties":{"next":{"type":["string","null"]},"prev":{"type":["string","null"]}},"required":["next","prev"]},"PaginatedRunGroupsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RunGroup"}},"limit":{"type":"number"},"estimatedTotal":{"type":"number"},"cursors":{"$ref":"#/components/schemas/Cursors"}},"required":["data","limit","estimatedTotal","cursors"]},"RunGroup":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}},"aggregates":{"$ref":"#/components/schemas/GroupAggregates"},"uniform":{"$ref":"#/components/schemas/GroupUniformValues"}},"required":["key","label","runIds","aggregates","uniform"]},"GroupAggregates":{"type":"object","properties":{"count":{"type":"number"},"turns":{"$ref":"#/components/schemas/AggregateStats"},"duration":{"$ref":"#/components/schemas/AggregateStats"},"promptTokens":{"$ref":"#/components/schemas/AggregateStats"},"completionTokens":{"$ref":"#/components/schemas/AggregateStats"},"statusCounts":{"type":"object","additionalProperties":{"type":"number"}},"outcomeCounts":{"type":"object","additionalProperties":{"type":"number"}}},"required":["count","turns","duration","promptTokens","completionTokens","statusCounts","outcomeCounts"]},"AggregateStats":{"type":["object","null"],"properties":{"min":{"type":"number"},"max":{"type":"number"},"mean":{"type":"number"},"stdDev":{"type":"number"}},"required":["min","max","mean","stdDev"]},"GroupUniformValues":{"type":"object","properties":{"workerType":{"type":"string"},"agentVersion":{"type":"string"},"model":{"type":"string"},"platform":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"codebaseRevisionId":{"type":"string"},"extensions":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["pending","queued","processing","paused","done"]},"submissionId":{"type":"string"},"task":{"type":"string"}}},"BulkResubmitInput":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1},"count":{"type":"integer","minimum":1,"maximum":10,"default":1},"overrides":{"type":"object","properties":{"profileId":{"type":["string","null"]},"workerType":{"type":"string"},"agentVersion":{"type":"string"},"model":{"type":["string","null"]},"reasoningEffort":{"type":["string","null"]},"maxIterations":{"type":["number","null"]},"mcpServers":{"type":["array","null"],"items":{"type":"string"}},"skillRevisions":{"type":["array","null"],"items":{"type":"string"}},"extensions":{"type":["array","null"],"items":{"type":"string"}}}}},"required":["ids"]},"ReportResponse":{"type":"object","properties":{"_id":{"type":"string"},"requestId":{"type":"string"},"templateId":{"type":"string"},"reporter":{"$ref":"#/components/schemas/Reporter"},"content":{"type":"string"},"status":{"type":"string","enum":["pending","generating","completed","failed"]},"error":{"type":"string"},"insightReferences":{"type":"array","items":{"$ref":"#/components/schemas/InsightReference"}},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","requestId","status","createdAt","projectId"]},"Reporter":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"gitHash":{"type":"string"},"model":{"type":"string"},"agentId":{"type":"string"},"agentVersion":{"type":"string"}},"required":["id","name","gitHash","model","agentId","agentVersion"]},"InsightReference":{"type":"object","properties":{"insightId":{"type":"string"},"referencedAt":{"type":["string","null"],"format":"date-time"},"isNew":{"type":"boolean"}},"required":["insightId","referencedAt","isNew"]},"CreateCriteriaInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}}},"required":["id","prompt"]},"CriteriaResponse":{"type":"object","properties":{"id":{"type":"string"},"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["id","prompt","createdAt","projectId"]},"CriteriaGraph":{"type":"object","properties":{"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CriteriaGraphNode"}},"edges":{"type":"array","items":{"$ref":"#/components/schemas/CriteriaGraphEdge"}}},"required":["nodes","edges"]},"CriteriaGraphNode":{"type":"object","properties":{"id":{"type":"string"},"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}}},"required":["id","prompt"]},"CriteriaGraphEdge":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"UpdateCriteriaInput":{"type":"object","properties":{"prompt":{"type":"string"},"dependsOn":{"type":"array","items":{"type":"string"}},"gates":{"type":"array","items":{"type":"string","enum":["select","build","test","run","deploy"]}}}},"CreatePromptFeatureInput":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"prompt":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"}},"required":["id","prompt"]},"PromptType":{"type":"string","enum":["select","build","test","run","deploy","agents.md"]},"PromptFeatureResult":{"type":"object","properties":{"featureId":{"type":"string"},"detected":{"type":"boolean"},"evaluated":{"type":"boolean"}},"required":["featureId","detected","evaluated"]},"SuggestedPromptFeature":{"type":"object","properties":{"suggestedId":{"type":"string"},"behavior":{"type":"string"},"prompt":{"type":"string"}},"required":["suggestedId","behavior","prompt"]},"PromptFeatureResponse":{"type":"object","properties":{"id":{"type":"string"},"prompt":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["id","prompt","createdAt","projectId"]},"UpdatePromptFeatureInput":{"type":"object","properties":{"prompt":{"type":"string"}}},"TaskPromptResponse":{"type":"object","properties":{"_id":{"type":"string"},"keyId":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"},"text":{"type":"string"},"contentBlobUrl":{"type":"string"},"features":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResult"}},"featuresExtractedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","keyId","createdAt","projectId"]},"CreateTaskPromptInput":{"type":"object","properties":{"text":{"type":"string"},"type":{"$ref":"#/components/schemas/PromptType"}},"required":["text"]},"PatchTaskPromptFeatureInput":{"type":"object","properties":{"detected":{"type":"boolean"}},"required":["detected"]},"CreateReportInput":{"type":"object","properties":{"requestId":{"type":"string"},"templateId":{"type":"string"}},"required":["requestId"]},"BulkCreateReportsInput":{"type":"object","properties":{"requestIds":{"type":"array","items":{"type":"string"}},"templateId":{"type":"string"}},"required":["requestIds"]},"BulkReportStatusInput":{"type":"object","properties":{"reportIds":{"type":"array","items":{"type":"string"}}},"required":["reportIds"]},"BulkReportSummaryResponse":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReportSummary"}},"ReportSummary":{"type":"object","properties":{"total":{"type":"number"},"pending":{"type":"number"},"generating":{"type":"number"},"completed":{"type":"number"},"failed":{"type":"number"}},"required":["total","pending","generating","completed","failed"]},"BulkReportSummaryInput":{"type":"object","properties":{"requestIds":{"type":"array","items":{"type":"string"}}},"required":["requestIds"]},"TriggerReportsInput":{"type":"object","properties":{"requestId":{"type":"string"}},"required":["requestId"]},"BulkTriggerReportsInput":{"type":"object","properties":{"requestIds":{"type":"array","items":{"type":"string"}}},"required":["requestIds"]},"InsightResponse":{"type":"object","properties":{"_id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"upvotes":{"type":"number"},"downvotes":{"type":"number"},"blocked":{"type":"boolean"},"referenceCount":{"type":"number"},"createdBy":{"type":"string","enum":["agent","user"]},"sourceReportId":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","title","description","upvotes","downvotes","blocked","referenceCount","createdBy","createdAt","projectId"]},"ProfileWithVersionResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"latestVersion":{"type":"number"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"version":{"$ref":"#/components/schemas/ProfileVersionResponse"},"projectId":{"type":"string"}},"required":["_id","name","latestVersion","createdAt","version","projectId"]},"ProfileVersionResponse":{"type":"object","properties":{"_id":{"type":"string"},"profileId":{"type":"string"},"version":{"type":"number"},"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"agentVersion":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","profileId","version","workerType","model","createdAt","projectId"]},"CreateProfileInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string","maxLength":512},"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"agentVersion":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}}},"required":["name","workerType","model"]},"ProfileResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"latestVersion":{"type":"number"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","name","latestVersion","createdAt","projectId"]},"UpdateProfileIdentity":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":128},"description":{"type":"string","maxLength":512}}},"ReportTemplateResponse":{"type":"object","properties":{"_id":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"userPrompt":{"type":"string"},"systemPrompt":{"$ref":"#/components/schemas/ReportTemplateSystemPrompt"},"trigger":{"$ref":"#/components/schemas/ReportTrigger"},"model":{"type":"string"},"timeoutMs":{"type":"integer","exclusiveMinimum":0},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","id","name","userPrompt","createdAt","projectId"]},"ReportTemplateSystemPrompt":{"type":"object","properties":{"mode":{"type":"string","enum":["append","override"]},"content":{"type":"string"}},"required":["mode","content"]},"ReportTrigger":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["always"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["criteria"]},"criteriaIds":{"type":"array","items":{"type":"string"}},"match":{"type":"string","enum":["any","all"]}},"required":["type","criteriaIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["taskPrompt"]},"taskPromptIds":{"type":"array","items":{"type":"string"}}},"required":["type","taskPromptIds"]},{"type":"object","properties":{"type":{"type":"string","enum":["promptFeature"]},"featureIds":{"type":"array","items":{"type":"string"}},"match":{"type":"string","enum":["any","all"]}},"required":["type","featureIds"]}]},"CreateReportTemplateInput":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"userPrompt":{"type":"string"},"systemPrompt":{"$ref":"#/components/schemas/ReportTemplateSystemPrompt"},"trigger":{"$ref":"#/components/schemas/ReportTrigger"},"model":{"type":"string"},"timeoutMs":{"type":"integer","exclusiveMinimum":0}},"required":["id","name","userPrompt"]},"UpdateReportTemplateInput":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"userPrompt":{"type":"string"},"systemPrompt":{"allOf":[{"$ref":"#/components/schemas/ReportTemplateSystemPrompt"},{"type":["object","null"]}]},"trigger":{"$ref":"#/components/schemas/ReportTrigger"},"model":{"type":["string","null"]},"timeoutMs":{"type":["integer","null"],"exclusiveMinimum":0}}},"AgentResponse":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"modelProvider":{"type":"string"},"supportedModels":{"type":"array","items":{"type":"string"}},"defaultModel":{"type":"string"},"available":{"type":"boolean"},"capabilities":{"$ref":"#/components/schemas/AgentCapabilities"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersion"}},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"}},"required":["_id","name","supportedModels","createdAt"]},"AgentCapabilities":{"type":"object","properties":{"supportsReasoningEffort":{"type":"boolean"},"supportsMcpServers":{"type":"boolean"},"supportsSkills":{"type":"boolean"},"supportsExtensions":{"type":"boolean"},"supportsResources":{"type":"boolean"}}},"AgentVersion":{"type":"object","properties":{"agentVersion":{"type":"string","minLength":1},"workerVersion":{"type":"string","minLength":1},"components":{"type":"object","additionalProperties":{"type":"string"}},"gitCommit":{"type":"string","minLength":1},"buildTime":{"type":"string","minLength":1},"imageTag":{"type":"string","minLength":1},"queueName":{"type":"string"},"status":{"type":"string","enum":["active","retired"]},"createdAt":{"type":["string","null"],"format":"date-time"}},"required":["agentVersion","workerVersion","components","gitCommit","buildTime","imageTag","status","createdAt"]},"CreateAgentInput":{"type":"object","properties":{"_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"description":{"type":"string"},"modelProvider":{"type":"string"},"supportedModels":{"type":"array","items":{"type":"string"}},"defaultModel":{"type":"string"},"available":{"type":"boolean"},"capabilities":{"$ref":"#/components/schemas/AgentCapabilities"}},"required":["_id","name"]},"UpdateAgentInput":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"modelProvider":{"type":"string"},"supportedModels":{"type":"array","items":{"type":"string"}},"defaultModel":{"type":"string"},"available":{"type":"boolean"},"capabilities":{"$ref":"#/components/schemas/AgentCapabilities"}}},"RegisterAgentVersionInput":{"type":"object","properties":{"agentVersion":{"type":"string","minLength":1},"workerVersion":{"type":"string","minLength":1},"components":{"type":"object","additionalProperties":{"type":"string"}},"gitCommit":{"type":"string","minLength":1},"buildTime":{"type":"string","minLength":1},"imageTag":{"type":"string","minLength":1},"queueName":{"type":"string","minLength":1}},"required":["agentVersion","workerVersion","components","gitCommit","buildTime","imageTag","queueName"]},"PatchAgentVersionInput":{"type":"object","properties":{"status":{"type":"string","enum":["active","retired"]}},"required":["status"]},"ModelResponse":{"type":"object","properties":{"_id":{"type":"string"},"modelId":{"type":"string"},"provider":{"type":"string"},"agentId":{"type":"string"},"firstSeenAt":{"type":["string","null"],"format":"date-time"},"lastSeenAt":{"type":["string","null"],"format":"date-time"},"disappearedAt":{"type":["string","null"],"format":"date-time"},"providerAvailableFrom":{"type":["string","null"],"format":"date-time"},"providerEndOfLife":{"type":["string","null"],"format":"date-time"},"metadata":{"type":"object","additionalProperties":{}},"capabilities":{"$ref":"#/components/schemas/ModelCapabilities"}},"required":["_id","modelId","provider","agentId","firstSeenAt","lastSeenAt"]},"ModelCapabilities":{"type":"object","properties":{"reasoningEffort":{"type":"array","items":{"type":"string"}},"toolCalls":{"type":"boolean"},"vision":{"type":"boolean"},"streaming":{"type":"boolean"},"adaptiveThinking":{"type":"boolean"},"maxThinkingBudget":{"type":"number"}}},"McpServerResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["sse","http","stdio"]},"url":{"type":"string"},"command":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"env":{"type":"object","additionalProperties":{"type":"string"}},"headers":{"type":"array","items":{"$ref":"#/components/schemas/McpServerHeader"}},"sessionMode":{"type":"string","enum":["stateful","stateless"]},"version":{"type":"string"},"description":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","name","type","createdAt","projectId"]},"McpServerHeader":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]},"UpdateMcpServerInput":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["sse","http","stdio"]},"url":{"type":"string"},"command":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"env":{"type":"object","additionalProperties":{"type":"string"}},"headers":{"type":"array","items":{"$ref":"#/components/schemas/McpServerHeader"}},"sessionMode":{"type":"string","enum":["stateful","stateless"]},"version":{"type":"string"},"description":{"type":"string"}}},"SkillResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"source":{"type":"string"},"skillName":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["skills-sh","manual"]},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","source","skillName","name","origin","createdAt","projectId"]},"SkillSearchResult":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"source":{"type":"string"},"description":{"type":"string"},"internal":{"type":"boolean"},"installs":{"type":"number"}},"required":["id","name","source","internal"]},"SkillDiscoveryResult":{"type":"object","properties":{"skillName":{"type":"string"},"skillPath":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"existsInLibrary":{"type":"boolean"},"currentRevisionCommitSha":{"type":"string"},"latestUpstreamCommitSha":{"type":"string"},"updateAvailable":{"type":"boolean"},"lastImportedAt":{"type":"string"}},"required":["skillName","skillPath"]},"SkillRevisionResponse":{"type":"object","properties":{"_id":{"type":"string"},"ref":{"type":"string"},"source":{"type":"string"},"skillName":{"type":"string"},"skillPath":{"type":"string"},"commitHash":{"type":"string"},"commitTimestamp":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"description":{"type":"string"},"license":{"type":"string"},"compatibility":{"type":"string"},"allowedTools":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"content":{"type":"string"},"archiveUrl":{"type":"string"},"validationWarnings":{"type":"array","items":{"type":"string"}},"resolvedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","ref","source","skillName","skillPath","commitHash","commitTimestamp","name","description","content","archiveUrl","resolvedAt","createdAt","projectId"]},"CreateSkillInput":{"type":"object","properties":{"source":{"type":"string"},"skillName":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["skills-sh","manual"]}},"required":["source","skillName","name","origin"]},"CodebaseResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"sourceType":{"type":"string","enum":["git","archive"]},"source":{"type":"string"},"defaultBranch":{"type":"string"},"revisionCounter":{"type":"number"},"latestRevisionId":{"type":"string"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","name","sourceType","revisionCounter","createdAt","projectId"]},"UpdateCodebaseInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"defaultBranch":{"type":"string"}}},"CodebaseRevisionResponse":{"type":"object","properties":{"_id":{"type":"string"},"codebaseId":{"type":"string"},"slug":{"type":"string"},"revisionNumber":{"type":"number"},"ref":{"type":"string"},"sourceType":{"type":"string","enum":["git","archive"]},"source":{"type":"string"},"requestedRef":{"type":"string"},"resolvedCommitSha":{"type":"string"},"commitTimestamp":{"type":["string","null"],"format":"date-time"},"originalFilename":{"type":"string"},"contentSha256":{"type":"string"},"archiveUrl":{"type":"string"},"sizeBytes":{"type":"number"},"fileCount":{"type":"number"},"creator":{"type":"string"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"deduplicated":{"type":"boolean"},"projectId":{"type":"string"}},"required":["_id","codebaseId","slug","revisionNumber","ref","sourceType","archiveUrl","resolvedAt","createdAt","projectId"]},"ResolveCodebaseRevisionInput":{"type":"object","properties":{"requestedRef":{"type":"string"},"creator":{"type":"string"}}},"ResourceResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"revisionCounter":{"type":"number"},"latestRevisionId":{"type":"string"},"latestRevisionNumber":{"type":"number"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","name","revisionCounter","createdAt","projectId"]},"CreateResourceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"description":{"type":"string"},"setup":{"$ref":"#/components/schemas/ResourceScript"},"teardown":{"$ref":"#/components/schemas/ResourceScript"},"exports":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"}},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ResourceParameter"}},"creator":{"type":"string"}},"required":["name","setup"]},"ResourceScript":{"type":"object","properties":{"sh":{"type":"string","minLength":1}}},"ResourceParameter":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"description":{"type":"string"},"required":{"type":"boolean","default":false},"default":{"type":"string"},"example":{"type":"string"}},"required":["name"]},"UpdateResourceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"}}},"ResourceRevisionResponse":{"type":"object","properties":{"_id":{"type":"string"},"resourceId":{"type":"string"},"slug":{"type":"string"},"revisionNumber":{"type":"number"},"ref":{"type":"string"},"setup":{"$ref":"#/components/schemas/ResourceScript"},"teardown":{"$ref":"#/components/schemas/ResourceScript"},"exports":{"type":"array","items":{"type":"string"}},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ResourceParameter"}},"contentSha256":{"type":"string"},"creator":{"type":"string"},"createdAt":{"type":["string","null"],"format":"date-time"},"deduplicated":{"type":"boolean"},"projectId":{"type":"string"}},"required":["_id","resourceId","slug","revisionNumber","ref","setup","exports","contentSha256","createdAt","projectId"]},"CreateResourceRevisionInput":{"type":"object","properties":{"setup":{"$ref":"#/components/schemas/ResourceScript"},"teardown":{"$ref":"#/components/schemas/ResourceScript"},"exports":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"}},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ResourceParameter"}},"creator":{"type":"string"}},"required":["setup"]},"ExtensionResponse":{"type":"object","properties":{"_id":{"type":"string"},"slug":{"type":"string"},"publisher":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["marketplace","manual"]},"createdAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"deletedAt":{"type":["string","null"],"format":"date-time"},"projectId":{"type":"string"}},"required":["_id","slug","publisher","name","origin","createdAt","projectId"]},"ExtensionSearchResult":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"publisher":{"type":"string"},"description":{"type":"string"},"internal":{"type":"boolean"},"version":{"type":"string"}},"required":["id","name","publisher","internal"]},"CreateExtensionInput":{"type":"object","properties":{"_id":{"type":"string","pattern":"^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+$"},"publisher":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"origin":{"type":"string","enum":["marketplace","manual"]}},"required":["_id","publisher","name","origin"]},"UpdateExtensionInput":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}}},"ExtensionVersionInfo":{"type":"object","properties":{"version":{"type":"string"},"preRelease":{"type":"boolean"},"lastUpdated":{"type":"string"}},"required":["version","preRelease","lastUpdated"]},"CreateInsightInput":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"createdBy":{"type":"string","enum":["agent","user"]},"sourceReportId":{"type":"string"}},"required":["title","description"]},"UpdateInsightInput":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"FeatureFlagResponse":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"enabled":{"type":"boolean"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"required":["key","label","enabled","updatedAt"]},"UpdateFeatureFlagInput":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}},"parameters":{}},"paths":{"/api/v1/keys/preview":{"post":{"tags":["Keys"],"summary":"Preview key","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInput"}}}},"responses":{"200":{"description":"Key preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}}},"/api/v1/keys":{"post":{"tags":["Keys"],"summary":"Create key","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInput"}}}},"responses":{"201":{"description":"Key created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}},"get":{"tags":["Keys"],"summary":"List keys","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KeyResponse"}}}}}}}},"/api/v1/keys/{id}":{"get":{"tags":["Keys"],"summary":"Get key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}},"put":{"tags":["Keys"],"summary":"Update key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInput"}}}},"responses":{"200":{"description":"Key updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyResponse"}}}}}},"delete":{"tags":["Keys"],"summary":"Delete key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Key deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/api/v1/keys/{id}/validate":{"post":{"tags":["Keys"],"summary":"Validate key","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateKeyInput"}}}},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"Key validation result"}}}}}}},"/api/v1/accounts":{"post":{"tags":["Accounts"],"summary":"Create account","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInput"}}}},"responses":{"201":{"description":"Account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}}}},"get":{"tags":["Accounts"],"summary":"List accounts","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountResponse"}}}}}}}},"/api/v1/accounts/{id}":{"get":{"tags":["Accounts"],"summary":"Get account","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}}}},"put":{"tags":["Accounts"],"summary":"Update account","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInput"}}}},"responses":{"200":{"description":"Account updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}}}},"delete":{"tags":["Accounts"],"summary":"Delete account","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Account deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}},"/api/v1/users/me":{"get":{"tags":["Users"],"summary":"Get the authenticated user's identity","description":"Read the existing authenticated Scope identity without enrollment or profile writes. Responses must not be HTTP-cached.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMeResponse"}}}},"401":{"description":"Not authenticated"},"403":{"description":"User is not enrolled or is disabled"},"503":{"description":"Authentication service unavailable"}}},"post":{"tags":["Users"],"summary":"Enroll the authenticated user","description":"JIT-enroll the authenticated user, refresh their profile and lastLoginAt, apply bootstrap-admin rules, and warm the access cache. Use this only after an explicit IdP login; do not prefetch, poll, or automatically retry transient failures.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMeResponse"}}}},"401":{"description":"Not authenticated"},"403":{"description":"User is disabled"},"503":{"description":"Authentication service unavailable"}}}},"/health":{"get":{"tags":["Health"],"summary":"Liveness probe","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"version":{"type":"string"}},"required":["status","version"]}}}}}}},"/ready":{"get":{"tags":["Health"],"summary":"Readiness probe","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"migrations":{}},"required":["status"]}}}},"503":{"description":"Service is not ready"}}}},"/about":{"get":{"tags":["System"],"summary":"API metadata","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"buildTime":{"type":"string"},"environment":{"type":"string"},"description":{"type":"string"},"workers":{"type":"array","items":{"type":"string"}}},"required":["name","version","buildTime","environment","description","workers"]}}}}}}},"/api/v1/version":{"get":{"tags":["System"],"summary":"Version info","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"commit":{"type":"string"},"buildTime":{"type":"string"},"environment":{"type":"string"},"strictAgentCapabilities":{"type":"boolean"}},"required":["commit","buildTime","environment","strictAgentCapabilities"]}}}}}}},"/api/v1/projects":{"get":{"tags":["Projects"],"summary":"List all projects","parameters":[{"schema":{"type":"string","enum":["true","false"],"description":"When true, include soft-deleted projects in the result"},"required":false,"description":"When true, include soft-deleted projects in the result","name":"includeDeleted","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectResponse"}}}}}}},"post":{"tags":["Projects"],"summary":"Create a project","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"400":{"description":"Invalid input"}}}},"/api/v1/projects/{id}":{"get":{"tags":["Projects"],"summary":"Get a project","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"404":{"description":"Project not found"}}},"patch":{"tags":["Projects"],"summary":"Update a project","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"404":{"description":"Project not found"}}},"delete":{"tags":["Projects"],"summary":"Soft-delete a project","responses":{"204":{"description":"Success"},"404":{"description":"Project not found"}}}},"/api/v1/projects/{id}/restore":{"post":{"tags":["Projects"],"summary":"Restore a soft-deleted project","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectResponse"}}}},"404":{"description":"Project not found"}}}},"/api/v1/requests":{"post":{"tags":["Requests"],"summary":"Submit request(s)","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateRequestInput"},{"type":"object","properties":{"count":{"type":"number","minimum":1,"maximum":10,"default":1},"skills":{"type":"array","items":{"type":"string"}},"agentVersion":{"type":"string"},"codebase":{"type":"string"}}}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RequestResponse"},{"type":"array","items":{"$ref":"#/components/schemas/RequestResponse"}}]}}}}}},"get":{"tags":["Requests"],"summary":"List requests","parameters":[{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"worker","in":"query"},{"schema":{"type":"string"},"required":false,"name":"taskPromptId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"criteria","in":"query"},{"schema":{"type":"string"},"required":false,"name":"submissionId","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"experimentId","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"profileId","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"status","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"outcome","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"model","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"os","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"priority","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"agentVersion","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["task","submissionId","profile","experiment"]},"required":false,"name":"groupBy","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"last","in":"query"},{"schema":{"type":"string","enum":["created","updated","priority","worker","status","id","duration","createdAt"]},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"sortDir","in":"query"},{"schema":{"type":["string","null"],"format":"date-time"},"required":false,"name":"createdAfter","in":"query"},{"schema":{"type":["string","null"],"format":"date-time"},"required":false,"name":"createdBefore","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"turns","in":"query"},{"schema":{"type":"string","enum":["eq","gte","lte"]},"required":false,"name":"turnsOp","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"maxIterations","in":"query"},{"schema":{"type":"string","enum":["eq","gte","lte"]},"required":false,"name":"maxIterationsOp","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PaginatedRunsResponse"},{"$ref":"#/components/schemas/PaginatedRunGroupsResponse"}]}}}}}}},"/api/v1/requests/facets":{"get":{"tags":["Requests"],"summary":"List run filter facets","description":"Returns every distinct value and its full-dataset count per categorical filter dimension for the Runs list rail. Counts are absolute over all non-deleted runs **in the given project**: they intentionally ignore the active search, date range, iteration, and categorical selections so every selectable value stays visible with a stable count. Requires ?projectId=. Computed with parallel $group aggregations (Cosmos has no $facet) and cached per-project for a short TTL.","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunFacetsResponse"}}}}}}},"/api/v1/requests/{id}":{"get":{"tags":["Requests"],"summary":"Get request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestResponse"}}}},"404":{"description":"Not found"}}},"delete":{"tags":["Requests"],"summary":"Soft-delete request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Not found"}}}},"/api/v1/analysis":{"get":{"tags":["Requests"],"summary":"Compute pass@k / success@T metrics","description":"Aggregates pass@k / success@T metrics over a single project's done runs. Requires ?projectId=.","parameters":[{"schema":{"type":"string"},"required":false,"name":"worker","in":"query"},{"schema":{"type":"string"},"required":false,"name":"taskPromptId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"criteria","in":"query"},{"schema":{"type":"string"},"required":false,"name":"features","in":"query"},{"schema":{"type":"string"},"required":false,"name":"submissionId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"k","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"Analysis metrics"}}}}}}},"/api/v1/requests/bulk-resubmit":{"post":{"tags":["Requests"],"summary":"Bulk resubmit requests","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkResubmitInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RequestResponse"}}}}}}}},"/api/v1/requests/bulk":{"delete":{"tags":["Requests"],"summary":"Bulk soft-delete requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"number"}},"required":["deleted"]}}}}}}},"/api/v1/requests/archive":{"post":{"tags":["Requests"],"summary":"Download batch archive of multiple runs","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Gzipped batch archive containing individual run archives"},"400":{"description":"Invalid input"},"404":{"description":"One or more runs not found"}}}},"/api/v1/runs/upload":{"post":{"tags":["Requests"],"summary":"Import run archive","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"201":{"description":"Success"}}}},"/api/v1/runs/upload-batch":{"post":{"tags":["Requests"],"summary":"Import batch run archive","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"207":{"description":"Multi-status: 201 if all runs imported, 400 if none imported, 207 if partial"},"400":{"description":"No archive uploaded, empty archive, or all runs failed"}}}},"/api/v1/requests/{id}/reports":{"get":{"tags":["Reports"],"summary":"Get reports for request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"404":{"description":"Run not found"}}}},"/api/v1/requests/{id}/runs":{"get":{"tags":["Requests"],"summary":"List attempts for a request","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RunState"}}}}},"404":{"description":"Request not found"}}}},"/api/v1/requests/{id}/runs/{runId}":{"get":{"tags":["Requests"],"summary":"Get a single attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunState"}}}},"404":{"description":"Request or run not found"}}}},"/api/v1/requests/bulk-retry":{"post":{"tags":["Requests"],"summary":"Bulk retry requests (start new attempts)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1},"force":{"type":"boolean"}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"retried":{"type":"integer"},"skipped":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"requestId":{"type":"string"},"runId":{"type":"string"},"attemptNumber":{"type":"integer"},"error":{"type":"string"}},"required":["requestId"]}}},"required":["retried","skipped","results"]}}}}}}},"/api/v1/requests/{id}/retry":{"post":{"tags":["Requests"],"summary":"Retry a request (start a new attempt)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"runId":{"type":"string"},"attemptNumber":{"type":"integer"}},"required":["requestId","runId","attemptNumber"]}}}},"404":{"description":"Request not found"},"409":{"description":"Conflict — request is not in a retryable state, or a concurrent retry won the race"},"422":{"description":"Cannot retry — current run not yet terminal"}}}},"/api/v1/requests/{id}/priority":{"post":{"tags":["Requests"],"summary":"Set priority on a single request","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"priority":{"type":"integer"}},"required":["priority"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"priority":{"type":"number"}},"required":["id","priority"]}}}}}}},"/api/v1/requests/bulk-priority":{"post":{"tags":["Requests"],"summary":"Set priority on multiple requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"priority":{"type":"integer"}},"required":["ids","priority"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]}}}}}}},"/api/v1/requests/{id}/pause":{"post":{"tags":["Requests"],"summary":"Pause a single request","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"]}}}}}}},"/api/v1/requests/{id}/resume":{"post":{"tags":["Requests"],"summary":"Resume a paused request","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"]}}}}}}},"/api/v1/requests/bulk-pause":{"post":{"tags":["Requests"],"summary":"Pause multiple requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]}}}}}}},"/api/v1/requests/bulk-resume":{"post":{"tags":["Requests"],"summary":"Resume multiple paused requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]}}}}}}},"/api/v1/requests/{id}/cancel":{"post":{"tags":["Requests"],"summary":"Cancel a request (marks as done/failed and signals worker to exit)","responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"previousStatus":{"type":"string"},"status":{"type":"string"},"outcome":{"type":"string"}},"required":["id","previousStatus","status","outcome"]}}}}}}},"/api/v1/requests/bulk-cancel":{"post":{"tags":["Requests"],"summary":"Cancel multiple requests","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"number"},"skipped":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"cancelled":{"type":"boolean"},"previousStatus":{"type":"string"},"error":{"type":"string"}},"required":["id","cancelled"]}}},"required":["cancelled","skipped","results"]}}}}}}},"/api/v1/requests/{id}/logs":{"get":{"tags":["Requests"],"summary":"Stream request logs (SSE)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Server-sent event stream of log entries"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/logs":{"get":{"tags":["Requests"],"summary":"Stream logs for a specific attempt (SSE)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Server-sent event stream of log entries"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/har":{"get":{"tags":["Requests"],"summary":"Download HAR file","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"HAR-format JSON file"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/har":{"get":{"tags":["Requests"],"summary":"Download HAR file for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"HAR-format JSON file"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/atif":{"get":{"tags":["Requests"],"summary":"Download ATIF trajectory file for a specific iteration","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The iteration number (1-based)"},"required":true,"description":"The iteration number (1-based)","name":"iteration","in":"query"}],"responses":{"200":{"description":"ATIF v1.7 trajectory JSON file"},"400":{"description":"Missing or invalid iteration"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/atif":{"get":{"tags":["Requests"],"summary":"Download ATIF trajectory file for a specific attempt and iteration","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string","description":"The iteration number (1-based)"},"required":true,"description":"The iteration number (1-based)","name":"iteration","in":"query"}],"responses":{"200":{"description":"ATIF v1.7 trajectory JSON file"},"400":{"description":"Missing or invalid iteration"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/video":{"get":{"tags":["Requests"],"summary":"Download session recording","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"WebM video recording (supports Range requests)"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/video":{"get":{"tags":["Requests"],"summary":"Download session recording for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"WebM video recording (supports Range requests)"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/tool-calls":{"get":{"tags":["Requests"],"summary":"Download per-iteration tool-calls JSONL","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"JSONL stream — one ToolCall per line"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/tool-calls":{"get":{"tags":["Requests"],"summary":"Download per-iteration tool-calls JSONL for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"JSONL stream — one ToolCall per line"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/snapshots/{iteration}":{"get":{"tags":["Requests"],"summary":"Download iteration snapshot","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"iteration","in":"path"}],"responses":{"200":{"description":"Gzipped snapshot archive"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/snapshots/{iteration}":{"get":{"tags":["Requests"],"summary":"Download iteration snapshot for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"iteration","in":"path"}],"responses":{"200":{"description":"Gzipped snapshot archive"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/archive":{"get":{"tags":["Requests"],"summary":"Download full run archive","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Gzipped run archive"},"404":{"description":"Not found"}}}},"/api/v1/requests/{id}/runs/{runId}/archive":{"get":{"tags":["Requests"],"summary":"Download full run archive for a specific attempt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Gzipped run archive"},"404":{"description":"Not found"}}}},"/api/v1/criteria/generate-prompt":{"post":{"tags":["Criteria"],"summary":"Generate criterion prompt from behavior","parameters":[{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","example":"00000000-0000-0000-0000-000000000000"},"required":false,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"behavior":{"type":"string"},"currentId":{"type":"string"},"gates":{"type":"array","items":{"type":"string"}}},"required":["behavior"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"suggestedId":{"type":"string"},"suggestedParents":{"type":"array","items":{"type":"string"}},"suggestedChildren":{"type":"array","items":{"type":"string"}}},"required":["prompt","suggestedId","suggestedParents","suggestedChildren"]}}}},"400":{"description":"Empty behavior string"},"503":{"description":"LLM not configured"}}}},"/api/v1/criteria/seed":{"post":{"tags":["Criteria"],"summary":"Seed criteria in bulk","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"criteria":{"type":"array","items":{"$ref":"#/components/schemas/CreateCriteriaInput"}}},"required":["criteria"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"seeded":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["seeded","errors"]}}}},"400":{"description":"Seed batch would introduce a dependency cycle"}}}},"/api/v1/criteria":{"get":{"tags":["Criteria"],"summary":"List criteria","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","description":"Comma-separated criterion IDs to include"},"required":false,"description":"Comma-separated criterion IDs to include","name":"ids","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"When true and ids is set, also include dependency ancestors"},"required":false,"description":"When true and ids is set, also include dependency ancestors","name":"ancestors","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CriteriaResponse"}}}}}}},"post":{"tags":["Criteria"],"summary":"Create criterion","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCriteriaInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaResponse"}}}},"409":{"description":"Criterion already exists"}}}},"/api/v1/criteria/mdp":{"get":{"tags":["Criteria"],"summary":"Compute MDP transitions","parameters":[{"schema":{"type":"string"},"required":false,"name":"criteria","in":"query"},{"schema":{"type":"string"},"required":false,"name":"features","in":"query"},{"schema":{"type":"string"},"required":false,"name":"since","in":"query"},{"schema":{"type":"string"},"required":false,"name":"worker","in":"query"},{"schema":{"type":"string"},"required":false,"name":"taskPromptId","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{}}}}}}}},"/api/v1/criteria/graph":{"get":{"tags":["Criteria"],"summary":"Get criteria DAG","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaGraph"}}}}}}},"/api/v1/criteria/{id}":{"get":{"tags":["Criteria"],"summary":"Get criterion","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaResponse"}}}},"404":{"description":"Criterion not found"}}},"put":{"tags":["Criteria"],"summary":"Update criterion","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCriteriaInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriteriaResponse"}}}},"400":{"description":"Invalid dependency reference or self-reference"},"404":{"description":"Criterion not found"}}},"delete":{"tags":["Criteria"],"summary":"Soft-delete criterion","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}},"404":{"description":"Criterion not found"},"409":{"description":"Criterion has dependents"}}}},"/api/v1/prompt-features/generate-prompt":{"post":{"tags":["Prompt Features"],"summary":"Generate prompt feature from behavior","parameters":[{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","example":"00000000-0000-0000-0000-000000000000"},"required":false,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"behavior":{"type":"string"},"currentId":{"type":"string"}},"required":["behavior"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"}},"required":["prompt"]}}}},"400":{"description":"Empty behavior string"},"503":{"description":"LLM not configured"}}}},"/api/v1/prompt-features/seed":{"post":{"tags":["Prompt Features"],"summary":"Seed prompt features in bulk","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"features":{"type":"array","items":{"$ref":"#/components/schemas/CreatePromptFeatureInput"}}},"required":["features"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"seeded":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["seeded","errors"]}}}}}}},"/api/v1/prompt-features/extract-from-text":{"post":{"tags":["Prompt Features"],"summary":"Extract features from text","parameters":[{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","example":"00000000-0000-0000-0000-000000000000"},"required":false,"description":"Optional project scope. When provided, a slug/id is resolved within that project (slugs may repeat across projects); when omitted, resolution falls back to a legacy global lookup for backward compatibility.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"model":{"type":"string"},"type":{"type":"string","enum":["select","agents.md"]}},"required":["text"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"features":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResult"}},"suggestedFeatures":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedPromptFeature"}},"cached":{"type":"boolean"}},"required":["features","cached"]}}}},"400":{"description":"Empty text string"},"503":{"description":"LLM not configured"}}}},"/api/v1/prompt-features":{"get":{"tags":["Prompt Features"],"summary":"List features","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","enum":["select","agents.md"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}}}}},"post":{"tags":["Prompt Features"],"summary":"Create feature","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromptFeatureInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}},"400":{"description":"Invalid input"},"409":{"description":"Feature already exists"}}}},"/api/v1/prompt-features/{id}":{"get":{"tags":["Prompt Features"],"summary":"Get feature","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}},"404":{"description":"Feature not found"}}},"put":{"tags":["Prompt Features"],"summary":"Update feature","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePromptFeatureInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptFeatureResponse"}}}},"400":{"description":"Invalid input"},"404":{"description":"Feature not found"}}},"delete":{"tags":["Prompt Features"],"summary":"Soft-delete feature","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}}}},"404":{"description":"Feature not found"}}}},"/api/v1/task-prompts/generate":{"post":{"tags":["Task Prompts"],"summary":"Generate task prompts","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"existingPrompt":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"type":"string"}}},"required":["tasks"]}}}},"503":{"description":"LLM not configured"}}}},"/api/v1/task-prompts":{"get":{"tags":["Task Prompts"],"summary":"List task prompts","parameters":[{"schema":{"type":["number","null"]},"required":false,"name":"limit","in":"query"},{"schema":{"type":["number","null"]},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"$ref":"#/components/schemas/PromptType"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TaskPromptResponse"}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["items","total","limit","offset"]}}}}}},"post":{"tags":["Task Prompts"],"summary":"Create or find task prompt","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskPromptInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPromptResponse"}}}},"400":{"description":"Empty text string"}}}},"/api/v1/task-prompts/{id}":{"get":{"tags":["Task Prompts"],"summary":"Get task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPromptResponse"}}}},"404":{"description":"Task prompt not found"}}},"delete":{"tags":["Task Prompts"],"summary":"Soft-delete task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}},"404":{"description":"Task prompt not found"}}}},"/api/v1/task-prompts/{id}/content":{"get":{"tags":["Task Prompts"],"summary":"Get resolved task prompt content","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}}}},"404":{"description":"Task prompt not found"}}}},"/api/v1/task-prompts/{id}/extract-features":{"post":{"tags":["Task Prompts"],"summary":"Extract features from task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"force","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"taskPromptId":{"type":"string"},"features":{"type":"array","items":{"$ref":"#/components/schemas/PromptFeatureResult"}},"featuresExtractedAt":{"type":["string","null"],"format":"date-time"},"suggestedFeatures":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedPromptFeature"}},"cached":{"type":"boolean"}},"required":["taskPromptId","features","cached"]}}}},"404":{"description":"Task prompt not found"},"503":{"description":"LLM not configured"}}}},"/api/v1/task-prompts/{id}/features/{featureId}":{"patch":{"tags":["Task Prompts"],"summary":"Toggle feature flag on task prompt","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"featureId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchTaskPromptFeatureInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPromptResponse"}}}},"400":{"description":"Invalid detected value"},"404":{"description":"Task prompt or feature not found"}}}},"/api/v1/reports":{"post":{"tags":["Reports"],"summary":"Create report","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"400":{"description":"Invalid input"},"404":{"description":"Run or template not found"}}},"get":{"tags":["Reports"],"summary":"List reports","parameters":[{"schema":{"type":"string"},"required":false,"name":"requestId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}}}}},"/api/v1/reports/bulk-create":{"post":{"tags":["Reports"],"summary":"Bulk create reports","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateReportsInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/bulk-status":{"post":{"tags":["Reports"],"summary":"Bulk get report statuses","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportStatusInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/bulk-summary":{"post":{"tags":["Reports"],"summary":"Bulk get report summary per run","description":"Returns aggregated report status counts per run. Only the latest report per template is counted (re-triggers are deduplicated).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportSummaryInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportSummaryResponse"}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/{id}":{"get":{"tags":["Reports"],"summary":"Get report","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"404":{"description":"Report not found"}}}},"/api/v1/reports/{id}/logs":{"get":{"tags":["Reports"],"summary":"Stream report logs (SSE)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Server-sent event stream of log entries"},"404":{"description":"Report not found"}}}},"/api/v1/reports/trigger":{"post":{"tags":["Reports"],"summary":"Trigger reports","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerReportsInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"triggered":{"type":"number"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}},"required":["triggered","reports"]}}}},"400":{"description":"Invalid input"},"404":{"description":"Run not found"}}}},"/api/v1/reports/bulk-trigger":{"post":{"tags":["Reports"],"summary":"Bulk trigger reports","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTriggerReportsInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}}}},"400":{"description":"Invalid input"}}}},"/api/v1/reports/{id}/insights":{"get":{"tags":["Reports"],"summary":"Get insights for report","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/InsightResponse"},{"type":"object","properties":{"referencedAt":{"type":["string","null"],"format":"date-time"},"isNew":{"type":"boolean"}}}]}}}}},"404":{"description":"Report not found"}}},"post":{"tags":["Reports"],"summary":"Link insight to report","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"insightId":{"type":"string"},"isNew":{"type":"boolean"}},"required":["insightId"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"insightId":{"type":"string"},"referencedAt":{"type":["string","null"],"format":"date-time"},"isNew":{"type":"boolean"}},"required":["insightId","referencedAt","isNew"]}}}},"404":{"description":"Report or insight not found"},"409":{"description":"Insight already referenced by this report"}}}},"/api/v1/profiles":{"post":{"tags":["Profiles"],"summary":"Create a new profile","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProfileInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileWithVersionResponse"}}}}}},"get":{"tags":["Profiles"],"summary":"List profiles","parameters":[{"schema":{"type":"string"},"required":false,"name":"workerType","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfileWithVersionResponse"}}}}}}}},"/api/v1/profiles/{profileId}":{"get":{"tags":["Profiles"],"summary":"Get profile with latest version","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileWithVersionResponse"}}}}}},"post":{"tags":["Profiles"],"summary":"Create new profile version","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workerType":{"type":"string"},"model":{"type":"string"},"reasoningEffort":{"type":"string"},"agentVersion":{"type":"string"},"mcpServers":{"type":"array","items":{"type":"string"}},"skillRevisions":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ResourceBindingSpec"}},"extensions":{"type":"array","items":{"type":"string"}}},"required":["workerType","model"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileVersionResponse"}}}}}},"put":{"tags":["Profiles"],"summary":"Update profile identity","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileIdentity"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}}}},"delete":{"tags":["Profiles"],"summary":"Delete profile","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/api/v1/profiles/{profileId}/versions":{"get":{"tags":["Profiles"],"summary":"List profile versions","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfileVersionResponse"}}}}}}}},"/api/v1/profiles/{profileId}/versions/{version}":{"get":{"tags":["Profiles"],"summary":"Get profile version","parameters":[{"schema":{"type":"string"},"required":true,"name":"profileId","in":"path"},{"schema":{"type":["number","null"]},"required":false,"name":"version","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileVersionResponse"}}}}}}},"/api/v1/report-templates/default-system-prompt":{"get":{"tags":["Report Templates"],"summary":"Get default system prompt","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}}}}}}},"/api/v1/report-templates/available-models":{"get":{"tags":["Report Templates"],"summary":"List models available for report generation","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string"}},"required":["modelId"]}}}}}}}},"/api/v1/report-templates":{"get":{"tags":["Report Templates"],"summary":"List report templates","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}}}}},"post":{"tags":["Report Templates"],"summary":"Create report template","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportTemplateInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}},"409":{"description":"Report template already exists"}}}},"/api/v1/report-templates/{id}":{"get":{"tags":["Report Templates"],"summary":"Get report template","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}},"404":{"description":"Report template not found"}}},"put":{"tags":["Report Templates"],"summary":"Update report template","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportTemplateInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportTemplateResponse"}}}},"404":{"description":"Report template not found"}}},"delete":{"tags":["Report Templates"],"summary":"Delete report template","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Report template not found"}}}},"/api/v1/agents":{"get":{"tags":["Agents"],"summary":"List agents","parameters":[{"schema":{"type":"string"},"required":false,"name":"modelProvider","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeDeleted","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentResponse"}}}}}}},"post":{"tags":["Agents"],"summary":"Create or update agent (upsert)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"400":{"description":"Validation error"},"409":{"description":"Restored agent versions conflict with an active queue owner"}}}},"/api/v1/agents/{id}":{"get":{"tags":["Agents"],"summary":"Get agent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"includeDeleted","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"404":{"description":"Agent not found"}}},"put":{"tags":["Agents"],"summary":"Update agent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"400":{"description":"Validation error"},"404":{"description":"Agent not found"}}},"delete":{"tags":["Agents"],"summary":"Delete agent","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Agent not found"}}}},"/api/v1/agents/{id}/versions":{"get":{"tags":["Agents"],"summary":"List agent versions","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersion"}}}}},"404":{"description":"Agent not found"}}},"post":{"tags":["Agents"],"summary":"Register agent version (upsert)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAgentVersionInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersion"}}}},"400":{"description":"Validation error"},"404":{"description":"Agent not found"},"409":{"description":"Queue is assigned to another agent"},"503":{"description":"Concurrent registration did not stabilize"}}}},"/api/v1/agents/{id}/versions/{agentVersion}":{"patch":{"tags":["Agents"],"summary":"Patch agent version","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"agentVersion","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchAgentVersionInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersion"}}}},"400":{"description":"Invalid status value"},"404":{"description":"Agent or version not found"},"409":{"description":"Queue is assigned to another agent"},"503":{"description":"Concurrent activation did not stabilize"}}}},"/api/v1/models":{"get":{"tags":["Models"],"summary":"List models","parameters":[{"schema":{"type":"string"},"required":false,"name":"agentId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"provider","in":"query"},{"schema":{"type":"string","enum":["active","disappeared"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelResponse"}}}}}}}},"/api/v1/models/{id}":{"get":{"tags":["Models"],"summary":"Get model","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelResponse"}}}}}}},"/api/v1/models/sync":{"post":{"tags":["Models"],"summary":"Sync models from provider","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string"},"provider":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"providerAvailableFrom":{"type":"string"},"providerEndOfLife":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"capabilities":{"type":"object","properties":{"reasoningEffort":{"type":"array","items":{"type":"string"}},"toolCalls":{"type":"boolean"},"vision":{"type":"boolean"},"streaming":{"type":"boolean"},"adaptiveThinking":{"type":"boolean"},"maxThinkingBudget":{"type":"number"}}}},"required":["id"]}},"scannedAt":{"type":"string"}},"required":["agentId","provider","models","scannedAt"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}},"unchanged":{"type":"array","items":{"type":"string"}}},"required":["added","removed","unchanged"]}}}}}}},"/api/v1/mcp/servers":{"get":{"tags":["MCP Servers"],"summary":"List MCP servers","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/McpServerResponse"}}}}}}},"post":{"tags":["MCP Servers"],"summary":"Create MCP server","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string","pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?$"},"name":{"type":"string"},"type":{"type":"string","enum":["sse","http","stdio"]},"url":{"type":"string"},"command":{"type":"string"},"args":{"type":"array","items":{"type":"string"}},"env":{"type":"object","additionalProperties":{"type":"string"}},"headers":{"type":"array","items":{"$ref":"#/components/schemas/McpServerHeader"}},"sessionMode":{"type":"string","enum":["stateful","stateless"]},"version":{"type":"string"},"description":{"type":"string"}},"required":["_id","name","type"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}}}}}},"/api/v1/mcp/servers/{id}":{"get":{"tags":["MCP Servers"],"summary":"Get MCP server","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}}}}},"put":{"tags":["MCP Servers"],"summary":"Update MCP server","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMcpServerInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerResponse"}}}}}},"delete":{"tags":["MCP Servers"],"summary":"Delete MCP server","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/api/v1/skills":{"get":{"tags":["Skills"],"summary":"List all skills","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillResponse"}}}}}}},"post":{"tags":["Skills"],"summary":"Create or import a skill","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSkillInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillResponse"}}}}}}},"/api/v1/skills/search":{"get":{"tags":["Skills"],"summary":"Search skills (internal + external)","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillSearchResult"}}}}},"400":{"description":"Missing query parameter"}}}},"/api/v1/skills/search/external":{"get":{"tags":["Skills"],"summary":"Search external skills registry","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Optional project scope. When provided, external results are de-duplicated only against skills already installed in that project."},"required":false,"description":"Optional project scope. When provided, external results are de-duplicated only against skills already installed in that project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillSearchResult"}}}}},"400":{"description":"Missing query parameter"}}}},"/api/v1/skills/discover":{"get":{"tags":["Skills"],"summary":"Discover skills in a GitHub repository","parameters":[{"schema":{"type":"string"},"required":true,"name":"source","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillDiscoveryResult"}}}}},"400":{"description":"Missing or malformed source parameter"},"404":{"description":"Repository not found"},"502":{"description":"GitHub API error"}}}},"/api/v1/skills/{id}(*)/revisions":{"get":{"tags":["Skills"],"summary":"List skill revisions","parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}}},"404":{"description":"Skill not found"}}}},"/api/v1/skills/{id}(*)":{"get":{"tags":["Skills"],"summary":"Get skill by slug","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillResponse"}}}},"404":{"description":"Skill not found"}}},"delete":{"tags":["Skills"],"summary":"Soft-delete a skill","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success"},"404":{"description":"Skill not found"}}}},"/api/v1/skill-revisions/by-ref/{ref}(*)/archive":{"get":{"tags":["Skill Revisions"],"summary":"Download skill revision archive","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Binary tar.gz archive"},"404":{"description":"Skill revision or archive not found"},"500":{"description":"Blob storage error"}}}},"/api/v1/skill-revisions/by-ref/{ref}(*)":{"get":{"tags":["Skill Revisions"],"summary":"Get skill revision by ref","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}},"404":{"description":"Skill revision not found"}}}},"/api/v1/skill-revisions/{id}":{"get":{"tags":["Skill Revisions"],"summary":"Get skill revision by ID","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}},"404":{"description":"Skill revision not found"}}}},"/api/v1/skills/{id}(*)/resolve":{"post":{"tags":["Skills"],"summary":"Trigger skill resolution","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRevisionResponse"}}}},"404":{"description":"Skill not found"},"500":{"description":"Blob storage error"}}}},"/api/v1/codebases":{"get":{"tags":["Codebases"],"summary":"List all codebases","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodebaseResponse"}}}}}}},"post":{"tags":["Codebases"],"summary":"Create a codebase (archive codebases require the archive file)","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"201":{"description":"Success"},"400":{"description":"Invalid input or missing archive"}}}},"/api/v1/codebases/{id}":{"get":{"tags":["Codebases"],"summary":"Get a codebase","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseResponse"}}}},"404":{"description":"Codebase not found"}}},"patch":{"tags":["Codebases"],"summary":"Update a codebase","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCodebaseInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseResponse"}}}},"404":{"description":"Codebase not found"}}},"delete":{"tags":["Codebases"],"summary":"Delete a codebase","responses":{"204":{"description":"Success"},"404":{"description":"Codebase not found"}}}},"/api/v1/codebases/{id}/revisions":{"get":{"tags":["Codebases"],"summary":"List codebase revisions","parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodebaseRevisionResponse"}}}}},"404":{"description":"Codebase not found"}}},"post":{"tags":["Codebases"],"summary":"Resolve a new git codebase revision","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveCodebaseRevisionInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseRevisionResponse"}}}},"400":{"description":"Not a git codebase"},"404":{"description":"Codebase not found"},"502":{"description":"GitHub resolution failed"}}}},"/api/v1/codebases/{id}/upload":{"post":{"tags":["Codebases"],"summary":"Upload a codebase archive as a new revision","responses":{"201":{"description":"Success"},"400":{"description":"Missing archive or not an archive codebase"},"404":{"description":"Codebase not found"}}}},"/api/v1/codebase-revisions/{id}/archive":{"get":{"tags":["Codebase Revisions"],"summary":"Download codebase revision archive","responses":{"200":{"description":"Binary tar.gz archive"},"404":{"description":"Revision or archive not found"},"500":{"description":"Blob storage error"}}}},"/api/v1/codebase-revisions/{id}":{"get":{"tags":["Codebase Revisions"],"summary":"Get codebase revision by id","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodebaseRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/resources":{"get":{"tags":["Resources"],"summary":"List all resources","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResourceResponse"}}}}}}},"post":{"tags":["Resources"],"summary":"Create a resource and its first revision","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceInput"}}}},"responses":{"201":{"description":"Success"},"400":{"description":"Invalid input"},"409":{"description":"Resource slug or revision ref already exists in this project"}}}},"/api/v1/resources/{id}":{"get":{"tags":["Resources"],"summary":"Get a resource","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceResponse"}}}},"404":{"description":"Resource not found"}}},"patch":{"tags":["Resources"],"summary":"Update a resource","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResourceInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceResponse"}}}},"404":{"description":"Resource not found"}}},"delete":{"tags":["Resources"],"summary":"Delete a resource","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success"},"404":{"description":"Resource not found"}}}},"/api/v1/resources/{id}/revisions":{"get":{"tags":["Resource Revisions"],"summary":"List resource revisions","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}}},"404":{"description":"Resource not found"}}},"post":{"tags":["Resource Revisions"],"summary":"Create a resource revision","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResourceRevisionInput"}}}},"responses":{"201":{"description":"Success"},"404":{"description":"Resource not found"},"409":{"description":"Resource revision ref already exists in this project"}}}},"/api/v1/resources/{id}/revisions/latest":{"get":{"tags":["Resource Revisions"],"summary":"Get the latest resource revision","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/resources/{id}/revisions/{revisionNumber}":{"get":{"tags":["Resource Revisions"],"summary":"Get a resource revision by resource and revision number","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"revisionNumber","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/resources/revisions/{id}":{"get":{"tags":["Resource Revisions"],"summary":"Get resource revision by id","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceRevisionResponse"}}}},"404":{"description":"Revision not found"}}}},"/api/v1/extensions":{"get":{"tags":["Extensions"],"summary":"List all extensions","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}}},"post":{"tags":["Extensions"],"summary":"Create or import an extension","parameters":[{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExtensionInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}}},"/api/v1/extensions/search":{"get":{"tags":["Extensions"],"summary":"Search extensions (internal + marketplace)","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExtensionSearchResult"}}}}},"400":{"description":"Missing query parameter"}}}},"/api/v1/extensions/{id}":{"get":{"tags":["Extensions"],"summary":"Get extension by ID","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}},"put":{"tags":["Extensions"],"summary":"Update extension","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExtensionInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtensionResponse"}}}}}},"delete":{"tags":["Extensions"],"summary":"Delete extension","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/api/v1/extensions/{id}/versions":{"get":{"tags":["Extensions"],"summary":"List available versions for an extension","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"preRelease","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExtensionVersionInfo"}}}}}}}},"/api/v1/insights":{"get":{"tags":["Insights"],"summary":"List insights","parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"blocked","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InsightResponse"}}}}}}},"post":{"tags":["Insights"],"summary":"Create insight","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInsightInput"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}}}}},"/api/v1/insights/search":{"get":{"tags":["Insights"],"summary":"Search insights","parameters":[{"schema":{"type":"string"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"blocked","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","example":"00000000-0000-0000-0000-000000000000"},"required":true,"description":"Project scope. Required on scoped list and root-create operations; requests without a resolvable project are rejected with 400. There is no default project.","name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InsightResponse"}}}}}}}},"/api/v1/insights/{id}":{"get":{"tags":["Insights"],"summary":"Get insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}},"put":{"tags":["Insights"],"summary":"Update insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInsightInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}},"delete":{"tags":["Insights"],"summary":"Delete insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/upvote":{"post":{"tags":["Insights"],"summary":"Upvote insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/downvote":{"post":{"tags":["Insights"],"summary":"Downvote insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/block":{"post":{"tags":["Insights"],"summary":"Block insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/unblock":{"post":{"tags":["Insights"],"summary":"Unblock insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightResponse"}}}},"404":{"description":"Insight not found"}}}},"/api/v1/insights/{id}/reports":{"get":{"tags":["Insights"],"summary":"Get reports referencing insight","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportResponse"}}}}},"404":{"description":"Insight not found"}}}},"/api/v1/feature-flags":{"get":{"tags":["Feature Flags"],"summary":"List feature flags","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureFlagResponse"}}}}}}}},"/api/v1/feature-flags/{key}":{"put":{"tags":["Feature Flags"],"summary":"Update feature flag","parameters":[{"schema":{"type":"string"},"required":true,"name":"key","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFeatureFlagInput"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagResponse"}}}}}}}},"webhooks":{}}
\ No newline at end of file
From a1612d4bf7d3a77d6a6d91e6c30d0a367a411a61 Mon Sep 17 00:00:00 2001
From: Cedric Vidal
Date: Tue, 13 Oct 2026 16:26:21 +0200
Subject: [PATCH 057/287] feat(submissions): add attempt state foundation
Introduce stable submission identities, deterministic request/run vectors, resumable CAS rollover with immutable history, named-handler dependency evaluation, Cosmos-safe indexes, and attempt-scoped worker claim/completion helpers. Align the observation handler identity with the pp-observations dependency contract.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 99f84f04-d3b0-40f1-a254-4dfbd21e4d87
---
apps/judge/src/agent-trajectory.test.ts | 2 +-
...observation-trajectory.integration.test.ts | 2 +-
apps/portal/src/lib/enrichment.test.ts | 28 +-
apps/portal/src/lib/enrichment.ts | 10 +-
apps/scheduler/src/handler-dispatcher.ts | 69 +-
apps/workers/post-processor/Dockerfile | 2 +-
.../post-processor/handler.taxonomy.yaml | 6 +-
.../src/handlers/taxonomy-handler.test.ts | 6 +-
.../src/handlers/taxonomy-handler.ts | 6 +-
docker-compose.yml | 4 +-
docs/architecture/criteria-provider.md | 2 +-
docs/architecture/post-processing.md | 37 +-
.../src/034-create-submission-indexes.test.ts | 52 ++
.../034-create-submission-indexes.ts | 67 ++
.../db-migrations/src/required-migrations.ts | 1 +
.../shared/src/criteria/criteria-store.ts | 2 +-
packages/shared/src/index.ts | 1 +
packages/shared/src/judge/judge-client.ts | 4 +-
packages/shared/src/schemas/index.ts | 1 +
packages/shared/src/schemas/request.ts | 4 +
packages/shared/src/schemas/submission.ts | 182 +++++
.../shared/src/scripts/register-handler.ts | 30 +-
packages/shared/src/submissions/index.ts | 5 +
.../submission-coordinator.test.ts | 693 ++++++++++++++++++
.../src/submissions/submission-coordinator.ts | 573 +++++++++++++++
.../src/submissions/submission-state.test.ts | 155 ++++
.../src/submissions/submission-state.ts | 184 +++++
packages/shared/src/types/types.ts | 130 +++-
28 files changed, 2167 insertions(+), 91 deletions(-)
create mode 100644 packages/db-migrations/src/034-create-submission-indexes.test.ts
create mode 100644 packages/db-migrations/src/migrations/034-create-submission-indexes.ts
create mode 100644 packages/shared/src/schemas/submission.ts
create mode 100644 packages/shared/src/submissions/index.ts
create mode 100644 packages/shared/src/submissions/submission-coordinator.test.ts
create mode 100644 packages/shared/src/submissions/submission-coordinator.ts
create mode 100644 packages/shared/src/submissions/submission-state.test.ts
create mode 100644 packages/shared/src/submissions/submission-state.ts
diff --git a/apps/judge/src/agent-trajectory.test.ts b/apps/judge/src/agent-trajectory.test.ts
index 8bb870184..ac4d713b8 100644
--- a/apps/judge/src/agent-trajectory.test.ts
+++ b/apps/judge/src/agent-trajectory.test.ts
@@ -48,7 +48,7 @@ async function call(
/**
* Realistic ATIF blob: system + user step, then agent steps that install,
- * use, and uninstall `left-pad`. Mirrors the real ATIF shape pp-taxonomy
+ * use, and uninstall `left-pad`. Mirrors the real ATIF shape pp-observations
* downloads (steps carry their own tool_calls AND the matching
* observation.results, paired by source_call_id === tool_call_id).
*/
diff --git a/apps/judge/src/observation-trajectory.integration.test.ts b/apps/judge/src/observation-trajectory.integration.test.ts
index 066c40da3..d8b89150d 100644
--- a/apps/judge/src/observation-trajectory.integration.test.ts
+++ b/apps/judge/src/observation-trajectory.integration.test.ts
@@ -34,7 +34,7 @@ const hasToken = !!process.env.GITHUB_TOKEN;
const JUDGE_MODEL = process.env.JUDGE_MODEL || "gpt-5.4-mini";
/**
- * Realistic ATIF trajectory (the exact shape pp-taxonomy downloads and forwards
+ * Realistic ATIF trajectory (the exact shape pp-observations downloads and forwards
* via `fromAtif`): a system + user step, then agent steps that install
* `left-pad`, use it, and uninstall it before finishing. Each agent step pairs
* its `tool_calls[]` with the matching same-step `observation.results[]` by
diff --git a/apps/portal/src/lib/enrichment.test.ts b/apps/portal/src/lib/enrichment.test.ts
index 879bc5b11..9e4b19024 100644
--- a/apps/portal/src/lib/enrichment.test.ts
+++ b/apps/portal/src/lib/enrichment.test.ts
@@ -33,59 +33,59 @@ describe("deriveEnrichmentStatus", () => {
expect(deriveEnrichmentStatus(run, false)).toBe("done");
});
- it("does NOT flip to done after pp-atif while pp-taxonomy is still pending (the bug)", () => {
- // Observations configured, pp-atif done, pp-taxonomy not yet dispatched.
+ it("does NOT flip to done after pp-atif while pp-observations is still pending (the bug)", () => {
+ // Observations configured, pp-atif done, pp-observations not yet dispatched.
const beforeDispatch = makeRun({
postProcessorStatus: "done", // legacy scalar already flipped — must be ignored
handlerStatus: { "pp-atif": { status: "done" } },
});
expect(deriveEnrichmentStatus(beforeDispatch, true)).toBe("processing");
- // pp-taxonomy queued.
+ // pp-observations queued.
const queued = makeRun({
postProcessorStatus: "done",
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "queued" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-observations": { status: "queued" } },
});
expect(deriveEnrichmentStatus(queued, true)).toBe("processing");
- // pp-taxonomy processing.
+ // pp-observations processing.
const processing = makeRun({
postProcessorStatus: "done",
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "processing" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-observations": { status: "processing" } },
});
expect(deriveEnrichmentStatus(processing, true)).toBe("processing");
});
- it("flips to done only once both pp-atif and pp-taxonomy are done", () => {
+ it("flips to done only once both pp-atif and pp-observations are done", () => {
const run = makeRun({
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-observations": { status: "done" } },
});
expect(deriveEnrichmentStatus(run, true)).toBe("done");
});
it("reports failed when a handler failed and nothing is still in flight", () => {
const run = makeRun({
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "failed" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-observations": { status: "failed" } },
});
expect(deriveEnrichmentStatus(run, true)).toBe("failed");
});
it("prefers processing over failed while another handler is still running", () => {
const run = makeRun({
- handlerStatus: { "pp-atif": { status: "processing" }, "pp-taxonomy": { status: "failed" } },
+ handlerStatus: { "pp-atif": { status: "processing" }, "pp-observations": { status: "failed" } },
});
expect(deriveEnrichmentStatus(run, true)).toBe("processing");
});
- it("treats a no-op pp-taxonomy (no observations) as part of the DAG", () => {
- // No observations configured, but pp-taxonomy still runs as a no-op handler.
+ it("treats a no-op pp-observations (no observations) as part of the DAG", () => {
+ // No observations configured, but pp-observations still runs as a no-op handler.
const stillRunning = makeRun({
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "processing" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-observations": { status: "processing" } },
});
expect(deriveEnrichmentStatus(stillRunning, false)).toBe("processing");
const allDone = makeRun({
- handlerStatus: { "pp-atif": { status: "done" }, "pp-taxonomy": { status: "done" } },
+ handlerStatus: { "pp-atif": { status: "done" }, "pp-observations": { status: "done" } },
});
expect(deriveEnrichmentStatus(allDone, false)).toBe("done");
});
diff --git a/apps/portal/src/lib/enrichment.ts b/apps/portal/src/lib/enrichment.ts
index 99f5bfebc..756a510d9 100644
--- a/apps/portal/src/lib/enrichment.ts
+++ b/apps/portal/src/lib/enrichment.ts
@@ -12,14 +12,14 @@ export type PostProcessorStatus = "queued" | "processing" | "done" | "failed";
*
* Each post-processor handler overwrites that scalar on its own completion, so
* it flips to "done" as soon as the FIRST handler (pp-atif) finishes — even
- * while pp-taxonomy is still computing observations. The "Enriched" badge (and
+ * while pp-observations is still computing observations. The "Enriched" badge (and
* the run-detail poller) must instead stay "Enriching…" until every handler in
* the DAG is terminal.
*
- * Known topology: pp-atif always runs; pp-taxonomy is expected whenever the run
+ * Known topology: pp-atif always runs; pp-observations is expected whenever the run
* has configured observations. We treat taxonomy as still-pending until
- * pp-taxonomy reaches a terminal state, which also covers the brief window
- * after pp-atif finishes but before the scheduler has dispatched pp-taxonomy
+ * pp-observations reaches a terminal state, which also covers the brief window
+ * after pp-atif finishes but before the scheduler has dispatched pp-observations
* (so it isn't yet present in `handlerStatus`).
*
* Falls back to the legacy `postProcessorStatus` scalar for runs that predate
@@ -36,7 +36,7 @@ export function deriveEnrichmentStatus(
return run.postProcessorStatus;
}
const statuses = Object.values(handlerStatus).map((h) => h?.status);
- const taxonomyStatus = handlerStatus["pp-taxonomy"]?.status;
+ const taxonomyStatus = handlerStatus["pp-observations"]?.status;
const taxonomyPending =
hasConfiguredObservations && taxonomyStatus !== "done" && taxonomyStatus !== "failed";
if (taxonomyPending || statuses.some((s) => s === "queued" || s === "processing")) {
diff --git a/apps/scheduler/src/handler-dispatcher.ts b/apps/scheduler/src/handler-dispatcher.ts
index 4ff1f8275..d744092c3 100644
--- a/apps/scheduler/src/handler-dispatcher.ts
+++ b/apps/scheduler/src/handler-dispatcher.ts
@@ -3,8 +3,13 @@
import { Collection, Db } from "mongodb";
import { QueueClient } from "@azure/storage-queue";
-import type { RequestDocument, HandlerServiceDocument, HandlerRunStatus } from "shared";
-import { DependencyGraph, withRetry } from "shared";
+import type {
+ RequestDocument,
+ HandlerServiceDocument,
+ HandlerRunStatus,
+ ServiceHandlerDocument,
+} from "shared";
+import { DependencyGraph, isHandlerDagDrained, withRetry } from "shared";
import type { RetryOptions } from "shared";
import type { NotifyHandler } from "./notify-routes.js";
@@ -151,7 +156,27 @@ export class HandlerDispatcher implements NotifyHandler {
await this.maybeTriggerReports(requestId, runId);
}
- async registerHandler(doc: HandlerServiceDocument): Promise {
+ async registerHandler(doc: ServiceHandlerDocument): Promise {
+ if (doc.type === "submission-handler") {
+ const postProcessHandlers = await this.loadHandlers(true);
+ for (const dependency of doc.dependsOn) {
+ if (!postProcessHandlers.some((handler) => handler._id === dependency)) {
+ throw new Error(
+ `Submission handler '${doc._id}' depends on unknown run handler '${dependency}'`,
+ );
+ }
+ }
+ const { _id, ...fields } = doc;
+ await this.db.collection("services").updateOne(
+ { _id } as any,
+ { $set: { ...fields, dependsOn: [...fields.dependsOn], updatedAt: new Date() } } as any,
+ { upsert: true },
+ );
+ console.log(
+ `[HandlerDispatcher] Registered submission handler ${_id} (version=${doc.version}, queue=${doc.queue}, dependsOn=[${doc.dependsOn.join(", ")}])`,
+ );
+ return;
+ }
// Validate the resulting topology has no cycles before persisting. Read
// fresh (bypass the cache) so validation reflects any concurrent registrations.
const existing = await this.loadHandlers(true);
@@ -183,43 +208,12 @@ export class HandlerDispatcher implements NotifyHandler {
// ── Report trigger on DAG drain ─────────────────────────────────────
- /**
- * A handler is "terminal" for a run when it can produce no further work:
- * it has succeeded (`done`), failed (`failed`), or is permanently blocked
- * because one of its transitive dependencies failed (so it can never run).
- */
- private isHandlerTerminal(
- handlerId: string,
- graph: DependencyGraph,
- handlerStatus: Record | undefined,
- ): boolean {
- const status = handlerStatus?.[handlerId]?.status;
- if (status === "done" || status === "failed") return true;
-
- // Not yet dispatched/processed — terminal only if blocked by a failed
- // ancestor (any transitive dependency that failed).
- if (status === undefined) {
- for (const ancestorId of graph.getAncestors(handlerId)) {
- if (handlerStatus?.[ancestorId]?.status === "failed") return true;
- }
- }
-
- // "queued" or "processing" — still active.
- return false;
- }
-
- /**
- * The DAG is drained for a run when every registered handler is terminal.
- * Vacuously true when there are no handlers.
- */
private isDagDrained(
handlers: HandlerServiceDocument[],
- graph: DependencyGraph,
+ _graph: DependencyGraph,
handlerStatus: Record | undefined,
): boolean {
- return handlers.every((h) =>
- this.isHandlerTerminal(h._id, graph, handlerStatus),
- );
+ return isHandlerDagDrained(handlers, handlerStatus);
}
/**
@@ -239,12 +233,11 @@ export class HandlerDispatcher implements NotifyHandler {
if ((run as any).reportsTriggeredAt) return;
const handlers = await this.loadHandlers();
- const graph = this.buildGraph(handlers);
const handlerStatus = (run as any).handlerStatus as
| Record
| undefined;
- if (!this.isDagDrained(handlers, graph, handlerStatus)) return;
+ if (!this.isDagDrained(handlers, this.buildGraph(handlers), handlerStatus)) return;
// Atomically claim the trigger so concurrent notify/poll paths fire once.
const claimed = await this.collection.findOneAndUpdate(
diff --git a/apps/workers/post-processor/Dockerfile b/apps/workers/post-processor/Dockerfile
index 50f1c7a7c..2f5427cfe 100644
--- a/apps/workers/post-processor/Dockerfile
+++ b/apps/workers/post-processor/Dockerfile
@@ -24,7 +24,7 @@ COPY packages/telemetry/src ./packages/telemetry/src/
COPY apps/workers/post-processor/tsconfig.json ./apps/workers/post-processor/
COPY apps/workers/post-processor/src ./apps/workers/post-processor/src/
# Copy every handler manifest (handler.yaml = pp-atif, handler.taxonomy.yaml =
-# pp-taxonomy, plus any future handlers). The registration jobs read these by
+# pp-observations, plus any future handlers). The registration jobs read these by
# HANDLER_YAML_PATH, so all must be present in the image.
COPY apps/workers/post-processor/handler*.yaml ./apps/workers/post-processor/
diff --git a/apps/workers/post-processor/handler.taxonomy.yaml b/apps/workers/post-processor/handler.taxonomy.yaml
index 37411625f..849568456 100644
--- a/apps/workers/post-processor/handler.taxonomy.yaml
+++ b/apps/workers/post-processor/handler.taxonomy.yaml
@@ -2,16 +2,16 @@
# Read by the generic register-handler script and POSTed to the
# scheduler's POST /handlers/register endpoint on deploy.
#
-# pp-taxonomy records per-iteration boolean observations (kind:"observation"
+# pp-observations records boolean observations (kind:"observation"
# criteria) by reusing the judge. It depends on pp-atif so each turn's ATIF
# trajectory is available, giving the judge codebase (snapshot) + trajectory
# (ATIF) access. Shares the post-processor-queue with pp-atif (same worker).
# See issue #1156.
-_id: pp-taxonomy
+_id: pp-observations
type: post-process-handler
version: 1
queue: post-processor-queue
-selector: taxonomy
+selector: observations
autoBackfill: true
dependsOn:
- pp-atif
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
index 1f191caa9..1aeb0b2ec 100644
--- a/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.test.ts
@@ -32,7 +32,7 @@ function makeCtx(
} as any;
}
-const msg: PostProcessorMessage = { type: "taxonomy", requestId: "req-1", runId: "run-1" };
+const msg: PostProcessorMessage = { type: "observations", requestId: "req-1", runId: "run-1" };
describe("TaxonomyHandler", () => {
let judge: { evaluate: ReturnType };
@@ -41,8 +41,8 @@ describe("TaxonomyHandler", () => {
judge = { evaluate: vi.fn() };
});
- it("has type 'taxonomy'", () => {
- expect(new TaxonomyHandler(judge as unknown as JudgeClient).type).toBe("taxonomy");
+ it("has type 'observations'", () => {
+ expect(new TaxonomyHandler(judge as unknown as JudgeClient).type).toBe("observations");
});
it("no-ops when no observations are selected", async () => {
diff --git a/apps/workers/post-processor/src/handlers/taxonomy-handler.ts b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
index 62cf41a85..2baa81365 100644
--- a/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
+++ b/apps/workers/post-processor/src/handlers/taxonomy-handler.ts
@@ -26,7 +26,7 @@ interface CriterionMeta {
}
/**
- * Taxonomy Handler (pp-taxonomy): records boolean observations.
+ * Taxonomy Handler (pp-observations): records boolean observations.
*
* Each selected observation criterion is routed by its `subject` (#1156):
*
@@ -40,12 +40,12 @@ interface CriterionMeta {
* behavior (e.g. a dependency added in one turn and removed in another) visible.
*
* Reuses the judge service; never gates, never steers the agent. Empty/absent
- * `observations` → no-op. pp-taxonomy is dispatched exactly once per run (the
+ * `observations` → no-op. pp-observations is dispatched exactly once per run (the
* scheduler never sets `message.iteration`), so the run-subject branch runs once
* with no idempotency guard.
*/
export class TaxonomyHandler implements PostProcessHandler {
- readonly type = "taxonomy";
+ readonly type = "observations";
readonly version = POST_PROCESSOR_VERSION;
readonly autoBackfill = true;
private readonly judge: JudgeClient;
diff --git a/docker-compose.yml b/docker-compose.yml
index 027888cd2..221dd5c03 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -886,7 +886,7 @@ services:
restart: "no"
entrypoint: ["npx", "tsx", "packages/shared/src/scripts/register-handler.ts"]
- # Registers the pp-taxonomy handler (observation evaluator) — shares the
+ # Registers the pp-observations handler (observation evaluator) — shares the
# post-processor worker + post-processor-queue, depends on pp-atif. Issue #1156.
register-handler-taxonomy:
build:
@@ -918,7 +918,7 @@ services:
AZURE_STORAGE_QUEUE_POSTPROCESSOR: post-processor-queue
SCOPE_MT_API_URL: http://api:80
SCHEDULER_URL: http://scheduler:8080
- # pp-taxonomy (issue #1156) calls the judge service to evaluate
+ # pp-observations (issue #1156) calls the judge service to evaluate
# observation criteria. Without this the JudgeClient falls back to
# localhost:3002 and cannot reach the judge container.
JUDGE_SERVICE_URL: http://judge:80
diff --git a/docs/architecture/criteria-provider.md b/docs/architecture/criteria-provider.md
index af6db54f6..23ae0d8ec 100644
--- a/docs/architecture/criteria-provider.md
+++ b/docs/architecture/criteria-provider.md
@@ -181,7 +181,7 @@ bypassed or drift between callers:
default): `kind:"observation"` ⇒ `"run"`, `kind:"gate"`/legacy ⇒ `"iteration"`. Gate
criteria are rejected if `subject:"run"` is supplied — `"iteration"` is their only legal
value. The field is threaded through `create`/`update`/`find` and both provider backends
- so the `pp-taxonomy` worker and the CLI/Portal can read it.
+ so the `pp-observations` worker and the CLI/Portal can read it.
- **Referential integrity on delete** — deleting a criterion that still has
dependents is rejected.
diff --git a/docs/architecture/post-processing.md b/docs/architecture/post-processing.md
index dbeec1301..4518ef391 100644
--- a/docs/architecture/post-processing.md
+++ b/docs/architecture/post-processing.md
@@ -56,9 +56,9 @@ Two paths trigger post-processing:
The `iteration` query parameter is mandatory for the ATIF endpoints. ATIF files are also included in archive exports as `iteration-{N}.atif.trajectory.json`.
-## Taxonomy Observations (`pp-taxonomy`)
+## Taxonomy Observations (`pp-observations`)
-The `pp-taxonomy` handler records **observation criteria** — boolean outcomes +
+The `pp-observations` handler records **observation criteria** — boolean outcomes +
evidence about the codebase and the agent's trajectory, **without gating or steering**
the coding agent (issue #1156). It is a DAG node `dependsOn: [pp-atif]`, because some
observations are only derivable from the trajectory (ATIF), not the final snapshot.
@@ -89,8 +89,8 @@ Gate criteria are always `subject: "iteration"` (the API rejects `"run"` for gat
4. **Run-subject:** evaluates **once** with `snapshotUrl` = final turn's snapshot, `atifUrls` = every turn's `atifUrl` (the judge downloads + merges them into one `AgentTrajectory`), and the full `conversationHistory`. Writes the verdicts to **`run.observationResults`** (run level).
- In all judge calls there is no persona, no gate, no taxonomyElementId (the classifier lives on the criterion). ATIF supersedes per-turn `toolCallsUrl`, so only ATIF is sent.
- Result shape/storage mirrors gate `criteriaResults`. No new blob, no `run.taxonomyUrl`.
- - **Runs exactly once per run:** the scheduler dispatches `pp-taxonomy` a single time (it never sets `message.iteration`), so the run-subject branch needs no idempotency guard.
-5. Stamps `run.handlerStatus["pp-taxonomy"] = { status: "done", version: N }` and notifies the scheduler.
+ - **Runs exactly once per run:** the scheduler dispatches `pp-observations` a single time (it never sets `message.iteration`), so the run-subject branch needs no idempotency guard.
+5. Stamps `run.handlerStatus["pp-observations"] = { status: "done", version: N }` and notifies the scheduler.
Dimension grouping is **derived at read time** by joining each result's `criterionId` → criterion `taxonomyElementId` (the three R&A Readout dimensions; unset = unclassified). It never feeds back to the agent and never affects pass/fail. (#1053 later extends this worker with a richer scorecard artifact.)
@@ -203,7 +203,34 @@ flowchart LR
**Where it runs:**
- **Docker Compose:** one `register-handler-` init service per handler (e.g. `pp-atif`) runs the generic script via `tsx`, gated on the scheduler being up. The worker waits for its registration service to complete.
-- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. `pp-atif` and `pp-taxonomy` are registered in K8s via their respective registration Jobs (`register-handler-taxonomy` points its `HANDLER_YAML_PATH` at `handler.taxonomy.yaml`). The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
+- **Kubernetes:** a `register-handler-post-processor` Job runs the compiled script (`node packages/shared/dist/scripts/register-handler.js`) on each deploy. `pp-atif` and `pp-observations` are registered in K8s via their respective registration Jobs (`register-handler-taxonomy` points its `HANDLER_YAML_PATH` at `handler.taxonomy.yaml`). The scheduler exposes a `Service` (`scheduler.scoped.svc.cluster.local:8080`) so Jobs and workers can reach `/handlers/register` and the notify endpoints.
+
+## Submission handlers
+
+Submission handlers use the same `services` registration endpoint but declare
+`type: submission-handler` and `dependencyMode: all-runs`. Their dependencies
+name run-level DAG handlers, not other submission handlers. The scheduler
+reconciles each submission's exact request/run vector, projects those named
+dependencies, and enqueues only the current embedded submission attempt.
+
+The first consumer is `pp-readout`, which depends on `pp-observations` for every
+run in the vector. Its queue contract is:
+
+```json
+{
+ "type": "readout",
+ "submissionId": "…",
+ "submissionRunId": "…"
+}
+```
+
+Workers must use the shared `claimSubmissionHandler`,
+`isCurrentSubmissionRun`, and `completeSubmissionHandler` helpers. These helpers
+scope every mutation to both identifiers, providing stale-message discard,
+cooperative supersession checks, and stale completion rejection. Queue delivery
+remains at-least-once; the embedded current attempt is the only dispatchable
+state, and the scheduler poll repairs missed notifications, stale projections,
+request-vector drift, and interrupted rollover/finalization.
To **add or change a handler**, edit its `handler.yaml` (bump `version`, adjust `dependsOn`, etc.) — no code or migration changes are needed for registration.
diff --git a/packages/db-migrations/src/034-create-submission-indexes.test.ts b/packages/db-migrations/src/034-create-submission-indexes.test.ts
new file mode 100644
index 000000000..1fd59c8bd
--- /dev/null
+++ b/packages/db-migrations/src/034-create-submission-indexes.test.ts
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { Db } from "mongodb";
+import { describe, expect, it, vi } from "vitest";
+import { CreateSubmissionIndexes } from "./migrations/034-create-submission-indexes.js";
+
+function collection() {
+ return {
+ createIndex: vi.fn(async () => "index"),
+ };
+}
+
+describe("migration 034: CreateSubmissionIndexes", () => {
+ it("creates submission, history, dispatch, and recovery indexes", async () => {
+ const submissions = collection();
+ const submissionRuns = collection();
+ const requests = collection();
+ const db = {
+ collection: vi.fn((name: string) => {
+ if (name === "submissions") return submissions;
+ if (name === "submission-runs") return submissionRuns;
+ if (name === "requests") return requests;
+ throw new Error(`Unexpected collection ${name}`);
+ }),
+ } as unknown as Db;
+
+ await new CreateSubmissionIndexes().up(db);
+
+ expect(submissions.createIndex).toHaveBeenCalledWith(
+ { projectId: 1, createdAt: -1, _id: -1 },
+ {},
+ );
+ expect(submissions.createIndex).toHaveBeenCalledWith(
+ { "run.handlerStatus.pp-readout.status": 1 },
+ {},
+ );
+ expect(submissionRuns.createIndex).toHaveBeenCalledWith(
+ { submissionId: 1, attemptNumber: -1 },
+ {},
+ );
+ expect(requests.createIndex).toHaveBeenCalledWith(
+ { submissionFinalizedAt: 1 },
+ {},
+ );
+ expect(requests.createIndex).toHaveBeenCalledWith(
+ { submissionId: 1, projectId: 1, submissionRequestIndex: 1, _id: 1 },
+ {},
+ );
+ });
+});
+
diff --git a/packages/db-migrations/src/migrations/034-create-submission-indexes.ts b/packages/db-migrations/src/migrations/034-create-submission-indexes.ts
new file mode 100644
index 000000000..8ceb836e9
--- /dev/null
+++ b/packages/db-migrations/src/migrations/034-create-submission-indexes.ts
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import type { Db } from "mongodb";
+import type { MigrationInterface } from "mongo-migrate-ts";
+import { ensureIndex } from "../cosmos-index-helpers.js";
+
+const TAG = "034";
+
+export class CreateSubmissionIndexes implements MigrationInterface {
+ async up(db: Db): Promise {
+ const submissions = db.collection("submissions");
+ await ensureIndex(
+ submissions,
+ { projectId: 1, createdAt: -1, _id: -1 },
+ {},
+ "submissions",
+ TAG,
+ );
+ await ensureIndex(
+ submissions,
+ { "run.handlerStatus.pp-readout.status": 1 },
+ {},
+ "submissions",
+ TAG,
+ );
+
+ const submissionRuns = db.collection("submission-runs");
+ await ensureIndex(
+ submissionRuns,
+ { submissionId: 1 },
+ {},
+ "submission-runs",
+ TAG,
+ );
+ await ensureIndex(
+ submissionRuns,
+ { submissionId: 1, attemptNumber: -1 },
+ {},
+ "submission-runs",
+ TAG,
+ );
+
+ const requests = db.collection("requests");
+ await ensureIndex(
+ requests,
+ { submissionFinalizedAt: 1 },
+ {},
+ "requests",
+ TAG,
+ );
+ await ensureIndex(
+ requests,
+ { submissionId: 1, projectId: 1, submissionRequestIndex: 1, _id: 1 },
+ {},
+ "requests",
+ TAG,
+ );
+ console.log(`[${TAG}] Submission indexes complete`);
+ }
+
+ async down(_db: Db): Promise {
+ console.log(
+ `[${TAG}-down] Skipping index changes - drop submission indexes manually if needed`,
+ );
+ }
+}
diff --git a/packages/db-migrations/src/required-migrations.ts b/packages/db-migrations/src/required-migrations.ts
index 4d0e54062..bee754391 100644
--- a/packages/db-migrations/src/required-migrations.ts
+++ b/packages/db-migrations/src/required-migrations.ts
@@ -46,6 +46,7 @@ export const REQUIRED_MIGRATIONS: readonly string[] = [
"031-migrate-services-to-handler-dag.ts",
"032-add-handler-status-index.ts",
"033-backfill-handler-status.ts",
+ "034-create-submission-indexes.ts",
"021-backfill-criteria-kind.ts",
"022-backfill-criteria-subject.ts",
];
diff --git a/packages/shared/src/criteria/criteria-store.ts b/packages/shared/src/criteria/criteria-store.ts
index 7413449c9..0b47231b4 100644
--- a/packages/shared/src/criteria/criteria-store.ts
+++ b/packages/shared/src/criteria/criteria-store.ts
@@ -439,7 +439,7 @@ export class CriteriaStore {
/**
* Resolve observation-criteria ids, asserting each is an active
- * kind:"observation" criterion. Used by submit validation + pp-taxonomy.
+ * kind:"observation" criterion. Used by submit validation + pp-observations.
* Throws CriteriaValidationError on a missing or non-observation id.
*/
async resolveObservations(ids: string[]): Promise {
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index a6febdece..fae65d02f 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -20,6 +20,7 @@ export * from "./codebases/index.js";
export * from "./resources/index.js";
export * from "./extensions/index.js";
export * from "./projects/index.js";
+export * from "./submissions/index.js";
export * from "./agent-version.js";
export * from "./resolve-agent-version.js";
export * from "./resolve-agent-target.js";
diff --git a/packages/shared/src/judge/judge-client.ts b/packages/shared/src/judge/judge-client.ts
index 7a5f85850..633fd6e8f 100644
--- a/packages/shared/src/judge/judge-client.ts
+++ b/packages/shared/src/judge/judge-client.ts
@@ -18,11 +18,11 @@ export interface JudgeEvaluateRequest {
/** Blob URL of this iteration's captured tool calls/outputs (build/test/run output). */
toolCallsUrl?: string;
/** Blob URL of this iteration's ATIF trajectory JSON. Normalized superset of
- * tool calls; sent by pp-taxonomy in place of toolCallsUrl so observations
+ * tool calls; sent by pp-observations in place of toolCallsUrl so observations
* can be evaluated against the full agent trajectory. See issue #1156. */
atifUrl?: string;
/** Blob URLs of EVERY iteration's ATIF trajectory JSON, in iteration order.
- * Sent by pp-taxonomy for `subject:"run"` observations so the judge merges
+ * Sent by pp-observations for `subject:"run"` observations so the judge merges
* them into one whole-run trajectory (cross-iteration behavior is visible in a
* single evaluation). Takes precedence over `atifUrl`. See issue #1156. */
atifUrls?: string[];
diff --git a/packages/shared/src/schemas/index.ts b/packages/shared/src/schemas/index.ts
index cb1df8b4c..52a7bed3f 100644
--- a/packages/shared/src/schemas/index.ts
+++ b/packages/shared/src/schemas/index.ts
@@ -22,3 +22,4 @@ export * from "./account.js";
export * from "./feature-flag.js";
export * from "./profile.js";
export * from "./project.js";
+export * from "./submission.js";
diff --git a/packages/shared/src/schemas/request.ts b/packages/shared/src/schemas/request.ts
index 5271582a5..5aefb2466 100644
--- a/packages/shared/src/schemas/request.ts
+++ b/packages/shared/src/schemas/request.ts
@@ -181,6 +181,10 @@ export const RequestResponseSchema = z
profileId: z.string().optional(),
profileVersionId: z.string().optional(),
submissionId: z.string().optional(),
+ submissionExpectedRequestCount: z.number().int().min(1).optional(),
+ submissionRequestIndex: z.number().int().min(0).optional(),
+ submissionInitialRunId: z.string().optional(),
+ submissionFinalizedAt: z.coerce.date().optional(),
priority: z.number().int().default(0),
gates: z.array(GateConfigSchema).optional(),
observations: z.array(z.string()).optional(),
diff --git a/packages/shared/src/schemas/submission.ts b/packages/shared/src/schemas/submission.ts
new file mode 100644
index 000000000..3558ae603
--- /dev/null
+++ b/packages/shared/src/schemas/submission.ts
@@ -0,0 +1,182 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { z } from "zod";
+import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
+
+extendZodWithOpenApi(z);
+
+export const SubmissionRequestRefSchema = z
+ .object({
+ requestId: z.string(),
+ runId: z.string(),
+ })
+ .openapi("SubmissionRequestRef");
+
+export const SubmissionDependencyStateSchema = z.enum([
+ "waiting",
+ "ready",
+ "failed",
+ "blocked",
+]);
+
+export const SubmissionDependencyProjectionSchema = z
+ .object({
+ requestId: z.string(),
+ runId: z.string(),
+ handlerId: z.string(),
+ state: SubmissionDependencyStateSchema,
+ version: z.number().optional(),
+ updatedAt: z.coerce.date().optional(),
+ error: z.string().optional(),
+ })
+ .openapi("SubmissionDependencyProjection");
+
+export const SubmissionBlockingDetailSchema = z
+ .object({
+ requestId: z.string(),
+ runId: z.string(),
+ handlerId: z.string(),
+ reason: z.enum([
+ "request-missing",
+ "run-changed",
+ "dependency-not-ready",
+ "dependency-failed",
+ "dependency-blocked",
+ ]),
+ error: z.string().optional(),
+ })
+ .openapi("SubmissionBlockingDetail");
+
+export const SubmissionHandlerStatusSchema = z
+ .object({
+ status: z.enum(["queued", "processing", "done", "failed"]),
+ version: z.number().optional(),
+ updatedAt: z.coerce.date().optional(),
+ error: z.string().optional(),
+ })
+ .openapi("SubmissionHandlerStatus");
+
+export const SubmissionReportPointerSchema = z
+ .object({
+ reportId: z.string().optional(),
+ url: z.string().optional(),
+ updatedAt: z.coerce.date().optional(),
+ })
+ .openapi("SubmissionReportPointer");
+
+export const SubmissionRolloverClaimSchema = z.object({
+ nextSubmissionRunId: z.string(),
+ vectorFingerprint: z.string(),
+ requests: z.array(SubmissionRequestRefSchema),
+ reason: z.enum(["request-vector-changed", "manual-retry"]),
+ claimedAt: z.coerce.date(),
+});
+
+export const SubmissionRunStateSchema = z
+ .object({
+ _id: z.string(),
+ attemptNumber: z.number().int().min(1),
+ vectorFingerprint: z.string(),
+ requests: z.array(SubmissionRequestRefSchema),
+ createdAt: z.coerce.date(),
+ updatedAt: z.coerce.date().optional(),
+ startedAt: z.coerce.date().optional(),
+ finishedAt: z.coerce.date().optional(),
+ dependencyProjection: z.array(SubmissionDependencyProjectionSchema).default([]),
+ handlerStatus: z.record(z.string(), SubmissionHandlerStatusSchema).optional(),
+ blocking: z.array(SubmissionBlockingDetailSchema).default([]),
+ report: SubmissionReportPointerSchema.optional(),
+ reconcileAfter: z.coerce.date().optional(),
+ rollover: SubmissionRolloverClaimSchema.optional(),
+ supersededAt: z.coerce.date().optional(),
+ supersededBySubmissionRunId: z.string().optional(),
+ supersededReason: z.enum(["request-vector-changed", "manual-retry"]).optional(),
+ })
+ .openapi("SubmissionRunState");
+
+export const SubmissionDocumentSchema = z
+ .object({
+ _id: z.string(),
+ submissionId: z.string(),
+ projectId: z.string(),
+ requestIds: z.array(z.string()).min(1),
+ createdAt: z.coerce.date(),
+ updatedAt: z.coerce.date().optional(),
+ run: SubmissionRunStateSchema,
+ })
+ .openapi("SubmissionDocument");
+
+export const SubmissionRunHistoryDocumentSchema = SubmissionRunStateSchema.extend({
+ submissionId: z.string(),
+ projectId: z.string(),
+}).openapi("SubmissionRunHistoryDocument");
+
+export const SubmissionRunResponseSchema = SubmissionRunStateSchema.omit({
+ reconcileAfter: true,
+ rollover: true,
+})
+ .extend({
+ submissionId: z.string().optional(),
+ projectId: z.string().optional(),
+ })
+ .openapi("SubmissionRunResponse");
+
+export const SubmissionReadinessSchema = z.enum([
+ "waiting",
+ "ready",
+ "blocked",
+ "processing",
+ "done",
+ "failed",
+]);
+
+export const SubmissionRequestSummarySchema = z
+ .object({
+ requestId: z.string(),
+ runId: z.string(),
+ task: z.string(),
+ status: z.string(),
+ outcome: z.string().optional(),
+ workerType: z.string(),
+ model: z.string().optional(),
+ profileId: z.string().optional(),
+ })
+ .openapi("SubmissionRequestSummary");
+
+export const SubmissionResponseSchema = z
+ .object({
+ submissionId: z.string(),
+ projectId: z.string(),
+ requestIds: z.array(z.string()),
+ createdAt: z.coerce.date(),
+ updatedAt: z.coerce.date().optional(),
+ submissionRunId: z.string(),
+ attemptNumber: z.number().int(),
+ readiness: SubmissionReadinessSchema,
+ requests: z.array(SubmissionRequestSummarySchema),
+ dependencyProjection: z.array(SubmissionDependencyProjectionSchema),
+ blocking: z.array(SubmissionBlockingDetailSchema),
+ handlerProgress: z.record(z.string(), SubmissionHandlerStatusSchema).optional(),
+ report: SubmissionReportPointerSchema.optional(),
+ supersededAt: z.coerce.date().optional(),
+ supersededBySubmissionRunId: z.string().optional(),
+ supersededReason: z.enum(["request-vector-changed", "manual-retry"]).optional(),
+ })
+ .openapi("SubmissionResponse");
+
+export const SubmissionListResponseSchema = z
+ .object({
+ submissions: z.array(SubmissionResponseSchema),
+ })
+ .openapi("SubmissionListResponse");
+
+export const SubmissionRetryResponseSchema = z
+ .object({
+ submissionId: z.string(),
+ submissionRunId: z.string(),
+ attemptNumber: z.number().int(),
+ readiness: SubmissionReadinessSchema,
+ blocking: z.array(SubmissionBlockingDetailSchema),
+ })
+ .openapi("SubmissionRetryResponse");
diff --git a/packages/shared/src/scripts/register-handler.ts b/packages/shared/src/scripts/register-handler.ts
index c585e9eb1..730b860f6 100644
--- a/packages/shared/src/scripts/register-handler.ts
+++ b/packages/shared/src/scripts/register-handler.ts
@@ -21,7 +21,7 @@
*/
import { readFile } from "node:fs/promises";
import { parse as parseYaml } from "yaml";
-import type { HandlerServiceDocument } from "../types/types.js";
+import type { ServiceHandlerDocument } from "../types/types.js";
const HEALTH_RETRIES = 30;
const HEALTH_DELAY_MS = 3_000;
@@ -33,7 +33,7 @@ function isNonEmptyString(value: unknown): value is string {
}
/** Validate the parsed YAML conforms to the HandlerServiceDocument shape. */
-export function parseHandlerDocument(raw: unknown): HandlerServiceDocument {
+export function parseHandlerDocument(raw: unknown): ServiceHandlerDocument {
if (typeof raw !== "object" || raw === null) {
throw new Error("handler.yaml must contain a mapping");
}
@@ -42,8 +42,10 @@ export function parseHandlerDocument(raw: unknown): HandlerServiceDocument {
if (!isNonEmptyString(doc._id)) {
throw new Error("handler.yaml: '_id' is required");
}
- if (doc.type !== "post-process-handler") {
- throw new Error("handler.yaml: 'type' must be 'post-process-handler'");
+ if (doc.type !== "post-process-handler" && doc.type !== "submission-handler") {
+ throw new Error(
+ "handler.yaml: 'type' must be 'post-process-handler' or 'submission-handler'",
+ );
}
if (typeof doc.version !== "number" || !Number.isFinite(doc.version)) {
throw new Error("handler.yaml: 'version' must be a number");
@@ -62,15 +64,27 @@ export function parseHandlerDocument(raw: unknown): HandlerServiceDocument {
throw new Error("handler.yaml: 'dependsOn' must be an array of strings");
}
- return {
+ const common = {
_id: doc._id,
- type: "post-process-handler",
version: doc.version,
queue: doc.queue,
selector: doc.selector,
autoBackfill: doc.autoBackfill,
dependsOn: dependsOn as string[],
};
+ if (doc.type === "submission-handler") {
+ if (doc.dependencyMode !== "all-runs") {
+ throw new Error(
+ "handler.yaml: submission handlers require dependencyMode: 'all-runs'",
+ );
+ }
+ return {
+ ...common,
+ type: "submission-handler",
+ dependencyMode: "all-runs",
+ };
+ }
+ return { ...common, type: "post-process-handler" };
}
async function delay(ms: number): Promise {
@@ -97,7 +111,7 @@ async function waitForScheduler(schedulerUrl: string): Promise {
async function postRegistration(
schedulerUrl: string,
- doc: HandlerServiceDocument,
+ doc: ServiceHandlerDocument,
): Promise {
for (let attempt = 1; attempt <= POST_RETRIES; attempt++) {
try {
@@ -128,7 +142,7 @@ async function postRegistration(
export async function registerHandlerFromYaml(
yamlPath: string,
schedulerUrl: string,
-): Promise {
+): Promise {
const content = await readFile(yamlPath, "utf-8");
const doc = parseHandlerDocument(parseYaml(content));
diff --git a/packages/shared/src/submissions/index.ts b/packages/shared/src/submissions/index.ts
new file mode 100644
index 000000000..5aa35026a
--- /dev/null
+++ b/packages/shared/src/submissions/index.ts
@@ -0,0 +1,5 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+export * from "./submission-state.js";
+export * from "./submission-coordinator.js";
diff --git a/packages/shared/src/submissions/submission-coordinator.test.ts b/packages/shared/src/submissions/submission-coordinator.test.ts
new file mode 100644
index 000000000..d44b4c12e
--- /dev/null
+++ b/packages/shared/src/submissions/submission-coordinator.test.ts
@@ -0,0 +1,693 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+import { describe, expect, it, vi } from "vitest";
+import type { Collection } from "mongodb";
+import type {
+ RequestDocument,
+ ServiceHandlerDocument,
+ SubmissionDocument,
+ SubmissionRunHistoryDocument,
+} from "../types/types.js";
+import {
+ SubmissionCoordinator,
+ claimSubmissionHandler,
+ completeSubmissionHandler,
+ ensureNativeSubmission,
+} from "./submission-coordinator.js";
+
+function queryResult(items: T[]) {
+ return {
+ project: () => queryResult(items),
+ sort: () => queryResult(items),
+ limit: () => queryResult(items),
+ toArray: async () => items,
+ };
+}
+
+describe("submission coordinator persistence", () => {
+ it("creates a native submission idempotently with the exact initial vector", async () => {
+ let stored: SubmissionDocument | null = null;
+ const updateOne = vi.fn(async (
+ _filter: unknown,
+ update: { $setOnInsert: SubmissionDocument },
+ ) => {
+ stored ??= update.$setOnInsert;
+ return { matchedCount: stored ? 1 : 0, modifiedCount: 0 };
+ });
+ const findOne = vi.fn(async () => stored);
+ const submissions = {
+ updateOne,
+ findOne,
+ } as unknown as Collection;
+
+ const first = await ensureNativeSubmission({
+ collections: { submissions },
+ submissionId: "submission-1",
+ projectId: "project-1",
+ requests: [
+ { requestId: "request-1", runId: "run-1" },
+ { requestId: "request-2", runId: "run-2" },
+ ],
+ createdAt: new Date("2026-01-01T00:00:00Z"),
+ });
+ const second = await ensureNativeSubmission({
+ collections: { submissions },
+ submissionId: "submission-1",
+ projectId: "project-1",
+ requests: [
+ { requestId: "request-1", runId: "run-1" },
+ { requestId: "request-2", runId: "run-2" },
+ ],
+ createdAt: new Date("2026-01-01T00:00:00Z"),
+ });
+
+ expect(first).toEqual(second);
+ expect(first.requestIds).toEqual(["request-1", "request-2"]);
+ expect(first.run.requests).toEqual([
+ { requestId: "request-1", runId: "run-1" },
+ { requestId: "request-2", runId: "run-2" },
+ ]);
+ expect(first.run._id).toBe(second.run._id);
+ expect(updateOne).toHaveBeenCalledTimes(2);
+ });
+
+ it("rejects an idempotency key reused with a different immutable vector", async () => {
+ const stored: SubmissionDocument = {
+ _id: "submission-1",
+ submissionId: "submission-1",
+ projectId: "project-1",
+ requestIds: ["request-1"],
+ createdAt: new Date(),
+ run: {
+ _id: "submission-run-1",
+ attemptNumber: 1,
+ vectorFingerprint: "fingerprint",
+ requests: [{ requestId: "request-1", runId: "run-1" }],
+ createdAt: new Date(),
+ dependencyProjection: [],
+ blocking: [],
+ },
+ };
+ const submissions = {
+ updateOne: vi.fn(async () => ({ matchedCount: 1, modifiedCount: 0 })),
+ findOne: vi.fn(async () => stored),
+ } as unknown as Collection;
+
+ await expect(
+ ensureNativeSubmission({
+ collections: { submissions },
+ submissionId: "submission-1",
+ projectId: "project-1",
+ requests: [{ requestId: "request-1", runId: "different-run" }],
+ }),
+ ).rejects.toThrow("different immutable request vector");
+ });
+
+ it("scopes claims and completions to the exact embedded submission run", async () => {
+ const findOneAndUpdate = vi.fn(async (_filter: unknown, _update: unknown) => null);
+ const updateOne = vi.fn(async (_filter: unknown, _update: unknown) => ({
+ modifiedCount: 0,
+ }));
+ const submissions = {
+ findOneAndUpdate,
+ updateOne,
+ } as unknown as Collection;
+
+ expect(
+ await claimSubmissionHandler({
+ submissions,
+ submissionId: "submission-1",
+ submissionRunId: "stale-run",
+ handlerId: "pp-readout",
+ version: 1,
+ }),
+ ).toBeNull();
+ expect(findOneAndUpdate.mock.calls[0]?.[0]).toMatchObject({
+ _id: "submission-1",
+ "run._id": "stale-run",
+ "run.rollover": { $exists: false },
+ });
+
+ expect(
+ await completeSubmissionHandler({
+ submissions,
+ submissionId: "submission-1",
+ submissionRunId: "stale-run",
+ handlerId: "pp-readout",
+ status: "done",
+ version: 1,
+ }),
+ ).toBe(false);
+ expect(updateOne.mock.calls[0]?.[0]).toMatchObject({
+ _id: "submission-1",
+ "run._id": "stale-run",
+ "run.rollover": { $exists: false },
+ "run.handlerStatus.pp-readout.status": "processing",
+ });
+ });
+
+ it("defers reconciliation while a bulk retry replaces its request vector", async () => {
+ const submission: SubmissionDocument = {
+ _id: "submission-1",
+ submissionId: "submission-1",
+ projectId: "project-1",
+ requestIds: ["request-1"],
+ createdAt: new Date(),
+ run: {
+ _id: "submission-run-1",
+ attemptNumber: 1,
+ vectorFingerprint: "old-vector",
+ requests: [{ requestId: "request-1", runId: "run-1" }],
+ createdAt: new Date(),
+ reconcileAfter: new Date(Date.now() + 60_000),
+ dependencyProjection: [],
+ blocking: [],
+ },
+ };
+ const requestsFind = vi.fn();
+ const archiveInsert = vi.fn();
+ const coordinator = new SubmissionCoordinator({
+ requests: {
+ find: requestsFind,
+ } as unknown as Collection,
+ submissions: {
+ findOne: vi.fn(async () => submission),
+ } as unknown as Collection,
+ submissionRuns: {
+ insertOne: archiveInsert,
+ } as unknown as Collection,
+ services: {} as Collection,
+ });
+
+ const result = await coordinator.reconcile("submission-1");
+
+ expect(result?.rolled).toBe(false);
+ expect(requestsFind).not.toHaveBeenCalled();
+ expect(archiveInsert).not.toHaveBeenCalled();
+ });
+
+ it("resumes an interrupted drift rollover without double-rolling a manual retry", async () => {
+ const requestDocs: RequestDocument[] = [
+ {
+ _id: "request-1",
+ projectId: "project-1",
+ scenario: { task: "Task", criteria: ["criterion"] },
+ workerType: "worker",
+ createdAt: new Date(),
+ priority: 0,
+ submissionId: "submission-1",
+ run: {
+ _id: "run-2",
+ attemptNumber: 2,
+ status: "done",
+ outcome: "failed",
+ handlerStatus: {
+ "pp-observations": { status: "done", version: 2 },
+ unrelated: { status: "failed" },
+ },
+ },
+ },
+ ];
+ let submission: SubmissionDocument = {
+ _id: "submission-1",
+ submissionId: "submission-1",
+ projectId: "project-1",
+ requestIds: ["request-1"],
+ createdAt: new Date(),
+ run: {
+ _id: "submission-run-1",
+ attemptNumber: 1,
+ vectorFingerprint: "old-vector",
+ requests: [{ requestId: "request-1", runId: "run-1" }],
+ createdAt: new Date(),
+ dependencyProjection: [],
+ blocking: [],
+ },
+ };
+ const history: SubmissionRunHistoryDocument[] = [];
+ const services: ServiceHandlerDocument[] = [
+ {
+ _id: "pp-atif",
+ type: "post-process-handler",
+ version: 1,
+ queue: "post-processor",
+ selector: "atif",
+ autoBackfill: true,
+ dependsOn: [],
+ },
+ {
+ _id: "pp-observations",
+ type: "post-process-handler",
+ version: 2,
+ queue: "post-processor",
+ selector: "observations",
+ autoBackfill: true,
+ dependsOn: ["pp-atif"],
+ },
+ {
+ _id: "pp-readout",
+ type: "submission-handler",
+ version: 1,
+ queue: "readout",
+ selector: "readout",
+ autoBackfill: false,
+ dependsOn: ["pp-observations"],
+ dependencyMode: "all-runs",
+ },
+ ];
+ const submissions = {
+ findOne: vi.fn(async () => structuredClone(submission)),
+ updateOne: vi.fn(async () => ({ matchedCount: 1, modifiedCount: 1 })),
+ findOneAndUpdate: vi.fn(async (
+ filter: Record,
+ update: { $set: Record },
+ ) => {
+ if (filter["run._id"] && filter["run._id"] !== submission.run._id) return null;
+ if (update.$set["run.rollover"]) {
+ submission = {
+ ...submission,
+ updatedAt: update.$set.updatedAt as Date,
+ run: {
+ ...submission.run,
+ rollover: update.$set[
+ "run.rollover"
+ ] as SubmissionDocument["run"]["rollover"],
+ updatedAt: update.$set["run.updatedAt"] as Date,
+ },
+ };
+ } else if (update.$set.run) {
+ rollAttempts++;
+ if (rollAttempts === 1) return null;
+ submission = {
+ ...submission,
+ run: update.$set.run as SubmissionDocument["run"],
+ updatedAt: update.$set.updatedAt as Date,
+ };
+ } else {
+ submission = {
+ ...submission,
+ updatedAt: update.$set.updatedAt as Date,
+ run: {
+ ...submission.run,
+ dependencyProjection: update.$set[
+ "run.dependencyProjection"
+ ] as SubmissionDocument["run"]["dependencyProjection"],
+ blocking: update.$set[
+ "run.blocking"
+ ] as SubmissionDocument["run"]["blocking"],
+ updatedAt: update.$set["run.updatedAt"] as Date,
+ },
+ };
+ }
+ return structuredClone(submission);
+ }),
+ } as unknown as Collection;
+ let rollAttempts = 0;
+ const enqueue = vi.fn(async (
+ _service: ServiceHandlerDocument,
+ _message: { submissionId: string; submissionRunId: string; type: string },
+ ) => undefined);
+ const archiveUpdate = vi.fn(async (
+ _filter: unknown,
+ update: { $setOnInsert: SubmissionRunHistoryDocument },
+ ) => {
+ if (!history.some((item) => item._id === update.$setOnInsert._id)) {
+ history.push(update.$setOnInsert);
+ }
+ return { matchedCount: 1, modifiedCount: 1 };
+ });
+ const coordinator = new SubmissionCoordinator(
+ {
+ requests: {
+ find: vi.fn(() => queryResult(requestDocs)),
+ } as unknown as Collection,
+ submissions,
+ submissionRuns: {
+ updateOne: archiveUpdate,
+ } as unknown as Collection,
+ services: {
+ find: vi.fn(() =>
+ queryResult(services.filter((service) => service.type === "post-process-handler")),
+ ),
+ findOne: vi.fn(async () =>
+ services.find((service) => service._id === "pp-readout") ?? null,
+ ),
+ } as unknown as Collection,
+ },
+ enqueue,
+ );
+
+ const result = await coordinator.retryCurrent(
+ "submission-1",
+ "submission-run-1",
+ );
+
+ expect(result?.rolled).toBe(true);
+ expect(result?.submission.run.attemptNumber).toBe(2);
+ expect(result?.submission.run.requests).toEqual([
+ { requestId: "request-1", runId: "run-2" },
+ ]);
+ expect(result?.submission.run.dependencyProjection[0]).toMatchObject({
+ runId: "run-2",
+ state: "ready",
+ version: 2,
+ });
+ expect(history).toHaveLength(1);
+ expect(archiveUpdate).toHaveBeenCalledTimes(2);
+ expect(history[0]).toMatchObject({
+ _id: "submission-run-1",
+ supersededBySubmissionRunId: result?.submission.run._id,
+ supersededReason: "request-vector-changed",
+ });
+ expect(enqueue).toHaveBeenCalledTimes(1);
+ expect(enqueue.mock.calls[0]?.[1]).toMatchObject({
+ submissionId: "submission-1",
+ submissionRunId: result?.submission.run._id,
+ });
+ });
+
+ it("links immutable history only to CAS-winning successors under concurrent vector drift", async () => {
+ const request = (runId: string, attemptNumber: number): RequestDocument => ({
+ _id: "request-1",
+ projectId: "project-1",
+ scenario: { task: "Task", criteria: ["criterion"] },
+ workerType: "worker",
+ createdAt: new Date(),
+ priority: 0,
+ submissionId: "submission-1",
+ run: {
+ _id: runId,
+ attemptNumber,
+ status: "done",
+ },
+ });
+ let submission: SubmissionDocument = {
+ _id: "submission-1",
+ submissionId: "submission-1",
+ projectId: "project-1",
+ requestIds: ["request-1"],
+ createdAt: new Date(),
+ run: {
+ _id: "submission-run-1",
+ attemptNumber: 1,
+ vectorFingerprint: "initial",
+ requests: [{ requestId: "request-1", runId: "run-1" }],
+ createdAt: new Date(),
+ dependencyProjection: [],
+ blocking: [],
+ },
+ };
+ const history = new Map();
+ const submissions = {
+ findOne: vi.fn(async () => structuredClone(submission)),
+ updateOne: vi.fn(async () => ({ matchedCount: 1, modifiedCount: 1 })),
+ findOneAndUpdate: vi.fn(async (
+ filter: Record,
+ update: { $set: Record },
+ ) => {
+ if (filter["run._id"] !== submission.run._id) return null;
+ if (update.$set["run.rollover"]) {
+ if (submission.run.rollover) return null;
+ submission = {
+ ...submission,
+ run: {
+ ...submission.run,
+ rollover: update.$set[
+ "run.rollover"
+ ] as SubmissionDocument["run"]["rollover"],
+ },
+ };
+ } else if (update.$set.run) {
+ if (
+ filter["run.rollover.nextSubmissionRunId"] !==
+ submission.run.rollover?.nextSubmissionRunId
+ ) {
+ return null;
+ }
+ submission = {
+ ...submission,
+ run: update.$set.run as SubmissionDocument["run"],
+ };
+ } else {
+ submission = {
+ ...submission,
+ run: {
+ ...submission.run,
+ dependencyProjection: update.$set[
+ "run.dependencyProjection"
+ ] as SubmissionDocument["run"]["dependencyProjection"],
+ blocking: update.$set[
+ "run.blocking"
+ ] as SubmissionDocument["run"]["blocking"],
+ },
+ };
+ }
+ return structuredClone(submission);
+ }),
+ } as unknown as Collection;
+ const submissionRuns = {
+ updateOne: vi.fn(async (
+ filter: { _id: string },
+ update: { $setOnInsert: SubmissionRunHistoryDocument },
+ ) => {
+ if (!history.has(filter._id)) {
+ history.set(filter._id, structuredClone(update.$setOnInsert));
+ }
+ return { matchedCount: 1, modifiedCount: 1 };
+ }),
+ } as unknown as Collection;
+ const services = {
+ find: vi.fn(() => queryResult([])),
+ findOne: vi.fn(async () => null),
+ } as unknown as Collection