HoloLang / Examples & Behavior
A complete CERFA validation example, evaluation behaviors, and the error messages rules produce.
Complete Example
A complete example validating a CERFA 2033-A balance sheet:
CERFA 2033-A Validation Rules
# ═══════════════════════════════════════════════════════════════
# CERFA 2033-A - Balance Sheet Validation Rules
# ═══════════════════════════════════════════════════════════════
# Metadata validation
REQUIRED @company_name
REQUIRED @company_siret
VALIDATE @company_siret FORMAT SIRET
VALIDATE @fiscal_year_end_n FORMAT DATE
# Balance calculations (pure assignments)
@f110_brut = @f010_brut + @f014_brut + @f028_brut
@f180 = @f142 + @f176
# Balance check - fundamental accounting equation
ASSERT @f110_net_n == @f180 WITHIN 0.01
# Conditional presence rules
IF @company_type == 'SARL' THEN REQUIRED @f120
IF @f040_brut > 0 THEN REQUIRED @f042
IF @f136 > 0 THEN REQUIRED @f134
# Conditional assertions
IF @has_debt == 'yes' THEN ASSERT @f156 > 0
# Warnings (non-blocking)
WARN IF @f136 < 0
WARN IF @f142 < 0
WARN IF NOT ASSERT @f136 == @f134 WITHIN 100Key Behaviors
- Case insensitive keywords:
IF,if,Ifall work - Nested field access: Use dot notation for objects, e.g.,
@salary.amount,@employee.address.city - Tolerance: Default tolerance is 10.0 for floating-point comparisons, customizable per engine
- Null handling: Missing/null fields are treated as 0 (numbers) or "" (strings)
- Warnings don't fail:
all_passedis True even with warnings - Conditional skip: If condition is false, rule passes automatically
- Comments: Use
#for comments in rule files
Error Messages
When validation fails, HoloLang returns descriptive messages:
| Rule Type | Example Message |
|---|---|
| Formula | "Difference of 150.00 (expected: 1000.00, actual: 850.00)" |
| Presence | "Field @company_name is required" |
| Format | "Field @company_siret does not match format SIRET" |
| Assertion (==) | "Assertion failed: difference of 100.00 exceeds tolerance 10" |
| Assertion (>) | "Assertion failed: -50 > 0" |
| Warning | "Warning condition triggered" |