> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/api-and-integrations/rest-api-reference/models.md).

# Models

## The ActionabilityEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]}}}}
```

## The AdjustProbabilitySpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]}}}}
```

## The AggregateFunctionEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]}}}}
```

## The AggregateModeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]}}}}
```

## The AggregationFunctionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]}}}}
```

## The AlertTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AlertTypeEnum":{"type":"string","enum":["spike","worsening","improving","sustained","normal"]}}}}
```

## The AnchorLocationTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AnchorLocationTypeEnum":{"type":"string","enum":["latitude","longitude","coordinate","country","region","city","postal_code","address","continent","airport_code","unlocode"]}}}}
```

## The anchorSqlCandidateSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlCandidateSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["concept","metric","derived","source","dataset","tag","grain"]},"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","default":0},"syntax":{"type":["string","null"]}},"required":["kind","id","name"]}}}}
```

## The anchorSqlEnrichmentProgressSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlEnrichmentProgressSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"conceptId":{"type":"string"},"conceptName":{"type":"string"},"status":{"type":"string"},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]}},"required":["datasetId","datasetName","conceptId","conceptName","status"]}}}}
```

## The anchorSqlErrorCodeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlErrorCodeSchema":{"type":"string","minLength":1}}}}
```

## The anchorSqlErrorResponseSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlErrorResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"$ref":"#/components/schemas/anchorSqlStructuredErrorSchema"}},"required":["ok","error"]},"anchorSqlStructuredErrorSchema":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/anchorSqlErrorCodeSchema"},"message":{"type":"string"},"span":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]},{"type":"null"}]},"perSource":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlPerSourceDiagnosticSchema"},"default":[]},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlCandidateSchema"},"default":[]},"suggestedQuery":{"type":["string","null"]},"enrichmentProgress":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlEnrichmentProgressSchema"},"default":[]}},"required":["code","message"]},"anchorSqlErrorCodeSchema":{"type":"string","minLength":1},"anchorSqlPerSourceDiagnosticSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"reason":{"type":"string"}},"required":["datasetId","datasetName","reason"]},"anchorSqlCandidateSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["concept","metric","derived","source","dataset","tag","grain"]},"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","default":0},"syntax":{"type":["string","null"]}},"required":["kind","id","name"]},"anchorSqlEnrichmentProgressSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"conceptId":{"type":"string"},"conceptName":{"type":"string"},"status":{"type":"string"},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]}},"required":["datasetId","datasetName","conceptId","conceptName","status"]}}}}
```

## The anchorSqlInvolvedConceptSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlInvolvedConceptSchema":{"type":"object","properties":{"conceptId":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["referenced","related","anchor","geo"]}},"required":["conceptId","name","role"]}}}}
```

## The anchorSqlJoinPlanStepSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlJoinPlanStepSchema":{"type":"object","properties":{"sourceDatasetId":{"type":"string"},"targetDatasetId":{"type":"string"},"conceptName":{"type":"string"},"strategy":{"type":"string","minLength":1},"fanout":{"type":["number","null"]}},"required":["sourceDatasetId","targetDatasetId","conceptName","strategy"]}}}}
```

## The anchorSqlMetadataResponseSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlMetadataResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"kind":{"type":"string","const":"metadata"},"command":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rowCount":{"type":["number","null"]},"totalRowCount":{"type":["number","null"]},"truncated":{"type":"boolean","default":false},"nextStartKey":{"type":["number","null"]}},"required":["ok","kind","command","columns","rows"]}}}}
```

## The anchorSqlPerSourceDiagnosticSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlPerSourceDiagnosticSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"reason":{"type":"string"}},"required":["datasetId","datasetName","reason"]}}}}
```

## The anchorSqlPlanChipSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlPlanChipSchema":{"type":"object","properties":{"kind":{"type":"string","minLength":1},"label":{"type":"string"},"detail":{"type":["string","null"]}},"required":["kind","label"]}}}}
```

## The anchorSqlPlanSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlPlanSchema":{"type":"object","properties":{"chips":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlPlanChipSchema"},"default":[]},"joinPlan":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlJoinPlanStepSchema"},"default":[]},"strategy":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}}},"anchorSqlPlanChipSchema":{"type":"object","properties":{"kind":{"type":"string","minLength":1},"label":{"type":"string"},"detail":{"type":["string","null"]}},"required":["kind","label"]},"anchorSqlJoinPlanStepSchema":{"type":"object","properties":{"sourceDatasetId":{"type":"string"},"targetDatasetId":{"type":"string"},"conceptName":{"type":"string"},"strategy":{"type":"string","minLength":1},"fanout":{"type":["number","null"]}},"required":["sourceDatasetId","targetDatasetId","conceptName","strategy"]}}}}
```

## The AnchorSqlResponseEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AnchorSqlResponseEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/anchorSqlRowsResponseSchema"},{"$ref":"#/components/schemas/anchorSqlMetadataResponseSchema"},{"$ref":"#/components/schemas/anchorSqlValidatedResponseSchema"},{"$ref":"#/components/schemas/anchorSqlErrorResponseSchema"}],"description":"Anchor SQL result union, discriminated by `ok` and `kind`: rows (materialised result with nextStartKey paging), metadata (SHOW/DESCRIBE), validated (compile-only), or a structured compile error"}},"required":["data"]},"anchorSqlRowsResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"kind":{"type":"string","const":"rows"},"sql":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rowCount":{"type":["number","null"]},"totalRowCount":{"type":["number","null"]},"truncated":{"type":"boolean","default":false},"nextStartKey":{"type":["number","null"]},"schemaEntries":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"units":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"plan":{"$ref":"#/components/schemas/anchorSqlPlanSchema","default":{}},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"dataViewId":{"type":["string","null"]},"relatedColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"involvedConcepts":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlInvolvedConceptSchema"},"default":[]}},"required":["ok","kind","sql","columns","rows"]},"anchorSqlPlanSchema":{"type":"object","properties":{"chips":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlPlanChipSchema"},"default":[]},"joinPlan":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlJoinPlanStepSchema"},"default":[]},"strategy":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}}},"anchorSqlPlanChipSchema":{"type":"object","properties":{"kind":{"type":"string","minLength":1},"label":{"type":"string"},"detail":{"type":["string","null"]}},"required":["kind","label"]},"anchorSqlJoinPlanStepSchema":{"type":"object","properties":{"sourceDatasetId":{"type":"string"},"targetDatasetId":{"type":"string"},"conceptName":{"type":"string"},"strategy":{"type":"string","minLength":1},"fanout":{"type":["number","null"]}},"required":["sourceDatasetId","targetDatasetId","conceptName","strategy"]},"anchorSqlInvolvedConceptSchema":{"type":"object","properties":{"conceptId":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["referenced","related","anchor","geo"]}},"required":["conceptId","name","role"]},"anchorSqlMetadataResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"kind":{"type":"string","const":"metadata"},"command":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rowCount":{"type":["number","null"]},"totalRowCount":{"type":["number","null"]},"truncated":{"type":"boolean","default":false},"nextStartKey":{"type":["number","null"]}},"required":["ok","kind","command","columns","rows"]},"anchorSqlValidatedResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"kind":{"type":"string","const":"validated"},"sql":{"type":"string"},"plan":{"$ref":"#/components/schemas/anchorSqlPlanSchema","default":{}},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"involvedConcepts":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlInvolvedConceptSchema"},"default":[]}},"required":["ok","kind","sql"]},"anchorSqlErrorResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":false},"error":{"$ref":"#/components/schemas/anchorSqlStructuredErrorSchema"}},"required":["ok","error"]},"anchorSqlStructuredErrorSchema":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/anchorSqlErrorCodeSchema"},"message":{"type":"string"},"span":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]},{"type":"null"}]},"perSource":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlPerSourceDiagnosticSchema"},"default":[]},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlCandidateSchema"},"default":[]},"suggestedQuery":{"type":["string","null"]},"enrichmentProgress":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlEnrichmentProgressSchema"},"default":[]}},"required":["code","message"]},"anchorSqlErrorCodeSchema":{"type":"string","minLength":1},"anchorSqlPerSourceDiagnosticSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"reason":{"type":"string"}},"required":["datasetId","datasetName","reason"]},"anchorSqlCandidateSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["concept","metric","derived","source","dataset","tag","grain"]},"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","default":0},"syntax":{"type":["string","null"]}},"required":["kind","id","name"]},"anchorSqlEnrichmentProgressSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"conceptId":{"type":"string"},"conceptName":{"type":"string"},"status":{"type":"string"},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]}},"required":["datasetId","datasetName","conceptId","conceptName","status"]}}}}
```

## The anchorSqlRowsResponseSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlRowsResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"kind":{"type":"string","const":"rows"},"sql":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rowCount":{"type":["number","null"]},"totalRowCount":{"type":["number","null"]},"truncated":{"type":"boolean","default":false},"nextStartKey":{"type":["number","null"]},"schemaEntries":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"units":{"type":"object","additionalProperties":{"type":"string"},"default":{}},"plan":{"$ref":"#/components/schemas/anchorSqlPlanSchema","default":{}},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"dataViewId":{"type":["string","null"]},"relatedColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"involvedConcepts":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlInvolvedConceptSchema"},"default":[]}},"required":["ok","kind","sql","columns","rows"]},"anchorSqlPlanSchema":{"type":"object","properties":{"chips":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlPlanChipSchema"},"default":[]},"joinPlan":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlJoinPlanStepSchema"},"default":[]},"strategy":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}}},"anchorSqlPlanChipSchema":{"type":"object","properties":{"kind":{"type":"string","minLength":1},"label":{"type":"string"},"detail":{"type":["string","null"]}},"required":["kind","label"]},"anchorSqlJoinPlanStepSchema":{"type":"object","properties":{"sourceDatasetId":{"type":"string"},"targetDatasetId":{"type":"string"},"conceptName":{"type":"string"},"strategy":{"type":"string","minLength":1},"fanout":{"type":["number","null"]}},"required":["sourceDatasetId","targetDatasetId","conceptName","strategy"]},"anchorSqlInvolvedConceptSchema":{"type":"object","properties":{"conceptId":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["referenced","related","anchor","geo"]}},"required":["conceptId","name","role"]}}}}
```

## The anchorSqlStructuredErrorSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlStructuredErrorSchema":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/anchorSqlErrorCodeSchema"},"message":{"type":"string"},"span":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]},{"type":"null"}]},"perSource":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlPerSourceDiagnosticSchema"},"default":[]},"candidates":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlCandidateSchema"},"default":[]},"suggestedQuery":{"type":["string","null"]},"enrichmentProgress":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlEnrichmentProgressSchema"},"default":[]}},"required":["code","message"]},"anchorSqlErrorCodeSchema":{"type":"string","minLength":1},"anchorSqlPerSourceDiagnosticSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"reason":{"type":"string"}},"required":["datasetId","datasetName","reason"]},"anchorSqlCandidateSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["concept","metric","derived","source","dataset","tag","grain"]},"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","default":0},"syntax":{"type":["string","null"]}},"required":["kind","id","name"]},"anchorSqlEnrichmentProgressSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"conceptId":{"type":"string"},"conceptName":{"type":"string"},"status":{"type":"string"},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]}},"required":["datasetId","datasetName","conceptId","conceptName","status"]}}}}
```

## The anchorSqlValidatedResponseSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"anchorSqlValidatedResponseSchema":{"type":"object","properties":{"ok":{"type":"boolean","const":true},"kind":{"type":"string","const":"validated"},"sql":{"type":"string"},"plan":{"$ref":"#/components/schemas/anchorSqlPlanSchema","default":{}},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"involvedConcepts":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlInvolvedConceptSchema"},"default":[]}},"required":["ok","kind","sql"]},"anchorSqlPlanSchema":{"type":"object","properties":{"chips":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlPlanChipSchema"},"default":[]},"joinPlan":{"type":"array","items":{"$ref":"#/components/schemas/anchorSqlJoinPlanStepSchema"},"default":[]},"strategy":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}}},"anchorSqlPlanChipSchema":{"type":"object","properties":{"kind":{"type":"string","minLength":1},"label":{"type":"string"},"detail":{"type":["string","null"]}},"required":["kind","label"]},"anchorSqlJoinPlanStepSchema":{"type":"object","properties":{"sourceDatasetId":{"type":"string"},"targetDatasetId":{"type":"string"},"conceptName":{"type":"string"},"strategy":{"type":"string","minLength":1},"fanout":{"type":["number","null"]}},"required":["sourceDatasetId","targetDatasetId","conceptName","strategy"]},"anchorSqlInvolvedConceptSchema":{"type":"object","properties":{"conceptId":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["referenced","related","anchor","geo"]}},"required":["conceptId","name","role"]}}}}
```

## The AnomalyDetectionRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The AnomalyDetectionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AnomalyDetectionResultSchema":{"type":"object","properties":{"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"totalSamplesScanned":{"type":"number"},"samples":{"type":"array","items":{"$ref":"#/components/schemas/SampleAnomalyScanResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalSamplesScanned"]},"SampleAnomalyScanResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number"},"isAnomalous":{"type":"boolean"},"systemScore":{"type":"number"},"flaggedNodes":{"type":"array","items":{"$ref":"#/components/schemas/AnomalyFlagResultSchema"},"default":[]},"allSurprises":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["sampleIndex","isAnomalous","systemScore"]},"AnomalyFlagResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"conditionalZ":{"type":"number"},"marginalZ":{"type":"number"},"isRootNode":{"type":"boolean"},"confidence":{"type":"number"},"graphDepth":{"type":"number"},"variableThreshold":{"type":["number","null"]}},"required":["variable","conditionalZ","marginalZ","isRootNode","confidence","graphDepth"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]}}}}
```

## The AnomalyFlagResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AnomalyFlagResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"conditionalZ":{"type":"number"},"marginalZ":{"type":"number"},"isRootNode":{"type":"boolean"},"confidence":{"type":"number"},"graphDepth":{"type":"number"},"variableThreshold":{"type":["number","null"]}},"required":["variable","conditionalZ","marginalZ","isRootNode","confidence","graphDepth"]}}}}
```

## The Application object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"Application":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"date":{"type":["string","null"]},"lastSaved":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"access":{"anyOf":[{"type":"string","enum":["public","private","restricted","organisation"]},{"type":"null"}]},"parentId":{"type":["string","null"]},"version":{"type":["string","null"]},"deployedAt":{"type":["string","null"]},"building":{"type":["boolean","null"]},"status":{"type":"string","enum":["Running","Idle","Failed"]},"isLive":{"type":["boolean","null"]},"type":{"anyOf":[{"type":"string","enum":["dashboard","api","automation","ai"]},{"type":"null"}]},"kind":{"anyOf":[{"type":"string","enum":["user","system"]},{"type":"null"}]},"slug":{"type":["string","null"]},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["draft","published","archived"]},{"type":"null"}]},"publish":{"anyOf":[{"type":"object","properties":{"slug":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"publishedVersion":{"type":["string","null"]},"surfaces":{"anyOf":[{"type":"array","items":{"type":"string","enum":["rest","ui","agent","schedule","webhook","subapp"]}},{"type":"null"}]},"consumerAccess":{"anyOf":[{"type":"string","enum":["private","workspace","organisation","public"]},{"type":"null"}]},"embedOrigins":{"type":"array","items":{"type":"string"}},"notes":{"type":["string","null"]}}},{"type":"null"}]},"settings":{"anyOf":[{"type":"object","properties":{"description":{"type":["string","null"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"exposedTerminals":{"type":"array","items":{"type":"object","properties":{"moduleId":{"type":["string","null"]},"portId":{"type":["string","null"]},"widgetId":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"kind":{"type":"string","enum":["dataframe","scalar","json","text","document","image","binary","signal","event"]},"label":{"type":"string"}},"required":["widgetId","direction","kind","label"]}},"embeddablePages":{"type":"array","items":{"type":"string"}},"emittedEvents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"payloadSchema":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"description":{"type":"string","default":""}},"required":["name"]}},"agent":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"instructions":{"type":"string","default":""},"tools":{"type":"array","items":{"type":"string","enum":["app_describe","app_read_terminal","app_query_indicator","app_list_flows","app_run_status","app_read_contract_object","app_read_state","app_list_links","app_explain_module","app_press_button","app_set_control","app_open_page"]},"default":["app_describe","app_read_terminal","app_query_indicator","app_list_flows","app_run_status","app_read_contract_object","app_read_state","app_list_links","app_explain_module","app_press_button","app_set_control","app_open_page"]},"canPress":{"type":"array","items":{"type":"string"},"default":[]},"knowledge":{"type":"array","items":{"type":"string"},"default":[]},"model":{"type":["string","null"],"default":null}}}}},{"type":"null"}]}},"required":["id","organisationId","name","status"]}}}}
```

## The ApplicationEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ApplicationEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Application"}},"required":["data"]},"Application":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"date":{"type":["string","null"]},"lastSaved":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"access":{"anyOf":[{"type":"string","enum":["public","private","restricted","organisation"]},{"type":"null"}]},"parentId":{"type":["string","null"]},"version":{"type":["string","null"]},"deployedAt":{"type":["string","null"]},"building":{"type":["boolean","null"]},"status":{"type":"string","enum":["Running","Idle","Failed"]},"isLive":{"type":["boolean","null"]},"type":{"anyOf":[{"type":"string","enum":["dashboard","api","automation","ai"]},{"type":"null"}]},"kind":{"anyOf":[{"type":"string","enum":["user","system"]},{"type":"null"}]},"slug":{"type":["string","null"]},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["draft","published","archived"]},{"type":"null"}]},"publish":{"anyOf":[{"type":"object","properties":{"slug":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"publishedVersion":{"type":["string","null"]},"surfaces":{"anyOf":[{"type":"array","items":{"type":"string","enum":["rest","ui","agent","schedule","webhook","subapp"]}},{"type":"null"}]},"consumerAccess":{"anyOf":[{"type":"string","enum":["private","workspace","organisation","public"]},{"type":"null"}]},"embedOrigins":{"type":"array","items":{"type":"string"}},"notes":{"type":["string","null"]}}},{"type":"null"}]},"settings":{"anyOf":[{"type":"object","properties":{"description":{"type":["string","null"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"exposedTerminals":{"type":"array","items":{"type":"object","properties":{"moduleId":{"type":["string","null"]},"portId":{"type":["string","null"]},"widgetId":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"kind":{"type":"string","enum":["dataframe","scalar","json","text","document","image","binary","signal","event"]},"label":{"type":"string"}},"required":["widgetId","direction","kind","label"]}},"embeddablePages":{"type":"array","items":{"type":"string"}},"emittedEvents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"payloadSchema":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"description":{"type":"string","default":""}},"required":["name"]}},"agent":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"instructions":{"type":"string","default":""},"tools":{"type":"array","items":{"type":"string","enum":["app_describe","app_read_terminal","app_query_indicator","app_list_flows","app_run_status","app_read_contract_object","app_read_state","app_list_links","app_explain_module","app_press_button","app_set_control","app_open_page"]},"default":["app_describe","app_read_terminal","app_query_indicator","app_list_flows","app_run_status","app_read_contract_object","app_read_state","app_list_links","app_explain_module","app_press_button","app_set_control","app_open_page"]},"canPress":{"type":"array","items":{"type":"string"},"default":[]},"knowledge":{"type":"array","items":{"type":"string"},"default":[]},"model":{"type":["string","null"],"default":null}}}}},{"type":"null"}]}},"required":["id","organisationId","name","status"]}}}}
```

## The ApplicationListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ApplicationListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Application"}},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]},"Application":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"date":{"type":["string","null"]},"lastSaved":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"access":{"anyOf":[{"type":"string","enum":["public","private","restricted","organisation"]},{"type":"null"}]},"parentId":{"type":["string","null"]},"version":{"type":["string","null"]},"deployedAt":{"type":["string","null"]},"building":{"type":["boolean","null"]},"status":{"type":"string","enum":["Running","Idle","Failed"]},"isLive":{"type":["boolean","null"]},"type":{"anyOf":[{"type":"string","enum":["dashboard","api","automation","ai"]},{"type":"null"}]},"kind":{"anyOf":[{"type":"string","enum":["user","system"]},{"type":"null"}]},"slug":{"type":["string","null"]},"lifecycleStatus":{"anyOf":[{"type":"string","enum":["draft","published","archived"]},{"type":"null"}]},"publish":{"anyOf":[{"type":"object","properties":{"slug":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"publishedVersion":{"type":["string","null"]},"surfaces":{"anyOf":[{"type":"array","items":{"type":"string","enum":["rest","ui","agent","schedule","webhook","subapp"]}},{"type":"null"}]},"consumerAccess":{"anyOf":[{"type":"string","enum":["private","workspace","organisation","public"]},{"type":"null"}]},"embedOrigins":{"type":"array","items":{"type":"string"}},"notes":{"type":["string","null"]}}},{"type":"null"}]},"settings":{"anyOf":[{"type":"object","properties":{"description":{"type":["string","null"]},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"exposedTerminals":{"type":"array","items":{"type":"object","properties":{"moduleId":{"type":["string","null"]},"portId":{"type":["string","null"]},"widgetId":{"type":"string"},"direction":{"type":"string","enum":["in","out"]},"kind":{"type":"string","enum":["dataframe","scalar","json","text","document","image","binary","signal","event"]},"label":{"type":"string"}},"required":["widgetId","direction","kind","label"]}},"embeddablePages":{"type":"array","items":{"type":"string"}},"emittedEvents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"payloadSchema":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"description":{"type":"string","default":""}},"required":["name"]}},"agent":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"instructions":{"type":"string","default":""},"tools":{"type":"array","items":{"type":"string","enum":["app_describe","app_read_terminal","app_query_indicator","app_list_flows","app_run_status","app_read_contract_object","app_read_state","app_list_links","app_explain_module","app_press_button","app_set_control","app_open_page"]},"default":["app_describe","app_read_terminal","app_query_indicator","app_list_flows","app_run_status","app_read_contract_object","app_read_state","app_list_links","app_explain_module","app_press_button","app_set_control","app_open_page"]},"canPress":{"type":"array","items":{"type":"string"},"default":[]},"knowledge":{"type":"array","items":{"type":"string"},"default":[]},"model":{"type":["string","null"],"default":null}}}}},{"type":"null"}]}},"required":["id","organisationId","name","status"]}}}}
```

## The ArrayAggregationKindEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]}}}}
```

## The ArrayDecomposeModeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]}}}}
```

## The ArraySizeDistributionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ArraySizeDistributionSchema":{"type":"object","properties":{"empty":{"type":"number","default":0},"oneToThree":{"type":"number","default":0},"fourToTen":{"type":"number","default":0},"elevenToFifty":{"type":"number","default":0},"fiftyPlus":{"type":"number","default":0}}}}}}
```

## The AsOfDirectionEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]}}}}
```

## The AsyncJobAccepted object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AsyncJobAccepted":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","description":"pending until the job reaches a terminal status"},"createdAt":{"type":"string"},"links":{"type":"object","properties":{"self":{"type":"string","description":"Poll this until the status is terminal"},"cancel":{"type":"string"}},"required":["self"]}},"required":["jobId","status","links"],"description":"Envelope for asynchronous pipeline work. Poll links.self until the job reaches a terminal status."}},"required":["data"]}}}}
```

## The AsyncRunAccepted object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AsyncRunAccepted":{"type":"object","properties":{"data":{"type":"object","properties":{"runId":{"type":"string"},"status":{"type":"string","description":"pending until the run reaches a terminal status"},"createdAt":{"type":"string"},"links":{"type":"object","properties":{"self":{"type":"string","description":"Poll this until the status is terminal"},"results":{"type":"string","description":"Fetch when the run completes"}},"required":["self"]}},"required":["runId","status","links"],"description":"Envelope for asynchronous simulation runs. Poll links.self; fetch links.results when complete."}},"required":["data"]}}}}
```

## The AutoUpdateSettingsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"AutoUpdateSettingsSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"mode":{"type":"string","enum":["assimilate_only","assimilate_or_retrain"],"default":"assimilate_only"}}}}}}
```

## The BinaryUpload object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"BinaryUpload":{"description":"Raw file bytes"}}}}
```

## The BindingSourceEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]}}}}
```

## The BindingStatusEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]}}}}
```

## The BrokenDataViewDependencySchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]}}}}
```

## The CategoricalPredictionRecordSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CategoricalPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"description":"Predicted class (most likely) in decoded format"},"probabilities":{"type":"array","items":{"type":"number"},"description":"Raw predicted probabilities for each class"},"lowerBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Lower bounds of confidence intervals for probabilities"},"upperBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Upper bounds of confidence intervals for probabilities"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"}},"required":["probabilities"]}}}}
```

## The CategoricalSeasonalPeriodSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]}}}}
```

## The CausalAlertEntryResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalAlertEntryResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"causalDepth":{"type":"number"},"firstAlertStep":{"type":"number"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"ewmaZ":{"type":"number"}},"required":["variable","causalDepth","firstAlertStep","alertType","ewmaZ"]},"AlertTypeEnum":{"type":"string","enum":["spike","worsening","improving","sustained","normal"]}}}}
```

## The CausalEdgeResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalEdgeResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]}}}}
```

## The CausalGraphChangeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"},"oldRelationship":{"anyOf":[{"$ref":"#/components/schemas/CausalRelationshipSchema"},{"type":"null"}]}},"required":["type","relationship"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]},"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]}}}}
```

## The CausalHealthMonitorRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The CausalHealthMonitorResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalHealthMonitorResultSchema":{"type":"object","properties":{"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"totalTimestepsScanned":{"type":"number"},"startTimestampMs":{"type":["number","null"]},"granularityMs":{"type":["number","null"]},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/ConditionScanTimestepResultSchema"}},"nodeSummaries":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"}},"causalAlertOrdering":{"type":"array","items":{"$ref":"#/components/schemas/CausalAlertEntryResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]},"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"eventLog":{"type":"array","items":{"$ref":"#/components/schemas/EventLogEntryResultSchema"},"default":[]},"leadLag":{"type":"array","items":{"$ref":"#/components/schemas/LeadLagEntryResultSchema"},"default":[]},"edgePropagation":{"type":"array","items":{"$ref":"#/components/schemas/EdgePropagationSeriesResultSchema"},"default":[]},"forecastedSamples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"causalEdges":{"type":"array","items":{"$ref":"#/components/schemas/CausalEdgeResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalTimestepsScanned","timeline","nodeSummaries"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"ConditionScanTimestepResultSchema":{"type":"object","properties":{"timestep":{"type":"number"},"timestampMs":{"type":["number","null"]},"systemHealthScore":{"type":"number"},"nodeStatuses":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"}},"spikeAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"trendAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["timestep","systemHealthScore","nodeStatuses"]},"NodeConditionStatusResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"currentZ":{"type":"number"},"ewmaZ":{"type":"number"},"trendSlope":{"type":"number"},"cusum":{"type":"number"},"stepsElevated":{"type":"number"},"isRootNode":{"type":"boolean"},"graphDepth":{"type":"number"},"confidence":{"type":"number"},"causalDepth":{"type":"number","default":0},"variableThreshold":{"type":["number","null"]},"marginalZScore":{"type":"number","default":0},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"recovered":{"type":"boolean","default":false}},"required":["variable","alertType","currentZ","ewmaZ","trendSlope","cusum","stepsElevated","isRootNode","graphDepth","confidence"]},"AlertTypeEnum":{"type":"string","enum":["spike","worsening","improving","sustained","normal"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"CausalAlertEntryResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"causalDepth":{"type":"number"},"firstAlertStep":{"type":"number"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"ewmaZ":{"type":"number"}},"required":["variable","causalDepth","firstAlertStep","alertType","ewmaZ"]},"EventLogEntryResultSchema":{"type":"object","properties":{"at":{"type":"number"},"atTimestampMs":{"type":["number","null"]},"kind":{"type":"string","enum":["first_alert","cascade","rca_verdict","recovered"]},"variable":{"type":["string","null"]},"alertType":{"type":["string","null"]},"ewmaZ":{"type":"number","default":0},"signedCurrentZ":{"type":"number","default":0},"sourceSignedZ":{"type":"number","default":0},"targetSignedZ":{"type":"number","default":0},"sentence":{"type":"string","default":""},"fromVar":{"type":["string","null"]},"toVar":{"type":["string","null"]},"lagSteps":{"type":["number","null"]},"correlation":{"type":["number","null"]},"target":{"type":["string","null"]},"rootCause":{"type":["string","null"]}},"required":["at","kind"]},"LeadLagEntryResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"lagSteps":{"type":"number"},"correlation":{"type":"number"}},"required":["source","target","lagSteps","correlation"]},"EdgePropagationSeriesResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"scores":{"type":"array","items":{"type":"number"}}},"required":["source","target","scores"]},"CausalEdgeResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]}}}}
```

## The CausalNodeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalNodeSchema":{"type":"object","properties":{"name":{"type":"string"},"nodeType":{"$ref":"#/components/schemas/NodeTypeEnum","default":"observed"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latentClusterId":{"type":["number","null"]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"isDerived":{"type":"boolean","default":false},"symbolicEquation":{"anyOf":[{"$ref":"#/components/schemas/SymbolicEquationSchema"},{"type":"null"}]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"},{"type":"null"}]},"parentImpacts":{"anyOf":[{"$ref":"#/components/schemas/NodeParentImpactsSchema"},{"type":"null"}],"description":"Model-based driver contribution shares computed after training"}},"required":["name","type"]},"NodeTypeEnum":{"type":"string","enum":["observed","latent","latent_inter","latent_intra","environment"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SymbolicEquationSchema":{"type":"object","properties":{"expression":{"type":"string"},"r2":{"type":"number"},"noisePercentage":{"type":"number"},"termBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicTermSchema"}},"complexity":{"type":"number"},"explanationType":{"type":"string","enum":["regression","classification_rules","conditional_probability"],"default":"regression"},"epsilonSigma":{"type":["number","null"]},"epsilonSigmaRelative":{"type":["number","null"]},"expressionWithNoise":{"type":["string","null"]},"discoveryMethod":{"type":["string","null"]},"parentContributions":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicParentContributionSchema"}},"unexplainedPct":{"type":["number","null"]},"directionReferenceClass":{"type":["string","null"]},"alternatives":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SymbolicEquationAlternativeSchema"}},{"type":"null"}],"description":"Pareto-front alternatives to the chosen equation (balanced / fewer terms / better fit); absent until discovery emits them"}},"required":["expression","r2","noisePercentage","termBreakdown","complexity"]},"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]},"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]},"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]},"DtDerivedColumnInfoSchema":{"type":"object","properties":{"derivedType":{"type":"string"},"targetColumn":{"type":"string"},"sourceColumns":{"type":"array","items":{"type":"string"}},"expression":{"type":"string"},"r2":{"type":["number","null"]},"isDeterministic":{"type":"boolean"},"implausibilityReason":{"type":["string","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"seasonalTerms":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalTermSchema"}},{"type":"null"}]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]}},"required":["derivedType","targetColumn","sourceColumns","expression","isDeterministic"]},"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]}}}}
```

## The CausalRelationshipAnalysisSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string","description":"The cause variable"},"effectVar":{"type":"string","description":"The effect variable"},"overallEffect":{"type":"object","properties":{"effectSize":{"type":"number","description":"Average causal effect size"},"effectRange":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Min and max effect across tested values"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"95% confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"P-value for statistical significance"},"categoryEffects":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Effects by category (for categorical causes)"},"targetEffects":{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"},"description":"Effects for specific target values"},"baselineOutcomeProbs":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Baseline outcome probabilities"},"targetOutcomeDeltas":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Changes in outcome probabilities"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"},"summaryMethod":{"type":"string","description":"Method used to summarize effects"}},"required":["effectSize","confidenceInterval","statisticalSignificance","targetEffects","contrast","nReplicates","effectiveSampleSize","summaryMethod"],"description":"Overall causal effect analysis"},"doseResponse":{"anyOf":[{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"},{"type":"null"}],"description":"Dose-response curve (for continuous causes)"},"segmentEffects":{"type":"array","items":{"$ref":"#/components/schemas/SegmentExplanationEffectSchema"},"description":"Effects by segment"},"pathwayEffects":{"type":"object","properties":{"mode":{"type":"string","enum":["qualitative","additive"],"description":"Analysis mode"},"directEffect":{"type":["number","null"],"description":"Direct effect if variables are connected"},"indirectEffects":{"type":"array","items":{"$ref":"#/components/schemas/PathwayEffectSchema"},"description":"Effects through indirect pathways"},"totalEffect":{"type":["number","null"],"description":"Sum of all pathway effects"},"sumToOverall":{"type":"boolean","description":"Whether pathway effects sum to overall effect"}},"required":["mode","indirectEffects","sumToOverall"],"description":"Analysis of causal pathways"},"units":{"type":"string","enum":["probability","value"],"description":"Units of the effect measurement"},"summaryMethod":{"type":"string","description":"Method used to summarize the analysis"}},"required":["causeVar","effectVar","overallEffect","segmentEffects","pathwayEffects","units","summaryMethod"]},"TargetEffectSchema":{"type":"object","properties":{"causeTarget":{"type":["string","number"],"description":"Target value of the cause"},"scalarEffect":{"type":"number","description":"Scalar effect size"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"Statistical significance level"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"}},"required":["causeTarget","scalarEffect","confidenceInterval","statisticalSignificance","nReplicates","effectiveSampleSize"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"SegmentExplanationEffectSchema":{"type":"object","properties":{"segmentId":{"type":"string","description":"Unique identifier for the segment"},"segmentDescription":{"type":"string","description":"Human-readable segment description"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"effectSize":{"type":"number","description":"Causal effect size in this segment"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"sampleSize":{"type":"number","description":"Number of samples in this segment"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification for this segment"},"nReplicates":{"type":["number","null"],"description":"Number of replicates"},"targetEffects":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"}},{"type":"null"}],"description":"Target-specific effects"}},"required":["segmentId","segmentDescription","conditions","effectSize","confidenceInterval","sampleSize","contrast"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"PathwayEffectSchema":{"type":"object","properties":{"pathway":{"type":"array","items":{"type":"string"},"description":"Variables in the causal pathway"},"effectContribution":{"type":["number","null"],"description":"Contribution of this pathway to total effect"},"percentageOfTotal":{"type":["number","null"],"description":"Percentage of total effect through this pathway"},"note":{"type":["string","null"],"description":"Additional notes about the pathway"}},"required":["pathway"]}}}}
```

## The CausalRelationshipSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]}}}}
```

## The ChangeLogSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ChangeLogSchema":{"type":"object","properties":{"temporalDependenciesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalDependencyChangeSchema"}},{"type":"null"}]},"fixedSubGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FixedSubGraphChangeSchema"}},{"type":"null"}]},"causalGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CausalGraphChangeSchema"}},{"type":"null"}]},"nodesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NodeChangeSchema"}},{"type":"null"}]},"evaluationDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvaluationChangeSchema"}},{"type":"null"}]}}},"TemporalDependencyChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"variable":{"type":"string"},"oldPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"newPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["type","variable"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]},"FixedSubGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"changeTarget":{"type":"string","enum":["relationships","antiRelationships"]},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"required":["type","changeTarget","relationship"]},"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]},"CausalGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"},"oldRelationship":{"anyOf":[{"$ref":"#/components/schemas/CausalRelationshipSchema"},{"type":"null"}]}},"required":["type","relationship"]},"NodeChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"node":{"$ref":"#/components/schemas/CausalNodeSchema"},"oldNode":{"anyOf":[{"$ref":"#/components/schemas/CausalNodeSchema"},{"type":"null"}]}},"required":["type","node"]},"CausalNodeSchema":{"type":"object","properties":{"name":{"type":"string"},"nodeType":{"$ref":"#/components/schemas/NodeTypeEnum","default":"observed"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latentClusterId":{"type":["number","null"]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"isDerived":{"type":"boolean","default":false},"symbolicEquation":{"anyOf":[{"$ref":"#/components/schemas/SymbolicEquationSchema"},{"type":"null"}]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"},{"type":"null"}]},"parentImpacts":{"anyOf":[{"$ref":"#/components/schemas/NodeParentImpactsSchema"},{"type":"null"}],"description":"Model-based driver contribution shares computed after training"}},"required":["name","type"]},"NodeTypeEnum":{"type":"string","enum":["observed","latent","latent_inter","latent_intra","environment"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SymbolicEquationSchema":{"type":"object","properties":{"expression":{"type":"string"},"r2":{"type":"number"},"noisePercentage":{"type":"number"},"termBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicTermSchema"}},"complexity":{"type":"number"},"explanationType":{"type":"string","enum":["regression","classification_rules","conditional_probability"],"default":"regression"},"epsilonSigma":{"type":["number","null"]},"epsilonSigmaRelative":{"type":["number","null"]},"expressionWithNoise":{"type":["string","null"]},"discoveryMethod":{"type":["string","null"]},"parentContributions":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicParentContributionSchema"}},"unexplainedPct":{"type":["number","null"]},"directionReferenceClass":{"type":["string","null"]},"alternatives":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SymbolicEquationAlternativeSchema"}},{"type":"null"}],"description":"Pareto-front alternatives to the chosen equation (balanced / fewer terms / better fit); absent until discovery emits them"}},"required":["expression","r2","noisePercentage","termBreakdown","complexity"]},"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]},"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]},"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]},"DtDerivedColumnInfoSchema":{"type":"object","properties":{"derivedType":{"type":"string"},"targetColumn":{"type":"string"},"sourceColumns":{"type":"array","items":{"type":"string"}},"expression":{"type":"string"},"r2":{"type":["number","null"]},"isDeterministic":{"type":"boolean"},"implausibilityReason":{"type":["string","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"seasonalTerms":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalTermSchema"}},{"type":"null"}]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]}},"required":["derivedType","targetColumn","sourceColumns","expression","isDeterministic"]},"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]},"EvaluationChangeSchema":{"type":"object","properties":{"type":{"type":"string","enum":["improvement","worsening"]},"metric":{"type":"string"},"oldValue":{"type":["number","null"]},"newValue":{"type":"number"},"percentChange":{"type":["number","null"]}},"required":["type","metric","newValue"]}}}}
```

## The ChangeTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]}}}}
```

## The ChmDataSourceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]}}}}
```

## The ColumnMetadataSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ColumnMetadataSchema":{"type":"object","properties":{"dtype":{"type":["string","null"]},"categoryOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"distribution":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"rangeFrom":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"rangeTo":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"mean":{"type":["number","null"]},"stringPattern":{"type":["string","null"]},"jsonObjectFraction":{"type":["number","null"]},"cardinality":{"type":["number","null"]},"nullFraction":{"type":["number","null"]},"unparsedFormat":{"type":["string","null"]},"processing":{"type":["boolean","null"]},"metadataStatus":{"anyOf":[{"$ref":"#/components/schemas/MetadataStatusEnum"},{"type":"null"}]},"elementType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"minSize":{"type":["number","null"]},"maxSize":{"type":["number","null"]},"avgSize":{"type":["number","null"]},"medianSize":{"type":["number","null"]},"p95Size":{"type":["number","null"]},"nullCount":{"type":["number","null"]},"emptyCount":{"type":["number","null"]},"totalElementCount":{"type":["number","null"]},"sizeDistribution":{"anyOf":[{"$ref":"#/components/schemas/ArraySizeDistributionSchema"},{"type":"null"}]},"uniqueElementCount":{"type":["number","null"]},"avgUniquePerRow":{"type":["number","null"]},"elementOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"elementMin":{"type":["number","null"]},"elementMax":{"type":["number","null"]},"elementMean":{"type":["number","null"]},"elementSum":{"type":["number","null"]},"elementStddev":{"type":["number","null"]}}},"MetadataStatusEnum":{"type":"string","enum":["complete","partial_skipped_expensive","in_progress"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"ArraySizeDistributionSchema":{"type":"object","properties":{"empty":{"type":"number","default":0},"oneToThree":{"type":"number","default":0},"fourToTen":{"type":"number","default":0},"elevenToFifty":{"type":"number","default":0},"fiftyPlus":{"type":"number","default":0}}}}}}
```

## The ColumnWindowProfileSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ColumnWindowProfileSchema":{"type":"object","properties":{"count":{"type":["number","null"]},"distinct":{"type":["number","null"]},"min":{"type":["string","null"]},"max":{"type":["string","null"]}}}}}}
```

## The ComparisonOperatorEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]}}}}
```

## The ConceptClassificationEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConceptClassificationEnum":{"type":"string","enum":["identifier","location","time"]}}}}
```

## The ConceptKindEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConceptKindEnum":{"type":"string","enum":["standard","derived","metric"]}}}}
```

## The ConceptMetadataSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConceptMetadataSchema":{"type":"object","properties":{"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]},"isUnique":{"type":["boolean","null"]},"isCyclic":{"type":["boolean","null"]},"isHeterogeneousIdentifier":{"type":["boolean","null"]},"compositeScopeConceptId":{"type":["string","null"]},"isUniformDistribution":{"type":["boolean","null"]},"locationType":{"anyOf":[{"$ref":"#/components/schemas/AnchorLocationTypeEnum"},{"type":"null"}]},"coordinateFormat":{"anyOf":[{"$ref":"#/components/schemas/CoordinateFormatEnum"},{"type":"null"}]},"coordinateDatum":{"anyOf":[{"$ref":"#/components/schemas/CoordinateDatumEnum"},{"type":"null"}]},"coordinatePairConceptId":{"type":["string","null"]},"locationDetectionSource":{"anyOf":[{"$ref":"#/components/schemas/LocationDetectionSourceEnum"},{"type":"null"}]},"latitudeInRangeFraction":{"type":["number","null"]},"longitudeInRangeFraction":{"type":["number","null"]},"fractionalPartFraction":{"type":["number","null"]},"coordinatePairFraction":{"type":["number","null"]},"dmsCoordinateFraction":{"type":["number","null"]},"postalCodeFraction":{"type":["number","null"]},"addressShapeFraction":{"type":["number","null"]},"enrichments":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EnrichmentRecordSchema"}},{"type":"null"}]},"geoEnrichmentStatus":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"geoEnrichmentKind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"geoEnrichedAt":{"type":["string","null"]},"geoEnrichmentVersion":{"type":["number","null"]},"geoSidecarKey":{"type":["string","null"]},"geoDistinctTotal":{"type":["number","null"]},"geoMatchedCount":{"type":["number","null"]},"geoUnmatchedCount":{"type":["number","null"]},"geoTruncated":{"type":["boolean","null"]},"geoEnrichmentError":{"type":["string","null"]},"nanFillStrategy":{"anyOf":[{"$ref":"#/components/schemas/NanFillStrategyEnum"},{"type":"null"}]},"changeRate":{"type":["number","null"]},"dateTimeFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"averageInterval":{"type":["number","null"]},"isConsistentInterval":{"type":["boolean","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"higherIsBetter":{"type":["boolean","null"]},"isEqualInterval":{"type":["boolean","null"]},"intervalSize":{"type":["number","null"]},"valueClass":{"anyOf":[{"$ref":"#/components/schemas/ValueClassEnum"},{"type":"null"}]},"fracZero":{"type":["number","null"]},"zeroRunLengthP95":{"type":["number","null"]},"nonZeroRunLengthP95":{"type":["number","null"]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"emailFraction":{"type":["number","null"]},"medianLength":{"type":["number","null"]},"distinctLengthCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"tsGranularity":{"type":["string","null"]},"tsValidGranularities":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tsTypicalDeltaSeconds":{"type":["number","null"]},"tsSelectedGrid":{"type":["string","null"]},"tsGapProfile":{"anyOf":[{"$ref":"#/components/schemas/GapProfileSchema"},{"type":"null"}]},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsPerEnvProfiles":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesEnvProfileSchema"}},{"type":"null"}]},"tsAnalyzerVersion":{"type":["string","null"]},"tsAnalyzedAt":{"type":["string","null"]},"elementSchemaType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"elementCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sizeStatistics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"additionalProperties":true},"AnchorLocationTypeEnum":{"type":"string","enum":["latitude","longitude","coordinate","country","region","city","postal_code","address","continent","airport_code","unlocode"]},"CoordinateFormatEnum":{"type":"string","enum":["dd","dms","ddm"]},"CoordinateDatumEnum":{"type":"string","enum":["wgs84","gcj02","bd09"]},"LocationDetectionSourceEnum":{"type":"string","enum":["values","column_name","user"]},"EnrichmentRecordSchema":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"enrichedAt":{"type":["string","null"]},"enricherVersion":{"type":["string","null"]},"dataVersion":{"type":["string","null"]},"version":{"type":["number","null"]},"sidecarKey":{"type":["string","null"]},"keyFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"hintFields":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"corroborationFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latLonPrecision":{"type":["number","null"]},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]},"truncated":{"type":["boolean","null"]},"error":{"type":["string","null"]},"appliedDatum":{"type":["string","null"]}}},"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]},"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]},"NanFillStrategyEnum":{"type":"string","enum":["forward","interpolate","zero","drop","undefined"]},"ValueClassEnum":{"type":"string","enum":["continuous","sparse_event","bursty","binary_indicator"]},"GapProfileSchema":{"type":"object","properties":{"expectedIntervalSeconds":{"type":["number","null"]},"p50GapSeconds":{"type":["number","null"]},"p95GapSeconds":{"type":["number","null"]},"p99GapSeconds":{"type":["number","null"]},"maxGapSeconds":{"type":["number","null"]},"gapCount":{"type":["number","null"]},"largestGapStart":{"type":["string","null"]}}},"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]},"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]},"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]},"TimeSeriesEnvProfileSchema":{"type":"object","properties":{"envKey":{"type":"string"},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"tsTypicalDeltaSeconds":{"type":["number","null"]}},"required":["envKey"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}}}}
```

## The ConceptValueMappingSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConceptValueMappingSchema":{"type":"object","properties":{"canonicalValue":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"},"default":[]}},"required":["canonicalValue"]}}}}
```

## The ConditionalAllowedValuesSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]}}}}
```

## The ConditionScanTimestepResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConditionScanTimestepResultSchema":{"type":"object","properties":{"timestep":{"type":"number"},"timestampMs":{"type":["number","null"]},"systemHealthScore":{"type":"number"},"nodeStatuses":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"}},"spikeAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"trendAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["timestep","systemHealthScore","nodeStatuses"]},"NodeConditionStatusResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"currentZ":{"type":"number"},"ewmaZ":{"type":"number"},"trendSlope":{"type":"number"},"cusum":{"type":"number"},"stepsElevated":{"type":"number"},"isRootNode":{"type":"boolean"},"graphDepth":{"type":"number"},"confidence":{"type":"number"},"causalDepth":{"type":"number","default":0},"variableThreshold":{"type":["number","null"]},"marginalZScore":{"type":"number","default":0},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"recovered":{"type":"boolean","default":false}},"required":["variable","alertType","currentZ","ewmaZ","trendSlope","cusum","stepsElevated","isRootNode","graphDepth","confidence"]},"AlertTypeEnum":{"type":"string","enum":["spike","worsening","improving","sustained","normal"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]}}}}
```

## The ConditionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]}}}}
```

## The ConformanceReportSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]}}}}
```

## The ConformanceVerdictEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]}}}}
```

## The Connector object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"Connector":{"type":"object","properties":{"id":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"type":{"anyOf":[{"$ref":"#/components/schemas/connectorTypesEnum"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"status":{"type":"string","enum":["connected","error","unconfigured"],"default":"unconfigured"},"errorMessage":{"type":["string","null"]}},"required":["organisationId","name","createdAt","updatedAt"]},"connectorTypesEnum":{"type":"string","enum":["PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]}}}}
```

## The ConnectorDirectQueryInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConnectorDirectQueryInput":{"type":"object","properties":{"workspaceId":{"type":["string","null"],"description":"Workspace the source lands in. Optional for a workspace-scoped credential, which supplies it; required for an organisation-wide credential, which can reach several"},"datasetName":{"type":"string","minLength":1,"description":"Name for the created source"},"config":{"type":"object","additionalProperties":{},"description":"Connector-specific selection: {table} or {query} plus database/schema/warehouse for SQL connectors, {path} for storage; connectorId, type and the direct-query settings below are filled in from the route. A SQL source names one of the two, never both: {query} is probed as a derived table, so a pivot, a join or an aggregate can be read directly instead of imported, and the source's columns are the statement's own output. Storage sources are read in place as Parquet and take no query: {path} must name a location inside the bucket rather than its root, {formats} may only say parquet, and {recursive} must not be true — the read covers the path and its partition folders, so anything deeper would never be read"},"orderingColumn":{"type":"string","minLength":1,"description":"Column rows are paged by. Required: a directly-queried source has no injected row index, so without a stable sort the same row can appear on two pages or none"},"relation":{"type":["string","null"],"description":"Relation to read, when it is not the config's table (SQL connectors) or resolved from the bucket and path (storage)"},"appendOnly":{"type":["boolean","null"],"description":"Declare that rows are only ever added, never updated or deleted. Lets a digital twin pin its training window by watermark instead of copying the rows; undeclared sources are copied"},"statementTimeoutSeconds":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"description":"Cap on how long a single remote statement may run"},"maxRowsScanned":{"anyOf":[{"type":"integer","exclusiveMinimum":0},{"type":"null"}],"description":"Cap on how many rows a single remote statement may scan. SQL connectors only — a row cap has no file analogue, so S3, Google Cloud Storage and Azure Data Lake refuse it rather than ignore it"},"parentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Folder to create the source under. Must be a folder already in this workspace; omit it to file the source at the workspace root"}},"required":["datasetName","config","orderingColumn"]}}}}
```

## The ConnectorEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConnectorEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Connector"}},"required":["data"]},"Connector":{"type":"object","properties":{"id":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"type":{"anyOf":[{"$ref":"#/components/schemas/connectorTypesEnum"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"status":{"type":"string","enum":["connected","error","unconfigured"],"default":"unconfigured"},"errorMessage":{"type":["string","null"]}},"required":["organisationId","name","createdAt","updatedAt"]},"connectorTypesEnum":{"type":"string","enum":["PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]}}}}
```

## The ConnectorImportInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConnectorImportInput":{"type":"object","properties":{"workspaceId":{"type":["string","null"],"description":"Workspace the imported source lands in. Optional for a workspace-scoped credential, which supplies it; required for an organisation-wide credential, which can reach several"},"config":{"type":"object","additionalProperties":{},"description":"Connector-specific selection: {table} or {query} for SQL connectors, {path} for storage, {object, fields} for CRM connectors; connectorId and type are filled in from the route"},"datasetName":{"type":["string","null"],"description":"Name for the created source (defaults to the table/query name)"},"ontologyMode":{"anyOf":[{"type":"string","enum":["auto","manual"]},{"type":"null"}],"description":"Whether ontology analysis runs automatically after import (default auto)"},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Optional URL called once when the import completes"}},"required":["config"]}}}}
```

## The ConnectorListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ConnectorListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Connector"}}},"required":["data"]},"Connector":{"type":"object","properties":{"id":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"type":{"anyOf":[{"$ref":"#/components/schemas/connectorTypesEnum"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"status":{"type":"string","enum":["connected","error","unconfigured"],"default":"unconfigured"},"errorMessage":{"type":["string","null"]}},"required":["organisationId","name","createdAt","updatedAt"]},"connectorTypesEnum":{"type":"string","enum":["PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]}}}}
```

## The connectorTypesEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"connectorTypesEnum":{"type":"string","enum":["PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]}}}}
```

## The ContinuousPredictionRecordSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ContinuousPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"type":["number","null"],"description":"Predicted value in decoded format"},"std":{"type":["number","null"],"description":"Standard deviation of prediction in decoded scale"},"lowerBound":{"type":["number","null"],"description":"Lower bound of confidence interval in decoded format"},"upperBound":{"type":["number","null"],"description":"Upper bound of confidence interval in decoded format"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"},"attribution":{"anyOf":[{"$ref":"#/components/schemas/ForecastComponentAttributionSchema"},{"type":"null"}],"description":"Component attribution for this prediction step"}}},"ForecastComponentAttributionSchema":{"type":"object","properties":{"trend":{"type":["number","null"],"description":"Adaptive trend contribution"},"seasonal":{"type":["number","null"],"description":"Seasonal component contribution"},"parents":{"type":["number","null"],"description":"Total parent causal effect"},"delta":{"type":["number","null"],"description":"Level/drift contribution"},"parentBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"anyOf":[{"not":{}},{"type":["number","null"]}]}},{"type":"null"}],"description":"Per-parent contribution breakdown"}}}}}}
```

## The ContrastSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ContrastSchema":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"]}}}}
```

## The CoordinateDatumEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CoordinateDatumEnum":{"type":"string","enum":["wgs84","gcj02","bd09"]}}}}
```

## The CoordinateFormatEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CoordinateFormatEnum":{"type":"string","enum":["dd","dms","ddm"]}}}}
```

## The CounterfactualExplanationSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualExplanationSchema":{"type":"object","properties":{"originalSample":{"type":"object","additionalProperties":{},"description":"Original sample this explanation corresponds to"},"imputedVariables":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Non-target variables the request left null, with the value the twin filled in from its own marginal before predicting and searching. originalSample already contains these fills."},"currentPrediction":{"type":"object","additionalProperties":{},"description":"Dictionary mapping each requested target variable to its predicted value in the original sample."},"requestedTargets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"The list of target conditions requested for this sample."},"counterfactuals":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualSchema"},"description":"List of counterfactual solutions found (if any)."},"searchStatus":{"$ref":"#/components/schemas/CounterfactualSearchStatusSchema","default":"searched","description":"'searched' means the solver evaluated candidates for this sample; 'failed' means the search could not run, so an empty counterfactual list is not evidence of infeasibility."},"failureReason":{"type":["string","null"],"description":"Actionable reason the search could not run for this sample. Set only when searchStatus is 'failed'."}},"required":["originalSample","currentPrediction","requestedTargets","counterfactuals"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/VariableChangeSchema"},"description":"Changes made to variables"},"predictedOutcomes":{"type":"object","additionalProperties":{},"description":"Dictionary mapping each target variable to its predicted value (decoded) under these changes."},"allTargetsMet":{"type":"boolean","description":"Indicates if all requested target conditions were met by this counterfactual."},"certainty":{"type":"number","default":0.8,"description":"Confidence or certainty measure of this counterfactual outcome (heuristic)."},"matchStatus":{"$ref":"#/components/schemas/CounterfactualMatchStatusSchema","default":"exact","description":"Why this counterfactual was kept: exact match, within configured tolerance, or closest non-matching fallback."},"targetDistances":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-target signed distance (predicted - target) for numeric targets, for UI display."}},"required":["changes","predictedOutcomes","allTargetsMet"]},"VariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to change"},"fromValue":{"description":"Original value"},"toValue":{"description":"New value"},"importance":{"type":"number","description":"Importance of the change"}},"required":["variable","importance"]},"CounterfactualMatchStatusSchema":{"type":"string","enum":["exact","withinTolerance","closest"]},"CounterfactualSearchStatusSchema":{"type":"string","enum":["searched","failed"]}}}}
```

## The CounterfactualMatchModeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]}}}}
```

## The CounterfactualMatchStatusSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualMatchStatusSchema":{"type":"string","enum":["exact","withinTolerance","closest"]}}}}
```

## The CounterfactualSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/VariableChangeSchema"},"description":"Changes made to variables"},"predictedOutcomes":{"type":"object","additionalProperties":{},"description":"Dictionary mapping each target variable to its predicted value (decoded) under these changes."},"allTargetsMet":{"type":"boolean","description":"Indicates if all requested target conditions were met by this counterfactual."},"certainty":{"type":"number","default":0.8,"description":"Confidence or certainty measure of this counterfactual outcome (heuristic)."},"matchStatus":{"$ref":"#/components/schemas/CounterfactualMatchStatusSchema","default":"exact","description":"Why this counterfactual was kept: exact match, within configured tolerance, or closest non-matching fallback."},"targetDistances":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-target signed distance (predicted - target) for numeric targets, for UI display."}},"required":["changes","predictedOutcomes","allTargetsMet"]},"VariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to change"},"fromValue":{"description":"Original value"},"toValue":{"description":"New value"},"importance":{"type":"number","description":"Importance of the change"}},"required":["variable","importance"]},"CounterfactualMatchStatusSchema":{"type":"string","enum":["exact","withinTolerance","closest"]}}}}
```

## The CounterfactualSearchStatusSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualSearchStatusSchema":{"type":"string","enum":["searched","failed"]}}}}
```

## The CounterfactualTargetSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]}}}}
```

## The CounterfactualToleranceTypeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]}}}}
```

## The CounterfactualVariableConstraintSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]}}}}
```

## The CreateConceptInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateConceptInput":{"type":"object","properties":{"name":{"type":"string"},"schemaFieldName":{"type":"string"},"schemaType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"schemaSubtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"metadata":{"$ref":"#/components/schemas/ConceptMetadataSchema"},"description":{"type":["string","null"]},"conceptClassification":{"anyOf":[{"$ref":"#/components/schemas/ConceptClassificationEnum"},{"type":"null"}]},"anchorConceptLinks":{"type":"array","items":{"type":"string"},"default":[]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DerivedConceptInfoSchema"},{"type":"null"}]},"conceptKind":{"$ref":"#/components/schemas/ConceptKindEnum","default":"standard"},"metricSql":{"type":["string","null"]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]},"fieldMappings":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"status":{"$ref":"#/components/schemas/BindingStatusEnum","default":"confirmed"},"source":{"$ref":"#/components/schemas/BindingSourceEnum","default":"ingest"},"confidence":{"type":["number","null"]},"evidence":{"type":["string","null"]},"valueMap":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}},{"allOf":[{},{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}}]}]},{"type":"null"}]},"canonicalField":{"type":["string","null"]},"scopeFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"precedence":{"type":["number","null"]},"keyRole":{"anyOf":[{"$ref":"#/components/schemas/KeyRoleEnum"},{"type":"null"}]},"conformance":{"anyOf":[{"$ref":"#/components/schemas/ConformanceReportSchema"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"sourceId":{"type":"string"}},"required":["field","sourceId"]},"default":[]}},"required":["name","schemaFieldName","schemaType","metadata"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"ConceptMetadataSchema":{"type":"object","properties":{"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]},"isUnique":{"type":["boolean","null"]},"isCyclic":{"type":["boolean","null"]},"isHeterogeneousIdentifier":{"type":["boolean","null"]},"compositeScopeConceptId":{"type":["string","null"]},"isUniformDistribution":{"type":["boolean","null"]},"locationType":{"anyOf":[{"$ref":"#/components/schemas/AnchorLocationTypeEnum"},{"type":"null"}]},"coordinateFormat":{"anyOf":[{"$ref":"#/components/schemas/CoordinateFormatEnum"},{"type":"null"}]},"coordinateDatum":{"anyOf":[{"$ref":"#/components/schemas/CoordinateDatumEnum"},{"type":"null"}]},"coordinatePairConceptId":{"type":["string","null"]},"locationDetectionSource":{"anyOf":[{"$ref":"#/components/schemas/LocationDetectionSourceEnum"},{"type":"null"}]},"latitudeInRangeFraction":{"type":["number","null"]},"longitudeInRangeFraction":{"type":["number","null"]},"fractionalPartFraction":{"type":["number","null"]},"coordinatePairFraction":{"type":["number","null"]},"dmsCoordinateFraction":{"type":["number","null"]},"postalCodeFraction":{"type":["number","null"]},"addressShapeFraction":{"type":["number","null"]},"enrichments":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EnrichmentRecordSchema"}},{"type":"null"}]},"geoEnrichmentStatus":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"geoEnrichmentKind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"geoEnrichedAt":{"type":["string","null"]},"geoEnrichmentVersion":{"type":["number","null"]},"geoSidecarKey":{"type":["string","null"]},"geoDistinctTotal":{"type":["number","null"]},"geoMatchedCount":{"type":["number","null"]},"geoUnmatchedCount":{"type":["number","null"]},"geoTruncated":{"type":["boolean","null"]},"geoEnrichmentError":{"type":["string","null"]},"nanFillStrategy":{"anyOf":[{"$ref":"#/components/schemas/NanFillStrategyEnum"},{"type":"null"}]},"changeRate":{"type":["number","null"]},"dateTimeFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"averageInterval":{"type":["number","null"]},"isConsistentInterval":{"type":["boolean","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"higherIsBetter":{"type":["boolean","null"]},"isEqualInterval":{"type":["boolean","null"]},"intervalSize":{"type":["number","null"]},"valueClass":{"anyOf":[{"$ref":"#/components/schemas/ValueClassEnum"},{"type":"null"}]},"fracZero":{"type":["number","null"]},"zeroRunLengthP95":{"type":["number","null"]},"nonZeroRunLengthP95":{"type":["number","null"]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"emailFraction":{"type":["number","null"]},"medianLength":{"type":["number","null"]},"distinctLengthCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"tsGranularity":{"type":["string","null"]},"tsValidGranularities":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tsTypicalDeltaSeconds":{"type":["number","null"]},"tsSelectedGrid":{"type":["string","null"]},"tsGapProfile":{"anyOf":[{"$ref":"#/components/schemas/GapProfileSchema"},{"type":"null"}]},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsPerEnvProfiles":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesEnvProfileSchema"}},{"type":"null"}]},"tsAnalyzerVersion":{"type":["string","null"]},"tsAnalyzedAt":{"type":["string","null"]},"elementSchemaType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"elementCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sizeStatistics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"additionalProperties":true},"AnchorLocationTypeEnum":{"type":"string","enum":["latitude","longitude","coordinate","country","region","city","postal_code","address","continent","airport_code","unlocode"]},"CoordinateFormatEnum":{"type":"string","enum":["dd","dms","ddm"]},"CoordinateDatumEnum":{"type":"string","enum":["wgs84","gcj02","bd09"]},"LocationDetectionSourceEnum":{"type":"string","enum":["values","column_name","user"]},"EnrichmentRecordSchema":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"enrichedAt":{"type":["string","null"]},"enricherVersion":{"type":["string","null"]},"dataVersion":{"type":["string","null"]},"version":{"type":["number","null"]},"sidecarKey":{"type":["string","null"]},"keyFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"hintFields":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"corroborationFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latLonPrecision":{"type":["number","null"]},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]},"truncated":{"type":["boolean","null"]},"error":{"type":["string","null"]},"appliedDatum":{"type":["string","null"]}}},"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]},"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]},"NanFillStrategyEnum":{"type":"string","enum":["forward","interpolate","zero","drop","undefined"]},"ValueClassEnum":{"type":"string","enum":["continuous","sparse_event","bursty","binary_indicator"]},"GapProfileSchema":{"type":"object","properties":{"expectedIntervalSeconds":{"type":["number","null"]},"p50GapSeconds":{"type":["number","null"]},"p95GapSeconds":{"type":["number","null"]},"p99GapSeconds":{"type":["number","null"]},"maxGapSeconds":{"type":["number","null"]},"gapCount":{"type":["number","null"]},"largestGapStart":{"type":["string","null"]}}},"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]},"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]},"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]},"TimeSeriesEnvProfileSchema":{"type":"object","properties":{"envKey":{"type":"string"},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"tsTypicalDeltaSeconds":{"type":["number","null"]}},"required":["envKey"]},"ConceptClassificationEnum":{"type":"string","enum":["identifier","location","time"]},"DerivedConceptInfoSchema":{"type":"object","properties":{"formula":{"type":["string","null"]},"formulaBlocks":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]},"derivedType":{"$ref":"#/components/schemas/DerivedTypeEnum","default":"manual"},"kind":{"anyOf":[{"$ref":"#/components/schemas/DerivedInfoKindEnum"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/DerivedSourceEnum"},{"type":"null"}]},"sourceColumns":{"type":"array","items":{"type":"string"},"default":[]},"expression":{"type":["string","null"]},"r2":{"type":["number","null"]},"isDeterministic":{"type":["boolean","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"sourceDataViewId":{"type":["string","null"]},"operationLineage":{"anyOf":[{"$ref":"#/components/schemas/OperationLineageSchema"},{"type":"null"}]},"viewSnapshot":{"anyOf":[{"$ref":"#/components/schemas/ViewSnapshotSchema"},{"type":"null"}]},"lineageHash":{"type":["string","null"]},"sourceJoinConfig":{"anyOf":[{"$ref":"#/components/schemas/SourceJoinConfigSchema"},{"type":"null"}]}}},"DerivedTypeEnum":{"type":"string","enum":["manual","datetime_component","lag","cumulative","step_change","algebraic_identity","complement","ratio","view_operation"]},"DerivedInfoKindEnum":{"type":"string","enum":["op","formula","detected","join"]},"DerivedSourceEnum":{"type":"string","enum":["user","detected","discovered"]},"OperationLineageSchema":{"type":"object","properties":{"opType":{"$ref":"#/components/schemas/OperationTypeEnum"},"opId":{"type":"string"},"parentColumns":{"type":"array","items":{"type":"string"},"default":[]},"parentConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["opType","opId"]},"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]},"ViewSnapshotSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"outputColumn":{"type":"string"}},"required":["sources","operations","outputColumn"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"SourceJoinConfigSchema":{"type":"object","properties":{"joinType":{"type":"string","enum":["left","inner"],"default":"left"},"strategy":{"type":["string","null"]}}},"ConceptKindEnum":{"type":"string","enum":["standard","derived","metric"]},"SuggestedRoleEnum":{"type":"string","enum":["source","target"]},"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]},"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]},"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]},"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]}}}}
```

## The CreateConnectorInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateConnectorInput":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"credentials":{"type":["object","null"],"additionalProperties":{}}},"required":["name","type"]}}}}
```

## The CreateDatasetInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateDatasetInput":{"type":"object","properties":{"name":{"type":"string"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/DataViewMutationSourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"description":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"anchorConceptId":{"type":["string","null"]}},"required":["name","sources","operations"]},"DataViewMutationSourceSchema":{"$ref":"#/components/schemas/SourceSchema"},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]}}}}
```

## The CreateEnvironmentGroupInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateEnvironmentGroupInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"Display name; unique per twin"},"definition":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"],"description":"The declarative membership rule: mode columnValues (allowed values per environment column), environments (exact combos), or statFilters (per-environment aggregates over any twin column)"}},"required":["name","definition"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The CreateReportInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateReportInput":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":["string","null"]}},"required":["title"]}}}}
```

## The CreateSourceFromDataSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateSourceFromDataSchema":{"type":"object","properties":{"name":{"type":"string","description":"Source name"},"data":{"type":"array","items":{"type":"object","additionalProperties":{}},"minItems":1,"description":"Array of records; keys become columns, types are inferred during ingest"},"description":{"type":["string","null"]},"parentSourceId":{"type":["string","null"],"description":"Optional parent folder source to group under"}},"required":["name","data"]}}}}
```

## The CreateSourceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateSourceSchema":{"type":"object","properties":{"name":{"type":"string"},"dataFormat":{"type":"string","enum":["Tabular","Folder","Text","PDF","Image","Audio","Video"],"default":"Tabular"},"description":{"type":["string","null"]},"parentSourceId":{"type":["string","null"]}},"required":["name","dataFormat"]}}}}
```

## The CreateTwinInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateTwinInput":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"],"default":"static"},"tags":{"type":["array","null"],"items":{"type":"string"}},"datasetId":{"type":["string","null"]},"sourceId":{"type":["string","null"]},"selectedTimeColumnName":{"type":["string","null"]},"environmentColumns":{"type":["array","null"],"items":{"type":"string"}},"shardCount":{"type":["integer","null"],"minimum":1}},"required":["name","type"]}}}}
```

## The CreateVersionInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateVersionInput":{"type":"object","properties":{"bump":{"type":"string","enum":["major","minor","patch"],"default":"patch","description":"Which version component to bump (default patch)"},"baseVersionId":{"type":["string","null"],"description":"Version to derive from; the latest version when omitted"},"datasetId":{"type":["string","null"],"description":"Point the new version at a different dataset"}}}}}}
```

## The CreateWorkspaceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CreateWorkspaceSchema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}}}
```

## The CredentialEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CredentialEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"userId":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":["string","null"],"description":"The workspace the credential is pinned to, or null for org-wide"},"scopes":{"type":"array","items":{"type":"string"}},"authType":{"type":"string","enum":["apiKey","oauth"]},"rateLimit":{"type":["number","null"],"description":"Requests per minute; null for OAuth, which shares the fixed OAuth limit"}},"required":["userId","organisationId","workspaceId","scopes","authType","rateLimit"]}},"required":["data"]}}}}
```

## The CrossEnvironmentStatsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CrossEnvironmentStatsSchema":{"type":"object","properties":{"scope":{"type":["string","null"]},"environmentCount":{"type":["number","null"]},"totalEnvironments":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"environmentsMissingResult":{"type":["number","null"]},"metrics":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PanelAggregateMetricStatsSchema"}},{"type":"null"}]}}},"PanelAggregateMetricStatsSchema":{"type":"object","properties":{"environmentCount":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"meanEffect":{"type":["number","null"]},"medianEffect":{"type":["number","null"]},"p10Effect":{"type":["number","null"]},"p90Effect":{"type":["number","null"]},"shareNegative":{"type":["number","null"]},"sharePositive":{"type":["number","null"]},"baselineMean":{"type":["number","null"]},"interventionMean":{"type":["number","null"]},"medianRelativeEffect":{"type":["number","null"]},"shareSignificant":{"type":["number","null"]}}}}}}
```

## The CycleNameEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]}}}}
```

## The CyclicComponentEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]}}}}
```

## The CyclicPatternSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]}}}}
```

## The datasetFormatsEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"datasetFormatsEnum":{"type":"string","enum":["Folder","Tabular","Text","Workbook","PDF","DOCX","PPTX","Image","Audio","Video"]}}}}
```

## The DataSourceTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DataSourceTypeEnum":{"type":"string","enum":["Local Upload","API Upload","Web Research","Document Extraction","Workbook Extraction","PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]}}}}
```

## The DataViewCreatedByEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]}}}}
```

## The DataViewMutationSourceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DataViewMutationSourceSchema":{"$ref":"#/components/schemas/SourceSchema"},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}}}}}
```

## The DataViewSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]}}}}
```

## The DataViewSourceQuerySchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]}}}}
```

## The DateDiffSignEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]}}}}
```

## The DateDiffUnitEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]}}}}
```

## The DatetimeFormatSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DatetimeFormatSchema":{"type":"string","minLength":1}}}}
```

## The DerivedConceptInfoSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DerivedConceptInfoSchema":{"type":"object","properties":{"formula":{"type":["string","null"]},"formulaBlocks":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]},"derivedType":{"$ref":"#/components/schemas/DerivedTypeEnum","default":"manual"},"kind":{"anyOf":[{"$ref":"#/components/schemas/DerivedInfoKindEnum"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/DerivedSourceEnum"},{"type":"null"}]},"sourceColumns":{"type":"array","items":{"type":"string"},"default":[]},"expression":{"type":["string","null"]},"r2":{"type":["number","null"]},"isDeterministic":{"type":["boolean","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"sourceDataViewId":{"type":["string","null"]},"operationLineage":{"anyOf":[{"$ref":"#/components/schemas/OperationLineageSchema"},{"type":"null"}]},"viewSnapshot":{"anyOf":[{"$ref":"#/components/schemas/ViewSnapshotSchema"},{"type":"null"}]},"lineageHash":{"type":["string","null"]},"sourceJoinConfig":{"anyOf":[{"$ref":"#/components/schemas/SourceJoinConfigSchema"},{"type":"null"}]}}},"DerivedTypeEnum":{"type":"string","enum":["manual","datetime_component","lag","cumulative","step_change","algebraic_identity","complement","ratio","view_operation"]},"DerivedInfoKindEnum":{"type":"string","enum":["op","formula","detected","join"]},"DerivedSourceEnum":{"type":"string","enum":["user","detected","discovered"]},"OperationLineageSchema":{"type":"object","properties":{"opType":{"$ref":"#/components/schemas/OperationTypeEnum"},"opId":{"type":"string"},"parentColumns":{"type":"array","items":{"type":"string"},"default":[]},"parentConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["opType","opId"]},"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]},"ViewSnapshotSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"outputColumn":{"type":"string"}},"required":["sources","operations","outputColumn"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"SourceJoinConfigSchema":{"type":"object","properties":{"joinType":{"type":"string","enum":["left","inner"],"default":"left"},"strategy":{"type":["string","null"]}}}}}}
```

## The DerivedInfoKindEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DerivedInfoKindEnum":{"type":"string","enum":["op","formula","detected","join"]}}}}
```

## The DerivedSourceEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DerivedSourceEnum":{"type":"string","enum":["user","detected","discovered"]}}}}
```

## The DerivedTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DerivedTypeEnum":{"type":"string","enum":["manual","datetime_component","lag","cumulative","step_change","algebraic_identity","complement","ratio","view_operation"]}}}}
```

## The DerivedViaEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DerivedViaEnum":{"type":"string","enum":["document_tables","document_homogenisation","document_entities","workbook_sql"]}}}}
```

## The DetectedConceptStructureSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DetectedConceptStructureSchema":{"type":"object","properties":{"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]}}},"SuggestedRoleEnum":{"type":"string","enum":["source","target"]}}}}
```

## The DigitalTwinCreatedEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinCreatedEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"normalizedName":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"canonicalInputSchema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"status":{"$ref":"#/components/schemas/StatusTypeEnum","default":"active"},"createdAt":{"type":"string"},"suggestedSimulations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SuggestedSimulationSchema"}},{"type":"null"}]},"suggestionsGeneratedAt":{"type":["string","null"]},"environmentGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentGroupSchema"}},{"type":"null"}]},"autoUpdate":{"anyOf":[{"$ref":"#/components/schemas/AutoUpdateSettingsSchema"},{"type":"null"}]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}},"versionId":{"type":"string","description":"The version created alongside the twin"}},"required":["id","organisationId","workspaceId","name","type","versionId"]}},"required":["data"]},"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"StatusTypeEnum":{"type":"string","enum":["active","deprecated"]},"SuggestedSimulationSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scenario":{"$ref":"#/components/schemas/DigitalTwinScenarioSchema"},"createdAt":{"type":"string"}},"required":["id","name","description","scenario","createdAt"]},"DigitalTwinScenarioSchema":{"anyOf":[{"$ref":"#/components/schemas/OptimisationScenarioSchema"},{"$ref":"#/components/schemas/StaticInterventionSpecSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionSpecSchema"},{"$ref":"#/components/schemas/MultiCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PredictionWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/ExplanationRequestSchema"},{"$ref":"#/components/schemas/ParentImpactRequestSchema"},{"$ref":"#/components/schemas/ForecastWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/TemporalExplanationRequestSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualRequestSchema"},{"$ref":"#/components/schemas/TemporalOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelForecastRequestSchema"},{"$ref":"#/components/schemas/PanelInterventionSpecSchema"},{"$ref":"#/components/schemas/PanelExplanationRequestSchema"},{"$ref":"#/components/schemas/PanelCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PanelOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelParentImpactRequestSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/TemporalRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/AnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorRequestSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorRequestSchema"}]},"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}},"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]},"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]},"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]},"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]},"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]},"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"EnvironmentGroupSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema"},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"splitColumn":{"type":["string","null"]},"splitValue":{"type":["string","null"]}},"required":["id","name","definition","createdAt"]},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]},"AutoUpdateSettingsSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"mode":{"type":"string","enum":["assimilate_only","assimilate_or_retrain"],"default":"assimilate_only"}}}}}}
```

## The DigitalTwinEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DigitalTwin"}},"required":["data"]},"DigitalTwin":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"normalizedName":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"canonicalInputSchema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"status":{"$ref":"#/components/schemas/StatusTypeEnum","default":"active"},"createdAt":{"type":"string"},"suggestedSimulations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SuggestedSimulationSchema"}},{"type":"null"}]},"suggestionsGeneratedAt":{"type":["string","null"]},"environmentGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentGroupSchema"}},{"type":"null"}]},"autoUpdate":{"anyOf":[{"$ref":"#/components/schemas/AutoUpdateSettingsSchema"},{"type":"null"}]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}}},"required":["id","organisationId","workspaceId","name","type"]},"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"StatusTypeEnum":{"type":"string","enum":["active","deprecated"]},"SuggestedSimulationSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scenario":{"$ref":"#/components/schemas/DigitalTwinScenarioSchema"},"createdAt":{"type":"string"}},"required":["id","name","description","scenario","createdAt"]},"DigitalTwinScenarioSchema":{"anyOf":[{"$ref":"#/components/schemas/OptimisationScenarioSchema"},{"$ref":"#/components/schemas/StaticInterventionSpecSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionSpecSchema"},{"$ref":"#/components/schemas/MultiCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PredictionWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/ExplanationRequestSchema"},{"$ref":"#/components/schemas/ParentImpactRequestSchema"},{"$ref":"#/components/schemas/ForecastWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/TemporalExplanationRequestSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualRequestSchema"},{"$ref":"#/components/schemas/TemporalOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelForecastRequestSchema"},{"$ref":"#/components/schemas/PanelInterventionSpecSchema"},{"$ref":"#/components/schemas/PanelExplanationRequestSchema"},{"$ref":"#/components/schemas/PanelCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PanelOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelParentImpactRequestSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/TemporalRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/AnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorRequestSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorRequestSchema"}]},"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}},"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]},"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]},"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]},"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]},"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]},"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"EnvironmentGroupSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema"},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"splitColumn":{"type":["string","null"]},"splitValue":{"type":["string","null"]}},"required":["id","name","definition","createdAt"]},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]},"AutoUpdateSettingsSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"mode":{"type":"string","enum":["assimilate_only","assimilate_or_retrain"],"default":"assimilate_only"}}}}}}
```

## The DigitalTwinListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DigitalTwin"}},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]},"DigitalTwin":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"normalizedName":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"canonicalInputSchema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"status":{"$ref":"#/components/schemas/StatusTypeEnum","default":"active"},"createdAt":{"type":"string"},"suggestedSimulations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SuggestedSimulationSchema"}},{"type":"null"}]},"suggestionsGeneratedAt":{"type":["string","null"]},"environmentGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentGroupSchema"}},{"type":"null"}]},"autoUpdate":{"anyOf":[{"$ref":"#/components/schemas/AutoUpdateSettingsSchema"},{"type":"null"}]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}}},"required":["id","organisationId","workspaceId","name","type"]},"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"StatusTypeEnum":{"type":"string","enum":["active","deprecated"]},"SuggestedSimulationSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scenario":{"$ref":"#/components/schemas/DigitalTwinScenarioSchema"},"createdAt":{"type":"string"}},"required":["id","name","description","scenario","createdAt"]},"DigitalTwinScenarioSchema":{"anyOf":[{"$ref":"#/components/schemas/OptimisationScenarioSchema"},{"$ref":"#/components/schemas/StaticInterventionSpecSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionSpecSchema"},{"$ref":"#/components/schemas/MultiCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PredictionWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/ExplanationRequestSchema"},{"$ref":"#/components/schemas/ParentImpactRequestSchema"},{"$ref":"#/components/schemas/ForecastWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/TemporalExplanationRequestSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualRequestSchema"},{"$ref":"#/components/schemas/TemporalOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelForecastRequestSchema"},{"$ref":"#/components/schemas/PanelInterventionSpecSchema"},{"$ref":"#/components/schemas/PanelExplanationRequestSchema"},{"$ref":"#/components/schemas/PanelCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PanelOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelParentImpactRequestSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/TemporalRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/AnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorRequestSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorRequestSchema"}]},"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}},"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]},"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]},"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]},"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]},"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]},"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"EnvironmentGroupSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema"},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"splitColumn":{"type":["string","null"]},"splitValue":{"type":["string","null"]}},"required":["id","name","definition","createdAt"]},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]},"AutoUpdateSettingsSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"mode":{"type":"string","enum":["assimilate_only","assimilate_or_retrain"],"default":"assimilate_only"}}}}}}
```

## The DigitalTwinPredictionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinPredictionResultSchema":{"type":"object","properties":{"results":{"type":"object","additionalProperties":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/CategoricalPredictionRecordSchema"},{"$ref":"#/components/schemas/ContinuousPredictionRecordSchema"}]}}},"changepoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ForecastChangepointSchema"}}},{"type":"null"}],"description":"Detected changepoints per variable"},"history":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ForecastHistorySeriesSchema"}},{"type":"null"}],"description":"Per-variable trailing observed history from the model's stored training series"}},"required":["results"]},"CategoricalPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"description":"Predicted class (most likely) in decoded format"},"probabilities":{"type":"array","items":{"type":"number"},"description":"Raw predicted probabilities for each class"},"lowerBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Lower bounds of confidence intervals for probabilities"},"upperBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Upper bounds of confidence intervals for probabilities"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"}},"required":["probabilities"]},"ContinuousPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"type":["number","null"],"description":"Predicted value in decoded format"},"std":{"type":["number","null"],"description":"Standard deviation of prediction in decoded scale"},"lowerBound":{"type":["number","null"],"description":"Lower bound of confidence interval in decoded format"},"upperBound":{"type":["number","null"],"description":"Upper bound of confidence interval in decoded format"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"},"attribution":{"anyOf":[{"$ref":"#/components/schemas/ForecastComponentAttributionSchema"},{"type":"null"}],"description":"Component attribution for this prediction step"}}},"ForecastComponentAttributionSchema":{"type":"object","properties":{"trend":{"type":["number","null"],"description":"Adaptive trend contribution"},"seasonal":{"type":["number","null"],"description":"Seasonal component contribution"},"parents":{"type":["number","null"],"description":"Total parent causal effect"},"delta":{"type":["number","null"],"description":"Level/drift contribution"},"parentBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"anyOf":[{"not":{}},{"type":["number","null"]}]}},{"type":"null"}],"description":"Per-parent contribution breakdown"}}},"ForecastChangepointSchema":{"type":"object","properties":{"stepIndex":{"type":"number","description":"Step index where changepoint occurs"},"timestamp":{"type":"number","description":"Timestamp of the changepoint"},"direction":{"type":"string","enum":["up","down","inflection"],"description":"Direction of the change"},"magnitude":{"type":"number","description":"Magnitude of the change"},"primaryDriver":{"type":"string","description":"Primary driver of the change"},"driverContribution":{"type":"number","description":"Contribution of the primary driver"}},"required":["stepIndex","timestamp","direction","magnitude","primaryDriver","driverContribution"]},"ForecastHistorySeriesSchema":{"type":"object","properties":{"timestamps":{"type":"array","items":{"type":"number"},"description":"Trailing observed-history timestamps in ms, ending at the model's last training step"},"values":{"type":"array","items":{"type":["number","null"]},"description":"Observed values aligned with timestamps; null entries mark missing source rows"}},"required":["timestamps","values"]}}}}
```

## The DigitalTwinScenarioSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinScenarioSchema":{"anyOf":[{"$ref":"#/components/schemas/OptimisationScenarioSchema"},{"$ref":"#/components/schemas/StaticInterventionSpecSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionSpecSchema"},{"$ref":"#/components/schemas/MultiCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PredictionWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/ExplanationRequestSchema"},{"$ref":"#/components/schemas/ParentImpactRequestSchema"},{"$ref":"#/components/schemas/ForecastWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/TemporalExplanationRequestSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualRequestSchema"},{"$ref":"#/components/schemas/TemporalOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelForecastRequestSchema"},{"$ref":"#/components/schemas/PanelInterventionSpecSchema"},{"$ref":"#/components/schemas/PanelExplanationRequestSchema"},{"$ref":"#/components/schemas/PanelCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PanelOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelParentImpactRequestSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/TemporalRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/AnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorRequestSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorRequestSchema"}]},"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}},"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]},"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]},"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]},"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]},"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]},"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]}}}}
```

## The DigitalTwinTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]}}}}
```

## The DigitalTwinVersionEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinVersionEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DigitalTwinVersion"}},"required":["data"]},"DigitalTwinVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"twinId":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"versionMajor":{"type":"number","minimum":0},"versionMinor":{"type":"number","minimum":0},"versionPatch":{"type":"number","minimum":0},"version":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"derivedFromVersionId":{"type":["string","null"]},"changelog":{"anyOf":[{"$ref":"#/components/schemas/ChangeLogSchema"},{"type":"null"}]},"datasetId":{"type":"string"},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"inputFields":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"temporalDependencies":{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesSchema"},{"type":"null"}]},"timeSeriesMetadata":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesMetadataSchema"},{"type":"null"}]},"granularity":{"type":["string","null"]},"fixedSubGraph":{"anyOf":[{"$ref":"#/components/schemas/FixedSubGraphSchema"},{"type":"null"}]},"variableRoles":{"anyOf":[{"$ref":"#/components/schemas/VariableRolesSchema"},{"type":"null"}]},"derivedColumns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"}},{"type":"null"}]},"dataSignature":{"type":"string"},"configSignature":{"type":"string"},"nTrainSamples":{"type":["number","null"]},"causalGraph":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CausalNodeSchema"}},"evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResultSchema"},{"type":"null"}]},"panelEvaluation":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EvaluationResultSchema"}},{"type":"null"}]},"graphRecommendations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GraphRecommendationsSchema"}},{"type":"null"}]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedEnvironmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedTimeColumnName":{"type":["string","null"]},"environmentSelection":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSelectionSchema"},{"type":"null"}]},"extraOps":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"nEnvironments":{"type":["number","null"]},"latentClusters":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/LatentClusterInfoSchema"}},{"type":"null"}]},"latentDiscoveryConfig":{"anyOf":[{"$ref":"#/components/schemas/LatentDiscoveryConfigSchema"},{"type":"null"}]},"nodeDomains":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}},{"type":"null"}]},"lastTimestampMs":{"type":["number","null"]},"headCommit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trainedWindowSignature":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"trainedWindowProfile":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnWindowProfileSchema"}},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"updateEligibility":{"anyOf":[{"type":"object","properties":{"updateMode":{"type":"string","enum":["assimilable","retrain_required","up_to_date","unsupported"]},"reasons":{"type":"array","items":{"type":"string"},"default":[]},"newRows":{"type":["number","null"]},"fromTsMs":{"type":["number","null"]},"toTsMs":{"type":["number","null"]},"historyDiff":{"anyOf":[{"$ref":"#/components/schemas/HistoryDiffSchema"},{"type":"null"}]}},"required":["updateMode"]},{"type":"null"}]},"trainingStages":{"anyOf":[{"type":"object","properties":{"confounderModelling":{"type":"boolean"},"equationDiscovery":{"type":"boolean"},"lagScreening":{"type":["boolean","null"]},"evalHorizons":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvalHorizonSchema"}},{"type":"null"}]}},"required":["confounderModelling","equationDiscovery"]},{"type":"null"}]},"timeComponent":{"anyOf":[{"$ref":"#/components/schemas/TimeComponentArtifactSchema"},{"type":"null"}]},"causalAlgorithmVersion":{"type":["string","null"]},"digitalTwinAlgorithmVersion":{"type":["string","null"]},"shardCount":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"maxLag":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"layout":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean"},"positions":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]},"edgeWaypoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]}},"required":["success"]},{"type":"null"}]},"lifecycleState":{"$ref":"#/components/schemas/LifecycleStateEnum","default":"created"},"currentTaskId":{"type":["string","null"]},"failureContext":{"anyOf":[{"$ref":"#/components/schemas/FailureContextSchema"},{"type":"null"}]},"traces":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":["string","null"]}}}},{"type":"null"}]},"arrayFeatureMap":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"arrayFeatureToBase":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","twinId","organisationId","workspaceId","versionMajor","versionMinor","versionPatch","datasetId","type","dataSignature","configSignature","causalGraph","nodes"]},{"type":"object","properties":{"id":{"type":"string"},"twinId":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"versionMajor":{"type":"number","minimum":0},"versionMinor":{"type":"number","minimum":0},"versionPatch":{"type":"number","minimum":0},"version":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"derivedFromVersionId":{"type":["string","null"]},"changelog":{"anyOf":[{"$ref":"#/components/schemas/ChangeLogSchema"},{"type":"null"}]},"sourceId":{"type":"string"},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"inputFields":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"temporalDependencies":{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesSchema"},{"type":"null"}]},"timeSeriesMetadata":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesMetadataSchema"},{"type":"null"}]},"granularity":{"type":["string","null"]},"fixedSubGraph":{"anyOf":[{"$ref":"#/components/schemas/FixedSubGraphSchema"},{"type":"null"}]},"variableRoles":{"anyOf":[{"$ref":"#/components/schemas/VariableRolesSchema"},{"type":"null"}]},"derivedColumns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"}},{"type":"null"}]},"dataSignature":{"type":"string"},"configSignature":{"type":"string"},"nTrainSamples":{"type":["number","null"]},"causalGraph":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CausalNodeSchema"}},"evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResultSchema"},{"type":"null"}]},"panelEvaluation":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EvaluationResultSchema"}},{"type":"null"}]},"graphRecommendations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GraphRecommendationsSchema"}},{"type":"null"}]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedEnvironmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedTimeColumnName":{"type":["string","null"]},"environmentSelection":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSelectionSchema"},{"type":"null"}]},"extraOps":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"nEnvironments":{"type":["number","null"]},"latentClusters":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/LatentClusterInfoSchema"}},{"type":"null"}]},"latentDiscoveryConfig":{"anyOf":[{"$ref":"#/components/schemas/LatentDiscoveryConfigSchema"},{"type":"null"}]},"nodeDomains":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}},{"type":"null"}]},"lastTimestampMs":{"type":["number","null"]},"headCommit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trainedWindowSignature":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"trainedWindowProfile":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnWindowProfileSchema"}},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"updateEligibility":{"anyOf":[{"type":"object","properties":{"updateMode":{"type":"string","enum":["assimilable","retrain_required","up_to_date","unsupported"]},"reasons":{"type":"array","items":{"type":"string"},"default":[]},"newRows":{"type":["number","null"]},"fromTsMs":{"type":["number","null"]},"toTsMs":{"type":["number","null"]},"historyDiff":{"anyOf":[{"$ref":"#/components/schemas/HistoryDiffSchema"},{"type":"null"}]}},"required":["updateMode"]},{"type":"null"}]},"trainingStages":{"anyOf":[{"type":"object","properties":{"confounderModelling":{"type":"boolean"},"equationDiscovery":{"type":"boolean"},"lagScreening":{"type":["boolean","null"]},"evalHorizons":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvalHorizonSchema"}},{"type":"null"}]}},"required":["confounderModelling","equationDiscovery"]},{"type":"null"}]},"timeComponent":{"anyOf":[{"$ref":"#/components/schemas/TimeComponentArtifactSchema"},{"type":"null"}]},"causalAlgorithmVersion":{"type":["string","null"]},"digitalTwinAlgorithmVersion":{"type":["string","null"]},"shardCount":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"maxLag":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"layout":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean"},"positions":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]},"edgeWaypoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]}},"required":["success"]},{"type":"null"}]},"lifecycleState":{"$ref":"#/components/schemas/LifecycleStateEnum","default":"created"},"currentTaskId":{"type":["string","null"]},"failureContext":{"anyOf":[{"$ref":"#/components/schemas/FailureContextSchema"},{"type":"null"}]},"traces":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":["string","null"]}}}},{"type":"null"}]},"arrayFeatureMap":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"arrayFeatureToBase":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","twinId","organisationId","workspaceId","versionMajor","versionMinor","versionPatch","sourceId","type","dataSignature","configSignature","causalGraph","nodes"]}]},"ChangeLogSchema":{"type":"object","properties":{"temporalDependenciesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalDependencyChangeSchema"}},{"type":"null"}]},"fixedSubGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FixedSubGraphChangeSchema"}},{"type":"null"}]},"causalGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CausalGraphChangeSchema"}},{"type":"null"}]},"nodesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NodeChangeSchema"}},{"type":"null"}]},"evaluationDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvaluationChangeSchema"}},{"type":"null"}]}}},"TemporalDependencyChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"variable":{"type":"string"},"oldPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"newPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["type","variable"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]},"FixedSubGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"changeTarget":{"type":"string","enum":["relationships","antiRelationships"]},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"required":["type","changeTarget","relationship"]},"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]},"CausalGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"},"oldRelationship":{"anyOf":[{"$ref":"#/components/schemas/CausalRelationshipSchema"},{"type":"null"}]}},"required":["type","relationship"]},"NodeChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"node":{"$ref":"#/components/schemas/CausalNodeSchema"},"oldNode":{"anyOf":[{"$ref":"#/components/schemas/CausalNodeSchema"},{"type":"null"}]}},"required":["type","node"]},"CausalNodeSchema":{"type":"object","properties":{"name":{"type":"string"},"nodeType":{"$ref":"#/components/schemas/NodeTypeEnum","default":"observed"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latentClusterId":{"type":["number","null"]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"isDerived":{"type":"boolean","default":false},"symbolicEquation":{"anyOf":[{"$ref":"#/components/schemas/SymbolicEquationSchema"},{"type":"null"}]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"},{"type":"null"}]},"parentImpacts":{"anyOf":[{"$ref":"#/components/schemas/NodeParentImpactsSchema"},{"type":"null"}],"description":"Model-based driver contribution shares computed after training"}},"required":["name","type"]},"NodeTypeEnum":{"type":"string","enum":["observed","latent","latent_inter","latent_intra","environment"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SymbolicEquationSchema":{"type":"object","properties":{"expression":{"type":"string"},"r2":{"type":"number"},"noisePercentage":{"type":"number"},"termBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicTermSchema"}},"complexity":{"type":"number"},"explanationType":{"type":"string","enum":["regression","classification_rules","conditional_probability"],"default":"regression"},"epsilonSigma":{"type":["number","null"]},"epsilonSigmaRelative":{"type":["number","null"]},"expressionWithNoise":{"type":["string","null"]},"discoveryMethod":{"type":["string","null"]},"parentContributions":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicParentContributionSchema"}},"unexplainedPct":{"type":["number","null"]},"directionReferenceClass":{"type":["string","null"]},"alternatives":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SymbolicEquationAlternativeSchema"}},{"type":"null"}],"description":"Pareto-front alternatives to the chosen equation (balanced / fewer terms / better fit); absent until discovery emits them"}},"required":["expression","r2","noisePercentage","termBreakdown","complexity"]},"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]},"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]},"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]},"DtDerivedColumnInfoSchema":{"type":"object","properties":{"derivedType":{"type":"string"},"targetColumn":{"type":"string"},"sourceColumns":{"type":"array","items":{"type":"string"}},"expression":{"type":"string"},"r2":{"type":["number","null"]},"isDeterministic":{"type":"boolean"},"implausibilityReason":{"type":["string","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"seasonalTerms":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalTermSchema"}},{"type":"null"}]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]}},"required":["derivedType","targetColumn","sourceColumns","expression","isDeterministic"]},"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]},"EvaluationChangeSchema":{"type":"object","properties":{"type":{"type":"string","enum":["improvement","worsening"]},"metric":{"type":"string"},"oldValue":{"type":["number","null"]},"newValue":{"type":"number"},"percentChange":{"type":["number","null"]}},"required":["type","metric","newValue"]},"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"TemporalDependenciesSchema":{"anyOf":[{"not":{}},{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesObjectSchema"},{"type":"null"}]}]},"TemporalDependenciesObjectSchema":{"type":"object","properties":{"prerequisites":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["prerequisites"]},"TimeSeriesMetadataSchema":{"type":"object","properties":{"colName":{"type":"string","description":"Column name for the time series"},"granularity":{"type":"string","enum":["ms","s","min","h","D","W","ME","Y","L","S","T","H"],"description":"Current granularity of the time series"},"validGranularities":{"type":"array","items":{"type":"string"},"description":"List of valid granularities"},"startDate":{"type":"string","description":"Start date of the time series"},"endDate":{"type":"string","description":"End date of the time series"},"typicalDeltaSeconds":{"type":["number","null"]},"selectedGrid":{"type":["string","null"]},"candidateGrids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"scoring":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}]},"coverage":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesCoverageSchema"},{"type":"null"}],"description":"Observed vs imputed grid steps; absent on twins trained before this existed"}},"required":["colName","granularity","validGranularities","startDate","endDate"]},"TimeSeriesCoverageSchema":{"type":"object","properties":{"observedSteps":{"type":"number","description":"Grid steps that carried at least one observed row"},"gridSteps":{"type":"number","description":"Steps on the dense grid the twin trains on"},"imputedSteps":{"type":"number","description":"Grid steps reconstructed by imputation, never measured"},"gapCount":{"type":"number","description":"Total gap runs; `gaps` lists only the largest"},"gaps":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesGapSchema"}}},"required":["observedSteps","gridSteps","imputedSteps","gapCount","gaps"]},"TimeSeriesGapSchema":{"type":"object","properties":{"startDate":{"type":"string","description":"First grid step in the gap"},"endDate":{"type":"string","description":"Last grid step in the gap"},"missingSteps":{"type":"number","description":"Consecutive grid steps with no observed rows"}},"required":["startDate","endDate","missingSteps"]},"FixedSubGraphSchema":{"type":"object","properties":{"relationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"antiRelationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}}},"required":["relationships","antiRelationships"]},"VariableRolesSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"type":"string"}}},"required":["sources","targets"]},"EvaluationResultSchema":{"type":"object","properties":{"modelType":{"type":"string","enum":["cbn","tcbn"],"description":"Type of the model"},"nodeMetrics":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/NodeMetricsSchema"},"description":"Metrics for each node"},"globalMetrics":{"type":"object","properties":{"logLikelihood":{"type":["number","null"],"description":"Overall log-likelihood"},"averageMse":{"type":["number","null"],"description":"Overall mean squared error"},"averageMae":{"type":["number","null"],"description":"Overall mean absolute error"},"averageAccuracy":{"type":["number","null"],"description":"Overall accuracy"},"averageMape":{"type":["number","null"],"description":"Overall mean absolute percentage error"}},"description":"Global metrics"},"skippedReason":{"anyOf":[{"type":"string","enum":["insufficient_data"]},{"type":"null"}],"description":"Set when evaluation was deliberately skipped"},"skipReasons":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"User-facing explanation of why evaluation was skipped"},"nEvalPoints":{"type":["number","null"],"description":"Number of holdout time steps evaluation used (or would have used)"}},"required":["modelType","nodeMetrics","globalMetrics"]},"NodeMetricsSchema":{"type":"object","properties":{"accuracy":{"type":["number","null"],"description":"Classification accuracy"},"accuracyPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Classification accuracy per class"},"weightedAccuracy":{"type":["number","null"],"description":"Weighted classification accuracy"},"falsePositiveRate":{"type":["number","null"],"description":"False positive rate"},"falseNegativeRate":{"type":["number","null"],"description":"False negative rate"},"truePositiveRate":{"type":["number","null"],"description":"True positive rate"},"trueNegativeRate":{"type":["number","null"],"description":"True negative rate"},"precision":{"type":["number","null"],"description":"Precision, macro-averaged across classes"},"recall":{"type":["number","null"],"description":"Recall, macro-averaged across classes"},"f1Score":{"type":["number","null"],"description":"F1 score, macro-averaged across classes"},"precisionPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Precision per class"},"recallPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Recall per class"},"f1ScorePerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"F1 score per class"},"positiveClassLabel":{"type":["string","null"],"description":"Decoded label of encoded class 1, the anchor for TPR/FPR/TNR/FNR"},"mse":{"type":["number","null"],"description":"Mean squared error"},"r2":{"type":["number","null"],"description":"R-squared"},"logLikelihood":{"type":["number","null"],"description":"Log-likelihood"},"auc":{"type":["number","null"],"description":"Area under ROC curve"},"brierScore":{"type":["number","null"],"description":"Brier score"},"mae":{"type":["number","null"],"description":"Mean absolute error"},"mape":{"anyOf":[{"type":"object","additionalProperties":{"type":["number","null"]}},{"type":"null"}],"description":"Mean absolute percentage error per horizon"}}},"GraphRecommendationsSchema":{"type":"object","properties":{"x":{"type":"string"},"y":{"type":"string"},"direction":{"type":"string","enum":["forward","backward"]},"reasons":{"type":"array","items":{"type":"string"}}},"required":["x","y","direction","reasons"]},"EnvironmentSelectionSchema":{"type":"object","properties":{"baseline":{"type":"string","enum":["all","none"]},"exceptions":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}}},"required":["baseline","exceptions"]},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"LatentClusterInfoSchema":{"type":"object","properties":{"clusterId":{"type":"number"},"affectedNodes":{"type":"array","items":{"type":"string"}},"estimatedDim":{"type":"number","default":1},"dicSatisfied":{"type":"boolean","default":true},"interColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"intraColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"modelStatus":{"anyOf":[{"$ref":"#/components/schemas/LatentModelStatusEnum"},{"type":"null"}]},"modelFailureReason":{"anyOf":[{"$ref":"#/components/schemas/LatentFitFailureReasonEnum"},{"type":"null"}]},"modelFailureDetail":{"type":["string","null"]},"avgLcScore":{"type":["number","null"]},"reconstructionError":{"type":["number","null"]},"envPredictability":{"type":["number","null"]},"memberLatentShare":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"seasonalStrength":{"type":["number","null"]}},"required":["clusterId","affectedNodes"]},"LatentModelStatusEnum":{"type":"string","enum":["modelled","detectedOnly"]},"LatentFitFailureReasonEnum":{"type":"string","enum":["tooFewMembers","noNumericMembers","noExternalParents","allParentColumnsEmpty","insufficientCleanRows","fitError"]},"LatentDiscoveryConfigSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":true},"residualCorrelationThreshold":{"type":"number","default":0.3},"ciTestAlpha":{"type":"number","default":0.05},"minClusterSize":{"type":"number","default":2},"maxLatentDim":{"type":"number","default":5}}},"ColumnWindowProfileSchema":{"type":"object","properties":{"count":{"type":["number","null"]},"distinct":{"type":["number","null"]},"min":{"type":["string","null"]},"max":{"type":["string","null"]}}},"HistoryDiffSchema":{"type":"object","properties":{"changedColumns":{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"stored":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]},"current":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]}},"required":["column"]},"default":[]},"deltaOperations":{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"version":{"type":"integer"},"operation":{"type":"string"},"timestampMs":{"type":["number","null"]}},"required":["datasetId","version","operation"]},"default":[]},"rewrittenDatasets":{"type":"array","items":{"type":"string"},"default":[]}}},"EvalHorizonSchema":{"type":"object","properties":{"count":{"type":"integer","exclusiveMinimum":0},"unit":{"$ref":"#/components/schemas/HorizonUnitEnum"}},"required":["count","unit"]},"HorizonUnitEnum":{"type":"string","enum":["S","T","H","D","W","ME","Y"]},"TimeComponentArtifactSchema":{"type":"object","properties":{"models":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeDecompositionModelSchema"}},"varExplained":{"type":"object","additionalProperties":{"type":"number"}},"trainNSamples":{"type":"number"}},"required":["models","varExplained","trainNSamples"]},"TimeDecompositionModelSchema":{"type":"object","properties":{"theilSenSlope":{"type":"number"},"theilSenIntercept":{"type":"number"},"harmonic":{"anyOf":[{"$ref":"#/components/schemas/HarmonicFitSchema"},{"type":"null"}]}},"required":["theilSenSlope","theilSenIntercept"]},"HarmonicFitSchema":{"type":"object","properties":{"periodsWithHarmonics":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"sinCosCoefficients":{"type":"array","items":{"type":"number"}},"productPairs":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"productCoefficients":{"type":"array","items":{"type":"number"}}},"required":["periodsWithHarmonics","sinCosCoefficients","productPairs","productCoefficients"]},"LifecycleStateEnum":{"type":"string","enum":["created","discovering","resolved","training","trained","failed","cancelled"]},"FailureContextSchema":{"type":"object","properties":{"error":{"type":"string"},"failedAtStage":{"type":"string","enum":["causal_discovery","model_training"]},"retryable":{"type":"boolean","default":true},"userFacing":{"type":"boolean","default":false}},"required":["error","failedAtStage"]}}}}
```

## The DigitalTwinVersionListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinVersionListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DigitalTwinVersion"}},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]},"DigitalTwinVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"twinId":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"versionMajor":{"type":"number","minimum":0},"versionMinor":{"type":"number","minimum":0},"versionPatch":{"type":"number","minimum":0},"version":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"derivedFromVersionId":{"type":["string","null"]},"changelog":{"anyOf":[{"$ref":"#/components/schemas/ChangeLogSchema"},{"type":"null"}]},"datasetId":{"type":"string"},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"inputFields":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"temporalDependencies":{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesSchema"},{"type":"null"}]},"timeSeriesMetadata":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesMetadataSchema"},{"type":"null"}]},"granularity":{"type":["string","null"]},"fixedSubGraph":{"anyOf":[{"$ref":"#/components/schemas/FixedSubGraphSchema"},{"type":"null"}]},"variableRoles":{"anyOf":[{"$ref":"#/components/schemas/VariableRolesSchema"},{"type":"null"}]},"derivedColumns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"}},{"type":"null"}]},"dataSignature":{"type":"string"},"configSignature":{"type":"string"},"nTrainSamples":{"type":["number","null"]},"causalGraph":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CausalNodeSchema"}},"evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResultSchema"},{"type":"null"}]},"panelEvaluation":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EvaluationResultSchema"}},{"type":"null"}]},"graphRecommendations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GraphRecommendationsSchema"}},{"type":"null"}]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedEnvironmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedTimeColumnName":{"type":["string","null"]},"environmentSelection":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSelectionSchema"},{"type":"null"}]},"extraOps":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"nEnvironments":{"type":["number","null"]},"latentClusters":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/LatentClusterInfoSchema"}},{"type":"null"}]},"latentDiscoveryConfig":{"anyOf":[{"$ref":"#/components/schemas/LatentDiscoveryConfigSchema"},{"type":"null"}]},"nodeDomains":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}},{"type":"null"}]},"lastTimestampMs":{"type":["number","null"]},"headCommit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trainedWindowSignature":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"trainedWindowProfile":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnWindowProfileSchema"}},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"updateEligibility":{"anyOf":[{"type":"object","properties":{"updateMode":{"type":"string","enum":["assimilable","retrain_required","up_to_date","unsupported"]},"reasons":{"type":"array","items":{"type":"string"},"default":[]},"newRows":{"type":["number","null"]},"fromTsMs":{"type":["number","null"]},"toTsMs":{"type":["number","null"]},"historyDiff":{"anyOf":[{"$ref":"#/components/schemas/HistoryDiffSchema"},{"type":"null"}]}},"required":["updateMode"]},{"type":"null"}]},"trainingStages":{"anyOf":[{"type":"object","properties":{"confounderModelling":{"type":"boolean"},"equationDiscovery":{"type":"boolean"},"lagScreening":{"type":["boolean","null"]},"evalHorizons":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvalHorizonSchema"}},{"type":"null"}]}},"required":["confounderModelling","equationDiscovery"]},{"type":"null"}]},"timeComponent":{"anyOf":[{"$ref":"#/components/schemas/TimeComponentArtifactSchema"},{"type":"null"}]},"causalAlgorithmVersion":{"type":["string","null"]},"digitalTwinAlgorithmVersion":{"type":["string","null"]},"shardCount":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"maxLag":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"layout":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean"},"positions":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]},"edgeWaypoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]}},"required":["success"]},{"type":"null"}]},"lifecycleState":{"$ref":"#/components/schemas/LifecycleStateEnum","default":"created"},"currentTaskId":{"type":["string","null"]},"failureContext":{"anyOf":[{"$ref":"#/components/schemas/FailureContextSchema"},{"type":"null"}]},"traces":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":["string","null"]}}}},{"type":"null"}]},"arrayFeatureMap":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"arrayFeatureToBase":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","twinId","organisationId","workspaceId","versionMajor","versionMinor","versionPatch","datasetId","type","dataSignature","configSignature","causalGraph","nodes"]},{"type":"object","properties":{"id":{"type":"string"},"twinId":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"versionMajor":{"type":"number","minimum":0},"versionMinor":{"type":"number","minimum":0},"versionPatch":{"type":"number","minimum":0},"version":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"derivedFromVersionId":{"type":["string","null"]},"changelog":{"anyOf":[{"$ref":"#/components/schemas/ChangeLogSchema"},{"type":"null"}]},"sourceId":{"type":"string"},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"inputFields":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"temporalDependencies":{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesSchema"},{"type":"null"}]},"timeSeriesMetadata":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesMetadataSchema"},{"type":"null"}]},"granularity":{"type":["string","null"]},"fixedSubGraph":{"anyOf":[{"$ref":"#/components/schemas/FixedSubGraphSchema"},{"type":"null"}]},"variableRoles":{"anyOf":[{"$ref":"#/components/schemas/VariableRolesSchema"},{"type":"null"}]},"derivedColumns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"}},{"type":"null"}]},"dataSignature":{"type":"string"},"configSignature":{"type":"string"},"nTrainSamples":{"type":["number","null"]},"causalGraph":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CausalNodeSchema"}},"evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResultSchema"},{"type":"null"}]},"panelEvaluation":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EvaluationResultSchema"}},{"type":"null"}]},"graphRecommendations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GraphRecommendationsSchema"}},{"type":"null"}]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedEnvironmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedTimeColumnName":{"type":["string","null"]},"environmentSelection":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSelectionSchema"},{"type":"null"}]},"extraOps":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"nEnvironments":{"type":["number","null"]},"latentClusters":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/LatentClusterInfoSchema"}},{"type":"null"}]},"latentDiscoveryConfig":{"anyOf":[{"$ref":"#/components/schemas/LatentDiscoveryConfigSchema"},{"type":"null"}]},"nodeDomains":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}},{"type":"null"}]},"lastTimestampMs":{"type":["number","null"]},"headCommit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trainedWindowSignature":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"trainedWindowProfile":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnWindowProfileSchema"}},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"updateEligibility":{"anyOf":[{"type":"object","properties":{"updateMode":{"type":"string","enum":["assimilable","retrain_required","up_to_date","unsupported"]},"reasons":{"type":"array","items":{"type":"string"},"default":[]},"newRows":{"type":["number","null"]},"fromTsMs":{"type":["number","null"]},"toTsMs":{"type":["number","null"]},"historyDiff":{"anyOf":[{"$ref":"#/components/schemas/HistoryDiffSchema"},{"type":"null"}]}},"required":["updateMode"]},{"type":"null"}]},"trainingStages":{"anyOf":[{"type":"object","properties":{"confounderModelling":{"type":"boolean"},"equationDiscovery":{"type":"boolean"},"lagScreening":{"type":["boolean","null"]},"evalHorizons":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvalHorizonSchema"}},{"type":"null"}]}},"required":["confounderModelling","equationDiscovery"]},{"type":"null"}]},"timeComponent":{"anyOf":[{"$ref":"#/components/schemas/TimeComponentArtifactSchema"},{"type":"null"}]},"causalAlgorithmVersion":{"type":["string","null"]},"digitalTwinAlgorithmVersion":{"type":["string","null"]},"shardCount":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"maxLag":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"layout":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean"},"positions":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]},"edgeWaypoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]}},"required":["success"]},{"type":"null"}]},"lifecycleState":{"$ref":"#/components/schemas/LifecycleStateEnum","default":"created"},"currentTaskId":{"type":["string","null"]},"failureContext":{"anyOf":[{"$ref":"#/components/schemas/FailureContextSchema"},{"type":"null"}]},"traces":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":["string","null"]}}}},{"type":"null"}]},"arrayFeatureMap":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"arrayFeatureToBase":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","twinId","organisationId","workspaceId","versionMajor","versionMinor","versionPatch","sourceId","type","dataSignature","configSignature","causalGraph","nodes"]}]},"ChangeLogSchema":{"type":"object","properties":{"temporalDependenciesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalDependencyChangeSchema"}},{"type":"null"}]},"fixedSubGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FixedSubGraphChangeSchema"}},{"type":"null"}]},"causalGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CausalGraphChangeSchema"}},{"type":"null"}]},"nodesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NodeChangeSchema"}},{"type":"null"}]},"evaluationDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvaluationChangeSchema"}},{"type":"null"}]}}},"TemporalDependencyChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"variable":{"type":"string"},"oldPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"newPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["type","variable"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]},"FixedSubGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"changeTarget":{"type":"string","enum":["relationships","antiRelationships"]},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"required":["type","changeTarget","relationship"]},"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]},"CausalGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"},"oldRelationship":{"anyOf":[{"$ref":"#/components/schemas/CausalRelationshipSchema"},{"type":"null"}]}},"required":["type","relationship"]},"NodeChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"node":{"$ref":"#/components/schemas/CausalNodeSchema"},"oldNode":{"anyOf":[{"$ref":"#/components/schemas/CausalNodeSchema"},{"type":"null"}]}},"required":["type","node"]},"CausalNodeSchema":{"type":"object","properties":{"name":{"type":"string"},"nodeType":{"$ref":"#/components/schemas/NodeTypeEnum","default":"observed"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latentClusterId":{"type":["number","null"]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"isDerived":{"type":"boolean","default":false},"symbolicEquation":{"anyOf":[{"$ref":"#/components/schemas/SymbolicEquationSchema"},{"type":"null"}]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"},{"type":"null"}]},"parentImpacts":{"anyOf":[{"$ref":"#/components/schemas/NodeParentImpactsSchema"},{"type":"null"}],"description":"Model-based driver contribution shares computed after training"}},"required":["name","type"]},"NodeTypeEnum":{"type":"string","enum":["observed","latent","latent_inter","latent_intra","environment"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SymbolicEquationSchema":{"type":"object","properties":{"expression":{"type":"string"},"r2":{"type":"number"},"noisePercentage":{"type":"number"},"termBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicTermSchema"}},"complexity":{"type":"number"},"explanationType":{"type":"string","enum":["regression","classification_rules","conditional_probability"],"default":"regression"},"epsilonSigma":{"type":["number","null"]},"epsilonSigmaRelative":{"type":["number","null"]},"expressionWithNoise":{"type":["string","null"]},"discoveryMethod":{"type":["string","null"]},"parentContributions":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicParentContributionSchema"}},"unexplainedPct":{"type":["number","null"]},"directionReferenceClass":{"type":["string","null"]},"alternatives":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SymbolicEquationAlternativeSchema"}},{"type":"null"}],"description":"Pareto-front alternatives to the chosen equation (balanced / fewer terms / better fit); absent until discovery emits them"}},"required":["expression","r2","noisePercentage","termBreakdown","complexity"]},"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]},"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]},"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]},"DtDerivedColumnInfoSchema":{"type":"object","properties":{"derivedType":{"type":"string"},"targetColumn":{"type":"string"},"sourceColumns":{"type":"array","items":{"type":"string"}},"expression":{"type":"string"},"r2":{"type":["number","null"]},"isDeterministic":{"type":"boolean"},"implausibilityReason":{"type":["string","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"seasonalTerms":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalTermSchema"}},{"type":"null"}]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]}},"required":["derivedType","targetColumn","sourceColumns","expression","isDeterministic"]},"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]},"EvaluationChangeSchema":{"type":"object","properties":{"type":{"type":"string","enum":["improvement","worsening"]},"metric":{"type":"string"},"oldValue":{"type":["number","null"]},"newValue":{"type":"number"},"percentChange":{"type":["number","null"]}},"required":["type","metric","newValue"]},"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"TemporalDependenciesSchema":{"anyOf":[{"not":{}},{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesObjectSchema"},{"type":"null"}]}]},"TemporalDependenciesObjectSchema":{"type":"object","properties":{"prerequisites":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["prerequisites"]},"TimeSeriesMetadataSchema":{"type":"object","properties":{"colName":{"type":"string","description":"Column name for the time series"},"granularity":{"type":"string","enum":["ms","s","min","h","D","W","ME","Y","L","S","T","H"],"description":"Current granularity of the time series"},"validGranularities":{"type":"array","items":{"type":"string"},"description":"List of valid granularities"},"startDate":{"type":"string","description":"Start date of the time series"},"endDate":{"type":"string","description":"End date of the time series"},"typicalDeltaSeconds":{"type":["number","null"]},"selectedGrid":{"type":["string","null"]},"candidateGrids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"scoring":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}]},"coverage":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesCoverageSchema"},{"type":"null"}],"description":"Observed vs imputed grid steps; absent on twins trained before this existed"}},"required":["colName","granularity","validGranularities","startDate","endDate"]},"TimeSeriesCoverageSchema":{"type":"object","properties":{"observedSteps":{"type":"number","description":"Grid steps that carried at least one observed row"},"gridSteps":{"type":"number","description":"Steps on the dense grid the twin trains on"},"imputedSteps":{"type":"number","description":"Grid steps reconstructed by imputation, never measured"},"gapCount":{"type":"number","description":"Total gap runs; `gaps` lists only the largest"},"gaps":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesGapSchema"}}},"required":["observedSteps","gridSteps","imputedSteps","gapCount","gaps"]},"TimeSeriesGapSchema":{"type":"object","properties":{"startDate":{"type":"string","description":"First grid step in the gap"},"endDate":{"type":"string","description":"Last grid step in the gap"},"missingSteps":{"type":"number","description":"Consecutive grid steps with no observed rows"}},"required":["startDate","endDate","missingSteps"]},"FixedSubGraphSchema":{"type":"object","properties":{"relationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"antiRelationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}}},"required":["relationships","antiRelationships"]},"VariableRolesSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"type":"string"}}},"required":["sources","targets"]},"EvaluationResultSchema":{"type":"object","properties":{"modelType":{"type":"string","enum":["cbn","tcbn"],"description":"Type of the model"},"nodeMetrics":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/NodeMetricsSchema"},"description":"Metrics for each node"},"globalMetrics":{"type":"object","properties":{"logLikelihood":{"type":["number","null"],"description":"Overall log-likelihood"},"averageMse":{"type":["number","null"],"description":"Overall mean squared error"},"averageMae":{"type":["number","null"],"description":"Overall mean absolute error"},"averageAccuracy":{"type":["number","null"],"description":"Overall accuracy"},"averageMape":{"type":["number","null"],"description":"Overall mean absolute percentage error"}},"description":"Global metrics"},"skippedReason":{"anyOf":[{"type":"string","enum":["insufficient_data"]},{"type":"null"}],"description":"Set when evaluation was deliberately skipped"},"skipReasons":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"User-facing explanation of why evaluation was skipped"},"nEvalPoints":{"type":["number","null"],"description":"Number of holdout time steps evaluation used (or would have used)"}},"required":["modelType","nodeMetrics","globalMetrics"]},"NodeMetricsSchema":{"type":"object","properties":{"accuracy":{"type":["number","null"],"description":"Classification accuracy"},"accuracyPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Classification accuracy per class"},"weightedAccuracy":{"type":["number","null"],"description":"Weighted classification accuracy"},"falsePositiveRate":{"type":["number","null"],"description":"False positive rate"},"falseNegativeRate":{"type":["number","null"],"description":"False negative rate"},"truePositiveRate":{"type":["number","null"],"description":"True positive rate"},"trueNegativeRate":{"type":["number","null"],"description":"True negative rate"},"precision":{"type":["number","null"],"description":"Precision, macro-averaged across classes"},"recall":{"type":["number","null"],"description":"Recall, macro-averaged across classes"},"f1Score":{"type":["number","null"],"description":"F1 score, macro-averaged across classes"},"precisionPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Precision per class"},"recallPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Recall per class"},"f1ScorePerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"F1 score per class"},"positiveClassLabel":{"type":["string","null"],"description":"Decoded label of encoded class 1, the anchor for TPR/FPR/TNR/FNR"},"mse":{"type":["number","null"],"description":"Mean squared error"},"r2":{"type":["number","null"],"description":"R-squared"},"logLikelihood":{"type":["number","null"],"description":"Log-likelihood"},"auc":{"type":["number","null"],"description":"Area under ROC curve"},"brierScore":{"type":["number","null"],"description":"Brier score"},"mae":{"type":["number","null"],"description":"Mean absolute error"},"mape":{"anyOf":[{"type":"object","additionalProperties":{"type":["number","null"]}},{"type":"null"}],"description":"Mean absolute percentage error per horizon"}}},"GraphRecommendationsSchema":{"type":"object","properties":{"x":{"type":"string"},"y":{"type":"string"},"direction":{"type":"string","enum":["forward","backward"]},"reasons":{"type":"array","items":{"type":"string"}}},"required":["x","y","direction","reasons"]},"EnvironmentSelectionSchema":{"type":"object","properties":{"baseline":{"type":"string","enum":["all","none"]},"exceptions":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}}},"required":["baseline","exceptions"]},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"LatentClusterInfoSchema":{"type":"object","properties":{"clusterId":{"type":"number"},"affectedNodes":{"type":"array","items":{"type":"string"}},"estimatedDim":{"type":"number","default":1},"dicSatisfied":{"type":"boolean","default":true},"interColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"intraColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"modelStatus":{"anyOf":[{"$ref":"#/components/schemas/LatentModelStatusEnum"},{"type":"null"}]},"modelFailureReason":{"anyOf":[{"$ref":"#/components/schemas/LatentFitFailureReasonEnum"},{"type":"null"}]},"modelFailureDetail":{"type":["string","null"]},"avgLcScore":{"type":["number","null"]},"reconstructionError":{"type":["number","null"]},"envPredictability":{"type":["number","null"]},"memberLatentShare":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"seasonalStrength":{"type":["number","null"]}},"required":["clusterId","affectedNodes"]},"LatentModelStatusEnum":{"type":"string","enum":["modelled","detectedOnly"]},"LatentFitFailureReasonEnum":{"type":"string","enum":["tooFewMembers","noNumericMembers","noExternalParents","allParentColumnsEmpty","insufficientCleanRows","fitError"]},"LatentDiscoveryConfigSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":true},"residualCorrelationThreshold":{"type":"number","default":0.3},"ciTestAlpha":{"type":"number","default":0.05},"minClusterSize":{"type":"number","default":2},"maxLatentDim":{"type":"number","default":5}}},"ColumnWindowProfileSchema":{"type":"object","properties":{"count":{"type":["number","null"]},"distinct":{"type":["number","null"]},"min":{"type":["string","null"]},"max":{"type":["string","null"]}}},"HistoryDiffSchema":{"type":"object","properties":{"changedColumns":{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"stored":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]},"current":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]}},"required":["column"]},"default":[]},"deltaOperations":{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"version":{"type":"integer"},"operation":{"type":"string"},"timestampMs":{"type":["number","null"]}},"required":["datasetId","version","operation"]},"default":[]},"rewrittenDatasets":{"type":"array","items":{"type":"string"},"default":[]}}},"EvalHorizonSchema":{"type":"object","properties":{"count":{"type":"integer","exclusiveMinimum":0},"unit":{"$ref":"#/components/schemas/HorizonUnitEnum"}},"required":["count","unit"]},"HorizonUnitEnum":{"type":"string","enum":["S","T","H","D","W","ME","Y"]},"TimeComponentArtifactSchema":{"type":"object","properties":{"models":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeDecompositionModelSchema"}},"varExplained":{"type":"object","additionalProperties":{"type":"number"}},"trainNSamples":{"type":"number"}},"required":["models","varExplained","trainNSamples"]},"TimeDecompositionModelSchema":{"type":"object","properties":{"theilSenSlope":{"type":"number"},"theilSenIntercept":{"type":"number"},"harmonic":{"anyOf":[{"$ref":"#/components/schemas/HarmonicFitSchema"},{"type":"null"}]}},"required":["theilSenSlope","theilSenIntercept"]},"HarmonicFitSchema":{"type":"object","properties":{"periodsWithHarmonics":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"sinCosCoefficients":{"type":"array","items":{"type":"number"}},"productPairs":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"productCoefficients":{"type":"array","items":{"type":"number"}}},"required":["periodsWithHarmonics","sinCosCoefficients","productPairs","productCoefficients"]},"LifecycleStateEnum":{"type":"string","enum":["created","discovering","resolved","training","trained","failed","cancelled"]},"FailureContextSchema":{"type":"object","properties":{"error":{"type":"string"},"failedAtStage":{"type":"string","enum":["causal_discovery","model_training"]},"retryable":{"type":"boolean","default":true},"userFacing":{"type":"boolean","default":false}},"required":["error","failedAtStage"]}}}}
```

## The directQuerySettingsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"directQuerySettingsSchema":{"type":"object","properties":{"orderingColumn":{"type":["string","null"],"description":"Column the source's rows are paged by"},"appendOnly":{"type":["boolean","null"],"description":"Declared: the rows are only ever added, never updated or deleted"},"statementTimeoutSeconds":{"type":["number","null"],"description":"Cap on how long one remote statement may run"},"maxRowsScanned":{"type":["number","null"],"description":"Cap on how many rows one remote statement may scan"}},"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}}}}
```

## The DirectQuerySourceEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DirectQuerySourceEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"sourceId":{"type":"string","description":"Id of the created source"},"workspaceId":{"type":"string"},"name":{"type":"string"},"droppedColumns":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string","description":"The source's own type name, which the platform has no column type for"}},"required":["field","type"]},"description":"Columns the source has that its schema here does not. An object store leaves out columns whose type the platform cannot represent, and a source silently short a column is what the caller has to be able to see"}},"required":["sourceId","workspaceId","name","droppedColumns"],"description":"A source created over a connector and read at query time. Creation is synchronous — the schema is probed from the remote catalogue, not scanned — but ontology analysis is queued and its results appear later"}},"required":["data"]}}}}
```

## The DoseResponseAnalysisSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]}}}}
```

## The DoseResponsePointSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]}}}}
```

## The DriverRankingSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DriverRankingSchema":{"type":"object","properties":{"targetVariable":{"type":"string","description":"The outcome variable being explained"},"drivers":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"},"description":"Causal drivers ranked by effect size"}},"required":["targetVariable","drivers"]},"CausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string","description":"The cause variable"},"effectVar":{"type":"string","description":"The effect variable"},"overallEffect":{"type":"object","properties":{"effectSize":{"type":"number","description":"Average causal effect size"},"effectRange":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Min and max effect across tested values"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"95% confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"P-value for statistical significance"},"categoryEffects":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Effects by category (for categorical causes)"},"targetEffects":{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"},"description":"Effects for specific target values"},"baselineOutcomeProbs":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Baseline outcome probabilities"},"targetOutcomeDeltas":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Changes in outcome probabilities"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"},"summaryMethod":{"type":"string","description":"Method used to summarize effects"}},"required":["effectSize","confidenceInterval","statisticalSignificance","targetEffects","contrast","nReplicates","effectiveSampleSize","summaryMethod"],"description":"Overall causal effect analysis"},"doseResponse":{"anyOf":[{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"},{"type":"null"}],"description":"Dose-response curve (for continuous causes)"},"segmentEffects":{"type":"array","items":{"$ref":"#/components/schemas/SegmentExplanationEffectSchema"},"description":"Effects by segment"},"pathwayEffects":{"type":"object","properties":{"mode":{"type":"string","enum":["qualitative","additive"],"description":"Analysis mode"},"directEffect":{"type":["number","null"],"description":"Direct effect if variables are connected"},"indirectEffects":{"type":"array","items":{"$ref":"#/components/schemas/PathwayEffectSchema"},"description":"Effects through indirect pathways"},"totalEffect":{"type":["number","null"],"description":"Sum of all pathway effects"},"sumToOverall":{"type":"boolean","description":"Whether pathway effects sum to overall effect"}},"required":["mode","indirectEffects","sumToOverall"],"description":"Analysis of causal pathways"},"units":{"type":"string","enum":["probability","value"],"description":"Units of the effect measurement"},"summaryMethod":{"type":"string","description":"Method used to summarize the analysis"}},"required":["causeVar","effectVar","overallEffect","segmentEffects","pathwayEffects","units","summaryMethod"]},"TargetEffectSchema":{"type":"object","properties":{"causeTarget":{"type":["string","number"],"description":"Target value of the cause"},"scalarEffect":{"type":"number","description":"Scalar effect size"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"Statistical significance level"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"}},"required":["causeTarget","scalarEffect","confidenceInterval","statisticalSignificance","nReplicates","effectiveSampleSize"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"SegmentExplanationEffectSchema":{"type":"object","properties":{"segmentId":{"type":"string","description":"Unique identifier for the segment"},"segmentDescription":{"type":"string","description":"Human-readable segment description"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"effectSize":{"type":"number","description":"Causal effect size in this segment"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"sampleSize":{"type":"number","description":"Number of samples in this segment"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification for this segment"},"nReplicates":{"type":["number","null"],"description":"Number of replicates"},"targetEffects":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"}},{"type":"null"}],"description":"Target-specific effects"}},"required":["segmentId","segmentDescription","conditions","effectSize","confidenceInterval","sampleSize","contrast"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"PathwayEffectSchema":{"type":"object","properties":{"pathway":{"type":"array","items":{"type":"string"},"description":"Variables in the causal pathway"},"effectContribution":{"type":["number","null"],"description":"Contribution of this pathway to total effect"},"percentageOfTotal":{"type":["number","null"],"description":"Percentage of total effect through this pathway"},"note":{"type":["string","null"],"description":"Additional notes about the pathway"}},"required":["pathway"]}}}}
```

## The DtDerivedColumnInfoSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DtDerivedColumnInfoSchema":{"type":"object","properties":{"derivedType":{"type":"string"},"targetColumn":{"type":"string"},"sourceColumns":{"type":"array","items":{"type":"string"}},"expression":{"type":"string"},"r2":{"type":["number","null"]},"isDeterministic":{"type":"boolean"},"implausibilityReason":{"type":["string","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"seasonalTerms":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalTermSchema"}},{"type":"null"}]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]}},"required":["derivedType","targetColumn","sourceColumns","expression","isDeterministic"]},"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]}}}}
```

## The EdgePropagationSeriesResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EdgePropagationSeriesResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"scores":{"type":"array","items":{"type":"number"}}},"required":["source","target","scores"]}}}}
```

## The EnrichmentRecordSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnrichmentRecordSchema":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"enrichedAt":{"type":["string","null"]},"enricherVersion":{"type":["string","null"]},"dataVersion":{"type":["string","null"]},"version":{"type":["number","null"]},"sidecarKey":{"type":["string","null"]},"keyFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"hintFields":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"corroborationFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latLonPrecision":{"type":["number","null"]},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]},"truncated":{"type":["boolean","null"]},"error":{"type":["string","null"]},"appliedDatum":{"type":["string","null"]}}},"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]},"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]}}}}
```

## The EnvironmentCoverageSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentCoverageSchema":{"type":"object","properties":{"requested":{"type":"number"},"forecast":{"type":"number"},"failed":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentForecastFailureSchema"},"default":[]},"omittedFailures":{"type":"number","default":0}},"required":["requested","forecast"]},"EnvironmentForecastFailureSchema":{"type":"object","properties":{"environment":{"type":"string"},"reason":{"type":"string"}},"required":["environment","reason"]}}}}
```

## The EnvironmentForecastFailureSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentForecastFailureSchema":{"type":"object","properties":{"environment":{"type":"string"},"reason":{"type":"string"}},"required":["environment","reason"]}}}}
```

## The EnvironmentGroupDefinitionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The EnvironmentGroupEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentGroupEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EnvironmentGroupSchema"}},"required":["data"]},"EnvironmentGroupSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema"},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"splitColumn":{"type":["string","null"]},"splitValue":{"type":["string","null"]}},"required":["id","name","definition","createdAt"]},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The EnvironmentGroupListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentGroupListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentGroupSchema"}}},"required":["data"]},"EnvironmentGroupSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema"},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"splitColumn":{"type":["string","null"]},"splitValue":{"type":["string","null"]}},"required":["id","name","definition","createdAt"]},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The EnvironmentGroupSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentGroupSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema"},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"splitColumn":{"type":["string","null"]},"splitValue":{"type":["string","null"]}},"required":["id","name","definition","createdAt"]},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The EnvironmentGroupSnapshotSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentGroupSnapshotSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"envKeys":{"type":"array","items":{"type":"string"}},"droppedEnvKeys":{"type":"array","items":{"type":"string"},"default":[]},"notice":{"type":["string","null"]}},"required":["id","name","envKeys"]}}}}
```

## The EnvironmentSelectionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvironmentSelectionSchema":{"type":"object","properties":{"baseline":{"type":"string","enum":["all","none"]},"exceptions":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}}},"required":["baseline","exceptions"]}}}}
```

## The EnvStatFilterGroupSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The EnvStatFilterSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The EnvStatReduceEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The EvalHorizonSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EvalHorizonSchema":{"type":"object","properties":{"count":{"type":"integer","exclusiveMinimum":0},"unit":{"$ref":"#/components/schemas/HorizonUnitEnum"}},"required":["count","unit"]},"HorizonUnitEnum":{"type":"string","enum":["S","T","H","D","W","ME","Y"]}}}}
```

## The EvaluationChangeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EvaluationChangeSchema":{"type":"object","properties":{"type":{"type":"string","enum":["improvement","worsening"]},"metric":{"type":"string"},"oldValue":{"type":["number","null"]},"newValue":{"type":"number"},"percentChange":{"type":["number","null"]}},"required":["type","metric","newValue"]}}}}
```

## The EvaluationResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EvaluationResultSchema":{"type":"object","properties":{"modelType":{"type":"string","enum":["cbn","tcbn"],"description":"Type of the model"},"nodeMetrics":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/NodeMetricsSchema"},"description":"Metrics for each node"},"globalMetrics":{"type":"object","properties":{"logLikelihood":{"type":["number","null"],"description":"Overall log-likelihood"},"averageMse":{"type":["number","null"],"description":"Overall mean squared error"},"averageMae":{"type":["number","null"],"description":"Overall mean absolute error"},"averageAccuracy":{"type":["number","null"],"description":"Overall accuracy"},"averageMape":{"type":["number","null"],"description":"Overall mean absolute percentage error"}},"description":"Global metrics"},"skippedReason":{"anyOf":[{"type":"string","enum":["insufficient_data"]},{"type":"null"}],"description":"Set when evaluation was deliberately skipped"},"skipReasons":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"User-facing explanation of why evaluation was skipped"},"nEvalPoints":{"type":["number","null"],"description":"Number of holdout time steps evaluation used (or would have used)"}},"required":["modelType","nodeMetrics","globalMetrics"]},"NodeMetricsSchema":{"type":"object","properties":{"accuracy":{"type":["number","null"],"description":"Classification accuracy"},"accuracyPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Classification accuracy per class"},"weightedAccuracy":{"type":["number","null"],"description":"Weighted classification accuracy"},"falsePositiveRate":{"type":["number","null"],"description":"False positive rate"},"falseNegativeRate":{"type":["number","null"],"description":"False negative rate"},"truePositiveRate":{"type":["number","null"],"description":"True positive rate"},"trueNegativeRate":{"type":["number","null"],"description":"True negative rate"},"precision":{"type":["number","null"],"description":"Precision, macro-averaged across classes"},"recall":{"type":["number","null"],"description":"Recall, macro-averaged across classes"},"f1Score":{"type":["number","null"],"description":"F1 score, macro-averaged across classes"},"precisionPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Precision per class"},"recallPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Recall per class"},"f1ScorePerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"F1 score per class"},"positiveClassLabel":{"type":["string","null"],"description":"Decoded label of encoded class 1, the anchor for TPR/FPR/TNR/FNR"},"mse":{"type":["number","null"],"description":"Mean squared error"},"r2":{"type":["number","null"],"description":"R-squared"},"logLikelihood":{"type":["number","null"],"description":"Log-likelihood"},"auc":{"type":["number","null"],"description":"Area under ROC curve"},"brierScore":{"type":["number","null"],"description":"Brier score"},"mae":{"type":["number","null"],"description":"Mean absolute error"},"mape":{"anyOf":[{"type":"object","additionalProperties":{"type":["number","null"]}},{"type":"null"}],"description":"Mean absolute percentage error per horizon"}}}}}}
```

## The EventLogEntryResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"EventLogEntryResultSchema":{"type":"object","properties":{"at":{"type":"number"},"atTimestampMs":{"type":["number","null"]},"kind":{"type":"string","enum":["first_alert","cascade","rca_verdict","recovered"]},"variable":{"type":["string","null"]},"alertType":{"type":["string","null"]},"ewmaZ":{"type":"number","default":0},"signedCurrentZ":{"type":"number","default":0},"sourceSignedZ":{"type":"number","default":0},"targetSignedZ":{"type":"number","default":0},"sentence":{"type":"string","default":""},"fromVar":{"type":["string","null"]},"toVar":{"type":["string","null"]},"lagSteps":{"type":["number","null"]},"correlation":{"type":["number","null"]},"target":{"type":["string","null"]},"rootCause":{"type":["string","null"]}},"required":["at","kind"]}}}}
```

## The ExecuteSimulationInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ExecuteSimulationInput":{"type":"object","properties":{"digitalTwinId":{"type":"string","description":"Id of the digital twin to simulate"},"digitalTwinVersionId":{"type":"string","description":"Id of the trained version to run against"},"scenario":{"type":"object","additionalProperties":{},"description":"Scenario configuration: the same object the platform's New Simulation wizard produces. `type` is the discriminator naming the family, and the rest of the fields are that family's inputs. The spelling depends on the twin's kind: prediction (`prediction`: sample, targetVars), forecast (`forecast` / `panel_forecast`: forecastH, targetVars), intervention (`intervention` / `temporal_intervention` / `panel_intervention`: interventions, metrics), optimisation (`optimisation` / `temporal_optimisation` / `panel_optimisation`: objectives, decisionVars), best action (`counterfactual` and variants: samples, targets), explanation (`explanation` and variants: explanationMode, causeVariable, effectVariable), root cause analysis and anomaly detection (targetVariable, samples). Note `scenarioType` is the filter on GET /simulations, not a field of this object. Worked bodies for every family: https://docs.rootcause.ai/api/rest-running-simulations. POST to the version's scenario-from-query endpoint to have the platform build one from a plain-English question."},"environmentGroupIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-environment (panel) twins: saved environment groups to scope the run to. The server resolves each group's membership against the version at submit time and narrows the run to it: when the scenario also names environments the two are intersected, never unioned, so a group can only ever shrink a scenario. An empty intersection is a 400. What it resolved is frozen onto the run as environmentGroupSnapshots. Ignored by single-environment twins."},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Optional URL called when the run completes"}},"required":["digitalTwinId","digitalTwinVersionId","scenario"]}}}}
```

## The ExplanationModeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]}}}}
```

## The ExplanationRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]}}}}
```

## The ExplanationResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ExplanationResultSchema":{"type":"object","properties":{"explanationType":{"type":"string","enum":["directional","discovery","impact"],"description":"Type of explanation performed"},"causalRelationships":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"}},{"type":"null"}],"description":"For directional explanations"},"driverRanking":{"anyOf":[{"$ref":"#/components/schemas/DriverRankingSchema"},{"type":"null"}],"description":"For discovery explanations"},"impactAnalysis":{"anyOf":[{"$ref":"#/components/schemas/ImpactAnalysisSchema"},{"type":"null"}],"description":"For impact explanations"},"executionTime":{"type":"number","description":"Time taken to generate explanation"},"sampleSize":{"type":"number","description":"Number of samples used in analysis"}},"required":["explanationType","executionTime","sampleSize"]},"CausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string","description":"The cause variable"},"effectVar":{"type":"string","description":"The effect variable"},"overallEffect":{"type":"object","properties":{"effectSize":{"type":"number","description":"Average causal effect size"},"effectRange":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Min and max effect across tested values"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"95% confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"P-value for statistical significance"},"categoryEffects":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Effects by category (for categorical causes)"},"targetEffects":{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"},"description":"Effects for specific target values"},"baselineOutcomeProbs":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Baseline outcome probabilities"},"targetOutcomeDeltas":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Changes in outcome probabilities"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"},"summaryMethod":{"type":"string","description":"Method used to summarize effects"}},"required":["effectSize","confidenceInterval","statisticalSignificance","targetEffects","contrast","nReplicates","effectiveSampleSize","summaryMethod"],"description":"Overall causal effect analysis"},"doseResponse":{"anyOf":[{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"},{"type":"null"}],"description":"Dose-response curve (for continuous causes)"},"segmentEffects":{"type":"array","items":{"$ref":"#/components/schemas/SegmentExplanationEffectSchema"},"description":"Effects by segment"},"pathwayEffects":{"type":"object","properties":{"mode":{"type":"string","enum":["qualitative","additive"],"description":"Analysis mode"},"directEffect":{"type":["number","null"],"description":"Direct effect if variables are connected"},"indirectEffects":{"type":"array","items":{"$ref":"#/components/schemas/PathwayEffectSchema"},"description":"Effects through indirect pathways"},"totalEffect":{"type":["number","null"],"description":"Sum of all pathway effects"},"sumToOverall":{"type":"boolean","description":"Whether pathway effects sum to overall effect"}},"required":["mode","indirectEffects","sumToOverall"],"description":"Analysis of causal pathways"},"units":{"type":"string","enum":["probability","value"],"description":"Units of the effect measurement"},"summaryMethod":{"type":"string","description":"Method used to summarize the analysis"}},"required":["causeVar","effectVar","overallEffect","segmentEffects","pathwayEffects","units","summaryMethod"]},"TargetEffectSchema":{"type":"object","properties":{"causeTarget":{"type":["string","number"],"description":"Target value of the cause"},"scalarEffect":{"type":"number","description":"Scalar effect size"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"Statistical significance level"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"}},"required":["causeTarget","scalarEffect","confidenceInterval","statisticalSignificance","nReplicates","effectiveSampleSize"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"SegmentExplanationEffectSchema":{"type":"object","properties":{"segmentId":{"type":"string","description":"Unique identifier for the segment"},"segmentDescription":{"type":"string","description":"Human-readable segment description"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"effectSize":{"type":"number","description":"Causal effect size in this segment"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"sampleSize":{"type":"number","description":"Number of samples in this segment"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification for this segment"},"nReplicates":{"type":["number","null"],"description":"Number of replicates"},"targetEffects":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"}},{"type":"null"}],"description":"Target-specific effects"}},"required":["segmentId","segmentDescription","conditions","effectSize","confidenceInterval","sampleSize","contrast"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"PathwayEffectSchema":{"type":"object","properties":{"pathway":{"type":"array","items":{"type":"string"},"description":"Variables in the causal pathway"},"effectContribution":{"type":["number","null"],"description":"Contribution of this pathway to total effect"},"percentageOfTotal":{"type":["number","null"],"description":"Percentage of total effect through this pathway"},"note":{"type":["string","null"],"description":"Additional notes about the pathway"}},"required":["pathway"]},"DriverRankingSchema":{"type":"object","properties":{"targetVariable":{"type":"string","description":"The outcome variable being explained"},"drivers":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"},"description":"Causal drivers ranked by effect size"}},"required":["targetVariable","drivers"]},"ImpactAnalysisSchema":{"type":"object","properties":{"sourceVariable":{"type":"string","description":"The variable whose impacts are analyzed"},"impacts":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"},"description":"Variables impacted by the source"}},"required":["sourceVariable","impacts"]}}}}
```

## The ExportTwinInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ExportTwinInput":{"type":"object","properties":{"includeRuns":{"type":"boolean","description":"Include simulation run artifacts in the export (default false)"},"versions":{"type":"array","items":{"type":"string"},"description":"Version ids to export; all versions when omitted"},"environments":{"type":"array","items":{"type":"string"},"description":"Panel twins: environment keys to export; all environments when omitted"},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Optional URL called once when the export completes"}}}}}}
```

## The ExtractionRecipeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ExtractionRecipeSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["schema","entities"]},"sourceDocumentIds":{"type":"array","items":{"type":"string"}},"columns":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"entityTypes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true},"default":[]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"targetName":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"lastAppendedAt":{"type":["string","null"]}},"required":["mode","sourceDocumentIds"],"additionalProperties":true}}}}
```

## The ExtractionStatusEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ExtractionStatusEnum":{"type":"string","enum":["pending","extracting","completed","failed"]}}}}
```

## The FailureContextSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FailureContextSchema":{"type":"object","properties":{"error":{"type":"string"},"failedAtStage":{"type":"string","enum":["causal_discovery","model_training"]},"retryable":{"type":"boolean","default":true},"userFacing":{"type":"boolean","default":false}},"required":["error","failedAtStage"]}}}}
```

## The FilterGroupSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]}}}}
```

## The FilterSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]}}}}
```

## The FixedConstraintSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]}}}}
```

## The FixedSubGraphChangeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FixedSubGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"changeTarget":{"type":"string","enum":["relationships","antiRelationships"]},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"required":["type","changeTarget","relationship"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]},"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]}}}}
```

## The FixedSubGraphSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FixedSubGraphSchema":{"type":"object","properties":{"relationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"antiRelationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}}},"required":["relationships","antiRelationships"]},"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]}}}}
```

## The ForecastChangepointSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ForecastChangepointSchema":{"type":"object","properties":{"stepIndex":{"type":"number","description":"Step index where changepoint occurs"},"timestamp":{"type":"number","description":"Timestamp of the changepoint"},"direction":{"type":"string","enum":["up","down","inflection"],"description":"Direction of the change"},"magnitude":{"type":"number","description":"Magnitude of the change"},"primaryDriver":{"type":"string","description":"Primary driver of the change"},"driverContribution":{"type":"number","description":"Contribution of the primary driver"}},"required":["stepIndex","timestamp","direction","magnitude","primaryDriver","driverContribution"]}}}}
```

## The ForecastComponentAttributionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ForecastComponentAttributionSchema":{"type":"object","properties":{"trend":{"type":["number","null"],"description":"Adaptive trend contribution"},"seasonal":{"type":["number","null"],"description":"Seasonal component contribution"},"parents":{"type":["number","null"],"description":"Total parent causal effect"},"delta":{"type":["number","null"],"description":"Level/drift contribution"},"parentBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"anyOf":[{"not":{}},{"type":["number","null"]}]}},{"type":"null"}],"description":"Per-parent contribution breakdown"}}}}}}
```

## The ForecastHistorySeriesSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ForecastHistorySeriesSchema":{"type":"object","properties":{"timestamps":{"type":"array","items":{"type":"number"},"description":"Trailing observed-history timestamps in ms, ending at the model's last training step"},"values":{"type":"array","items":{"type":["number","null"]},"description":"Observed values aligned with timestamps; null entries mark missing source rows"}},"required":["timestamps","values"]}}}}
```

## The ForecastWithUncertaintyRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]}}}}
```

## The FrequencyMethodEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]}}}}
```

## The FrequencyOutputFormatEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]}}}}
```

## The FrequencyUnitEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]}}}}
```

## The FrequencyWindowFunctionEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]}}}}
```

## The GapProfileSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"GapProfileSchema":{"type":"object","properties":{"expectedIntervalSeconds":{"type":["number","null"]},"p50GapSeconds":{"type":["number","null"]},"p95GapSeconds":{"type":["number","null"]},"p99GapSeconds":{"type":["number","null"]},"maxGapSeconds":{"type":["number","null"]},"gapCount":{"type":["number","null"]},"largestGapStart":{"type":["string","null"]}}}}}}
```

## The GeoEnrichmentKindEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]}}}}
```

## The GeoEnrichmentStatusEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]}}}}
```

## The GraphRecommendationsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"GraphRecommendationsSchema":{"type":"object","properties":{"x":{"type":"string"},"y":{"type":"string"},"direction":{"type":"string","enum":["forward","backward"]},"reasons":{"type":"array","items":{"type":"string"}}},"required":["x","y","direction","reasons"]}}}}
```

## The GraphSliceInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"GraphSliceInput":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"],"description":"How the environment subset is defined"},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}],"description":"columnValues mode: allowed values per environment column; an unconstrained column admits all values"},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}],"description":"environments mode: exact environment combos, each {column: value}"},"statFilters":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"statFilters mode: select environments by per-environment aggregates over any twin column"},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}],"description":"Share of environments (0-1) a relationship must hold in to keep an edge (default 0.5)"}},"required":["mode"]},{"type":"object","properties":{"groupId":{"type":"string","description":"Id of a saved environment group on this twin; its stored definition supplies the subset"},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}],"description":"Overrides the agreementThreshold stored on the group for this call only"}},"required":["groupId"]}]}}}}
```

## The GroupUnresolvableSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"GroupUnresolvableSchema":{"type":"object","properties":{"reason":{"type":"string","enum":["noEnvironmentColumns","unknownEnvironmentColumn","shapeMismatch","unknownFilterColumn","filterQueryFailed","noEvidence"]},"message":{"type":"string"},"columns":{"type":"array","items":{"type":"string"},"default":[]}},"required":["reason","message"]}}}}
```

## The HarmonicFitSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"HarmonicFitSchema":{"type":"object","properties":{"periodsWithHarmonics":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"sinCosCoefficients":{"type":"array","items":{"type":"number"}},"productPairs":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"productCoefficients":{"type":"array","items":{"type":"number"}}},"required":["periodsWithHarmonics","sinCosCoefficients","productPairs","productCoefficients"]}}}}
```

## The HistoryDiffSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"HistoryDiffSchema":{"type":"object","properties":{"changedColumns":{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"stored":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]},"current":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]}},"required":["column"]},"default":[]},"deltaOperations":{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"version":{"type":"integer"},"operation":{"type":"string"},"timestampMs":{"type":["number","null"]}},"required":["datasetId","version","operation"]},"default":[]},"rewrittenDatasets":{"type":"array","items":{"type":"string"},"default":[]}}},"ColumnWindowProfileSchema":{"type":"object","properties":{"count":{"type":["number","null"]},"distinct":{"type":["number","null"]},"min":{"type":["string","null"]},"max":{"type":["string","null"]}}}}}}
```

## The HorizonUnitEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"HorizonUnitEnum":{"type":"string","enum":["S","T","H","D","W","ME","Y"]}}}}
```

## The ImpactAnalysisSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ImpactAnalysisSchema":{"type":"object","properties":{"sourceVariable":{"type":"string","description":"The variable whose impacts are analyzed"},"impacts":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"},"description":"Variables impacted by the source"}},"required":["sourceVariable","impacts"]},"CausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string","description":"The cause variable"},"effectVar":{"type":"string","description":"The effect variable"},"overallEffect":{"type":"object","properties":{"effectSize":{"type":"number","description":"Average causal effect size"},"effectRange":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Min and max effect across tested values"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"95% confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"P-value for statistical significance"},"categoryEffects":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Effects by category (for categorical causes)"},"targetEffects":{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"},"description":"Effects for specific target values"},"baselineOutcomeProbs":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Baseline outcome probabilities"},"targetOutcomeDeltas":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Changes in outcome probabilities"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"},"summaryMethod":{"type":"string","description":"Method used to summarize effects"}},"required":["effectSize","confidenceInterval","statisticalSignificance","targetEffects","contrast","nReplicates","effectiveSampleSize","summaryMethod"],"description":"Overall causal effect analysis"},"doseResponse":{"anyOf":[{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"},{"type":"null"}],"description":"Dose-response curve (for continuous causes)"},"segmentEffects":{"type":"array","items":{"$ref":"#/components/schemas/SegmentExplanationEffectSchema"},"description":"Effects by segment"},"pathwayEffects":{"type":"object","properties":{"mode":{"type":"string","enum":["qualitative","additive"],"description":"Analysis mode"},"directEffect":{"type":["number","null"],"description":"Direct effect if variables are connected"},"indirectEffects":{"type":"array","items":{"$ref":"#/components/schemas/PathwayEffectSchema"},"description":"Effects through indirect pathways"},"totalEffect":{"type":["number","null"],"description":"Sum of all pathway effects"},"sumToOverall":{"type":"boolean","description":"Whether pathway effects sum to overall effect"}},"required":["mode","indirectEffects","sumToOverall"],"description":"Analysis of causal pathways"},"units":{"type":"string","enum":["probability","value"],"description":"Units of the effect measurement"},"summaryMethod":{"type":"string","description":"Method used to summarize the analysis"}},"required":["causeVar","effectVar","overallEffect","segmentEffects","pathwayEffects","units","summaryMethod"]},"TargetEffectSchema":{"type":"object","properties":{"causeTarget":{"type":["string","number"],"description":"Target value of the cause"},"scalarEffect":{"type":"number","description":"Scalar effect size"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"Statistical significance level"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"}},"required":["causeTarget","scalarEffect","confidenceInterval","statisticalSignificance","nReplicates","effectiveSampleSize"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"SegmentExplanationEffectSchema":{"type":"object","properties":{"segmentId":{"type":"string","description":"Unique identifier for the segment"},"segmentDescription":{"type":"string","description":"Human-readable segment description"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"effectSize":{"type":"number","description":"Causal effect size in this segment"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"sampleSize":{"type":"number","description":"Number of samples in this segment"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification for this segment"},"nReplicates":{"type":["number","null"],"description":"Number of replicates"},"targetEffects":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"}},{"type":"null"}],"description":"Target-specific effects"}},"required":["segmentId","segmentDescription","conditions","effectSize","confidenceInterval","sampleSize","contrast"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"PathwayEffectSchema":{"type":"object","properties":{"pathway":{"type":"array","items":{"type":"string"},"description":"Variables in the causal pathway"},"effectContribution":{"type":["number","null"],"description":"Contribution of this pathway to total effect"},"percentageOfTotal":{"type":["number","null"],"description":"Percentage of total effect through this pathway"},"note":{"type":["string","null"],"description":"Additional notes about the pathway"}},"required":["pathway"]}}}}
```

## The ImputeMethodEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]}}}}
```

## The InterpolateTimeMethodEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]}}}}
```

## The InterventionCountConfigSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}}}}}
```

## The InterventionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"InterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]}}}}
```

## The InterventionRobustnessScoreInlineSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]}}}}
```

## The InterventionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]}}}}
```

## The InterventionUncertaintySchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]}}}}
```

## The JoinColumnPairSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}}}}
```

## The JoinConflictResolutionEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]}}}}
```

## The JoinTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]}}}}
```

## The JsonRpcRequest object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"JsonRpcRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"method":{"type":"string"},"params":{"type":["object","null"],"additionalProperties":{}},"id":{"anyOf":[{"oneOf":[{"type":"string"},{"type":"number"}]},{"type":"null"}]}},"required":["jsonrpc","method"]}}}}
```

## The KeepEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"KeepEnum":{"type":"string","enum":["first","last"]}}}}
```

## The KeyRoleEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]}}}}
```

## The LatentClusterInfoSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LatentClusterInfoSchema":{"type":"object","properties":{"clusterId":{"type":"number"},"affectedNodes":{"type":"array","items":{"type":"string"}},"estimatedDim":{"type":"number","default":1},"dicSatisfied":{"type":"boolean","default":true},"interColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"intraColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"modelStatus":{"anyOf":[{"$ref":"#/components/schemas/LatentModelStatusEnum"},{"type":"null"}]},"modelFailureReason":{"anyOf":[{"$ref":"#/components/schemas/LatentFitFailureReasonEnum"},{"type":"null"}]},"modelFailureDetail":{"type":["string","null"]},"avgLcScore":{"type":["number","null"]},"reconstructionError":{"type":["number","null"]},"envPredictability":{"type":["number","null"]},"memberLatentShare":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"seasonalStrength":{"type":["number","null"]}},"required":["clusterId","affectedNodes"]},"LatentModelStatusEnum":{"type":"string","enum":["modelled","detectedOnly"]},"LatentFitFailureReasonEnum":{"type":"string","enum":["tooFewMembers","noNumericMembers","noExternalParents","allParentColumnsEmpty","insufficientCleanRows","fitError"]}}}}
```

## The LatentDiscoveryConfigSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LatentDiscoveryConfigSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":true},"residualCorrelationThreshold":{"type":"number","default":0.3},"ciTestAlpha":{"type":"number","default":0.05},"minClusterSize":{"type":"number","default":2},"maxLatentDim":{"type":"number","default":5}}}}}}
```

## The LatentFitFailureReasonEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LatentFitFailureReasonEnum":{"type":"string","enum":["tooFewMembers","noNumericMembers","noExternalParents","allParentColumnsEmpty","insufficientCleanRows","fitError"]}}}}
```

## The LatentModelStatusEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LatentModelStatusEnum":{"type":"string","enum":["modelled","detectedOnly"]}}}}
```

## The LeadLagEntryResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LeadLagEntryResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"lagSteps":{"type":"number"},"correlation":{"type":"number"}},"required":["source","target","lagSteps","correlation"]}}}}
```

## The LifecycleStateEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LifecycleStateEnum":{"type":"string","enum":["created","discovering","resolved","training","trained","failed","cancelled"]}}}}
```

## The LinkSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LinkSchema":{"type":"object","properties":{"sourceIds":{"type":"array","items":{"type":"string"},"minItems":1},"parentSourceId":{"type":["string","null"]}},"required":["sourceIds"]}}}}
```

## The LocationDetectionSourceEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LocationDetectionSourceEnum":{"type":"string","enum":["values","column_name","user"]}}}}
```

## The LogicalOperatorEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]}}}}
```

## The MediatorCategoricalShiftSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]}}}}
```

## The MediatorNumericShiftSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]}}}}
```

## The MediatorShiftSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]}}}}
```

## The MediatorShiftsForMetricSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]}}}}
```

## The MediatorShiftsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]}}}}
```

## The MergeInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MergeInput":{"type":"object","properties":{"sourceConceptId":{"type":"string"},"sourceConceptIds":{"type":"array","items":{"type":"string"}},"targetConceptId":{"type":"string"}},"required":["sourceConceptIds","targetConceptId"]}}}}
```

## The MetadataStatusEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MetadataStatusEnum":{"type":"string","enum":["complete","partial_skipped_expensive","in_progress"]}}}}
```

## The MetricConstraintSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}}}}}
```

## The MetricResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]}}}}
```

## The MetricScaleBasisSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MetricScaleBasisSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["intensive","extensive","unknown"],"description":"Whether the metric's level scales with the sampled table's row count"},"sampleRows":{"type":"number","description":"Rows in the sampled table the metric was computed over"},"sourceRows":{"type":["number","null"],"description":"Rows in the twin's source data; the rescale target for extensive metrics"},"rescaled":{"type":"boolean","default":false,"description":"Whether absolute values for this metric were rescaled"},"rescaledTo":{"anyOf":[{"type":"string","enum":["source_rows","single_path"]},{"type":"null"}],"description":"What an extensive metric was rescaled to: the source data's row count (static) or one simulated future path (temporal)"}},"required":["kind","sampleRows"]}}}}
```

## The MetricSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}}}}}
```

## The MultiCounterfactualExplanationSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MultiCounterfactualExplanationSchema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualExplanationSchema"},"description":"List of counterfactual results, one per input sample"}},"required":["results"]},"CounterfactualExplanationSchema":{"type":"object","properties":{"originalSample":{"type":"object","additionalProperties":{},"description":"Original sample this explanation corresponds to"},"imputedVariables":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Non-target variables the request left null, with the value the twin filled in from its own marginal before predicting and searching. originalSample already contains these fills."},"currentPrediction":{"type":"object","additionalProperties":{},"description":"Dictionary mapping each requested target variable to its predicted value in the original sample."},"requestedTargets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"The list of target conditions requested for this sample."},"counterfactuals":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualSchema"},"description":"List of counterfactual solutions found (if any)."},"searchStatus":{"$ref":"#/components/schemas/CounterfactualSearchStatusSchema","default":"searched","description":"'searched' means the solver evaluated candidates for this sample; 'failed' means the search could not run, so an empty counterfactual list is not evidence of infeasibility."},"failureReason":{"type":["string","null"],"description":"Actionable reason the search could not run for this sample. Set only when searchStatus is 'failed'."}},"required":["originalSample","currentPrediction","requestedTargets","counterfactuals"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/VariableChangeSchema"},"description":"Changes made to variables"},"predictedOutcomes":{"type":"object","additionalProperties":{},"description":"Dictionary mapping each target variable to its predicted value (decoded) under these changes."},"allTargetsMet":{"type":"boolean","description":"Indicates if all requested target conditions were met by this counterfactual."},"certainty":{"type":"number","default":0.8,"description":"Confidence or certainty measure of this counterfactual outcome (heuristic)."},"matchStatus":{"$ref":"#/components/schemas/CounterfactualMatchStatusSchema","default":"exact","description":"Why this counterfactual was kept: exact match, within configured tolerance, or closest non-matching fallback."},"targetDistances":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-target signed distance (predicted - target) for numeric targets, for UI display."}},"required":["changes","predictedOutcomes","allTargetsMet"]},"VariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to change"},"fromValue":{"description":"Original value"},"toValue":{"description":"New value"},"importance":{"type":"number","description":"Importance of the change"}},"required":["variable","importance"]},"CounterfactualMatchStatusSchema":{"type":"string","enum":["exact","withinTolerance","closest"]},"CounterfactualSearchStatusSchema":{"type":"string","enum":["searched","failed"]}}}}
```

## The MultiCounterfactualRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]}}}}
```

## The MultiMatchStrategyEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]}}}}
```

## The NanFillStrategyEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NanFillStrategyEnum":{"type":"string","enum":["forward","interpolate","zero","drop","undefined"]}}}}
```

## The NewColumnDefinitionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]}}}}
```

## The NodeChangeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NodeChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"node":{"$ref":"#/components/schemas/CausalNodeSchema"},"oldNode":{"anyOf":[{"$ref":"#/components/schemas/CausalNodeSchema"},{"type":"null"}]}},"required":["type","node"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]},"CausalNodeSchema":{"type":"object","properties":{"name":{"type":"string"},"nodeType":{"$ref":"#/components/schemas/NodeTypeEnum","default":"observed"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latentClusterId":{"type":["number","null"]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"isDerived":{"type":"boolean","default":false},"symbolicEquation":{"anyOf":[{"$ref":"#/components/schemas/SymbolicEquationSchema"},{"type":"null"}]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"},{"type":"null"}]},"parentImpacts":{"anyOf":[{"$ref":"#/components/schemas/NodeParentImpactsSchema"},{"type":"null"}],"description":"Model-based driver contribution shares computed after training"}},"required":["name","type"]},"NodeTypeEnum":{"type":"string","enum":["observed","latent","latent_inter","latent_intra","environment"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SymbolicEquationSchema":{"type":"object","properties":{"expression":{"type":"string"},"r2":{"type":"number"},"noisePercentage":{"type":"number"},"termBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicTermSchema"}},"complexity":{"type":"number"},"explanationType":{"type":"string","enum":["regression","classification_rules","conditional_probability"],"default":"regression"},"epsilonSigma":{"type":["number","null"]},"epsilonSigmaRelative":{"type":["number","null"]},"expressionWithNoise":{"type":["string","null"]},"discoveryMethod":{"type":["string","null"]},"parentContributions":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicParentContributionSchema"}},"unexplainedPct":{"type":["number","null"]},"directionReferenceClass":{"type":["string","null"]},"alternatives":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SymbolicEquationAlternativeSchema"}},{"type":"null"}],"description":"Pareto-front alternatives to the chosen equation (balanced / fewer terms / better fit); absent until discovery emits them"}},"required":["expression","r2","noisePercentage","termBreakdown","complexity"]},"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]},"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]},"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]},"DtDerivedColumnInfoSchema":{"type":"object","properties":{"derivedType":{"type":"string"},"targetColumn":{"type":"string"},"sourceColumns":{"type":"array","items":{"type":"string"}},"expression":{"type":"string"},"r2":{"type":["number","null"]},"isDeterministic":{"type":"boolean"},"implausibilityReason":{"type":["string","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"seasonalTerms":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalTermSchema"}},{"type":"null"}]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]}},"required":["derivedType","targetColumn","sourceColumns","expression","isDeterministic"]},"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]}}}}
```

## The NodeConditionStatusResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NodeConditionStatusResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"currentZ":{"type":"number"},"ewmaZ":{"type":"number"},"trendSlope":{"type":"number"},"cusum":{"type":"number"},"stepsElevated":{"type":"number"},"isRootNode":{"type":"boolean"},"graphDepth":{"type":"number"},"confidence":{"type":"number"},"causalDepth":{"type":"number","default":0},"variableThreshold":{"type":["number","null"]},"marginalZScore":{"type":"number","default":0},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"recovered":{"type":"boolean","default":false}},"required":["variable","alertType","currentZ","ewmaZ","trendSlope","cusum","stepsElevated","isRootNode","graphDepth","confidence"]},"AlertTypeEnum":{"type":"string","enum":["spike","worsening","improving","sustained","normal"]}}}}
```

## The NodeMetricsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NodeMetricsSchema":{"type":"object","properties":{"accuracy":{"type":["number","null"],"description":"Classification accuracy"},"accuracyPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Classification accuracy per class"},"weightedAccuracy":{"type":["number","null"],"description":"Weighted classification accuracy"},"falsePositiveRate":{"type":["number","null"],"description":"False positive rate"},"falseNegativeRate":{"type":["number","null"],"description":"False negative rate"},"truePositiveRate":{"type":["number","null"],"description":"True positive rate"},"trueNegativeRate":{"type":["number","null"],"description":"True negative rate"},"precision":{"type":["number","null"],"description":"Precision, macro-averaged across classes"},"recall":{"type":["number","null"],"description":"Recall, macro-averaged across classes"},"f1Score":{"type":["number","null"],"description":"F1 score, macro-averaged across classes"},"precisionPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Precision per class"},"recallPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Recall per class"},"f1ScorePerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"F1 score per class"},"positiveClassLabel":{"type":["string","null"],"description":"Decoded label of encoded class 1, the anchor for TPR/FPR/TNR/FNR"},"mse":{"type":["number","null"],"description":"Mean squared error"},"r2":{"type":["number","null"],"description":"R-squared"},"logLikelihood":{"type":["number","null"],"description":"Log-likelihood"},"auc":{"type":["number","null"],"description":"Area under ROC curve"},"brierScore":{"type":["number","null"],"description":"Brier score"},"mae":{"type":["number","null"],"description":"Mean absolute error"},"mape":{"anyOf":[{"type":"object","additionalProperties":{"type":["number","null"]}},{"type":"null"}],"description":"Mean absolute percentage error per horizon"}}}}}}
```

## The NodeParentImpactsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]}}}}
```

## The NodeSurpriseResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]}}}}
```

## The NodeTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NodeTypeEnum":{"type":"string","enum":["observed","latent","latent_inter","latent_intra","environment"]}}}}
```

## The NormalizeNumericMethodEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]}}}}
```

## The objectiveUnitReadSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]}}}}
```

## The OntologyConceptEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyConceptEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/OntologyConcept"}},"required":["data"]},"OntologyConcept":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"conceptClassification":{"anyOf":[{"$ref":"#/components/schemas/ConceptClassificationEnum"},{"type":"null"}]},"anchorConceptLinks":{"type":"array","items":{"type":"string"},"default":[]},"schemaFieldName":{"type":"string"},"schemaType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"schemaSubtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"metadata":{"$ref":"#/components/schemas/ConceptMetadataSchema"},"lockedMetadataFields":{"type":"array","items":{"type":"string"}},"detectedMetadata":{"anyOf":[{"$ref":"#/components/schemas/ConceptMetadataSchema"},{"type":"null"}]},"fieldMappings":{"type":"array","items":{"type":"object","properties":{"sourceId":{"type":"string"},"field":{"type":"string"},"status":{"$ref":"#/components/schemas/BindingStatusEnum","default":"confirmed"},"source":{"$ref":"#/components/schemas/BindingSourceEnum","default":"ingest"},"confidence":{"type":["number","null"]},"evidence":{"type":["string","null"]},"valueMap":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}},{"allOf":[{},{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}}]}]},{"type":"null"}]},"canonicalField":{"type":["string","null"]},"scopeFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"precedence":{"type":["number","null"]},"keyRole":{"anyOf":[{"$ref":"#/components/schemas/KeyRoleEnum"},{"type":"null"}]},"conformance":{"anyOf":[{"$ref":"#/components/schemas/ConformanceReportSchema"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]}},"required":["sourceId","field"]}},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DerivedConceptInfoSchema"},{"type":"null"}]},"conceptKind":{"$ref":"#/components/schemas/ConceptKindEnum","default":"standard"},"metricSql":{"type":["string","null"]},"relationshipRules":{"type":"array","items":{"$ref":"#/components/schemas/RelationshipRuleSchema"},"default":[]},"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]},"trustTier":{"anyOf":[{"type":"string","enum":["exploratory","curated_pending","curated"]},{"type":"null"}]},"ontologyRef":{"anyOf":[{"type":"object","properties":{"ontologyId":{"type":"string"},"ontologyVersion":{"type":"string"},"canonicalId":{"type":"string"},"installScope":{"anyOf":[{"type":"object","properties":{"conceptCanonicalIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"filters":{"type":"array","items":{"type":"object","properties":{"conceptRef":{"type":"string"},"values":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]}},"required":["conceptRef"]},"default":[]}}},{"type":"null"}]}},"required":["ontologyId","ontologyVersion","canonicalId"]},{"type":"null"}]},"layerIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"},"default":[]},"valueMappings":{"type":"array","items":{"$ref":"#/components/schemas/ConceptValueMappingSchema"},"default":[]},"lockedConceptFields":{"type":"array","items":{"type":"string"}},"detectedConceptStructure":{"anyOf":[{"$ref":"#/components/schemas/DetectedConceptStructureSchema"},{"type":"null"}]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]},"lineageDrift":{"type":["boolean","null"]},"editVersion":{"type":"integer","minimum":0,"default":0},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organisationId","workspaceId","name","schemaFieldName","schemaType","metadata","fieldMappings"]},"ConceptClassificationEnum":{"type":"string","enum":["identifier","location","time"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"ConceptMetadataSchema":{"type":"object","properties":{"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]},"isUnique":{"type":["boolean","null"]},"isCyclic":{"type":["boolean","null"]},"isHeterogeneousIdentifier":{"type":["boolean","null"]},"compositeScopeConceptId":{"type":["string","null"]},"isUniformDistribution":{"type":["boolean","null"]},"locationType":{"anyOf":[{"$ref":"#/components/schemas/AnchorLocationTypeEnum"},{"type":"null"}]},"coordinateFormat":{"anyOf":[{"$ref":"#/components/schemas/CoordinateFormatEnum"},{"type":"null"}]},"coordinateDatum":{"anyOf":[{"$ref":"#/components/schemas/CoordinateDatumEnum"},{"type":"null"}]},"coordinatePairConceptId":{"type":["string","null"]},"locationDetectionSource":{"anyOf":[{"$ref":"#/components/schemas/LocationDetectionSourceEnum"},{"type":"null"}]},"latitudeInRangeFraction":{"type":["number","null"]},"longitudeInRangeFraction":{"type":["number","null"]},"fractionalPartFraction":{"type":["number","null"]},"coordinatePairFraction":{"type":["number","null"]},"dmsCoordinateFraction":{"type":["number","null"]},"postalCodeFraction":{"type":["number","null"]},"addressShapeFraction":{"type":["number","null"]},"enrichments":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EnrichmentRecordSchema"}},{"type":"null"}]},"geoEnrichmentStatus":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"geoEnrichmentKind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"geoEnrichedAt":{"type":["string","null"]},"geoEnrichmentVersion":{"type":["number","null"]},"geoSidecarKey":{"type":["string","null"]},"geoDistinctTotal":{"type":["number","null"]},"geoMatchedCount":{"type":["number","null"]},"geoUnmatchedCount":{"type":["number","null"]},"geoTruncated":{"type":["boolean","null"]},"geoEnrichmentError":{"type":["string","null"]},"nanFillStrategy":{"anyOf":[{"$ref":"#/components/schemas/NanFillStrategyEnum"},{"type":"null"}]},"changeRate":{"type":["number","null"]},"dateTimeFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"averageInterval":{"type":["number","null"]},"isConsistentInterval":{"type":["boolean","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"higherIsBetter":{"type":["boolean","null"]},"isEqualInterval":{"type":["boolean","null"]},"intervalSize":{"type":["number","null"]},"valueClass":{"anyOf":[{"$ref":"#/components/schemas/ValueClassEnum"},{"type":"null"}]},"fracZero":{"type":["number","null"]},"zeroRunLengthP95":{"type":["number","null"]},"nonZeroRunLengthP95":{"type":["number","null"]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"emailFraction":{"type":["number","null"]},"medianLength":{"type":["number","null"]},"distinctLengthCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"tsGranularity":{"type":["string","null"]},"tsValidGranularities":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tsTypicalDeltaSeconds":{"type":["number","null"]},"tsSelectedGrid":{"type":["string","null"]},"tsGapProfile":{"anyOf":[{"$ref":"#/components/schemas/GapProfileSchema"},{"type":"null"}]},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsPerEnvProfiles":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesEnvProfileSchema"}},{"type":"null"}]},"tsAnalyzerVersion":{"type":["string","null"]},"tsAnalyzedAt":{"type":["string","null"]},"elementSchemaType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"elementCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sizeStatistics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"additionalProperties":true},"AnchorLocationTypeEnum":{"type":"string","enum":["latitude","longitude","coordinate","country","region","city","postal_code","address","continent","airport_code","unlocode"]},"CoordinateFormatEnum":{"type":"string","enum":["dd","dms","ddm"]},"CoordinateDatumEnum":{"type":"string","enum":["wgs84","gcj02","bd09"]},"LocationDetectionSourceEnum":{"type":"string","enum":["values","column_name","user"]},"EnrichmentRecordSchema":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"enrichedAt":{"type":["string","null"]},"enricherVersion":{"type":["string","null"]},"dataVersion":{"type":["string","null"]},"version":{"type":["number","null"]},"sidecarKey":{"type":["string","null"]},"keyFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"hintFields":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"corroborationFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latLonPrecision":{"type":["number","null"]},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]},"truncated":{"type":["boolean","null"]},"error":{"type":["string","null"]},"appliedDatum":{"type":["string","null"]}}},"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]},"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]},"NanFillStrategyEnum":{"type":"string","enum":["forward","interpolate","zero","drop","undefined"]},"ValueClassEnum":{"type":"string","enum":["continuous","sparse_event","bursty","binary_indicator"]},"GapProfileSchema":{"type":"object","properties":{"expectedIntervalSeconds":{"type":["number","null"]},"p50GapSeconds":{"type":["number","null"]},"p95GapSeconds":{"type":["number","null"]},"p99GapSeconds":{"type":["number","null"]},"maxGapSeconds":{"type":["number","null"]},"gapCount":{"type":["number","null"]},"largestGapStart":{"type":["string","null"]}}},"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]},"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]},"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]},"TimeSeriesEnvProfileSchema":{"type":"object","properties":{"envKey":{"type":"string"},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"tsTypicalDeltaSeconds":{"type":["number","null"]}},"required":["envKey"]},"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]},"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]},"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]},"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]},"DerivedConceptInfoSchema":{"type":"object","properties":{"formula":{"type":["string","null"]},"formulaBlocks":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]},"derivedType":{"$ref":"#/components/schemas/DerivedTypeEnum","default":"manual"},"kind":{"anyOf":[{"$ref":"#/components/schemas/DerivedInfoKindEnum"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/DerivedSourceEnum"},{"type":"null"}]},"sourceColumns":{"type":"array","items":{"type":"string"},"default":[]},"expression":{"type":["string","null"]},"r2":{"type":["number","null"]},"isDeterministic":{"type":["boolean","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"sourceDataViewId":{"type":["string","null"]},"operationLineage":{"anyOf":[{"$ref":"#/components/schemas/OperationLineageSchema"},{"type":"null"}]},"viewSnapshot":{"anyOf":[{"$ref":"#/components/schemas/ViewSnapshotSchema"},{"type":"null"}]},"lineageHash":{"type":["string","null"]},"sourceJoinConfig":{"anyOf":[{"$ref":"#/components/schemas/SourceJoinConfigSchema"},{"type":"null"}]}}},"DerivedTypeEnum":{"type":"string","enum":["manual","datetime_component","lag","cumulative","step_change","algebraic_identity","complement","ratio","view_operation"]},"DerivedInfoKindEnum":{"type":"string","enum":["op","formula","detected","join"]},"DerivedSourceEnum":{"type":"string","enum":["user","detected","discovered"]},"OperationLineageSchema":{"type":"object","properties":{"opType":{"$ref":"#/components/schemas/OperationTypeEnum"},"opId":{"type":"string"},"parentColumns":{"type":"array","items":{"type":"string"},"default":[]},"parentConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["opType","opId"]},"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]},"ViewSnapshotSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"outputColumn":{"type":"string"}},"required":["sources","operations","outputColumn"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"SourceJoinConfigSchema":{"type":"object","properties":{"joinType":{"type":"string","enum":["left","inner"],"default":"left"},"strategy":{"type":["string","null"]}}},"ConceptKindEnum":{"type":"string","enum":["standard","derived","metric"]},"RelationshipRuleSchema":{"type":"object","properties":{"ruleType":{"$ref":"#/components/schemas/RelationshipRuleTypeEnum"},"sourceVariable":{"type":"string"},"condition":{"anyOf":[{"$ref":"#/components/schemas/ConditionSchema"},{"type":"null"}]},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"confidence":{"type":"number","default":1},"support":{"type":"number","default":0},"strength":{"anyOf":[{"$ref":"#/components/schemas/RuleStrengthEnum"},{"type":"null"}]},"violationRate":{"type":["number","null"]},"source":{"type":["string","null"]},"cycle":{"type":["string","null"]}},"required":["ruleType","sourceVariable"]},"RelationshipRuleTypeEnum":{"type":"string","enum":["conditional_values","range","set","cyclic_active_window","cyclic_missing"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"RuleStrengthEnum":{"type":"string","enum":["hard","soft"]},"SuggestedRoleEnum":{"type":"string","enum":["source","target"]},"ConceptValueMappingSchema":{"type":"object","properties":{"canonicalValue":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"},"default":[]}},"required":["canonicalValue"]},"DetectedConceptStructureSchema":{"type":"object","properties":{"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]}}}}}}
```

## The OntologyConceptListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyConceptListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OntologyConcept"}},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]},"OntologyConcept":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"conceptClassification":{"anyOf":[{"$ref":"#/components/schemas/ConceptClassificationEnum"},{"type":"null"}]},"anchorConceptLinks":{"type":"array","items":{"type":"string"},"default":[]},"schemaFieldName":{"type":"string"},"schemaType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"schemaSubtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"metadata":{"$ref":"#/components/schemas/ConceptMetadataSchema"},"lockedMetadataFields":{"type":"array","items":{"type":"string"}},"detectedMetadata":{"anyOf":[{"$ref":"#/components/schemas/ConceptMetadataSchema"},{"type":"null"}]},"fieldMappings":{"type":"array","items":{"type":"object","properties":{"sourceId":{"type":"string"},"field":{"type":"string"},"status":{"$ref":"#/components/schemas/BindingStatusEnum","default":"confirmed"},"source":{"$ref":"#/components/schemas/BindingSourceEnum","default":"ingest"},"confidence":{"type":["number","null"]},"evidence":{"type":["string","null"]},"valueMap":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}},{"allOf":[{},{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}}]}]},{"type":"null"}]},"canonicalField":{"type":["string","null"]},"scopeFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"precedence":{"type":["number","null"]},"keyRole":{"anyOf":[{"$ref":"#/components/schemas/KeyRoleEnum"},{"type":"null"}]},"conformance":{"anyOf":[{"$ref":"#/components/schemas/ConformanceReportSchema"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]}},"required":["sourceId","field"]}},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DerivedConceptInfoSchema"},{"type":"null"}]},"conceptKind":{"$ref":"#/components/schemas/ConceptKindEnum","default":"standard"},"metricSql":{"type":["string","null"]},"relationshipRules":{"type":"array","items":{"$ref":"#/components/schemas/RelationshipRuleSchema"},"default":[]},"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]},"trustTier":{"anyOf":[{"type":"string","enum":["exploratory","curated_pending","curated"]},{"type":"null"}]},"ontologyRef":{"anyOf":[{"type":"object","properties":{"ontologyId":{"type":"string"},"ontologyVersion":{"type":"string"},"canonicalId":{"type":"string"},"installScope":{"anyOf":[{"type":"object","properties":{"conceptCanonicalIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"filters":{"type":"array","items":{"type":"object","properties":{"conceptRef":{"type":"string"},"values":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]}},"required":["conceptRef"]},"default":[]}}},{"type":"null"}]}},"required":["ontologyId","ontologyVersion","canonicalId"]},{"type":"null"}]},"layerIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"},"default":[]},"valueMappings":{"type":"array","items":{"$ref":"#/components/schemas/ConceptValueMappingSchema"},"default":[]},"lockedConceptFields":{"type":"array","items":{"type":"string"}},"detectedConceptStructure":{"anyOf":[{"$ref":"#/components/schemas/DetectedConceptStructureSchema"},{"type":"null"}]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]},"lineageDrift":{"type":["boolean","null"]},"editVersion":{"type":"integer","minimum":0,"default":0},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organisationId","workspaceId","name","schemaFieldName","schemaType","metadata","fieldMappings"]},"ConceptClassificationEnum":{"type":"string","enum":["identifier","location","time"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"ConceptMetadataSchema":{"type":"object","properties":{"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]},"isUnique":{"type":["boolean","null"]},"isCyclic":{"type":["boolean","null"]},"isHeterogeneousIdentifier":{"type":["boolean","null"]},"compositeScopeConceptId":{"type":["string","null"]},"isUniformDistribution":{"type":["boolean","null"]},"locationType":{"anyOf":[{"$ref":"#/components/schemas/AnchorLocationTypeEnum"},{"type":"null"}]},"coordinateFormat":{"anyOf":[{"$ref":"#/components/schemas/CoordinateFormatEnum"},{"type":"null"}]},"coordinateDatum":{"anyOf":[{"$ref":"#/components/schemas/CoordinateDatumEnum"},{"type":"null"}]},"coordinatePairConceptId":{"type":["string","null"]},"locationDetectionSource":{"anyOf":[{"$ref":"#/components/schemas/LocationDetectionSourceEnum"},{"type":"null"}]},"latitudeInRangeFraction":{"type":["number","null"]},"longitudeInRangeFraction":{"type":["number","null"]},"fractionalPartFraction":{"type":["number","null"]},"coordinatePairFraction":{"type":["number","null"]},"dmsCoordinateFraction":{"type":["number","null"]},"postalCodeFraction":{"type":["number","null"]},"addressShapeFraction":{"type":["number","null"]},"enrichments":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EnrichmentRecordSchema"}},{"type":"null"}]},"geoEnrichmentStatus":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"geoEnrichmentKind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"geoEnrichedAt":{"type":["string","null"]},"geoEnrichmentVersion":{"type":["number","null"]},"geoSidecarKey":{"type":["string","null"]},"geoDistinctTotal":{"type":["number","null"]},"geoMatchedCount":{"type":["number","null"]},"geoUnmatchedCount":{"type":["number","null"]},"geoTruncated":{"type":["boolean","null"]},"geoEnrichmentError":{"type":["string","null"]},"nanFillStrategy":{"anyOf":[{"$ref":"#/components/schemas/NanFillStrategyEnum"},{"type":"null"}]},"changeRate":{"type":["number","null"]},"dateTimeFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"averageInterval":{"type":["number","null"]},"isConsistentInterval":{"type":["boolean","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"higherIsBetter":{"type":["boolean","null"]},"isEqualInterval":{"type":["boolean","null"]},"intervalSize":{"type":["number","null"]},"valueClass":{"anyOf":[{"$ref":"#/components/schemas/ValueClassEnum"},{"type":"null"}]},"fracZero":{"type":["number","null"]},"zeroRunLengthP95":{"type":["number","null"]},"nonZeroRunLengthP95":{"type":["number","null"]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"emailFraction":{"type":["number","null"]},"medianLength":{"type":["number","null"]},"distinctLengthCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"tsGranularity":{"type":["string","null"]},"tsValidGranularities":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tsTypicalDeltaSeconds":{"type":["number","null"]},"tsSelectedGrid":{"type":["string","null"]},"tsGapProfile":{"anyOf":[{"$ref":"#/components/schemas/GapProfileSchema"},{"type":"null"}]},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsPerEnvProfiles":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesEnvProfileSchema"}},{"type":"null"}]},"tsAnalyzerVersion":{"type":["string","null"]},"tsAnalyzedAt":{"type":["string","null"]},"elementSchemaType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"elementCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sizeStatistics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"additionalProperties":true},"AnchorLocationTypeEnum":{"type":"string","enum":["latitude","longitude","coordinate","country","region","city","postal_code","address","continent","airport_code","unlocode"]},"CoordinateFormatEnum":{"type":"string","enum":["dd","dms","ddm"]},"CoordinateDatumEnum":{"type":"string","enum":["wgs84","gcj02","bd09"]},"LocationDetectionSourceEnum":{"type":"string","enum":["values","column_name","user"]},"EnrichmentRecordSchema":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"enrichedAt":{"type":["string","null"]},"enricherVersion":{"type":["string","null"]},"dataVersion":{"type":["string","null"]},"version":{"type":["number","null"]},"sidecarKey":{"type":["string","null"]},"keyFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"hintFields":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"corroborationFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latLonPrecision":{"type":["number","null"]},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]},"truncated":{"type":["boolean","null"]},"error":{"type":["string","null"]},"appliedDatum":{"type":["string","null"]}}},"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]},"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]},"NanFillStrategyEnum":{"type":"string","enum":["forward","interpolate","zero","drop","undefined"]},"ValueClassEnum":{"type":"string","enum":["continuous","sparse_event","bursty","binary_indicator"]},"GapProfileSchema":{"type":"object","properties":{"expectedIntervalSeconds":{"type":["number","null"]},"p50GapSeconds":{"type":["number","null"]},"p95GapSeconds":{"type":["number","null"]},"p99GapSeconds":{"type":["number","null"]},"maxGapSeconds":{"type":["number","null"]},"gapCount":{"type":["number","null"]},"largestGapStart":{"type":["string","null"]}}},"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]},"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]},"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]},"TimeSeriesEnvProfileSchema":{"type":"object","properties":{"envKey":{"type":"string"},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"tsTypicalDeltaSeconds":{"type":["number","null"]}},"required":["envKey"]},"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]},"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]},"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]},"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]},"DerivedConceptInfoSchema":{"type":"object","properties":{"formula":{"type":["string","null"]},"formulaBlocks":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]},"derivedType":{"$ref":"#/components/schemas/DerivedTypeEnum","default":"manual"},"kind":{"anyOf":[{"$ref":"#/components/schemas/DerivedInfoKindEnum"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/DerivedSourceEnum"},{"type":"null"}]},"sourceColumns":{"type":"array","items":{"type":"string"},"default":[]},"expression":{"type":["string","null"]},"r2":{"type":["number","null"]},"isDeterministic":{"type":["boolean","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"sourceDataViewId":{"type":["string","null"]},"operationLineage":{"anyOf":[{"$ref":"#/components/schemas/OperationLineageSchema"},{"type":"null"}]},"viewSnapshot":{"anyOf":[{"$ref":"#/components/schemas/ViewSnapshotSchema"},{"type":"null"}]},"lineageHash":{"type":["string","null"]},"sourceJoinConfig":{"anyOf":[{"$ref":"#/components/schemas/SourceJoinConfigSchema"},{"type":"null"}]}}},"DerivedTypeEnum":{"type":"string","enum":["manual","datetime_component","lag","cumulative","step_change","algebraic_identity","complement","ratio","view_operation"]},"DerivedInfoKindEnum":{"type":"string","enum":["op","formula","detected","join"]},"DerivedSourceEnum":{"type":"string","enum":["user","detected","discovered"]},"OperationLineageSchema":{"type":"object","properties":{"opType":{"$ref":"#/components/schemas/OperationTypeEnum"},"opId":{"type":"string"},"parentColumns":{"type":"array","items":{"type":"string"},"default":[]},"parentConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["opType","opId"]},"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]},"ViewSnapshotSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"outputColumn":{"type":"string"}},"required":["sources","operations","outputColumn"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"SourceJoinConfigSchema":{"type":"object","properties":{"joinType":{"type":"string","enum":["left","inner"],"default":"left"},"strategy":{"type":["string","null"]}}},"ConceptKindEnum":{"type":"string","enum":["standard","derived","metric"]},"RelationshipRuleSchema":{"type":"object","properties":{"ruleType":{"$ref":"#/components/schemas/RelationshipRuleTypeEnum"},"sourceVariable":{"type":"string"},"condition":{"anyOf":[{"$ref":"#/components/schemas/ConditionSchema"},{"type":"null"}]},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"confidence":{"type":"number","default":1},"support":{"type":"number","default":0},"strength":{"anyOf":[{"$ref":"#/components/schemas/RuleStrengthEnum"},{"type":"null"}]},"violationRate":{"type":["number","null"]},"source":{"type":["string","null"]},"cycle":{"type":["string","null"]}},"required":["ruleType","sourceVariable"]},"RelationshipRuleTypeEnum":{"type":"string","enum":["conditional_values","range","set","cyclic_active_window","cyclic_missing"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"RuleStrengthEnum":{"type":"string","enum":["hard","soft"]},"SuggestedRoleEnum":{"type":"string","enum":["source","target"]},"ConceptValueMappingSchema":{"type":"object","properties":{"canonicalValue":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"},"default":[]}},"required":["canonicalValue"]},"DetectedConceptStructureSchema":{"type":"object","properties":{"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]}}}}}}
```

## The OntologyModeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyModeEnum":{"type":"string","enum":["auto","manual"]}}}}
```

## The OntologyQueryInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyQueryInput":{"type":"object","properties":{"anchorSql":{"type":"string","minLength":1,"description":"Anchor SQL statement over ontology concepts. Reference concepts by name — the ontology plans the joins, time alignment and location matching; most queries need no FROM clause (scope explicitly with FROM source:\"name\", dataset:\"name\" or tag:\"name\" when needed). SHOW/DESCRIBE metadata commands are also accepted. Workspace and organisation ids are injected from the auth context."},"limit":{"type":"integer","minimum":1,"maximum":10000,"description":"Rows per page (default 1000). Page through the full result with startKey; an Anchor SQL LIMIT still caps the statement itself."},"startKey":{"type":"integer","minimum":0,"description":"Resume paging from a rows response's nextStartKey"},"validateOnly":{"type":"boolean","description":"Compile and plan without executing; the response is the validated arm carrying the plan and warnings"},"projectionMode":{"type":"string","enum":["related","minimal"],"description":"related adds ontology-linked context columns; minimal returns only the selected concepts and their anchors"}},"required":["anchorSql"]}}}}
```

## The OntologyStatusEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyStatusEnum":{"type":"string","enum":["pending","extracting","consolidation_queued","consolidating","detecting_derived","analyzing_dependencies","profiling_time_series","completed","extraction_failed","consolidation_failed","derived_detection_failed","relationship_detection_failed","cross_relationship_detection_failed","dependency_analysis_failed","time_series_profiling_failed","cancelled","manual_pending"]}}}}
```

## The OntologyValueMapEntriesSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyValueMapEntriesSchema":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}}}}}
```

## The OntologyValueMapSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyValueMapSchema":{"anyOf":[{"$ref":"#/components/schemas/OntologyValueMapEntriesSchema"},{"$ref":"#/components/schemas/OntologyValueMapEntriesSchema"}]},"OntologyValueMapEntriesSchema":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}}}}}
```

## The OperationConfigSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]}}}}
```

## The OperationLineageSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OperationLineageSchema":{"type":"object","properties":{"opType":{"$ref":"#/components/schemas/OperationTypeEnum"},"opId":{"type":"string"},"parentColumns":{"type":"array","items":{"type":"string"},"default":[]},"parentConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["opType","opId"]},"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]}}}}
```

## The OperationSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]}}}}
```

## The OperationTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]}}}}
```

## The OptimisationObjectiveSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}}}}}
```

## The OptimisationScenarioSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}}}}}
```

## The OptimisationTargetSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}}}}}
```

## The OptimizationResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OptimizationResultSchema":{"type":"object","properties":{"paretoFront":{"type":"array","items":{"$ref":"#/components/schemas/ParetoDominantSolutionSchema"},"description":"Pareto-optimal solutions"},"optimizationTrace":{"type":"array","items":{"$ref":"#/components/schemas/OptimizationTraceSchema"},"description":"Record of optimization progress"},"baselineMetrics":{"type":"object","additionalProperties":{"type":"number"},"description":"Baseline metrics for objectives"},"constraintBaselineMetrics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Baseline metrics for constraint metrics"},"balancedSolution":{"anyOf":[{"$ref":"#/components/schemas/ParetoDominantSolutionSchema"},{"type":"null"}],"description":"Balanced solution closest to ideal point (for multi-objective)"},"bestPerObjective":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ParetoDominantSolutionSchema"}},{"type":"null"}],"description":"Best solution for each individual objective"},"allConstraintsSatisfiable":{"type":"boolean","default":true,"description":"Whether any solution satisfying all constraints was found"},"executionTime":{"type":"number","default":0,"description":"Execution time in seconds"},"metricScaleBases":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MetricScaleBasisSchema"}},{"type":"null"}],"description":"Per-metric scale basis: intensive metrics read directly from the simulation, extensive ones are rescaled to the source data's row count"}},"required":["paretoFront","optimizationTrace","baselineMetrics"]},"ParetoDominantSolutionSchema":{"type":"object","properties":{"interventions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Interventions in this solution"},"interventionCount":{"type":"number","default":0,"description":"Number of interventions in this solution"},"objectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Values of the objectives"},"implementationDifficulty":{"type":["number","null"],"description":"Difficulty of implementing this solution"},"expectedOutcomes":{"type":"object","additionalProperties":{},"description":"Expected outcomes of the solution"},"uncertainty":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Uncertainty in objective values"},"improvementOverBaseline":{"type":"object","additionalProperties":{"type":"number"},"description":"Improvements over baseline"},"constraintsSatisfied":{"type":"boolean","default":true,"description":"Whether all constraints were satisfied by this solution"},"constraintViolations":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Descriptions of constraint violations if any"},"targetsAchieved":{"anyOf":[{"type":"object","additionalProperties":{"type":"boolean"}},{"type":"null"}],"description":"Whether each objective's target was achieved"},"segmentResults":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Per-segment objective values: {segment_id: {objective_name: value}}"},"segmentSampleSizes":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-segment sample sizes: {segment_id: sample_count}"},"segmentInterventions":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Segment-specific interventions with conditions"},"totalSampleCount":{"type":["number","null"]},"affectedSampleCount":{"type":["number","null"]},"affectedPercentage":{"type":["number","null"]},"appliedInterventions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"}},{"type":"null"}],"description":"The exact intervention rows the evaluator ran for this plan, after scoping and relative-mode conversion"},"interventionResult":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"$ref":"#/components/schemas/InterventionResultSchema"}]},{"type":"null"}],"description":"The plan re-run as an intervention scenario; null on older runs, panel temporal runs, and when the plan's run failed"}},"required":["interventions","objectiveValues","expectedOutcomes","uncertainty","improvementOverBaseline"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"InterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"OptimizationTraceSchema":{"type":"object","properties":{"iteration":{"type":"number","description":"Iteration number"},"bestObjectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Best objective values found"},"populationDiversity":{"type":"number","description":"Diversity of the population"}},"required":["iteration","bestObjectiveValues","populationDiversity"]},"MetricScaleBasisSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["intensive","extensive","unknown"],"description":"Whether the metric's level scales with the sampled table's row count"},"sampleRows":{"type":"number","description":"Rows in the sampled table the metric was computed over"},"sourceRows":{"type":["number","null"],"description":"Rows in the twin's source data; the rescale target for extensive metrics"},"rescaled":{"type":"boolean","default":false,"description":"Whether absolute values for this metric were rescaled"},"rescaledTo":{"anyOf":[{"type":"string","enum":["source_rows","single_path"]},{"type":"null"}],"description":"What an extensive metric was rescaled to: the source data's row count (static) or one simulated future path (temporal)"}},"required":["kind","sampleRows"]}}}}
```

## The OptimizationTraceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OptimizationTraceSchema":{"type":"object","properties":{"iteration":{"type":"number","description":"Iteration number"},"bestObjectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Best objective values found"},"populationDiversity":{"type":"number","description":"Diversity of the population"}},"required":["iteration","bestObjectiveValues","populationDiversity"]}}}}
```

## The OrgSourceEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OrgSourceEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"parentSourceId":{"type":["string","null"]},"dataSource":{"anyOf":[{"$ref":"#/components/schemas/DataSourceTypeEnum"},{"type":"null"}]},"dataFormat":{"$ref":"#/components/schemas/datasetFormatsEnum"},"description":{"type":["string","null"]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}},"richDescription":{"anyOf":[{"$ref":"#/components/schemas/RichDescriptionSchema"},{"type":"null"}]},"schemaEntries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"importWarnings":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ontologyMode":{"$ref":"#/components/schemas/OntologyModeEnum","default":"auto"},"documentCount":{"type":["number","null"]},"columnMetadata":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnMetadataSchema"}},{"type":"null"}]},"extension":{"type":["string","null"]},"totalSize":{"type":["number","null"]},"createdAt":{"type":["string","null"]},"lastSaved":{"type":["string","null"]},"virtual":{"type":["boolean","null"]},"ontologyStatus":{"anyOf":[{"$ref":"#/components/schemas/OntologyStatusEnum"},{"type":"null"}]},"ontologyError":{"type":["string","null"]},"extractionStatus":{"anyOf":[{"$ref":"#/components/schemas/ExtractionStatusEnum"},{"type":"null"}]},"extractionError":{"type":["string","null"]},"pageCount":{"type":["number","null"]},"derivedFromDatasetIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"derivedVia":{"anyOf":[{"$ref":"#/components/schemas/DerivedViaEnum"},{"type":"null"}]},"extractionRecipe":{"anyOf":[{"$ref":"#/components/schemas/ExtractionRecipeSchema"},{"type":"null"}]},"pendingAnnotationCount":{"type":["number","null"]},"ontologyExcludedFields":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string","enum":["auto","user","suggestion"]}},"required":["field","reason","source"]}},{"type":"null"}]},"batchRanges":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"fileName":{"type":"string"},"uploadedAt":{"type":"string"},"rowStart":{"type":"number"},"rowEnd":{"type":"number"}},"required":["hash","fileName","uploadedAt","rowStart","rowEnd"]}},{"type":"null"}]},"currentVersionId":{"type":["string","null"]},"latestVersionOrdinal":{"type":["number","null"]},"staging":{"type":["boolean","null"]},"readMode":{"type":"string","enum":["direct_query","snapshot"],"description":"How this source is read. direct_query runs every read against the origin database — live, but subject to its statement timeout, and no row count is recorded; snapshot reads a stored copy, which changes only when it is synced"},"directQuery":{"anyOf":[{"$ref":"#/components/schemas/directQuerySettingsSchema"},{"type":"null"}],"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"},"linkedWorkspaceIds":{"type":"array","items":{"type":"string"},"description":"Workspaces this source is linked into"}},"required":["id","organisationId","name","dataFormat","readMode","directQuery","linkedWorkspaceIds"]}},"required":["data"]},"DataSourceTypeEnum":{"type":"string","enum":["Local Upload","API Upload","Web Research","Document Extraction","Workbook Extraction","PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]},"datasetFormatsEnum":{"type":"string","enum":["Folder","Tabular","Text","Workbook","PDF","DOCX","PPTX","Image","Audio","Video"]},"RichDescriptionSchema":{"type":"object","properties":{"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}}},"required":["markdown","widgets"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"OntologyModeEnum":{"type":"string","enum":["auto","manual"]},"ColumnMetadataSchema":{"type":"object","properties":{"dtype":{"type":["string","null"]},"categoryOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"distribution":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"rangeFrom":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"rangeTo":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"mean":{"type":["number","null"]},"stringPattern":{"type":["string","null"]},"jsonObjectFraction":{"type":["number","null"]},"cardinality":{"type":["number","null"]},"nullFraction":{"type":["number","null"]},"unparsedFormat":{"type":["string","null"]},"processing":{"type":["boolean","null"]},"metadataStatus":{"anyOf":[{"$ref":"#/components/schemas/MetadataStatusEnum"},{"type":"null"}]},"elementType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"minSize":{"type":["number","null"]},"maxSize":{"type":["number","null"]},"avgSize":{"type":["number","null"]},"medianSize":{"type":["number","null"]},"p95Size":{"type":["number","null"]},"nullCount":{"type":["number","null"]},"emptyCount":{"type":["number","null"]},"totalElementCount":{"type":["number","null"]},"sizeDistribution":{"anyOf":[{"$ref":"#/components/schemas/ArraySizeDistributionSchema"},{"type":"null"}]},"uniqueElementCount":{"type":["number","null"]},"avgUniquePerRow":{"type":["number","null"]},"elementOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"elementMin":{"type":["number","null"]},"elementMax":{"type":["number","null"]},"elementMean":{"type":["number","null"]},"elementSum":{"type":["number","null"]},"elementStddev":{"type":["number","null"]}}},"MetadataStatusEnum":{"type":"string","enum":["complete","partial_skipped_expensive","in_progress"]},"ArraySizeDistributionSchema":{"type":"object","properties":{"empty":{"type":"number","default":0},"oneToThree":{"type":"number","default":0},"fourToTen":{"type":"number","default":0},"elevenToFifty":{"type":"number","default":0},"fiftyPlus":{"type":"number","default":0}}},"OntologyStatusEnum":{"type":"string","enum":["pending","extracting","consolidation_queued","consolidating","detecting_derived","analyzing_dependencies","profiling_time_series","completed","extraction_failed","consolidation_failed","derived_detection_failed","relationship_detection_failed","cross_relationship_detection_failed","dependency_analysis_failed","time_series_profiling_failed","cancelled","manual_pending"]},"ExtractionStatusEnum":{"type":"string","enum":["pending","extracting","completed","failed"]},"DerivedViaEnum":{"type":"string","enum":["document_tables","document_homogenisation","document_entities","workbook_sql"]},"ExtractionRecipeSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["schema","entities"]},"sourceDocumentIds":{"type":"array","items":{"type":"string"}},"columns":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"entityTypes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true},"default":[]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"targetName":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"lastAppendedAt":{"type":["string","null"]}},"required":["mode","sourceDocumentIds"],"additionalProperties":true},"directQuerySettingsSchema":{"type":"object","properties":{"orderingColumn":{"type":["string","null"],"description":"Column the source's rows are paged by"},"appendOnly":{"type":["boolean","null"],"description":"Declared: the rows are only ever added, never updated or deleted"},"statementTimeoutSeconds":{"type":["number","null"],"description":"Cap on how long one remote statement may run"},"maxRowsScanned":{"type":["number","null"],"description":"Cap on how many rows one remote statement may scan"}},"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}}}}
```

## The PaginatedEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PaginatedEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{},"description":"Payload not declared in this repo"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]}}}}
```

## The PanelAggregateMetricStatsSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelAggregateMetricStatsSchema":{"type":"object","properties":{"environmentCount":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"meanEffect":{"type":["number","null"]},"medianEffect":{"type":["number","null"]},"p10Effect":{"type":["number","null"]},"p90Effect":{"type":["number","null"]},"shareNegative":{"type":["number","null"]},"sharePositive":{"type":["number","null"]},"baselineMean":{"type":["number","null"]},"interventionMean":{"type":["number","null"]},"medianRelativeEffect":{"type":["number","null"]},"shareSignificant":{"type":["number","null"]}}}}}}
```

## The PanelAnomalyDetectionRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}}}}}
```

## The PanelAnomalyDetectionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelAnomalyDetectionResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalAnomalyDetectionResultSchema"}}},"required":["environmentResults"]},"TemporalAnomalyDetectionResultSchema":{"type":"object","properties":{"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"totalTimestepsScanned":{"type":"number"},"timesteps":{"type":"array","items":{"$ref":"#/components/schemas/SampleAnomalyScanResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalTimestepsScanned"]},"SampleAnomalyScanResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number"},"isAnomalous":{"type":"boolean"},"systemScore":{"type":"number"},"flaggedNodes":{"type":"array","items":{"$ref":"#/components/schemas/AnomalyFlagResultSchema"},"default":[]},"allSurprises":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["sampleIndex","isAnomalous","systemScore"]},"AnomalyFlagResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"conditionalZ":{"type":"number"},"marginalZ":{"type":"number"},"isRootNode":{"type":"boolean"},"confidence":{"type":"number"},"graphDepth":{"type":"number"},"variableThreshold":{"type":["number","null"]}},"required":["variable","conditionalZ","marginalZ","isRootNode","confidence","graphDepth"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]}}}}
```

## The PanelCausalHealthMonitorRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}}}}}
```

## The PanelCausalHealthMonitorResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelCausalHealthMonitorResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CausalHealthMonitorResultSchema"}}},"required":["environmentResults"]},"CausalHealthMonitorResultSchema":{"type":"object","properties":{"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"totalTimestepsScanned":{"type":"number"},"startTimestampMs":{"type":["number","null"]},"granularityMs":{"type":["number","null"]},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/ConditionScanTimestepResultSchema"}},"nodeSummaries":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"}},"causalAlertOrdering":{"type":"array","items":{"$ref":"#/components/schemas/CausalAlertEntryResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]},"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"eventLog":{"type":"array","items":{"$ref":"#/components/schemas/EventLogEntryResultSchema"},"default":[]},"leadLag":{"type":"array","items":{"$ref":"#/components/schemas/LeadLagEntryResultSchema"},"default":[]},"edgePropagation":{"type":"array","items":{"$ref":"#/components/schemas/EdgePropagationSeriesResultSchema"},"default":[]},"forecastedSamples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"causalEdges":{"type":"array","items":{"$ref":"#/components/schemas/CausalEdgeResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalTimestepsScanned","timeline","nodeSummaries"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"ConditionScanTimestepResultSchema":{"type":"object","properties":{"timestep":{"type":"number"},"timestampMs":{"type":["number","null"]},"systemHealthScore":{"type":"number"},"nodeStatuses":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"}},"spikeAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"trendAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["timestep","systemHealthScore","nodeStatuses"]},"NodeConditionStatusResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"currentZ":{"type":"number"},"ewmaZ":{"type":"number"},"trendSlope":{"type":"number"},"cusum":{"type":"number"},"stepsElevated":{"type":"number"},"isRootNode":{"type":"boolean"},"graphDepth":{"type":"number"},"confidence":{"type":"number"},"causalDepth":{"type":"number","default":0},"variableThreshold":{"type":["number","null"]},"marginalZScore":{"type":"number","default":0},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"recovered":{"type":"boolean","default":false}},"required":["variable","alertType","currentZ","ewmaZ","trendSlope","cusum","stepsElevated","isRootNode","graphDepth","confidence"]},"AlertTypeEnum":{"type":"string","enum":["spike","worsening","improving","sustained","normal"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"CausalAlertEntryResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"causalDepth":{"type":"number"},"firstAlertStep":{"type":"number"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"ewmaZ":{"type":"number"}},"required":["variable","causalDepth","firstAlertStep","alertType","ewmaZ"]},"EventLogEntryResultSchema":{"type":"object","properties":{"at":{"type":"number"},"atTimestampMs":{"type":["number","null"]},"kind":{"type":"string","enum":["first_alert","cascade","rca_verdict","recovered"]},"variable":{"type":["string","null"]},"alertType":{"type":["string","null"]},"ewmaZ":{"type":"number","default":0},"signedCurrentZ":{"type":"number","default":0},"sourceSignedZ":{"type":"number","default":0},"targetSignedZ":{"type":"number","default":0},"sentence":{"type":"string","default":""},"fromVar":{"type":["string","null"]},"toVar":{"type":["string","null"]},"lagSteps":{"type":["number","null"]},"correlation":{"type":["number","null"]},"target":{"type":["string","null"]},"rootCause":{"type":["string","null"]}},"required":["at","kind"]},"LeadLagEntryResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"lagSteps":{"type":"number"},"correlation":{"type":"number"}},"required":["source","target","lagSteps","correlation"]},"EdgePropagationSeriesResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"scores":{"type":"array","items":{"type":"number"}}},"required":["source","target","scores"]},"CausalEdgeResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]}}}}
```

## The PanelCounterfactualRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]}}}}
```

## The PanelCounterfactualResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelCounterfactualResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalCounterfactualExplanationSchema"},"description":"Counterfactual results per environment"}},"required":["environmentResults"]},"TemporalCounterfactualExplanationSchema":{"type":"object","properties":{"currentState":{"type":"object","additionalProperties":{}},"baselineTrajectory":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},"requestedTargets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"counterfactuals":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualSchema"}},"baselineAlreadyMeetsTarget":{"type":["boolean","null"]},"baselineAchievedAt":{"type":["number","null"]}},"required":["currentState","baselineTrajectory","requestedTargets","counterfactuals"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"TemporalCounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/TemporalVariableChangeSchema"}},"predictedTrajectories":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},"targetAchievedAt":{"type":["number","null"]},"allTargetsMet":{"type":"boolean"},"certainty":{"type":"number"}},"required":["changes","predictedTrajectories","allTargetsMet","certainty"]},"TemporalVariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string"},"fromValue":{},"toValue":{},"timestamp":{"type":["number","null"]},"persistent":{"type":"boolean","default":true},"rampSteps":{"type":["number","null"]},"importance":{"type":"number","default":1}},"required":["variable"]}}}}
```

## The PanelExplanationRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]}}}}
```

## The PanelExplanationResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelExplanationResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalExplanationResultSchema"},"description":"Explanation results per environment"}},"required":["environmentResults"]},"TemporalExplanationResultSchema":{"type":"object","properties":{"explanationType":{"type":"string","enum":["directional","discovery","impact"]},"causalRelationships":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalRelationshipAnalysisSchema"}},{"type":"null"}]},"forecastHorizonUsed":{"type":"number"},"executionTime":{"type":"number"}},"required":["explanationType","forecastHorizonUsed","executionTime"]},"TemporalCausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string"},"effectVar":{"type":"string"},"overallEffect":{"$ref":"#/components/schemas/TemporalOverallEffectAnalysisSchema"},"effectPropagation":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},{"type":"null"}]},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["causeVar","effectVar","overallEffect","causalPaths"]},"TemporalOverallEffectAnalysisSchema":{"type":"object","properties":{"effectSize":{"type":"number"},"effectRange":{"type":"array","items":{"type":"number"}},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"},"lagEffects":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalStrengthSchema"}},"seasonalEffects":{"type":"array","items":{"$ref":"#/components/schemas/SeasonalEffectDecompositionSchema"}},"impulseResponse":{"type":"array","items":{"type":"number"}},"cumulativeEffect":{"type":"number"},"peakEffectLag":{"type":"number"},"contrast":{"$ref":"#/components/schemas/ContrastSchema"}},"required":["effectSize","effectRange","confidenceInterval","statisticalSignificance","lagEffects","seasonalEffects","impulseResponse","cumulativeEffect","peakEffectLag","contrast"]},"TemporalCausalStrengthSchema":{"type":"object","properties":{"lag":{"type":"number"},"effectSize":{"type":"number"},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"}},"required":["lag","effectSize","confidenceInterval","statisticalSignificance"]},"SeasonalEffectDecompositionSchema":{"type":"object","properties":{"component":{"type":"string"},"period":{"type":"number"},"periodEffects":{"type":"object","additionalProperties":{"type":"number"}},"strongestPeriod":{"type":"string"},"weakestPeriod":{"type":"string"}},"required":["component","period","periodEffects","strongestPeriod","weakestPeriod"]},"ContrastSchema":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]}}}}
```

## The PanelForecastRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]}}}}
```

## The PanelForecastResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelForecastResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DigitalTwinPredictionResultSchema"},"description":"Forecast results per environment"},"aggregateResult":{"anyOf":[{"$ref":"#/components/schemas/DigitalTwinPredictionResultSchema"},{"type":"null"}],"description":"Aggregated forecast result across environments"},"environmentCoverage":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentCoverageSchema"},{"type":"null"}],"description":"Requested-vs-forecast environment coverage; absent on runs that predate tracking and read as full"}},"required":["environmentResults"]},"DigitalTwinPredictionResultSchema":{"type":"object","properties":{"results":{"type":"object","additionalProperties":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/CategoricalPredictionRecordSchema"},{"$ref":"#/components/schemas/ContinuousPredictionRecordSchema"}]}}},"changepoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ForecastChangepointSchema"}}},{"type":"null"}],"description":"Detected changepoints per variable"},"history":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ForecastHistorySeriesSchema"}},{"type":"null"}],"description":"Per-variable trailing observed history from the model's stored training series"}},"required":["results"]},"CategoricalPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"description":"Predicted class (most likely) in decoded format"},"probabilities":{"type":"array","items":{"type":"number"},"description":"Raw predicted probabilities for each class"},"lowerBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Lower bounds of confidence intervals for probabilities"},"upperBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Upper bounds of confidence intervals for probabilities"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"}},"required":["probabilities"]},"ContinuousPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"type":["number","null"],"description":"Predicted value in decoded format"},"std":{"type":["number","null"],"description":"Standard deviation of prediction in decoded scale"},"lowerBound":{"type":["number","null"],"description":"Lower bound of confidence interval in decoded format"},"upperBound":{"type":["number","null"],"description":"Upper bound of confidence interval in decoded format"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"},"attribution":{"anyOf":[{"$ref":"#/components/schemas/ForecastComponentAttributionSchema"},{"type":"null"}],"description":"Component attribution for this prediction step"}}},"ForecastComponentAttributionSchema":{"type":"object","properties":{"trend":{"type":["number","null"],"description":"Adaptive trend contribution"},"seasonal":{"type":["number","null"],"description":"Seasonal component contribution"},"parents":{"type":["number","null"],"description":"Total parent causal effect"},"delta":{"type":["number","null"],"description":"Level/drift contribution"},"parentBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"anyOf":[{"not":{}},{"type":["number","null"]}]}},{"type":"null"}],"description":"Per-parent contribution breakdown"}}},"ForecastChangepointSchema":{"type":"object","properties":{"stepIndex":{"type":"number","description":"Step index where changepoint occurs"},"timestamp":{"type":"number","description":"Timestamp of the changepoint"},"direction":{"type":"string","enum":["up","down","inflection"],"description":"Direction of the change"},"magnitude":{"type":"number","description":"Magnitude of the change"},"primaryDriver":{"type":"string","description":"Primary driver of the change"},"driverContribution":{"type":"number","description":"Contribution of the primary driver"}},"required":["stepIndex","timestamp","direction","magnitude","primaryDriver","driverContribution"]},"ForecastHistorySeriesSchema":{"type":"object","properties":{"timestamps":{"type":"array","items":{"type":"number"},"description":"Trailing observed-history timestamps in ms, ending at the model's last training step"},"values":{"type":"array","items":{"type":["number","null"]},"description":"Observed values aligned with timestamps; null entries mark missing source rows"}},"required":["timestamps","values"]},"EnvironmentCoverageSchema":{"type":"object","properties":{"requested":{"type":"number"},"forecast":{"type":"number"},"failed":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentForecastFailureSchema"},"default":[]},"omittedFailures":{"type":"number","default":0}},"required":["requested","forecast"]},"EnvironmentForecastFailureSchema":{"type":"object","properties":{"environment":{"type":"string"},"reason":{"type":"string"}},"required":["environment","reason"]}}}}
```

## The PanelInterventionAggregateSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelInterventionAggregateSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"},"crossEnvironment":{"anyOf":[{"$ref":"#/components/schemas/CrossEnvironmentStatsSchema"},{"type":"null"}],"description":"Distribution of per-environment effects, which the mean result cannot express"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"CrossEnvironmentStatsSchema":{"type":"object","properties":{"scope":{"type":["string","null"]},"environmentCount":{"type":["number","null"]},"totalEnvironments":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"environmentsMissingResult":{"type":["number","null"]},"metrics":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PanelAggregateMetricStatsSchema"}},{"type":"null"}]}}},"PanelAggregateMetricStatsSchema":{"type":"object","properties":{"environmentCount":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"meanEffect":{"type":["number","null"]},"medianEffect":{"type":["number","null"]},"p10Effect":{"type":["number","null"]},"p90Effect":{"type":["number","null"]},"shareNegative":{"type":["number","null"]},"sharePositive":{"type":["number","null"]},"baselineMean":{"type":["number","null"]},"interventionMean":{"type":["number","null"]},"medianRelativeEffect":{"type":["number","null"]},"shareSignificant":{"type":["number","null"]}}}}}}
```

## The PanelInterventionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelInterventionResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},"description":"Intervention results per environment"},"aggregateResult":{"anyOf":[{"$ref":"#/components/schemas/PanelInterventionAggregateSchema"},{"type":"null"}],"description":"All-environments aggregate shaped like a per-environment result"}},"required":["environmentResults"]},"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"PanelInterventionAggregateSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"},"crossEnvironment":{"anyOf":[{"$ref":"#/components/schemas/CrossEnvironmentStatsSchema"},{"type":"null"}],"description":"Distribution of per-environment effects, which the mean result cannot express"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"CrossEnvironmentStatsSchema":{"type":"object","properties":{"scope":{"type":["string","null"]},"environmentCount":{"type":["number","null"]},"totalEnvironments":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"environmentsMissingResult":{"type":["number","null"]},"metrics":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PanelAggregateMetricStatsSchema"}},{"type":"null"}]}}},"PanelAggregateMetricStatsSchema":{"type":"object","properties":{"environmentCount":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"meanEffect":{"type":["number","null"]},"medianEffect":{"type":["number","null"]},"p10Effect":{"type":["number","null"]},"p90Effect":{"type":["number","null"]},"shareNegative":{"type":["number","null"]},"sharePositive":{"type":["number","null"]},"baselineMean":{"type":["number","null"]},"interventionMean":{"type":["number","null"]},"medianRelativeEffect":{"type":["number","null"]},"shareSignificant":{"type":["number","null"]}}}}}}
```

## The PanelInterventionSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]}}}}
```

## The PanelOptimisationScenarioSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}}}}}
```

## The PanelOptimizationResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelOptimizationResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalOptimizationResultSchema"},"description":"Optimization results per environment"}},"required":["environmentResults"]},"TemporalOptimizationResultSchema":{"type":"object","properties":{"paretoFront":{"type":"array","items":{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"}},"baselineMetrics":{"type":"object","additionalProperties":{"type":"number"}},"balancedSolution":{"anyOf":[{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"},{"type":"null"}]},"bestPerObjective":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"},"executionTime":{"type":"number"},"allConstraintsSatisfiable":{"type":"boolean","default":true,"description":"Whether any plan satisfying every metric constraint was found"},"metricScaleBases":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MetricScaleBasisSchema"}},{"type":"null"}],"description":"Per-objective scale basis; an extensive metric over the stacked Monte Carlo paths is rescaled to a single path"}},"required":["paretoFront","baselineMetrics","forecastHorizon","executionTime"]},"TemporalParetoDominantSolutionSchema":{"type":"object","properties":{"interventions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Interventions in this solution"},"interventionCount":{"type":"number","default":0,"description":"Number of interventions in this solution"},"objectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Values of the objectives"},"implementationDifficulty":{"type":["number","null"],"description":"Difficulty of implementing this solution"},"expectedOutcomes":{"type":"object","additionalProperties":{},"description":"Expected outcomes of the solution"},"uncertainty":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Uncertainty in objective values"},"improvementOverBaseline":{"type":"object","additionalProperties":{"type":"number"},"description":"Improvements over baseline"},"constraintsSatisfied":{"type":"boolean","default":true,"description":"Whether all constraints were satisfied by this solution"},"constraintViolations":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Descriptions of constraint violations if any"},"targetsAchieved":{"anyOf":[{"type":"object","additionalProperties":{"type":"boolean"}},{"type":"null"}],"description":"Whether each objective's target was achieved"},"segmentResults":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Per-segment objective values: {segment_id: {objective_name: value}}"},"segmentSampleSizes":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-segment sample sizes: {segment_id: sample_count}"},"segmentInterventions":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Segment-specific interventions with conditions"},"totalSampleCount":{"type":["number","null"]},"affectedSampleCount":{"type":["number","null"]},"affectedPercentage":{"type":["number","null"]},"appliedInterventions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"}},{"type":"null"}],"description":"The exact intervention rows the evaluator ran for this plan, after scoping and relative-mode conversion"},"interventionResult":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"type":"null"}],"description":"The plan re-run as a Monte Carlo temporal intervention over the same horizon"},"interventionSequence":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"forecastTrajectories":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},{"type":"null"}],"description":"Superseded by interventionResult.forecastData; empty on runs that carry a per-plan result"}},"required":["interventions","objectiveValues","expectedOutcomes","uncertainty","improvementOverBaseline","interventionSequence"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"MetricScaleBasisSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["intensive","extensive","unknown"],"description":"Whether the metric's level scales with the sampled table's row count"},"sampleRows":{"type":"number","description":"Rows in the sampled table the metric was computed over"},"sourceRows":{"type":["number","null"],"description":"Rows in the twin's source data; the rescale target for extensive metrics"},"rescaled":{"type":"boolean","default":false,"description":"Whether absolute values for this metric were rescaled"},"rescaledTo":{"anyOf":[{"type":"string","enum":["source_rows","single_path"]},{"type":"null"}],"description":"What an extensive metric was rescaled to: the source data's row count (static) or one simulated future path (temporal)"}},"required":["kind","sampleRows"]}}}}
```

## The PanelParentImpactRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]}}}}
```

## The PanelParentImpactResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelParentImpactResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ParentImpactResultSchema"},"description":"Parent impact results per environment"}},"required":["environmentResults"]},"ParentImpactResultSchema":{"type":"object","properties":{"nodeImpacts":{"type":"array","items":{"$ref":"#/components/schemas/NodeParentImpactsSchema"}},"executionTime":{"type":"number"},"sampleSize":{"type":["number","null"]}},"required":["nodeImpacts","executionTime"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]}}}}
```

## The PanelRootCauseAnalysisRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}}}}}
```

## The PanelRootCauseAnalysisResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelRootCauseAnalysisResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RootCauseAnalysisResultSchema"}}},"required":["environmentResults"]},"RootCauseAnalysisResultSchema":{"type":"object","properties":{"sampleResults":{"type":"array","items":{"$ref":"#/components/schemas/SampleRcaResultSchema"}},"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"executionTime":{"type":"number","default":0}},"required":["sampleResults"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]}}}}
```

## The PanelScenarioSamplesRefSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The ParentImpactEntrySchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]}}}}
```

## The ParentImpactRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]}}}}
```

## The ParentImpactResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ParentImpactResultSchema":{"type":"object","properties":{"nodeImpacts":{"type":"array","items":{"$ref":"#/components/schemas/NodeParentImpactsSchema"}},"executionTime":{"type":"number"},"sampleSize":{"type":["number","null"]}},"required":["nodeImpacts","executionTime"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]}}}}
```

## The ParetoDominantSolutionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ParetoDominantSolutionSchema":{"type":"object","properties":{"interventions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Interventions in this solution"},"interventionCount":{"type":"number","default":0,"description":"Number of interventions in this solution"},"objectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Values of the objectives"},"implementationDifficulty":{"type":["number","null"],"description":"Difficulty of implementing this solution"},"expectedOutcomes":{"type":"object","additionalProperties":{},"description":"Expected outcomes of the solution"},"uncertainty":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Uncertainty in objective values"},"improvementOverBaseline":{"type":"object","additionalProperties":{"type":"number"},"description":"Improvements over baseline"},"constraintsSatisfied":{"type":"boolean","default":true,"description":"Whether all constraints were satisfied by this solution"},"constraintViolations":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Descriptions of constraint violations if any"},"targetsAchieved":{"anyOf":[{"type":"object","additionalProperties":{"type":"boolean"}},{"type":"null"}],"description":"Whether each objective's target was achieved"},"segmentResults":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Per-segment objective values: {segment_id: {objective_name: value}}"},"segmentSampleSizes":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-segment sample sizes: {segment_id: sample_count}"},"segmentInterventions":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Segment-specific interventions with conditions"},"totalSampleCount":{"type":["number","null"]},"affectedSampleCount":{"type":["number","null"]},"affectedPercentage":{"type":["number","null"]},"appliedInterventions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"}},{"type":"null"}],"description":"The exact intervention rows the evaluator ran for this plan, after scoping and relative-mode conversion"},"interventionResult":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"$ref":"#/components/schemas/InterventionResultSchema"}]},{"type":"null"}],"description":"The plan re-run as an intervention scenario; null on older runs, panel temporal runs, and when the plan's run failed"}},"required":["interventions","objectiveValues","expectedOutcomes","uncertainty","improvementOverBaseline"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"InterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"}},"required":["metrics","sampleSize","uncertainty","executionTime"]}}}}
```

## The PatchFixedGraphInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PatchFixedGraphInput":{"type":"object","properties":{"addEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]}},"removeEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]}}},"required":["addEdges","removeEdges"]}}}}
```

## The PathwayEffectSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PathwayEffectSchema":{"type":"object","properties":{"pathway":{"type":"array","items":{"type":"string"},"description":"Variables in the causal pathway"},"effectContribution":{"type":["number","null"],"description":"Contribution of this pathway to total effect"},"percentageOfTotal":{"type":["number","null"],"description":"Percentage of total effect through this pathway"},"note":{"type":["string","null"],"description":"Additional notes about the pathway"}},"required":["pathway"]}}}}
```

## The PredictionWithUncertaintyRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The PreviewQueryInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PreviewQueryInput":{"type":"object","properties":{"config":{"type":"object","additionalProperties":{},"description":"Connector-specific selection: {table} plus database/schema/warehouse for SQL connectors, {database, collection} for MongoDB, {path} for storage, or {query} to preview custom SQL instead; connectorId and type are filled in from the route"},"limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}],"description":"Row cap for the preview (default 50, max 1000)"}},"required":["config"]}}}}
```

## The PublicConceptUpdateInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PublicConceptUpdateInput":{"type":"object","properties":{"_id":{"type":"string"},"ownerId":{"type":"string","default":"system"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"conceptClassification":{"anyOf":[{"$ref":"#/components/schemas/ConceptClassificationEnum"},{"type":"null"}]},"anchorConceptLinks":{"type":"array","items":{"type":"string"},"default":[]},"schemaFieldName":{"type":"string"},"schemaType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"schemaSubtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"metadata":{"$ref":"#/components/schemas/ConceptMetadataSchema"},"lockedMetadataFields":{"type":"array","items":{"type":"string"}},"detectedMetadata":{"anyOf":[{"$ref":"#/components/schemas/ConceptMetadataSchema"},{"type":"null"}]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DerivedConceptInfoSchema"},{"type":"null"}]},"conceptKind":{"$ref":"#/components/schemas/ConceptKindEnum","default":"standard"},"metricSql":{"type":["string","null"]},"relationshipRules":{"type":"array","items":{"$ref":"#/components/schemas/RelationshipRuleSchema"},"default":[]},"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]},"trustTier":{"anyOf":[{"type":"string","enum":["exploratory","curated_pending","curated"]},{"type":"null"}]},"ontologyRef":{"anyOf":[{"type":"object","properties":{"ontologyId":{"type":"string"},"ontologyVersion":{"type":"string"},"canonicalId":{"type":"string"},"installScope":{"anyOf":[{"type":"object","properties":{"conceptCanonicalIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"filters":{"type":"array","items":{"type":"object","properties":{"conceptRef":{"type":"string"},"values":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]}},"required":["conceptRef"]},"default":[]}}},{"type":"null"}]}},"required":["ontologyId","ontologyVersion","canonicalId"]},{"type":"null"}]},"layerIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"},"default":[]},"valueMappings":{"type":"array","items":{"$ref":"#/components/schemas/ConceptValueMappingSchema"},"default":[]},"lockedConceptFields":{"type":"array","items":{"type":"string"}},"detectedConceptStructure":{"anyOf":[{"$ref":"#/components/schemas/DetectedConceptStructureSchema"},{"type":"null"}]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]},"lineageDrift":{"type":["boolean","null"]},"editVersion":{"type":"integer","minimum":0,"default":0},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"fieldMappings":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"status":{"$ref":"#/components/schemas/BindingStatusEnum","default":"confirmed"},"source":{"$ref":"#/components/schemas/BindingSourceEnum","default":"ingest"},"confidence":{"type":["number","null"]},"evidence":{"type":["string","null"]},"valueMap":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}},{"allOf":[{},{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}}]}]},{"type":"null"}]},"canonicalField":{"type":["string","null"]},"scopeFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"precedence":{"type":["number","null"]},"keyRole":{"anyOf":[{"$ref":"#/components/schemas/KeyRoleEnum"},{"type":"null"}]},"conformance":{"anyOf":[{"$ref":"#/components/schemas/ConformanceReportSchema"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"sourceId":{"type":"string"}},"required":["field","sourceId"]}}},"required":["_id"]},"ConceptClassificationEnum":{"type":"string","enum":["identifier","location","time"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"ConceptMetadataSchema":{"type":"object","properties":{"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]},"isUnique":{"type":["boolean","null"]},"isCyclic":{"type":["boolean","null"]},"isHeterogeneousIdentifier":{"type":["boolean","null"]},"compositeScopeConceptId":{"type":["string","null"]},"isUniformDistribution":{"type":["boolean","null"]},"locationType":{"anyOf":[{"$ref":"#/components/schemas/AnchorLocationTypeEnum"},{"type":"null"}]},"coordinateFormat":{"anyOf":[{"$ref":"#/components/schemas/CoordinateFormatEnum"},{"type":"null"}]},"coordinateDatum":{"anyOf":[{"$ref":"#/components/schemas/CoordinateDatumEnum"},{"type":"null"}]},"coordinatePairConceptId":{"type":["string","null"]},"locationDetectionSource":{"anyOf":[{"$ref":"#/components/schemas/LocationDetectionSourceEnum"},{"type":"null"}]},"latitudeInRangeFraction":{"type":["number","null"]},"longitudeInRangeFraction":{"type":["number","null"]},"fractionalPartFraction":{"type":["number","null"]},"coordinatePairFraction":{"type":["number","null"]},"dmsCoordinateFraction":{"type":["number","null"]},"postalCodeFraction":{"type":["number","null"]},"addressShapeFraction":{"type":["number","null"]},"enrichments":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EnrichmentRecordSchema"}},{"type":"null"}]},"geoEnrichmentStatus":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"geoEnrichmentKind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"geoEnrichedAt":{"type":["string","null"]},"geoEnrichmentVersion":{"type":["number","null"]},"geoSidecarKey":{"type":["string","null"]},"geoDistinctTotal":{"type":["number","null"]},"geoMatchedCount":{"type":["number","null"]},"geoUnmatchedCount":{"type":["number","null"]},"geoTruncated":{"type":["boolean","null"]},"geoEnrichmentError":{"type":["string","null"]},"nanFillStrategy":{"anyOf":[{"$ref":"#/components/schemas/NanFillStrategyEnum"},{"type":"null"}]},"changeRate":{"type":["number","null"]},"dateTimeFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"averageInterval":{"type":["number","null"]},"isConsistentInterval":{"type":["boolean","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"higherIsBetter":{"type":["boolean","null"]},"isEqualInterval":{"type":["boolean","null"]},"intervalSize":{"type":["number","null"]},"valueClass":{"anyOf":[{"$ref":"#/components/schemas/ValueClassEnum"},{"type":"null"}]},"fracZero":{"type":["number","null"]},"zeroRunLengthP95":{"type":["number","null"]},"nonZeroRunLengthP95":{"type":["number","null"]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"emailFraction":{"type":["number","null"]},"medianLength":{"type":["number","null"]},"distinctLengthCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"tsGranularity":{"type":["string","null"]},"tsValidGranularities":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tsTypicalDeltaSeconds":{"type":["number","null"]},"tsSelectedGrid":{"type":["string","null"]},"tsGapProfile":{"anyOf":[{"$ref":"#/components/schemas/GapProfileSchema"},{"type":"null"}]},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsPerEnvProfiles":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesEnvProfileSchema"}},{"type":"null"}]},"tsAnalyzerVersion":{"type":["string","null"]},"tsAnalyzedAt":{"type":["string","null"]},"elementSchemaType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"elementCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sizeStatistics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"additionalProperties":true},"AnchorLocationTypeEnum":{"type":"string","enum":["latitude","longitude","coordinate","country","region","city","postal_code","address","continent","airport_code","unlocode"]},"CoordinateFormatEnum":{"type":"string","enum":["dd","dms","ddm"]},"CoordinateDatumEnum":{"type":"string","enum":["wgs84","gcj02","bd09"]},"LocationDetectionSourceEnum":{"type":"string","enum":["values","column_name","user"]},"EnrichmentRecordSchema":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"enrichedAt":{"type":["string","null"]},"enricherVersion":{"type":["string","null"]},"dataVersion":{"type":["string","null"]},"version":{"type":["number","null"]},"sidecarKey":{"type":["string","null"]},"keyFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"hintFields":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"corroborationFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latLonPrecision":{"type":["number","null"]},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]},"truncated":{"type":["boolean","null"]},"error":{"type":["string","null"]},"appliedDatum":{"type":["string","null"]}}},"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]},"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]},"NanFillStrategyEnum":{"type":"string","enum":["forward","interpolate","zero","drop","undefined"]},"ValueClassEnum":{"type":"string","enum":["continuous","sparse_event","bursty","binary_indicator"]},"GapProfileSchema":{"type":"object","properties":{"expectedIntervalSeconds":{"type":["number","null"]},"p50GapSeconds":{"type":["number","null"]},"p95GapSeconds":{"type":["number","null"]},"p99GapSeconds":{"type":["number","null"]},"maxGapSeconds":{"type":["number","null"]},"gapCount":{"type":["number","null"]},"largestGapStart":{"type":["string","null"]}}},"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]},"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]},"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]},"TimeSeriesEnvProfileSchema":{"type":"object","properties":{"envKey":{"type":"string"},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"tsTypicalDeltaSeconds":{"type":["number","null"]}},"required":["envKey"]},"DerivedConceptInfoSchema":{"type":"object","properties":{"formula":{"type":["string","null"]},"formulaBlocks":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]},"derivedType":{"$ref":"#/components/schemas/DerivedTypeEnum","default":"manual"},"kind":{"anyOf":[{"$ref":"#/components/schemas/DerivedInfoKindEnum"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/DerivedSourceEnum"},{"type":"null"}]},"sourceColumns":{"type":"array","items":{"type":"string"},"default":[]},"expression":{"type":["string","null"]},"r2":{"type":["number","null"]},"isDeterministic":{"type":["boolean","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"sourceDataViewId":{"type":["string","null"]},"operationLineage":{"anyOf":[{"$ref":"#/components/schemas/OperationLineageSchema"},{"type":"null"}]},"viewSnapshot":{"anyOf":[{"$ref":"#/components/schemas/ViewSnapshotSchema"},{"type":"null"}]},"lineageHash":{"type":["string","null"]},"sourceJoinConfig":{"anyOf":[{"$ref":"#/components/schemas/SourceJoinConfigSchema"},{"type":"null"}]}}},"DerivedTypeEnum":{"type":"string","enum":["manual","datetime_component","lag","cumulative","step_change","algebraic_identity","complement","ratio","view_operation"]},"DerivedInfoKindEnum":{"type":"string","enum":["op","formula","detected","join"]},"DerivedSourceEnum":{"type":"string","enum":["user","detected","discovered"]},"OperationLineageSchema":{"type":"object","properties":{"opType":{"$ref":"#/components/schemas/OperationTypeEnum"},"opId":{"type":"string"},"parentColumns":{"type":"array","items":{"type":"string"},"default":[]},"parentConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["opType","opId"]},"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]},"ViewSnapshotSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"outputColumn":{"type":"string"}},"required":["sources","operations","outputColumn"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"SourceJoinConfigSchema":{"type":"object","properties":{"joinType":{"type":"string","enum":["left","inner"],"default":"left"},"strategy":{"type":["string","null"]}}},"ConceptKindEnum":{"type":"string","enum":["standard","derived","metric"]},"RelationshipRuleSchema":{"type":"object","properties":{"ruleType":{"$ref":"#/components/schemas/RelationshipRuleTypeEnum"},"sourceVariable":{"type":"string"},"condition":{"anyOf":[{"$ref":"#/components/schemas/ConditionSchema"},{"type":"null"}]},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"confidence":{"type":"number","default":1},"support":{"type":"number","default":0},"strength":{"anyOf":[{"$ref":"#/components/schemas/RuleStrengthEnum"},{"type":"null"}]},"violationRate":{"type":["number","null"]},"source":{"type":["string","null"]},"cycle":{"type":["string","null"]}},"required":["ruleType","sourceVariable"]},"RelationshipRuleTypeEnum":{"type":"string","enum":["conditional_values","range","set","cyclic_active_window","cyclic_missing"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"RuleStrengthEnum":{"type":"string","enum":["hard","soft"]},"SuggestedRoleEnum":{"type":"string","enum":["source","target"]},"ConceptValueMappingSchema":{"type":"object","properties":{"canonicalValue":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"},"default":[]}},"required":["canonicalValue"]},"DetectedConceptStructureSchema":{"type":"object","properties":{"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]}}},"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]},"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]},"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]},"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]}}}}
```

## The PublicFieldMappingSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PublicFieldMappingSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"field":{"type":"string"},"status":{"$ref":"#/components/schemas/BindingStatusEnum","default":"confirmed"},"source":{"$ref":"#/components/schemas/BindingSourceEnum","default":"ingest"},"confidence":{"type":["number","null"]},"evidence":{"type":["string","null"]},"valueMap":{"anyOf":[{"$ref":"#/components/schemas/OntologyValueMapSchema"},{"type":"null"}]},"canonicalField":{"type":["string","null"]},"scopeFields":{"type":["array","null"],"items":{"type":"string"}},"precedence":{"type":["number","null"]},"keyRole":{"anyOf":[{"$ref":"#/components/schemas/KeyRoleEnum"},{"type":"null"}]},"conformance":{"anyOf":[{"$ref":"#/components/schemas/ConformanceReportSchema"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"sourceId":{"type":"string"}},"required":["datasetId","field","status","source","sourceId"]},"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]},"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]},"OntologyValueMapSchema":{"anyOf":[{"$ref":"#/components/schemas/OntologyValueMapEntriesSchema"},{"$ref":"#/components/schemas/OntologyValueMapEntriesSchema"}]},"OntologyValueMapEntriesSchema":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]},"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]}}}}
```

## The PutGraphInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"PutGraphInput":{"type":"object","properties":{"relationships":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"}},"required":["source","target"]}},"nodes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"nodeType":{"type":"string"},"type":{"type":"string"}},"required":["name","nodeType","type"]}}},"required":["relationships","nodes"]}}}}
```

## The RangeConstraintSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]}}}}
```

## The RangeValueSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]}}}}
```

## The ReconciliationColumnGroupSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]}}}}
```

## The ReconciliationColumnSideEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]}}}}
```

## The ReconciliationSecondaryMetaSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]}}}}
```

## The RelationshipRuleSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RelationshipRuleSchema":{"type":"object","properties":{"ruleType":{"$ref":"#/components/schemas/RelationshipRuleTypeEnum"},"sourceVariable":{"type":"string"},"condition":{"anyOf":[{"$ref":"#/components/schemas/ConditionSchema"},{"type":"null"}]},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"confidence":{"type":"number","default":1},"support":{"type":"number","default":0},"strength":{"anyOf":[{"$ref":"#/components/schemas/RuleStrengthEnum"},{"type":"null"}]},"violationRate":{"type":["number","null"]},"source":{"type":["string","null"]},"cycle":{"type":["string","null"]}},"required":["ruleType","sourceVariable"]},"RelationshipRuleTypeEnum":{"type":"string","enum":["conditional_values","range","set","cyclic_active_window","cyclic_missing"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"RuleStrengthEnum":{"type":"string","enum":["hard","soft"]}}}}
```

## The RelationshipRuleTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RelationshipRuleTypeEnum":{"type":"string","enum":["conditional_values","range","set","cyclic_active_window","cyclic_missing"]}}}}
```

## The RelativeChangeSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]}}}}
```

## The RenderWidgetInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RenderWidgetInput":{"type":"object","properties":{"widget":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{},"description":"A widget payload as emitted by agent/MCP tools (type plus kind-specific fields)"},"theme":{"type":"string","enum":["light","dark"],"description":"Render theme (default light)"}},"required":["widget"]}}}}
```

## The ReportEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ReportEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Report"}},"required":["data"]},"Report":{"type":"object","properties":{"id":{"type":["string","null"]},"workspaceId":{"type":"string"},"organisationId":{"type":"string"},"title":{"type":"string"},"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}},"evidenceIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"status":{"$ref":"#/components/schemas/ReportStatusSchema"},"rev":{"type":"integer"},"error":{"type":["string","null"]},"prompt":{"type":["string","null"]},"publish":{"anyOf":[{"$ref":"#/components/schemas/reportPublishSchema"},{"type":"null"}]}},"required":["workspaceId","organisationId","title","markdown","widgets","evidenceIds","createdAt","updatedAt"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"ReportStatusSchema":{"type":"string","enum":["draft","ready","error"]},"reportPublishSchema":{"type":"object","properties":{"slug":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"consumerAccess":{"anyOf":[{"type":"string","enum":["private","workspace","organisation","public"]},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"widgetSnapshot":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"snapshotAt":{"type":["string","null"]},"snapshotStats":{"anyOf":[{"type":"object","properties":{"requested":{"type":"number"},"resolved":{"type":"number"},"omitted":{"type":"number"},"timedOut":{"type":"boolean"},"bytes":{"type":"number"}},"required":["requested","resolved","omitted","timedOut","bytes"]},{"type":"null"}]}}}}}}
```

## The ReportListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ReportListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Report"}},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]},"Report":{"type":"object","properties":{"id":{"type":["string","null"]},"workspaceId":{"type":"string"},"organisationId":{"type":"string"},"title":{"type":"string"},"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}},"evidenceIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"status":{"$ref":"#/components/schemas/ReportStatusSchema"},"rev":{"type":"integer"},"error":{"type":["string","null"]},"prompt":{"type":["string","null"]},"publish":{"anyOf":[{"$ref":"#/components/schemas/reportPublishSchema"},{"type":"null"}]}},"required":["workspaceId","organisationId","title","markdown","widgets","evidenceIds","createdAt","updatedAt"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"ReportStatusSchema":{"type":"string","enum":["draft","ready","error"]},"reportPublishSchema":{"type":"object","properties":{"slug":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"consumerAccess":{"anyOf":[{"type":"string","enum":["private","workspace","organisation","public"]},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"widgetSnapshot":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"snapshotAt":{"type":["string","null"]},"snapshotStats":{"anyOf":[{"type":"object","properties":{"requested":{"type":"number"},"resolved":{"type":"number"},"omitted":{"type":"number"},"timedOut":{"type":"boolean"},"bytes":{"type":"number"}},"required":["requested","resolved","omitted","timedOut","bytes"]},{"type":"null"}]}}}}}}
```

## The reportPublishSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"reportPublishSchema":{"type":"object","properties":{"slug":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"consumerAccess":{"anyOf":[{"type":"string","enum":["private","workspace","organisation","public"]},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"widgetSnapshot":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"snapshotAt":{"type":["string","null"]},"snapshotStats":{"anyOf":[{"type":"object","properties":{"requested":{"type":"number"},"resolved":{"type":"number"},"omitted":{"type":"number"},"timedOut":{"type":"boolean"},"bytes":{"type":"number"}},"required":["requested","resolved","omitted","timedOut","bytes"]},{"type":"null"}]}}}}}}
```

## The ReportStatusSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ReportStatusSchema":{"type":"string","enum":["draft","ready","error"]}}}}
```

## The ResolvedEnvironmentGroupEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ResolvedEnvironmentGroupEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResolvedEnvironmentGroupSchema"}},"required":["data"]},"ResolvedEnvironmentGroupSchema":{"type":"object","properties":{"groupId":{"type":["string","null"]},"name":{"type":["string","null"]},"environmentColumns":{"type":"array","items":{"type":"string"}},"environments":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},"envKeys":{"type":"array","items":{"type":"string"}},"sampleSize":{"type":"number"},"totalEnvCount":{"type":"number"},"unresolvedEnvCount":{"type":"number","default":0},"matchedBeforeEvidenceFilter":{"type":["number","null"]},"unresolvable":{"anyOf":[{"$ref":"#/components/schemas/GroupUnresolvableSchema"},{"type":"null"}]}},"required":["environmentColumns","environments","envKeys","sampleSize","totalEnvCount"]},"GroupUnresolvableSchema":{"type":"object","properties":{"reason":{"type":"string","enum":["noEnvironmentColumns","unknownEnvironmentColumn","shapeMismatch","unknownFilterColumn","filterQueryFailed","noEvidence"]},"message":{"type":"string"},"columns":{"type":"array","items":{"type":"string"},"default":[]}},"required":["reason","message"]}}}}
```

## The ResolvedEnvironmentGroupSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ResolvedEnvironmentGroupSchema":{"type":"object","properties":{"groupId":{"type":["string","null"]},"name":{"type":["string","null"]},"environmentColumns":{"type":"array","items":{"type":"string"}},"environments":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},"envKeys":{"type":"array","items":{"type":"string"}},"sampleSize":{"type":"number"},"totalEnvCount":{"type":"number"},"unresolvedEnvCount":{"type":"number","default":0},"matchedBeforeEvidenceFilter":{"type":["number","null"]},"unresolvable":{"anyOf":[{"$ref":"#/components/schemas/GroupUnresolvableSchema"},{"type":"null"}]}},"required":["environmentColumns","environments","envKeys","sampleSize","totalEnvCount"]},"GroupUnresolvableSchema":{"type":"object","properties":{"reason":{"type":"string","enum":["noEnvironmentColumns","unknownEnvironmentColumn","shapeMismatch","unknownFilterColumn","filterQueryFailed","noEvidence"]},"message":{"type":"string"},"columns":{"type":"array","items":{"type":"string"},"default":[]}},"required":["reason","message"]}}}}
```

## The ResolveEnvironmentGroupInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ResolveEnvironmentGroupInput":{"type":"object","properties":{"groupId":{"type":"string","description":"Id of a saved environment group on this twin"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema","description":"An ad-hoc membership rule to resolve without saving it"}}},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The ResolveEnvironmentsInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ResolveEnvironmentsInput":{"type":"object","properties":{"statFilters":{"type":"object","additionalProperties":{},"description":"A filter group: {booleanOperator: AND | OR, filters: [{column, comparisonOperator, value, reduce}]} — reduce is value (constant per environment), mean/min/max (numeric aggregate), or any (at least one matching row); groups nest"}},"required":["statFilters"]}}}}
```

## The RichDescriptionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RichDescriptionSchema":{"type":"object","properties":{"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}}},"required":["markdown","widgets"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]}}}}
```

## The RootCauseAnalysisRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The RootCauseAnalysisResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RootCauseAnalysisResultSchema":{"type":"object","properties":{"sampleResults":{"type":"array","items":{"$ref":"#/components/schemas/SampleRcaResultSchema"}},"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"executionTime":{"type":"number","default":0}},"required":["sampleResults"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]}}}}
```

## The RuleStrengthEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"RuleStrengthEnum":{"type":"string","enum":["hard","soft"]}}}}
```

## The SampleAnomalyScanResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SampleAnomalyScanResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number"},"isAnomalous":{"type":"boolean"},"systemScore":{"type":"number"},"flaggedNodes":{"type":"array","items":{"$ref":"#/components/schemas/AnomalyFlagResultSchema"},"default":[]},"allSurprises":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["sampleIndex","isAnomalous","systemScore"]},"AnomalyFlagResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"conditionalZ":{"type":"number"},"marginalZ":{"type":"number"},"isRootNode":{"type":"boolean"},"confidence":{"type":"number"},"graphDepth":{"type":"number"},"variableThreshold":{"type":["number","null"]}},"required":["variable","conditionalZ","marginalZ","isRootNode","confidence","graphDepth"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]}}}}
```

## The SampleRcaResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]}}}}
```

## The SampleTwinInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SampleTwinInput":{"type":"object","properties":{"spec":{"type":"object","additionalProperties":{},"description":"Sampling spec, discriminated by type: intervention (static/temporal twins), time_series_intervention, or panel_intervention (multi-environment twins, optional environments list). Carries interventions with valueSpec (setValue, relativeChange, setProbability, …) and optional per-intervention conditions. Deep validation happens server-side."},"n":{"type":"integer","minimum":1,"maximum":100000,"description":"Number of joint posterior draws (default 1000)"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Reproducibility seed. Panel twins derive a stable per-environment child seed from it."}},"required":["spec"]}}}}
```

## The ScenarioFromQueryInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ScenarioFromQueryInput":{"type":"object","properties":{"query":{"type":"string","minLength":1},"scenarioType":{"type":["string","null"]}},"required":["query"]}}}}
```

## The ScenarioSamplesRefSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The ScenarioTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ScenarioTypeEnum":{"type":"string","enum":["optimisation","intervention","temporal_intervention","prediction","counterfactual","explanation","parent_impact","forecast","temporal_explanation","temporal_counterfactual","temporal_optimisation","panel_forecast","panel_intervention","panel_explanation","panel_counterfactual","panel_optimisation","panel_parent_impact","root_cause_analysis","temporal_root_cause_analysis","panel_root_cause_analysis","static_panel_root_cause_analysis","anomaly_detection","temporal_anomaly_detection","panel_anomaly_detection","static_panel_anomaly_detection","causal_health_monitor","panel_causal_health_monitor"]}}}}
```

## The SchemaEntryModelSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]}}}}
```

## The SchemaMainTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}}}}
```

## The SchemaSubTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]}}}}
```

## The ScoreRowsInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ScoreRowsInput":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":{}},"minItems":1,"maxItems":500,"description":"Rows to score; keys name twin variables (non-variable columns become row labels)"},"targets":{"type":"array","items":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"matchMode":{"type":"string"}},"required":["variable"],"additionalProperties":{}},"minItems":1,"description":"Outcomes each row should reach: [{variable, value, matchMode?}]"},"maxChanges":{"type":"integer","minimum":1,"maximum":10,"description":"Most changes a counterfactual may make per row (default 3)"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Per-variable constraints: {variable: {locked?, min?, max?, allowedValues?}}"},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Optional URL called once when the run completes"}},"required":["rows","targets"]}}}}
```

## The SeasonalEffectDecompositionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SeasonalEffectDecompositionSchema":{"type":"object","properties":{"component":{"type":"string"},"period":{"type":"number"},"periodEffects":{"type":"object","additionalProperties":{"type":"number"}},"strongestPeriod":{"type":"string"},"weakestPeriod":{"type":"string"}},"required":["component","period","periodEffects","strongestPeriod","weakestPeriod"]}}}}
```

## The SeasonalPeriodSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]}}}}
```

## The SeasonalTermSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]}}}}
```

## The SegmentDefinitionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]}}}}
```

## The SegmentEffectSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]}}}}
```

## The SegmentExplanationEffectSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SegmentExplanationEffectSchema":{"type":"object","properties":{"segmentId":{"type":"string","description":"Unique identifier for the segment"},"segmentDescription":{"type":"string","description":"Human-readable segment description"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"effectSize":{"type":"number","description":"Causal effect size in this segment"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"sampleSize":{"type":"number","description":"Number of samples in this segment"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification for this segment"},"nReplicates":{"type":["number","null"],"description":"Number of replicates"},"targetEffects":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"}},{"type":"null"}],"description":"Target-specific effects"}},"required":["segmentId","segmentDescription","conditions","effectSize","confidenceInterval","sampleSize","contrast"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"TargetEffectSchema":{"type":"object","properties":{"causeTarget":{"type":["string","number"],"description":"Target value of the cause"},"scalarEffect":{"type":"number","description":"Scalar effect size"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"Statistical significance level"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"}},"required":["causeTarget","scalarEffect","confidenceInterval","statisticalSignificance","nReplicates","effectiveSampleSize"]}}}}
```

## The SetConstraintSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]}}}}
```

## The SetMembersSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]}}}}
```

## The SetProbabilitySpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]}}}}
```

## The SetValueSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]}}}}
```

## The SimulateInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SimulateInput":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}}},"required":["sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]}}}}
```

## The SimulationEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SimulationEnvelope":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string","description":"The organisation id"},"workspaceId":{"type":"string","description":"The workspace id"},"digitalTwinId":{"type":"string","description":"The digital twin id"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"},"description":"The digital twin version ids that were used to run the simulation"},"userQuery":{"type":["string","null"],"description":"The user query that triggered the run"},"timeStarted":{"type":"string","description":"The time the run started"},"timeCompleted":{"type":["string","null"],"description":"The time the run completed"},"status":{"type":"string","enum":["pending","configuring","configured","running","completed","failed","cancelled"],"description":"The status of the run"},"error":{"type":["string","null"],"description":"The failure reason when the run failed"},"progress":{"anyOf":[{"$ref":"#/components/schemas/SimulationProgressSchema"},{"type":"null"}],"description":"The progress of the run"},"scenario":{"anyOf":[{"$ref":"#/components/schemas/DigitalTwinScenarioSchema"},{"type":"null"}],"description":"The scenario to run"},"outputs":{"anyOf":[{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/DigitalTwinPredictionResultSchema"},{"$ref":"#/components/schemas/OptimizationResultSchema"},{"$ref":"#/components/schemas/InterventionResultSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"$ref":"#/components/schemas/MultiCounterfactualExplanationSchema"},{"$ref":"#/components/schemas/ExplanationResultSchema"},{"$ref":"#/components/schemas/ParentImpactResultSchema"},{"$ref":"#/components/schemas/TemporalExplanationResultSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualExplanationSchema"},{"$ref":"#/components/schemas/TemporalOptimizationResultSchema"},{"$ref":"#/components/schemas/PanelForecastResultSchema"},{"$ref":"#/components/schemas/PanelInterventionResultSchema"},{"$ref":"#/components/schemas/PanelExplanationResultSchema"},{"$ref":"#/components/schemas/PanelCounterfactualResultSchema"},{"$ref":"#/components/schemas/PanelOptimizationResultSchema"},{"$ref":"#/components/schemas/PanelParentImpactResultSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisResultSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisResultSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisResultSchema"},{"$ref":"#/components/schemas/AnomalyDetectionResultSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionResultSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionResultSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionResultSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorResultSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorResultSchema"}]}},{"type":"null"}],"description":"The output of the run"},"outputsStorageType":{"anyOf":[{"type":"string","enum":["inline","data_lake"]},{"type":"null"}],"description":"Where outputs are stored"},"resultsSummary":{"anyOf":[{"type":"object","properties":{"summary":{"type":"string"},"keyPoints":{"type":"array","items":{"type":"string"}}},"required":["summary","keyPoints"]},{"type":"null"}],"description":"AI generated summary of the run results"},"environmentGroupSnapshots":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentGroupSnapshotSchema"}},{"type":"null"}],"description":"Resolved membership of each scoped environment group, frozen at submit"},"executedByUserId":{"type":["string","null"],"description":"The user who triggered the run"},"applicationExecutionId":{"type":["string","null"],"description":"Set when an application execution triggered the run"},"exportFormats":{"type":"array","items":{"type":"string","enum":["json","csv"]},"description":"Formats /results accepts; empty until the run completes"}},"required":["id","organisationId","workspaceId","digitalTwinId","digitalTwinVersionIds","timeStarted","status","exportFormats"]}},"required":["data"]},"SimulationProgressSchema":{"type":"object","properties":{"percentage":{"type":"number"},"state":{"type":"string"},"eta":{"type":["number","null"]}},"required":["percentage","state"]},"DigitalTwinScenarioSchema":{"anyOf":[{"$ref":"#/components/schemas/OptimisationScenarioSchema"},{"$ref":"#/components/schemas/StaticInterventionSpecSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionSpecSchema"},{"$ref":"#/components/schemas/MultiCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PredictionWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/ExplanationRequestSchema"},{"$ref":"#/components/schemas/ParentImpactRequestSchema"},{"$ref":"#/components/schemas/ForecastWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/TemporalExplanationRequestSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualRequestSchema"},{"$ref":"#/components/schemas/TemporalOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelForecastRequestSchema"},{"$ref":"#/components/schemas/PanelInterventionSpecSchema"},{"$ref":"#/components/schemas/PanelExplanationRequestSchema"},{"$ref":"#/components/schemas/PanelCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PanelOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelParentImpactRequestSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/TemporalRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/AnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorRequestSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorRequestSchema"}]},"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}},"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]},"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]},"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]},"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]},"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]},"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"DigitalTwinPredictionResultSchema":{"type":"object","properties":{"results":{"type":"object","additionalProperties":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/CategoricalPredictionRecordSchema"},{"$ref":"#/components/schemas/ContinuousPredictionRecordSchema"}]}}},"changepoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ForecastChangepointSchema"}}},{"type":"null"}],"description":"Detected changepoints per variable"},"history":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ForecastHistorySeriesSchema"}},{"type":"null"}],"description":"Per-variable trailing observed history from the model's stored training series"}},"required":["results"]},"CategoricalPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"description":"Predicted class (most likely) in decoded format"},"probabilities":{"type":"array","items":{"type":"number"},"description":"Raw predicted probabilities for each class"},"lowerBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Lower bounds of confidence intervals for probabilities"},"upperBound":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Upper bounds of confidence intervals for probabilities"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"}},"required":["probabilities"]},"ContinuousPredictionRecordSchema":{"type":"object","properties":{"timestamp":{"type":["number","null"],"description":"Timestamp of the prediction"},"prediction":{"type":["number","null"],"description":"Predicted value in decoded format"},"std":{"type":["number","null"],"description":"Standard deviation of prediction in decoded scale"},"lowerBound":{"type":["number","null"],"description":"Lower bound of confidence interval in decoded format"},"upperBound":{"type":["number","null"],"description":"Upper bound of confidence interval in decoded format"},"confidenceLevel":{"type":["number","null"],"description":"Confidence level for bounds"},"attribution":{"anyOf":[{"$ref":"#/components/schemas/ForecastComponentAttributionSchema"},{"type":"null"}],"description":"Component attribution for this prediction step"}}},"ForecastComponentAttributionSchema":{"type":"object","properties":{"trend":{"type":["number","null"],"description":"Adaptive trend contribution"},"seasonal":{"type":["number","null"],"description":"Seasonal component contribution"},"parents":{"type":["number","null"],"description":"Total parent causal effect"},"delta":{"type":["number","null"],"description":"Level/drift contribution"},"parentBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"anyOf":[{"not":{}},{"type":["number","null"]}]}},{"type":"null"}],"description":"Per-parent contribution breakdown"}}},"ForecastChangepointSchema":{"type":"object","properties":{"stepIndex":{"type":"number","description":"Step index where changepoint occurs"},"timestamp":{"type":"number","description":"Timestamp of the changepoint"},"direction":{"type":"string","enum":["up","down","inflection"],"description":"Direction of the change"},"magnitude":{"type":"number","description":"Magnitude of the change"},"primaryDriver":{"type":"string","description":"Primary driver of the change"},"driverContribution":{"type":"number","description":"Contribution of the primary driver"}},"required":["stepIndex","timestamp","direction","magnitude","primaryDriver","driverContribution"]},"ForecastHistorySeriesSchema":{"type":"object","properties":{"timestamps":{"type":"array","items":{"type":"number"},"description":"Trailing observed-history timestamps in ms, ending at the model's last training step"},"values":{"type":"array","items":{"type":["number","null"]},"description":"Observed values aligned with timestamps; null entries mark missing source rows"}},"required":["timestamps","values"]},"OptimizationResultSchema":{"type":"object","properties":{"paretoFront":{"type":"array","items":{"$ref":"#/components/schemas/ParetoDominantSolutionSchema"},"description":"Pareto-optimal solutions"},"optimizationTrace":{"type":"array","items":{"$ref":"#/components/schemas/OptimizationTraceSchema"},"description":"Record of optimization progress"},"baselineMetrics":{"type":"object","additionalProperties":{"type":"number"},"description":"Baseline metrics for objectives"},"constraintBaselineMetrics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Baseline metrics for constraint metrics"},"balancedSolution":{"anyOf":[{"$ref":"#/components/schemas/ParetoDominantSolutionSchema"},{"type":"null"}],"description":"Balanced solution closest to ideal point (for multi-objective)"},"bestPerObjective":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ParetoDominantSolutionSchema"}},{"type":"null"}],"description":"Best solution for each individual objective"},"allConstraintsSatisfiable":{"type":"boolean","default":true,"description":"Whether any solution satisfying all constraints was found"},"executionTime":{"type":"number","default":0,"description":"Execution time in seconds"},"metricScaleBases":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MetricScaleBasisSchema"}},{"type":"null"}],"description":"Per-metric scale basis: intensive metrics read directly from the simulation, extensive ones are rescaled to the source data's row count"}},"required":["paretoFront","optimizationTrace","baselineMetrics"]},"ParetoDominantSolutionSchema":{"type":"object","properties":{"interventions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Interventions in this solution"},"interventionCount":{"type":"number","default":0,"description":"Number of interventions in this solution"},"objectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Values of the objectives"},"implementationDifficulty":{"type":["number","null"],"description":"Difficulty of implementing this solution"},"expectedOutcomes":{"type":"object","additionalProperties":{},"description":"Expected outcomes of the solution"},"uncertainty":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Uncertainty in objective values"},"improvementOverBaseline":{"type":"object","additionalProperties":{"type":"number"},"description":"Improvements over baseline"},"constraintsSatisfied":{"type":"boolean","default":true,"description":"Whether all constraints were satisfied by this solution"},"constraintViolations":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Descriptions of constraint violations if any"},"targetsAchieved":{"anyOf":[{"type":"object","additionalProperties":{"type":"boolean"}},{"type":"null"}],"description":"Whether each objective's target was achieved"},"segmentResults":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Per-segment objective values: {segment_id: {objective_name: value}}"},"segmentSampleSizes":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-segment sample sizes: {segment_id: sample_count}"},"segmentInterventions":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Segment-specific interventions with conditions"},"totalSampleCount":{"type":["number","null"]},"affectedSampleCount":{"type":["number","null"]},"affectedPercentage":{"type":["number","null"]},"appliedInterventions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"}},{"type":"null"}],"description":"The exact intervention rows the evaluator ran for this plan, after scoping and relative-mode conversion"},"interventionResult":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"$ref":"#/components/schemas/InterventionResultSchema"}]},{"type":"null"}],"description":"The plan re-run as an intervention scenario; null on older runs, panel temporal runs, and when the plan's run failed"}},"required":["interventions","objectiveValues","expectedOutcomes","uncertainty","improvementOverBaseline"]},"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"InterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"OptimizationTraceSchema":{"type":"object","properties":{"iteration":{"type":"number","description":"Iteration number"},"bestObjectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Best objective values found"},"populationDiversity":{"type":"number","description":"Diversity of the population"}},"required":["iteration","bestObjectiveValues","populationDiversity"]},"MetricScaleBasisSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["intensive","extensive","unknown"],"description":"Whether the metric's level scales with the sampled table's row count"},"sampleRows":{"type":"number","description":"Rows in the sampled table the metric was computed over"},"sourceRows":{"type":["number","null"],"description":"Rows in the twin's source data; the rescale target for extensive metrics"},"rescaled":{"type":"boolean","default":false,"description":"Whether absolute values for this metric were rescaled"},"rescaledTo":{"anyOf":[{"type":"string","enum":["source_rows","single_path"]},{"type":"null"}],"description":"What an extensive metric was rescaled to: the source data's row count (static) or one simulated future path (temporal)"}},"required":["kind","sampleRows"]},"MultiCounterfactualExplanationSchema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualExplanationSchema"},"description":"List of counterfactual results, one per input sample"}},"required":["results"]},"CounterfactualExplanationSchema":{"type":"object","properties":{"originalSample":{"type":"object","additionalProperties":{},"description":"Original sample this explanation corresponds to"},"imputedVariables":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"Non-target variables the request left null, with the value the twin filled in from its own marginal before predicting and searching. originalSample already contains these fills."},"currentPrediction":{"type":"object","additionalProperties":{},"description":"Dictionary mapping each requested target variable to its predicted value in the original sample."},"requestedTargets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"The list of target conditions requested for this sample."},"counterfactuals":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualSchema"},"description":"List of counterfactual solutions found (if any)."},"searchStatus":{"$ref":"#/components/schemas/CounterfactualSearchStatusSchema","default":"searched","description":"'searched' means the solver evaluated candidates for this sample; 'failed' means the search could not run, so an empty counterfactual list is not evidence of infeasibility."},"failureReason":{"type":["string","null"],"description":"Actionable reason the search could not run for this sample. Set only when searchStatus is 'failed'."}},"required":["originalSample","currentPrediction","requestedTargets","counterfactuals"]},"CounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/VariableChangeSchema"},"description":"Changes made to variables"},"predictedOutcomes":{"type":"object","additionalProperties":{},"description":"Dictionary mapping each target variable to its predicted value (decoded) under these changes."},"allTargetsMet":{"type":"boolean","description":"Indicates if all requested target conditions were met by this counterfactual."},"certainty":{"type":"number","default":0.8,"description":"Confidence or certainty measure of this counterfactual outcome (heuristic)."},"matchStatus":{"$ref":"#/components/schemas/CounterfactualMatchStatusSchema","default":"exact","description":"Why this counterfactual was kept: exact match, within configured tolerance, or closest non-matching fallback."},"targetDistances":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-target signed distance (predicted - target) for numeric targets, for UI display."}},"required":["changes","predictedOutcomes","allTargetsMet"]},"VariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to change"},"fromValue":{"description":"Original value"},"toValue":{"description":"New value"},"importance":{"type":"number","description":"Importance of the change"}},"required":["variable","importance"]},"CounterfactualMatchStatusSchema":{"type":"string","enum":["exact","withinTolerance","closest"]},"CounterfactualSearchStatusSchema":{"type":"string","enum":["searched","failed"]},"ExplanationResultSchema":{"type":"object","properties":{"explanationType":{"type":"string","enum":["directional","discovery","impact"],"description":"Type of explanation performed"},"causalRelationships":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"}},{"type":"null"}],"description":"For directional explanations"},"driverRanking":{"anyOf":[{"$ref":"#/components/schemas/DriverRankingSchema"},{"type":"null"}],"description":"For discovery explanations"},"impactAnalysis":{"anyOf":[{"$ref":"#/components/schemas/ImpactAnalysisSchema"},{"type":"null"}],"description":"For impact explanations"},"executionTime":{"type":"number","description":"Time taken to generate explanation"},"sampleSize":{"type":"number","description":"Number of samples used in analysis"}},"required":["explanationType","executionTime","sampleSize"]},"CausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string","description":"The cause variable"},"effectVar":{"type":"string","description":"The effect variable"},"overallEffect":{"type":"object","properties":{"effectSize":{"type":"number","description":"Average causal effect size"},"effectRange":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Min and max effect across tested values"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"95% confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"P-value for statistical significance"},"categoryEffects":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Effects by category (for categorical causes)"},"targetEffects":{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"},"description":"Effects for specific target values"},"baselineOutcomeProbs":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Baseline outcome probabilities"},"targetOutcomeDeltas":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Changes in outcome probabilities"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"},"summaryMethod":{"type":"string","description":"Method used to summarize effects"}},"required":["effectSize","confidenceInterval","statisticalSignificance","targetEffects","contrast","nReplicates","effectiveSampleSize","summaryMethod"],"description":"Overall causal effect analysis"},"doseResponse":{"anyOf":[{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"},{"type":"null"}],"description":"Dose-response curve (for continuous causes)"},"segmentEffects":{"type":"array","items":{"$ref":"#/components/schemas/SegmentExplanationEffectSchema"},"description":"Effects by segment"},"pathwayEffects":{"type":"object","properties":{"mode":{"type":"string","enum":["qualitative","additive"],"description":"Analysis mode"},"directEffect":{"type":["number","null"],"description":"Direct effect if variables are connected"},"indirectEffects":{"type":"array","items":{"$ref":"#/components/schemas/PathwayEffectSchema"},"description":"Effects through indirect pathways"},"totalEffect":{"type":["number","null"],"description":"Sum of all pathway effects"},"sumToOverall":{"type":"boolean","description":"Whether pathway effects sum to overall effect"}},"required":["mode","indirectEffects","sumToOverall"],"description":"Analysis of causal pathways"},"units":{"type":"string","enum":["probability","value"],"description":"Units of the effect measurement"},"summaryMethod":{"type":"string","description":"Method used to summarize the analysis"}},"required":["causeVar","effectVar","overallEffect","segmentEffects","pathwayEffects","units","summaryMethod"]},"TargetEffectSchema":{"type":"object","properties":{"causeTarget":{"type":["string","number"],"description":"Target value of the cause"},"scalarEffect":{"type":"number","description":"Scalar effect size"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"Statistical significance level"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"}},"required":["causeTarget","scalarEffect","confidenceInterval","statisticalSignificance","nReplicates","effectiveSampleSize"]},"SegmentExplanationEffectSchema":{"type":"object","properties":{"segmentId":{"type":"string","description":"Unique identifier for the segment"},"segmentDescription":{"type":"string","description":"Human-readable segment description"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"effectSize":{"type":"number","description":"Causal effect size in this segment"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"sampleSize":{"type":"number","description":"Number of samples in this segment"},"contrast":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"],"description":"Contrast specification for this segment"},"nReplicates":{"type":["number","null"],"description":"Number of replicates"},"targetEffects":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TargetEffectSchema"}},{"type":"null"}],"description":"Target-specific effects"}},"required":["segmentId","segmentDescription","conditions","effectSize","confidenceInterval","sampleSize","contrast"]},"PathwayEffectSchema":{"type":"object","properties":{"pathway":{"type":"array","items":{"type":"string"},"description":"Variables in the causal pathway"},"effectContribution":{"type":["number","null"],"description":"Contribution of this pathway to total effect"},"percentageOfTotal":{"type":["number","null"],"description":"Percentage of total effect through this pathway"},"note":{"type":["string","null"],"description":"Additional notes about the pathway"}},"required":["pathway"]},"DriverRankingSchema":{"type":"object","properties":{"targetVariable":{"type":"string","description":"The outcome variable being explained"},"drivers":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"},"description":"Causal drivers ranked by effect size"}},"required":["targetVariable","drivers"]},"ImpactAnalysisSchema":{"type":"object","properties":{"sourceVariable":{"type":"string","description":"The variable whose impacts are analyzed"},"impacts":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipAnalysisSchema"},"description":"Variables impacted by the source"}},"required":["sourceVariable","impacts"]},"ParentImpactResultSchema":{"type":"object","properties":{"nodeImpacts":{"type":"array","items":{"$ref":"#/components/schemas/NodeParentImpactsSchema"}},"executionTime":{"type":"number"},"sampleSize":{"type":["number","null"]}},"required":["nodeImpacts","executionTime"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]},"TemporalExplanationResultSchema":{"type":"object","properties":{"explanationType":{"type":"string","enum":["directional","discovery","impact"]},"causalRelationships":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalRelationshipAnalysisSchema"}},{"type":"null"}]},"forecastHorizonUsed":{"type":"number"},"executionTime":{"type":"number"}},"required":["explanationType","forecastHorizonUsed","executionTime"]},"TemporalCausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string"},"effectVar":{"type":"string"},"overallEffect":{"$ref":"#/components/schemas/TemporalOverallEffectAnalysisSchema"},"effectPropagation":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},{"type":"null"}]},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["causeVar","effectVar","overallEffect","causalPaths"]},"TemporalOverallEffectAnalysisSchema":{"type":"object","properties":{"effectSize":{"type":"number"},"effectRange":{"type":"array","items":{"type":"number"}},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"},"lagEffects":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalStrengthSchema"}},"seasonalEffects":{"type":"array","items":{"$ref":"#/components/schemas/SeasonalEffectDecompositionSchema"}},"impulseResponse":{"type":"array","items":{"type":"number"}},"cumulativeEffect":{"type":"number"},"peakEffectLag":{"type":"number"},"contrast":{"$ref":"#/components/schemas/ContrastSchema"}},"required":["effectSize","effectRange","confidenceInterval","statisticalSignificance","lagEffects","seasonalEffects","impulseResponse","cumulativeEffect","peakEffectLag","contrast"]},"TemporalCausalStrengthSchema":{"type":"object","properties":{"lag":{"type":"number"},"effectSize":{"type":"number"},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"}},"required":["lag","effectSize","confidenceInterval","statisticalSignificance"]},"SeasonalEffectDecompositionSchema":{"type":"object","properties":{"component":{"type":"string"},"period":{"type":"number"},"periodEffects":{"type":"object","additionalProperties":{"type":"number"}},"strongestPeriod":{"type":"string"},"weakestPeriod":{"type":"string"}},"required":["component","period","periodEffects","strongestPeriod","weakestPeriod"]},"ContrastSchema":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"]},"TemporalCounterfactualExplanationSchema":{"type":"object","properties":{"currentState":{"type":"object","additionalProperties":{}},"baselineTrajectory":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},"requestedTargets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"counterfactuals":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualSchema"}},"baselineAlreadyMeetsTarget":{"type":["boolean","null"]},"baselineAchievedAt":{"type":["number","null"]}},"required":["currentState","baselineTrajectory","requestedTargets","counterfactuals"]},"TemporalCounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/TemporalVariableChangeSchema"}},"predictedTrajectories":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},"targetAchievedAt":{"type":["number","null"]},"allTargetsMet":{"type":"boolean"},"certainty":{"type":"number"}},"required":["changes","predictedTrajectories","allTargetsMet","certainty"]},"TemporalVariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string"},"fromValue":{},"toValue":{},"timestamp":{"type":["number","null"]},"persistent":{"type":"boolean","default":true},"rampSteps":{"type":["number","null"]},"importance":{"type":"number","default":1}},"required":["variable"]},"TemporalOptimizationResultSchema":{"type":"object","properties":{"paretoFront":{"type":"array","items":{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"}},"baselineMetrics":{"type":"object","additionalProperties":{"type":"number"}},"balancedSolution":{"anyOf":[{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"},{"type":"null"}]},"bestPerObjective":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"},"executionTime":{"type":"number"},"allConstraintsSatisfiable":{"type":"boolean","default":true,"description":"Whether any plan satisfying every metric constraint was found"},"metricScaleBases":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MetricScaleBasisSchema"}},{"type":"null"}],"description":"Per-objective scale basis; an extensive metric over the stacked Monte Carlo paths is rescaled to a single path"}},"required":["paretoFront","baselineMetrics","forecastHorizon","executionTime"]},"TemporalParetoDominantSolutionSchema":{"type":"object","properties":{"interventions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Interventions in this solution"},"interventionCount":{"type":"number","default":0,"description":"Number of interventions in this solution"},"objectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Values of the objectives"},"implementationDifficulty":{"type":["number","null"],"description":"Difficulty of implementing this solution"},"expectedOutcomes":{"type":"object","additionalProperties":{},"description":"Expected outcomes of the solution"},"uncertainty":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Uncertainty in objective values"},"improvementOverBaseline":{"type":"object","additionalProperties":{"type":"number"},"description":"Improvements over baseline"},"constraintsSatisfied":{"type":"boolean","default":true,"description":"Whether all constraints were satisfied by this solution"},"constraintViolations":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Descriptions of constraint violations if any"},"targetsAchieved":{"anyOf":[{"type":"object","additionalProperties":{"type":"boolean"}},{"type":"null"}],"description":"Whether each objective's target was achieved"},"segmentResults":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Per-segment objective values: {segment_id: {objective_name: value}}"},"segmentSampleSizes":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-segment sample sizes: {segment_id: sample_count}"},"segmentInterventions":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Segment-specific interventions with conditions"},"totalSampleCount":{"type":["number","null"]},"affectedSampleCount":{"type":["number","null"]},"affectedPercentage":{"type":["number","null"]},"appliedInterventions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"}},{"type":"null"}],"description":"The exact intervention rows the evaluator ran for this plan, after scoping and relative-mode conversion"},"interventionResult":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"type":"null"}],"description":"The plan re-run as a Monte Carlo temporal intervention over the same horizon"},"interventionSequence":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"forecastTrajectories":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},{"type":"null"}],"description":"Superseded by interventionResult.forecastData; empty on runs that carry a per-plan result"}},"required":["interventions","objectiveValues","expectedOutcomes","uncertainty","improvementOverBaseline","interventionSequence"]},"PanelForecastResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DigitalTwinPredictionResultSchema"},"description":"Forecast results per environment"},"aggregateResult":{"anyOf":[{"$ref":"#/components/schemas/DigitalTwinPredictionResultSchema"},{"type":"null"}],"description":"Aggregated forecast result across environments"},"environmentCoverage":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentCoverageSchema"},{"type":"null"}],"description":"Requested-vs-forecast environment coverage; absent on runs that predate tracking and read as full"}},"required":["environmentResults"]},"EnvironmentCoverageSchema":{"type":"object","properties":{"requested":{"type":"number"},"forecast":{"type":"number"},"failed":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentForecastFailureSchema"},"default":[]},"omittedFailures":{"type":"number","default":0}},"required":["requested","forecast"]},"EnvironmentForecastFailureSchema":{"type":"object","properties":{"environment":{"type":"string"},"reason":{"type":"string"}},"required":["environment","reason"]},"PanelInterventionResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},"description":"Intervention results per environment"},"aggregateResult":{"anyOf":[{"$ref":"#/components/schemas/PanelInterventionAggregateSchema"},{"type":"null"}],"description":"All-environments aggregate shaped like a per-environment result"}},"required":["environmentResults"]},"PanelInterventionAggregateSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"},"crossEnvironment":{"anyOf":[{"$ref":"#/components/schemas/CrossEnvironmentStatsSchema"},{"type":"null"}],"description":"Distribution of per-environment effects, which the mean result cannot express"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"CrossEnvironmentStatsSchema":{"type":"object","properties":{"scope":{"type":["string","null"]},"environmentCount":{"type":["number","null"]},"totalEnvironments":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"environmentsMissingResult":{"type":["number","null"]},"metrics":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PanelAggregateMetricStatsSchema"}},{"type":"null"}]}}},"PanelAggregateMetricStatsSchema":{"type":"object","properties":{"environmentCount":{"type":["number","null"]},"environmentsWithoutEffect":{"type":["number","null"]},"meanEffect":{"type":["number","null"]},"medianEffect":{"type":["number","null"]},"p10Effect":{"type":["number","null"]},"p90Effect":{"type":["number","null"]},"shareNegative":{"type":["number","null"]},"sharePositive":{"type":["number","null"]},"baselineMean":{"type":["number","null"]},"interventionMean":{"type":["number","null"]},"medianRelativeEffect":{"type":["number","null"]},"shareSignificant":{"type":["number","null"]}}},"PanelExplanationResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalExplanationResultSchema"},"description":"Explanation results per environment"}},"required":["environmentResults"]},"PanelCounterfactualResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalCounterfactualExplanationSchema"},"description":"Counterfactual results per environment"}},"required":["environmentResults"]},"PanelOptimizationResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalOptimizationResultSchema"},"description":"Optimization results per environment"}},"required":["environmentResults"]},"PanelParentImpactResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ParentImpactResultSchema"},"description":"Parent impact results per environment"}},"required":["environmentResults"]},"RootCauseAnalysisResultSchema":{"type":"object","properties":{"sampleResults":{"type":"array","items":{"$ref":"#/components/schemas/SampleRcaResultSchema"}},"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"executionTime":{"type":"number","default":0}},"required":["sampleResults"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"PanelRootCauseAnalysisResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RootCauseAnalysisResultSchema"}}},"required":["environmentResults"]},"StaticPanelRootCauseAnalysisResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RootCauseAnalysisResultSchema"}}},"required":["environmentResults"]},"AnomalyDetectionResultSchema":{"type":"object","properties":{"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"totalSamplesScanned":{"type":"number"},"samples":{"type":"array","items":{"$ref":"#/components/schemas/SampleAnomalyScanResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalSamplesScanned"]},"SampleAnomalyScanResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number"},"isAnomalous":{"type":"boolean"},"systemScore":{"type":"number"},"flaggedNodes":{"type":"array","items":{"$ref":"#/components/schemas/AnomalyFlagResultSchema"},"default":[]},"allSurprises":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["sampleIndex","isAnomalous","systemScore"]},"AnomalyFlagResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"conditionalZ":{"type":"number"},"marginalZ":{"type":"number"},"isRootNode":{"type":"boolean"},"confidence":{"type":"number"},"graphDepth":{"type":"number"},"variableThreshold":{"type":["number","null"]}},"required":["variable","conditionalZ","marginalZ","isRootNode","confidence","graphDepth"]},"TemporalAnomalyDetectionResultSchema":{"type":"object","properties":{"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"totalTimestepsScanned":{"type":"number"},"timesteps":{"type":"array","items":{"$ref":"#/components/schemas/SampleAnomalyScanResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalTimestepsScanned"]},"PanelAnomalyDetectionResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalAnomalyDetectionResultSchema"}}},"required":["environmentResults"]},"StaticPanelAnomalyDetectionResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AnomalyDetectionResultSchema"}}},"required":["environmentResults"]},"CausalHealthMonitorResultSchema":{"type":"object","properties":{"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"totalTimestepsScanned":{"type":"number"},"startTimestampMs":{"type":["number","null"]},"granularityMs":{"type":["number","null"]},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/ConditionScanTimestepResultSchema"}},"nodeSummaries":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"}},"causalAlertOrdering":{"type":"array","items":{"$ref":"#/components/schemas/CausalAlertEntryResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]},"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"eventLog":{"type":"array","items":{"$ref":"#/components/schemas/EventLogEntryResultSchema"},"default":[]},"leadLag":{"type":"array","items":{"$ref":"#/components/schemas/LeadLagEntryResultSchema"},"default":[]},"edgePropagation":{"type":"array","items":{"$ref":"#/components/schemas/EdgePropagationSeriesResultSchema"},"default":[]},"forecastedSamples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"causalEdges":{"type":"array","items":{"$ref":"#/components/schemas/CausalEdgeResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalTimestepsScanned","timeline","nodeSummaries"]},"ConditionScanTimestepResultSchema":{"type":"object","properties":{"timestep":{"type":"number"},"timestampMs":{"type":["number","null"]},"systemHealthScore":{"type":"number"},"nodeStatuses":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"}},"spikeAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"trendAlerts":{"type":"array","items":{"$ref":"#/components/schemas/NodeConditionStatusResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["timestep","systemHealthScore","nodeStatuses"]},"NodeConditionStatusResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"currentZ":{"type":"number"},"ewmaZ":{"type":"number"},"trendSlope":{"type":"number"},"cusum":{"type":"number"},"stepsElevated":{"type":"number"},"isRootNode":{"type":"boolean"},"graphDepth":{"type":"number"},"confidence":{"type":"number"},"causalDepth":{"type":"number","default":0},"variableThreshold":{"type":["number","null"]},"marginalZScore":{"type":"number","default":0},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"recovered":{"type":"boolean","default":false}},"required":["variable","alertType","currentZ","ewmaZ","trendSlope","cusum","stepsElevated","isRootNode","graphDepth","confidence"]},"AlertTypeEnum":{"type":"string","enum":["spike","worsening","improving","sustained","normal"]},"CausalAlertEntryResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"causalDepth":{"type":"number"},"firstAlertStep":{"type":"number"},"alertType":{"$ref":"#/components/schemas/AlertTypeEnum"},"ewmaZ":{"type":"number"}},"required":["variable","causalDepth","firstAlertStep","alertType","ewmaZ"]},"EventLogEntryResultSchema":{"type":"object","properties":{"at":{"type":"number"},"atTimestampMs":{"type":["number","null"]},"kind":{"type":"string","enum":["first_alert","cascade","rca_verdict","recovered"]},"variable":{"type":["string","null"]},"alertType":{"type":["string","null"]},"ewmaZ":{"type":"number","default":0},"signedCurrentZ":{"type":"number","default":0},"sourceSignedZ":{"type":"number","default":0},"targetSignedZ":{"type":"number","default":0},"sentence":{"type":"string","default":""},"fromVar":{"type":["string","null"]},"toVar":{"type":["string","null"]},"lagSteps":{"type":["number","null"]},"correlation":{"type":["number","null"]},"target":{"type":["string","null"]},"rootCause":{"type":["string","null"]}},"required":["at","kind"]},"LeadLagEntryResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"lagSteps":{"type":"number"},"correlation":{"type":"number"}},"required":["source","target","lagSteps","correlation"]},"EdgePropagationSeriesResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"scores":{"type":"array","items":{"type":"number"}}},"required":["source","target","scores"]},"CausalEdgeResultSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"PanelCausalHealthMonitorResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CausalHealthMonitorResultSchema"}}},"required":["environmentResults"]},"EnvironmentGroupSnapshotSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"envKeys":{"type":"array","items":{"type":"string"}},"droppedEnvKeys":{"type":"array","items":{"type":"string"},"default":[]},"notice":{"type":["string","null"]}},"required":["id","name","envKeys"]}}}}
```

## The SimulationProgressSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SimulationProgressSchema":{"type":"object","properties":{"percentage":{"type":"number"},"state":{"type":"string"},"eta":{"type":["number","null"]}},"required":["percentage","state"]}}}}
```

## The SortColumnSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]}}}}
```

## The SortDirectionEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SortDirectionEnum":{"type":"string","enum":["asc","desc"]}}}}
```

## The SourceDeleteConflictProblem object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SourceDeleteConflictProblem":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"number","const":409},"detail":{"type":"string"},"instance":{"type":"string"},"blockingDigitalTwins":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The digital twins in this workspace trained on the source or on anything derived from it. Twins in workspaces this credential cannot reach are counted in `detail` rather than listed here."},"sharedSources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The sources in the deletion tree that are shared into other workspaces. Present when that is what blocks the delete."},"otherWorkspaceLinks":{"type":"number","description":"How many links into other workspaces those sources hold between them."}},"required":["type","title","status","detail","blockingDigitalTwins"]}}}}
```

## The SourceEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SourceEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Source"}},"required":["data"]},"Source":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"parentSourceId":{"type":["string","null"]},"dataSource":{"anyOf":[{"$ref":"#/components/schemas/DataSourceTypeEnum"},{"type":"null"}]},"dataFormat":{"$ref":"#/components/schemas/datasetFormatsEnum"},"description":{"type":["string","null"]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}},"richDescription":{"anyOf":[{"$ref":"#/components/schemas/RichDescriptionSchema"},{"type":"null"}]},"schemaEntries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"importWarnings":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ontologyMode":{"$ref":"#/components/schemas/OntologyModeEnum","default":"auto"},"documentCount":{"type":["number","null"]},"columnMetadata":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnMetadataSchema"}},{"type":"null"}]},"extension":{"type":["string","null"]},"totalSize":{"type":["number","null"]},"createdAt":{"type":["string","null"]},"lastSaved":{"type":["string","null"]},"virtual":{"type":["boolean","null"]},"ontologyStatus":{"anyOf":[{"$ref":"#/components/schemas/OntologyStatusEnum"},{"type":"null"}]},"ontologyError":{"type":["string","null"]},"extractionStatus":{"anyOf":[{"$ref":"#/components/schemas/ExtractionStatusEnum"},{"type":"null"}]},"extractionError":{"type":["string","null"]},"pageCount":{"type":["number","null"]},"derivedFromDatasetIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"derivedVia":{"anyOf":[{"$ref":"#/components/schemas/DerivedViaEnum"},{"type":"null"}]},"extractionRecipe":{"anyOf":[{"$ref":"#/components/schemas/ExtractionRecipeSchema"},{"type":"null"}]},"pendingAnnotationCount":{"type":["number","null"]},"ontologyExcludedFields":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string","enum":["auto","user","suggestion"]}},"required":["field","reason","source"]}},{"type":"null"}]},"batchRanges":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"fileName":{"type":"string"},"uploadedAt":{"type":"string"},"rowStart":{"type":"number"},"rowEnd":{"type":"number"}},"required":["hash","fileName","uploadedAt","rowStart","rowEnd"]}},{"type":"null"}]},"currentVersionId":{"type":["string","null"]},"latestVersionOrdinal":{"type":["number","null"]},"staging":{"type":["boolean","null"]},"readMode":{"type":"string","enum":["direct_query","snapshot"],"description":"How this source is read. direct_query runs every read against the origin database — live, but subject to its statement timeout, and no row count is recorded; snapshot reads a stored copy, which changes only when it is synced"},"directQuery":{"anyOf":[{"$ref":"#/components/schemas/directQuerySettingsSchema"},{"type":"null"}],"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}},"required":["id","organisationId","name","dataFormat","readMode","directQuery"]},"DataSourceTypeEnum":{"type":"string","enum":["Local Upload","API Upload","Web Research","Document Extraction","Workbook Extraction","PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]},"datasetFormatsEnum":{"type":"string","enum":["Folder","Tabular","Text","Workbook","PDF","DOCX","PPTX","Image","Audio","Video"]},"RichDescriptionSchema":{"type":"object","properties":{"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}}},"required":["markdown","widgets"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"OntologyModeEnum":{"type":"string","enum":["auto","manual"]},"ColumnMetadataSchema":{"type":"object","properties":{"dtype":{"type":["string","null"]},"categoryOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"distribution":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"rangeFrom":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"rangeTo":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"mean":{"type":["number","null"]},"stringPattern":{"type":["string","null"]},"jsonObjectFraction":{"type":["number","null"]},"cardinality":{"type":["number","null"]},"nullFraction":{"type":["number","null"]},"unparsedFormat":{"type":["string","null"]},"processing":{"type":["boolean","null"]},"metadataStatus":{"anyOf":[{"$ref":"#/components/schemas/MetadataStatusEnum"},{"type":"null"}]},"elementType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"minSize":{"type":["number","null"]},"maxSize":{"type":["number","null"]},"avgSize":{"type":["number","null"]},"medianSize":{"type":["number","null"]},"p95Size":{"type":["number","null"]},"nullCount":{"type":["number","null"]},"emptyCount":{"type":["number","null"]},"totalElementCount":{"type":["number","null"]},"sizeDistribution":{"anyOf":[{"$ref":"#/components/schemas/ArraySizeDistributionSchema"},{"type":"null"}]},"uniqueElementCount":{"type":["number","null"]},"avgUniquePerRow":{"type":["number","null"]},"elementOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"elementMin":{"type":["number","null"]},"elementMax":{"type":["number","null"]},"elementMean":{"type":["number","null"]},"elementSum":{"type":["number","null"]},"elementStddev":{"type":["number","null"]}}},"MetadataStatusEnum":{"type":"string","enum":["complete","partial_skipped_expensive","in_progress"]},"ArraySizeDistributionSchema":{"type":"object","properties":{"empty":{"type":"number","default":0},"oneToThree":{"type":"number","default":0},"fourToTen":{"type":"number","default":0},"elevenToFifty":{"type":"number","default":0},"fiftyPlus":{"type":"number","default":0}}},"OntologyStatusEnum":{"type":"string","enum":["pending","extracting","consolidation_queued","consolidating","detecting_derived","analyzing_dependencies","profiling_time_series","completed","extraction_failed","consolidation_failed","derived_detection_failed","relationship_detection_failed","cross_relationship_detection_failed","dependency_analysis_failed","time_series_profiling_failed","cancelled","manual_pending"]},"ExtractionStatusEnum":{"type":"string","enum":["pending","extracting","completed","failed"]},"DerivedViaEnum":{"type":"string","enum":["document_tables","document_homogenisation","document_entities","workbook_sql"]},"ExtractionRecipeSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["schema","entities"]},"sourceDocumentIds":{"type":"array","items":{"type":"string"}},"columns":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"entityTypes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true},"default":[]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"targetName":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"lastAppendedAt":{"type":["string","null"]}},"required":["mode","sourceDocumentIds"],"additionalProperties":true},"directQuerySettingsSchema":{"type":"object","properties":{"orderingColumn":{"type":["string","null"],"description":"Column the source's rows are paged by"},"appendOnly":{"type":["boolean","null"],"description":"Declared: the rows are only ever added, never updated or deleted"},"statementTimeoutSeconds":{"type":["number","null"],"description":"Cap on how long one remote statement may run"},"maxRowsScanned":{"type":["number","null"],"description":"Cap on how many rows one remote statement may scan"}},"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}}}}
```

## The SourceJoinConfigSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SourceJoinConfigSchema":{"type":"object","properties":{"joinType":{"type":"string","enum":["left","inner"],"default":"left"},"strategy":{"type":["string","null"]}}}}}}
```

## The SourceListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SourceListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Source"}},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]},"Source":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"parentSourceId":{"type":["string","null"]},"dataSource":{"anyOf":[{"$ref":"#/components/schemas/DataSourceTypeEnum"},{"type":"null"}]},"dataFormat":{"$ref":"#/components/schemas/datasetFormatsEnum"},"description":{"type":["string","null"]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}},"richDescription":{"anyOf":[{"$ref":"#/components/schemas/RichDescriptionSchema"},{"type":"null"}]},"schemaEntries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"importWarnings":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ontologyMode":{"$ref":"#/components/schemas/OntologyModeEnum","default":"auto"},"documentCount":{"type":["number","null"]},"columnMetadata":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnMetadataSchema"}},{"type":"null"}]},"extension":{"type":["string","null"]},"totalSize":{"type":["number","null"]},"createdAt":{"type":["string","null"]},"lastSaved":{"type":["string","null"]},"virtual":{"type":["boolean","null"]},"ontologyStatus":{"anyOf":[{"$ref":"#/components/schemas/OntologyStatusEnum"},{"type":"null"}]},"ontologyError":{"type":["string","null"]},"extractionStatus":{"anyOf":[{"$ref":"#/components/schemas/ExtractionStatusEnum"},{"type":"null"}]},"extractionError":{"type":["string","null"]},"pageCount":{"type":["number","null"]},"derivedFromDatasetIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"derivedVia":{"anyOf":[{"$ref":"#/components/schemas/DerivedViaEnum"},{"type":"null"}]},"extractionRecipe":{"anyOf":[{"$ref":"#/components/schemas/ExtractionRecipeSchema"},{"type":"null"}]},"pendingAnnotationCount":{"type":["number","null"]},"ontologyExcludedFields":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string","enum":["auto","user","suggestion"]}},"required":["field","reason","source"]}},{"type":"null"}]},"batchRanges":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"fileName":{"type":"string"},"uploadedAt":{"type":"string"},"rowStart":{"type":"number"},"rowEnd":{"type":"number"}},"required":["hash","fileName","uploadedAt","rowStart","rowEnd"]}},{"type":"null"}]},"currentVersionId":{"type":["string","null"]},"latestVersionOrdinal":{"type":["number","null"]},"staging":{"type":["boolean","null"]},"readMode":{"type":"string","enum":["direct_query","snapshot"],"description":"How this source is read. direct_query runs every read against the origin database — live, but subject to its statement timeout, and no row count is recorded; snapshot reads a stored copy, which changes only when it is synced"},"directQuery":{"anyOf":[{"$ref":"#/components/schemas/directQuerySettingsSchema"},{"type":"null"}],"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}},"required":["id","organisationId","name","dataFormat","readMode","directQuery"]},"DataSourceTypeEnum":{"type":"string","enum":["Local Upload","API Upload","Web Research","Document Extraction","Workbook Extraction","PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]},"datasetFormatsEnum":{"type":"string","enum":["Folder","Tabular","Text","Workbook","PDF","DOCX","PPTX","Image","Audio","Video"]},"RichDescriptionSchema":{"type":"object","properties":{"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}}},"required":["markdown","widgets"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"OntologyModeEnum":{"type":"string","enum":["auto","manual"]},"ColumnMetadataSchema":{"type":"object","properties":{"dtype":{"type":["string","null"]},"categoryOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"distribution":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"rangeFrom":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"rangeTo":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"mean":{"type":["number","null"]},"stringPattern":{"type":["string","null"]},"jsonObjectFraction":{"type":["number","null"]},"cardinality":{"type":["number","null"]},"nullFraction":{"type":["number","null"]},"unparsedFormat":{"type":["string","null"]},"processing":{"type":["boolean","null"]},"metadataStatus":{"anyOf":[{"$ref":"#/components/schemas/MetadataStatusEnum"},{"type":"null"}]},"elementType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"minSize":{"type":["number","null"]},"maxSize":{"type":["number","null"]},"avgSize":{"type":["number","null"]},"medianSize":{"type":["number","null"]},"p95Size":{"type":["number","null"]},"nullCount":{"type":["number","null"]},"emptyCount":{"type":["number","null"]},"totalElementCount":{"type":["number","null"]},"sizeDistribution":{"anyOf":[{"$ref":"#/components/schemas/ArraySizeDistributionSchema"},{"type":"null"}]},"uniqueElementCount":{"type":["number","null"]},"avgUniquePerRow":{"type":["number","null"]},"elementOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"elementMin":{"type":["number","null"]},"elementMax":{"type":["number","null"]},"elementMean":{"type":["number","null"]},"elementSum":{"type":["number","null"]},"elementStddev":{"type":["number","null"]}}},"MetadataStatusEnum":{"type":"string","enum":["complete","partial_skipped_expensive","in_progress"]},"ArraySizeDistributionSchema":{"type":"object","properties":{"empty":{"type":"number","default":0},"oneToThree":{"type":"number","default":0},"fourToTen":{"type":"number","default":0},"elevenToFifty":{"type":"number","default":0},"fiftyPlus":{"type":"number","default":0}}},"OntologyStatusEnum":{"type":"string","enum":["pending","extracting","consolidation_queued","consolidating","detecting_derived","analyzing_dependencies","profiling_time_series","completed","extraction_failed","consolidation_failed","derived_detection_failed","relationship_detection_failed","cross_relationship_detection_failed","dependency_analysis_failed","time_series_profiling_failed","cancelled","manual_pending"]},"ExtractionStatusEnum":{"type":"string","enum":["pending","extracting","completed","failed"]},"DerivedViaEnum":{"type":"string","enum":["document_tables","document_homogenisation","document_entities","workbook_sql"]},"ExtractionRecipeSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["schema","entities"]},"sourceDocumentIds":{"type":"array","items":{"type":"string"}},"columns":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"entityTypes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true},"default":[]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"targetName":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"lastAppendedAt":{"type":["string","null"]}},"required":["mode","sourceDocumentIds"],"additionalProperties":true},"directQuerySettingsSchema":{"type":"object","properties":{"orderingColumn":{"type":["string","null"],"description":"Column the source's rows are paged by"},"appendOnly":{"type":["boolean","null"],"description":"Declared: the rows are only ever added, never updated or deleted"},"statementTimeoutSeconds":{"type":["number","null"],"description":"Cap on how long one remote statement may run"},"maxRowsScanned":{"type":["number","null"],"description":"Cap on how many rows one remote statement may scan"}},"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}}}}
```

## The SourcePinSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}}}}}
```

## The SourceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}}}}}
```

## The SplitInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SplitInput":{"type":"object","properties":{"fieldMapping":{"$ref":"#/components/schemas/PublicFieldMappingSchema"}},"required":["fieldMapping"]},"PublicFieldMappingSchema":{"type":"object","properties":{"datasetId":{"type":"string"},"field":{"type":"string"},"status":{"$ref":"#/components/schemas/BindingStatusEnum","default":"confirmed"},"source":{"$ref":"#/components/schemas/BindingSourceEnum","default":"ingest"},"confidence":{"type":["number","null"]},"evidence":{"type":["string","null"]},"valueMap":{"anyOf":[{"$ref":"#/components/schemas/OntologyValueMapSchema"},{"type":"null"}]},"canonicalField":{"type":["string","null"]},"scopeFields":{"type":["array","null"],"items":{"type":"string"}},"precedence":{"type":["number","null"]},"keyRole":{"anyOf":[{"$ref":"#/components/schemas/KeyRoleEnum"},{"type":"null"}]},"conformance":{"anyOf":[{"$ref":"#/components/schemas/ConformanceReportSchema"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"sourceId":{"type":"string"}},"required":["datasetId","field","status","source","sourceId"]},"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]},"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]},"OntologyValueMapSchema":{"anyOf":[{"$ref":"#/components/schemas/OntologyValueMapEntriesSchema"},{"$ref":"#/components/schemas/OntologyValueMapEntriesSchema"}]},"OntologyValueMapEntriesSchema":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]},"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]}}}}
```

## The SplitTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]}}}}
```

## The StaticInterventionSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]}}}}
```

## The StaticPanelAnomalyDetectionRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}}}}}
```

## The StaticPanelAnomalyDetectionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"StaticPanelAnomalyDetectionResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AnomalyDetectionResultSchema"}}},"required":["environmentResults"]},"AnomalyDetectionResultSchema":{"type":"object","properties":{"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"totalSamplesScanned":{"type":"number"},"samples":{"type":"array","items":{"$ref":"#/components/schemas/SampleAnomalyScanResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalSamplesScanned"]},"SampleAnomalyScanResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number"},"isAnomalous":{"type":"boolean"},"systemScore":{"type":"number"},"flaggedNodes":{"type":"array","items":{"$ref":"#/components/schemas/AnomalyFlagResultSchema"},"default":[]},"allSurprises":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["sampleIndex","isAnomalous","systemScore"]},"AnomalyFlagResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"conditionalZ":{"type":"number"},"marginalZ":{"type":"number"},"isRootNode":{"type":"boolean"},"confidence":{"type":"number"},"graphDepth":{"type":"number"},"variableThreshold":{"type":["number","null"]}},"required":["variable","conditionalZ","marginalZ","isRootNode","confidence","graphDepth"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]}}}}
```

## The StaticPanelRootCauseAnalysisRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}}}}}
```

## The StaticPanelRootCauseAnalysisResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"StaticPanelRootCauseAnalysisResultSchema":{"type":"object","properties":{"environmentResults":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RootCauseAnalysisResultSchema"}}},"required":["environmentResults"]},"RootCauseAnalysisResultSchema":{"type":"object","properties":{"sampleResults":{"type":"array","items":{"$ref":"#/components/schemas/SampleRcaResultSchema"}},"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"executionTime":{"type":"number","default":0}},"required":["sampleResults"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]}}}}
```

## The StatusTypeEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"StatusTypeEnum":{"type":"string","enum":["active","deprecated"]}}}}
```

## The SuggestedRoleEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SuggestedRoleEnum":{"type":"string","enum":["source","target"]}}}}
```

## The SuggestedSimulationSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SuggestedSimulationSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scenario":{"$ref":"#/components/schemas/DigitalTwinScenarioSchema"},"createdAt":{"type":"string"}},"required":["id","name","description","scenario","createdAt"]},"DigitalTwinScenarioSchema":{"anyOf":[{"$ref":"#/components/schemas/OptimisationScenarioSchema"},{"$ref":"#/components/schemas/StaticInterventionSpecSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionSpecSchema"},{"$ref":"#/components/schemas/MultiCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PredictionWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/ExplanationRequestSchema"},{"$ref":"#/components/schemas/ParentImpactRequestSchema"},{"$ref":"#/components/schemas/ForecastWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/TemporalExplanationRequestSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualRequestSchema"},{"$ref":"#/components/schemas/TemporalOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelForecastRequestSchema"},{"$ref":"#/components/schemas/PanelInterventionSpecSchema"},{"$ref":"#/components/schemas/PanelExplanationRequestSchema"},{"$ref":"#/components/schemas/PanelCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PanelOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelParentImpactRequestSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/TemporalRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/AnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorRequestSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorRequestSchema"}]},"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}},"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]},"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]},"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]},"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]},"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]},"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]}}}}
```

## The SymbolicEquationAlternativeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]}}}}
```

## The SymbolicEquationSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SymbolicEquationSchema":{"type":"object","properties":{"expression":{"type":"string"},"r2":{"type":"number"},"noisePercentage":{"type":"number"},"termBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicTermSchema"}},"complexity":{"type":"number"},"explanationType":{"type":"string","enum":["regression","classification_rules","conditional_probability"],"default":"regression"},"epsilonSigma":{"type":["number","null"]},"epsilonSigmaRelative":{"type":["number","null"]},"expressionWithNoise":{"type":["string","null"]},"discoveryMethod":{"type":["string","null"]},"parentContributions":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicParentContributionSchema"}},"unexplainedPct":{"type":["number","null"]},"directionReferenceClass":{"type":["string","null"]},"alternatives":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SymbolicEquationAlternativeSchema"}},{"type":"null"}],"description":"Pareto-front alternatives to the chosen equation (balanced / fewer terms / better fit); absent until discovery emits them"}},"required":["expression","r2","noisePercentage","termBreakdown","complexity"]},"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]},"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]},"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]}}}}
```

## The SymbolicParentContributionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]}}}}
```

## The SymbolicTermSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]}}}}
```

## The TargetEffectSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TargetEffectSchema":{"type":"object","properties":{"causeTarget":{"type":["string","number"],"description":"Target value of the cause"},"scalarEffect":{"type":"number","description":"Scalar effect size"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for the effect"},"statisticalSignificance":{"type":"number","description":"Statistical significance level"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"},"nReplicates":{"type":"number","description":"Number of replicates"},"effectiveSampleSize":{"type":"number","description":"Effective sample size"}},"required":["causeTarget","scalarEffect","confidenceInterval","statisticalSignificance","nReplicates","effectiveSampleSize"]}}}}
```

## The TargetModeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"}}}}
```

## The TemporalAnomalyDetectionRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The TemporalAnomalyDetectionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalAnomalyDetectionResultSchema":{"type":"object","properties":{"calibratedThresholds":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"targetFpr":{"type":["number","null"]},"totalTimestepsScanned":{"type":"number"},"timesteps":{"type":"array","items":{"$ref":"#/components/schemas/SampleAnomalyScanResultSchema"},"default":[]},"executionTime":{"type":"number","default":0}},"required":["totalTimestepsScanned"]},"SampleAnomalyScanResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number"},"isAnomalous":{"type":"boolean"},"systemScore":{"type":"number"},"flaggedNodes":{"type":"array","items":{"$ref":"#/components/schemas/AnomalyFlagResultSchema"},"default":[]},"allSurprises":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"},"default":[]},"autoRca":{"anyOf":[{"$ref":"#/components/schemas/SampleRcaResultSchema"},{"type":"null"}]}},"required":["sampleIndex","isAnomalous","systemScore"]},"AnomalyFlagResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"conditionalZ":{"type":"number"},"marginalZ":{"type":"number"},"isRootNode":{"type":"boolean"},"confidence":{"type":"number"},"graphDepth":{"type":"number"},"variableThreshold":{"type":["number","null"]}},"required":["variable","conditionalZ","marginalZ","isRootNode","confidence","graphDepth"]},"NodeSurpriseResultSchema":{"type":"object","properties":{"variable":{"type":"string"},"observedValue":{"type":"number"},"expectedMean":{"type":"number"},"expectedStd":{"type":"number"},"zScore":{"type":"number"},"conditionalPercentile":{"type":"number"},"marginalZScore":{"type":"number","default":0},"graphDepth":{"type":"number","default":0},"isRootNode":{"type":"boolean","default":false},"explainedFraction":{"type":"number","default":0},"rootCauseScore":{"type":"number","default":0},"confidence":{"type":"number","default":1},"nConditionalSamples":{"type":"number","default":0},"isLatent":{"type":"boolean","default":false},"actionability":{"$ref":"#/components/schemas/ActionabilityEnum","default":"observable"},"variableThreshold":{"type":["number","null"]}},"required":["variable","observedValue","expectedMean","expectedStd","zScore","conditionalPercentile"]},"ActionabilityEnum":{"type":"string","enum":["actionable","observable","latent","external"]},"SampleRcaResultSchema":{"type":"object","properties":{"sampleIndex":{"type":"number","default":0},"targetVariable":{"type":"string"},"observedTarget":{"type":"number"},"expectedTargetMean":{"type":"number"},"expectedTargetStd":{"type":"number"},"targetZScore":{"type":"number"},"rankedCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"rootCauses":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"propagationChain":{"type":"array","items":{"$ref":"#/components/schemas/NodeSurpriseResultSchema"}},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"observableAttribution":{"type":"number"},"latentAttribution":{"type":"number"}},"required":["targetVariable","observedTarget","expectedTargetMean","expectedTargetStd","targetZScore","rankedCauses","rootCauses","propagationChain","causalPaths","observableAttribution","latentAttribution"]}}}}
```

## The TemporalCausalRelationshipAnalysisSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalCausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string"},"effectVar":{"type":"string"},"overallEffect":{"$ref":"#/components/schemas/TemporalOverallEffectAnalysisSchema"},"effectPropagation":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},{"type":"null"}]},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["causeVar","effectVar","overallEffect","causalPaths"]},"TemporalOverallEffectAnalysisSchema":{"type":"object","properties":{"effectSize":{"type":"number"},"effectRange":{"type":"array","items":{"type":"number"}},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"},"lagEffects":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalStrengthSchema"}},"seasonalEffects":{"type":"array","items":{"$ref":"#/components/schemas/SeasonalEffectDecompositionSchema"}},"impulseResponse":{"type":"array","items":{"type":"number"}},"cumulativeEffect":{"type":"number"},"peakEffectLag":{"type":"number"},"contrast":{"$ref":"#/components/schemas/ContrastSchema"}},"required":["effectSize","effectRange","confidenceInterval","statisticalSignificance","lagEffects","seasonalEffects","impulseResponse","cumulativeEffect","peakEffectLag","contrast"]},"TemporalCausalStrengthSchema":{"type":"object","properties":{"lag":{"type":"number"},"effectSize":{"type":"number"},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"}},"required":["lag","effectSize","confidenceInterval","statisticalSignificance"]},"SeasonalEffectDecompositionSchema":{"type":"object","properties":{"component":{"type":"string"},"period":{"type":"number"},"periodEffects":{"type":"object","additionalProperties":{"type":"number"}},"strongestPeriod":{"type":"string"},"weakestPeriod":{"type":"string"}},"required":["component","period","periodEffects","strongestPeriod","weakestPeriod"]},"ContrastSchema":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]}}}}
```

## The TemporalCausalStrengthSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalCausalStrengthSchema":{"type":"object","properties":{"lag":{"type":"number"},"effectSize":{"type":"number"},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"}},"required":["lag","effectSize","confidenceInterval","statisticalSignificance"]}}}}
```

## The TemporalCounterfactualExplanationSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalCounterfactualExplanationSchema":{"type":"object","properties":{"currentState":{"type":"object","additionalProperties":{}},"baselineTrajectory":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},"requestedTargets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"counterfactuals":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualSchema"}},"baselineAlreadyMeetsTarget":{"type":["boolean","null"]},"baselineAchievedAt":{"type":["number","null"]}},"required":["currentState","baselineTrajectory","requestedTargets","counterfactuals"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"TemporalCounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/TemporalVariableChangeSchema"}},"predictedTrajectories":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},"targetAchievedAt":{"type":["number","null"]},"allTargetsMet":{"type":"boolean"},"certainty":{"type":"number"}},"required":["changes","predictedTrajectories","allTargetsMet","certainty"]},"TemporalVariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string"},"fromValue":{},"toValue":{},"timestamp":{"type":["number","null"]},"persistent":{"type":"boolean","default":true},"rampSteps":{"type":["number","null"]},"importance":{"type":"number","default":1}},"required":["variable"]}}}}
```

## The TemporalCounterfactualRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]}}}}
```

## The TemporalCounterfactualSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalCounterfactualSchema":{"type":"object","properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/TemporalVariableChangeSchema"}},"predictedTrajectories":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},"targetAchievedAt":{"type":["number","null"]},"allTargetsMet":{"type":"boolean"},"certainty":{"type":"number"}},"required":["changes","predictedTrajectories","allTargetsMet","certainty"]},"TemporalVariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string"},"fromValue":{},"toValue":{},"timestamp":{"type":["number","null"]},"persistent":{"type":"boolean","default":true},"rampSteps":{"type":["number","null"]},"importance":{"type":"number","default":1}},"required":["variable"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]}}}}
```

## The TemporalCounterfactualTargetSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]}}}}
```

## The TemporalDependenciesObjectSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalDependenciesObjectSchema":{"type":"object","properties":{"prerequisites":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["prerequisites"]}}}}
```

## The TemporalDependenciesSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalDependenciesSchema":{"anyOf":[{"not":{}},{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesObjectSchema"},{"type":"null"}]}]},"TemporalDependenciesObjectSchema":{"type":"object","properties":{"prerequisites":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["prerequisites"]}}}}
```

## The TemporalDependencyChangeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalDependencyChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"variable":{"type":"string"},"oldPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"newPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["type","variable"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]}}}}
```

## The TemporalExplanationRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]}}}}
```

## The TemporalExplanationResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalExplanationResultSchema":{"type":"object","properties":{"explanationType":{"type":"string","enum":["directional","discovery","impact"]},"causalRelationships":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalRelationshipAnalysisSchema"}},{"type":"null"}]},"forecastHorizonUsed":{"type":"number"},"executionTime":{"type":"number"}},"required":["explanationType","forecastHorizonUsed","executionTime"]},"TemporalCausalRelationshipAnalysisSchema":{"type":"object","properties":{"causeVar":{"type":"string"},"effectVar":{"type":"string"},"overallEffect":{"$ref":"#/components/schemas/TemporalOverallEffectAnalysisSchema"},"effectPropagation":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},{"type":"null"}]},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["causeVar","effectVar","overallEffect","causalPaths"]},"TemporalOverallEffectAnalysisSchema":{"type":"object","properties":{"effectSize":{"type":"number"},"effectRange":{"type":"array","items":{"type":"number"}},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"},"lagEffects":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalStrengthSchema"}},"seasonalEffects":{"type":"array","items":{"$ref":"#/components/schemas/SeasonalEffectDecompositionSchema"}},"impulseResponse":{"type":"array","items":{"type":"number"}},"cumulativeEffect":{"type":"number"},"peakEffectLag":{"type":"number"},"contrast":{"$ref":"#/components/schemas/ContrastSchema"}},"required":["effectSize","effectRange","confidenceInterval","statisticalSignificance","lagEffects","seasonalEffects","impulseResponse","cumulativeEffect","peakEffectLag","contrast"]},"TemporalCausalStrengthSchema":{"type":"object","properties":{"lag":{"type":"number"},"effectSize":{"type":"number"},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"}},"required":["lag","effectSize","confidenceInterval","statisticalSignificance"]},"SeasonalEffectDecompositionSchema":{"type":"object","properties":{"component":{"type":"string"},"period":{"type":"number"},"periodEffects":{"type":"object","additionalProperties":{"type":"number"}},"strongestPeriod":{"type":"string"},"weakestPeriod":{"type":"string"}},"required":["component","period","periodEffects","strongestPeriod","weakestPeriod"]},"ContrastSchema":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]}}}}
```

## The TemporalInterventionTimingSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]}}}}
```

## The TemporalMetricSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}}}}}
```

## The TemporalOptimisationObjectiveSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}}}}}
```

## The TemporalOptimisationScenarioSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}}}}}
```

## The TemporalOptimizationResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalOptimizationResultSchema":{"type":"object","properties":{"paretoFront":{"type":"array","items":{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"}},"baselineMetrics":{"type":"object","additionalProperties":{"type":"number"}},"balancedSolution":{"anyOf":[{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"},{"type":"null"}]},"bestPerObjective":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TemporalParetoDominantSolutionSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"},"executionTime":{"type":"number"},"allConstraintsSatisfiable":{"type":"boolean","default":true,"description":"Whether any plan satisfying every metric constraint was found"},"metricScaleBases":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MetricScaleBasisSchema"}},{"type":"null"}],"description":"Per-objective scale basis; an extensive metric over the stacked Monte Carlo paths is rescaled to a single path"}},"required":["paretoFront","baselineMetrics","forecastHorizon","executionTime"]},"TemporalParetoDominantSolutionSchema":{"type":"object","properties":{"interventions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Interventions in this solution"},"interventionCount":{"type":"number","default":0,"description":"Number of interventions in this solution"},"objectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Values of the objectives"},"implementationDifficulty":{"type":["number","null"],"description":"Difficulty of implementing this solution"},"expectedOutcomes":{"type":"object","additionalProperties":{},"description":"Expected outcomes of the solution"},"uncertainty":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Uncertainty in objective values"},"improvementOverBaseline":{"type":"object","additionalProperties":{"type":"number"},"description":"Improvements over baseline"},"constraintsSatisfied":{"type":"boolean","default":true,"description":"Whether all constraints were satisfied by this solution"},"constraintViolations":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Descriptions of constraint violations if any"},"targetsAchieved":{"anyOf":[{"type":"object","additionalProperties":{"type":"boolean"}},{"type":"null"}],"description":"Whether each objective's target was achieved"},"segmentResults":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Per-segment objective values: {segment_id: {objective_name: value}}"},"segmentSampleSizes":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-segment sample sizes: {segment_id: sample_count}"},"segmentInterventions":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Segment-specific interventions with conditions"},"totalSampleCount":{"type":["number","null"]},"affectedSampleCount":{"type":["number","null"]},"affectedPercentage":{"type":["number","null"]},"appliedInterventions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"}},{"type":"null"}],"description":"The exact intervention rows the evaluator ran for this plan, after scoping and relative-mode conversion"},"interventionResult":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"type":"null"}],"description":"The plan re-run as a Monte Carlo temporal intervention over the same horizon"},"interventionSequence":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"forecastTrajectories":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},{"type":"null"}],"description":"Superseded by interventionResult.forecastData; empty on runs that carry a per-plan result"}},"required":["interventions","objectiveValues","expectedOutcomes","uncertainty","improvementOverBaseline","interventionSequence"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]},"MetricScaleBasisSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["intensive","extensive","unknown"],"description":"Whether the metric's level scales with the sampled table's row count"},"sampleRows":{"type":"number","description":"Rows in the sampled table the metric was computed over"},"sourceRows":{"type":["number","null"],"description":"Rows in the twin's source data; the rescale target for extensive metrics"},"rescaled":{"type":"boolean","default":false,"description":"Whether absolute values for this metric were rescaled"},"rescaledTo":{"anyOf":[{"type":"string","enum":["source_rows","single_path"]},{"type":"null"}],"description":"What an extensive metric was rescaled to: the source data's row count (static) or one simulated future path (temporal)"}},"required":["kind","sampleRows"]}}}}
```

## The TemporalOverallEffectAnalysisSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalOverallEffectAnalysisSchema":{"type":"object","properties":{"effectSize":{"type":"number"},"effectRange":{"type":"array","items":{"type":"number"}},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"},"lagEffects":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCausalStrengthSchema"}},"seasonalEffects":{"type":"array","items":{"$ref":"#/components/schemas/SeasonalEffectDecompositionSchema"}},"impulseResponse":{"type":"array","items":{"type":"number"}},"cumulativeEffect":{"type":"number"},"peakEffectLag":{"type":"number"},"contrast":{"$ref":"#/components/schemas/ContrastSchema"}},"required":["effectSize","effectRange","confidenceInterval","statisticalSignificance","lagEffects","seasonalEffects","impulseResponse","cumulativeEffect","peakEffectLag","contrast"]},"TemporalCausalStrengthSchema":{"type":"object","properties":{"lag":{"type":"number"},"effectSize":{"type":"number"},"confidenceInterval":{"type":"array","items":{"type":"number"}},"statisticalSignificance":{"type":"number"}},"required":["lag","effectSize","confidenceInterval","statisticalSignificance"]},"SeasonalEffectDecompositionSchema":{"type":"object","properties":{"component":{"type":"string"},"period":{"type":"number"},"periodEffects":{"type":"object","additionalProperties":{"type":"number"}},"strongestPeriod":{"type":"string"},"weakestPeriod":{"type":"string"}},"required":["component","period","periodEffects","strongestPeriod","weakestPeriod"]},"ContrastSchema":{"type":"object","properties":{"type":{"type":"string","enum":["numeric","categorical"]},"causeRef":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"causeTarget":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"contrastType":{"type":"string"}},"required":["type","contrastType"]}}}}
```

## The TemporalParetoDominantSolutionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalParetoDominantSolutionSchema":{"type":"object","properties":{"interventions":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Interventions in this solution"},"interventionCount":{"type":"number","default":0,"description":"Number of interventions in this solution"},"objectiveValues":{"type":"object","additionalProperties":{"type":"number"},"description":"Values of the objectives"},"implementationDifficulty":{"type":["number","null"],"description":"Difficulty of implementing this solution"},"expectedOutcomes":{"type":"object","additionalProperties":{},"description":"Expected outcomes of the solution"},"uncertainty":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Uncertainty in objective values"},"improvementOverBaseline":{"type":"object","additionalProperties":{"type":"number"},"description":"Improvements over baseline"},"constraintsSatisfied":{"type":"boolean","default":true,"description":"Whether all constraints were satisfied by this solution"},"constraintViolations":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Descriptions of constraint violations if any"},"targetsAchieved":{"anyOf":[{"type":"object","additionalProperties":{"type":"boolean"}},{"type":"null"}],"description":"Whether each objective's target was achieved"},"segmentResults":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}],"description":"Per-segment objective values: {segment_id: {objective_name: value}}"},"segmentSampleSizes":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Per-segment sample sizes: {segment_id: sample_count}"},"segmentInterventions":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Segment-specific interventions with conditions"},"totalSampleCount":{"type":["number","null"]},"affectedSampleCount":{"type":["number","null"]},"affectedPercentage":{"type":["number","null"]},"appliedInterventions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"}},{"type":"null"}],"description":"The exact intervention rows the evaluator ran for this plan, after scoping and relative-mode conversion"},"interventionResult":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionResultSchema"},{"type":"null"}],"description":"The plan re-run as a Monte Carlo temporal intervention over the same horizon"},"interventionSequence":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"forecastTrajectories":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"}},{"type":"null"}],"description":"Superseded by interventionResult.forecastData; empty on runs that carry a per-plan result"}},"required":["interventions","objectiveValues","expectedOutcomes","uncertainty","improvementOverBaseline","interventionSequence"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]}}}}
```

## The TemporalRootCauseAnalysisRequestSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]}}}}
```

## The TemporalVariableChangeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TemporalVariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string"},"fromValue":{},"toValue":{},"timestamp":{"type":["number","null"]},"persistent":{"type":"boolean","default":true},"rampSteps":{"type":["number","null"]},"importance":{"type":"number","default":1}},"required":["variable"]}}}}
```

## The TimeComponentArtifactSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeComponentArtifactSchema":{"type":"object","properties":{"models":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeDecompositionModelSchema"}},"varExplained":{"type":"object","additionalProperties":{"type":"number"}},"trainNSamples":{"type":"number"}},"required":["models","varExplained","trainNSamples"]},"TimeDecompositionModelSchema":{"type":"object","properties":{"theilSenSlope":{"type":"number"},"theilSenIntercept":{"type":"number"},"harmonic":{"anyOf":[{"$ref":"#/components/schemas/HarmonicFitSchema"},{"type":"null"}]}},"required":["theilSenSlope","theilSenIntercept"]},"HarmonicFitSchema":{"type":"object","properties":{"periodsWithHarmonics":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"sinCosCoefficients":{"type":"array","items":{"type":"number"}},"productPairs":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"productCoefficients":{"type":"array","items":{"type":"number"}}},"required":["periodsWithHarmonics","sinCosCoefficients","productPairs","productCoefficients"]}}}}
```

## The TimeDecompositionModelSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeDecompositionModelSchema":{"type":"object","properties":{"theilSenSlope":{"type":"number"},"theilSenIntercept":{"type":"number"},"harmonic":{"anyOf":[{"$ref":"#/components/schemas/HarmonicFitSchema"},{"type":"null"}]}},"required":["theilSenSlope","theilSenIntercept"]},"HarmonicFitSchema":{"type":"object","properties":{"periodsWithHarmonics":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"sinCosCoefficients":{"type":"array","items":{"type":"number"}},"productPairs":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"productCoefficients":{"type":"array","items":{"type":"number"}}},"required":["periodsWithHarmonics","sinCosCoefficients","productPairs","productCoefficients"]}}}}
```

## The TimeSeriesCoverageSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesCoverageSchema":{"type":"object","properties":{"observedSteps":{"type":"number","description":"Grid steps that carried at least one observed row"},"gridSteps":{"type":"number","description":"Steps on the dense grid the twin trains on"},"imputedSteps":{"type":"number","description":"Grid steps reconstructed by imputation, never measured"},"gapCount":{"type":"number","description":"Total gap runs; `gaps` lists only the largest"},"gaps":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesGapSchema"}}},"required":["observedSteps","gridSteps","imputedSteps","gapCount","gaps"]},"TimeSeriesGapSchema":{"type":"object","properties":{"startDate":{"type":"string","description":"First grid step in the gap"},"endDate":{"type":"string","description":"Last grid step in the gap"},"missingSteps":{"type":"number","description":"Consecutive grid steps with no observed rows"}},"required":["startDate","endDate","missingSteps"]}}}}
```

## The TimeSeriesEnvProfileSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesEnvProfileSchema":{"type":"object","properties":{"envKey":{"type":"string"},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"tsTypicalDeltaSeconds":{"type":["number","null"]}},"required":["envKey"]},"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]},"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]},"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]}}}}
```

## The TimeSeriesForecastSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]}}}}
```

## The TimeSeriesGapSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesGapSchema":{"type":"object","properties":{"startDate":{"type":"string","description":"First grid step in the gap"},"endDate":{"type":"string","description":"Last grid step in the gap"},"missingSteps":{"type":"number","description":"Consecutive grid steps with no observed rows"}},"required":["startDate","endDate","missingSteps"]}}}}
```

## The TimeSeriesInterventionResultSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesInterventionResultSchema":{"type":"object","properties":{"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Intervention metrics"},"sampleSize":{"type":"number","description":"Number of samples used"},"causalPaths":{"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Causal paths from intervention to target"},"causalPathsByMetric":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"description":"Causal paths per metric name"},"segmentAnalysis":{"type":"array","items":{"$ref":"#/components/schemas/SegmentEffectSchema"},"description":"Segment-specific effects"},"uncertainty":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"],"description":"Uncertainty quantification"},"uncertainties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InterventionUncertaintySchema"},"description":"Per-metric bootstrap uncertainties"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"},"robustness":{"$ref":"#/components/schemas/InterventionRobustnessScoreInlineSchema","description":"Robustness score for panel data interventions"},"interventionValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Pre/post value per intervened variable: {variable: {baseline, intervention}}"},"sweptVariable":{"type":["string","null"],"description":"Variable swept by a `range` intervention, when the scenario carried one"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}],"description":"Units of the sweep grid — percentage grids apply relative changes and share units with percent dials"},"doseResponse":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/DoseResponseAnalysisSchema"}},{"type":"null"}],"description":"Per-metric sweep curve keyed by metric name, present only for range scenarios"},"executionTime":{"type":"number","description":"Execution time in seconds"},"originalInterventions":{"anyOf":[{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]}},{"type":"null"}],"description":"Original intervention spec as provided by user (preserves sequences and ramps)"},"expandedInterventions":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}},"description":"Mapping from timestamp to the concrete interventions applied at that time"},"forecastData":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesForecastSchema"},"description":"Time series forecasts for intervened variables, mediators, and outcomes"},"forecastStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms): the step after the training data ends"},"forecastEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive)"}},"required":["metrics","sampleSize","uncertainty","executionTime"]},"MetricResultSchema":{"type":"object","properties":{"name":{"type":"string"},"baseline":{"type":["number","null"],"description":"Metric value for the baseline segment; null when the metric window produced no evaluable result"},"intervention":{"type":["number","null"],"description":"Metric value for the intervention segment; null when the metric window produced no evaluable result"},"windowStartMs":{"type":["number","null"],"description":"First forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"},"windowEndMs":{"type":["number","null"],"description":"Last forecast grid timestamp (ms, inclusive) the metric SQL was evaluated over; temporal twins only"}},"required":["name"]},"SegmentEffectSchema":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the segment definition used"},"description":{"type":"string","description":"Description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"Conditions defining the segment"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricResultSchema"},"description":"Calculated metrics for this segment (e.g., baseline, intervention, effect). NaN if calculation failed."},"baselineSampleSize":{"type":"number","description":"Number of samples in the baseline segment"},"interventionSampleSize":{"type":"number","description":"Number of samples in the intervention segment"},"mediatorShifts":{"$ref":"#/components/schemas/MediatorShiftsSchema","description":"Per-metric mediator shifts: {metricName: {mediators: [...], paths: {...}}}"}},"required":["id","conditions","metrics","baselineSampleSize","interventionSampleSize"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"MediatorShiftsSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediatorShiftsForMetricSchema"}},"MediatorShiftsForMetricSchema":{"type":"object","properties":{"mediators":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"}},"paths":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/MediatorShiftSchema"},"description":"Before/after distributions for the path endpoints — intervened variables and metric-source columns; absent on runs stored before it existed"}},"required":["mediators"]},"MediatorShiftSchema":{"anyOf":[{"$ref":"#/components/schemas/MediatorNumericShiftSchema"},{"$ref":"#/components/schemas/MediatorCategoricalShiftSchema"}]},"MediatorNumericShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"numeric"},"baselineMean":{"type":"number"},"interventionMean":{"type":"number"},"deltaMean":{"type":"number"},"baselineStd":{"type":"number"},"interventionStd":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineMean","interventionMean","deltaMean"]},"MediatorCategoricalShiftSchema":{"type":"object","properties":{"variable":{"type":"string"},"type":{"type":"string","const":"categorical"},"baselineProbs":{"type":"object","additionalProperties":{"type":"number"}},"interventionProbs":{"type":"object","additionalProperties":{"type":"number"}},"deltaProbs":{"type":"object","additionalProperties":{"type":"number"}},"tv":{"type":"number"},"scope":{"type":"string","enum":["cohort","population"],"description":"Which rows the before/after covers: 'cohort' is the rows a conditioned intervention touched; absent or 'population' is every row, which is what runs stored before cohort scoping existed"}},"required":["variable","type","baselineProbs","interventionProbs","deltaProbs","tv"]},"InterventionUncertaintySchema":{"type":"object","properties":{"meanEffect":{"type":"number","description":"Mean effect"},"stdEffect":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval"},"confidenceLevel":{"type":"number","description":"Confidence level"},"pValue":{"type":"number","description":"P-value testing null hypothesis of no effect"},"significant":{"type":"boolean","description":"Whether the effect is statistically significant"},"robustnessValue":{"type":["number","null"],"description":"Cinelli-Hazlett robustness value: share of residual variance an unmeasured confounder must explain in both treatment and outcome to move the estimate to the null (0..1)"},"eValue":{"type":["number","null"],"description":"E-value on the risk-ratio scale; only present for binary-rate metrics"},"eValueCiLimit":{"type":["number","null"],"description":"E-value for the confidence-interval limit closest to the null"},"baselineInterval":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Percentile interval of the resampled baseline reading, on the metric's scale, at confidenceLevel"}},"required":["meanEffect","stdEffect","confidenceInterval","confidenceLevel","pValue","significant"]},"InterventionRobustnessScoreInlineSchema":{"type":"object","properties":{"overallScore":{"type":"number"},"edgeStabilityScore":{"type":"number"},"coefficientStabilityScore":{"type":["number","null"]},"environmentCoverageScore":{"type":["number","null"]},"warnings":{"type":"array","items":{"type":"string"},"default":[]},"recommendation":{"type":"string"}},"required":["overallScore","edgeStabilityScore","recommendation"]},"DoseResponseAnalysisSchema":{"type":"object","properties":{"points":{"type":"array","items":{"$ref":"#/components/schemas/DoseResponsePointSchema"},"description":"Points along the dose-response curve"},"isLinear":{"type":"boolean","description":"Whether the relationship appears linear"},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Values where effect direction changes"},"referenceValue":{"type":"number","description":"Reference value for dose-response analysis"}},"required":["points","isLinear","referenceValue"]},"DoseResponsePointSchema":{"type":"object","properties":{"causeValue":{"type":"number","description":"Value of the cause variable"},"effectMean":{"type":"number","description":"Mean effect at this cause value"},"effectStd":{"type":"number","description":"Standard deviation of effect"},"confidenceInterval":{"type":"array","items":{"type":"number"},"description":"Confidence interval for effect"},"deltaVector":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Change in probability distribution"}},"required":["causeValue","effectMean","effectStd","confidenceInterval"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"TimeSeriesForecastSchema":{"type":"object","properties":{"variable":{"type":"string","description":"Variable name"},"timestamps":{"type":"array","items":{"type":"number"},"description":"Timestamps in milliseconds"},"baselineMean":{"type":"array","items":{"type":"number"},"description":"Mean values under baseline"},"baselineStd":{"type":"array","items":{"type":"number"},"description":"Std dev under baseline"},"interventionMean":{"type":"array","items":{"type":"number"},"description":"Mean values under intervention"},"interventionStd":{"type":"array","items":{"type":"number"},"description":"Std dev under intervention"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Ordered category labels when the variable is categorical; null for numeric variables"},"baselineProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under baseline, shape [timestep][category]"},"interventionProbs":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}],"description":"Per-timestep category probabilities under intervention, shape [timestep][category]"},"interventionTimestamp":{"type":["number","null"],"description":"When intervention started (if applicable)"},"historyTimestamps":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"Trailing observed-history timestamps in ms, ending at the forecast start boundary; absent on categorical variables and results stored before this field existed"},"historyValues":{"anyOf":[{"type":"array","items":{"type":["number","null"]}},{"type":"null"}],"description":"Observed values aligned with historyTimestamps; null entries mark missing source rows"},"isIntervened":{"type":"boolean","description":"Whether this variable was directly intervened on"},"isMediator":{"type":"boolean","description":"Whether this is on causal path"},"isOutcome":{"type":"boolean","description":"Whether this is a metric/outcome variable"}},"required":["variable","timestamps","baselineMean","baselineStd","interventionMean","interventionStd","isIntervened","isMediator","isOutcome"]}}}}
```

## The TimeSeriesInterventionSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]}}}}
```

## The TimeSeriesInterventionSpecSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]}}}}
```

## The TimeSeriesMetadataSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"TimeSeriesMetadataSchema":{"type":"object","properties":{"colName":{"type":"string","description":"Column name for the time series"},"granularity":{"type":"string","enum":["ms","s","min","h","D","W","ME","Y","L","S","T","H"],"description":"Current granularity of the time series"},"validGranularities":{"type":"array","items":{"type":"string"},"description":"List of valid granularities"},"startDate":{"type":"string","description":"Start date of the time series"},"endDate":{"type":"string","description":"End date of the time series"},"typicalDeltaSeconds":{"type":["number","null"]},"selectedGrid":{"type":["string","null"]},"candidateGrids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"scoring":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}]},"coverage":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesCoverageSchema"},{"type":"null"}],"description":"Observed vs imputed grid steps; absent on twins trained before this existed"}},"required":["colName","granularity","validGranularities","startDate","endDate"]},"TimeSeriesCoverageSchema":{"type":"object","properties":{"observedSteps":{"type":"number","description":"Grid steps that carried at least one observed row"},"gridSteps":{"type":"number","description":"Steps on the dense grid the twin trains on"},"imputedSteps":{"type":"number","description":"Grid steps reconstructed by imputation, never measured"},"gapCount":{"type":"number","description":"Total gap runs; `gaps` lists only the largest"},"gaps":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesGapSchema"}}},"required":["observedSteps","gridSteps","imputedSteps","gapCount","gaps"]},"TimeSeriesGapSchema":{"type":"object","properties":{"startDate":{"type":"string","description":"First grid step in the gap"},"endDate":{"type":"string","description":"Last grid step in the gap"},"missingSteps":{"type":"number","description":"Consecutive grid steps with no observed rows"}},"required":["startDate","endDate","missingSteps"]}}}}
```

## The ToleranceUnitEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]}}}}
```

## The UnlinkSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UnlinkSchema":{"type":"object","properties":{"sourceIds":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["sourceIds"]}}}}
```

## The UnmatchedRuleEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]}}}}
```

## The UnspecifiedEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}}}}
```

## The UpdateConnectorInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UpdateConnectorInput":{"type":"object","properties":{"name":{"type":"string"},"credentials":{"type":["object","null"],"additionalProperties":{}}}}}}}
```

## The UpdateDataViewSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UpdateDataViewSchema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"$ref":"#/components/schemas/DataViewMutationSourceSchema"}},"operations":{"type":"array","items":{}},"anchorConceptId":{"type":["string","null"]}}},"DataViewMutationSourceSchema":{"$ref":"#/components/schemas/SourceSchema"},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}}}}}
```

## The UpdateEnvironmentGroupInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UpdateEnvironmentGroupInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"New display name; unique per twin"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema","description":"Replacement membership rule"}}},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]}}}}
```

## The UpdateReportInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UpdateReportInput":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":["string","null"]},"markdown":{"type":"string"}}}}}}
```

## The UpdateSourceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UpdateSourceSchema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]}},"additionalProperties":false}}}}
```

## The UpdateTwinInput object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UpdateTwinInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"tags":{"type":"array","items":{"type":"string"}}}}}}}
```

## The UpdateWorkspaceSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"UpdateWorkspaceSchema":{"type":"object","properties":{"name":{"type":"string"}},"additionalProperties":false}}}}
```

## The ValueClassEnum object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ValueClassEnum":{"type":"string","enum":["continuous","sparse_event","bursty","binary_indicator"]}}}}
```

## The VariableChangeSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"VariableChangeSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to change"},"fromValue":{"description":"Original value"},"toValue":{"description":"New value"},"importance":{"type":"number","description":"Importance of the change"}},"required":["variable","importance"]}}}}
```

## The VariableConstraintSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]}}}}
```

## The VariableRolesSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"VariableRolesSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"type":"string"}}},"required":["sources","targets"]}}}}
```

## The ViewConceptOverrideEntrySchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]}}}}
```

## The ViewSnapshotSchema object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"ViewSnapshotSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"outputColumn":{"type":"string"}},"required":["sources","operations","outputColumn"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]}}}}
```

## The WebhookBody object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"WebhookBody":{"type":"object","properties":{"webhookUrl":{"type":["string","null"],"format":"uri"}}}}}}
```

## The WorkspaceEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"WorkspaceEnvelope":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workspace"}},"required":["data"]},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string"},"isOrgLibrary":{"type":"boolean"}},"required":["organisationId","name","createdAt"]}}}}
```

## The WorkspaceListEnvelope object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"WorkspaceListEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}},"required":["data"]},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string"},"isOrgLibrary":{"type":"boolean"}},"required":["organisationId","name","createdAt"]}}}}
```

## The DigitalTwin object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwin":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"normalizedName":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"canonicalInputSchema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"status":{"$ref":"#/components/schemas/StatusTypeEnum","default":"active"},"createdAt":{"type":"string"},"suggestedSimulations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SuggestedSimulationSchema"}},{"type":"null"}]},"suggestionsGeneratedAt":{"type":["string","null"]},"environmentGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentGroupSchema"}},{"type":"null"}]},"autoUpdate":{"anyOf":[{"$ref":"#/components/schemas/AutoUpdateSettingsSchema"},{"type":"null"}]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}}},"required":["id","organisationId","workspaceId","name","type"]},"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"StatusTypeEnum":{"type":"string","enum":["active","deprecated"]},"SuggestedSimulationSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"scenario":{"$ref":"#/components/schemas/DigitalTwinScenarioSchema"},"createdAt":{"type":"string"}},"required":["id","name","description","scenario","createdAt"]},"DigitalTwinScenarioSchema":{"anyOf":[{"$ref":"#/components/schemas/OptimisationScenarioSchema"},{"$ref":"#/components/schemas/StaticInterventionSpecSchema"},{"$ref":"#/components/schemas/TimeSeriesInterventionSpecSchema"},{"$ref":"#/components/schemas/MultiCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PredictionWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/ExplanationRequestSchema"},{"$ref":"#/components/schemas/ParentImpactRequestSchema"},{"$ref":"#/components/schemas/ForecastWithUncertaintyRequestSchema"},{"$ref":"#/components/schemas/TemporalExplanationRequestSchema"},{"$ref":"#/components/schemas/TemporalCounterfactualRequestSchema"},{"$ref":"#/components/schemas/TemporalOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelForecastRequestSchema"},{"$ref":"#/components/schemas/PanelInterventionSpecSchema"},{"$ref":"#/components/schemas/PanelExplanationRequestSchema"},{"$ref":"#/components/schemas/PanelCounterfactualRequestSchema"},{"$ref":"#/components/schemas/PanelOptimisationScenarioSchema"},{"$ref":"#/components/schemas/PanelParentImpactRequestSchema"},{"$ref":"#/components/schemas/RootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/TemporalRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/PanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/StaticPanelRootCauseAnalysisRequestSchema"},{"$ref":"#/components/schemas/AnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/TemporalAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/PanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/StaticPanelAnomalyDetectionRequestSchema"},{"$ref":"#/components/schemas/CausalHealthMonitorRequestSchema"},{"$ref":"#/components/schemas/PanelCausalHealthMonitorRequestSchema"}]},"OptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/OptimisationObjectiveSchema"},"description":"The objectives to optimize"},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Dead field, ignored by the optimizer: subpopulation scoping goes through segmentDefinitions + enableSegmentInterventions. Kept so stored scenarios still parse."},"decisionVars":{"type":"array","items":{"type":"string"},"description":"Variables that can be manipulated during optimization"},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}],"description":"Constraints on variable values and changes"},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}],"description":"Constraints on metric values"},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Segment definitions for segment-aware interventions and per-segment results"},"enableSegmentInterventions":{"type":"boolean","default":false,"description":"Whether to explore segment-specific interventions"},"interventionTypes":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Map of variable name to intervention type: 'set_value', 'relative_percentage', 'relative_absolute', 'set_probability'"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}],"description":"Configuration for intervention count optimization"}},"required":["type","objectives","decisionVars"]},"OptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"],"description":"The direction of the optimization"},"variable":{"type":"string","description":"A descriptive name for this objective/metric (e.g., 'Total Revenue', 'Customer Churn Rate'). Used as a label, not necessarily a variable in the causal graph."},"metricSqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"unit":{"$ref":"#/components/schemas/objectiveUnitReadSchema","description":"Canonical unit id (legacy keys coerced on read). Omit for objectives without a meaningful unit."},"weight":{"type":"number","default":1,"description":"Weight of this objective in multi-objective optimization"},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric"},"target":{"anyOf":[{"$ref":"#/components/schemas/OptimisationTargetSchema"},{"type":"null"}],"description":"Optional target specification (absolute value or percentage improvement)"},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["direction","variable","metricSqlQuery"]},"objectiveUnitReadSchema":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}]},"OptimisationTargetSchema":{"type":"object","properties":{"type":{"type":"string","enum":["absolute","percentage"],"default":"percentage","description":"Whether target is an absolute value or percentage change from baseline"},"value":{"type":["number","null"],"description":"Target value. None means just optimize in the specified direction without a specific target."}}},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"VariableConstraintSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable this constraint applies to"},"type":{"type":"string","enum":["range","set","conditional"],"description":"Type of constraint"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (for range type)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (for range type)"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"List of allowed values (for set type)"},"maxChangePercent":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}],"description":"Maximum percentage change from baseline allowed"},"conditionalAllowedValues":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionalAllowedValuesSchema"}},{"type":"null"}],"description":"Conditional allowed values based on other variable values (for conditional type)"}},"required":["variable","type"]},"ConditionalAllowedValuesSchema":{"type":"object","properties":{"condition":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"],"description":"The condition that must be met for this constraint to apply"},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"Values allowed when condition is met (used for categorical/boolean variables)"},"minValue":{"type":["number","null"],"description":"Minimum allowed value when condition is met (used for numeric variables)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value when condition is met (used for numeric variables)"}},"required":["condition"]},"MetricConstraintSchema":{"type":"object","properties":{"metricName":{"type":"string","description":"Name of the metric being constrained"},"sqlQuery":{"type":"string","description":"SQL query to calculate the metric"},"constraintType":{"type":"string","enum":["min_value","max_value","max_decrease_percent","max_increase_percent","fixed_boolean"],"description":"Type of constraint"},"value":{"type":["number","null"],"description":"Constraint value (absolute for min/max, percentage for percent types)"},"booleanValue":{"type":["boolean","null"],"description":"Boolean value for fixed_boolean constraint type"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Window the constraint is evaluated over on a temporal twin. Null means the whole forecast horizon from the first forecast step."}},"required":["metricName","sqlQuery","constraintType"]},"TemporalMetricSpecSchema":{"type":"object","properties":{"startDate":{"type":["string","null"],"description":"Evaluation start as an ISO date (UTC); the backend resolves it into startTimestampMs"},"endDate":{"type":["string","null"],"description":"Evaluation end as an ISO date (UTC), inclusive"},"startTimestampMs":{"type":["number","null"],"description":"Start timestamp (ms). Without an end the window runs intervalSteps grid steps from here; a start alone is one grid step."},"endTimestampMs":{"type":["number","null"],"description":"End timestamp (ms) inclusive. Windows narrower than one model step widen to one full step."},"intervalSteps":{"type":["number","null"],"description":"Window length in model steps when no end is given, counted from the start (or the first forecast step). Ignored when an end is set."}}},"SegmentDefinitionSchema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the segment (e.g., 'high_spenders')"},"description":{"type":["string","null"],"description":"User-friendly description of the segment"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"},"description":"List of conditions (ANDed together) defining the segment membership."}},"required":["id","conditions"]},"InterventionCountConfigSchema":{"type":"object","properties":{"maxInterventions":{"anyOf":[{"type":"number","minimum":1},{"type":"null"}],"description":"Maximum number of changes per plan. None means no limit."},"optimizeCount":{"type":"boolean","default":true,"description":"Whether to treat intervention count as an implicit minimization objective"}}},"StaticInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"intervention"},"interventions":{"type":"array","items":{"$ref":"#/components/schemas/InterventionSchema"},"description":"A list of interventions with their respective conditions"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"InterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."}},"required":["variable","valueSpec"]},"SetValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_value"},"value":{"type":["number","string","boolean"],"description":"The specific value to set the variable to (in its original domain)."}},"required":["type","value"]},"RelativeChangeSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"relative_change"},"mode":{"type":"string","enum":["percentage","absolute"],"description":"Whether the change is a percentage or an absolute amount."},"value":{"type":"number","description":"The amount of change (e.g., 10 for +10%, -5 for -5 units)."}},"required":["type","mode","value"]},"SetProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value (in its original domain) whose probability will be set."},"probability":{"type":"number","minimum":0,"maximum":1,"description":"The desired probability for the specified category (0.0 to 1.0). Other probabilities will be renormalized."}},"required":["type","category","probability"]},"AdjustProbabilitySpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"adjust_probability"},"category":{"type":["string","number","boolean"],"description":"The target category value whose probability will be adjusted."},"delta":{"type":"number","description":"Percentage-point shift (e.g. 10 means +10pp, -5 means -5pp)."}},"required":["type","category","delta"]},"SetMembersSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"set_members"},"include":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to include in the set"},"exclude":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Members to exclude from the set"},"size":{"type":["number","null"],"description":"Fix the set size"},"replace":{"type":"boolean","description":"If true, zero out all members not in include"}},"required":["type"]},"RangeValueSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"from":{"type":["number","null"],"description":"First value of the grid, in the variable's original domain. Omit to start at the low end of the observed range."},"to":{"type":["number","null"],"description":"Last value of the grid, in the variable's original domain. Omit to end at the high end of the observed range."},"steps":{"anyOf":[{"type":"integer","minimum":2,"maximum":50},{"type":"null"}],"description":"Number of evenly spaced grid points, inclusive of both bounds (2-50). Omit to let the twin family pick — 20 for a static sweep, fewer for temporal families where one point is a whole forecast."}},"required":["type"]},"MetricSchema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation window for time-aware metrics. Null means the whole forecast horizon from the first forecast step. Ignored by non-temporal twins."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"TimeSeriesInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of time series interventions or sequences (nested lists) for time series models"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/MetricSchema"},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions for targeted analysis of results."}},"required":["type","interventions","metrics"]},"TimeSeriesInterventionSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The variable to intervene on"},"valueSpec":{"anyOf":[{"$ref":"#/components/schemas/SetValueSpecSchema"},{"$ref":"#/components/schemas/RelativeChangeSpecSchema"},{"$ref":"#/components/schemas/SetProbabilitySpecSchema"},{"$ref":"#/components/schemas/AdjustProbabilitySpecSchema"},{"$ref":"#/components/schemas/SetMembersSpecSchema"},{"$ref":"#/components/schemas/RangeValueSpecSchema"}],"description":"Specification of how to modify the variable."},"conditions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ConditionSchema"}},{"type":"null"}],"description":"Optional conditions defining the subpopulation for intervention."},"detachFormula":{"type":["boolean","null"],"description":"Allow this intervention on a computed value. Its formula is switched off for the run: the variable takes the intervened value instead of being recomputed from its inputs, and its inputs do not move to match."},"timestamp":{"type":["number","null"],"description":"The timestamp to intervene at (for temporal models)"},"persistent":{"type":["boolean","null"],"description":"If True, intervention persists from timestamp onwards. If False, applies only at that timestamp. Only used for temporal models."},"durationSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Hold the value for this many steps starting at the timestamp, then release. Overrides persistent when set (>1). Only used for temporal models."},"rampSteps":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Number of steps to gradually reach this intervention's value. Within a sequence, ramps from the previous state; on a single intervention, ramps from baseline (relative changes only)."}},"required":["variable","valueSpec"]},"MultiCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"counterfactual"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"List of initial samples"},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline samples"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/CounterfactualTargetSchema"},"description":"Target variables to change for all samples"},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}],"description":"Constraints defining the search space (applied individually per sample). Variables not mentioned or without a FixedConstraint are implicitly changeable."},"maxChanges":{"type":"number","default":3,"description":"Maximum number of variables to change per sample"}},"required":["type","targets"]},"ScenarioSamplesRefSchema":{"type":"object","properties":{"key":{"type":"string","description":"Datalake object key holding the JSON-encoded samples array"},"format":{"type":"string","enum":["json"],"default":"json"},"rowCount":{"type":"integer","minimum":0,"description":"Number of rows in the referenced blob"}},"required":["key","rowCount"]},"CounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string","description":"The target variable name"},"value":{"description":"The desired value for this target variable"},"matchMode":{"$ref":"#/components/schemas/CounterfactualMatchModeSchema","default":"tolerance","description":"How to decide whether a prediction meets this target: tolerance band, >= target, or <= target."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}],"description":"When matchMode='tolerance': percentage of |target| or absolute units."},"toleranceValue":{"type":["number","null"],"description":"When matchMode='tolerance': width of the tolerance band (>=0). None/0 means exact match."}},"required":["variable"]},"CounterfactualMatchModeSchema":{"type":"string","enum":["tolerance","orMore","orLess"]},"CounterfactualToleranceTypeSchema":{"type":"string","enum":["percentage","absolute"]},"CounterfactualVariableConstraintSchema":{"anyOf":[{"$ref":"#/components/schemas/RangeConstraintSchema"},{"$ref":"#/components/schemas/SetConstraintSchema"},{"$ref":"#/components/schemas/FixedConstraintSchema"}]},"RangeConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"range"},"minValue":{"type":["number","null"],"description":"Minimum allowed value (inclusive)"},"maxValue":{"type":["number","null"],"description":"Maximum allowed value (inclusive)"}},"required":["type"]},"SetConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"set"},"allowedValues":{"type":"array","items":{"type":["string","number","boolean"]},"description":"List of explicitly allowed values."}},"required":["type","allowedValues"]},"FixedConstraintSchema":{"type":"object","properties":{"type":{"type":"string","const":"fixed"}},"required":["type"]},"PredictionWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"prediction"},"sample":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Samples to predict for"},"sampleRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}],"description":"Datalake reference replacing inline sample"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to predict"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"}},"required":["type","targetVars"]},"ExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"],"description":"The cause variable to explain"},"effectVariable":{"type":["string","null"],"description":"The effect variable to explain"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"The segments to explain"}},"required":["type"]},"ExplanationModeSchema":{"type":"string","enum":["directional","discovery","impact"]},"ParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"}},"required":["type"]},"ForecastWithUncertaintyRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"forecast"},"forecastFrom":{"type":["number","null"],"description":"Timestamp of the forecast start"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom when set."}},"required":["type","forecastH","targetVars"]},"TemporalExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"causeVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select cause variables for directional mode"},"effectVariables":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Multi-select effect variables for directional mode"},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]}},"required":["type"]},"TemporalCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]}},"required":["type","targets"]},"TemporalCounterfactualTargetSchema":{"type":"object","properties":{"variable":{"type":"string"},"value":{},"timestamp":{"type":["number","null"]},"aggregation":{"type":"string","enum":["point","mean","cumulative"],"default":"point"},"targetMode":{"$ref":"#/components/schemas/TargetModeSchema"},"matchMode":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualMatchModeSchema"},{"type":"null"}],"description":"Left unset, each aggregation keeps its own rule: a 10% band for point and mean, at-least for cumulative. A value overrides that."},"toleranceType":{"anyOf":[{"$ref":"#/components/schemas/CounterfactualToleranceTypeSchema"},{"type":"null"}]},"toleranceValue":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]}},"required":["variable"]},"TargetModeSchema":{"type":"string","enum":["absolute","relative_percentage","relative_absolute"],"default":"absolute"},"TemporalOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":"number"},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]}},"required":["type","objectives","decisionVars","forecastHorizon"]},"TemporalOptimisationObjectiveSchema":{"type":"object","properties":{"direction":{"type":"string","enum":["maximise","minimise"]},"variable":{"type":"string"},"metricSqlQuery":{"type":"string"},"weight":{"type":"number","default":1},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}]},"discountFactor":{"type":"number","default":1},"conceptId":{"type":["string","null"]},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["direction","variable","metricSqlQuery"]},"TemporalInterventionTimingSchema":{"type":"object","properties":{"variable":{"type":"string"},"earliestTimestamp":{"type":["number","null"]},"latestTimestamp":{"type":["number","null"]},"allowRamping":{"type":"boolean","default":true},"maxRampSteps":{"type":["number","null"]}},"required":["variable"]},"PanelForecastRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_forecast"},"forecastH":{"type":"number","description":"Number of steps to forecast"},"targetVars":{"type":"array","items":{"type":"string"},"description":"Target variables to forecast"},"confidenceLevel":{"type":["number","null"],"default":0.95,"description":"Confidence level for intervals"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments to forecast. None = all environments"},"aggregateMode":{"anyOf":[{"$ref":"#/components/schemas/AggregateModeEnum"},{"type":"null"}],"description":"How to aggregate across environments. Unset defaults to avg at execution — every panel forecast stores an aggregate"},"originTimestamp":{"type":["number","null"],"description":"Forecast as-of timestamp (ms epoch). Overrides forecastFrom per environment."}},"required":["type","forecastH","targetVars"]},"AggregateModeEnum":{"type":"string","enum":["sum","avg","min","max"]},"PanelInterventionSpecSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_intervention"},"interventions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"},{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesInterventionSchema"}}]},"description":"A list of interventions or sequences"},"metrics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the metric"},"sqlQuery":{"type":"string","description":"The SQL query to calculate the metric"},"unit":{"allOf":[{"anyOf":[{"not":{}},{"type":["string","null"]}]},{"type":["string","null"]}],"description":"Canonical unit id (legacy keys coerced on read)"},"higherIsBetter":{"type":"boolean","default":true,"description":"Whether a higher value is better for this metric"},"temporal":{"anyOf":[{"$ref":"#/components/schemas/TemporalMetricSpecSchema"},{"type":"null"}],"description":"Temporal evaluation spec for time-aware metrics. Null for static panel models."},"conceptId":{"type":["string","null"],"description":"Ontology metric concept this SQL was materialised from, when picked from the ontology"},"conceptEditVersion":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"editVersion of the source concept at materialisation time; drift is detected against the live concept"}},"required":["name","sqlQuery"]},"description":"SQL queries to calculate the metrics of interest."},"variablesRelevantToMetric":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Variables causally relevant to the metric."},"segmentDefinitions":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}],"description":"Optional list of segment definitions"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for intervention. None = all environments"}},"required":["type","interventions","metrics"]},"PanelExplanationRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_explanation"},"explanationMode":{"anyOf":[{"$ref":"#/components/schemas/ExplanationModeSchema"},{"type":"null"}],"description":"Explicit explanation mode selection"},"causeVariable":{"type":["string","null"]},"effectVariable":{"type":["string","null"]},"segments":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SegmentDefinitionSchema"}},{"type":"null"}]},"forecastHorizonOverride":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for explanation. None = all environments"}},"required":["type"]},"PanelCounterfactualRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_counterfactual"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/TemporalCounterfactualTargetSchema"}},"constraints":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/CounterfactualVariableConstraintSchema"}},{"type":"null"}]},"maxChanges":{"type":"number","default":3},"forecastHorizon":{"type":["number","null"]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for counterfactual. None = all environments"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}],"description":"Multi-environment static panels only: baseline states to improve, applied in every environment in scope. Temporal panels solve from the twin's own trajectory and ignore this."}},"required":["type","targets"]},"PanelOptimisationScenarioSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_optimisation"},"objectives":{"type":"array","items":{"$ref":"#/components/schemas/TemporalOptimisationObjectiveSchema"}},"decisionVars":{"type":"array","items":{"type":"string"}},"variableConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/VariableConstraintSchema"}},{"type":"null"}]},"metricConstraints":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MetricConstraintSchema"}},{"type":"null"}]},"interventionTiming":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalInterventionTimingSchema"}},{"type":"null"}]},"forecastHorizon":{"type":["number","null"]},"interventionCountConfig":{"anyOf":[{"$ref":"#/components/schemas/InterventionCountConfigSchema"},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for optimisation. None = all environments"}},"required":["type","objectives","decisionVars"]},"PanelParentImpactRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_parent_impact"},"nodes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Nodes to analyze. None = all non-latent nodes with parents"},"nSamples":{"type":"number","default":500,"description":"Samples per do() contrast (static twins only)"},"horizonOverride":{"type":["number","null"],"description":"Attribution forecast window override (temporal twins only)"},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Specific environments for parent impact. None = all environments"}},"required":["type"]},"RootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"TemporalRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5}},"required":["type","targetVariable"]},"PanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"anomalyTimestep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"PanelScenarioSamplesRefSchema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"}},"StaticPanelRootCauseAnalysisRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_root_cause_analysis"},"targetVariable":{"type":"string"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type","targetVariable"]},"AnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"TemporalAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"temporal_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1}},"required":["type"]},"PanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRcaTopK":{"type":"integer","minimum":0,"default":1},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"StaticPanelAnomalyDetectionRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"static_panel_anomaly_detection"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"CausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true}},"required":["type"]},"ChmDataSourceSchema":{"type":"string","enum":["observed","forecast"]},"PanelCausalHealthMonitorRequestSchema":{"type":"object","properties":{"type":{"type":"string","const":"panel_causal_health_monitor"},"dataSource":{"$ref":"#/components/schemas/ChmDataSourceSchema","default":"observed"},"samples":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"samplesRef":{"anyOf":[{"$ref":"#/components/schemas/ScenarioSamplesRefSchema"},{"type":"null"}]},"forecastHorizon":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"startStep":{"type":["number","null"]},"endStep":{"type":["number","null"]},"targetFpr":{"type":"number","minimum":0.0001,"maximum":0.1,"default":0.005},"parentToleranceSigma":{"type":"number","default":0.5},"autoRca":{"type":"boolean","default":true},"environments":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"panelSamples":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":{}}}},{"type":"null"}]},"panelSamplesRef":{"anyOf":[{"$ref":"#/components/schemas/PanelScenarioSamplesRefSchema"},{"type":"null"}]}},"required":["type"]},"EnvironmentGroupSchema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"$ref":"#/components/schemas/EnvironmentGroupDefinitionSchema"},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"splitColumn":{"type":["string","null"]},"splitValue":{"type":["string","null"]}},"required":["id","name","definition","createdAt"]},"EnvironmentGroupDefinitionSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["columnValues","environments","statFilters"]},"columnValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"environments":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}},{"type":"null"}]},"statFilters":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"},{"type":"null"}]},"agreementThreshold":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]}},"required":["mode"]},"EnvStatFilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"type":"string","enum":["AND","OR"]},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EnvStatFilterSchema"},{"$ref":"#/components/schemas/EnvStatFilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"EnvStatFilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"reduce":{"anyOf":[{"$ref":"#/components/schemas/EnvStatReduceEnum"},{"type":"null"}]}},"required":["column","comparisonOperator","value"]},"EnvStatReduceEnum":{"type":"string","enum":["value","mean","min","max","any"]},"AutoUpdateSettingsSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":false},"mode":{"type":"string","enum":["assimilate_only","assimilate_or_retrain"],"default":"assimilate_only"}}}}}}
```

## The DigitalTwinVersion object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"DigitalTwinVersion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"twinId":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"versionMajor":{"type":"number","minimum":0},"versionMinor":{"type":"number","minimum":0},"versionPatch":{"type":"number","minimum":0},"version":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"derivedFromVersionId":{"type":["string","null"]},"changelog":{"anyOf":[{"$ref":"#/components/schemas/ChangeLogSchema"},{"type":"null"}]},"datasetId":{"type":"string"},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"inputFields":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"temporalDependencies":{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesSchema"},{"type":"null"}]},"timeSeriesMetadata":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesMetadataSchema"},{"type":"null"}]},"granularity":{"type":["string","null"]},"fixedSubGraph":{"anyOf":[{"$ref":"#/components/schemas/FixedSubGraphSchema"},{"type":"null"}]},"variableRoles":{"anyOf":[{"$ref":"#/components/schemas/VariableRolesSchema"},{"type":"null"}]},"derivedColumns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"}},{"type":"null"}]},"dataSignature":{"type":"string"},"configSignature":{"type":"string"},"nTrainSamples":{"type":["number","null"]},"causalGraph":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CausalNodeSchema"}},"evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResultSchema"},{"type":"null"}]},"panelEvaluation":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EvaluationResultSchema"}},{"type":"null"}]},"graphRecommendations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GraphRecommendationsSchema"}},{"type":"null"}]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedEnvironmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedTimeColumnName":{"type":["string","null"]},"environmentSelection":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSelectionSchema"},{"type":"null"}]},"extraOps":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"nEnvironments":{"type":["number","null"]},"latentClusters":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/LatentClusterInfoSchema"}},{"type":"null"}]},"latentDiscoveryConfig":{"anyOf":[{"$ref":"#/components/schemas/LatentDiscoveryConfigSchema"},{"type":"null"}]},"nodeDomains":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}},{"type":"null"}]},"lastTimestampMs":{"type":["number","null"]},"headCommit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trainedWindowSignature":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"trainedWindowProfile":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnWindowProfileSchema"}},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"updateEligibility":{"anyOf":[{"type":"object","properties":{"updateMode":{"type":"string","enum":["assimilable","retrain_required","up_to_date","unsupported"]},"reasons":{"type":"array","items":{"type":"string"},"default":[]},"newRows":{"type":["number","null"]},"fromTsMs":{"type":["number","null"]},"toTsMs":{"type":["number","null"]},"historyDiff":{"anyOf":[{"$ref":"#/components/schemas/HistoryDiffSchema"},{"type":"null"}]}},"required":["updateMode"]},{"type":"null"}]},"trainingStages":{"anyOf":[{"type":"object","properties":{"confounderModelling":{"type":"boolean"},"equationDiscovery":{"type":"boolean"},"lagScreening":{"type":["boolean","null"]},"evalHorizons":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvalHorizonSchema"}},{"type":"null"}]}},"required":["confounderModelling","equationDiscovery"]},{"type":"null"}]},"timeComponent":{"anyOf":[{"$ref":"#/components/schemas/TimeComponentArtifactSchema"},{"type":"null"}]},"causalAlgorithmVersion":{"type":["string","null"]},"digitalTwinAlgorithmVersion":{"type":["string","null"]},"shardCount":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"maxLag":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"layout":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean"},"positions":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]},"edgeWaypoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]}},"required":["success"]},{"type":"null"}]},"lifecycleState":{"$ref":"#/components/schemas/LifecycleStateEnum","default":"created"},"currentTaskId":{"type":["string","null"]},"failureContext":{"anyOf":[{"$ref":"#/components/schemas/FailureContextSchema"},{"type":"null"}]},"traces":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":["string","null"]}}}},{"type":"null"}]},"arrayFeatureMap":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"arrayFeatureToBase":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","twinId","organisationId","workspaceId","versionMajor","versionMinor","versionPatch","datasetId","type","dataSignature","configSignature","causalGraph","nodes"]},{"type":"object","properties":{"id":{"type":"string"},"twinId":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"versionMajor":{"type":"number","minimum":0},"versionMinor":{"type":"number","minimum":0},"versionPatch":{"type":"number","minimum":0},"version":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"derivedFromVersionId":{"type":["string","null"]},"changelog":{"anyOf":[{"$ref":"#/components/schemas/ChangeLogSchema"},{"type":"null"}]},"sourceId":{"type":"string"},"type":{"$ref":"#/components/schemas/DigitalTwinTypeEnum"},"inputFields":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"temporalDependencies":{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesSchema"},{"type":"null"}]},"timeSeriesMetadata":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesMetadataSchema"},{"type":"null"}]},"granularity":{"type":["string","null"]},"fixedSubGraph":{"anyOf":[{"$ref":"#/components/schemas/FixedSubGraphSchema"},{"type":"null"}]},"variableRoles":{"anyOf":[{"$ref":"#/components/schemas/VariableRolesSchema"},{"type":"null"}]},"derivedColumns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"}},{"type":"null"}]},"dataSignature":{"type":"string"},"configSignature":{"type":"string"},"nTrainSamples":{"type":["number","null"]},"causalGraph":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/CausalNodeSchema"}},"evaluation":{"anyOf":[{"$ref":"#/components/schemas/EvaluationResultSchema"},{"type":"null"}]},"panelEvaluation":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EvaluationResultSchema"}},{"type":"null"}]},"graphRecommendations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GraphRecommendationsSchema"}},{"type":"null"}]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedEnvironmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedTimeColumnName":{"type":["string","null"]},"environmentSelection":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSelectionSchema"},{"type":"null"}]},"extraOps":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"nEnvironments":{"type":["number","null"]},"latentClusters":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/LatentClusterInfoSchema"}},{"type":"null"}]},"latentDiscoveryConfig":{"anyOf":[{"$ref":"#/components/schemas/LatentDiscoveryConfigSchema"},{"type":"null"}]},"nodeDomains":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"}},"required":["min","max"]}},{"type":"null"}]},"lastTimestampMs":{"type":["number","null"]},"headCommit":{"anyOf":[{"type":"integer"},{"type":"null"}]},"trainedWindowSignature":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"trainedWindowProfile":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnWindowProfileSchema"}},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"updateEligibility":{"anyOf":[{"type":"object","properties":{"updateMode":{"type":"string","enum":["assimilable","retrain_required","up_to_date","unsupported"]},"reasons":{"type":"array","items":{"type":"string"},"default":[]},"newRows":{"type":["number","null"]},"fromTsMs":{"type":["number","null"]},"toTsMs":{"type":["number","null"]},"historyDiff":{"anyOf":[{"$ref":"#/components/schemas/HistoryDiffSchema"},{"type":"null"}]}},"required":["updateMode"]},{"type":"null"}]},"trainingStages":{"anyOf":[{"type":"object","properties":{"confounderModelling":{"type":"boolean"},"equationDiscovery":{"type":"boolean"},"lagScreening":{"type":["boolean","null"]},"evalHorizons":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvalHorizonSchema"}},{"type":"null"}]}},"required":["confounderModelling","equationDiscovery"]},{"type":"null"}]},"timeComponent":{"anyOf":[{"$ref":"#/components/schemas/TimeComponentArtifactSchema"},{"type":"null"}]},"causalAlgorithmVersion":{"type":["string","null"]},"digitalTwinAlgorithmVersion":{"type":["string","null"]},"shardCount":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"maxLag":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"layout":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean"},"positions":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]},"edgeWaypoints":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"null"}]}},"required":["success"]},{"type":"null"}]},"lifecycleState":{"$ref":"#/components/schemas/LifecycleStateEnum","default":"created"},"currentTaskId":{"type":["string","null"]},"failureContext":{"anyOf":[{"$ref":"#/components/schemas/FailureContextSchema"},{"type":"null"}]},"traces":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":["string","null"]}}}},{"type":"null"}]},"arrayFeatureMap":{"anyOf":[{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},{"type":"null"}]},"arrayFeatureToBase":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","twinId","organisationId","workspaceId","versionMajor","versionMinor","versionPatch","sourceId","type","dataSignature","configSignature","causalGraph","nodes"]}]},"ChangeLogSchema":{"type":"object","properties":{"temporalDependenciesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TemporalDependencyChangeSchema"}},{"type":"null"}]},"fixedSubGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/FixedSubGraphChangeSchema"}},{"type":"null"}]},"causalGraphDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CausalGraphChangeSchema"}},{"type":"null"}]},"nodesDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NodeChangeSchema"}},{"type":"null"}]},"evaluationDiffs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/EvaluationChangeSchema"}},{"type":"null"}]}}},"TemporalDependencyChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"variable":{"type":"string"},"oldPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"newPrerequisites":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["type","variable"]},"ChangeTypeEnum":{"type":"string","enum":["added","removed","modified"]},"FixedSubGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"changeTarget":{"type":"string","enum":["relationships","antiRelationships"]},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"required":["type","changeTarget","relationship"]},"CausalRelationshipSchema":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"strength":{"type":"number"},"strengthStatus":{"anyOf":[{"type":"string","enum":["measured","not_measured"]},{"type":"null"}]},"timeLagEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lag":{"type":"number"},"strength":{"type":"number"},"granularity":{"type":["string","null"]}},"required":["lag","strength"]}},{"type":"null"}]},"cyclicalEffects":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"frequency":{"type":"string"},"strength":{"type":"number"}},"required":["frequency","strength"]}},{"type":"null"}]},"confidence":{"type":["number","null"]},"agreementRate":{"type":["number","null"]},"isEnvironmentGated":{"type":"boolean","default":false}},"required":["source","target","strength"]},"CausalGraphChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"relationship":{"$ref":"#/components/schemas/CausalRelationshipSchema"},"oldRelationship":{"anyOf":[{"$ref":"#/components/schemas/CausalRelationshipSchema"},{"type":"null"}]}},"required":["type","relationship"]},"NodeChangeSchema":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ChangeTypeEnum"},"node":{"$ref":"#/components/schemas/CausalNodeSchema"},"oldNode":{"anyOf":[{"$ref":"#/components/schemas/CausalNodeSchema"},{"type":"null"}]}},"required":["type","node"]},"CausalNodeSchema":{"type":"object","properties":{"name":{"type":"string"},"nodeType":{"$ref":"#/components/schemas/NodeTypeEnum","default":"observed"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latentClusterId":{"type":["number","null"]},"environmentColumns":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"isDerived":{"type":"boolean","default":false},"symbolicEquation":{"anyOf":[{"$ref":"#/components/schemas/SymbolicEquationSchema"},{"type":"null"}]},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DtDerivedColumnInfoSchema"},{"type":"null"}]},"parentImpacts":{"anyOf":[{"$ref":"#/components/schemas/NodeParentImpactsSchema"},{"type":"null"}],"description":"Model-based driver contribution shares computed after training"}},"required":["name","type"]},"NodeTypeEnum":{"type":"string","enum":["observed","latent","latent_inter","latent_intra","environment"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SymbolicEquationSchema":{"type":"object","properties":{"expression":{"type":"string"},"r2":{"type":"number"},"noisePercentage":{"type":"number"},"termBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicTermSchema"}},"complexity":{"type":"number"},"explanationType":{"type":"string","enum":["regression","classification_rules","conditional_probability"],"default":"regression"},"epsilonSigma":{"type":["number","null"]},"epsilonSigmaRelative":{"type":["number","null"]},"expressionWithNoise":{"type":["string","null"]},"discoveryMethod":{"type":["string","null"]},"parentContributions":{"type":"array","items":{"$ref":"#/components/schemas/SymbolicParentContributionSchema"}},"unexplainedPct":{"type":["number","null"]},"directionReferenceClass":{"type":["string","null"]},"alternatives":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SymbolicEquationAlternativeSchema"}},{"type":"null"}],"description":"Pareto-front alternatives to the chosen equation (balanced / fewer terms / better fit); absent until discovery emits them"}},"required":["expression","r2","noisePercentage","termBreakdown","complexity"]},"SymbolicTermSchema":{"type":"object","properties":{"expression":{"type":"string"},"parentVariable":{"type":["string","null"]},"parentVariables":{"type":"array","items":{"type":"string"}},"coefficient":{"type":"number"},"operator":{"type":"string"},"contributionPercentage":{"type":"number"}},"required":["expression","coefficient","operator","contributionPercentage"]},"SymbolicParentContributionSchema":{"type":"object","properties":{"parent":{"type":"string"},"contributionPct":{"type":"number"},"signedEffect":{"type":"number"},"direction":{"type":"string","enum":["positive","negative","mixed","none"]},"terms":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["included","noEffect"]}},"required":["parent","contributionPct","signedEffect","direction","terms","status"]},"SymbolicEquationAlternativeSchema":{"type":"object","properties":{"label":{"type":"string","description":"How this alternative trades off, e.g. 'Balanced', 'Fewer terms', 'Better fit'"},"expression":{"type":"string"},"r2":{"type":["number","null"]},"complexity":{"type":["number","null"]}},"required":["label","expression"]},"DtDerivedColumnInfoSchema":{"type":"object","properties":{"derivedType":{"type":"string"},"targetColumn":{"type":"string"},"sourceColumns":{"type":"array","items":{"type":"string"}},"expression":{"type":"string"},"r2":{"type":["number","null"]},"isDeterministic":{"type":"boolean"},"implausibilityReason":{"type":["string","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"seasonalTerms":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalTermSchema"}},{"type":"null"}]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]}},"required":["derivedType","targetColumn","sourceColumns","expression","isDeterministic"]},"SeasonalTermSchema":{"type":"object","properties":{"period":{"type":"number"},"order":{"type":"number","default":1}},"required":["period"]},"NodeParentImpactsSchema":{"type":"object","properties":{"node":{"type":"string"},"method":{"type":"string","enum":["forecast_attribution","fwl_betas","gaamt_betas","cat_logit_betas","do_contrast"]},"parents":{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},"exogenous":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentImpactEntrySchema"}},{"type":"null"}],"description":"Trend/seasonal/level drivers on the same 0-100 scale as parents"},"nonParentShare":{"type":["number","null"]}},"required":["node","method","parents"]},"ParentImpactEntrySchema":{"type":"object","properties":{"parent":{"type":"string"},"impactPct":{"type":"number","description":"Share of total driver influence on the node, 0-100"},"signedEffect":{"type":"number"},"lagBreakdown":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["parent","impactPct","signedEffect"]},"EvaluationChangeSchema":{"type":"object","properties":{"type":{"type":"string","enum":["improvement","worsening"]},"metric":{"type":"string"},"oldValue":{"type":["number","null"]},"newValue":{"type":"number"},"percentChange":{"type":["number","null"]}},"required":["type","metric","newValue"]},"DigitalTwinTypeEnum":{"type":"string","enum":["static","temporal","multi-environment-temporal","multi-environment-static"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"TemporalDependenciesSchema":{"anyOf":[{"not":{}},{"anyOf":[{"$ref":"#/components/schemas/TemporalDependenciesObjectSchema"},{"type":"null"}]}]},"TemporalDependenciesObjectSchema":{"type":"object","properties":{"prerequisites":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["prerequisites"]},"TimeSeriesMetadataSchema":{"type":"object","properties":{"colName":{"type":"string","description":"Column name for the time series"},"granularity":{"type":"string","enum":["ms","s","min","h","D","W","ME","Y","L","S","T","H"],"description":"Current granularity of the time series"},"validGranularities":{"type":"array","items":{"type":"string"},"description":"List of valid granularities"},"startDate":{"type":"string","description":"Start date of the time series"},"endDate":{"type":"string","description":"End date of the time series"},"typicalDeltaSeconds":{"type":["number","null"]},"selectedGrid":{"type":["string","null"]},"candidateGrids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"scoring":{"anyOf":[{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"number"}}},{"type":"null"}]},"coverage":{"anyOf":[{"$ref":"#/components/schemas/TimeSeriesCoverageSchema"},{"type":"null"}],"description":"Observed vs imputed grid steps; absent on twins trained before this existed"}},"required":["colName","granularity","validGranularities","startDate","endDate"]},"TimeSeriesCoverageSchema":{"type":"object","properties":{"observedSteps":{"type":"number","description":"Grid steps that carried at least one observed row"},"gridSteps":{"type":"number","description":"Steps on the dense grid the twin trains on"},"imputedSteps":{"type":"number","description":"Grid steps reconstructed by imputation, never measured"},"gapCount":{"type":"number","description":"Total gap runs; `gaps` lists only the largest"},"gaps":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesGapSchema"}}},"required":["observedSteps","gridSteps","imputedSteps","gapCount","gaps"]},"TimeSeriesGapSchema":{"type":"object","properties":{"startDate":{"type":"string","description":"First grid step in the gap"},"endDate":{"type":"string","description":"Last grid step in the gap"},"missingSteps":{"type":"number","description":"Consecutive grid steps with no observed rows"}},"required":["startDate","endDate","missingSteps"]},"FixedSubGraphSchema":{"type":"object","properties":{"relationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}},"antiRelationships":{"type":"array","items":{"$ref":"#/components/schemas/CausalRelationshipSchema"}}},"required":["relationships","antiRelationships"]},"VariableRolesSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"type":"string"}}},"required":["sources","targets"]},"EvaluationResultSchema":{"type":"object","properties":{"modelType":{"type":"string","enum":["cbn","tcbn"],"description":"Type of the model"},"nodeMetrics":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/NodeMetricsSchema"},"description":"Metrics for each node"},"globalMetrics":{"type":"object","properties":{"logLikelihood":{"type":["number","null"],"description":"Overall log-likelihood"},"averageMse":{"type":["number","null"],"description":"Overall mean squared error"},"averageMae":{"type":["number","null"],"description":"Overall mean absolute error"},"averageAccuracy":{"type":["number","null"],"description":"Overall accuracy"},"averageMape":{"type":["number","null"],"description":"Overall mean absolute percentage error"}},"description":"Global metrics"},"skippedReason":{"anyOf":[{"type":"string","enum":["insufficient_data"]},{"type":"null"}],"description":"Set when evaluation was deliberately skipped"},"skipReasons":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"User-facing explanation of why evaluation was skipped"},"nEvalPoints":{"type":["number","null"],"description":"Number of holdout time steps evaluation used (or would have used)"}},"required":["modelType","nodeMetrics","globalMetrics"]},"NodeMetricsSchema":{"type":"object","properties":{"accuracy":{"type":["number","null"],"description":"Classification accuracy"},"accuracyPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Classification accuracy per class"},"weightedAccuracy":{"type":["number","null"],"description":"Weighted classification accuracy"},"falsePositiveRate":{"type":["number","null"],"description":"False positive rate"},"falseNegativeRate":{"type":["number","null"],"description":"False negative rate"},"truePositiveRate":{"type":["number","null"],"description":"True positive rate"},"trueNegativeRate":{"type":["number","null"],"description":"True negative rate"},"precision":{"type":["number","null"],"description":"Precision, macro-averaged across classes"},"recall":{"type":["number","null"],"description":"Recall, macro-averaged across classes"},"f1Score":{"type":["number","null"],"description":"F1 score, macro-averaged across classes"},"precisionPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Precision per class"},"recallPerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"Recall per class"},"f1ScorePerClass":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}],"description":"F1 score per class"},"positiveClassLabel":{"type":["string","null"],"description":"Decoded label of encoded class 1, the anchor for TPR/FPR/TNR/FNR"},"mse":{"type":["number","null"],"description":"Mean squared error"},"r2":{"type":["number","null"],"description":"R-squared"},"logLikelihood":{"type":["number","null"],"description":"Log-likelihood"},"auc":{"type":["number","null"],"description":"Area under ROC curve"},"brierScore":{"type":["number","null"],"description":"Brier score"},"mae":{"type":["number","null"],"description":"Mean absolute error"},"mape":{"anyOf":[{"type":"object","additionalProperties":{"type":["number","null"]}},{"type":"null"}],"description":"Mean absolute percentage error per horizon"}}},"GraphRecommendationsSchema":{"type":"object","properties":{"x":{"type":"string"},"y":{"type":"string"},"direction":{"type":"string","enum":["forward","backward"]},"reasons":{"type":"array","items":{"type":"string"}}},"required":["x","y","direction","reasons"]},"EnvironmentSelectionSchema":{"type":"object","properties":{"baseline":{"type":"string","enum":["all","none"]},"exceptions":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}}}},"required":["baseline","exceptions"]},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"LatentClusterInfoSchema":{"type":"object","properties":{"clusterId":{"type":"number"},"affectedNodes":{"type":"array","items":{"type":"string"}},"estimatedDim":{"type":"number","default":1},"dicSatisfied":{"type":"boolean","default":true},"interColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"intraColumnNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"modelStatus":{"anyOf":[{"$ref":"#/components/schemas/LatentModelStatusEnum"},{"type":"null"}]},"modelFailureReason":{"anyOf":[{"$ref":"#/components/schemas/LatentFitFailureReasonEnum"},{"type":"null"}]},"modelFailureDetail":{"type":["string","null"]},"avgLcScore":{"type":["number","null"]},"reconstructionError":{"type":["number","null"]},"envPredictability":{"type":["number","null"]},"memberLatentShare":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"seasonalStrength":{"type":["number","null"]}},"required":["clusterId","affectedNodes"]},"LatentModelStatusEnum":{"type":"string","enum":["modelled","detectedOnly"]},"LatentFitFailureReasonEnum":{"type":"string","enum":["tooFewMembers","noNumericMembers","noExternalParents","allParentColumnsEmpty","insufficientCleanRows","fitError"]},"LatentDiscoveryConfigSchema":{"type":"object","properties":{"enabled":{"type":"boolean","default":true},"residualCorrelationThreshold":{"type":"number","default":0.3},"ciTestAlpha":{"type":"number","default":0.05},"minClusterSize":{"type":"number","default":2},"maxLatentDim":{"type":"number","default":5}}},"ColumnWindowProfileSchema":{"type":"object","properties":{"count":{"type":["number","null"]},"distinct":{"type":["number","null"]},"min":{"type":["string","null"]},"max":{"type":["string","null"]}}},"HistoryDiffSchema":{"type":"object","properties":{"changedColumns":{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"stored":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]},"current":{"anyOf":[{"$ref":"#/components/schemas/ColumnWindowProfileSchema"},{"type":"null"}]}},"required":["column"]},"default":[]},"deltaOperations":{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"version":{"type":"integer"},"operation":{"type":"string"},"timestampMs":{"type":["number","null"]}},"required":["datasetId","version","operation"]},"default":[]},"rewrittenDatasets":{"type":"array","items":{"type":"string"},"default":[]}}},"EvalHorizonSchema":{"type":"object","properties":{"count":{"type":"integer","exclusiveMinimum":0},"unit":{"$ref":"#/components/schemas/HorizonUnitEnum"}},"required":["count","unit"]},"HorizonUnitEnum":{"type":"string","enum":["S","T","H","D","W","ME","Y"]},"TimeComponentArtifactSchema":{"type":"object","properties":{"models":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeDecompositionModelSchema"}},"varExplained":{"type":"object","additionalProperties":{"type":"number"}},"trainNSamples":{"type":"number"}},"required":["models","varExplained","trainNSamples"]},"TimeDecompositionModelSchema":{"type":"object","properties":{"theilSenSlope":{"type":"number"},"theilSenIntercept":{"type":"number"},"harmonic":{"anyOf":[{"$ref":"#/components/schemas/HarmonicFitSchema"},{"type":"null"}]}},"required":["theilSenSlope","theilSenIntercept"]},"HarmonicFitSchema":{"type":"object","properties":{"periodsWithHarmonics":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"sinCosCoefficients":{"type":"array","items":{"type":"number"}},"productPairs":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}]}},"productCoefficients":{"type":"array","items":{"type":"number"}}},"required":["periodsWithHarmonics","sinCosCoefficients","productPairs","productCoefficients"]},"LifecycleStateEnum":{"type":"string","enum":["created","discovering","resolved","training","trained","failed","cancelled"]},"FailureContextSchema":{"type":"object","properties":{"error":{"type":"string"},"failedAtStage":{"type":"string","enum":["causal_discovery","model_training"]},"retryable":{"type":"boolean","default":true},"userFacing":{"type":"boolean","default":false}},"required":["error","failedAtStage"]}}}}
```

## The OntologyConcept object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"OntologyConcept":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"conceptClassification":{"anyOf":[{"$ref":"#/components/schemas/ConceptClassificationEnum"},{"type":"null"}]},"anchorConceptLinks":{"type":"array","items":{"type":"string"},"default":[]},"schemaFieldName":{"type":"string"},"schemaType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"schemaSubtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"metadata":{"$ref":"#/components/schemas/ConceptMetadataSchema"},"lockedMetadataFields":{"type":"array","items":{"type":"string"}},"detectedMetadata":{"anyOf":[{"$ref":"#/components/schemas/ConceptMetadataSchema"},{"type":"null"}]},"fieldMappings":{"type":"array","items":{"type":"object","properties":{"sourceId":{"type":"string"},"field":{"type":"string"},"status":{"$ref":"#/components/schemas/BindingStatusEnum","default":"confirmed"},"source":{"$ref":"#/components/schemas/BindingSourceEnum","default":"ingest"},"confidence":{"type":["number","null"]},"evidence":{"type":["string","null"]},"valueMap":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}},{"allOf":[{},{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string"},{"type":"string"}]}}]}]},{"type":"null"}]},"canonicalField":{"type":["string","null"]},"scopeFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"precedence":{"type":["number","null"]},"keyRole":{"anyOf":[{"$ref":"#/components/schemas/KeyRoleEnum"},{"type":"null"}]},"conformance":{"anyOf":[{"$ref":"#/components/schemas/ConformanceReportSchema"},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]}},"required":["sourceId","field"]}},"derivedInfo":{"anyOf":[{"$ref":"#/components/schemas/DerivedConceptInfoSchema"},{"type":"null"}]},"conceptKind":{"$ref":"#/components/schemas/ConceptKindEnum","default":"standard"},"metricSql":{"type":["string","null"]},"relationshipRules":{"type":"array","items":{"$ref":"#/components/schemas/RelationshipRuleSchema"},"default":[]},"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]},"trustTier":{"anyOf":[{"type":"string","enum":["exploratory","curated_pending","curated"]},{"type":"null"}]},"ontologyRef":{"anyOf":[{"type":"object","properties":{"ontologyId":{"type":"string"},"ontologyVersion":{"type":"string"},"canonicalId":{"type":"string"},"installScope":{"anyOf":[{"type":"object","properties":{"conceptCanonicalIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"filters":{"type":"array","items":{"type":"object","properties":{"conceptRef":{"type":"string"},"values":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]}},"required":["conceptRef"]},"default":[]}}},{"type":"null"}]}},"required":["ontologyId","ontologyVersion","canonicalId"]},{"type":"null"}]},"layerIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"},"default":[]},"valueMappings":{"type":"array","items":{"$ref":"#/components/schemas/ConceptValueMappingSchema"},"default":[]},"lockedConceptFields":{"type":"array","items":{"type":"string"}},"detectedConceptStructure":{"anyOf":[{"$ref":"#/components/schemas/DetectedConceptStructureSchema"},{"type":"null"}]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]},"lineageDrift":{"type":["boolean","null"]},"editVersion":{"type":"integer","minimum":0,"default":0},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organisationId","workspaceId","name","schemaFieldName","schemaType","metadata","fieldMappings"]},"ConceptClassificationEnum":{"type":"string","enum":["identifier","location","time"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"ConceptMetadataSchema":{"type":"object","properties":{"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"isMonotonicallyIncreasing":{"type":["boolean","null"]},"isMonotonicallyDecreasing":{"type":["boolean","null"]},"isUnique":{"type":["boolean","null"]},"isCyclic":{"type":["boolean","null"]},"isHeterogeneousIdentifier":{"type":["boolean","null"]},"compositeScopeConceptId":{"type":["string","null"]},"isUniformDistribution":{"type":["boolean","null"]},"locationType":{"anyOf":[{"$ref":"#/components/schemas/AnchorLocationTypeEnum"},{"type":"null"}]},"coordinateFormat":{"anyOf":[{"$ref":"#/components/schemas/CoordinateFormatEnum"},{"type":"null"}]},"coordinateDatum":{"anyOf":[{"$ref":"#/components/schemas/CoordinateDatumEnum"},{"type":"null"}]},"coordinatePairConceptId":{"type":["string","null"]},"locationDetectionSource":{"anyOf":[{"$ref":"#/components/schemas/LocationDetectionSourceEnum"},{"type":"null"}]},"latitudeInRangeFraction":{"type":["number","null"]},"longitudeInRangeFraction":{"type":["number","null"]},"fractionalPartFraction":{"type":["number","null"]},"coordinatePairFraction":{"type":["number","null"]},"dmsCoordinateFraction":{"type":["number","null"]},"postalCodeFraction":{"type":["number","null"]},"addressShapeFraction":{"type":["number","null"]},"enrichments":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/EnrichmentRecordSchema"}},{"type":"null"}]},"geoEnrichmentStatus":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"geoEnrichmentKind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"geoEnrichedAt":{"type":["string","null"]},"geoEnrichmentVersion":{"type":["number","null"]},"geoSidecarKey":{"type":["string","null"]},"geoDistinctTotal":{"type":["number","null"]},"geoMatchedCount":{"type":["number","null"]},"geoUnmatchedCount":{"type":["number","null"]},"geoTruncated":{"type":["boolean","null"]},"geoEnrichmentError":{"type":["string","null"]},"nanFillStrategy":{"anyOf":[{"$ref":"#/components/schemas/NanFillStrategyEnum"},{"type":"null"}]},"changeRate":{"type":["number","null"]},"dateTimeFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"averageInterval":{"type":["number","null"]},"isConsistentInterval":{"type":["boolean","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"higherIsBetter":{"type":["boolean","null"]},"isEqualInterval":{"type":["boolean","null"]},"intervalSize":{"type":["number","null"]},"valueClass":{"anyOf":[{"$ref":"#/components/schemas/ValueClassEnum"},{"type":"null"}]},"fracZero":{"type":["number","null"]},"zeroRunLengthP95":{"type":["number","null"]},"nonZeroRunLengthP95":{"type":["number","null"]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"emailFraction":{"type":["number","null"]},"medianLength":{"type":["number","null"]},"distinctLengthCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"tsGranularity":{"type":["string","null"]},"tsValidGranularities":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"tsTypicalDeltaSeconds":{"type":["number","null"]},"tsSelectedGrid":{"type":["string","null"]},"tsGapProfile":{"anyOf":[{"$ref":"#/components/schemas/GapProfileSchema"},{"type":"null"}]},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsPerEnvProfiles":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/TimeSeriesEnvProfileSchema"}},{"type":"null"}]},"tsAnalyzerVersion":{"type":["string","null"]},"tsAnalyzedAt":{"type":["string","null"]},"elementSchemaType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"elementCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"sizeStatistics":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"additionalProperties":true},"AnchorLocationTypeEnum":{"type":"string","enum":["latitude","longitude","coordinate","country","region","city","postal_code","address","continent","airport_code","unlocode"]},"CoordinateFormatEnum":{"type":"string","enum":["dd","dms","ddm"]},"CoordinateDatumEnum":{"type":"string","enum":["wgs84","gcj02","bd09"]},"LocationDetectionSourceEnum":{"type":"string","enum":["values","column_name","user"]},"EnrichmentRecordSchema":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentStatusEnum"},{"type":"null"}]},"kind":{"anyOf":[{"$ref":"#/components/schemas/GeoEnrichmentKindEnum"},{"type":"null"}]},"enrichedAt":{"type":["string","null"]},"enricherVersion":{"type":["string","null"]},"dataVersion":{"type":["string","null"]},"version":{"type":["number","null"]},"sidecarKey":{"type":["string","null"]},"keyFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"hintFields":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]},"corroborationFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"latLonPrecision":{"type":["number","null"]},"distinctTotal":{"type":["number","null"]},"matchedCount":{"type":["number","null"]},"unmatchedCount":{"type":["number","null"]},"truncated":{"type":["boolean","null"]},"error":{"type":["string","null"]},"appliedDatum":{"type":["string","null"]}}},"GeoEnrichmentStatusEnum":{"type":"string","enum":["running","completed","partial","failed"]},"GeoEnrichmentKindEnum":{"type":"string","enum":["forward","reverse"]},"NanFillStrategyEnum":{"type":"string","enum":["forward","interpolate","zero","drop","undefined"]},"ValueClassEnum":{"type":"string","enum":["continuous","sparse_event","bursty","binary_indicator"]},"GapProfileSchema":{"type":"object","properties":{"expectedIntervalSeconds":{"type":["number","null"]},"p50GapSeconds":{"type":["number","null"]},"p95GapSeconds":{"type":["number","null"]},"p99GapSeconds":{"type":["number","null"]},"maxGapSeconds":{"type":["number","null"]},"gapCount":{"type":["number","null"]},"largestGapStart":{"type":["string","null"]}}},"SeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"strength":{"type":"number"},"confidence":{"type":"number"},"amplitude":{"type":["number","null"]},"phase":{"type":["number","null"]},"order":{"type":"number","default":1}},"required":["periodSeconds","strength","confidence"]},"CategoricalSeasonalPeriodSchema":{"type":"object","properties":{"periodSeconds":{"type":"number"},"cycleLabel":{"type":["string","null"]},"nPhaseBins":{"type":"number"},"cramersV":{"type":"number"},"chi2PerDof":{"type":["number","null"]},"phaseDistribution":{"anyOf":[{"type":"array","items":{"type":"array","items":{"type":"number"}}},{"type":"null"}]},"levels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["periodSeconds","nPhaseBins","cramersV"]},"CyclicPatternSchema":{"type":"object","properties":{"cycle":{"$ref":"#/components/schemas/CycleNameEnum"},"activeIndices":{"type":"array","items":{"type":"number"},"default":[]},"inactiveIndices":{"type":"array","items":{"type":"number"},"default":[]},"densityByIndex":{"type":"object","additionalProperties":{"type":"number"},"default":{}},"aggByIndex":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]}},"required":["cycle"]},"CycleNameEnum":{"type":"string","enum":["hour_of_day","day_of_week","day_of_month","month_of_year","week_of_year"]},"TimeSeriesEnvProfileSchema":{"type":"object","properties":{"envKey":{"type":"string"},"tsSeasonalPeriods":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SeasonalPeriodSchema"}},{"type":"null"}]},"tsCategoricalSeasonality":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CategoricalSeasonalPeriodSchema"}},{"type":"null"}]},"tsMissingPatterns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"tsActiveWindows":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/CyclicPatternSchema"}},{"type":"null"}]},"trendSlopePerSecond":{"type":["number","null"]},"trendR2":{"type":["number","null"]},"tsTypicalDeltaSeconds":{"type":["number","null"]}},"required":["envKey"]},"BindingStatusEnum":{"type":"string","enum":["confirmed","suggested"]},"BindingSourceEnum":{"type":"string","enum":["ingest","statistical","llm","user","install"]},"KeyRoleEnum":{"type":"string","enum":["primary","foreign"]},"ConformanceReportSchema":{"type":"object","properties":{"rowsScanned":{"type":"number"},"nullRate":{"type":"number"},"allowedValueCoverage":{"type":["number","null"]},"unresolvedValues":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"number"}},"required":["value","count"]},"default":[]},"inferredGranularity":{"type":["string","null"]},"granularityMatch":{"type":["boolean","null"]},"duplicateAnchorKeys":{"type":["number","null"]},"unitNote":{"type":["string","null"]},"verdict":{"$ref":"#/components/schemas/ConformanceVerdictEnum","default":"pass"}},"required":["rowsScanned","nullRate"]},"ConformanceVerdictEnum":{"type":"string","enum":["pass","warn","fail"]},"DerivedConceptInfoSchema":{"type":"object","properties":{"formula":{"type":["string","null"]},"formulaBlocks":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{"oneOf":[{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"template"},"blockType":{"type":"string","minLength":1},"values":{"type":"object","additionalProperties":{}}},"required":["nodeId","kind","blockType"]},{"type":"object","properties":{"nodeId":{"type":"string"},"kind":{"type":"string","const":"structural"},"blockType":{"type":"string","enum":["binary","ifElse"]},"values":{"type":"object","additionalProperties":{}},"children":{"type":"object","additionalProperties":{"anyOf":[{},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]}}},"required":["nodeId","kind","blockType","children"]}],"discriminator":{"propertyName":"kind"}},{"type":"null"}]},"derivedType":{"$ref":"#/components/schemas/DerivedTypeEnum","default":"manual"},"kind":{"anyOf":[{"$ref":"#/components/schemas/DerivedInfoKindEnum"},{"type":"null"}]},"source":{"anyOf":[{"$ref":"#/components/schemas/DerivedSourceEnum"},{"type":"null"}]},"sourceColumns":{"type":"array","items":{"type":"string"},"default":[]},"expression":{"type":["string","null"]},"r2":{"type":["number","null"]},"isDeterministic":{"type":["boolean","null"]},"lag":{"type":["number","null"]},"cumulativeDirection":{"type":["string","null"]},"sourceDataViewId":{"type":["string","null"]},"operationLineage":{"anyOf":[{"$ref":"#/components/schemas/OperationLineageSchema"},{"type":"null"}]},"viewSnapshot":{"anyOf":[{"$ref":"#/components/schemas/ViewSnapshotSchema"},{"type":"null"}]},"lineageHash":{"type":["string","null"]},"sourceJoinConfig":{"anyOf":[{"$ref":"#/components/schemas/SourceJoinConfigSchema"},{"type":"null"}]}}},"DerivedTypeEnum":{"type":"string","enum":["manual","datetime_component","lag","cumulative","step_change","algebraic_identity","complement","ratio","view_operation"]},"DerivedInfoKindEnum":{"type":"string","enum":["op","formula","detected","join"]},"DerivedSourceEnum":{"type":"string","enum":["user","detected","discovered"]},"OperationLineageSchema":{"type":"object","properties":{"opType":{"$ref":"#/components/schemas/OperationTypeEnum"},"opId":{"type":"string"},"parentColumns":{"type":"array","items":{"type":"string"},"default":[]},"parentConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["opType","opId"]},"OperationTypeEnum":{"type":"string","enum":["SQL_QUERY","FILTER","AGGREGATE","JOIN","CONCATENATE","SORT","SPLIT_COLUMN","DROP_COLUMNS","REMOVE_DUPLICATES","IMPUTE_NULLS","DROP_NULLS","REPLACE_VALUES","REPLACE_TYPE","INTERPOLATE_TIME","CLIP_OUTLIERS","NORMALIZE_NUMERIC","MAP_CATEGORIES","TIME_SERIES_AGGREGATE","TIME_SERIES_JOIN","TRANSPOSE","FREQUENCY_ANALYSIS","CYCLIC_AGGREGATE","DIFF","DATE_DIFF","CUMULATIVE","ARRAY_DECOMPOSE","ARRAY_CONSOLIDATE","ARRAY_EXPLODE","ARRAY_AGGREGATE","JSON_FLATTEN"]},"ViewSnapshotSchema":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"outputColumn":{"type":"string"}},"required":["sources","operations","outputColumn"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"SourceJoinConfigSchema":{"type":"object","properties":{"joinType":{"type":"string","enum":["left","inner"],"default":"left"},"strategy":{"type":["string","null"]}}},"ConceptKindEnum":{"type":"string","enum":["standard","derived","metric"]},"RelationshipRuleSchema":{"type":"object","properties":{"ruleType":{"$ref":"#/components/schemas/RelationshipRuleTypeEnum"},"sourceVariable":{"type":"string"},"condition":{"anyOf":[{"$ref":"#/components/schemas/ConditionSchema"},{"type":"null"}]},"allowedValues":{"anyOf":[{"type":"array","items":{"type":["string","number","boolean"]}},{"type":"null"}]},"minValue":{"type":["number","null"]},"maxValue":{"type":["number","null"]},"confidence":{"type":"number","default":1},"support":{"type":"number","default":0},"strength":{"anyOf":[{"$ref":"#/components/schemas/RuleStrengthEnum"},{"type":"null"}]},"violationRate":{"type":["number","null"]},"source":{"type":["string","null"]},"cycle":{"type":["string","null"]}},"required":["ruleType","sourceVariable"]},"RelationshipRuleTypeEnum":{"type":"string","enum":["conditional_values","range","set","cyclic_active_window","cyclic_missing"]},"ConditionSchema":{"type":"object","properties":{"variable":{"type":"string"},"operator":{"type":"string","enum":["eq","ne","gt","lt","ge","le","in","not_in"]},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"boolean"},{"type":"array","items":{"type":["number","string","boolean"]}}]}},"required":["variable","operator","value"]},"RuleStrengthEnum":{"type":"string","enum":["hard","soft"]},"SuggestedRoleEnum":{"type":"string","enum":["source","target"]},"ConceptValueMappingSchema":{"type":"object","properties":{"canonicalValue":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"},"default":[]}},"required":["canonicalValue"]},"DetectedConceptStructureSchema":{"type":"object","properties":{"temporalPrerequisites":{"type":"array","items":{"type":"string"},"default":[]},"suggestedRole":{"anyOf":[{"$ref":"#/components/schemas/SuggestedRoleEnum"},{"type":"null"}]}}}}}}
```

## The Report object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"Report":{"type":"object","properties":{"id":{"type":["string","null"]},"workspaceId":{"type":"string"},"organisationId":{"type":"string"},"title":{"type":"string"},"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}},"evidenceIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"status":{"$ref":"#/components/schemas/ReportStatusSchema"},"rev":{"type":"integer"},"error":{"type":["string","null"]},"prompt":{"type":["string","null"]},"publish":{"anyOf":[{"$ref":"#/components/schemas/reportPublishSchema"},{"type":"null"}]}},"required":["workspaceId","organisationId","title","markdown","widgets","evidenceIds","createdAt","updatedAt"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"ReportStatusSchema":{"type":"string","enum":["draft","ready","error"]},"reportPublishSchema":{"type":"object","properties":{"slug":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"consumerAccess":{"anyOf":[{"type":"string","enum":["private","workspace","organisation","public"]},{"type":"null"}]},"resolvedInputs":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"versionId":{"type":["string","null"]},"deltaVersion":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["datasetId"]}},{"type":"null"}]},"widgetSnapshot":{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"null"}]},"snapshotAt":{"type":["string","null"]},"snapshotStats":{"anyOf":[{"type":"object","properties":{"requested":{"type":"number"},"resolved":{"type":"number"},"omitted":{"type":"number"},"timedOut":{"type":"boolean"},"bytes":{"type":"number"}},"required":["requested","resolved","omitted","timedOut","bytes"]},{"type":"null"}]}}}}}}
```

## The Source object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"Source":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":["string","null"]},"organisationId":{"type":"string"},"name":{"type":"string"},"parentSourceId":{"type":["string","null"]},"dataSource":{"anyOf":[{"$ref":"#/components/schemas/DataSourceTypeEnum"},{"type":"null"}]},"dataFormat":{"$ref":"#/components/schemas/datasetFormatsEnum"},"description":{"type":["string","null"]},"maintainedBy":{"type":"array","items":{"type":"object","properties":{"applicationId":{"type":"string"},"version":{"type":"string"},"flowId":{"type":"string"}},"required":["applicationId","version","flowId"]}},"richDescription":{"anyOf":[{"$ref":"#/components/schemas/RichDescriptionSchema"},{"type":"null"}]},"schemaEntries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaEntryModelSchema"}},{"type":"null"}]},"importWarnings":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ontologyMode":{"$ref":"#/components/schemas/OntologyModeEnum","default":"auto"},"documentCount":{"type":["number","null"]},"columnMetadata":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ColumnMetadataSchema"}},{"type":"null"}]},"extension":{"type":["string","null"]},"totalSize":{"type":["number","null"]},"createdAt":{"type":["string","null"]},"lastSaved":{"type":["string","null"]},"virtual":{"type":["boolean","null"]},"ontologyStatus":{"anyOf":[{"$ref":"#/components/schemas/OntologyStatusEnum"},{"type":"null"}]},"ontologyError":{"type":["string","null"]},"extractionStatus":{"anyOf":[{"$ref":"#/components/schemas/ExtractionStatusEnum"},{"type":"null"}]},"extractionError":{"type":["string","null"]},"pageCount":{"type":["number","null"]},"derivedFromDatasetIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"derivedVia":{"anyOf":[{"$ref":"#/components/schemas/DerivedViaEnum"},{"type":"null"}]},"extractionRecipe":{"anyOf":[{"$ref":"#/components/schemas/ExtractionRecipeSchema"},{"type":"null"}]},"pendingAnnotationCount":{"type":["number","null"]},"ontologyExcludedFields":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string","enum":["auto","user","suggestion"]}},"required":["field","reason","source"]}},{"type":"null"}]},"batchRanges":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"fileName":{"type":"string"},"uploadedAt":{"type":"string"},"rowStart":{"type":"number"},"rowEnd":{"type":"number"}},"required":["hash","fileName","uploadedAt","rowStart","rowEnd"]}},{"type":"null"}]},"currentVersionId":{"type":["string","null"]},"latestVersionOrdinal":{"type":["number","null"]},"staging":{"type":["boolean","null"]},"readMode":{"type":"string","enum":["direct_query","snapshot"],"description":"How this source is read. direct_query runs every read against the origin database — live, but subject to its statement timeout, and no row count is recorded; snapshot reads a stored copy, which changes only when it is synced"},"directQuery":{"anyOf":[{"$ref":"#/components/schemas/directQuerySettingsSchema"},{"type":"null"}],"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}},"required":["id","organisationId","name","dataFormat","readMode","directQuery"]},"DataSourceTypeEnum":{"type":"string","enum":["Local Upload","API Upload","Web Research","Document Extraction","Workbook Extraction","PostgreSQL","MySQL","ClickHouse","MongoDB","REST API","Snowflake","S3","Azure Data Lake","Google Cloud Storage","Google Drive","Redshift","BigQuery","Databricks","Azure Synapse","Salesforce","Hubspot","NetSuite","Kafka"]},"datasetFormatsEnum":{"type":"string","enum":["Folder","Tabular","Text","Workbook","PDF","DOCX","PPTX","Image","Audio","Video"]},"RichDescriptionSchema":{"type":"object","properties":{"markdown":{"type":"string"},"widgets":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"chart"},"explorerConfig":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"dataView":{"anyOf":[{"$ref":"#/components/schemas/DataViewSchema"},{"type":"null"}]},"operations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},{"type":"null"}]},"additionalSources":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},{"type":"null"}]},"inlineData":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]}},"required":["name","type"]},"minItems":1},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"type":["string","number","boolean","null"]}},"default":[]},"downsampled":{"type":"boolean"},"totalRows":{"type":["number","null"]}},"required":["columns"]},{"type":"null"}]},"series":{"anyOf":[{"type":"object","properties":{"labels":{"type":"array","items":{"type":["string","number"]},"default":[]},"datasets":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"meta":{"anyOf":[{"type":"object","properties":{"version":{"type":"number","default":1},"xField":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]},"default":[]},"series":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"yField":{"type":["string","null"]},"aggregation":{"type":["string","null"]}},"required":["label"]},"default":[]},"categoriesTotal":{"type":["number","null"]},"categoriesShown":{"type":["number","null"]},"otherFolded":{"type":["boolean","null"]},"sortBy":{"type":["string","null"]},"sortType":{"type":["string","null"]},"binCount":{"type":["number","null"]},"linksTotal":{"type":["number","null"]},"linksShown":{"type":["number","null"]},"pointsTotal":{"type":["number","null"]},"pointsShown":{"type":["number","null"]},"rowsScanned":{"type":["number","null"]},"rowsWithoutCategory":{"type":["number","null"]},"rowsExcluded":{"type":["number","null"]},"rowsExcludedBy":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"column":{"type":["string","null"]},"rows":{"type":"number"}},"required":["reason","rows"]}},{"type":"null"}]},"downsampled":{"type":["boolean","null"]},"summary":{"type":"string","default":""}},"additionalProperties":true},{"type":"null"}]}}},{"type":"null"}]},"xSelection":{"type":"string"},"traces":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"bar"},"options":{"anyOf":[{"type":"object","properties":{"stacked":{"type":"boolean","default":false},"aggregation":{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"line"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"showPoints":{"type":"boolean","default":true}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"scatter"},"options":{"anyOf":[{"type":"object","properties":{"showLine":{"type":"boolean","default":false},"pointRadius":{"type":"number","minimum":1,"maximum":20,"default":3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"area"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"anyOf":[{"type":"string","enum":["average","sum","count","min","max"],"default":"sum"},{"type":"null"}]},"tension":{"type":"number","minimum":0,"maximum":1,"default":0.4},"fillOpacity":{"type":"number","minimum":0,"maximum":1,"default":0.3}}},{"type":"null"}]}},"required":["id","name","ySelection","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"histogram"},"options":{"anyOf":[{"type":"object","properties":{"bins":{"type":"number","minimum":5,"maximum":100,"default":20}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"pie"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"default":[]},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"doughnut"},"options":{"anyOf":[{"type":"object","properties":{"aggregation":{"default":"sum","type":"string","enum":["average","sum","count","min","max"]}}},{"type":"null"}]}},"required":["id","name","chartType"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ySelection":{"type":"array","items":{"type":"string"},"minItems":1},"yAxisPosition":{"type":"string","enum":["left","right"],"default":"left"},"color":{"type":["string","null"]},"visible":{"type":"boolean","default":true},"chartType":{"type":"string","const":"sankey"}},"required":["id","name","ySelection","chartType"]}],"discriminator":{"propertyName":"chartType"}}},"config":{"type":"object","properties":{"responsive":{"type":"boolean","default":true},"chartTitle":{"type":["string","null"]},"dataPoints":{"type":"number","default":-1},"dataDisplayOrder":{"type":"string","enum":["fromStart","fromEnd"],"default":"fromStart"},"sortBy":{"anyOf":[{"type":"string","enum":["none","x","y"]},{"type":"null"}]},"sortType":{"anyOf":[{"type":"string","enum":["ascending","descending","natural"]},{"type":"null"}]},"advancedSettings":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}}}},"required":["id","xSelection","traces","config"]},{"type":"null"}]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"table"},"title":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","additionalProperties":{}}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"totalRows":{"type":"number"},"csvExport":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"sql_evidence"},"rowCount":{"type":"integer","minimum":0},"queryTruncated":{"type":"boolean"},"queryTotalRowCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["source","rowCount","queryTruncated"]},{"type":"null"}]},"livePaging":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"anchor_sql"},"sql":{"type":"string"},"projectionMode":{"type":"string","enum":["related","minimal"],"default":"related"}},"required":["source","sql"]},{"type":"null"}]}},"required":["id","evidenceId","type","columns","rows","totalRows"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_preview"},"datasetId":{"type":"string"}},"required":["id","evidenceId","type","datasetId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_preview"},"dataViewId":{"type":"string"}},"required":["id","evidenceId","type","dataViewId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"kpi_card"},"title":{"type":"string"},"value":{"type":["string","number"]},"dataBinding":{"anyOf":[{"oneOf":[{"type":"object","properties":{"sourceType":{"type":"string","const":"dataset"},"datasetId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","datasetId","valueField"]},{"type":"object","properties":{"sourceType":{"type":"string","const":"dataview"},"dataViewId":{"type":"string","minLength":1},"valueField":{"type":"string","minLength":1}},"required":["sourceType","dataViewId","valueField"]}],"discriminator":{"propertyName":"sourceType"}},{"type":"null"}]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["id","evidenceId","type","title","value"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_graph"},"digitalTwinVersionId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dataset_search_results"},"searchQuery":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","datasetIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"data_view_search_results"},"searchQuery":{"type":"string"},"dataViewIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","dataViewIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_result"},"digitalTwinRunId":{"type":"string"}},"required":["id","evidenceId","type","digitalTwinRunId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_search_results"},"digitalTwinVersionIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","digitalTwinVersionIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"digital_twin_run_search_results"},"searchQuery":{"type":"string"},"runIds":{"type":"array","items":{"type":"string"}}},"required":["id","evidenceId","type","searchQuery","runIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_graph"},"searchQuery":{"type":"string"},"conceptIds":{"type":"array","items":{"type":"string"}},"anchorType":{"type":"string","enum":["dataset","identifier","conceptType"],"default":"dataset"},"showFullGraph":{"type":"boolean","default":false}},"required":["id","evidenceId","type","searchQuery","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"path_analysis_sankey"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]},"depthLimit":{"type":"number","default":2}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"parameter_distribution"},"digitalTwinVersionId":{"type":"string"},"selectedNode":{"type":["string","null"]},"selectedEdge":{"anyOf":[{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},{"type":"null"}]}},"required":["id","evidenceId","type","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_diff"},"version1Id":{"type":"string"},"version2Id":{"type":"string"}},"required":["id","evidenceId","type","version1Id","version2Id"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dose_response"},"causeVariable":{"type":"string"},"sweptMode":{"anyOf":[{"type":"string","enum":["absolute","percentage"]},{"type":"null"}]},"metric":{"type":"string"},"points":{"type":"array","items":{"type":"object","properties":{"causeValue":{"type":"number"},"effect":{"type":"number"},"ciLower":{"type":["number","null"]},"ciUpper":{"type":["number","null"]}},"required":["causeValue","effect"]}},"referenceValue":{"type":["number","null"]},"isLinear":{"type":["boolean","null"]},"inflectionPoints":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"digitalTwinRunId":{"type":["string","null"]}},"required":["id","evidenceId","type","causeVariable","metric","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"page_context"},"section":{"anyOf":[{"type":"string","enum":["Organisation Home","Workspace Home","Dataset Selection","Dataset Page","Data View Selection","Data View Page","Digital Twin Selection","Digital Twin Page","Report Selection","Report Page","Settings"]},{"type":"null"}]},"summary":{"type":"string"},"entityName":{"type":["string","null"]},"entityType":{"anyOf":[{"type":"string","enum":["dataset","data_view","digital_twin","report"]},{"type":"null"}]},"itemCount":{"type":["number","null"]}},"required":["id","evidenceId","type","summary"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"dag_review"},"digitalTwinVersionId":{"type":"string"},"digitalTwinName":{"type":"string"},"nodeCount":{"type":"number"},"edgeCount":{"type":"number"},"overallHealth":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"suggestedFix":{"type":["string","null"]},"affectedNodes":{"type":"array","items":{"type":"string"},"default":[]},"affectedEdges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"}},"required":["source","target"]},"default":[]}},"required":["type","description","severity"]},"default":[]},"recommendations":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type","digitalTwinVersionId","digitalTwinName","nodeCount","edgeCount","overallHealth"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"causal_context"},"outcomeVariable":{"type":"string"},"relatedConcepts":{"type":"array","items":{"type":"object","properties":{"concept":{"type":"string"},"source":{"type":["string","null"]},"sourceName":{"type":["string","null"]},"role":{"type":["string","null"]},"isIdentifier":{"type":"boolean","default":false}},"required":["concept"]},"default":[]},"datasetSourceCount":{"type":"number","default":0},"recommendation":{"type":["string","null"]},"existingDataViewId":{"type":["string","null"]},"existingDataViewName":{"type":["string","null"]},"existingDigitalTwinId":{"type":["string","null"]},"existingDigitalTwinName":{"type":["string","null"]}},"required":["id","evidenceId","type","outcomeVariable"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"graph_query_result"},"queryType":{"type":"string"},"digitalTwinVersionId":{"type":"string"},"queriedNode":{"type":["string","null"]},"results":{"type":"array","items":{"type":"object","properties":{"node":{"type":"string"},"edgeLabel":{"type":["string","null"]},"strength":{"type":["number","null"]},"depth":{"type":["number","null"]},"type":{"type":["string","null"]}},"required":["node"]},"default":[]},"path":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","queryType","digitalTwinVersionId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_data"},"columns":{"type":"array","items":{"type":"string"},"default":[]},"rowCount":{"type":"number","default":0},"sampleRows":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"dataViewId":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"ontology_mutation_preview"},"operations":{"type":"array","items":{"type":"object","additionalProperties":{}},"default":[]},"successCount":{"type":"number","default":0},"failureCount":{"type":"number","default":0},"affectedConceptIds":{"type":"array","items":{"type":"string"},"default":[]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"docs_sources"},"documentReferences":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"path":{"type":"string"},"pageId":{"type":["string","null"]}},"required":["title","path"]}}},"required":["id","evidenceId","type","documentReferences"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"background_runs"},"runs":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string"},"entityId":{"type":["string","null"]},"status":{"type":"string"},"percentage":{"type":["number","null"]},"label":{"type":["string","null"]},"error":{"type":["string","null"]},"startedAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["runId","name","domain","status"]}}},"required":["id","evidenceId","type","runs"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_segments"},"title":{"type":"string"},"silhouetteScore":{"type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"segment":{"type":"number"},"label":{"type":"string"},"description":{"type":["string","null"]},"environments":{"type":"array","items":{"type":"string"}}},"required":["segment","label","environments"]}},"points":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"segment":{"type":"number"}},"required":["envKey","x","y","segment"]}}},"required":["id","evidenceId","type","title","segments","points"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_comparison"},"title":{"type":"string"},"sliceLabel":{"type":"string"},"baselineLabel":{"type":"string"},"sliceEnvCount":{"type":"number"},"baselineEnvCount":{"type":"number"},"edges":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"target":{"type":"string"},"sliceAgreement":{"type":"number"},"baselineAgreement":{"type":"number"},"sliceStrength":{"type":["number","null"]},"baselineStrength":{"type":["number","null"]},"verdict":{"type":"string","enum":["slice-only","missing-from-slice","differs","consistent"]}},"required":["source","target","sliceAgreement","baselineAgreement","verdict"]}}},"required":["id","evidenceId","type","title","sliceLabel","baselineLabel","sliceEnvCount","baselineEnvCount","edges"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"environment_coverage"},"title":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"envKey":{"type":"string"},"trainingRows":{"type":["number","null"]},"variablesTrained":{"type":["number","null"]},"variablesTotal":{"type":["number","null"]},"missing":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":["string","null"]}},"required":["name"]}},"evaluation":{"type":["string","null"]}},"required":["envKey","missing"]}}},"required":["id","evidenceId","type","title","environments"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"clarification"},"toolCallId":{"type":"string"},"mode":{"type":"string","enum":["multiple_choice","form"]},"question":{"type":"string"},"why":{"type":["string","null"]},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"preview":{"type":["string","null"]}},"required":["label","value"]},"default":[]},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"type":{"type":"string","enum":["number","string","select","multiselect","boolean","source","dataset","digitalTwin","ontologyConcept"],"default":"string"},"default":{"anyOf":[{},{"type":"null"}]},"options":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"value":{"type":"string"},"label":{"type":["string","null"]}},"required":["value"]}]}},{"type":"null"}]},"min":{"type":["number","null"]},"max":{"type":["number","null"]},"step":{"type":["number","null"]},"pattern":{"type":["string","null"]},"control":{"type":["string","null"]},"placeholder":{"type":["string","null"]},"help":{"type":["string","null"]},"required":{"type":["boolean","null"]},"secret":{"type":["boolean","null"]},"urlParam":{"type":["string","null"]}},"required":["id"]},"default":[]},"selectedValues":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"selectedFieldValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","mode","question"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"action_confirmation"},"toolCallId":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"severity":{"type":"string","enum":["mutates_truth","long_running","irreversible"]},"actionLabel":{"type":"string"},"estimatedDuration":{"type":["string","null"]},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["label"]}},{"type":"null"}]},"details":{"type":["string","null"]},"editableKind":{"anyOf":[{"type":"string","enum":["extraction_schema"]},{"type":"null"}]},"editableInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"toolName":{"type":["string","null"]},"toolInputs":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]}},"required":["id","evidenceId","type","toolCallId","title","summary","severity","actionLabel"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"navigation"},"commandId":{"type":"string"},"label":{"type":"string"},"subtitle":{"type":["string","null"]},"kind":{"type":"string","enum":["navigate","create","action"],"default":"navigate"},"entity":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["dataset","dataview","concept","digitalTwin","report","digitalTwinRun"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},{"type":"null"}]}},"required":["id","evidenceId","type","commandId","label"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"foundational_ontology_install"},"ontologyId":{"type":"string"},"version":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"trustTier":{"type":"string"},"anchorsSummary":{"type":["string","null"]},"conceptCount":{"type":"number"},"sourceCount":{"type":"number"},"suggestedScopeNote":{"type":["string","null"]}},"required":["id","evidenceId","type","ontologyId","version","name","trustTier","conceptCount","sourceCount"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"stat_grid"},"title":{"type":["string","null"]},"stats":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":["string","number"]},"unit":{"type":["string","null"]},"unitId":{"type":["string","null"]},"decimals":{"type":["number","null"]},"change":{"type":["number","null"]},"changePeriod":{"type":["string","null"]},"trend":{"anyOf":[{"type":"string","enum":["up","down","neutral"]},{"type":"null"}]}},"required":["title","value"]}},"gridCols":{"anyOf":[{"type":"number","enum":[2,3,4]},{"type":"null"}]}},"required":["id","evidenceId","type","stats"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"markdown"},"content":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"heading"},"text":{"type":["string","null"]},"eyebrow":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"divider"},"style":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"image"},"src":{"type":["string","null"]},"alt":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"iframe"},"url":{"type":["string","null"]}},"required":["id","evidenceId","type"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"application"},"applicationId":{"type":"string"},"runId":{"type":["string","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]},"moduleCount":{"type":["number","null"]},"publicUrl":{"type":["string","null"]}},"required":["id","evidenceId","type","applicationId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"report"},"reportId":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":["string","null"]},"rev":{"type":["number","null"]}},"required":["id","evidenceId","type","reportId"]},{"type":"object","properties":{"id":{"type":"string"},"evidenceId":{"type":"string"},"type":{"type":"string","const":"lineage"},"lineageId":{"type":"string"},"tool":{"type":"string","default":""},"hops":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"status":{"type":"string","enum":["resolved","denied","deleted"]},"parents":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"label":{"type":"string","default":""}},"required":["kind","id"]},"default":[]},"pin":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"versionId":{"type":["string","null"]},"ordinal":{"type":["number","null"]},"deltaVersion":{"type":["number","null"]},"label":{"type":["string","null"]}},"required":["kind","id"]},{"type":"null"}]},"detail":{"type":"object","additionalProperties":{},"default":{}}},"required":["ref","status"]},"default":[]},"reading":{"anyOf":[{"type":"object","properties":{"value":{"type":["number","null"]},"valueType":{"type":["string","null"]},"unit":{"type":["string","null"]},"display":{"type":["string","null"]}}},{"type":"null"}]},"request":{"anyOf":[{"type":"object","properties":{"sql":{"type":["string","null"]},"query":{"type":["string","null"]}}},{"type":"null"}]}},"required":["id","evidenceId","type","lineageId"]}],"discriminator":{"propertyName":"type"}}}},"required":["markdown","widgets"]},"DataViewSchema":{"type":"object","properties":{"_id":{"type":"string"},"organisationId":{"type":"string"},"workspaceId":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"anchorConceptId":{"type":["string","null"]},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/DataViewCreatedByEnum"},{"type":"null"}]},"sourceQuery":{"anyOf":[{"$ref":"#/components/schemas/DataViewSourceQuerySchema"},{"type":"null"}]},"sourceQueryDetached":{"type":["boolean","null"]},"chartWidgets":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"layout":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"}},"required":["x","y","w","h"]},"widget":{"type":"object","additionalProperties":{}}},"required":["id","layout","widget"]}},{"type":"null"}]},"conceptOverrides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ViewConceptOverrideEntrySchema"}},{"type":"null"}]},"status":{"anyOf":[{"type":"string","enum":["ok","broken"]},{"type":"null"}]},"brokenReasons":{"anyOf":[{"type":"array","items":{"type":"string","enum":["source_removed","ontology_reset"]}},{"type":"null"}]},"brokenDependencies":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BrokenDataViewDependencySchema"}},{"type":"null"}]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["_id","organisationId","workspaceId","ownerId","name","sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"DataViewCreatedByEnum":{"type":"string","enum":["manual","ontology_query","ai","recommended"]},"DataViewSourceQuerySchema":{"type":"object","properties":{"queryRequest":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"reconciliationColumnSides":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReconciliationColumnSideEnum"}},{"type":"null"}]},"reconciliationColumnGroups":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationColumnGroupSchema"}},{"type":"null"}]},"reconciliationSecondaries":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ReconciliationSecondaryMetaSchema"}},{"type":"null"}]},"reconciliationAlignKeyLabels":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"additionalProperties":true},"ReconciliationColumnSideEnum":{"type":"string","enum":["primary","secondary","system","context"]},"ReconciliationColumnGroupSchema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"fieldIds":{"type":"array","items":{"type":"string"}}},"required":["key","label","fieldIds"]},"ReconciliationSecondaryMetaSchema":{"type":"object","properties":{"secondaryKey":{"type":"string"},"secondaryName":{"type":"string"},"presenceCol":{"type":["string","null"]},"mismatchCol":{"type":["string","null"]},"statusCol":{"type":["string","null"]}},"required":["secondaryKey","secondaryName"]},"ViewConceptOverrideEntrySchema":{"type":"object","properties":{"override":{"type":"object","additionalProperties":{}},"displayName":{"type":["string","null"]},"description":{"type":["string","null"]},"lineageHash":{"type":["string","null"]},"lastEditedBy":{"type":["string","null"]},"lastEditedAt":{"type":["string","null"]}},"required":["override"]},"BrokenDataViewDependencySchema":{"type":"object","properties":{"type":{"type":"string","enum":["DATASET","DATA_VIEW"]},"id":{"type":"string"},"name":{"type":"string"}},"required":["type","id","name"]},"SchemaEntryModelSchema":{"type":"object","properties":{"field":{"type":"string"},"type":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"subtype":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"availableTypes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/SchemaMainTypeEnum"}},{"type":"null"}]},"isIndex":{"type":["boolean","null"]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"aliases":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":{"type":["string","null"]},"displayWidth":{"type":["number","null"]},"originalFormat":{"type":["string","null"]},"displayFormat":{"type":["string","null"]},"unit":{"type":["string","null"]},"unitModifier":{"type":["number","null"]},"dateOrderAssumed":{"type":["boolean","null"]}},"required":["field","type"]},"OntologyModeEnum":{"type":"string","enum":["auto","manual"]},"ColumnMetadataSchema":{"type":"object","properties":{"dtype":{"type":["string","null"]},"categoryOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"distribution":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"rangeFrom":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"rangeTo":{"anyOf":[{"type":["string","number"]},{"type":"null"}]},"mean":{"type":["number","null"]},"stringPattern":{"type":["string","null"]},"jsonObjectFraction":{"type":["number","null"]},"cardinality":{"type":["number","null"]},"nullFraction":{"type":["number","null"]},"unparsedFormat":{"type":["string","null"]},"processing":{"type":["boolean","null"]},"metadataStatus":{"anyOf":[{"$ref":"#/components/schemas/MetadataStatusEnum"},{"type":"null"}]},"elementType":{"anyOf":[{"$ref":"#/components/schemas/SchemaMainTypeEnum"},{"type":"null"}]},"minSize":{"type":["number","null"]},"maxSize":{"type":["number","null"]},"avgSize":{"type":["number","null"]},"medianSize":{"type":["number","null"]},"p95Size":{"type":["number","null"]},"nullCount":{"type":["number","null"]},"emptyCount":{"type":["number","null"]},"totalElementCount":{"type":["number","null"]},"sizeDistribution":{"anyOf":[{"$ref":"#/components/schemas/ArraySizeDistributionSchema"},{"type":"null"}]},"uniqueElementCount":{"type":["number","null"]},"avgUniquePerRow":{"type":["number","null"]},"elementOccurences":{"anyOf":[{"type":"object","additionalProperties":{"type":"number"}},{"type":"null"}]},"elementMin":{"type":["number","null"]},"elementMax":{"type":["number","null"]},"elementMean":{"type":["number","null"]},"elementSum":{"type":["number","null"]},"elementStddev":{"type":["number","null"]}}},"MetadataStatusEnum":{"type":"string","enum":["complete","partial_skipped_expensive","in_progress"]},"ArraySizeDistributionSchema":{"type":"object","properties":{"empty":{"type":"number","default":0},"oneToThree":{"type":"number","default":0},"fourToTen":{"type":"number","default":0},"elevenToFifty":{"type":"number","default":0},"fiftyPlus":{"type":"number","default":0}}},"OntologyStatusEnum":{"type":"string","enum":["pending","extracting","consolidation_queued","consolidating","detecting_derived","analyzing_dependencies","profiling_time_series","completed","extraction_failed","consolidation_failed","derived_detection_failed","relationship_detection_failed","cross_relationship_detection_failed","dependency_analysis_failed","time_series_profiling_failed","cancelled","manual_pending"]},"ExtractionStatusEnum":{"type":"string","enum":["pending","extracting","completed","failed"]},"DerivedViaEnum":{"type":"string","enum":["document_tables","document_homogenisation","document_entities","workbook_sql"]},"ExtractionRecipeSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["schema","entities"]},"sourceDocumentIds":{"type":"array","items":{"type":"string"}},"columns":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"entityTypes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"dtype":{"anyOf":[{"type":"string","enum":["number","category","boolean","text"]},{"type":"null"}]},"categories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"trueSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"falseSynonyms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unit":{"type":["string","null"]},"conceptId":{"type":["string","null"]}},"required":["name"],"additionalProperties":true},"default":[]}},"required":["name"],"additionalProperties":true}},{"type":"null"}]},"targetName":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"lastAppendedAt":{"type":["string","null"]}},"required":["mode","sourceDocumentIds"],"additionalProperties":true},"directQuerySettingsSchema":{"type":"object","properties":{"orderingColumn":{"type":["string","null"],"description":"Column the source's rows are paged by"},"appendOnly":{"type":["boolean","null"],"description":"Declared: the rows are only ever added, never updated or deleted"},"statementTimeoutSeconds":{"type":["number","null"],"description":"Cap on how long one remote statement may run"},"maxRowsScanned":{"type":["number","null"],"description":"Cap on how many rows one remote statement may scan"}},"description":"How a direct_query source is read. Null on a snapshot source, where none of it applies. The relation itself is not reported: on a storage source it is resolved against the bucket inside the connector's encrypted credentials, which the connector routes strip"}}}}
```

## The Workspace object

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"components":{"schemas":{"Workspace":{"type":"object","properties":{"id":{"type":"string"},"organisationId":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string"},"isOrgLibrary":{"type":"boolean"}},"required":["organisationId","name","createdAt"]}}}}
```
