Follow-up: daw_error/v1 cell_id/resource_id update #46

Closed
opened 2026-08-12 20:29:28 +02:00 by michael · 1 comment
Owner

Goal

Track follow-up work in daw-lua-common resulting from the daw_error/v1
contract update in DAW/daw-contracts (source/cell_id clarification,
optional resource_id).

Background

daw_error/v1 was updated:

  • source is now explicitly documented as the cell's stable name/type,
    not a concrete instance identity (clarification of existing behavior,
    not a breaking change for daw-lua-common's current usage).
  • cell_id (optional) added: concrete producing cell instance.
  • resource_id (optional) added: links to a daw_i18n/v1 resource for
    localized presentation. If present, message must be that resource's
    canonical English text.

Questions to resolve here

  • Does daw.common.error.new() (or equivalent constructor) need an
    optional cell_id / resource_id parameter, or is this left to
    callers building the table directly?
  • daw-lua-common has no cell identity/lifecycle concept yet -- do not
    invent one here; only decide whether the constructor should be able
    to pass cell_id through if a caller already has one.

Acceptance criteria

  • Decision made and documented: constructor API change or no change
  • If changed: implemented, tests updated
  • No behavior change for existing callers that don't use the new
    optional fields

References

  • DAW/daw-contracts daw_error/v1 (contract.json, specification.md,
    CHANGELOG.md)
## Goal Track follow-up work in daw-lua-common resulting from the daw_error/v1 contract update in DAW/daw-contracts (source/cell_id clarification, optional resource_id). ## Background daw_error/v1 was updated: - `source` is now explicitly documented as the cell's stable name/type, not a concrete instance identity (clarification of existing behavior, not a breaking change for daw-lua-common's current usage). - `cell_id` (optional) added: concrete producing cell instance. - `resource_id` (optional) added: links to a daw_i18n/v1 resource for localized presentation. If present, `message` must be that resource's canonical English text. ## Questions to resolve here - Does `daw.common.error.new()` (or equivalent constructor) need an optional `cell_id` / `resource_id` parameter, or is this left to callers building the table directly? - daw-lua-common has no cell identity/lifecycle concept yet -- do not invent one here; only decide whether the constructor should be able to pass `cell_id` through if a caller already has one. ## Acceptance criteria - [ ] Decision made and documented: constructor API change or no change - [ ] If changed: implemented, tests updated - [ ] No behavior change for existing callers that don't use the new optional fields ## References - DAW/daw-contracts daw_error/v1 (contract.json, specification.md, CHANGELOG.md)
Author
Owner

Session 2026-08-13

  • [OK] opts.cell_id and opts.resource_id added to daw.common.error.new()
    (init.lua), both validated as non-empty strings when present
  • [OK] util.lua validate_and_copy_error() extended to carry cell_id/
    resource_id through when an error is embedded as cause -- without
    this they would have been silently dropped on nested errors
  • [OK] no behavior change for existing callers, both fields purely
    additive
  • [OK] fragjan code . -- 41 files, 893 checks, all clear
  • [OK] make test -- 503/503 tests passed on both Lua 5.4 and Lua 5.1
  • Decision: constructor API change (not left to callers building the
    table directly)
  • Follow-up split into two new issues: #47 (decide daw_i18n/v1
    resource file location for daw-lua-common) and #48 (add resource_id
    to all 171 daw_error/v1 sites, blocked by #47)
## Session 2026-08-13 - [OK] opts.cell_id and opts.resource_id added to daw.common.error.new() (init.lua), both validated as non-empty strings when present - [OK] util.lua validate_and_copy_error() extended to carry cell_id/ resource_id through when an error is embedded as cause -- without this they would have been silently dropped on nested errors - [OK] no behavior change for existing callers, both fields purely additive - [OK] fragjan code . -- 41 files, 893 checks, all clear - [OK] make test -- 503/503 tests passed on both Lua 5.4 and Lua 5.1 - Decision: constructor API change (not left to callers building the table directly) - Follow-up split into two new issues: #47 (decide daw_i18n/v1 resource file location for daw-lua-common) and #48 (add resource_id to all 171 daw_error/v1 sites, blocked by #47)
michael 2026-08-13 21:59:50 +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/daw-lua-common#46
No description provided.