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

# Reprocess quarantine

> Rerun, with the Pipeline Plan active now, the step a Corpus's stuck Versions failed at, typically after a plugin was fixed and activated or a plan rolled back. A Version quarantined at normalization is normalized again, published with its new Manifest and processed; one quarantined at ingestion is segmented, embedded and indexed again. A Version that succeeds goes through the normal path, as for a first success. It becomes current if its Record still desires it, searchable, its alerts are evaluated, and the change feed announces it (record.materialized when its content changed, record.retrieval_ready, record.enrichment_available). A Version that fails again stays quarantined with its new reason. The scope is the Corpus's stuck Versions (see listQuarantinedVersions), kept by the optional filters, taken when the reprocess is accepted. A dry run is required. dry_run true answers 200 with the count and records it under the idempotency key. The same body with dry_run false then accepts the reprocess as a queued Operation (202, Location). Without a dry run recorded under that key and scope, the answer is 409 dry_run_required. The same key with another scope is 409 idempotency_conflict, and an accepted key replays its Operation. A Corpus whose previous reprocess has not finished is 409 reprocess_in_progress. The reprocess runs on the backfills' task queue at the deployment's backfill.rate, pinned to the plan active when it is accepted. It can be paused, resumed, canceled and rerun. Its counters are versions_in_scope, versions_recovered, versions_quarantined (failed again) and versions_skipped (with skipped_<reason>). Requires plugins:admin, on a key of the Corpus's Organization that grants the Corpus.



## OpenAPI

````yaml /openapi.yaml post /v0/admin/quarantine/reprocess
openapi: 3.1.0
info:
  title: Quivr HTTP API
  version: 0.0.0-draft
  description: >-
    Every endpoint of the Quivr v0 HTTP API. Send an API key as a bearer token;
    the key decides the Organization, the actions and the Corpora a request may
    reach.
servers: []
security:
  - ApiKey: []
paths:
  /v0/admin/quarantine/reprocess:
    post:
      tags:
        - Admin
      summary: Reprocess quarantine
      description: >-
        Rerun, with the Pipeline Plan active now, the step a Corpus's stuck
        Versions failed at, typically after a plugin was fixed and activated or
        a plan rolled back. A Version quarantined at normalization is normalized
        again, published with its new Manifest and processed; one quarantined at
        ingestion is segmented, embedded and indexed again. A Version that
        succeeds goes through the normal path, as for a first success. It
        becomes current if its Record still desires it, searchable, its alerts
        are evaluated, and the change feed announces it (record.materialized
        when its content changed, record.retrieval_ready,
        record.enrichment_available). A Version that fails again stays
        quarantined with its new reason. The scope is the Corpus's stuck
        Versions (see listQuarantinedVersions), kept by the optional filters,
        taken when the reprocess is accepted. A dry run is required. dry_run
        true answers 200 with the count and records it under the idempotency
        key. The same body with dry_run false then accepts the reprocess as a
        queued Operation (202, Location). Without a dry run recorded under that
        key and scope, the answer is 409 dry_run_required. The same key with
        another scope is 409 idempotency_conflict, and an accepted key replays
        its Operation. A Corpus whose previous reprocess has not finished is 409
        reprocess_in_progress. The reprocess runs on the backfills' task queue
        at the deployment's backfill.rate, pinned to the plan active when it is
        accepted. It can be paused, resumed, canceled and rerun. Its counters
        are versions_in_scope, versions_recovered, versions_quarantined (failed
        again) and versions_skipped (with skipped_<reason>). Requires
        plugins:admin, on a key of the Corpus's Organization that grants the
        Corpus.
      operationId: reprocessQuarantine
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuarantineReprocessRequest'
      responses:
        '200':
          description: The dry run's count, recorded under the key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuarantineReprocessEstimate'
        '202':
          description: The accepted reprocess Operation; read it at the Location.
          headers:
            Location:
              required: true
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
        default:
          description: >-
            Structured error; 400 malformed, 401 unauthenticated, 403 without
            plugins:admin, 404 unknown Corpus, 409 dry_run_required,
            idempotency_conflict or reprocess_in_progress, 422 invalid_schema or
            invalid_reprocess (an empty window), 503 storage unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    QuarantineReprocessRequest:
      type: object
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 200
        corpus_id:
          type: string
          minLength: 1
        plugin:
          type: string
          minLength: 1
          description: Only Versions whose quarantine reason names this plugin id.
        code:
          type: string
          minLength: 1
          description: Only Versions quarantined with this reason code.
        quarantined_after:
          type: string
          format: date-time
          description: Only Versions quarantined at or after this time.
        quarantined_before:
          type: string
          format: date-time
          description: Only Versions quarantined before this time.
        dry_run:
          type: boolean
          description: >-
            true reports the count and records it; false starts the reprocess a
            dry run with the same key and scope preceded.
      required:
        - idempotency_key
        - corpus_id
        - dry_run
    QuarantineReprocessEstimate:
      type: object
      additionalProperties: false
      properties:
        versions:
          type: integer
          minimum: 0
          description: Stuck Versions in scope.
        stages:
          type: object
          description: Of them, how many failed at each step.
          properties:
            normalization:
              type: integer
              minimum: 0
            ingestion:
              type: integer
              minimum: 0
          required:
            - normalization
            - ingestion
          additionalProperties: false
        codes:
          type: object
          description: Of them, how many by reason code.
          additionalProperties:
            type: integer
            minimum: 0
      required:
        - versions
        - stages
        - codes
    Operation:
      type: object
      additionalProperties: false
      properties:
        operation_id:
          type: string
          minLength: 1
        kind:
          type: string
          minLength: 1
        state:
          type: string
          enum:
            - queued
            - running
            - paused
            - succeeded
            - failed
            - cancel_requested
            - canceled
        progress:
          type: number
          minimum: 0
          maximum: 1
          description: Approximate fraction, omitted when unknown.
        counters:
          type: object
          additionalProperties:
            type: integer
            minimum: 0
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          maxItems: 20
        previous_operation_id:
          type: string
          minLength: 1
        corpus_id:
          type: string
          minLength: 1
        result:
          $ref: '#/components/schemas/ProjectionRebuildResult'
        backfill:
          $ref: '#/components/schemas/OperationBackfill'
        quarantine_reprocess:
          $ref: '#/components/schemas/OperationQuarantineReprocess'
      required:
        - operation_id
        - kind
        - state
        - counters
        - errors
      description: >-
        Administrative execution only. Retries keep identity. Intentional
        terminal rerun has a new ID and previous_operation_id. Cancellation does
        not promise universal rollback; already-terminal state and racing
        completion may win. projection_rebuild, retrieval_configuration and
        backfill Operations require corpus_id; when succeeded they require
        result naming the activated logical generation, or for a backfill the
        generation it filled. A backfill also carries backfill, and its counters
        versions_in_scope, versions_done, versions_skipped (with
        skipped_<reason>) and segments. A quarantine_reprocess carries corpus_id
        and quarantine_reprocess, and its counters versions_in_scope,
        versions_recovered, versions_quarantined and versions_skipped (with
        skipped_<reason>); it has no result. Only a backfill and a
        quarantine_reprocess can be paused.
      if:
        properties:
          kind:
            enum:
              - projection_rebuild
              - retrieval_configuration
              - backfill
        required:
          - kind
      then:
        required:
          - corpus_id
        if:
          properties:
            state:
              const: succeeded
          required:
            - state
        then:
          required:
            - result
    Error:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          minLength: 1
        message:
          type: string
          minLength: 1
        retryable:
          type: boolean
        field:
          type: string
          minLength: 1
          description: >-
            JSON Pointer (RFC 6901) to the request member that caused a 422,
            when known (for example /config/url or /credential/secret/token on
            connector commands).
        resync_url:
          type: string
          format: uri-reference
      required:
        - code
        - message
        - retryable
    ProjectionRebuildResult:
      type: object
      additionalProperties: false
      properties:
        projection_generation_id:
          type: string
          minLength: 1
      required:
        - projection_generation_id
      description: >-
        Logical generation activated for the requested Corpus. Opaque ID, never
        a physical search collection name.
    OperationBackfill:
      type: object
      additionalProperties: false
      description: What a backfill fills and how far it got.
      properties:
        registration_id:
          type: string
          minLength: 1
        spaces:
          type: array
          items:
            type: string
            minLength: 1
        accepted_after:
          type: string
          format: date-time
        accepted_before:
          type: string
          format: date-time
        plan_id:
          type: string
          minLength: 1
          description: The Pipeline Plan the backfill is pinned to, once it started.
        checkpoint:
          type: string
          minLength: 1
          description: >-
            The last Version id it finished; it resumes after it, in Version id
            order.
        estimate:
          $ref: '#/components/schemas/BackfillEstimate'
      required:
        - registration_id
        - spaces
        - estimate
    OperationQuarantineReprocess:
      type: object
      additionalProperties: false
      description: >-
        What a quarantine reprocess covers, the plan it runs with and the dry
        run it followed.
      properties:
        plugin:
          type: string
          minLength: 1
        code:
          type: string
          minLength: 1
        quarantined_after:
          type: string
          format: date-time
        quarantined_before:
          type: string
          format: date-time
        plan_id:
          type: string
          minLength: 1
          description: The Pipeline Plan it runs with, the one active when it was accepted.
        estimate:
          $ref: '#/components/schemas/QuarantineReprocessEstimate'
      required:
        - plan_id
        - estimate
    BackfillEstimate:
      type: object
      additionalProperties: false
      properties:
        registration_id:
          type: string
          minLength: 1
        spaces:
          type: array
          items:
            type: string
            minLength: 1
        versions:
          type: integer
          minimum: 0
          description: Versions in scope that miss a vector in a target space.
        segments:
          type: integer
          minimum: 0
          description: Their segments, which the plugin embeds.
        input_tokens:
          type: integer
          minimum: 0
          description: >-
            Estimated tokens the plugin embeds, one per four code points of
            segment text.
        estimated_seconds:
          type: number
          format: double
          minimum: 0
          description: >-
            How long the backfill should take, at the deployment's backfill.rate
            or the recent throughput, whichever is slower.
        duration_basis:
          type: string
          enum:
            - rate
            - recent_backfills
            - recent_plugin_calls
          description: What the duration comes from.
        estimated_cost_usd:
          type: number
          format: double
          minimum: 0
          description: >-
            Estimated cost in US dollars, rounded up to the cent, of the target
            spaces that declare an input_price in the plugin manifest; a space
            without one adds nothing. Absent when none declares one, so the cost
            is unknown.
        confirmation_required:
          type: boolean
          description: >-
            The cost exceeds backfill.max_cost_without_confirmation, so starting
            the backfill needs confirm_cost.
      required:
        - registration_id
        - spaces
        - versions
        - segments
        - input_tokens
        - estimated_seconds
        - duration_basis
        - confirmation_required
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        API key, not necessarily a JWT. Server derives Organization, permitted
        actions and Corpus scope; every resource access is authorized.

````