"$schema": "http://json-schema.org/draft-04/schema"
"$id": "https://nix.dev/manual/nix/latest/protocols/json/schema/build-trace-entry-v3.json"
title: Build Trace Entry
description: |
  A record of a successful build outcome for a specific derivation output.

  This schema describes the JSON representation of an [entry](@docroot@/store/build-trace.md#entry) in a [build trace](@docroot@/store/build-trace.md).

  > **Warning**
  >
  > This JSON format is currently
  > [**experimental**](@docroot@/development/experimental-features.md#xp-feature-ca-derivations)
  > and subject to change.

  ## Version History

  - Version 1: Original format

  - Version 2:
    - Remove `dependentRealisations`

  - Version 3:
    - Use `drvPath` not `drvHash` to refer to derivation in a more conventional way.
    - Separate into `key` and `value`
    - Use 2nd version of signatures format (objects, not strings)

type: object
required:
  - key
  - value
properties:
  key:
    "$ref": "#/$defs/key"
  value:
    "$ref": "#/$defs/value"
additionalProperties: false

"$defs":
  key:
    title: Build Trace Key
    description: |
      A [build trace entry](@docroot@/store/build-trace.md#entry) is a key-value pair.
      This is the "key" part, referring to a derivation and output.
    type: object
    required:
      - drvPath
      - outputName
    properties:
      drvPath:
        "$ref": "store-path-v1.yaml"
        title: Derivation Path
        description: |
          The store path of the derivation that was built.
      outputName:
        type: string
        title: Output Name
        description: |
          Name of the specific output (e.g., "out", "dev", "doc")
    additionalProperties: false

  value:
    title: Build Trace Value
    description: |
      A [build trace entry](@docroot@/store/build-trace.md#entry) is a key-value pair.
      This is the "value" part, describing an output.
    type: object
    required:
      - outPath
      - signatures
    properties:
      outPath:
        "$ref": "store-path-v1.yaml"
        title: Output Store Path
        description: |
          The path to the store object that resulted from building this derivation for the given output name.

      signatures:
        type: array
        title: Build Signatures
        description: |
          A set of cryptographic signatures attesting to the authenticity of this build trace entry.
        items:
          "$ref": "signature-v2.yaml"
