dgi.synapse.validate ​
Self-correct: review DAG for consistency
Validate and self-correct the constructed DAG.
The fifth and final synapse. Reviews the virtual_workflow from build_dag for consistency issues and can return a corrected version.
Inputs:
- virtual_workflow: dict from dgi.synapse.build_dag (required)
- understanding: dict from dgi.synapse.understand (required)
- operations: list from dgi.synapse.decompose (required)
Outputs (terminal state_data):
- is_valid: bool — whether the DAG passed validation
- issues: list of issue dicts
- virtual_workflow: dict — corrected workflow if fixes applied, else original
- validation_summary: str — human-readable validation summary
- input_tokens: int
- output_tokens: int
Plugin required: context.get_plugin("ai")
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-dgi |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | Explicit AI CloudConnection UUID — threaded to ai.chat.complete so synapse uses the org's resolved connection (org-context-free) |
model | string | No | — | Optional model override threaded to ai.chat.complete |
virtual_workflow | json | Yes | — | Virtual workflow from build_dag |
understanding | json | Yes | — | Understanding from understand |
operations | json | Yes | — | Operations from decompose |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
input_tokens | integer | No | — | — |
is_valid | boolean | No | — | — |
issues | list | No | — | — |
output_tokens | integer | No | — | — |
validation_summary | dict | No | — | — |
virtual_workflow | json | No | — | — |
connection_uuid | uuid | No | — | — |
model | string | No | — | — |
operations | json | No | — | — |
understanding | json | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "dgi.synapse.validate",
"initial_data": {
"virtual_workflow": "value",
"understanding": "value",
"operations": "value"
}
}