ux: human-readable diagnostics (issue #32) #38

Merged
yorunikakeru merged 3 commits from feature/issue-32-human-readable-diagnostics into main 2026-06-15 13:35:29 +02:00
Owner

Summary

  • Adds DSL.Diagnostics.renderValidationError :: ValidationError -> Text — human-readable message per constructor
  • Updates DSL.Compile.compileResult to use renderDomainError (IR) and renderValidationError instead of show dumps
  • Removes dead Int index field from Location — type now honestly reflects what it carries

Before:

validation error: AtSection (Location ProfileKind 0 "gaming") (IntraConflict "docker")

After:

profile "gaming": service "docker" is both enabled and disabled

IR changes (in separate IR commit 37933a6): renderDomainError added to IR.Domain.Error; all FromJSON parsers replaced fail . show with fail . T.unpack . renderDomainError.

Test Plan

  • DSL.DiagnosticsSpec — 7 unit tests, one per ValidationError constructor
  • DSL.CompileSpec — 2 new cases asserting exact human-readable message strings
  • DSL.ValidateSpec — existing tests updated to match new Location shape; all pass
  • nix flake check passes

Closes #32

## Summary - Adds `DSL.Diagnostics.renderValidationError :: ValidationError -> Text` — human-readable message per constructor - Updates `DSL.Compile.compileResult` to use `renderDomainError` (IR) and `renderValidationError` instead of `show` dumps - Removes dead `Int` index field from `Location` — type now honestly reflects what it carries **Before:** ``` validation error: AtSection (Location ProfileKind 0 "gaming") (IntraConflict "docker") ``` **After:** ``` profile "gaming": service "docker" is both enabled and disabled ``` IR changes (in separate IR commit `37933a6`): `renderDomainError` added to `IR.Domain.Error`; all `FromJSON` parsers replaced `fail . show` with `fail . T.unpack . renderDomainError`. ## Test Plan - [x] `DSL.DiagnosticsSpec` — 7 unit tests, one per `ValidationError` constructor - [x] `DSL.CompileSpec` — 2 new cases asserting exact human-readable message strings - [x] `DSL.ValidateSpec` — existing tests updated to match new `Location` shape; all pass - [x] `nix flake check` passes Closes #32
compileResult now calls renderDomainError and renderValidationError
instead of show. CompileSpec asserts exact message strings.
refactor(validate): remove dead index field from Location
All checks were successful
CI / linux (pull_request) Successful in 4m41s
d1e4251fc2
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FrogOS/DSL!38
No description provided.