openapi: 3.1.0 info: title: ACA Canonical Workflow API version: 2.0.0 description: | Coordinated breaking replacement for ingestion, summarization, theme, digest, pipeline, podcast, and audio mutation contracts. All mutations return a durable OperationHandle backed by pgqueuer_jobs. servers: - url: http://localhost:8000 description: Local development - url: https://api.aca.rotkohl.ai description: Production security: - AdminKey: [] paths: /api/v1/capabilities: get: operationId: getCapabilities summary: Discover source, operation, resource, and transport capabilities tags: [capabilities] parameters: - $ref: "#/components/parameters/PageLimit" - $ref: "#/components/parameters/PageCursor" responses: "200": description: Deployment capabilities content: application/json: schema: { $ref: "#/components/schemas/CapabilityDocument" } example: contract_version: "2.0.0" source_commands: - key: rss display_name: RSS emitted_sources: [rss] scheduled: true transports: [cli, http, mcp, frontend] fields: - { name: max_items, type: integer, required: false } operation_types: [ingestion.execute, digest.create] resource_types: [content, digest] next_cursor: null "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } /api/v1/configured-sources: get: operationId: listConfiguredSources summary: List configured ingestion sources without assuming locator fields tags: [capabilities, ingestion] parameters: - $ref: "#/components/parameters/PageLimit" - $ref: "#/components/parameters/PageCursor" responses: "200": description: Configured source page content: application/json: schema: { $ref: "#/components/schemas/ConfiguredSourcePage" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } /api/v1/sources: get: operationId: listSources summary: List the complete operator-managed source configuration catalog tags: [sources] security: - AdminKey: [] - OwnerSession: [] responses: "200": description: Configured source overview and grouped content counts content: application/json: schema: { $ref: "#/components/schemas/SourcesOverview" } "401": { $ref: "#/components/responses/LegacyUnauthorized" } "403": { $ref: "#/components/responses/LegacyForbidden" } post: operationId: upsertSource summary: Add or replace a database source override tags: [sources] security: - AdminKey: [] - OwnerSession: [] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/SourceUpsertRequest" } responses: "200": description: Database override mutation result content: application/json: schema: { $ref: "#/components/schemas/SourceMutationResult" } "400": { $ref: "#/components/responses/LegacyServiceError" } "401": { $ref: "#/components/responses/LegacyUnauthorized" } "403": { $ref: "#/components/responses/LegacyForbidden" } "422": { $ref: "#/components/responses/LegacyValidationError" } /api/v1/sources/{key}: parameters: - name: key in: path required: true description: Ordinary natural key or opaque Obsidian management key; clients URL-encode it. schema: { $ref: "#/components/schemas/PublicSourceKey" } patch: operationId: setSourceEnabled summary: Enable or disable a source, creating a YAML shadow when required tags: [sources] security: - AdminKey: [] - OwnerSession: [] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/SourceEnabledRequest" } responses: "200": description: Database override mutation result content: application/json: schema: { $ref: "#/components/schemas/SourceMutationResult" } "400": { $ref: "#/components/responses/LegacyServiceError" } "401": { $ref: "#/components/responses/LegacyUnauthorized" } "403": { $ref: "#/components/responses/LegacyForbidden" } "404": { $ref: "#/components/responses/LegacyServiceError" } "422": { $ref: "#/components/responses/LegacyValidationError" } delete: operationId: deleteSource summary: Remove a database override, possibly revealing a YAML definition tags: [sources] security: - AdminKey: [] - OwnerSession: [] responses: "200": description: Deleted override result content: application/json: schema: { $ref: "#/components/schemas/SourceDeleteResult" } "400": { $ref: "#/components/responses/LegacyServiceError" } "401": { $ref: "#/components/responses/LegacyUnauthorized" } "403": { $ref: "#/components/responses/LegacyForbidden" } "404": { $ref: "#/components/responses/LegacyServiceError" } "422": { $ref: "#/components/responses/LegacyValidationError" } /api/v1/uploads: post: operationId: createUpload summary: Upload a document for a subsequent files ingestion command tags: [uploads] requestBody: required: true content: multipart/form-data: schema: type: object required: [file] properties: file: { type: string, format: binary } title: { type: string } publication: { type: string } example: title: Architecture notes publication: Internal responses: "201": description: Durable upload reference content: application/json: schema: { $ref: "#/components/schemas/UploadReference" } example: id: upl_01JABCDEF filename: architecture.pdf media_type: application/pdf size_bytes: 18432 "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "413": { $ref: "#/components/responses/ProblemResponse" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/ingestions: get: operationId: listIngestionHistory summary: List compact terminal ingestion history derived from durable operations tags: [operations, ingestion] parameters: - name: command_key in: query required: false schema: { type: string, minLength: 1, maxLength: 100 } - name: configured_source_key in: query required: false schema: { type: string, pattern: "^src_[a-f0-9]{20}$" } - name: outcome in: query required: false schema: { $ref: "#/components/schemas/IngestionOutcome" } - name: status in: query required: false schema: { $ref: "#/components/schemas/TerminalOperationStatus" } - name: parent_operation_id in: query required: false schema: { type: string, pattern: "^[1-9][0-9]*$", maxLength: 19 } - name: created_after in: query required: false schema: { type: string, format: date-time, maxLength: 64 } - name: created_before in: query required: false schema: { type: string, format: date-time, maxLength: 64 } - $ref: "#/components/parameters/PageLimit" - name: cursor in: query required: false schema: { type: string, minLength: 1, maxLength: 2048 } description: Signed keyset cursor bound to the normalized history filters. responses: "200": description: Compact ingestion history page content: application/json: schema: { $ref: "#/components/schemas/IngestionHistoryPage" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "422": { $ref: "#/components/responses/ValidationProblem" } post: operationId: submitIngestion summary: Submit one typed ingestion command tags: [operations, ingestion] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/IngestCommand" } example: kind: arxiv_paper identifier: "2401.12345" extract_pdf: true force_reprocess: false responses: "202": $ref: "#/components/responses/AcceptedIngestionOperation" "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "409": { $ref: "#/components/responses/ConflictProblem" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/summarization-runs: post: operationId: submitSummarization summary: Submit summarization for a content query or explicit IDs tags: [operations, summarization] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/SummarizationRequest" } example: query: { source_types: [rss], limit: 25 } force_reprocess: false responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/theme-analyses: post: operationId: submitThemeAnalysis summary: Submit theme analysis over one canonical resolved content set tags: [operations, themes] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/ThemeAnalysisRequest" } example: query: start_date: "2026-07-06T00:00:00Z" end_date: "2026-07-13T00:00:00Z" date_basis: published_date max_themes: 10 responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/digests: post: operationId: submitDigest summary: Submit durable digest creation tags: [operations, digests] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/DigestCreateRequest" } example: digest_type: weekly period_start: "2026-07-06T00:00:00Z" period_end: "2026-07-13T00:00:00Z" query: { source_types: [gmail, rss], date_basis: published_date } include_historical_context: true responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "409": { $ref: "#/components/responses/ConflictProblem" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/pipeline-runs: post: operationId: submitPipeline summary: Submit the canonical ingest-to-digest pipeline tags: [operations, pipeline] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/PipelineRequest" } example: period: daily period_start: "2026-07-12T00:00:00Z" period_end: "2026-07-13T00:00:00Z" sources: [gmail, rss, readwise] continue_on_source_error: true responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/podcast-scripts: post: operationId: submitPodcastScript summary: Submit podcast script creation from persisted digest provenance tags: [operations, podcasts] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/PodcastScriptRequest" } example: digest_id: 42 length: standard enable_web_search: true custom_focus_topics: [agentic systems] responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "409": { $ref: "#/components/responses/ConflictProblem" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/podcasts: post: operationId: submitPodcastAudio summary: Submit audio generation for an approved podcast script tags: [operations, podcasts] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/PodcastAudioRequest" } example: script_id: 77 voice_provider: openai_tts alex_voice: alex_male sam_voice: sam_female responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "409": { $ref: "#/components/responses/ConflictProblem" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/audio-digests: post: operationId: submitAudioDigest summary: Submit single-voice audio digest generation tags: [operations, audio-digests] parameters: - $ref: "#/components/parameters/IdempotencyKey" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/AudioDigestRequest" } example: digest_id: 42 provider: openai voice: nova speed: 1.1 responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "409": { $ref: "#/components/responses/ConflictProblem" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/operations/{operation_id}: get: operationId: getOperation summary: Get operation state, optionally waiting for change or completion tags: [operations] parameters: - $ref: "#/components/parameters/OperationId" - name: wait_seconds in: query required: false schema: { type: integer, minimum: 0, maximum: 30, default: 0 } example: 10 responses: "200": description: Current operation state content: application/json: schema: { $ref: "#/components/schemas/OperationHandle" } example: schema_version: 2 operation_id: "8123" operation_type: digest.create status: completed progress: 100 message: Digest created cancellable: false retry_count: 0 status_url: /api/v1/operations/8123 events_url: /api/v1/operations/8123/events resource: { type: digest, id: "42", url: /api/v1/digests/42 } result: { selection_fingerprint: "b6d81b360a5672d80c27430f39153e2c" } problem: null created_at: "2026-07-13T10:00:00Z" started_at: "2026-07-13T10:00:01Z" completed_at: "2026-07-13T10:01:12Z" "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "404": { $ref: "#/components/responses/NotFoundProblem" } /api/v1/operations: get: operationId: listOperations summary: List bounded operation summaries using an opaque keyset cursor tags: [operations] parameters: - name: status in: query required: false schema: { $ref: "#/components/schemas/OperationStatus" } description: Optional lifecycle filter used for bounded active hydration. - $ref: "#/components/parameters/PageLimit" - $ref: "#/components/parameters/PageCursor" responses: "200": description: Operation page content: application/json: schema: { $ref: "#/components/schemas/OperationPage" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/workflow-alert-verification-context: get: operationId: getWorkflowAlertVerificationContext summary: Read positive staging deployment identity for destructive alert verification tags: [operations, observability] responses: "200": description: Authenticated staging deployment identity content: application/json: schema: { $ref: "#/components/schemas/WorkflowAlertVerificationContext" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } # Absent outside verified Railway staging. Permanent for a deployment, # so it is a 404 rather than a "retry later" 503. "404": { $ref: "#/components/responses/NotFoundProblem" } /api/v1/workflow-terminal-events/{event_id}: get: operationId: getWorkflowTerminalEvent summary: Read one bounded sanitized workflow terminal-event diagnostic tags: [operations, observability] parameters: - name: event_id in: path required: true schema: { type: string, format: uuid } responses: "200": description: Sanitized terminal-event diagnostic content: application/json: schema: { $ref: "#/components/schemas/WorkflowTerminalEventDiagnostic" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "404": { $ref: "#/components/responses/NotFoundProblem" } "422": { $ref: "#/components/responses/ValidationProblem" } /api/v1/operations/reconcile-content: post: operationId: reconcileContent summary: Preview or apply one bounded page of content reconciliation tags: [operations] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/ContentReconciliationRequest" } example: { apply: false, limit: 50, after_content_id: null } responses: "200": description: Bounded content reconciliation report content: application/json: schema: { $ref: "#/components/schemas/ContentReconciliationReport" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "422": { $ref: "#/components/responses/ValidationProblem" } "409": description: Reconciliation apply is disabled by server policy content: application/problem+json: schema: { $ref: "#/components/schemas/Problem" } /api/v1/operations/{operation_id}/events: get: operationId: streamOperationEvents summary: Stream operation progress events tags: [operations] parameters: - $ref: "#/components/parameters/OperationId" - name: Last-Event-ID in: header required: false schema: { type: string } example: "8123:4" responses: "200": description: Server-sent operation events content: text/event-stream: schema: { $ref: "#/components/schemas/OperationEvent" } example: "id: 8123:5\nevent: progress\ndata: {\"operation_id\":\"8123\",\"status\":\"in_progress\",\"progress\":65,\"message\":\"Creating digest\"}\n\n" "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "404": { $ref: "#/components/responses/NotFoundProblem" } /api/v1/operations/{operation_id}/retry: post: operationId: retryOperation summary: Retry a failed operation tags: [operations] parameters: - $ref: "#/components/parameters/OperationId" requestBody: required: false content: application/json: schema: { type: object, additionalProperties: false } example: {} responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "404": { $ref: "#/components/responses/NotFoundProblem" } "409": { $ref: "#/components/responses/ConflictProblem" } /api/v1/operations/{operation_id}/cancel: post: operationId: cancelOperation summary: Cancel a queued operation or request safe running cancellation tags: [operations] parameters: - $ref: "#/components/parameters/OperationId" requestBody: required: false content: application/json: schema: { type: object, additionalProperties: false } example: {} responses: "202": { $ref: "#/components/responses/AcceptedOperation" } "401": { $ref: "#/components/responses/Unauthorized" } "403": { $ref: "#/components/responses/Forbidden" } "404": { $ref: "#/components/responses/NotFoundProblem" } "409": { $ref: "#/components/responses/ConflictProblem" } /api/v1/operations/{operation_id}/attempts: get: operationId: listOperationAttempts summary: Return bounded observability attempts for one operation security: - OperatorKey: [] parameters: - $ref: '#/components/parameters/OperationId' - $ref: '#/components/parameters/PageLimit' - $ref: '#/components/parameters/AttemptCursor' responses: '200': description: Ordered attempt evidence content: application/json: schema: $ref: '#/components/schemas/OperationAttemptPage' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFoundProblem' /api/v1/status/observability: get: operationId: getObservabilityHealth summary: Return bounded telemetry initialization and delivery health security: - OperatorKey: [] responses: '200': description: Telemetry is initialized and within delivery policy content: application/json: schema: $ref: '#/components/schemas/ObservabilityHealthPage' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '503': description: Required observability is degraded content: application/json: schema: $ref: '#/components/schemas/ObservabilityHealthPage' /api/v1/status/environment-ownership: get: operationId: getEnvironmentOwnershipStatus summary: Return the bounded passive/active ownership-fence status security: - OperatorKey: [] parameters: - name: dry_run_target in: query required: false schema: type: string minLength: 1 maxLength: 32 responses: '200': description: Current ownership status and optional dry-run verdict content: application/json: schema: $ref: '#/components/schemas/EnvironmentOwnershipStatus' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '409': description: Authority fingerprint or epoch conflicts with the requested dry run content: application/problem+json: schema: $ref: '#/components/schemas/Problem' '503': description: Shared ownership authority is unavailable content: application/problem+json: schema: $ref: '#/components/schemas/Problem' components: securitySchemes: AdminKey: type: apiKey in: header name: X-Admin-Key OwnerSession: type: apiKey in: cookie name: session OperatorKey: type: apiKey in: header name: X-Operator-Key description: Distinct privileged capability for deployment-wide diagnostics. A normal authenticated session or legacy admin-compatible session is insufficient. parameters: PageLimit: name: limit in: query required: false schema: { type: integer, minimum: 1, maximum: 100, default: 50 } PageCursor: name: cursor in: query required: false schema: { type: string } IdempotencyKey: name: Idempotency-Key in: header required: false schema: { type: string, minLength: 8, maxLength: 200 } example: "weekly-2026-07-06-gmail-rss" OperationId: name: operation_id in: path required: true schema: type: string pattern: ^([1-9][0-9]{0,17}|[1-8][0-9]{18}|9[01][0-9]{17}|92[01][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$ maxLength: 19 example: "8123" AttemptCursor: name: after_claim_generation in: query required: false schema: $ref: '#/components/schemas/ClaimGenerationString' responses: AcceptedOperation: description: Durable operation accepted or existing idempotent operation returned content: application/json: schema: { $ref: "#/components/schemas/OperationHandle" } example: schema_version: 2 operation_id: "8123" operation_type: digest.create status: queued progress: 0 message: Queued cancellable: true retry_count: 0 status_url: /api/v1/operations/8123 events_url: /api/v1/operations/8123/events resource: null result: null problem: null created_at: "2026-07-13T10:00:00Z" started_at: null completed_at: null AcceptedIngestionOperation: description: Durable ingestion accepted with the serving release identity headers: X-Release-Revision: required: true schema: type: string maxLength: 40 pattern: "^(?:[a-f0-9]{40}|development|unavailable)$" X-Release-Revision-Source: required: true schema: type: string enum: [railway_commit_sha, local_development, unavailable] content: application/json: schema: { $ref: "#/components/schemas/OperationHandle" } ProblemResponse: description: RFC 7807 problem content: application/problem+json: schema: { $ref: "#/components/schemas/Problem" } example: type: https://aca.rotkohl.ai/problems/request-failed title: Request failed status: 400 detail: The request could not be completed Unauthorized: description: Authentication is required content: application/problem+json: schema: { $ref: "#/components/schemas/Problem" } example: type: https://aca.rotkohl.ai/problems/unauthorized title: Unauthorized status: 401 detail: Valid credentials are required Forbidden: description: Credentials do not authorize the operation content: application/problem+json: schema: { $ref: "#/components/schemas/Problem" } example: type: https://aca.rotkohl.ai/problems/forbidden title: Forbidden status: 403 detail: The supplied credentials are not authorized ValidationProblem: description: Request validation failed content: application/problem+json: schema: { $ref: "#/components/schemas/Problem" } example: type: https://aca.rotkohl.ai/problems/validation title: Validation failed status: 422 detail: arxiv_paper.identifier is required errors: - { path: [identifier], code: missing, message: Field required } ConflictProblem: description: Current resource or operation state conflicts with the request content: application/problem+json: schema: { $ref: "#/components/schemas/Problem" } example: type: https://aca.rotkohl.ai/problems/operation-conflict title: Operation conflict status: 409 detail: Completed operations cannot be cancelled NotFoundProblem: description: Requested operation or resource was not found content: application/problem+json: schema: { $ref: "#/components/schemas/Problem" } example: type: https://aca.rotkohl.ai/problems/not-found title: Not found status: 404 detail: Operation 8123 was not found LegacyServiceError: description: Legacy source-management service error content: application/json: schema: { $ref: "#/components/schemas/LegacyDetailError" } LegacyUnauthorized: description: Authentication is required content: application/json: schema: { $ref: "#/components/schemas/LegacyAuthError" } example: error: Authentication required detail: Please log in or provide X-Admin-Key header. LegacyForbidden: description: Explicit credentials are invalid content: application/json: schema: { $ref: "#/components/schemas/LegacyAuthError" } example: error: Forbidden detail: Invalid admin API key LegacyValidationError: description: Request-body or path validation failed content: application/json: schema: { $ref: "#/components/schemas/LegacyValidationErrorBody" } schemas: LegacyDetailError: type: object additionalProperties: false required: [detail] properties: detail: { type: string } LegacyAuthError: type: object additionalProperties: false required: [error, detail] properties: error: { type: string } detail: { type: string } trace_id: { type: [string, "null"] } LegacyValidationErrorBody: type: object additionalProperties: false required: [detail] properties: detail: type: array items: { $ref: "#/components/schemas/LegacyValidationErrorItem" } LegacyValidationErrorItem: type: object additionalProperties: true required: [type, loc, msg] properties: type: { type: string } loc: { type: array, items: { type: [string, integer] } } msg: { type: string } input: {} ctx: { type: object, additionalProperties: true } Problem: type: object additionalProperties: false required: [type, title, status, detail] properties: type: { type: string, format: uri } title: { type: string } status: { type: integer, minimum: 400, maximum: 599 } detail: { type: string } instance: { type: [string, "null"] } code: { type: [string, "null"] } errors: type: array items: type: object additionalProperties: false required: [path, code, message] properties: path: { type: array, items: { type: [string, integer] } } code: { type: string } message: { type: string } ResourceReference: type: object additionalProperties: false required: [type, id, url] properties: type: type: string enum: [content, ingestion_run, summary_batch, theme_analysis, digest, pipeline_run, podcast_script, podcast, audio_digest] id: { type: string } url: { type: string } IngestionOutcome: type: string enum: [success, zero_items, partial, failed, cancelled, unknown] OperationStatus: type: string enum: [queued, in_progress, completed, failed, cancelled] IngestionStatus: type: string enum: [ok, partial, error] TerminalOperationStatus: type: string enum: [completed, failed, cancelled] BoundedDiagnostic: type: object additionalProperties: false required: [code, message] properties: code: { type: string, minLength: 1, maxLength: 100 } message: { type: string, minLength: 1, maxLength: 500 } redirected_source_key: type: [string, "null"] pattern: "^src_[a-f0-9]{20}$" ConfiguredSourceOutcome: type: object additionalProperties: false required: - source_key - status - items_ingested - items_failed - errors - warnings - errors_omitted - warnings_omitted properties: source_key: { type: string, pattern: "^src_[a-f0-9]{20}$" } status: { $ref: "#/components/schemas/IngestionStatus" } items_ingested: { type: integer, minimum: 0 } items_failed: { type: integer, minimum: 0 } errors: type: array maxItems: 20 items: { $ref: "#/components/schemas/BoundedDiagnostic" } warnings: type: array maxItems: 20 items: { $ref: "#/components/schemas/BoundedDiagnostic" } errors_omitted: { type: integer, minimum: 0 } warnings_omitted: { type: integer, minimum: 0 } IngestionResult: oneOf: - { $ref: "#/components/schemas/IngestionResultV1" } - { $ref: "#/components/schemas/IngestionResultV2" } description: >- Legacy V1 rows may predate an explicit schema_version, so readers use structural union validation rather than a discriminator. IngestionResultV1: type: object additionalProperties: false required: [command_key, resolved_route, emitted_sources, items_ingested, content_ids] properties: schema_version: { type: integer, enum: [1], default: 1 } command_key: { type: string } resolved_route: { type: string } emitted_sources: type: array minItems: 1 uniqueItems: true items: { type: string } items_ingested: { type: integer, minimum: 0 } content_ids: type: array uniqueItems: true items: { type: integer, minimum: 1 } warnings: { type: array, items: { type: string } } details: { type: object, additionalProperties: true } description: >- Legacy reader shape. New writers never emit V1 and history must not infer missing outcome/count fields from it. IngestionResultV2: type: object additionalProperties: false x-max-serialized-metadata-bytes: 65536 required: - schema_version - command_key - resolved_route - emitted_sources - status - outcome - items_ingested - items_skipped - items_failed - content_ids - errors - warnings - errors_omitted - warnings_omitted - source_outcomes - source_outcomes_omitted - details - details_omitted properties: schema_version: { type: integer, const: 2 } command_key: { type: string, minLength: 1, maxLength: 100 } resolved_route: { type: string, minLength: 1, maxLength: 100 } emitted_sources: type: array minItems: 1 uniqueItems: true items: { type: string, minLength: 1, maxLength: 100 } status: { $ref: "#/components/schemas/IngestionStatus" } outcome: { $ref: "#/components/schemas/IngestionOutcome" } items_ingested: { type: integer, minimum: 0 } items_skipped: { type: integer, minimum: 0 } items_failed: { type: integer, minimum: 0 } content_ids: type: array uniqueItems: true items: { type: integer, minimum: 1 } description: Exact provenance; excluded from compact list and history projections. errors: type: array maxItems: 20 items: { $ref: "#/components/schemas/BoundedDiagnostic" } warnings: type: array maxItems: 20 items: { $ref: "#/components/schemas/BoundedDiagnostic" } errors_omitted: { type: integer, minimum: 0 } warnings_omitted: { type: integer, minimum: 0 } source_outcomes: type: array maxItems: 100 items: { $ref: "#/components/schemas/ConfiguredSourceOutcome" } source_outcomes_omitted: { type: integer, minimum: 0 } details: { $ref: "#/components/schemas/SafeIngestionDetails" } details_omitted: { type: integer, minimum: 0 } SafeIngestionDetails: type: object additionalProperties: false properties: dry_run: { type: boolean } duplicate: { type: boolean } version_updated: { type: boolean } papers_ingested: { type: integer, minimum: 0 } refs_ingested: { type: integer, minimum: 0 } content_scanned: { type: integer, minimum: 0 } references_found: { type: integer, minimum: 0 } references_resolved: { type: integer, minimum: 0 } references_unresolved: { type: integer, minimum: 0 } queries_made: { type: integer, minimum: 0 } citations_found: { type: integer, minimum: 0 } tool_calls_made: { type: integer, minimum: 0 } threads_found: { type: integer, minimum: 0 } references_recorded: { type: integer, minimum: 0 } links_submitted: { type: integer, minimum: 0 } links_skipped: { type: integer, minimum: 0 } links_retried: { type: integer, minimum: 0 } links_pending: { type: integer, minimum: 0 } PipelineSourceIngestionSummary: type: object additionalProperties: false required: - operation_id - command_key - operation_status - outcome - items_ingested - items_skipped - items_failed properties: operation_id: { type: string, pattern: "^[1-9][0-9]*$", maxLength: 19 } command_key: { type: string, minLength: 1, maxLength: 100 } operation_status: { $ref: "#/components/schemas/TerminalOperationStatus" } outcome: { $ref: "#/components/schemas/IngestionOutcome" } items_ingested: { type: [integer, "null"], minimum: 0 } items_skipped: { type: [integer, "null"], minimum: 0 } items_failed: { type: [integer, "null"], minimum: 0 } PipelineIngestionSummary: type: object additionalProperties: false required: [outcome, sources, sources_omitted] description: >- Aggregate precedence is failed, partial, cancelled, unknown, zero_items, success, with mixed success and zero-item sources classified as success. properties: outcome: { $ref: "#/components/schemas/IngestionOutcome" } sources: type: array maxItems: 100 items: { $ref: "#/components/schemas/PipelineSourceIngestionSummary" } sources_omitted: { type: integer, minimum: 0 } PipelineResultV2: type: object additionalProperties: true x-operation-type: pipeline.run required: [schema_version, ingestion_summary] properties: schema_version: { type: integer, const: 2 } ingestion_summary: { $ref: "#/components/schemas/PipelineIngestionSummary" } ConfiguredSourceHistoryOutcome: type: object additionalProperties: false required: [source_key, status, outcome, items_ingested, items_failed] properties: source_key: { type: string, pattern: "^src_[a-f0-9]{20}$" } status: { $ref: "#/components/schemas/IngestionStatus" } outcome: { $ref: "#/components/schemas/IngestionOutcome" } items_ingested: { type: [integer, "null"], minimum: 0 } items_failed: { type: [integer, "null"], minimum: 0 } error_codes: type: array maxItems: 20 uniqueItems: true items: { type: string, minLength: 1, maxLength: 100 } warning_codes: type: array maxItems: 20 uniqueItems: true items: { type: string, minLength: 1, maxLength: 100 } IngestionHistoryItem: type: object additionalProperties: false required: - operation_id - command_key - operation_status - outcome - items_ingested - items_skipped - items_failed - source_outcomes - retry_count - status_url - created_at properties: operation_id: { type: string, pattern: "^[1-9][0-9]*$", maxLength: 19 } parent_operation_id: { type: [string, "null"], pattern: "^[1-9][0-9]*$", maxLength: 19 } command_key: { type: string, minLength: 1, maxLength: 100 } operation_status: { $ref: "#/components/schemas/TerminalOperationStatus" } outcome: { $ref: "#/components/schemas/IngestionOutcome" } items_ingested: { type: [integer, "null"], minimum: 0 } items_skipped: { type: [integer, "null"], minimum: 0 } items_failed: { type: [integer, "null"], minimum: 0 } source_outcomes: type: array maxItems: 100 items: { $ref: "#/components/schemas/ConfiguredSourceHistoryOutcome" } retry_count: { type: integer, minimum: 0 } problem_code: { type: [string, "null"], maxLength: 100 } status_url: { type: string, pattern: "^/api/v1/operations/[1-9][0-9]*$" } created_at: { type: string, format: date-time } completed_at: { type: [string, "null"], format: date-time } IngestionHistoryPage: type: object additionalProperties: false required: [data] properties: data: type: array maxItems: 100 items: { $ref: "#/components/schemas/IngestionHistoryItem" } next_cursor: { type: [string, "null"], maxLength: 2048 } OperationSummary: type: object additionalProperties: false required: - schema_version - operation_id - operation_type - status - progress - message - cancellable - retry_count - status_url - events_url - created_at properties: schema_version: { type: integer, const: 2 } operation_id: { type: string, pattern: "^[1-9][0-9]*$", maxLength: 19 } operation_type: type: string enum: - ingestion.execute - summarization.run - theme_analysis.create - digest.create - pipeline.run - podcast_script.create - podcast_audio.create - audio_digest.create status: { $ref: "#/components/schemas/OperationStatus" } progress: { type: integer, minimum: 0, maximum: 100 } message: { type: string, maxLength: 500 } cancellable: { type: boolean } retry_count: { type: integer, minimum: 0 } status_url: { type: string, pattern: "^/api/v1/operations/[1-9][0-9]*$" } events_url: { type: string, pattern: "^/api/v1/operations/[1-9][0-9]*/events$" } created_at: { type: string, format: date-time } started_at: { type: [string, "null"], format: date-time } completed_at: { type: [string, "null"], format: date-time } OperationHandle: type: object additionalProperties: false x-operation-result-schemas: ingestion.execute: { $ref: "#/components/schemas/IngestionResult" } pipeline.run: { $ref: "#/components/schemas/PipelineResultV2" } required: - schema_version - operation_id - operation_type - status - progress - message - cancellable - retry_count - status_url - events_url - created_at properties: schema_version: { type: integer, const: 2 } operation_id: { type: string } operation_type: type: string enum: - ingestion.execute - summarization.run - theme_analysis.create - digest.create - pipeline.run - podcast_script.create - podcast_audio.create - audio_digest.create status: { $ref: "#/components/schemas/OperationStatus" } progress: { type: integer, minimum: 0, maximum: 100 } message: { type: string } cancellable: { type: boolean } retry_count: { type: integer, minimum: 0 } status_url: { type: string } events_url: { type: string } resource: anyOf: - { $ref: "#/components/schemas/ResourceReference" } - { type: "null" } result: type: [object, "null"] additionalProperties: true problem: anyOf: - { $ref: "#/components/schemas/Problem" } - { type: "null" } created_at: { type: string, format: date-time } started_at: { type: [string, "null"], format: date-time } completed_at: { type: [string, "null"], format: date-time } observability: oneOf: - { $ref: "#/components/schemas/OperationObservabilitySummary" } - { type: "null" } default: null OperationPage: type: object additionalProperties: false required: [data] properties: data: type: array maxItems: 100 items: { $ref: "#/components/schemas/OperationSummary" } next_cursor: { type: [string, "null"], maxLength: 2048 } WorkflowAlertVerificationContext: type: object additionalProperties: false required: [schema_version, environment_class, revision, revision_source] properties: schema_version: { type: integer, const: 1 } environment_class: { type: string, const: staging } revision: { type: string, minLength: 40, maxLength: 40, pattern: "^[a-f0-9]{40}$" } revision_source: { type: string, const: railway_commit_sha } WorkflowTerminalDeliveryCounts: type: object additionalProperties: false required: [pending, leased, delivered, permanent_failure, exhausted] properties: pending: { type: integer, minimum: 0, maximum: 9223372036854775807 } leased: { type: integer, minimum: 0, maximum: 9223372036854775807 } delivered: { type: integer, minimum: 0, maximum: 9223372036854775807 } permanent_failure: { type: integer, minimum: 0, maximum: 9223372036854775807 } exhausted: { type: integer, minimum: 0, maximum: 9223372036854775807 } WorkflowTerminalEventDiagnostic: type: object additionalProperties: false required: - schema_version - event_id - event_key - source_kind - operation_id - claim_generation - terminal_status - classification_status - release_revision - release_revision_source - occurred_at - telemetry_emitted_at - delivery_counts properties: schema_version: { type: integer, const: 1 } event_id: { type: string, format: uuid } event_key: { type: string, minLength: 1, maxLength: 160, pattern: "^[a-z0-9:_-]+$" } source_kind: type: string enum: [operation, reconciliation_action, reconciliation_failure, system_check] operation_id: type: [string, "null"] maxLength: 19 pattern: "^[1-9][0-9]*$" claim_generation: type: [integer, "null"] minimum: 0 maximum: 2147483647 terminal_status: type: [string, "null"] enum: [completed, failed, cancelled, null] classification_status: type: string enum: [pending, ready, telemetry_only, rejected] release_revision: type: [string, "null"] maxLength: 40 pattern: "^(?:[a-f0-9]{40}|development|unavailable)$" release_revision_source: type: [string, "null"] enum: [railway_commit_sha, local_development, unavailable, null] occurred_at: { type: string, format: date-time } telemetry_emitted_at: { type: [string, "null"], format: date-time } delivery_counts: { $ref: "#/components/schemas/WorkflowTerminalDeliveryCounts" } ContentReconciliationMode: type: string enum: [dry_run, apply] ContentReconciliationProjection: type: string enum: [proposed, observed] ContentReconciliationContentStatus: type: string enum: [pending, parsing, parsed, processing, completed, failed, filtered_out] ContentReconciliationOperationStatus: type: string enum: [queued, in_progress, completed, failed, cancelled] ContentReconciliationPhase: type: string enum: [parsing, processing] ContentReconciliationAction: type: string enum: - none - retry_operation - project_completed - project_parsed - restore_parsed - restore_pending - cancel_restore_parsed - cancel_restore_pending ContentReconciliationReason: type: string enum: - summary_exists - extraction_completed - completed_output_missing - output_owner_mismatch - active_operation - cancellation_pending - execution_locked - cancellation_requested - stale_operation - failed_operation - retry_budget_exhausted - forced_reprocessing - summarization_cancelled - extraction_cancelled - missing_operation - ownership_conflict - incompatible_worker - revalidation_conflict - apply_failed ContentReconciliationRequest: type: object additionalProperties: false properties: apply: { type: boolean, default: false } limit: { type: integer, minimum: 1, maximum: 100 } # contents.id is int4, and asyncpg infers $1 from `c.id > $1`, so anything # above int4 max is rejected by Postgres on the wire rather than by this # schema. Declare the bound the column actually enforces. after_content_id: type: [integer, "null"] minimum: 1 maximum: 2147483647 ContentReconciliationCounts: type: object additionalProperties: false required: - applied - retried - projected - restored - active - locked - missing - conflicted - cancelled - forced - exhausted - incompatible - failed properties: applied: { type: integer, minimum: 0, maximum: 100 } retried: { type: integer, minimum: 0, maximum: 100 } projected: { type: integer, minimum: 0, maximum: 100 } restored: { type: integer, minimum: 0, maximum: 100 } active: { type: integer, minimum: 0, maximum: 100 } locked: { type: integer, minimum: 0, maximum: 100 } missing: { type: integer, minimum: 0, maximum: 100 } conflicted: { type: integer, minimum: 0, maximum: 100 } cancelled: { type: integer, minimum: 0, maximum: 100 } forced: { type: integer, minimum: 0, maximum: 100 } exhausted: { type: integer, minimum: 0, maximum: 100 } incompatible: { type: integer, minimum: 0, maximum: 100 } failed: { type: integer, minimum: 0, maximum: 100 } ContentReconciliationItem: type: object additionalProperties: false required: - content_id - projection - content_status_before - content_status_after - operation_id - claim_generation - claim_protocol_version - operation_status_before - operation_status_after - retry_count_before - retry_count_after - phase - action - reason - applied properties: content_id: { type: integer, minimum: 1, maximum: 2147483647 } projection: { $ref: "#/components/schemas/ContentReconciliationProjection" } content_status_before: { $ref: "#/components/schemas/ContentReconciliationContentStatus" } content_status_after: { $ref: "#/components/schemas/ContentReconciliationContentStatus" } operation_id: type: [string, "null"] pattern: "^[1-9][0-9]{0,18}$" maxLength: 19 claim_generation: type: [integer, "null"] minimum: 1 maximum: 9223372036854775807 claim_protocol_version: type: [integer, "null"] minimum: 1 maximum: 32767 operation_status_before: anyOf: - { $ref: "#/components/schemas/ContentReconciliationOperationStatus" } - { type: "null" } operation_status_after: anyOf: - { $ref: "#/components/schemas/ContentReconciliationOperationStatus" } - { type: "null" } retry_count_before: type: [integer, "null"] minimum: 0 maximum: 2147483647 retry_count_after: type: [integer, "null"] minimum: 0 maximum: 2147483647 phase: anyOf: - { $ref: "#/components/schemas/ContentReconciliationPhase" } - { type: "null" } action: { $ref: "#/components/schemas/ContentReconciliationAction" } reason: { $ref: "#/components/schemas/ContentReconciliationReason" } operation_heartbeat_at: { type: [string, "null"], format: date-time } operation_completed_at: { type: [string, "null"], format: date-time } applied: { type: boolean } ContentReconciliationReport: type: object additionalProperties: false required: [run_id, mode, scanned, reported, counts, items] properties: run_id: { type: string, format: uuid } mode: { $ref: "#/components/schemas/ContentReconciliationMode" } scanned: { type: integer, minimum: 0, maximum: 100 } reported: { type: integer, minimum: 0, maximum: 100 } # Clients feed this straight back into after_content_id, so it must carry # the identical bound. next_after_content_id: type: [integer, "null"] minimum: 1 maximum: 2147483647 counts: { $ref: "#/components/schemas/ContentReconciliationCounts" } items: type: array maxItems: 100 items: { $ref: "#/components/schemas/ContentReconciliationItem" } OperationEvent: type: object additionalProperties: false required: [schema_version, event_id, operation_id, operation_type, status, progress, message, occurred_at] properties: schema_version: { type: integer, const: 2 } event_id: { type: string } operation_id: { type: string } operation_type: type: string enum: - ingestion.execute - summarization.run - theme_analysis.create - digest.create - pipeline.run - podcast_script.create - podcast_audio.create - audio_digest.create status: { $ref: "#/components/schemas/OperationStatus" } progress: { type: integer, minimum: 0, maximum: 100 } message: { type: string } resource: anyOf: - { $ref: "#/components/schemas/ResourceReference" } - { type: "null" } problem: anyOf: - { $ref: "#/components/schemas/Problem" } - { type: "null" } occurred_at: { type: string, format: date-time } UploadReference: type: object additionalProperties: false required: [id, filename, media_type, size_bytes] properties: id: { type: string } filename: { type: string } media_type: { type: string } size_bytes: { type: integer, minimum: 0 } title: { type: [string, "null"] } publication: { type: [string, "null"] } CapabilityField: type: object additionalProperties: false required: [name, type, required] properties: name: { type: string } type: { type: string } required: { type: boolean } description: { type: [string, "null"] } format: { type: [string, "null"] } enum: { type: array, items: { type: string } } default: {} constraints: type: object additionalProperties: true default: {} SourceCapability: type: object additionalProperties: false required: - key - display_name - emitted_sources - scheduled - transports - supports_force - supports_date_range - supports_preview - requires_identifier - fields properties: key: { type: string } display_name: { type: string } emitted_sources: type: array minItems: 1 uniqueItems: true items: { type: string } scheduled: { type: boolean } supports_force: { type: boolean } supports_date_range: { type: boolean } supports_preview: { type: boolean } requires_identifier: { type: boolean } transports: type: array items: { type: string, enum: [cli, http, mcp, frontend] } uniqueItems: true fields: { type: array, items: { $ref: "#/components/schemas/CapabilityField" } } CapabilityDocument: type: object additionalProperties: false required: [contract_version, source_commands, operation_types, resource_types] properties: contract_version: { type: string } source_commands: { type: array, items: { $ref: "#/components/schemas/SourceCapability" } } operation_types: { type: array, items: { type: string } } resource_types: { type: array, items: { type: string } } next_cursor: { type: [string, "null"] } SourceManagementType: type: string enum: [blog, rss, substack, podcast, youtube_playlist, youtube_channel, youtube_rss, gmail, scholar, arxiv, huggingface_papers, websearch, readwise, obsidian_vault] PublicSourceKey: type: string description: Ordinary natural key or HMAC-derived opaque Obsidian management key. pattern: "^(?:src_[a-f0-9]{20}|(?:blog|rss|substack|podcast|youtube_playlist|youtube_channel|youtube_rss|gmail|scholar|arxiv|huggingface_papers|websearch|readwise):.+)$" SourceOverrideConfig: oneOf: - { $ref: "#/components/schemas/BlogSourceOverrideConfig" } - { $ref: "#/components/schemas/RSSSourceOverrideConfig" } - { $ref: "#/components/schemas/SubstackSourceOverrideConfig" } - { $ref: "#/components/schemas/PodcastSourceOverrideConfig" } - { $ref: "#/components/schemas/YouTubePlaylistSourceOverrideConfig" } - { $ref: "#/components/schemas/YouTubeChannelSourceOverrideConfig" } - { $ref: "#/components/schemas/YouTubeRSSSourceOverrideConfig" } - { $ref: "#/components/schemas/GmailSourceOverrideConfig" } - { $ref: "#/components/schemas/ScholarSourceOverrideConfig" } - { $ref: "#/components/schemas/ArxivSourceOverrideConfig" } - { $ref: "#/components/schemas/HuggingFacePapersSourceOverrideConfig" } - { $ref: "#/components/schemas/WebSearchSourceOverrideConfig" } - { $ref: "#/components/schemas/ReadwiseSourceOverrideConfig" } - { $ref: "#/components/schemas/ObsidianVaultSourceOverrideConfig" } discriminator: propertyName: type SourceConfigBase: type: object additionalProperties: true x-model-extra: ignore properties: name: { type: [string, "null"] } tags: { type: array, items: { type: string }, default: [] } enabled: { type: boolean, default: true } max_entries: { type: [integer, "null"] } content_filter_strategy: { type: [string, "null"] } content_filter_topics: { type: [array, "null"], items: { type: string } } content_filter_excerpt_chars: { type: [integer, "null"] } BlogSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, url] properties: type: { type: string, const: blog } url: { type: string } link_selector: { type: [string, "null"] } link_pattern: { type: [string, "null"] } request_delay: { type: number, default: 1.0 } rss_url: { type: [string, "null"] } RSSSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, url] properties: type: { type: string, const: rss } url: { type: string } SubstackSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, url] properties: type: { type: string, const: substack } url: { type: string } PodcastSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, url] properties: type: { type: string, const: podcast } url: { type: string } transcribe: { type: boolean, default: true } stt_provider: { type: string, enum: [openai, local_whisper], default: openai } languages: { type: array, items: { type: string }, default: [en] } YouTubeSourceConfigBase: type: object additionalProperties: true x-model-extra: ignore properties: min_duration_seconds: { type: [integer, "null"] } max_duration_seconds: { type: [integer, "null"] } long_video_threshold_seconds: { type: integer, default: 2700 } long_video_strategy: { type: string, enum: [grounding, segments], default: grounding } video_fps: { type: [number, "null"], default: 0.1 } segment_overlap_seconds: { type: integer, default: 15 } unknown_duration_strategy: { type: string, enum: [short, grounding, segments, skip], default: short } YouTubePlaylistSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, id] properties: type: { type: string, const: youtube_playlist } id: { type: string } visibility: { type: string, enum: [public, private], default: public } min_duration_seconds: { type: [integer, "null"] } max_duration_seconds: { type: [integer, "null"] } long_video_threshold_seconds: { type: integer, default: 2700 } long_video_strategy: { type: string, enum: [grounding, segments], default: grounding } video_fps: { type: [number, "null"], default: 0.1 } segment_overlap_seconds: { type: integer, default: 15 } unknown_duration_strategy: { type: string, enum: [short, grounding, segments, skip], default: short } hint_terms: { type: array, items: { type: string }, default: [] } proofread: { type: boolean, default: true } gemini_summary: { type: boolean, default: true } gemini_resolution: { type: string, default: default } YouTubeChannelSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, channel_id] properties: type: { type: string, const: youtube_channel } channel_id: { type: string } visibility: { type: string, enum: [public, private], default: public } min_duration_seconds: { type: [integer, "null"] } max_duration_seconds: { type: [integer, "null"] } long_video_threshold_seconds: { type: integer, default: 2700 } long_video_strategy: { type: string, enum: [grounding, segments], default: grounding } video_fps: { type: [number, "null"], default: 0.1 } segment_overlap_seconds: { type: integer, default: 15 } unknown_duration_strategy: { type: string, enum: [short, grounding, segments, skip], default: short } languages: { type: array, items: { type: string }, default: [en] } hint_terms: { type: array, items: { type: string }, default: [] } proofread: { type: boolean, default: true } gemini_summary: { type: boolean, default: true } gemini_resolution: { type: string, default: default } YouTubeRSSSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, url] properties: type: { type: string, const: youtube_rss } url: { type: string } min_duration_seconds: { type: [integer, "null"] } max_duration_seconds: { type: [integer, "null"] } long_video_threshold_seconds: { type: integer, default: 2700 } long_video_strategy: { type: string, enum: [grounding, segments], default: grounding } video_fps: { type: [number, "null"], default: 0.1 } segment_overlap_seconds: { type: integer, default: 15 } unknown_duration_strategy: { type: string, enum: [short, grounding, segments, skip], default: short } gemini_summary: { type: boolean, default: true } gemini_resolution: { type: string, default: low } GmailSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type] properties: type: { type: string, const: gmail } query: { type: string, default: "label:newsletters-ai" } max_results: { type: integer, default: 50 } ScholarSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, query] properties: type: { type: string, const: scholar } query: { type: string } fields_of_study: { type: array, items: { type: string }, default: [] } paper_types: { type: array, items: { type: string }, default: [] } min_citation_count: { type: integer, default: 0 } year_range: { type: string, default: "" } venues: { type: array, items: { type: string }, default: [] } ArxivSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type] properties: type: { type: string, const: arxiv } categories: { type: array, items: { type: string }, default: [] } search_query: { type: [string, "null"] } sort_by: { type: string, enum: [relevance, lastUpdatedDate, submittedDate], default: submittedDate } pdf_extraction: { type: boolean, default: true } max_pdf_pages: { type: integer, default: 80 } HuggingFacePapersSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type] properties: type: { type: string, const: huggingface_papers } url: { type: string, default: "https://huggingface.co/papers" } request_delay: { type: number, default: 1.0 } WebSearchSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type, provider, prompt] properties: type: { type: string, const: websearch } provider: { type: string, enum: [perplexity, grok] } prompt: { type: string } max_results: { type: [integer, "null"] } max_threads: { type: [integer, "null"] } recency_filter: { type: [string, "null"] } context_size: { type: [string, "null"] } domain_filter: { type: [array, "null"], items: { type: string } } ReadwiseSourceOverrideConfig: allOf: - { $ref: "#/components/schemas/SourceConfigBase" } - type: object required: [type] properties: type: { type: string, const: readwise } source_types: { type: array, items: { type: string }, default: [] } include_deleted: { type: boolean, default: false } ObsidianVaultSourceOverrideConfig: type: object additionalProperties: false x-model-validators: obsidian_vault required: [type, vault_id, vault_path] properties: type: { type: string, const: obsidian_vault } name: { type: [string, "null"] } tags: { type: array, items: { type: string }, default: [] } enabled: { type: boolean, default: true } content_filter_strategy: { type: [string, "null"] } content_filter_topics: { type: [array, "null"], items: { type: string } } content_filter_excerpt_chars: { type: [integer, "null"] } origin: { type: string, enum: [yaml, db], default: yaml } vault_id: { type: string, minLength: 1, maxLength: 128, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]*$" } vault_path: type: string minLength: 1 maxLength: 4096 pattern: "^/" description: Absolute Unix path; generated models also reject NUL, backslash, and dot/traversal components. ingest_folder: type: string minLength: 1 maxLength: 1024 pattern: '^[^/\\\x00]' default: Inbox description: Safe relative path; generated models also reject empty, dot, traversal, NUL, backslash, and empty components. max_files: { type: integer, minimum: 1, maximum: 10000, default: 1000 } max_entries: { type: integer, minimum: 1, maximum: 100000, default: 10000 } max_total_bytes: { type: integer, minimum: 1, maximum: 268435456, default: 67108864 } max_depth: { type: integer, minimum: 0, maximum: 32, default: 8 } max_duration_seconds: { type: number, exclusiveMinimum: 0, maximum: 3600, default: 300.0 } max_note_bytes: { type: integer, minimum: 1, maximum: 16777216, default: 4194304 } settle_seconds: { type: number, minimum: 0, maximum: 60, default: 0.0 } max_concurrency: { type: integer, minimum: 1, maximum: 8, default: 1 } max_frontmatter_bytes: { type: integer, minimum: 1, maximum: 1048576, default: 16384 } max_yaml_nodes: { type: integer, minimum: 1, maximum: 4096, default: 256 } max_yaml_depth: { type: integer, minimum: 1, maximum: 64, default: 16 } max_yaml_aliases: { type: integer, minimum: 0, maximum: 64, default: 8 } max_yaml_string_chars: { type: integer, minimum: 1, maximum: 65536, default: 4096 } SourceUpsertRequest: type: object additionalProperties: true x-model-extra: ignore description: Only config.type is semantic; unknown request siblings are ignored by /api/v1. required: [config] properties: config: { $ref: "#/components/schemas/SourceOverrideConfig" } description: { type: [string, "null"] } SourceEnabledRequest: type: object additionalProperties: true x-model-extra: ignore description: Only enabled is semantic; unknown request siblings are ignored by /api/v1. required: [enabled] properties: enabled: { type: boolean } SourceInfo: type: object additionalProperties: false required: [type, name, url, enabled, tags, origin, source_key] properties: type: { $ref: "#/components/schemas/SourceManagementType" } name: { type: [string, "null"] } url: { type: string } enabled: { type: boolean } tags: { type: array, items: { type: string } } origin: { type: string, enum: [yaml, db] } source_key: anyOf: - { $ref: "#/components/schemas/PublicSourceKey" } - { type: "null" } SourcesOverview: type: object additionalProperties: false required: [sources, counts, total_sources, enabled_sources] properties: sources: { type: array, items: { $ref: "#/components/schemas/SourceInfo" } } counts: { type: object, additionalProperties: { type: integer, minimum: 0 } } total_sources: { type: integer, minimum: 0 } enabled_sources: { type: integer, minimum: 0 } SourceMutationResult: type: object additionalProperties: false required: [source_key, version, origin, enabled] properties: source_key: { $ref: "#/components/schemas/PublicSourceKey" } version: { type: integer, minimum: 1 } origin: { type: string, enum: [db] } enabled: { type: boolean } SourceDeleteResult: type: object additionalProperties: false required: [source_key, deleted] properties: source_key: { $ref: "#/components/schemas/PublicSourceKey" } deleted: { type: boolean } ConfiguredSource: type: object additionalProperties: false required: [key, command_key, source_type, enabled, origin, configuration, ready, readiness_code] properties: key: { type: string } command_key: { type: string } source_type: { type: string } name: { type: [string, "null"] } enabled: { type: boolean } origin: { type: string, enum: [yaml, db] } configuration: { type: object, additionalProperties: true } ready: { type: boolean, default: true } readiness_code: { type: [string, "null"], default: null } ConfiguredSourcePage: type: object additionalProperties: false required: [data] properties: data: { type: array, items: { $ref: "#/components/schemas/ConfiguredSource" } } next_cursor: { type: [string, "null"] } ContentQuery: type: object additionalProperties: false properties: source_types: type: array items: type: string enum: [gmail, rss, file_upload, youtube, podcast, substack, manual, webpage, xsearch, perplexity, blog, scholar, arxiv, huggingface_papers, readwise, obsidian, x_bookmarks, other] statuses: type: array items: { type: string, enum: [pending, parsing, parsed, processing, completed, failed, filtered_out] } publications: { type: array, items: { type: string } } publication_search: { type: string } start_date: { type: string, format: date-time } end_date: { type: string, format: date-time } date_basis: { type: string, enum: [published_date, ingested_at], default: published_date } search: { type: string } limit: { type: integer, minimum: 1 } sort_by: type: string enum: [id, title, source_type, publication, status, published_date, ingested_at] default: published_date sort_order: { type: string, enum: [asc, desc], default: desc } canonical_only: { type: boolean, default: true } require_summary: { type: boolean, default: true } ConfiguredSourceCommandBase: type: object properties: configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } GmailIngestCommand: allOf: - { $ref: "#/components/schemas/ConfiguredSourceCommandBase" } - type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: gmail } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } query: { type: string } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } RssIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: rss } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } BlogIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: blog } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } SubstackIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: substack } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } YouTubePlaylistIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: youtube_playlist } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } public_only: { type: boolean, default: false } YouTubeRssIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: youtube_rss } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } PodcastIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: podcast } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } transcribe: { type: boolean, default: true } XSearchIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: x_search } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } prompt: { type: string } max_threads: { type: integer, minimum: 1 } force_reprocess: { type: boolean, default: false } PerplexitySearchIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: perplexity_search } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } prompt: { type: string } max_items: { type: integer, minimum: 1 } recency: { type: string, enum: [hour, day, week, month] } context_size: { type: string, enum: [low, medium, high] } force_reprocess: { type: boolean, default: false } FilesIngestCommand: type: object additionalProperties: false required: [kind, upload_ids] properties: kind: { type: string, const: files } upload_ids: { type: array, minItems: 1, items: { type: string } } force_reprocess: { type: boolean, default: false } UrlIngestCommand: type: object additionalProperties: false required: [kind, url] properties: kind: { type: string, const: url } url: { type: string, format: uri } title: { type: string } tags: { type: array, items: { type: string } } notes: { type: string } routing_mode: { type: string, enum: [auto, webpage], default: auto } force_reprocess: { type: boolean, default: false } ScholarSearchIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: scholar_search } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1, default: 20 } ScholarPaperIngestCommand: type: object additionalProperties: false required: [kind, identifier] properties: kind: { type: string, const: scholar_paper } identifier: { type: string, minLength: 1 } with_references: { type: boolean, default: false } ScholarReferencesIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: scholar_references } after: { type: string, format: date-time } before: { type: string, format: date-time } source_types: { type: array, items: { type: string } } dry_run: { type: boolean, default: false } limit: { type: integer, minimum: 1 } ArxivSearchIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: arxiv_search } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1, default: 20 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } extract_pdf: { type: boolean, default: true } ArxivPaperIngestCommand: type: object additionalProperties: false required: [kind, identifier] properties: kind: { type: string, const: arxiv_paper } identifier: { type: string, minLength: 1 } extract_pdf: { type: boolean, default: true } force_reprocess: { type: boolean, default: false } HuggingFacePapersIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: huggingface_papers } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1, default: 30 } days_back: { type: integer, minimum: 0 } after_date: { type: string, format: date-time } force_reprocess: { type: boolean, default: false } ReadwiseIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: readwise } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } updated_after: { type: string, format: date-time } source_types: { type: array, items: { type: string } } include_deleted: { type: boolean, default: false } max_books: { type: integer, minimum: 1 } force_reprocess: { type: boolean, default: false } ObsidianVaultIngestCommand: type: object additionalProperties: false required: [kind, source_key] properties: kind: { type: string, const: obsidian_vault } source_key: { type: string, pattern: "^src_[a-f0-9]{20}$" } configured_source_version: type: string pattern: "^[a-f0-9]{64}$" readOnly: true x-internal: true max_items: { type: integer, minimum: 1, maximum: 10000 } force_reprocess: { type: boolean, default: false } XBookmarksIngestCommand: type: object additionalProperties: false required: [kind] properties: kind: { type: string, const: x_bookmarks } configured_sources: type: array readOnly: true x-internal: true items: { type: object, additionalProperties: true } max_items: { type: integer, minimum: 1, maximum: 10000 } full: { type: boolean, default: false } expand_links: { type: boolean } force_reprocess: { type: boolean, default: false } retry_links: type: boolean default: false description: >- Retry-only mode: skip the bookmarks walk (no X request, no X session needed, backfill cursor unchanged) and spend the whole linked-article budget on stored pending or failed bookmark links, oldest first. IngestCommand: oneOf: - { $ref: "#/components/schemas/GmailIngestCommand" } - { $ref: "#/components/schemas/RssIngestCommand" } - { $ref: "#/components/schemas/BlogIngestCommand" } - { $ref: "#/components/schemas/SubstackIngestCommand" } - { $ref: "#/components/schemas/YouTubePlaylistIngestCommand" } - { $ref: "#/components/schemas/YouTubeRssIngestCommand" } - { $ref: "#/components/schemas/PodcastIngestCommand" } - { $ref: "#/components/schemas/XSearchIngestCommand" } - { $ref: "#/components/schemas/PerplexitySearchIngestCommand" } - { $ref: "#/components/schemas/FilesIngestCommand" } - { $ref: "#/components/schemas/UrlIngestCommand" } - { $ref: "#/components/schemas/ScholarSearchIngestCommand" } - { $ref: "#/components/schemas/ScholarPaperIngestCommand" } - { $ref: "#/components/schemas/ScholarReferencesIngestCommand" } - { $ref: "#/components/schemas/ArxivSearchIngestCommand" } - { $ref: "#/components/schemas/ArxivPaperIngestCommand" } - { $ref: "#/components/schemas/HuggingFacePapersIngestCommand" } - { $ref: "#/components/schemas/ReadwiseIngestCommand" } - { $ref: "#/components/schemas/ObsidianVaultIngestCommand" } - { $ref: "#/components/schemas/XBookmarksIngestCommand" } discriminator: propertyName: kind mapping: gmail: "#/components/schemas/GmailIngestCommand" rss: "#/components/schemas/RssIngestCommand" blog: "#/components/schemas/BlogIngestCommand" substack: "#/components/schemas/SubstackIngestCommand" youtube_playlist: "#/components/schemas/YouTubePlaylistIngestCommand" youtube_rss: "#/components/schemas/YouTubeRssIngestCommand" podcast: "#/components/schemas/PodcastIngestCommand" x_search: "#/components/schemas/XSearchIngestCommand" perplexity_search: "#/components/schemas/PerplexitySearchIngestCommand" files: "#/components/schemas/FilesIngestCommand" url: "#/components/schemas/UrlIngestCommand" scholar_search: "#/components/schemas/ScholarSearchIngestCommand" scholar_paper: "#/components/schemas/ScholarPaperIngestCommand" scholar_references: "#/components/schemas/ScholarReferencesIngestCommand" arxiv_search: "#/components/schemas/ArxivSearchIngestCommand" arxiv_paper: "#/components/schemas/ArxivPaperIngestCommand" huggingface_papers: "#/components/schemas/HuggingFacePapersIngestCommand" readwise: "#/components/schemas/ReadwiseIngestCommand" obsidian_vault: "#/components/schemas/ObsidianVaultIngestCommand" x_bookmarks: "#/components/schemas/XBookmarksIngestCommand" SummarizationRequest: type: object additionalProperties: false properties: content_ids: { type: array, minItems: 1, items: { type: integer, minimum: 1 } } query: { $ref: "#/components/schemas/ContentQuery" } force_reprocess: { type: boolean, default: false } oneOf: - required: [content_ids] - required: [query] ThemeAnalysisRequest: type: object additionalProperties: false required: [query] properties: query: { $ref: "#/components/schemas/ContentQuery" } max_themes: { type: integer, minimum: 1, maximum: 50, default: 10 } DigestCreateRequest: type: object additionalProperties: false required: [digest_type, period_start, period_end] properties: digest_type: { type: string, enum: [daily, weekly] } period_start: { type: string, format: date-time } period_end: { type: string, format: date-time } query: { $ref: "#/components/schemas/ContentQuery" } include_historical_context: { type: boolean, default: true } PipelineRequest: type: object additionalProperties: false required: [period, period_start, period_end] properties: period: { type: string, enum: [daily, weekly] } period_start: { type: string, format: date-time } period_end: { type: string, format: date-time } sources: { type: array, uniqueItems: true, items: { type: string } } continue_on_source_error: { type: boolean, default: true } PodcastScriptRequest: type: object additionalProperties: false required: [digest_id] properties: digest_id: { type: integer, minimum: 1 } length: { type: string, enum: [brief, standard, extended], default: standard } enable_web_search: { type: boolean, default: true } custom_focus_topics: { type: array, items: { type: string } } custom_instructions: { type: string } PodcastAudioRequest: type: object additionalProperties: false required: [script_id] properties: script_id: { type: integer, minimum: 1 } voice_provider: { type: string, enum: [elevenlabs, google_tts, aws_polly, openai_tts], default: openai_tts } alex_voice: { type: string, enum: [alex_male, alex_female], default: alex_male } sam_voice: { type: string, enum: [sam_male, sam_female], default: sam_female } AudioDigestRequest: type: object additionalProperties: false required: [digest_id] properties: digest_id: { type: integer, minimum: 1 } provider: { type: string, default: openai } voice: { type: string, default: nova } speed: { type: number, minimum: 0.5, maximum: 2.0, default: 1.0 } TraceId: type: string pattern: ^(?!0{32}$)[0-9a-f]{32}$ SpanId: type: string pattern: ^(?!0{16}$)[0-9a-f]{16}$ OperationId: type: string pattern: ^([1-9][0-9]{0,17}|[1-8][0-9]{18}|9[01][0-9]{17}|92[01][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$ maxLength: 19 Int64NonNegativeString: type: string pattern: ^(0|[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[01][0-9]{17}|92[01][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$ maxLength: 19 description: Lossless signed-BIGINT non-negative value at JSON/JavaScript boundaries. ClaimGenerationString: type: string pattern: ^(0|[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[01][0-9]{17}|92[01][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-6])$ maxLength: 19 description: Signed BIGINT value with headroom for attempt_number = generation + 1. Int64PositiveString: type: string pattern: ^([1-9][0-9]{0,17}|[1-8][0-9]{18}|9[01][0-9]{17}|92[01][0-9]{16}|922[0-2][0-9]{15}|9223[0-2][0-9]{14}|92233[0-6][0-9]{13}|922337[0-1][0-9]{12}|92233720[0-2][0-9]{10}|922337203[0-5][0-9]{9}|9223372036[0-7][0-9]{8}|92233720368[0-4][0-9]{7}|922337203685[0-3][0-9]{6}|9223372036854[0-6][0-9]{5}|92233720368547[0-6][0-9]{4}|922337203685477[0-4][0-9]{3}|9223372036854775[0-7][0-9]{2}|922337203685477580[0-7])$ maxLength: 19 OperationStage: type: string enum: - submit - queue_wait - claim - fetch - discover - metadata - transcript - extract - parse - filter - deduplicate - model - fallback - persist - index - graph - deliver - backup - restore - alert - cleanup - flush OperationOutcome: type: string enum: - succeeded - partial - skipped_policy - skipped_duplicate - filtered - retryable_failure - permanent_failure - cancelled TelemetryDeliveryState: type: string enum: - pending - delivered - degraded - dropped - disabled OperationContextEnvelope: description: Structural wire schema. Every ingress must additionally call the generated composite semantic validator before accepting an envelope. type: object additionalProperties: false required: - schema_version - operation_id - root_operation_id - parent_operation_id - traceparent - tracestate - trace_id - span_id - claim_generation - attempt_number - entrypoint - service_name - service_instance_id - environment - release_revision - authority_fingerprint - ownership_epoch - stage - resource_kind - resource_key properties: schema_version: type: integer const: 1 operation_id: $ref: '#/components/schemas/OperationId' root_operation_id: $ref: '#/components/schemas/OperationId' parent_operation_id: oneOf: - $ref: '#/components/schemas/OperationId' - type: 'null' traceparent: type: string pattern: ^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$ minLength: 55 maxLength: 55 description: Embedded trace and parent IDs must equal trace_id and span_id. tracestate: type: - string - 'null' pattern: ^[a-z0-9][a-z0-9_*/-]{0,255}=(?:[!-+\--<>-~]|[!-+\--<>-~][ -+\--<>-~]{0,254}[!-+\--<>-~])(,[a-z0-9][a-z0-9_*/-]{0,255}=(?:[!-+\--<>-~]|[!-+\--<>-~][ -+\--<>-~]{0,254}[!-+\--<>-~])){0,31}$ maxLength: 512 description: Optional safe W3C simple-key subset, at most 32 members. trace_id: $ref: '#/components/schemas/TraceId' span_id: $ref: '#/components/schemas/SpanId' claim_generation: $ref: '#/components/schemas/ClaimGenerationString' attempt_number: oneOf: - $ref: '#/components/schemas/Int64PositiveString' - type: 'null' entrypoint: type: string minLength: 1 maxLength: 160 service_name: type: string minLength: 1 maxLength: 100 service_instance_id: type: string minLength: 1 maxLength: 128 environment: type: string minLength: 1 maxLength: 32 release_revision: type: string minLength: 1 maxLength: 64 authority_fingerprint: type: - string - 'null' pattern: ^[0-9a-f]{64}$ maxLength: 64 ownership_epoch: oneOf: - $ref: '#/components/schemas/Int64NonNegativeString' - type: 'null' stage: oneOf: - $ref: '#/components/schemas/OperationStage' - type: 'null' resource_kind: type: - string - 'null' maxLength: 64 resource_key: type: - string - 'null' maxLength: 128 OperationAttemptSummary: type: object additionalProperties: false required: - claim_generation - attempt_number - trace_id - root_span_id - langfuse_observation_id - service_name - service_instance_id - environment - release_revision - started_at - completed_at - terminal_stage - outcome - retryable - telemetry_delivery_state - diagnostic_codes - diagnostics_omitted properties: claim_generation: $ref: '#/components/schemas/ClaimGenerationString' attempt_number: $ref: '#/components/schemas/Int64PositiveString' trace_id: $ref: '#/components/schemas/TraceId' root_span_id: oneOf: - $ref: '#/components/schemas/SpanId' - type: 'null' langfuse_observation_id: type: - string - 'null' maxLength: 64 service_name: type: string maxLength: 100 service_instance_id: type: string maxLength: 128 environment: type: string maxLength: 32 release_revision: type: string maxLength: 64 started_at: type: string format: date-time completed_at: type: - string - 'null' format: date-time terminal_stage: oneOf: - $ref: '#/components/schemas/OperationStage' - type: 'null' outcome: oneOf: - $ref: '#/components/schemas/OperationOutcome' - type: 'null' retryable: type: - boolean - 'null' telemetry_delivery_state: $ref: '#/components/schemas/TelemetryDeliveryState' diagnostic_codes: type: array maxItems: 20 items: type: string pattern: ^[a-z][a-z0-9_.-]{0,99}$ diagnostics_omitted: type: integer minimum: 0 OperationObservabilitySummary: type: object additionalProperties: false required: - root_operation_id - trace_id - attempt_count - telemetry_delivery_state - latest_attempt - langfuse_url properties: root_operation_id: $ref: '#/components/schemas/OperationId' trace_id: $ref: '#/components/schemas/TraceId' attempt_count: type: integer minimum: 0 latest_attempt: oneOf: - $ref: '#/components/schemas/OperationAttemptSummary' - type: 'null' telemetry_delivery_state: $ref: '#/components/schemas/TelemetryDeliveryState' langfuse_url: type: - string - 'null' format: uri maxLength: 2048 OperationAttemptPage: type: object additionalProperties: false required: - schema_version - operation_id - root_operation_id - attempts - attempts_omitted - next_after_claim_generation properties: schema_version: type: integer const: 1 operation_id: $ref: '#/components/schemas/OperationId' root_operation_id: $ref: '#/components/schemas/OperationId' attempts: type: array maxItems: 100 items: $ref: '#/components/schemas/OperationAttemptSummary' attempts_omitted: type: integer minimum: 0 next_after_claim_generation: oneOf: - $ref: '#/components/schemas/ClaimGenerationString' - type: 'null' ProcessObservabilityHealth: type: object additionalProperties: false required: - schema_version - required - initialized - status - service_name - service_instance_id - environment - release_revision - lifecycle_kind - expires_at - export_target - last_heartbeat_at - last_success_at - last_success_age_seconds - last_error_at - last_error_age_seconds - last_error_code - buffered_count - buffer_capacity - dropped_count - last_flush_at - last_flush_succeeded properties: schema_version: type: integer const: 1 required: type: boolean initialized: type: boolean status: type: string enum: - healthy - degraded - disabled - stale service_name: type: string maxLength: 100 service_instance_id: type: string maxLength: 128 environment: type: string maxLength: 32 release_revision: type: string maxLength: 64 lifecycle_kind: type: string enum: - long_running - short_lived expires_at: type: string format: date-time export_target: type: string enum: - local_langfuse - remote_langfuse - other_otlp - none last_heartbeat_at: type: string format: date-time last_success_at: type: - string - 'null' format: date-time last_success_age_seconds: type: - integer - 'null' minimum: 0 last_error_at: type: - string - 'null' format: date-time last_error_age_seconds: type: - integer - 'null' minimum: 0 last_error_code: type: - string - 'null' maxLength: 100 buffered_count: type: integer minimum: 0 buffer_capacity: type: integer minimum: 1 dropped_count: type: integer minimum: 0 last_flush_at: type: - string - 'null' format: date-time last_flush_succeeded: type: - boolean - 'null' ObservabilityHealthPage: type: object additionalProperties: false required: - schema_version - status - generated_at - stale_after_seconds - processes - processes_omitted properties: schema_version: type: integer const: 1 status: type: string enum: - healthy - degraded generated_at: type: string format: date-time stale_after_seconds: type: integer minimum: 1 processes_omitted: type: integer minimum: 0 description: Nonexpired rows outside this deterministic newest-first page. processes: type: array maxItems: 1000 items: $ref: '#/components/schemas/ProcessObservabilityHealth' EnvironmentOwnershipStatus: type: object additionalProperties: false required: - schema_version - configured_environment - active_environment - mode - authority_matches - authority_fingerprint_prefix - epoch - passive_reasons - dry_run properties: schema_version: type: integer const: 1 configured_environment: type: string minLength: 1 maxLength: 32 active_environment: type: string minLength: 1 maxLength: 32 mode: type: string enum: - active - passive - conflict authority_matches: type: boolean authority_fingerprint_prefix: type: string pattern: ^[0-9a-f]{12}$ description: Redacted prefix only; the full authority fingerprint is never returned. epoch: $ref: '#/components/schemas/Int64NonNegativeString' passive_reasons: type: array maxItems: 20 items: type: string pattern: ^[a-z][a-z0-9_.-]{0,99}$ dry_run: oneOf: - $ref: '#/components/schemas/OwnershipDryRun' - type: 'null' OwnershipDryRun: type: object additionalProperties: false required: - target_environment - allowed - next_epoch - checks properties: target_environment: type: string minLength: 1 maxLength: 32 allowed: type: boolean next_epoch: oneOf: - $ref: '#/components/schemas/Int64NonNegativeString' - type: 'null' checks: type: array maxItems: 20 items: type: string pattern: ^[a-z][a-z0-9_.-]{0,99}$