# Generated by apps/docs/scripts/export-native-task-contract.py; do not edit.
openapi: 3.1.0
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
info:
    title: OrbitSpace Native Task API
    version: 1.0.0
    description: Public Task, input request and approval operations. SSE replay semantics are documented separately.
x-orbitspace-contract: orbitspace.native-task/v1
servers:
    - url: https://api.orbitspace.dev
security:
    - bearerAuth: []
paths:
    /api/v1/tasks:
        get:
            tags:
                - TaskService
            operationId: TaskService_ListTasks
            parameters:
                - name: status
                  in: query
                  schema:
                    enum:
                        - TASK_STATUS_UNSPECIFIED
                        - TASK_STATUS_QUEUED
                        - TASK_STATUS_PLANNING
                        - TASK_STATUS_PROVISIONING
                        - TASK_STATUS_RUNNING
                        - TASK_STATUS_WAITING_APPROVAL
                        - TASK_STATUS_WAITING_INPUT
                        - TASK_STATUS_PAUSED
                        - TASK_STATUS_COMPLETED
                        - TASK_STATUS_FAILED
                        - TASK_STATUS_CANCELLED
                    type: string
                    format: enum
                - name: page_size
                  in: query
                  schema:
                    type: integer
                    format: int32
                - name: page_token
                  in: query
                  schema:
                    type: string
                - name: conversation_id
                  in: query
                  schema:
                    type: string
                - name: root_only
                  in: query
                  schema:
                    type: boolean
                - name: status_group
                  in: query
                  description: |-
                    Empty/all preserves the existing behavior; current excludes terminal Tasks,
                     history includes completed, failed and cancelled Tasks. Intersects status.
                  schema:
                    type: string
                - name: query
                  in: query
                  description: Case-insensitive input search or an exact Task/Workspace UUID (max 256 chars).
                  schema:
                    type: string
                - name: summary_only
                  in: query
                  description: Omit full input and other execution configuration from operational lists.
                  schema:
                    type: boolean
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ListTasksResponse'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
        post:
            tags:
                - TaskService
            operationId: TaskService_CreateTask
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/CreateTaskRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Task'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/tasks/{id}:
        get:
            tags:
                - TaskService
            operationId: TaskService_GetTask
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Task'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/tasks/{id}/cancel:
        post:
            tags:
                - TaskService
            operationId: TaskService_CancelTask
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/CancelTaskRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Task'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/tasks/{id}/pause:
        post:
            tags:
                - TaskService
            operationId: TaskService_PauseTask
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/PauseTaskRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Task'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/tasks/{id}/resume:
        post:
            tags:
                - TaskService
            operationId: TaskService_ResumeTask
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/ResumeTaskRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Task'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/tasks/{id}/retry:
        post:
            tags:
                - TaskService
            operationId: TaskService_RetryTask
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/RetryTaskRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Task'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/tasks/{task_id}/events:
        get:
            tags:
                - TaskService
            operationId: TaskService_ListTaskEvents
            parameters:
                - name: task_id
                  in: path
                  required: true
                  schema:
                    type: string
                - name: after_sequence
                  in: query
                  schema:
                    type: string
                - name: page_size
                  in: query
                  schema:
                    type: integer
                    format: int32
                - name: tail
                  in: query
                  description: |-
                    Return the newest page in ascending sequence order. This is intended for
                     conversation previews; callers can still request the complete history by
                     paging forward from after_sequence=0.
                  schema:
                    type: boolean
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ListTaskEventsResponse'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/tasks/{task_id}/input-requests:
        get:
            tags:
                - TaskService
            operationId: TaskService_ListTaskInputRequests
            parameters:
                - name: task_id
                  in: path
                  required: true
                  schema:
                    type: string
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/ListTaskInputRequestsResponse'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/input-requests/{id}:
        get:
            tags:
                - TaskService
            operationId: TaskService_GetTaskInputRequest
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/RunInputRequest'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/input-requests/{id}:reply:
        post:
            tags:
                - TaskService
            operationId: TaskService_ReplyTaskInputRequest
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/ReplyTaskInputRequestRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/RunInputRequest'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/approvals/{id}:
        get:
            tags:
                - ApprovalService
            operationId: ApprovalService_GetApproval
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Approval'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/approvals/{id}/approve:
        post:
            tags:
                - ApprovalService
            operationId: ApprovalService_ApproveApproval
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/ApproveApprovalRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Approval'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
    /api/v1/approvals/{id}/deny:
        post:
            tags:
                - ApprovalService
            operationId: ApprovalService_DenyApproval
            parameters:
                - name: id
                  in: path
                  required: true
                  schema:
                    type: string
            requestBody:
                content:
                    application/json:
                        schema:
                            $ref: '#/components/schemas/DenyApprovalRequest'
                required: true
            responses:
                "200":
                    description: OK
                    content:
                        application/json:
                            schema:
                                $ref: '#/components/schemas/Approval'
                default:
                    description: RFC 9457 Problem Details
                    content:
                        application/problem+json:
                            schema:
                                $ref: '#/components/schemas/ProblemDetails'
components:
    securitySchemes:
        bearerAuth:
            type: http
            scheme: bearer
    schemas:
        Approval:
            type: object
            properties:
                id:
                    type: string
                tenant_id:
                    type: string
                task_id:
                    type: string
                run_id:
                    type: string
                tool_call_id:
                    type: string
                provider_call_id:
                    type: string
                kind:
                    type: string
                request_json:
                    type: string
                    format: bytes
                request_hash:
                    type: string
                status:
                    enum:
                        - APPROVAL_STATUS_UNSPECIFIED
                        - APPROVAL_STATUS_PENDING
                        - APPROVAL_STATUS_APPROVED
                        - APPROVAL_STATUS_DENIED
                        - APPROVAL_STATUS_EXPIRED
                        - APPROVAL_STATUS_CANCELLED
                    type: string
                    format: enum
                decision:
                    type: string
                decided_by:
                    type: string
                expires_at:
                    type: string
                    format: date-time
                decided_at:
                    type: string
                    format: date-time
                created_at:
                    type: string
                    format: date-time
                updated_at:
                    type: string
                    format: date-time
                scope_task_id:
                    type: string
                delegation_approval_policy:
                    enum:
                        - DELEGATION_APPROVAL_POLICY_UNSPECIFIED
                        - DELEGATION_APPROVAL_POLICY_INHERIT
                        - DELEGATION_APPROVAL_POLICY_INDEPENDENT
                    type: string
                    format: enum
                policy_scope_id:
                    type: string
                request_summary:
                    type: string
                manual_decision_required:
                    type: boolean
                    description: |-
                        True when an immutable policy forbids system auto-approval for this
                         specific Tool request.
        ApproveApprovalRequest:
            type: object
            properties:
                id:
                    type: string
        CancelTaskRequest:
            type: object
            properties:
                id:
                    type: string
                expected_state_version:
                    type: string
        CreateTaskRequest:
            type: object
            properties:
                agent_version_id:
                    type: string
                workspace_id:
                    type: string
                input:
                    type: string
                priority:
                    type: integer
                    format: int32
                idempotency_key:
                    type: string
                environment_version_id:
                    type: string
                policy_scope_id:
                    type: string
                model_config:
                    $ref: '#/components/schemas/ModelInvocationConfig'
                participants:
                    type: array
                    items:
                        $ref: '#/components/schemas/TaskParticipant'
                conversation_id:
                    type: string
                workspace_agent_binding_id:
                    type: string
                    description: |-
                        When present, agent_version_id and environment_version_id are resolved
                         from this active Workspace team binding.
                result_contract:
                    type: object
                approval_mode:
                    enum:
                        - EXECUTION_APPROVAL_MODE_UNSPECIFIED
                        - EXECUTION_APPROVAL_MODE_MANUAL
                        - EXECUTION_APPROVAL_MODE_AUTO
                    type: string
                    format: enum
                input_attachments:
                    type: array
                    items:
                        $ref: '#/components/schemas/TaskInputAttachment'
                worktree_id:
                    type: string
                    description: |-
                        Optional explicit branch. When empty, a Conversation reuses its Worktree;
                         otherwise a root Task forks an isolated Worktree from Workspace main.
                token_budget:
                    type: string
                    description: |-
                        Optional aggregate limits for this Task's complete Run, across every
                         model/tool round. Zero keeps the corresponding dimension unlimited.
                cost_budget_microunits:
                    type: string
                    description: This monetary envelope includes all retries and delegated descendants.
                compute_budget_ms:
                    type: string
                skill_invocations:
                    type: array
                    items:
                        type: string
                    description: |-
                        Explicit caller invocation of Skills already pinned in the Environment.
                         Workers cannot supply this field; no implicit delegation inheritance.
                work_contract:
                    $ref: '#/components/schemas/WorkContract'
                cost_budget_currency:
                    type: string
                    description: Optional assertion against the accepted charge price currency; never FX.
        DenyApprovalRequest:
            type: object
            properties:
                id:
                    type: string
        GoogleProtobufValue:
            description: Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.
        ListTaskEventsResponse:
            type: object
            properties:
                events:
                    type: array
                    items:
                        $ref: '#/components/schemas/TaskEvent'
                next_sequence:
                    type: string
        ListTaskInputRequestsResponse:
            type: object
            properties:
                requests:
                    type: array
                    items:
                        $ref: '#/components/schemas/RunInputRequest'
        ListTasksResponse:
            type: object
            properties:
                tasks:
                    type: array
                    items:
                        $ref: '#/components/schemas/Task'
                next_page_token:
                    type: string
                total_count:
                    type: string
        ModelContextCompactionAttempt:
            type: object
            properties:
                id:
                    type: string
                input_digest:
                    type: string
                source_digest:
                    type: string
                round:
                    type: string
                state:
                    type: string
                compaction_id:
                    type: string
            description: Latest durable compaction attempt, including suppressed or failed attempts.
        ModelContextComposition:
            type: object
            properties:
                request_bytes:
                    type: string
                history_bytes:
                    type: string
                media_bytes:
                    type: string
                media_items:
                    type: string
                protected_text_bytes:
                    type: string
                compactable_text_bytes:
                    type: string
                recent_text_bytes:
                    type: string
                tool_bytes:
                    type: string
            description: |-
                Measured serialized request categories. These byte counts are not token
                 estimates and media nodes are not mixed into the text categories.
        ModelContextProgress:
            type: object
            properties:
                last_event_sequence:
                    type: string
                session_id:
                    type: string
                model:
                    type: string
                context_window_tokens:
                    type: string
                max_output_tokens:
                    type: string
                output_reserve_tokens:
                    type: string
                input_limit_tokens:
                    type: string
                input_tokens:
                    type: string
                tokens_reported:
                    type: boolean
                request_bytes:
                    type: string
                bytes_reported:
                    type: boolean
                trigger_bytes:
                    type: string
                limits_source:
                    type: string
                usage_source:
                    type: string
                compaction_count:
                    type: string
                compaction_state:
                    type: string
                last_compaction_id:
                    type: string
                before_bytes:
                    type: string
                after_bytes:
                    type: string
                source_digest:
                    type: string
                composition:
                    $ref: '#/components/schemas/ModelContextComposition'
                retention:
                    $ref: '#/components/schemas/ModelContextRetention'
                compaction_skip_reason:
                    type: string
                compaction_attempt_count:
                    type: string
                constraint_count:
                    type: string
                overflow_recovery_count:
                    type: string
                latest_compaction_attempt:
                    $ref: '#/components/schemas/ModelContextCompactionAttempt'
            description: |-
                Last request measurements and compaction provenance; zero without the reporting
                 flag means unknown. Cumulative consumption remains in TaskStatistics.
        ModelContextRetention:
            type: object
            properties:
                items:
                    type: string
                text_bytes:
                    type: string
                text_budget_bytes:
                    type: string
                estimated_text_tokens:
                    type: string
                token_budget:
                    type: string
                tokens_reported:
                    type: boolean
                token_source:
                    type: string
                indivisible_floor_exceeds_budget:
                    type: boolean
            description: Most recent bounded retention decision used by the context engine.
        ModelInvocationConfig:
            type: object
            properties:
                model:
                    type: string
                reasoning_effort:
                    type: string
            description: |-
                ModelInvocationConfig is shared by Agent defaults, Task overrides and the
                 effective Run snapshot. reasoning_effort is a provider-advertised identifier
                 such as low, xhigh, max, ultra or thinking; OrbitSpace does not freeze the
                 provider's evolving vocabulary into a protobuf enum. Empty Task fields
                 inherit the Agent/provider default.
        PauseTaskRequest:
            type: object
            properties:
                id:
                    type: string
                expected_state_version:
                    type: string
        ProblemDetails:
            type: object
            description: RFC 9457 Problem Details with OrbitSpace correlation extensions.
            required:
                - type
                - title
                - status
                - detail
                - request_id
            properties:
                type:
                    type: string
                    format: uri
                title:
                    type: string
                status:
                    type: integer
                    minimum: 400
                    maximum: 599
                detail:
                    type: string
                instance:
                    type: string
                    format: uri-reference
                code:
                    type: string
                    pattern: '^[A-Z][A-Z0-9_]*$'
                request_id:
                    type: string
                    format: uuid
        ReplyTaskInputRequestRequest:
            type: object
            properties:
                id:
                    type: string
                expected_state_version:
                    type: string
                response:
                    $ref: '#/components/schemas/GoogleProtobufValue'
                artifact_ids:
                    type: array
                    items:
                        type: string
                idempotency_key:
                    type: string
        RepositoryChangeSet:
            type: object
            properties:
                binding_id:
                    type: string
                repository_id:
                    type: string
                key:
                    type: string
                mount_path:
                    type: string
                base_commit:
                    type: string
                head_commit:
                    type: string
                dirty:
                    type: boolean
                conflicted:
                    type: boolean
                ahead_count:
                    type: string
                changed_paths:
                    type: array
                    items:
                        $ref: '#/components/schemas/RepositoryChangedPath'
                insertions:
                    type: string
                deletions:
                    type: string
                patch_artifact_id:
                    type: string
                patch_complete:
                    type: boolean
                    description: |-
                        False means untracked files or a size limit prevented the patch Artifact
                         from representing every changed byte. Workspace Snapshot remains the
                         durable source for those files.
                status_digest:
                    type: string
                    description: |-
                        Digest of the versioned canonical Git base, HEAD, porcelain status and
                         tracked binary diff captured when the Run completed.
                checkout_id:
                    type: string
                    description: |-
                        The operation ID and monotonic Worktree fence under which this state was
                         captured. They let the Control Plane reject a late completion from an old
                         Worker after another Host has acquired the Worktree.
                checkout_fence:
                    type: string
        RepositoryChangedPath:
            type: object
            properties:
                path:
                    type: string
                status:
                    type: string
        ResumeTaskRequest:
            type: object
            properties:
                id:
                    type: string
                expected_state_version:
                    type: string
        RetryTaskRequest:
            type: object
            properties:
                id:
                    type: string
                expected_state_version:
                    type: string
        RunInputRequest:
            type: object
            properties:
                id:
                    type: string
                task_id:
                    type: string
                run_id:
                    type: string
                scope_task_id:
                    type: string
                message:
                    type: string
                response_schema:
                    type: object
                status:
                    type: string
                state_version:
                    type: string
                response:
                    $ref: '#/components/schemas/GoogleProtobufValue'
                response_artifact_ids:
                    type: array
                    items:
                        type: string
                requested_by:
                    type: string
                responded_by:
                    type: string
                expires_at:
                    type: string
                    format: date-time
                created_at:
                    type: string
                    format: date-time
                updated_at:
                    type: string
                    format: date-time
                responded_at:
                    type: string
                    format: date-time
        SkillInvocation:
            type: object
            properties:
                reference:
                    type: string
                registry_version_id:
                    type: string
                content_digest:
                    type: string
                actor_identity_id:
                    type: string
            description: Server-derived immutable selection; an Agent cannot mint operator consent.
        Task:
            type: object
            properties:
                id:
                    type: string
                tenant_id:
                    type: string
                agent_version_id:
                    type: string
                workspace_id:
                    type: string
                input:
                    type: string
                status:
                    enum:
                        - TASK_STATUS_UNSPECIFIED
                        - TASK_STATUS_QUEUED
                        - TASK_STATUS_PLANNING
                        - TASK_STATUS_PROVISIONING
                        - TASK_STATUS_RUNNING
                        - TASK_STATUS_WAITING_APPROVAL
                        - TASK_STATUS_WAITING_INPUT
                        - TASK_STATUS_PAUSED
                        - TASK_STATUS_COMPLETED
                        - TASK_STATUS_FAILED
                        - TASK_STATUS_CANCELLED
                    type: string
                    format: enum
                priority:
                    type: integer
                    format: int32
                state_version:
                    type: string
                created_at:
                    type: string
                    format: date-time
                updated_at:
                    type: string
                    format: date-time
                environment_version_id:
                    type: string
                parent_task_id:
                    type: string
                parent_run_id:
                    type: string
                delegation_id:
                    type: string
                delegation_depth:
                    type: integer
                    format: int32
                policy_scope_id:
                    type: string
                model_config:
                    $ref: '#/components/schemas/ModelInvocationConfig'
                participants:
                    type: array
                    items:
                        $ref: '#/components/schemas/TaskParticipant'
                conversation_id:
                    type: string
                    description: |-
                        Top-level Chat conversation. A conversation may contain Tasks that use
                         different Workspaces.
                workspace_agent_binding_id:
                    type: string
                    description: |-
                        The immutable executable Agent/Environment member selected from the
                         Workspace team for this Task.
                result_contract:
                    type: object
                    description: |-
                        Immutable JSON Schema for the Task's complete final response. When set,
                         Runtime completion is rejected unless final_output is one JSON value that
                         satisfies the schema.
                approval_mode:
                    enum:
                        - EXECUTION_APPROVAL_MODE_UNSPECIFIED
                        - EXECUTION_APPROVAL_MODE_MANUAL
                        - EXECUTION_APPROVAL_MODE_AUTO
                    type: string
                    format: enum
                goal_id:
                    type: string
                    description: |-
                        Present for every Task created as part of a long-running Goal, including
                         delegated and Workflow step Tasks.
                execution_input:
                    type: string
                    description: |-
                        Immutable input executed by the Agent Runtime. For a direct Chat turn the
                         Control Plane derives this from the conversation history and the raw input.
                progress:
                    allOf:
                        - $ref: '#/components/schemas/TaskProgress'
                    description: |-
                        Rebuildable cumulative progress projected from the durable Task event
                         stream and current tool, approval, and delegation state.
                input_artifact_ids:
                    type: array
                    items:
                        type: string
                    description: Immutable user-supplied files materialized into the Runtime Workspace.
                worktree_id:
                    type: string
                    description: |-
                        Mutable filesystem branch used by this Task. workspace_id remains the
                         collaboration, authorization and shared-memory boundary.
                statistics:
                    allOf:
                        - $ref: '#/components/schemas/TaskStatistics'
                    description: |-
                        Cumulative execution statistics across every Run attempt. This summary is
                         returned by both GetTask and ListTasks so Chat and operational lists use
                         one metering and timing model.
                repository_checkouts:
                    type: array
                    items:
                        $ref: '#/components/schemas/TaskRepositoryCheckout'
                    description: Immutable repository inputs captured when the Task is admitted.
                repository_change_sets:
                    type: array
                    items:
                        $ref: '#/components/schemas/RepositoryChangeSet'
                    description: |-
                        Reviewable Git results captured from the terminal Run. These records are
                         durable even when the Runtime sandbox and its local .git directory are gone.
                initiator:
                    allOf:
                        - $ref: '#/components/schemas/TaskInitiator'
                    description: |-
                        Trusted admission-time identity snapshot. Absent on historical Tasks
                         where the initiator was not recorded. Never supplied by the caller.
                input_summary:
                    type: string
                    description: Short plain-text input for list views; the full input is available via GetTask.
                inference_only:
                    type: boolean
                    description: Service-derived bounded model task with no tools, memory or delegation.
                handoff_required:
                    type: boolean
                    description: 'Output-only: requires a Worker capable of materializing the pinned handoff.'
                input_requests_used:
                    type: boolean
                skill_invocations:
                    type: array
                    items:
                        $ref: '#/components/schemas/SkillInvocation'
                work_contract:
                    allOf:
                        - $ref: '#/components/schemas/WorkContract'
                    description: |-
                        Immutable contract used by every Harness implementation. Legacy callers
                         receive a server-derived reported contract.
                work_contract_outcome:
                    allOf:
                        - $ref: '#/components/schemas/WorkContractOutcome'
                    description: Durable Control Plane evaluation; never supplied by the model or Worker.
                platform_operation:
                    type: object
                cost_budget_microunits:
                    type: string
                    description: |-
                        Explicit Task ceiling covers all attempts and delegated descendants.
                         Currency is fixed at admission from the accepted tenant-charge price.
                cost_budget_currency:
                    type: string
        TaskContextSource:
            type: object
            properties:
                kind:
                    type: string
                resource_id:
                    type: string
                reference:
                    type: string
                version_id:
                    type: string
                content_digest:
                    type: string
                scope:
                    type: string
                revision:
                    type: string
                path:
                    type: string
                source_kind:
                    type: string
                source_id:
                    type: string
                source_uri:
                    type: string
                index_generation_id:
                    type: string
                first_event_sequence:
                    type: string
                last_event_sequence:
                    type: string
                access_count:
                    type: string
        TaskEvent:
            type: object
            properties:
                event_id:
                    type: string
                schema_version:
                    type: integer
                    format: int32
                type:
                    type: string
                tenant_id:
                    type: string
                task_id:
                    type: string
                run_id:
                    type: string
                sequence:
                    type: string
                occurred_at:
                    type: string
                    format: date-time
                trace_id:
                    type: string
                payload:
                    type: object
        TaskInitiator:
            type: object
            properties:
                identity_id:
                    type: string
                display_name:
                    type: string
                kind:
                    type: string
                integration_client_id:
                    type: string
                source:
                    type: string
                    description: chat, api, goal, workflow, delegation, or a2a.
        TaskInputAttachment:
            type: object
            properties:
                id:
                    type: string
                    description: Client-generated UUID used for idempotency and Artifact identity.
                name:
                    type: string
                content_type:
                    type: string
                content:
                    type: string
                    format: bytes
        TaskParticipant:
            type: object
            properties:
                agent_version_id:
                    type: string
                model_config:
                    allOf:
                        - $ref: '#/components/schemas/ModelInvocationConfig'
                    description: |-
                        Non-empty fields are operator constraints. Empty fields are selected by
                         the primary Agent and inherit the participant Agent default if omitted.
                default_model_config:
                    allOf:
                        - $ref: '#/components/schemas/ModelInvocationConfig'
                    description: Resolved immutable Agent Version default, returned by the server.
                workspace_agent_binding_id:
                    type: string
                    description: |-
                        When selected from a Workspace team these fields pin delegation to the
                         participant's authorized execution and shared-memory boundary.
                workspace_id:
                    type: string
                environment_version_id:
                    type: string
                role:
                    type: string
                delegation_grant_id:
                    type: string
                    description: |-
                        Server-resolved authorization snapshot for a participant in another
                         persistent Workspace. Request callers must leave these fields empty.
                delegation_grant_state_version:
                    type: string
                delegation_grant_max_depth:
                    type: integer
                    format: int32
                delegation_grant_token_budget:
                    type: string
                delegation_grant_cost_budget_microunits:
                    type: string
                delegation_grant_compute_budget_ms:
                    type: string
                delegation_grant_expires_at:
                    type: string
                    format: date-time
                delegation_grant_cost_budget_currency:
                    type: string
            description: |-
                TaskParticipant selects an immutable Agent Version and optionally overrides
                 its provider-advertised model and reasoning effort for this Task.
        TaskProgress:
            type: object
            properties:
                last_event_sequence:
                    type: string
                model_round:
                    type: string
                model_round_count:
                    type: string
                model_retry_count:
                    type: string
                model_turn_active:
                    type: boolean
                tool_call_count:
                    type: string
                tool_running_count:
                    type: string
                tool_completed_count:
                    type: string
                tool_failed_count:
                    type: string
                approval_count:
                    type: string
                approval_pending_count:
                    type: string
                approval_approved_count:
                    type: string
                approval_denied_count:
                    type: string
                delegation_count:
                    type: string
                delegation_running_count:
                    type: string
                delegation_completed_count:
                    type: string
                delegation_failed_count:
                    type: string
                context:
                    $ref: '#/components/schemas/ModelContextProgress'
                context_sources:
                    type: array
                    items:
                        $ref: '#/components/schemas/TaskContextSource'
                    description: |-
                        Bounded immutable Memory/Skill identities actually returned to the model.
                         Source content remains behind its authoritative service and authorization.
                context_source_omitted_count:
                    type: string
        TaskRepositoryCheckout:
            type: object
            properties:
                binding_id:
                    type: string
                repository_id:
                    type: string
                key:
                    type: string
                mount_path:
                    type: string
                remote_url:
                    type: string
                source_ref:
                    type: string
                resolved_commit:
                    type: string
                primary:
                    type: boolean
                binding_state_version:
                    type: string
                connection_id:
                    type: string
                repository_grant_id:
                    type: string
                access_mode:
                    enum:
                        - REPOSITORY_ACCESS_MODE_UNSPECIFIED
                        - REPOSITORY_ACCESS_MODE_READ
                        - REPOSITORY_ACCESS_MODE_WRITE
                        - REPOSITORY_ACCESS_MODE_PUBLISH
                    type: string
                    format: enum
                grant_state_version:
                    type: string
                resolved_ref:
                    type: string
                credential_required:
                    type: boolean
                comparison_commit:
                    type: string
                    description: |-
                        Trusted orchestration may pin a second read-only snapshot for comparison.
                         Runtime fetches this object without moving the checkout's HEAD.
                comparison_ref:
                    type: string
        TaskStatistics:
            type: object
            properties:
                input_tokens:
                    type: string
                output_tokens:
                    type: string
                model_cost_microunits:
                    type: string
                compute_ms:
                    type: string
                gpu_ms:
                    type: string
                attempt_count:
                    type: string
                elapsed_ms:
                    type: string
                    description: End-to-end wall time from the first Run start through completion or now.
                run_time_ms:
                    type: string
                    description: Sum of active wall time across Run attempts.
                started_at:
                    type: string
                    format: date-time
                finished_at:
                    type: string
                    format: date-time
                cache_read_input_tokens:
                    type: string
                cache_write_input_tokens:
                    type: string
                cache_usage_reported:
                    type: boolean
                    description: |-
                        False means the Provider did not return a cache-usage breakdown. This is
                         different from a reported zero cache hit/write count.
                cache_read_reported:
                    type: boolean
                cache_write_reported:
                    type: boolean
        WorkContract:
            type: object
            properties:
                schema_version:
                    type: string
                    description: Must be orbitspace.work-contract/v1 when supplied by a caller.
                objective:
                    type: string
                constraints:
                    type: array
                    items:
                        type: string
                deliverables:
                    type: array
                    items:
                        type: string
                result_schema:
                    type: object
                    description: |-
                        Schema for the complete final response. result_contract remains a
                         backwards-compatible alias and must match when both are supplied.
                evidence_requirements:
                    type: array
                    items:
                        $ref: '#/components/schemas/WorkEvidenceRequirement'
                completion_mode:
                    enum:
                        - WORK_COMPLETION_MODE_UNSPECIFIED
                        - WORK_COMPLETION_MODE_REPORTED
                        - WORK_COMPLETION_MODE_VERIFIED
                    type: string
                    format: enum
        WorkContractOutcome:
            type: object
            properties:
                status:
                    enum:
                        - WORK_CONTRACT_STATUS_UNSPECIFIED
                        - WORK_CONTRACT_STATUS_PENDING
                        - WORK_CONTRACT_STATUS_REPORTED
                        - WORK_CONTRACT_STATUS_VERIFIED
                        - WORK_CONTRACT_STATUS_REJECTED
                    type: string
                    format: enum
                checks:
                    type: array
                    items:
                        $ref: '#/components/schemas/WorkEvidenceCheck'
                reason:
                    type: string
                evaluated_at:
                    type: string
                    format: date-time
        WorkEvidenceCheck:
            type: object
            properties:
                key:
                    type: string
                kind:
                    enum:
                        - WORK_EVIDENCE_KIND_UNSPECIFIED
                        - WORK_EVIDENCE_KIND_FINAL_OUTPUT
                        - WORK_EVIDENCE_KIND_ARTIFACT
                        - WORK_EVIDENCE_KIND_REPOSITORY_CHANGE
                        - WORK_EVIDENCE_KIND_TOOL_CALL
                    type: string
                    format: enum
                required:
                    type: boolean
                passed:
                    type: boolean
                matched_count:
                    type: string
                summary:
                    type: string
                description:
                    type: string
        WorkEvidenceRequirement:
            type: object
            properties:
                key:
                    type: string
                    description: Stable caller-defined key used by evidence checks and UI projections.
                kind:
                    enum:
                        - WORK_EVIDENCE_KIND_UNSPECIFIED
                        - WORK_EVIDENCE_KIND_FINAL_OUTPUT
                        - WORK_EVIDENCE_KIND_ARTIFACT
                        - WORK_EVIDENCE_KIND_REPOSITORY_CHANGE
                        - WORK_EVIDENCE_KIND_TOOL_CALL
                    type: string
                    format: enum
                required:
                    type: boolean
                description:
                    type: string
                selector:
                    type: object
                    description: |-
                        Kind-specific, bounded selector. V1 supports final-output min_bytes;
                         Artifact kind/name/content_type/min_count; repository binding_id/key,
                         path_globs/exclude_path_globs/min_changed_paths/require_commit/
                         require_task_progress; and Tool Call
                         kind/min_count.
                deadline_model_round:
                    type: integer
                    description: |-
                        Optional live progress deadline. At this model round the Runtime begins
                         rejecting completion until the required evidence exists. V1 supports
                         deadlines for repository_change evidence; 0 defers verification to Task
                         completion.
                    format: int32
                when_result:
                    type: object
                    description: |-
                        Optional bounded JSON Schema applied to the Task's normalized final
                         response. This evidence requirement is evaluated only when the response
                         matches the schema. Conditional requirements cannot declare live model
                         round deadlines because their applicability is known only at completion.
