{"version":3,"file":"inference-queue.d.ts","sourceRoot":"","sources":["../../../src/core/shared-inference/inference-queue.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Durable inference queue ledger — store port + validation (3.0.0 foundation).\n *\n * One ledger file per shared inference resource. The ledger is the\n * cross-process scheduling authority: QUEUED requests are durable across\n * restart, RUNNING requests carry a fencing lease, and terminal requests are\n * folded into a bounded history ring with aggregate counters.\n *\n * The ledger NEVER contains prompts, message bodies, or credentials — only\n * correlation ids, estimates, and lifecycle metadata. The surrounding durable\n * AgentSession owns the virtualized context; a queued logical agent is cold,\n * not a duplicated hot prompt.\n */\n\nimport type { InferenceRequestRecord, InferenceRequestSummary } from \"./types.js\";\n\nexport const INFERENCE_LEDGER_SCHEMA_VERSION = 1 as const;\n\n/** Bounded history ring size (terminal request summaries). */\nexport const INFERENCE_HISTORY_LIMIT = 1000;\n\n// =============================================================================\n// Ledger model\n// =============================================================================\n\n/**\n * Per-resource durable ledger.\n *\n * `running` and `queue` are ordered collections. `running` is ordered by slot\n * (index = slot). `queue` is kept in deterministic admission order; the\n * scheduler re-sorts on promotion using the deterministic priority comparator.\n */\nexport interface InferenceResourceLedger {\n\tschemaVersion: 1;\n\tresourceId: string;\n\tcapacity: number;\n\t/** Running (admitted) requests. Length must equal busySlots. */\n\trunning: InferenceRequestRecord[];\n\t/** Queued requests awaiting admission. */\n\tqueue: InferenceRequestRecord[];\n\t/** Most-recent-first bounded terminal summaries. */\n\thistory: InferenceRequestSummary[];\n\t/** Monotonic request sequence for deterministic tiebreak ids. */\n\tnextSeq: number;\n\t/** Monotonic ownership epoch for slot leases. */\n\tfencingToken: number;\n\t// Aggregate telemetry counters (never reset).\n\tcompletedCount: number;\n\tcancelledCount: number;\n\tfailedCount: number;\n\tinterruptedCount: number;\n\ttotalQueueWaitMs: number;\n\ttotalInferenceMs: number;\n\ttotalInputTokens: number;\n\ttotalOutputTokens: number;\n\tmaxQueueDepth: number;\n\tupdatedAtMs: number;\n\trevision: number;\n}\n\n// =============================================================================\n// Store port\n// =============================================================================\n\nexport type InferenceLedgerCreateResult =\n\t| { status: \"created\" }\n\t| { status: \"idempotent\"; ledger: InferenceResourceLedger }\n\t| { status: \"conflict\"; error: string };\n\nexport type InferenceLedgerLoadResult =\n\t| { status: \"ok\"; ledger: InferenceResourceLedger }\n\t| { status: \"missing\" }\n\t| { status: \"corrupt\"; resourceId: string; diagnostic: string };\n\nexport type InferenceLedgerMutation<T> =\n\t| { kind: \"write\"; next: InferenceResourceLedger; value: T }\n\t| { kind: \"noop\"; value: T };\n\nexport type InferenceLedgerMutateResult<T> =\n\t| { status: \"ok\"; value: T }\n\t| { status: \"missing\" }\n\t| { status: \"corrupt\"; resourceId: string; diagnostic: string };\n\nexport interface InferenceQueueStore {\n\treadonly storeId: string;\n\tcreate(resourceId: string, ledger: InferenceResourceLedger): Promise<InferenceLedgerCreateResult>;\n\tload(resourceId: string): Promise<InferenceLedgerLoadResult>;\n\tmutate<T>(\n\t\tresourceId: string,\n\t\tmutation: (current: InferenceResourceLedger) => InferenceLedgerMutation<T>,\n\t): Promise<InferenceLedgerMutateResult<T>>;\n\tlistResources(): Promise<string[]>;\n}\n\n// =============================================================================\n// Construction + validation\n// =============================================================================\n\n/** A resourceId is a path component; reject traversal/injection. */\nexport function isSafeResourceId(value: string): boolean {\n\treturn /^[A-Za-z0-9._-]+$/u.test(value) && value !== \".\" && value !== \"..\";\n}\n\nexport function createEmptyInferenceLedger(options: {\n\tresourceId: string;\n\tcapacity: number;\n\tnow?: number;\n}): InferenceResourceLedger {\n\tif (options.capacity < 1) throw new Error(`Inference resource capacity must be >= 1 (got ${options.capacity})`);\n\treturn {\n\t\tschemaVersion: INFERENCE_LEDGER_SCHEMA_VERSION,\n\t\tresourceId: options.resourceId,\n\t\tcapacity: options.capacity,\n\t\trunning: [],\n\t\tqueue: [],\n\t\thistory: [],\n\t\tnextSeq: 0,\n\t\tfencingToken: 0,\n\t\tcompletedCount: 0,\n\t\tcancelledCount: 0,\n\t\tfailedCount: 0,\n\t\tinterruptedCount: 0,\n\t\ttotalQueueWaitMs: 0,\n\t\ttotalInferenceMs: 0,\n\t\ttotalInputTokens: 0,\n\t\ttotalOutputTokens: 0,\n\t\tmaxQueueDepth: 0,\n\t\tupdatedAtMs: options.now ?? Date.now(),\n\t\trevision: 1,\n\t};\n}\n\nfunction invalid(why: string): { ok: false; diagnostic: string } {\n\treturn { ok: false, diagnostic: why };\n}\n\nfunction isSafeInteger(value: unknown): value is number {\n\treturn typeof value === \"number\" && Number.isSafeInteger(value);\n}\n\nfunction parsePriority(value: unknown): InferenceRequestRecord[\"priority\"] | undefined {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n\tconst p = value as Record<string, unknown>;\n\tif (!isSafeInteger(p.base)) return undefined;\n\treturn {\n\t\tbase: p.base as number,\n\t\tinteractive: typeof p.interactive === \"boolean\" ? p.interactive : undefined,\n\t\tverification: typeof p.verification === \"boolean\" ? p.verification : undefined,\n\t};\n}\n\nfunction parseRequest(value: unknown): { record: InferenceRequestRecord } | { error: string } {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value))\n\t\treturn { error: \"request must be an object\" };\n\tconst r = value as Record<string, unknown>;\n\tif (r.schemaVersion !== 1) return { error: `unsupported request schemaVersion: ${String(r.schemaVersion)}` };\n\tif (typeof r.inferenceRequestId !== \"string\" || r.inferenceRequestId.length === 0)\n\t\treturn { error: \"inferenceRequestId must be a non-empty string\" };\n\tif (typeof r.logicalAgentId !== \"string\" || r.logicalAgentId.length === 0)\n\t\treturn { error: \"logicalAgentId must be a non-empty string\" };\n\tif (typeof r.ownerId !== \"string\" || r.ownerId.length === 0) return { error: \"ownerId must be a non-empty string\" };\n\tif (typeof r.resourceId !== \"string\" || !isSafeResourceId(r.resourceId))\n\t\treturn { error: \"resourceId is missing or unsafe\" };\n\tif (typeof r.provider !== \"string\" || typeof r.model !== \"string\")\n\t\treturn { error: \"provider and model must be strings\" };\n\tif (!isSafeInteger(r.requestedAtMs) || !isSafeInteger(r.enqueuedAtMs))\n\t\treturn { error: \"requestedAtMs/enqueuedAtMs must be safe integers\" };\n\tconst priority = parsePriority(r.priority);\n\tif (!priority) return { error: \"priority.base must be a safe integer\" };\n\tif (\n\t\t!(\n\t\t\tr.state === \"QUEUED\" ||\n\t\t\tr.state === \"RUNNING\" ||\n\t\t\tr.state === \"COMPLETED\" ||\n\t\t\tr.state === \"FAILED\" ||\n\t\t\tr.state === \"CANCELLED\" ||\n\t\t\tr.state === \"INTERRUPTED\"\n\t\t)\n\t)\n\t\treturn { error: `invalid request state: ${String(r.state)}` };\n\n\tlet dependency: InferenceRequestRecord[\"dependency\"];\n\tif (r.dependency !== undefined) {\n\t\tif (typeof r.dependency !== \"object\" || r.dependency === null || Array.isArray(r.dependency))\n\t\t\treturn { error: \"dependency must be an object\" };\n\t\tconst d = r.dependency as Record<string, unknown>;\n\t\tif (!isSafeInteger(d.unblocksCount) || (d.unblocksCount as number) < 0)\n\t\t\treturn { error: \"dependency.unblocksCount must be a non-negative integer\" };\n\t\tdependency = { unblocksCount: d.unblocksCount as number };\n\t}\n\n\tlet lease: InferenceRequestRecord[\"lease\"];\n\tif (r.lease !== undefined) {\n\t\tif (typeof r.lease !== \"object\" || r.lease === null || Array.isArray(r.lease))\n\t\t\treturn { error: \"lease must be an object\" };\n\t\tconst l = r.lease as Record<string, unknown>;\n\t\tif (typeof l.ownerId !== \"string\" || typeof l.leaseId !== \"string\")\n\t\t\treturn { error: \"lease ownerId/leaseId must be strings\" };\n\t\tif (!isSafeInteger(l.slot) || !isSafeInteger(l.acquiredAtMs) || !isSafeInteger(l.expiresAtMs))\n\t\t\treturn { error: \"lease slot/timestamps must be safe integers\" };\n\t\tlease = {\n\t\t\townerId: l.ownerId as string,\n\t\t\tleaseId: l.leaseId as string,\n\t\t\tslot: l.slot as number,\n\t\t\tacquiredAtMs: l.acquiredAtMs as number,\n\t\t\texpiresAtMs: l.expiresAtMs as number,\n\t\t};\n\t}\n\n\treturn {\n\t\trecord: {\n\t\t\tschemaVersion: 1,\n\t\t\tinferenceRequestId: r.inferenceRequestId as string,\n\t\t\tlogicalAgentId: r.logicalAgentId as string,\n\t\t\townerId: r.ownerId as string,\n\t\t\tmissionId: typeof r.missionId === \"string\" ? r.missionId : undefined,\n\t\t\tassignmentId: typeof r.assignmentId === \"string\" ? r.assignmentId : undefined,\n\t\t\texecutionId: typeof r.executionId === \"string\" ? r.executionId : undefined,\n\t\t\tresourceId: r.resourceId as string,\n\t\t\tprovider: r.provider as string,\n\t\t\tmodel: r.model as string,\n\t\t\trequestedAtMs: r.requestedAtMs as number,\n\t\t\tenqueuedAtMs: r.enqueuedAtMs as number,\n\t\t\tpriority,\n\t\t\tdependency,\n\t\t\testimatedInputTokens: isSafeInteger(r.estimatedInputTokens) ? (r.estimatedInputTokens as number) : undefined,\n\t\t\tmaxOutputTokens: isSafeInteger(r.maxOutputTokens) ? (r.maxOutputTokens as number) : undefined,\n\t\t\tstate: r.state as InferenceRequestRecord[\"state\"],\n\t\t\tlease,\n\t\t\tadmittedAtMs: isSafeInteger(r.admittedAtMs) ? (r.admittedAtMs as number) : undefined,\n\t\t\tfinishedAtMs: isSafeInteger(r.finishedAtMs) ? (r.finishedAtMs as number) : undefined,\n\t\t\tqueueWaitMs: isSafeInteger(r.queueWaitMs) ? (r.queueWaitMs as number) : undefined,\n\t\t\tinferenceWallMs: isSafeInteger(r.inferenceWallMs) ? (r.inferenceWallMs as number) : undefined,\n\t\t\tinputTokens: isSafeInteger(r.inputTokens) ? (r.inputTokens as number) : undefined,\n\t\t\toutputTokens: isSafeInteger(r.outputTokens) ? (r.outputTokens as number) : undefined,\n\t\t\terrorMessage: typeof r.errorMessage === \"string\" ? r.errorMessage : undefined,\n\t\t},\n\t};\n}\n\nfunction parseSummary(value: unknown): { record: InferenceRequestSummary } | { error: string } {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value))\n\t\treturn { error: \"summary must be an object\" };\n\tconst r = value as Record<string, unknown>;\n\tif (typeof r.inferenceRequestId !== \"string\" || typeof r.logicalAgentId !== \"string\")\n\t\treturn { error: \"summary must have string inferenceRequestId/logicalAgentId\" };\n\tif (typeof r.resourceId !== \"string\" || typeof r.provider !== \"string\" || typeof r.model !== \"string\")\n\t\treturn { error: \"summary must have string resourceId/provider/model\" };\n\tif (!isSafeInteger(r.requestedAtMs) || !isSafeInteger(r.enqueuedAtMs))\n\t\treturn { error: \"summary timestamps must be safe integers\" };\n\tif (!(r.state === \"COMPLETED\" || r.state === \"FAILED\" || r.state === \"CANCELLED\" || r.state === \"INTERRUPTED\"))\n\t\treturn { error: `invalid summary state: ${String(r.state)}` };\n\n\treturn {\n\t\trecord: {\n\t\t\tinferenceRequestId: r.inferenceRequestId as string,\n\t\t\tlogicalAgentId: r.logicalAgentId as string,\n\t\t\tresourceId: r.resourceId as string,\n\t\t\tprovider: r.provider as string,\n\t\t\tmodel: r.model as string,\n\t\t\trequestedAtMs: r.requestedAtMs as number,\n\t\t\tenqueuedAtMs: r.enqueuedAtMs as number,\n\t\t\tstate: r.state as InferenceRequestSummary[\"state\"],\n\t\t\tadmittedAtMs: isSafeInteger(r.admittedAtMs) ? (r.admittedAtMs as number) : undefined,\n\t\t\tfinishedAtMs: isSafeInteger(r.finishedAtMs) ? (r.finishedAtMs as number) : undefined,\n\t\t\tqueueWaitMs: isSafeInteger(r.queueWaitMs) ? (r.queueWaitMs as number) : undefined,\n\t\t\tinferenceWallMs: isSafeInteger(r.inferenceWallMs) ? (r.inferenceWallMs as number) : undefined,\n\t\t\tinputTokens: isSafeInteger(r.inputTokens) ? (r.inputTokens as number) : undefined,\n\t\t\toutputTokens: isSafeInteger(r.outputTokens) ? (r.outputTokens as number) : undefined,\n\t\t\terrorMessage: typeof r.errorMessage === \"string\" ? r.errorMessage : undefined,\n\t\t},\n\t};\n}\n\n/**\n * Validate an untrusted persisted ledger. Corruption is surfaced structurally\n * and never fabricated into a free slot or a completed inference.\n */\nexport function parseInferenceResourceLedger(\n\tvalue: unknown,\n): { ok: true; ledger: InferenceResourceLedger } | { ok: false; diagnostic: string } {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return invalid(\"ledger must be an object\");\n\tconst doc = value as Record<string, unknown>;\n\tif (doc.schemaVersion !== INFERENCE_LEDGER_SCHEMA_VERSION)\n\t\treturn invalid(`unsupported schemaVersion: ${String(doc.schemaVersion)}`);\n\tif (typeof doc.resourceId !== \"string\" || !isSafeResourceId(doc.resourceId))\n\t\treturn invalid(\"resourceId is missing or unsafe\");\n\tconst resourceId = doc.resourceId;\n\tif (!isSafeInteger(doc.capacity) || (doc.capacity as number) < 1) return invalid(\"capacity must be an integer >= 1\");\n\tif (!isSafeInteger(doc.nextSeq) || (doc.nextSeq as number) < 0)\n\t\treturn invalid(\"nextSeq must be a non-negative integer\");\n\tif (!isSafeInteger(doc.fencingToken) || (doc.fencingToken as number) < 0)\n\t\treturn invalid(\"fencingToken must be a non-negative integer\");\n\tif (!isSafeInteger(doc.updatedAtMs) || !isSafeInteger(doc.revision))\n\t\treturn invalid(\"updatedAtMs/revision must be safe integers\");\n\tfor (const key of [\"completedCount\", \"cancelledCount\", \"failedCount\", \"interruptedCount\", \"maxQueueDepth\"]) {\n\t\tif (!isSafeInteger(doc[key]) || (doc[key] as number) < 0) return invalid(`${key} must be a non-negative integer`);\n\t}\n\tfor (const key of [\"totalQueueWaitMs\", \"totalInferenceMs\", \"totalInputTokens\", \"totalOutputTokens\"]) {\n\t\tif (!isSafeInteger(doc[key]) || (doc[key] as number) < 0) return invalid(`${key} must be a non-negative integer`);\n\t}\n\n\tif (!Array.isArray(doc.running) || !Array.isArray(doc.queue) || !Array.isArray(doc.history))\n\t\treturn invalid(\"running/queue/history must be arrays\");\n\n\tconst running: InferenceRequestRecord[] = [];\n\tfor (const entry of doc.running) {\n\t\tconst parsed = parseRequest(entry);\n\t\tif (\"error\" in parsed) return invalid(`running: ${parsed.error}`);\n\t\trunning.push(parsed.record);\n\t}\n\tconst queue: InferenceRequestRecord[] = [];\n\tfor (const entry of doc.queue) {\n\t\tconst parsed = parseRequest(entry);\n\t\tif (\"error\" in parsed) return invalid(`queue: ${parsed.error}`);\n\t\tqueue.push(parsed.record);\n\t}\n\tconst history: InferenceRequestSummary[] = [];\n\tfor (const entry of doc.history) {\n\t\tconst parsed = parseSummary(entry);\n\t\tif (\"error\" in parsed) return invalid(`history: ${parsed.error}`);\n\t\thistory.push(parsed.record);\n\t}\n\n\t// Structural invariant: the slot count is derived from running.length; the\n\t// ledger never persists a separate busySlots field that could drift.\n\tconst busySlots = running.length;\n\tif (busySlots > (doc.capacity as number)) return invalid(\"running.length exceeds capacity\");\n\n\treturn {\n\t\tok: true,\n\t\tledger: {\n\t\t\tschemaVersion: INFERENCE_LEDGER_SCHEMA_VERSION,\n\t\t\tresourceId,\n\t\t\tcapacity: doc.capacity as number,\n\t\t\trunning,\n\t\t\tqueue,\n\t\t\thistory,\n\t\t\tnextSeq: doc.nextSeq as number,\n\t\t\tfencingToken: doc.fencingToken as number,\n\t\t\tcompletedCount: doc.completedCount as number,\n\t\t\tcancelledCount: doc.cancelledCount as number,\n\t\t\tfailedCount: doc.failedCount as number,\n\t\t\tinterruptedCount: doc.interruptedCount as number,\n\t\t\ttotalQueueWaitMs: doc.totalQueueWaitMs as number,\n\t\t\ttotalInferenceMs: doc.totalInferenceMs as number,\n\t\t\ttotalInputTokens: doc.totalInputTokens as number,\n\t\t\ttotalOutputTokens: doc.totalOutputTokens as number,\n\t\t\tmaxQueueDepth: doc.maxQueueDepth as number,\n\t\t\tupdatedAtMs: doc.updatedAtMs as number,\n\t\t\trevision: doc.revision as number,\n\t\t},\n\t};\n}\n"]}