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

# Validate a receipt

> Validate a portable Agent Work Receipt without storing it.



## OpenAPI

````yaml /openapi/v1.yaml post /agent-work-receipts/validate
openapi: 3.1.0
info:
  title: OrgX REST API v1
  version: '1'
  description: >-
    Build accountable work into your product with OrgX REST API v1.


    Create work with one field, attach evidence when it is complete, and keep
    the receipt. Every authenticated request is scoped to the workspace resolved
    from your credential.


    Start with `POST /work`. Human guide:
    https://docs.useorgx.com/docs/api/quickstart
  contact:
    name: OrgX Support
    url: https://useorgx.com/support
    email: support@useorgx.com
  license:
    name: Proprietary
    url: https://useorgx.com/terms
servers:
  - url: https://useorgx.com/api/v1
    description: Production
security: []
tags:
  - name: Work
    description: Create accountable work and complete it with evidence
  - name: Initiatives
    description: Organize related work around an outcome
  - name: Operating processes
    description: Evidence-backed company workflow/process lifecycle
  - name: Operating map
    description: Derived, rebuildable Operating Map projection over the process ledger
  - name: Discovery runs
    description: Wizard and deep-search workflow discovery over connected company sources
  - name: Handoffs
    description: Ledger-backed stage handoffs between operating-process stages
  - name: Events
    description: Replayable, workspace-scoped accepted ledger events
  - name: Projections
    description: Workspace-scoped, rebuildable read projections over OrgX sources
  - name: Episodes
    description: Mission-compatible Episode read adapters
  - name: Receipt validation
    description: Account-free Agent Work Receipt schema discovery and conformance
  - name: Receipt import
    description: Authenticated, workspace-scoped import into the hosted receipt ledger
  - name: Workload diagnosis
    description: >-
      Account-free evaluation of time, agents, systems, authority, and
      accountability boundaries
  - name: Content Studio
    description: >-
      Estimate, showcase, checkout, and payment event operations for Content
      Studio
  - name: Decisions
    description: Raise decisions for human ruling and read their state
  - name: Controllers
    description: Shadow-only domain controller status and reconciliation
  - name: Artifacts
    description: Register produced work against the entity it belongs to
  - name: Launches
    description: Preview and run an initiative launch through its spend gates
  - name: Runs
    description: Control agent runs with pause, resume, cancel, and rollback
  - name: Lifecycle
    description: Pause, resume, retry, or cancel work hierarchy nodes and runs
  - name: Deduplication
    description: Claim durable event fingerprints so duplicate triggers fire once
  - name: Credential
    description: >-
      Resolve the calling credential, the workspaces it reaches, and what it may
      do
  - name: API discovery
    description: Account-free error codes, request schemas, and closed vocabularies for v1
externalDocs:
  description: Human-readable OrgX REST API v1 reference
  url: https://docs.useorgx.com/docs/api/public-api
paths:
  /agent-work-receipts/validate:
    post:
      tags:
        - Receipt validation
      summary: Validate a receipt
      description: Validate a portable Agent Work Receipt without storing it.
      operationId: validateAgentWorkReceipt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentWorkReceipt'
            example:
              schema_version: agent-work-receipt/v0.1
              receipt_id: awr:example:launch-review-001
              intent:
                summary: >-
                  Add a portable receipt validator and prove it with focused
                  tests.
                objective: >-
                  Produce an account-free contract that another runtime can
                  validate without OrgX identifiers.
                acceptance_criteria:
                  - The JSON Schema accepts opaque external identifiers.
                  - The focused conformance tests pass.
                constraints:
                  - Do not change application routes.
                request_ref:
                  system: example-app
                  type: task
                  id: launch-review-001
              actor:
                type: agent
                id: launch-review-agent
                display_name: Launch Review Agent
                runtime:
                  name: example-runtime
                  version: 1.0.0
                model:
                  provider: example
                  name: workflow-model
              authority:
                mode: delegated
                status: restricted
                scope:
                  actions:
                    - read_source
                    - edit_package
                    - run_tests
                  resources:
                    - system: git
                      type: repository
                      id: launch-planning
                  systems:
                    - filesystem
                    - git
                  spend_limit:
                    currency: USD
                    amount: 1
                delegated_by:
                  type: human
                  id: launch-owner
                authorization_ref:
                  system: example-app
                  type: task_message
                  id: launch-review-message-001
                constraints:
                  - Write only inside packages/agent-work-receipt.
                valid_from: '2026-07-19T15:00:00.000Z'
                valid_until: '2026-07-19T16:00:00.000Z'
              actions:
                - id: inspect-receipt
                  type: source.inspect
                  summary: Reviewed the receipt fields required by the integration.
                  status: completed
                  system: filesystem
                  started_at: '2026-07-19T15:00:00.000Z'
                  completed_at: '2026-07-19T15:02:00.000Z'
                - id: run-conformance
                  type: test.run
                  summary: Ran the Agent Work Receipt conformance suite.
                  status: completed
                  system: vitest
                  tool_ref:
                    system: vitest
                    type: command
                    id: receipt-conformance
                  output_refs:
                    - system: local-filesystem
                      type: test_output
                      id: receipt-conformance-output
                  started_at: '2026-07-19T15:08:00.000Z'
                  completed_at: '2026-07-19T15:08:05.000Z'
              artifacts:
                - id: artifact-schema
                  kind: json_schema
                  name: Agent Work Receipt v0.1 schema
                  role: output
                  ref:
                    system: git
                    type: file
                    id: >-
                      packages/agent-work-receipt/schema/agent-work-receipt.v0.1.schema.json
                    uri: >-
                      file:packages/agent-work-receipt/schema/agent-work-receipt.v0.1.schema.json
                  media_type: application/schema+json
                  digest:
                    algorithm: sha256
                    value: >-
                      1111111111111111111111111111111111111111111111111111111111111111
                    encoding: hex
                  created_at: '2026-07-19T15:07:00.000Z'
              evidence:
                - id: evidence-tests
                  kind: test_result
                  summary: Focused conformance tests passed.
                  ref:
                    system: local-filesystem
                    type: test_output
                    id: receipt-conformance-output
                  observed_at: '2026-07-19T15:08:05.000Z'
                  excerpt: 'Tests: passed'
                  supports:
                    - verification
                    - outcome
              outcome:
                status: succeeded
                summary: >-
                  The portable schema, types, validator, and fixtures were
                  produced.
                observed_effects:
                  - >-
                    An external runtime can emit a receipt without an OrgX
                    account.
                metrics:
                  - name: focused_tests_passed
                    value: 1
                    unit: boolean
                    target: 1
                    observed_at: '2026-07-19T15:08:05.000Z'
                    evidence_ids:
                      - evidence-tests
              verification:
                status: passed
                method: Deterministic JSON Schema and semantic conformance suite.
                verifier:
                  type: service
                  id: vitest-local
                checks:
                  - id: check-conformance
                    name: Agent Work Receipt conformance
                    status: passed
                    method: vitest run
                    evidence_ids:
                      - evidence-tests
                evidence_ids:
                  - evidence-tests
                verified_at: '2026-07-19T15:08:05.000Z'
              cost:
                currency: USD
                total: 0.08
                components:
                  - category: model
                    amount: 0.08
                usage:
                  - name: agent_runtime
                    quantity: 8
                    unit: minutes
                    cost: 0.08
                human_minutes: 0
                estimated: true
              lineage:
                run_ref:
                  system: example-app
                  type: run
                  id: run-2026-07-19-001
                parent_receipt_refs: []
                references:
                  - relationship: produced_in
                    ref:
                      system: git
                      type: branch
                      id: example-app/launch-review-001
                trace_id: launch-review-trace-001
              human_interventions: []
              timestamps:
                started_at: '2026-07-19T15:00:00.000Z'
                completed_at: '2026-07-19T15:08:05.000Z'
                issued_at: '2026-07-19T15:08:06.000Z'
                duration_ms: 485000
      responses:
        '200':
          description: Receipt conforms to the current schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiptValidationSuccess'
              example:
                ok: true
                valid: true
                schema_version: agent-work-receipt/v0.1
                schema_url: >-
                  https://useorgx.com/schemas/agent-work-receipt/v0.1/schema.json
                receipt:
                  receipt_id: awr:example:launch-review-001
                  actor_id: launch-review-agent
                  runtime: example-runtime
                  producer_reported_outcome_status: active
                  producer_reported_verification_status: active
                  evidence_count: 0
                  human_intervention_count: 0
                persistence:
                  stored: false
                  import_requires_authentication: true
        '400':
          description: Request body is not valid JSON
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '413':
          description: Receipt exceeds the 262,144-byte public limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '415':
          description: Content-Type is not application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '422':
          description: Receipt is valid JSON but does not conform to the schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiptValidationFailure'
        '429':
          description: Public validation rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '503':
          description: Distributed production rate limiting is unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
components:
  schemas:
    AgentWorkReceipt:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: https://useorgx.com/schemas/agent-work-receipt/v0.1/schema.json
      title: Agent Work Receipt v0.1
      description: >-
        A portable, account-free record of agent intent, authority, actions,
        evidence, outcome, verification, cost, lineage, and human intervention.
        Identifiers are opaque external strings and never require an OrgX
        account or UUID.
      type: object
      additionalProperties: false
      required:
        - schema_version
        - receipt_id
        - intent
        - actor
        - authority
        - actions
        - artifacts
        - evidence
        - outcome
        - verification
        - cost
        - lineage
        - human_interventions
        - timestamps
      properties:
        schema_version:
          const: agent-work-receipt/v0.1
          description: >-
            Stable contract version. Producers must not silently emit a
            different shape under this value.
        receipt_id:
          $ref: c64a4033-fcde-42db-b13b-88d9ed390fb2
          description: >-
            Producer-owned opaque receipt identifier. UUIDs are allowed but
            never required.
        intent: e45fb22f-abd5-4af7-be43-59e84fc45262
        actor: 297dc690-e0d8-462b-8435-4758017d0c94
        authority: 10804548-44f1-46c6-b53e-deb9a3ced89f
        actions:
          type: array
          minItems: 1
          maxItems: 10000
          items: 69be020f-fef5-4d88-b40d-bd2ab0cfc9c6
        artifacts:
          type: array
          maxItems: 10000
          items: d1c44eb0-26ec-4685-8730-769ffc401c9c
        evidence:
          type: array
          minItems: 1
          maxItems: 10000
          items: e540d313-ab1d-4bcc-97e3-b74acf5fd772
        outcome: 53de48cd-ce3f-43f8-a171-89b5ff654be0
        verification: 48ca1fa7-9810-4070-8b19-6a6e6501f64c
        cost: d708d1af-214a-432e-95fb-dd79fab5e9ad
        lineage: 9842e5a7-98af-4238-829f-cae651592209
        human_interventions:
          type: array
          maxItems: 10000
          items: 78b61b67-d705-4976-b374-fa868ed07da2
        timestamps: a84c025b-8076-470c-9022-ed537d03e568
        integrity: f442ee09-080a-4893-87a6-00b9c033ec25
        extensions:
          $ref: 4d36b463-8129-4ad6-acd5-d3b6edd99f16
          description: >-
            Namespaced producer or consumer extensions. Core interoperability
            must not depend on extension fields.
      $defs:
        id:
          type: string
          minLength: 1
          maxLength: 512
          pattern: \S
        short_string:
          type: string
          minLength: 1
          maxLength: 512
          pattern: \S
        long_string:
          type: string
          minLength: 1
          maxLength: 20000
          pattern: \S
        json_value:
          anyOf:
            - type: string
            - type: number
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: boolean
            - type: 'null'
            - $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
            - type: array
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_value'
        json_object:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_value'
        digest:
          type: object
          additionalProperties: false
          required:
            - algorithm
            - value
          properties:
            algorithm:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
              description: Digest algorithm such as sha256, sha512, or blake3.
            value:
              type: string
              minLength: 1
              maxLength: 8192
            encoding:
              type: string
              enum:
                - hex
                - base64
                - base64url
        external_reference:
          type: object
          additionalProperties: false
          required:
            - system
            - type
            - id
          properties:
            system:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
              description: >-
                Owning namespace or protocol, for example git, github, mcp, a2a,
                opentelemetry, or a vendor-defined system.
            type:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            uri:
              type: string
              minLength: 1
              maxLength: 8192
              format: uri-reference
            version:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            digest:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/digest'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        runtime:
          type: object
          additionalProperties: false
          required:
            - name
          properties:
            name:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            version:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
        model:
          type: object
          additionalProperties: false
          required:
            - provider
            - name
          properties:
            provider:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            name:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            version:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
        actor:
          type: object
          additionalProperties: false
          required:
            - type
            - id
          properties:
            type:
              type: string
              enum:
                - agent
                - service
                - human
                - team
                - system
                - other
            id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            display_name:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            runtime:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/runtime'
            model:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/model'
            external_refs:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        intent:
          type: object
          additionalProperties: false
          required:
            - summary
          properties:
            summary:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            objective:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            acceptance_criteria:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            constraints:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            request_ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        money_limit:
          type: object
          additionalProperties: false
          required:
            - currency
            - amount
          properties:
            currency:
              type: string
              minLength: 3
              maxLength: 12
              pattern: ^[A-Z][A-Z0-9_-]+$
            amount:
              type: number
              minimum: 0
              maximum: 9007199254740991
        authority_scope:
          type: object
          additionalProperties: false
          required:
            - actions
            - resources
          properties:
            actions:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            resources:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            systems:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            spend_limit:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/money_limit'
        approval:
          type: object
          additionalProperties: false
          required:
            - status
            - approver
            - occurred_at
          properties:
            status:
              type: string
              enum:
                - requested
                - granted
                - denied
                - revoked
                - expired
            approver:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/actor'
            scope:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            occurred_at:
              type: string
              format: date-time
            ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
        authority:
          type: object
          additionalProperties: false
          required:
            - mode
            - status
            - scope
          properties:
            mode:
              type: string
              enum:
                - explicit
                - delegated
                - inherited
                - policy
                - none
                - unknown
            status:
              type: string
              enum:
                - granted
                - restricted
                - denied
                - expired
                - unknown
            scope:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/authority_scope'
            delegated_by:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/actor'
            authorization_ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            approvals:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/approval'
            constraints:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            valid_from:
              type: string
              format: date-time
            valid_until:
              type: string
              format: date-time
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        action:
          type: object
          additionalProperties: false
          required:
            - id
            - type
            - summary
            - status
          properties:
            id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            type:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            summary:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            status:
              type: string
              enum:
                - planned
                - running
                - completed
                - failed
                - skipped
                - blocked
            system:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            tool_ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            target_refs:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            input_refs:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            output_refs:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            started_at:
              type: string
              format: date-time
            completed_at:
              type: string
              format: date-time
            error:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        artifact:
          type: object
          additionalProperties: false
          required:
            - id
            - kind
            - name
            - ref
          properties:
            id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            kind:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            name:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            role:
              type: string
              enum:
                - input
                - intermediate
                - output
                - log
                - report
                - other
            media_type:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            digest:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/digest'
            size_bytes:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            created_at:
              type: string
              format: date-time
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        evidence:
          type: object
          additionalProperties: false
          required:
            - id
            - kind
            - summary
            - observed_at
          properties:
            id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            kind:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            summary:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            digest:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/digest'
            observed_at:
              type: string
              format: date-time
            excerpt:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            supports:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        outcome_metric:
          type: object
          additionalProperties: false
          required:
            - name
            - value
            - unit
          properties:
            name:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            value:
              type: number
              minimum: -9007199254740991
              maximum: 9007199254740991
            unit:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            baseline:
              type: number
              minimum: -9007199254740991
              maximum: 9007199254740991
            target:
              type: number
              minimum: -9007199254740991
              maximum: 9007199254740991
            observed_at:
              type: string
              format: date-time
            evidence_ids:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
        acceptance:
          type: object
          additionalProperties: false
          required:
            - status
          properties:
            status:
              type: string
              enum:
                - pending
                - accepted
                - rejected
                - changes_requested
            actor:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/actor'
            occurred_at:
              type: string
              format: date-time
            evidence_ids:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            notes:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
        outcome:
          type: object
          additionalProperties: false
          required:
            - status
            - summary
          properties:
            status:
              type: string
              enum:
                - succeeded
                - partially_succeeded
                - failed
                - blocked
                - cancelled
                - unknown
            summary:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            observed_effects:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            metrics:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/outcome_metric'
            acceptance:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/acceptance'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        verification_check:
          type: object
          additionalProperties: false
          required:
            - id
            - name
            - status
            - evidence_ids
          properties:
            id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            name:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            status:
              type: string
              enum:
                - passed
                - failed
                - skipped
                - inconclusive
            method:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            evidence_ids:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            details:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
        verification:
          type: object
          additionalProperties: false
          required:
            - status
            - method
            - checks
            - evidence_ids
          properties:
            status:
              type: string
              enum:
                - unverified
                - passed
                - failed
                - partial
                - inconclusive
            method:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            verifier:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/actor'
            checks:
              type: array
              maxItems: 10000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/verification_check'
            evidence_ids:
              type: array
              maxItems: 10000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            verified_at:
              type: string
              format: date-time
            notes:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        cost_component:
          type: object
          additionalProperties: false
          required:
            - category
            - amount
          properties:
            category:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            amount:
              type: number
              minimum: 0
              maximum: 9007199254740991
            description:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
        usage:
          type: object
          additionalProperties: false
          required:
            - name
            - quantity
            - unit
          properties:
            name:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            quantity:
              type: number
              minimum: 0
              maximum: 9007199254740991
            unit:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
            cost:
              type: number
              minimum: 0
              maximum: 9007199254740991
        cost:
          type: object
          additionalProperties: false
          required:
            - currency
            - total
          properties:
            currency:
              type: string
              minLength: 3
              maxLength: 12
              pattern: ^[A-Z][A-Z0-9_-]+$
            total:
              type: number
              minimum: 0
              maximum: 9007199254740991
            components:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/cost_component'
            usage:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/usage'
            human_minutes:
              type: number
              minimum: 0
              maximum: 9007199254740991
            estimated:
              type: boolean
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        lineage_edge:
          type: object
          additionalProperties: false
          required:
            - relationship
            - ref
          properties:
            relationship:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/short_string'
              description: >-
                Producer-defined relationship such as produced_from, depends_on,
                supersedes, retries, or trace.
            ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
        lineage:
          type: object
          additionalProperties: false
          required:
            - parent_receipt_refs
            - references
          properties:
            run_ref:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            parent_receipt_refs:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            references:
              type: array
              maxItems: 10000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/lineage_edge'
            trace_id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            span_id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        human_intervention:
          type: object
          additionalProperties: false
          required:
            - id
            - kind
            - actor
            - summary
            - occurred_at
          properties:
            id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            kind:
              type: string
              enum:
                - approval
                - correction
                - input
                - execution
                - escalation
                - override
                - review
                - other
            actor:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/actor'
            summary:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/long_string'
            occurred_at:
              type: string
              format: date-time
            duration_minutes:
              type: number
              minimum: 0
              maximum: 9007199254740991
            evidence_ids:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            refs:
              type: array
              maxItems: 1000
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/external_reference'
            metadata:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/json_object'
        timestamps:
          type: object
          additionalProperties: false
          required:
            - started_at
            - completed_at
            - issued_at
          properties:
            started_at:
              type: string
              format: date-time
            completed_at:
              type: string
              format: date-time
            issued_at:
              type: string
              format: date-time
            observed_at:
              type: string
              format: date-time
            duration_ms:
              type: integer
              minimum: 0
              maximum: 9007199254740991
        signature:
          type: object
          additionalProperties: false
          required:
            - algorithm
            - encoding
            - value
            - key_id
          properties:
            algorithm:
              const: ed25519
            encoding:
              const: base64url
            value:
              type: string
              pattern: ^[A-Za-z0-9_-]{85}[AQgw]$
              description: >-
                An unpadded canonical base64url encoding of the 64-byte Ed25519
                signature.
            key_id:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/id'
            signer:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/actor'
            signed_at:
              type: string
              format: date-time
        integrity:
          type: object
          additionalProperties: false
          required:
            - content_hash
          properties:
            content_hash:
              $ref: '#/components/schemas/AgentWorkReceipt/$defs/content_hash'
              description: >-
                Digest of RFC 8785 canonical JSON for this receipt with the
                integrity property omitted.
            signatures:
              type: array
              minItems: 1
              maxItems: 100
              description: >-
                Ed25519 signatures over the domain-separated
                agent-work-receipt-signature/v0.1 canonical payload. Key
                resolution and signer trust are consumer policy.
              items:
                $ref: '#/components/schemas/AgentWorkReceipt/$defs/signature'
        content_hash:
          type: object
          additionalProperties: false
          required:
            - algorithm
            - value
          properties:
            algorithm:
              enum:
                - sha-256
                - sha256
            value:
              type: string
              minLength: 1
              maxLength: 128
            encoding:
              type: string
              enum:
                - hex
                - base64
                - base64url
          oneOf:
            - not:
                properties:
                  encoding: true
                required:
                  - encoding
              properties:
                value:
                  type: string
                  pattern: ^[0-9A-Fa-f]{64}$
            - required:
                - encoding
              properties:
                encoding:
                  const: hex
                value:
                  type: string
                  pattern: ^[0-9A-Fa-f]{64}$
            - required:
                - encoding
              properties:
                encoding:
                  const: base64
                value:
                  type: string
                  pattern: ^[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048]=$
            - required:
                - encoding
              properties:
                encoding:
                  const: base64url
                value:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$
    ReceiptValidationSuccess:
      type: object
      required:
        - ok
        - valid
        - schema_version
        - schema_url
        - receipt
        - persistence
      properties:
        ok:
          type: boolean
          const: true
        valid:
          type: boolean
          const: true
        schema_version:
          type: string
          const: agent-work-receipt/v0.1
        schema_url:
          type: string
          format: uri
        receipt:
          type: object
          required:
            - receipt_id
            - actor_id
            - runtime
            - producer_reported_outcome_status
            - producer_reported_verification_status
            - evidence_count
            - human_intervention_count
          properties:
            receipt_id:
              type: string
            actor_id:
              type: string
            runtime:
              type:
                - string
                - 'null'
            producer_reported_outcome_status:
              type: string
              description: >-
                Producer-declared outcome; not independently verified by
                conformance validation
            producer_reported_verification_status:
              type: string
              description: Producer-declared verification; not an OrgX hosted review
            evidence_count:
              type: integer
              minimum: 0
            human_intervention_count:
              type: integer
              minimum: 0
        persistence:
          type: object
          required:
            - stored
            - import_requires_authentication
          properties:
            stored:
              type: boolean
              const: false
            import_requires_authentication:
              type: boolean
              const: true
    PublicApiError:
      type: object
      required:
        - error
      properties:
        ok:
          type: boolean
        valid:
          type: boolean
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            issues:
              type: array
              items:
                type: object
    ReceiptValidationFailure:
      type: object
      required:
        - ok
        - valid
        - schema_version
        - schema_url
        - issues
        - issue_count
        - issues_truncated
      properties:
        ok:
          type: boolean
          const: false
        valid:
          type: boolean
          const: false
        schema_version:
          type: string
          const: agent-work-receipt/v0.1
        schema_url:
          type: string
          format: uri
        issues:
          type: array
          maxItems: 100
          items:
            type: object
            required:
              - path
              - code
              - message
            properties:
              path:
                type: string
              code:
                type: string
              message:
                type: string
        issue_count:
          type: integer
          minimum: 1
        issues_truncated:
          type: boolean

````