Semantic Validation Rules & Errors
Scapius compiler executes static semantic verification passes on every .ea model to guarantee architectural integrity. Violations trigger compile-time diagnostics with clear remediation guidance.
1. Global ID Uniqueness
- Rule: Every entity ID across the entire workspace must be globally unique, regardless of file boundaries or container nesting.
- Error Example:
[Error NEA2001] Semantic Error: Duplicate view/entity ID 'payment_api' found. All identifiers in the workspace must be globally unique.
- Remediation: Rename one of the entities using a distinct
snake_casesuffix (e.g.payment_api_v2orpayment_api_legacy).
2. Single Parent composed_of Rule
- Rule: An entity can only be the destination of at most one
composed_ofrelationship. Sub-components cannot be owned by multiple parent systems. - Error Example:
[Error NEA3004] Linking Error: Target entity 'comp_auth' has multiple composed_of relationships (composed into both 'sys_core' and 'sys_payments'). An entity can only be composed into a single parent entity.
- Remediation: If multiple systems depend on the module, use
depends_onorservesinstead ofcomposed_of.
3. Value Stream Stage & Capability Rules
- Rule A (
orderuniqueness): Everystageinside avalue_streamwith anorderproperty must have a unique integer value. - Rule B (Composition Exclusion):
composed_ofcannot be declared between astageand acapability. - Correct Pattern: Capabilities link to stages using the
realizesverb:capability cap_payment "Payment Processing" {relationships {this realizes stage_checkout "Realizes checkout stage"}}
4. Lifecycle Date Format & Sequencing
- Rule A (Date Sequencing): Dates must conform strictly to
"YYYY-MM-DD". If anenddate is supplied, it must be chronologically greater than or equal to thestartdate (NEA4004). - Rule B (Linter Style Rule): Phase properties should be declared on a single line:
Splitting# Preferred single-row formatphase Run start "2020-01-01" end "2025-12-31"
phase,start, andendacross multiple lines triggers a linter style warning.
5. Type-Compatible Relationship Rules
- Rule: Verbs can only connect entity types permitted in the Master Relationship Matrix.
- Error Example:
[Error NEA3004] Linking Error: Relationship 'actor_user mitigates threat_sql' is invalid. Verb 'mitigates' is not allowed from type 'Actor' to 'Threat'.