Replace M.PRIMITIVES with daw_field_type/v1 registry validation #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
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type/refactor
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-modul-berhtjan-core#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?
Goal
Remove
M.PRIMITIVES(the hardcoded field type list: text, textarea,number, boolean, select, date) from
types.luaand re-implementtypes.resolve()as pure registry validation against thedaw_field_type/v1contract proposed inDAW/daw-contracts#3.Background
Identified as a blocker during the 2.1
daw_error/v1migration(
feature/daw-error-v1-migrationbranch).M.PRIMITIVESembedsfield type vocabulary directly in program code -- exactly the
anti-pattern described in "Festgelegt heißt nicht einprogrammiert".
berhtjan-cliwas verified (prompt.lua, render.lua) to already befully field-type-name-agnostic today -- it treats every field as an
opaque, generically presented value and never branches on
field.typeor readsfield.primitive.types.lua's hardcoded listis therefore the only place in the current ecosystem that would
block a new field type (e.g. a hypothetical
LATTENZAUN) fromworking without a code change.
Scope
types.resolve(field_type, registry)validates purely againstregistry[field_type]and thedaw_field_type/v1structuralrules (required
value/acquisition,collectionrequirediff an acquisition entry has
kind=selection,resourcerequired iff an acquisition entry has
kind=resource) -- nobuilt-in primitive names anywhere in code
M.PRIMITIVESremoved fromtypes.luaM.is_primitive()/M.primitives()re-evaluated -- may nolonger make sense once "primitive" is a data property
(
value.kindwithout composition) rather than a fixed set Coreowns; re-check call sites before removing
composer.lua'sresolved.primitive = def.primitive/type_deffields re-evaluated against the new contract shape-- currently unread by
berhtjan-cli(verified), but checkother consumers before changing
daw_field_type/v1fixtures instead ofthe current hardcoded-primitive fixtures
daw_field_type/v1data (see open question below for where they are shipped from)
Depends on
DAW/daw-contracts#3 (daw_field_type/v1 contract) -- this issue should
not start implementation before that contract is settled enough that
its shape (
value/acquisition/collection/resourcekeys) is notexpected to change further.
Open question, not blocking contract work but blocking this issue's completion
Where do the six base primitives ship from at runtime once they are
data instead of code? Discussed, not decided:
berhtjan-coreships its owntypes.jsoncontribution, scannedlike any module's contribution
Acceptance test
Define a new field type (e.g.
LATTENZAUN, an atomic value with itsown domain,
senkrecht/waagerecht/kreuz) asdaw_field_type/v1data only. No commit to
daw-modul-berhtjan-coreordaw-modul-berhtjan-clirequired for it to work end to end.Refs: DAW/daw-contracts#3
Resolved (v2.1.0).
types.resolve() reduced to pure registry lookup -- M.PRIMITIVES,
is_primitive(), primitives() removed entirely. Field types are now
validated structurally against daw_field_type/v1 (DAW/daw-contracts#3)
once, at the boundary where they enter the system
(loader.parse_types()), not hardcoded anywhere in Core.
Acceptance test passed: a new field type (lattenzaun, with its own
value.kind = lattenzaun_orientation) resolves and composes correctly
as pure data, with no change to types.lua, composer.lua, or
daw-modul-berhtjan-cli.
Open follow-up, not blocking this issue: where the ecosystem's six
former primitives are shipped from at runtime (own contribution vs.
host-required vs. shared vocabulary module) -- still undecided,
tracked separately.