Clean up adapters/ui _contracts terminology (bool_or_err/value_or_err/result_or_err) #133
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/architecture
type
bug
type
config
type
deployment
type
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
type/task
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/fragjan#133
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?
Goal
Clean up the inconsistent
_contracts/return-shape terminologybetween
adapters/uiand the UI provider modules it dispatches to(e.g.
daw-modul-berhtjan-core), starting here ("von unten nachoben" -- fix the adapter/tooling layer first, then the modules).
Background
Found while reviewing
adapters/ui/init.luaandadapters/ui/renderers.luaduring thedaw-modul-berhtjan-core2.1migration:
adapters/ui/init.lua's ownM._contractsdeclarescheck = "bool_or_err",required_ops = "list",dispatch = "result_or_err",build_usage = "result_or_err",render = "bool_or_err".daw-modul-berhtjan-core'sM._contracts(documenting thecontract UI provider modules like
daw-modul-berhtjan-climustimplement) uses different terms for comparable shapes:
dispatch = "bool_or_err",build_usage = "value_or_err",render = "bool_or_err".adapters/ui/init.lua'sM.check(mod)does not actually readmod._contractsat all -- it only checks thattype(mod[op]) == "function"for each op inrequired_ops(). The_contractstable is therefore currently pure documentation, notan enforced contract, on both sides.
dispatch()'s actual behavior doesn't cleanly match either"bool_or_err"label: a provider'sdispatch()returnsok, resultwhereresultcan be a number (exit code) on success,not just
nil.Scope
function return shapes (bool/value/result_or_err, or something
else) and document it once
adapters/ui/init.lua's_contractsanddaw-modul-berhtjan-core's_contractsto use the same termsfor the same shapes
M.check()actually validate against_contracts,or remove/relabel
_contractsas documentation-only ifenforcement isn't intended
dispatch()shape description with its actualbehavior (result can be a number on success)
Acceptance criteria
_contractsterminology consistent betweenadapters/uiandat least
daw-modul-berhtjan-core_contractsis enforced orpurely descriptive
dispatch()'s documented shape matches its actual returnbehavior
Affected repositories
fragjan(adapters/ui/init.lua,adapters/ui/renderers.lua)daw-modul-berhtjan-core(init.lua'sM._contracts)Order: fragjan/adapter layer first, then modules, per prior team
decision ("von unten nach oben").