Validation Rules
DSP enforces 40+ validation rules across four categories: scene identity, scene references, operation validation, and content limits.
Scene identity rules (S-001)
| Code | Rule | Severity |
|---|
| S-001 | Duplicate element IDs | error |
Scene reference rules (S-010 — S-013)
| Code | Rule | Severity |
|---|
| S-010 | Group/frame references nonexistent child | error |
| S-011 | Edge references nonexistent endpoint | error |
| S-012 | Edge endpoint is not a node | error |
| S-013 | Edge references nonexistent port | error |
Containment rules (S-020 — S-023)
| Code | Rule | Severity |
|---|
| S-020 | Element contains itself | error |
| S-021 | Containment cycle detected | error |
| S-022 | Element belongs to multiple groups | error |
| S-023 | Invalid child kind (edges can’t be group children) | error |
| S-033 | Inside target is not a container | error |
Layout rules (S-030 — S-034)
| Code | Rule | Severity |
|---|
| S-030 | Relative layout references nonexistent target | error |
| S-031 | Relative layout references itself | error |
| S-032 | Relative layout cycle detected | error |
| S-034 | Element missing required dimensions | warning |
Port and asset rules (S-040 — S-062)
| Code | Rule | Severity |
|---|
| S-040 | Duplicate port IDs on a node | error |
| S-041 | Port on non-node element | error |
| S-043 | Edge is a self-loop | warning |
| S-050 | Element references nonexistent asset | error |
| S-051 | Asset kind mismatch | error |
| S-060 | Element references nonexistent style | error |
| S-062 | Remote URI not allowed by policy | warning |
Operation target rules (O-010 — O-011)
| Code | Rule | Severity |
|---|
| O-010 | Operation target element not found | error |
| O-011 | Create operation ID collision | error |
Operation kind rules (O-020 — O-024)
| Code | Rule | Severity |
|---|
| O-020 | updateNode targets non-node | error |
| O-021 | updateEdge targets non-edge | error |
| O-022 | setText targets element without text | error |
| O-023 | resizeElement targets non-resizable | error |
| O-024 | moveElement targets relative-layout element | warning |
Batch rules (O-040 — O-041)
| Code | Rule | Severity |
|---|
| O-040 | Batch creates then targets same ID | error |
| O-041 | Batch deletes then references same ID | error |
Post-mutation rules (P-001)
| Code | Rule | Severity |
|---|
| P-001 | Dangling reference after mutation | error |
Constraint rules (C-001 — C-004)
| Code | Rule | Severity |
|---|
| C-001 | Constraint references nonexistent element | error |
| C-003 | Constraint has fewer than 2 members | error |
| C-004 | Duplicate members in constraint | warning |
Content limits (L-001 — L-004)
| Code | Rule | Severity |
|---|
| L-001 | Scene exceeds maximum element count (1000) | error |
| L-002 | Nesting depth exceeds maximum (10) | error |
| L-003 | Text content exceeds maximum length (10000) | warning |
| L-004 | Scene exceeds maximum constraint count (500) | error |