fix(modules): builtin load failure silently ignored in scan #62

Closed
opened 2026-05-25 15:21:57 +02:00 by michael · 1 comment
Owner

Problem

core/modules.lua silently ignores builtin load failures in M.scan:

for require_path, id in pairs(BUILTINS) do
  local ok, mod = pcall(require, require_path)
  if ok then
    ...
  end
  -- load failure: silently skipped
end

A missing or broken builtin produces no warning. Installed modules get
explicit errors on load failure -- builtins should too.

Fix

Log a [WARN] when a builtin cannot be loaded:

if not ok then
  -- [WARN] builtin 'berhtjan-cli' not available: ...
end

Note

The safety-net in M.resolve (restoring builtins when all providers are
disabled) is intentional design -- not affected by this fix.

Acceptance criteria

  • Failed builtin load produces [WARN] with module id and reason
  • Behaviour otherwise unchanged
## Problem `core/modules.lua` silently ignores builtin load failures in `M.scan`: ```lua for require_path, id in pairs(BUILTINS) do local ok, mod = pcall(require, require_path) if ok then ... end -- load failure: silently skipped end ``` A missing or broken builtin produces no warning. Installed modules get explicit errors on load failure -- builtins should too. ## Fix Log a [WARN] when a builtin cannot be loaded: ```lua if not ok then -- [WARN] builtin 'berhtjan-cli' not available: ... end ``` ## Note The safety-net in `M.resolve` (restoring builtins when all providers are disabled) is intentional design -- not affected by this fix. ## Acceptance criteria - [ ] Failed builtin load produces [WARN] with module id and reason - [ ] Behaviour otherwise unchanged
michael added this to the Basic Version milestone 2026-05-30 16:08:42 +02:00
Author
Owner

Fixed in core/modules.lua.

Builtin load failures now recorded as [FAULT] with module id and reason.
Variable renamed from ok to pcall_ok for clarity (DAW/fragjan#64 pattern).

Fixed in core/modules.lua. Builtin load failures now recorded as [FAULT] with module id and reason. Variable renamed from ok to pcall_ok for clarity (DAW/fragjan#64 pattern).
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#62
No description provided.