Add resource_id to all daw_error/v1 sites in daw-lua-common (en + de) #48

Closed
opened 2026-08-13 21:53:26 +02:00 by michael · 2 comments
Owner

Goal

Add resource_id to all daw_error/v1 construction sites in
daw-lua-common (171 sites across 37 files), linking each to a
canonical English daw_i18n/v1 resource, with a German translation.

Background

The daw_error/v1 constructor (daw/common/error/init.lua) already
accepts an optional opts.resource_id (see DAW/daw-lua-common#46).
This issue is the follow-up: actually populating resource_id at
every site that constructs a daw_error/v1 object in this library, not
just having the capability to pass it through.

Blocked by

DAW/daw-lua-common#47 (decide daw_i18n/v1 resource file location for
daw-lua-common) -- resource_id values cannot be assigned to error
sites before the canonical English resource file's location and
shape are decided.

Scope

  • File by file, same order/pattern as the original daw_error/v1
    migration (base64.lua first as reference)
  • Each daw_error/v1 construction site gets a resource_id referencing
    a daw_i18n/v1 resource; message becomes that resource's canonical
    English text (see daw_error/v1 specification.md: message MUST be
    the canonical text if resource_id is present)
  • German (de) translation added per site, may lag behind English
    slightly but should be added in the same pass where practical
  • fragjan code . + make test (5.1 and 5.4) as gate after each file

Acceptance criteria

  • All 171 daw_error/v1 construction sites have a resource_id
  • Canonical English daw_i18n/v1 resource file complete (every
    resource_id used, every placeholder declared)
  • German daw_i18n/v1 resource file covers the same resource_ids
    (partial acceptable per contract, but aim for full coverage)
  • fragjan code . and make test pass after each file
  • No behavior change to error code/source/message semantics --
    this only adds resource_id + the canonical resource backing it

DAW/daw-lua-common#46 (resource_id constructor support)
DAW/daw-contracts daw_i18n/v1, daw_error/v1

## Goal Add resource_id to all daw_error/v1 construction sites in daw-lua-common (171 sites across 37 files), linking each to a canonical English daw_i18n/v1 resource, with a German translation. ## Background The daw_error/v1 constructor (daw/common/error/init.lua) already accepts an optional opts.resource_id (see DAW/daw-lua-common#46). This issue is the follow-up: actually populating resource_id at every site that constructs a daw_error/v1 object in this library, not just having the capability to pass it through. ## Blocked by DAW/daw-lua-common#47 (decide daw_i18n/v1 resource file location for daw-lua-common) -- resource_id values cannot be assigned to error sites before the canonical English resource file's location and shape are decided. ## Scope - File by file, same order/pattern as the original daw_error/v1 migration (base64.lua first as reference) - Each daw_error/v1 construction site gets a resource_id referencing a daw_i18n/v1 resource; message becomes that resource's canonical English text (see daw_error/v1 specification.md: message MUST be the canonical text if resource_id is present) - German (de) translation added per site, may lag behind English slightly but should be added in the same pass where practical - fragjan code . + make test (5.1 and 5.4) as gate after each file ## Acceptance criteria - [ ] All 171 daw_error/v1 construction sites have a resource_id - [ ] Canonical English daw_i18n/v1 resource file complete (every resource_id used, every placeholder declared) - [ ] German daw_i18n/v1 resource file covers the same resource_ids (partial acceptable per contract, but aim for full coverage) - [ ] fragjan code . and make test pass after each file - [ ] No behavior change to error code/source/message semantics -- this only adds resource_id + the canonical resource backing it ## Related DAW/daw-lua-common#46 (resource_id constructor support) DAW/daw-contracts daw_i18n/v1, daw_error/v1
Author
Owner

Migration rule: context on all new canonical error resources

Decided: every newly created canonical daw_i18n/v1 error resource in
this migration gets a context field -- not only resources that happen
to share identical text with another resource.

Rationale: context is cheap to write while the semantic origin is
still in front of us during migration, and retrofitting it later
would invalidate source_hash for everything already migrated anyway.
Setting it consistently now avoids a second pass.

## Migration rule: context on all new canonical error resources Decided: every newly created canonical daw_i18n/v1 error resource in this migration gets a context field -- not only resources that happen to share identical text with another resource. Rationale: context is cheap to write while the semantic origin is still in front of us during migration, and retrofitting it later would invalidate source_hash for everything already migrated anyway. Setting it consistently now avoids a second pass.
Author
Owner

Done. All 171+ daw_error/v1 construction sites across all 29 files in daw-lua-common now carry a resource_id, including bootstrap and daw-error-facility-unavailable sentinel paths (extended beyond the original scope per today's decision). Canonical en.json/de.json cover 238 resources, all source_hash values verified against the DAW/daw-contracts#6 algorithm. fragjan-clean, 503/503 tests passing on both Lua 5.1 and 5.4.

Spun off along the way: DAW/daw-lua-common#53 through #58 (structural fail() fallback gap, run_rc()/run() cause-vs-output audits, decimal.is_decimal() integrality, fs.query exists()/is_dir() error swallowing, sys close() exit status), DAW/daw-contracts#6/#7/#8 (source_hash algorithm, distinct-context recommendation, parameter-to-data mapping), DAW/daw-modul-berhtjan-core#13 (host text override, design open).

Done. All 171+ daw_error/v1 construction sites across all 29 files in daw-lua-common now carry a resource_id, including bootstrap and daw-error-facility-unavailable sentinel paths (extended beyond the original scope per today's decision). Canonical en.json/de.json cover 238 resources, all source_hash values verified against the DAW/daw-contracts#6 algorithm. fragjan-clean, 503/503 tests passing on both Lua 5.1 and 5.4. Spun off along the way: DAW/daw-lua-common#53 through #58 (structural fail() fallback gap, run_rc()/run() cause-vs-output audits, decimal.is_decimal() integrality, fs.query exists()/is_dir() error swallowing, sys close() exit status), DAW/daw-contracts#6/#7/#8 (source_hash algorithm, distinct-context recommendation, parameter-to-data mapping), DAW/daw-modul-berhtjan-core#13 (host text override, design open).
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/daw-lua-common#48
No description provided.