> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentsfleet.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish one tested exact-head repair

> Records immutable expected-head and tested-tree authority before one native publication. Refuses workflow changes, unsupported file modes, stale ownership and unresolved effects. Unknown acknowledgements require reconciliation and never repeat the mutation.



## OpenAPI

````yaml https://raw.githubusercontent.com/agentsfleet/agentsfleet/main/public/openapi.json post /v1/runners/me/leases/{lease_id}/tasks/effects
openapi: 3.1.0
info:
  title: agentsfleet API
  description: API for managing workspaces, fleets, triggers, and runs.
  contact:
    name: agentsfleet
    url: https://agentsfleet.net
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.agentsfleet.net
    description: Production
security: []
paths:
  /v1/runners/me/leases/{lease_id}/tasks/effects:
    post:
      tags:
        - Runners
      summary: Publish one tested exact-head repair
      description: >-
        Records immutable expected-head and tested-tree authority before one
        native publication. Refuses workflow changes, unsupported file modes,
        stale ownership and unresolved effects. Unknown acknowledgements require
        reconciliation and never repeat the mutation.
      operationId: runner_publish_task_effect
      parameters:
        - name: lease_id
          in: path
          description: Current lease UUIDv7.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskEffectInput'
        required: true
      responses:
        '200':
          description: Saved operation replay
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEffect'
        '201':
          description: Confirmed new publication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEffect'
        '400':
          description: The request is invalid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '401':
          description: Authentication is missing, invalid, or not accepted by this endpoint
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '403':
          description: You do not have permission for this action
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '404':
          description: The resource was not found or is not accessible to you
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '409':
          description: >-
            Coded problem with the immutable effect receipt; UZ-DT-010
            identifies an uncertain publication
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '413':
          description: The request body exceeds this endpoint's size limit
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '429':
          description: A request or capacity limit has been reached
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '500':
          description: An internal server error occurred
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
        '503':
          description: A required service is unavailable
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemBody'
      security:
        - RunnerBearerAuth: []
components:
  schemas:
    TaskEffectInput:
      type: object
      description: >-
        The supervisor has tested this exact tree against the recorded expected
        head.
      required:
        - operation_id
        - fencing_token
        - task
        - source_item_id
        - covered_input_sequence
        - expected_head
        - tested_tree
        - changes
      properties:
        changes:
          type: array
          items:
            $ref: '#/components/schemas/TaskFileChange'
          description: Complete changes, bounded again by one MiB of decoded bytes.
        covered_input_sequence:
          type: integer
          format: int64
          description: >-
            Every accepted current-task input through this cursor was
            considered.
          minimum: 0
        expected_head:
          type: string
          description: >-
            Exact native old head; GitHub compares it atomically during
            publication.
        fencing_token:
          type: integer
          format: int64
          description: Current slot fence.
          minimum: 0
        operation_id:
          type: string
          description: Stable identity; a lost acknowledgement must reuse this operation.
        source_item_id:
          type: string
          description: Accepted originating action item.
        task:
          $ref: '#/components/schemas/DecisionTaskVersion'
          description: Current selected task and generation.
        tested_tree:
          type: string
          description: Git tree actually tested in the isolated workspace.
      additionalProperties: false
    TaskEffect:
      type: object
      description: No token or arbitrary remote response is exposed in this receipt.
      required:
        - effect_id
        - ordinal
        - state
        - expected_head
        - tested_tree
        - pull_request_url
      properties:
        commit:
          type:
            - string
            - 'null'
          description: Confirmed commit only after native readback.
        effect_id:
          type: string
          description: >-
            Native effect `UUIDv7` discoverable after replacement-worker
            recovery.
        expected_head:
          type: string
          description: Recorded expected branch head.
        ordinal:
          type: integer
          format: int64
          description: Task-local publication order, independent of response delivery.
          minimum: 0
        pull_request_url:
          type: string
          description: Exact accepted PR URL.
        state:
          $ref: '#/components/schemas/TaskEffectState'
          description: Native state.
        tested_tree:
          type: string
          description: Verified candidate tree.
    ProblemBody:
      type: object
      description: The body every refusal carries, under `application/problem+json`.
      required:
        - docs_uri
        - title
        - detail
        - error_code
        - request_id
      properties:
        action_id:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the action the gate held.'
        current_state:
          type:
            - string
            - 'null'
          description: 'On a 409 only: the state that forbade the transition.'
        detail:
          type: string
          description: One sentence on what was refused and why.
        docs_uri:
          type: string
          description: Where the error code is documented.
        error_code:
          type: string
          description: The registry code, stable across releases.
        etag:
          type:
            - string
            - 'null'
          description: >-
            On a 412 only: the resource's current entity tag, to refetch and
            retry.
        gate_id:
          type:
            - string
            - 'null'
          description: 'On an answered approval gate''s 409 only: the gate that was answered.'
        outcome:
          type:
            - string
            - 'null'
          description: 'On that 409 only: the answer that stands.'
        request_id:
          type: string
          description: The request this refusal answers, for support.
        resolved_at:
          type:
            - string
            - 'null'
          format: date-time
          description: 'On that 409 only: when the standing answer was given.'
        resolved_by:
          type:
            - string
            - 'null'
          description: 'On that 409 only: who gave it.'
        title:
          type: string
          description: A short name for the refusal, safe to show a person.
        user_message:
          type:
            - string
            - 'null'
          description: A curated sentence for end users, where the code has one.
    TaskFileChange:
      type: object
      description: Complete content for one supported regular-file change.
      required:
        - path
      properties:
        contents:
          type:
            - string
            - 'null'
          description: Standard base64 contents; null deletes a regular file.
        path:
          type: string
          description: Canonical relative Git path; no Git metadata or workflow changes.
      additionalProperties: false
    DecisionTaskVersion:
      type: object
      description: Task identity and generation supplied from the native lease context.
      required:
        - task_id
        - generation
      properties:
        generation:
          type: integer
          format: int64
          description: >-
            Expected current task generation, without resetting cumulative
            usage.
          minimum: 0
        task_id:
          type: string
          description: >-
            The current lease's objective; not another task selected by model
            text.
      additionalProperties: false
    TaskEffectState:
      type: string
      description: Native publication state, retained independently of a runner response.
      enum:
        - prepared
        - issued
        - confirmed
        - unknown
        - refused
  securitySchemes:
    RunnerBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: agt_r
      description: >-
        Runner token beginning with agt_r, returned once by POST
        /v1/admin/runners

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.