Reserve fundamental daw_error/v1 id for unavailable error facility #11
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/design
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-contracts#11
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 runtime code protects
require()calls withpcall(require, ...)so that a component below
main.luanever terminates the host processthrough an unhandled Lua loading error.
This creates one fundamental edge case:
If loading
daw.common.erroritself fails, the raw Lua failure issuccessfully caught, but the component cannot use
daw_error.new()torepresent that failure as
daw_error/v1because the error facility isthe dependency that is unavailable.
Copying the full error constructor/bootstrap implementation into every
component is not acceptable.
Decision to specify
Reserve one special
daw_error/v1.idsentinel exclusively for failureto establish/access the DAW error facility itself.
Proposed sentinel:
This is intentionally not a UUID. Its non-UUID form makes the
fundamental infrastructure state recognizable and avoids requiring any
ID-generation dependency when the error facility itself is unavailable.
A component that catches failure of:
may construct the minimal
daw_error/v1representation directly, forexample:
The normal process-ownership rule remains unchanged: the component
returns
nil, err; onlymain.luadecides whether the host processterminates.
Scope restriction
The sentinel MUST be reserved for this exact fundamental condition:
the DAW error facility itself cannot be established or accessed.
It MUST NOT be used for:
daw.common.error;All normal errors continue to use ordinary
daw_error/v1identityrules.
Rationale
In a correctly bootstrapped host, normal components should never need
this path because
main.luaestablishesdaw.common.errorbeforenormal runtime work begins.
The sentinel is therefore a last-resort contract-preserving fallback,
not a normal runtime mechanism.
It allows all of the following rules to remain true simultaneously:
require()remains guarded withpcall;main.luaterminates the process;daw_error/v1form;Acceptance criteria
daw_error/v1defines the reserved sentinel iddaw-error-facility-unavailable.error facility itself.
daw_error/v1identities remain UUIDs.nil, err; process termination remainsowned by
main.lua.a correctly bootstrapped normal runtime.
Related
DAW/daw-docs#23DAW/daw-docs#26DAW/daw-lua-common#50