[
  {
    "kinds": [
      "record"
    ],
    "stage": "read_selection",
    "path": "fields",
    "code": "invalid_fields",
    "status": 400,
    "valid": "body,provenance",
    "invalid": "body.title"
  },
  {
    "kinds": [
      "record"
    ],
    "stage": "response",
    "path": "$",
    "code": "response_too_large",
    "status": 413,
    "valid": "Complete compact UTF-8 JSON at the endpoint byte limit",
    "invalid": "Complete compact UTF-8 JSON one byte over the endpoint byte limit"
  },
  {
    "kinds": [
      "send"
    ],
    "stage": "admission",
    "path": "state.connector_input",
    "code": "send_input_too_large",
    "status": 413,
    "valid": "Compact UTF-8 JSON of the combined input at 41,209 bytes",
    "invalid": "Compact UTF-8 JSON of the combined input at 41,210 bytes"
  },
  {
    "kinds": [
      "record"
    ],
    "stage": "state_patch",
    "path": "state_patch",
    "code": "patch_invalid",
    "status": 422,
    "valid": [
      {
        "op": "set",
        "key": "pinned",
        "value": true
      },
      {
        "op": "add_member",
        "key": "tags",
        "member": "trip"
      }
    ],
    "invalid": [
      {
        "op": "add_member",
        "key": "tags",
        "member": "Trip"
      },
      {
        "op": "remove_member",
        "key": "tags",
        "member": "trip"
      }
    ]
  },
  {
    "kinds": [
      "record"
    ],
    "stage": "state_patch",
    "path": "state,state_patch",
    "code": "patch_invalid",
    "status": 422,
    "valid": {
      "state_patch": [
        {
          "op": "remove",
          "key": "pinned"
        }
      ]
    },
    "invalid": {
      "state": {},
      "state_patch": [
        {
          "op": "remove",
          "key": "pinned"
        }
      ]
    }
  },
  {
    "kinds": [
      "record"
    ],
    "stage": "materialized_state",
    "path": "state",
    "code": "invalid_state",
    "status": 422,
    "valid": {
      "pinned": true,
      "connector_key": null
    },
    "invalid": {
      "pinned": "yes"
    }
  },
  {
    "kinds": [
      "send"
    ],
    "stage": "materialized_state",
    "path": "state.connector_input,state.connector_retry_of",
    "code": "server_owned_field",
    "status": 422,
    "valid": {
      "state": {
        "note": "Review later"
      }
    },
    "invalid": {
      "state_patch": [
        {
          "op": "remove",
          "key": "connector_input"
        }
      ]
    }
  },
  {
    "kinds": [
      "send"
    ],
    "stage": "materialized_body",
    "path": "body.feedback",
    "code": "server_owned_field",
    "status": 422,
    "valid": {
      "fields": {
        "via": "file"
      }
    },
    "invalid": {
      "fields": {
        "feedback": null
      }
    }
  },
  {
    "kinds": [
      "guide"
    ],
    "stage": "materialized_state",
    "path": "state.completed_stop_ids",
    "code": "invalid_state",
    "status": 422,
    "valid": "Add the Part ID of a stop in the resulting guide",
    "invalid": "Add the ID of a day or an absent stop"
  },
  {
    "kinds": [
      "guide"
    ],
    "stage": "materialized_body",
    "path": "body.days[].stops[].id",
    "code": "patch_invalid",
    "status": 422,
    "valid": "Insert with a new Part ID or reset a removed stop to its original",
    "invalid": "Reuse a retired stop Part ID for an inserted stop"
  },
  {
    "kinds": [
      "record"
    ],
    "stage": "materialized_state",
    "path": "state",
    "code": "state_too_large",
    "status": 413,
    "valid": "Final compact UTF-8 JSON at 65,536 bytes, including after a removal",
    "invalid": "Final compact UTF-8 JSON at 65,537 bytes after merging a stale patch"
  },
  {
    "kinds": [
      "place"
    ],
    "stage": "state_patch",
    "path": "state_patch.merge_experience",
    "code": "patch_invalid",
    "status": 422,
    "valid": {
      "op": "merge_experience",
      "value": {
        "version": 1,
        "visits": {
          "current": {
            "rating": {
              "value": null,
              "updated_at": "2030-07-04T19:00:00-04:00"
            }
          }
        }
      }
    },
    "invalid": {
      "op": "merge_experience",
      "value": {
        "version": 1,
        "visits": {
          "current": {
            "rating": null
          }
        }
      }
    }
  },
  {
    "kinds": [
      "preferences"
    ],
    "stage": "materialized_body",
    "path": "home_lat,home_lng",
    "code": "invalid_body",
    "status": 422,
    "valid": {
      "home_lat": 40.7,
      "home_lng": -74
    },
    "invalid": {
      "home_lat": 40.7
    }
  },
  {
    "kinds": [
      "preferences"
    ],
    "stage": "materialized_body",
    "path": "pinned_kinds",
    "code": "invalid_body",
    "status": 422,
    "valid": [
      "place",
      "recipe",
      "workout"
    ],
    "invalid": [
      "recipe",
      "recipe",
      "workout"
    ]
  },
  {
    "kinds": [
      "record"
    ],
    "stage": "dispatch",
    "path": "schema",
    "code": "unsupported_schema",
    "valid": {
      "kind": "note",
      "schema": "note@1.0"
    },
    "invalid": {
      "kind": "note",
      "schema": "note@1.1"
    },
    "status": 422
  },
  {
    "kinds": [
      "place"
    ],
    "stage": "materialized_body",
    "path": "lat,lng",
    "code": "invalid_body",
    "valid": {
      "lat": 40.7,
      "lng": -74
    },
    "invalid": {
      "lat": 40.7
    },
    "status": 422
  },
  {
    "kinds": [
      "event",
      "guide"
    ],
    "stage": "materialized_body",
    "path": "event schedule",
    "code": "invalid_body",
    "valid": {
      "all_day": true,
      "start_date": "2030-07-04",
      "end_date_exclusive": "2030-07-05"
    },
    "invalid": {
      "all_day": true,
      "starts_at": "2030-07-04T19:00:00-04:00",
      "timezone": "America/New_York"
    },
    "status": 422
  },
  {
    "kinds": [
      "event",
      "guide"
    ],
    "stage": "materialized_body",
    "path": "recurrence.rrule",
    "code": "invalid_body",
    "valid": "FREQ=WEEKLY;BYDAY=MO",
    "invalid": "FREQ=SECONDLY",
    "status": 422
  },
  {
    "kinds": [
      "product"
    ],
    "stage": "materialized_body",
    "path": "gtin",
    "code": "invalid_body",
    "valid": "4006381333931",
    "invalid": "4006381333932",
    "status": 422
  },
  {
    "kinds": [
      "recipe"
    ],
    "stage": "materialized_body",
    "path": "steps.*.ingredient_ids",
    "code": "invalid_body",
    "valid": {
      "ingredients": [
        {
          "id": "salt"
        }
      ],
      "steps": [
        {
          "id": "mix",
          "ingredient_ids": [
            "salt"
          ]
        }
      ]
    },
    "invalid": {
      "ingredients": [],
      "steps": [
        {
          "id": "mix",
          "ingredient_ids": [
            "salt"
          ]
        }
      ]
    },
    "status": 422
  },
  {
    "kinds": [
      "tab"
    ],
    "stage": "materialized_body",
    "path": "tuning,chords.*.{strings,fingers}",
    "code": "invalid_body",
    "valid": {
      "string_count": 4,
      "tuning": [
        "G4",
        "C4",
        "E4",
        "A4"
      ],
      "chords": [
        {
          "strings": [
            0,
            0,
            0,
            3
          ],
          "fingers": [
            0,
            0,
            0,
            3
          ]
        }
      ]
    },
    "invalid": {
      "string_count": 4,
      "tuning": [
        "G4",
        "C4",
        "E4"
      ],
      "chords": [
        {
          "strings": [
            0,
            0,
            0,
            3,
            2
          ],
          "fingers": [
            0,
            0
          ]
        }
      ]
    },
    "status": 422
  },
  {
    "kinds": [
      "tab"
    ],
    "stage": "materialized_body",
    "path": "sections.*.measures.*.chord_id",
    "code": "invalid_body",
    "valid": {
      "chords": [
        {
          "id": "c1"
        }
      ],
      "measure": {
        "chord_id": "c1"
      }
    },
    "invalid": {
      "chords": [
        {
          "id": "c1"
        }
      ],
      "measure": {
        "chord_id": "c2"
      }
    },
    "status": 422
  },
  {
    "kinds": [
      "tab"
    ],
    "stage": "materialized_body",
    "path": "sections.*.measures.*.beats.*.notes.*.string",
    "code": "invalid_body",
    "valid": {
      "string_count": 4,
      "notes": [
        {
          "string": 1
        },
        {
          "string": 4
        }
      ]
    },
    "invalid": {
      "string_count": 4,
      "notes": [
        {
          "string": 1
        },
        {
          "string": 1
        },
        {
          "string": 5
        }
      ]
    },
    "status": 422
  },
  {
    "kinds": [
      "tab"
    ],
    "stage": "materialized_body",
    "path": "sections.*.measures.*.beats.*.notes",
    "code": "invalid_body",
    "valid": {
      "rest": true,
      "notes": []
    },
    "invalid": {
      "rest": true,
      "notes": [
        {
          "string": 1,
          "fret": 2,
          "techniques": []
        }
      ]
    },
    "status": 422
  },
  {
    "kinds": [
      "meal"
    ],
    "stage": "materialized_body",
    "path": "servings,scale",
    "code": "invalid_body",
    "valid": {
      "servings": "2.5",
      "scale": "1"
    },
    "invalid": {
      "servings": "0",
      "scale": "1000.01"
    },
    "status": 422
  },
  {
    "kinds": [
      "session"
    ],
    "stage": "materialized_body",
    "path": "occurrences.*.sets.*.completed_at",
    "code": "invalid_body",
    "valid": {
      "state": "completed",
      "completed_at": "2030-07-04T19:00:00Z"
    },
    "invalid": {
      "state": "completed"
    },
    "status": 422
  },
  {
    "kinds": [
      "category"
    ],
    "stage": "materialized_body",
    "path": "title",
    "code": "invalid_body",
    "valid": {
      "title": "Strength",
      "symbol": "dumbbell"
    },
    "invalid": {
      "symbol": "dumbbell"
    },
    "status": 422
  },
  {
    "kinds": [
      "session",
      "program_run"
    ],
    "stage": "materialized_body",
    "path": "**.mass_kg",
    "code": "invalid_body",
    "valid": {
      "mass": {
        "value": "1",
        "unit": "lb"
      },
      "mass_kg": "0.45359237"
    },
    "invalid": {
      "mass": {
        "value": "1",
        "unit": "lb"
      },
      "mass_kg": "1"
    },
    "status": 422
  },
  {
    "kinds": [
      "workout_version"
    ],
    "stage": "materialized_body_after_reference_rewrite",
    "path": "body_sha256",
    "code": "invalid_body",
    "valid": "SHA-256 of compact UTF-8 workout JSON with recursively sorted object keys",
    "invalid": "Digest of the pre-rewrite workout or another version's body",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "materialized_body",
    "path": "**.id",
    "code": "invalid_body",
    "valid": [
      "unique-first-id",
      "unique-second-id"
    ],
    "invalid": [
      "repeated-id",
      "repeated-id"
    ],
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "create",
    "path": "mutations[].schema",
    "code": "invalid_request",
    "valid": "A kind and its exact @1.0 ID",
    "invalid": "A different or unregistered kind/schema pair",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "materialized_body",
    "path": "body",
    "code": "body_too_large",
    "valid": "Final compact UTF-8 body at its byte limit",
    "invalid": "Final compact UTF-8 body one byte over its limit",
    "status": 413
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "materialized_state",
    "path": "state",
    "code": "state_too_large",
    "valid": "Final compact UTF-8 map at its byte limit",
    "invalid": "Final compact UTF-8 map one byte over its limit",
    "status": 413
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "operation_admission",
    "path": "mutations",
    "code": "operation_too_large",
    "valid": "Request bytes and mutation count within both limits",
    "invalid": "Request bytes or mutation count over its limit",
    "status": 413
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "create",
    "path": "mutations[].create_id",
    "code": "duplicate_create_id",
    "valid": "A different create ID for each intended record",
    "invalid": "Two creates with the same create ID in one operation",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "create_or_update",
    "path": "external_ids[].ns",
    "code": "namespace_denied",
    "valid": "An alias in the caller’s connection namespace",
    "invalid": "An alias in another connection’s namespace",
    "status": 403
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "typed_reference",
    "path": "Declared record target",
    "code": "create_reference_unavailable",
    "valid": "A planned create ID that resolves to a readable live record",
    "invalid": "A planned create ID that cannot resolve to a readable live record",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "typed_reference",
    "path": "Declared record target",
    "code": "dangling_reference",
    "valid": "A readable live record of the expected kind or a create ID allocated by this operation",
    "invalid": "A newly introduced typed reference to a missing, unreadable or deleted record",
    "status": 422
  },
  {
    "kinds": [
      "meal"
    ],
    "stage": "typed_reference",
    "path": "recipe_id",
    "code": "reference_kind_mismatch",
    "valid": "A linked recipe record ID",
    "invalid": "A grocery list record ID",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "typed_reference",
    "path": "Declared part selector",
    "code": "reference_part_mismatch",
    "valid": "A present part of the expected type and parent",
    "invalid": "A missing part or one under the wrong parent",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "typed_reference",
    "path": "Declared workout pin",
    "code": "reference_hash_mismatch",
    "valid": "A version with the expected body hash",
    "invalid": "A version with a different body hash",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "patch",
    "path": "part_ops[].list",
    "code": "patch_invalid",
    "valid": "An insert into note sections",
    "invalid": "An insert into atomic note tags",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "patch",
    "path": "reset",
    "code": "reset_no_upstream",
    "valid": "An edited source-backed record with a current base",
    "invalid": "A record authored without an upstream source",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "patch",
    "path": "reset",
    "code": "reset_not_edited",
    "valid": "An address owned by an overlay edit",
    "invalid": "An unchanged source field",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "patch",
    "path": "reset",
    "code": "reset_conflict",
    "valid": "A current disjoint edit and reset",
    "invalid": "Overlapping reset and explicit edit intent",
    "status": 409
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "patch",
    "path": "reset",
    "code": "reset_dependency",
    "valid": "Addresses that reset together without breaking an invariant",
    "invalid": "Reset of only one side of a required dependency",
    "status": 409
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "update_or_patch",
    "path": "base",
    "code": "base_unknown",
    "valid": "The revision number paired with its acknowledged operation ID",
    "invalid": "A number paired with another operation ID",
    "status": 409
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "strict_write",
    "path": "base",
    "code": "revision_conflict",
    "valid": "A strict edit against the current revision",
    "invalid": "A strict edit against a stale revision",
    "status": 409
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "retry",
    "path": "Idempotency-Key",
    "code": "idempotency_key_reused",
    "valid": "The same request under the same account and connection key",
    "invalid": "Changed mutations under the same live key",
    "status": 422
  },
  {
    "kinds": [
      "workout_version",
      "operation_log"
    ],
    "stage": "update_or_patch",
    "path": "body",
    "code": "immutable_record",
    "valid": "Create the immutable body once",
    "invalid": "Change the body after creation",
    "status": 422
  },
  {
    "kinds": [
      "exercise",
      "exercise_override",
      "modifier_assignment"
    ],
    "stage": "update_or_patch",
    "path": "Protected operation lineage",
    "code": "lineage_protected",
    "valid": "An ordinary edit that retains its existing lineage",
    "invalid": "A forged operation binding",
    "status": 422
  },
  {
    "kinds": [
      "*"
    ],
    "stage": "assistant_write",
    "path": "mutations[]",
    "code": "assistant_edit_shape",
    "valid": "Strict body-only patch of a readable editable save",
    "invalid": "A state replacement under the assistant-only grant",
    "status": 422
  },
  {
    "kinds": [
      "grocery_list"
    ],
    "stage": "create",
    "path": "mutations[].kind",
    "code": "grocery_list_exists",
    "valid": "Create the first live grocery list",
    "invalid": "Create another live grocery list for the account",
    "status": 409
  }
]
