Migrate all internal error origins to daw_error/v1 #50
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-common#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
daw-lua-commonstill contains internal helpers that create or propagateplain error strings. The i18n migration exposed that callers may then
reuse opaque helper text as the complete
messageof a new error,losing origin, code, structured data, identity, and causality.
Concrete example:
crypto/hash.lua.Goal
Before continuing the broad
daw_i18n/v1migration, review all Luasource files and move structured error creation to the actual point of
failure.
Scope
For every Lua error path:
daw_error/v1there;causefor a distinct higher-level error;Do not perform unrelated refactoring.
This issue blocks further repository-wide work on
DAW/daw-lua-common#48so i18n is applied only after the final set of error origins is stable.
Acceptance criteria
daw_error/v1at its origin.causewhere appropriate.fragjan code .passes.make testpasses under Lua 5.1 and Lua 5.4.DAW/daw-lua-common#48can resume against a stable set of error sites.Related
DAW/daw-lua-common#48DAW/daw-lua-common#49daw_error/v1michael referenced this issue2026-08-14 20:33:32 +02:00
Session summary (2026-08-15)
Full pass across
daw-lua-commoncomplete. Every file originallyflagged by
fragjan code .now buildsdaw_error/v1at its actualerror origin instead of returning plain strings.
Committed and pushed
error/init.lua,error/util.lua-- local, non-recursive bootstrapconstructors for the error core's own argument-validation failures
(two independent copies, deliberately not shared).
crypto/(hash, hmac, init),decimal/(init, util, arith,compare, convert),
fs/(init, dir, file, handle, query, temp),init.lua(root),uuid.lua,json/(init, encode, decode),yaml/(init, parse, dump),sys.lua,time.lua.docs/error.md,docs/crypto.md,docs/decimal.md,docs/fs.md,docs/common-uuid.md,docs/json.md,docs/yaml.md,docs/sys.md,docs/time.md), plus severaldocs/kb-draft-*.mdopen-research notes (explicitly marked unresearched, not invented
history).
Not committed (code)
base64.lua,config_parser.lua-- both already have i18n groundworkin progress (resource_id assignments) from a paused earlier session.
The daw_error/v1-sentinel fail() upgrade for both was prepared and
reviewed, but is deliberately held back uncommitted until the i18n
work resumes and finishes, to avoid two half-finished migrations
overlapping in the same files. Their reference docs
(
docs/base64.md,docs/config-parser.md) were committed, sincethose don't touch code.
Key decisions made along the way
DAW/daw-contracts#11: reserved sentinel iddaw-error-facility-unavailablefor the one case a componentcannot build a real daw_error/v1 (the error facility itself is
unavailable or its constructor crashed).
DAW/daw-docs#26: daw.common.error is mandatory runtime bootstrap,but this does NOT exempt it from the existing
pcall(require, ...)-everywhere rule -- an earlier attempt at an
unprotected require was corrected during the session.
error -> uuid -> fs.handle -> fs.dir -> sysdeferredrequire cycle (established 2026-08-06) was investigated, confirmed
still structurally necessary, and left completely untouched --
only the fallback value at that boundary changed, from a plain
string to the sentinel.
removing pcall() around daw_error.new() itself (assuming it never
throws) broke resilience against a crashing constructor, caught by
test_uuid.lua's explicit crash-simulation test. Fixed across all
22 affected files in the same session.
Verification
fragjan code .: 0 errors, 0 warnings, 16 explicitly documentedsuppressions.
make test: 503/503 on both Lua 5.1 and Lua 5.4.Closing. Follow-up work:
DAW/daw-lua-common#52(sys cycle openquestion), base64/config_parser code once i18n resumes.