{
  "$defs": {
    "AcceptedValuesCheck": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "title": "Column",
          "type": "string"
        },
        "values": {
          "items": {},
          "title": "Values",
          "type": "array"
        }
      },
      "required": [
        "column",
        "values"
      ],
      "title": "AcceptedValuesCheck",
      "type": "object"
    },
    "ArtifactsConfig": {
      "additionalProperties": false,
      "properties": {
        "intermediate_ttl": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "default": 86400,
          "description": "How long the persisted results of `intermediate` models are kept after their run ended.\n0 deletes them when a run succeeds. Default 1d.",
          "title": "Intermediate Ttl"
        },
        "root": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Directory or volume path where artifacts are written.",
          "title": "Root"
        }
      },
      "title": "ArtifactsConfig",
      "type": "object"
    },
    "CheckConfig": {
      "additionalProperties": false,
      "properties": {
        "accepted_values": {
          "anyOf": [
            {
              "$ref": "#/$defs/AcceptedValuesCheck"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "freshness": {
          "anyOf": [
            {
              "$ref": "#/$defs/FreshnessCheck"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "not_null": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Not Null"
        },
        "range": {
          "anyOf": [
            {
              "$ref": "#/$defs/RangeCheck"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "regex": {
          "anyOf": [
            {
              "$ref": "#/$defs/RegexCheck"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "row_count": {
          "anyOf": [
            {
              "$ref": "#/$defs/RowCountCheck"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "unique": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Unique"
        }
      },
      "title": "CheckConfig",
      "type": "object"
    },
    "DeletesConfig": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "description": "Column that marks a deleted row.",
          "title": "Column",
          "type": "string"
        },
        "mode": {
          "default": "hard",
          "description": "Remove the row, or keep it flagged.",
          "enum": [
            "hard",
            "soft"
          ],
          "title": "Mode",
          "type": "string"
        },
        "value": {
          "default": true,
          "description": "Value of the column that means deleted.",
          "title": "Value"
        }
      },
      "required": [
        "column"
      ],
      "title": "DeletesConfig",
      "type": "object"
    },
    "EventsConfig": {
      "additionalProperties": false,
      "properties": {
        "sinks": {
          "description": "Event sinks.",
          "items": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "buffer_size": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 10000,
                    "description": "Events held by a buffered sink before the oldest is dropped.",
                    "title": "Buffer Size"
                  },
                  "buffered": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": false,
                    "description": "Run the sink on a background thread.",
                    "title": "Buffered"
                  },
                  "failure_budget": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 5,
                    "description": "Consecutive failures before the sink is disabled.",
                    "title": "Failure Budget"
                  },
                  "kind": {
                    "const": "console",
                    "description": "Readable lines on stderr."
                  }
                },
                "required": [
                  "kind"
                ],
                "title": "console",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "buffer_size": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 10000,
                    "description": "Events held by a buffered sink before the oldest is dropped.",
                    "title": "Buffer Size"
                  },
                  "buffered": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": false,
                    "description": "Run the sink on a background thread.",
                    "title": "Buffered"
                  },
                  "failure_budget": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 5,
                    "description": "Consecutive failures before the sink is disabled.",
                    "title": "Failure Budget"
                  },
                  "kind": {
                    "const": "jsonl",
                    "description": "One JSON event per line, to stderr or a file under the project."
                  },
                  "path": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "File to write, relative to the project directory. Stderr when omitted.",
                    "title": "Path"
                  }
                },
                "required": [
                  "kind"
                ],
                "title": "jsonl",
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "buffer_size": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 10000,
                    "description": "Events held by a buffered sink before the oldest is dropped.",
                    "title": "Buffer Size"
                  },
                  "buffered": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": false,
                    "description": "Run the sink on a background thread.",
                    "title": "Buffered"
                  },
                  "events": {
                    "default": [
                      "run.completed"
                    ],
                    "description": "Event types to post.",
                    "items": {
                      "type": "string"
                    },
                    "title": "Events",
                    "type": "array"
                  },
                  "failure_budget": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 5,
                    "description": "Consecutive failures before the sink is disabled.",
                    "title": "Failure Budget"
                  },
                  "kind": {
                    "const": "webhook",
                    "description": "Posts selected events as JSON to a webhook URL given as a secret."
                  },
                  "max_failures": {
                    "anyOf": [
                      {
                        "minimum": 1,
                        "type": "integer"
                      },
                      {
                        "pattern": "^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 3,
                    "description": "Failed posts in a row before the sink stops posting.",
                    "title": "Max Failures"
                  },
                  "min_level": {
                    "anyOf": [
                      {
                        "enum": [
                          "warning",
                          "error"
                        ],
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Also post every event at or above this level. Off by default.",
                    "title": "Min Level"
                  },
                  "secret_url": {
                    "description": "The webhook URL, as ${secret:provider/path}. Only http and https; never logged.",
                    "title": "Secret Url",
                    "type": "string"
                  },
                  "statuses": {
                    "default": [
                      "failed"
                    ],
                    "description": "A run.completed event is posted only with one of these statuses.",
                    "items": {
                      "enum": [
                        "succeeded",
                        "failed",
                        "cancelled"
                      ],
                      "type": "string"
                    },
                    "title": "Statuses",
                    "type": "array"
                  },
                  "timeout": {
                    "anyOf": [
                      {
                        "minimum": 0,
                        "type": "integer"
                      },
                      {
                        "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
                        "type": "string"
                      }
                    ],
                    "default": 10,
                    "description": "Seconds to wait for each post, as 10 or 30s.",
                    "title": "Timeout"
                  }
                },
                "required": [
                  "kind",
                  "secret_url"
                ],
                "title": "webhook",
                "type": "object"
              }
            ]
          },
          "title": "Sinks",
          "type": "array"
        }
      },
      "title": "EventsConfig",
      "type": "object"
    },
    "ExpectationConfig": {
      "additionalProperties": false,
      "properties": {
        "check": {
          "anyOf": [
            {
              "$ref": "#/$defs/CheckConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A portable check."
        },
        "expr": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "An engine-dialect predicate.",
          "title": "Expr"
        },
        "name": {
          "description": "Name shown in results.",
          "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
          "title": "Name",
          "type": "string"
        },
        "on_violation": {
          "default": "fail",
          "description": "What happens to rows or runs that violate it.",
          "enum": [
            "warn",
            "drop",
            "fail"
          ],
          "title": "On Violation",
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "title": "ExpectationConfig",
      "type": "object"
    },
    "FolderSettings": {
      "additionalProperties": {
        "$ref": "#/$defs/FolderSettings"
      },
      "description": "One folder of the `models:` tree in pipeloom.yml: settings written as `+key`, and\nsub-folders written as plain keys.",
      "properties": {
        "+catalog": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Catalog of the target relation; wins over the naming strategy's catalog.",
          "title": "+Catalog"
        },
        "+cluster_by": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Clustering columns.",
          "title": "+Cluster By"
        },
        "+expectations": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/ExpectationConfig"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Data quality expectations.",
          "title": "+Expectations"
        },
        "+frame_api": {
          "anyOf": [
            {
              "enum": [
                "native",
                "narwhals"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Frame type passed to Python bodies.",
          "title": "+Frame Api"
        },
        "+incremental": {
          "anyOf": [
            {
              "$ref": "#/$defs/IncrementalConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Incremental processing."
        },
        "+materialized": {
          "anyOf": [
            {
              "enum": [
                "table",
                "incremental",
                "view",
                "ephemeral",
                "intermediate"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "How the model is stored.",
          "title": "+Materialized"
        },
        "+meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Free-form metadata.",
          "title": "+Meta"
        },
        "+partition_by": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Partition columns.",
          "title": "+Partition By"
        },
        "+quality": {
          "anyOf": [
            {
              "$ref": "#/$defs/QualityConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Quarantine settings."
        },
        "+retries": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Retries after a failure.",
          "title": "+Retries"
        },
        "+retry_delay": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Base delay between retries.",
          "title": "+Retry Delay"
        },
        "+retry_on": {
          "anyOf": [
            {
              "enum": [
                "transient",
                "any"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Which failures are retried.",
          "title": "+Retry On"
        },
        "+schema": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Schema (namespace) of the target relation.",
          "title": "+Schema"
        },
        "+sql_dialect": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "sqlglot dialect of the model's `ctx.sql` queries; translated when it differs from the\nengine's (needs the sqlglot extra).",
          "title": "+Sql Dialect"
        },
        "+tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tags used by selectors.",
          "title": "+Tags"
        },
        "+timeout": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Time limit per attempt.",
          "title": "+Timeout"
        },
        "+write": {
          "anyOf": [
            {
              "$ref": "#/$defs/WriteConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Write behaviour."
        }
      },
      "title": "FolderSettings",
      "type": "object"
    },
    "FreshnessCheck": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "title": "Column",
          "type": "string"
        },
        "max_age": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "title": "Max Age"
        }
      },
      "required": [
        "column",
        "max_age"
      ],
      "title": "FreshnessCheck",
      "type": "object"
    },
    "IncrementalConfig": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Column compared with the watermark.",
          "title": "Column"
        },
        "input": {
          "description": "Alias of the input that is filtered.",
          "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
          "title": "Input",
          "type": "string"
        },
        "interval": {
          "anyOf": [
            {
              "$ref": "#/$defs/IntervalConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Process the input in windows of event_time instead of after a watermark (since 1.3)."
        },
        "lookback": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "default": 0,
          "description": "Reprocess this much before the watermark.",
          "title": "Lookback"
        },
        "on_cursor_value_missing": {
          "anyOf": [
            {
              "enum": [
                "raise",
                "include",
                "exclude"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Rows whose `column` is null: fail the unit, keep them in every batch, or drop and count\nthem. Unset keeps the 1.0 behavior (the watermark filter drops them, unreported). Watermark\nmodels only (since 1.3).",
          "title": "On Cursor Value Missing"
        },
        "watermark_source": {
          "default": "state",
          "description": "Where the watermark is read from.",
          "enum": [
            "state",
            "target"
          ],
          "title": "Watermark Source",
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "title": "IncrementalConfig",
      "type": "object"
    },
    "IntervalConfig": {
      "additionalProperties": false,
      "description": "Interval incrementals (ADR-0054): the model runs one half-open UTC window at a time.",
      "properties": {
        "begin": {
          "description": "ISO date or date-time; the first window is the one that holds it. Naive means UTC.",
          "format": "date-time",
          "title": "Begin",
          "type": "string"
        },
        "event_time": {
          "description": "Column of the input and of the output that places a row in a window.",
          "minLength": 1,
          "title": "Event Time",
          "type": "string"
        },
        "grain": {
          "description": "Window length. Windows start at the grain boundary in UTC; weeks start on Monday.",
          "enum": [
            "hour",
            "day",
            "week",
            "month",
            "year"
          ],
          "title": "Grain",
          "type": "string"
        },
        "lookback": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "default": 0,
          "description": "Windows before the first missing one that run again.",
          "title": "Lookback"
        }
      },
      "required": [
        "event_time",
        "grain",
        "begin"
      ],
      "title": "IntervalConfig",
      "type": "object"
    },
    "PluginBlock": {
      "additionalProperties": true,
      "description": "A plugin selection: `kind` plus the options of that plugin.",
      "properties": {
        "kind": {
          "description": "Name of the plugin.",
          "title": "Kind",
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "title": "PluginBlock",
      "type": "object"
    },
    "QualityConfig": {
      "additionalProperties": false,
      "properties": {
        "max_drop_ratio": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0,
              "type": "number"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Fail the unit when more than this share of rows is dropped.",
          "title": "Max Drop Ratio"
        },
        "quarantine": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "default": false,
          "description": "Write dropped rows to a quarantine table.",
          "title": "Quarantine"
        }
      },
      "title": "QualityConfig",
      "type": "object"
    },
    "RangeCheck": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "title": "Column",
          "type": "string"
        },
        "max": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max"
        },
        "min": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Min"
        }
      },
      "required": [
        "column"
      ],
      "title": "RangeCheck",
      "type": "object"
    },
    "RegexCheck": {
      "additionalProperties": false,
      "properties": {
        "column": {
          "title": "Column",
          "type": "string"
        },
        "pattern": {
          "title": "Pattern",
          "type": "string"
        }
      },
      "required": [
        "column",
        "pattern"
      ],
      "title": "RegexCheck",
      "type": "object"
    },
    "RowCountCheck": {
      "additionalProperties": false,
      "properties": {
        "max": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max"
        },
        "min": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Min"
        }
      },
      "title": "RowCountCheck",
      "type": "object"
    },
    "SinkBlock": {
      "additionalProperties": true,
      "description": "An event sink.",
      "properties": {
        "buffer_size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "default": 10000,
          "description": "Events held by a buffered sink before the oldest is dropped.",
          "title": "Buffer Size"
        },
        "buffered": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "default": false,
          "description": "Run the sink on a background thread.",
          "title": "Buffered"
        },
        "failure_budget": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            }
          ],
          "default": 5,
          "description": "Consecutive failures before the sink is disabled.",
          "title": "Failure Budget"
        },
        "kind": {
          "description": "Name of the plugin.",
          "title": "Kind",
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "title": "SinkBlock",
      "type": "object"
    },
    "SourceGroupConfig": {
      "additionalProperties": false,
      "description": "A group of source tables that share a format, a location or a schema.",
      "properties": {
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "What the group holds.",
          "title": "Description"
        },
        "format": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "File or table format of its tables.",
          "title": "Format"
        },
        "location": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Base path or URI that table locations are joined to.",
          "title": "Location"
        },
        "meta": {
          "additionalProperties": true,
          "description": "Free-form metadata.",
          "title": "Meta",
          "type": "object"
        },
        "options": {
          "additionalProperties": true,
          "description": "Reader options.",
          "title": "Options",
          "type": "object"
        },
        "schema": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Schema that qualifies table names.",
          "title": "Schema"
        },
        "tables": {
          "description": "Tables by name. An empty entry reads the table named by its key.",
          "patternProperties": {
            "^[A-Za-z_][A-Za-z0-9_]*$": {
              "anyOf": [
                {
                  "$ref": "#/$defs/SourceTableConfig"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "title": "Tables",
          "type": "object"
        },
        "tags": {
          "description": "Tags used by selectors.",
          "items": {
            "type": "string"
          },
          "title": "Tags",
          "type": "array"
        }
      },
      "title": "SourceGroupConfig",
      "type": "object"
    },
    "SourceTableConfig": {
      "additionalProperties": false,
      "description": "One table of a source group. Keys it leaves out come from the group.",
      "properties": {
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "What the table holds.",
          "title": "Description"
        },
        "format": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "File or table format; replaces the group format.",
          "title": "Format"
        },
        "location": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Path joined to the group location.",
          "title": "Location"
        },
        "meta": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Free-form metadata, merged over the group meta.",
          "title": "Meta"
        },
        "options": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Reader options, merged over the group options.",
          "title": "Options"
        },
        "schema": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Schema that qualifies the table name; replaces the group schema.",
          "title": "Schema"
        },
        "table": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Table name, qualified by the group schema. Without location or table, the key is used.",
          "title": "Table"
        },
        "tags": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tags added to the group tags.",
          "title": "Tags"
        }
      },
      "title": "SourceTableConfig",
      "type": "object"
    },
    "TargetConfig": {
      "additionalProperties": false,
      "description": "One deployment target.",
      "properties": {
        "artifacts": {
          "anyOf": [
            {
              "$ref": "#/$defs/ArtifactsConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Where artifacts go."
        },
        "boundary": {
          "anyOf": [
            {
              "enum": [
                "process",
                "task"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Whether units share a process or run as separate tasks.",
          "title": "Boundary"
        },
        "cancel_grace": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Time a stopped or timed-out unit gets to finish before it is killed. Default 30s.",
          "title": "Cancel Grace"
        },
        "catalog": {
          "description": "Catalog plugin.",
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "format": {
                  "default": "parquet",
                  "description": "File format of the part files engines write.",
                  "enum": [
                    "parquet",
                    "csv",
                    "ndjson"
                  ],
                  "title": "Format",
                  "type": "string"
                },
                "kind": {
                  "const": "filesystem",
                  "description": "Tables as part files under a directory, committed atomically."
                },
                "root": {
                  "default": ".",
                  "description": "Directory under which schemas and tables are laid out.",
                  "title": "Root",
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "title": "filesystem",
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "memory",
                  "description": "In-memory catalog for tests."
                },
                "root": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "The engine's `root`, to see the same tables.",
                  "title": "Root"
                }
              },
              "required": [
                "kind"
              ],
              "title": "memory",
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "deploy": {
          "anyOf": [
            {
              "$ref": "#/$defs/PluginBlock"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "How an orchestrator deploys and runs the plan: a `renderers` plugin and its options."
        },
        "engine": {
          "description": "Engine plugin.",
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "memory",
                  "description": "In-memory engine for tests; SQL runs on sqlite3."
                },
                "root": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Keep tables as JSON files in this directory, so other processes see them.",
                  "title": "Root"
                },
                "tables": {
                  "additionalProperties": {
                    "items": {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "description": "Tables to start with, by name; each is a list of rows.",
                  "title": "Tables",
                  "type": "object"
                }
              },
              "required": [
                "kind"
              ],
              "title": "memory",
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "naming": {
          "description": "Naming strategy plugin.",
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "catalog": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Catalog of every relation.",
                  "title": "Catalog"
                },
                "kind": {
                  "const": "none",
                  "description": "Schema as given."
                },
                "schema": {
                  "default": "main",
                  "description": "Default schema; a model's own schema wins.",
                  "title": "Schema",
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "title": "none",
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "catalog": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Catalog of every relation.",
                  "title": "Catalog"
                },
                "kind": {
                  "const": "per_user",
                  "description": "Schema with the user name appended."
                },
                "schema": {
                  "default": "main",
                  "description": "Default schema; a model's own schema wins.",
                  "title": "Schema",
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "title": "per_user",
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "catalog": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Catalog of every relation.",
                  "title": "Catalog"
                },
                "kind": {
                  "const": "prefix",
                  "description": "Schema with a fixed prefix."
                },
                "schema": {
                  "default": "main",
                  "description": "Default schema; a model's own schema wins.",
                  "title": "Schema",
                  "type": "string"
                },
                "schema_prefix": {
                  "default": "",
                  "description": "Text put in front of the schema name.",
                  "title": "Schema Prefix",
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "title": "prefix",
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "sources": {
          "anyOf": [
            {
              "patternProperties": {
                "^[A-Za-z_][A-Za-z0-9_]*$": {
                  "additionalProperties": true,
                  "type": "object"
                }
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Source group overrides, deep-merged over the groups; an explicit null removes a key.",
          "title": "Sources"
        },
        "state": {
          "description": "State store plugin.",
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "json",
                  "description": "State as JSON files in a directory; safe to share between processes."
                },
                "path": {
                  "default": ".pipeloom/state",
                  "description": "State directory, relative to the project directory.",
                  "title": "Path",
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "title": "json",
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "sqlite",
                  "description": "State in one sqlite file on this machine."
                },
                "path": {
                  "default": ".pipeloom/state.db",
                  "description": "Database file, relative to the project directory.",
                  "title": "Path",
                  "type": "string"
                }
              },
              "required": [
                "kind"
              ],
              "title": "sqlite",
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "workers": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "pattern": "^\\$\\{.+\\}$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum concurrent units.",
          "title": "Workers"
        }
      },
      "title": "TargetConfig",
      "type": "object"
    },
    "WriteConfig": {
      "additionalProperties": false,
      "properties": {
        "deletes": {
          "anyOf": [
            {
              "$ref": "#/$defs/DeletesConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "How deleted rows are recognised and applied."
        },
        "on_schema_change": {
          "default": "fail",
          "description": "Policy when the output schema differs from the target.",
          "enum": [
            "fail",
            "ignore",
            "append_new_columns",
            "sync_all_columns"
          ],
          "title": "On Schema Change",
          "type": "string"
        },
        "options": {
          "additionalProperties": true,
          "description": "Engine-specific write options.",
          "title": "Options",
          "type": "object"
        },
        "strategy": {
          "anyOf": [
            {
              "enum": [
                "append",
                "overwrite",
                "replace_partitions",
                "merge",
                "scd2"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "How rows reach the target.",
          "title": "Strategy"
        },
        "table_properties": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Properties set on the target table.",
          "title": "Table Properties",
          "type": "object"
        },
        "tracked_columns": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Columns whose change opens a new scd2 row; default all.",
          "title": "Tracked Columns"
        },
        "unique_key": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Columns that identify a row (merge and scd2).",
          "title": "Unique Key"
        },
        "update_condition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Extra condition for updating a matched row (merge).",
          "title": "Update Condition"
        }
      },
      "title": "WriteConfig",
      "type": "object"
    }
  },
  "$id": "https://emanuel-luis.github.io/pipeloom/latest/schema/v1/project.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "The pipeloom.yml file.",
  "properties": {
    "artifacts": {
      "anyOf": [
        {
          "$ref": "#/$defs/ArtifactsConfig"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Where artifacts go."
    },
    "boundary": {
      "anyOf": [
        {
          "enum": [
            "process",
            "task"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether units share a process or run as separate tasks.",
      "title": "Boundary"
    },
    "cancel_grace": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "pattern": "^(?=.)(?:\\d+d)?(?:\\d+h)?(?:\\d+m)?(?:\\d+s)?$|^\\d+$|^\\$\\{.+\\}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Time a stopped or timed-out unit gets to finish before it is killed. Default 30s.",
      "title": "Cancel Grace"
    },
    "catalog": {
      "description": "Catalog plugin.",
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "format": {
              "default": "parquet",
              "description": "File format of the part files engines write.",
              "enum": [
                "parquet",
                "csv",
                "ndjson"
              ],
              "title": "Format",
              "type": "string"
            },
            "kind": {
              "const": "filesystem",
              "description": "Tables as part files under a directory, committed atomically."
            },
            "root": {
              "default": ".",
              "description": "Directory under which schemas and tables are laid out.",
              "title": "Root",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "title": "filesystem",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "memory",
              "description": "In-memory catalog for tests."
            },
            "root": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "The engine's `root`, to see the same tables.",
              "title": "Root"
            }
          },
          "required": [
            "kind"
          ],
          "title": "memory",
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "config_version": {
      "const": 1,
      "description": "Schema version of this file.",
      "title": "Config Version",
      "type": "integer"
    },
    "default_target": {
      "anyOf": [
        {
          "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Target used when none is selected.",
      "title": "Default Target"
    },
    "deploy": {
      "anyOf": [
        {
          "$ref": "#/$defs/PluginBlock"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "How an orchestrator deploys and runs the plan: a `renderers` plugin and its options."
    },
    "engine": {
      "description": "Engine plugin.",
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "memory",
              "description": "In-memory engine for tests; SQL runs on sqlite3."
            },
            "root": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Keep tables as JSON files in this directory, so other processes see them.",
              "title": "Root"
            },
            "tables": {
              "additionalProperties": {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              "description": "Tables to start with, by name; each is a list of rows.",
              "title": "Tables",
              "type": "object"
            }
          },
          "required": [
            "kind"
          ],
          "title": "memory",
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "ephemeral_fanout_warn": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "pattern": "^\\$\\{.+\\}$",
          "type": "string"
        }
      ],
      "default": 3,
      "description": "Warn when an ephemeral model feeds more units than this.",
      "title": "Ephemeral Fanout Warn"
    },
    "events": {
      "$ref": "#/$defs/EventsConfig",
      "description": "Event sinks."
    },
    "model_packages": {
      "description": "Installed packages whose modules hold models, by dotted name.",
      "items": {
        "pattern": "^[A-Za-z_]\\w*(\\.[A-Za-z_]\\w*)*$",
        "type": "string"
      },
      "title": "Model Packages",
      "type": "array"
    },
    "model_paths": {
      "description": "Directories that hold model files.",
      "items": {
        "type": "string"
      },
      "title": "Model Paths",
      "type": "array"
    },
    "models": {
      "$ref": "#/$defs/FolderSettings",
      "description": "Model settings by folder: `+key` settings apply to every model below that folder, and\nplain keys name sub-folders of model_paths. Root `+key` settings are project defaults."
    },
    "name": {
      "description": "Project name.",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
      "title": "Name",
      "type": "string"
    },
    "naming": {
      "description": "Naming strategy plugin.",
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "catalog": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Catalog of every relation.",
              "title": "Catalog"
            },
            "kind": {
              "const": "none",
              "description": "Schema as given."
            },
            "schema": {
              "default": "main",
              "description": "Default schema; a model's own schema wins.",
              "title": "Schema",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "title": "none",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "catalog": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Catalog of every relation.",
              "title": "Catalog"
            },
            "kind": {
              "const": "per_user",
              "description": "Schema with the user name appended."
            },
            "schema": {
              "default": "main",
              "description": "Default schema; a model's own schema wins.",
              "title": "Schema",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "title": "per_user",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "catalog": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "Catalog of every relation.",
              "title": "Catalog"
            },
            "kind": {
              "const": "prefix",
              "description": "Schema with a fixed prefix."
            },
            "schema": {
              "default": "main",
              "description": "Default schema; a model's own schema wins.",
              "title": "Schema",
              "type": "string"
            },
            "schema_prefix": {
              "default": "",
              "description": "Text put in front of the schema name.",
              "title": "Schema Prefix",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "title": "prefix",
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "python_paths": {
      "description": "Directories added to sys.path when models run.",
      "items": {
        "type": "string"
      },
      "title": "Python Paths",
      "type": "array"
    },
    "sources": {
      "description": "Source groups by name.",
      "patternProperties": {
        "^[A-Za-z_][A-Za-z0-9_]*$": {
          "$ref": "#/$defs/SourceGroupConfig"
        }
      },
      "title": "Sources",
      "type": "object"
    },
    "state": {
      "description": "State store plugin.",
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "json",
              "description": "State as JSON files in a directory; safe to share between processes."
            },
            "path": {
              "default": ".pipeloom/state",
              "description": "State directory, relative to the project directory.",
              "title": "Path",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "title": "json",
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "sqlite",
              "description": "State in one sqlite file on this machine."
            },
            "path": {
              "default": ".pipeloom/state.db",
              "description": "Database file, relative to the project directory.",
              "title": "Path",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "title": "sqlite",
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "targets": {
      "description": "Deployment targets.",
      "minProperties": 1,
      "patternProperties": {
        "^[A-Za-z_][A-Za-z0-9_]*$": {
          "$ref": "#/$defs/TargetConfig"
        }
      },
      "title": "Targets",
      "type": "object"
    },
    "vars": {
      "additionalProperties": true,
      "description": "Variables for ${var:name}.",
      "title": "Vars",
      "type": "object"
    },
    "workers": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "pattern": "^\\$\\{.+\\}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Maximum concurrent units.",
      "title": "Workers"
    }
  },
  "required": [
    "config_version",
    "name",
    "targets"
  ],
  "title": "pipeloom project",
  "type": "object"
}
