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

# Compare versions of insurance wording

> Not implemented yet: returns 501 until the implementation ships. Start a cited comparison of 2–4 versions of insurance wording ("variants"): an endpoint or a set of forms per variant, plus optional shared or per-variant context (product, documents, facts), knowledge files, focus questions, scenarios and reviewer annotations. Each input is a file you can read and download; its current version is pinned and only pinned inputs can be cited. Poll getFormComparison with the returned id (or follow Location), or subscribe to the form_comparison.completed and form_comparison.failed webhooks; a comparison not finished 30 minutes after launch fails with execution_timeout. Send an Idempotency-Key to retry safely: a retry with the same key and request returns the same comparison (202 while queued or running, 200 once finished) and never starts new work; the same key with a different request is 409 idempotency_conflict. Without a key, every POST starts a new comparison. Keys last 7 days (idempotencyExpiresAt). Inputs must have extracted text: 409 input_not_ready while extraction runs (retry after Retry-After), 422 input_unreadable when a file has no text (scanned PDFs are not OCRed). Knowledge files must pass validateFormKnowledge without errors. Limits: 20 inputs, 50 annotations, 64 KiB. Billed by session credits; read-only members cannot create comparisons.



## OpenAPI

````yaml /openapi.json post /insurance/form-comparisons
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.canary.effectiveai.app/api/v2
    description: Canary
security:
  - bearerAuth: []
paths:
  /insurance/form-comparisons:
    post:
      tags:
        - Form comparisons
      summary: Compare versions of insurance wording
      description: >-
        Not implemented yet: returns 501 until the implementation ships. Start a
        cited comparison of 2–4 versions of insurance wording ("variants"): an
        endpoint or a set of forms per variant, plus optional shared or
        per-variant context (product, documents, facts), knowledge files, focus
        questions, scenarios and reviewer annotations. Each input is a file you
        can read and download; its current version is pinned and only pinned
        inputs can be cited. Poll getFormComparison with the returned id (or
        follow Location), or subscribe to the form_comparison.completed and
        form_comparison.failed webhooks; a comparison not finished 30 minutes
        after launch fails with execution_timeout. Send an Idempotency-Key to
        retry safely: a retry with the same key and request returns the same
        comparison (202 while queued or running, 200 once finished) and never
        starts new work; the same key with a different request is 409
        idempotency_conflict. Without a key, every POST starts a new comparison.
        Keys last 7 days (idempotencyExpiresAt). Inputs must have extracted
        text: 409 input_not_ready while extraction runs (retry after
        Retry-After), 422 input_unreadable when a file has no text (scanned PDFs
        are not OCRed). Knowledge files must pass validateFormKnowledge without
        errors. Limits: 20 inputs, 50 annotations, 64 KiB. Billed by session
        credits; read-only members cannot create comparisons.
      operationId: createFormComparison
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9\-_.:]+$
            description: >-
              Client-chosen key for safe retries: 1-128 letters, digits, -, _, .
              or :. Use a new random UUID for each intended operation and the
              same key when retrying it. Do not put customer data or credentials
              in the key.
          required: false
          description: >-
            Client-chosen key for safe retries: 1-128 letters, digits, -, _, .
            or :. Use a new random UUID for each intended operation and the same
            key when retrying it. Do not put customer data or credentials in the
            key.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2CreateFormComparisonRequest'
      responses:
        '200':
          description: >-
            A retried key whose comparison has finished: its current
            representation.
          headers:
            Location:
              required: true
              schema:
                type: string
              description: 'Polling path: /api/v2/insurance/form-comparisons/{id}.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2FormComparison'
        '202':
          description: >-
            Accepted (status queued), or the queued or running comparison a
            retried key already started.
          headers:
            Location:
              required: true
              schema:
                type: string
              description: 'Polling path: /api/v2/insurance/form-comparisons/{id}.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2FormComparison'
        '400':
          description: >-
            invalid_request: invalid body, Idempotency-Key, limits, duplicate
            IDs, or knowledge files with errors (one detail per diagnostic).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: 'unauthenticated: valid credentials are required.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: >-
            feature_not_enabled: the organization does not have form
            comparisons. download_restricted: an input file may not be
            downloaded. forbidden: read-only member or a credential that cannot
            launch runs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: >-
            not_found: an input file does not exist or is inaccessible (details
            name each input), or a retried key belongs to a deleted comparison.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: >-
            idempotency_conflict: the key was used with a different request.
            input_not_ready: an input is still being extracted (details name
            each input); retry after Retry-After. version_unavailable: an input
            version cannot be pinned.
          headers:
            Retry-After:
              required: false
              schema:
                type: integer
                minimum: 0
              description: Seconds to wait before retrying, for input_not_ready.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '413':
          description: 'request_too_large: the request exceeds 64 KiB.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '415':
          description: 'unsupported_media_type: use application/json.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '422':
          description: >-
            input_unreadable: an input finished extraction with no text (details
            name each input).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '429':
          description: 'cost_control_enforced: a cost-control policy blocks new runs.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '500':
          description: 'internal_error: unexpected server error.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '501':
          description: >-
            not_implemented: the contract is published ahead of its
            implementation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: 'temporarily_unavailable: retry after Retry-After seconds.'
          headers:
            Retry-After:
              required: true
              schema:
                type: integer
                minimum: 0
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2CreateFormComparisonRequest:
      type: object
      properties:
        variants:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonVariant'
          minItems: 2
          maxItems: 4
          description: >-
            2–4 versions of the wording to compare, in the order to present
            them.
        sharedContext:
          allOf:
            - $ref: '#/components/schemas/V2FormComparisonContext'
            - description: >-
                Context applied to every variant. It supplements each variant's
                own context; conflicts are reported as gaps.
        knowledge:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonInput'
          maxItems: 10
          description: >-
            Up to 10 knowledge files (see validateFormKnowledge). They must
            validate without errors. Reasoning context, never form evidence.
        focus:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 1000
          maxItems: 10
          description: >-
            Up to 10 questions to focus on, 1–1,000 characters each. Omit for
            material similarities and differences.
        scenarios:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonScenario'
          maxItems: 10
          description: Up to 10 hypothetical scenarios to answer for each variant.
        reviewMaterial:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonInput'
          maxItems: 10
          description: >-
            Up to 10 files holding saved earlier output or reviewer notes to
            reconcile. Never counted as policy evidence.
      required:
        - variants
      additionalProperties: false
    V2FormComparison:
      oneOf:
        - $ref: '#/components/schemas/V2QueuedFormComparison'
        - $ref: '#/components/schemas/V2RunningFormComparison'
        - $ref: '#/components/schemas/V2SucceededFormComparison'
        - $ref: '#/components/schemas/V2FailedFormComparison'
      discriminator:
        propertyName: status
        mapping:
          queued: '#/components/schemas/V2QueuedFormComparison'
          running: '#/components/schemas/V2RunningFormComparison'
          succeeded: '#/components/schemas/V2SucceededFormComparison'
          failed: '#/components/schemas/V2FailedFormComparison'
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
            dataset:
              type: string
              enum:
                - naic
                - osha
              description: Dataset needed for dataset_not_enabled.
            businessCode:
              type: string
              description: The rater’s own refusal code, for business_rejection.
            violations:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    description: Authored or built-in constraint code
                  message:
                    type: string
                    description: Authored message for the failed constraint
                  path:
                    type: string
                    description: Input path of the offending value; empty for the request
                  value:
                    nullable: true
                    description: Offending input value, size-bounded by the runtime
                  constraint:
                    type: string
                    description: The constraint the value failed, as text
                  cite:
                    type: string
                    nullable: true
                    description: >-
                      Filing citation of the constraint, when the source cites
                      one
                required:
                  - code
                  - message
                  - path
                  - value
                  - constraint
                  - cite
                additionalProperties: false
              maxItems: 256
              description: >-
                Each input constraint the submission failed, for invalid_inputs
                and business_rejection.
            violationsTruncated:
              type: boolean
              description: >-
                True when the rater reported more violations than violations
                holds.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: >-
                Where to add the product to your account, for
                product_access_required.
          required:
            - code
    V2FormComparisonVariant:
      type: object
      properties:
        key:
          type: string
          pattern: ^[a-z][a-z0-9_-]{0,39}$
          description: >-
            Variant key, unique in the request: lowercase letter, then up to 39
            lowercase letters, digits, - or _.
          example: verus
        label:
          type: string
          minLength: 1
          maxLength: 200
          description: Display label, up to 200 characters.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonInput'
          minItems: 1
          maxItems: 10
          description: 1–10 documents holding this version of the wording.
        context:
          $ref: '#/components/schemas/V2FormComparisonContext'
      required:
        - key
        - documents
      additionalProperties: false
    V2FormComparisonContext:
      type: object
      properties:
        product:
          anyOf:
            - $ref: '#/components/schemas/V2AnswerProductScope'
            - $ref: '#/components/schemas/V2FormComparisonInlineProduct'
          description: >-
            Directory product { id, state? } (the same shape as createAnswer
            scope.products) or an inline description. Descriptive context only:
            a product never attaches forms or makes them approved.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonInput'
          maxItems: 10
          description: Up to 10 context documents, such as a base policy or declarations.
        facts:
          type: string
          minLength: 1
          maxLength: 4000
          description: Facts that apply, up to 4,000 characters.
      additionalProperties: false
      description: >-
        Context for this variant only. Omitted context is missing context, never
        borrowed from a sibling variant's.
    V2FormComparisonInput:
      anyOf:
        - type: string
          format: uuid
          description: >-
            File UUID, e.g. 01a150b0-b6a4-774f-a0e0-ad385dbc5028; normalized to
            lowercase.
          example: 01a150b0-b6a4-774f-a0e0-ad385dbc5028
        - $ref: '#/components/schemas/V2FormComparisonInputObject'
      description: >-
        A file the caller can read and download: a bare file UUID, or an object
        with an ID, label and annotations. A bare UUID gets the ID input-<n>,
        where n is its one-based position among all inputs in request order
        (variants in order, each with its documents then its context documents;
        then sharedContext documents, knowledge and reviewMaterial).
    V2FormComparisonScenario:
      type: object
      properties:
        id:
          type: string
          pattern: ^[a-z][a-z0-9_-]{0,63}$
          description: Scenario ID, unique in the request.
          example: water-backup
        facts:
          type: string
          minLength: 1
          maxLength: 4000
          description: Hypothetical premises, up to 4,000 characters.
        question:
          type: string
          minLength: 1
          maxLength: 1000
          description: Question to answer for each variant, up to 1,000 characters.
        expectations:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                pattern: ^[a-z][a-z0-9_-]{0,63}$
                description: Expectation ID, unique in the request.
              assertion:
                type: string
                minLength: 1
                maxLength: 1000
                description: Expert assertion to test, up to 1,000 characters.
              variant:
                type: string
                pattern: ^[a-z][a-z0-9_-]{0,39}$
                description: Variant key the assertion is about; omit for every variant.
            required:
              - id
              - assertion
            additionalProperties: false
          maxItems: 10
          description: Up to 10 expert assertions, each tested separately.
      required:
        - id
        - facts
        - question
      additionalProperties: false
    V2QueuedFormComparison:
      type: object
      properties:
        id:
          type: string
          description: Form comparison UUID.
        createdAt:
          type: string
          format: date-time
          description: When the comparison was accepted.
        idempotencyExpiresAt:
          type: string
          nullable: true
          format: date-time
          description: >-
            When the Idempotency-Key binding expires (7 days after acceptance);
            null without a key.
        status:
          type: string
          enum:
            - queued
          description: Accepted; the agent has not started.
      required:
        - id
        - createdAt
        - idempotencyExpiresAt
        - status
    V2RunningFormComparison:
      type: object
      properties:
        id:
          type: string
          description: Form comparison UUID.
        createdAt:
          type: string
          format: date-time
          description: When the comparison was accepted.
        idempotencyExpiresAt:
          type: string
          nullable: true
          format: date-time
          description: >-
            When the Idempotency-Key binding expires (7 days after acceptance);
            null without a key.
        status:
          type: string
          enum:
            - running
          description: >-
            The agent is working. A comparison unfinished 30 minutes after
            launch fails.
      required:
        - id
        - createdAt
        - idempotencyExpiresAt
        - status
    V2SucceededFormComparison:
      type: object
      properties:
        id:
          type: string
          description: Form comparison UUID.
        createdAt:
          type: string
          format: date-time
          description: When the comparison was accepted.
        idempotencyExpiresAt:
          type: string
          nullable: true
          format: date-time
          description: >-
            When the Idempotency-Key binding expires (7 days after acceptance);
            null without a key.
        status:
          type: string
          enum:
            - succeeded
          description: A verified result was accepted; terminal.
        result:
          $ref: '#/components/schemas/V2FormComparisonResult'
        inputsUsed:
          $ref: '#/components/schemas/V2FormComparisonInputsUsed'
        redactedCitationCount:
          type: integer
          minimum: 0
          description: >-
            Document references removed from this read because you can no longer
            read or download their file.
        usage:
          type: object
          properties:
            credits:
              type: number
              minimum: 0
              description: >-
                Recorded session usage in credits; may rise as delayed charges
                arrive.
          required:
            - credits
          description: Current recorded usage.
      required:
        - id
        - createdAt
        - idempotencyExpiresAt
        - status
        - result
        - inputsUsed
        - redactedCitationCount
        - usage
    V2FailedFormComparison:
      type: object
      properties:
        id:
          type: string
          description: Form comparison UUID.
        createdAt:
          type: string
          format: date-time
          description: When the comparison was accepted.
        idempotencyExpiresAt:
          type: string
          nullable: true
          format: date-time
          description: >-
            When the Idempotency-Key binding expires (7 days after acceptance);
            null without a key.
        status:
          type: string
          enum:
            - failed
          description: The run ended without an accepted result; terminal.
        failure:
          type: object
          properties:
            code:
              type: string
              description: >-
                run_failed: could not be launched. execution_timeout: no result
                within 30 minutes of launch. unable_to_compare: the agent
                reported that the inputs cannot be compared; error gives its
                reason. Tolerate future codes.
            error:
              type: string
              description: Human-readable explanation.
            retryable:
              type: boolean
              description: >-
                Whether a new comparison with the same input (and a new key) may
                succeed.
          required:
            - code
            - error
            - retryable
      required:
        - id
        - createdAt
        - idempotencyExpiresAt
        - status
        - failure
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
    V2AnswerProductScope:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: >-
            Catalog product ID, e.g. product_00001AB or bare code 00001AB.
            Aliases normalize to the full ID.
          example: product_00001AB
        state:
          type: string
          pattern: ^[A-Z]{2}$
          description: >-
            Two-letter uppercase state code, e.g. CA for California. Omit to
            include all states for this product.
          example: CA
      required:
        - id
      additionalProperties: false
    V2FormComparisonInlineProduct:
      type: object
      properties:
        label:
          type: string
          minLength: 1
          maxLength: 200
          description: Product name, up to 200 characters.
        description:
          type: string
          minLength: 1
          maxLength: 4000
          description: Description, up to 4,000 characters.
        jurisdiction:
          type: string
          minLength: 1
          maxLength: 100
          description: Jurisdiction, e.g. TX.
        effectiveDate:
          type: string
          format: date
          description: ISO date, e.g. 2026-01-01.
      required:
        - label
      additionalProperties: false
      description: Product described inline; descriptive context only.
    V2FormComparisonInputObject:
      type: object
      properties:
        id:
          type: string
          pattern: ^[a-z][a-z0-9_-]{0,63}$
          description: >-
            Input ID, unique in the request: lowercase letter, then up to 63
            lowercase letters, digits, - or _.
          example: verus-base
        fileId:
          type: string
          format: uuid
          description: >-
            File UUID, e.g. 01a150b0-b6a4-774f-a0e0-ad385dbc5028; normalized to
            lowercase.
          example: 01a150b0-b6a4-774f-a0e0-ad385dbc5028
        label:
          type: string
          minLength: 1
          maxLength: 200
          description: Display label, up to 200 characters.
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonAnnotation'
          maxItems: 50
          description: Reviewer notes about this input. Annotations never change sources.
      required:
        - id
        - fileId
      additionalProperties: false
    V2FormComparisonResult:
      type: object
      properties:
        summary:
          type: object
          properties:
            text:
              type: string
            findingIds:
              type: array
              items:
                type: string
              description: IDs of findings in result.findings.
          required:
            - text
            - findingIds
        findings:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonFinding'
        scenarios:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonScenarioResult'
          description: One per supplied scenario.
        gaps:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonGap'
        references:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonReference'
        annotationResponses:
          type: array
          items:
            type: object
            properties:
              annotationId:
                type: string
              status:
                type: string
                enum:
                  - addressed
                  - needs_context
                  - target_not_found
              text:
                type: string
              findingIds:
                type: array
                items:
                  type: string
                description: IDs of findings in result.findings.
              referenceIds:
                type: array
                items:
                  type: string
                description: IDs of entries in result.references; every ID resolves.
            required:
              - annotationId
              - status
              - text
              - findingIds
              - referenceIds
          description: One per supplied annotation.
        report:
          type: string
          description: >-
            Markdown rendered by the server from the fields above; it never
            reruns interpretation.
      required:
        - summary
        - findings
        - scenarios
        - gaps
        - references
        - annotationResponses
        - report
      description: >-
        Lists are empty arrays, never null. IDs are stable within this
        comparison.
    V2FormComparisonInputsUsed:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              inputId:
                type: string
              role:
                type: string
                enum:
                  - target
                  - context
                  - knowledge
                  - review_material
              variant:
                type: string
                nullable: true
                description: Variant key; null for shared and request-wide inputs.
              fileId:
                type: string
              versionId:
                anyOf:
                  - type: string
                    format: uuid
                  - type: string
                    maxLength: 8192
                    pattern: ^lv1\.[A-Za-z0-9_.-]+$
                description: 'Pinned version: UUID or lv1. token.'
              contentSha256:
                type: string
                nullable: true
                description: >-
                  sha256:<hex> of the pinned version; null for files without
                  version history.
              name:
                type: string
              extractionMethod:
                type: string
                nullable: true
                description: How the text was extracted; null when unknown.
            required:
              - inputId
              - role
              - variant
              - fileId
              - versionId
              - contentSha256
              - name
              - extractionMethod
          description: One per input.
        products:
          type: array
          items:
            type: object
            properties:
              variant:
                type: string
                nullable: true
                description: Variant key; null for shared context.
              product:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - directory
                      id:
                        type: string
                      name:
                        type: string
                      states:
                        type: array
                        items:
                          type: string
                    required:
                      - type
                      - id
                      - name
                      - states
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - inline
                      label:
                        type: string
                      description:
                        type: string
                        nullable: true
                      jurisdiction:
                        type: string
                        nullable: true
                      effectiveDate:
                        type: string
                        nullable: true
                    required:
                      - type
                      - label
                      - description
                      - jurisdiction
                      - effectiveDate
                description: Directory snapshot used, or the inline values.
            required:
              - variant
              - product
          description: Product context per variant.
        execution:
          type: object
          properties:
            executor:
              type: string
            model:
              type: string
              nullable: true
            codeVersion:
              type: string
              nullable: true
              description: Server git SHA; null when unknown.
            startedAt:
              type: string
              nullable: true
              format: date-time
            finishedAt:
              type: string
              format: date-time
          required:
            - executor
            - model
            - codeVersion
            - startedAt
            - finishedAt
      required:
        - items
        - products
        - execution
      description: What this run read, for audit.
    V2FormComparisonAnnotation:
      type: object
      properties:
        id:
          type: string
          pattern: ^[a-z][a-z0-9_-]{0,63}$
          description: >-
            Annotation ID, unique in the request: lowercase letter, then up to
            63 lowercase letters, digits, - or _.
          example: note-1
        kind:
          type: string
          enum:
            - comment
            - question
            - correction
          default: comment
          description: >-
            comment (default), question, or correction. A correction is a claim
            to reconcile with the sources, not an instruction to agree.
        text:
          type: string
          minLength: 1
          maxLength: 2000
          description: Annotation text, 1–2,000 characters.
        target:
          $ref: '#/components/schemas/V2FormComparisonAnnotationTarget'
      required:
        - id
        - text
      additionalProperties: false
    V2FormComparisonFinding:
      type: object
      properties:
        id:
          type: string
          description: Finding ID, stable within this comparison.
        finding:
          type: string
          description: Short title naming what is being compared.
        comparison:
          type: string
          enum:
            - different
            - aligned
            - unresolved
          description: >-
            different, aligned or unresolved, scoped to the finding and the
            reviewed evidence.
        positions:
          type: array
          items:
            type: object
            properties:
              variant:
                type: string
                description: Variant key from the request.
              text:
                type: string
              referenceIds:
                type: array
                items:
                  type: string
                description: IDs of entries in result.references; every ID resolves.
            required:
              - variant
              - text
              - referenceIds
          description: >-
            One position per variant, in request variant order where the agent
            kept it.
        interpretation:
          type: object
          properties:
            text:
              type: string
            referenceIds:
              type: array
              items:
                type: string
              description: IDs of entries in result.references; every ID resolves.
          required:
            - text
            - referenceIds
          description: What the comparison means in practice.
        gapIds:
          type: array
          items:
            type: string
          description: IDs of gaps in result.gaps.
      required:
        - id
        - finding
        - comparison
        - positions
        - interpretation
        - gapIds
    V2FormComparisonScenarioResult:
      type: object
      properties:
        id:
          type: string
          description: Scenario ID from the request.
        question:
          type: string
          description: The scenario question from the request.
        propositions:
          type: array
          items:
            $ref: '#/components/schemas/V2FormComparisonProposition'
        expectationChecks:
          type: array
          items:
            type: object
            properties:
              expectationId:
                type: string
                description: Expectation ID from the request.
              variant:
                type: string
                description: Variant key from the request.
              propositionIds:
                type: array
                items:
                  type: string
                description: IDs of this scenario’s propositions the check relies on.
              status:
                type: string
                enum:
                  - met
                  - not_met
                  - undetermined
              explanation:
                type: string
              referenceIds:
                type: array
                items:
                  type: string
                description: IDs of entries in result.references; every ID resolves.
            required:
              - expectationId
              - variant
              - propositionIds
              - status
              - explanation
              - referenceIds
          description: One per expectation and variant it applies to.
      required:
        - id
        - question
        - propositions
        - expectationChecks
    V2FormComparisonGap:
      type: object
      properties:
        id:
          type: string
          description: Gap ID, stable within this comparison.
        text:
          type: string
          description: What is missing or conflicting.
        limits:
          type: string
          description: What conclusion the gap limits.
        needed:
          type: string
          description: What would resolve it.
        affected:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - finding
                  - scenario
                  - annotation
                  - input
              id:
                type: string
            required:
              - type
              - id
          description: Findings, scenarios, annotations or inputs the gap affects.
      required:
        - id
        - text
        - limits
        - needed
        - affected
    V2FormComparisonReference:
      oneOf:
        - $ref: '#/components/schemas/V2FormComparisonDocumentReference'
        - $ref: '#/components/schemas/V2FormComparisonKnowledgeReference'
        - $ref: '#/components/schemas/V2FormComparisonAnnotationReference'
      discriminator:
        propertyName: type
        mapping:
          document: '#/components/schemas/V2FormComparisonDocumentReference'
          knowledge: '#/components/schemas/V2FormComparisonKnowledgeReference'
          annotation: '#/components/schemas/V2FormComparisonAnnotationReference'
    V2FormComparisonAnnotationTarget:
      anyOf:
        - type: object
          properties:
            page:
              type: integer
              minimum: 1
              description: One-based page of the document.
            quote:
              $ref: '#/components/schemas/V2FormComparisonQuoteSelector'
          additionalProperties: false
          description: A place in a document or review material, by page, quote or both.
          anyOf:
            - required:
                - page
            - required:
                - quote
        - type: object
          properties:
            entryId:
              type: string
              minLength: 1
              maxLength: 200
              description: Full knowledge entry ID, namespace:local-id.
          required:
            - entryId
          additionalProperties: false
          description: An entry of a knowledge file.
        - type: object
          properties:
            findingId:
              type: string
              minLength: 1
              maxLength: 64
              description: A finding ID in a saved earlier comparison.
          required:
            - findingId
          additionalProperties: false
          description: A finding of review material.
      description: >-
        What the annotation is about; omit for the whole input. A target that
        cannot be found is answered as target_not_found.
    V2FormComparisonProposition:
      type: object
      properties:
        id:
          type: string
          description: Proposition ID, stable within this comparison.
        text:
          type: string
          description: One proposition split from the scenario question.
        assessments:
          type: array
          items:
            type: object
            properties:
              variant:
                type: string
                description: Variant key from the request.
              status:
                type: string
                enum:
                  - supported
                  - not_supported
                  - conditional
                  - undetermined
                description: Missing evidence is undetermined, never not_supported.
              text:
                type: string
              referenceIds:
                type: array
                items:
                  type: string
                description: IDs of entries in result.references; every ID resolves.
              findingIds:
                type: array
                items:
                  type: string
                description: IDs of findings in result.findings.
              gapIds:
                type: array
                items:
                  type: string
                description: IDs of gaps in result.gaps.
            required:
              - variant
              - status
              - text
              - referenceIds
              - findingIds
              - gapIds
          description: One assessment per variant.
      required:
        - id
        - text
        - assessments
    V2FormComparisonDocumentReference:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - document
        inputId:
          type: string
          description: Input the citation belongs to, keeping its role.
        scope:
          type: string
          enum:
            - passage
            - document
          description: >-
            passage: page and quote support the statement. document: a "not
            found in this document" statement about the whole input, with a null
            page and an empty quote.
        fileId:
          type: string
          description: Cited file UUID.
        versionId:
          anyOf:
            - type: string
              format: uuid
            - type: string
              maxLength: 8192
              pattern: ^lv1\.[A-Za-z0-9_.-]+$
          description: >-
            File version pinned when the comparison was accepted: UUID or opaque
            lv1. token.
        page:
          type: integer
          nullable: true
          minimum: 1
          description: One-based extracted page, or null.
        quote:
          type: string
          description: >-
            The matched source passage when verified; otherwise an opening
            excerpt of the cited page, or empty.
        verified:
          type: boolean
          description: >-
            True when the quote matched the extracted text at the cited page of
            the pinned version.
        downloadUrl:
          type: string
          description: >-
            Authenticated API-relative path:
            /api/v2/files/{fileId}/download?versionId=...
        webUrl:
          type: string
          format: uri
          description: Effective file viewer for the cited file, at the cited page.
      required:
        - id
        - type
        - inputId
        - scope
        - fileId
        - versionId
        - page
        - quote
        - verified
        - downloadUrl
        - webUrl
    V2FormComparisonKnowledgeReference:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - knowledge
        inputId:
          type: string
        entryId:
          type: string
          description: Full knowledge entry ID, namespace:local-id.
      required:
        - id
        - type
        - inputId
        - entryId
      description: Reasoning context from a knowledge file, not form evidence.
    V2FormComparisonAnnotationReference:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - annotation
        inputId:
          type: string
        annotationId:
          type: string
      required:
        - id
        - type
        - inputId
        - annotationId
      description: 'A caller annotation: a claim, not evidence.'
    V2FormComparisonQuoteSelector:
      type: object
      properties:
        exact:
          type: string
          minLength: 1
          maxLength: 2000
          description: Exact passage the annotation is about, up to 2,000 characters.
        prefix:
          type: string
          minLength: 1
          maxLength: 200
          description: Text just before the passage, to disambiguate it.
        suffix:
          type: string
          minLength: 1
          maxLength: 200
          description: Text just after the passage, to disambiguate it.
      required:
        - exact
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

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