fix(adapters/ui): dispatch loop discards all but last provider error #43

Closed
opened 2026-05-25 13:42:22 +02:00 by michael · 4 comments
Owner

Problem

M.dispatch in adapters/ui/init.lua only keeps the last error:

for _, mod in ipairs(providers) do
  local ok, merr = mod.dispatch(args, roots, ctx)
  if not ok then any_error = merr end
end

If multiple providers fail, earlier errors are silently lost.

Fix

Collect all errors and return them combined, or fail fast on the first error.
Decision needed: fail-fast vs collect-all.

Acceptance criteria

  • No provider error is silently discarded
  • All errors visible in output
## Problem `M.dispatch` in `adapters/ui/init.lua` only keeps the last error: ```lua for _, mod in ipairs(providers) do local ok, merr = mod.dispatch(args, roots, ctx) if not ok then any_error = merr end end ``` If multiple providers fail, earlier errors are silently lost. ## Fix Collect all errors and return them combined, or fail fast on the first error. Decision needed: fail-fast vs collect-all. ## Acceptance criteria - [ ] No provider error is silently discarded - [ ] All errors visible in output
Author
Owner

Scope expanded to core/loader.lua:

  • load_pack(): first broken rule file aborts entire pack load -- remaining rules never checked
  • load_packs_for_type(): first broken pack aborts -- remaining packs for the type never loaded

Both should collect all errors and continue, so all problems are visible at once.
A broken rule/pack should produce [ERROR] output but not stop other rules from running.

Scope expanded to core/loader.lua: - load_pack(): first broken rule file aborts entire pack load -- remaining rules never checked - load_packs_for_type(): first broken pack aborts -- remaining packs for the type never loaded Both should collect all errors and continue, so all problems are visible at once. A broken rule/pack should produce [ERROR] output but not stop other rules from running.
Author
Owner

Scope expanded to core/runner.lua:

The entire run-loop fails fast on the first error (primitive not found,
adapter.run failure, file read error, suppressor error, collect_files error).
All remaining rules and files are skipped silently.

Runner should collect errors and continue so all problems are visible.

Scope expanded to core/runner.lua: The entire run-loop fails fast on the first error (primitive not found, adapter.run failure, file read error, suppressor error, collect_files error). All remaining rules and files are skipped silently. Runner should collect errors and continue so all problems are visible.
Author
Owner

Scope expanded to core/validator/init.lua:

M.pack(): first failing rule schema check aborts -- remaining rules never validated.
M.primitives(): first missing primitive aborts -- remaining primitives never checked.

Both should collect all errors so all problems are visible at once.

Scope expanded to core/validator/init.lua: M.pack(): first failing rule schema check aborts -- remaining rules never validated. M.primitives(): first missing primitive aborts -- remaining primitives never checked. Both should collect all errors so all problems are visible at once.
Author
Owner

Scope expanded to core/modules.lua:

scan(): first module load or validation failure aborts -- remaining modules never checked.
validate_interfaces(): first failing interface check aborts -- remaining interfaces never checked.

Scope expanded to core/modules.lua: scan(): first module load or validation failure aborts -- remaining modules never checked. validate_interfaces(): first failing interface check aborts -- remaining interfaces never checked.
michael added this to the Basic Version milestone 2026-05-30 16:05:00 +02:00
Sign in to join this conversation.
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
DAW/fragjan#43
No description provided.